From 2b6e02252fced536c5280ff3b7bb91efc5c2e399 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Sun, 10 Jul 2022 18:39:19 +0100 Subject: [PATCH 01/16] Initial PARAMS_GET macros --- include/z64actor.h | 12 ++ src/code/z_en_a_keep.c | 2 +- src/code/z_en_item00.c | 4 +- src/code/z_play.c | 4 +- src/code/z_room.c | 2 +- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 2 +- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 38 +++--- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h | 2 +- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.c | 6 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 10 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 8 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 30 ++-- .../ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c | 2 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 18 +-- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 2 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 2 +- .../ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c | 2 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c | 4 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 2 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 2 +- .../actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c | 2 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 20 +-- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 4 +- .../ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c | 2 +- .../ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c | 2 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 40 +++--- .../ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c | 4 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 22 +-- .../z_bg_hidan_kowarerukabe.c | 24 ++-- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 4 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 20 +-- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c | 4 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 6 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 4 +- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.c | 2 +- .../z_bg_jya_bombchuiwa.c | 2 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 8 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 34 ++--- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c | 8 +- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 4 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 4 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 4 +- .../z_bg_menkuri_nisekabe.c | 2 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 20 +-- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 10 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h | 6 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 4 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 8 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 8 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 2 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 8 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 4 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 4 +- .../ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c | 2 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 4 +- .../z_bg_spot01_objects2.c | 10 +- .../z_bg_spot02_objects.c | 4 +- .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c | 2 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 2 +- .../z_bg_spot06_objects.c | 4 +- .../z_bg_spot08_bakudankabe.c | 4 +- .../z_bg_spot08_iceblock.c | 20 +-- .../z_bg_spot11_bakudankabe.c | 4 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 4 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 4 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- .../z_bg_spot16_bombstone.c | 4 +- .../z_bg_spot17_bakudankabe.c | 4 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 8 +- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 22 +-- .../z_bg_spot18_shutter.c | 8 +- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 4 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c | 4 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 6 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 4 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 8 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 2 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 14 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 12 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 12 +- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 6 +- .../actors/ovl_Door_Killer/z_door_killer.c | 14 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 22 +-- .../actors/ovl_Door_Warp1/z_door_warp1.c | 2 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 30 ++-- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 16 +-- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 2 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 6 +- src/overlays/actors/ovl_En_Box/z_en_box.c | 22 +-- src/overlays/actors/ovl_En_Brob/z_en_brob.c | 6 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 8 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 10 +- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 2 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 40 +++--- .../z_en_daiku_kakariko.c | 20 +-- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 20 +-- src/overlays/actors/ovl_En_Door/z_en_door.c | 16 +-- .../actors/ovl_En_Encount1/z_en_encount1.c | 6 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 4 +- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 4 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 20 +-- .../actors/ovl_En_Firefly/z_en_firefly.c | 2 +- .../actors/ovl_En_Floormas/z_en_floormas.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 8 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 8 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 12 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 78 +++++------ src/overlays/actors/ovl_En_Go2/z_en_go2.c | 128 +++++++++--------- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 46 +++---- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 6 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 4 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 6 +- .../actors/ovl_En_Heishi4/z_en_heishi4.c | 6 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 20 +-- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 2 +- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 4 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 86 ++++++------ src/overlays/actors/ovl_En_Ik/z_en_ik.c | 6 +- .../actors/ovl_En_Insect/z_en_insect.c | 20 +-- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 28 ++-- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 4 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 2 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 4 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 16 +-- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 8 +- src/overlays/actors/ovl_En_Light/z_en_light.c | 18 +-- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 12 +- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 2 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 8 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 2 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 8 +- .../actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 2 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 6 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 2 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 12 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 2 +- .../actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 6 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.h | 2 +- .../ovl_En_River_Sound/z_en_river_sound.c | 4 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 8 +- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 8 +- src/overlays/actors/ovl_En_Si/z_en_si.c | 2 +- .../actors/ovl_En_Siofuki/z_en_siofuki.c | 28 ++-- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 2 +- .../actors/ovl_En_Stream/z_en_stream.c | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 46 +++---- src/overlays/actors/ovl_En_Trap/z_en_trap.c | 2 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 4 +- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.c | 2 +- .../actors/ovl_En_Viewer/z_en_viewer.c | 18 +-- src/overlays/actors/ovl_En_Vm/z_en_vm.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 4 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 2 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 6 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.c | 6 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 6 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 2 +- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 4 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 12 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 6 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 8 +- .../actors/ovl_Item_Inbox/z_item_inbox.c | 4 +- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 6 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 14 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 4 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 6 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 6 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 6 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 4 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 8 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 14 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 4 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 20 +-- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 34 ++--- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 2 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 16 +-- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 8 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 20 +-- .../actors/ovl_Obj_Mure3/z_obj_mure3.c | 10 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 26 ++-- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 14 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 82 +++++------ .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 18 +-- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 42 +++--- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 12 +- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 38 +++--- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 8 +- .../actors/ovl_player_actor/z_player.c | 16 +-- 196 files changed, 1073 insertions(+), 1065 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index 572ab9054a6..71b42328516 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -507,4 +507,16 @@ typedef enum { #define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples #define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check? +#define PARAMS_GET(p, s, m) \ + (((p) >> (s)) & (m)) + +#define PARAMS_GET2(p, s, m) \ + (((p) & (m)) >> (s)) + +#define PARAMS_GET_NOMASK(p, s) \ + ((p) >> (s)) + +#define PARAMS_GET_NOSHIFT(p, s, m) \ + ((p) & ((m) << (s))) + #endif diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 190619c12fa..66d3db6576c 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -81,7 +81,7 @@ void EnAObj_Init(Actor* thisx, PlayState* play) { EnAObj* this = (EnAObj*)thisx; f32 shadowScale = 6.0f; - this->textId = (thisx->params >> 8) & 0xFF; + this->textId = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; switch (thisx->params) { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index e4d09def76b..3092d11e6b4 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -142,10 +142,10 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { f32 yOffset = 980.0f; f32 shadowScale = 6.0f; s32 getItemId = GI_NONE; - s16 spawnParam8000 = this->actor.params & 0x8000; + s16 spawnParam8000 = PARAMS_GET2(this->actor.params, 0, 0x8000); s32 pad1; - this->collectibleFlag = (this->actor.params & 0x3F00) >> 8; + this->collectibleFlag = PARAMS_GET2(this->actor.params, 8, 0x3F00); this->actor.params &= 0xFF; diff --git a/src/code/z_play.c b/src/code/z_play.c index 2905e4ba03e..5e9b5e071bb 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -410,7 +410,7 @@ void Play_Init(GameState* thisx) { Camera_InitPlayerSettings(&this->mainCamera, player); Camera_ChangeMode(&this->mainCamera, CAM_MODE_NORMAL); - playerStartBgCamIndex = player->actor.params & 0xFF; + playerStartBgCamIndex = PARAMS_GET(player->actor.params, 0, 0xFF); if (playerStartBgCamIndex != 0xFF) { osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); Camera_ChangeBgCamIndex(&this->mainCamera, playerStartBgCamIndex); @@ -1749,7 +1749,7 @@ s32 func_800C0D34(PlayState* this, Actor* actor, s16* yaw) { return 0; } - transitionActor = &this->transiActorCtx.list[(u16)actor->params >> 10]; + transitionActor = &this->transiActorCtx.list[PARAMS_GET_NOMASK((u16)actor->params, 10)]; frontRoom = transitionActor->sides[0].room; if (frontRoom == transitionActor->sides[1].room) { diff --git a/src/code/z_room.c b/src/code/z_room.c index c43450f624d..93f9264204a 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -374,7 +374,7 @@ BgImage* func_80096A74(MeshHeader1Multi* meshHeader1Multi, PlayState* play) { } player = GET_PLAYER(play); - player->actor.params = (player->actor.params & 0xFF00) | bgCamIndex; + player->actor.params = PARAMS_GET(player->actor.params, 0, 0xFF00) | bgCamIndex; bgImage = SEGMENTED_TO_VIRTUAL(meshHeader1Multi->list); for (i = 0; i < meshHeader1Multi->count; i++) { diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 471cf5fbfeb..054a185acd6 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -111,7 +111,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - this->switchFlag = (thisx->params >> 8) & 0x3F; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0x3F); thisx->params &= 0xFF; if (thisx->params == 2) { thisx->flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index e5aed1b8feb..53de16e9e68 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -116,7 +116,7 @@ void func_8086D0EC(BgBdanSwitch* this) { this->unk_1CC += 0xFA0; } - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -139,7 +139,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { s16 type; s32 flag; - type = this->dyna.actor.params & 0xFF; + type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { this->dyna.actor.scale.z = 0.05f; @@ -165,7 +165,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { break; } - flag = Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + flag = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); switch (type) { case BLUE: @@ -203,7 +203,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -220,9 +220,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { s32 pad; s32 type; - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { - type = this->dyna.actor.params & 0xFF; - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); if (type == BLUE || type == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } else { @@ -232,9 +232,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { } void func_8086D548(BgBdanSwitch* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); - if ((this->dyna.actor.params & 0xFF) == YELLOW_TALL_2) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -246,7 +246,7 @@ void func_8086D5C4(BgBdanSwitch* this) { } void func_8086D5E0(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case BLUE: if (func_800435B4(&this->dyna)) { func_8086D67C(this); @@ -285,7 +285,7 @@ void func_8086D730(BgBdanSwitch* this) { } void func_8086D754(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case BLUE: if (!func_800435B4(&this->dyna)) { if (this->unk_1D8 <= 0) { @@ -297,7 +297,7 @@ void func_8086D754(BgBdanSwitch* this, PlayState* play) { } break; case YELLOW: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { func_8086D7FC(this); } break; @@ -407,7 +407,7 @@ void func_8086DB4C(BgBdanSwitch* this) { } void func_8086DB68(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { default: return; case YELLOW_TALL_1: @@ -448,9 +448,9 @@ void func_8086DCCC(BgBdanSwitch* this) { } void func_8086DCE8(BgBdanSwitch* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case YELLOW_TALL_1: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { func_8086DDA8(this); } break; @@ -470,7 +470,7 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, PlayState* play) { - if ((((this->dyna.actor.params & 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || + if (((PARAMS_GET(this->dyna.actor.params, 0, 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; if (this->unk_1C8 >= 2.0f) { @@ -490,7 +490,7 @@ void BgBdanSwitch_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); func_8086D0EC(this); - type = this->dyna.actor.params & 0xFF; + type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); if (type != 3 && type != 4) { this->unk_1D8--; } else { @@ -516,7 +516,7 @@ void func_8086DF58(BgBdanSwitch* this, PlayState* play, Gfx* dlist) { void BgBdanSwitch_Draw(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case YELLOW_HEAVY: case YELLOW: func_8086DF58(this, play, gJabuYellowFloorSwitchDL); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index cc0d7ccebc3..bbc4e15367b 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "global.h" -// BgBdanSwitch.actor.params & 0xFF +// PARAMS_GET(BgBdanSwitch.actor.params, 0, 0xFF) typedef enum { /* 0x00 */ BLUE, /* 0x01 */ YELLOW_HEAVY, diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 22404a818ee..c96e07f7633 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -122,7 +122,7 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, 0.1f); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_8086EE94(this, play); } else { BgBombwall_InitDynapoly(this, play); @@ -213,7 +213,7 @@ void func_8086ED70(BgBombwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, play); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -232,7 +232,7 @@ void func_8086EE40(BgBombwall* this, PlayState* play) { } else { func_8086EE94(this, play); - if (((this->dyna.actor.params >> 0xF) & 1) != 0) { + if (PARAMS_GET(this->dyna.actor.params, 0xF, 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } } diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 6e34546e270..32ebc15cfb8 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -79,7 +79,7 @@ void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc void BgBreakwall_Init(Actor* thisx, PlayState* play) { BgBreakwall* this = (BgBreakwall*)thisx; s32 pad; - s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; + s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 3); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); @@ -91,7 +91,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { } if (this->bombableWallDList != NULL) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); return; } @@ -203,7 +203,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { CollisionHeader* colHeader = NULL; - s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; + s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 3); this->dyna.actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(play, &this->dyna.actor); @@ -227,7 +227,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { Vec3f effectPos; - s32 wallType = ((this->dyna.actor.params >> 13) & 3) & 0xFF; + s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 3); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); effectPos.y = effectPos.z = effectPos.x = 0.0f; @@ -240,7 +240,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { } BgBreakwall_SpawnFragments(play, this, &effectPos, 0.0f, 6.4f, 5.0f, 1, 2.0f); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); if (wallType == BWALL_KD_FLOOR) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION); diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 043d4dd68f5..0239a889f4a 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -118,7 +118,7 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { BgDodoago_SetupAction(this, BgDodoago_DoNothing); this->dyna.actor.shape.rot.x = 0x1333; play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] = play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] = 255; @@ -156,7 +156,7 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { if (((play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] == 255) && (this->state == BGDODOAGO_EYE_RIGHT)) || ((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); this->state = 0; Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -296,9 +296,9 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) { } } else { sTimer++; - Flags_GetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); if (!sDisableBombCatcher && sTimer > 140) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { // this prevents clearing the actor's parent pointer, effectively disabling the bomb catcher sDisableBombCatcher++; } else { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index ee3c834fbba..aec519a2774 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -52,7 +52,7 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->updateFunc = BgGndDarkmeiro_Noop; Actor_SetScale(&this->dyna.actor, 0.1f); - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case DARKMEIRO_INVISIBLE_PATH: this->dyna.actor.draw = BgGndDarkmeiro_DrawInvisiblePath; this->dyna.actor.flags |= ACTOR_FLAG_7; @@ -60,14 +60,14 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { case DARKMEIRO_CLEAR_BLOCK: CollisionHeader_GetVirtual(&gClearBlockCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (((this->dyna.actor.params >> 8) & 0x3F) == 0x3F) { + if (PARAMS_GET(this->dyna.actor.params, 8, 0x3F) == 0x3F) { this->updateFunc = BgGndDarkmeiro_UpdateStaticBlock; this->dyna.actor.draw = BgGndDarkmeiro_DrawStaticBlock; } else { this->actionFlags = this->timer1 = this->timer2 = 0; thisx->draw = BgGndDarkmeiro_DrawSwitchBlock; this->updateFunc = BgGndDarkmeiro_UpdateSwitchBlock; - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); } else { this->timer1 = 64; @@ -79,18 +79,18 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->actionFlags = this->timer1 = this->timer2 = 0; this->updateFunc = BgGndDarkmeiro_UpdateBlockTimer; thisx->draw = NULL; - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 1)) { this->timer1 = 64; this->actionFlags |= 4; } - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 2)) { this->timer2 = 64; this->actionFlags |= 8; } if ((this->timer1 != 0) || (this->timer2 != 0)) { - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); } else { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); } break; } @@ -100,7 +100,7 @@ void BgGndDarkmeiro_Destroy(Actor* thisx, PlayState* play2) { PlayState* play = play2; BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx; - if ((this->dyna.actor.params & 0xFF) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 1) { if (1) {} DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } @@ -112,12 +112,12 @@ void BgGndDarkmeiro_Noop(BgGndDarkmeiro* this, PlayState* play) { void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { s16 timeLeft; - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 1)) { if (this->actionFlags & 4) { if (this->timer1 > 0) { this->timer1--; } else { - Flags_UnsetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 1); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 1); this->actionFlags &= ~4; } } else { @@ -128,12 +128,12 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } } - if (Flags_GetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 2)) { if (this->actionFlags & 8) { if (this->timer2 > 0) { this->timer2--; } else { - Flags_UnsetSwitch(play, ((this->dyna.actor.params >> 8) & 0x3F) + 2); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 2); this->actionFlags &= ~8; } } else { @@ -149,9 +149,9 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { func_8002F994(&this->dyna.actor, timeLeft); } if ((this->timer1 >= 64) || (this->timer2 >= 64)) { - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); } else { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); } } @@ -163,7 +163,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, PlayState* play) { this->timer1--; } - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { this->timer1 = 64; } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index 0e910ebccab..40b6bdc462f 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -53,7 +53,7 @@ void BgGndNisekabe_Draw(Actor* thisx, PlayState* play) { gGanonsCastleScrubsFakeWallDL, }; BgGndNisekabe* this = (BgGndNisekabe*)thisx; - u32 index = this->actor.params & 0xFF; + u32 index = PARAMS_GET(this->actor.params, 0, 0xFF); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_7)) { Gfx_DrawDListXlu(play, dLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index ea30922849e..7f84a155c3f 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -65,12 +65,12 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actionFunc = NULL; - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET(this->actor.params, 0, 0xFF)) { case 0: Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actionFunc = func_8087B284; - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9); @@ -83,7 +83,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { break; case 1: case 2: - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -96,7 +96,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { void BgGndSoulmeiro_Destroy(Actor* thisx, PlayState* play) { BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx; - if ((this->actor.params & 0xFF) == 0) { + if (PARAMS_GET(this->actor.params, 0, 0xFF) == 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -112,13 +112,13 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { } if (this->unk_198 == 20) { - Flags_SetSwitch(play, (thisx->params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F)); thisx->draw = NULL; } // This should be this->unk_198 == 0, this is required to match if (!this->unk_198) { - Flags_SetSwitch(play, (thisx->params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F)); Actor_Kill(&this->actor); Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0, 0, 0, 9); @@ -159,7 +159,7 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { s32 pad; - if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { this->actor.draw = BgGndSoulmeiro_Draw; if (this->collider.base.acFlags & AC_HIT) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -174,7 +174,7 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { } void func_8087B350(BgGndSoulmeiro* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -195,7 +195,7 @@ void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play) { gSpiritTrialLightSourceDL, gSpiritTrialLightFloorDL, }; - s32 params = thisx->params & 0xFF; + s32 params = PARAMS_GET(thisx->params, 0, 0xFF); if (1) {} diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index d390f5f3b25..ef93bb54553 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -74,7 +74,7 @@ void BgHakaGate_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, DPM_UNK); if (thisx->params == BGHAKAGATE_SKULL) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 3408efe8ff9..5dad5b6ad78 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -48,7 +48,7 @@ void BgHakaHuta_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); CollisionHeader_GetVirtual(&gBotwCoffinLidCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - this->unk_16A = (thisx->params >> 8) & 0xFF; + this->unk_16A = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (Flags_GetSwitch(play, thisx->params)) { this->counter = -1; diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 3942b8adbfd..4177c8a6d36 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -59,7 +59,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->unk_168 = (thisx->params >> 8) & 0xFF; + this->unk_168 = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (thisx->params == 2) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 019662dd48e..414abfee08e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -138,8 +138,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->unk_151 = thisx->params & 0xFF; - thisx->params = (thisx->params >> 8) & 0xFF; + this->unk_151 = PARAMS_GET(thisx->params, 0, 0xFF); + thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); if (this->unk_151 != 0) { thisx->flags |= ACTOR_FLAG_7; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 6df4947f3b2..998e98f6ea3 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -44,7 +44,7 @@ void BgHakaShip_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 4e7ea78857e..133f900f1da 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -197,7 +197,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); } else { // Drops a small key and sets a collect flag - collectibleParams = ((this->dyna.actor.params & 0x3F) << 8) | ITEM00_SMALL_KEY; + collectibleParams = (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) << 8) | ITEM00_SMALL_KEY; func_80078884(NA_SE_SY_CORRECT_CHIME); } if (collectibleParams != -1) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 3b64228ef8b..57ca7b4353e 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -77,7 +77,7 @@ void BgHakaZou_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (thisx->params == STA_UNKNOWN) { diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 4e0649851ba..6f806998be4 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -93,7 +93,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { thisx->params |= 4; } - switch (thisx->params & 0xFF) { + switch (PARAMS_GET(thisx->params, 0, 0xFF)) { case HEAVYBLOCK_BIG_PIECE: thisx->draw = BgHeavyBlock_DrawPiece; this->actionFunc = BgHeavyBlock_MovePiece; @@ -113,7 +113,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { Actor_Kill(thisx); return; } @@ -123,7 +123,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { this->actionFunc = BgHeavyBlock_DoNothing; thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0; thisx->shape.rot.y = thisx->world.rot.y = 0xC000; @@ -150,7 +150,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { void BgHeavyBlock_Destroy(Actor* thisx, PlayState* play) { BgHeavyBlock* this = (BgHeavyBlock*)thisx; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case HEAVYBLOCK_BIG_PIECE: break; case HEAVYBLOCK_SMALL_PIECE: @@ -319,7 +319,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { if (Actor_HasParent(&this->dyna.actor, play)) { this->timer = 0; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case HEAVYBLOCK_BREAKABLE: OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, CAM_ID_MAIN); break; @@ -392,10 +392,10 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { if (this->dyna.actor.home.pos.y <= raycastResult) { func_800AA000(0.0f, 0xFF, 0x3C, 4); - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SpawnPieces(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); Actor_Kill(&this->dyna.actor); quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); @@ -419,7 +419,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Quake_SetCountdown(quakeIndex, 40); this->actionFunc = BgHeavyBlock_Land; - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); break; case HEAVYBLOCK_UNBREAKABLE: Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); @@ -456,7 +456,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) { this->dyna.actor.world.pos = this->dyna.actor.home.pos; Actor_MoveForward(&this->dyna.actor); this->dyna.actor.home.pos = this->dyna.actor.world.pos; - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SpawnDust(play, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f, Rand_CenteredFloat(30.0f) + 552.0f, 0.0f, 0.0f, 0.0f, 0); @@ -510,7 +510,7 @@ void BgHeavyBlock_Draw(Actor* thisx, PlayState* play) { } void BgHeavyBlock_DrawPiece(Actor* thisx, PlayState* play) { - switch (thisx->params & 0xFF) { + switch (PARAMS_GET(thisx->params, 0, 0xFF)) { case HEAVYBLOCK_BIG_PIECE: Matrix_Translate(50.0f, -260.0f, -20.0f, MTXMODE_APPLY); Gfx_DrawDListOpa(play, gHeavyBlockBigPieceDL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 6815631d60d..b90a8f2f0e7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -72,7 +72,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { osSyncPrintf("Curtain (arg_data 0x%04x)\n", this->actor.params); Actor_SetFocus(&this->actor, 20.0f); - this->type = (thisx->params >> 0xC) & 0xF; + this->type = PARAMS_GET(thisx->params, 0xC, 0xF); if (this->type > 6) { // "Type is not set" osSyncPrintf("Error : object のタイプが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", @@ -83,7 +83,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { this->size = ((this->type == 2) || (this->type == 4)) ? 1 : 0; hcParams = &sHCParams[this->size]; - this->treasureFlag = (thisx->params >> 6) & 0x3F; + this->treasureFlag = PARAMS_GET(thisx->params, 6, 0x3F); thisx->params &= 0x3F; if ((this->actor.params < 0) || (this->actor.params > 0x3F)) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 3b823951921..c6b6aa0122a 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -106,7 +106,7 @@ void BgHidanDalm_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c index 7e5c9cb5d99..b5fed4cf739 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c @@ -76,7 +76,7 @@ void BgHidanFwbig_Init(Actor* thisx, PlayState* play2) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actor.colChkInfo.mass = MASS_IMMOVABLE; - this->direction = (u16)(thisx->params >> 8); + this->direction = (u16)PARAMS_GET_NOMASK(thisx->params, 8); thisx->params &= 0xFF; if (this->direction != 0) { this->actor.home.pos.x = 1560.0f; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 36e7c643b29..a11dcc05654 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -112,7 +112,7 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, PlayState* play2) { pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; params = (i + 1) & 0xFF; - params |= (this->dyna.actor.params & 0xFF00); + params |= PARAMS_GET(this->dyna.actor.params, 0, 0xFF00); step = (BgHidanHamstep*)Actor_SpawnAsChild(&play->actorCtx, &step->dyna.actor, play, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, this->dyna.actor.world.rot.x, @@ -137,7 +137,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderItems); @@ -151,7 +151,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { } } - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { CollisionHeader_GetVirtual(&gFireTempleStoneStep1Col, &colHeader); } else { CollisionHeader_GetVirtual(&gFireTempleStoneStep2Col, &colHeader); @@ -159,16 +159,16 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF)) { - if ((this->dyna.actor.params & 0xFF) == 0) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0xFF))) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f); BgHidanHamstep_SetupAction(this, 4); } else { this->dyna.actor.world.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } - } else if ((this->dyna.actor.params & 0xFF) == 0) { + } else if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { BgHidanHamstep_SetupAction(this, 0); } else { BgHidanHamstep_SetupAction(this, 2); @@ -177,7 +177,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.actor.gravity = -1.2f; this->dyna.actor.minVelocityY = -12.0f; - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { // "Fire Temple Object [Hammer Step] appears" osSyncPrintf("◯◯◯炎の神殿オブジェクト【ハンマーステップ】出現\n"); if (BgHidanHamstep_SpawnChildren(this, play) == 0) { @@ -200,7 +200,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { Collider_DestroyTris(play, &this->collider); } } @@ -231,7 +231,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { - if ((child->dyna.actor.params & 0xFF) != 0) { + if (PARAMS_GET(child->dyna.actor.params, 0, 0xFF) != 0) { func_808884C8(child, play); } child = (BgHidanHamstep*)child->dyna.actor.child; @@ -241,7 +241,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { BgHidanHamstep* child; - if ((this->dyna.actor.params & 0xFF) >= 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) >= 2) { if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y; } else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) { @@ -266,7 +266,7 @@ void func_80888734(BgHidanHamstep* this) { if (parent != NULL) { this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y; - if ((this->dyna.actor.params & 0xFF) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 1) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } else { this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * frameDivisor); @@ -282,7 +282,7 @@ void func_808887C4(BgHidanHamstep* this, PlayState* play) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); this->collider.base.acFlags = AC_NONE; BgHidanHamstep_SetupAction(this, 1); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0xFF)); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -328,9 +328,9 @@ void func_808889B8(BgHidanHamstep* this, PlayState* play) { func_80888734(this); if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) { - if ((this->dyna.actor.params & 0xFF) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 1) { this->dyna.actor.world.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } else { BgHidanHamstep_SetupAction(this, 3); @@ -346,20 +346,20 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Actor_MoveForward(&this->dyna.actor); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); - if (((this->dyna.actor.params & 0xFF) <= 0) || ((this->dyna.actor.params & 0xFF) >= 6)) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) <= 0 || PARAMS_GET(this->dyna.actor.params, 0, 0xFF) >= 6) { // "[Hammer Step] arg_data strange (arg_data = %d)" osSyncPrintf("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); osSyncPrintf("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1]) && + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1]) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { this->dyna.actor.world.pos.y = - sYPosOffsets[(this->dyna.actor.params & 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 3); } else { this->dyna.actor.velocity.y *= -0.24f; @@ -376,7 +376,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { func_800AA000(10000.0f, 255, 20, 150); func_808884C8(this, play); - if ((this->dyna.actor.params & 0xFF) == 5) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 5) { func_80078884(NA_SE_SY_CORRECT_CHIME); } @@ -403,7 +403,7 @@ void BgHidanHamstep_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_hidan_hamstep.c", 787), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if ((thisx->params & 0xFF) == 0) { + if (PARAMS_GET(thisx->params, 0, 0xFF) == 0) { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep1DL); } else { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep2DL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index 693362ca765..d5127a0df24 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -84,8 +84,8 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { CollisionHeader* collisionHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->unk_16A = thisx->params & 0x3F; - thisx->params = (thisx->params >> 8) & 0xFF; + this->unk_16A = PARAMS_GET(thisx->params, 0, 0x3F); + thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); DynaPolyActor_Init(&this->dyna, DPM_UNK); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 89b616a7e7a..310c756702e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -69,18 +69,18 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_UNK); Actor_SetFocus(thisx, 50.0f); - osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, thisx->params & 0xFF, - ((s32)thisx->params >> 8) & 0xFF); + osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, PARAMS_GET(thisx->params, 0, 0xFF), + PARAMS_GET((s32)thisx->params, 8, 0xFF)); Actor_ProcessInitChain(thisx, sInitChain); - if (((thisx->params & 0xFF) < 0) || ((thisx->params & 0xFF) >= 3)) { + if (PARAMS_GET(thisx->params, 0, 0xFF) < 0 || PARAMS_GET(thisx->params, 0, 0xFF) >= 3) { osSyncPrintf("arg_data おかしい 【格子】\n"); } - CollisionHeader_GetVirtual(sMetalFencesCollisions[thisx->params & 0xFF], &colHeader); + CollisionHeader_GetVirtual(sMetalFencesCollisions[PARAMS_GET(thisx->params, 0, 0xFF)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - thisx->world.rot.y = D_80889E7C[this->dyna.actor.params & 0xFF] + thisx->shape.rot.y; - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0xFF)) { + thisx->world.rot.y = D_80889E7C[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] + thisx->shape.rot.y; + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0xFF))) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); } else { @@ -96,15 +96,15 @@ void BgHidanKousi_Destroy(Actor* thisx, PlayState* play) { void func_80889ACC(BgHidanKousi* this) { s32 pad[2]; Vec3s* rot = &this->dyna.actor.world.rot; - f32 temp1 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_SinS(rot->y); - f32 temp2 = D_80889E40[this->dyna.actor.params & 0xFF] * Math_CosS(rot->y); + f32 temp1 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] * Math_SinS(rot->y); + f32 temp2 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] * Math_CosS(rot->y); this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + temp1; this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + temp2; } void func_80889B5C(BgHidanKousi* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0xFF)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0xFF))) { BgHidanKousi_SetupAction(this, func_80889BC0); OnePointCutscene_Attention(play, &this->dyna.actor); this->unk_168 = 0xC8; @@ -130,7 +130,7 @@ void func_80889C18(BgHidanKousi* this, PlayState* play) { void func_80889C90(BgHidanKousi* this, PlayState* play) { func_8002D7EC(&this->dyna.actor); - if (D_80889E40[this->dyna.actor.params & 0xFF] < + if (D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] < Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); @@ -156,7 +156,7 @@ void BgHidanKousi_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 354), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[thisx->params & 0xFF]); + gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[PARAMS_GET(thisx->params, 0, 0xFF)]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 359); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 4d718685f09..2e1722fff79 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -77,9 +77,9 @@ void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, PlayState* play CollisionHeader* colHeader = NULL; s32 pad2; - if (collisionHeaders[this->dyna.actor.params & 0xFF] != NULL) { + if (collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] != NULL) { DynaPolyActor_Init(&this->dyna, DPM_UNK); - CollisionHeader_GetVirtual(collisionHeaders[this->dyna.actor.params & 0xFF], &colHeader); + CollisionHeader_GetVirtual(collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); } else { this->dyna.bgId = BGACTOR_NEG_ONE; @@ -94,14 +94,14 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.elements[0].dim.modelSphere.radius = sphereRadii[this->dyna.actor.params & 0xFF]; - this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[this->dyna.actor.params & 0xFF]; + this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)]; + this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)]; } void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; - this->dyna.actor.world.pos.y = actorYPosOffsets[this->dyna.actor.params & 0xFF] + this->dyna.actor.home.pos.y; + this->dyna.actor.world.pos.y = actorYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { @@ -115,8 +115,8 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { BgHidanKowarerukabe_InitDynaPoly(this, play); - if (((this->dyna.actor.params & 0xFF) < CRACKED_STONE_FLOOR) || - ((this->dyna.actor.params & 0xFF) > LARGE_BOMBABLE_WALL)) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) < CRACKED_STONE_FLOOR || + PARAMS_GET(this->dyna.actor.params, 0, 0xFF) > LARGE_BOMBABLE_WALL) { // "Error: Fire Temple Breakable Walls. arg_data I can't determine the (%s %d)(arg_data 0x%04x)" osSyncPrintf("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_kowarerukabe.c", 254, this->dyna.actor.params); @@ -124,7 +124,7 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { return; } - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { Actor_Kill(&this->dyna.actor); return; } @@ -283,7 +283,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, PlayState* pl } void BgHidanKowarerukabe_Break(BgHidanKowarerukabe* this, PlayState* play) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case CRACKED_STONE_FLOOR: BgHidanKowarerukabe_FloorBreak(this, play); break; @@ -304,9 +304,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) { if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) { BgHidanKowarerukabe_Break(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); - if ((this->dyna.actor.params & 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); @@ -329,7 +329,7 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 568), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[this->dyna.actor.params & 0xFF]); + gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)]); Collider_UpdateSpheres(0, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index d2d218a43d3..06cc2b4c451 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -74,10 +74,10 @@ void BgHidanRock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - this->type = thisx->params & 0xFF; + this->type = PARAMS_GET(thisx->params, 0, 0xFF); this->unk_169 = 0; - thisx->params = ((thisx->params) >> 8) & 0xFF; + thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index bc6d8774894..00def1871aa 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -75,7 +75,7 @@ void func_80890740(BgIceShelter* this, PlayState* play) { static s16 cylinderRadii[] = { 47, 33, 44, 41, 100 }; static s16 cylinderHeights[] = { 80, 54, 90, 60, 200 }; s32 pad; - s32 type = (this->dyna.actor.params >> 8) & 7; + s32 type = PARAMS_GET(this->dyna.actor.params, 8, 7); Collider_InitCylinder(play, &this->cylinder1); Collider_SetCylinder(play, &this->cylinder1, &this->dyna.actor, &D_8089170C); @@ -132,7 +132,7 @@ static InitChainEntry sInitChain[] = { void BgIceShelter_Init(Actor* thisx, PlayState* play) { static Vec3f kzIceScale = { 0.18f, 0.27f, 0.24f }; BgIceShelter* this = (BgIceShelter*)thisx; - s16 type = (this->dyna.actor.params >> 8) & 7; + s16 type = PARAMS_GET(this->dyna.actor.params, 8, 7); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -162,7 +162,7 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; - if (!((this->dyna.actor.params >> 6) & 1) && (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F))) { + if (!PARAMS_GET(this->dyna.actor.params, 6, 1) && (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)))) { Actor_Kill(&this->dyna.actor); return; } @@ -175,7 +175,7 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { void BgIceShelter_Destroy(Actor* thisx, PlayState* play) { BgIceShelter* this = (BgIceShelter*)thisx; - switch ((this->dyna.actor.params >> 8) & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 8, 7)) { case 2: case 3: DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -284,7 +284,7 @@ void func_80891064(BgIceShelter* this) { void func_8089107C(BgIceShelter* this, PlayState* play) { s32 pad; - s16 type = (this->dyna.actor.params >> 8) & 7; + s16 type = PARAMS_GET(this->dyna.actor.params, 8, 7); if (type == 4) { if (this->dyna.actor.parent != NULL) { @@ -334,7 +334,7 @@ static void (*sEffSpawnFuncs[])(BgIceShelter* this, PlayState* play, f32 chance, void func_808911D4(BgIceShelter* this, PlayState* play) { s32 pad; - s32 type = (this->dyna.actor.params >> 8) & 7; + s32 type = PARAMS_GET(this->dyna.actor.params, 8, 7); f32 phi_f0; this->alpha -= 5; @@ -365,8 +365,8 @@ void func_808911D4(BgIceShelter* this, PlayState* play) { sEffSpawnFuncs[type](this, play, phi_f0, D_808917D0[type]); if (this->alpha <= 0) { - if (!((this->dyna.actor.params >> 6) & 1)) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + if (!PARAMS_GET(this->dyna.actor.params, 6, 1)) { + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } if (type == 4) { @@ -394,7 +394,7 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_ice_shelter.c", 751), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - switch ((this->dyna.actor.params >> 8) & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 8, 7)) { case 0: case 1: case 2: @@ -405,7 +405,7 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, this->alpha); - switch ((this->dyna.actor.params >> 8) & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 8, 7)) { case 0: case 1: case 4: diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 1721755e291..293f7b74461 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -54,8 +54,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); - sp28 = this->dyna.actor.params & 0xFF; - this->dyna.actor.params = (this->dyna.actor.params >> 8) & 0xFF; + sp28 = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); + this->dyna.actor.params = PARAMS_GET(this->dyna.actor.params, 8, 0xFF); CollisionHeader_GetVirtual(&object_ice_objects_Col_002854, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (sp28 == 2) { diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index c9c77e5e2af..bf448220313 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -51,7 +51,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->dyna.actor, 0.1f); - if (((this->dyna.actor.params & 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { + if ((PARAMS_GET(this->dyna.actor.params, 0, 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { play->csCtx.frames = 0; BgInGate_SetupAction(this, func_80892890); } else { @@ -72,7 +72,7 @@ void func_80892890(BgInGate* this, PlayState* play) { if (play->csCtx.frames >= 50) { phi0 = 0x4000; - if ((this->dyna.actor.params & 2) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 0) { phi0 = -0x4000; } this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0; @@ -86,7 +86,7 @@ void func_80892890(BgInGate* this, PlayState* play) { } csFrames = (Math_SinS(csFrames) * 16384.0f); phi1 = csFrames; - if ((this->dyna.actor.params & 2) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 0) { phi1 = -phi1; } this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi1; diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index cae20779c5c..a17aeebf118 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -102,7 +102,7 @@ void BgJya1flift_Init(Actor* thisx, PlayState* play) { BgJya1flift_InitDynapoly(this, play, &g1fliftCol, 0); Actor_ProcessInitChain(thisx, sInitChain); BgJya1flift_InitCollision(thisx, play); - if (Flags_GetSwitch(play, (thisx->params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : BgJya1flift_SetupDoNothing(this); } else { BgJya1flift_SetupWaitForSwitch(this); @@ -128,7 +128,7 @@ void BgJya1flift_SetupWaitForSwitch(BgJya1flift* this) { } void BgJya1flift_WaitForSwitch(BgJya1flift* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { BgJya1flift_ChangeDirection(this); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index 03512650dab..6600934b75e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -43,7 +43,7 @@ void BgJyaBlock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, thisx->params & 0x3F)) { + if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index 27b244307cc..26416000d19 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -78,7 +78,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); BgJyaBombchuiwa_SetupCollider(this, play); - if (Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { BgJyaBombchuiwa_SpawnLightRay(this, play); } else { BgJyaBombchuiwa_SetupWaitForExplosion(this, play); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 2eb87acb550..9dec1cff355 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -88,17 +88,17 @@ void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) { BgJyaBombiwa* this = (BgJyaBombiwa*)thisx; - if ((this->dyna.actor.params & 0x3F) != 0x29) { + if (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) != 0x29) { osSyncPrintf(VT_COL(YELLOW, BLACK)); // "Warning: Switch Number changed (%s %d)(SW %d)" osSyncPrintf("Warning : Switch Number が変更された(%s %d)(SW %d)\n", "../z_bg_jya_bombiwa.c", 218, - this->dyna.actor.params & 0x3F); + PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); osSyncPrintf(VT_RST); } BgJyaBombiwa_SetupDynaPoly(this, play, &gBombiwaCol, DPM_UNK); BgJyaBombiwa_InitCollider(this, play); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -164,7 +164,7 @@ void BgJyaBombiwa_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, play); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 83fcf3750b8..26cc34ca5ba 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -146,7 +146,7 @@ void func_80895A70(BgJyaCobra* this) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; MirRay* mirRay; - switch (this->dyna.actor.params & 3) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { case 0: mirRay = (MirRay*)this->dyna.actor.child; if (mirRay == NULL) { @@ -179,7 +179,7 @@ void func_80895A70(BgJyaCobra* this) { mirRay->unLit = 0; Math_Vec3f_Copy(&mirRay->sourcePt, &this->unk_180); Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.shape.rot.y), MTXMODE_NEW); - Matrix_RotateX(BINANG_TO_RAD(D_80897308[this->dyna.actor.params & 3]), MTXMODE_APPLY); + Matrix_RotateX(BINANG_TO_RAD(D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 3)]), MTXMODE_APPLY); sp28.x = 0.0f; sp28.y = 0.0; sp28.z = this->unk_190 * 2800.0f; @@ -205,14 +205,14 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; f32 phi_f0; - if ((params & 3) == 2 && mirror != NULL && + if (PARAMS_GET(params, 0, 3) == 2 && mirror != NULL && (!(mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) || !(mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) { Math_StepToF(&this->unk_18C, 0.0f, 0.05f); } else { this->unk_18C = 1.0f; - if (D_80897310[params & 3]) { - phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[params & 3]; + if (D_80897310[PARAMS_GET(params, 0, 3)]) { + phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[PARAMS_GET(params, 0, 3)]; phi_v0 = ABS(phi_v0); if (phi_v0 < 0x2000 && phi_v0 != -0x8000) { this->unk_18C += (phi_v0 - 0x2000) * (3.0f / 0x4000); @@ -227,9 +227,9 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f; this->unk_180.z = this->dyna.actor.world.pos.z; - if ((params & 3) == 0) { + if (PARAMS_GET(params, 0, 3) == 0) { this->unk_190 = 0.1f; - } else if ((params & 3) == 1) { + } else if (PARAMS_GET(params, 0, 3) == 1) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -242,7 +242,7 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { } } Math_StepToF(&this->unk_190, phi_f0, 0.04f); - } else if ((params & 3) == 2) { + } else if (PARAMS_GET(params, 0, 3) == 2) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -279,7 +279,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { Lib_MemSet(shadowTex, COBRA_SHADOW_TEX_SIZE, 0); Matrix_RotateX((M_PI / 4), MTXMODE_NEW); - rotY = !(this->dyna.actor.params & 3) ? (this->dyna.actor.shape.rot.y + 0x4000) + rotY = !PARAMS_GET(this->dyna.actor.params, 0, 3) ? (this->dyna.actor.shape.rot.y + 0x4000) : (this->dyna.actor.shape.rot.y - 0x4000); Matrix_RotateY(BINANG_TO_RAD(rotY), MTXMODE_APPLY); Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); @@ -399,21 +399,21 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) { BgJyaCobra_InitDynapoly(this, play, &gCobraCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (!(this->dyna.actor.params & 3) && Flags_GetSwitch(play, ((s32)this->dyna.actor.params >> 8) & 0x3F)) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 3) && Flags_GetSwitch(play, PARAMS_GET((s32)this->dyna.actor.params, 8, 0x3F))) { this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0; } - if (!(this->dyna.actor.params & 3)) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 3)) { BgJyaCobra_SpawnRay(this, play); } func_80896918(this, play); - if ((this->dyna.actor.params & 3) == 1 || (this->dyna.actor.params & 3) == 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 1 || PARAMS_GET(this->dyna.actor.params, 0, 3) == 2) { this->dyna.actor.room = -1; } - if ((this->dyna.actor.params & 3) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 1) { BgJyaCobra_UpdateShadowFromTop(this); } @@ -519,7 +519,7 @@ void BgJyaCobra_Update(Actor* thisx, PlayState* play2) { func_80895C74(this, play); func_80895A70(this); - if ((this->dyna.actor.params & 3) == 0 || (this->dyna.actor.params & 3) == 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 0 || PARAMS_GET(this->dyna.actor.params, 0, 3) == 2) { BgJyaCobra_UpdateShadowFromSide(this); } } @@ -542,7 +542,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 924); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - sp44.x = D_80897308[this->dyna.actor.params & 3] + this->dyna.actor.shape.rot.x; + sp44.x = D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 3)] + this->dyna.actor.shape.rot.x; sp44.y = this->dyna.actor.shape.rot.y; sp44.z = this->dyna.actor.shape.rot.z; Matrix_SetTranslateRotateYXZ(this->unk_180.x, this->unk_180.y, this->unk_180.z, &sp44); @@ -558,7 +558,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) { s32 pad; - s16 params = this->dyna.actor.params & 3; + s16 params = PARAMS_GET(this->dyna.actor.params, 0, 3); Vec3f sp64; Vec3s* phi_a3; @@ -609,7 +609,7 @@ void BgJyaCobra_Draw(Actor* thisx, PlayState* play) { func_80896D78(this, play); } - if ((this->dyna.actor.params & 3) == 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 2) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; if (mirror != NULL && (mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) && diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index e096cfd046a..8a85f4e4e3b 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -84,7 +84,7 @@ void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) { Collider_InitCylinder(play, colCylinder); Collider_SetCylinder(play, colCylinder, &this->dyna.actor, &sCylinderInit); - if ((this->dyna.actor.params & 1) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 1) == 1) { this->colCylinder.dim.radius = 40; this->colCylinder.dim.height = 100; } @@ -221,7 +221,7 @@ void BgJyaIronobj_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); BgJyaIronobj_InitCylinder(this, play); - CollisionHeader_GetVirtual(sCollisionHeaders[thisx->params & 1], &colHeader); + CollisionHeader_GetVirtual(sCollisionHeaders[PARAMS_GET(thisx->params, 0, 1)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); func_808992D8(this); } @@ -247,7 +247,7 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play) { actor = this->colCylinder.base.ac; this->colCylinder.base.acFlags &= ~AC_HIT; if (actor != NULL && actor->id == ACTOR_EN_IK) { - particleFunc[this->dyna.actor.params & 1](this, play, (EnIk*)actor); + particleFunc[PARAMS_GET(this->dyna.actor.params, 0, 1)](this, play, (EnIk*)actor); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR); dropPos.x = this->dyna.actor.world.pos.x; dropPos.y = this->dyna.actor.world.pos.y + 20.0f; @@ -271,5 +271,5 @@ void BgJyaIronobj_Update(Actor* thisx, PlayState* play) { } void BgJyaIronobj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sOpaDL[thisx->params & 1]); + Gfx_DrawDListOpa(play, sOpaDL[PARAMS_GET(thisx->params, 0, 1)]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index ff740731d93..fc20d0d23b7 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -58,7 +58,7 @@ void BgJyaKanaami_Init(Actor* thisx, PlayState* play) { BgJyaKanaami_InitDynaPoly(this, play, &gKanaamiCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_80899A08(this); } else { func_80899880(this); @@ -78,7 +78,7 @@ void func_80899880(BgJyaKanaami* this) { } void func_80899894(BgJyaKanaami* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || this->unk_16A > 0) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) || this->unk_16A > 0) { if (this->dyna.actor.world.pos.x > -1000.0f && this->unk_16A == 0) { OnePointCutscene_Init(play, 3450, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 73c46dcdd25..9e143aebc75 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -63,7 +63,7 @@ void BgJyaLift_Init(Actor* thisx, PlayState* play) { osSyncPrintf("女神リフト CT\n"); BgJyaLift_InitDynapoly(this, play, &gLiftCol, DPM_UNK); Actor_ProcessInitChain(thisx, sInitChain); - if (Flags_GetSwitch(play, (thisx->params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { BgJyaLift_SetFinalPosY(this); } else { BgJyaLift_SetInitPosY(this); @@ -92,7 +92,7 @@ void BgJyaLift_SetInitPosY(BgJyaLift* this) { } void BgJyaLift_DelayMove(BgJyaLift* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || (this->moveDelay > 0)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) || (this->moveDelay > 0)) { this->moveDelay++; if (this->moveDelay >= 20) { OnePointCutscene_Init(play, 3430, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index def39665a80..7d285524502 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -161,7 +161,7 @@ void BgJyaMegami_Init(Actor* thisx, PlayState* play) { BgJyaMegami_InitDynaPoly(this, play, &GMegamiCol, DPM_UNK); BgJyaMegami_InitCollider(this, play); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -195,7 +195,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) { this->lightTimer--; } if (this->lightTimer > 40) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); BgJyaMegami_SetupExplode(this); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); OnePointCutscene_Init(play, 3440, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index dc61af22d9e..99449ac9e63 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -49,7 +49,7 @@ void BgMenkuriNisekabe_Update(Actor* thisx, PlayState* play) { void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play) { BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx; - u32 index = this->actor.params & 0xFF; + u32 index = PARAMS_GET(this->actor.params, 0, 0xFF); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_7)) { Gfx_DrawDListXlu(play, sDLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 75e9167b400..8b00c72a9ca 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -176,14 +176,14 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->yRot = this->dyna.actor.world.pos.y; - this->dList = sDLists[(u16)this->dyna.actor.params & 0xF]; + this->dList = sDLists[PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)]; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - CollisionHeader_GetVirtual(sColHeaders[(u16)this->dyna.actor.params & 0xF], &colHeader); + CollisionHeader_GetVirtual(sColHeaders[PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - switch ((u16)this->dyna.actor.params & 0xF) { + switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)) { case MIZUBWALL_FLOOR: - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -218,7 +218,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_RUTO_ROOM: - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -253,7 +253,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_UNUSED: - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -290,7 +290,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_STINGER_ROOM_1: - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -328,7 +328,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_STINGER_ROOM_2: - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -425,7 +425,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, PlayState* play) { Vec3f debrisOffsets[15]; for (i = 0; i < ARRAY_COUNT(debrisOffsets); i++) { - switch ((u16)this->dyna.actor.params & 0xF) { + switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)) { case MIZUBWALL_FLOOR: debrisOffsets[i].x = (Rand_ZeroOne() * 80.0f) - 40.0f; debrisOffsets[i].y = Rand_ZeroOne() * 0; @@ -465,7 +465,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) { BgMizuBwall_SetAlpha(this, play); if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Flags_SetSwitch(play, ((u16)this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F)); this->breakTimer = 1; DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index 4db250ef3fb..339c17e6fe4 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -10,11 +10,11 @@ #define FLAGS ACTOR_FLAG_4 -#define MOVEBG_TYPE(params) (((u16)(params) >> 0xC) & 0xF) -#define MOVEBG_FLAGS(params) ((u16)(params)&0x3F) -#define MOVEBG_PATH_ID(params) (((u16)(params) >> 0x8) & 0xF) -#define MOVEBG_POINT_ID(params) ((u16)(params)&0xF) -#define MOVEBG_SPEED(params) (((u16)(params) >> 0x4) & 0xF) +#define MOVEBG_TYPE(params) PARAMS_GET((u16)(params), 0xC, 0xF) +#define MOVEBG_FLAGS(params) PARAMS_GET((u16)(params), 0, 0x3F) +#define MOVEBG_PATH_ID(params) PARAMS_GET((u16)(params), 8, 0xF) +#define MOVEBG_POINT_ID(params) PARAMS_GET((u16)(params), 0, 0xF) +#define MOVEBG_SPEED(params) PARAMS_GET((u16)(params), 4, 0xF) void BgMizuMovebg_Init(Actor* thisx, PlayState* play); void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index 58f822fdbef..ba20efa9597 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -4,9 +4,9 @@ #include "ultra64.h" #include "global.h" -#define BGMIZUSHUTTER_SIZE_PARAM(thisx) (((u16)(thisx)->params >> 0xC) & 0xF) -#define BGMIZUSHUTTER_TIMER_PARAM(thisx) (((u16)(thisx)->params >> 0x6) & 0x3F) -#define BGMIZUSHUTTER_SWITCH_PARAM(thisx) (((u16)(thisx)->params >> 0x0) & 0x3F) +#define BGMIZUSHUTTER_SIZE_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0xC, 0xF) +#define BGMIZUSHUTTER_TIMER_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0x6, 0x3F) +#define BGMIZUSHUTTER_SWITCH_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0x0, 0x3F) #define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 0xC) | ((timer) << 0x6) | (switchFlag)) struct BgMizuShutter; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index ab73a8b9056..7d150d831bf 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -95,8 +95,8 @@ void BgMizuWater_Init(Actor* thisx, PlayState* play) { s32 waterLevelActionIndex; waterBoxes = play->colCtx.colHeader->waterBoxes; - this->type = this->actor.params & 0xFF; - this->switchFlag = (this->actor.params >> 8) & 0xFF; + this->type = PARAMS_GET(this->actor.params, 0, 0xFF); + this->switchFlag = PARAMS_GET(this->actor.params, 8, 0xFF); Actor_ProcessInitChain(&this->actor, sInitChain); initialActorY = this->actor.world.pos.y; this->baseY = initialActorY; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 4873c2c9e1f..3758860af12 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -71,7 +71,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { // "mori (bigST.keyceiling)" osSyncPrintf("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, - Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F), + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)), Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room), GET_PLAYER(play)->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, DPM_UNK); @@ -84,7 +84,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f; @@ -110,7 +110,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) { thisx->draw = BgMoriBigst_Draw; if (Flags_GetClear(play, thisx->room) && (GET_PLAYER(play)->actor.world.pos.y > 700.0f)) { - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { BgMoriBigst_SetupDone(this, play); } else { BgMoriBigst_SetupStalfosFight(this, play); @@ -214,7 +214,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play) { if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(play)) { - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); BgMoriBigst_SetupDone(this, play); } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 206e7a89e6e..c267bb64121 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -135,7 +135,7 @@ void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) { void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { if (play->roomCtx.curRoom.num == 2) { this->dyna.actor.world.pos.y = 73.0f; BgMoriElevator_SetupSetPosition(this); @@ -210,11 +210,11 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) { } else if ((play->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) { this->targetY = -779.0f; BgMoriElevator_StopMovement(this); - } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) && + } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) && (this->unk_16C == 0)) { this->targetY = 73.0f; func_808A1C30(this); - } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) && + } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) && (this->unk_16C != 0)) { this->targetY = 233.0f; func_808A1CF4(this, play); @@ -245,7 +245,7 @@ void BgMoriElevator_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); this->unk_170 = this->dyna.interactFlags; - this->unk_16C = Flags_GetSwitch(play, (thisx->params & 0x3F)); + this->unk_16C = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F)); } void BgMoriElevator_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index f2df07d496d..bf8c40cffce 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -69,7 +69,7 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { s32 pad; BgMoriHashira4* this = (BgMoriHashira4*)thisx; - this->switchFlag = (this->dyna.actor.params >> 8) & 0x3F; + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 0x3F); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index bb00444f88c..d4f6ffe20b2 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -61,16 +61,16 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - switchFlagParam = this->dyna.actor.params & 0x3F; - t6 = this->dyna.actor.params & 0x4000; + switchFlagParam = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); + t6 = PARAMS_GET(this->dyna.actor.params, 0, 0x4000); if (t6 != 0) { this->switchFlag = switchFlagParam; } else { - this->switchFlag = ((this->dyna.actor.params >> 8) & 0x3F); + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 0x3F); this->switchFlag = (Flags_GetSwitch(play, this->switchFlag)) ? 1 : 0; } - this->dyna.actor.params = ((this->dyna.actor.params & 0x8000) >> 0xE); + this->dyna.actor.params = PARAMS_GET2(this->dyna.actor.params, 0xE, 0x8000); if (Flags_GetSwitch(play, switchFlagParam)) { if (this->dyna.actor.params == 0) { this->dyna.actor.params = 1; diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 1e01c5b5ab3..e53f23f39b9 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -58,7 +58,7 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) { this->actor.scale.z = 1.0f; this->actor.world.pos.x = 119.0f; this->actor.world.pos.z = -1820.0f; - this->prevSwitchFlagSet = Flags_GetSwitch(play, this->actor.params & 0x3F); + this->prevSwitchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); if (this->prevSwitchFlagSet != 0) { this->actor.world.pos.y = -282.0f; BgMoriIdomizu_SetWaterLevel(play, -282); @@ -112,7 +112,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play) { s32 switchFlagSet; roomNum = play->roomCtx.curRoom.num; - switchFlagSet = Flags_GetSwitch(play, thisx->params & 0x3F); + switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F)); if (switchFlagSet) { this->targetWaterLevel = -282.0f; } else { diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index d569c7e35b6..eabf0e48ebe 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -196,8 +196,8 @@ void BgPoEvent_Init(Actor* thisx, PlayState* play) { BgPoEvent* this = (BgPoEvent*)thisx; Actor_ProcessInitChain(thisx, sInitChain); - this->type = (thisx->params >> 8) & 0xF; - this->index = (thisx->params >> 0xC) & 0xF; + this->type = PARAMS_GET(thisx->params, 8, 0xF); + this->index = PARAMS_GET(thisx->params, 0xC, 0xF); thisx->params &= 0x3F; if (this->type >= 2) { diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index 8700d03e726..be186f9dbd3 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -80,7 +80,7 @@ void BgPoSyokudai_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->flameColor = (thisx->params >> 8) & 0xFF; + this->flameColor = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0x3F; thisx->colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 3d7cd495b87..c13d419af61 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -50,8 +50,8 @@ void BgRelayObjects_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = thisx->params & 0x3F; - thisx->params = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 0, 0x3F); + thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); DynaPolyActor_Init(&this->dyna, 3); if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&gWindmillRotatingPlatformCol, &colHeader); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index 6444b24ac2a..b7297ce8b3f 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -45,7 +45,7 @@ static Gfx* D_808AC510[] = { void BgSpot01Objects2_Init(Actor* thisx, PlayState* play) { BgSpot01Objects2* this = (BgSpot01Objects2*)thisx; - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { case 0: case 1: case 2: @@ -99,7 +99,7 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { this->dyna.actor.objBankIndex = this->objBankIndex; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { case 4: // Shooting gallery CollisionHeader_GetVirtual(&gKakarikoShootingGalleryCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); @@ -108,10 +108,10 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { CollisionHeader_GetVirtual(&object_spot01_matoyab_col, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); if (IS_DAY) { - func_808AC22C(play->setupPathList, &position, ((s32)thisx->params >> 8) & 0xFF, 0); + func_808AC22C(play->setupPathList, &position, PARAMS_GET((s32)thisx->params, 8, 0xFF), 0); Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_EN_DAIKU_KAKARIKO, position.x, position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z, - ((((s32)thisx->params >> 8) & 0xFF) << 8) + 1); + (PARAMS_GET((s32)thisx->params, 8, 0xFF) << 8) + 1); } break; case 0: // Potion Shop Poster @@ -135,5 +135,5 @@ void BgSpot01Objects2_Update(Actor* thisx, PlayState* play) { } void func_808AC4A4(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_808AC510[thisx->params & 7]); + Gfx_DrawDListOpa(play, D_808AC510[PARAMS_GET(thisx->params, 0, 7)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 7694548a715..271717f9aad 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -53,8 +53,8 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - this->unk_16B = (u16)(thisx->params >> 8); - thisx->params = (u16)(thisx->params & 0xFF); + this->unk_16B = (u16)PARAMS_GET_NOMASK(thisx->params, 8); + thisx->params = (u16)PARAMS_GET(thisx->params, 0, 0xFF); switch (thisx->params) { case 0: diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index a2c1540694d..a3f80010d6d 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -47,7 +47,7 @@ void BgSpot03Taki_Init(Actor* thisx, PlayState* play) { s16 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = (this->dyna.actor.params & 0x3F); + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&object_spot03_object_Col_000C98, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index d6bd8824cdd..5d0624342ae 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -45,7 +45,7 @@ void BgSpot05Soko_Init(Actor* thisx, PlayState* play) { s32 pad2; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, DPM_UNK); if (thisx->params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index d603eaab656..2cb20128f19 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -96,8 +96,8 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { s32 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = thisx->params & 0xFF; - thisx->params = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 0, 0xFF); + thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); osSyncPrintf("spot06 obj nthisx->arg_data=[%d]", thisx->params); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index 4c023b33910..9f903708d9d 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -162,7 +162,7 @@ void BgSpot08Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); return; } @@ -184,7 +184,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index 79d46f99562..4bd1d6cc6d6 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -55,7 +55,7 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll // Sets params to 0x10 (medium, nonrotating) if not in the cases listed. void BgSpot08Iceblock_CheckParams(BgSpot08Iceblock* this) { - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case 0xFF: this->dyna.actor.params = 0x10; break; @@ -86,7 +86,7 @@ void BgSpot08Iceblock_SinkUnderPlayer(BgSpot08Iceblock* this) { f32 target; f32 step; - switch (this->dyna.actor.params & 0xF0) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF0)) { case 0: step = 0.15f; break; @@ -173,7 +173,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - switch (this->dyna.actor.params & 0xFF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { case 0x11: // Medium nonrotating rollDataIndex = 0; break; @@ -258,7 +258,7 @@ void BgSpot08Iceblock_SpawnTwinFloe(BgSpot08Iceblock* this, PlayState* play) { sin = Math_SinS(this->dyna.actor.home.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.home.rot.y) * 100.0f; - if (!(this->dyna.actor.params & 0x100)) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 0x100)) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BG_SPOT08_ICEBLOCK, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, this->dyna.actor.home.rot.x, this->dyna.actor.home.rot.y, this->dyna.actor.home.rot.z, @@ -287,7 +287,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { osSyncPrintf("(spot08 流氷)(arg_data 0x%04x)\n", this->dyna.actor.params); BgSpot08Iceblock_CheckParams(this); - switch (this->dyna.actor.params & 0x200) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0x200)) { case 0: colHeader = &gZorasFountainIcebergCol; break; @@ -296,7 +296,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { break; } - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case 2: case 3: BgSpot08Iceblock_InitDynaPoly(this, play, colHeader, DPM_UNK3); @@ -313,7 +313,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - switch (this->dyna.actor.params & 0xF0) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF0)) { case 0: Actor_SetScale(&this->dyna.actor, 0.2f); break; @@ -330,7 +330,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { this->surfaceNormal.y = 1.0f; this->rotationAxis.x = 1.0f; - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case 0: case 1: BgSpot08Iceblock_SetupFloatNonrotating(this); @@ -391,7 +391,7 @@ void BgSpot08Iceblock_FloatOrbitingTwins(BgSpot08Iceblock* this, PlayState* play BgSpot08Iceblock_SetWaterline(this); // parent handles rotations of both - if (!(this->dyna.actor.params & 0x100)) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 0x100)) { this->dyna.actor.world.rot.y += 0x190; sin = Math_SinS(this->dyna.actor.world.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.world.rot.y) * 100.0f; @@ -432,7 +432,7 @@ void BgSpot08Iceblock_Draw(Actor* thisx, PlayState* play) { Gfx* dList; BgSpot08Iceblock* this = (BgSpot08Iceblock*)thisx; - switch (this->dyna.actor.params & 0x200) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0x200)) { case 0: dList = gZorasFountainIcebergDL; break; diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index de547753f89..b01ce840037 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -113,7 +113,7 @@ void BgSpot11Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); return; } @@ -136,7 +136,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index d8cf6331df5..c56f3b36f1b 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -62,7 +62,7 @@ void BgSpot12Gate_Init(Actor* thisx, PlayState* play) { BgSpot12Gate_InitDynaPoly(this, play, &gGerudoFortressWastelandGateCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_808B3274(this); } else { func_808B30C0(this); @@ -81,7 +81,7 @@ void func_808B30C0(BgSpot12Gate* this) { } void func_808B30D8(BgSpot12Gate* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_808B3134(this); OnePointCutscene_Init(play, 4160, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 1a3dfe511b6..a39952d4d38 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -59,7 +59,7 @@ void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { func_808B3420(this, play, &gGerudoFortressGTGShutterCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_808B3714(this); } else { func_808B3550(this); @@ -80,7 +80,7 @@ void func_808B3550(BgSpot12Saku* this) { } void func_808B357C(BgSpot12Saku* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_808B35E4(this); this->timer = 20; OnePointCutscene_Init(play, 4170, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index b5ef416397c..de2d6a698e1 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -123,7 +123,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, PlayState* play) { func_808B3960(this, play, &gLonLonMilkCrateCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); func_808B3A34(this); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { func_808B44B8(this, play); this->dyna.actor.world.pos = D_808B45C4[D_808B4590]; D_808B4590++; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index d9e50a1f2cc..d64ead71bc3 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -144,8 +144,8 @@ static f32 D_808B6074[] = { 66.0f, 51.0f, 48.0f, 36.0f, 21.0f }; static s16 D_808B6088[] = { 0, 1, 2, 3, 4 }; void func_808B4C30(BgSpot16Bombstone* this) { - this->switchFlag = (this->actor.params >> 8) & 0x3F; - this->actor.params = this->actor.params & 0xFF; + this->switchFlag = PARAMS_GET(this->actor.params, 8, 0x3F); + this->actor.params = PARAMS_GET(this->actor.params, 0, 0xFF); } void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index 17f014a8228..b8e0bf13f55 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -96,7 +96,7 @@ void BgSpot17Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - if (Flags_GetSwitch(play, (this->dyna.actor.params & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_Kill(&this->dyna.actor); return; } @@ -115,7 +115,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) { BgSpot17Bakudankabe* this = (BgSpot17Bakudankabe*)thisx; if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) { func_808B6BC0(this, play); - Flags_SetSwitch(play, (this->dyna.actor.params & 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index ad0595cf5f2..671b8b5b2fe 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -144,7 +144,7 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) { this->dyna.actor.home.pos.y += 0.01f; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { func_808B7BB0(this); return; } @@ -174,7 +174,7 @@ void func_808B7AEC(BgSpot18Basket* this) { } void func_808B7AFC(BgSpot18Basket* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { OnePointCutscene_Init(play, 4220, 80, &this->dyna.actor, CAM_ID_MAIN); func_808B7B58(this); } @@ -385,7 +385,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } } else if (this->unk_218 == 2) { - if ((this->unk_21A != 0) || Flags_GetCollectible(play, (actor->params & 0x3F))) { + if ((this->unk_21A != 0) || Flags_GetCollectible(play, PARAMS_GET(actor->params, 0, 0x3F))) { collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_PURPLE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; @@ -393,7 +393,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } else { collectible = - Item_DropCollectible(play, &tempVector, ((actor->params & 0x3F) << 8) | ITEM00_HEART_PIECE); + Item_DropCollectible(play, &tempVector, (PARAMS_GET(actor->params, 0, 0x3F) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; collectible->actor.world.rot.y = D_808B85E4[1]; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index 772b38daf67..e9c0936671e 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -101,13 +101,13 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { return 0; } - switch (D_808B90F0[this->dyna.actor.params & 0xF][age]) { + switch (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 0xF)][age]) { case 0: case 1: - if (D_808B90F0[this->dyna.actor.params & 0xF][age] == 0) { + if (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 0xF)][age] == 0) { osSyncPrintf("出現しない Object (0x%04x)\n", this->dyna.actor.params); } - return D_808B90F0[this->dyna.actor.params & 0xF][age]; + return D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 0xF)][age]; case 2: osSyncPrintf("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202, this->dyna.actor.params); @@ -120,7 +120,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8A5C(BgSpot18Obj* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, D_808B90F4[this->dyna.actor.params & 0xF]); + Actor_SetScale(&this->dyna.actor, D_808B90F4[PARAMS_GET(this->dyna.actor.params, 0, 0xF)]); return 1; } @@ -129,13 +129,13 @@ s32 func_808B8A98(BgSpot18Obj* this, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - CollisionHeader_GetVirtual(D_808B90FC[this->dyna.actor.params & 0xF], &colHeader); + CollisionHeader_GetVirtual(D_808B90FC[PARAMS_GET(this->dyna.actor.params, 0, 0xF)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); return 1; } s32 func_808B8B08(BgSpot18Obj* this, PlayState* play) { - this->dyna.actor.flags |= D_808B9104[this->dyna.actor.params & 0xF]; + this->dyna.actor.flags |= D_808B9104[PARAMS_GET(this->dyna.actor.params, 0, 0xF)]; return 1; } @@ -155,7 +155,7 @@ s32 func_808B8BB4(BgSpot18Obj* this, PlayState* play) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { func_808B9030(this); - } else if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + } else if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { func_808B9030(this); this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; @@ -172,8 +172,8 @@ s32 func_808B8C90(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8CC8(BgSpot18Obj* this, PlayState* play) { - if ((D_808B913C[this->dyna.actor.params & 0xF] != NULL) && - (!D_808B913C[this->dyna.actor.params & 0xF](this, play))) { + if ((D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 0xF)] != NULL) && + (!D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 0xF)](this, play))) { return 0; } return 1; @@ -257,7 +257,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) { this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; - Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); func_80078884(NA_SE_SY_CORRECT_CHIME); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { @@ -283,5 +283,5 @@ void BgSpot18Obj_Update(Actor* thisx, PlayState* play) { } void BgSpot18Obj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sDlists[thisx->params & 0xF]); + Gfx_DrawDListOpa(play, sDlists[PARAMS_GET(thisx->params, 0, 0xF)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index edaa45269f1..a9897e8f41f 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -39,7 +39,7 @@ static InitChainEntry sInitChain[] = { void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { s32 pad; BgSpot18Shutter* this = (BgSpot18Shutter*)thisx; - s32 param = (this->dyna.actor.params >> 8) & 1; + s32 param = PARAMS_GET(this->dyna.actor.params, 8, 1); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); @@ -54,7 +54,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_808B9618; } } else { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { this->actionFunc = func_808B95AC; this->dyna.actor.world.pos.y += 180.0f; } else { @@ -85,7 +85,7 @@ void func_808B95AC(BgSpot18Shutter* this, PlayState* play) { } void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Actor_SetFocus(&this->dyna.actor, 70.0f); OnePointCutscene_Attention(play, &this->dyna.actor); this->actionFunc = func_808B9698; @@ -95,7 +95,7 @@ void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { void func_808B9618(BgSpot18Shutter* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_109)) { Actor_SetFocus(&this->dyna.actor, 70.0f); - if (((this->dyna.actor.params >> 8) & 1) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 8, 1) == 0) { this->actionFunc = func_808B9698; } else { this->actionFunc = func_808B971C; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index f1f291a337a..4078ad85853 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -44,8 +44,8 @@ void BgYdanHasi_Init(Actor* thisx, PlayState* play) { WaterBox* waterBox; Actor_ProcessInitChain(thisx, sInitChain); - this->type = ((thisx->params >> 8) & 0x3F); - thisx->params = thisx->params & 0xFF; + this->type = PARAMS_GET(thisx->params, 8, 0x3F); + thisx->params = PARAMS_GET(thisx->params, 0, 0xFF); waterBox = &play->colCtx.colHeader->waterBoxes[1]; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); if (thisx->params == HASI_WATER) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 8a8668d0928..f98d7f5ce49 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -88,8 +88,8 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->elements); - this->switchFlag = this->dyna.actor.params & 0xFFFF; - thisx->params = (thisx->params >> 8) & 0xFF; // thisx is required to match here + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0xFFFF); + thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); // thisx is required to match here if (this->dyna.actor.params == 0) { triInit = &sTrisElementsInit[0]; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index 97f95a1c072..ffa8de71f2e 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -91,9 +91,9 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { f32 nSinsX; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->isDestroyedSwitchFlag = thisx->params & 0x3F; - this->burnSwitchFlag = (thisx->params >> 6) & 0x3F; - this->dyna.actor.params = (thisx->params >> 0xC) & 0xF; + this->isDestroyedSwitchFlag = PARAMS_GET(thisx->params, 0, 0x3F); + this->burnSwitchFlag = PARAMS_GET(thisx->params, 6, 0x3F); + this->dyna.actor.params = PARAMS_GET(thisx->params, 0xC, 0xF); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); Collider_InitTris(play, &this->trisCollider); Collider_SetTris(play, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems); diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index f8962823739..1f2012575b6 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -59,13 +59,13 @@ void func_808C0C50(BgZg* this) { } s32 func_808C0C98(BgZg* this, PlayState* play) { - s32 flag = (this->dyna.actor.params >> 8) & 0xFF; + s32 flag = PARAMS_GET(this->dyna.actor.params, 8, 0xFF); return Flags_GetSwitch(play, flag); } s32 func_808C0CC8(BgZg* this) { - s32 flag = this->dyna.actor.params & 0xFF; + s32 flag = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); return flag; } diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 2ca2f67746c..0e16cf1d1c3 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -909,8 +909,8 @@ void func_808FF898(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if (((actor->params & 0xFF) == 0x10) || ((actor->params & 0xFF) == 0x11) || - ((actor->params & 0xFF) == 0x16)) { + if ((PARAMS_GET(actor->params, 0, 0xFF) == 0x10) || (PARAMS_GET(actor->params, 0, 0xFF) == 0x11) || + (PARAMS_GET(actor->params, 0, 0xFF) == 0x16)) { if (SQ(this->unk_218.x - gj->dyna.actor.world.pos.x) + SQ(this->unk_218.z - gj->dyna.actor.world.pos.z) < SQ(100.0f)) { @@ -950,8 +950,8 @@ s32 func_808FFA24(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if (((actor->params & 0xFF) == 0x10) || ((actor->params & 0xFF) == 0x11) || - ((actor->params & 0xFF) == 0x16)) { + if ((PARAMS_GET(actor->params, 0, 0xFF) == 0x10) || (PARAMS_GET(actor->params, 0, 0xFF) == 0x11) || + (PARAMS_GET(actor->params, 0, 0xFF) == 0x16)) { if (SQ(this->actor.world.pos.x - gj->dyna.actor.world.pos.x) + SQ(this->actor.world.pos.z - gj->dyna.actor.world.pos.z) < SQ(200.0f)) { diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index bae9216c0db..582e746457e 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -2658,7 +2658,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { sp4C = 200.0f; BossVa_Spark(play, this, 1, 125, 15.0f, 7.0f, SPARK_TETHER, 1.0f, true); this->actor.flags &= ~ACTOR_FLAG_0; - if (this->actor.params & 1) { + if (PARAMS_GET(this->actor.params, 0, 1)) { sp4C = -200.0f; } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index a8b9c765505..f202343c466 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -182,8 +182,8 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { DemoEffect* crystalLight; DemoEffect* lightRing; - effectType = (this->actor.params & 0x00FF); - lightEffect = ((this->actor.params & 0xF000) >> 12); + effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); + lightEffect = PARAMS_GET2(this->actor.params, 12, 0xF000); osSyncPrintf(VT_FGCOL(CYAN) " no = %d\n" VT_RST, effectType); @@ -519,7 +519,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { */ void DemoEffect_Destroy(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 effectType = (this->actor.params & 0x00FF); + s32 effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); if (effectType == DEMO_EFFECT_TIMEWARP_MASTERSWORD || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { @@ -680,7 +680,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { * 3) Timeblock is cleared with the Song of Time (Large and Small have different versions of Timewarp) */ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { - s32 effectType = (this->actor.params & 0x00FF); + s32 effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); if (!SkelCurve_Init(play, &this->skelCurve, &gTimeWarpSkel, &gTimeWarpAnim)) { ASSERT(0, "0", "../z_demo_effect.c", 1283); @@ -792,7 +792,7 @@ void DemoEffect_UpdateTimeWarpTimeblock(DemoEffect* this, PlayState* play) { shrinkProgress = (100 - this->timeWarp.shrinkTimer) * 0.010f; scale = shrinkProgress * 0.14f; - if ((this->actor.params & 0x00FF) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { + if (PARAMS_GET2(this->actor.params, 0, 0x00FF) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { scale *= 0.6f; } @@ -1036,7 +1036,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { u16 action; s32 isLargeSize; - isLargeSize = ((this->actor.params & 0x0F00) >> 8); + isLargeSize = PARAMS_GET2(this->actor.params, 8, 0x0F00); if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[this->csActionId] != NULL) { DemoEffect_MoveToCsEndpoint(this, play, this->csActionId, 0); @@ -2068,7 +2068,7 @@ s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; - u8 effectType = (this->actor.params & 0x00FF); + u8 effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL || Flags_GetEnv(play, 1) || gSaveContext.sceneSetupIndex >= 4 || gSaveContext.entranceIndex == ENTR_TOKINOMA_4) { diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index d350ac85825..915cd8bbe0b 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -77,23 +77,23 @@ typedef void (*DemoGjDrawFunc)(DemoGj*, PlayState*); // bits 11-15 s32 DemoGj_GetCollectibleType(DemoGj* this) { - s32 params = this->dyna.actor.params >> 0xB; + s32 type = PARAMS_GET(this->dyna.actor.params, 0xB, 0x1F); - return params & 0x1F; + return type; } // bits 8-10 s32 DemoGj_GetCollectibleAmount(DemoGj* this) { - s32 params = this->dyna.actor.params >> 0x8; + s32 amount = PARAMS_GET(this->dyna.actor.params, 0x8, 7); - return params & 7; + return amount; } // bits 0-7 s32 DemoGj_GetType(DemoGj* this) { - s32 params = this->dyna.actor.params; + s32 type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); - return params & 0xFF; + return type; } void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* cylinder, diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 36afd889f22..90c607e0897 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -66,9 +66,9 @@ void DoorAna_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; // init block for grottos that are initially "hidden" (require explosives/hammer/song of storms to open) - if ((this->actor.params & 0x300) != 0) { + if (PARAMS_GET(this->actor.params, 0, 0x300) != 0) { // only allocate collider for grottos that need bombing/hammering open - if ((this->actor.params & 0x200) != 0) { + if (PARAMS_GET(this->actor.params, 0, 0x200) != 0) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); } else { @@ -86,7 +86,7 @@ void DoorAna_Destroy(Actor* thisx, PlayState* play) { DoorAna* this = (DoorAna*)thisx; // free collider if it has one - if ((this->actor.params & 0x200) != 0) { + if (PARAMS_GET(this->actor.params, 0, 0x200) != 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -95,7 +95,7 @@ void DoorAna_Destroy(Actor* thisx, PlayState* play) { void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { u32 openGrotto = false; - if (!(this->actor.params & 0x200)) { + if (!PARAMS_GET(this->actor.params, 0, 0x200)) { // opening with song of storms if (this->actor.xyzDistToPlayerSq < SQ(200.0f) && Flags_GetEnv(play, 5)) { openGrotto = true; @@ -130,11 +130,11 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_31) && (player->unk_84F == 0)) { - destinationIdx = ((this->actor.params >> 0xC) & 7) - 1; + destinationIdx = PARAMS_GET(this->actor.params, 0xC, 7) - 1; Play_SetupRespawnPoint(play, RESPAWN_MODE_RETURN, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; - gSaveContext.respawn[RESPAWN_MODE_RETURN].data = this->actor.params & 0xFFFF; + gSaveContext.respawn[RESPAWN_MODE_RETURN].data = PARAMS_GET(this->actor.params, 0, 0xFFFF); if (destinationIdx < 0) { destinationIdx = this->actor.home.rot.z + 1; } diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index aee6f349f5b..0af93649d48 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -44,7 +44,7 @@ void DoorGerudo_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&gGerudoCellDoorCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - if (Flags_GetSwitch(play, thisx->params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { this->actionFunc = func_8099485C; thisx->world.pos.y = thisx->home.pos.y + 200.0f; } else { @@ -100,7 +100,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (this->unk_164 != 0) { this->actionFunc = func_8099496C; gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } else { s32 direction = func_80994750(this, play); @@ -110,7 +110,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) { player->naviTextId = -0x203; - } else if (!Flags_GetCollectible(play, (this->dyna.actor.params >> 8) & 0x1F)) { + } else if (!Flags_GetCollectible(play, PARAMS_GET(this->dyna.actor.params, 8, 0x1F))) { player->naviTextId = -0x225; } else { player->doorType = PLAYER_DOORTYPE_SLIDING; diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index f65c0611eb2..8f9ae144895 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -120,7 +120,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->animStyle = 0; this->playerIsOpening = 0; - switch ((u8)(this->actor.params & 0xFF)) { + switch ((u8)PARAMS_GET(this->actor.params, 0, 0xFF)) { case DOOR_KILLER_DOOR: // `jointTable` is used for both the `jointTable` and `morphTable` args here. Because this actor doesn't // play any animations it does not cause problems, but it would need to be changed otherwise. @@ -143,8 +143,8 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->colliderJntSph.elements[0].dim.worldSphere.center.z = (s16)this->actor.world.pos.z; // If tied to a switch flag and that switch flag is already set, kill the actor. - if ((((this->actor.params >> 8) & 0x3F) != 0x3F) && - Flags_GetSwitch(play, ((this->actor.params >> 8) & 0x3F))) { + if ((PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) && + Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { Actor_Kill(&this->actor); } break; @@ -179,7 +179,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { void DoorKiller_Destroy(Actor* thisx, PlayState* play) { DoorKiller* this = (DoorKiller*)thisx; - if ((thisx->params & 0xFF) == DOOR_KILLER_DOOR) { + if (PARAMS_GET(thisx->params, 0, 0xFF) == DOOR_KILLER_DOOR) { Collider_DestroyCylinder(play, &this->colliderCylinder); Collider_DestroyJntSph(play, &this->colliderJntSph); } @@ -240,7 +240,7 @@ void DoorKiller_SetAC(DoorKiller* this, PlayState* play) { } void DoorKiller_Die(DoorKiller* this, PlayState* play) { - s32 switchFlag = (this->actor.params >> 8) & 0x3F; + s32 switchFlag = PARAMS_GET(this->actor.params, 8, 0x3F); // Can set a switch flag on death based on params if (switchFlag != 0x3F) { @@ -471,7 +471,7 @@ void DoorKiller_UpdateTexture(Actor* thisx, PlayState* play) { void DoorKiller_SetProperties(DoorKiller* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->doorObjBankIndex)) { DoorKiller_UpdateTexture(&this->actor, play); - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET(this->actor.params, 0, 0xFF)) { case DOOR_KILLER_DOOR: this->actionFunc = DoorKiller_Wait; this->actor.draw = DoorKiller_DrawDoor; @@ -514,7 +514,7 @@ void DoorKiller_DrawDoor(Actor* thisx, PlayState* play) { void DoorKiller_DrawRubble(Actor* thisx, PlayState* play) { static Gfx* dLists[] = { object_door_killer_DL_001250, object_door_killer_DL_001550, object_door_killer_DL_0017B8, object_door_killer_DL_001A58 }; - s32 rubblePieceIndex = (thisx->params & 0xFF) - 1; + s32 rubblePieceIndex = PARAMS_GET(thisx->params, 0, 0xFF) - 1; DoorKiller* this = (DoorKiller*)thisx; if ((this->timer >= 20) || ((this->timer & 1) == 0)) { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 1432d8bdc1d..5cc84cef2b2 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -174,7 +174,7 @@ void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc } s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) { - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[(u16)this->dyna.actor.params >> 0xA]; + TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA)]; s8 frontRoom = transitionEntry->sides[0].room; s32 doorType = this->doorType; ShutterObjectInfo* temp_t0 = &sObjectInfo[this->unk_16B]; @@ -202,7 +202,7 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) { return true; } } else if (doorType == SHUTTER_FRONT_SWITCH || doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) { - if (!Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { DoorShutter_SetupAction(this, func_80996EE8); this->unk_170 = 1.0f; return true; @@ -228,7 +228,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->dyna.actor.home.pos.z = this->dyna.actor.shape.yOffset; DynaPolyActor_Init(&this->dyna, DPM_UNK); - this->doorType = (this->dyna.actor.params >> 6) & 0xF; + this->doorType = PARAMS_GET(this->dyna.actor.params, 6, 0xF); phi_a3 = D_80998224[this->doorType]; if (phi_a3 < 0) { ShutterSceneInfo* phi_v1; @@ -259,7 +259,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { DoorShutter_SetupAction(this, DoorShutter_SetupType); this->unk_16B = phi_a3; if (this->doorType == SHUTTER_KEY_LOCKED || this->doorType == SHUTTER_BOSS) { - if (!Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { this->unk_16E = 10; } Actor_SetFocus(&this->dyna.actor, 60.0f); @@ -278,7 +278,7 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); if (this->dyna.actor.room >= 0) { - s32 transitionActorId = (u16)this->dyna.actor.params >> 0xA; + s32 transitionActorId = PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA); play->transiActorCtx.list[transitionActorId].id *= -1; } @@ -371,7 +371,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) { DoorShutter_SetupAction(this, func_80997004); this->dyna.actor.velocity.y = 0.0f; if (this->unk_16E != 0) { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); if (this->doorType != SHUTTER_BOSS) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); @@ -468,7 +468,7 @@ s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) { void func_80996EE8(DoorShutter* this, PlayState* play) { if (func_80996E08(this, play, 1.0f)) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { DoorShutter_SetupAction(this, func_80997150); OnePointCutscene_Attention(play, &this->dyna.actor); this->unk_16F = -100; @@ -481,7 +481,7 @@ void func_80996EE8(DoorShutter* this, PlayState* play) { } void func_80996F98(DoorShutter* this, PlayState* play) { - if (this->unk_164 == 0 && !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (this->unk_164 == 0 && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { DoorShutter_SetupAction(this, func_80996EE8); } else { func_80996B0C(this, play); @@ -500,7 +500,7 @@ void func_80997004(DoorShutter* this, PlayState* play) { } else { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYODOOR_CLOSE); if ((this->doorType == SHUTTER_FRONT_SWITCH || this->doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) && - !Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSHUTTER_CLOSE); } DoorShutter_SetupAction(this, func_80997528); @@ -540,7 +540,7 @@ void func_80997220(DoorShutter* this, PlayState* play) { func_8002DBD0(&this->dyna.actor, &vec, &player->actor.world.pos); this->dyna.actor.room = - play->transiActorCtx.list[(u16)this->dyna.actor.params >> 0xA].sides[(vec.z < 0.0f) ? 0 : 1].room; + play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA)].sides[(vec.z < 0.0f) ? 0 : 1].room; if (room != this->dyna.actor.room) { Room tempRoom = play->roomCtx.curRoom; @@ -727,7 +727,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) { } } else { if (sp70->b != NULL) { - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[(u16)this->dyna.actor.params >> 0xA]; + TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA)]; if (play->roomCtx.prevRoom.num >= 0 || transitionEntry->sides[0].room == transitionEntry->sides[1].room) { diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 4621934a126..282c0dda68f 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -165,7 +165,7 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) { gSaveContext.entranceIndex == ENTR_SPOT06_9 || gSaveContext.entranceIndex == ENTR_SPOT11_8 || gSaveContext.entranceIndex == ENTR_SPOT02_8) && gSaveContext.sceneSetupIndex < 4) || - (GET_PLAYER(play)->actor.params & 0xF00) != 0x200) { + PARAMS_GET(GET_PLAYER(play)->actor.params, 0, 0xF00) != 0x200) { Actor_Kill(&this->actor); } if (Actor_WorldDistXZToActor(&player->actor, &this->actor) > 100.0f) { diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 25700a4fe1b..c84f313f4c4 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -47,21 +47,21 @@ s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 161); // "Mutual destruction" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); } Actor_Kill(&this->actor); return 1; - } else if (((this->actor.params >> 8) & 0x3F) == 0x3F) { + } else if (PARAMS_GET(this->actor.params, 8, 0x3F) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { Actor_Kill(&this->actor); return 1; } @@ -72,7 +72,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { ElfMsg* this = (ElfMsg*)thisx; // "Conditions for Elf Tag disappearing" - osSyncPrintf(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", (thisx->params >> 8) & 0x3F); + osSyncPrintf(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET(thisx->params, 8, 0x3F)); osSyncPrintf(VT_FGCOL(CYAN) "\nthisx->shape.angle.sy = %d\n" VT_RST, thisx->shape.rot.y); if (thisx->shape.rot.y >= 0x41) { // "Conditions for Elf Tag appearing" @@ -94,7 +94,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { thisx->scale.y = thisx->world.rot.z * 0.04f; } - if (thisx->params & 0x4000) { + if (PARAMS_GET(thisx->params, 0, 0x4000)) { ElfMsg_SetupAction(this, ElfMsg_CallNaviCuboid); } else { ElfMsg_SetupAction(this, ElfMsg_CallNaviCylinder); @@ -109,10 +109,10 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi - if (this->actor.params & 0x8000) { - return (this->actor.params & 0xFF) + 0x100; + if (PARAMS_GET(this->actor.params, 0, 0x8000)) { + return PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100; } else { - return -((this->actor.params & 0xFF) + 0x100); + return -(PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100); } } @@ -150,8 +150,8 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { if (!ElfMsg_KillCheck(this, play)) { if (Actor_ProcessTalkRequest(&this->actor, play)) { - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); } Actor_Kill(&this->actor); return; @@ -173,7 +173,7 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) { } Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (thisx->params & 0x8000) { + if (PARAMS_GET(thisx->params, 0, 0x8000)) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 100, 100, R_NAVI_MSG_REGION_ALPHA); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, R_NAVI_MSG_REGION_ALPHA); @@ -183,7 +183,7 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_809AD278); - if (thisx->params & 0x4000) { + if (PARAMS_GET(thisx->params, 0, 0x4000)) { gSPDisplayList(POLY_XLU_DISP++, sCubeDL); } else { gSPDisplayList(POLY_XLU_DISP++, sCylinderDL); diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 26cfed8ca4c..81b6c973983 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -47,21 +47,21 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, ((this->actor.params >> 8) & 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2" - if (((this->actor.params >> 8) & 0x3F) != 0x3F) { - Flags_SetSwitch(play, ((this->actor.params >> 8) & 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); } Actor_Kill(&this->actor); return 1; - } else if (((this->actor.params >> 8) & 0x3F) == 0x3F) { + } else if (PARAMS_GET(this->actor.params, 8, 0x3F) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, ((this->actor.params >> 8) & 0x3F))) { + } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction" Actor_Kill(&this->actor); return 1; @@ -93,7 +93,7 @@ void ElfMsg2_Destroy(Actor* thisx, PlayState* play) { } s32 ElfMsg2_GetMessageId(ElfMsg2* this) { - return (this->actor.params & 0xFF) + 0x100; + return PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100; } /** @@ -106,7 +106,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); - switchFlag = (this->actor.params >> 8) & 0x3F; + switchFlag = PARAMS_GET(this->actor.params, 8, 0x3F); if (switchFlag != 0x3F) { Flags_SetSwitch(play, switchFlag); } diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 711327f1389..c6d9ef42b1c 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -104,7 +104,7 @@ void EnBa_Init(Actor* thisx, PlayState* play) { } this->actor.targetMode = 4; - this->upperParams = (thisx->params >> 8) & 0xFF; + this->upperParams = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (this->actor.params < EN_BA_DEAD_BLOB) { diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 70edb68e6b3..206a1cd5c4e 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -318,15 +318,15 @@ void EnBb_Init(Actor* thisx, PlayState* play) { Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, thisx, &sJntSphInit, this->elements); - this->actionState = thisx->params >> 8; + this->actionState = PARAMS_GET_NOMASK(thisx->params, 8); - if (thisx->params & 0x80) { + if (PARAMS_GET(thisx->params, 0, 0x80)) { thisx->params |= 0xFF00; } if (thisx->params <= ENBB_BLUE) { ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawCircle, 35.0f); } - if (thisx->params & 0xFF00) { + if (PARAMS_GET(thisx->params, 0, 0xFF00)) { this->timer = 0; this->flameScaleY = 80.0f; this->flameScaleX = 100.0f; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index 274bbf71da9..b8c9088d34d 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -109,7 +109,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { DynaPoly_DisableCeilingCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->movementFlags = 0; - this->type = thisx->params >> 12 & 0xF; + this->type = PARAMS_GET(thisx->params, 12, 0xF); this->iceSmokeTimer = 0; this->unk_1FB = ENBOX_STATE_0; this->dyna.actor.gravity = -5.5f; @@ -118,7 +118,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { if (play) {} // helps the compiler store play2 into s1 - if (Flags_GetTreasure(play, this->dyna.actor.params & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 0x1F))) { this->alpha = 255; this->iceSmokeTimer = 100; EnBox_SetupAction(this, EnBox_Open); @@ -264,7 +264,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) { } void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { func_8002F5F0(&this->dyna.actor, play); @@ -283,7 +283,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { // used for types 9, 10 void func_809C9700(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); Player* player = GET_PLAYER(play); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { @@ -320,7 +320,7 @@ void func_809C9700(EnBox* this, PlayState* play) { } void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { func_8002F5F0(&this->dyna.actor, play); @@ -334,7 +334,7 @@ void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { } void EnBox_AppearOnRoomClear(EnBox* this, PlayState* play) { - s32 treasureFlag = this->dyna.actor.params & 0x1F; + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { func_8002F5F0(&this->dyna.actor, play); @@ -417,16 +417,16 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { Audio_PlayFanfare(NA_BGM_OPEN_TRE_BOX | 0x900); } } - osSyncPrintf("Actor_Environment_Tbox_On() %d\n", this->dyna.actor.params & 0x1F); - Flags_SetTreasure(play, this->dyna.actor.params & 0x1F); + osSyncPrintf("Actor_Environment_Tbox_On() %d\n", PARAMS_GET(this->dyna.actor.params, 0, 0x1F)); + Flags_SetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 0x1F)); } else { player = GET_PLAYER(play); func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) { - func_8002F554(&this->dyna.actor, play, 0 - (this->dyna.actor.params >> 5 & 0x7F)); + func_8002F554(&this->dyna.actor, play, -PARAMS_GET(this->dyna.actor.params, 5, 0x7F)); } - if (Flags_GetTreasure(play, this->dyna.actor.params & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 0x1F))) { EnBox_SetupAction(this, EnBox_Open); } } @@ -537,7 +537,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 40.0f); } - if ((this->dyna.actor.params >> 5 & 0x7F) == 0x7C && this->actionFunc == EnBox_Open && + if (PARAMS_GET(this->dyna.actor.params, 5, 0x7F) == 0x7C && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) { EnBox_SpawnIceSmoke(this, play); } diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 4ed81251755..0fde933fe11 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -71,17 +71,17 @@ void EnBrob_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->colliders[1]); Collider_SetCylinder(play, &this->colliders[1], &this->dyna.actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); - if (((thisx->params >> 8) & 0xFF) == 0) { + if (PARAMS_GET(thisx->params, 8, 0xFF) == 0) { Actor_SetScale(&this->dyna.actor, 0.01f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= (thisx->params & 0xFF) * (1.0f / 30.0f); + thisx->scale.y *= PARAMS_GET(thisx->params, 0, 0xFF) * (1.0f / 30.0f); } } else { Actor_SetScale(&this->dyna.actor, 0.005f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= (thisx->params & 0xFF) * (2.0f / 30.0f); + thisx->scale.y *= PARAMS_GET(thisx->params, 0, 0xFF) * (2.0f / 30.0f); } } this->colliders[0].dim.radius *= thisx->scale.x; diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 437740daaa2..ff2cea08cc5 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -154,7 +154,7 @@ void EnButte_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET(this->actor.params, 0, 1) == 1) { this->actor.uncullZoneScale = 200.0f; } @@ -268,7 +268,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) { EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]); } - if (((this->actor.params & 1) == 1) && (player->heldItemActionParam == PLAYER_AP_STICK) && + if ((PARAMS_GET(this->actor.params, 0, 1) == 1) && (player->heldItemActionParam == PLAYER_AP_STICK) && (this->swordDownTimer <= 0) && ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) < SQ(120.0f)) || @@ -396,7 +396,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) { this->unk_25E += 0x1000; this->unk_260 += 0x600; - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET(this->actor.params, 0, 1) == 1) { if (GET_PLAYER(play)->meleeWeaponState == 0) { if (this->swordDownTimer > 0) { this->swordDownTimer--; @@ -427,7 +427,7 @@ void EnButte_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->collider); } - if (((this->actor.params & 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { + if ((PARAMS_GET(this->actor.params, 0, 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { EnButte_DrawTransformationEffect(this, play); } } diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 3a45a56b097..4eba5836b60 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -98,7 +98,7 @@ void EnBx_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.mass = MASS_IMMOVABLE; this->unk_14C = 0; thisx->uncullZoneDownward = 2000.0f; - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0xFF)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0xFF))) { Actor_Kill(&this->actor); } thisx->params &= 0xFF; @@ -140,7 +140,7 @@ void EnBx_Update(Actor* thisx, PlayState* play) { (&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) { tmp33 = player->invincibilityTimer & 0xFF; tmp32 = thisx->world.rot.y; - if (!(thisx->params & 0x80)) { + if (!PARAMS_GET(thisx->params, 0, 0x80)) { tmp32 = thisx->yawTowardsPlayer; } if ((&player->actor != this->collider.base.at) && (&player->actor != this->collider.base.ac) && @@ -189,7 +189,7 @@ void EnBx_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - if (thisx->params & 0x80) { + if (PARAMS_GET(thisx->params, 0, 0x80)) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderQuad.base); } } @@ -210,13 +210,13 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x0C, mtx); - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[this->actor.params & 0x7F])); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[PARAMS_GET(this->actor.params, 0, 0x7F)])); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 16, 16, 1, 0, (play->gameplayFrames * -10) % 128, 32, 32)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_bx.c", 478), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (this->actor.params & 0x80) { + if (PARAMS_GET(this->actor.params, 0, 0x80)) { func_809D1D0C(&this->actor, play); } diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 4c1281a70c4..3e052c5e716 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -144,7 +144,7 @@ void EnCs_Init(Actor* thisx, PlayState* play) { sAnimationInfo[ENCS_ANIM_0].morphFrames); this->actor.targetMode = 6; - this->path = this->actor.params & 0xFF; + this->path = PARAMS_GET(this->actor.params, 0, 0xFF); this->unk_1EC = 0; // This variable is unused anywhere else this->talkState = 0; this->currentAnimIndex = -1; diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 5b673d02e66..d74eb5579bc 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -152,13 +152,13 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { s32 noKill = true; s32 isFree = false; - if ((this->actor.params & 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { + if (PARAMS_GET(this->actor.params, 0, 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { isFree = true; - } else if ((this->actor.params & 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { + } else if (PARAMS_GET(this->actor.params, 0, 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { isFree = true; - } else if ((this->actor.params & 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { + } else if (PARAMS_GET(this->actor.params, 0, 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { isFree = true; - } else if ((this->actor.params & 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { + } else if (PARAMS_GET(this->actor.params, 0, 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { isFree = true; } @@ -200,7 +200,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2; this->actionFunc = EnDaiku_Jailed; } else { - if ((this->actor.params & 3) == 1 || (this->actor.params & 3) == 3) { + if (PARAMS_GET(this->actor.params, 0, 3) == 1 || PARAMS_GET(this->actor.params, 0, 3) == 3) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex); this->stateFlags |= ENDAIKU_STATEFLAG_1; } else { @@ -295,7 +295,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { this->actor.textId = 0x6007; } } else if (play->sceneNum == SCENE_TENT) { - switch (this->actor.params & 3) { + switch (PARAMS_GET(this->actor.params, 0, 3)) { case 0: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6060; @@ -378,7 +378,7 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) { void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; EnDaiku_UpdateText(this, play); } @@ -400,14 +400,14 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= - EVENTCHKINF_CARPENTERS_FREE_MASK(this->actor.params & 3); + EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET(this->actor.params, 0, 3)); this->actor.gravity = -1.0f; - this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].maxFramesActive; EnDaiku_InitSubCamera(this, play); exitLoop = false; - path = &play->setupPathList[this->actor.params >> 4 & 0xF]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 4, 0xF)]; while (!exitLoop) { pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; @@ -444,11 +444,11 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { Vec3f eyePosDeltaWorld; this->subCamActive = true; - this->escapeSubCamTimer = sEscapeSubCamParams[this->actor.params & 3].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].maxFramesActive; - eyePosDeltaLocal.x = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.x; - eyePosDeltaLocal.y = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.y; - eyePosDeltaLocal.z = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.z; + eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].eyePosDeltaLocal.x; + eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].eyePosDeltaLocal.y; + eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].eyePosDeltaLocal.z; Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); @@ -522,7 +522,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) { f32 dxz; Vec3s* pointPos; - path = &play->setupPathList[this->actor.params >> 4 & 0xF]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 4, 0xF)]; pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; dz = pointPos->z - this->actor.world.pos.z; @@ -592,13 +592,13 @@ void EnDaiku_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if ((thisx->params & 3) == 0) { + if (PARAMS_GET(thisx->params, 0, 3) == 0) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if ((thisx->params & 3) == 1) { + } else if (PARAMS_GET(thisx->params, 0, 3) == 1) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if ((thisx->params & 3) == 2) { + } else if (PARAMS_GET(thisx->params, 0, 3) == 2) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if ((thisx->params & 3) == 3) { + } else if (PARAMS_GET(thisx->params, 0, 3) == 3) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } @@ -635,7 +635,7 @@ void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, vo if (limb == 15) { // head Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, hairDLists[this->actor.params & 3]); + gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET(this->actor.params, 0, 3)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1330); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 41a669f023e..9f2aa1488d7 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -133,7 +133,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { case SCENE_SPOT01: if (IS_DAY) { this->flags |= 1; - this->flags |= initFlags[this->actor.params & 3]; + this->flags |= initFlags[PARAMS_GET(this->actor.params, 0, 3)]; } break; case SCENE_KAKARIKO: @@ -184,7 +184,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnDaikuKakariko_Run; } else { if (this->flags & 8) { - if (((this->actor.params & 3) == CARPENTER_SABOORO) || ((this->actor.params & 3) == CARPENTER_SHIRO)) { + if ((PARAMS_GET(this->actor.params, 0, 3) == CARPENTER_SABOORO) || (PARAMS_GET(this->actor.params, 0, 3) == CARPENTER_SHIRO)) { EnDaikuKakariko_ChangeAnim(this, ENDAIKUKAKARIKO_ANIM_5, &this->currentAnimIndex); this->flags |= 0x800; } else { @@ -239,10 +239,10 @@ void EnDaikuKakariko_HandleTalking(EnDaikuKakariko* this, PlayState* play) { if ((sp26 >= 0) && (sp26 <= 320) && (sp24 >= 0) && (sp24 <= 240) && (this->talkState == 0) && (func_8002F2CC(&this->actor, play, 100.0f) == 1)) { - this->actor.textId = Text_GetFaceReaction(play, maskReactionSets[this->actor.params & 3]); + this->actor.textId = Text_GetFaceReaction(play, maskReactionSets[PARAMS_GET(this->actor.params, 0, 3)]); if (this->actor.textId == 0) { - switch (this->actor.params & 3) { + switch (PARAMS_GET(this->actor.params, 0, 3)) { case 0: if (this->flags & 8) { this->actor.textId = 0x5076; @@ -359,7 +359,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { s32 run; do { - path = &play->setupPathList[(this->actor.params >> 8) & 0xFF]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 8, 0xFF)]; pathPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->waypoint]; xDist = pathPos->x - this->actor.world.pos.x; zDist = pathPos->z - this->actor.world.pos.z; @@ -531,7 +531,7 @@ void EnDaikuKakariko_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V if (limbIndex == 15) { Matrix_MultVec3f(&unkVec, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[this->actor.params & 3]); + gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET(this->actor.params, 0, 3)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku_kakariko.c", 1113); @@ -544,13 +544,13 @@ void EnDaikuKakariko_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if ((thisx->params & 3) == CARPENTER_ICHIRO) { + if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_ICHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if ((thisx->params & 3) == CARPENTER_SABOORO) { + } else if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_SABOORO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if ((thisx->params & 3) == CARPENTER_JIRO) { + } else if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_JIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if ((thisx->params & 3) == CARPENTER_SHIRO) { + } else if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_SHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 6ade12dbea6..ed2fbf5ff48 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -119,7 +119,7 @@ void EnDekunuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->shotsPerRound = ((thisx->params >> 8) & 0xFF); + this->shotsPerRound = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if ((this->shotsPerRound == 0xFF) || (this->shotsPerRound == 0)) { this->shotsPerRound = 1; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index afd70c7dd0c..97654cf5d3e 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -190,7 +190,7 @@ s8 EnDog_CanFollow(EnDog* this, PlayState* play) { if (gSaveContext.dogParams != 0) { return 0; } - gSaveContext.dogParams = (this->actor.params & 0x7FFF); + gSaveContext.dogParams = PARAMS_GET2(this->actor.params, 0, 0x7FFF); return 1; } @@ -248,12 +248,12 @@ void EnDog_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, NULL, this->jointTable, this->morphTable, 13); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDOG_ANIM_0); - if ((this->actor.params & 0x8000) == 0) { - this->actor.params = (this->actor.params & 0xF0FF) | ((((this->actor.params & 0x0F00) >> 8) + 1) << 8); + if (PARAMS_GET2(this->actor.params, 0, 0x8000) == 0) { + this->actor.params = PARAMS_GET2(this->actor.params, 0, 0xF0FF) | ((PARAMS_GET2(this->actor.params, 8, 0x0F00) + 1) << 8); } followingDog = ((gSaveContext.dogParams & 0x0F00) >> 8); - if (followingDog == ((this->actor.params & 0x0F00) >> 8) && ((this->actor.params & 0x8000) == 0)) { + if (followingDog == PARAMS_GET2(this->actor.params, 8, 0x0F00) && PARAMS_GET2(this->actor.params, 0, 0x8000) == 0) { Actor_Kill(&this->actor); return; } @@ -264,16 +264,16 @@ void EnDog_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; - this->path = Path_GetByIndex(play, (this->actor.params & 0x00F0) >> 4, 0xF); + this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 4, 0x00F0), 0xF); switch (play->sceneNum) { case SCENE_MARKET_NIGHT: - if ((!gSaveContext.dogIsLost) && (((this->actor.params & 0x0F00) >> 8) == 1)) { + if ((!gSaveContext.dogIsLost) && PARAMS_GET2(this->actor.params, 8, 0x0F00) == 1) { Actor_Kill(&this->actor); } break; case SCENE_IMPA: // Richard's Home - if (!(this->actor.params & 0x8000)) { + if (!PARAMS_GET2(this->actor.params, 0, 0x8000)) { if (!gSaveContext.dogIsLost) { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_Wait; @@ -287,7 +287,7 @@ void EnDog_Init(Actor* thisx, PlayState* play) { break; } - if (this->actor.params & 0x8000) { + if (PARAMS_GET2(this->actor.params, 0, 0x8000)) { this->nextBehavior = DOG_WALK; this->actionFunc = EnDog_FollowPlayer; } else { @@ -477,8 +477,8 @@ void EnDog_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, colors[this->actor.params & 0xF].r, colors[this->actor.params & 0xF].g, - colors[this->actor.params & 0xF].b, colors[this->actor.params & 0xF].a); + gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET2(this->actor.params, 0, 0xF)].r, colors[PARAMS_GET2(this->actor.params, 0, 0xF)].g, + colors[PARAMS_GET2(this->actor.params, 0, 0xF)].b, colors[PARAMS_GET2(this->actor.params, 0, 0xF)].a); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDog_OverrideLimbDraw, EnDog_PostLimbDraw, this); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 057ef258d82..53533422d29 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -113,7 +113,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { } // Double doors - if (this->actor.params & 0x40) { + if (PARAMS_GET(this->actor.params, 0, 0x40)) { EnDoor* other; xOffset = Math_CosS(this->actor.shape.rot.y) * 30.0f; @@ -135,7 +135,7 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play) { TransitionActorEntry* transitionEntry; EnDoor* this = (EnDoor*)thisx; - transitionEntry = &play->transiActorCtx.list[(u16)this->actor.params >> 0xA]; + transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->actor.params, 0xA)]; if (transitionEntry->id < 0) { transitionEntry->id = -transitionEntry->id; } @@ -145,7 +145,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { s32 doorType; if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) { - doorType = this->actor.params >> 7 & 7; + doorType = PARAMS_GET(this->actor.params, 7, 7); this->actor.flags &= ~ACTOR_FLAG_4; this->actor.objBankIndex = this->requiredObjBankIndex; this->actionFunc = EnDoor_Idle; @@ -156,7 +156,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { } this->actor.world.rot.y = 0x0000; if (doorType == DOOR_LOCKED) { - if (!Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { this->lockTimer = 10; } } else if (doorType == DOOR_AJAR) { @@ -165,7 +165,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { this->actor.world.rot.y = -0x1800; } } else if (doorType == DOOR_CHECKABLE) { - this->actor.textId = (this->actor.params & 0x3F) + 0x0200; + this->actor.textId = PARAMS_GET(this->actor.params, 0, 0x3F) + 0x0200; if (this->actor.textId == 0x0229 && !GET_EVENTCHKINF(EVENTCHKINF_14)) { // Talon's house door. If Talon has not been woken up at Hyrule Castle // this door should be openable at any time of day. Note that there is no @@ -188,7 +188,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { Vec3f playerPosRelToDoor; s16 yawDiff; - doorType = this->actor.params >> 7 & 7; + doorType = PARAMS_GET(this->actor.params, 7, 7); func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); if (this->playerIsOpening != 0) { this->actionFunc = EnDoor_Open; @@ -196,7 +196,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { (player->stateFlags1 & PLAYER_STATE1_27) ? 0.75f : 1.5f); if (this->lockTimer != 0) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } } else if (!Player_InCsMode(play)) { @@ -306,7 +306,7 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* if (limbIndex == 4) { doorDLists = sDoorDLists[this->dListIndex]; - transitionEntry = &play->transiActorCtx.list[(u16)this->actor.params >> 0xA]; + transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->actor.params, 0xA)]; rot->z += this->actor.world.rot.y; if ((play->roomCtx.prevRoom.num >= 0) || (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) { rotDiff = ((this->actor.shape.rot.y + this->skelAnime.jointTable[3].z) + rot->z) - diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 015779aa848..a824767190c 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -44,9 +44,9 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { return; } - this->spawnType = (this->actor.params >> 0xB) & 0x1F; - this->maxCurSpawns = (this->actor.params >> 6) & 0x1F; - this->maxTotalSpawns = this->actor.params & 0x3F; + this->spawnType = PARAMS_GET(this->actor.params, 0xB, 0x1F); + this->maxCurSpawns = PARAMS_GET(this->actor.params, 6, 0x1F); + this->maxTotalSpawns = PARAMS_GET(this->actor.params, 0, 0x3F); this->curNumSpawn = this->totalNumSpawn = 0; spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 428c83e21dd..9c6909b1047 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -52,8 +52,8 @@ void EnExItem_Init(Actor* thisx, PlayState* play) { EnExItem* this = (EnExItem*)thisx; this->actor.flags &= ~ACTOR_FLAG_0; - this->type = this->actor.params & 0xFF; - this->unusedParam = (this->actor.params >> 8) & 0xFF; + this->type = PARAMS_GET(this->actor.params, 0, 0xFF); + this->unusedParam = PARAMS_GET(this->actor.params, 8, 0xFF); osSyncPrintf("\n\n"); // "What will come out?" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index ee6129effa7..c72015e9327 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -638,9 +638,9 @@ void EnFd_WaitForCore(EnFd* this, PlayState* play) { if (this->spinTimer == 0) { Actor_Kill(&this->actor); } - } else if (this->actor.params & FLG_COREDONE) { + } else if (PARAMS_GET(this->actor.params, 0, FLG_COREDONE)) { this->actionFunc = EnFd_Reappear; - } else if (this->actor.params & FLG_COREDEAD) { + } else if (PARAMS_GET(this->actor.params, 0, FLG_COREDEAD)) { this->actor.params = 0; this->spinTimer = 30; } diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index dd21184ae57..69343d461cd 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -155,7 +155,7 @@ void func_80A0E70C(EnFdFire* this, PlayState* play) { this->actor.velocity = velocity; this->actor.speedXZ = 0.0f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; - if (this->actor.params & 0x8000) { + if (PARAMS_GET2(this->actor.params, 0, 0x8000)) { this->deathTimer = 200; this->actionFunc = EnFdFire_DanceTowardsPlayer; } else { @@ -179,7 +179,7 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play) { Vec3f pos; s16 idx; - idx = ((play->state.frames / 10) + (this->actor.params & 0x7FFF)) % ARRAY_COUNT(angles); + idx = ((play->state.frames / 10) + PARAMS_GET2(this->actor.params, 0, 0x7FFF)) % ARRAY_COUNT(angles); pos = player->actor.world.pos; pos.x += 120.0f * sinf(angles[idx]); pos.z += 120.0f * cosf(angles[idx]); @@ -271,14 +271,14 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { gSPSegment( POLY_XLU_DISP++, 0x8, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->tile2Y, 0x20, 0x80)); - gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[((this->actor.params & 0x8000) >> 0xF)].r, - primColors[((this->actor.params & 0x8000) >> 0xF)].g, - primColors[((this->actor.params & 0x8000) >> 0xF)].b, - primColors[((this->actor.params & 0x8000) >> 0xF)].a); - gDPSetEnvColor(POLY_XLU_DISP++, envColors[((this->actor.params & 0x8000) >> 0xF)].r, - envColors[((this->actor.params & 0x8000) >> 0xF)].g, - envColors[((this->actor.params & 0x8000) >> 0xF)].b, - envColors[((this->actor.params & 0x8000) >> 0xF)].a); + gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].r, + primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].g, + primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].b, + primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].a); + gDPSetEnvColor(POLY_XLU_DISP++, envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].r, + envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].g, + envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].b, + envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].a); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 9030102846a..6047081064f 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -146,7 +146,7 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) { Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - if ((this->actor.params & 0x8000) != 0) { + if (PARAMS_GET(this->actor.params, 0, 0x8000) != 0) { this->actor.flags |= ACTOR_FLAG_7; if (1) {} this->actor.draw = EnFirefly_DrawInvisible; diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index ddf7ca49b23..c75ab5bc1ac 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -133,7 +133,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->zOffset = -1600; - invisble = this->actor.params & SPAWN_INVISIBLE; + invisble = PARAMS_GET(this->actor.params, 0, SPAWN_INVISIBLE); // s16 cast needed this->actor.params &= (s16) ~(SPAWN_INVISIBLE); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index 058a80a5d8e..cac6a99d438 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -80,8 +80,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { s32 pad; EnGSwitch* this = (EnGSwitch*)thisx; - this->type = (this->actor.params >> 0xC) & 0xF; - this->switchFlag = this->actor.params & 0x3F; + this->type = PARAMS_GET(this->actor.params, 0xC, 0xF); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); this->numEffects = EN_GSWITCH_EFFECT_COUNT; // "index" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); @@ -93,7 +93,9 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { // "parent switch spawn" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); sCollectedCount = 0; - this->silverCount = this->actor.params >> 6; + // Ideally the following two lines would be + // this->silverCount = PARAMS_GET(this->actor.params, 6, 0x3F); + this->silverCount = PARAMS_GET_NOMASK(this->actor.params, 6); this->silverCount &= 0x3F; // "maximum number of checks" osSyncPrintf(VT_FGCOL(MAGENTA) "☆☆☆☆☆ 最大チェック数 ☆☆☆☆☆ %d\n" VT_RST, this->silverCount); diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index b9e649daf5c..9a01ac5457c 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -104,7 +104,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { // In Gerudo Valley this->actor.uncullZoneForward = ((play->sceneNum == SCENE_SPOT09) ? 1000.0f : 1200.0f); - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET(this->actor.params, 0, 0xFF)) { case GE1_TYPE_GATE_GUARD: this->hairstyle = GE1_HAIR_SPIKY; @@ -330,7 +330,7 @@ void EnGe1_WaitTillOpened_GTGGuard(EnGe1* this, PlayState* play) { void EnGe1_Open_GTGGuard(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitTillOpened_GTGGuard; - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -423,7 +423,7 @@ void EnGe1_WaitUntilGateOpened_GateOp(EnGe1* this, PlayState* play) { void EnGe1_OpenGate_GateOp(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitUntilGateOpened_GateOp; - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -445,7 +445,7 @@ void EnGe1_SetupOpenGate_GateOp(EnGe1* this, PlayState* play) { } void EnGe1_CheckGate_GateOp(EnGe1* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { EnGe1_SetTalkAction(this, play, 0x6018, 100.0f, EnGe1_WaitGateOpen_GateOp); } else { EnGe1_SetTalkAction(this, play, 0x6017, 100.0f, EnGe1_SetupOpenGate_GateOp); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index 2248ade02ac..adbfd144a77 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -133,7 +133,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.z = 0; this->actor.shape.rot.z = 0; - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET2(this->actor.params, 0, 0xFF)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); if (EnGe2_CheckCarpentersFreed()) { @@ -165,7 +165,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; this->walkDirection = this->actor.world.rot.y; - this->walkDuration = ((this->actor.params & 0xFF00) >> 8) * 10; + this->walkDuration = PARAMS_GET2(this->actor.params, 8, 0xFF00) * 10; } void EnGe2_Destroy(Actor* thisx, PlayState* play) { @@ -425,7 +425,7 @@ void EnGe2_LookAtPlayer(EnGe2* this, PlayState* play) { void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - switch (this->actor.params & 0xFF) { + switch (PARAMS_GET2(this->actor.params, 0, 0xFF)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN); break; @@ -520,7 +520,7 @@ void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (Actor_ProcessTalkRequest(&this->actor, play)) { - if ((this->actor.params & 0xFF) == GE2_TYPE_PATROLLING) { + if (PARAMS_GET2(this->actor.params, 0, 0xFF) == GE2_TYPE_PATROLLING) { this->actor.speedXZ = 0.0f; EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER); } @@ -575,7 +575,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { EnGe2_SetupCapturePlayer(this, play); } - if (((this->actor.params & 0xFF) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { + if ((PARAMS_GET2(this->actor.params, 0, 0xFF) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); EnGe2_SetupCapturePlayer(this, play); @@ -583,7 +583,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } if (!(this->stateFlags & GE2_STATE_KO)) { - paramsType = this->actor.params & 0xFF; // Not necessary, but looks a bit nicer + paramsType = PARAMS_GET2(this->actor.params, 0, 0xFF); // Not necessary, but looks a bit nicer if ((paramsType == GE2_TYPE_PATROLLING) || (paramsType == GE2_TYPE_STATIONARY)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 9271920133b..f8a0d1246cb 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -228,7 +228,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; thisx->naviEnemyId = NAVI_ENEMY_GERUDO_THIEF; - this->keyFlag = thisx->params & 0xFF00; + this->keyFlag = PARAMS_GET(thisx->params, 0, 0xFF00); thisx->params &= 0xFF; this->blinkState = 0; this->unkFloat = 10.0f; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index de9f51e0901..413618adfbc 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -91,7 +91,7 @@ void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) { u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); - switch (thisx->params & 0xF0) { + switch (PARAMS_GET(thisx->params, 0, 0xF0)) { case 0x90: if (gSaveContext.bgsFlag) { return 0x305E; @@ -135,7 +135,7 @@ u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { } } case 0x10: - if (Flags_GetSwitch(play, thisx->params >> 8)) { + if (Flags_GetSwitch(play, PARAMS_GET_NOMASK(thisx->params, 8))) { return 0x3052; } else { return 0x3051; @@ -351,7 +351,7 @@ s32 func_80A3ED24(PlayState* play, EnGo* this, struct_80034A14_arg1* arg2, f32 a void EnGo_ChangeAnim(EnGo* this, s32 index) { Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, - sAnimationInfo[index].playSpeed * ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f), 0.0f, + sAnimationInfo[index].playSpeed * (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f), 0.0f, Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames); } @@ -359,18 +359,18 @@ void EnGo_ChangeAnim(EnGo* this, s32 index) { s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { if (((this->actor.params) & 0xF0) == 0x90) { return true; - } else if (play->sceneNum == SCENE_HIDAN && !Flags_GetSwitch(play, (this->actor.params) >> 8) && LINK_IS_ADULT && - (this->actor.params & 0xF0) == 0x10) { + } else if (play->sceneNum == SCENE_HIDAN && !Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && LINK_IS_ADULT && + PARAMS_GET(this->actor.params, 0, 0xF0) == 0x10) { return true; - } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && (this->actor.params & 0xF0) == 0x00) { + } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && PARAMS_GET(this->actor.params, 0, 0xF0) == 0x00) { return true; } else if (play->sceneNum == SCENE_SPOT16 && LINK_IS_CHILD && - ((this->actor.params & 0xF0) == 0x20 || (this->actor.params & 0xF0) == 0x30 || - (this->actor.params & 0xF0) == 0x40)) { + (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x20 || PARAMS_GET(this->actor.params, 0, 0xF0) == 0x30 || + PARAMS_GET(this->actor.params, 0, 0xF0) == 0x40)) { return true; } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_CHILD && - ((this->actor.params & 0xF0) == 0x50 || (this->actor.params & 0xF0) == 0x60 || - (this->actor.params & 0xF0) == 0x70)) { + (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x50 || PARAMS_GET(this->actor.params, 0, 0xF0) == 0x60 || + PARAMS_GET(this->actor.params, 0, 0xF0) == 0x70)) { return true; } else { return false; @@ -378,7 +378,7 @@ s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { } f32 EnGo_GetGoronSize(EnGo* this) { - switch (this->actor.params & 0xF0) { + switch (PARAMS_GET(this->actor.params, 0, 0xF0)) { case 0x00: return 10.0f; case 0x20: @@ -428,7 +428,7 @@ s32 EnGo_IsCameraModified(EnGo* this, PlayState* play) { } xyzDistSq = (this->actor.scale.x / 0.01f) * 10000.0f; - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); xyzDistSq *= 4.8f; } @@ -469,11 +469,11 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { f32 xDist; f32 zDist; - if ((this->actor.params & 0xF) == 15) { + if (PARAMS_GET(this->actor.params, 0, 0xF) == 15) { return false; } - path = &play->setupPathList[this->actor.params & 0xF]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xF)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->unk_218; xDist = pointPos->x - this->actor.world.pos.x; @@ -486,9 +486,9 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { this->unk_218 = 0; } - if ((this->actor.params & 0xF0) != 0x00) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x00) { return true; - } else if (Flags_GetSwitch(play, this->actor.params >> 8)) { + } else if (Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8))) { return true; } else if (this->unk_218 >= this->actor.shape.rot.z) { this->unk_218 = 0; @@ -504,10 +504,10 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) { Path* path; Vec3s* pointPos; - if ((this->actor.params & 0xF) == 0xF) { + if (PARAMS_GET(this->actor.params, 0, 0xF) == 0xF) { return false; } else { - path = &play->setupPathList[this->actor.params & 0xF]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xF)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += (path->count - 1); this->actor.world.pos.x = pointPos->x; @@ -581,18 +581,18 @@ void func_80A3F908(EnGo* this, PlayState* play) { float1 = (this->collider.dim.radius + 30.0f); float1 *= (this->actor.scale.x / 0.01f); - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { float1 *= 4.8f; } - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { isUnkCondition = func_80A3ED24(play, this, &this->unk_1E0, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } else { isUnkCondition = func_800343CC(play, &this->actor, &this->unk_1E0.unk_00, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } - if (((this->actor.params & 0xF0) == 0x90) && (isUnkCondition == true)) { + if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) && (isUnkCondition == true)) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_SWORD_BROKEN) { if (func_8002F368(play) == EXCH_ITEM_SWORD_BROKEN) { if (GET_INFTABLE(INFTABLE_B4)) { @@ -635,7 +635,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { return; } - if ((this->actor.params & 0xF0) && ((this->actor.params & 0xF0) != 0x90)) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) && (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90)) { this->actor.flags &= ~ACTOR_FLAG_4; this->actor.flags &= ~ACTOR_FLAG_5; } @@ -645,7 +645,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { this->unk_1E0.unk_00 = 0; this->actor.gravity = -1.0f; - switch (this->actor.params & 0xF0) { + switch (PARAMS_GET(this->actor.params, 0, 0xF0)) { case 0x00: Actor_SetScale(&this->actor, 0.008f); if (CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { @@ -747,7 +747,7 @@ void func_80A4008C(EnGo* this, PlayState* play) { } void EnGo_GoronLinkRolling(EnGo* this, PlayState* play) { - if ((EnGo_FollowPath(this, play) == true) && Flags_GetSwitch(play, this->actor.params >> 8) && + if ((EnGo_FollowPath(this, play) == true) && Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && (this->unk_218 == 0)) { this->actor.speedXZ = 0.0f; EnGo_SetupAction(this, func_80A4008C); @@ -770,10 +770,10 @@ void EnGo_CurledUp(EnGo* this, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->skelAnime.playSpeed = 0.1f; - this->skelAnime.playSpeed *= (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, EnGo_WakeUp); - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); } } @@ -783,7 +783,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -793,7 +793,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if ((this->actor.params & 0xF0) != 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90) { this->unk_212 = 30; return; } @@ -814,7 +814,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { void func_80A40494(EnGo* this, PlayState* play) { f32 frame; - Math_SmoothStepToF(&this->skelAnime.playSpeed, ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -836,7 +836,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { f32 frame; lastFrame = Animation_GetLastFrame(&gGoronAnim_004930); - Math_SmoothStepToF(&this->skelAnime.playSpeed, (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; @@ -846,7 +846,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { this->skelAnime.curFrame = lastFrame; this->skelAnime.playSpeed = 0.0f; this->unk_212 = Rand_S16Offset(30, 30); - if (((this->actor.params & 0xF0) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { + if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { EnGo_SetupAction(this, func_80A40B1C); } else { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); @@ -855,7 +855,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { } void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { - if (((this->actor.params & 0xF0) == 0x90) && (this->unk_1E0.unk_00 == 2)) { + if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) && (this->unk_1E0.unk_00 == 2)) { if (gSaveContext.bgsFlag) { this->unk_1E0.unk_00 = 0; } else { @@ -874,7 +874,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { EnGo_GetItem(this, play); } } - } else if (((this->actor.params & 0xF0) == 0) && (this->unk_1E0.unk_00 == 2)) { + } else if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0) && (this->unk_1E0.unk_00 == 2)) { EnGo_SetupAction(this, EnGo_GetItem); play->msgCtx.stateTimer = 4; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -882,7 +882,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { if ((DECR(this->unk_212) == 0) && !EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); this->skelAnime.playSpeed = -0.1f; - this->skelAnime.playSpeed *= (this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, func_80A408D8); } } @@ -892,7 +892,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, ((this->actor.params & 0xF0) == 0x90 ? 0.5f : 1.0f) * -1.0f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f) * -1.0f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -901,7 +901,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if ((this->actor.params & 0xF0) != 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90) { this->unk_212 = 30; return; } @@ -952,7 +952,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { EnGo_SetupAction(this, func_80A40C78); } else { this->unk_20C = 0; - if ((this->actor.params & 0xF0) == 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { getItemId = GI_SWORD_BGS; this->unk_20C = 1; @@ -965,7 +965,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { } } - if ((this->actor.params & 0xF0) == 0) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0) { getItemId = GI_TUNIC_GORON; } @@ -978,7 +978,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { void func_80A40C78(EnGo* this, PlayState* play) { if (this->unk_1E0.unk_00 == 3) { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); - if ((this->actor.params & 0xF0) != 0x90) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90) { this->unk_1E0.unk_00 = 0; } else if (this->unk_20C) { this->unk_1E0.unk_00 = 0; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index cd988eb6225..531d9e2f6af 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -32,13 +32,13 @@ INFTABLE_10F - (not on cloud modding) INFTABLE_11E - Bomb bag upgrade obtained from rolling Goron EnGo -pathIndex: this->actor.params & 0xF -Goron: this->actor.params & 0xF0 +pathIndex: PARAMS_GET2(this->actor.params, 0, 0xF) +Goron: PARAMS_GET2(this->actor.params, 0, 0xF0) EnGo2 -(this->actor.params & 0x3E0) >> 5 -(this->actor.params & 0xFC00) >> 0xA - Gorons in Fire Temple -this->actor.params & 0x1F +PARAMS_GET2(this->actor.params, 5, 0x3E0) +PARAMS_GET2(this->actor.params, 0xA, 0xFC00) - Gorons in Fire Temple +PARAMS_GET2(this->actor.params, 0, 0x1F) Gorons only move when this->unk_194.unk_00 == 0 */ @@ -300,7 +300,7 @@ s32 EnGo2_GetDialogState(EnGo2* this, PlayState* play) { } u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) { - switch ((this->actor.params & 0xFC00) >> 0xA) { + switch (PARAMS_GET2(this->actor.params, 0xA, 0xFC00)) { case 3: return 0x3069; case 5: @@ -645,7 +645,7 @@ s16 EnGo2_GetStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronFireGeneric(PlayState* play, EnGo2* this) { - if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 0xA, 0xFC00))) { return 0x3071; } else { return 0x3051; @@ -745,7 +745,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { if (faceReaction != 0) { return faceReaction; } else { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetTextIdGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -783,7 +783,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { s16 EnGo2_GetState(PlayState* play, Actor* thisx) { EnGo2* this = (EnGo2*)thisx; - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetStateGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -821,9 +821,9 @@ s16 EnGo2_GetState(PlayState* play, Actor* thisx) { } s32 func_80A44790(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON && (this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BIGGORON && PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_ROLLING_BIG) { return func_800343CC(play, &this->actor, &this->unk_194.unk_00, this->unk_218, EnGo2_GetTextId, EnGo2_GetState); - } else if (((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) && + } else if ((PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { return false; } else { @@ -841,14 +841,14 @@ s32 func_80A44790(EnGo2* this, PlayState* play) { } void EnGo2_SetColliderDim(EnGo2* this) { - u8 index = this->actor.params & 0x1F; + u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); this->collider.dim.radius = D_80A4816C[index].radius; this->collider.dim.height = D_80A4816C[index].height; } void EnGo2_SetShape(EnGo2* this) { - u8 index = this->actor.params & 0x1F; + u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10; Actor_SetScale(&this->actor, D_80A481F8[index].scale); @@ -864,10 +864,10 @@ void EnGo2_CheckCollision(EnGo2* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - xzDist = D_80A4816C[this->actor.params & 0x1F].xzDist; + xzDist = D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].xzDist; pos.x += (s16)(xzDist * Math_SinS(this->actor.shape.rot.y)); pos.z += (s16)(xzDist * Math_CosS(this->actor.shape.rot.y)); - pos.y += D_80A4816C[this->actor.params & 0x1F].yDist; + pos.y += D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].yDist; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -885,7 +885,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 arg2; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { return false; } else { if ((this->actionFunc != EnGo2_SlowRolling) && (this->actionFunc != EnGo2_ReverseRolling) && @@ -965,11 +965,11 @@ s32 func_80A44D84(EnGo2* this) { s32 EnGo2_IsWakingUp(EnGo2* this) { s16 yawDiff; - f32 xyzDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; - f32 yDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 yDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; s16 yawDiffAbs; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { if (!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { this->actor.flags &= ~ACTOR_FLAG_0; return false; @@ -1006,7 +1006,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { } if (this->unk_59C >= 2) { - Audio_PlayActorSound2(&this->actor, (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG + Audio_PlayActorSound2(&this->actor, PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG ? NA_SE_EN_GOLON_LAND_BIG : NA_SE_EN_DODO_M_GND); } @@ -1030,7 +1030,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { u16 textId; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { if (gSaveContext.bgsFlag) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { this->actor.textId = 0x3003; @@ -1093,7 +1093,7 @@ void func_80A45288(EnGo2* this, PlayState* play) { if (this->actionFunc != EnGo2_GoronFireGenericAction) { this->unk_194.unk_18 = player->actor.world.pos; - this->unk_194.unk_14 = D_80A482D8[this->actor.params & 0x1F][((void)0, gSaveContext.linkAge)]; + this->unk_194.unk_14 = D_80A482D8[PARAMS_GET2(this->actor.params, 0, 0x1F)][((void)0, gSaveContext.linkAge)]; func_80034A14(&this->actor, &this->unk_194, 4, this->unk_26E); } if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) { @@ -1126,7 +1126,7 @@ void EnGo2_RollForward(EnGo2* this) { } void func_80A454CC(EnGo2* this) { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_CITY_ROLLING_BIG: case GORON_DMT_DC_ENTRANCE: case GORON_CITY_ENTRANCE: @@ -1147,8 +1147,8 @@ void func_80A454CC(EnGo2* this) { } f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { - f32 yDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; - s32 index = this->actor.params & 0x1F; + f32 yDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + s32 index = PARAMS_GET2(this->actor.params, 0, 0x1F); if (index == GORON_CITY_LINK && (fabsf(this->actor.yDistToPlayer) < yDist) && (this->actor.xzDistToPlayer < 400.0f)) { @@ -1161,7 +1161,7 @@ f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN]; - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { if (EnGo2_IsWakingUp(this)) { Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); func_8005AD1C(mainCam, 4); @@ -1171,9 +1171,9 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { } } - if ((this->actor.params & 0x1F) == GORON_FIRE_GENERIC || (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || - (this->actor.params & 0x1F) == GORON_CITY_STAIRWELL || (this->actor.params & 0x1F) == GORON_DMT_BIGGORON || - (this->actor.params & 0x1F) == GORON_MARKET_BAZAAR) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_FIRE_GENERIC || PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG || + PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_STAIRWELL || PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON || + PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_MARKET_BAZAAR) { return true; } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { return true; @@ -1197,7 +1197,7 @@ void EnGo2_DefaultWakingUp(EnGo2* this) { } void EnGo2_WakingUp(EnGo2* this) { - f32 xyzDist = (this->actor.params & 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; s32 isTrue = true; xyzDist = SQ(xyzDist); @@ -1220,7 +1220,7 @@ void EnGo2_BiggoronWakingUp(EnGo2* this) { } void EnGo2_SelectGoronWakingUp(EnGo2* this) { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_DMT_BOMB_FLOWER: this->isAwake = true; this->unk_26E = EnGo2_IsWakingUp(this) ? 2 : 1; @@ -1275,7 +1275,7 @@ void EnGo2_EyeMouthTexState(EnGo2* this) { void EnGo2_SitDownAnimation(EnGo2* this) { if ((this->skelAnime.playSpeed != 0.0f) && (this->skelAnime.animation == &gGoronAnim_004930)) { if (this->skelAnime.playSpeed > 0.0f && this->skelAnime.curFrame == 14.0f) { - if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BIGGORON) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_SIT_DOWN); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60); @@ -1293,7 +1293,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) { } void EnGo2_GetDustData(EnGo2* this, s32 index2) { - s32 index1 = (this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG ? 1 : 0; + s32 index1 = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG ? 1 : 0; EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2]; EnGo2_SpawnDust(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep, @@ -1301,7 +1301,7 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) { } void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { this->actor.flags &= ~ACTOR_FLAG_0; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = -0.5f; @@ -1318,13 +1318,13 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { void EnGo2_WakeUp(EnGo2* this, PlayState* play) { if (this->skelAnime.playSpeed == 0.0f) { - if ((this->actor.params & 0x1F) != GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BIGGORON) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } } - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = 0.5f; @@ -1345,7 +1345,7 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) { } void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) == GORON_CITY_ROLLING_BIG || (this->actor.params & 0x1F) == GORON_CITY_LINK) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG || PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_LINK) { this->collider.info.bumperFlags = BUMP_ON; this->actor.speedXZ = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f; } else { @@ -1361,8 +1361,8 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { void EnGo2_StopRolling(EnGo2* this, PlayState* play) { EnBom* bomb; - if (((this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG) && ((this->actor.params & 0x1F) != GORON_CITY_LINK)) { - if ((this->actor.params & 0x1F) == GORON_DMT_ROLLING_SMALL) { + if ((PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_ROLLING_BIG) && (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_LINK)) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_ROLLING_SMALL) { bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bomb != NULL) { @@ -1382,20 +1382,20 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) { } s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) != GORON_FIRE_GENERIC) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_FIRE_GENERIC) { return false; } // shaking curled up this->actor.world.pos.x += (play->state.frames & 1) ? 1.0f : -1.0f; - if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 0xA, 0xFC00))) { return true; } return false; } s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { - if ((this->actor.params & 0x1F) != GORON_DMT_BOMB_FLOWER || this->unk_194.unk_00 != 2) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BOMB_FLOWER || this->unk_194.unk_00 != 2) { return false; } @@ -1408,7 +1408,7 @@ s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { } s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { - if ((this->actor.params & 0x1F) != GORON_CITY_ROLLING_BIG || (this->unk_194.unk_00 != 2)) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_ROLLING_BIG || (this->unk_194.unk_00 != 2)) { return false; } this->unk_194.unk_00 = 0; @@ -1418,7 +1418,7 @@ s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { } s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { - if ((this->actor.params & 0x1F) != GORON_FIRE_GENERIC || this->unk_194.unk_00 == 0) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_FIRE_GENERIC || this->unk_194.unk_00 == 0) { return false; } this->actionFunc = EnGo2_GoronFireGenericAction; @@ -1426,7 +1426,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { } s32 EnGo2_IsGoronLinkReversing(EnGo2* this) { - if ((this->actor.params & 0x1F) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || + if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || !EnGo2_IsWakingUp(this)) { return false; } @@ -1449,7 +1449,7 @@ s32 EnGo2_IsRolling(EnGo2* this) { void EnGo2_GoronLinkAnimation(EnGo2* this, PlayState* play) { s32 animation = ARRAY_COUNT(sAnimationInfo); - if ((this->actor.params & 0x1F) == GORON_CITY_LINK) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_LINK) { if ((this->actor.textId == 0x3035 && this->unk_20C == 0) || (this->actor.textId == 0x3036 && this->unk_20C == 0)) { if (this->skelAnime.animation != &gGoronAnim_000D5C) { @@ -1502,7 +1502,7 @@ void EnGo2_GoronFireClearCamera(EnGo2* this, PlayState* play) { void EnGo2_BiggoronAnimation(EnGo2* this) { if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_SWORD_BROKEN && INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYEDROPS && - (this->actor.params & 0x1F) == GORON_DMT_BIGGORON && this->unk_194.unk_00 == 0) { + PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON && this->unk_194.unk_00 == 0) { if (DECR(this->animTimer) == 0) { this->animTimer = Rand_S16Offset(30, 30); func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_EYE_BIG, 60); @@ -1521,7 +1521,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); // Not GORON_CITY_ROLLING_BIG, GORON_CITY_LINK, GORON_DMT_BIGGORON - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_FIRE_GENERIC: case GORON_DMT_BOMB_FLOWER: case GORON_DMT_ROLLING_SMALL: @@ -1549,8 +1549,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->waypoint = 0; this->unk_216 = this->actor.shape.rot.z; this->unk_26E = 1; - this->path = Path_GetByIndex(play, (this->actor.params & 0x3E0) >> 5, 0x1F); - switch (this->actor.params & 0x1F) { + this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 5, 0x3E0), 0x1F); + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_CITY_ENTRANCE: case GORON_CITY_ISLAND: case GORON_CITY_LOWEST_FLOOR: @@ -1579,18 +1579,18 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { } } else { CLEAR_INFTABLE(INFTABLE_10C); - this->collider.dim.height = (D_80A4816C[this->actor.params & 0x1F].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].height * 0.6f); EnGo2_SetupRolling(this, play); this->isAwake = true; } break; case GORON_CITY_ROLLING_BIG: case GORON_DMT_ROLLING_SMALL: - this->collider.dim.height = (D_80A4816C[this->actor.params & 0x1F].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].height * 0.6f); EnGo2_SetupRolling(this, play); break; case GORON_FIRE_GENERIC: - if (Flags_GetSwitch(play, (this->actor.params & 0xFC00) >> 0xA)) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 0xA, 0xFC00))) { Actor_Kill(&this->actor); } else { this->isAwake = true; @@ -1626,12 +1626,12 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) { } void EnGo2_CurledUp(EnGo2* this, PlayState* play) { - u8 index = this->actor.params & 0x1F; + u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); s16 height; s32 quake; if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { quake = Quake_Add(GET_ACTIVE_CAM(play), 3); Quake_SetSpeed(quake, -0x3CB0); Quake_SetQuakeValues(quake, 8, 0, 0, 0); @@ -1654,13 +1654,13 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) { this->isAwake = false; EnGo2_WakeUp(this, play); } - if (((this->actor.params & 0x1F) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { + if ((PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { EnGo2_WakeUp(this, play); } } void func_80A46B40(EnGo2* this, PlayState* play) { - u8 index = (this->actor.params & 0x1F); + u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); f32 height; if (this->unk_211 == true) { @@ -1677,7 +1677,7 @@ void func_80A46B40(EnGo2* this, PlayState* play) { } } else { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if ((this->actor.params & 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { this->actor.flags |= ACTOR_FLAG_0; } func_80A454CC(this); @@ -1715,7 +1715,7 @@ void EnGo2_GoronRollingBigContinueRolling(EnGo2* this, PlayState* play) { void EnGo2_ContinueRolling(EnGo2* this, PlayState* play) { f32 float1 = 1000.0f; - if (((this->actor.params & 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && + if ((PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && DECR(this->animTimer) == 0) { this->actionFunc = EnGo2_SlowRolling; this->actor.speedXZ *= 0.5f; // slowdown @@ -1736,7 +1736,7 @@ void EnGo2_SlowRolling(EnGo2* this, PlayState* play) { EnGo2_GetDustData(this, 3); } orientation = EnGo2_Orient(this, play); - index = this->actor.params & 0x1F; + index = PARAMS_GET2(this->actor.params, 0, 0x1F); if (index != GORON_CITY_LINK) { if ((index == GORON_DMT_ROLLING_SMALL) && (orientation == 1) && (this->waypoint == 0)) { EnGo2_StopRolling(this, play); @@ -1755,7 +1755,7 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) { if (EnGo2_IsRollingOnGround(this, 4, 8.0f, 0)) { EnGo2_GetDustData(this, 0); if (this->unk_59C == 0) { - switch (this->actor.params & 0x1F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { case GORON_CITY_LINK: this->goronState = 0; this->actionFunc = EnGo2_GoronLinkStopRolling; @@ -1937,9 +1937,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { } else { this->animTimer = 0; this->actor.speedXZ = 0.0f; - if ((((this->actor.params & 0xFC00) >> 0xA) != 1) && (((this->actor.params & 0xFC00) >> 0xA) != 2) && - (((this->actor.params & 0xFC00) >> 0xA) != 4) && (((this->actor.params & 0xFC00) >> 0xA) != 5) && - (((this->actor.params & 0xFC00) >> 0xA) != 9) && (((this->actor.params & 0xFC00) >> 0xA) != 11)) { + if ((PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 1) && (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 2) && + (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 4) && (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 5) && + (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 9) && (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 11)) { this->goronState++; } this->goronState++; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 9a43bfde939..4b36a9e5615 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -90,7 +90,7 @@ void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; worldSphere->center.x = this->actor.world.pos.x; - worldSphere->center.y = this->actor.world.pos.y + yOffsets[(this->actor.params >> 10) & 1]; + worldSphere->center.y = this->actor.world.pos.y + yOffsets[PARAMS_GET(this->actor.params, 10, 1)]; worldSphere->center.z = this->actor.world.pos.z; } @@ -136,7 +136,7 @@ void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; Vec3s* nextPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3f nextPosF; @@ -148,8 +148,8 @@ void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest) { - s16 loopMode = (this->actor.params >> 8) & 3; - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + s16 loopMode = PARAMS_GET(this->actor.params, 8, 3); + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; s16 prevWaypoint = this->currentWaypoint - this->pathDirection; Vec3s* prevPointPos; Vec3s* currentPointPos; @@ -176,7 +176,7 @@ void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest } void EnGoroiw_CheckEndOfPath(EnGoroiwa* this) { - s16 loopMode = (this->actor.params >> 8) & 3; + s16 loopMode = PARAMS_GET(this->actor.params, 8, 3); if (this->nextWaypoint < 0) { if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY || loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK) { @@ -214,14 +214,14 @@ void EnGoroiwa_ReverseDirection(EnGoroiwa* this) { } void EnGoroiwa_InitPath(EnGoroiwa* this, PlayState* play) { - this->endWaypoint = play->setupPathList[this->actor.params & 0xFF].count - 1; + this->endWaypoint = play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)].count - 1; this->currentWaypoint = 0; this->nextWaypoint = 1; this->pathDirection = 1; } void EnGoroiwa_TeleportToWaypoint(EnGoroiwa* this, PlayState* play, s32 waypoint) { - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint; this->actor.world.pos.x = pointPos->x; @@ -236,7 +236,7 @@ void EnGoroiwa_InitRotation(EnGoroiwa* this) { s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -300,7 +300,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); func_8002D868(&this->actor); - path = &play->setupPathList[this->actor.params & 0xFF]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; result = true; result &= Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)); @@ -310,7 +310,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { } s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; s32 pad; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -342,7 +342,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Math_StepToF(&this->actor.velocity.y, (R_EN_GOROIWA_SPEED * 0.01f) * 0.5f, 0.18f); @@ -353,7 +353,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->setupPathList[this->actor.params & 0xFF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; f32 nextPointY; f32 thisY; @@ -471,7 +471,7 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_NextWaypoint(EnGoroiwa* this, PlayState* play) { - s16 loopMode = (this->actor.params >> 8) & 3; + s16 loopMode = PARAMS_GET(this->actor.params, 8, 3); EnGoroiwa_SetNextWaypoint(this); @@ -495,7 +495,7 @@ void EnGoroiwa_SpawnFragments(EnGoroiwa* this, PlayState* play) { f32 cos1; f32 sin1; f32 sin2; - s16 yOffsetIdx = (this->actor.params >> 10) & 1; + s16 yOffsetIdx = PARAMS_GET(this->actor.params, 10, 1); s32 i; for (i = 0, angle1 = 0; i < 16; i++, angle1 += 0x4E20) { @@ -534,7 +534,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnGoroiwa_InitCollider(this, play); - pathIdx = this->actor.params & 0xFF; + pathIdx = PARAMS_GET(this->actor.params, 0, 0xFF); if (pathIdx == 0xFF) { // "Error: Invalid arg_data" osSyncPrintf("Error : arg_data が不正(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 1033, @@ -549,7 +549,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, yOffsets[(this->actor.params >> 10) & 1], ActorShadow_DrawCircle, 9.4f); + ActorShape_Init(&this->actor.shape, yOffsets[PARAMS_GET(this->actor.params, 10, 1)], ActorShadow_DrawCircle, 9.4f); this->actor.shape.shadowAlpha = 200; EnGoroiwa_SetSpeed(this, play); EnGoroiwa_InitPath(this, play); @@ -559,7 +559,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_SetupRoll(this); // "(Goroiwa)" osSyncPrintf("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, - this->actor.params & 0xFF, (this->actor.params >> 8) & 3, (this->actor.params >> 10) & 1, + PARAMS_GET(this->actor.params, 0, 0xFF), PARAMS_GET(this->actor.params, 8, 3), PARAMS_GET(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } @@ -590,7 +590,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (yawDiff > -0x4000 && yawDiff < 0x4000) { this->stateFlags |= ENGOROIWA_PLAYER_IN_THE_WAY; - if (((this->actor.params >> 10) & 1) || (this->actor.home.rot.z & 1) != 1) { + if (PARAMS_GET(this->actor.params, 10, 1) || (this->actor.home.rot.z & 1) != 1) { EnGoroiwa_ReverseDirection(this); EnGoroiwa_FaceNextWaypoint(this, play); } @@ -599,13 +599,13 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { osSyncPrintf(VT_FGCOL(CYAN)); osSyncPrintf("Player ぶっ飛ばし\n"); // "Player knocked down" osSyncPrintf(VT_RST); - onHitSetupFuncs[(this->actor.params >> 10) & 1](this); + onHitSetupFuncs[PARAMS_GET(this->actor.params, 10, 1)](this); func_8002F7DC(&GET_PLAYER(play)->actor, NA_SE_PL_BODY_HIT); if ((this->actor.home.rot.z & 1) == 1) { this->collisionDisabledTimer = 50; } - } else if (moveFuncs[(this->actor.params >> 10) & 1](this, play)) { - loopMode = (this->actor.params >> 8) & 3; + } else if (moveFuncs[PARAMS_GET(this->actor.params, 10, 1)](this, play)) { + loopMode = PARAMS_GET(this->actor.params, 8, 3); if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK && (this->nextWaypoint == 0 || this->nextWaypoint == this->endWaypoint)) { EnGoroiwa_SpawnFragments(this, play); @@ -614,7 +614,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { if ((loopMode == ENGOROIWA_LOOPMODE_ROUNDTRIP) && (this->currentWaypoint == 0 || this->currentWaypoint == this->endWaypoint)) { EnGoroiwa_SetupWait(this); - } else if (!((this->actor.params >> 10) & 1) && this->currentWaypoint != 0 && + } else if (!PARAMS_GET(this->actor.params, 10, 1) && this->currentWaypoint != 0 && this->currentWaypoint != this->endWaypoint) { ascendDirection = EnGoroiwa_GetAscendDirection(this, play); if (ascendDirection > 0) { @@ -730,7 +730,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { this->collisionDisabledTimer--; } this->actionFunc(this, play); - switch ((this->actor.params >> 10) & 1) { + switch (PARAMS_GET(this->actor.params, 10, 1)) { case 1: Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 78d62f28f6d..0b9ce12ea78 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -123,7 +123,7 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) { if (Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x2054: - this->actor.textId = (this->actor.params & 0xFF) + 0x400; + this->actor.textId = PARAMS_GET(this->actor.params, 0, 0xFF) + 0x400; ret = 1; break; default: @@ -163,7 +163,7 @@ void func_80A4E470(EnGs* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } this->unk_19D = 0; - Flags_SetSwitch(play, (this->actor.params >> 8) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_01) { player->stateFlags2 |= PLAYER_STATE2_23; } @@ -490,7 +490,7 @@ void func_80A4F700(EnGs* this, PlayState* play) { } void func_80A4F734(EnGs* this, PlayState* play) { - if (!Flags_GetSwitch(play, (this->actor.params >> 8) & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { func_80A4E470(this, play); } } diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 0726839bb03..3227bd7b35c 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -72,8 +72,8 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); - this->type = (this->actor.params >> 8) & 0xFF; - this->path = this->actor.params & 0xFF; + this->type = PARAMS_GET(this->actor.params, 8, 0xFF); + this->path = PARAMS_GET(this->actor.params, 0, 0xFF); for (i = 0; i < ARRAY_COUNT(sAnimParamsInit[0]); i++) { this->animParams[i] = sAnimParamsInit[this->type][i]; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index e7c199911c8..5af3d5fa511 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -87,7 +87,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { EnHeishi2* this = (EnHeishi2*)thisx; Actor_SetScale(&this->actor, 0.01f); - this->type = this->actor.params & 0xFF; + this->type = PARAMS_GET(this->actor.params, 0, 0xFF); this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->type == 6) || (this->type == 9)) { @@ -148,7 +148,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { break; } - this->unk_2F0 = (this->actor.params >> 8) & 0xFF; + this->unk_2F0 = PARAMS_GET(this->actor.params, 8, 0xFF); osSyncPrintf("\n\n"); // "Soldier Set 2 Completed!" osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); @@ -156,7 +156,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); // "Message completed!" osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, - (this->actor.params >> 8) & 0xF); + PARAMS_GET(this->actor.params, 8, 0xF)); } } diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 877baef7b0f..93815233ea2 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -59,7 +59,7 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { EnHeishi4* this = (EnHeishi4*)thisx; Actor_SetScale(thisx, 0.01f); - this->type = thisx->params & 0xFF; + this->type = PARAMS_GET(thisx->params, 0, 0xFF); thisx->colChkInfo.mass = MASS_IMMOVABLE; this->pos = thisx->world.pos; thisx->targetMode = 6; @@ -93,11 +93,11 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80A56544; break; } - this->unk_27C = ((thisx->params >> 8) & 0xFF); + this->unk_27C = PARAMS_GET(thisx->params, 8, 0xFF); osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, thisx->params); osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了!\t ☆☆☆☆☆ %d\n" VT_RST, this->type); - osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, (thisx->params >> 8) & 0xF); + osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET(thisx->params, 8, 0xF)); osSyncPrintf("\n\n"); } diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 5a1836045fb..2b27ff945f1 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -83,7 +83,7 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Actor_SetTextWithPrefix(play, &this->actor, (this->actor.params >> 8) & 0xFF); + Actor_SetTextWithPrefix(play, &this->actor, PARAMS_GET(this->actor.params, 8, 0xFF)); this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; sPuzzleCounter = 0; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index 45d4dc3ba57..a85d11776d8 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -82,7 +82,7 @@ s32 EnHoll_IsKokiriSetup8(void) { void EnHoll_ChooseAction(EnHoll* this) { s32 action; - action = (this->actor.params >> 6) & 7; + action = PARAMS_GET(this->actor.params, 6, 7); EnHoll_SetupAction(this, sActionFuncs[action]); if (action != 0) { this->actor.draw = NULL; @@ -100,7 +100,7 @@ void EnHoll_Init(Actor* thisx, PlayState* play) { } void EnHoll_Destroy(Actor* thisx, PlayState* play) { - s32 transitionActorIdx = (u16)thisx->params >> 0xA; + s32 transitionActorIdx = PARAMS_GET_NOMASK((u16)thisx->params, 0xA); TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIdx]; transitionEntry->id = -transitionEntry->id; @@ -129,7 +129,7 @@ void func_80A58DD4(EnHoll* this, PlayState* play) { absZ = fabsf(vec.z); if (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH && absZ < sHorizTriggerDists[phi_t0][0]) { - transitionActorIdx = (u16)this->actor.params >> 0xA; + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); if (absZ > sHorizTriggerDists[phi_t0][1]) { if (play->roomCtx.prevRoom.num >= 0 && play->roomCtx.status == 0) { this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[this->side].room; @@ -162,12 +162,12 @@ void func_80A59014(EnHoll* this, PlayState* play) { f32 absZ; func_8002DBD0(&this->actor, &vec, (useViewEye) ? &play->view.eye : &player->actor.world.pos); - planeHalfWidth = (((this->actor.params >> 6) & 7) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; + planeHalfWidth = (PARAMS_GET(this->actor.params, 6, 7) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; temp = EnHoll_IsKokiriSetup8(); if (temp || (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < planeHalfWidth && (absZ = fabsf(vec.z), 100.0f > absZ && absZ > 50.0f))) { - s32 transitionActorIdx = (u16)this->actor.params >> 0xA; + s32 transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); s32 side = (vec.z < 0.0f) ? 0 : 1; TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIdx]; s32 room = transitionEntry->sides[side].room; @@ -190,7 +190,7 @@ void func_80A591C0(EnHoll* this, PlayState* play) { s32 transitionActorIdx; if (this->actor.xzDistToPlayer < 500.0f && absY < 700.0f) { - transitionActorIdx = (u16)this->actor.params >> 0xA; + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); if (absY < 95.0f) { play->unk_11E18 = 0xFF; } else if (absY > 605.0f) { @@ -228,7 +228,7 @@ void func_80A593A4(EnHoll* this, PlayState* play) { play->unk_11E18 = (200.0f - absY) * 1.7f; } if (absY > 50.0f) { - transitionActorIdx = (u16)this->actor.params >> 0xA; + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && @@ -252,7 +252,7 @@ void func_80A59520(EnHoll* this, PlayState* play) { if (this->actor.xzDistToPlayer < 120.0f) { absY = fabsf(this->actor.yDistToPlayer); if (absY < 200.0f && absY > 50.0f) { - transitionActorIdx = (u16)this->actor.params >> 0xA; + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && @@ -271,7 +271,7 @@ void func_80A59618(EnHoll* this, PlayState* play) { s32 side; s32 transitionActorIdx; - if (!Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { if (this->unk_14F != 0) { play->unk_11E18 = 0; this->unk_14F = 0; @@ -281,7 +281,7 @@ void func_80A59618(EnHoll* this, PlayState* play) { absZ = fabsf(vec.z); if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) { this->unk_14F = 1; - transitionActorIdx = (u16)this->actor.params >> 0xA; + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); play->unk_11E18 = 0xFF - (s32)((absZ - 50.0f) * 5.9f); if (play->unk_11E18 >= 0x100) { play->unk_11E18 = 0xFF; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index eddf488023a..9eee19bb1b3 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -760,7 +760,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { DREG(4) = 70; } - if (this->actor.params & 0x8000) { + if (PARAMS_GET(this->actor.params, 0, 0x8000)) { this->actor.params &= ~0x8000; this->type = HORSE_HNI; diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index aa3c7e3bab8..cdde7dfa7aa 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -259,7 +259,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { Skin_Init(play, &this->skin, &gHorseNormalSkel, &gHorseNormalIdleAnim); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); } - if ((this->actor.params & 0xF0) == 0x10 && (this->actor.params & 0xF) != 0xF) { + if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x10 && PARAMS_GET(this->actor.params, 0, 0xF) != 0xF) { func_80A6B91C(this, play); } else { func_80A6BC48(this); @@ -286,7 +286,7 @@ void func_80A6B91C(EnHorseNormal* this, PlayState* play) { } void EnHorseNormal_FollowPath(EnHorseNormal* this, PlayState* play) { - Path* path = &play->setupPathList[this->actor.params & 0xF]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xF)]; Vec3s* pointPos = SEGMENTED_TO_VIRTUAL(path->points); f32 dx; f32 dz; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index e763ddf2ae4..7f6d4a5bc72 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -352,9 +352,9 @@ static EnHyInit2Info sInit2Info[] = { }; s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) { - u8 headInfoIndex = sModelInfo[this->actor.params & 0x7F].headInfoIndex; - u8 skelInfoIndex2 = sModelInfo[this->actor.params & 0x7F].skelInfoIndex2; - u8 skelInfoIndex1 = sModelInfo[this->actor.params & 0x7F].skelInfoIndex1; + u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].headInfoIndex; + u8 skelInfoIndex2 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].skelInfoIndex2; + u8 skelInfoIndex1 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].skelInfoIndex1; this->objBankIndexSkel1 = Object_GetIndex(&play->objectCtx, sSkeletonInfo[skelInfoIndex1].objectId); if (this->objBankIndexSkel1 < 0) { @@ -417,16 +417,16 @@ void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) { u16 func_80A6F810(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); EnHy* this = (EnHy*)thisx; - u16 textId = Text_GetFaceReaction(play, (this->actor.params & 0x7F) + 37); + u16 textId = Text_GetFaceReaction(play, PARAMS_GET2(this->actor.params, 0, 0x7F) + 37); if (textId != 0) { - if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_5) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_5) { player->exchangeItemId = EXCH_ITEM_BLUE_FIRE; } return textId; } - switch (this->actor.params & 0x7F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { case ENHY_TYPE_AOB: if (play->sceneNum == SCENE_KAKARIKO) { return (this->unk_330 & EVENTCHKINF_6B_MASK) ? 0x508D : (GET_INFTABLE(INFTABLE_CB) ? 0x508C : 0x508B); @@ -673,7 +673,7 @@ s16 func_80A70058(PlayState* play, Actor* thisx) { void EnHy_UpdateEyes(EnHy* this) { if (DECR(this->nextEyeIndexTimer) == 0) { - u8 headInfoIndex = sModelInfo[this->actor.params & 0x7F].headInfoIndex; + u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].headInfoIndex; this->curEyeIndex++; if ((sHeadInfo[headInfoIndex].eyeTextures != NULL) && @@ -685,14 +685,14 @@ void EnHy_UpdateEyes(EnHy* this) { } void EnHy_InitCollider(EnHy* this) { - u8 type = this->actor.params & 0x7F; + u8 type = PARAMS_GET2(this->actor.params, 0, 0x7F); this->collider.dim.radius = sColliderInfo[type].radius; this->collider.dim.height = sColliderInfo[type].height; } void EnHy_InitSetProperties(EnHy* this) { - u8 type = this->actor.params & 0x7F; + u8 type = PARAMS_GET2(this->actor.params, 0, 0x7F); this->actor.shape.shadowScale = sInit2Info[type].shadowScale; Actor_SetScale(&this->actor, sInit2Info[type].scale); @@ -708,9 +708,9 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - pos.x += sColliderInfo[this->actor.params & 0x7F].offset.x; - pos.y += sColliderInfo[this->actor.params & 0x7F].offset.y; - pos.z += sColliderInfo[this->actor.params & 0x7F].offset.z; + pos.x += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].offset.x; + pos.y += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].offset.y; + pos.z += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].offset.z; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } @@ -718,7 +718,7 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { void func_80A70834(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); - if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_5) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_5) { if (!Inventory_HasSpecificBottle(ITEM_BLUE_FIRE) && !Inventory_HasSpecificBottle(ITEM_BUG) && !Inventory_HasSpecificBottle(ITEM_FISH)) { switch (func_8002F368(play)) { @@ -760,7 +760,7 @@ void func_80A70978(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 phi_a3; - switch (this->actor.params & 0x7F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { case ENHY_TYPE_BOJ_3: case ENHY_TYPE_BJI_7: case ENHY_TYPE_BOJ_9: @@ -786,12 +786,12 @@ void func_80A70978(EnHy* this, PlayState* play) { this->unk_1E8.unk_18 = player->actor.world.pos; if (LINK_IS_ADULT) { - this->unk_1E8.unk_14 = sInit1Info[this->actor.params & 0x7F].unkValueAdult; + this->unk_1E8.unk_14 = sInit1Info[PARAMS_GET2(this->actor.params, 0, 0x7F)].unkValueAdult; } else { - this->unk_1E8.unk_14 = sInit1Info[this->actor.params & 0x7F].unkValueChild; + this->unk_1E8.unk_14 = sInit1Info[PARAMS_GET2(this->actor.params, 0, 0x7F)].unkValueChild; } - func_80034A14(&this->actor, &this->unk_1E8, sInit1Info[this->actor.params & 0x7F].unkPresetIndex, phi_a3); + func_80034A14(&this->actor, &this->unk_1E8, sInit1Info[PARAMS_GET2(this->actor.params, 0, 0x7F)].unkPresetIndex, phi_a3); if (func_800343CC(play, &this->actor, &this->unk_1E8.unk_00, this->unkRange, func_80A6F810, func_80A70058)) { func_80A70834(this, play); @@ -801,29 +801,29 @@ void func_80A70978(EnHy* this, PlayState* play) { s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { switch (play->sceneNum) { case SCENE_SPOT01: - if (!((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_9 || (this->actor.params & 0x7F) == ENHY_TYPE_BOJ_10 || - (this->actor.params & 0x7F) == ENHY_TYPE_BOJ_12 || (this->actor.params & 0x7F) == ENHY_TYPE_AHG_2 || - (this->actor.params & 0x7F) == ENHY_TYPE_BJI_7)) { + if (!(PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_9 || PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_10 || + PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_12 || PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_AHG_2 || + PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BJI_7)) { return true; } else if (!LINK_IS_ADULT) { return true; - } else if ((this->actor.params & 0x7F) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { + } else if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { return false; } else { return true; } case SCENE_LABO: - if ((this->actor.params & 0x7F) != ENHY_TYPE_BOJ_10) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_BOJ_10) { return true; } else if (LINK_IS_CHILD) { return false; - } else if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_10 && IS_DAY) { + } else if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_10 && IS_DAY) { return false; } else { return true; } case SCENE_IMPA: - if ((this->actor.params & 0x7F) != ENHY_TYPE_AOB) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_AOB) { return true; } else if (IS_DAY) { return false; @@ -831,11 +831,11 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } case SCENE_KAKARIKO: - if ((this->actor.params & 0x7F) == ENHY_TYPE_AOB) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_AOB) { return !LINK_IS_ADULT ? false : true; - } else if (!((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_9 || - (this->actor.params & 0x7F) == ENHY_TYPE_AHG_2 || - (this->actor.params & 0x7F) == ENHY_TYPE_BJI_7)) { + } else if (!(PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_9 || + PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_AHG_2 || + PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BJI_7)) { return true; } else if (IS_DAY) { return false; @@ -846,7 +846,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { } case SCENE_MARKET_ALLEY: case SCENE_MARKET_ALLEY_N: - if ((this->actor.params & 0x7F) != ENHY_TYPE_BOJ_14) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_BOJ_14) { return true; } else if (IS_NIGHT) { return false; @@ -856,7 +856,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } default: - switch (this->actor.params & 0x7F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { case ENHY_TYPE_BJI_19: case ENHY_TYPE_AHG_20: if (LINK_IS_ADULT) { @@ -870,7 +870,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { void EnHy_Init(Actor* thisx, PlayState* play) { EnHy* this = (EnHy*)thisx; - if ((this->actor.params & 0x7F) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || + if (PARAMS_GET2(this->actor.params, 0, 0x7F) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || !EnHy_FindSkelAndHeadObjects(this, play)) { Actor_Kill(&this->actor); } @@ -893,7 +893,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { this->actor.objBankIndex = this->objBankIndexSkel1; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->actor.objBankIndex].segment); SkelAnime_InitFlex(play, &this->skelAnime, - sSkeletonInfo[sModelInfo[this->actor.params & 0x7F].skelInfoIndex1].skeleton, NULL, + sSkeletonInfo[sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].skelInfoIndex1].skeleton, NULL, this->jointTable, this->morphTable, 16); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexOsAnime].segment); @@ -901,7 +901,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); EnHy_InitCollider(this); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[this->actor.params & 0x7F].animInfoIndex); + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].animInfoIndex); if ((play->sceneNum == SCENE_MARKET_ALLEY) || (play->sceneNum == SCENE_MARKET_DAY)) { this->actor.flags &= ~ACTOR_FLAG_4; @@ -913,9 +913,9 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { } EnHy_InitSetProperties(this); - this->path = Path_GetByIndex(play, (this->actor.params & 0x780) >> 7, 15); + this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 7, 0x780), 15); - switch (this->actor.params & 0x7F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { case ENHY_TYPE_BOJ_3: if (this->path != NULL) { this->actor.speedXZ = 3.0f; @@ -1104,7 +1104,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (limbIndex == 15) { gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objBankIndexHead].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexHead].segment); - i = sModelInfo[this->actor.params & 0x7F].headInfoIndex; + i = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].headInfoIndex; *dList = sHeadInfo[i].headDList; if (sHeadInfo[i].eyeTextures != NULL) { @@ -1151,7 +1151,7 @@ void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexSkel2].segment); } - if ((this->actor.params & 0x7F) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_005BC8); } @@ -1183,10 +1183,10 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { if (this->actionFunc != EnHy_InitImpl) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Translate(this->modelOffset.x, this->modelOffset.y, this->modelOffset.z, MTXMODE_APPLY); - envColorSeg8 = sModelInfo[this->actor.params & 0x7F].envColorSeg8; - envColorSeg9 = sModelInfo[this->actor.params & 0x7F].envColorSeg9; + envColorSeg8 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].envColorSeg8; + envColorSeg9 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].envColorSeg9; - switch (this->actor.params & 0x7F) { + switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { // ENHY_TYPE_AOB // ENHY_TYPE_COB case ENHY_TYPE_AHG_2: @@ -1215,11 +1215,11 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { EnHy_SetEnvColor(play->state.gfxCtx, envColorSeg9.r, envColorSeg9.g, envColorSeg9.b, envColorSeg9.a)); - if ((this->actor.params & 0x7F) == ENHY_TYPE_CNE_8 || (this->actor.params & 0x7F) == ENHY_TYPE_CNE_11) { - if ((this->actor.params & 0x7F) == ENHY_TYPE_CNE_8) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_8 || PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_8) { envColorSeg10 = envColorSeg8; } - if ((this->actor.params & 0x7F) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_11) { envColorSeg10.r = envColorSeg10.g = envColorSeg10.b = 255; envColorSeg10.a = 0; } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 9c56d5b5ac7..dd2ae419f91 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -202,7 +202,7 @@ void func_80A74398(Actor* thisx, PlayState* play) { this->unk_2FC = 0; thisx->colChkInfo.health = 30; thisx->gravity = -1.0f; - this->switchFlags = (thisx->params >> 8) & 0xFF; + this->switchFlags = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (thisx->params == 0) { @@ -1435,9 +1435,9 @@ void func_80A781CC(Actor* thisx, PlayState* play) { void EnIk_Init(Actor* thisx, PlayState* play) { EnIk* this = (EnIk*)thisx; - s32 flag = this->actor.params & 0xFF00; + s32 flag = PARAMS_GET(this->actor.params, 0, 0xFF00); - if (((this->actor.params & 0xFF) == 0 && GET_EVENTCHKINF(EVENTCHKINF_3C)) || + if ((PARAMS_GET(this->actor.params, 0, 0xFF) == 0 && GET_EVENTCHKINF(EVENTCHKINF_3C)) || (flag != 0 && Flags_GetSwitch(play, flag >> 8))) { Actor_Kill(&this->actor); } else { diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index fbe94395a1e..7b1e6d010a5 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -99,7 +99,7 @@ static InitChainEntry sInitChain[] = { }; void EnInsect_InitFlags(EnInsect* this) { - this->insectFlags = sInitInsectFlags[this->actor.params & 3]; + this->insectFlags = sInitInsectFlags[PARAMS_GET(this->actor.params, 0, 3)]; } f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) { @@ -187,7 +187,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->actor, sInitChain); EnInsect_InitFlags(this); - type = this->actor.params & 3; + type = PARAMS_GET(this->actor.params, 0, 3); SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24); Collider_InitJntSph(play, &this->collider); @@ -242,7 +242,7 @@ void EnInsect_Destroy(Actor* thisx, PlayState* play) { s16 type; EnInsect* this = (EnInsect*)thisx; - type = this->actor.params & 3; + type = PARAMS_GET(this->actor.params, 0, 3); Collider_DestroyJntSph(play, &this->collider); if ((type == INSECT_TYPE_FIRST_DROPPED || type == INSECT_TYPE_EXTRA_DROPPED) && sDroppedCount > 0) { sDroppedCount--; @@ -261,7 +261,7 @@ void EnInsect_SlowDown(EnInsect* this, PlayState* play) { s16 type; f32 playSpeed; - type = this->actor.params & 3; + type = PARAMS_GET(this->actor.params, 0, 3); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); @@ -297,7 +297,7 @@ void EnInsect_Crawl(EnInsect* this, PlayState* play) { s32 pad1; s32 pad2; s16 yaw; - s16 type = this->actor.params & 3; + s16 type = PARAMS_GET(this->actor.params, 0, 3); Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f); @@ -469,7 +469,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) { s16 type; Vec3f ripplePoint; - type = this->actor.params & 3; + type = PARAMS_GET(this->actor.params, 0, 3); if (this->actionTimer > 80) { Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f); @@ -571,7 +571,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { f32 sp34; sp50 = 0; - type = this->actor.params & 3; + type = PARAMS_GET(this->actor.params, 0, 3); if (this->soilActor != NULL) { distanceSq = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); @@ -672,8 +672,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { !(this->insectFlags & INSECT_FLAG_7)) { if (this->unk_32A >= 15) { if (this->soilActor != NULL) { - if (!(GET_GS_FLAGS(((this->soilActor->actor.params >> 8) & 0x1F) - 1) & - (this->soilActor->actor.params & 0xFF))) { + if (!(GET_GS_FLAGS(PARAMS_GET(this->soilActor->actor.params, 8, 0x1F) - 1) & + PARAMS_GET(this->soilActor->actor.params, 0, 0xFF))) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); } } @@ -764,7 +764,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - tmp = this->actor.params & 3; + tmp = PARAMS_GET(this->actor.params, 0, 3); if (tmp == INSECT_TYPE_FIRST_DROPPED || tmp == INSECT_TYPE_EXTRA_DROPPED) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 54551d40981..6dbf2814667 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -106,7 +106,7 @@ void EnIshi_InitCollider(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInits[this->actor.params & 1]); + Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInits[PARAMS_GET(this->actor.params, 0, 1)]); Collider_UpdateCylinder(&this->actor, &this->collider); } @@ -249,8 +249,8 @@ void EnIshi_SpawnDustLarge(EnIshi* this, PlayState* play) { void EnIshi_DropCollectible(EnIshi* this, PlayState* play) { s16 dropParams; - if ((this->actor.params & 1) == ROCK_SMALL) { - dropParams = (this->actor.params >> 8) & 0xF; + if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_SMALL) { + dropParams = PARAMS_GET(this->actor.params, 8, 0xF); if (dropParams >= 0xD) { dropParams = 0; @@ -308,7 +308,7 @@ static InitChainEntry sInitChains[][5] = { void EnIshi_Init(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; - s16 type = this->actor.params & 1; + s16 type = PARAMS_GET(this->actor.params, 0, 1); Actor_ProcessInitChain(&this->actor, sInitChains[type]); if (play->csCtx.state != CS_STATE_IDLE) { @@ -320,13 +320,13 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, play); if ((type == ROCK_LARGE) && - Flags_GetSwitch(play, ((this->actor.params >> 0xA) & 0x3C) | ((this->actor.params >> 6) & 3))) { + Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0xA, 0x3C) | PARAMS_GET(this->actor.params, 6, 3))) { Actor_Kill(&this->actor); return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actor.shape.yOffset = D_80A7FA20[type]; - if (!((this->actor.params >> 5) & 1) && !EnIshi_SnapToFloor(this, play, 0.0f)) { + if (!PARAMS_GET(this->actor.params, 5, 1) && !EnIshi_SnapToFloor(this, play, 0.0f)) { Actor_Kill(&this->actor); return; } @@ -347,12 +347,12 @@ void EnIshi_SetupWait(EnIshi* this) { void EnIshi_Wait(EnIshi* this, PlayState* play) { static u16 liftSounds[] = { NA_SE_PL_PULL_UP_ROCK, NA_SE_PL_PULL_UP_BIGROCK }; s32 pad; - s16 type = this->actor.params & 1; + s16 type = PARAMS_GET(this->actor.params, 0, 1); if (Actor_HasParent(&this->actor, play)) { EnIshi_SetupLiftedUp(this); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, liftSounds[type]); - if ((this->actor.params >> 4) & 1) { + if (PARAMS_GET(this->actor.params, 4, 1)) { EnIshi_SpawnBugs(this, play); } } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && @@ -390,12 +390,12 @@ void EnIshi_SetupLiftedUp(EnIshi* this) { void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; - if ((this->actor.params & 1) == ROCK_LARGE) { - Flags_SetSwitch(play, ((this->actor.params >> 0xA) & 0x3C) | ((this->actor.params >> 6) & 3)); + if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_LARGE) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0xA, 0x3C) | PARAMS_GET(this->actor.params, 6, 3)); } EnIshi_SetupFly(this); EnIshi_Fall(this); - func_80A7ED94(&this->actor.velocity, D_80A7FA28[this->actor.params & 1]); + func_80A7ED94(&this->actor.velocity, D_80A7FA28[PARAMS_GET(this->actor.params, 0, 1)]); func_8002D7EC(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_6 | @@ -406,7 +406,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { void EnIshi_SetupFly(EnIshi* this) { this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; - if ((this->actor.params & 1) == ROCK_SMALL) { + if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_SMALL) { sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; } else { @@ -419,7 +419,7 @@ void EnIshi_SetupFly(EnIshi* this) { void EnIshi_Fly(EnIshi* this, PlayState* play) { s32 pad; - s16 type = this->actor.params & 1; + s16 type = PARAMS_GET(this->actor.params, 0, 1); s32 pad2; s32 quakeIdx; Vec3f contactPos; @@ -502,5 +502,5 @@ static EnIshiDrawFunc sDrawFuncs[] = { EnIshi_DrawSmall, EnIshi_DrawLarge }; void EnIshi_Draw(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; - sDrawFuncs[this->actor.params & 1](this, play); + sDrawFuncs[PARAMS_GET(this->actor.params, 0, 1)](this, play); } diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 8430270c895..110569fc431 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -63,8 +63,8 @@ void EnKakasi2_Init(Actor* thisx, PlayState* play) { // "Visit Umeda" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 梅田参号見参! ☆☆☆☆☆ \n" VT_RST); - this->switchFlag = this->actor.params & 0x3F; - spawnRangeY = (this->actor.params >> 6) & 0xFF; + this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + spawnRangeY = PARAMS_GET(this->actor.params, 6, 0xFF); spawnRangeXZ = this->actor.world.rot.z; if (this->switchFlag == 0x3F) { this->switchFlag = -1; diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index 36e287ea8e8..d74c3c0f7de 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -473,7 +473,7 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); if (this->actionFunc == EnKarebaba_DeadItemDrop) { - if (this->actor.params > 40 || (this->actor.params & 1)) { + if (this->actor.params > 40 || PARAMS_GET(this->actor.params, 0, 1)) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_karebaba.c", 1066), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 0726fad1b2a..57698d0813a 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -13,8 +13,8 @@ #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) -#define ENKO_TYPE (this->actor.params & 0xFF) -#define ENKO_PATH ((this->actor.params & 0xFF00) >> 8) +#define ENKO_TYPE PARAMS_GET2(this->actor.params, 0, 0xFF) +#define ENKO_PATH PARAMS_GET2(this->actor.params, 8, 0xFF00) void EnKo_Init(Actor* thisx, PlayState* play); void EnKo_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 091b36db148..e0a5eab8d5c 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -126,10 +126,10 @@ s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) { void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { s16 dropParams; - switch (this->actor.params & 3) { + switch (PARAMS_GET(this->actor.params, 0, 3)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: - dropParams = (this->actor.params >> 8) & 0xF; + dropParams = PARAMS_GET(this->actor.params, 8, 0xF); if (dropParams >= 0xD) { dropParams = 0; @@ -253,7 +253,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { return; } - this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[thisx->params & 3]); + this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[PARAMS_GET(thisx->params, 0, 3)]); if (this->objBankIndex < 0) { // "Bank danger!" @@ -307,11 +307,11 @@ void EnKusa_Main(EnKusa* this, PlayState* play) { EnKusa_DropCollectible(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); - if ((this->actor.params >> 4) & 1) { + if (PARAMS_GET(this->actor.params, 4, 1)) { EnKusa_SpawnBugs(this, play); } - if ((this->actor.params & 3) == ENKUSA_TYPE_0) { + if (PARAMS_GET(this->actor.params, 0, 3) == ENKUSA_TYPE_0) { Actor_Kill(&this->actor); return; } @@ -379,7 +379,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } EnKusa_SpawnFragments(this, play); EnKusa_DropCollectible(this, play); - switch (this->actor.params & 3) { + switch (PARAMS_GET(this->actor.params, 0, 3)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: Actor_Kill(&this->actor); @@ -424,7 +424,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } void EnKusa_SetupCut(EnKusa* this) { - switch (this->actor.params & 3) { + switch (PARAMS_GET(this->actor.params, 0, 3)) { case ENKUSA_TYPE_2: EnKusa_SetupAction(this, EnKusa_DoNothing); break; @@ -504,6 +504,6 @@ void EnKusa_Draw(Actor* thisx, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_ENKUSA_CUT) { Gfx_DrawDListOpa(play, object_kusa_DL_0002E0); } else { - Gfx_DrawDListOpa(play, dLists[thisx->params & 3]); + Gfx_DrawDListOpa(play, dLists[PARAMS_GET(thisx->params, 0, 3)]); } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 2d9afe326e2..cfae7ec0245 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -275,11 +275,11 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { f32 pathDiffX; f32 pathDiffZ; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { return 0; } - path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -301,11 +301,11 @@ s32 EnKz_SetMovedPos(EnKz* this, PlayState* play) { Path* path; Vec3s* lastPointPos; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { return 0; } - path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index bf85d4619ef..d740afd2798 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -60,10 +60,10 @@ void EnLight_Init(Actor* thisx, PlayState* play) { } this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - Actor_SetScale(&this->actor, D_80A9E840[this->actor.params & 0xF].scale * 0.0001f); + Actor_SetScale(&this->actor, D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)].scale * 0.0001f); this->timer = (s32)(Rand_ZeroOne() * 255.0f); - if ((this->actor.params & 0x400) != 0) { + if (PARAMS_GET2(this->actor.params, 0, 0x400) != 0) { this->actor.update = EnLight_UpdateSwitch; } } @@ -92,7 +92,7 @@ void EnLight_Update(Actor* thisx, PlayState* play) { s16 radius; EnLight* this = (EnLight*)thisx; - flameParams = &D_80A9E840[this->actor.params & 0xF]; + flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)]; intensity = (Rand_ZeroOne() * 0.5f) + 0.5f; radius = (this->actor.params < 0) ? 100 : 300; Lights_PointSetColorAndRadius(&this->lightInfo, (flameParams->primColor.r * intensity), @@ -111,11 +111,11 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { EnLight* this = (EnLight*)thisx; f32 scale; - flameParams = &D_80A9E840[this->actor.params & 0xF]; + flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)]; scale = this->actor.scale.x / ((f32)flameParams->scale * 0.0001); - if ((this->actor.params & 0x800) != 0) { - if (Flags_GetSwitch(play, (this->actor.params & 0x3F0) >> 4)) { + if (PARAMS_GET2(this->actor.params, 0, 0x800) != 0) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 0x3F0))) { Math_StepToF(&scale, 1.0f, 0.05f); } else { if (scale < 0.1f) { @@ -125,7 +125,7 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { Math_StepToF(&scale, 0.0f, 0.05f); } } else { - if (Flags_GetSwitch(play, (this->actor.params & 0x3F0) >> 4)) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 0x3F0))) { if (scale < 0.1f) { Actor_SetScale(&this->actor, 0.0f); return; @@ -156,7 +156,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { if (1) {} - flameParams = &D_80A9E840[this->actor.params & 0xF]; + flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)]; OPEN_DISPS(play->state.gfxCtx, "../z_en_light.c", 441); @@ -183,7 +183,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(BINANG_TO_RAD((s16)((Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y) + 0x8000)), MTXMODE_APPLY); - if (this->actor.params & 1) { + if (PARAMS_GET2(this->actor.params, 0, 1)) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 5ea75dda85a..0793a04a646 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -66,7 +66,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420); - this->unk_1C7 = (this->actor.params & 0xFF) - 1; + this->unk_1C7 = PARAMS_GET2(this->actor.params, 0, 0xFF) - 1; Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 255, 255, 255, 0); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); @@ -85,8 +85,8 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { if (player->stateFlags2 & PLAYER_STATE2_17) { if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || - (((this->actor.params & 0xFF00) >> 8) && - !(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_NOW)))) { + (PARAMS_GET2(this->actor.params, 8, 0xFF00) && + !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 0xFF00), MAGIC_CONSUME_NOW)))) { Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, @@ -158,8 +158,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (this->unk_1CA == 0) { if (player->unk_858 >= 0.1f) { if ((gSaveContext.magicState != MAGIC_STATE_IDLE) || - (((this->actor.params & 0xFF00) >> 8) && - !(Magic_RequestChange(play, (this->actor.params & 0xFF00) >> 8, MAGIC_CONSUME_WAIT_PREVIEW)))) { + (PARAMS_GET2(this->actor.params, 8, 0xFF00) && + !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 0xFF00), MAGIC_CONSUME_WAIT_PREVIEW)))) { func_80A9F350(this, play); func_80A9EFE0(this, func_80A9F350); this->unk_1C8 = 0; @@ -192,7 +192,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { return; } else { player->stateFlags2 &= ~PLAYER_STATE2_17; - if ((this->actor.params & 0xFF00) >> 8) { + if (PARAMS_GET2(this->actor.params, 8, 0xFF00)) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; } if (player->unk_858 < 0.85f) { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 9c007332086..0168438820a 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -316,7 +316,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { this->morphTable, 28); Actor_SetScale(&this->actor, 0.014f); - this->path = (thisx->params & 0xFF00) >> 8; + this->path = PARAMS_GET2(thisx->params, 8, 0xFF00); this->actor.params = ENMB_TYPE_SPEAR_PATROL; this->waypoint = 0; this->actor.colChkInfo.health = 1; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 7b0a85c3ddb..5f42d029977 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -591,11 +591,11 @@ u8 EnMd_FollowPath(EnMd* this, PlayState* play) { f32 pathDiffX; f32 pathDiffZ; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { return 0; } - path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -618,11 +618,11 @@ u8 EnMd_SetMovedPos(EnMd* this, PlayState* play) { Path* path; Vec3s* lastPointPos; - if ((this->actor.params & 0xFF00) == 0xFF00) { + if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { return 0; } - path = &play->setupPathList[(this->actor.params & 0xFF00) >> 8]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 1fae3e0d8c6..dd4d614dd7e 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -173,7 +173,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { Animation_GetLastFrame(sAnimationInfo[RM_ANIM_RUN].animation), sAnimationInfo[RM_ANIM_RUN].mode, sAnimationInfo[RM_ANIM_RUN].morphFrames); - this->path = this->actor.params & 0xFF; + this->path = PARAMS_GET(this->actor.params, 0, 0xFF); this->unk_1F0 = 2; this->unk_1E8 = 0; this->actor.targetMode = 2; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 5935f5cfdb1..eb221df8f9c 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -89,15 +89,15 @@ static s32 D_80AB4318 = 0; #include "z_en_nb_cutscene_data.c" s32 EnNb_GetPath(EnNb* this) { - s32 path = this->actor.params >> 8; + s32 path = PARAMS_GET(this->actor.params, 8, 0xFF); - return path & 0xFF; + return path; } s32 EnNb_GetType(EnNb* this) { - s32 type = this->actor.params; + s32 type = PARAMS_GET(this->actor.params, 0, 0xFF); - return type & 0xFF; + return type; } void EnNb_UpdatePath(EnNb* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 69cedb5e557..536c1937396 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -65,7 +65,7 @@ void EnNiwGirl_Init(Actor* thisx, PlayState* play) { if (this->actor.params < 0) { this->actor.params = 0; } - this->path = ((this->actor.params >> 8) & 0xFF); + this->path = PARAMS_GET(this->actor.params, 8, 0xFF); this->actor.gravity = -3.0f; Matrix_RotateY(BINANG_TO_RAD_ALT(this->actor.shape.rot.y), MTXMODE_NEW); vec2.x = vec2.y = vec2.z = 0.0f; diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 3ef0699fcd4..5077911beb4 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -47,9 +47,9 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { // "Ocarina tag outbreak" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ オカリナタグ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->actor.flags &= ~ACTOR_FLAG_0; - this->type = (this->actor.params >> 0xA) & 0x3F; - this->ocarinaSong = (this->actor.params >> 6) & 0xF; - this->switchFlag = this->actor.params & 0x3F; + this->type = PARAMS_GET(this->actor.params, 0xA, 0x3F); + this->ocarinaSong = PARAMS_GET(this->actor.params, 6, 0xF); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index 81f4c66ae63..c422202027d 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -121,7 +121,7 @@ void EnOkuta_Init(Actor* thisx, PlayState* play) { s32 floorBgId; Actor_ProcessInitChain(thisx, sInitChain); - this->numShots = (thisx->params >> 8) & 0xFF; + this->numShots = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (thisx->params == 0) { SkelAnime_Init(play, &this->skelAnime, &gOctorokSkel, &gOctorokAppearAnim, this->jointTable, this->morphTable, diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 3a32f4ca3c7..69128c75c83 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -125,8 +125,8 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->unk_405 = 4; this->unk_404 = this->unk_407 = 0; this->unk_408 = 4; - owlType = (this->actor.params & 0xFC0) >> 6; - switchFlag = (this->actor.params & 0x3F); + owlType = PARAMS_GET2(this->actor.params, 6, 0xFC0); + switchFlag = PARAMS_GET2(this->actor.params, 0, 0x3F); if (this->actor.params == 0xFFF) { owlType = OWL_OUTSIDE_KOKIRI; switchFlag = 0x20; @@ -302,7 +302,7 @@ void func_80ACA5C8(EnOwl* this) { } void func_80ACA62C(EnOwl* this, PlayState* play) { - s32 switchFlag = this->actor.params & 0x3F; + s32 switchFlag = PARAMS_GET2(this->actor.params, 0, 0x3F); if (switchFlag < 0x20) { Flags_SetSwitch(play, switchFlag); @@ -728,7 +728,7 @@ void func_80ACB748(EnOwl* this, PlayState* play) { static Vec3f D_80ACD62C = { 0.0f, 0.0f, 0.0f }; f32 dist; f32 weight; - s32 owlType = (this->actor.params & 0xFC0) >> 6; + s32 owlType = PARAMS_GET2(this->actor.params, 6, 0xFC0); dist = Math3D_Vec3f_DistXYZ(&this->eye, &play->view.eye) / 45.0f; this->eye.x = play->view.eye.x; @@ -926,7 +926,7 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { if (this->actor.xzDistToPlayer < 50.0f) { if (!Play_InCsMode(play)) { - owlType = (this->actor.params & 0xFC0) >> 6; + owlType = PARAMS_GET2(this->actor.params, 6, 0xFC0); osSyncPrintf(VT_FGCOL(CYAN)); osSyncPrintf("%dのフクロウ\n", owlType); // "%d owl" osSyncPrintf(VT_RST); @@ -1057,7 +1057,7 @@ s32 func_80ACC5CC(EnOwl* this) { } s32 func_80ACC624(EnOwl* this, PlayState* play) { - s32 switchFlag = (this->actor.params & 0xFC0) >> 6; + s32 switchFlag = PARAMS_GET2(this->actor.params, 6, 0xFC0); if (play->sceneNum != SCENE_SPOT11) { return true; diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 86b74b3ed50..f9ee1bf9164 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -74,7 +74,7 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) { 255, 255, 255, 200); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 37.0f); this->currentPathPoint = 1; - this->actor.params = (this->actor.params >> 8) & 0xFF; + this->actor.params = PARAMS_GET(this->actor.params, 8, 0xFF); this->targetY = this->actor.world.pos.y; EnPoDesert_SetNextPathPoint(this, play); } diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 8c2f7ae37ac..24e5eb8d130 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -153,7 +153,7 @@ void EnPoField_Init(Actor* thisx, PlayState* play) { sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; - sSpawnSwitchFlags[sNumSpawned] = this->actor.params & 0xFF; + sSpawnSwitchFlags[sNumSpawned] = PARAMS_GET(this->actor.params, 0, 0xFF); sNumSpawned++; } if (sNumSpawned >= 2) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 849fdd038c6..d50067a9cac 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -191,17 +191,17 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->unk_194 = (thisx->params >> 8) & 3; + this->unk_194 = PARAMS_GET(thisx->params, 8, 3); this->actor.naviEnemyId = this->unk_194 + NAVI_ENEMY_POE_SISTER_MEG; if (1) {} - this->unk_195 = (thisx->params >> 0xA) & 3; + this->unk_195 = PARAMS_GET(thisx->params, 0xA, 3); this->unk_196 = 32; this->unk_197 = 20; this->unk_198 = 1; this->unk_199 = 32; this->unk_294 = 110.0f; this->actor.flags &= ~ACTOR_FLAG_0; - if (this->actor.params & 0x1000) { + if (PARAMS_GET(this->actor.params, 0, 0x1000)) { func_80ADA094(this, play); } else if (this->unk_194 == 0) { if (this->unk_195 == 0) { diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index cde8a3f6896..4e423df016e 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -153,7 +153,7 @@ void EnRd_Init(Actor* thisx, PlayState* play) { this->alpha = this->unk_31D = 255; this->rdFlags = REDEAD_GET_FLAGS(thisx); - if (this->actor.params & 0x80) { + if (PARAMS_GET2(this->actor.params, 0, 0x80)) { this->actor.params |= 0xFF00; } else { this->actor.params &= 0xFF; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 864dc13a993..3e6bd3b9a15 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -8,7 +8,7 @@ struct EnRd; typedef void (*EnRdActionFunc)(struct EnRd*, PlayState*); -#define REDEAD_GET_FLAGS(thisx) (((thisx)->params & 0xFF00) >> 8) +#define REDEAD_GET_FLAGS(thisx) PARAMS_GET2((thisx)->params, 8, 0xFF00) typedef enum { /* 0 */ REDEAD_GIBDO_LIMB_NONE, diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index 302e2f6d999..ead1df56e19 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -29,8 +29,8 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { EnRiverSound* this = (EnRiverSound*)thisx; this->playSound = false; - this->pathIndex = (this->actor.params >> 8) & 0xFF; - this->actor.params = this->actor.params & 0xFF; + this->pathIndex = PARAMS_GET(this->actor.params, 8, 0xFF); + this->actor.params = PARAMS_GET(this->actor.params, 0, 0xFF); if (this->actor.params >= RS_GANON_TOWER_0) { // Incrementally increase volume of NA_BGM_GANON_TOWER for each new room during the climb of Ganon's Tower diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index d5d10dbdb2d..f882e71f46c 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -189,13 +189,13 @@ void func_80AEADD8(EnRu1* this) { } u8 func_80AEADE0(EnRu1* this) { - u8 params = this->actor.params >> 8; + u8 params = PARAMS_GET(this->actor.params, 8, 0xFF); return params; } u8 func_80AEADF0(EnRu1* this) { - s16 params = this->actor.params; + u8 params = PARAMS_GET(this->actor.params, 0, 0xFF); return params; } @@ -324,7 +324,7 @@ Actor* func_80AEB124(PlayState* play) { Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { - if ((actorIt->id == ACTOR_DEMO_EFFECT) && ((actorIt->params & 0xFF) == 0x15)) { + if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET(actorIt->params, 0, 0xFF) == 0x15)) { return actorIt; } actorIt = actorIt->next; @@ -1520,7 +1520,7 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { floorBgId = this->actor.floorBgId; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { - if (((dynaPolyActor->actor.params >> 8) & 0x3F) == 0x38) { + if (PARAMS_GET(dynaPolyActor->actor.params, 8, 0x3F) == 0x38) { SET_INFTABLE(INFTABLE_140); return; } diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index cce4a612fb3..3f581b413f9 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -126,15 +126,15 @@ void func_80AF2608(EnRu2* this) { } s32 func_80AF2690(EnRu2* this) { - s32 params_shift = this->actor.params >> 8; + s32 params_shift = PARAMS_GET(this->actor.params, 8, 0xFF); - return params_shift & 0xFF; + return params_shift; } s32 func_80AF26A0(EnRu2* this) { - s16 params = this->actor.params; + s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); - return params & 0xFF; + return params; } void func_80AF26AC(EnRu2* this) { diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index e73a9de021f..942c72071d0 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -128,7 +128,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) { player->actor.freezeTimer = 10; } else { - SET_GS_FLAGS((this->actor.params & 0x1F00) >> 8, this->actor.params & 0xFF); + SET_GS_FLAGS(PARAMS_GET2(this->actor.params, 8, 0x1F00), PARAMS_GET2(this->actor.params, 0, 0xFF)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 08f38d5d0d9..f822cec5746 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -51,7 +51,7 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); this->sfxFlags |= 1; - type = ((u16)thisx->params >> 0xC) & 0xF; + type = PARAMS_GET((u16)thisx->params, 0xC, 0xF); if (!((type == 0) || (type == 1))) { Actor_Kill(thisx); return; @@ -81,13 +81,13 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { thisx->shape.rot.y = 0; thisx->shape.rot.z = 0; - type = ((u16)thisx->params >> 0xC) & 0xF; + type = PARAMS_GET((u16)thisx->params, 0xC, 0xF); if (type == EN_SIOFUKI_RAISING) { this->currentHeight = 10.0f; this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; } else if (type == EN_SIOFUKI_LOWERING) { - if (Flags_GetTreasure(play, (u16)thisx->params & 0x3F)) { + if (Flags_GetTreasure(play, PARAMS_GET((u16)thisx->params, 0, 0x3F))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -189,8 +189,8 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { this->timer--; if (this->timer < 0) { - Flags_UnsetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F); - switch (((u16)this->dyna.actor.params >> 0xC) & 0xF) { + Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F)); + switch (PARAMS_GET((u16)this->dyna.actor.params, 0xC, 0xF)) { case EN_SIOFUKI_RAISING: this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; @@ -204,11 +204,11 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { func_8002F994(&this->dyna.actor, this->timer); } - if (((((u16)this->dyna.actor.params >> 0xC) & 0xF) == EN_SIOFUKI_LOWERING) && - Flags_GetTreasure(play, (u16)this->dyna.actor.params & 0x3F)) { + if ((PARAMS_GET((u16)this->dyna.actor.params, 0xC, 0xF) == EN_SIOFUKI_LOWERING) && + Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 0x3F))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; - Flags_UnsetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F)); this->actionFunc = func_80AFC544; } } @@ -218,7 +218,7 @@ void func_80AFC34C(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F))) { this->targetHeight = 400.0f; this->timer = 300; this->actionFunc = func_80AFC218; @@ -237,7 +237,7 @@ void func_80AFC3C8(EnSiofuki* this, PlayState* play) { this->actionFunc = func_80AFC218; } - if (Flags_GetTreasure(play, (u16)this->dyna.actor.params & 0x3F)) { + if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 0x3F))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -249,14 +249,14 @@ void func_80AFC478(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (((u16)this->dyna.actor.params >> 0xC & 0xF) == EN_SIOFUKI_LOWERING) { - if (Flags_GetSwitch(play, ((u16)this->dyna.actor.params >> 6) & 0x3F)) { + if (PARAMS_GET((u16)this->dyna.actor.params, 0xC, 0xF) == EN_SIOFUKI_LOWERING) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F))) { this->timer = 20; this->actionFunc = func_80AFC3C8; OnePointCutscene_Init(play, 5010, 40, &this->dyna.actor, CAM_ID_MAIN); } - if (Flags_GetTreasure(play, (u16)this->dyna.actor.params & 0x3F)) { + if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 0x3F))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -295,7 +295,7 @@ void EnSiofuki_Draw(Actor* thisx, PlayState* play) { if (this->sfxFlags & 1) { f32 heightRatio; - switch (((u16)thisx->params >> 0xC) & 0xF) { + switch (PARAMS_GET((u16)thisx->params, 0xC, 0xF)) { case EN_SIOFUKI_RAISING: heightRatio = (this->currentHeight - 10.0f) / (400.0f - 10.0f); func_800F436C(&thisx->projectedPos, NA_SE_EV_FOUNTAIN - SFX_FLAG, 1.0f + heightRatio); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 1476a9e0329..727e1945fc5 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -360,7 +360,7 @@ void EnSkj_SetNaviId(EnSkj* this) { } void EnSkj_Init(Actor* thisx, PlayState* play2) { - s16 type = (thisx->params >> 0xA) & 0x3F; + s16 type = PARAMS_GET(thisx->params, 0xA, 0x3F); EnSkj* this = (EnSkj*)thisx; PlayState* play = play2; s32 pad; diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 9934941fd57..f2b7b26ee2f 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -38,7 +38,7 @@ void EnStream_SetupAction(EnStream* this, EnStreamActionFunc actionFunc) { void EnStream_Init(Actor* thisx, PlayState* play) { EnStream* this = (EnStream*)thisx; - this->unk_150 = thisx->params & 0xFF; + this->unk_150 = PARAMS_GET(thisx->params, 0, 0xFF); Actor_ProcessInitChain(thisx, sInitChain); if ((this->unk_150 != 0) && (this->unk_150 == 1)) { thisx->scale.y = 0.01f; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index a55498d3a11..21bc65ba933 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -219,18 +219,18 @@ void EnSw_Init(Actor* thisx, PlayState* play) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; s32 pad; - if (thisx->params & 0x8000) { - phi_v0 = (((thisx->params - 0x8000) & 0xE000) >> 0xD) + 1; - thisx->params = (thisx->params & 0x1FFF) | (phi_v0 << 0xD); + if (PARAMS_GET2(thisx->params, 0, 0x8000)) { + phi_v0 = PARAMS_GET2(thisx->params - 0x8000, 0xD, 0xE000) + 1; + thisx->params = PARAMS_GET2(thisx->params, 0, 0x1FFF) | (phi_v0 << 0xD); } - if (((thisx->params & 0xE000) >> 0xD) > 0) { - phi_v0 = ((thisx->params & 0x1F00) >> 8) - 1; - thisx->params = (thisx->params & 0xE0FF) | (phi_v0 << 8); + if (PARAMS_GET2(thisx->params, 0xD, 0xE000) > 0) { + phi_v0 = PARAMS_GET2(thisx->params, 8, 0x1F00) - 1; + thisx->params = PARAMS_GET2(thisx->params, 0, 0xE0FF) | (phi_v0 << 8); } // Check to see if this gold skull token has already been retrieved. - if (GET_GS_FLAGS((thisx->params & 0x1F00) >> 8) & (thisx->params & 0xFF)) { + if (GET_GS_FLAGS(PARAMS_GET2(thisx->params, 8, 0x1F00)) & PARAMS_GET2(thisx->params, 0, 0xFF)) { Actor_Kill(&this->actor); return; } @@ -243,7 +243,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xE), &D_80B0F074); this->actor.scale.x = 0.02f; - if (((thisx->params & 0xE000) >> 0xD) == 0) { + if (PARAMS_GET2(thisx->params, 0xD, 0xE000) == 0) { this->actor.world.rot.x = 0; this->actor.world.rot.z = 0; thisx->shape.rot = this->actor.world.rot; @@ -265,12 +265,12 @@ void EnSw_Init(Actor* thisx, PlayState* play) { func_80B0C0CC(this, play, 1); } - if (((thisx->params & 0xE000) >> 0xD) >= 3) { + if (PARAMS_GET2(thisx->params, 0xD, 0xE000) >= 3) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - switch ((thisx->params & 0xE000) >> 0xD) { + switch (PARAMS_GET2(thisx->params, 0xD, 0xE000)) { case 3: case 4: this->unk_360 = 1; @@ -298,11 +298,11 @@ void EnSw_Init(Actor* thisx, PlayState* play) { this->actor.home.pos = this->actor.world.pos; thisx->shape.rot = this->actor.world.rot; - if (((thisx->params & 0xE000) >> 0xD) >= 3) { + if (PARAMS_GET2(thisx->params, 0xD, 0xE000) >= 3) { this->unk_38C = 0x28; this->unk_394 = 1; this->actionFunc = func_80B0D364; - } else if (((thisx->params & 0xE000) >> 0xD) == 0) { + } else if (PARAMS_GET2(thisx->params, 0xD, 0xE000) == 0) { this->actionFunc = func_80B0E5E0; } else { this->actionFunc = func_80B0D590; @@ -318,7 +318,7 @@ void EnSw_Destroy(Actor* thisx, PlayState* play) { s32 func_80B0C9F0(EnSw* this, PlayState* play) { s32 phi_v1 = false; - if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && ((this->actor.params & 0xE000) >> 0xD) == 0 && + if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET2(this->actor.params, 0xD, 0xE000) == 0 && play->actorCtx.unk_02 != 0) { this->actor.colChkInfo.damage = this->actor.colChkInfo.health; @@ -335,7 +335,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { return true; } Enemy_StartFinishingBlow(play, &this->actor); - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { this->skelAnime.playSpeed = 8.0f; if ((play->state.frames & 1) == 0) { this->unk_420 = 0.1f; @@ -369,7 +369,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { } void func_80B0CBE8(EnSw* this, PlayState* play) { - if ((((this->actor.params & 0xE000) >> 0xD) > 0) && (this->actionFunc != func_80B0D590)) { + if ((PARAMS_GET2(this->actor.params, 0xD, 0xE000) > 0) && (this->actionFunc != func_80B0D590)) { if (this->unk_392 != 0) { this->unk_392--; } @@ -437,7 +437,7 @@ void func_80B0CEA8(EnSw* this, PlayState* play) { Camera* activeCam = GET_ACTIVE_CAM(play); if (!(Math_Vec3f_DistXYZ(&this->actor.world.pos, &activeCam->eye) >= 380.0f)) { - Audio_PlayActorSound2(&this->actor, ((this->actor.params & 0xE000) >> 0xD) > 0 ? NA_SE_EN_STALGOLD_ROLL + Audio_PlayActorSound2(&this->actor, PARAMS_GET2(this->actor.params, 0xD, 0xE000) > 0 ? NA_SE_EN_STALGOLD_ROLL : NA_SE_EN_STALWALL_ROLL); } } @@ -482,7 +482,7 @@ void func_80B0D14C(EnSw* this, PlayState* play, s32 cnt) { } void func_80B0D364(EnSw* this, PlayState* play) { - if (((this->actor.params & 0xE000) >> 0xD) == 4) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) == 4) { this->unk_38C = 0; this->actionFunc = func_80B0D3AC; } else { @@ -535,7 +535,7 @@ void func_80B0D3AC(EnSw* this, PlayState* play) { void func_80B0D590(EnSw* this, PlayState* play) { f32 sp2C; - if (((this->actor.params & 0xE000) >> 0xD) == 2) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) == 2) { if (this->actor.scale.x < 0.0139999995f) { this->collider.elements[0].info.toucherFlags = TOUCH_NONE; this->collider.elements[0].info.bumperFlags = BUMP_NONE; @@ -559,7 +559,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_420 = ((play->state.frames % 2) == 0) ? 0.1f : -0.1f; this->unk_38A = 1; this->unk_38C = Rand_S16Offset(30, 60); - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { this->unk_38C *= 2; this->unk_420 *= 2.0f; } @@ -570,7 +570,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_38E = Rand_S16Offset(15, 30); this->unk_38A = 0; this->skelAnime.playSpeed = 0.0f; - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { this->unk_38E /= 2; } } else if (this->unk_38A != 0) { @@ -580,7 +580,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { if (this->skelAnime.playSpeed > 0.0f) { func_80B0CEA8(this, play); } - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { this->skelAnime.playSpeed *= 2.0f; } } else { @@ -909,7 +909,7 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po OPEN_DISPS(play->state.gfxCtx, "../z_en_sw.c", 2084); - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { switch (limbIndex) { case 23: *dList = object_st_DL_004788; @@ -1000,7 +1000,7 @@ void EnSw_Draw(Actor* thisx, PlayState* play) { EnSw* this = (EnSw*)thisx; Color_RGBA8 sp30 = { 184, 0, 228, 255 }; - if (((this->actor.params & 0xE000) >> 0xD) != 0) { + if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { Matrix_RotateX(DEG_TO_RAD(-80), MTXMODE_APPLY); if (this->actor.colChkInfo.health != 0) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 2df3f1e891f..74e5c2b4658 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -67,7 +67,7 @@ void EnTrap_Init(Actor* thisx, PlayState* play) { EnTrap* this = (EnTrap*)thisx; ColliderCylinder* unused = &this->collider; // required to match - this->upperParams = (thisx->params >> 8) & 0xFF; + this->upperParams = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; Actor_SetScale(thisx, 0.1f); thisx->gravity = -2.0f; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index f47c91b2774..aac9fde560f 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -72,10 +72,10 @@ void EnTuboTrap_Destroy(Actor* thisx, PlayState* play) { void EnTuboTrap_DropCollectible(EnTuboTrap* this, PlayState* play) { s16 params = this->actor.params; - s16 dropType = (params >> 6) & 0x3FF; + s16 dropType = PARAMS_GET(params, 6, 0x3FF); if (dropType >= 0 && dropType < ITEM00_MAX) { - Item_DropCollectible(play, &this->actor.world.pos, dropType | ((params & 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, dropType | (PARAMS_GET(params, 0, 0x3F) << 8)); } } diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index cbe807cc909..0cb7f839b96 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -134,7 +134,7 @@ void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { this->actor.velocity.x = sinf(angle) * 10.0f; this->actor.velocity.z = cosf(angle) * 10.0f; this->actor.velocity.y *= -0.5f; - if (this->actor.params & 1) { + if (PARAMS_GET(this->actor.params, 0, 1)) { Audio_PlaySoundGeneral(NA_SE_EN_VALVAISA_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } diff --git a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c index 629ec18f4d2..4dacada392c 100644 --- a/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c +++ b/src/overlays/actors/ovl_En_Viewer/z_en_viewer.c @@ -94,7 +94,7 @@ void EnViewer_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnViewer_SetupAction(this, EnViewer_InitImpl); sHorseSfxPlayed = false; - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); this->unused = 0; this->state = 0; this->isVisible = false; @@ -113,7 +113,7 @@ void EnViewer_Destroy(Actor* thisx, PlayState* play) { void EnViewer_InitAnimGanondorfOrZelda(EnViewer* this, PlayState* play, void* skeletonHeaderSeg, AnimationHeader* anim) { - s16 type = this->actor.params >> 8; + s16 type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type == ENVIEWER_TYPE_2_ZELDA || type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF || type == ENVIEWER_TYPE_9_GANONDORF) { @@ -141,7 +141,7 @@ void EnViewer_InitAnimHorse(EnViewer* this, PlayState* play, void* skeletonHeade u8 type; Skin_Init(play, &this->skin, skeletonHeaderSeg, anim); - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); if (!(type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_4_HORSE_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF || type == ENVIEWER_TYPE_9_GANONDORF)) { @@ -165,7 +165,7 @@ static ActorShadowFunc sShadowDrawFuncs[] = { }; void EnViewer_InitImpl(EnViewer* this, PlayState* play) { - EnViewerInitData* initData = &sInitData[this->actor.params >> 8]; + EnViewerInitData* initData = &sInitData[PARAMS_GET_NOMASK(this->actor.params, 8)]; s32 skelObjBankIndex = Object_GetIndex(&play->objectCtx, initData->skeletonObject); ASSERT(skelObjBankIndex >= 0, "bank_ID >= 0", "../z_en_viewer.c", 576); @@ -193,7 +193,7 @@ void EnViewer_InitImpl(EnViewer* this, PlayState* play) { static s16 sTimer = 0; void EnViewer_UpdateImpl(EnViewer* this, PlayState* play) { - u8 type = this->actor.params >> 8; + u8 type = PARAMS_GET_NOMASK(this->actor.params, 8); u16 csFrames; s32 animationEnded; @@ -527,7 +527,7 @@ void EnViewer_DrawGanondorf(EnViewer* this, PlayState* play) { s16 type; OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1405); - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type == ENVIEWER_TYPE_3_GANONDORF || type == ENVIEWER_TYPE_5_GANONDORF || type == ENVIEWER_TYPE_7_GANONDORF || type == ENVIEWER_TYPE_8_GANONDORF) { if (gSaveContext.sceneSetupIndex != 4) { @@ -696,7 +696,7 @@ void EnViewer_Draw(Actor* thisx, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_en_viewer.c", 1760); if (this->isVisible) { - type = this->actor.params >> 8; + type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type <= ENVIEWER_TYPE_2_ZELDA) { // zelda's horse, impa and zelda if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[0] != NULL) { Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -715,7 +715,7 @@ void EnViewer_UpdatePosition(EnViewer* this, PlayState* play) { Vec3f startPos; Vec3f endPos; f32 lerpFactor; - s16 type = this->actor.params >> 8; + s16 type = PARAMS_GET_NOMASK(this->actor.params, 8); if (type <= ENVIEWER_TYPE_2_ZELDA) { // zelda's horse, impa and zelda if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[0] != NULL && @@ -865,7 +865,7 @@ void EnViewer_UpdateGanondorfCape(PlayState* play, EnViewer* this) { Vec3f forearmModelOffset; Vec3f forearmWorldOffset; - if ((this->actor.params >> 8) == ENVIEWER_TYPE_5_GANONDORF) { + if (PARAMS_GET_NOMASK(this->actor.params, 8) == ENVIEWER_TYPE_5_GANONDORF) { if (1) {} sGanondorfCape->backPush = BREG(54) / 10.0f; sGanondorfCape->backSwayMagnitude = (BREG(60) + 25) / 100.0f; diff --git a/src/overlays/actors/ovl_En_Vm/z_en_vm.c b/src/overlays/actors/ovl_En_Vm/z_en_vm.c index 550860379be..cad836f6b43 100644 --- a/src/overlays/actors/ovl_En_Vm/z_en_vm.c +++ b/src/overlays/actors/ovl_En_Vm/z_en_vm.c @@ -142,7 +142,7 @@ void EnVm_Init(Actor* thisx, PlayState* play) { Collider_SetQuad(play, &this->colliderQuad1, thisx, &sQuadInit1); Collider_InitQuad(play, &this->colliderQuad2); Collider_SetQuad(play, &this->colliderQuad2, thisx, &sQuadInit2); - this->beamSightRange = (thisx->params >> 8) * 40.0f; + this->beamSightRange = PARAMS_GET_NOMASK(thisx->params, 8) * 40.0f; thisx->params &= 0xFF; thisx->naviEnemyId = NAVI_ENEMY_BEAMOS; diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 304e83a6775..d12c67e0d0b 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -124,8 +124,8 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->switchFlag = (u8)(thisx->params >> 0x8); - thisx->params = thisx->params & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + thisx->params = PARAMS_GET(thisx->params, 0, 0xFF); if (thisx->params == WMT_FLAG) { if (Flags_GetSwitch(play, this->switchFlag) != 0) { diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 9d03e485d2e..98a4e7bd995 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -55,7 +55,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_0; - switch (this->actor.params & 0xF) { + switch (PARAMS_GET(this->actor.params, 0, 0xF)) { case EN_WEATHER_TAG_TYPE_CLOUDY_MARKET: osSyncPrintf("\n\n"); // "☆☆☆☆☆ (;o;) About ☆☆☆☆☆☆" diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 2aef3c07dcb..6a9e619315a 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -220,7 +220,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.health = 8; thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; - this->switchFlag = (thisx->params >> 8) & 0xFF; + this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; this->eyeIndex = 0; this->unk_2F4 = 10.0f; // Set and not used diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 9c4191277bf..175e4bd30ee 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -122,9 +122,9 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 不思議不思議まか不思議 \t ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->actor.flags &= ~ACTOR_FLAG_0; - this->wonderMode = (this->actor.params >> 0xB) & 0x1F; - this->itemDrop = (this->actor.params >> 6) & 0x1F; - this->switchFlag = this->actor.params & 0x3F; + this->wonderMode = PARAMS_GET(this->actor.params, 0xB, 0x1F); + this->itemDrop = PARAMS_GET(this->actor.params, 6, 0x1F); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index c470558feb8..43303a0f427 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -39,9 +39,9 @@ void EnWonderTalk_Init(Actor* thisx, PlayState* play) { // "Special conversation" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 特殊会話くん ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->unk_150 = (this->actor.params >> 0xB) & 0x1F; - this->unk_152 = (this->actor.params >> 6) & 0x1F; - this->switchFlag = this->actor.params & 0x3F; + this->unk_150 = PARAMS_GET(this->actor.params, 0xB, 0x1F); + this->unk_152 = PARAMS_GET(this->actor.params, 6, 0x1F); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index f3f9ba57885..8dbff4f7a52 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -43,7 +43,7 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { osSyncPrintf("\n\n"); // "Transparent message" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->baseMsgId = (this->actor.params >> 6) & 0xFF; + this->baseMsgId = PARAMS_GET(this->actor.params, 6, 0xFF); if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; s16 rotZmod10 = this->actor.world.rot.z; @@ -73,8 +73,8 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { } this->initPos = this->actor.world.pos; - this->switchFlag = (this->actor.params & 0x3F); - this->talkMode = ((this->actor.params >> 0xE) & 3); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + this->talkMode = PARAMS_GET(this->actor.params, 0xE, 3); if (this->switchFlag == 0x3F) { this->switchFlag = -1; diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index ef1161dda9f..db601a0cf00 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -169,7 +169,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { spawnType = WOOD_SPAWN_NORMAL; actorScale = 1.0f; - this->unk_14C = (this->actor.params >> 8) & 0xFF; + this->unk_14C = PARAMS_GET(this->actor.params, 8, 0xFF); if (this->actor.home.rot.z != 0) { this->actor.home.rot.z = (this->actor.home.rot.z << 8) | this->unk_14C; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index a94eb159033..ea7ca2f94a9 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -283,12 +283,12 @@ void EnZf_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); thisx->targetMode = 3; - this->clearFlag = (thisx->params & 0xFF00) >> 8; + this->clearFlag = PARAMS_GET2(thisx->params, 8, 0xFF00); /* Strip the top byte of params */ thisx->params &= 0xFF; /* Return the params to their original value if they were originally negative, i.e. 0xFFFF or 0xFFFE */ - if (thisx->params & 0x80) { + if (PARAMS_GET2(thisx->params, 0, 0x80)) { thisx->params |= 0xFF00; } diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index cbed9c5109c..03aec63701f 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -722,21 +722,21 @@ void EnZl3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } s32 func_80B54DB4(EnZl3* this) { - s32 params = this->actor.params >> 8; + s32 params = PARAMS_GET(this->actor.params, 8, 0xFF); - return params & 0xFF; + return params; } s32 func_80B54DC4(EnZl3* this) { - s32 params = this->actor.params >> 4; + s32 params = PARAMS_GET(this->actor.params, 4, 0xF); - return params & 0xF; + return params; } s32 func_80B54DD4(EnZl3* this) { - s32 params = this->actor.params; + s32 params = PARAMS_GET(this->actor.params, 0, 0xF); - return params & 0xF; + return params; } void func_80B54DE0(EnZl3* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 73160159d3b..39f000eed4d 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -362,7 +362,7 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { return textId; } - switch (thisx->params & 0x3F) { + switch (PARAMS_GET(thisx->params, 0, 0x3F)) { case 8: if (GET_EVENTCHKINF(EVENTCHKINF_30)) { return 0x402A; @@ -577,7 +577,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit); - if (LINK_IS_ADULT && ((this->actor.params & 0x3F) == 8)) { + if (LINK_IS_ADULT && (PARAMS_GET(this->actor.params, 0, 0x3F) == 8)) { Actor_Kill(&this->actor); return; } @@ -592,7 +592,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); - if (this->actor.yDistToWater < 54.0f || (this->actor.params & 0x3F) == 8) { + if (this->actor.yDistToWater < 54.0f || PARAMS_GET(this->actor.params, 0, 0x3F) == 8) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowScale = 24.0f; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_1); diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index ba29d03285f..f356db2542a 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -62,7 +62,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { s32 type; s32 objBankIndex; - type = this->actor.params & 0xFF; + type = PARAMS_GET(this->actor.params, 0, 0xFF); osSyncPrintf("no = %d\n", type); objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[type]); osSyncPrintf("bank_ID = %d\n", objBankIndex); @@ -118,7 +118,7 @@ void func_80B857D0(ItemEtcetera* this, PlayState* play) { void func_80B85824(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if ((this->actor.params & 0xFF) == 1) { + if (PARAMS_GET(this->actor.params, 0, 0xFF) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -130,7 +130,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { void func_80B858B4(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if ((this->actor.params & 0xFF) == 1) { + if (PARAMS_GET(this->actor.params, 0, 0xFF) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -172,7 +172,7 @@ void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play) { } void func_80B85B28(ItemEtcetera* this, PlayState* play) { - if (Flags_GetTreasure(play, (this->actor.params >> 8) & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 0x1F))) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index dbb11d88888..4c82fc38233 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -38,7 +38,7 @@ void ItemInbox_Destroy(Actor* thisx, PlayState* play) { } void ItemInbox_Wait(ItemInbox* this, PlayState* play) { - if (Flags_GetTreasure(play, (this->actor.params >> 8) & 0x1F)) { + if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 0x1F))) { Actor_Kill(&this->actor); } } @@ -54,5 +54,5 @@ void ItemInbox_Draw(Actor* thisx, PlayState* play) { func_8002EBCC(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0); - GetItem_Draw(play, this->actor.params & 0xFF); + GetItem_Draw(play, PARAMS_GET(this->actor.params, 0, 0xFF)); } diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index e163fb1101d..19a5d1ab534 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -136,7 +136,7 @@ void MirRay_MakeShieldLight(MirRay* this, PlayState* play) { player->actor.world.pos.y + 30.0f, player->actor.world.pos.z, this->sourceEndRad, this->poolEndRad)) { - if (dataEntry->params & 8) { // Light beams from mirrors + if (PARAMS_GET(dataEntry->params, 0, 8)) { // Light beams from mirrors Math_Vec3f_Diff(&player->actor.world.pos, &this->sourcePt, &reflectionPt); } else { // Light beams from windows Math_Vec3f_Diff(&this->poolPt, &this->sourcePt, &reflectionPt); @@ -207,10 +207,10 @@ void MirRay_Init(Actor* thisx, PlayState* play) { this->shieldCorners[5].x = 758.0f; this->shieldCorners[5].y = -800.0f; - if (dataEntry->params & 2) { + if (PARAMS_GET(dataEntry->params, 0, 2)) { Collider_InitJntSph(play, &this->colliderSph); Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem); - if (!(dataEntry->params & 4)) { // Beams not from mirrors + if (!PARAMS_GET(dataEntry->params, 0, 4)) { // Beams not from mirrors MirRay_SetupCollider(this); } } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index 72920d1020d..bda074e04e0 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -226,13 +226,13 @@ void ObjBean_SetDrawMode(ObjBean* this, u8 drawFlag) { } void ObjBean_SetupPathCount(ObjBean* this, PlayState* play) { - this->pathCount = play->setupPathList[(this->dyna.actor.params >> 8) & 0x1F].count - 1; + this->pathCount = play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 0x1F)].count - 1; this->currentPointIndex = 0; this->nextPointIndex = 1; } void ObjBean_SetupPath(ObjBean* this, PlayState* play) { - Path* path = &play->setupPathList[(this->dyna.actor.params >> 8) & 0x1F]; + Path* path = &play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 0x1F)]; Math_Vec3s_ToVec3f(&this->pathPoints, SEGMENTED_TO_VIRTUAL(path->points)); } @@ -250,7 +250,7 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { f32 mag; Math_StepToF(&this->dyna.actor.speedXZ, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel); - path = &play->setupPathList[(this->dyna.actor.params >> 8) & 0x1F]; + path = &play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 0x1F)]; nextPathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->nextPointIndex]; Math_Vec3s_ToVec3f(&pathPointsFloat, nextPathPoint); @@ -469,8 +469,8 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) || (mREG(1) == 1)) { - path = (this->dyna.actor.params >> 8) & 0x1F; + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) || (mREG(1) == 1)) { + path = PARAMS_GET(this->dyna.actor.params, 8, 0x1F); if (path == 0x1F) { osSyncPrintf(VT_COL(RED, WHITE)); // "No path data?" @@ -506,7 +506,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - } else if ((Flags_GetSwitch(play, this->dyna.actor.params & 0x3F) != 0) || (mREG(1) == 1)) { + } else if ((Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) != 0) || (mREG(1) == 1)) { ObjBean_SetupWaitForWater(this); } else { ObjBean_SetupWaitForBean(this); @@ -540,7 +540,7 @@ void ObjBean_WaitForBean(ObjBean* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->dyna.actor, play)) { if (func_8002F368(play) == EXCH_ITEM_BEAN) { func_80B8FE00(this); - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } } else { func_8002F298(&this->dyna.actor, play, 40.0f, EXCH_ITEM_BEAN); diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index d2a1d00bc85..b9e0ec28ab9 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -50,8 +50,8 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId); if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_OBJ_OSHIHIKI) { - if ((dynaPolyActor->actor.params & 0x000F) == PUSHBLOCK_HUGE_START_ON || - (dynaPolyActor->actor.params & 0x000F) == PUSHBLOCK_HUGE_START_OFF) { + if (PARAMS_GET(dynaPolyActor->actor.params, 0, 0x000F) == PUSHBLOCK_HUGE_START_ON || + PARAMS_GET(dynaPolyActor->actor.params, 0, 0x000F) == PUSHBLOCK_HUGE_START_OFF) { func_80078884(NA_SE_SY_CORRECT_CHIME); } else { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index e938f6c29c8..5440dd83cbe 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -74,7 +74,7 @@ void ObjBombiwa_InitCollision(Actor* thisx, PlayState* play) { void ObjBombiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); ObjBombiwa_InitCollision(thisx, play); - if ((Flags_GetSwitch(play, thisx->params & 0x3F) != 0)) { + if ((Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F)) != 0)) { Actor_Kill(thisx); } else { CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); @@ -127,9 +127,9 @@ void ObjBombiwa_Update(Actor* thisx, PlayState* play) { if ((func_80033684(play, &this->actor) != NULL) || ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HAMMER))) { ObjBombiwa_Break(this, play); - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); - if (((this->actor.params >> 0xF) & 1) != 0) { + if (PARAMS_GET(this->actor.params, 0xF, 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index e69e4365091..00c76d558b2 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -128,14 +128,14 @@ void ObjComb_Break(ObjComb* this, PlayState* play) { } void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) { - s16 params = this->actor.params & 0x1F; + s16 params = PARAMS_GET(this->actor.params, 0, 0x1F); if ((params > 0) || (params < ITEM00_MAX)) { // conditional always true. May have been intended to be && if (params == ITEM00_HEART_PIECE) { - if (Flags_GetCollectible(play, (this->actor.params >> 8) & 0x3F)) { + if (Flags_GetCollectible(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { params = -1; } else { - params = (params | (((this->actor.params >> 8) & 0x3F) << 8)); + params = (params | (PARAMS_GET(this->actor.params, 8, 0x3F) << 8)); } } else if (Rand_ZeroOne() < 0.5f) { params = -1; diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index 6cd7e51e051..1abb601a531 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -63,9 +63,9 @@ void ObjElevator_Init(Actor* thisx, PlayState* play) { f32 temp_f0; func_80B92B08(this, play, &object_d_elevator_Col_000360, DPM_PLAYER); - Actor_SetScale(thisx, sScales[thisx->params & 1]); + Actor_SetScale(thisx, sScales[PARAMS_GET(thisx->params, 0, 1)]); Actor_ProcessInitChain(thisx, sInitChain); - temp_f0 = (thisx->params >> 8) & 0xF; + temp_f0 = PARAMS_GET(thisx->params, 8, 0xF); this->unk_16C = temp_f0 + temp_f0; func_80B92C5C(this); osSyncPrintf("(Dungeon Elevator)(arg_data 0x%04x)\n", thisx->params); @@ -88,7 +88,7 @@ void func_80B92C80(ObjElevator* this, PlayState* play) { if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) && !(this->unk_170 & DYNA_INTERACT_PLAYER_ON_TOP)) { sub = thisx->world.pos.y - thisx->home.pos.y; if (fabsf(sub) < 0.1f) { - this->unk_168 = thisx->home.pos.y + ((thisx->params >> 0xC) & 0xF) * 80.0f; + this->unk_168 = thisx->home.pos.y + (PARAMS_GET(thisx->params, 0xC, 0xF)) * 80.0f; } else { this->unk_168 = thisx->home.pos.y; } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index bc62183e470..c7ae6317967 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -149,7 +149,7 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) { ObjHamishi_InitCollision(&this->actor, play); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - if (Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { Actor_Kill(&this->actor); return; } @@ -180,7 +180,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) { } else { ObjHamishi_Break(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); Actor_Kill(&this->actor); } } else { diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 4468077c2d6..d54e0ea2af0 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -71,7 +71,7 @@ static InitChainEntry sInitChain[] = { void ObjHana_Init(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - s16 type = this->actor.params & 3; + s16 type = PARAMS_GET(this->actor.params, 0, 3); HanaParams* params = &sHanaParams[type]; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -94,7 +94,7 @@ void ObjHana_Init(Actor* thisx, PlayState* play) { void ObjHana_Destroy(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[this->actor.params & 3].radius >= 0) { + if (sHanaParams[PARAMS_GET(this->actor.params, 0, 3)].radius >= 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -102,11 +102,11 @@ void ObjHana_Destroy(Actor* thisx, PlayState* play) { void ObjHana_Update(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[this->actor.params & 3].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { + if (sHanaParams[PARAMS_GET(this->actor.params, 0, 3)].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } } void ObjHana_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sHanaParams[thisx->params & 3].dList); + Gfx_DrawDListOpa(play, sHanaParams[PARAMS_GET(thisx->params, 0, 3)].dList); } diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index c7a68820924..d27db1f8ba9 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -67,7 +67,7 @@ void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision } void func_80B93BF0(ObjHsblock* this, PlayState* play) { - if ((this->dyna.actor.params >> 5) & 1) { + if (PARAMS_GET(this->dyna.actor.params, 5, 1)) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); @@ -77,17 +77,17 @@ void func_80B93BF0(ObjHsblock* this, PlayState* play) { void ObjHsblock_Init(Actor* thisx, PlayState* play) { ObjHsblock* this = (ObjHsblock*)thisx; - func_80B93B68(this, play, sCollisionHeaders[thisx->params & 3], DPM_UNK); + func_80B93B68(this, play, sCollisionHeaders[PARAMS_GET(thisx->params, 0, 3)], DPM_UNK); Actor_ProcessInitChain(thisx, sInitChain); func_80B93BF0(this, play); - switch (thisx->params & 3) { + switch (PARAMS_GET(thisx->params, 0, 3)) { case 0: case 2: func_80B93D90(this); break; case 1: - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { func_80B93D90(this); } else { func_80B93DB0(this); @@ -116,7 +116,7 @@ void func_80B93DB0(ObjHsblock* this) { } void func_80B93DF4(ObjHsblock* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { func_80B93E38(this); } } @@ -141,7 +141,7 @@ void ObjHsblock_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != NULL) { this->actionFunc(this, play); } - Actor_SetFocus(thisx, D_80B940C0[thisx->params & 3]); + Actor_SetFocus(thisx, D_80B940C0[PARAMS_GET(thisx->params, 0, 3)]); } void ObjHsblock_Draw(Actor* thisx, PlayState* play) { @@ -165,7 +165,7 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) { } gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 255); - gSPDisplayList(POLY_OPA_DISP++, sDLists[thisx->params & 3]); + gSPDisplayList(POLY_OPA_DISP++, sDLists[PARAMS_GET(thisx->params, 0, 3)]); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_hsblock.c", 399); } diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 24989fa383b..fe328b0f2ca 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -77,7 +77,7 @@ static Color_RGBA8 sColorGray = { 180, 180, 180, 255 }; void ObjIcePoly_Init(Actor* thisx, PlayState* play) { ObjIcePoly* this = (ObjIcePoly*)thisx; - this->unk_151 = (thisx->params >> 8) & 0xFF; + this->unk_151 = PARAMS_GET(thisx->params, 8, 0xFF); thisx->params &= 0xFF; if (thisx->params < 0 || thisx->params >= 3) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 654b9fd3847..1ef10c24815 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -66,9 +66,9 @@ static InitChainEntry sInitChain[] = { void ObjKibako_SpawnCollectible(ObjKibako* this, PlayState* play) { s16 collectible; - collectible = this->actor.params & 0x1F; + collectible = PARAMS_GET(this->actor.params, 0, 0x1F); if ((collectible >= 0) && (collectible < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, collectible | (((this->actor.params >> 8) & 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, collectible | (PARAMS_GET(this->actor.params, 8, 0x3F) << 8)); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index 336de8d2de0..bd34d693be3 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -159,7 +159,7 @@ void ObjKibako2_Idle(ObjKibako2* this, PlayState* play) { void ObjKibako2_Kill(ObjKibako2* this, PlayState* play) { s16 params = this->dyna.actor.params; - if ((params & 0x8000) == 0) { + if (PARAMS_GET(params, 0, 0x8000) == 0) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, params | 0x8000); } diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 957eb1f51e3..7fe40581a5f 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -96,9 +96,9 @@ void func_80B96160(ObjLift* this, PlayState* play) { OBJECT_D_LIFT, gCollapsingPlatformDL); } - if (((this->dyna.actor.params >> 1) & 1) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 1, 1) == 0) { func_80033480(play, &this->dyna.actor.world.pos, 120.0f, 12, 120, 100, 1); - } else if (((this->dyna.actor.params >> 1) & 1) == 1) { + } else if (PARAMS_GET(this->dyna.actor.params, 1, 1) == 1) { func_80033480(play, &this->dyna.actor.world.pos, 60.0f, 8, 60, 100, 1); } } @@ -108,12 +108,12 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { ObjLift_InitDynaPoly(this, play, &gCollapsingPlatformCol, DPM_PLAYER); - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 0x3F))) { Actor_Kill(&this->dyna.actor); return; } - Actor_SetScale(&this->dyna.actor, sScales[(this->dyna.actor.params >> 1) & 1]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET(this->dyna.actor.params, 1, 1)]); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->unk_168.x = Rand_ZeroOne() * 65535.5f; this->unk_168.y = Rand_ZeroOne() * 65535.5f; @@ -129,7 +129,7 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) { } void func_80B9651C(ObjLift* this) { - this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7]; + this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 7)]; ObjLift_SetupAction(this, func_80B96560); } @@ -139,7 +139,7 @@ void func_80B96560(ObjLift* this, PlayState* play) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->timer <= 0) { - if (((this->dyna.actor.params >> 8) & 7) == 7) { + if (PARAMS_GET(this->dyna.actor.params, 8, 7) == 7) { func_80B967C0(this); } else { quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1); @@ -150,7 +150,7 @@ void func_80B96560(ObjLift* this, PlayState* play) { } } } else { - this->timer = sFallTimerDurations[(this->dyna.actor.params >> 8) & 7]; + this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 7)]; } } @@ -193,15 +193,15 @@ void func_80B96840(ObjLift* this, PlayState* play) { Actor_MoveForward(&this->dyna.actor); Math_Vec3f_Copy(&sp2C, &this->dyna.actor.prevPos); - sp2C.y += sMaxFallDistances[(this->dyna.actor.params >> 1) & 1]; + sp2C.y += sMaxFallDistances[PARAMS_GET(this->dyna.actor.params, 1, 1)]; this->dyna.actor.floorHeight = BgCheck_EntityRaycastFloor4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &sp2C); if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= - (sMaxFallDistances[(this->dyna.actor.params >> 1) & 1] - 0.001f)) { + (sMaxFallDistances[PARAMS_GET(this->dyna.actor.params, 1, 1)] - 0.001f)) { func_80B96160(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); - Flags_SetSwitch(play, (this->dyna.actor.params >> 2) & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 0x3F)); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 10029079f80..9156831487d 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -104,10 +104,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { Actor* thisx = &this->actor; // required s32 type; - if (!Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { - type = this->actor.params >> 4 & 3; + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + type = PARAMS_GET(this->actor.params, 4, 3); - Flags_SetSwitch(play, this->actor.params >> 8 & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); if (type == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_TRE_BOX_APPEAR); @@ -120,10 +120,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { } void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, PlayState* play) { - if (Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { - Flags_UnsetSwitch(play, this->actor.params >> 8 & 0x3F); + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + Flags_UnsetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); - if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_1) { + if (PARAMS_GET(this->actor.params, 4, 3) == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, &this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -161,13 +161,13 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, PlayState* play) void ObjLightswitch_Init(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; - s32 switchFlagSet = Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F); + s32 switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); s32 removeSelf = false; Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetFocus(&this->actor, 0.0f); if (switchFlagSet) { - if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN) { + if (PARAMS_GET(this->actor.params, 4, 3) == OBJLIGHTSWITCH_TYPE_BURN) { removeSelf = true; } else { ObjLightswitch_SetupOn(this); @@ -175,7 +175,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) { } else { ObjLightswitch_SetupOff(this); } - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET(this->actor.params, 0, 1) == 1) { if (switchFlagSet) { Math_Vec3f_Copy(&this->actor.world.pos, &D_80B97F68); Math_Vec3f_Copy(&this->actor.home.pos, &D_80B97F68); @@ -222,7 +222,7 @@ void ObjLightswitch_SetupOff(ObjLightswitch* this) { } void ObjLightswitch_Off(ObjLightswitch* this, PlayState* play) { - switch (this->actor.params >> 4 & 3) { + switch (PARAMS_GET(this->actor.params, 4, 3)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: if (this->collider.base.acFlags & AC_HIT) { @@ -289,9 +289,9 @@ void ObjLightswitch_SetupOn(ObjLightswitch* this) { } void ObjLightswitch_On(ObjLightswitch* this, PlayState* play) { - switch (this->actor.params >> 4 & 3) { + switch (PARAMS_GET(this->actor.params, 4, 3)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: - if (!Flags_GetSwitch(play, this->actor.params >> 8 & 0x3F)) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { ObjLightswitch_SetupTurnOff(this); } break; @@ -325,7 +325,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) { } void ObjLightswitch_TurnOff(ObjLightswitch* this, PlayState* play) { - if ((this->actor.params >> 4 & 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || + if (PARAMS_GET(this->actor.params, 4, 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || this->toggleDelay <= 0) { this->timer--; @@ -379,7 +379,7 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); if (this->actor.update != NULL) { - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET(this->actor.params, 0, 1) == 1) { this->actor.world.pos.x = this->actor.child->world.pos.x; this->actor.world.pos.y = this->actor.child->world.pos.y + 60.0f; this->actor.world.pos.z = this->actor.child->world.pos.z; @@ -405,7 +405,7 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { (u8)(this->alpha >> 6)); gSPSegment(POLY_OPA_DISP++, 0x09, &D_80116280[2]); - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET(this->actor.params, 0, 1) == 1) { child = this->actor.child; this->actor.world.pos.x = child->world.pos.x; this->actor.world.pos.y = child->world.pos.y + 60.0f; @@ -488,11 +488,11 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; s32 alpha = this->alpha >> 6 & 0xFF; - if ((this->actor.params & 1) == 1) { + if (PARAMS_GET(this->actor.params, 0, 1) == 1) { Collider_UpdateSpheres(0, &this->collider); } - if ((this->actor.params >> 4 & 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { + if (PARAMS_GET(this->actor.params, 4, 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { ObjLightswitch_DrawXlu(this, play); } else { ObjLightswitch_DrawOpa(this, play); diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 77a0f88c0f7..1cae2875aeb 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -30,7 +30,7 @@ const ActorInit Obj_Makekinsuta_InitVars = { void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) { ObjMakekinsuta* this = (ObjMakekinsuta*)thisx; - if ((this->actor.params & 0x6000) == 0x4000) { + if (PARAMS_GET(this->actor.params, 0, 0x6000) == 0x4000) { osSyncPrintf(VT_FGCOL(BLUE)); // "Gold Star Enemy(arg_data %x)" osSyncPrintf("金スタ発生敵(arg_data %x)\n", this->actor.params); diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index d18d45b1d0f..06739d26318 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -53,9 +53,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) { s32 typeIdx; Vec3f* spawnPos; - if (!((thisx->params >> 6) & 1) && Flags_GetSwitch(play, thisx->params & 0x3F)) { + if (!PARAMS_GET(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { typeIdx = 1; - } else if (!((thisx->params >> 0xE) & 1) && Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + } else if (!PARAMS_GET(thisx->params, 0xE, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { typeIdx = 2; } else { typeIdx = 0; @@ -90,10 +90,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { for (i = 0; i < 3; i++) { if (Math3D_Vec3fDistSq(&thisx->child->world.pos, &block->posVecs[i]) < 0.001f) { if (block->unk_24[i] & 1) { - if ((thisx->params >> 6) & 1) { + if (PARAMS_GET(thisx->params, 6, 1)) { sfxCond1 = false; } else { - if (Flags_GetSwitch(play, thisx->params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { cond = true; } else { cond = false; @@ -101,10 +101,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { sfxCond1 = sFlags[i][0] ^ cond; } - if ((thisx->params >> 0xE) & 1) { + if (PARAMS_GET(thisx->params, 0xE, 1)) { sfxCond2 = false; } else { - if (Flags_GetSwitch(play, (thisx->params >> 8) & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { cond2 = true; } else { cond2 = false; @@ -117,8 +117,8 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { } } - sFlagSwitchFuncs[sFlags[i][0]](play, thisx->params & 0x3F); - sFlagSwitchFuncs[sFlags[i][1]](play, (thisx->params >> 8) & 0x3F); + sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET(thisx->params, 0, 0x3F)); + sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET(thisx->params, 8, 0x3F)); if (block->unk_24[i] & 2) { ((ObjOshihiki*)thisx->child)->cantMove = true; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index c1bd1853be4..4d9cbd6c667 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -89,10 +89,10 @@ s32 ObjMure_SetCulling(Actor* thisx, PlayState* play) { void ObjMure_Init(Actor* thisx, PlayState* play) { ObjMure* this = (ObjMure*)thisx; - this->chNum = (thisx->params >> 0xC) & 0x0F; - this->ptn = (thisx->params >> 8) & 0x07; - this->svNum = (thisx->params >> 5) & 0x03; - this->type = thisx->params & 0x1F; + this->chNum = PARAMS_GET(thisx->params, 0xC, 0x0F); + this->ptn = PARAMS_GET(thisx->params, 8, 0x07); + this->svNum = PARAMS_GET(thisx->params, 5, 0x03); + this->type = PARAMS_GET(thisx->params, 0, 0x1F); if (this->ptn >= 4) { osSyncPrintf("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 237, thisx->params); diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 3187a7725be..f2e0c0d6080 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -52,7 +52,7 @@ void ObjMure2_SetPosShrubCircle(Vec3f* vec, ObjMure2* this) { s32 i; Math_Vec3f_Copy(vec, &this->actor.world.pos); - for (i = 1; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 1; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS((i - 1) * 0x2000)); (vec + i)->z += (80.0f * Math_CosS((i - 1) * 0x2000)); @@ -67,7 +67,7 @@ static Mure2sScatteredShrubInfo sScatteredShrubInfo[] = { void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (sScatteredShrubInfo[i].radius * Math_CosS(sScatteredShrubInfo[i].angle)); (vec + i)->z -= (sScatteredShrubInfo[i].radius * Math_SinS(sScatteredShrubInfo[i].angle)); @@ -77,7 +77,7 @@ void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS(i * 0x2000)); (vec + i)->z += (80.0f * Math_CosS(i * 0x2000)); @@ -86,12 +86,12 @@ void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetActorSpawnParams(s16* params, ObjMure2* this) { static s16 actorSpawnParams[] = { 0, 0, 0 }; - s16 dropTable = (this->actor.params >> 8) & 0xF; + s16 dropTable = PARAMS_GET(this->actor.params, 8, 0xF); if (dropTable >= 13) { dropTable = 0; } - *params = actorSpawnParams[this->actor.params & 3] & 0xF0FF; + *params = actorSpawnParams[PARAMS_GET(this->actor.params, 0, 3)] & 0xF0FF; *params |= (dropTable << 8); } @@ -101,7 +101,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { ObjMure2_SetPosShrubScattered, ObjMure2_SetPosRockCircle, }; - s32 actorNum = this->actor.params & 3; + s32 actorNum = PARAMS_GET(this->actor.params, 0, 3); s32 i; Vec3f spawnPos[12]; s16 params; @@ -131,7 +131,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { if (((this->currentActorNum >> i) & 1) == 0) { if (this->actorSpawnPtrList[i] != NULL) { if (Actor_HasParent(this->actorSpawnPtrList[i], play)) { @@ -150,7 +150,7 @@ void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { void func_80B9A534(ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[this->actor.params & 3]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { if (this->actorSpawnPtrList[i] != NULL && (((this->currentActorNum >> i) & 1) == 0) && (this->actorSpawnPtrList[i]->update == NULL)) { this->currentActorNum |= (1 << i); @@ -189,7 +189,7 @@ void func_80B9A658(ObjMure2* this) { void func_80B9A668(ObjMure2* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < - (sDistSquared1[this->actor.params & 3] * this->unk_184)) { + (sDistSquared1[PARAMS_GET(this->actor.params, 0, 3)] * this->unk_184)) { this->actor.flags |= ACTOR_FLAG_4; ObjMure2_SpawnActors(this, play); func_80B9A6E8(this); @@ -202,7 +202,7 @@ void func_80B9A6E8(ObjMure2* this) { void func_80B9A6F8(ObjMure2* this, PlayState* play) { func_80B9A534(this); - if ((sDistSquared2[this->actor.params & 3] * this->unk_184) <= + if ((sDistSquared2[PARAMS_GET(this->actor.params, 0, 3)] * this->unk_184) <= Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) { this->actor.flags &= ~ACTOR_FLAG_4; ObjMure2_CleanupAndDie(this, play); diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index 233acdba1ff..f0efb0adcb3 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -104,7 +104,7 @@ void func_80B9ABA0(ObjMure3* this, PlayState* play) { } void func_80B9ACE4(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[(this->actor.params >> 13) & 7]; + s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 7)]; s32 i; for (i = 0; i < count; i++) { @@ -122,7 +122,7 @@ void func_80B9ACE4(ObjMure3* this, PlayState* play) { } void func_80B9ADCC(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[(this->actor.params >> 13) & 7]; + s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 7)]; s32 i; for (i = 0; i < count; i++) { @@ -130,7 +130,7 @@ void func_80B9ADCC(ObjMure3* this, PlayState* play) { if ((*collectible != NULL) && !((this->unk_16C >> i) & 1)) { if (Actor_HasParent(&(*collectible)->actor, play)) { - Flags_SetSwitch(play, this->actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); } if ((*collectible)->actor.update == NULL) { this->unk_16C |= (1 << i); @@ -144,7 +144,7 @@ void ObjMure3_Init(Actor* thisx, PlayState* play) { s32 pad; ObjMure3* this = (ObjMure3*)thisx; - if (Flags_GetSwitch(play, this->actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { Actor_Kill(&this->actor); return; } @@ -172,7 +172,7 @@ void func_80B9AF64(ObjMure3* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < SQ(1150.0f)) { this->actor.flags |= ACTOR_FLAG_4; - spawnFuncs[(this->actor.params >> 13) & 7](this, play); + spawnFuncs[PARAMS_GET(this->actor.params, 13, 7)](this, play); func_80B9AFEC(this); } } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index b21dc1ed461..8bc4c8016ec 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -112,7 +112,7 @@ s32 ObjOshihiki_StrongEnough(ObjOshihiki* this) { return 0; } strength = Player_GetStrength(); - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -179,16 +179,16 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* if (dyna == NULL) { return 1; } else if (dyna->actor.id == ACTOR_OBJ_SWITCH) { - dynaSwitchFlag = (dyna->actor.params >> 8) & 0x3F; - switch (dyna->actor.params & 0x33) { + dynaSwitchFlag = PARAMS_GET(dyna->actor.params, 8, 0x3F); + switch (PARAMS_GET(dyna->actor.params, 0, 0x33)) { case 0x20: // Normal blue switch - if ((dynaSwitchFlag == ((this->dyna.actor.params >> 8) & 0x3F)) && + if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 0x3F)) && Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } break; case 0x30: // Inverse blue switch - if ((dynaSwitchFlag == ((this->dyna.actor.params >> 8) & 0x3F)) && + if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 0x3F)) && !Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } @@ -199,7 +199,7 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* } void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -219,11 +219,11 @@ void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { } void ObjOshihiki_SetScale(ObjOshihiki* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, sScales[this->dyna.actor.params & 0xF]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET(this->dyna.actor.params, 0, 0xF)]); } void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -247,7 +247,7 @@ void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play) { s16 paramsColorIdx; s32 i; - paramsColorIdx = (this->dyna.actor.params >> 6) & 3; + paramsColorIdx = PARAMS_GET(this->dyna.actor.params, 6, 3); for (i = 0; i < ARRAY_COUNT(sScenes); i++) { if (sScenes[i] == play->sceneNum) { @@ -273,9 +273,9 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { ObjOshihiki_CheckType(this, play); - if ((((this->dyna.actor.params >> 8) & 0xFF) >= 0) && (((this->dyna.actor.params >> 8) & 0xFF) <= 0x3F)) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F)) { - switch (this->dyna.actor.params & 0xF) { + if ((PARAMS_GET(this->dyna.actor.params, 8, 0xFF) >= 0) && (PARAMS_GET(this->dyna.actor.params, 8, 0xFF) <= 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -284,7 +284,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { return; } } else { - switch (this->dyna.actor.params & 0xF) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { case PUSHBLOCK_SMALL_START_OFF: case PUSHBLOCK_MEDIUM_START_OFF: case PUSHBLOCK_LARGE_START_OFF: diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 1cfc9697e20..33eedd8b796 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -29,18 +29,12 @@ const ActorInit Obj_Roomtimer_InitVars = { void ObjRoomtimer_Init(Actor* thisx, PlayState* play) { ObjRoomtimer* this = (ObjRoomtimer*)thisx; - s16 params = this->actor.params; - this->switchFlag = (params >> 10) & 0x3F; - this->actor.params = params & 0x3FF; - params = this->actor.params; + this->switchFlag = PARAMS_GET(this->actor.params, 10, 0x3F); + this->actor.params = PARAMS_GET(this->actor.params, 0, 0x3FF); - if (params != 0x3FF) { - if (params > 600) { - this->actor.params = 600; - } else { - this->actor.params = params; - } + if (this->actor.params != 0x3FF) { + this->actor.params = CLAMP_MAX(this->actor.params, 600); } this->actionFunc = func_80B9D054; diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index cff2431b05d..6b1cf0ab8af 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -10,10 +10,10 @@ #define FLAGS ACTOR_FLAG_4 -// type: (this->dyna.actor.params & 7) -// subtype: (this->dyna.actor.params >> 4 & 7) -// switch flag: (this->dyna.actor.params >> 8 & 0x3F) -// frozen: this->dyna.actor.params >> 7 & 1 +// type: PARAMS_GET(this->dyna.actor.params, 0, 7) +// subtype: PARAMS_GET(this->dyna.actor.params, 4, 7) +// switch flag: PARAMS_GET(this->dyna.actor.params, 8, 0x3F) +// frozen: PARAMS_GET(this->dyna.actor.params, 7, 1) void ObjSwitch_Init(Actor* thisx, PlayState* play); void ObjSwitch_Destroy(Actor* thisx, PlayState* play); @@ -235,18 +235,18 @@ Actor* ObjSwitch_SpawnIce(ObjSwitch* this, PlayState* play) { return Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_OBJ_ICE_POLY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z, - (this->dyna.actor.params >> 8 & 0x3F) << 8); + PARAMS_GET(this->dyna.actor.params, 8, 0x3F) << 8); } void ObjSwitch_SetOn(ObjSwitch* this, PlayState* play) { s32 pad; s32 subType; - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { this->cooldownOn = false; } else { - subType = (this->dyna.actor.params >> 4 & 7); - Flags_SetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F)); + subType = PARAMS_GET(this->dyna.actor.params, 4, 7); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); if (subType == OBJSWITCH_SUBTYPE_ONCE || subType == OBJSWITCH_SUBTYPE_SYNC) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_CORRECT_CHIME); @@ -261,10 +261,10 @@ void ObjSwitch_SetOn(ObjSwitch* this, PlayState* play) { void ObjSwitch_SetOff(ObjSwitch* this, PlayState* play) { this->cooldownOn = false; - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { - Flags_UnsetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F)); + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); - if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_TOGGLE) { + if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_TOGGLE) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); this->cooldownOn = true; } @@ -283,8 +283,8 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) { s32 switchFlagSet; s32 type; - switchFlagSet = Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F)); - type = (this->dyna.actor.params & 7); + switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + type = PARAMS_GET(this->dyna.actor.params, 0, 7); if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { ObjSwitch_InitDynaPoly(this, play, &gFloorSwitchCol, DPM_PLAYER); @@ -313,14 +313,14 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) { this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; - if ((this->dyna.actor.params >> 7 & 1) && (ObjSwitch_SpawnIce(this, play) == NULL)) { + if (PARAMS_GET(this->dyna.actor.params, 7, 1) && (ObjSwitch_SpawnIce(this, play) == NULL)) { osSyncPrintf(VT_FGCOL(RED)); osSyncPrintf("Error : 氷発生失敗 (%s %d)\n", "../z_obj_switch.c", 732); osSyncPrintf(VT_RST); this->dyna.actor.params &= ~0x80; } - if (this->dyna.actor.params >> 7 & 1) { + if (PARAMS_GET(this->dyna.actor.params, 7, 1)) { ObjSwitch_EyeFrozenInit(this); } else if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { //! @bug This condition does not account for OBJSWITCH_SUBTYPE_HOLD_INVERTED which expects @@ -350,14 +350,14 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) { void ObjSwitch_Destroy(Actor* thisx, PlayState* play) { ObjSwitch* this = (ObjSwitch*)thisx; - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { case OBJSWITCH_TYPE_FLOOR: case OBJSWITCH_TYPE_FLOOR_RUSTY: DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); break; } - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { case OBJSWITCH_TYPE_FLOOR_RUSTY: case OBJSWITCH_TYPE_EYE: Collider_DestroyTris(play, &this->tris.col); @@ -375,7 +375,7 @@ void ObjSwitch_FloorUpInit(ObjSwitch* this) { } void ObjSwitch_FloorUp(ObjSwitch* this, PlayState* play) { - if ((this->dyna.actor.params & 7) == OBJSWITCH_TYPE_FLOOR_RUSTY) { + if (PARAMS_GET(this->dyna.actor.params, 0, 7) == OBJSWITCH_TYPE_FLOOR_RUSTY) { if (this->tris.col.base.acFlags & AC_HIT) { ObjSwitch_FloorPressInit(this); ObjSwitch_SetOn(this, play); @@ -384,7 +384,7 @@ void ObjSwitch_FloorUp(ObjSwitch* this, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->tris.col.base); } } else { - switch (this->dyna.actor.params >> 4 & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { case OBJSWITCH_SUBTYPE_ONCE: if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { ObjSwitch_FloorPressInit(this); @@ -420,7 +420,7 @@ void ObjSwitch_FloorPressInit(ObjSwitch* this) { } void ObjSwitch_FloorPress(ObjSwitch* this, PlayState* play) { - if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_HOLD_INVERTED || !this->cooldownOn || + if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_HOLD_INVERTED || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->dyna.actor.scale.y -= 99.0f / 2000.0f; if (this->dyna.actor.scale.y <= 33.0f / 2000.0f) { @@ -438,9 +438,9 @@ void ObjSwitch_FloorDownInit(ObjSwitch* this) { } void ObjSwitch_FloorDown(ObjSwitch* this, PlayState* play) { - switch (this->dyna.actor.params >> 4 & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { case OBJSWITCH_SUBTYPE_ONCE: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { ObjSwitch_FloorReleaseInit(this); } break; @@ -456,7 +456,7 @@ void ObjSwitch_FloorDown(ObjSwitch* this, PlayState* play) { if (!func_800435B4(&this->dyna) && !Player_InCsMode(play)) { if (this->releaseTimer <= 0) { ObjSwitch_FloorReleaseInit(this); - if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_HOLD) { + if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_HOLD) { ObjSwitch_SetOff(this, play); } else { ObjSwitch_SetOn(this, play); @@ -475,7 +475,7 @@ void ObjSwitch_FloorReleaseInit(ObjSwitch* this) { } void ObjSwitch_FloorRelease(ObjSwitch* this, PlayState* play) { - s16 subType = (this->dyna.actor.params >> 4 & 7); + s16 subType = PARAMS_GET(this->dyna.actor.params, 4, 7); if (((subType != OBJSWITCH_SUBTYPE_TOGGLE) && (subType != OBJSWITCH_SUBTYPE_HOLD_INVERTED)) || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { @@ -511,7 +511,7 @@ void ObjSwitch_EyeFrozenInit(ObjSwitch* this) { } void ObjSwitch_EyeInit(ObjSwitch* this, PlayState* play) { - if (Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { ObjSwitch_EyeClosedInit(this); } else { ObjSwitch_EyeOpenInit(this); @@ -524,7 +524,7 @@ void ObjSwitch_EyeOpenInit(ObjSwitch* this) { } void ObjSwitch_EyeOpen(ObjSwitch* this, PlayState* play) { - if (ObjSwitch_EyeIsHit(this) || (this->dyna.actor.params >> 7 & 1)) { + if (ObjSwitch_EyeIsHit(this) || PARAMS_GET(this->dyna.actor.params, 7, 1)) { ObjSwitch_EyeClosingInit(this); ObjSwitch_SetOn(this, play); this->dyna.actor.params &= ~0x80; @@ -552,15 +552,15 @@ void ObjSwitch_EyeClosedInit(ObjSwitch* this) { } void ObjSwitch_EyeClosed(ObjSwitch* this, PlayState* play) { - switch (this->dyna.actor.params >> 4 & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { case OBJSWITCH_SUBTYPE_ONCE: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { ObjSwitch_EyeOpeningInit(this); this->dyna.actor.params &= ~0x80; } break; case OBJSWITCH_SUBTYPE_TOGGLE: - if (ObjSwitch_EyeIsHit(this) || (this->dyna.actor.params >> 7 & 1)) { + if (ObjSwitch_EyeIsHit(this) || PARAMS_GET(this->dyna.actor.params, 7, 1)) { ObjSwitch_EyeOpeningInit(this); ObjSwitch_SetOff(this, play); this->dyna.actor.params &= ~0x80; @@ -575,7 +575,7 @@ void ObjSwitch_EyeOpeningInit(ObjSwitch* this) { } void ObjSwitch_EyeOpening(ObjSwitch* this, PlayState* play) { - if ((this->dyna.actor.params >> 4 & 7) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || + if (PARAMS_GET(this->dyna.actor.params, 4, 7) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->eyeTexIndex--; if (this->eyeTexIndex <= 0) { @@ -594,7 +594,7 @@ void ObjSwitch_CrystalOffInit(ObjSwitch* this) { } void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) { - switch (this->dyna.actor.params >> 4 & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { case OBJSWITCH_SUBTYPE_ONCE: if ((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; @@ -604,7 +604,7 @@ void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) { break; case OBJSWITCH_SUBTYPE_SYNC: if (((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) || - Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, play); ObjSwitch_CrystalTurnOnInit(this); @@ -629,7 +629,7 @@ void ObjSwitch_CrystalTurnOnInit(ObjSwitch* this) { void ObjSwitch_CrystalTurnOn(ObjSwitch* this, PlayState* play) { if (!this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOnInit(this); - if ((this->dyna.actor.params >> 4 & 7) == OBJSWITCH_SUBTYPE_TOGGLE) { + if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_TOGGLE) { ObjSwitch_UpdateTwoTexScrollXY(this); } Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_DIAMOND_SWITCH); @@ -645,10 +645,10 @@ void ObjSwitch_CrystalOnInit(ObjSwitch* this) { } void ObjSwitch_CrystalOn(ObjSwitch* this, PlayState* play) { - switch (this->dyna.actor.params >> 4 & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { case OBJSWITCH_SUBTYPE_ONCE: case OBJSWITCH_SUBTYPE_SYNC: - if (!Flags_GetSwitch(play, (this->dyna.actor.params >> 8 & 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { ObjSwitch_CrystalTurnOffInit(this); } break; @@ -670,7 +670,7 @@ void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this) { } void ObjSwitch_CrystalTurnOff(ObjSwitch* this, PlayState* play) { - if ((this->dyna.actor.params >> 4 & 7) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || + if (PARAMS_GET(this->dyna.actor.params, 4, 7) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOffInit(this); ObjSwitch_UpdateTwoTexScrollXY(this); @@ -690,7 +690,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - switch (this->dyna.actor.params & 7) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { case OBJSWITCH_TYPE_FLOOR: case OBJSWITCH_TYPE_FLOOR_RUSTY: this->unk_17F = this->dyna.interactFlags; @@ -718,7 +718,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { void ObjSwitch_DrawFloor(ObjSwitch* this, PlayState* play) { static Gfx* floorSwitchDLists[] = { gFloorSwitch1DL, gFloorSwitch3DL, gFloorSwitch2DL, gFloorSwitch2DL }; - Gfx_DrawDListOpa(play, floorSwitchDLists[(this->dyna.actor.params >> 4 & 7)]); + Gfx_DrawDListOpa(play, floorSwitchDLists[PARAMS_GET(this->dyna.actor.params, 4, 7)]); } void ObjSwitch_DrawFloorRusty(ObjSwitch* this, PlayState* play) { @@ -732,7 +732,7 @@ void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { }; static Gfx* eyeDlists[] = { gEyeSwitch1DL, gEyeSwitch2DL }; s32 pad; - s32 subType = (this->dyna.actor.params >> 4 & 7); + s32 subType = PARAMS_GET(this->dyna.actor.params, 4, 7); OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1459); @@ -754,7 +754,7 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { s32 pad2; s32 subType; - subType = (this->dyna.actor.params >> 4 & 7); + subType = PARAMS_GET(this->dyna.actor.params, 4, 7); func_8002ED80(&this->dyna.actor, play, 0); if (1) {} @@ -794,5 +794,5 @@ static ObjSwitchActionFunc sDrawFuncs[] = { void ObjSwitch_Draw(Actor* thisx, PlayState* play) { ObjSwitch* this = (ObjSwitch*)thisx; - sDrawFuncs[(this->dyna.actor.params & 7)](this, play); + sDrawFuncs[PARAMS_GET(this->dyna.actor.params, 0, 7)](this, play); } diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 92ee4585c58..2e356f9d0bb 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -81,14 +81,14 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { static u8 sColTypesStand[] = { 0x09, 0x0B, 0x0B }; s32 pad; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchType = this->actor.params & 0xF000; + s32 torchType = PARAMS_GET(this->actor.params, 0, 0xF000); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); Collider_InitCylinder(play, &this->colliderStand); Collider_SetCylinder(play, &this->colliderStand, &this->actor, &sCylInitStand); - this->colliderStand.base.colType = sColTypesStand[this->actor.params >> 0xC]; + this->colliderStand.base.colType = sColTypesStand[PARAMS_GET_NOMASK(this->actor.params, 0xC)]; Collider_InitCylinder(play, &this->colliderFlame); Collider_SetCylinder(play, &this->colliderFlame, &this->actor, &sCylInitFlame); @@ -99,7 +99,7 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - if ((this->actor.params & 0x400) || ((torchType != 2) && Flags_GetSwitch(play, this->actor.params & 0x3F))) { + if (PARAMS_GET(this->actor.params, 0, 0x400) || ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)))) { this->litTimer = -1; } @@ -120,9 +120,9 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play) { void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchCount = (this->actor.params >> 6) & 0xF; - s32 switchFlag = this->actor.params & 0x3F; - s32 torchType = this->actor.params & 0xF000; + s32 torchCount = PARAMS_GET(this->actor.params, 6, 0xF); + s32 switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + s32 torchType = PARAMS_GET(this->actor.params, 0, 0xF000); s32 litTimeScale; WaterBox* dummy; f32 waterSurface; @@ -153,7 +153,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { } else { player = GET_PLAYER(play); interactionType = 0; - if (this->actor.params & 0x400) { + if (PARAMS_GET(this->actor.params, 0, 0x400)) { this->litTimer = -1; } if (torchCount != 0) { @@ -263,7 +263,7 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { ObjSyokudai* this = (ObjSyokudai*)thisx; s32 timerMax; - timerMax = (((this->actor.params >> 6) & 0xF) * 50) + 100; + timerMax = PARAMS_GET(this->actor.params, 6, 0xF) * 50 + 100; OPEN_DISPS(play->state.gfxCtx, "../z_obj_syokudai.c", 707); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -271,7 +271,7 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_syokudai.c", 714), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, displayLists[(u16)this->actor.params >> 0xC]); + gSPDisplayList(POLY_OPA_DISP++, displayLists[PARAMS_GET_NOMASK((u16)this->actor.params, 0xC)]); if (this->litTimer != 0) { f32 flameScale = 1.0f; diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index 96d4bc2c3a6..ed03768fcf0 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -63,11 +63,11 @@ static Color_RGB8 sPrimColors[] = { }; u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { - if (!((this->dyna.actor.params >> 10) & 1)) { + if (!PARAMS_GET(this->dyna.actor.params, 10, 1)) { if (this->unk_177 == 0) { return this->unk_175; } else { - u8 temp = ((this->dyna.actor.params >> 15) & 1) ? true : false; + u8 temp = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; if (this->unk_177 == 1) { return this->unk_174 ^ temp; @@ -78,14 +78,14 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { } } } else { - return (((this->dyna.actor.params >> 15) & 1) ? true : false) ^ this->unk_174; + return (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false) ^ this->unk_174; } } void ObjTimeblock_SpawnDemoEffect(ObjTimeblock* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, 0, 0, - sSizeOptions[(this->dyna.actor.params >> 8) & 1].demoEffectParams); + sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].demoEffectParams); } void ObjTimeblock_ToggleSwitchFlag(PlayState* play, s32 flag) { @@ -109,23 +109,23 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetScale(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].scale); + Actor_SetScale(&this->dyna.actor, sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].scale); - if ((this->dyna.actor.params >> 6) & 1) { + if (PARAMS_GET(this->dyna.actor.params, 6, 1)) { this->unk_177 = 0; } else { - this->unk_177 = ((this->dyna.actor.params & 0x3F) < 0x38) ? 2 : 1; + this->unk_177 = (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) < 0x38) ? 2 : 1; } this->songObserverFunc = ObjTimeblock_WaitForOcarina; - Actor_SetFocus(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height); + Actor_SetFocus(&this->dyna.actor, sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].height); - this->unk_174 = (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) ? true : false; - this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) ? true : false; + this->unk_175 = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; this->isVisible = ObjTimeblock_CalculateIsVisible(this); - if (!((this->dyna.actor.params >> 10) & 1)) { + if (!PARAMS_GET(this->dyna.actor.params, 10, 1)) { ObjTimeblock_SetupNormal(this); } else if (this->isVisible) { ObjTimeblock_SetupAltBehaviorVisible(this); @@ -135,8 +135,8 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { // "Block of time" osSyncPrintf("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 11) & 7, - (this->dyna.actor.params >> 10) & 1); + this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 7), + PARAMS_GET(this->dyna.actor.params, 10, 1)); } void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) { @@ -151,7 +151,7 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, PlayState* play) { return false; } - if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) { + if (this->dyna.actor.xzDistToPlayer <= sRanges[PARAMS_GET(this->dyna.actor.params, 11, 7)]) { Vec3f distance; f32 blockSize; @@ -225,7 +225,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { if (this->unk_177 == 0) { this->dyna.actor.params ^= 0x8000; } else { - ObjTimeblock_ToggleSwitchFlag(play, this->dyna.actor.params & 0x3F); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } } @@ -234,9 +234,9 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { this->demoEffectFirstPartTimer--; if (this->demoEffectFirstPartTimer == 0) { if (this->unk_177 == 0) { - this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false; + this->unk_175 = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; } else { - this->unk_174 = (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) ? true : false; } } } @@ -253,7 +253,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { } void func_80BA06AC(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = this->dyna.actor.params & 0x3F; + s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); this->unk_172 = play->msgCtx.lastPlayedSong; @@ -277,7 +277,7 @@ void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play) { OnePointCutscene_Attention(play, &this->dyna.actor); // "Time Block Attention Camera (frame counter)" osSyncPrintf("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n", play->state.frames); - ObjTimeblock_ToggleSwitchFlag(play, this->dyna.actor.params & 0x3F); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } func_80BA06AC(this, play); @@ -296,10 +296,10 @@ void ObjTimeblock_SetupAltBehaviourNotVisible(ObjTimeblock* this) { } void ObjTimeblock_AltBehaviourNotVisible(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = this->dyna.actor.params & 0x3F; + s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); s8 switchFlagIsSet = (Flags_GetSwitch(play, switchFlag)) ? true : false; - if (this->unk_176 ^ switchFlagIsSet && switchFlagIsSet ^ (((this->dyna.actor.params >> 15) & 1) ? true : false)) { + if (this->unk_176 ^ switchFlagIsSet && switchFlagIsSet ^ (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false)) { if (this->demoEffectTimer <= 0) { ObjTimeblock_SpawnDemoEffect(this, play); this->demoEffectTimer = 160; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 6217588e092..4046266aa57 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -83,10 +83,10 @@ static InitChainEntry sInitChain[] = { }; void ObjTsubo_SpawnCollectible(ObjTsubo* this, PlayState* play) { - s16 dropParams = this->actor.params & 0x1F; + s16 dropParams = PARAMS_GET(this->actor.params, 0, 0x1F); if ((dropParams >= 0) && (dropParams < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, (dropParams | (((this->actor.params >> 9) & 0x3F) << 8))); + Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET(this->actor.params, 9, 0x3F) << 8)); } } @@ -135,7 +135,7 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - this->objTsuboBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[(this->actor.params >> 8) & 1]); + this->objTsuboBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[PARAMS_GET(this->actor.params, 8, 1)]); if (this->objTsuboBankIndex < 0) { osSyncPrintf("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_obj_tsubo.c", 410); Actor_Kill(&this->actor); @@ -183,7 +183,7 @@ void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) { } EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -240, arg5, 10, 10, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 60, KAKERA_COLOR_NONE, - sObjectIds[(this->actor.params >> 8) & 1], D_80BA1B8C[(this->actor.params >> 8) & 1]); + sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); } func_80033480(play, &this->actor.world.pos, 30.0f, 4, 20, 50, 1); } @@ -212,7 +212,7 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) { phi_s0 = (Rand_ZeroOne() < .2f) ? 64 : 32; EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -180, phi_s0, 30, 30, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 70, KAKERA_COLOR_NONE, - sObjectIds[(this->actor.params >> 8) & 1], D_80BA1B8C[(this->actor.params >> 8) & 1]); + sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); } } @@ -337,5 +337,5 @@ void ObjTsubo_Update(Actor* thisx, PlayState* play) { } void ObjTsubo_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_80BA1B84[(thisx->params >> 8) & 1]); + Gfx_DrawDListOpa(play, D_80BA1B84[PARAMS_GET(thisx->params, 8, 1)]); } diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index f98a3a3fc17..ed7f4606584 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -66,11 +66,11 @@ static Color_RGB8 sColors[] = { void ObjWarp2block_Spawn(ObjWarp2block* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, - this->dyna.actor.world.pos.z, 0, 0, 0, sSpawnData[(this->dyna.actor.params >> 8) & 1].params); + this->dyna.actor.world.pos.z, 0, 0, 0, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].params); Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.child->world.pos.x, this->dyna.actor.child->world.pos.y, this->dyna.actor.child->world.pos.z, 0, 0, 0, - sSpawnData[(this->dyna.actor.child->params >> 8) & 1].params); + sSpawnData[PARAMS_GET(this->dyna.actor.child->params, 8, 1)].params); } s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { @@ -86,8 +86,8 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { temp_a3 = this->dyna.actor.child; player = GET_PLAYER(play); - if ((this->dyna.actor.xzDistToPlayer <= sDistances[(((this->dyna.actor.params >> 0xB) & 7))]) || - (temp_a3->xzDistToPlayer <= sDistances[(((temp_a3->params >> 0xB) & 7))])) { + if ((this->dyna.actor.xzDistToPlayer <= sDistances[PARAMS_GET(this->dyna.actor.params, 0xB, 7)]) || + (temp_a3->xzDistToPlayer <= sDistances[PARAMS_GET(temp_a3->params, 0xB, 7)])) { func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos); temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f; @@ -142,14 +142,14 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { this->dyna.actor.focus.rot = this->dyna.actor.child->focus.rot; this->dyna.actor.child->focus.rot = tempRot; - temp = this->dyna.actor.params & 0x7FFF; - this->dyna.actor.params = (this->dyna.actor.params & 0x8000) | (this->dyna.actor.child->params & 0x7FFF); - this->dyna.actor.child->params = (this->dyna.actor.child->params & 0x8000) | (temp & 0x7FFF); + temp = PARAMS_GET(this->dyna.actor.params, 0, 0x7FFF); + this->dyna.actor.params = PARAMS_GET(this->dyna.actor.params, 0, 0x8000) | PARAMS_GET(this->dyna.actor.child->params, 0, 0x7FFF); + this->dyna.actor.child->params = PARAMS_GET(this->dyna.actor.child->params, 0, 0x8000) | (temp & 0x7FFF); if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos) < 0.01f) { - Flags_UnsetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } else { - Flags_SetSwitch(play, this->dyna.actor.params & 0x3F); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); } } @@ -203,13 +203,13 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetScale(&this->dyna.actor, sSpawnData[(this->dyna.actor.params >> 8) & 1].scale); + Actor_SetScale(&this->dyna.actor, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].scale); this->func_168 = func_80BA2218; - Actor_SetFocus(&this->dyna.actor, sSpawnData[(this->dyna.actor.params >> 8) & 1].focus); + Actor_SetFocus(&this->dyna.actor, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].focus); - if ((this->dyna.actor.params >> 0xF) & 1) { + if (PARAMS_GET(this->dyna.actor.params, 0xF, 1)) { func_80BA24E8(this); - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { this->dyna.actor.draw = NULL; } DynaPolyActor_Init(&this->dyna, 0); @@ -219,13 +219,13 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { ObjWarp2block_SetInactive(this); } - osSyncPrintf("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", this->dyna.actor.params & 0xFFFF, - this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 0xB) & 7); + osSyncPrintf("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", PARAMS_GET(this->dyna.actor.params, 0, 0xFFFF), + this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 0xB, 7)); } void ObjWarp2block_Destroy(Actor* thisx, PlayState* play) { ObjWarp2block* this = (ObjWarp2block*)thisx; - if ((this->dyna.actor.params >> 0xF) & 1) { + if (PARAMS_GET(this->dyna.actor.params, 0xF, 1)) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } } @@ -246,10 +246,10 @@ void func_80BA24F8(ObjWarp2block* this, PlayState* play) { Actor* current = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (current != NULL) { - if (current->id == ACTOR_OBJ_WARP2BLOCK && !((current->params >> 0xF) & 1) && - ((this->dyna.actor.params & 0x3F) == (current->params & 0x3F))) { + if (current->id == ACTOR_OBJ_WARP2BLOCK && !PARAMS_GET(current->params, 0xF, 1) && + (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) == PARAMS_GET(current->params, 0, 0x3F))) { this->dyna.actor.child = current; - if (Flags_GetSwitch(play, this->dyna.actor.params & 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { ObjWarp2block_SwapWithChild(this, play); this->dyna.actor.draw = ObjWarp2block_Draw; } diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index cb753ac12fd..b0de2381918 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -59,7 +59,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { // "Ocarina secret occurrence" osSyncPrintf("%d ---- オカリナの秘密発生!!!!!!!!!!!!!\n", this->actor.params); - params = this->actor.params & 0xFF; + params = PARAMS_GET(this->actor.params, 0, 0xFF); if (params == 0x40 || params == 0x41) { this->unk_1A4 = 0; this->actor.flags |= ACTOR_FLAG_4; @@ -76,7 +76,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { void ShotSun_Destroy(Actor* thisx, PlayState* play) { ShotSun* this = (ShotSun*)thisx; - s32 params = this->actor.params & 0xFF; + s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); if (params != 0x40 && params != 0x41) { Collider_DestroyCylinder(play, &this->collider); @@ -84,7 +84,7 @@ void ShotSun_Destroy(Actor* thisx, PlayState* play) { } void ShotSun_SpawnFairy(ShotSun* this, PlayState* play) { - s32 params = this->actor.params & 0xFF; + s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); s32 fairyType; if (this->timer > 0) { @@ -122,7 +122,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { void func_80BADF0C(ShotSun* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s32 params = this->actor.params & 0xFF; + s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) { this->unk_1A4 = 0; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index d95f299b694..208f1eced4f 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4373,7 +4373,7 @@ s32 func_80839800(Player* this, PlayState* play) { } if (doorShutter->dyna.actor.category == ACTORCAT_DOOR) { - this->doorBgCamIndex = play->transiActorCtx.list[(u16)doorShutter->dyna.actor.params >> 10] + this->doorBgCamIndex = play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)doorShutter->dyna.actor.params, 10)] .sides[(doorDirection > 0) ? 0 : 1] .bgCamIndex; @@ -4432,7 +4432,7 @@ s32 func_80839800(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_29; Actor_DisableLens(play); - if (((doorActor->params >> 7) & 7) == 3) { + if (PARAMS_GET(doorActor->params, 7, 7) == 3) { sp4C.x = doorActor->world.pos.x - (sp6C * sp74); sp4C.y = doorActor->world.pos.y + 10.0f; sp4C.z = doorActor->world.pos.z - (sp6C * sp78); @@ -4445,7 +4445,7 @@ s32 func_80839800(Player* this, PlayState* play) { } } else { Camera_ChangeDoorCam(Play_GetCamera(play, CAM_ID_MAIN), doorActor, - play->transiActorCtx.list[(u16)doorActor->params >> 10] + play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)doorActor->params, 10)] .sides[(doorDirection > 0) ? 0 : 1] .bgCamIndex, 0, 38.0f * D_808535EC, 26.0f * D_808535EC, 10.0f * D_808535EC); @@ -4455,7 +4455,7 @@ s32 func_80839800(Player* this, PlayState* play) { if ((this->doorType != PLAYER_DOORTYPE_FAKE) && (doorActor->category == ACTORCAT_DOOR)) { frontRoom = - play->transiActorCtx.list[(u16)doorActor->params >> 10].sides[(doorDirection > 0) ? 0 : 1].room; + play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)doorActor->params, 10)].sides[(doorDirection > 0) ? 0 : 1].room; if ((frontRoom >= 0) && (frontRoom != play->roomCtx.curRoom.num)) { func_8009728C(play, &play->roomCtx, frontRoom); @@ -4555,7 +4555,7 @@ void func_8083A0F4(PlayState* play, Player* this) { func_80835C58(play, this, func_80846120, 0); this->stateFlags1 |= PLAYER_STATE1_29; anim = &gPlayerAnim_002F98; - } else if ((interactActorId == ACTOR_EN_ISHI) && ((interactRangeActor->params & 0xF) == 1)) { + } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET(interactRangeActor->params, 0, 0xF) == 1)) { func_80835C58(play, this, func_80846260, 0); anim = &gPlayerAnim_0032B0; } else if (((interactActorId == ACTOR_EN_BOMBF) || (interactActorId == ACTOR_EN_KUSA)) && @@ -6194,7 +6194,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { } else { s32 strength = Player_GetStrength(); - if ((interactedActor->id == ACTOR_EN_ISHI) && ((interactedActor->params & 0xF) == 1) && + if ((interactedActor->id == ACTOR_EN_ISHI) && (PARAMS_GET(interactedActor->params, 0, 0xF) == 1) && (strength < PLAYER_STR_SILVER_G)) { return 0; } @@ -9355,7 +9355,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { } if (func_80845C68(play, (respawnFlag == 2) ? 1 : 0) == 0) { - gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = (thisx->params & 0xFF) | 0xD00; + gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PARAMS_GET2(thisx->params, 0, 0xFF) | 0xD00; } gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1; @@ -9364,7 +9364,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { gSaveContext.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneNum]; } - initMode = (thisx->params & 0xF00) >> 8; + initMode = PARAMS_GET2(thisx->params, 8, 0xF00); if ((initMode == 5) || (initMode == 6)) { if (gSaveContext.cutsceneIndex >= 0xFFF0) { initMode = 13; From 3611da83e845cc8605d5d9bc40c865ab00b28acd Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Mon, 11 Jul 2022 19:08:29 +0100 Subject: [PATCH 02/16] NOSHIFT macro --- src/code/z_room.c | 2 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 2 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 2 +- .../z_bg_spot08_iceblock.c | 12 ++-- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 8 +-- .../actors/ovl_Door_Warp1/z_door_warp1.c | 2 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 8 +-- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 4 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 6 +- src/overlays/actors/ovl_En_Door/z_en_door.c | 2 +- .../actors/ovl_En_Firefly/z_en_firefly.c | 2 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 62 +++++++++---------- src/overlays/actors/ovl_En_Horse/z_en_horse.c | 2 +- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 2 +- src/overlays/actors/ovl_En_Ik/z_en_ik.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 2 +- .../actors/ovl_Obj_Kibako2/z_obj_kibako2.c | 2 +- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 2 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 8 +-- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 4 +- 21 files changed, 69 insertions(+), 69 deletions(-) diff --git a/src/code/z_room.c b/src/code/z_room.c index 93f9264204a..20bbb28b84c 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -374,7 +374,7 @@ BgImage* func_80096A74(MeshHeader1Multi* meshHeader1Multi, PlayState* play) { } player = GET_PLAYER(play); - player->actor.params = PARAMS_GET(player->actor.params, 0, 0xFF00) | bgCamIndex; + player->actor.params = PARAMS_GET_NOSHIFT(player->actor.params, 8, 0xFF) | bgCamIndex; bgImage = SEGMENTED_TO_VIRTUAL(meshHeader1Multi->list); for (i = 0; i < meshHeader1Multi->count; i++) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index a11dcc05654..408f2e8a993 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -112,7 +112,7 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, PlayState* play2) { pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; params = (i + 1) & 0xFF; - params |= PARAMS_GET(this->dyna.actor.params, 0, 0xFF00); + params |= PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 0xFF); step = (BgHidanHamstep*)Actor_SpawnAsChild(&play->actorCtx, &step->dyna.actor, play, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, this->dyna.actor.world.rot.x, diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index d4f6ffe20b2..38128aa7a1b 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -62,7 +62,7 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); switchFlagParam = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); - t6 = PARAMS_GET(this->dyna.actor.params, 0, 0x4000); + t6 = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 14, 1); if (t6 != 0) { this->switchFlag = switchFlagParam; diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index 4bd1d6cc6d6..f0ca86518c9 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -86,7 +86,7 @@ void BgSpot08Iceblock_SinkUnderPlayer(BgSpot08Iceblock* this) { f32 target; f32 step; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF0)) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 0xF)) { case 0: step = 0.15f; break; @@ -258,7 +258,7 @@ void BgSpot08Iceblock_SpawnTwinFloe(BgSpot08Iceblock* this, PlayState* play) { sin = Math_SinS(this->dyna.actor.home.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.home.rot.y) * 100.0f; - if (!PARAMS_GET(this->dyna.actor.params, 0, 0x100)) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 1)) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_BG_SPOT08_ICEBLOCK, this->dyna.actor.home.pos.x, this->dyna.actor.home.pos.y, this->dyna.actor.home.pos.z, this->dyna.actor.home.rot.x, this->dyna.actor.home.rot.y, this->dyna.actor.home.rot.z, @@ -287,7 +287,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { osSyncPrintf("(spot08 流氷)(arg_data 0x%04x)\n", this->dyna.actor.params); BgSpot08Iceblock_CheckParams(this); - switch (PARAMS_GET(this->dyna.actor.params, 0, 0x200)) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 9, 1)) { case 0: colHeader = &gZorasFountainIcebergCol; break; @@ -313,7 +313,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF0)) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 0xF)) { case 0: Actor_SetScale(&this->dyna.actor, 0.2f); break; @@ -391,7 +391,7 @@ void BgSpot08Iceblock_FloatOrbitingTwins(BgSpot08Iceblock* this, PlayState* play BgSpot08Iceblock_SetWaterline(this); // parent handles rotations of both - if (!PARAMS_GET(this->dyna.actor.params, 0, 0x100)) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 0, 0x100)) { this->dyna.actor.world.rot.y += 0x190; sin = Math_SinS(this->dyna.actor.world.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.world.rot.y) * 100.0f; @@ -432,7 +432,7 @@ void BgSpot08Iceblock_Draw(Actor* thisx, PlayState* play) { Gfx* dList; BgSpot08Iceblock* this = (BgSpot08Iceblock*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0x200)) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 9, 1)) { case 0: dList = gZorasFountainIcebergDL; break; diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 90c607e0897..9f36299e2b0 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -66,9 +66,9 @@ void DoorAna_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; // init block for grottos that are initially "hidden" (require explosives/hammer/song of storms to open) - if (PARAMS_GET(this->actor.params, 0, 0x300) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 3) != 0) { // only allocate collider for grottos that need bombing/hammering open - if (PARAMS_GET(this->actor.params, 0, 0x200) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 9, 1) != 0) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); } else { @@ -86,7 +86,7 @@ void DoorAna_Destroy(Actor* thisx, PlayState* play) { DoorAna* this = (DoorAna*)thisx; // free collider if it has one - if (PARAMS_GET(this->actor.params, 0, 0x200) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 9, 1) != 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -95,7 +95,7 @@ void DoorAna_Destroy(Actor* thisx, PlayState* play) { void DoorAna_WaitClosed(DoorAna* this, PlayState* play) { u32 openGrotto = false; - if (!PARAMS_GET(this->actor.params, 0, 0x200)) { + if (!PARAMS_GET_NOSHIFT(this->actor.params, 9, 1)) { // opening with song of storms if (this->actor.xyzDistToPlayerSq < SQ(200.0f) && Flags_GetEnv(play, 5)) { openGrotto = true; diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 282c0dda68f..87708b40100 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -165,7 +165,7 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) { gSaveContext.entranceIndex == ENTR_SPOT06_9 || gSaveContext.entranceIndex == ENTR_SPOT11_8 || gSaveContext.entranceIndex == ENTR_SPOT02_8) && gSaveContext.sceneSetupIndex < 4) || - PARAMS_GET(GET_PLAYER(play)->actor.params, 0, 0xF00) != 0x200) { + PARAMS_GET_NOSHIFT(GET_PLAYER(play)->actor.params, 8, 0xF) != 0x200) { Actor_Kill(&this->actor); } if (Actor_WorldDistXZToActor(&player->actor, &this->actor) > 100.0f) { diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index c84f313f4c4..b5ce12e743c 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -94,7 +94,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { thisx->scale.y = thisx->world.rot.z * 0.04f; } - if (PARAMS_GET(thisx->params, 0, 0x4000)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 14, 1)) { ElfMsg_SetupAction(this, ElfMsg_CallNaviCuboid); } else { ElfMsg_SetupAction(this, ElfMsg_CallNaviCylinder); @@ -109,7 +109,7 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi - if (PARAMS_GET(this->actor.params, 0, 0x8000)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { return PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100; } else { return -(PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100); @@ -173,7 +173,7 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) { } Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (PARAMS_GET(thisx->params, 0, 0x8000)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 15, 1)) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 100, 100, R_NAVI_MSG_REGION_ALPHA); } else { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, R_NAVI_MSG_REGION_ALPHA); @@ -183,7 +183,7 @@ void ElfMsg_Draw(Actor* thisx, PlayState* play) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, D_809AD278); - if (PARAMS_GET(thisx->params, 0, 0x4000)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 14, 1)) { gSPDisplayList(POLY_XLU_DISP++, sCubeDL); } else { gSPDisplayList(POLY_XLU_DISP++, sCylinderDL); diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 206a1cd5c4e..6d935bb5a06 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -320,13 +320,13 @@ void EnBb_Init(Actor* thisx, PlayState* play) { this->actionState = PARAMS_GET_NOMASK(thisx->params, 8); - if (PARAMS_GET(thisx->params, 0, 0x80)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { thisx->params |= 0xFF00; } if (thisx->params <= ENBB_BLUE) { ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawCircle, 35.0f); } - if (PARAMS_GET(thisx->params, 0, 0xFF00)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 8, 0xFF)) { this->timer = 0; this->flameScaleY = 80.0f; this->flameScaleX = 100.0f; diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 4eba5836b60..02b82a5dc8f 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -140,7 +140,7 @@ void EnBx_Update(Actor* thisx, PlayState* play) { (&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) { tmp33 = player->invincibilityTimer & 0xFF; tmp32 = thisx->world.rot.y; - if (!PARAMS_GET(thisx->params, 0, 0x80)) { + if (!PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { tmp32 = thisx->yawTowardsPlayer; } if ((&player->actor != this->collider.base.at) && (&player->actor != this->collider.base.ac) && @@ -189,7 +189,7 @@ void EnBx_Update(Actor* thisx, PlayState* play) { Collider_UpdateCylinder(thisx, &this->collider); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); - if (PARAMS_GET(thisx->params, 0, 0x80)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderQuad.base); } } @@ -216,7 +216,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_bx.c", 478), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (PARAMS_GET(this->actor.params, 0, 0x80)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 7, 1)) { func_809D1D0C(&this->actor, play); } diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 53533422d29..3bc50c7bdb2 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -113,7 +113,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { } // Double doors - if (PARAMS_GET(this->actor.params, 0, 0x40)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 6, 1)) { EnDoor* other; xOffset = Math_CosS(this->actor.shape.rot.y) * 30.0f; diff --git a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c index 6047081064f..5aafb7836a7 100644 --- a/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c +++ b/src/overlays/actors/ovl_En_Firefly/z_en_firefly.c @@ -146,7 +146,7 @@ void EnFirefly_Init(Actor* thisx, PlayState* play) { Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - if (PARAMS_GET(this->actor.params, 0, 0x8000) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1) != 0) { this->actor.flags |= ACTOR_FLAG_7; if (1) {} this->actor.draw = EnFirefly_DrawInvisible; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index f8a0d1246cb..7692398cdda 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -228,7 +228,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; thisx->naviEnemyId = NAVI_ENEMY_GERUDO_THIEF; - this->keyFlag = PARAMS_GET(thisx->params, 0, 0xFF00); + this->keyFlag = PARAMS_GET_NOSHIFT(thisx->params, 8, 0xFF); thisx->params &= 0xFF; this->blinkState = 0; this->unkFloat = 10.0f; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 413618adfbc..4d510433c36 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -91,7 +91,7 @@ void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) { u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); - switch (PARAMS_GET(thisx->params, 0, 0xF0)) { + switch (PARAMS_GET_NOSHIFT(thisx->params, 4, 0xF)) { case 0x90: if (gSaveContext.bgsFlag) { return 0x305E; @@ -351,7 +351,7 @@ s32 func_80A3ED24(PlayState* play, EnGo* this, struct_80034A14_arg1* arg2, f32 a void EnGo_ChangeAnim(EnGo* this, s32 index) { Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, - sAnimationInfo[index].playSpeed * (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f), 0.0f, + sAnimationInfo[index].playSpeed * (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f), 0.0f, Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames); } @@ -360,17 +360,17 @@ s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { if (((this->actor.params) & 0xF0) == 0x90) { return true; } else if (play->sceneNum == SCENE_HIDAN && !Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && LINK_IS_ADULT && - PARAMS_GET(this->actor.params, 0, 0xF0) == 0x10) { + PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x10) { return true; - } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && PARAMS_GET(this->actor.params, 0, 0xF0) == 0x00) { + } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x00) { return true; } else if (play->sceneNum == SCENE_SPOT16 && LINK_IS_CHILD && - (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x20 || PARAMS_GET(this->actor.params, 0, 0xF0) == 0x30 || - PARAMS_GET(this->actor.params, 0, 0xF0) == 0x40)) { + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x20 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x30 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x40)) { return true; } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_CHILD && - (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x50 || PARAMS_GET(this->actor.params, 0, 0xF0) == 0x60 || - PARAMS_GET(this->actor.params, 0, 0xF0) == 0x70)) { + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x50 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x60 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x70)) { return true; } else { return false; @@ -378,7 +378,7 @@ s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { } f32 EnGo_GetGoronSize(EnGo* this) { - switch (PARAMS_GET(this->actor.params, 0, 0xF0)) { + switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF)) { case 0x00: return 10.0f; case 0x20: @@ -428,7 +428,7 @@ s32 EnGo_IsCameraModified(EnGo* this, PlayState* play) { } xyzDistSq = (this->actor.scale.x / 0.01f) * 10000.0f; - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); xyzDistSq *= 4.8f; } @@ -486,7 +486,7 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { this->unk_218 = 0; } - if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x00) { return true; } else if (Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8))) { return true; @@ -581,18 +581,18 @@ void func_80A3F908(EnGo* this, PlayState* play) { float1 = (this->collider.dim.radius + 30.0f); float1 *= (this->actor.scale.x / 0.01f); - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { float1 *= 4.8f; } - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { isUnkCondition = func_80A3ED24(play, this, &this->unk_1E0, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } else { isUnkCondition = func_800343CC(play, &this->actor, &this->unk_1E0.unk_00, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } - if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) && (isUnkCondition == true)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) && (isUnkCondition == true)) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_SWORD_BROKEN) { if (func_8002F368(play) == EXCH_ITEM_SWORD_BROKEN) { if (GET_INFTABLE(INFTABLE_B4)) { @@ -635,7 +635,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { return; } - if (PARAMS_GET(this->actor.params, 0, 0xF0) && (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) && (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90)) { this->actor.flags &= ~ACTOR_FLAG_4; this->actor.flags &= ~ACTOR_FLAG_5; } @@ -645,7 +645,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { this->unk_1E0.unk_00 = 0; this->actor.gravity = -1.0f; - switch (PARAMS_GET(this->actor.params, 0, 0xF0)) { + switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF)) { case 0x00: Actor_SetScale(&this->actor, 0.008f); if (CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { @@ -770,10 +770,10 @@ void EnGo_CurledUp(EnGo* this, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->skelAnime.playSpeed = 0.1f; - this->skelAnime.playSpeed *= PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, EnGo_WakeUp); - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); } } @@ -783,7 +783,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -793,7 +793,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90) { this->unk_212 = 30; return; } @@ -814,7 +814,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { void func_80A40494(EnGo* this, PlayState* play) { f32 frame; - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -836,7 +836,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { f32 frame; lastFrame = Animation_GetLastFrame(&gGoronAnim_004930); - Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; @@ -846,7 +846,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { this->skelAnime.curFrame = lastFrame; this->skelAnime.playSpeed = 0.0f; this->unk_212 = Rand_S16Offset(30, 30); - if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { EnGo_SetupAction(this, func_80A40B1C); } else { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); @@ -855,7 +855,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { } void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { - if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) && (this->unk_1E0.unk_00 == 2)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) && (this->unk_1E0.unk_00 == 2)) { if (gSaveContext.bgsFlag) { this->unk_1E0.unk_00 = 0; } else { @@ -874,7 +874,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { EnGo_GetItem(this, play); } } - } else if ((PARAMS_GET(this->actor.params, 0, 0xF0) == 0) && (this->unk_1E0.unk_00 == 2)) { + } else if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0) && (this->unk_1E0.unk_00 == 2)) { EnGo_SetupAction(this, EnGo_GetItem); play->msgCtx.stateTimer = 4; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -882,7 +882,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { if ((DECR(this->unk_212) == 0) && !EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); this->skelAnime.playSpeed = -0.1f; - this->skelAnime.playSpeed *= PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, func_80A408D8); } } @@ -892,7 +892,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90 ? 0.5f : 1.0f) * -1.0f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f) * -1.0f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -901,7 +901,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90) { this->unk_212 = 30; return; } @@ -952,7 +952,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { EnGo_SetupAction(this, func_80A40C78); } else { this->unk_20C = 0; - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { getItemId = GI_SWORD_BGS; this->unk_20C = 1; @@ -965,7 +965,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { } } - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0) { getItemId = GI_TUNIC_GORON; } @@ -978,7 +978,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { void func_80A40C78(EnGo* this, PlayState* play) { if (this->unk_1E0.unk_00 == 3) { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); - if (PARAMS_GET(this->actor.params, 0, 0xF0) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90) { this->unk_1E0.unk_00 = 0; } else if (this->unk_20C) { this->unk_1E0.unk_00 = 0; diff --git a/src/overlays/actors/ovl_En_Horse/z_en_horse.c b/src/overlays/actors/ovl_En_Horse/z_en_horse.c index 9eee19bb1b3..dd0bf60ed93 100644 --- a/src/overlays/actors/ovl_En_Horse/z_en_horse.c +++ b/src/overlays/actors/ovl_En_Horse/z_en_horse.c @@ -760,7 +760,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) { DREG(4) = 70; } - if (PARAMS_GET(this->actor.params, 0, 0x8000)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { this->actor.params &= ~0x8000; this->type = HORSE_HNI; diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index cdde7dfa7aa..71def087619 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -259,7 +259,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { Skin_Init(play, &this->skin, &gHorseNormalSkel, &gHorseNormalIdleAnim); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); } - if (PARAMS_GET(this->actor.params, 0, 0xF0) == 0x10 && PARAMS_GET(this->actor.params, 0, 0xF) != 0xF) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x10 && PARAMS_GET(this->actor.params, 0, 0xF) != 0xF) { func_80A6B91C(this, play); } else { func_80A6BC48(this); diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index dd2ae419f91..464e4524a45 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -1435,7 +1435,7 @@ void func_80A781CC(Actor* thisx, PlayState* play) { void EnIk_Init(Actor* thisx, PlayState* play) { EnIk* this = (EnIk*)thisx; - s32 flag = PARAMS_GET(this->actor.params, 0, 0xFF00); + s32 flag = PARAMS_GET_NOSHIFT(this->actor.params, 8, 0xFF); if ((PARAMS_GET(this->actor.params, 0, 0xFF) == 0 && GET_EVENTCHKINF(EVENTCHKINF_3C)) || (flag != 0 && Flags_GetSwitch(play, flag >> 8))) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index d50067a9cac..98f84c508d7 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -201,7 +201,7 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { this->unk_199 = 32; this->unk_294 = 110.0f; this->actor.flags &= ~ACTOR_FLAG_0; - if (PARAMS_GET(this->actor.params, 0, 0x1000)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 12, 1)) { func_80ADA094(this, play); } else if (this->unk_194 == 0) { if (this->unk_195 == 0) { diff --git a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c index bd34d693be3..6ad7c8a50a5 100644 --- a/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c +++ b/src/overlays/actors/ovl_Obj_Kibako2/z_obj_kibako2.c @@ -159,7 +159,7 @@ void ObjKibako2_Idle(ObjKibako2* this, PlayState* play) { void ObjKibako2_Kill(ObjKibako2* this, PlayState* play) { s16 params = this->dyna.actor.params; - if (PARAMS_GET(params, 0, 0x8000) == 0) { + if (PARAMS_GET_NOSHIFT(params, 15, 1) == 0) { Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SW, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, this->dyna.actor.shape.rot.y, 0, params | 0x8000); } diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 1cae2875aeb..46261f32735 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -30,7 +30,7 @@ const ActorInit Obj_Makekinsuta_InitVars = { void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) { ObjMakekinsuta* this = (ObjMakekinsuta*)thisx; - if (PARAMS_GET(this->actor.params, 0, 0x6000) == 0x4000) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 13, 3) == 0x4000) { osSyncPrintf(VT_FGCOL(BLUE)); // "Gold Star Enemy(arg_data %x)" osSyncPrintf("金スタ発生敵(arg_data %x)\n", this->actor.params); diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 2e356f9d0bb..2057a33b2cc 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -81,7 +81,7 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { static u8 sColTypesStand[] = { 0x09, 0x0B, 0x0B }; s32 pad; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchType = PARAMS_GET(this->actor.params, 0, 0xF000); + s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 0xF); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); @@ -99,7 +99,7 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - if (PARAMS_GET(this->actor.params, 0, 0x400) || ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)))) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)))) { this->litTimer = -1; } @@ -122,7 +122,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { ObjSyokudai* this = (ObjSyokudai*)thisx; s32 torchCount = PARAMS_GET(this->actor.params, 6, 0xF); s32 switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); - s32 torchType = PARAMS_GET(this->actor.params, 0, 0xF000); + s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 0xF); s32 litTimeScale; WaterBox* dummy; f32 waterSurface; @@ -153,7 +153,7 @@ void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { } else { player = GET_PLAYER(play); interactionType = 0; - if (PARAMS_GET(this->actor.params, 0, 0x400)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1)) { this->litTimer = -1; } if (torchCount != 0) { diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index ed7f4606584..37b328b9c20 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -143,8 +143,8 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { this->dyna.actor.child->focus.rot = tempRot; temp = PARAMS_GET(this->dyna.actor.params, 0, 0x7FFF); - this->dyna.actor.params = PARAMS_GET(this->dyna.actor.params, 0, 0x8000) | PARAMS_GET(this->dyna.actor.child->params, 0, 0x7FFF); - this->dyna.actor.child->params = PARAMS_GET(this->dyna.actor.child->params, 0, 0x8000) | (temp & 0x7FFF); + this->dyna.actor.params = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET(this->dyna.actor.child->params, 0, 0x7FFF); + this->dyna.actor.child->params = PARAMS_GET_NOSHIFT(this->dyna.actor.child->params, 15, 1) | (temp & 0x7FFF); if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos) < 0.01f) { Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); From bdd0919f83bea025b2200e92f14d352afd7c549b Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Mon, 11 Jul 2022 20:59:58 +0100 Subject: [PATCH 03/16] Use number of bits rather than raw mask values --- include/z64actor.h | 17 ++- src/code/z_en_a_keep.c | 2 +- src/code/z_en_item00.c | 4 +- src/code/z_play.c | 2 +- src/code/z_room.c | 2 +- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 2 +- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 38 +++--- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.c | 6 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 10 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 8 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 30 ++-- .../ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c | 2 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 18 +-- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 2 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 2 +- .../ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c | 2 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c | 4 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 2 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 2 +- .../actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c | 2 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 20 +-- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 4 +- .../ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c | 2 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 40 +++--- .../ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c | 4 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 22 +-- .../z_bg_hidan_kowarerukabe.c | 24 ++-- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 4 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 18 +-- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c | 4 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 4 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 4 +- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.c | 2 +- .../z_bg_jya_bombchuiwa.c | 2 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 8 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 34 ++--- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 4 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 4 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 4 +- .../z_bg_menkuri_nisekabe.c | 2 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 20 +-- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 10 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h | 8 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 4 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 8 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 8 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 2 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 6 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 4 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 4 +- .../ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c | 2 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 4 +- .../z_bg_spot01_objects2.c | 10 +- .../z_bg_spot02_objects.c | 2 +- .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c | 2 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 2 +- .../z_bg_spot06_objects.c | 4 +- .../z_bg_spot08_bakudankabe.c | 4 +- .../z_bg_spot08_iceblock.c | 14 +- .../z_bg_spot11_bakudankabe.c | 4 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 4 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 4 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- .../z_bg_spot16_bombstone.c | 4 +- .../z_bg_spot17_bakudankabe.c | 4 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 8 +- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 22 +-- .../z_bg_spot18_shutter.c | 4 +- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 4 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c | 4 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 6 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 4 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 8 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 14 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 6 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 6 +- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 6 +- .../actors/ovl_Door_Killer/z_door_killer.c | 14 +- .../actors/ovl_Door_Shutter/z_door_shutter.c | 22 +-- .../actors/ovl_Door_Warp1/z_door_warp1.c | 2 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 22 +-- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 16 +-- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 2 +- src/overlays/actors/ovl_En_Bb/z_en_bb.c | 2 +- src/overlays/actors/ovl_En_Box/z_en_box.c | 22 +-- src/overlays/actors/ovl_En_Brob/z_en_brob.c | 6 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 4 +- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 2 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 40 +++--- .../z_en_daiku_kakariko.c | 20 +-- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 20 +-- src/overlays/actors/ovl_En_Door/z_en_door.c | 14 +- .../actors/ovl_En_Encount1/z_en_encount1.c | 6 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 4 +- src/overlays/actors/ovl_En_Fd/z_en_fd.c | 10 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 20 +-- .../actors/ovl_En_Floormas/z_en_floormas.c | 2 +- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 6 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 8 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 12 +- src/overlays/actors/ovl_En_GeldB/z_en_geldb.c | 2 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 70 +++++----- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 128 +++++++++--------- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 30 ++-- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 6 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 4 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 6 +- .../actors/ovl_En_Heishi4/z_en_heishi4.c | 6 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- src/overlays/actors/ovl_En_Holl/z_en_holl.c | 20 +-- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 4 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 86 ++++++------ src/overlays/actors/ovl_En_Ik/z_en_ik.c | 6 +- .../actors/ovl_En_Insect/z_en_insect.c | 20 +-- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 6 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 4 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 4 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 14 +- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 8 +- src/overlays/actors/ovl_En_Light/z_en_light.c | 16 +-- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 12 +- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 2 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 8 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 2 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 4 +- .../actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 2 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 6 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 2 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 12 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 2 +- .../actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 4 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.h | 2 +- .../ovl_En_River_Sound/z_en_river_sound.c | 4 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 8 +- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 4 +- src/overlays/actors/ovl_En_Si/z_en_si.c | 2 +- .../actors/ovl_En_Siofuki/z_en_siofuki.c | 28 ++-- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 2 +- .../actors/ovl_En_Stream/z_en_stream.c | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 46 +++---- src/overlays/actors/ovl_En_Trap/z_en_trap.c | 2 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 4 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 4 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 2 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 6 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.c | 6 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 6 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 2 +- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 4 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 6 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 6 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 8 +- .../actors/ovl_Item_Inbox/z_item_inbox.c | 4 +- src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c | 6 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 14 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 4 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 6 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 6 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 4 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 4 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 8 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 12 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 4 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 10 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 26 ++-- .../ovl_Obj_Makekinsuta/z_obj_makekinsuta.c | 2 +- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 14 +- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 8 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 20 +-- .../actors/ovl_Obj_Mure3/z_obj_mure3.c | 10 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 26 ++-- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 4 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 72 +++++----- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 16 +-- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 18 +-- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 4 +- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 28 ++-- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 8 +- .../actors/ovl_player_actor/z_player.c | 10 +- 184 files changed, 948 insertions(+), 937 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index 71b42328516..e0854f3721e 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -507,16 +507,27 @@ typedef enum { #define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples #define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check? +#define NBITS_TO_MASK(n) \ + ((1 << (n)) - 1) + #define PARAMS_GET(p, s, m) \ - (((p) >> (s)) & (m)) + (((p) >> (s)) & NBITS_TO_MASK(m)) #define PARAMS_GET2(p, s, m) \ - (((p) & (m)) >> (s)) + (((p) & (NBITS_TO_MASK(m) << (s))) >> (s)) #define PARAMS_GET_NOMASK(p, s) \ ((p) >> (s)) #define PARAMS_GET_NOSHIFT(p, s, m) \ - ((p) & ((m) << (s))) + ((p) & (NBITS_TO_MASK(m) << (s))) + +// Shift (m) bits from (s1) bit position to (s2) bit position +#define PARAMS_GET_PS(p, s1, s2, m) \ + (((p) >> ((s1) - (s2))) & (NBITS_TO_MASK(m) << (s2))) + +// Shift (m) bits from (s1) bit position to (s2) bit position +#define PARAMS_GET2_PS(p, s1, s2, m) \ + (((p) & (NBITS_TO_MASK(m) << (s1))) >> ((s1) - (s2))) #endif diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 66d3db6576c..36ca7ae39d5 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -81,7 +81,7 @@ void EnAObj_Init(Actor* thisx, PlayState* play) { EnAObj* this = (EnAObj*)thisx; f32 shadowScale = 6.0f; - this->textId = PARAMS_GET(thisx->params, 8, 0xFF); + this->textId = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; switch (thisx->params) { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index 3092d11e6b4..91ed04755e2 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -142,10 +142,10 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { f32 yOffset = 980.0f; f32 shadowScale = 6.0f; s32 getItemId = GI_NONE; - s16 spawnParam8000 = PARAMS_GET2(this->actor.params, 0, 0x8000); + s16 spawnParam8000 = PARAMS_GET_NOSHIFT(this->actor.params, 15, 1); s32 pad1; - this->collectibleFlag = PARAMS_GET2(this->actor.params, 8, 0x3F00); + this->collectibleFlag = PARAMS_GET2(this->actor.params, 8, 6); this->actor.params &= 0xFF; diff --git a/src/code/z_play.c b/src/code/z_play.c index 5e9b5e071bb..b5ae18fcc26 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -410,7 +410,7 @@ void Play_Init(GameState* thisx) { Camera_InitPlayerSettings(&this->mainCamera, player); Camera_ChangeMode(&this->mainCamera, CAM_MODE_NORMAL); - playerStartBgCamIndex = PARAMS_GET(player->actor.params, 0, 0xFF); + playerStartBgCamIndex = PARAMS_GET(player->actor.params, 0, 8); if (playerStartBgCamIndex != 0xFF) { osSyncPrintf("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); Camera_ChangeBgCamIndex(&this->mainCamera, playerStartBgCamIndex); diff --git a/src/code/z_room.c b/src/code/z_room.c index 20bbb28b84c..c36c9d05d46 100644 --- a/src/code/z_room.c +++ b/src/code/z_room.c @@ -374,7 +374,7 @@ BgImage* func_80096A74(MeshHeader1Multi* meshHeader1Multi, PlayState* play) { } player = GET_PLAYER(play); - player->actor.params = PARAMS_GET_NOSHIFT(player->actor.params, 8, 0xFF) | bgCamIndex; + player->actor.params = PARAMS_GET_NOSHIFT(player->actor.params, 8, 8) | bgCamIndex; bgImage = SEGMENTED_TO_VIRTUAL(meshHeader1Multi->list); for (i = 0; i < meshHeader1Multi->count; i++) { diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index 054a185acd6..01b205212c6 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -111,7 +111,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0x3F); + this->switchFlag = PARAMS_GET(thisx->params, 8, 6); thisx->params &= 0xFF; if (thisx->params == 2) { thisx->flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index 53de16e9e68..ebd1119d727 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -116,7 +116,7 @@ void func_8086D0EC(BgBdanSwitch* this) { this->unk_1CC += 0xFA0; } - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -139,7 +139,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { s16 type; s32 flag; - type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); + type = PARAMS_GET(this->dyna.actor.params, 0, 8); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { this->dyna.actor.scale.z = 0.05f; @@ -165,7 +165,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { break; } - flag = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + flag = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); switch (type) { case BLUE: @@ -203,7 +203,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -220,9 +220,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { s32 pad; s32 type; - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { - type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + type = PARAMS_GET(this->dyna.actor.params, 0, 8); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); if (type == BLUE || type == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } else { @@ -232,9 +232,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { } void func_8086D548(BgBdanSwitch* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == YELLOW_TALL_2) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -246,7 +246,7 @@ void func_8086D5C4(BgBdanSwitch* this) { } void func_8086D5E0(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case BLUE: if (func_800435B4(&this->dyna)) { func_8086D67C(this); @@ -285,7 +285,7 @@ void func_8086D730(BgBdanSwitch* this) { } void func_8086D754(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case BLUE: if (!func_800435B4(&this->dyna)) { if (this->unk_1D8 <= 0) { @@ -297,7 +297,7 @@ void func_8086D754(BgBdanSwitch* this, PlayState* play) { } break; case YELLOW: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { func_8086D7FC(this); } break; @@ -407,7 +407,7 @@ void func_8086DB4C(BgBdanSwitch* this) { } void func_8086DB68(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { default: return; case YELLOW_TALL_1: @@ -448,9 +448,9 @@ void func_8086DCCC(BgBdanSwitch* this) { } void func_8086DCE8(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case YELLOW_TALL_1: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { func_8086DDA8(this); } break; @@ -470,7 +470,7 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, PlayState* play) { - if (((PARAMS_GET(this->dyna.actor.params, 0, 0xFF) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || + if (((PARAMS_GET(this->dyna.actor.params, 0, 8) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; if (this->unk_1C8 >= 2.0f) { @@ -490,7 +490,7 @@ void BgBdanSwitch_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); func_8086D0EC(this); - type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); + type = PARAMS_GET(this->dyna.actor.params, 0, 8); if (type != 3 && type != 4) { this->unk_1D8--; } else { @@ -516,7 +516,7 @@ void func_8086DF58(BgBdanSwitch* this, PlayState* play, Gfx* dlist) { void BgBdanSwitch_Draw(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case YELLOW_HEAVY: case YELLOW: func_8086DF58(this, play, gJabuYellowFloorSwitchDL); diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index c96e07f7633..24a719416c1 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -122,7 +122,7 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, 0.1f); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_8086EE94(this, play); } else { BgBombwall_InitDynapoly(this, play); @@ -213,7 +213,7 @@ void func_8086ED70(BgBombwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -232,7 +232,7 @@ void func_8086EE40(BgBombwall* this, PlayState* play) { } else { func_8086EE94(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0xF, 1) != 0) { + if (PARAMS_GET(this->dyna.actor.params, 15, 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } } diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 32ebc15cfb8..a57fc8f8bb2 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -79,7 +79,7 @@ void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc void BgBreakwall_Init(Actor* thisx, PlayState* play) { BgBreakwall* this = (BgBreakwall*)thisx; s32 pad; - s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 3); + s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 2); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); @@ -91,7 +91,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { } if (this->bombableWallDList != NULL) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -203,7 +203,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->bankIndex)) { CollisionHeader* colHeader = NULL; - s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 3); + s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 2); this->dyna.actor.objBankIndex = this->bankIndex; Actor_SetObjectDependency(play, &this->dyna.actor); @@ -227,7 +227,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { Vec3f effectPos; - s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 3); + s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 2); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); effectPos.y = effectPos.z = effectPos.x = 0.0f; @@ -240,7 +240,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { } BgBreakwall_SpawnFragments(play, this, &effectPos, 0.0f, 6.4f, 5.0f, 1, 2.0f); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); if (wallType == BWALL_KD_FLOOR) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_EXPLOSION); diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 0239a889f4a..ac927a75cd0 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -118,7 +118,7 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { BgDodoago_SetupAction(this, BgDodoago_DoNothing); this->dyna.actor.shape.rot.x = 0x1333; play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] = play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] = 255; @@ -156,7 +156,7 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { if (((play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] == 255) && (this->state == BGDODOAGO_EYE_RIGHT)) || ((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); this->state = 0; Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -296,9 +296,9 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) { } } else { sTimer++; - Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); if (!sDisableBombCatcher && sTimer > 140) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { // this prevents clearing the actor's parent pointer, effectively disabling the bomb catcher sDisableBombCatcher++; } else { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index aec519a2774..f4931190361 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -52,7 +52,7 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->updateFunc = BgGndDarkmeiro_Noop; Actor_SetScale(&this->dyna.actor, 0.1f); - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case DARKMEIRO_INVISIBLE_PATH: this->dyna.actor.draw = BgGndDarkmeiro_DrawInvisiblePath; this->dyna.actor.flags |= ACTOR_FLAG_7; @@ -60,14 +60,14 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { case DARKMEIRO_CLEAR_BLOCK: CollisionHeader_GetVirtual(&gClearBlockCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (PARAMS_GET(this->dyna.actor.params, 8, 0x3F) == 0x3F) { + if (PARAMS_GET(this->dyna.actor.params, 8, 6) == 0x3F) { this->updateFunc = BgGndDarkmeiro_UpdateStaticBlock; this->dyna.actor.draw = BgGndDarkmeiro_DrawStaticBlock; } else { this->actionFlags = this->timer1 = this->timer2 = 0; thisx->draw = BgGndDarkmeiro_DrawSwitchBlock; this->updateFunc = BgGndDarkmeiro_UpdateSwitchBlock; - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); } else { this->timer1 = 64; @@ -79,18 +79,18 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->actionFlags = this->timer1 = this->timer2 = 0; this->updateFunc = BgGndDarkmeiro_UpdateBlockTimer; thisx->draw = NULL; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 1)) { this->timer1 = 64; this->actionFlags |= 4; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 2)) { this->timer2 = 64; this->actionFlags |= 8; } if ((this->timer1 != 0) || (this->timer2 != 0)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); } break; } @@ -100,7 +100,7 @@ void BgGndDarkmeiro_Destroy(Actor* thisx, PlayState* play2) { PlayState* play = play2; BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx; - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 1) { if (1) {} DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } @@ -112,12 +112,12 @@ void BgGndDarkmeiro_Noop(BgGndDarkmeiro* this, PlayState* play) { void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { s16 timeLeft; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 1)) { if (this->actionFlags & 4) { if (this->timer1 > 0) { this->timer1--; } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 1); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 1); this->actionFlags &= ~4; } } else { @@ -128,12 +128,12 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 2)) { if (this->actionFlags & 8) { if (this->timer2 > 0) { this->timer2--; } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F) + 2); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 2); this->actionFlags &= ~8; } } else { @@ -149,9 +149,9 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { func_8002F994(&this->dyna.actor, timeLeft); } if ((this->timer1 >= 64) || (this->timer2 >= 64)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); } } @@ -163,7 +163,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, PlayState* play) { this->timer1--; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { this->timer1 = 64; } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index 40b6bdc462f..1eb1a3255d6 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -53,7 +53,7 @@ void BgGndNisekabe_Draw(Actor* thisx, PlayState* play) { gGanonsCastleScrubsFakeWallDL, }; BgGndNisekabe* this = (BgGndNisekabe*)thisx; - u32 index = PARAMS_GET(this->actor.params, 0, 0xFF); + u32 index = PARAMS_GET(this->actor.params, 0, 8); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_7)) { Gfx_DrawDListXlu(play, dLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 7f84a155c3f..b2c18386c2a 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -65,12 +65,12 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actionFunc = NULL; - switch (PARAMS_GET(this->actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->actor.params, 0, 8)) { case 0: Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actionFunc = func_8087B284; - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9); @@ -83,7 +83,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { break; case 1: case 2: - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -96,7 +96,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { void BgGndSoulmeiro_Destroy(Actor* thisx, PlayState* play) { BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx; - if (PARAMS_GET(this->actor.params, 0, 0xFF) == 0) { + if (PARAMS_GET(this->actor.params, 0, 8) == 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -112,13 +112,13 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { } if (this->unk_198 == 20) { - Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 6)); thisx->draw = NULL; } // This should be this->unk_198 == 0, this is required to match if (!this->unk_198) { - Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 6)); Actor_Kill(&this->actor); Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0, 0, 0, 9); @@ -159,7 +159,7 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { s32 pad; - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; if (this->collider.base.acFlags & AC_HIT) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -174,7 +174,7 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { } void func_8087B350(BgGndSoulmeiro* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -195,7 +195,7 @@ void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play) { gSpiritTrialLightSourceDL, gSpiritTrialLightFloorDL, }; - s32 params = PARAMS_GET(thisx->params, 0, 0xFF); + s32 params = PARAMS_GET(thisx->params, 0, 8); if (1) {} diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index ef93bb54553..3fdda68ac96 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -74,7 +74,7 @@ void BgHakaGate_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, DPM_UNK); if (thisx->params == BGHAKAGATE_SKULL) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 5dad5b6ad78..d1feeaf235c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -48,7 +48,7 @@ void BgHakaHuta_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); CollisionHeader_GetVirtual(&gBotwCoffinLidCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - this->unk_16A = PARAMS_GET(thisx->params, 8, 0xFF); + this->unk_16A = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (Flags_GetSwitch(play, thisx->params)) { this->counter = -1; diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 4177c8a6d36..bc89c730527 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -59,7 +59,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->unk_168 = PARAMS_GET(thisx->params, 8, 0xFF); + this->unk_168 = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 2) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 414abfee08e..6a47e76d0c8 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -138,8 +138,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->unk_151 = PARAMS_GET(thisx->params, 0, 0xFF); - thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); + this->unk_151 = PARAMS_GET(thisx->params, 0, 8); + thisx->params = PARAMS_GET(thisx->params, 8, 8); if (this->unk_151 != 0) { thisx->flags |= ACTOR_FLAG_7; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index 998e98f6ea3..ecf551e7a62 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -44,7 +44,7 @@ void BgHakaShip_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 1); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 133f900f1da..53047be3c55 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -197,7 +197,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); } else { // Drops a small key and sets a collect flag - collectibleParams = (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) << 8) | ITEM00_SMALL_KEY; + collectibleParams = (PARAMS_GET(this->dyna.actor.params, 0, 6) << 8) | ITEM00_SMALL_KEY; func_80078884(NA_SE_SY_CORRECT_CHIME); } if (collectibleParams != -1) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 57ca7b4353e..6cc0a8b682c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -77,7 +77,7 @@ void BgHakaZou_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == STA_UNKNOWN) { diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index 6f806998be4..700f7dcf54b 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -93,7 +93,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { thisx->params |= 4; } - switch (PARAMS_GET(thisx->params, 0, 0xFF)) { + switch (PARAMS_GET(thisx->params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: thisx->draw = BgHeavyBlock_DrawPiece; this->actionFunc = BgHeavyBlock_MovePiece; @@ -113,7 +113,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { Actor_Kill(thisx); return; } @@ -123,7 +123,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { this->actionFunc = BgHeavyBlock_DoNothing; thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0; thisx->shape.rot.y = thisx->world.rot.y = 0xC000; @@ -150,7 +150,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { void BgHeavyBlock_Destroy(Actor* thisx, PlayState* play) { BgHeavyBlock* this = (BgHeavyBlock*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: break; case HEAVYBLOCK_SMALL_PIECE: @@ -319,7 +319,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { if (Actor_HasParent(&this->dyna.actor, play)) { this->timer = 0; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BREAKABLE: OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, CAM_ID_MAIN); break; @@ -392,10 +392,10 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { if (this->dyna.actor.home.pos.y <= raycastResult) { func_800AA000(0.0f, 0xFF, 0x3C, 4); - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SpawnPieces(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); Actor_Kill(&this->dyna.actor); quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 3); @@ -419,7 +419,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Quake_SetCountdown(quakeIndex, 40); this->actionFunc = BgHeavyBlock_Land; - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); break; case HEAVYBLOCK_UNBREAKABLE: Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); @@ -456,7 +456,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) { this->dyna.actor.world.pos = this->dyna.actor.home.pos; Actor_MoveForward(&this->dyna.actor); this->dyna.actor.home.pos = this->dyna.actor.world.pos; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SpawnDust(play, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f, Rand_CenteredFloat(30.0f) + 552.0f, 0.0f, 0.0f, 0.0f, 0); @@ -510,7 +510,7 @@ void BgHeavyBlock_Draw(Actor* thisx, PlayState* play) { } void BgHeavyBlock_DrawPiece(Actor* thisx, PlayState* play) { - switch (PARAMS_GET(thisx->params, 0, 0xFF)) { + switch (PARAMS_GET(thisx->params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: Matrix_Translate(50.0f, -260.0f, -20.0f, MTXMODE_APPLY); Gfx_DrawDListOpa(play, gHeavyBlockBigPieceDL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index b90a8f2f0e7..4759532166c 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -72,7 +72,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { osSyncPrintf("Curtain (arg_data 0x%04x)\n", this->actor.params); Actor_SetFocus(&this->actor, 20.0f); - this->type = PARAMS_GET(thisx->params, 0xC, 0xF); + this->type = PARAMS_GET(thisx->params, 12, 4); if (this->type > 6) { // "Type is not set" osSyncPrintf("Error : object のタイプが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", @@ -83,7 +83,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { this->size = ((this->type == 2) || (this->type == 4)) ? 1 : 0; hcParams = &sHCParams[this->size]; - this->treasureFlag = PARAMS_GET(thisx->params, 6, 0x3F); + this->treasureFlag = PARAMS_GET(thisx->params, 6, 6); thisx->params &= 0x3F; if ((this->actor.params < 0) || (this->actor.params > 0x3F)) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index c6b6aa0122a..6a29122c6a6 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -106,7 +106,7 @@ void BgHidanDalm_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index 408f2e8a993..e86541cecbc 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -112,7 +112,7 @@ s32 BgHidanHamstep_SpawnChildren(BgHidanHamstep* this, PlayState* play2) { pos.z = (((i * 160.0f) + 60.0f) * cos) + this->dyna.actor.home.pos.z; params = (i + 1) & 0xFF; - params |= PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 0xFF); + params |= PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 8); step = (BgHidanHamstep*)Actor_SpawnAsChild(&play->actorCtx, &step->dyna.actor, play, ACTOR_BG_HIDAN_HAMSTEP, pos.x, pos.y, pos.z, this->dyna.actor.world.rot.x, @@ -137,7 +137,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_PLAYER); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderItems); @@ -151,7 +151,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { } } - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { CollisionHeader_GetVirtual(&gFireTempleStoneStep1Col, &colHeader); } else { CollisionHeader_GetVirtual(&gFireTempleStoneStep2Col, &colHeader); @@ -159,16 +159,16 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0xFF))) { - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 8))) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f); BgHidanHamstep_SetupAction(this, 4); } else { this->dyna.actor.world.pos.y = - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } - } else if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + } else if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { BgHidanHamstep_SetupAction(this, 0); } else { BgHidanHamstep_SetupAction(this, 2); @@ -177,7 +177,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.actor.gravity = -1.2f; this->dyna.actor.minVelocityY = -12.0f; - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { // "Fire Temple Object [Hammer Step] appears" osSyncPrintf("◯◯◯炎の神殿オブジェクト【ハンマーステップ】出現\n"); if (BgHidanHamstep_SpawnChildren(this, play) == 0) { @@ -200,7 +200,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { Collider_DestroyTris(play, &this->collider); } } @@ -231,7 +231,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { - if (PARAMS_GET(child->dyna.actor.params, 0, 0xFF) != 0) { + if (PARAMS_GET(child->dyna.actor.params, 0, 8) != 0) { func_808884C8(child, play); } child = (BgHidanHamstep*)child->dyna.actor.child; @@ -241,7 +241,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { BgHidanHamstep* child; - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) >= 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) >= 2) { if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y; } else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) { @@ -266,7 +266,7 @@ void func_80888734(BgHidanHamstep* this) { if (parent != NULL) { this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y; - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 1) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } else { this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * frameDivisor); @@ -282,7 +282,7 @@ void func_808887C4(BgHidanHamstep* this, PlayState* play) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); this->collider.base.acFlags = AC_NONE; BgHidanHamstep_SetupAction(this, 1); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0xFF)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 8)); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -328,9 +328,9 @@ void func_808889B8(BgHidanHamstep* this, PlayState* play) { func_80888734(this); if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) { - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 1) { this->dyna.actor.world.pos.y = - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } else { BgHidanHamstep_SetupAction(this, 3); @@ -346,20 +346,20 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Actor_MoveForward(&this->dyna.actor); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) <= 0 || PARAMS_GET(this->dyna.actor.params, 0, 0xFF) >= 6) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET(this->dyna.actor.params, 0, 8) >= 6) { // "[Hammer Step] arg_data strange (arg_data = %d)" osSyncPrintf("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); osSyncPrintf("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1]) && + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1]) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { this->dyna.actor.world.pos.y = - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 3); } else { this->dyna.actor.velocity.y *= -0.24f; @@ -376,7 +376,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { func_800AA000(10000.0f, 255, 20, 150); func_808884C8(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 5) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 5) { func_80078884(NA_SE_SY_CORRECT_CHIME); } @@ -403,7 +403,7 @@ void BgHidanHamstep_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_hidan_hamstep.c", 787), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (PARAMS_GET(thisx->params, 0, 0xFF) == 0) { + if (PARAMS_GET(thisx->params, 0, 8) == 0) { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep1DL); } else { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep2DL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index d5127a0df24..18a5ea9a728 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -84,8 +84,8 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { CollisionHeader* collisionHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->unk_16A = PARAMS_GET(thisx->params, 0, 0x3F); - thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); + this->unk_16A = PARAMS_GET(thisx->params, 0, 6); + thisx->params = PARAMS_GET(thisx->params, 8, 8); Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); DynaPolyActor_Init(&this->dyna, DPM_UNK); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 310c756702e..2ebe09ba883 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -69,18 +69,18 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DPM_UNK); Actor_SetFocus(thisx, 50.0f); - osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, PARAMS_GET(thisx->params, 0, 0xFF), - PARAMS_GET((s32)thisx->params, 8, 0xFF)); + osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, PARAMS_GET(thisx->params, 0, 8), + PARAMS_GET((s32)thisx->params, 8, 8)); Actor_ProcessInitChain(thisx, sInitChain); - if (PARAMS_GET(thisx->params, 0, 0xFF) < 0 || PARAMS_GET(thisx->params, 0, 0xFF) >= 3) { + if (PARAMS_GET(thisx->params, 0, 8) < 0 || PARAMS_GET(thisx->params, 0, 8) >= 3) { osSyncPrintf("arg_data おかしい 【格子】\n"); } - CollisionHeader_GetVirtual(sMetalFencesCollisions[PARAMS_GET(thisx->params, 0, 0xFF)], &colHeader); + CollisionHeader_GetVirtual(sMetalFencesCollisions[PARAMS_GET(thisx->params, 0, 8)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - thisx->world.rot.y = D_80889E7C[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] + thisx->shape.rot.y; - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0xFF))) { + thisx->world.rot.y = D_80889E7C[PARAMS_GET(this->dyna.actor.params, 0, 8)] + thisx->shape.rot.y; + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 8))) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); } else { @@ -96,15 +96,15 @@ void BgHidanKousi_Destroy(Actor* thisx, PlayState* play) { void func_80889ACC(BgHidanKousi* this) { s32 pad[2]; Vec3s* rot = &this->dyna.actor.world.rot; - f32 temp1 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] * Math_SinS(rot->y); - f32 temp2 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] * Math_CosS(rot->y); + f32 temp1 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 8)] * Math_SinS(rot->y); + f32 temp2 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 8)] * Math_CosS(rot->y); this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + temp1; this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + temp2; } void func_80889B5C(BgHidanKousi* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0xFF))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 8))) { BgHidanKousi_SetupAction(this, func_80889BC0); OnePointCutscene_Attention(play, &this->dyna.actor); this->unk_168 = 0xC8; @@ -130,7 +130,7 @@ void func_80889C18(BgHidanKousi* this, PlayState* play) { void func_80889C90(BgHidanKousi* this, PlayState* play) { func_8002D7EC(&this->dyna.actor); - if (D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] < + if (D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 8)] < Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); @@ -156,7 +156,7 @@ void BgHidanKousi_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 354), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[PARAMS_GET(thisx->params, 0, 0xFF)]); + gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[PARAMS_GET(thisx->params, 0, 8)]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 359); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 2e1722fff79..36c51bd9ddc 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -77,9 +77,9 @@ void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, PlayState* play CollisionHeader* colHeader = NULL; s32 pad2; - if (collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] != NULL) { + if (collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 8)] != NULL) { DynaPolyActor_Init(&this->dyna, DPM_UNK); - CollisionHeader_GetVirtual(collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)], &colHeader); + CollisionHeader_GetVirtual(collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 8)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); } else { this->dyna.bgId = BGACTOR_NEG_ONE; @@ -94,14 +94,14 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)]; - this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)]; + this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET(this->dyna.actor.params, 0, 8)]; + this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET(this->dyna.actor.params, 0, 8)]; } void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; - this->dyna.actor.world.pos.y = actorYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)] + this->dyna.actor.home.pos.y; + this->dyna.actor.world.pos.y = actorYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8)] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { @@ -115,8 +115,8 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { BgHidanKowarerukabe_InitDynaPoly(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) < CRACKED_STONE_FLOOR || - PARAMS_GET(this->dyna.actor.params, 0, 0xFF) > LARGE_BOMBABLE_WALL) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) < CRACKED_STONE_FLOOR || + PARAMS_GET(this->dyna.actor.params, 0, 8) > LARGE_BOMBABLE_WALL) { // "Error: Fire Temple Breakable Walls. arg_data I can't determine the (%s %d)(arg_data 0x%04x)" osSyncPrintf("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_kowarerukabe.c", 254, this->dyna.actor.params); @@ -124,7 +124,7 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { return; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -283,7 +283,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, PlayState* pl } void BgHidanKowarerukabe_Break(BgHidanKowarerukabe* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case CRACKED_STONE_FLOOR: BgHidanKowarerukabe_FloorBreak(this, play); break; @@ -304,9 +304,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) { if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) { BgHidanKowarerukabe_Break(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); - if (PARAMS_GET(this->dyna.actor.params, 0, 0xFF) == 0) { + if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); @@ -329,7 +329,7 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 568), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[PARAMS_GET(this->dyna.actor.params, 0, 0xFF)]); + gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[PARAMS_GET(this->dyna.actor.params, 0, 8)]); Collider_UpdateSpheres(0, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 06cc2b4c451..f94ab159ed7 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -74,10 +74,10 @@ void BgHidanRock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - this->type = PARAMS_GET(thisx->params, 0, 0xFF); + this->type = PARAMS_GET(thisx->params, 0, 8); this->unk_169 = 0; - thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); + thisx->params = PARAMS_GET(thisx->params, 8, 8); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index 00def1871aa..42247b0053a 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -75,7 +75,7 @@ void func_80890740(BgIceShelter* this, PlayState* play) { static s16 cylinderRadii[] = { 47, 33, 44, 41, 100 }; static s16 cylinderHeights[] = { 80, 54, 90, 60, 200 }; s32 pad; - s32 type = PARAMS_GET(this->dyna.actor.params, 8, 7); + s32 type = PARAMS_GET(this->dyna.actor.params, 8, 3); Collider_InitCylinder(play, &this->cylinder1); Collider_SetCylinder(play, &this->cylinder1, &this->dyna.actor, &D_8089170C); @@ -132,7 +132,7 @@ static InitChainEntry sInitChain[] = { void BgIceShelter_Init(Actor* thisx, PlayState* play) { static Vec3f kzIceScale = { 0.18f, 0.27f, 0.24f }; BgIceShelter* this = (BgIceShelter*)thisx; - s16 type = PARAMS_GET(this->dyna.actor.params, 8, 7); + s16 type = PARAMS_GET(this->dyna.actor.params, 8, 3); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -162,7 +162,7 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; - if (!PARAMS_GET(this->dyna.actor.params, 6, 1) && (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)))) { + if (!PARAMS_GET(this->dyna.actor.params, 6, 1) && (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)))) { Actor_Kill(&this->dyna.actor); return; } @@ -175,7 +175,7 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { void BgIceShelter_Destroy(Actor* thisx, PlayState* play) { BgIceShelter* this = (BgIceShelter*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 8, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 8, 3)) { case 2: case 3: DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); @@ -284,7 +284,7 @@ void func_80891064(BgIceShelter* this) { void func_8089107C(BgIceShelter* this, PlayState* play) { s32 pad; - s16 type = PARAMS_GET(this->dyna.actor.params, 8, 7); + s16 type = PARAMS_GET(this->dyna.actor.params, 8, 3); if (type == 4) { if (this->dyna.actor.parent != NULL) { @@ -334,7 +334,7 @@ static void (*sEffSpawnFuncs[])(BgIceShelter* this, PlayState* play, f32 chance, void func_808911D4(BgIceShelter* this, PlayState* play) { s32 pad; - s32 type = PARAMS_GET(this->dyna.actor.params, 8, 7); + s32 type = PARAMS_GET(this->dyna.actor.params, 8, 3); f32 phi_f0; this->alpha -= 5; @@ -366,7 +366,7 @@ void func_808911D4(BgIceShelter* this, PlayState* play) { if (this->alpha <= 0) { if (!PARAMS_GET(this->dyna.actor.params, 6, 1)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } if (type == 4) { @@ -394,7 +394,7 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_bg_ice_shelter.c", 751), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - switch (PARAMS_GET(this->dyna.actor.params, 8, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 8, 3)) { case 0: case 1: case 2: @@ -405,7 +405,7 @@ void BgIceShelter_Draw(Actor* thisx, PlayState* play2) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 0, 0, this->alpha); - switch (PARAMS_GET(this->dyna.actor.params, 8, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 8, 3)) { case 0: case 1: case 4: diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 293f7b74461..222b97bd760 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -54,8 +54,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_UNK); - sp28 = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); - this->dyna.actor.params = PARAMS_GET(this->dyna.actor.params, 8, 0xFF); + sp28 = PARAMS_GET(this->dyna.actor.params, 0, 8); + this->dyna.actor.params = PARAMS_GET(this->dyna.actor.params, 8, 8); CollisionHeader_GetVirtual(&object_ice_objects_Col_002854, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (sp28 == 2) { diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index bf448220313..16a08bd4b1f 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -72,7 +72,7 @@ void func_80892890(BgInGate* this, PlayState* play) { if (play->csCtx.frames >= 50) { phi0 = 0x4000; - if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 0) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 1, 1)) { phi0 = -0x4000; } this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi0; @@ -86,7 +86,7 @@ void func_80892890(BgInGate* this, PlayState* play) { } csFrames = (Math_SinS(csFrames) * 16384.0f); phi1 = csFrames; - if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 0) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 1, 1)) { phi1 = -phi1; } this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y + phi1; diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index a17aeebf118..7e750a2d1e3 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -102,7 +102,7 @@ void BgJya1flift_Init(Actor* thisx, PlayState* play) { BgJya1flift_InitDynapoly(this, play, &g1fliftCol, 0); Actor_ProcessInitChain(thisx, sInitChain); BgJya1flift_InitCollision(thisx, play); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : BgJya1flift_SetupDoNothing(this); } else { BgJya1flift_SetupWaitForSwitch(this); @@ -128,7 +128,7 @@ void BgJya1flift_SetupWaitForSwitch(BgJya1flift* this) { } void BgJya1flift_WaitForSwitch(BgJya1flift* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { BgJya1flift_ChangeDirection(this); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index 6600934b75e..76f306ec311 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -43,7 +43,7 @@ void BgJyaBlock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { + if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index 26416000d19..a412c16cbb3 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -78,7 +78,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); BgJyaBombchuiwa_SetupCollider(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { BgJyaBombchuiwa_SpawnLightRay(this, play); } else { BgJyaBombchuiwa_SetupWaitForExplosion(this, play); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 9dec1cff355..e208f8c7bd0 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -88,17 +88,17 @@ void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) { BgJyaBombiwa* this = (BgJyaBombiwa*)thisx; - if (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) != 0x29) { + if (PARAMS_GET(this->dyna.actor.params, 0, 6) != 0x29) { osSyncPrintf(VT_COL(YELLOW, BLACK)); // "Warning: Switch Number changed (%s %d)(SW %d)" osSyncPrintf("Warning : Switch Number が変更された(%s %d)(SW %d)\n", "../z_bg_jya_bombiwa.c", 218, - PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + PARAMS_GET(this->dyna.actor.params, 0, 6)); osSyncPrintf(VT_RST); } BgJyaBombiwa_SetupDynaPoly(this, play, &gBombiwaCol, DPM_UNK); BgJyaBombiwa_InitCollider(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -164,7 +164,7 @@ void BgJyaBombiwa_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 26cc34ca5ba..560726e917a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -146,7 +146,7 @@ void func_80895A70(BgJyaCobra* this) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; MirRay* mirRay; - switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 2)) { case 0: mirRay = (MirRay*)this->dyna.actor.child; if (mirRay == NULL) { @@ -179,7 +179,7 @@ void func_80895A70(BgJyaCobra* this) { mirRay->unLit = 0; Math_Vec3f_Copy(&mirRay->sourcePt, &this->unk_180); Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.shape.rot.y), MTXMODE_NEW); - Matrix_RotateX(BINANG_TO_RAD(D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 3)]), MTXMODE_APPLY); + Matrix_RotateX(BINANG_TO_RAD(D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 2)]), MTXMODE_APPLY); sp28.x = 0.0f; sp28.y = 0.0; sp28.z = this->unk_190 * 2800.0f; @@ -205,14 +205,14 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; f32 phi_f0; - if (PARAMS_GET(params, 0, 3) == 2 && mirror != NULL && + if (PARAMS_GET(params, 0, 2) == 2 && mirror != NULL && (!(mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) || !(mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) { Math_StepToF(&this->unk_18C, 0.0f, 0.05f); } else { this->unk_18C = 1.0f; - if (D_80897310[PARAMS_GET(params, 0, 3)]) { - phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[PARAMS_GET(params, 0, 3)]; + if (D_80897310[PARAMS_GET(params, 0, 2)]) { + phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[PARAMS_GET(params, 0, 2)]; phi_v0 = ABS(phi_v0); if (phi_v0 < 0x2000 && phi_v0 != -0x8000) { this->unk_18C += (phi_v0 - 0x2000) * (3.0f / 0x4000); @@ -227,9 +227,9 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f; this->unk_180.z = this->dyna.actor.world.pos.z; - if (PARAMS_GET(params, 0, 3) == 0) { + if (PARAMS_GET(params, 0, 2) == 0) { this->unk_190 = 0.1f; - } else if (PARAMS_GET(params, 0, 3) == 1) { + } else if (PARAMS_GET(params, 0, 2) == 1) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -242,7 +242,7 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { } } Math_StepToF(&this->unk_190, phi_f0, 0.04f); - } else if (PARAMS_GET(params, 0, 3) == 2) { + } else if (PARAMS_GET(params, 0, 2) == 2) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -279,7 +279,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { Lib_MemSet(shadowTex, COBRA_SHADOW_TEX_SIZE, 0); Matrix_RotateX((M_PI / 4), MTXMODE_NEW); - rotY = !PARAMS_GET(this->dyna.actor.params, 0, 3) ? (this->dyna.actor.shape.rot.y + 0x4000) + rotY = !PARAMS_GET(this->dyna.actor.params, 0, 2) ? (this->dyna.actor.shape.rot.y + 0x4000) : (this->dyna.actor.shape.rot.y - 0x4000); Matrix_RotateY(BINANG_TO_RAD(rotY), MTXMODE_APPLY); Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); @@ -399,21 +399,21 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) { BgJyaCobra_InitDynapoly(this, play, &gCobraCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (!PARAMS_GET(this->dyna.actor.params, 0, 3) && Flags_GetSwitch(play, PARAMS_GET((s32)this->dyna.actor.params, 8, 0x3F))) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 2) && Flags_GetSwitch(play, PARAMS_GET((s32)this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0; } - if (!PARAMS_GET(this->dyna.actor.params, 0, 3)) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 2)) { BgJyaCobra_SpawnRay(this, play); } func_80896918(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 1 || PARAMS_GET(this->dyna.actor.params, 0, 3) == 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 1 || PARAMS_GET(this->dyna.actor.params, 0, 2) == 2) { this->dyna.actor.room = -1; } - if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 1) { + if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 1) { BgJyaCobra_UpdateShadowFromTop(this); } @@ -519,7 +519,7 @@ void BgJyaCobra_Update(Actor* thisx, PlayState* play2) { func_80895C74(this, play); func_80895A70(this); - if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 0 || PARAMS_GET(this->dyna.actor.params, 0, 3) == 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 0 || PARAMS_GET(this->dyna.actor.params, 0, 2) == 2) { BgJyaCobra_UpdateShadowFromSide(this); } } @@ -542,7 +542,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 924); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - sp44.x = D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 3)] + this->dyna.actor.shape.rot.x; + sp44.x = D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 2)] + this->dyna.actor.shape.rot.x; sp44.y = this->dyna.actor.shape.rot.y; sp44.z = this->dyna.actor.shape.rot.z; Matrix_SetTranslateRotateYXZ(this->unk_180.x, this->unk_180.y, this->unk_180.z, &sp44); @@ -558,7 +558,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) { s32 pad; - s16 params = PARAMS_GET(this->dyna.actor.params, 0, 3); + s16 params = PARAMS_GET(this->dyna.actor.params, 0, 2); Vec3f sp64; Vec3s* phi_a3; @@ -609,7 +609,7 @@ void BgJyaCobra_Draw(Actor* thisx, PlayState* play) { func_80896D78(this, play); } - if (PARAMS_GET(this->dyna.actor.params, 0, 3) == 2) { + if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 2) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; if (mirror != NULL && (mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) && diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index fc20d0d23b7..cc029bfca49 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -58,7 +58,7 @@ void BgJyaKanaami_Init(Actor* thisx, PlayState* play) { BgJyaKanaami_InitDynaPoly(this, play, &gKanaamiCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_80899A08(this); } else { func_80899880(this); @@ -78,7 +78,7 @@ void func_80899880(BgJyaKanaami* this) { } void func_80899894(BgJyaKanaami* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) || this->unk_16A > 0) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) || this->unk_16A > 0) { if (this->dyna.actor.world.pos.x > -1000.0f && this->unk_16A == 0) { OnePointCutscene_Init(play, 3450, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index 9e143aebc75..e40d37e9146 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -63,7 +63,7 @@ void BgJyaLift_Init(Actor* thisx, PlayState* play) { osSyncPrintf("女神リフト CT\n"); BgJyaLift_InitDynapoly(this, play, &gLiftCol, DPM_UNK); Actor_ProcessInitChain(thisx, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { BgJyaLift_SetFinalPosY(this); } else { BgJyaLift_SetInitPosY(this); @@ -92,7 +92,7 @@ void BgJyaLift_SetInitPosY(BgJyaLift* this) { } void BgJyaLift_DelayMove(BgJyaLift* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) || (this->moveDelay > 0)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) || (this->moveDelay > 0)) { this->moveDelay++; if (this->moveDelay >= 20) { OnePointCutscene_Init(play, 3430, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 7d285524502..3a6271bcf28 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -161,7 +161,7 @@ void BgJyaMegami_Init(Actor* thisx, PlayState* play) { BgJyaMegami_InitDynaPoly(this, play, &GMegamiCol, DPM_UNK); BgJyaMegami_InitCollider(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -195,7 +195,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) { this->lightTimer--; } if (this->lightTimer > 40) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); BgJyaMegami_SetupExplode(this); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); OnePointCutscene_Init(play, 3440, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index 99449ac9e63..94e9dfae22f 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -49,7 +49,7 @@ void BgMenkuriNisekabe_Update(Actor* thisx, PlayState* play) { void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play) { BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx; - u32 index = PARAMS_GET(this->actor.params, 0, 0xFF); + u32 index = PARAMS_GET(this->actor.params, 0, 8); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_7)) { Gfx_DrawDListXlu(play, sDLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 8b00c72a9ca..fb67f54b36e 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -176,14 +176,14 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->yRot = this->dyna.actor.world.pos.y; - this->dList = sDLists[PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)]; + this->dList = sDLists[PARAMS_GET((u16)this->dyna.actor.params, 0, 4)]; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - CollisionHeader_GetVirtual(sColHeaders[PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)], &colHeader); + CollisionHeader_GetVirtual(sColHeaders[PARAMS_GET((u16)this->dyna.actor.params, 0, 4)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 4)) { case MIZUBWALL_FLOOR: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -218,7 +218,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_RUTO_ROOM: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -253,7 +253,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_UNUSED: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -290,7 +290,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_STINGER_ROOM_1: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -328,7 +328,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_STINGER_ROOM_2: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -425,7 +425,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, PlayState* play) { Vec3f debrisOffsets[15]; for (i = 0; i < ARRAY_COUNT(debrisOffsets); i++) { - switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 4)) { case MIZUBWALL_FLOOR: debrisOffsets[i].x = (Rand_ZeroOne() * 80.0f) - 40.0f; debrisOffsets[i].y = Rand_ZeroOne() * 0; @@ -465,7 +465,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) { BgMizuBwall_SetAlpha(this, play); if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Flags_SetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6)); this->breakTimer = 1; DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index 339c17e6fe4..ec9a6859663 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -10,11 +10,11 @@ #define FLAGS ACTOR_FLAG_4 -#define MOVEBG_TYPE(params) PARAMS_GET((u16)(params), 0xC, 0xF) -#define MOVEBG_FLAGS(params) PARAMS_GET((u16)(params), 0, 0x3F) -#define MOVEBG_PATH_ID(params) PARAMS_GET((u16)(params), 8, 0xF) -#define MOVEBG_POINT_ID(params) PARAMS_GET((u16)(params), 0, 0xF) -#define MOVEBG_SPEED(params) PARAMS_GET((u16)(params), 4, 0xF) +#define MOVEBG_TYPE(params) PARAMS_GET((u16)(params), 12, 4) +#define MOVEBG_FLAGS(params) PARAMS_GET((u16)(params), 0, 6) +#define MOVEBG_PATH_ID(params) PARAMS_GET((u16)(params), 8, 4) +#define MOVEBG_POINT_ID(params) PARAMS_GET((u16)(params), 0, 4) +#define MOVEBG_SPEED(params) PARAMS_GET((u16)(params), 4, 4) void BgMizuMovebg_Init(Actor* thisx, PlayState* play); void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index ba20efa9597..e8ca6e48c6d 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -4,10 +4,10 @@ #include "ultra64.h" #include "global.h" -#define BGMIZUSHUTTER_SIZE_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0xC, 0xF) -#define BGMIZUSHUTTER_TIMER_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0x6, 0x3F) -#define BGMIZUSHUTTER_SWITCH_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0x0, 0x3F) -#define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 0xC) | ((timer) << 0x6) | (switchFlag)) +#define BGMIZUSHUTTER_SIZE_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 12, 4) +#define BGMIZUSHUTTER_TIMER_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 6, 6) +#define BGMIZUSHUTTER_SWITCH_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0, 6) +#define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 12) | ((timer) << 6) | (switchFlag)) struct BgMizuShutter; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 7d150d831bf..61c503d8b4e 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -95,8 +95,8 @@ void BgMizuWater_Init(Actor* thisx, PlayState* play) { s32 waterLevelActionIndex; waterBoxes = play->colCtx.colHeader->waterBoxes; - this->type = PARAMS_GET(this->actor.params, 0, 0xFF); - this->switchFlag = PARAMS_GET(this->actor.params, 8, 0xFF); + this->type = PARAMS_GET(this->actor.params, 0, 8); + this->switchFlag = PARAMS_GET(this->actor.params, 8, 8); Actor_ProcessInitChain(&this->actor, sInitChain); initialActorY = this->actor.world.pos.y; this->baseY = initialActorY; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 3758860af12..bf6174e7802 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -71,7 +71,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { // "mori (bigST.keyceiling)" osSyncPrintf("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, - Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)), + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)), Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room), GET_PLAYER(play)->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, DPM_UNK); @@ -84,7 +84,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f; @@ -110,7 +110,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) { thisx->draw = BgMoriBigst_Draw; if (Flags_GetClear(play, thisx->room) && (GET_PLAYER(play)->actor.world.pos.y > 700.0f)) { - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { BgMoriBigst_SetupDone(this, play); } else { BgMoriBigst_SetupStalfosFight(this, play); @@ -214,7 +214,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play) { if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(play)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); BgMoriBigst_SetupDone(this, play); } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index c267bb64121..4321a41c005 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -135,7 +135,7 @@ void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) { void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjIndex)) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { if (play->roomCtx.curRoom.num == 2) { this->dyna.actor.world.pos.y = 73.0f; BgMoriElevator_SetupSetPosition(this); @@ -210,11 +210,11 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) { } else if ((play->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) { this->targetY = -779.0f; BgMoriElevator_StopMovement(this); - } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) && + } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) && (this->unk_16C == 0)) { this->targetY = 73.0f; func_808A1C30(this); - } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) && + } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) && (this->unk_16C != 0)) { this->targetY = 233.0f; func_808A1CF4(this, play); @@ -245,7 +245,7 @@ void BgMoriElevator_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); this->unk_170 = this->dyna.interactFlags; - this->unk_16C = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F)); + this->unk_16C = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6)); } void BgMoriElevator_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index bf8c40cffce..087d4a7b971 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -69,7 +69,7 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { s32 pad; BgMoriHashira4* this = (BgMoriHashira4*)thisx; - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 0x3F); + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 6); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 38128aa7a1b..bec65778d88 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -61,16 +61,16 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - switchFlagParam = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); + switchFlagParam = PARAMS_GET(this->dyna.actor.params, 0, 6); t6 = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 14, 1); if (t6 != 0) { this->switchFlag = switchFlagParam; } else { - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 0x3F); + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 6); this->switchFlag = (Flags_GetSwitch(play, this->switchFlag)) ? 1 : 0; } - this->dyna.actor.params = PARAMS_GET2(this->dyna.actor.params, 0xE, 0x8000); + this->dyna.actor.params = PARAMS_GET2_PS(this->dyna.actor.params, 15, 1, 1); if (Flags_GetSwitch(play, switchFlagParam)) { if (this->dyna.actor.params == 0) { this->dyna.actor.params = 1; diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index e53f23f39b9..08053a9b33c 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -58,7 +58,7 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) { this->actor.scale.z = 1.0f; this->actor.world.pos.x = 119.0f; this->actor.world.pos.z = -1820.0f; - this->prevSwitchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); + this->prevSwitchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); if (this->prevSwitchFlagSet != 0) { this->actor.world.pos.y = -282.0f; BgMoriIdomizu_SetWaterLevel(play, -282); @@ -112,7 +112,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play) { s32 switchFlagSet; roomNum = play->roomCtx.curRoom.num; - switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F)); + switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6)); if (switchFlagSet) { this->targetWaterLevel = -282.0f; } else { diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index eabf0e48ebe..82182d90414 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -196,8 +196,8 @@ void BgPoEvent_Init(Actor* thisx, PlayState* play) { BgPoEvent* this = (BgPoEvent*)thisx; Actor_ProcessInitChain(thisx, sInitChain); - this->type = PARAMS_GET(thisx->params, 8, 0xF); - this->index = PARAMS_GET(thisx->params, 0xC, 0xF); + this->type = PARAMS_GET(thisx->params, 8, 4); + this->index = PARAMS_GET(thisx->params, 12, 4); thisx->params &= 0x3F; if (this->type >= 2) { diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index be186f9dbd3..182fc58202f 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -80,7 +80,7 @@ void BgPoSyokudai_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->flameColor = PARAMS_GET(thisx->params, 8, 0xFF); + this->flameColor = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0x3F; thisx->colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index c13d419af61..4e2d3e7226d 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -50,8 +50,8 @@ void BgRelayObjects_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 0, 0x3F); - thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 0, 6); + thisx->params = PARAMS_GET(thisx->params, 8, 8); DynaPolyActor_Init(&this->dyna, 3); if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&gWindmillRotatingPlatformCol, &colHeader); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index b7297ce8b3f..7f46422eccf 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -45,7 +45,7 @@ static Gfx* D_808AC510[] = { void BgSpot01Objects2_Init(Actor* thisx, PlayState* play) { BgSpot01Objects2* this = (BgSpot01Objects2*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { case 0: case 1: case 2: @@ -99,7 +99,7 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { this->dyna.actor.objBankIndex = this->objBankIndex; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); - switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { case 4: // Shooting gallery CollisionHeader_GetVirtual(&gKakarikoShootingGalleryCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); @@ -108,10 +108,10 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { CollisionHeader_GetVirtual(&object_spot01_matoyab_col, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); if (IS_DAY) { - func_808AC22C(play->setupPathList, &position, PARAMS_GET((s32)thisx->params, 8, 0xFF), 0); + func_808AC22C(play->setupPathList, &position, PARAMS_GET((s32)thisx->params, 8, 8), 0); Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_EN_DAIKU_KAKARIKO, position.x, position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z, - (PARAMS_GET((s32)thisx->params, 8, 0xFF) << 8) + 1); + (PARAMS_GET((s32)thisx->params, 8, 8) << 8) + 1); } break; case 0: // Potion Shop Poster @@ -135,5 +135,5 @@ void BgSpot01Objects2_Update(Actor* thisx, PlayState* play) { } void func_808AC4A4(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_808AC510[PARAMS_GET(thisx->params, 0, 7)]); + Gfx_DrawDListOpa(play, D_808AC510[PARAMS_GET(thisx->params, 0, 3)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 271717f9aad..c0ae1baecc5 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -54,7 +54,7 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); this->unk_16B = (u16)PARAMS_GET_NOMASK(thisx->params, 8); - thisx->params = (u16)PARAMS_GET(thisx->params, 0, 0xFF); + thisx->params = (u16)PARAMS_GET(thisx->params, 0, 8); switch (thisx->params) { case 0: diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index a3f80010d6d..c9d7606d178 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -47,7 +47,7 @@ void BgSpot03Taki_Init(Actor* thisx, PlayState* play) { s16 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); DynaPolyActor_Init(&this->dyna, DPM_UNK); CollisionHeader_GetVirtual(&object_spot03_object_Col_000C98, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 5d0624342ae..bb3f37913d6 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -45,7 +45,7 @@ void BgSpot05Soko_Init(Actor* thisx, PlayState* play) { s32 pad2; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, DPM_UNK); if (thisx->params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 2cb20128f19..df80dfea4a4 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -96,8 +96,8 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { s32 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = PARAMS_GET(thisx->params, 0, 0xFF); - thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 0, 8); + thisx->params = PARAMS_GET(thisx->params, 8, 8); osSyncPrintf("spot06 obj nthisx->arg_data=[%d]", thisx->params); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index 9f903708d9d..49c9fc03044 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -162,7 +162,7 @@ void BgSpot08Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -184,7 +184,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index f0ca86518c9..550d28054d0 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -55,7 +55,7 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll // Sets params to 0x10 (medium, nonrotating) if not in the cases listed. void BgSpot08Iceblock_CheckParams(BgSpot08Iceblock* this) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case 0xFF: this->dyna.actor.params = 0x10; break; @@ -86,7 +86,7 @@ void BgSpot08Iceblock_SinkUnderPlayer(BgSpot08Iceblock* this) { f32 target; f32 step; - switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 0xF)) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 4)) { case 0: step = 0.15f; break; @@ -173,7 +173,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { case 0x11: // Medium nonrotating rollDataIndex = 0; break; @@ -296,7 +296,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { break; } - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case 2: case 3: BgSpot08Iceblock_InitDynaPoly(this, play, colHeader, DPM_UNK3); @@ -313,7 +313,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 0xF)) { + switch (PARAMS_GET_NOSHIFT(this->dyna.actor.params, 4, 4)) { case 0: Actor_SetScale(&this->dyna.actor, 0.2f); break; @@ -330,7 +330,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { this->surfaceNormal.y = 1.0f; this->rotationAxis.x = 1.0f; - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case 0: case 1: BgSpot08Iceblock_SetupFloatNonrotating(this); @@ -391,7 +391,7 @@ void BgSpot08Iceblock_FloatOrbitingTwins(BgSpot08Iceblock* this, PlayState* play BgSpot08Iceblock_SetWaterline(this); // parent handles rotations of both - if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 0, 0x100)) { + if (!PARAMS_GET_NOSHIFT(this->dyna.actor.params, 8, 1)) { this->dyna.actor.world.rot.y += 0x190; sin = Math_SinS(this->dyna.actor.world.rot.y) * 100.0f; cos = Math_CosS(this->dyna.actor.world.rot.y) * 100.0f; diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index b01ce840037..33a96ad7810 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -113,7 +113,7 @@ void BgSpot11Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -136,7 +136,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); SoundSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index c56f3b36f1b..0348e10b9a0 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -62,7 +62,7 @@ void BgSpot12Gate_Init(Actor* thisx, PlayState* play) { BgSpot12Gate_InitDynaPoly(this, play, &gGerudoFortressWastelandGateCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_808B3274(this); } else { func_808B30C0(this); @@ -81,7 +81,7 @@ void func_808B30C0(BgSpot12Gate* this) { } void func_808B30D8(BgSpot12Gate* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_808B3134(this); OnePointCutscene_Init(play, 4160, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index a39952d4d38..2039efe3acc 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -59,7 +59,7 @@ void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { func_808B3420(this, play, &gGerudoFortressGTGShutterCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_808B3714(this); } else { func_808B3550(this); @@ -80,7 +80,7 @@ void func_808B3550(BgSpot12Saku* this) { } void func_808B357C(BgSpot12Saku* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_808B35E4(this); this->timer = 20; OnePointCutscene_Init(play, 4170, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index de2d6a698e1..3c92f354a7f 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -123,7 +123,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, PlayState* play) { func_808B3960(this, play, &gLonLonMilkCrateCol, DPM_UNK); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); func_808B3A34(this); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { func_808B44B8(this, play); this->dyna.actor.world.pos = D_808B45C4[D_808B4590]; D_808B4590++; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index d64ead71bc3..e1e5e1232b4 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -144,8 +144,8 @@ static f32 D_808B6074[] = { 66.0f, 51.0f, 48.0f, 36.0f, 21.0f }; static s16 D_808B6088[] = { 0, 1, 2, 3, 4 }; void func_808B4C30(BgSpot16Bombstone* this) { - this->switchFlag = PARAMS_GET(this->actor.params, 8, 0x3F); - this->actor.params = PARAMS_GET(this->actor.params, 0, 0xFF); + this->switchFlag = PARAMS_GET(this->actor.params, 8, 6); + this->actor.params = PARAMS_GET(this->actor.params, 0, 8); } void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index b8e0bf13f55..a79e19f08f7 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -96,7 +96,7 @@ void BgSpot17Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -115,7 +115,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) { BgSpot17Bakudankabe* this = (BgSpot17Bakudankabe*)thisx; if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) { func_808B6BC0(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); func_80078884(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 671b8b5b2fe..b00c65207e4 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -144,7 +144,7 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) { this->dyna.actor.home.pos.y += 0.01f; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { func_808B7BB0(this); return; } @@ -174,7 +174,7 @@ void func_808B7AEC(BgSpot18Basket* this) { } void func_808B7AFC(BgSpot18Basket* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { OnePointCutscene_Init(play, 4220, 80, &this->dyna.actor, CAM_ID_MAIN); func_808B7B58(this); } @@ -385,7 +385,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } } else if (this->unk_218 == 2) { - if ((this->unk_21A != 0) || Flags_GetCollectible(play, PARAMS_GET(actor->params, 0, 0x3F))) { + if ((this->unk_21A != 0) || Flags_GetCollectible(play, PARAMS_GET(actor->params, 0, 6))) { collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_PURPLE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; @@ -393,7 +393,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } else { collectible = - Item_DropCollectible(play, &tempVector, (PARAMS_GET(actor->params, 0, 0x3F) << 8) | ITEM00_HEART_PIECE); + Item_DropCollectible(play, &tempVector, (PARAMS_GET(actor->params, 0, 6) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; collectible->actor.world.rot.y = D_808B85E4[1]; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index e9c0936671e..a9dafefc43d 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -101,13 +101,13 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { return 0; } - switch (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 0xF)][age]) { + switch (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 4)][age]) { case 0: case 1: - if (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 0xF)][age] == 0) { + if (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 4)][age] == 0) { osSyncPrintf("出現しない Object (0x%04x)\n", this->dyna.actor.params); } - return D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 0xF)][age]; + return D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 4)][age]; case 2: osSyncPrintf("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202, this->dyna.actor.params); @@ -120,7 +120,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8A5C(BgSpot18Obj* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, D_808B90F4[PARAMS_GET(this->dyna.actor.params, 0, 0xF)]); + Actor_SetScale(&this->dyna.actor, D_808B90F4[PARAMS_GET(this->dyna.actor.params, 0, 4)]); return 1; } @@ -129,13 +129,13 @@ s32 func_808B8A98(BgSpot18Obj* this, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, DPM_UNK); - CollisionHeader_GetVirtual(D_808B90FC[PARAMS_GET(this->dyna.actor.params, 0, 0xF)], &colHeader); + CollisionHeader_GetVirtual(D_808B90FC[PARAMS_GET(this->dyna.actor.params, 0, 4)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); return 1; } s32 func_808B8B08(BgSpot18Obj* this, PlayState* play) { - this->dyna.actor.flags |= D_808B9104[PARAMS_GET(this->dyna.actor.params, 0, 0xF)]; + this->dyna.actor.flags |= D_808B9104[PARAMS_GET(this->dyna.actor.params, 0, 4)]; return 1; } @@ -155,7 +155,7 @@ s32 func_808B8BB4(BgSpot18Obj* this, PlayState* play) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { func_808B9030(this); - } else if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + } else if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { func_808B9030(this); this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; @@ -172,8 +172,8 @@ s32 func_808B8C90(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8CC8(BgSpot18Obj* this, PlayState* play) { - if ((D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 0xF)] != NULL) && - (!D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 0xF)](this, play))) { + if ((D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 4)] != NULL) && + (!D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 4)](this, play))) { return 0; } return 1; @@ -257,7 +257,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) { this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); func_80078884(NA_SE_SY_CORRECT_CHIME); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { @@ -283,5 +283,5 @@ void BgSpot18Obj_Update(Actor* thisx, PlayState* play) { } void BgSpot18Obj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sDlists[PARAMS_GET(thisx->params, 0, 0xF)]); + Gfx_DrawDListOpa(play, sDlists[PARAMS_GET(thisx->params, 0, 4)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index a9897e8f41f..cd910fb10ad 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -54,7 +54,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_808B9618; } } else { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { this->actionFunc = func_808B95AC; this->dyna.actor.world.pos.y += 180.0f; } else { @@ -85,7 +85,7 @@ void func_808B95AC(BgSpot18Shutter* this, PlayState* play) { } void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Actor_SetFocus(&this->dyna.actor, 70.0f); OnePointCutscene_Attention(play, &this->dyna.actor); this->actionFunc = func_808B9698; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 4078ad85853..4cb0a5a3808 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -44,8 +44,8 @@ void BgYdanHasi_Init(Actor* thisx, PlayState* play) { WaterBox* waterBox; Actor_ProcessInitChain(thisx, sInitChain); - this->type = PARAMS_GET(thisx->params, 8, 0x3F); - thisx->params = PARAMS_GET(thisx->params, 0, 0xFF); + this->type = PARAMS_GET(thisx->params, 8, 6); + thisx->params = PARAMS_GET(thisx->params, 0, 8); waterBox = &play->colCtx.colHeader->waterBoxes[1]; DynaPolyActor_Init(&this->dyna, DPM_PLAYER); if (thisx->params == HASI_WATER) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index f98d7f5ce49..2152529d239 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -88,8 +88,8 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->elements); - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0xFFFF); - thisx->params = PARAMS_GET(thisx->params, 8, 0xFF); // thisx is required to match here + this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 16); + thisx->params = PARAMS_GET(thisx->params, 8, 8); // thisx is required to match here if (this->dyna.actor.params == 0) { triInit = &sTrisElementsInit[0]; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index ffa8de71f2e..8bdd71717d3 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -91,9 +91,9 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { f32 nSinsX; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->isDestroyedSwitchFlag = PARAMS_GET(thisx->params, 0, 0x3F); - this->burnSwitchFlag = PARAMS_GET(thisx->params, 6, 0x3F); - this->dyna.actor.params = PARAMS_GET(thisx->params, 0xC, 0xF); + this->isDestroyedSwitchFlag = PARAMS_GET(thisx->params, 0, 6); + this->burnSwitchFlag = PARAMS_GET(thisx->params, 6, 6); + this->dyna.actor.params = PARAMS_GET(thisx->params, 12, 4); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); Collider_InitTris(play, &this->trisCollider); Collider_SetTris(play, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems); diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 1f2012575b6..bc8e45f5a5b 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -59,13 +59,13 @@ void func_808C0C50(BgZg* this) { } s32 func_808C0C98(BgZg* this, PlayState* play) { - s32 flag = PARAMS_GET(this->dyna.actor.params, 8, 0xFF); + s32 flag = PARAMS_GET(this->dyna.actor.params, 8, 8); return Flags_GetSwitch(play, flag); } s32 func_808C0CC8(BgZg* this) { - s32 flag = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); + s32 flag = PARAMS_GET(this->dyna.actor.params, 0, 8); return flag; } diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 0e16cf1d1c3..8e444655f4e 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -909,8 +909,8 @@ void func_808FF898(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if ((PARAMS_GET(actor->params, 0, 0xFF) == 0x10) || (PARAMS_GET(actor->params, 0, 0xFF) == 0x11) || - (PARAMS_GET(actor->params, 0, 0xFF) == 0x16)) { + if ((PARAMS_GET(actor->params, 0, 8) == 0x10) || (PARAMS_GET(actor->params, 0, 8) == 0x11) || + (PARAMS_GET(actor->params, 0, 8) == 0x16)) { if (SQ(this->unk_218.x - gj->dyna.actor.world.pos.x) + SQ(this->unk_218.z - gj->dyna.actor.world.pos.z) < SQ(100.0f)) { @@ -950,8 +950,8 @@ s32 func_808FFA24(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if ((PARAMS_GET(actor->params, 0, 0xFF) == 0x10) || (PARAMS_GET(actor->params, 0, 0xFF) == 0x11) || - (PARAMS_GET(actor->params, 0, 0xFF) == 0x16)) { + if ((PARAMS_GET(actor->params, 0, 8) == 0x10) || (PARAMS_GET(actor->params, 0, 8) == 0x11) || + (PARAMS_GET(actor->params, 0, 8) == 0x16)) { if (SQ(this->actor.world.pos.x - gj->dyna.actor.world.pos.x) + SQ(this->actor.world.pos.z - gj->dyna.actor.world.pos.z) < SQ(200.0f)) { diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index f202343c466..5c5a924cea0 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -182,8 +182,8 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { DemoEffect* crystalLight; DemoEffect* lightRing; - effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); - lightEffect = PARAMS_GET2(this->actor.params, 12, 0xF000); + effectType = PARAMS_GET2(this->actor.params, 0, 8); + lightEffect = PARAMS_GET2(this->actor.params, 12, 4); osSyncPrintf(VT_FGCOL(CYAN) " no = %d\n" VT_RST, effectType); @@ -519,7 +519,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { */ void DemoEffect_Destroy(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); + s32 effectType = PARAMS_GET2(this->actor.params, 0, 8); if (effectType == DEMO_EFFECT_TIMEWARP_MASTERSWORD || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { @@ -680,7 +680,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { * 3) Timeblock is cleared with the Song of Time (Large and Small have different versions of Timewarp) */ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { - s32 effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); + s32 effectType = PARAMS_GET2(this->actor.params, 0, 8); if (!SkelCurve_Init(play, &this->skelCurve, &gTimeWarpSkel, &gTimeWarpAnim)) { ASSERT(0, "0", "../z_demo_effect.c", 1283); @@ -792,7 +792,7 @@ void DemoEffect_UpdateTimeWarpTimeblock(DemoEffect* this, PlayState* play) { shrinkProgress = (100 - this->timeWarp.shrinkTimer) * 0.010f; scale = shrinkProgress * 0.14f; - if (PARAMS_GET2(this->actor.params, 0, 0x00FF) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { + if (PARAMS_GET2(this->actor.params, 0, 8) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { scale *= 0.6f; } @@ -1036,7 +1036,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { u16 action; s32 isLargeSize; - isLargeSize = PARAMS_GET2(this->actor.params, 8, 0x0F00); + isLargeSize = PARAMS_GET2(this->actor.params, 8, 4); if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.npcActions[this->csActionId] != NULL) { DemoEffect_MoveToCsEndpoint(this, play, this->csActionId, 0); @@ -2068,7 +2068,7 @@ s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; - u8 effectType = PARAMS_GET2(this->actor.params, 0, 0x00FF); + u8 effectType = PARAMS_GET2(this->actor.params, 0, 8); if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL || Flags_GetEnv(play, 1) || gSaveContext.sceneSetupIndex >= 4 || gSaveContext.entranceIndex == ENTR_TOKINOMA_4) { diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 915cd8bbe0b..9384046fca1 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -77,21 +77,21 @@ typedef void (*DemoGjDrawFunc)(DemoGj*, PlayState*); // bits 11-15 s32 DemoGj_GetCollectibleType(DemoGj* this) { - s32 type = PARAMS_GET(this->dyna.actor.params, 0xB, 0x1F); + s32 type = PARAMS_GET(this->dyna.actor.params, 11, 5); return type; } // bits 8-10 s32 DemoGj_GetCollectibleAmount(DemoGj* this) { - s32 amount = PARAMS_GET(this->dyna.actor.params, 0x8, 7); + s32 amount = PARAMS_GET(this->dyna.actor.params, 8, 3); return amount; } // bits 0-7 s32 DemoGj_GetType(DemoGj* this) { - s32 type = PARAMS_GET(this->dyna.actor.params, 0, 0xFF); + s32 type = PARAMS_GET(this->dyna.actor.params, 0, 8); return type; } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 9f36299e2b0..c969070c30c 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -66,7 +66,7 @@ void DoorAna_Init(Actor* thisx, PlayState* play) { this->actor.shape.rot.z = 0; this->actor.shape.rot.y = this->actor.shape.rot.z; // init block for grottos that are initially "hidden" (require explosives/hammer/song of storms to open) - if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 3) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 2) != 0) { // only allocate collider for grottos that need bombing/hammering open if (PARAMS_GET_NOSHIFT(this->actor.params, 9, 1) != 0) { Collider_InitCylinder(play, &this->collider); @@ -130,11 +130,11 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_31) && (player->unk_84F == 0)) { - destinationIdx = PARAMS_GET(this->actor.params, 0xC, 7) - 1; + destinationIdx = PARAMS_GET(this->actor.params, 12, 3) - 1; Play_SetupRespawnPoint(play, RESPAWN_MODE_RETURN, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; - gSaveContext.respawn[RESPAWN_MODE_RETURN].data = PARAMS_GET(this->actor.params, 0, 0xFFFF); + gSaveContext.respawn[RESPAWN_MODE_RETURN].data = PARAMS_GET(this->actor.params, 0, 16); if (destinationIdx < 0) { destinationIdx = this->actor.home.rot.z + 1; } diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 0af93649d48..1c9c774bb31 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -44,7 +44,7 @@ void DoorGerudo_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&gGerudoCellDoorCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { this->actionFunc = func_8099485C; thisx->world.pos.y = thisx->home.pos.y + 200.0f; } else { @@ -100,7 +100,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (this->unk_164 != 0) { this->actionFunc = func_8099496C; gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } else { s32 direction = func_80994750(this, play); @@ -110,7 +110,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) { player->naviTextId = -0x203; - } else if (!Flags_GetCollectible(play, PARAMS_GET(this->dyna.actor.params, 8, 0x1F))) { + } else if (!Flags_GetCollectible(play, PARAMS_GET(this->dyna.actor.params, 8, 5))) { player->naviTextId = -0x225; } else { player->doorType = PLAYER_DOORTYPE_SLIDING; diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index 8f9ae144895..62b825c3a29 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -120,7 +120,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->animStyle = 0; this->playerIsOpening = 0; - switch ((u8)PARAMS_GET(this->actor.params, 0, 0xFF)) { + switch ((u8)PARAMS_GET(this->actor.params, 0, 8)) { case DOOR_KILLER_DOOR: // `jointTable` is used for both the `jointTable` and `morphTable` args here. Because this actor doesn't // play any animations it does not cause problems, but it would need to be changed otherwise. @@ -143,8 +143,8 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->colliderJntSph.elements[0].dim.worldSphere.center.z = (s16)this->actor.world.pos.z; // If tied to a switch flag and that switch flag is already set, kill the actor. - if ((PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) && - Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if ((PARAMS_GET(this->actor.params, 8, 6) != 0x3F) && + Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { Actor_Kill(&this->actor); } break; @@ -179,7 +179,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { void DoorKiller_Destroy(Actor* thisx, PlayState* play) { DoorKiller* this = (DoorKiller*)thisx; - if (PARAMS_GET(thisx->params, 0, 0xFF) == DOOR_KILLER_DOOR) { + if (PARAMS_GET(thisx->params, 0, 8) == DOOR_KILLER_DOOR) { Collider_DestroyCylinder(play, &this->colliderCylinder); Collider_DestroyJntSph(play, &this->colliderJntSph); } @@ -240,7 +240,7 @@ void DoorKiller_SetAC(DoorKiller* this, PlayState* play) { } void DoorKiller_Die(DoorKiller* this, PlayState* play) { - s32 switchFlag = PARAMS_GET(this->actor.params, 8, 0x3F); + s32 switchFlag = PARAMS_GET(this->actor.params, 8, 6); // Can set a switch flag on death based on params if (switchFlag != 0x3F) { @@ -471,7 +471,7 @@ void DoorKiller_UpdateTexture(Actor* thisx, PlayState* play) { void DoorKiller_SetProperties(DoorKiller* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->doorObjBankIndex)) { DoorKiller_UpdateTexture(&this->actor, play); - switch (PARAMS_GET(this->actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->actor.params, 0, 8)) { case DOOR_KILLER_DOOR: this->actionFunc = DoorKiller_Wait; this->actor.draw = DoorKiller_DrawDoor; @@ -514,7 +514,7 @@ void DoorKiller_DrawDoor(Actor* thisx, PlayState* play) { void DoorKiller_DrawRubble(Actor* thisx, PlayState* play) { static Gfx* dLists[] = { object_door_killer_DL_001250, object_door_killer_DL_001550, object_door_killer_DL_0017B8, object_door_killer_DL_001A58 }; - s32 rubblePieceIndex = PARAMS_GET(thisx->params, 0, 0xFF) - 1; + s32 rubblePieceIndex = PARAMS_GET(thisx->params, 0, 8) - 1; DoorKiller* this = (DoorKiller*)thisx; if ((this->timer >= 20) || ((this->timer & 1) == 0)) { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c index 5cc84cef2b2..9d044c8460d 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.c @@ -174,7 +174,7 @@ void DoorShutter_SetupAction(DoorShutter* this, DoorShutterActionFunc actionFunc } s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) { - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA)]; + TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 10)]; s8 frontRoom = transitionEntry->sides[0].room; s32 doorType = this->doorType; ShutterObjectInfo* temp_t0 = &sObjectInfo[this->unk_16B]; @@ -202,7 +202,7 @@ s32 DoorShutter_SetupDoor(DoorShutter* this, PlayState* play) { return true; } } else if (doorType == SHUTTER_FRONT_SWITCH || doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) { - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { DoorShutter_SetupAction(this, func_80996EE8); this->unk_170 = 1.0f; return true; @@ -228,7 +228,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->dyna.actor.home.pos.z = this->dyna.actor.shape.yOffset; DynaPolyActor_Init(&this->dyna, DPM_UNK); - this->doorType = PARAMS_GET(this->dyna.actor.params, 6, 0xF); + this->doorType = PARAMS_GET(this->dyna.actor.params, 6, 4); phi_a3 = D_80998224[this->doorType]; if (phi_a3 < 0) { ShutterSceneInfo* phi_v1; @@ -259,7 +259,7 @@ void DoorShutter_Init(Actor* thisx, PlayState* play2) { DoorShutter_SetupAction(this, DoorShutter_SetupType); this->unk_16B = phi_a3; if (this->doorType == SHUTTER_KEY_LOCKED || this->doorType == SHUTTER_BOSS) { - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { this->unk_16E = 10; } Actor_SetFocus(&this->dyna.actor, 60.0f); @@ -278,7 +278,7 @@ void DoorShutter_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); if (this->dyna.actor.room >= 0) { - s32 transitionActorId = PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA); + s32 transitionActorId = PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 10); play->transiActorCtx.list[transitionActorId].id *= -1; } @@ -371,7 +371,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) { DoorShutter_SetupAction(this, func_80997004); this->dyna.actor.velocity.y = 0.0f; if (this->unk_16E != 0) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); if (this->doorType != SHUTTER_BOSS) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); @@ -468,7 +468,7 @@ s32 func_80996E08(DoorShutter* this, PlayState* play, f32 arg2) { void func_80996EE8(DoorShutter* this, PlayState* play) { if (func_80996E08(this, play, 1.0f)) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { DoorShutter_SetupAction(this, func_80997150); OnePointCutscene_Attention(play, &this->dyna.actor); this->unk_16F = -100; @@ -481,7 +481,7 @@ void func_80996EE8(DoorShutter* this, PlayState* play) { } void func_80996F98(DoorShutter* this, PlayState* play) { - if (this->unk_164 == 0 && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (this->unk_164 == 0 && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { DoorShutter_SetupAction(this, func_80996EE8); } else { func_80996B0C(this, play); @@ -500,7 +500,7 @@ void func_80997004(DoorShutter* this, PlayState* play) { } else { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYODOOR_CLOSE); if ((this->doorType == SHUTTER_FRONT_SWITCH || this->doorType == SHUTTER_FRONT_SWITCH_BACK_CLEAR) && - !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BUYOSHUTTER_CLOSE); } DoorShutter_SetupAction(this, func_80997528); @@ -540,7 +540,7 @@ void func_80997220(DoorShutter* this, PlayState* play) { func_8002DBD0(&this->dyna.actor, &vec, &player->actor.world.pos); this->dyna.actor.room = - play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA)].sides[(vec.z < 0.0f) ? 0 : 1].room; + play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 10)].sides[(vec.z < 0.0f) ? 0 : 1].room; if (room != this->dyna.actor.room) { Room tempRoom = play->roomCtx.curRoom; @@ -727,7 +727,7 @@ void DoorShutter_Draw(Actor* thisx, PlayState* play) { } } else { if (sp70->b != NULL) { - TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 0xA)]; + TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->dyna.actor.params, 10)]; if (play->roomCtx.prevRoom.num >= 0 || transitionEntry->sides[0].room == transitionEntry->sides[1].room) { diff --git a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 87708b40100..2b8cfdd2678 100644 --- a/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -165,7 +165,7 @@ void DoorWarp1_SetupWarp(DoorWarp1* this, PlayState* play) { gSaveContext.entranceIndex == ENTR_SPOT06_9 || gSaveContext.entranceIndex == ENTR_SPOT11_8 || gSaveContext.entranceIndex == ENTR_SPOT02_8) && gSaveContext.sceneSetupIndex < 4) || - PARAMS_GET_NOSHIFT(GET_PLAYER(play)->actor.params, 8, 0xF) != 0x200) { + PARAMS_GET_NOSHIFT(GET_PLAYER(play)->actor.params, 8, 4) != 0x200) { Actor_Kill(&this->actor); } if (Actor_WorldDistXZToActor(&player->actor, &this->actor) > 100.0f) { diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index b5ce12e743c..43db72f30d2 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -47,21 +47,21 @@ s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 161); // "Mutual destruction" - if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction" - if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; - } else if (PARAMS_GET(this->actor.params, 8, 0x3F) == 0x3F) { + } else if (PARAMS_GET(this->actor.params, 8, 6) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { Actor_Kill(&this->actor); return 1; } @@ -72,7 +72,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { ElfMsg* this = (ElfMsg*)thisx; // "Conditions for Elf Tag disappearing" - osSyncPrintf(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET(thisx->params, 8, 0x3F)); + osSyncPrintf(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET(thisx->params, 8, 6)); osSyncPrintf(VT_FGCOL(CYAN) "\nthisx->shape.angle.sy = %d\n" VT_RST, thisx->shape.rot.y); if (thisx->shape.rot.y >= 0x41) { // "Conditions for Elf Tag appearing" @@ -110,9 +110,9 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { - return PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100; + return PARAMS_GET(this->actor.params, 0, 8) + 0x100; } else { - return -(PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100); + return -(PARAMS_GET(this->actor.params, 0, 8) + 0x100); } } @@ -150,8 +150,8 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { if (!ElfMsg_KillCheck(this, play)) { if (Actor_ProcessTalkRequest(&this->actor, play)) { - if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 81b6c973983..6320f0278f4 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -47,21 +47,21 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction" - if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2" - if (PARAMS_GET(this->actor.params, 8, 0x3F) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; - } else if (PARAMS_GET(this->actor.params, 8, 0x3F) == 0x3F) { + } else if (PARAMS_GET(this->actor.params, 8, 6) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction" Actor_Kill(&this->actor); return 1; @@ -93,7 +93,7 @@ void ElfMsg2_Destroy(Actor* thisx, PlayState* play) { } s32 ElfMsg2_GetMessageId(ElfMsg2* this) { - return PARAMS_GET(this->actor.params, 0, 0xFF) + 0x100; + return PARAMS_GET(this->actor.params, 0, 8) + 0x100; } /** @@ -106,7 +106,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); - switchFlag = PARAMS_GET(this->actor.params, 8, 0x3F); + switchFlag = PARAMS_GET(this->actor.params, 8, 6); if (switchFlag != 0x3F) { Flags_SetSwitch(play, switchFlag); } diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index c6d9ef42b1c..e6e2574e75a 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -104,7 +104,7 @@ void EnBa_Init(Actor* thisx, PlayState* play) { } this->actor.targetMode = 4; - this->upperParams = PARAMS_GET(thisx->params, 8, 0xFF); + this->upperParams = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (this->actor.params < EN_BA_DEAD_BLOB) { diff --git a/src/overlays/actors/ovl_En_Bb/z_en_bb.c b/src/overlays/actors/ovl_En_Bb/z_en_bb.c index 6d935bb5a06..ebc6cec1d71 100644 --- a/src/overlays/actors/ovl_En_Bb/z_en_bb.c +++ b/src/overlays/actors/ovl_En_Bb/z_en_bb.c @@ -326,7 +326,7 @@ void EnBb_Init(Actor* thisx, PlayState* play) { if (thisx->params <= ENBB_BLUE) { ActorShape_Init(&thisx->shape, 200.0f, ActorShadow_DrawCircle, 35.0f); } - if (PARAMS_GET_NOSHIFT(thisx->params, 8, 0xFF)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 8, 8)) { this->timer = 0; this->flameScaleY = 80.0f; this->flameScaleX = 100.0f; diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index b8c9088d34d..b3ada7af943 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -109,7 +109,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { DynaPoly_DisableCeilingCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->movementFlags = 0; - this->type = PARAMS_GET(thisx->params, 12, 0xF); + this->type = PARAMS_GET(thisx->params, 12, 4); this->iceSmokeTimer = 0; this->unk_1FB = ENBOX_STATE_0; this->dyna.actor.gravity = -5.5f; @@ -118,7 +118,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { if (play) {} // helps the compiler store play2 into s1 - if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 0x1F))) { + if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 5))) { this->alpha = 255; this->iceSmokeTimer = 100; EnBox_SetupAction(this, EnBox_Open); @@ -264,7 +264,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) { } void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { func_8002F5F0(&this->dyna.actor, play); @@ -283,7 +283,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { // used for types 9, 10 void func_809C9700(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); Player* player = GET_PLAYER(play); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { @@ -320,7 +320,7 @@ void func_809C9700(EnBox* this, PlayState* play) { } void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { func_8002F5F0(&this->dyna.actor, play); @@ -334,7 +334,7 @@ void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { } void EnBox_AppearOnRoomClear(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x1F); + s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { func_8002F5F0(&this->dyna.actor, play); @@ -417,16 +417,16 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { Audio_PlayFanfare(NA_BGM_OPEN_TRE_BOX | 0x900); } } - osSyncPrintf("Actor_Environment_Tbox_On() %d\n", PARAMS_GET(this->dyna.actor.params, 0, 0x1F)); - Flags_SetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 0x1F)); + osSyncPrintf("Actor_Environment_Tbox_On() %d\n", PARAMS_GET(this->dyna.actor.params, 0, 5)); + Flags_SetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 5)); } else { player = GET_PLAYER(play); func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) { - func_8002F554(&this->dyna.actor, play, -PARAMS_GET(this->dyna.actor.params, 5, 0x7F)); + func_8002F554(&this->dyna.actor, play, -PARAMS_GET(this->dyna.actor.params, 5, 7)); } - if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 0x1F))) { + if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 5))) { EnBox_SetupAction(this, EnBox_Open); } } @@ -537,7 +537,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 40.0f); } - if (PARAMS_GET(this->dyna.actor.params, 5, 0x7F) == 0x7C && this->actionFunc == EnBox_Open && + if (PARAMS_GET(this->dyna.actor.params, 5, 7) == 0x7C && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) { EnBox_SpawnIceSmoke(this, play); } diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 0fde933fe11..7c7b09567c8 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -71,17 +71,17 @@ void EnBrob_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->colliders[1]); Collider_SetCylinder(play, &this->colliders[1], &this->dyna.actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); - if (PARAMS_GET(thisx->params, 8, 0xFF) == 0) { + if (PARAMS_GET(thisx->params, 8, 8) == 0) { Actor_SetScale(&this->dyna.actor, 0.01f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= PARAMS_GET(thisx->params, 0, 0xFF) * (1.0f / 30.0f); + thisx->scale.y *= PARAMS_GET(thisx->params, 0, 8) * (1.0f / 30.0f); } } else { Actor_SetScale(&this->dyna.actor, 0.005f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= PARAMS_GET(thisx->params, 0, 0xFF) * (2.0f / 30.0f); + thisx->scale.y *= PARAMS_GET(thisx->params, 0, 8) * (2.0f / 30.0f); } } this->colliders[0].dim.radius *= thisx->scale.x; diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index 02b82a5dc8f..a67b8394592 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -98,7 +98,7 @@ void EnBx_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.mass = MASS_IMMOVABLE; this->unk_14C = 0; thisx->uncullZoneDownward = 2000.0f; - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0xFF))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 8))) { Actor_Kill(&this->actor); } thisx->params &= 0xFF; @@ -210,7 +210,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x0C, mtx); - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[PARAMS_GET(this->actor.params, 0, 0x7F)])); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[PARAMS_GET(this->actor.params, 0, 7)])); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 16, 16, 1, 0, (play->gameplayFrames * -10) % 128, 32, 32)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_en_bx.c", 478), diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 3e052c5e716..7ff6ac01d37 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -144,7 +144,7 @@ void EnCs_Init(Actor* thisx, PlayState* play) { sAnimationInfo[ENCS_ANIM_0].morphFrames); this->actor.targetMode = 6; - this->path = PARAMS_GET(this->actor.params, 0, 0xFF); + this->path = PARAMS_GET(this->actor.params, 0, 8); this->unk_1EC = 0; // This variable is unused anywhere else this->talkState = 0; this->currentAnimIndex = -1; diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index d74eb5579bc..4747aaaa646 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -152,13 +152,13 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { s32 noKill = true; s32 isFree = false; - if (PARAMS_GET(this->actor.params, 0, 3) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { + if (PARAMS_GET(this->actor.params, 0, 2) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { isFree = true; - } else if (PARAMS_GET(this->actor.params, 0, 3) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { + } else if (PARAMS_GET(this->actor.params, 0, 2) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { isFree = true; - } else if (PARAMS_GET(this->actor.params, 0, 3) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { + } else if (PARAMS_GET(this->actor.params, 0, 2) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { isFree = true; - } else if (PARAMS_GET(this->actor.params, 0, 3) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { + } else if (PARAMS_GET(this->actor.params, 0, 2) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { isFree = true; } @@ -200,7 +200,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2; this->actionFunc = EnDaiku_Jailed; } else { - if (PARAMS_GET(this->actor.params, 0, 3) == 1 || PARAMS_GET(this->actor.params, 0, 3) == 3) { + if (PARAMS_GET(this->actor.params, 0, 2) == 1 || PARAMS_GET(this->actor.params, 0, 2) == 3) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex); this->stateFlags |= ENDAIKU_STATEFLAG_1; } else { @@ -295,7 +295,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { this->actor.textId = 0x6007; } } else if (play->sceneNum == SCENE_TENT) { - switch (PARAMS_GET(this->actor.params, 0, 3)) { + switch (PARAMS_GET(this->actor.params, 0, 2)) { case 0: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6060; @@ -378,7 +378,7 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) { void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; EnDaiku_UpdateText(this, play); } @@ -400,14 +400,14 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); gSaveContext.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= - EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET(this->actor.params, 0, 3)); + EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET(this->actor.params, 0, 2)); this->actor.gravity = -1.0f; - this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].maxFramesActive; EnDaiku_InitSubCamera(this, play); exitLoop = false; - path = &play->setupPathList[PARAMS_GET(this->actor.params, 4, 0xF)]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 4, 4)]; while (!exitLoop) { pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; @@ -444,11 +444,11 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { Vec3f eyePosDeltaWorld; this->subCamActive = true; - this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].maxFramesActive; - eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].eyePosDeltaLocal.x; - eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].eyePosDeltaLocal.y; - eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 3)].eyePosDeltaLocal.z; + eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].eyePosDeltaLocal.x; + eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].eyePosDeltaLocal.y; + eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].eyePosDeltaLocal.z; Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); @@ -522,7 +522,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) { f32 dxz; Vec3s* pointPos; - path = &play->setupPathList[PARAMS_GET(this->actor.params, 4, 0xF)]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 4, 4)]; pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; dz = pointPos->z - this->actor.world.pos.z; @@ -592,13 +592,13 @@ void EnDaiku_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (PARAMS_GET(thisx->params, 0, 3) == 0) { + if (PARAMS_GET(thisx->params, 0, 2) == 0) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 3) == 1) { + } else if (PARAMS_GET(thisx->params, 0, 2) == 1) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if (PARAMS_GET(thisx->params, 0, 3) == 2) { + } else if (PARAMS_GET(thisx->params, 0, 2) == 2) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 3) == 3) { + } else if (PARAMS_GET(thisx->params, 0, 2) == 3) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } @@ -635,7 +635,7 @@ void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, vo if (limb == 15) { // head Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET(this->actor.params, 0, 3)]); + gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET(this->actor.params, 0, 2)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1330); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index 9f2aa1488d7..a6d20f73d97 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -133,7 +133,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { case SCENE_SPOT01: if (IS_DAY) { this->flags |= 1; - this->flags |= initFlags[PARAMS_GET(this->actor.params, 0, 3)]; + this->flags |= initFlags[PARAMS_GET(this->actor.params, 0, 2)]; } break; case SCENE_KAKARIKO: @@ -184,7 +184,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnDaikuKakariko_Run; } else { if (this->flags & 8) { - if ((PARAMS_GET(this->actor.params, 0, 3) == CARPENTER_SABOORO) || (PARAMS_GET(this->actor.params, 0, 3) == CARPENTER_SHIRO)) { + if ((PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SABOORO) || (PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SHIRO)) { EnDaikuKakariko_ChangeAnim(this, ENDAIKUKAKARIKO_ANIM_5, &this->currentAnimIndex); this->flags |= 0x800; } else { @@ -239,10 +239,10 @@ void EnDaikuKakariko_HandleTalking(EnDaikuKakariko* this, PlayState* play) { if ((sp26 >= 0) && (sp26 <= 320) && (sp24 >= 0) && (sp24 <= 240) && (this->talkState == 0) && (func_8002F2CC(&this->actor, play, 100.0f) == 1)) { - this->actor.textId = Text_GetFaceReaction(play, maskReactionSets[PARAMS_GET(this->actor.params, 0, 3)]); + this->actor.textId = Text_GetFaceReaction(play, maskReactionSets[PARAMS_GET(this->actor.params, 0, 2)]); if (this->actor.textId == 0) { - switch (PARAMS_GET(this->actor.params, 0, 3)) { + switch (PARAMS_GET(this->actor.params, 0, 2)) { case 0: if (this->flags & 8) { this->actor.textId = 0x5076; @@ -359,7 +359,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { s32 run; do { - path = &play->setupPathList[PARAMS_GET(this->actor.params, 8, 0xFF)]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 8, 8)]; pathPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->waypoint]; xDist = pathPos->x - this->actor.world.pos.x; zDist = pathPos->z - this->actor.world.pos.z; @@ -531,7 +531,7 @@ void EnDaikuKakariko_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V if (limbIndex == 15) { Matrix_MultVec3f(&unkVec, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET(this->actor.params, 0, 3)]); + gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET(this->actor.params, 0, 2)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku_kakariko.c", 1113); @@ -544,13 +544,13 @@ void EnDaikuKakariko_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_ICHIRO) { + if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_ICHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_SABOORO) { + } else if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_SABOORO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_JIRO) { + } else if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_JIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 3) == CARPENTER_SHIRO) { + } else if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_SHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index ed2fbf5ff48..27cb28766ce 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -119,7 +119,7 @@ void EnDekunuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->shotsPerRound = PARAMS_GET(thisx->params, 8, 0xFF); + this->shotsPerRound = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if ((this->shotsPerRound == 0xFF) || (this->shotsPerRound == 0)) { this->shotsPerRound = 1; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 97654cf5d3e..b2b23df8c48 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -190,7 +190,7 @@ s8 EnDog_CanFollow(EnDog* this, PlayState* play) { if (gSaveContext.dogParams != 0) { return 0; } - gSaveContext.dogParams = PARAMS_GET2(this->actor.params, 0, 0x7FFF); + gSaveContext.dogParams = PARAMS_GET2(this->actor.params, 0, 15); return 1; } @@ -248,12 +248,12 @@ void EnDog_Init(Actor* thisx, PlayState* play) { SkelAnime_InitFlex(play, &this->skelAnime, &gDogSkel, NULL, this->jointTable, this->morphTable, 13); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDOG_ANIM_0); - if (PARAMS_GET2(this->actor.params, 0, 0x8000) == 0) { - this->actor.params = PARAMS_GET2(this->actor.params, 0, 0xF0FF) | ((PARAMS_GET2(this->actor.params, 8, 0x0F00) + 1) << 8); + if (!PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { + this->actor.params = (this->actor.params & ~(0xF << 8)) | ((PARAMS_GET2(this->actor.params, 8, 4) + 1) << 8); } followingDog = ((gSaveContext.dogParams & 0x0F00) >> 8); - if (followingDog == PARAMS_GET2(this->actor.params, 8, 0x0F00) && PARAMS_GET2(this->actor.params, 0, 0x8000) == 0) { + if (followingDog == PARAMS_GET2(this->actor.params, 8, 4) && !PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { Actor_Kill(&this->actor); return; } @@ -264,16 +264,16 @@ void EnDog_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; - this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 4, 0x00F0), 0xF); + this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 4, 4), 0xF); switch (play->sceneNum) { case SCENE_MARKET_NIGHT: - if ((!gSaveContext.dogIsLost) && PARAMS_GET2(this->actor.params, 8, 0x0F00) == 1) { + if ((!gSaveContext.dogIsLost) && PARAMS_GET2(this->actor.params, 8, 4) == 1) { Actor_Kill(&this->actor); } break; case SCENE_IMPA: // Richard's Home - if (!PARAMS_GET2(this->actor.params, 0, 0x8000)) { + if (!PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { if (!gSaveContext.dogIsLost) { this->nextBehavior = DOG_SIT; this->actionFunc = EnDog_Wait; @@ -287,7 +287,7 @@ void EnDog_Init(Actor* thisx, PlayState* play) { break; } - if (PARAMS_GET2(this->actor.params, 0, 0x8000)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { this->nextBehavior = DOG_WALK; this->actionFunc = EnDog_FollowPlayer; } else { @@ -477,8 +477,8 @@ void EnDog_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET2(this->actor.params, 0, 0xF)].r, colors[PARAMS_GET2(this->actor.params, 0, 0xF)].g, - colors[PARAMS_GET2(this->actor.params, 0, 0xF)].b, colors[PARAMS_GET2(this->actor.params, 0, 0xF)].a); + gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET2(this->actor.params, 0, 4)].r, colors[PARAMS_GET2(this->actor.params, 0, 4)].g, + colors[PARAMS_GET2(this->actor.params, 0, 4)].b, colors[PARAMS_GET2(this->actor.params, 0, 4)].a); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDog_OverrideLimbDraw, EnDog_PostLimbDraw, this); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 3bc50c7bdb2..b3615b9ec90 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -135,7 +135,7 @@ void EnDoor_Destroy(Actor* thisx, PlayState* play) { TransitionActorEntry* transitionEntry; EnDoor* this = (EnDoor*)thisx; - transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->actor.params, 0xA)]; + transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->actor.params, 10)]; if (transitionEntry->id < 0) { transitionEntry->id = -transitionEntry->id; } @@ -145,7 +145,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { s32 doorType; if (Object_IsLoaded(&play->objectCtx, this->requiredObjBankIndex)) { - doorType = PARAMS_GET(this->actor.params, 7, 7); + doorType = PARAMS_GET(this->actor.params, 7, 3); this->actor.flags &= ~ACTOR_FLAG_4; this->actor.objBankIndex = this->requiredObjBankIndex; this->actionFunc = EnDoor_Idle; @@ -156,7 +156,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { } this->actor.world.rot.y = 0x0000; if (doorType == DOOR_LOCKED) { - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { this->lockTimer = 10; } } else if (doorType == DOOR_AJAR) { @@ -165,7 +165,7 @@ void EnDoor_SetupType(EnDoor* this, PlayState* play) { this->actor.world.rot.y = -0x1800; } } else if (doorType == DOOR_CHECKABLE) { - this->actor.textId = PARAMS_GET(this->actor.params, 0, 0x3F) + 0x0200; + this->actor.textId = PARAMS_GET(this->actor.params, 0, 6) + 0x0200; if (this->actor.textId == 0x0229 && !GET_EVENTCHKINF(EVENTCHKINF_14)) { // Talon's house door. If Talon has not been woken up at Hyrule Castle // this door should be openable at any time of day. Note that there is no @@ -188,7 +188,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { Vec3f playerPosRelToDoor; s16 yawDiff; - doorType = PARAMS_GET(this->actor.params, 7, 7); + doorType = PARAMS_GET(this->actor.params, 7, 3); func_8002DBD0(&this->actor, &playerPosRelToDoor, &player->actor.world.pos); if (this->playerIsOpening != 0) { this->actionFunc = EnDoor_Open; @@ -196,7 +196,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) { (player->stateFlags1 & PLAYER_STATE1_27) ? 0.75f : 1.5f); if (this->lockTimer != 0) { gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } } else if (!Player_InCsMode(play)) { @@ -306,7 +306,7 @@ s32 EnDoor_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* if (limbIndex == 4) { doorDLists = sDoorDLists[this->dListIndex]; - transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->actor.params, 0xA)]; + transitionEntry = &play->transiActorCtx.list[PARAMS_GET_NOMASK((u16)this->actor.params, 10)]; rot->z += this->actor.world.rot.y; if ((play->roomCtx.prevRoom.num >= 0) || (transitionEntry->sides[0].room == transitionEntry->sides[1].room)) { rotDiff = ((this->actor.shape.rot.y + this->skelAnime.jointTable[3].z) + rot->z) - diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index a824767190c..b14500ba2a2 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -44,9 +44,9 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { return; } - this->spawnType = PARAMS_GET(this->actor.params, 0xB, 0x1F); - this->maxCurSpawns = PARAMS_GET(this->actor.params, 6, 0x1F); - this->maxTotalSpawns = PARAMS_GET(this->actor.params, 0, 0x3F); + this->spawnType = PARAMS_GET(this->actor.params, 11, 5); + this->maxCurSpawns = PARAMS_GET(this->actor.params, 6, 5); + this->maxTotalSpawns = PARAMS_GET(this->actor.params, 0, 6); this->curNumSpawn = this->totalNumSpawn = 0; spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 9c6909b1047..c74cf7efcf8 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -52,8 +52,8 @@ void EnExItem_Init(Actor* thisx, PlayState* play) { EnExItem* this = (EnExItem*)thisx; this->actor.flags &= ~ACTOR_FLAG_0; - this->type = PARAMS_GET(this->actor.params, 0, 0xFF); - this->unusedParam = PARAMS_GET(this->actor.params, 8, 0xFF); + this->type = PARAMS_GET(this->actor.params, 0, 8); + this->unusedParam = PARAMS_GET(this->actor.params, 8, 8); osSyncPrintf("\n\n"); // "What will come out?" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); diff --git a/src/overlays/actors/ovl_En_Fd/z_en_fd.c b/src/overlays/actors/ovl_En_Fd/z_en_fd.c index c72015e9327..73393b94b3e 100644 --- a/src/overlays/actors/ovl_En_Fd/z_en_fd.c +++ b/src/overlays/actors/ovl_En_Fd/z_en_fd.c @@ -10,9 +10,6 @@ #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_9) -#define FLG_COREDEAD (0x4000) -#define FLG_COREDONE (0x8000) - void EnFd_Init(Actor* thisx, PlayState* play); void EnFd_Destroy(Actor* thisx, PlayState* play); void EnFd_Update(Actor* thisx, PlayState* play); @@ -627,6 +624,9 @@ void EnFd_Run(EnFd* this, PlayState* play) { Math_SmoothStepToF(&this->actor.speedXZ, 8.0f, 0.1f, 1.0f, 0.0f); } +#define FLG_COREDEAD (0x4000) +#define FLG_COREDONE (0x8000) + /** * En_Fw will set `this` params when it is done with its action. * It will set FLG_COREDONE when the core has returned to `this`'s initial @@ -638,9 +638,9 @@ void EnFd_WaitForCore(EnFd* this, PlayState* play) { if (this->spinTimer == 0) { Actor_Kill(&this->actor); } - } else if (PARAMS_GET(this->actor.params, 0, FLG_COREDONE)) { + } else if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { // FLG_COREDONE this->actionFunc = EnFd_Reappear; - } else if (PARAMS_GET(this->actor.params, 0, FLG_COREDEAD)) { + } else if (PARAMS_GET_NOSHIFT(this->actor.params, 14, 1)) { // FLG_COREDEAD this->actor.params = 0; this->spinTimer = 30; } diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 69343d461cd..cd805393dbf 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -155,7 +155,7 @@ void func_80A0E70C(EnFdFire* this, PlayState* play) { this->actor.velocity = velocity; this->actor.speedXZ = 0.0f; this->actor.bgCheckFlags &= ~BGCHECKFLAG_GROUND; - if (PARAMS_GET2(this->actor.params, 0, 0x8000)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { this->deathTimer = 200; this->actionFunc = EnFdFire_DanceTowardsPlayer; } else { @@ -179,7 +179,7 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play) { Vec3f pos; s16 idx; - idx = ((play->state.frames / 10) + PARAMS_GET2(this->actor.params, 0, 0x7FFF)) % ARRAY_COUNT(angles); + idx = ((play->state.frames / 10) + PARAMS_GET2(this->actor.params, 0, 15)) % ARRAY_COUNT(angles); pos = player->actor.world.pos; pos.x += 120.0f * sinf(angles[idx]); pos.z += 120.0f * cosf(angles[idx]); @@ -271,14 +271,14 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { gSPSegment( POLY_XLU_DISP++, 0x8, Gfx_TwoTexScroll(play->state.gfxCtx, 0, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->tile2Y, 0x20, 0x80)); - gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].r, - primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].g, - primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].b, - primColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].a); - gDPSetEnvColor(POLY_XLU_DISP++, envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].r, - envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].g, - envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].b, - envColors[PARAMS_GET2(this->actor.params, 0xF, 0x8000)].a); + gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[PARAMS_GET2(this->actor.params, 15, 1)].r, + primColors[PARAMS_GET2(this->actor.params, 15, 1)].g, + primColors[PARAMS_GET2(this->actor.params, 15, 1)].b, + primColors[PARAMS_GET2(this->actor.params, 15, 1)].a); + gDPSetEnvColor(POLY_XLU_DISP++, envColors[PARAMS_GET2(this->actor.params, 15, 1)].r, + envColors[PARAMS_GET2(this->actor.params, 15, 1)].g, + envColors[PARAMS_GET2(this->actor.params, 15, 1)].b, + envColors[PARAMS_GET2(this->actor.params, 15, 1)].a); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c index c75ab5bc1ac..5076bc5e6a5 100644 --- a/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c +++ b/src/overlays/actors/ovl_En_Floormas/z_en_floormas.c @@ -133,7 +133,7 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); this->zOffset = -1600; - invisble = PARAMS_GET(this->actor.params, 0, SPAWN_INVISIBLE); + invisble = PARAMS_GET_NOSHIFT(this->actor.params, 15, 1); // SPAWN_INVISIBLE // s16 cast needed this->actor.params &= (s16) ~(SPAWN_INVISIBLE); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index cac6a99d438..f4b8ddff55f 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -80,8 +80,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { s32 pad; EnGSwitch* this = (EnGSwitch*)thisx; - this->type = PARAMS_GET(this->actor.params, 0xC, 0xF); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + this->type = PARAMS_GET(this->actor.params, 12, 4); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); this->numEffects = EN_GSWITCH_EFFECT_COUNT; // "index" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); @@ -94,7 +94,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); sCollectedCount = 0; // Ideally the following two lines would be - // this->silverCount = PARAMS_GET(this->actor.params, 6, 0x3F); + // this->silverCount = PARAMS_GET(this->actor.params, 6, 6); this->silverCount = PARAMS_GET_NOMASK(this->actor.params, 6); this->silverCount &= 0x3F; // "maximum number of checks" diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 9a01ac5457c..def8da1580f 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -104,7 +104,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { // In Gerudo Valley this->actor.uncullZoneForward = ((play->sceneNum == SCENE_SPOT09) ? 1000.0f : 1200.0f); - switch (PARAMS_GET(this->actor.params, 0, 0xFF)) { + switch (PARAMS_GET(this->actor.params, 0, 8)) { case GE1_TYPE_GATE_GUARD: this->hairstyle = GE1_HAIR_SPIKY; @@ -330,7 +330,7 @@ void EnGe1_WaitTillOpened_GTGGuard(EnGe1* this, PlayState* play) { void EnGe1_Open_GTGGuard(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitTillOpened_GTGGuard; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -423,7 +423,7 @@ void EnGe1_WaitUntilGateOpened_GateOp(EnGe1* this, PlayState* play) { void EnGe1_OpenGate_GateOp(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitUntilGateOpened_GateOp; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -445,7 +445,7 @@ void EnGe1_SetupOpenGate_GateOp(EnGe1* this, PlayState* play) { } void EnGe1_CheckGate_GateOp(EnGe1* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { EnGe1_SetTalkAction(this, play, 0x6018, 100.0f, EnGe1_WaitGateOpen_GateOp); } else { EnGe1_SetTalkAction(this, play, 0x6017, 100.0f, EnGe1_SetupOpenGate_GateOp); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index adbfd144a77..b1bd57df191 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -133,7 +133,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.z = 0; this->actor.shape.rot.z = 0; - switch (PARAMS_GET2(this->actor.params, 0, 0xFF)) { + switch (PARAMS_GET2(this->actor.params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); if (EnGe2_CheckCarpentersFreed()) { @@ -165,7 +165,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; this->walkDirection = this->actor.world.rot.y; - this->walkDuration = PARAMS_GET2(this->actor.params, 8, 0xFF00) * 10; + this->walkDuration = PARAMS_GET2(this->actor.params, 8, 8) * 10; } void EnGe2_Destroy(Actor* thisx, PlayState* play) { @@ -425,7 +425,7 @@ void EnGe2_LookAtPlayer(EnGe2* this, PlayState* play) { void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - switch (PARAMS_GET2(this->actor.params, 0, 0xFF)) { + switch (PARAMS_GET2(this->actor.params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN); break; @@ -520,7 +520,7 @@ void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (Actor_ProcessTalkRequest(&this->actor, play)) { - if (PARAMS_GET2(this->actor.params, 0, 0xFF) == GE2_TYPE_PATROLLING) { + if (PARAMS_GET2(this->actor.params, 0, 8) == GE2_TYPE_PATROLLING) { this->actor.speedXZ = 0.0f; EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER); } @@ -575,7 +575,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { EnGe2_SetupCapturePlayer(this, play); } - if ((PARAMS_GET2(this->actor.params, 0, 0xFF) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { + if ((PARAMS_GET2(this->actor.params, 0, 8) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { // "Discovered!" osSyncPrintf(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); EnGe2_SetupCapturePlayer(this, play); @@ -583,7 +583,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } if (!(this->stateFlags & GE2_STATE_KO)) { - paramsType = PARAMS_GET2(this->actor.params, 0, 0xFF); // Not necessary, but looks a bit nicer + paramsType = PARAMS_GET2(this->actor.params, 0, 8); // Not necessary, but looks a bit nicer if ((paramsType == GE2_TYPE_PATROLLING) || (paramsType == GE2_TYPE_STATIONARY)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 7692398cdda..0d50bd8d263 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -228,7 +228,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; thisx->naviEnemyId = NAVI_ENEMY_GERUDO_THIEF; - this->keyFlag = PARAMS_GET_NOSHIFT(thisx->params, 8, 0xFF); + this->keyFlag = PARAMS_GET_NOSHIFT(thisx->params, 8, 8); thisx->params &= 0xFF; this->blinkState = 0; this->unkFloat = 10.0f; diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index 4d510433c36..bd38620ad00 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -91,7 +91,7 @@ void EnGo_SetupAction(EnGo* this, EnGoActionFunc actionFunc) { u16 EnGo_GetTextID(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); - switch (PARAMS_GET_NOSHIFT(thisx->params, 4, 0xF)) { + switch (PARAMS_GET_NOSHIFT(thisx->params, 4, 4)) { case 0x90: if (gSaveContext.bgsFlag) { return 0x305E; @@ -351,7 +351,7 @@ s32 func_80A3ED24(PlayState* play, EnGo* this, struct_80034A14_arg1* arg2, f32 a void EnGo_ChangeAnim(EnGo* this, s32 index) { Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, - sAnimationInfo[index].playSpeed * (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f), 0.0f, + sAnimationInfo[index].playSpeed * (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f), 0.0f, Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames); } @@ -360,17 +360,17 @@ s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { if (((this->actor.params) & 0xF0) == 0x90) { return true; } else if (play->sceneNum == SCENE_HIDAN && !Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && LINK_IS_ADULT && - PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x10) { + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10) { return true; - } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x00) { + } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_ADULT && PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x00) { return true; } else if (play->sceneNum == SCENE_SPOT16 && LINK_IS_CHILD && - (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x20 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x30 || - PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x40)) { + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x20 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x30 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40)) { return true; } else if (play->sceneNum == SCENE_SPOT18 && LINK_IS_CHILD && - (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x50 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x60 || - PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x70)) { + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x50 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x60 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x70)) { return true; } else { return false; @@ -378,7 +378,7 @@ s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { } f32 EnGo_GetGoronSize(EnGo* this) { - switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF)) { + switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4)) { case 0x00: return 10.0f; case 0x20: @@ -428,7 +428,7 @@ s32 EnGo_IsCameraModified(EnGo* this, PlayState* play) { } xyzDistSq = (this->actor.scale.x / 0.01f) * 10000.0f; - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); xyzDistSq *= 4.8f; } @@ -469,11 +469,11 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { f32 xDist; f32 zDist; - if (PARAMS_GET(this->actor.params, 0, 0xF) == 15) { + if (PARAMS_GET(this->actor.params, 0, 4) == 15) { return false; } - path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xF)]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 4)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->unk_218; xDist = pointPos->x - this->actor.world.pos.x; @@ -486,7 +486,7 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { this->unk_218 = 0; } - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x00) { return true; } else if (Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8))) { return true; @@ -504,10 +504,10 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) { Path* path; Vec3s* pointPos; - if (PARAMS_GET(this->actor.params, 0, 0xF) == 0xF) { + if (PARAMS_GET(this->actor.params, 0, 4) == 0xF) { return false; } else { - path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xF)]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 4)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += (path->count - 1); this->actor.world.pos.x = pointPos->x; @@ -581,18 +581,18 @@ void func_80A3F908(EnGo* this, PlayState* play) { float1 = (this->collider.dim.radius + 30.0f); float1 *= (this->actor.scale.x / 0.01f); - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { float1 *= 4.8f; } - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { isUnkCondition = func_80A3ED24(play, this, &this->unk_1E0, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } else { isUnkCondition = func_800343CC(play, &this->actor, &this->unk_1E0.unk_00, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } - if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) && (isUnkCondition == true)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) && (isUnkCondition == true)) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_SWORD_BROKEN) { if (func_8002F368(play) == EXCH_ITEM_SWORD_BROKEN) { if (GET_INFTABLE(INFTABLE_B4)) { @@ -635,7 +635,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { return; } - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) && (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) && (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90)) { this->actor.flags &= ~ACTOR_FLAG_4; this->actor.flags &= ~ACTOR_FLAG_5; } @@ -645,7 +645,7 @@ void EnGo_Init(Actor* thisx, PlayState* play) { this->unk_1E0.unk_00 = 0; this->actor.gravity = -1.0f; - switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF)) { + switch (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4)) { case 0x00: Actor_SetScale(&this->actor, 0.008f); if (CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { @@ -770,10 +770,10 @@ void EnGo_CurledUp(EnGo* this, PlayState* play) { &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); this->skelAnime.playSpeed = 0.1f; - this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, EnGo_WakeUp); - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); } } @@ -783,7 +783,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -793,7 +793,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90) { this->unk_212 = 30; return; } @@ -814,7 +814,7 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { void func_80A40494(EnGo* this, PlayState* play) { f32 frame; - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -836,7 +836,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { f32 frame; lastFrame = Animation_GetLastFrame(&gGoronAnim_004930); - Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; @@ -846,7 +846,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { this->skelAnime.curFrame = lastFrame; this->skelAnime.playSpeed = 0.0f; this->unk_212 = Rand_S16Offset(30, 30); - if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40) && !GET_INFTABLE(INFTABLE_EB)) { EnGo_SetupAction(this, func_80A40B1C); } else { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); @@ -855,7 +855,7 @@ void func_80A405CC(EnGo* this, PlayState* play) { } void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { - if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) && (this->unk_1E0.unk_00 == 2)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) && (this->unk_1E0.unk_00 == 2)) { if (gSaveContext.bgsFlag) { this->unk_1E0.unk_00 = 0; } else { @@ -874,7 +874,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { EnGo_GetItem(this, play); } } - } else if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0) && (this->unk_1E0.unk_00 == 2)) { + } else if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0) && (this->unk_1E0.unk_00 == 2)) { EnGo_SetupAction(this, EnGo_GetItem); play->msgCtx.stateTimer = 4; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -882,7 +882,7 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { if ((DECR(this->unk_212) == 0) && !EnGo_IsCameraModified(this, play)) { EnGo_ReverseAnimation(this); this->skelAnime.playSpeed = -0.1f; - this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f; + this->skelAnime.playSpeed *= PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f; EnGo_SetupAction(this, func_80A408D8); } } @@ -892,7 +892,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90 ? 0.5f : 1.0f) * -1.0f, + Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -1.0f, 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -901,7 +901,7 @@ void func_80A408D8(EnGo* this, PlayState* play) { } else { this->skelAnime.curFrame = 12.0f; this->skelAnime.playSpeed = 0.0f; - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90) { this->unk_212 = 30; return; } @@ -952,7 +952,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { EnGo_SetupAction(this, func_80A40C78); } else { this->unk_20C = 0; - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) { if (INV_CONTENT(ITEM_TRADE_ADULT) == ITEM_CLAIM_CHECK) { getItemId = GI_SWORD_BGS; this->unk_20C = 1; @@ -965,7 +965,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { } } - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0) { getItemId = GI_TUNIC_GORON; } @@ -978,7 +978,7 @@ void EnGo_GetItem(EnGo* this, PlayState* play) { void func_80A40C78(EnGo* this, PlayState* play) { if (this->unk_1E0.unk_00 == 3) { EnGo_SetupAction(this, EnGo_BiggoronActionFunc); - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) != 0x90) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) != 0x90) { this->unk_1E0.unk_00 = 0; } else if (this->unk_20C) { this->unk_1E0.unk_00 = 0; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 531d9e2f6af..88d05edf83c 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -32,13 +32,13 @@ INFTABLE_10F - (not on cloud modding) INFTABLE_11E - Bomb bag upgrade obtained from rolling Goron EnGo -pathIndex: PARAMS_GET2(this->actor.params, 0, 0xF) -Goron: PARAMS_GET2(this->actor.params, 0, 0xF0) +pathIndex: PARAMS_GET2(this->actor.params, 0, 4) +Goron: PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) EnGo2 -PARAMS_GET2(this->actor.params, 5, 0x3E0) -PARAMS_GET2(this->actor.params, 0xA, 0xFC00) - Gorons in Fire Temple -PARAMS_GET2(this->actor.params, 0, 0x1F) +PARAMS_GET2(this->actor.params, 5, 5) +PARAMS_GET2(this->actor.params, 10, 6) - Gorons in Fire Temple +PARAMS_GET2(this->actor.params, 0, 5) Gorons only move when this->unk_194.unk_00 == 0 */ @@ -300,7 +300,7 @@ s32 EnGo2_GetDialogState(EnGo2* this, PlayState* play) { } u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) { - switch (PARAMS_GET2(this->actor.params, 0xA, 0xFC00)) { + switch (PARAMS_GET2(this->actor.params, 10, 6)) { case 3: return 0x3069; case 5: @@ -645,7 +645,7 @@ s16 EnGo2_GetStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronFireGeneric(PlayState* play, EnGo2* this) { - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 0xA, 0xFC00))) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 10, 6))) { return 0x3071; } else { return 0x3051; @@ -745,7 +745,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { if (faceReaction != 0) { return faceReaction; } else { - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetTextIdGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -783,7 +783,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { s16 EnGo2_GetState(PlayState* play, Actor* thisx) { EnGo2* this = (EnGo2*)thisx; - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetStateGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -821,9 +821,9 @@ s16 EnGo2_GetState(PlayState* play, Actor* thisx) { } s32 func_80A44790(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BIGGORON && PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_ROLLING_BIG) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BIGGORON && PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) { return func_800343CC(play, &this->actor, &this->unk_194.unk_00, this->unk_218, EnGo2_GetTextId, EnGo2_GetState); - } else if ((PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) && + } else if ((PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { return false; } else { @@ -841,14 +841,14 @@ s32 func_80A44790(EnGo2* this, PlayState* play) { } void EnGo2_SetColliderDim(EnGo2* this) { - u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); + u8 index = PARAMS_GET2(this->actor.params, 0, 5); this->collider.dim.radius = D_80A4816C[index].radius; this->collider.dim.height = D_80A4816C[index].height; } void EnGo2_SetShape(EnGo2* this) { - u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); + u8 index = PARAMS_GET2(this->actor.params, 0, 5); this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10; Actor_SetScale(&this->actor, D_80A481F8[index].scale); @@ -864,10 +864,10 @@ void EnGo2_CheckCollision(EnGo2* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - xzDist = D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].xzDist; + xzDist = D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].xzDist; pos.x += (s16)(xzDist * Math_SinS(this->actor.shape.rot.y)); pos.z += (s16)(xzDist * Math_CosS(this->actor.shape.rot.y)); - pos.y += D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].yDist; + pos.y += D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].yDist; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -885,7 +885,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 arg2; - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { return false; } else { if ((this->actionFunc != EnGo2_SlowRolling) && (this->actionFunc != EnGo2_ReverseRolling) && @@ -965,11 +965,11 @@ s32 func_80A44D84(EnGo2* this) { s32 EnGo2_IsWakingUp(EnGo2* this) { s16 yawDiff; - f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; - f32 yDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 yDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; s16 yawDiffAbs; - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { this->actor.flags &= ~ACTOR_FLAG_0; return false; @@ -1006,7 +1006,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { } if (this->unk_59C >= 2) { - Audio_PlayActorSound2(&this->actor, PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG + Audio_PlayActorSound2(&this->actor, PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? NA_SE_EN_GOLON_LAND_BIG : NA_SE_EN_DODO_M_GND); } @@ -1030,7 +1030,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { u16 textId; - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (gSaveContext.bgsFlag) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { this->actor.textId = 0x3003; @@ -1093,7 +1093,7 @@ void func_80A45288(EnGo2* this, PlayState* play) { if (this->actionFunc != EnGo2_GoronFireGenericAction) { this->unk_194.unk_18 = player->actor.world.pos; - this->unk_194.unk_14 = D_80A482D8[PARAMS_GET2(this->actor.params, 0, 0x1F)][((void)0, gSaveContext.linkAge)]; + this->unk_194.unk_14 = D_80A482D8[PARAMS_GET2(this->actor.params, 0, 5)][((void)0, gSaveContext.linkAge)]; func_80034A14(&this->actor, &this->unk_194, 4, this->unk_26E); } if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) { @@ -1126,7 +1126,7 @@ void EnGo2_RollForward(EnGo2* this) { } void func_80A454CC(EnGo2* this) { - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: case GORON_DMT_DC_ENTRANCE: case GORON_CITY_ENTRANCE: @@ -1147,8 +1147,8 @@ void func_80A454CC(EnGo2* this) { } f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { - f32 yDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; - s32 index = PARAMS_GET2(this->actor.params, 0, 0x1F); + f32 yDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + s32 index = PARAMS_GET2(this->actor.params, 0, 5); if (index == GORON_CITY_LINK && (fabsf(this->actor.yDistToPlayer) < yDist) && (this->actor.xzDistToPlayer < 400.0f)) { @@ -1161,7 +1161,7 @@ f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN]; - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (EnGo2_IsWakingUp(this)) { Camera_ChangeSetting(mainCam, CAM_SET_DIRECTED_YAW); func_8005AD1C(mainCam, 4); @@ -1171,9 +1171,9 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { } } - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_FIRE_GENERIC || PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG || - PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_STAIRWELL || PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON || - PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_MARKET_BAZAAR) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_FIRE_GENERIC || PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || + PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_STAIRWELL || PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON || + PARAMS_GET2(this->actor.params, 0, 5) == GORON_MARKET_BAZAAR) { return true; } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { return true; @@ -1197,7 +1197,7 @@ void EnGo2_DefaultWakingUp(EnGo2* this) { } void EnGo2_WakingUp(EnGo2* this) { - f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; s32 isTrue = true; xyzDist = SQ(xyzDist); @@ -1220,7 +1220,7 @@ void EnGo2_BiggoronWakingUp(EnGo2* this) { } void EnGo2_SelectGoronWakingUp(EnGo2* this) { - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_DMT_BOMB_FLOWER: this->isAwake = true; this->unk_26E = EnGo2_IsWakingUp(this) ? 2 : 1; @@ -1275,7 +1275,7 @@ void EnGo2_EyeMouthTexState(EnGo2* this) { void EnGo2_SitDownAnimation(EnGo2* this) { if ((this->skelAnime.playSpeed != 0.0f) && (this->skelAnime.animation == &gGoronAnim_004930)) { if (this->skelAnime.playSpeed > 0.0f && this->skelAnime.curFrame == 14.0f) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_SIT_DOWN); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60); @@ -1293,7 +1293,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) { } void EnGo2_GetDustData(EnGo2* this, s32 index2) { - s32 index1 = PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG ? 1 : 0; + s32 index1 = PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? 1 : 0; EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2]; EnGo2_SpawnDust(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep, @@ -1301,7 +1301,7 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) { } void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { this->actor.flags &= ~ACTOR_FLAG_0; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = -0.5f; @@ -1318,13 +1318,13 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { void EnGo2_WakeUp(EnGo2* this, PlayState* play) { if (this->skelAnime.playSpeed == 0.0f) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOLON_WAKE_UP); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } } - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = 0.5f; @@ -1345,7 +1345,7 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) { } void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_ROLLING_BIG || PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_LINK) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_LINK) { this->collider.info.bumperFlags = BUMP_ON; this->actor.speedXZ = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f; } else { @@ -1361,8 +1361,8 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { void EnGo2_StopRolling(EnGo2* this, PlayState* play) { EnBom* bomb; - if ((PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_ROLLING_BIG) && (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_LINK)) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_ROLLING_SMALL) { + if ((PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) && (PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_LINK)) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_ROLLING_SMALL) { bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bomb != NULL) { @@ -1382,20 +1382,20 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) { } s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_FIRE_GENERIC) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) { return false; } // shaking curled up this->actor.world.pos.x += (play->state.frames & 1) ? 1.0f : -1.0f; - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 0xA, 0xFC00))) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 10, 6))) { return true; } return false; } s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_BOMB_FLOWER || this->unk_194.unk_00 != 2) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BOMB_FLOWER || this->unk_194.unk_00 != 2) { return false; } @@ -1408,7 +1408,7 @@ s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { } s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_ROLLING_BIG || (this->unk_194.unk_00 != 2)) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG || (this->unk_194.unk_00 != 2)) { return false; } this->unk_194.unk_00 = 0; @@ -1418,7 +1418,7 @@ s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { } s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_FIRE_GENERIC || this->unk_194.unk_00 == 0) { + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_FIRE_GENERIC || this->unk_194.unk_00 == 0) { return false; } this->actionFunc = EnGo2_GoronFireGenericAction; @@ -1426,7 +1426,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { } s32 EnGo2_IsGoronLinkReversing(EnGo2* this) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || + if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || !EnGo2_IsWakingUp(this)) { return false; } @@ -1449,7 +1449,7 @@ s32 EnGo2_IsRolling(EnGo2* this) { void EnGo2_GoronLinkAnimation(EnGo2* this, PlayState* play) { s32 animation = ARRAY_COUNT(sAnimationInfo); - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_CITY_LINK) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_LINK) { if ((this->actor.textId == 0x3035 && this->unk_20C == 0) || (this->actor.textId == 0x3036 && this->unk_20C == 0)) { if (this->skelAnime.animation != &gGoronAnim_000D5C) { @@ -1502,7 +1502,7 @@ void EnGo2_GoronFireClearCamera(EnGo2* this, PlayState* play) { void EnGo2_BiggoronAnimation(EnGo2* this) { if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_SWORD_BROKEN && INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYEDROPS && - PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON && this->unk_194.unk_00 == 0) { + PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON && this->unk_194.unk_00 == 0) { if (DECR(this->animTimer) == 0) { this->animTimer = Rand_S16Offset(30, 30); func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_EYE_BIG, 60); @@ -1521,7 +1521,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); // Not GORON_CITY_ROLLING_BIG, GORON_CITY_LINK, GORON_DMT_BIGGORON - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_FIRE_GENERIC: case GORON_DMT_BOMB_FLOWER: case GORON_DMT_ROLLING_SMALL: @@ -1549,8 +1549,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->waypoint = 0; this->unk_216 = this->actor.shape.rot.z; this->unk_26E = 1; - this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 5, 0x3E0), 0x1F); - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 5, 5), 0x1F); + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_CITY_ENTRANCE: case GORON_CITY_ISLAND: case GORON_CITY_LOWEST_FLOOR: @@ -1579,18 +1579,18 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { } } else { CLEAR_INFTABLE(INFTABLE_10C); - this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].height * 0.6f); EnGo2_SetupRolling(this, play); this->isAwake = true; } break; case GORON_CITY_ROLLING_BIG: case GORON_DMT_ROLLING_SMALL: - this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 0x1F)].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].height * 0.6f); EnGo2_SetupRolling(this, play); break; case GORON_FIRE_GENERIC: - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 0xA, 0xFC00))) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 10, 6))) { Actor_Kill(&this->actor); } else { this->isAwake = true; @@ -1626,12 +1626,12 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) { } void EnGo2_CurledUp(EnGo2* this, PlayState* play) { - u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); + u8 index = PARAMS_GET2(this->actor.params, 0, 5); s16 height; s32 quake; if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { quake = Quake_Add(GET_ACTIVE_CAM(play), 3); Quake_SetSpeed(quake, -0x3CB0); Quake_SetQuakeValues(quake, 8, 0, 0, 0); @@ -1654,13 +1654,13 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) { this->isAwake = false; EnGo2_WakeUp(this, play); } - if ((PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { + if ((PARAMS_GET2(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { EnGo2_WakeUp(this, play); } } void func_80A46B40(EnGo2* this, PlayState* play) { - u8 index = PARAMS_GET2(this->actor.params, 0, 0x1F); + u8 index = PARAMS_GET2(this->actor.params, 0, 5); f32 height; if (this->unk_211 == true) { @@ -1677,7 +1677,7 @@ void func_80A46B40(EnGo2* this, PlayState* play) { } } else { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (PARAMS_GET2(this->actor.params, 0, 0x1F) == GORON_DMT_BIGGORON) { + if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { this->actor.flags |= ACTOR_FLAG_0; } func_80A454CC(this); @@ -1715,7 +1715,7 @@ void EnGo2_GoronRollingBigContinueRolling(EnGo2* this, PlayState* play) { void EnGo2_ContinueRolling(EnGo2* this, PlayState* play) { f32 float1 = 1000.0f; - if ((PARAMS_GET2(this->actor.params, 0, 0x1F) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && + if ((PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && DECR(this->animTimer) == 0) { this->actionFunc = EnGo2_SlowRolling; this->actor.speedXZ *= 0.5f; // slowdown @@ -1736,7 +1736,7 @@ void EnGo2_SlowRolling(EnGo2* this, PlayState* play) { EnGo2_GetDustData(this, 3); } orientation = EnGo2_Orient(this, play); - index = PARAMS_GET2(this->actor.params, 0, 0x1F); + index = PARAMS_GET2(this->actor.params, 0, 5); if (index != GORON_CITY_LINK) { if ((index == GORON_DMT_ROLLING_SMALL) && (orientation == 1) && (this->waypoint == 0)) { EnGo2_StopRolling(this, play); @@ -1755,7 +1755,7 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) { if (EnGo2_IsRollingOnGround(this, 4, 8.0f, 0)) { EnGo2_GetDustData(this, 0); if (this->unk_59C == 0) { - switch (PARAMS_GET2(this->actor.params, 0, 0x1F)) { + switch (PARAMS_GET2(this->actor.params, 0, 5)) { case GORON_CITY_LINK: this->goronState = 0; this->actionFunc = EnGo2_GoronLinkStopRolling; @@ -1937,9 +1937,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { } else { this->animTimer = 0; this->actor.speedXZ = 0.0f; - if ((PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 1) && (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 2) && - (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 4) && (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 5) && - (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 9) && (PARAMS_GET2(this->actor.params, 0xA, 0xFC00) != 11)) { + if ((PARAMS_GET2(this->actor.params, 10, 6) != 1) && (PARAMS_GET2(this->actor.params, 10, 6) != 2) && + (PARAMS_GET2(this->actor.params, 10, 6) != 4) && (PARAMS_GET2(this->actor.params, 10, 6) != 5) && + (PARAMS_GET2(this->actor.params, 10, 6) != 9) && (PARAMS_GET2(this->actor.params, 10, 6) != 11)) { this->goronState++; } this->goronState++; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 4b36a9e5615..1dce95ce473 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -136,7 +136,7 @@ void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; Vec3s* nextPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3f nextPosF; @@ -148,8 +148,8 @@ void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest) { - s16 loopMode = PARAMS_GET(this->actor.params, 8, 3); - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + s16 loopMode = PARAMS_GET(this->actor.params, 8, 2); + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; s16 prevWaypoint = this->currentWaypoint - this->pathDirection; Vec3s* prevPointPos; Vec3s* currentPointPos; @@ -176,7 +176,7 @@ void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest } void EnGoroiw_CheckEndOfPath(EnGoroiwa* this) { - s16 loopMode = PARAMS_GET(this->actor.params, 8, 3); + s16 loopMode = PARAMS_GET(this->actor.params, 8, 2); if (this->nextWaypoint < 0) { if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY || loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK) { @@ -214,14 +214,14 @@ void EnGoroiwa_ReverseDirection(EnGoroiwa* this) { } void EnGoroiwa_InitPath(EnGoroiwa* this, PlayState* play) { - this->endWaypoint = play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)].count - 1; + this->endWaypoint = play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)].count - 1; this->currentWaypoint = 0; this->nextWaypoint = 1; this->pathDirection = 1; } void EnGoroiwa_TeleportToWaypoint(EnGoroiwa* this, PlayState* play, s32 waypoint) { - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint; this->actor.world.pos.x = pointPos->x; @@ -236,7 +236,7 @@ void EnGoroiwa_InitRotation(EnGoroiwa* this) { s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -300,7 +300,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { Math_StepToF(&this->actor.speedXZ, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); func_8002D868(&this->actor); - path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; result = true; result &= Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)); @@ -310,7 +310,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { } s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; s32 pad; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -342,7 +342,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Math_StepToF(&this->actor.velocity.y, (R_EN_GOROIWA_SPEED * 0.01f) * 0.5f, 0.18f); @@ -353,7 +353,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xFF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; f32 nextPointY; f32 thisY; @@ -471,7 +471,7 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_NextWaypoint(EnGoroiwa* this, PlayState* play) { - s16 loopMode = PARAMS_GET(this->actor.params, 8, 3); + s16 loopMode = PARAMS_GET(this->actor.params, 8, 2); EnGoroiwa_SetNextWaypoint(this); @@ -534,7 +534,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnGoroiwa_InitCollider(this, play); - pathIdx = PARAMS_GET(this->actor.params, 0, 0xFF); + pathIdx = PARAMS_GET(this->actor.params, 0, 8); if (pathIdx == 0xFF) { // "Error: Invalid arg_data" osSyncPrintf("Error : arg_data が不正(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 1033, @@ -559,7 +559,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_SetupRoll(this); // "(Goroiwa)" osSyncPrintf("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, - PARAMS_GET(this->actor.params, 0, 0xFF), PARAMS_GET(this->actor.params, 8, 3), PARAMS_GET(this->actor.params, 10, 1), + PARAMS_GET(this->actor.params, 0, 8), PARAMS_GET(this->actor.params, 8, 2), PARAMS_GET(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } @@ -605,7 +605,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { this->collisionDisabledTimer = 50; } } else if (moveFuncs[PARAMS_GET(this->actor.params, 10, 1)](this, play)) { - loopMode = PARAMS_GET(this->actor.params, 8, 3); + loopMode = PARAMS_GET(this->actor.params, 8, 2); if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK && (this->nextWaypoint == 0 || this->nextWaypoint == this->endWaypoint)) { EnGoroiwa_SpawnFragments(this, play); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 0b9ce12ea78..ff1bb4f4dae 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -123,7 +123,7 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) { if (Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x2054: - this->actor.textId = PARAMS_GET(this->actor.params, 0, 0xFF) + 0x400; + this->actor.textId = PARAMS_GET(this->actor.params, 0, 8) + 0x400; ret = 1; break; default: @@ -163,7 +163,7 @@ void func_80A4E470(EnGs* this, PlayState* play) { Audio_PlayActorSound2(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } this->unk_19D = 0; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_01) { player->stateFlags2 |= PLAYER_STATE2_23; } @@ -490,7 +490,7 @@ void func_80A4F700(EnGs* this, PlayState* play) { } void func_80A4F734(EnGs* this, PlayState* play) { - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { func_80A4E470(this, play); } } diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 3227bd7b35c..86ec0ffdf42 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -72,8 +72,8 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); - this->type = PARAMS_GET(this->actor.params, 8, 0xFF); - this->path = PARAMS_GET(this->actor.params, 0, 0xFF); + this->type = PARAMS_GET(this->actor.params, 8, 8); + this->path = PARAMS_GET(this->actor.params, 0, 8); for (i = 0; i < ARRAY_COUNT(sAnimParamsInit[0]); i++) { this->animParams[i] = sAnimParamsInit[this->type][i]; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 5af3d5fa511..48a0a5f04bb 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -87,7 +87,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { EnHeishi2* this = (EnHeishi2*)thisx; Actor_SetScale(&this->actor, 0.01f); - this->type = PARAMS_GET(this->actor.params, 0, 0xFF); + this->type = PARAMS_GET(this->actor.params, 0, 8); this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->type == 6) || (this->type == 9)) { @@ -148,7 +148,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { break; } - this->unk_2F0 = PARAMS_GET(this->actor.params, 8, 0xFF); + this->unk_2F0 = PARAMS_GET(this->actor.params, 8, 8); osSyncPrintf("\n\n"); // "Soldier Set 2 Completed!" osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); @@ -156,7 +156,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); // "Message completed!" osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, - PARAMS_GET(this->actor.params, 8, 0xF)); + PARAMS_GET(this->actor.params, 8, 4)); } } diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 93815233ea2..af98aaa5d9b 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -59,7 +59,7 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { EnHeishi4* this = (EnHeishi4*)thisx; Actor_SetScale(thisx, 0.01f); - this->type = PARAMS_GET(thisx->params, 0, 0xFF); + this->type = PARAMS_GET(thisx->params, 0, 8); thisx->colChkInfo.mass = MASS_IMMOVABLE; this->pos = thisx->world.pos; thisx->targetMode = 6; @@ -93,11 +93,11 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80A56544; break; } - this->unk_27C = PARAMS_GET(thisx->params, 8, 0xFF); + this->unk_27C = PARAMS_GET(thisx->params, 8, 8); osSyncPrintf("\n\n"); osSyncPrintf(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, thisx->params); osSyncPrintf(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了!\t ☆☆☆☆☆ %d\n" VT_RST, this->type); - osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET(thisx->params, 8, 0xF)); + osSyncPrintf(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET(thisx->params, 8, 4)); osSyncPrintf("\n\n"); } diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 2b27ff945f1..c36a50c543f 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -83,7 +83,7 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Actor_SetTextWithPrefix(play, &this->actor, PARAMS_GET(this->actor.params, 8, 0xFF)); + Actor_SetTextWithPrefix(play, &this->actor, PARAMS_GET(this->actor.params, 8, 8)); this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; sPuzzleCounter = 0; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.c b/src/overlays/actors/ovl_En_Holl/z_en_holl.c index a85d11776d8..548b9bf44d5 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.c +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.c @@ -82,7 +82,7 @@ s32 EnHoll_IsKokiriSetup8(void) { void EnHoll_ChooseAction(EnHoll* this) { s32 action; - action = PARAMS_GET(this->actor.params, 6, 7); + action = PARAMS_GET(this->actor.params, 6, 3); EnHoll_SetupAction(this, sActionFuncs[action]); if (action != 0) { this->actor.draw = NULL; @@ -100,7 +100,7 @@ void EnHoll_Init(Actor* thisx, PlayState* play) { } void EnHoll_Destroy(Actor* thisx, PlayState* play) { - s32 transitionActorIdx = PARAMS_GET_NOMASK((u16)thisx->params, 0xA); + s32 transitionActorIdx = PARAMS_GET_NOMASK((u16)thisx->params, 10); TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIdx]; transitionEntry->id = -transitionEntry->id; @@ -129,7 +129,7 @@ void func_80A58DD4(EnHoll* this, PlayState* play) { absZ = fabsf(vec.z); if (vec.y > PLANE_Y_MIN && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH && absZ < sHorizTriggerDists[phi_t0][0]) { - transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 10); if (absZ > sHorizTriggerDists[phi_t0][1]) { if (play->roomCtx.prevRoom.num >= 0 && play->roomCtx.status == 0) { this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[this->side].room; @@ -162,12 +162,12 @@ void func_80A59014(EnHoll* this, PlayState* play) { f32 absZ; func_8002DBD0(&this->actor, &vec, (useViewEye) ? &play->view.eye : &player->actor.world.pos); - planeHalfWidth = (PARAMS_GET(this->actor.params, 6, 7) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; + planeHalfWidth = (PARAMS_GET(this->actor.params, 6, 3) == 6) ? PLANE_HALFWIDTH : PLANE_HALFWIDTH_2; temp = EnHoll_IsKokiriSetup8(); if (temp || (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < planeHalfWidth && (absZ = fabsf(vec.z), 100.0f > absZ && absZ > 50.0f))) { - s32 transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); + s32 transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 10); s32 side = (vec.z < 0.0f) ? 0 : 1; TransitionActorEntry* transitionEntry = &play->transiActorCtx.list[transitionActorIdx]; s32 room = transitionEntry->sides[side].room; @@ -190,7 +190,7 @@ void func_80A591C0(EnHoll* this, PlayState* play) { s32 transitionActorIdx; if (this->actor.xzDistToPlayer < 500.0f && absY < 700.0f) { - transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 10); if (absY < 95.0f) { play->unk_11E18 = 0xFF; } else if (absY > 605.0f) { @@ -228,7 +228,7 @@ void func_80A593A4(EnHoll* this, PlayState* play) { play->unk_11E18 = (200.0f - absY) * 1.7f; } if (absY > 50.0f) { - transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 10); side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && @@ -252,7 +252,7 @@ void func_80A59520(EnHoll* this, PlayState* play) { if (this->actor.xzDistToPlayer < 120.0f) { absY = fabsf(this->actor.yDistToPlayer); if (absY < 200.0f && absY > 50.0f) { - transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 10); side = (0.0f < this->actor.yDistToPlayer) ? 0 : 1; this->actor.room = play->transiActorCtx.list[transitionActorIdx].sides[side].room; if (this->actor.room != play->roomCtx.curRoom.num && @@ -271,7 +271,7 @@ void func_80A59618(EnHoll* this, PlayState* play) { s32 side; s32 transitionActorIdx; - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { if (this->unk_14F != 0) { play->unk_11E18 = 0; this->unk_14F = 0; @@ -281,7 +281,7 @@ void func_80A59618(EnHoll* this, PlayState* play) { absZ = fabsf(vec.z); if (PLANE_Y_MIN < vec.y && vec.y < PLANE_Y_MAX && fabsf(vec.x) < PLANE_HALFWIDTH_2 && absZ < 100.0f) { this->unk_14F = 1; - transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 0xA); + transitionActorIdx = PARAMS_GET_NOMASK((u16)this->actor.params, 10); play->unk_11E18 = 0xFF - (s32)((absZ - 50.0f) * 5.9f); if (play->unk_11E18 >= 0x100) { play->unk_11E18 = 0xFF; diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 71def087619..d8161fce54d 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -259,7 +259,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { Skin_Init(play, &this->skin, &gHorseNormalSkel, &gHorseNormalIdleAnim); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); } - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 0xF) == 0x10 && PARAMS_GET(this->actor.params, 0, 0xF) != 0xF) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10 && PARAMS_GET(this->actor.params, 0, 4) != 0xF) { func_80A6B91C(this, play); } else { func_80A6BC48(this); @@ -286,7 +286,7 @@ void func_80A6B91C(EnHorseNormal* this, PlayState* play) { } void EnHorseNormal_FollowPath(EnHorseNormal* this, PlayState* play) { - Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 0xF)]; + Path* path = &play->setupPathList[PARAMS_GET(this->actor.params, 0, 4)]; Vec3s* pointPos = SEGMENTED_TO_VIRTUAL(path->points); f32 dx; f32 dz; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 7f6d4a5bc72..9c8be3dea84 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -352,9 +352,9 @@ static EnHyInit2Info sInit2Info[] = { }; s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) { - u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].headInfoIndex; - u8 skelInfoIndex2 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].skelInfoIndex2; - u8 skelInfoIndex1 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].skelInfoIndex1; + u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].headInfoIndex; + u8 skelInfoIndex2 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex2; + u8 skelInfoIndex1 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex1; this->objBankIndexSkel1 = Object_GetIndex(&play->objectCtx, sSkeletonInfo[skelInfoIndex1].objectId); if (this->objBankIndexSkel1 < 0) { @@ -417,16 +417,16 @@ void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) { u16 func_80A6F810(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); EnHy* this = (EnHy*)thisx; - u16 textId = Text_GetFaceReaction(play, PARAMS_GET2(this->actor.params, 0, 0x7F) + 37); + u16 textId = Text_GetFaceReaction(play, PARAMS_GET2(this->actor.params, 0, 7) + 37); if (textId != 0) { - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_5) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_5) { player->exchangeItemId = EXCH_ITEM_BLUE_FIRE; } return textId; } - switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { + switch (PARAMS_GET2(this->actor.params, 0, 7)) { case ENHY_TYPE_AOB: if (play->sceneNum == SCENE_KAKARIKO) { return (this->unk_330 & EVENTCHKINF_6B_MASK) ? 0x508D : (GET_INFTABLE(INFTABLE_CB) ? 0x508C : 0x508B); @@ -673,7 +673,7 @@ s16 func_80A70058(PlayState* play, Actor* thisx) { void EnHy_UpdateEyes(EnHy* this) { if (DECR(this->nextEyeIndexTimer) == 0) { - u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].headInfoIndex; + u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].headInfoIndex; this->curEyeIndex++; if ((sHeadInfo[headInfoIndex].eyeTextures != NULL) && @@ -685,14 +685,14 @@ void EnHy_UpdateEyes(EnHy* this) { } void EnHy_InitCollider(EnHy* this) { - u8 type = PARAMS_GET2(this->actor.params, 0, 0x7F); + u8 type = PARAMS_GET2(this->actor.params, 0, 7); this->collider.dim.radius = sColliderInfo[type].radius; this->collider.dim.height = sColliderInfo[type].height; } void EnHy_InitSetProperties(EnHy* this) { - u8 type = PARAMS_GET2(this->actor.params, 0, 0x7F); + u8 type = PARAMS_GET2(this->actor.params, 0, 7); this->actor.shape.shadowScale = sInit2Info[type].shadowScale; Actor_SetScale(&this->actor, sInit2Info[type].scale); @@ -708,9 +708,9 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - pos.x += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].offset.x; - pos.y += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].offset.y; - pos.z += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].offset.z; + pos.x += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 7)].offset.x; + pos.y += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 7)].offset.y; + pos.z += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 7)].offset.z; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } @@ -718,7 +718,7 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { void func_80A70834(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_5) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_5) { if (!Inventory_HasSpecificBottle(ITEM_BLUE_FIRE) && !Inventory_HasSpecificBottle(ITEM_BUG) && !Inventory_HasSpecificBottle(ITEM_FISH)) { switch (func_8002F368(play)) { @@ -760,7 +760,7 @@ void func_80A70978(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 phi_a3; - switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { + switch (PARAMS_GET2(this->actor.params, 0, 7)) { case ENHY_TYPE_BOJ_3: case ENHY_TYPE_BJI_7: case ENHY_TYPE_BOJ_9: @@ -786,12 +786,12 @@ void func_80A70978(EnHy* this, PlayState* play) { this->unk_1E8.unk_18 = player->actor.world.pos; if (LINK_IS_ADULT) { - this->unk_1E8.unk_14 = sInit1Info[PARAMS_GET2(this->actor.params, 0, 0x7F)].unkValueAdult; + this->unk_1E8.unk_14 = sInit1Info[PARAMS_GET2(this->actor.params, 0, 7)].unkValueAdult; } else { - this->unk_1E8.unk_14 = sInit1Info[PARAMS_GET2(this->actor.params, 0, 0x7F)].unkValueChild; + this->unk_1E8.unk_14 = sInit1Info[PARAMS_GET2(this->actor.params, 0, 7)].unkValueChild; } - func_80034A14(&this->actor, &this->unk_1E8, sInit1Info[PARAMS_GET2(this->actor.params, 0, 0x7F)].unkPresetIndex, phi_a3); + func_80034A14(&this->actor, &this->unk_1E8, sInit1Info[PARAMS_GET2(this->actor.params, 0, 7)].unkPresetIndex, phi_a3); if (func_800343CC(play, &this->actor, &this->unk_1E8.unk_00, this->unkRange, func_80A6F810, func_80A70058)) { func_80A70834(this, play); @@ -801,29 +801,29 @@ void func_80A70978(EnHy* this, PlayState* play) { s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { switch (play->sceneNum) { case SCENE_SPOT01: - if (!(PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_9 || PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_10 || - PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_12 || PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_AHG_2 || - PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BJI_7)) { + if (!(PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_12 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { return true; } else if (!LINK_IS_ADULT) { return true; - } else if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { + } else if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { return false; } else { return true; } case SCENE_LABO: - if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_BOJ_10) { + if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_10) { return true; } else if (LINK_IS_CHILD) { return false; - } else if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_10 && IS_DAY) { + } else if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 && IS_DAY) { return false; } else { return true; } case SCENE_IMPA: - if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_AOB) { + if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_AOB) { return true; } else if (IS_DAY) { return false; @@ -831,11 +831,11 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } case SCENE_KAKARIKO: - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_AOB) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AOB) { return !LINK_IS_ADULT ? false : true; - } else if (!(PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_9 || - PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_AHG_2 || - PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BJI_7)) { + } else if (!(PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { return true; } else if (IS_DAY) { return false; @@ -846,7 +846,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { } case SCENE_MARKET_ALLEY: case SCENE_MARKET_ALLEY_N: - if (PARAMS_GET2(this->actor.params, 0, 0x7F) != ENHY_TYPE_BOJ_14) { + if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_14) { return true; } else if (IS_NIGHT) { return false; @@ -856,7 +856,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } default: - switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { + switch (PARAMS_GET2(this->actor.params, 0, 7)) { case ENHY_TYPE_BJI_19: case ENHY_TYPE_AHG_20: if (LINK_IS_ADULT) { @@ -870,7 +870,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { void EnHy_Init(Actor* thisx, PlayState* play) { EnHy* this = (EnHy*)thisx; - if (PARAMS_GET2(this->actor.params, 0, 0x7F) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || + if (PARAMS_GET2(this->actor.params, 0, 7) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || !EnHy_FindSkelAndHeadObjects(this, play)) { Actor_Kill(&this->actor); } @@ -893,7 +893,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { this->actor.objBankIndex = this->objBankIndexSkel1; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->actor.objBankIndex].segment); SkelAnime_InitFlex(play, &this->skelAnime, - sSkeletonInfo[sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].skelInfoIndex1].skeleton, NULL, + sSkeletonInfo[sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex1].skeleton, NULL, this->jointTable, this->morphTable, 16); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexOsAnime].segment); @@ -901,7 +901,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); EnHy_InitCollider(this); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].animInfoIndex); + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].animInfoIndex); if ((play->sceneNum == SCENE_MARKET_ALLEY) || (play->sceneNum == SCENE_MARKET_DAY)) { this->actor.flags &= ~ACTOR_FLAG_4; @@ -913,9 +913,9 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { } EnHy_InitSetProperties(this); - this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 7, 0x780), 15); + this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 7, 4), 15); - switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { + switch (PARAMS_GET2(this->actor.params, 0, 7)) { case ENHY_TYPE_BOJ_3: if (this->path != NULL) { this->actor.speedXZ = 3.0f; @@ -1104,7 +1104,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (limbIndex == 15) { gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.status[this->objBankIndexHead].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexHead].segment); - i = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].headInfoIndex; + i = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].headInfoIndex; *dList = sHeadInfo[i].headDList; if (sHeadInfo[i].eyeTextures != NULL) { @@ -1151,7 +1151,7 @@ void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexSkel2].segment); } - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_005BC8); } @@ -1183,10 +1183,10 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { if (this->actionFunc != EnHy_InitImpl) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Translate(this->modelOffset.x, this->modelOffset.y, this->modelOffset.z, MTXMODE_APPLY); - envColorSeg8 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].envColorSeg8; - envColorSeg9 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 0x7F)].envColorSeg9; + envColorSeg8 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].envColorSeg8; + envColorSeg9 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].envColorSeg9; - switch (PARAMS_GET2(this->actor.params, 0, 0x7F)) { + switch (PARAMS_GET2(this->actor.params, 0, 7)) { // ENHY_TYPE_AOB // ENHY_TYPE_COB case ENHY_TYPE_AHG_2: @@ -1215,11 +1215,11 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { EnHy_SetEnvColor(play->state.gfxCtx, envColorSeg9.r, envColorSeg9.g, envColorSeg9.b, envColorSeg9.a)); - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_8 || PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_11) { - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_8) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8) { envColorSeg10 = envColorSeg8; } - if (PARAMS_GET2(this->actor.params, 0, 0x7F) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { envColorSeg10.r = envColorSeg10.g = envColorSeg10.b = 255; envColorSeg10.a = 0; } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c index 464e4524a45..c37a8d93889 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c @@ -202,7 +202,7 @@ void func_80A74398(Actor* thisx, PlayState* play) { this->unk_2FC = 0; thisx->colChkInfo.health = 30; thisx->gravity = -1.0f; - this->switchFlags = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlags = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 0) { @@ -1435,9 +1435,9 @@ void func_80A781CC(Actor* thisx, PlayState* play) { void EnIk_Init(Actor* thisx, PlayState* play) { EnIk* this = (EnIk*)thisx; - s32 flag = PARAMS_GET_NOSHIFT(this->actor.params, 8, 0xFF); + s32 flag = PARAMS_GET_NOSHIFT(this->actor.params, 8, 8); - if ((PARAMS_GET(this->actor.params, 0, 0xFF) == 0 && GET_EVENTCHKINF(EVENTCHKINF_3C)) || + if ((PARAMS_GET(this->actor.params, 0, 8) == 0 && GET_EVENTCHKINF(EVENTCHKINF_3C)) || (flag != 0 && Flags_GetSwitch(play, flag >> 8))) { Actor_Kill(&this->actor); } else { diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 7b1e6d010a5..e31be504167 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -99,7 +99,7 @@ static InitChainEntry sInitChain[] = { }; void EnInsect_InitFlags(EnInsect* this) { - this->insectFlags = sInitInsectFlags[PARAMS_GET(this->actor.params, 0, 3)]; + this->insectFlags = sInitInsectFlags[PARAMS_GET(this->actor.params, 0, 2)]; } f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) { @@ -187,7 +187,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->actor, sInitChain); EnInsect_InitFlags(this); - type = PARAMS_GET(this->actor.params, 0, 3); + type = PARAMS_GET(this->actor.params, 0, 2); SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24); Collider_InitJntSph(play, &this->collider); @@ -242,7 +242,7 @@ void EnInsect_Destroy(Actor* thisx, PlayState* play) { s16 type; EnInsect* this = (EnInsect*)thisx; - type = PARAMS_GET(this->actor.params, 0, 3); + type = PARAMS_GET(this->actor.params, 0, 2); Collider_DestroyJntSph(play, &this->collider); if ((type == INSECT_TYPE_FIRST_DROPPED || type == INSECT_TYPE_EXTRA_DROPPED) && sDroppedCount > 0) { sDroppedCount--; @@ -261,7 +261,7 @@ void EnInsect_SlowDown(EnInsect* this, PlayState* play) { s16 type; f32 playSpeed; - type = PARAMS_GET(this->actor.params, 0, 3); + type = PARAMS_GET(this->actor.params, 0, 2); Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f); @@ -297,7 +297,7 @@ void EnInsect_Crawl(EnInsect* this, PlayState* play) { s32 pad1; s32 pad2; s16 yaw; - s16 type = PARAMS_GET(this->actor.params, 0, 3); + s16 type = PARAMS_GET(this->actor.params, 0, 2); Math_SmoothStepToF(&this->actor.speedXZ, 1.5f, 0.1f, 0.5f, 0.0f); @@ -469,7 +469,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) { s16 type; Vec3f ripplePoint; - type = PARAMS_GET(this->actor.params, 0, 3); + type = PARAMS_GET(this->actor.params, 0, 2); if (this->actionTimer > 80) { Math_StepToF(&this->actor.speedXZ, 0.6f, 0.08f); @@ -571,7 +571,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { f32 sp34; sp50 = 0; - type = PARAMS_GET(this->actor.params, 0, 3); + type = PARAMS_GET(this->actor.params, 0, 2); if (this->soilActor != NULL) { distanceSq = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); @@ -672,8 +672,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { !(this->insectFlags & INSECT_FLAG_7)) { if (this->unk_32A >= 15) { if (this->soilActor != NULL) { - if (!(GET_GS_FLAGS(PARAMS_GET(this->soilActor->actor.params, 8, 0x1F) - 1) & - PARAMS_GET(this->soilActor->actor.params, 0, 0xFF))) { + if (!(GET_GS_FLAGS(PARAMS_GET(this->soilActor->actor.params, 8, 5) - 1) & + PARAMS_GET(this->soilActor->actor.params, 0, 8))) { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); } } @@ -764,7 +764,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - tmp = PARAMS_GET(this->actor.params, 0, 3); + tmp = PARAMS_GET(this->actor.params, 0, 2); if (tmp == INSECT_TYPE_FIRST_DROPPED || tmp == INSECT_TYPE_EXTRA_DROPPED) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 6dbf2814667..7939df56743 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -250,7 +250,7 @@ void EnIshi_DropCollectible(EnIshi* this, PlayState* play) { s16 dropParams; if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_SMALL) { - dropParams = PARAMS_GET(this->actor.params, 8, 0xF); + dropParams = PARAMS_GET(this->actor.params, 8, 4); if (dropParams >= 0xD) { dropParams = 0; @@ -320,7 +320,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, play); if ((type == ROCK_LARGE) && - Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0xA, 0x3C) | PARAMS_GET(this->actor.params, 6, 3))) { + Flags_GetSwitch(play, PARAMS_GET_PS(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2))) { Actor_Kill(&this->actor); return; } @@ -391,7 +391,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_LARGE) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0xA, 0x3C) | PARAMS_GET(this->actor.params, 6, 3)); + Flags_SetSwitch(play, PARAMS_GET_PS(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2)); } EnIshi_SetupFly(this); EnIshi_Fall(this); diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 110569fc431..c58c02394ad 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -63,8 +63,8 @@ void EnKakasi2_Init(Actor* thisx, PlayState* play) { // "Visit Umeda" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 梅田参号見参! ☆☆☆☆☆ \n" VT_RST); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); - spawnRangeY = PARAMS_GET(this->actor.params, 6, 0xFF); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); + spawnRangeY = PARAMS_GET(this->actor.params, 6, 8); spawnRangeXZ = this->actor.world.rot.z; if (this->switchFlag == 0x3F) { this->switchFlag = -1; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 57698d0813a..606baf2ee30 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -13,8 +13,8 @@ #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) -#define ENKO_TYPE PARAMS_GET2(this->actor.params, 0, 0xFF) -#define ENKO_PATH PARAMS_GET2(this->actor.params, 8, 0xFF00) +#define ENKO_TYPE PARAMS_GET2(this->actor.params, 0, 8) +#define ENKO_PATH PARAMS_GET2(this->actor.params, 8, 8) void EnKo_Init(Actor* thisx, PlayState* play); void EnKo_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index e0a5eab8d5c..c400c53f65d 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -126,10 +126,10 @@ s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) { void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { s16 dropParams; - switch (PARAMS_GET(this->actor.params, 0, 3)) { + switch (PARAMS_GET(this->actor.params, 0, 2)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: - dropParams = PARAMS_GET(this->actor.params, 8, 0xF); + dropParams = PARAMS_GET(this->actor.params, 8, 4); if (dropParams >= 0xD) { dropParams = 0; @@ -253,7 +253,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { return; } - this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[PARAMS_GET(thisx->params, 0, 3)]); + this->objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[PARAMS_GET(thisx->params, 0, 2)]); if (this->objBankIndex < 0) { // "Bank danger!" @@ -311,7 +311,7 @@ void EnKusa_Main(EnKusa* this, PlayState* play) { EnKusa_SpawnBugs(this, play); } - if (PARAMS_GET(this->actor.params, 0, 3) == ENKUSA_TYPE_0) { + if (PARAMS_GET(this->actor.params, 0, 2) == ENKUSA_TYPE_0) { Actor_Kill(&this->actor); return; } @@ -379,7 +379,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } EnKusa_SpawnFragments(this, play); EnKusa_DropCollectible(this, play); - switch (PARAMS_GET(this->actor.params, 0, 3)) { + switch (PARAMS_GET(this->actor.params, 0, 2)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: Actor_Kill(&this->actor); @@ -424,7 +424,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } void EnKusa_SetupCut(EnKusa* this) { - switch (PARAMS_GET(this->actor.params, 0, 3)) { + switch (PARAMS_GET(this->actor.params, 0, 2)) { case ENKUSA_TYPE_2: EnKusa_SetupAction(this, EnKusa_DoNothing); break; @@ -504,6 +504,6 @@ void EnKusa_Draw(Actor* thisx, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_ENKUSA_CUT) { Gfx_DrawDListOpa(play, object_kusa_DL_0002E0); } else { - Gfx_DrawDListOpa(play, dLists[PARAMS_GET(thisx->params, 0, 3)]); + Gfx_DrawDListOpa(play, dLists[PARAMS_GET(thisx->params, 0, 2)]); } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index cfae7ec0245..29be5d5c3bf 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -275,11 +275,11 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { f32 pathDiffX; f32 pathDiffZ; - if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 8)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -301,11 +301,11 @@ s32 EnKz_SetMovedPos(EnKz* this, PlayState* play) { Path* path; Vec3s* lastPointPos; - if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 8)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index d740afd2798..bdffbb6c7c9 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -60,10 +60,10 @@ void EnLight_Init(Actor* thisx, PlayState* play) { } this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - Actor_SetScale(&this->actor, D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)].scale * 0.0001f); + Actor_SetScale(&this->actor, D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)].scale * 0.0001f); this->timer = (s32)(Rand_ZeroOne() * 255.0f); - if (PARAMS_GET2(this->actor.params, 0, 0x400) != 0) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1)) { this->actor.update = EnLight_UpdateSwitch; } } @@ -92,7 +92,7 @@ void EnLight_Update(Actor* thisx, PlayState* play) { s16 radius; EnLight* this = (EnLight*)thisx; - flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)]; + flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)]; intensity = (Rand_ZeroOne() * 0.5f) + 0.5f; radius = (this->actor.params < 0) ? 100 : 300; Lights_PointSetColorAndRadius(&this->lightInfo, (flameParams->primColor.r * intensity), @@ -111,11 +111,11 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { EnLight* this = (EnLight*)thisx; f32 scale; - flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)]; + flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)]; scale = this->actor.scale.x / ((f32)flameParams->scale * 0.0001); - if (PARAMS_GET2(this->actor.params, 0, 0x800) != 0) { - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 0x3F0))) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 11, 1)) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 6))) { Math_StepToF(&scale, 1.0f, 0.05f); } else { if (scale < 0.1f) { @@ -125,7 +125,7 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { Math_StepToF(&scale, 0.0f, 0.05f); } } else { - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 0x3F0))) { + if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 6))) { if (scale < 0.1f) { Actor_SetScale(&this->actor, 0.0f); return; @@ -156,7 +156,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { if (1) {} - flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 0xF)]; + flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)]; OPEN_DISPS(play->state.gfxCtx, "../z_en_light.c", 441); diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index 0793a04a646..41c4766a669 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -66,7 +66,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420); - this->unk_1C7 = PARAMS_GET2(this->actor.params, 0, 0xFF) - 1; + this->unk_1C7 = PARAMS_GET2(this->actor.params, 0, 8) - 1; Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 255, 255, 255, 0); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); @@ -85,8 +85,8 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { if (player->stateFlags2 & PLAYER_STATE2_17) { if (!gSaveContext.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || - (PARAMS_GET2(this->actor.params, 8, 0xFF00) && - !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 0xFF00), MAGIC_CONSUME_NOW)))) { + (PARAMS_GET2(this->actor.params, 8, 8) && + !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 8), MAGIC_CONSUME_NOW)))) { Audio_PlaySoundGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySoundGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, @@ -158,8 +158,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (this->unk_1CA == 0) { if (player->unk_858 >= 0.1f) { if ((gSaveContext.magicState != MAGIC_STATE_IDLE) || - (PARAMS_GET2(this->actor.params, 8, 0xFF00) && - !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 0xFF00), MAGIC_CONSUME_WAIT_PREVIEW)))) { + (PARAMS_GET2(this->actor.params, 8, 8) && + !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 8), MAGIC_CONSUME_WAIT_PREVIEW)))) { func_80A9F350(this, play); func_80A9EFE0(this, func_80A9F350); this->unk_1C8 = 0; @@ -192,7 +192,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { return; } else { player->stateFlags2 &= ~PLAYER_STATE2_17; - if (PARAMS_GET2(this->actor.params, 8, 0xFF00)) { + if (PARAMS_GET2(this->actor.params, 8, 8)) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; } if (player->unk_858 < 0.85f) { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 0168438820a..3126181c612 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -316,7 +316,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { this->morphTable, 28); Actor_SetScale(&this->actor, 0.014f); - this->path = PARAMS_GET2(thisx->params, 8, 0xFF00); + this->path = PARAMS_GET2(thisx->params, 8, 8); this->actor.params = ENMB_TYPE_SPEAR_PATROL; this->waypoint = 0; this->actor.colChkInfo.health = 1; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 5f42d029977..7ce70f6f756 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -591,11 +591,11 @@ u8 EnMd_FollowPath(EnMd* this, PlayState* play) { f32 pathDiffX; f32 pathDiffZ; - if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 8)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -618,11 +618,11 @@ u8 EnMd_SetMovedPos(EnMd* this, PlayState* play) { Path* path; Vec3s* lastPointPos; - if (PARAMS_GET2(this->actor.params, 0, 0xFF00) == 0xFF00) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) == 0xFF00) { return 0; } - path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 0xFF00)]; + path = &play->setupPathList[PARAMS_GET2(this->actor.params, 8, 8)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index dd4d614dd7e..4503a861493 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -173,7 +173,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { Animation_GetLastFrame(sAnimationInfo[RM_ANIM_RUN].animation), sAnimationInfo[RM_ANIM_RUN].mode, sAnimationInfo[RM_ANIM_RUN].morphFrames); - this->path = PARAMS_GET(this->actor.params, 0, 0xFF); + this->path = PARAMS_GET(this->actor.params, 0, 8); this->unk_1F0 = 2; this->unk_1E8 = 0; this->actor.targetMode = 2; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index eb221df8f9c..8604e108f88 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -89,13 +89,13 @@ static s32 D_80AB4318 = 0; #include "z_en_nb_cutscene_data.c" s32 EnNb_GetPath(EnNb* this) { - s32 path = PARAMS_GET(this->actor.params, 8, 0xFF); + s32 path = PARAMS_GET(this->actor.params, 8, 8); return path; } s32 EnNb_GetType(EnNb* this) { - s32 type = PARAMS_GET(this->actor.params, 0, 0xFF); + s32 type = PARAMS_GET(this->actor.params, 0, 8); return type; } diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 536c1937396..7fc83dd9d3d 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -65,7 +65,7 @@ void EnNiwGirl_Init(Actor* thisx, PlayState* play) { if (this->actor.params < 0) { this->actor.params = 0; } - this->path = PARAMS_GET(this->actor.params, 8, 0xFF); + this->path = PARAMS_GET(this->actor.params, 8, 8); this->actor.gravity = -3.0f; Matrix_RotateY(BINANG_TO_RAD_ALT(this->actor.shape.rot.y), MTXMODE_NEW); vec2.x = vec2.y = vec2.z = 0.0f; diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index 5077911beb4..d558c1077ac 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -47,9 +47,9 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { // "Ocarina tag outbreak" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ オカリナタグ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->actor.flags &= ~ACTOR_FLAG_0; - this->type = PARAMS_GET(this->actor.params, 0xA, 0x3F); - this->ocarinaSong = PARAMS_GET(this->actor.params, 6, 0xF); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + this->type = PARAMS_GET(this->actor.params, 10, 6); + this->ocarinaSong = PARAMS_GET(this->actor.params, 6, 4); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index c422202027d..1ac8140f631 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -121,7 +121,7 @@ void EnOkuta_Init(Actor* thisx, PlayState* play) { s32 floorBgId; Actor_ProcessInitChain(thisx, sInitChain); - this->numShots = PARAMS_GET(thisx->params, 8, 0xFF); + this->numShots = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 0) { SkelAnime_Init(play, &this->skelAnime, &gOctorokSkel, &gOctorokAppearAnim, this->jointTable, this->morphTable, diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 69128c75c83..f81f041cac1 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -125,8 +125,8 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->unk_405 = 4; this->unk_404 = this->unk_407 = 0; this->unk_408 = 4; - owlType = PARAMS_GET2(this->actor.params, 6, 0xFC0); - switchFlag = PARAMS_GET2(this->actor.params, 0, 0x3F); + owlType = PARAMS_GET2(this->actor.params, 6, 6); + switchFlag = PARAMS_GET2(this->actor.params, 0, 6); if (this->actor.params == 0xFFF) { owlType = OWL_OUTSIDE_KOKIRI; switchFlag = 0x20; @@ -302,7 +302,7 @@ void func_80ACA5C8(EnOwl* this) { } void func_80ACA62C(EnOwl* this, PlayState* play) { - s32 switchFlag = PARAMS_GET2(this->actor.params, 0, 0x3F); + s32 switchFlag = PARAMS_GET2(this->actor.params, 0, 6); if (switchFlag < 0x20) { Flags_SetSwitch(play, switchFlag); @@ -728,7 +728,7 @@ void func_80ACB748(EnOwl* this, PlayState* play) { static Vec3f D_80ACD62C = { 0.0f, 0.0f, 0.0f }; f32 dist; f32 weight; - s32 owlType = PARAMS_GET2(this->actor.params, 6, 0xFC0); + s32 owlType = PARAMS_GET2(this->actor.params, 6, 6); dist = Math3D_Vec3f_DistXYZ(&this->eye, &play->view.eye) / 45.0f; this->eye.x = play->view.eye.x; @@ -926,7 +926,7 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { if (this->actor.xzDistToPlayer < 50.0f) { if (!Play_InCsMode(play)) { - owlType = PARAMS_GET2(this->actor.params, 6, 0xFC0); + owlType = PARAMS_GET2(this->actor.params, 6, 6); osSyncPrintf(VT_FGCOL(CYAN)); osSyncPrintf("%dのフクロウ\n", owlType); // "%d owl" osSyncPrintf(VT_RST); @@ -1057,7 +1057,7 @@ s32 func_80ACC5CC(EnOwl* this) { } s32 func_80ACC624(EnOwl* this, PlayState* play) { - s32 switchFlag = PARAMS_GET2(this->actor.params, 6, 0xFC0); + s32 switchFlag = PARAMS_GET2(this->actor.params, 6, 6); if (play->sceneNum != SCENE_SPOT11) { return true; diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index f9ee1bf9164..035d802b627 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -74,7 +74,7 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) { 255, 255, 255, 200); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 37.0f); this->currentPathPoint = 1; - this->actor.params = PARAMS_GET(this->actor.params, 8, 0xFF); + this->actor.params = PARAMS_GET(this->actor.params, 8, 8); this->targetY = this->actor.world.pos.y; EnPoDesert_SetNextPathPoint(this, play); } diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 24e5eb8d130..f560ffddf4a 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -153,7 +153,7 @@ void EnPoField_Init(Actor* thisx, PlayState* play) { sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; - sSpawnSwitchFlags[sNumSpawned] = PARAMS_GET(this->actor.params, 0, 0xFF); + sSpawnSwitchFlags[sNumSpawned] = PARAMS_GET(this->actor.params, 0, 8); sNumSpawned++; } if (sNumSpawned >= 2) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 98f84c508d7..b6b546d58ae 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -191,10 +191,10 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->unk_194 = PARAMS_GET(thisx->params, 8, 3); + this->unk_194 = PARAMS_GET(thisx->params, 8, 2); this->actor.naviEnemyId = this->unk_194 + NAVI_ENEMY_POE_SISTER_MEG; if (1) {} - this->unk_195 = PARAMS_GET(thisx->params, 0xA, 3); + this->unk_195 = PARAMS_GET(thisx->params, 10, 2); this->unk_196 = 32; this->unk_197 = 20; this->unk_198 = 1; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 4e423df016e..bfc2553731c 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -153,7 +153,7 @@ void EnRd_Init(Actor* thisx, PlayState* play) { this->alpha = this->unk_31D = 255; this->rdFlags = REDEAD_GET_FLAGS(thisx); - if (PARAMS_GET2(this->actor.params, 0, 0x80)) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 7, 1)) { this->actor.params |= 0xFF00; } else { this->actor.params &= 0xFF; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 3e6bd3b9a15..307e0b47c72 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -8,7 +8,7 @@ struct EnRd; typedef void (*EnRdActionFunc)(struct EnRd*, PlayState*); -#define REDEAD_GET_FLAGS(thisx) PARAMS_GET2((thisx)->params, 8, 0xFF00) +#define REDEAD_GET_FLAGS(thisx) PARAMS_GET2((thisx)->params, 8, 8) typedef enum { /* 0 */ REDEAD_GIBDO_LIMB_NONE, diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index ead1df56e19..7f8410a6ce5 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -29,8 +29,8 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { EnRiverSound* this = (EnRiverSound*)thisx; this->playSound = false; - this->pathIndex = PARAMS_GET(this->actor.params, 8, 0xFF); - this->actor.params = PARAMS_GET(this->actor.params, 0, 0xFF); + this->pathIndex = PARAMS_GET(this->actor.params, 8, 8); + this->actor.params = PARAMS_GET(this->actor.params, 0, 8); if (this->actor.params >= RS_GANON_TOWER_0) { // Incrementally increase volume of NA_BGM_GANON_TOWER for each new room during the climb of Ganon's Tower diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index f882e71f46c..4cb6d6ad460 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -189,13 +189,13 @@ void func_80AEADD8(EnRu1* this) { } u8 func_80AEADE0(EnRu1* this) { - u8 params = PARAMS_GET(this->actor.params, 8, 0xFF); + u8 params = PARAMS_GET(this->actor.params, 8, 8); return params; } u8 func_80AEADF0(EnRu1* this) { - u8 params = PARAMS_GET(this->actor.params, 0, 0xFF); + u8 params = PARAMS_GET(this->actor.params, 0, 8); return params; } @@ -324,7 +324,7 @@ Actor* func_80AEB124(PlayState* play) { Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { - if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET(actorIt->params, 0, 0xFF) == 0x15)) { + if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET(actorIt->params, 0, 8) == 0x15)) { return actorIt; } actorIt = actorIt->next; @@ -1520,7 +1520,7 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { floorBgId = this->actor.floorBgId; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { - if (PARAMS_GET(dynaPolyActor->actor.params, 8, 0x3F) == 0x38) { + if (PARAMS_GET(dynaPolyActor->actor.params, 8, 6) == 0x38) { SET_INFTABLE(INFTABLE_140); return; } diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 3f581b413f9..6980f9d215d 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -126,13 +126,13 @@ void func_80AF2608(EnRu2* this) { } s32 func_80AF2690(EnRu2* this) { - s32 params_shift = PARAMS_GET(this->actor.params, 8, 0xFF); + s32 params_shift = PARAMS_GET(this->actor.params, 8, 8); return params_shift; } s32 func_80AF26A0(EnRu2* this) { - s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); + s32 params = PARAMS_GET(this->actor.params, 0, 8); return params; } diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index 942c72071d0..a8875ac74bb 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -128,7 +128,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) { player->actor.freezeTimer = 10; } else { - SET_GS_FLAGS(PARAMS_GET2(this->actor.params, 8, 0x1F00), PARAMS_GET2(this->actor.params, 0, 0xFF)); + SET_GS_FLAGS(PARAMS_GET2(this->actor.params, 8, 5), PARAMS_GET2(this->actor.params, 0, 8)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index f822cec5746..5089ca05aa8 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -51,7 +51,7 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); this->sfxFlags |= 1; - type = PARAMS_GET((u16)thisx->params, 0xC, 0xF); + type = PARAMS_GET((u16)thisx->params, 12, 4); if (!((type == 0) || (type == 1))) { Actor_Kill(thisx); return; @@ -81,13 +81,13 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { thisx->shape.rot.y = 0; thisx->shape.rot.z = 0; - type = PARAMS_GET((u16)thisx->params, 0xC, 0xF); + type = PARAMS_GET((u16)thisx->params, 12, 4); if (type == EN_SIOFUKI_RAISING) { this->currentHeight = 10.0f; this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; } else if (type == EN_SIOFUKI_LOWERING) { - if (Flags_GetTreasure(play, PARAMS_GET((u16)thisx->params, 0, 0x3F))) { + if (Flags_GetTreasure(play, PARAMS_GET((u16)thisx->params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -189,8 +189,8 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { this->timer--; if (this->timer < 0) { - Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F)); - switch (PARAMS_GET((u16)this->dyna.actor.params, 0xC, 0xF)) { + Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6)); + switch (PARAMS_GET((u16)this->dyna.actor.params, 12, 4)) { case EN_SIOFUKI_RAISING: this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; @@ -204,11 +204,11 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { func_8002F994(&this->dyna.actor, this->timer); } - if ((PARAMS_GET((u16)this->dyna.actor.params, 0xC, 0xF) == EN_SIOFUKI_LOWERING) && - Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 0x3F))) { + if ((PARAMS_GET((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) && + Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; - Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F)); + Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6)); this->actionFunc = func_80AFC544; } } @@ -218,7 +218,7 @@ void func_80AFC34C(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6))) { this->targetHeight = 400.0f; this->timer = 300; this->actionFunc = func_80AFC218; @@ -237,7 +237,7 @@ void func_80AFC3C8(EnSiofuki* this, PlayState* play) { this->actionFunc = func_80AFC218; } - if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -249,14 +249,14 @@ void func_80AFC478(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (PARAMS_GET((u16)this->dyna.actor.params, 0xC, 0xF) == EN_SIOFUKI_LOWERING) { - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 0x3F))) { + if (PARAMS_GET((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) { + if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6))) { this->timer = 20; this->actionFunc = func_80AFC3C8; OnePointCutscene_Init(play, 5010, 40, &this->dyna.actor, CAM_ID_MAIN); } - if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -295,7 +295,7 @@ void EnSiofuki_Draw(Actor* thisx, PlayState* play) { if (this->sfxFlags & 1) { f32 heightRatio; - switch (PARAMS_GET((u16)thisx->params, 0xC, 0xF)) { + switch (PARAMS_GET((u16)thisx->params, 12, 4)) { case EN_SIOFUKI_RAISING: heightRatio = (this->currentHeight - 10.0f) / (400.0f - 10.0f); func_800F436C(&thisx->projectedPos, NA_SE_EV_FOUNTAIN - SFX_FLAG, 1.0f + heightRatio); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 727e1945fc5..1b90c4c5deb 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -360,7 +360,7 @@ void EnSkj_SetNaviId(EnSkj* this) { } void EnSkj_Init(Actor* thisx, PlayState* play2) { - s16 type = PARAMS_GET(thisx->params, 0xA, 0x3F); + s16 type = PARAMS_GET(thisx->params, 10, 6); EnSkj* this = (EnSkj*)thisx; PlayState* play = play2; s32 pad; diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index f2b7b26ee2f..19d2abd7d6d 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -38,7 +38,7 @@ void EnStream_SetupAction(EnStream* this, EnStreamActionFunc actionFunc) { void EnStream_Init(Actor* thisx, PlayState* play) { EnStream* this = (EnStream*)thisx; - this->unk_150 = PARAMS_GET(thisx->params, 0, 0xFF); + this->unk_150 = PARAMS_GET(thisx->params, 0, 8); Actor_ProcessInitChain(thisx, sInitChain); if ((this->unk_150 != 0) && (this->unk_150 == 1)) { thisx->scale.y = 0.01f; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 21bc65ba933..9b2d45f0c33 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -219,18 +219,18 @@ void EnSw_Init(Actor* thisx, PlayState* play) { Vec3f sp4C = { 0.0f, 0.0f, 0.0f }; s32 pad; - if (PARAMS_GET2(thisx->params, 0, 0x8000)) { - phi_v0 = PARAMS_GET2(thisx->params - 0x8000, 0xD, 0xE000) + 1; - thisx->params = PARAMS_GET2(thisx->params, 0, 0x1FFF) | (phi_v0 << 0xD); + if (PARAMS_GET_NOSHIFT(thisx->params, 15, 1)) { + phi_v0 = PARAMS_GET2(thisx->params - 0x8000, 13, 3) + 1; + thisx->params = PARAMS_GET2(thisx->params, 0, 13) | (phi_v0 << 0xD); } - if (PARAMS_GET2(thisx->params, 0xD, 0xE000) > 0) { - phi_v0 = PARAMS_GET2(thisx->params, 8, 0x1F00) - 1; - thisx->params = PARAMS_GET2(thisx->params, 0, 0xE0FF) | (phi_v0 << 8); + if (PARAMS_GET2(thisx->params, 13, 3) > 0) { + phi_v0 = PARAMS_GET2(thisx->params, 8, 5) - 1; + thisx->params = (thisx->params & ~(0x1F << 8)) | (phi_v0 << 8); } // Check to see if this gold skull token has already been retrieved. - if (GET_GS_FLAGS(PARAMS_GET2(thisx->params, 8, 0x1F00)) & PARAMS_GET2(thisx->params, 0, 0xFF)) { + if (GET_GS_FLAGS(PARAMS_GET2(thisx->params, 8, 5)) & PARAMS_GET2(thisx->params, 0, 8)) { Actor_Kill(&this->actor); return; } @@ -243,7 +243,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xE), &D_80B0F074); this->actor.scale.x = 0.02f; - if (PARAMS_GET2(thisx->params, 0xD, 0xE000) == 0) { + if (PARAMS_GET2(thisx->params, 13, 3) == 0) { this->actor.world.rot.x = 0; this->actor.world.rot.z = 0; thisx->shape.rot = this->actor.world.rot; @@ -265,12 +265,12 @@ void EnSw_Init(Actor* thisx, PlayState* play) { func_80B0C0CC(this, play, 1); } - if (PARAMS_GET2(thisx->params, 0xD, 0xE000) >= 3) { + if (PARAMS_GET2(thisx->params, 13, 3) >= 3) { Audio_PlaySoundGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - switch (PARAMS_GET2(thisx->params, 0xD, 0xE000)) { + switch (PARAMS_GET2(thisx->params, 13, 3)) { case 3: case 4: this->unk_360 = 1; @@ -298,11 +298,11 @@ void EnSw_Init(Actor* thisx, PlayState* play) { this->actor.home.pos = this->actor.world.pos; thisx->shape.rot = this->actor.world.rot; - if (PARAMS_GET2(thisx->params, 0xD, 0xE000) >= 3) { + if (PARAMS_GET2(thisx->params, 13, 3) >= 3) { this->unk_38C = 0x28; this->unk_394 = 1; this->actionFunc = func_80B0D364; - } else if (PARAMS_GET2(thisx->params, 0xD, 0xE000) == 0) { + } else if (PARAMS_GET2(thisx->params, 13, 3) == 0) { this->actionFunc = func_80B0E5E0; } else { this->actionFunc = func_80B0D590; @@ -318,7 +318,7 @@ void EnSw_Destroy(Actor* thisx, PlayState* play) { s32 func_80B0C9F0(EnSw* this, PlayState* play) { s32 phi_v1 = false; - if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET2(this->actor.params, 0xD, 0xE000) == 0 && + if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET2(this->actor.params, 13, 3) == 0 && play->actorCtx.unk_02 != 0) { this->actor.colChkInfo.damage = this->actor.colChkInfo.health; @@ -335,7 +335,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { return true; } Enemy_StartFinishingBlow(play, &this->actor); - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { + if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { this->skelAnime.playSpeed = 8.0f; if ((play->state.frames & 1) == 0) { this->unk_420 = 0.1f; @@ -369,7 +369,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { } void func_80B0CBE8(EnSw* this, PlayState* play) { - if ((PARAMS_GET2(this->actor.params, 0xD, 0xE000) > 0) && (this->actionFunc != func_80B0D590)) { + if ((PARAMS_GET2(this->actor.params, 13, 3) > 0) && (this->actionFunc != func_80B0D590)) { if (this->unk_392 != 0) { this->unk_392--; } @@ -437,7 +437,7 @@ void func_80B0CEA8(EnSw* this, PlayState* play) { Camera* activeCam = GET_ACTIVE_CAM(play); if (!(Math_Vec3f_DistXYZ(&this->actor.world.pos, &activeCam->eye) >= 380.0f)) { - Audio_PlayActorSound2(&this->actor, PARAMS_GET2(this->actor.params, 0xD, 0xE000) > 0 ? NA_SE_EN_STALGOLD_ROLL + Audio_PlayActorSound2(&this->actor, PARAMS_GET2(this->actor.params, 13, 3) > 0 ? NA_SE_EN_STALGOLD_ROLL : NA_SE_EN_STALWALL_ROLL); } } @@ -482,7 +482,7 @@ void func_80B0D14C(EnSw* this, PlayState* play, s32 cnt) { } void func_80B0D364(EnSw* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) == 4) { + if (PARAMS_GET2(this->actor.params, 13, 3) == 4) { this->unk_38C = 0; this->actionFunc = func_80B0D3AC; } else { @@ -535,7 +535,7 @@ void func_80B0D3AC(EnSw* this, PlayState* play) { void func_80B0D590(EnSw* this, PlayState* play) { f32 sp2C; - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) == 2) { + if (PARAMS_GET2(this->actor.params, 13, 3) == 2) { if (this->actor.scale.x < 0.0139999995f) { this->collider.elements[0].info.toucherFlags = TOUCH_NONE; this->collider.elements[0].info.bumperFlags = BUMP_NONE; @@ -559,7 +559,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_420 = ((play->state.frames % 2) == 0) ? 0.1f : -0.1f; this->unk_38A = 1; this->unk_38C = Rand_S16Offset(30, 60); - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { + if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { this->unk_38C *= 2; this->unk_420 *= 2.0f; } @@ -570,7 +570,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_38E = Rand_S16Offset(15, 30); this->unk_38A = 0; this->skelAnime.playSpeed = 0.0f; - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { + if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { this->unk_38E /= 2; } } else if (this->unk_38A != 0) { @@ -580,7 +580,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { if (this->skelAnime.playSpeed > 0.0f) { func_80B0CEA8(this, play); } - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { + if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { this->skelAnime.playSpeed *= 2.0f; } } else { @@ -909,7 +909,7 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po OPEN_DISPS(play->state.gfxCtx, "../z_en_sw.c", 2084); - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { + if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { switch (limbIndex) { case 23: *dList = object_st_DL_004788; @@ -1000,7 +1000,7 @@ void EnSw_Draw(Actor* thisx, PlayState* play) { EnSw* this = (EnSw*)thisx; Color_RGBA8 sp30 = { 184, 0, 228, 255 }; - if (PARAMS_GET2(this->actor.params, 0xD, 0xE000) != 0) { + if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { Matrix_RotateX(DEG_TO_RAD(-80), MTXMODE_APPLY); if (this->actor.colChkInfo.health != 0) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index 74e5c2b4658..6e82b91d43d 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -67,7 +67,7 @@ void EnTrap_Init(Actor* thisx, PlayState* play) { EnTrap* this = (EnTrap*)thisx; ColliderCylinder* unused = &this->collider; // required to match - this->upperParams = PARAMS_GET(thisx->params, 8, 0xFF); + this->upperParams = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; Actor_SetScale(thisx, 0.1f); thisx->gravity = -2.0f; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index aac9fde560f..f7b6ed1dfdf 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -72,10 +72,10 @@ void EnTuboTrap_Destroy(Actor* thisx, PlayState* play) { void EnTuboTrap_DropCollectible(EnTuboTrap* this, PlayState* play) { s16 params = this->actor.params; - s16 dropType = PARAMS_GET(params, 6, 0x3FF); + s16 dropType = PARAMS_GET(params, 6, 10); if (dropType >= 0 && dropType < ITEM00_MAX) { - Item_DropCollectible(play, &this->actor.world.pos, dropType | (PARAMS_GET(params, 0, 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, dropType | (PARAMS_GET(params, 0, 6) << 8)); } } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index d12c67e0d0b..a0fa0f1ca9d 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -124,8 +124,8 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); - thisx->params = PARAMS_GET(thisx->params, 0, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + thisx->params = PARAMS_GET(thisx->params, 0, 8); if (thisx->params == WMT_FLAG) { if (Flags_GetSwitch(play, this->switchFlag) != 0) { diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index 98a4e7bd995..d266b450bd7 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -55,7 +55,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_0; - switch (PARAMS_GET(this->actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->actor.params, 0, 4)) { case EN_WEATHER_TAG_TYPE_CLOUDY_MARKET: osSyncPrintf("\n\n"); // "☆☆☆☆☆ (;o;) About ☆☆☆☆☆☆" diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 6a9e619315a..53100eab582 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -220,7 +220,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.health = 8; thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; - this->switchFlag = PARAMS_GET(thisx->params, 8, 0xFF); + this->switchFlag = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; this->eyeIndex = 0; this->unk_2F4 = 10.0f; // Set and not used diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 175e4bd30ee..b3c7162b5c9 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -122,9 +122,9 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) { osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 不思議不思議まか不思議 \t ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->actor.flags &= ~ACTOR_FLAG_0; - this->wonderMode = PARAMS_GET(this->actor.params, 0xB, 0x1F); - this->itemDrop = PARAMS_GET(this->actor.params, 6, 0x1F); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + this->wonderMode = PARAMS_GET(this->actor.params, 11, 5); + this->itemDrop = PARAMS_GET(this->actor.params, 6, 5); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 43303a0f427..2fefa155741 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -39,9 +39,9 @@ void EnWonderTalk_Init(Actor* thisx, PlayState* play) { // "Special conversation" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 特殊会話くん ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->unk_150 = PARAMS_GET(this->actor.params, 0xB, 0x1F); - this->unk_152 = PARAMS_GET(this->actor.params, 6, 0x1F); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); + this->unk_150 = PARAMS_GET(this->actor.params, 11, 5); + this->unk_152 = PARAMS_GET(this->actor.params, 6, 5); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 8dbff4f7a52..0644e8ed9aa 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -43,7 +43,7 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { osSyncPrintf("\n\n"); // "Transparent message" osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->baseMsgId = PARAMS_GET(this->actor.params, 6, 0xFF); + this->baseMsgId = PARAMS_GET(this->actor.params, 6, 8); if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; s16 rotZmod10 = this->actor.world.rot.z; @@ -73,8 +73,8 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { } this->initPos = this->actor.world.pos; - this->switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); - this->talkMode = PARAMS_GET(this->actor.params, 0xE, 3); + this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); + this->talkMode = PARAMS_GET(this->actor.params, 14, 2); if (this->switchFlag == 0x3F) { this->switchFlag = -1; diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index db601a0cf00..a07e22b9c3a 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -169,7 +169,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { spawnType = WOOD_SPAWN_NORMAL; actorScale = 1.0f; - this->unk_14C = PARAMS_GET(this->actor.params, 8, 0xFF); + this->unk_14C = PARAMS_GET(this->actor.params, 8, 8); if (this->actor.home.rot.z != 0) { this->actor.home.rot.z = (this->actor.home.rot.z << 8) | this->unk_14C; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index ea7ca2f94a9..33ee7ca5525 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -283,12 +283,12 @@ void EnZf_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); thisx->targetMode = 3; - this->clearFlag = PARAMS_GET2(thisx->params, 8, 0xFF00); + this->clearFlag = PARAMS_GET2(thisx->params, 8, 8); /* Strip the top byte of params */ thisx->params &= 0xFF; /* Return the params to their original value if they were originally negative, i.e. 0xFFFF or 0xFFFE */ - if (PARAMS_GET2(thisx->params, 0, 0x80)) { + if (PARAMS_GET_NOSHIFT(thisx->params, 7, 1)) { thisx->params |= 0xFF00; } diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 03aec63701f..863ce052636 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -722,19 +722,19 @@ void EnZl3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } s32 func_80B54DB4(EnZl3* this) { - s32 params = PARAMS_GET(this->actor.params, 8, 0xFF); + s32 params = PARAMS_GET(this->actor.params, 8, 8); return params; } s32 func_80B54DC4(EnZl3* this) { - s32 params = PARAMS_GET(this->actor.params, 4, 0xF); + s32 params = PARAMS_GET(this->actor.params, 4, 4); return params; } s32 func_80B54DD4(EnZl3* this) { - s32 params = PARAMS_GET(this->actor.params, 0, 0xF); + s32 params = PARAMS_GET(this->actor.params, 0, 4); return params; } diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 39f000eed4d..4c52c874565 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -362,7 +362,7 @@ u16 func_80B61024(PlayState* play, Actor* thisx) { return textId; } - switch (PARAMS_GET(thisx->params, 0, 0x3F)) { + switch (PARAMS_GET(thisx->params, 0, 6)) { case 8: if (GET_EVENTCHKINF(EVENTCHKINF_30)) { return 0x402A; @@ -577,7 +577,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit); - if (LINK_IS_ADULT && (PARAMS_GET(this->actor.params, 0, 0x3F) == 8)) { + if (LINK_IS_ADULT && (PARAMS_GET(this->actor.params, 0, 6) == 8)) { Actor_Kill(&this->actor); return; } @@ -592,7 +592,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); - if (this->actor.yDistToWater < 54.0f || PARAMS_GET(this->actor.params, 0, 0x3F) == 8) { + if (this->actor.yDistToWater < 54.0f || PARAMS_GET(this->actor.params, 0, 6) == 8) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowScale = 24.0f; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_1); diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index f356db2542a..9939b99a016 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -62,7 +62,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { s32 type; s32 objBankIndex; - type = PARAMS_GET(this->actor.params, 0, 0xFF); + type = PARAMS_GET(this->actor.params, 0, 8); osSyncPrintf("no = %d\n", type); objBankIndex = Object_GetIndex(&play->objectCtx, sObjectIds[type]); osSyncPrintf("bank_ID = %d\n", objBankIndex); @@ -118,7 +118,7 @@ void func_80B857D0(ItemEtcetera* this, PlayState* play) { void func_80B85824(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if (PARAMS_GET(this->actor.params, 0, 0xFF) == 1) { + if (PARAMS_GET(this->actor.params, 0, 8) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -130,7 +130,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { void func_80B858B4(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if (PARAMS_GET(this->actor.params, 0, 0xFF) == 1) { + if (PARAMS_GET(this->actor.params, 0, 8) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -172,7 +172,7 @@ void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play) { } void func_80B85B28(ItemEtcetera* this, PlayState* play) { - if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 0x1F))) { + if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 5))) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 4c82fc38233..d3be31750ac 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -38,7 +38,7 @@ void ItemInbox_Destroy(Actor* thisx, PlayState* play) { } void ItemInbox_Wait(ItemInbox* this, PlayState* play) { - if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 0x1F))) { + if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 5))) { Actor_Kill(&this->actor); } } @@ -54,5 +54,5 @@ void ItemInbox_Draw(Actor* thisx, PlayState* play) { func_8002EBCC(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0); - GetItem_Draw(play, PARAMS_GET(this->actor.params, 0, 0xFF)); + GetItem_Draw(play, PARAMS_GET(this->actor.params, 0, 8)); } diff --git a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c index 19a5d1ab534..1383ce04a74 100644 --- a/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c +++ b/src/overlays/actors/ovl_Mir_Ray/z_mir_ray.c @@ -136,7 +136,7 @@ void MirRay_MakeShieldLight(MirRay* this, PlayState* play) { player->actor.world.pos.y + 30.0f, player->actor.world.pos.z, this->sourceEndRad, this->poolEndRad)) { - if (PARAMS_GET(dataEntry->params, 0, 8)) { // Light beams from mirrors + if (PARAMS_GET_NOSHIFT(dataEntry->params, 3, 1)) { // Light beams from mirrors Math_Vec3f_Diff(&player->actor.world.pos, &this->sourcePt, &reflectionPt); } else { // Light beams from windows Math_Vec3f_Diff(&this->poolPt, &this->sourcePt, &reflectionPt); @@ -207,10 +207,10 @@ void MirRay_Init(Actor* thisx, PlayState* play) { this->shieldCorners[5].x = 758.0f; this->shieldCorners[5].y = -800.0f; - if (PARAMS_GET(dataEntry->params, 0, 2)) { + if (PARAMS_GET_NOSHIFT(dataEntry->params, 1, 1)) { Collider_InitJntSph(play, &this->colliderSph); Collider_SetJntSph(play, &this->colliderSph, &this->actor, &sJntSphInit, &this->colliderSphItem); - if (!PARAMS_GET(dataEntry->params, 0, 4)) { // Beams not from mirrors + if (!PARAMS_GET_NOSHIFT(dataEntry->params, 2, 1)) { // Beams not from mirrors MirRay_SetupCollider(this); } } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index bda074e04e0..d06f78a6de0 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -226,13 +226,13 @@ void ObjBean_SetDrawMode(ObjBean* this, u8 drawFlag) { } void ObjBean_SetupPathCount(ObjBean* this, PlayState* play) { - this->pathCount = play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 0x1F)].count - 1; + this->pathCount = play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 5)].count - 1; this->currentPointIndex = 0; this->nextPointIndex = 1; } void ObjBean_SetupPath(ObjBean* this, PlayState* play) { - Path* path = &play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 0x1F)]; + Path* path = &play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 5)]; Math_Vec3s_ToVec3f(&this->pathPoints, SEGMENTED_TO_VIRTUAL(path->points)); } @@ -250,7 +250,7 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { f32 mag; Math_StepToF(&this->dyna.actor.speedXZ, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel); - path = &play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 0x1F)]; + path = &play->setupPathList[PARAMS_GET(this->dyna.actor.params, 8, 5)]; nextPathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->nextPointIndex]; Math_Vec3s_ToVec3f(&pathPointsFloat, nextPathPoint); @@ -469,8 +469,8 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) || (mREG(1) == 1)) { - path = PARAMS_GET(this->dyna.actor.params, 8, 0x1F); + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) || (mREG(1) == 1)) { + path = PARAMS_GET(this->dyna.actor.params, 8, 5); if (path == 0x1F) { osSyncPrintf(VT_COL(RED, WHITE)); // "No path data?" @@ -506,7 +506,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - } else if ((Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)) != 0) || (mREG(1) == 1)) { + } else if ((Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) != 0) || (mREG(1) == 1)) { ObjBean_SetupWaitForWater(this); } else { ObjBean_SetupWaitForBean(this); @@ -540,7 +540,7 @@ void ObjBean_WaitForBean(ObjBean* this, PlayState* play) { if (Actor_ProcessTalkRequest(&this->dyna.actor, play)) { if (func_8002F368(play) == EXCH_ITEM_BEAN) { func_80B8FE00(this); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } } else { func_8002F298(&this->dyna.actor, play, 40.0f, EXCH_ITEM_BEAN); diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index b9e0ec28ab9..b7304670d8f 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -50,8 +50,8 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId); if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_OBJ_OSHIHIKI) { - if (PARAMS_GET(dynaPolyActor->actor.params, 0, 0x000F) == PUSHBLOCK_HUGE_START_ON || - PARAMS_GET(dynaPolyActor->actor.params, 0, 0x000F) == PUSHBLOCK_HUGE_START_OFF) { + if (PARAMS_GET(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_ON || + PARAMS_GET(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_OFF) { func_80078884(NA_SE_SY_CORRECT_CHIME); } else { func_80078884(NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 5440dd83cbe..ebb5060d4eb 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -74,7 +74,7 @@ void ObjBombiwa_InitCollision(Actor* thisx, PlayState* play) { void ObjBombiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); ObjBombiwa_InitCollision(thisx, play); - if ((Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F)) != 0)) { + if ((Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6)) != 0)) { Actor_Kill(thisx); } else { CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); @@ -127,9 +127,9 @@ void ObjBombiwa_Update(Actor* thisx, PlayState* play) { if ((func_80033684(play, &this->actor) != NULL) || ((this->collider.base.acFlags & AC_HIT) && (this->collider.info.acHitInfo->toucher.dmgFlags & DMG_HAMMER))) { ObjBombiwa_Break(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); - if (PARAMS_GET(this->actor.params, 0xF, 1) != 0) { + if (PARAMS_GET(this->actor.params, 15, 1) != 0) { func_80078884(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 00c76d558b2..a7fc8b1d09e 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -128,14 +128,14 @@ void ObjComb_Break(ObjComb* this, PlayState* play) { } void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) { - s16 params = PARAMS_GET(this->actor.params, 0, 0x1F); + s16 params = PARAMS_GET(this->actor.params, 0, 5); if ((params > 0) || (params < ITEM00_MAX)) { // conditional always true. May have been intended to be && if (params == ITEM00_HEART_PIECE) { - if (Flags_GetCollectible(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (Flags_GetCollectible(play, PARAMS_GET(this->actor.params, 8, 6))) { params = -1; } else { - params = (params | (PARAMS_GET(this->actor.params, 8, 0x3F) << 8)); + params = (params | (PARAMS_GET(this->actor.params, 8, 6) << 8)); } } else if (Rand_ZeroOne() < 0.5f) { params = -1; diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index 1abb601a531..9609ad8439b 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -65,7 +65,7 @@ void ObjElevator_Init(Actor* thisx, PlayState* play) { func_80B92B08(this, play, &object_d_elevator_Col_000360, DPM_PLAYER); Actor_SetScale(thisx, sScales[PARAMS_GET(thisx->params, 0, 1)]); Actor_ProcessInitChain(thisx, sInitChain); - temp_f0 = PARAMS_GET(thisx->params, 8, 0xF); + temp_f0 = PARAMS_GET(thisx->params, 8, 4); this->unk_16C = temp_f0 + temp_f0; func_80B92C5C(this); osSyncPrintf("(Dungeon Elevator)(arg_data 0x%04x)\n", thisx->params); @@ -88,7 +88,7 @@ void func_80B92C80(ObjElevator* this, PlayState* play) { if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) && !(this->unk_170 & DYNA_INTERACT_PLAYER_ON_TOP)) { sub = thisx->world.pos.y - thisx->home.pos.y; if (fabsf(sub) < 0.1f) { - this->unk_168 = thisx->home.pos.y + (PARAMS_GET(thisx->params, 0xC, 0xF)) * 80.0f; + this->unk_168 = thisx->home.pos.y + (PARAMS_GET(thisx->params, 12, 4)) * 80.0f; } else { this->unk_168 = thisx->home.pos.y; } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index c7ae6317967..b7516308353 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -149,7 +149,7 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) { ObjHamishi_InitCollision(&this->actor, play); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { Actor_Kill(&this->actor); return; } @@ -180,7 +180,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) { } else { ObjHamishi_Break(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); Actor_Kill(&this->actor); } } else { diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index d54e0ea2af0..38379f9638c 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -71,7 +71,7 @@ static InitChainEntry sInitChain[] = { void ObjHana_Init(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - s16 type = PARAMS_GET(this->actor.params, 0, 3); + s16 type = PARAMS_GET(this->actor.params, 0, 2); HanaParams* params = &sHanaParams[type]; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -94,7 +94,7 @@ void ObjHana_Init(Actor* thisx, PlayState* play) { void ObjHana_Destroy(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[PARAMS_GET(this->actor.params, 0, 3)].radius >= 0) { + if (sHanaParams[PARAMS_GET(this->actor.params, 0, 2)].radius >= 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -102,11 +102,11 @@ void ObjHana_Destroy(Actor* thisx, PlayState* play) { void ObjHana_Update(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[PARAMS_GET(this->actor.params, 0, 3)].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { + if (sHanaParams[PARAMS_GET(this->actor.params, 0, 2)].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } } void ObjHana_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sHanaParams[PARAMS_GET(thisx->params, 0, 3)].dList); + Gfx_DrawDListOpa(play, sHanaParams[PARAMS_GET(thisx->params, 0, 2)].dList); } diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index d27db1f8ba9..1bc5c2f4f27 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -77,17 +77,17 @@ void func_80B93BF0(ObjHsblock* this, PlayState* play) { void ObjHsblock_Init(Actor* thisx, PlayState* play) { ObjHsblock* this = (ObjHsblock*)thisx; - func_80B93B68(this, play, sCollisionHeaders[PARAMS_GET(thisx->params, 0, 3)], DPM_UNK); + func_80B93B68(this, play, sCollisionHeaders[PARAMS_GET(thisx->params, 0, 2)], DPM_UNK); Actor_ProcessInitChain(thisx, sInitChain); func_80B93BF0(this, play); - switch (PARAMS_GET(thisx->params, 0, 3)) { + switch (PARAMS_GET(thisx->params, 0, 2)) { case 0: case 2: func_80B93D90(this); break; case 1: - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { func_80B93D90(this); } else { func_80B93DB0(this); @@ -116,7 +116,7 @@ void func_80B93DB0(ObjHsblock* this) { } void func_80B93DF4(ObjHsblock* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { func_80B93E38(this); } } @@ -141,7 +141,7 @@ void ObjHsblock_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != NULL) { this->actionFunc(this, play); } - Actor_SetFocus(thisx, D_80B940C0[PARAMS_GET(thisx->params, 0, 3)]); + Actor_SetFocus(thisx, D_80B940C0[PARAMS_GET(thisx->params, 0, 2)]); } void ObjHsblock_Draw(Actor* thisx, PlayState* play) { @@ -165,7 +165,7 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) { } gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 255); - gSPDisplayList(POLY_OPA_DISP++, sDLists[PARAMS_GET(thisx->params, 0, 3)]); + gSPDisplayList(POLY_OPA_DISP++, sDLists[PARAMS_GET(thisx->params, 0, 2)]); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_hsblock.c", 399); } diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index fe328b0f2ca..34d70bb2015 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -77,7 +77,7 @@ static Color_RGBA8 sColorGray = { 180, 180, 180, 255 }; void ObjIcePoly_Init(Actor* thisx, PlayState* play) { ObjIcePoly* this = (ObjIcePoly*)thisx; - this->unk_151 = PARAMS_GET(thisx->params, 8, 0xFF); + this->unk_151 = PARAMS_GET(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params < 0 || thisx->params >= 3) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 1ef10c24815..7937d0dbe74 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -66,9 +66,9 @@ static InitChainEntry sInitChain[] = { void ObjKibako_SpawnCollectible(ObjKibako* this, PlayState* play) { s16 collectible; - collectible = PARAMS_GET(this->actor.params, 0, 0x1F); + collectible = PARAMS_GET(this->actor.params, 0, 5); if ((collectible >= 0) && (collectible < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, collectible | (PARAMS_GET(this->actor.params, 8, 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, collectible | (PARAMS_GET(this->actor.params, 8, 6) << 8)); } } diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index 7fe40581a5f..b68b0185d2c 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -108,7 +108,7 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { ObjLift_InitDynaPoly(this, play, &gCollapsingPlatformCol, DPM_PLAYER); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -129,7 +129,7 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) { } void func_80B9651C(ObjLift* this) { - this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 7)]; + this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 3)]; ObjLift_SetupAction(this, func_80B96560); } @@ -139,7 +139,7 @@ void func_80B96560(ObjLift* this, PlayState* play) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->timer <= 0) { - if (PARAMS_GET(this->dyna.actor.params, 8, 7) == 7) { + if (PARAMS_GET(this->dyna.actor.params, 8, 3) == 7) { func_80B967C0(this); } else { quakeIndex = Quake_Add(GET_ACTIVE_CAM(play), 1); @@ -150,7 +150,7 @@ void func_80B96560(ObjLift* this, PlayState* play) { } } } else { - this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 7)]; + this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 3)]; } } @@ -201,7 +201,7 @@ void func_80B96840(ObjLift* this, PlayState* play) { (sMaxFallDistances[PARAMS_GET(this->dyna.actor.params, 1, 1)] - 0.001f)) { func_80B96160(this, play); SoundSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 6)); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 9156831487d..ca7c09c38a3 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -104,10 +104,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { Actor* thisx = &this->actor; // required s32 type; - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { - type = PARAMS_GET(this->actor.params, 4, 3); + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + type = PARAMS_GET(this->actor.params, 4, 2); - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); if (type == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_TRE_BOX_APPEAR); @@ -120,10 +120,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { } void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { - Flags_UnsetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); - if (PARAMS_GET(this->actor.params, 4, 3) == OBJLIGHTSWITCH_TYPE_1) { + if (PARAMS_GET(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, &this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -161,13 +161,13 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, PlayState* play) void ObjLightswitch_Init(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; - s32 switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F)); + s32 switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); s32 removeSelf = false; Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetFocus(&this->actor, 0.0f); if (switchFlagSet) { - if (PARAMS_GET(this->actor.params, 4, 3) == OBJLIGHTSWITCH_TYPE_BURN) { + if (PARAMS_GET(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN) { removeSelf = true; } else { ObjLightswitch_SetupOn(this); @@ -222,7 +222,7 @@ void ObjLightswitch_SetupOff(ObjLightswitch* this) { } void ObjLightswitch_Off(ObjLightswitch* this, PlayState* play) { - switch (PARAMS_GET(this->actor.params, 4, 3)) { + switch (PARAMS_GET(this->actor.params, 4, 2)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: if (this->collider.base.acFlags & AC_HIT) { @@ -289,9 +289,9 @@ void ObjLightswitch_SetupOn(ObjLightswitch* this) { } void ObjLightswitch_On(ObjLightswitch* this, PlayState* play) { - switch (PARAMS_GET(this->actor.params, 4, 3)) { + switch (PARAMS_GET(this->actor.params, 4, 2)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { ObjLightswitch_SetupTurnOff(this); } break; @@ -325,7 +325,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) { } void ObjLightswitch_TurnOff(ObjLightswitch* this, PlayState* play) { - if (PARAMS_GET(this->actor.params, 4, 3) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || + if (PARAMS_GET(this->actor.params, 4, 2) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || this->toggleDelay <= 0) { this->timer--; @@ -492,7 +492,7 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->collider); } - if (PARAMS_GET(this->actor.params, 4, 3) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { + if (PARAMS_GET(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { ObjLightswitch_DrawXlu(this, play); } else { ObjLightswitch_DrawOpa(this, play); diff --git a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c index 46261f32735..e423b594691 100644 --- a/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c +++ b/src/overlays/actors/ovl_Obj_Makekinsuta/z_obj_makekinsuta.c @@ -30,7 +30,7 @@ const ActorInit Obj_Makekinsuta_InitVars = { void ObjMakekinsuta_Init(Actor* thisx, PlayState* play) { ObjMakekinsuta* this = (ObjMakekinsuta*)thisx; - if (PARAMS_GET_NOSHIFT(this->actor.params, 13, 3) == 0x4000) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 13, 2) == 0x4000) { osSyncPrintf(VT_FGCOL(BLUE)); // "Gold Star Enemy(arg_data %x)" osSyncPrintf("金スタ発生敵(arg_data %x)\n", this->actor.params); diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index 06739d26318..f584dddff69 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -53,9 +53,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) { s32 typeIdx; Vec3f* spawnPos; - if (!PARAMS_GET(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { + if (!PARAMS_GET(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { typeIdx = 1; - } else if (!PARAMS_GET(thisx->params, 0xE, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { + } else if (!PARAMS_GET(thisx->params, 14, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { typeIdx = 2; } else { typeIdx = 0; @@ -93,7 +93,7 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { if (PARAMS_GET(thisx->params, 6, 1)) { sfxCond1 = false; } else { - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { cond = true; } else { cond = false; @@ -101,10 +101,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { sfxCond1 = sFlags[i][0] ^ cond; } - if (PARAMS_GET(thisx->params, 0xE, 1)) { + if (PARAMS_GET(thisx->params, 14, 1)) { sfxCond2 = false; } else { - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { cond2 = true; } else { cond2 = false; @@ -117,8 +117,8 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { } } - sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET(thisx->params, 0, 0x3F)); - sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET(thisx->params, 8, 0x3F)); + sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET(thisx->params, 0, 6)); + sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET(thisx->params, 8, 6)); if (block->unk_24[i] & 2) { ((ObjOshihiki*)thisx->child)->cantMove = true; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index 4d9cbd6c667..bdd8815167e 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -89,10 +89,10 @@ s32 ObjMure_SetCulling(Actor* thisx, PlayState* play) { void ObjMure_Init(Actor* thisx, PlayState* play) { ObjMure* this = (ObjMure*)thisx; - this->chNum = PARAMS_GET(thisx->params, 0xC, 0x0F); - this->ptn = PARAMS_GET(thisx->params, 8, 0x07); - this->svNum = PARAMS_GET(thisx->params, 5, 0x03); - this->type = PARAMS_GET(thisx->params, 0, 0x1F); + this->chNum = PARAMS_GET(thisx->params, 12, 4); + this->ptn = PARAMS_GET(thisx->params, 8, 3); + this->svNum = PARAMS_GET(thisx->params, 5, 2); + this->type = PARAMS_GET(thisx->params, 0, 5); if (this->ptn >= 4) { osSyncPrintf("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 237, thisx->params); diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index f2e0c0d6080..32106db12ce 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -52,7 +52,7 @@ void ObjMure2_SetPosShrubCircle(Vec3f* vec, ObjMure2* this) { s32 i; Math_Vec3f_Copy(vec, &this->actor.world.pos); - for (i = 1; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { + for (i = 1; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS((i - 1) * 0x2000)); (vec + i)->z += (80.0f * Math_CosS((i - 1) * 0x2000)); @@ -67,7 +67,7 @@ static Mure2sScatteredShrubInfo sScatteredShrubInfo[] = { void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (sScatteredShrubInfo[i].radius * Math_CosS(sScatteredShrubInfo[i].angle)); (vec + i)->z -= (sScatteredShrubInfo[i].radius * Math_SinS(sScatteredShrubInfo[i].angle)); @@ -77,7 +77,7 @@ void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS(i * 0x2000)); (vec + i)->z += (80.0f * Math_CosS(i * 0x2000)); @@ -86,12 +86,12 @@ void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetActorSpawnParams(s16* params, ObjMure2* this) { static s16 actorSpawnParams[] = { 0, 0, 0 }; - s16 dropTable = PARAMS_GET(this->actor.params, 8, 0xF); + s16 dropTable = PARAMS_GET(this->actor.params, 8, 4); if (dropTable >= 13) { dropTable = 0; } - *params = actorSpawnParams[PARAMS_GET(this->actor.params, 0, 3)] & 0xF0FF; + *params = actorSpawnParams[PARAMS_GET(this->actor.params, 0, 2)] & 0xF0FF; *params |= (dropTable << 8); } @@ -101,7 +101,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { ObjMure2_SetPosShrubScattered, ObjMure2_SetPosRockCircle, }; - s32 actorNum = PARAMS_GET(this->actor.params, 0, 3); + s32 actorNum = PARAMS_GET(this->actor.params, 0, 2); s32 i; Vec3f spawnPos[12]; s16 params; @@ -131,7 +131,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { if (((this->currentActorNum >> i) & 1) == 0) { if (this->actorSpawnPtrList[i] != NULL) { if (Actor_HasParent(this->actorSpawnPtrList[i], play)) { @@ -150,7 +150,7 @@ void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { void func_80B9A534(ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 3)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { if (this->actorSpawnPtrList[i] != NULL && (((this->currentActorNum >> i) & 1) == 0) && (this->actorSpawnPtrList[i]->update == NULL)) { this->currentActorNum |= (1 << i); @@ -189,7 +189,7 @@ void func_80B9A658(ObjMure2* this) { void func_80B9A668(ObjMure2* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < - (sDistSquared1[PARAMS_GET(this->actor.params, 0, 3)] * this->unk_184)) { + (sDistSquared1[PARAMS_GET(this->actor.params, 0, 2)] * this->unk_184)) { this->actor.flags |= ACTOR_FLAG_4; ObjMure2_SpawnActors(this, play); func_80B9A6E8(this); @@ -202,7 +202,7 @@ void func_80B9A6E8(ObjMure2* this) { void func_80B9A6F8(ObjMure2* this, PlayState* play) { func_80B9A534(this); - if ((sDistSquared2[PARAMS_GET(this->actor.params, 0, 3)] * this->unk_184) <= + if ((sDistSquared2[PARAMS_GET(this->actor.params, 0, 2)] * this->unk_184) <= Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) { this->actor.flags &= ~ACTOR_FLAG_4; ObjMure2_CleanupAndDie(this, play); diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index f0efb0adcb3..1ad8f948fbf 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -104,7 +104,7 @@ void func_80B9ABA0(ObjMure3* this, PlayState* play) { } void func_80B9ACE4(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 7)]; + s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 3)]; s32 i; for (i = 0; i < count; i++) { @@ -122,7 +122,7 @@ void func_80B9ACE4(ObjMure3* this, PlayState* play) { } void func_80B9ADCC(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 7)]; + s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 3)]; s32 i; for (i = 0; i < count; i++) { @@ -130,7 +130,7 @@ void func_80B9ADCC(ObjMure3* this, PlayState* play) { if ((*collectible != NULL) && !((this->unk_16C >> i) & 1)) { if (Actor_HasParent(&(*collectible)->actor, play)) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); } if ((*collectible)->actor.update == NULL) { this->unk_16C |= (1 << i); @@ -144,7 +144,7 @@ void ObjMure3_Init(Actor* thisx, PlayState* play) { s32 pad; ObjMure3* this = (ObjMure3*)thisx; - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { Actor_Kill(&this->actor); return; } @@ -172,7 +172,7 @@ void func_80B9AF64(ObjMure3* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < SQ(1150.0f)) { this->actor.flags |= ACTOR_FLAG_4; - spawnFuncs[PARAMS_GET(this->actor.params, 13, 7)](this, play); + spawnFuncs[PARAMS_GET(this->actor.params, 13, 3)](this, play); func_80B9AFEC(this); } } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 8bc4c8016ec..fa259f03c61 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -112,7 +112,7 @@ s32 ObjOshihiki_StrongEnough(ObjOshihiki* this) { return 0; } strength = Player_GetStrength(); - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -179,16 +179,16 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* if (dyna == NULL) { return 1; } else if (dyna->actor.id == ACTOR_OBJ_SWITCH) { - dynaSwitchFlag = PARAMS_GET(dyna->actor.params, 8, 0x3F); - switch (PARAMS_GET(dyna->actor.params, 0, 0x33)) { + dynaSwitchFlag = PARAMS_GET(dyna->actor.params, 8, 6); + switch (dyna->actor.params & 0x33) { // TODO params macro case 0x20: // Normal blue switch - if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 0x3F)) && + if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 6)) && Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } break; case 0x30: // Inverse blue switch - if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 0x3F)) && + if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 6)) && !Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } @@ -199,7 +199,7 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* } void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -219,11 +219,11 @@ void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { } void ObjOshihiki_SetScale(ObjOshihiki* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET(this->dyna.actor.params, 0, 0xF)]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET(this->dyna.actor.params, 0, 4)]); } void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -247,7 +247,7 @@ void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play) { s16 paramsColorIdx; s32 i; - paramsColorIdx = PARAMS_GET(this->dyna.actor.params, 6, 3); + paramsColorIdx = PARAMS_GET(this->dyna.actor.params, 6, 2); for (i = 0; i < ARRAY_COUNT(sScenes); i++) { if (sScenes[i] == play->sceneNum) { @@ -273,9 +273,9 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { ObjOshihiki_CheckType(this, play); - if ((PARAMS_GET(this->dyna.actor.params, 8, 0xFF) >= 0) && (PARAMS_GET(this->dyna.actor.params, 8, 0xFF) <= 0x3F)) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + if ((PARAMS_GET(this->dyna.actor.params, 8, 8) >= 0) && (PARAMS_GET(this->dyna.actor.params, 8, 8) <= 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -284,7 +284,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { return; } } else { - switch (PARAMS_GET(this->dyna.actor.params, 0, 0xF)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_OFF: case PUSHBLOCK_MEDIUM_START_OFF: case PUSHBLOCK_LARGE_START_OFF: diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 33eedd8b796..057868df097 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -30,8 +30,8 @@ const ActorInit Obj_Roomtimer_InitVars = { void ObjRoomtimer_Init(Actor* thisx, PlayState* play) { ObjRoomtimer* this = (ObjRoomtimer*)thisx; - this->switchFlag = PARAMS_GET(this->actor.params, 10, 0x3F); - this->actor.params = PARAMS_GET(this->actor.params, 0, 0x3FF); + this->switchFlag = PARAMS_GET(this->actor.params, 10, 6); + this->actor.params = PARAMS_GET(this->actor.params, 0, 10); if (this->actor.params != 0x3FF) { this->actor.params = CLAMP_MAX(this->actor.params, 600); diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 6b1cf0ab8af..5b8d945cf99 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -10,9 +10,9 @@ #define FLAGS ACTOR_FLAG_4 -// type: PARAMS_GET(this->dyna.actor.params, 0, 7) -// subtype: PARAMS_GET(this->dyna.actor.params, 4, 7) -// switch flag: PARAMS_GET(this->dyna.actor.params, 8, 0x3F) +// type: PARAMS_GET(this->dyna.actor.params, 0, 3) +// subtype: PARAMS_GET(this->dyna.actor.params, 4, 3) +// switch flag: PARAMS_GET(this->dyna.actor.params, 8, 6) // frozen: PARAMS_GET(this->dyna.actor.params, 7, 1) void ObjSwitch_Init(Actor* thisx, PlayState* play); @@ -235,18 +235,18 @@ Actor* ObjSwitch_SpawnIce(ObjSwitch* this, PlayState* play) { return Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_OBJ_ICE_POLY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z, - PARAMS_GET(this->dyna.actor.params, 8, 0x3F) << 8); + PARAMS_GET(this->dyna.actor.params, 8, 6) << 8); } void ObjSwitch_SetOn(ObjSwitch* this, PlayState* play) { s32 pad; s32 subType; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { this->cooldownOn = false; } else { - subType = PARAMS_GET(this->dyna.actor.params, 4, 7); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + subType = PARAMS_GET(this->dyna.actor.params, 4, 3); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); if (subType == OBJSWITCH_SUBTYPE_ONCE || subType == OBJSWITCH_SUBTYPE_SYNC) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_CORRECT_CHIME); @@ -261,10 +261,10 @@ void ObjSwitch_SetOn(ObjSwitch* this, PlayState* play) { void ObjSwitch_SetOff(ObjSwitch* this, PlayState* play) { this->cooldownOn = false; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); - if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_TOGGLE) { + if (PARAMS_GET(this->dyna.actor.params, 4, 3) == OBJSWITCH_SUBTYPE_TOGGLE) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); this->cooldownOn = true; } @@ -283,8 +283,8 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) { s32 switchFlagSet; s32 type; - switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F)); - type = PARAMS_GET(this->dyna.actor.params, 0, 7); + switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + type = PARAMS_GET(this->dyna.actor.params, 0, 3); if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { ObjSwitch_InitDynaPoly(this, play, &gFloorSwitchCol, DPM_PLAYER); @@ -350,14 +350,14 @@ void ObjSwitch_Init(Actor* thisx, PlayState* play) { void ObjSwitch_Destroy(Actor* thisx, PlayState* play) { ObjSwitch* this = (ObjSwitch*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { case OBJSWITCH_TYPE_FLOOR: case OBJSWITCH_TYPE_FLOOR_RUSTY: DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); break; } - switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { case OBJSWITCH_TYPE_FLOOR_RUSTY: case OBJSWITCH_TYPE_EYE: Collider_DestroyTris(play, &this->tris.col); @@ -375,7 +375,7 @@ void ObjSwitch_FloorUpInit(ObjSwitch* this) { } void ObjSwitch_FloorUp(ObjSwitch* this, PlayState* play) { - if (PARAMS_GET(this->dyna.actor.params, 0, 7) == OBJSWITCH_TYPE_FLOOR_RUSTY) { + if (PARAMS_GET(this->dyna.actor.params, 0, 3) == OBJSWITCH_TYPE_FLOOR_RUSTY) { if (this->tris.col.base.acFlags & AC_HIT) { ObjSwitch_FloorPressInit(this); ObjSwitch_SetOn(this, play); @@ -384,7 +384,7 @@ void ObjSwitch_FloorUp(ObjSwitch* this, PlayState* play) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->tris.col.base); } } else { - switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 3)) { case OBJSWITCH_SUBTYPE_ONCE: if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { ObjSwitch_FloorPressInit(this); @@ -420,7 +420,7 @@ void ObjSwitch_FloorPressInit(ObjSwitch* this) { } void ObjSwitch_FloorPress(ObjSwitch* this, PlayState* play) { - if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_HOLD_INVERTED || !this->cooldownOn || + if (PARAMS_GET(this->dyna.actor.params, 4, 3) == OBJSWITCH_SUBTYPE_HOLD_INVERTED || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->dyna.actor.scale.y -= 99.0f / 2000.0f; if (this->dyna.actor.scale.y <= 33.0f / 2000.0f) { @@ -438,9 +438,9 @@ void ObjSwitch_FloorDownInit(ObjSwitch* this) { } void ObjSwitch_FloorDown(ObjSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 3)) { case OBJSWITCH_SUBTYPE_ONCE: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { ObjSwitch_FloorReleaseInit(this); } break; @@ -456,7 +456,7 @@ void ObjSwitch_FloorDown(ObjSwitch* this, PlayState* play) { if (!func_800435B4(&this->dyna) && !Player_InCsMode(play)) { if (this->releaseTimer <= 0) { ObjSwitch_FloorReleaseInit(this); - if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_HOLD) { + if (PARAMS_GET(this->dyna.actor.params, 4, 3) == OBJSWITCH_SUBTYPE_HOLD) { ObjSwitch_SetOff(this, play); } else { ObjSwitch_SetOn(this, play); @@ -475,7 +475,7 @@ void ObjSwitch_FloorReleaseInit(ObjSwitch* this) { } void ObjSwitch_FloorRelease(ObjSwitch* this, PlayState* play) { - s16 subType = PARAMS_GET(this->dyna.actor.params, 4, 7); + s16 subType = PARAMS_GET(this->dyna.actor.params, 4, 3); if (((subType != OBJSWITCH_SUBTYPE_TOGGLE) && (subType != OBJSWITCH_SUBTYPE_HOLD_INVERTED)) || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { @@ -511,7 +511,7 @@ void ObjSwitch_EyeFrozenInit(ObjSwitch* this) { } void ObjSwitch_EyeInit(ObjSwitch* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { ObjSwitch_EyeClosedInit(this); } else { ObjSwitch_EyeOpenInit(this); @@ -552,9 +552,9 @@ void ObjSwitch_EyeClosedInit(ObjSwitch* this) { } void ObjSwitch_EyeClosed(ObjSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 3)) { case OBJSWITCH_SUBTYPE_ONCE: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { ObjSwitch_EyeOpeningInit(this); this->dyna.actor.params &= ~0x80; } @@ -575,7 +575,7 @@ void ObjSwitch_EyeOpeningInit(ObjSwitch* this) { } void ObjSwitch_EyeOpening(ObjSwitch* this, PlayState* play) { - if (PARAMS_GET(this->dyna.actor.params, 4, 7) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || + if (PARAMS_GET(this->dyna.actor.params, 4, 3) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { this->eyeTexIndex--; if (this->eyeTexIndex <= 0) { @@ -594,7 +594,7 @@ void ObjSwitch_CrystalOffInit(ObjSwitch* this) { } void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 3)) { case OBJSWITCH_SUBTYPE_ONCE: if ((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) { this->disableAcTimer = 10; @@ -604,7 +604,7 @@ void ObjSwitch_CrystalOff(ObjSwitch* this, PlayState* play) { break; case OBJSWITCH_SUBTYPE_SYNC: if (((this->jntSph.col.base.acFlags & AC_HIT) && this->disableAcTimer <= 0) || - Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { this->disableAcTimer = 10; ObjSwitch_SetOn(this, play); ObjSwitch_CrystalTurnOnInit(this); @@ -629,7 +629,7 @@ void ObjSwitch_CrystalTurnOnInit(ObjSwitch* this) { void ObjSwitch_CrystalTurnOn(ObjSwitch* this, PlayState* play) { if (!this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOnInit(this); - if (PARAMS_GET(this->dyna.actor.params, 4, 7) == OBJSWITCH_SUBTYPE_TOGGLE) { + if (PARAMS_GET(this->dyna.actor.params, 4, 3) == OBJSWITCH_SUBTYPE_TOGGLE) { ObjSwitch_UpdateTwoTexScrollXY(this); } Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_DIAMOND_SWITCH); @@ -645,10 +645,10 @@ void ObjSwitch_CrystalOnInit(ObjSwitch* this) { } void ObjSwitch_CrystalOn(ObjSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 4, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 4, 3)) { case OBJSWITCH_SUBTYPE_ONCE: case OBJSWITCH_SUBTYPE_SYNC: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 0x3F))) { + if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { ObjSwitch_CrystalTurnOffInit(this); } break; @@ -670,7 +670,7 @@ void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this) { } void ObjSwitch_CrystalTurnOff(ObjSwitch* this, PlayState* play) { - if (PARAMS_GET(this->dyna.actor.params, 4, 7) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || + if (PARAMS_GET(this->dyna.actor.params, 4, 3) != OBJSWITCH_SUBTYPE_TOGGLE || !this->cooldownOn || func_8005B198() == this->dyna.actor.category || this->cooldownTimer <= 0) { ObjSwitch_CrystalOffInit(this); ObjSwitch_UpdateTwoTexScrollXY(this); @@ -690,7 +690,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); - switch (PARAMS_GET(this->dyna.actor.params, 0, 7)) { + switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { case OBJSWITCH_TYPE_FLOOR: case OBJSWITCH_TYPE_FLOOR_RUSTY: this->unk_17F = this->dyna.interactFlags; @@ -718,7 +718,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { void ObjSwitch_DrawFloor(ObjSwitch* this, PlayState* play) { static Gfx* floorSwitchDLists[] = { gFloorSwitch1DL, gFloorSwitch3DL, gFloorSwitch2DL, gFloorSwitch2DL }; - Gfx_DrawDListOpa(play, floorSwitchDLists[PARAMS_GET(this->dyna.actor.params, 4, 7)]); + Gfx_DrawDListOpa(play, floorSwitchDLists[PARAMS_GET(this->dyna.actor.params, 4, 3)]); } void ObjSwitch_DrawFloorRusty(ObjSwitch* this, PlayState* play) { @@ -732,7 +732,7 @@ void ObjSwitch_DrawEye(ObjSwitch* this, PlayState* play) { }; static Gfx* eyeDlists[] = { gEyeSwitch1DL, gEyeSwitch2DL }; s32 pad; - s32 subType = PARAMS_GET(this->dyna.actor.params, 4, 7); + s32 subType = PARAMS_GET(this->dyna.actor.params, 4, 3); OPEN_DISPS(play->state.gfxCtx, "../z_obj_switch.c", 1459); @@ -754,7 +754,7 @@ void ObjSwitch_DrawCrystal(ObjSwitch* this, PlayState* play) { s32 pad2; s32 subType; - subType = PARAMS_GET(this->dyna.actor.params, 4, 7); + subType = PARAMS_GET(this->dyna.actor.params, 4, 3); func_8002ED80(&this->dyna.actor, play, 0); if (1) {} @@ -794,5 +794,5 @@ static ObjSwitchActionFunc sDrawFuncs[] = { void ObjSwitch_Draw(Actor* thisx, PlayState* play) { ObjSwitch* this = (ObjSwitch*)thisx; - sDrawFuncs[PARAMS_GET(this->dyna.actor.params, 0, 7)](this, play); + sDrawFuncs[PARAMS_GET(this->dyna.actor.params, 0, 3)](this, play); } diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 2057a33b2cc..800df5882e1 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -81,14 +81,14 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { static u8 sColTypesStand[] = { 0x09, 0x0B, 0x0B }; s32 pad; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 0xF); + s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 4); Actor_ProcessInitChain(&this->actor, sInitChain); ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f); Collider_InitCylinder(play, &this->colliderStand); Collider_SetCylinder(play, &this->colliderStand, &this->actor, &sCylInitStand); - this->colliderStand.base.colType = sColTypesStand[PARAMS_GET_NOMASK(this->actor.params, 0xC)]; + this->colliderStand.base.colType = sColTypesStand[PARAMS_GET_NOMASK(this->actor.params, 12)]; Collider_InitCylinder(play, &this->colliderFlame); Collider_SetCylinder(play, &this->colliderFlame, &this->actor, &sCylInitFlame); @@ -99,7 +99,7 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 0x3F)))) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)))) { this->litTimer = -1; } @@ -120,9 +120,9 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play) { void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchCount = PARAMS_GET(this->actor.params, 6, 0xF); - s32 switchFlag = PARAMS_GET(this->actor.params, 0, 0x3F); - s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 0xF); + s32 torchCount = PARAMS_GET(this->actor.params, 6, 4); + s32 switchFlag = PARAMS_GET(this->actor.params, 0, 6); + s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 4); s32 litTimeScale; WaterBox* dummy; f32 waterSurface; @@ -263,7 +263,7 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { ObjSyokudai* this = (ObjSyokudai*)thisx; s32 timerMax; - timerMax = PARAMS_GET(this->actor.params, 6, 0xF) * 50 + 100; + timerMax = PARAMS_GET(this->actor.params, 6, 4) * 50 + 100; OPEN_DISPS(play->state.gfxCtx, "../z_obj_syokudai.c", 707); Gfx_SetupDL_25Opa(play->state.gfxCtx); @@ -271,7 +271,7 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, "../z_obj_syokudai.c", 714), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, displayLists[PARAMS_GET_NOMASK((u16)this->actor.params, 0xC)]); + gSPDisplayList(POLY_OPA_DISP++, displayLists[PARAMS_GET_NOMASK((u16)this->actor.params, 12)]); if (this->litTimer != 0) { f32 flameScale = 1.0f; diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index ed03768fcf0..ee8b166ca81 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -114,14 +114,14 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { if (PARAMS_GET(this->dyna.actor.params, 6, 1)) { this->unk_177 = 0; } else { - this->unk_177 = (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) < 0x38) ? 2 : 1; + this->unk_177 = (PARAMS_GET(this->dyna.actor.params, 0, 6) < 0x38) ? 2 : 1; } this->songObserverFunc = ObjTimeblock_WaitForOcarina; Actor_SetFocus(&this->dyna.actor, sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].height); - this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) ? true : false; this->unk_175 = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; this->isVisible = ObjTimeblock_CalculateIsVisible(this); @@ -135,7 +135,7 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { // "Block of time" osSyncPrintf("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 7), + this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 3), PARAMS_GET(this->dyna.actor.params, 10, 1)); } @@ -151,7 +151,7 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, PlayState* play) { return false; } - if (this->dyna.actor.xzDistToPlayer <= sRanges[PARAMS_GET(this->dyna.actor.params, 11, 7)]) { + if (this->dyna.actor.xzDistToPlayer <= sRanges[PARAMS_GET(this->dyna.actor.params, 11, 3)]) { Vec3f distance; f32 blockSize; @@ -225,7 +225,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { if (this->unk_177 == 0) { this->dyna.actor.params ^= 0x8000; } else { - ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } } @@ -236,7 +236,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { if (this->unk_177 == 0) { this->unk_175 = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; } else { - this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) ? true : false; } } } @@ -253,7 +253,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { } void func_80BA06AC(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); + s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); this->unk_172 = play->msgCtx.lastPlayedSong; @@ -277,7 +277,7 @@ void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play) { OnePointCutscene_Attention(play, &this->dyna.actor); // "Time Block Attention Camera (frame counter)" osSyncPrintf("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n", play->state.frames); - ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } func_80BA06AC(this, play); @@ -296,7 +296,7 @@ void ObjTimeblock_SetupAltBehaviourNotVisible(ObjTimeblock* this) { } void ObjTimeblock_AltBehaviourNotVisible(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 0x3F); + s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); s8 switchFlagIsSet = (Flags_GetSwitch(play, switchFlag)) ? true : false; if (this->unk_176 ^ switchFlagIsSet && switchFlagIsSet ^ (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false)) { diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 4046266aa57..ad7bba5fb6f 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -83,10 +83,10 @@ static InitChainEntry sInitChain[] = { }; void ObjTsubo_SpawnCollectible(ObjTsubo* this, PlayState* play) { - s16 dropParams = PARAMS_GET(this->actor.params, 0, 0x1F); + s16 dropParams = PARAMS_GET(this->actor.params, 0, 5); if ((dropParams >= 0) && (dropParams < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET(this->actor.params, 9, 0x3F) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET(this->actor.params, 9, 6) << 8)); } } diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 37b328b9c20..4def90db4fd 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -86,8 +86,8 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { temp_a3 = this->dyna.actor.child; player = GET_PLAYER(play); - if ((this->dyna.actor.xzDistToPlayer <= sDistances[PARAMS_GET(this->dyna.actor.params, 0xB, 7)]) || - (temp_a3->xzDistToPlayer <= sDistances[PARAMS_GET(temp_a3->params, 0xB, 7)])) { + if ((this->dyna.actor.xzDistToPlayer <= sDistances[PARAMS_GET(this->dyna.actor.params, 11, 3)]) || + (temp_a3->xzDistToPlayer <= sDistances[PARAMS_GET(temp_a3->params, 11, 3)])) { func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos); temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f; @@ -142,14 +142,14 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { this->dyna.actor.focus.rot = this->dyna.actor.child->focus.rot; this->dyna.actor.child->focus.rot = tempRot; - temp = PARAMS_GET(this->dyna.actor.params, 0, 0x7FFF); - this->dyna.actor.params = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET(this->dyna.actor.child->params, 0, 0x7FFF); + temp = PARAMS_GET(this->dyna.actor.params, 0, 15); + this->dyna.actor.params = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET(this->dyna.actor.child->params, 0, 15); this->dyna.actor.child->params = PARAMS_GET_NOSHIFT(this->dyna.actor.child->params, 15, 1) | (temp & 0x7FFF); if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos) < 0.01f) { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } else { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F)); + Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); } } @@ -207,9 +207,9 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { this->func_168 = func_80BA2218; Actor_SetFocus(&this->dyna.actor, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].focus); - if (PARAMS_GET(this->dyna.actor.params, 0xF, 1)) { + if (PARAMS_GET(this->dyna.actor.params, 15, 1)) { func_80BA24E8(this); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { this->dyna.actor.draw = NULL; } DynaPolyActor_Init(&this->dyna, 0); @@ -219,13 +219,13 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { ObjWarp2block_SetInactive(this); } - osSyncPrintf("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", PARAMS_GET(this->dyna.actor.params, 0, 0xFFFF), - this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 0xB, 7)); + osSyncPrintf("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", PARAMS_GET(this->dyna.actor.params, 0, 16), + this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 3)); } void ObjWarp2block_Destroy(Actor* thisx, PlayState* play) { ObjWarp2block* this = (ObjWarp2block*)thisx; - if (PARAMS_GET(this->dyna.actor.params, 0xF, 1)) { + if (PARAMS_GET(this->dyna.actor.params, 15, 1)) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } } @@ -246,10 +246,10 @@ void func_80BA24F8(ObjWarp2block* this, PlayState* play) { Actor* current = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (current != NULL) { - if (current->id == ACTOR_OBJ_WARP2BLOCK && !PARAMS_GET(current->params, 0xF, 1) && - (PARAMS_GET(this->dyna.actor.params, 0, 0x3F) == PARAMS_GET(current->params, 0, 0x3F))) { + if (current->id == ACTOR_OBJ_WARP2BLOCK && !PARAMS_GET(current->params, 15, 1) && + (PARAMS_GET(this->dyna.actor.params, 0, 6) == PARAMS_GET(current->params, 0, 6))) { this->dyna.actor.child = current; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 0x3F))) { + if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { ObjWarp2block_SwapWithChild(this, play); this->dyna.actor.draw = ObjWarp2block_Draw; } diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index b0de2381918..4bd9250f11e 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -59,7 +59,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { // "Ocarina secret occurrence" osSyncPrintf("%d ---- オカリナの秘密発生!!!!!!!!!!!!!\n", this->actor.params); - params = PARAMS_GET(this->actor.params, 0, 0xFF); + params = PARAMS_GET(this->actor.params, 0, 8); if (params == 0x40 || params == 0x41) { this->unk_1A4 = 0; this->actor.flags |= ACTOR_FLAG_4; @@ -76,7 +76,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { void ShotSun_Destroy(Actor* thisx, PlayState* play) { ShotSun* this = (ShotSun*)thisx; - s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); + s32 params = PARAMS_GET(this->actor.params, 0, 8); if (params != 0x40 && params != 0x41) { Collider_DestroyCylinder(play, &this->collider); @@ -84,7 +84,7 @@ void ShotSun_Destroy(Actor* thisx, PlayState* play) { } void ShotSun_SpawnFairy(ShotSun* this, PlayState* play) { - s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); + s32 params = PARAMS_GET(this->actor.params, 0, 8); s32 fairyType; if (this->timer > 0) { @@ -122,7 +122,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { void func_80BADF0C(ShotSun* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s32 params = PARAMS_GET(this->actor.params, 0, 0xFF); + s32 params = PARAMS_GET(this->actor.params, 0, 8); if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) { this->unk_1A4 = 0; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 208f1eced4f..ecc65566881 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4432,7 +4432,7 @@ s32 func_80839800(Player* this, PlayState* play) { this->stateFlags1 |= PLAYER_STATE1_29; Actor_DisableLens(play); - if (PARAMS_GET(doorActor->params, 7, 7) == 3) { + if (PARAMS_GET(doorActor->params, 7, 3) == 3) { sp4C.x = doorActor->world.pos.x - (sp6C * sp74); sp4C.y = doorActor->world.pos.y + 10.0f; sp4C.z = doorActor->world.pos.z - (sp6C * sp78); @@ -4555,7 +4555,7 @@ void func_8083A0F4(PlayState* play, Player* this) { func_80835C58(play, this, func_80846120, 0); this->stateFlags1 |= PLAYER_STATE1_29; anim = &gPlayerAnim_002F98; - } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET(interactRangeActor->params, 0, 0xF) == 1)) { + } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET(interactRangeActor->params, 0, 4) == 1)) { func_80835C58(play, this, func_80846260, 0); anim = &gPlayerAnim_0032B0; } else if (((interactActorId == ACTOR_EN_BOMBF) || (interactActorId == ACTOR_EN_KUSA)) && @@ -6194,7 +6194,7 @@ s32 func_8083E5A8(Player* this, PlayState* play) { } else { s32 strength = Player_GetStrength(); - if ((interactedActor->id == ACTOR_EN_ISHI) && (PARAMS_GET(interactedActor->params, 0, 0xF) == 1) && + if ((interactedActor->id == ACTOR_EN_ISHI) && (PARAMS_GET(interactedActor->params, 0, 4) == 1) && (strength < PLAYER_STR_SILVER_G)) { return 0; } @@ -9355,7 +9355,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { } if (func_80845C68(play, (respawnFlag == 2) ? 1 : 0) == 0) { - gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PARAMS_GET2(thisx->params, 0, 0xFF) | 0xD00; + gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PARAMS_GET2(thisx->params, 0, 8) | 0xD00; } gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1; @@ -9364,7 +9364,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { gSaveContext.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneNum]; } - initMode = PARAMS_GET2(thisx->params, 8, 0xF00); + initMode = PARAMS_GET2(thisx->params, 8, 4); if ((initMode == 5) || (initMode == 6)) { if (gSaveContext.cutsceneIndex >= 0xFFF0) { initMode = 13; From 3530c74a6c308390b46dcc7419ab237ac98f12d4 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Wed, 13 Jul 2022 19:22:28 +0100 Subject: [PATCH 04/16] Add descriptions for each generic macro --- include/z64actor.h | 32 ++++++++++++------- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 2 +- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 4 +-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index e0854f3721e..d1ab822aaf6 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -507,27 +507,37 @@ typedef enum { #define UPDBGCHECKINFO_FLAG_6 (1 << 6) // disable water ripples #define UPDBGCHECKINFO_FLAG_7 (1 << 7) // alternate wall check? +// Converts a number of bits to a bitmask, helper for params macros +// i.e. 3 becomes 0b111 / 7 #define NBITS_TO_MASK(n) \ ((1 << (n)) - 1) -#define PARAMS_GET(p, s, m) \ - (((p) >> (s)) & NBITS_TO_MASK(m)) +// Extracts the `w`-bit value at position `s` in `p`, shifts then masks +// No possibility of sign extension +#define PARAMS_GET(p, s, w) \ + (((p) >> (s)) & NBITS_TO_MASK(w)) -#define PARAMS_GET2(p, s, m) \ - (((p) & (NBITS_TO_MASK(m) << (s))) >> (s)) +// Extracts the `w`-bit value at position `s` in `p`, masks then shifts +// Possibility of sign extension +#define PARAMS_GET2(p, s, w) \ + (((p) & (NBITS_TO_MASK(w) << (s))) >> (s)) +// Extracts all bits past position `s` in `p` #define PARAMS_GET_NOMASK(p, s) \ ((p) >> (s)) -#define PARAMS_GET_NOSHIFT(p, s, m) \ - ((p) & (NBITS_TO_MASK(m) << (s))) +// Extracts the `w`-bit value at position `s` in `p` without shifting it from its current position +#define PARAMS_GET_NOSHIFT(p, s, w) \ + ((p) & (NBITS_TO_MASK(w) << (s))) -// Shift (m) bits from (s1) bit position to (s2) bit position -#define PARAMS_GET_PS(p, s1, s2, m) \ - (((p) >> ((s1) - (s2))) & (NBITS_TO_MASK(m) << (s2))) +// Extracts the `w`-bit value at position `s1` in `p` and shifts it down to position `s2`, shifts then masks +// No possibility of sign extension +#define PARAMS_GET_S(p, s1, s2, w) \ + (((p) >> ((s1) - (s2))) & (NBITS_TO_MASK(w) << (s2))) -// Shift (m) bits from (s1) bit position to (s2) bit position -#define PARAMS_GET2_PS(p, s1, s2, m) \ +// Extracts the `w`-bit value at position `s1` in `p` and shifts it down to position `s2`, masks then shifts +// Possibility of sign extension +#define PARAMS_GET2_S(p, s1, s2, m) \ (((p) & (NBITS_TO_MASK(m) << (s1))) >> ((s1) - (s2))) #endif diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index bec65778d88..e1f8f164303 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -70,7 +70,7 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 6); this->switchFlag = (Flags_GetSwitch(play, this->switchFlag)) ? 1 : 0; } - this->dyna.actor.params = PARAMS_GET2_PS(this->dyna.actor.params, 15, 1, 1); + this->dyna.actor.params = PARAMS_GET2_S(this->dyna.actor.params, 15, 1, 1); if (Flags_GetSwitch(play, switchFlagParam)) { if (this->dyna.actor.params == 0) { this->dyna.actor.params = 1; diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 7939df56743..e8a8eb41d8b 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -320,7 +320,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, play); if ((type == ROCK_LARGE) && - Flags_GetSwitch(play, PARAMS_GET_PS(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2))) { + Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2))) { Actor_Kill(&this->actor); return; } @@ -391,7 +391,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_LARGE) { - Flags_SetSwitch(play, PARAMS_GET_PS(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2)); + Flags_SetSwitch(play, PARAMS_GET_S(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2)); } EnIshi_SetupFly(this); EnIshi_Fall(this); From 9c37da9af8e2cf58ac5ecdb2e056e7e869190087 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Sat, 2 Sep 2023 22:07:50 +0100 Subject: [PATCH 05/16] Reformat --- src/gcc_fix/missing_gcc_functions.c | 16 +++---- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 3 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 4 +- .../z_bg_hidan_kowarerukabe.c | 3 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 7 +-- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 5 ++- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 8 ++-- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 4 +- .../ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c | 3 +- .../z_en_daiku_kakariko.c | 3 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 5 ++- src/overlays/actors/ovl_En_Go/z_en_go.c | 43 +++++++++++-------- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 4 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 20 +++++---- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 4 +- .../ovl_En_Syateki_Niw/z_en_syateki_niw.c | 5 +-- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 2 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 8 ++-- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 3 +- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 3 +- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 6 ++- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 8 ++-- 22 files changed, 95 insertions(+), 72 deletions(-) diff --git a/src/gcc_fix/missing_gcc_functions.c b/src/gcc_fix/missing_gcc_functions.c index c62418c7bbf..b4d87a89268 100644 --- a/src/gcc_fix/missing_gcc_functions.c +++ b/src/gcc_fix/missing_gcc_functions.c @@ -47,7 +47,7 @@ u64 __fixunssfdi(f32 a) { u64 i; } m; - __asm__ ("cvt.l.s %0, %1" : "=f"(m.f) : "f"(a)); + __asm__("cvt.l.s %0, %1" : "=f"(m.f) : "f"(a)); return m.i; } return 0; @@ -61,7 +61,7 @@ u64 __fixunsdfdi(f64 a) { u64 i; } m; - __asm__ ("cvt.l.d %0, %1" : "=f"(m.f) : "f"(a)); + __asm__("cvt.l.d %0, %1" : "=f"(m.f) : "f"(a)); return m.i; } return 0; @@ -74,7 +74,7 @@ s64 __fixsfdi(f32 c) { s64 i; } m; - __asm__ ("cvt.l.s %0, %1" : "=f"(m.f) : "f"(c)); + __asm__("cvt.l.s %0, %1" : "=f"(m.f) : "f"(c)); return m.i; } @@ -85,7 +85,7 @@ s64 __fixdfdi(f64 c) { s64 i; } m; - __asm__ ("cvt.l.d %0, %1" : "=f"(m.f) : "f"(c)); + __asm__("cvt.l.d %0, %1" : "=f"(m.f) : "f"(c)); return m.i; } @@ -98,7 +98,7 @@ f32 __floatdisf(s64 c) { register f32 v; m.i = c; - __asm__ ("cvt.s.l %0, %1" : "=f"(v) : "f"(m.f)); + __asm__("cvt.s.l %0, %1" : "=f"(v) : "f"(m.f)); return v; } @@ -111,7 +111,7 @@ f64 __floatdidf(s64 c) { register f64 v; m.i = c; - __asm__ ("cvt.d.l %0, %1" : "=f"(v) : "f"(m.f)); + __asm__("cvt.d.l %0, %1" : "=f"(v) : "f"(m.f)); return v; } @@ -124,7 +124,7 @@ f32 __floatundisf(u64 c) { register f32 v; m.i = c; - __asm__ ("cvt.s.l %0, %1" : "=f"(v) : "f"(m.f)); + __asm__("cvt.s.l %0, %1" : "=f"(v) : "f"(m.f)); if ((s64)c < 0) { // cvt.s.l assumes signed input, adjust output v += 4294967296.0f; // 2^32 @@ -141,7 +141,7 @@ f64 __floatundidf(u64 c) { register f64 v; m.i = c; - __asm__ ("cvt.d.l %0, %1" : "=f"(v) : "f"(m.f)); + __asm__("cvt.d.l %0, %1" : "=f"(v) : "f"(m.f)); if ((s64)c < 0) { // cvt.d.l assumes signed input, adjust output v += 18446744073709551616.0; // 2^64 diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index 2f7a476cca2..98cad39e151 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -470,7 +470,8 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, PlayState* play) { - if (((PARAMS_GET(this->dyna.actor.params, 0, 8) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || + if (((PARAMS_GET(this->dyna.actor.params, 0, 8) != YELLOW_TALL_2) || + (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; if (this->unk_1C8 >= 2.0f) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 1f71a1e380a..5c76555e2d8 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -69,8 +69,8 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_SetFocus(thisx, 50.0f); - osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, PARAMS_GET(thisx->params, 0, 8), - PARAMS_GET((s32)thisx->params, 8, 8)); + osSyncPrintf("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, + PARAMS_GET(thisx->params, 0, 8), PARAMS_GET((s32)thisx->params, 8, 8)); Actor_ProcessInitChain(thisx, sInitChain); if (PARAMS_GET(thisx->params, 0, 8) < 0 || PARAMS_GET(thisx->params, 0, 8) >= 3) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index da2afbfe84e..264a11dee4f 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -101,7 +101,8 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; - this->dyna.actor.world.pos.y = actorYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8)] + this->dyna.actor.home.pos.y; + this->dyna.actor.world.pos.y = + actorYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8)] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index c9a0d981aaf..405b9fc0298 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -9,8 +9,8 @@ #define FLAGS 0 -#define BGICESHELTER_GET_TYPE(thisx) PARAMS_GET((thisx)->params, 8, 3) -#define BGICESHELTER_NO_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 6, 1) +#define BGICESHELTER_GET_TYPE(thisx) PARAMS_GET((thisx)->params, 8, 3) +#define BGICESHELTER_NO_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 6, 1) void BgIceShelter_Init(Actor* thisx, PlayState* play); void BgIceShelter_Destroy(Actor* thisx, PlayState* play); @@ -179,7 +179,8 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; // The only red ice actor in the game that doesn't use a switch flag is the one for King Zora - if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor) && (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)))) { + if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor) && + (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)))) { Actor_Kill(&this->dyna.actor); return; } diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 4f13933787a..0404d4708fa 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -280,7 +280,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { Matrix_RotateX((M_PI / 4), MTXMODE_NEW); rotY = !PARAMS_GET(this->dyna.actor.params, 0, 2) ? (this->dyna.actor.shape.rot.y + 0x4000) - : (this->dyna.actor.shape.rot.y - 0x4000); + : (this->dyna.actor.shape.rot.y - 0x4000); Matrix_RotateY(BINANG_TO_RAD(rotY), MTXMODE_APPLY); Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); @@ -399,7 +399,8 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) { BgJyaCobra_InitDynapoly(this, play, &gCobraCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (!PARAMS_GET(this->dyna.actor.params, 0, 2) && Flags_GetSwitch(play, PARAMS_GET((s32)this->dyna.actor.params, 8, 6))) { + if (!PARAMS_GET(this->dyna.actor.params, 0, 2) && + Flags_GetSwitch(play, PARAMS_GET((s32)this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0; } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index bf61420cc9e..89ec219b72c 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -10,11 +10,11 @@ #define FLAGS ACTOR_FLAG_4 -#define MOVEBG_TYPE(params) PARAMS_GET((u16)(params), 12, 4) -#define MOVEBG_FLAGS(params) PARAMS_GET((u16)(params), 0, 6) -#define MOVEBG_PATH_ID(params) PARAMS_GET((u16)(params), 8, 4) +#define MOVEBG_TYPE(params) PARAMS_GET((u16)(params), 12, 4) +#define MOVEBG_FLAGS(params) PARAMS_GET((u16)(params), 0, 6) +#define MOVEBG_PATH_ID(params) PARAMS_GET((u16)(params), 8, 4) #define MOVEBG_POINT_ID(params) PARAMS_GET((u16)(params), 0, 4) -#define MOVEBG_SPEED(params) PARAMS_GET((u16)(params), 4, 4) +#define MOVEBG_SPEED(params) PARAMS_GET((u16)(params), 4, 4) void BgMizuMovebg_Init(Actor* thisx, PlayState* play); void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 47a913335c7..95c206e3f27 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -392,8 +392,8 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { collectible->actor.world.rot.y = D_808B85E4[1]; } } else { - collectible = - Item_DropCollectible(play, &tempVector, (PARAMS_GET(actor->params, 0, 6) << 8) | ITEM00_HEART_PIECE); + collectible = Item_DropCollectible(play, &tempVector, + (PARAMS_GET(actor->params, 0, 6) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; collectible->actor.world.rot.y = D_808B85E4[1]; diff --git a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c index 2a5ee19bce7..8fe6dfbb426 100644 --- a/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c +++ b/src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c @@ -69,8 +69,7 @@ void EnBomBowlMan_Init(Actor* thisx, PlayState* play2) { for (i = 0; i < 2; i++) { cucco = (EnSyatekiNiw*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_SYATEKI_NIW, cuccoSpawnPos[i].x, - cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, - SYATEKI_MINIGAME_ALLEY); + cuccoSpawnPos[i].y, cuccoSpawnPos[i].z, 0, 0, 0, SYATEKI_MINIGAME_ALLEY); if (cucco != NULL) { cucco->scale = cuccoScales[i]; cucco->collider.dim.radius = (s16)cuccoColliderDims[i][0]; diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index b9a278cd7dc..ff80feb7f10 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -184,7 +184,8 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnDaikuKakariko_Run; } else { if (this->flags & 8) { - if ((PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SABOORO) || (PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SHIRO)) { + if ((PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SABOORO) || + (PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SHIRO)) { EnDaikuKakariko_ChangeAnim(this, ENDAIKUKAKARIKO_ANIM_5, &this->currentAnimIndex); this->flags |= 0x800; } else { diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 29cf88fd3c3..3757f486576 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -477,8 +477,9 @@ void EnDog_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET2(this->actor.params, 0, 4)].r, colors[PARAMS_GET2(this->actor.params, 0, 4)].g, - colors[PARAMS_GET2(this->actor.params, 0, 4)].b, colors[PARAMS_GET2(this->actor.params, 0, 4)].a); + gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET2(this->actor.params, 0, 4)].r, + colors[PARAMS_GET2(this->actor.params, 0, 4)].g, colors[PARAMS_GET2(this->actor.params, 0, 4)].b, + colors[PARAMS_GET2(this->actor.params, 0, 4)].a); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDog_OverrideLimbDraw, EnDog_PostLimbDraw, this); diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index f56e169cc2c..0795f8e5a13 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -351,25 +351,29 @@ s32 EnGo_UpdateTalking(PlayState* play, Actor* thisx, s16* talkState, f32 intera void EnGo_ChangeAnim(EnGo* this, s32 index) { Animation_Change(&this->skelAnime, sAnimationInfo[index].animation, - sAnimationInfo[index].playSpeed * (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f), 0.0f, - Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, + sAnimationInfo[index].playSpeed * + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f), + 0.0f, Animation_GetLastFrame(sAnimationInfo[index].animation), sAnimationInfo[index].mode, sAnimationInfo[index].morphFrames); } s32 EnGo_IsActorSpawned(EnGo* this, PlayState* play) { if (((this->actor.params) & 0xF0) == 0x90) { return true; - } else if (play->sceneId == SCENE_FIRE_TEMPLE && !Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && LINK_IS_ADULT && - PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10) { + } else if (play->sceneId == SCENE_FIRE_TEMPLE && !Flags_GetSwitch(play, PARAMS_GET_NOMASK(this->actor.params, 8)) && + LINK_IS_ADULT && PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10) { return true; - } else if (play->sceneId == SCENE_GORON_CITY && LINK_IS_ADULT && PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x00) { + } else if (play->sceneId == SCENE_GORON_CITY && LINK_IS_ADULT && + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x00) { return true; } else if (play->sceneId == SCENE_DEATH_MOUNTAIN_TRAIL && LINK_IS_CHILD && - (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x20 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x30 || + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x20 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x30 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x40)) { return true; } else if (play->sceneId == SCENE_GORON_CITY && LINK_IS_CHILD && - (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x50 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x60 || + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x50 || + PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x60 || PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x70)) { return true; } else { @@ -784,8 +788,9 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, - 1000.0f, 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * 0.5f, 0.1f, 1000.0f, + 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -815,8 +820,9 @@ void EnGo_WakeUp(EnGo* this, PlayState* play) { void func_80A40494(EnGo* this, PlayState* play) { f32 frame; - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, - 1000.0f, 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -0.5f, 0.1f, 1000.0f, + 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -837,8 +843,8 @@ void func_80A405CC(EnGo* this, PlayState* play) { f32 frame; lastFrame = Animation_GetLastFrame(&gGoronAnim_004930); - Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f, 0.1f, 1000.0f, - 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f, + 0.1f, 1000.0f, 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; @@ -856,7 +862,8 @@ void func_80A405CC(EnGo* this, PlayState* play) { } void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { - if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) && (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { + if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90) && + (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { if (gSaveContext.save.info.playerData.bgsFlag) { this->interactInfo.talkState = NPC_TALK_STATE_IDLE; } else { @@ -875,7 +882,8 @@ void EnGo_BiggoronActionFunc(EnGo* this, PlayState* play) { EnGo_GetItem(this, play); } } - } else if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0) && (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { + } else if ((PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0) && + (this->interactInfo.talkState == NPC_TALK_STATE_ACTION)) { EnGo_SetupAction(this, EnGo_GetItem); play->msgCtx.stateTimer = 4; play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING; @@ -893,8 +901,9 @@ void func_80A408D8(EnGo* this, PlayState* play) { f32 frame; if (this->skelAnime.playSpeed != 0.0f) { - Math_SmoothStepToF(&this->skelAnime.playSpeed, (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -1.0f, - 0.1f, 1000.0f, 0.1f); + Math_SmoothStepToF(&this->skelAnime.playSpeed, + (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x90 ? 0.5f : 1.0f) * -1.0f, 0.1f, 1000.0f, + 0.1f); frame = this->skelAnime.curFrame; frame += this->skelAnime.playSpeed; if (frame >= 12.0f) { diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index a5d382aac45..b3f0793f583 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -560,8 +560,8 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_SetupRoll(this); // "(Goroiwa)" osSyncPrintf("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, - PARAMS_GET(this->actor.params, 0, 8), PARAMS_GET(this->actor.params, 8, 2), PARAMS_GET(this->actor.params, 10, 1), - this->actor.home.rot.z & 1); + PARAMS_GET(this->actor.params, 0, 8), PARAMS_GET(this->actor.params, 8, 2), + PARAMS_GET(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } void EnGoroiwa_Destroy(Actor* thisx, PlayState* play2) { diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index c56a293a23a..1bba6b3d185 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -797,8 +797,8 @@ void func_80A70978(EnHy* this, PlayState* play) { this->interactInfo.yOffset = sPlayerTrackingInfo[PARAMS_GET2(this->actor.params, 0, 7)].childYOffset; } - Npc_TrackPoint(&this->actor, &this->interactInfo, sPlayerTrackingInfo[PARAMS_GET2(this->actor.params, 0, 7)].presetIndex, - trackingMode); + Npc_TrackPoint(&this->actor, &this->interactInfo, + sPlayerTrackingInfo[PARAMS_GET2(this->actor.params, 0, 7)].presetIndex, trackingMode); if (Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange, EnHy_GetTextId, EnHy_UpdateTalkState)) { @@ -809,8 +809,10 @@ void func_80A70978(EnHy* this, PlayState* play) { s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { switch (play->sceneId) { case SCENE_KAKARIKO_VILLAGE: - if (!(PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_12 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || + if (!(PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_12 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { return true; } else if (!LINK_IS_ADULT) { @@ -901,15 +903,16 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { this->actor.objBankIndex = this->objBankIndexSkel1; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->actor.objBankIndex].segment); SkelAnime_InitFlex(play, &this->skelAnime, - sSkeletonInfo[sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex1].skeleton, NULL, - this->jointTable, this->morphTable, 16); + sSkeletonInfo[sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex1].skeleton, + NULL, this->jointTable, this->morphTable, 16); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[this->objBankIndexOsAnime].segment); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); EnHy_InitCollider(this); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].animInfoIndex); + Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, + sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].animInfoIndex); if ((play->sceneId == SCENE_BACK_ALLEY_DAY) || (play->sceneId == SCENE_MARKET_DAY)) { this->actor.flags &= ~ACTOR_FLAG_4; @@ -1223,7 +1226,8 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { EnHy_SetEnvColor(play->state.gfxCtx, envColorSeg9.r, envColorSeg9.g, envColorSeg9.b, envColorSeg9.a)); - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8 || PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8 || + PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8) { envColorSeg10 = envColorSeg8; } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index 5b2cfd98cd5..5d19d01496f 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -437,8 +437,8 @@ void func_80B0CEA8(EnSw* this, PlayState* play) { Camera* activeCam = GET_ACTIVE_CAM(play); if (!(Math_Vec3f_DistXYZ(&this->actor.world.pos, &activeCam->eye) >= 380.0f)) { - Actor_PlaySfx(&this->actor, - (PARAMS_GET2(this->actor.params, 13, 3) > 0) ? NA_SE_EN_STALGOLD_ROLL : NA_SE_EN_STALWALL_ROLL); + Actor_PlaySfx(&this->actor, (PARAMS_GET2(this->actor.params, 13, 3) > 0) ? NA_SE_EN_STALGOLD_ROLL + : NA_SE_EN_STALWALL_ROLL); } } } diff --git a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c index ff0f5f3244b..2393a679ffb 100644 --- a/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c +++ b/src/overlays/actors/ovl_En_Syateki_Niw/z_en_syateki_niw.c @@ -497,9 +497,8 @@ void EnSyatekiNiw_SetupRemove(EnSyatekiNiw* this, PlayState* play) { Actor_SetFocus(&this->actor, this->focusYOffset); Actor_GetScreenPos(play, &this->actor, &screenX, &screenY); - if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) - && (screenX > 0) && (screenX < SCREEN_WIDTH) && (screenY > 0) - && (screenY < SCREEN_HEIGHT)) { + if ((this->actor.projectedPos.z > 200.0f) && (this->actor.projectedPos.z < 800.0f) && (screenX > 0) && + (screenX < SCREEN_WIDTH) && (screenY > 0) && (screenY < SCREEN_HEIGHT)) { this->actor.speed = 5.0f; this->rotYFlip = Rand_ZeroFloat(1.99f); this->removeStateYaw = Rand_CenteredFloat(8000.0f) + -10000.0f; diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index beee7f82d4a..feb4616008b 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -182,7 +182,7 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* } else if (dyna->actor.id == ACTOR_OBJ_SWITCH) { dynaSwitchFlag = PARAMS_GET(dyna->actor.params, 8, 6); switch (dyna->actor.params & 0x33) { // Does not fit any standard params getter macro - case 0x20: // Normal blue switch + case 0x20: // Normal blue switch if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 6)) && Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 24383dbcc31..e40120f7ef6 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -10,10 +10,10 @@ #define FLAGS ACTOR_FLAG_4 -#define OBJSWITCH_TYPE(thisx) PARAMS_GET((thisx)->params, 0, 3) -#define OBJSWITCH_SUBTYPE(thisx) PARAMS_GET((thisx)->params, 4, 3) -#define OBJSWITCH_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 8, 6) -#define OBJSWITCH_FROZEN(thisx) PARAMS_GET((thisx)->params, 7, 1) +#define OBJSWITCH_TYPE(thisx) PARAMS_GET((thisx)->params, 0, 3) +#define OBJSWITCH_SUBTYPE(thisx) PARAMS_GET((thisx)->params, 4, 3) +#define OBJSWITCH_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 8, 6) +#define OBJSWITCH_FROZEN(thisx) PARAMS_GET((thisx)->params, 7, 1) #define OBJSWITCH_FROZEN_FLAG (1 << 7) diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 797df53c397..bba9339af98 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -99,7 +99,8 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->actor.world.pos.z, 255, 255, 180, -1); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)))) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || + ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)))) { this->litTimer = -1; } diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index 83439f25ddd..b04700f894d 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -299,7 +299,8 @@ void ObjTimeblock_AltBehaviourNotVisible(ObjTimeblock* this, PlayState* play) { s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); s8 switchFlagIsSet = (Flags_GetSwitch(play, switchFlag)) ? true : false; - if (this->unk_176 ^ switchFlagIsSet && switchFlagIsSet ^ (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false)) { + if (this->unk_176 ^ switchFlagIsSet && + switchFlagIsSet ^ (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false)) { if (this->demoEffectTimer <= 0) { ObjTimeblock_SpawnDemoEffect(this, play); this->demoEffectTimer = 160; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index d88ced7bd2b..696d38cf931 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -183,7 +183,8 @@ void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) { } EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -240, arg5, 10, 10, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 60, KAKERA_COLOR_NONE, - sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); + sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], + D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); } func_80033480(play, &this->actor.world.pos, 30.0f, 4, 20, 50, 1); } @@ -212,7 +213,8 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) { phi_s0 = (Rand_ZeroOne() < .2f) ? 64 : 32; EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -180, phi_s0, 30, 30, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 70, KAKERA_COLOR_NONE, - sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); + sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], + D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); } } diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index cdbb9eb068f..28107cd6d54 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -143,7 +143,8 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { this->dyna.actor.child->focus.rot = tempRot; temp = PARAMS_GET(this->dyna.actor.params, 0, 15); - this->dyna.actor.params = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET(this->dyna.actor.child->params, 0, 15); + this->dyna.actor.params = + PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET(this->dyna.actor.child->params, 0, 15); this->dyna.actor.child->params = PARAMS_GET_NOSHIFT(this->dyna.actor.child->params, 15, 1) | (temp & 0x7FFF); if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos) < 0.01f) { @@ -219,8 +220,9 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { ObjWarp2block_SetInactive(this); } - osSyncPrintf("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", PARAMS_GET(this->dyna.actor.params, 0, 16), - this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 3)); + osSyncPrintf("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", + PARAMS_GET(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7, + PARAMS_GET(this->dyna.actor.params, 11, 3)); } void ObjWarp2block_Destroy(Actor* thisx, PlayState* play) { From fe88d70e9cc142bdfaac3c8ee1b2f36b3bac1e74 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Sat, 2 Sep 2023 22:14:38 +0100 Subject: [PATCH 06/16] Adjust comment --- include/z64actor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/z64actor.h b/include/z64actor.h index 1f9b3afeb6f..9bf2f87fa66 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -579,7 +579,7 @@ typedef struct { } NpcInteractInfo; // size = 0x28 // Converts a number of bits to a bitmask, helper for params macros -// i.e. 3 becomes 0b111 / 7 +// e.g. 3 becomes 0b111 (7) #define NBITS_TO_MASK(n) \ ((1 << (n)) - 1) From 5f03bdedf920be953b54ac5ce4e4c065468ec77c Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 12:42:01 -0500 Subject: [PATCH 07/16] format --- src/code/z_collision_check.c | 3 +-- src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 2 +- src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 2 +- src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 6 +++--- src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c | 4 ++-- src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c | 3 +-- src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c | 2 +- src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c | 4 ++-- src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c | 4 ++-- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index efb64705f10..8d55adbdd3b 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -2807,8 +2807,7 @@ void CollisionCheck_OC_JntSphVsJntSph(PlayState* play, CollisionCheckContext* co continue; } if (Math3D_SphVsSphOverlap(&leftJntSphElem->dim.worldSphere, &rightJntSphElem->dim.worldSphere, - &overlapSize) == - true) { + &overlapSize) == true) { Vec3f leftPos; Vec3f rightPos; diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index f07ce84d187..43628bf6efa 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -70,7 +70,7 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_SetFocus(thisx, 50.0f); PRINTF("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, - PARAMS_GET(thisx->params, 0, 8), PARAMS_GET((s32)thisx->params, 8, 8)); + PARAMS_GET(thisx->params, 0, 8), PARAMS_GET((s32)thisx->params, 8, 8)); Actor_ProcessInitChain(thisx, sInitChain); if (PARAMS_GET(thisx->params, 0, 8) < 0 || PARAMS_GET(thisx->params, 0, 8) >= 3) { diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 35099715d17..0b9599d995e 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -93,7 +93,7 @@ void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) { // "Warning: Switch Number changed (%s %d)(SW %d)" PRINTF("Warning : Switch Number が変更された(%s %d)(SW %d)\n", "../z_bg_jya_bombiwa.c", 218, - PARAMS_GET(this->dyna.actor.params, 0, 6)); + PARAMS_GET(this->dyna.actor.params, 0, 6)); PRINTF(VT_RST); } BgJyaBombiwa_SetupDynaPoly(this, play, &gBombiwaCol, 0); diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index 91a3cbf5948..c37d5e1ed9a 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -72,9 +72,9 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { // "mori (bigST.keyceiling)" PRINTF("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, - Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)), - Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room), - GET_PLAYER(play)->actor.world.pos.y); + Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)), + Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room), + GET_PLAYER(play)->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->moriTexObjectSlot = Object_GetSlot(&play->objectCtx, OBJECT_MORI_TEX); diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 4142c97e6ac..217cd28bbb3 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -559,8 +559,8 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_SetupRoll(this); // "(Goroiwa)" PRINTF("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, - PARAMS_GET(this->actor.params, 0, 8), PARAMS_GET(this->actor.params, 8, 2), - PARAMS_GET(this->actor.params, 10, 1), this->actor.home.rot.z & 1); + PARAMS_GET(this->actor.params, 0, 8), PARAMS_GET(this->actor.params, 8, 2), + PARAMS_GET(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } void EnGoroiwa_Destroy(Actor* thisx, PlayState* play2) { diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index df080dc70be..eccb1858c74 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -155,8 +155,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { // "Identification Completed!" PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); // "Message completed!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, - PARAMS_GET(this->actor.params, 8, 4)); + PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET(this->actor.params, 8, 4)); } } diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index 8870dffd5b0..5b9ecb2213f 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -534,7 +534,7 @@ void EnHonotrap_Draw(Actor* thisx, PlayState* play) { case HONOTRAP_TYPE_EYE: EnHonotrap_DrawEye(thisx, play); break; - + case HONOTRAP_TYPE_FLAME_MOVE: case HONOTRAP_TYPE_FLAME_DROP: EnHonotrap_DrawFlame(thisx, play); diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index b2d04fcb9ba..a47a875064b 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -135,8 +135,8 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { // "Block of time" PRINTF("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 3), - PARAMS_GET(this->dyna.actor.params, 10, 1)); + this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 3), + PARAMS_GET(this->dyna.actor.params, 10, 1)); } void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 6233b9097ae..2e915ca3bb3 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -221,8 +221,8 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { } PRINTF("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", - PARAMS_GET(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7, - PARAMS_GET(this->dyna.actor.params, 11, 3)); + PARAMS_GET(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7, + PARAMS_GET(this->dyna.actor.params, 11, 3)); } void ObjWarp2block_Destroy(Actor* thisx, PlayState* play) { From 7ac46da7dd233138a1602ab87323079b1e4906db Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 12:55:52 -0500 Subject: [PATCH 08/16] edit en_door macro names --- src/overlays/actors/ovl_En_Door/z_en_door.c | 4 ++-- src/overlays/actors/ovl_En_Door/z_en_door.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.c b/src/overlays/actors/ovl_En_Door/z_en_door.c index 5f04f6159f3..f398dc45fe6 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.c +++ b/src/overlays/actors/ovl_En_Door/z_en_door.c @@ -144,7 +144,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { } // Double doors - if (ENDOOR_IS_DOUBLE_DOOR(&this->actor)) { + if (ENDOOR_GET_IS_DOUBLE_DOOR(&this->actor)) { EnDoor* other; xOffset = Math_CosS(this->actor.shape.rot.y) * 30.0f; @@ -152,7 +152,7 @@ void EnDoor_Init(Actor* thisx, PlayState* play2) { other = (EnDoor*)Actor_SpawnAsChild(&play->actorCtx, &this->actor, play, ACTOR_EN_DOOR, this->actor.world.pos.x + xOffset, this->actor.world.pos.y, this->actor.world.pos.z - zOffset, 0, this->actor.shape.rot.y + 0x8000, 0, - this->actor.params & ~ENDOOR_PARAMS_DOUBLE_DOOR_FLAG); + this->actor.params & ~ENDOOR_PARAMS_IS_DOUBLE_DOOR_MASK); if (other != NULL) { other->unk_192 = 1; } diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 8a20e46dc95..2bbf5c8175f 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -26,8 +26,8 @@ #define ENDOOR_PARAMS_TYPE_MASK PARAMS_MAKE_MASK(7, 3) #define ENDOOR_GET_TYPE(thisx) PARAMS_GET((thisx)->params, 7, 3) -#define ENDOOR_PARAMS_DOUBLE_DOOR_FLAG PARAMS_MAKE_MASK(6, 1) -#define ENDOOR_IS_DOUBLE_DOOR(thisx) PARAMS_GET_NOSHIFT((thisx)->params, 6, 1) +#define ENDOOR_PARAMS_IS_DOUBLE_DOOR_MASK PARAMS_MAKE_MASK(6, 1) +#define ENDOOR_GET_IS_DOUBLE_DOOR(thisx) PARAMS_GET_NOSHIFT((thisx)->params, 6, 1) #define ENDOOR_GET_LOCKED_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 0, 6) From 4b7c92383ad933137771b94cefbcd9a461064e75 Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 13:15:31 -0500 Subject: [PATCH 09/16] edit redead macro name --- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 2 +- src/overlays/actors/ovl_En_Rd/z_en_rd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index b45e5e4d176..1e44c103d12 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -151,7 +151,7 @@ void EnRd_Init(Actor* thisx, PlayState* play) { this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.health = 8; this->alpha = this->unk_31D = 255; - this->rdFlags = REDEAD_GET_FLAGS(thisx); + this->rdFlags = REDEAD_GET_RDFLAGS(thisx); if (PARAMS_GET_NOSHIFT(this->actor.params, 7, 1)) { this->actor.params |= 0xFF00; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 307e0b47c72..4f81f37bd3c 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -8,7 +8,7 @@ struct EnRd; typedef void (*EnRdActionFunc)(struct EnRd*, PlayState*); -#define REDEAD_GET_FLAGS(thisx) PARAMS_GET2((thisx)->params, 8, 8) +#define REDEAD_GET_RDFLAGS(thisx) PARAMS_GET2((thisx)->params, 8, 8) typedef enum { /* 0 */ REDEAD_GIBDO_LIMB_NONE, From fd774933b3c48d11a0b528e8a36d3ccc5a6e8efc Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 13:20:12 -0500 Subject: [PATCH 10/16] edit bdan switch macro name, and remove unneeded comments in go2 --- .../actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h | 1 - src/overlays/actors/ovl_En_Go2/z_en_go2.c | 9 --------- 2 files changed, 10 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h index bbc4e15367b..b5815aa24b7 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.h @@ -4,7 +4,6 @@ #include "ultra64.h" #include "global.h" -// PARAMS_GET(BgBdanSwitch.actor.params, 0, 0xFF) typedef enum { /* 0x00 */ BLUE, /* 0x01 */ YELLOW_HEAVY, diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index b7c794526c1..53236328b88 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -32,15 +32,6 @@ INFTABLE_10F - (not on cloud modding) INFTABLE_11E - Bomb bag upgrade obtained from rolling Goron -EnGo -pathIndex: PARAMS_GET2(this->actor.params, 0, 4) -Goron: PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) - -EnGo2 -PARAMS_GET2(this->actor.params, 5, 5) -PARAMS_GET2(this->actor.params, 10, 6) - Gorons in Fire Temple -PARAMS_GET2(this->actor.params, 0, 5) - Gorons only move when this->interactInfo.talkState == NPC_TALK_STATE_IDLE */ From 78a8530053ce008cd76f36af80ec9d18e4c370b9 Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 13:22:28 -0500 Subject: [PATCH 11/16] mizushutter macro names --- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c | 22 +++++++++---------- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h | 7 +++--- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c index a547fde73cf..1215d5af896 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.c @@ -52,30 +52,30 @@ void BgMizuShutter_Init(Actor* thisx, PlayState* play) { s32 pad3; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->displayList = sDisplayLists[BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor)]; + this->displayList = sDisplayLists[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)]; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - CollisionHeader_GetVirtual(sCollisionHeaders[BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor)], &colHeader); + CollisionHeader_GetVirtual(sCollisionHeaders[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if ((BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor) == BGMIZUSHUTTER_SMALL) || - (BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor) == BGMIZUSHUTTER_LARGE)) { + if ((BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor) == BGMIZUSHUTTER_SMALL) || + (BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor) == BGMIZUSHUTTER_LARGE)) { this->closedPos = this->dyna.actor.world.pos; this->timer = 0; - this->timerMax = BGMIZUSHUTTER_TIMER_PARAM(&this->dyna.actor) * 20; + this->timerMax = BGMIZUSHUTTER_GET_TIMER(&this->dyna.actor) * 20; Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.world.rot.y), MTXMODE_NEW); Matrix_RotateX(BINANG_TO_RAD(this->dyna.actor.world.rot.x), MTXMODE_APPLY); Matrix_RotateZ(BINANG_TO_RAD(this->dyna.actor.world.rot.z), MTXMODE_APPLY); - Matrix_MultVec3f(&sDisplacements[BGMIZUSHUTTER_SIZE_PARAM(&this->dyna.actor)], &this->openPos); + Matrix_MultVec3f(&sDisplacements[BGMIZUSHUTTER_GET_SIZE(&this->dyna.actor)], &this->openPos); this->openPos.x += this->dyna.actor.world.pos.x; this->openPos.y += this->dyna.actor.world.pos.y; this->openPos.z += this->dyna.actor.world.pos.z; if (this->timerMax != 0x3F * 20) { - Flags_UnsetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor)); + Flags_UnsetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor)); this->dyna.actor.world.pos = this->closedPos; } - if (Flags_GetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor))) { + if (Flags_GetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor))) { this->dyna.actor.world.pos = this->openPos; this->actionFunc = BgMizuShutter_WaitForTimer; } else { @@ -92,7 +92,7 @@ void BgMizuShutter_Destroy(Actor* thisx, PlayState* play) { } void BgMizuShutter_WaitForSwitch(BgMizuShutter* this, PlayState* play) { - if (Flags_GetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor))) { + if (Flags_GetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor))) { if (ABS(this->dyna.actor.world.rot.x) > 0x2C60) { OnePointCutscene_Init(play, 4510, -99, &this->dyna.actor, CAM_ID_MAIN); } else { @@ -111,7 +111,7 @@ void BgMizuShutter_WaitForCutscene(BgMizuShutter* this, PlayState* play) { } void BgMizuShutter_Move(BgMizuShutter* this, PlayState* play) { - if (Flags_GetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor))) { + if (Flags_GetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor))) { Math_SmoothStepToF(&this->dyna.actor.world.pos.x, this->openPos.x, 1.0f, 4.0f, 0.1f); Math_SmoothStepToF(&this->dyna.actor.world.pos.y, this->openPos.y, 1.0f, 4.0f, 0.1f); Math_SmoothStepToF(&this->dyna.actor.world.pos.z, this->openPos.z, 1.0f, 4.0f, 0.1f); @@ -141,7 +141,7 @@ void BgMizuShutter_WaitForTimer(BgMizuShutter* this, PlayState* play) { func_8002F994(&this->dyna.actor, this->timer); if (this->timer == 0) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_METALDOOR_CLOSE); - Flags_UnsetSwitch(play, BGMIZUSHUTTER_SWITCH_PARAM(&this->dyna.actor)); + Flags_UnsetSwitch(play, BGMIZUSHUTTER_GET_SWITCH(&this->dyna.actor)); this->actionFunc = BgMizuShutter_Move; } } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index e8ca6e48c6d..c0043f7622d 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -4,9 +4,10 @@ #include "ultra64.h" #include "global.h" -#define BGMIZUSHUTTER_SIZE_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 12, 4) -#define BGMIZUSHUTTER_TIMER_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 6, 6) -#define BGMIZUSHUTTER_SWITCH_PARAM(thisx) PARAMS_GET((u16)(thisx)->params, 0, 6) +#define BGMIZUSHUTTER_GET_SIZE(thisx) PARAMS_GET((u16)(thisx)->params, 12, 4) +#define BGMIZUSHUTTER_GET_TIMER(thisx) PARAMS_GET((u16)(thisx)->params, 6, 6) +#define BGMIZUSHUTTER_GET_SWITCH(thisx) PARAMS_GET((u16)(thisx)->params, 0, 6) + #define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 12) | ((timer) << 6) | (switchFlag)) struct BgMizuShutter; From a6b3290e4cf7c7772101e1eb16003a1087892d59 Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 17:13:27 -0500 Subject: [PATCH 12/16] remove PARAMS_GET_S, rework ishi switch flag handling --- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 4 ++-- src/overlays/actors/ovl_En_Ishi/z_en_ishi.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index bc3d990217d..4399b0c71f2 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -320,7 +320,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, play); if ((type == ROCK_LARGE) && - Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2))) { + Flags_GetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor))) { Actor_Kill(&this->actor); return; } @@ -390,7 +390,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_LARGE) { - Flags_SetSwitch(play, PARAMS_GET_S(this->actor.params, 12, 2, 4) | PARAMS_GET(this->actor.params, 6, 2)); + Flags_SetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor)); } EnIshi_SetupFly(this); EnIshi_Fall(this); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 3ce7c72bf3c..8c8e765e7f2 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -4,6 +4,20 @@ #include "ultra64.h" #include "global.h" +// The switch flag value for this actor is constructed in a unique way. +// There are two seperate param values which get OR'd together to create one final switch flag index. +// These two values are seperated within the overall actor param value. See below: +// +// | A B C D | _ _ _ _ | E F | _ _ _ _ _ _ | +// 16 12 8 6 0 +// After the OR operation, the final switch flag is constructed to form "0bABCDEF" +// +// Due to the unique form of access to obtain the upper bits of the switch flag, `ISHI_GET_SWITCH_FLAG_UPPER` +// cannot use the generic `PARAMS_GET` macros. +#define ISHI_GET_SWITCH_FLAG_UPPER(thisx) ((((thisx)->params) >> (12 - 2)) & (NBITS_TO_MASK(4) << 2)) +#define ISHI_GET_SWITCH_FLAG_LOWER(thisx) PARAMS_GET((thisx)->params, 6, 2) +#define ISHI_GET_SWITCH_FLAG(thisx) (ISHI_GET_SWITCH_FLAG_UPPER(thisx) | ISHI_GET_SWITCH_FLAG_LOWER(thisx) ) + typedef enum { /* 0x00 */ ROCK_SMALL, /* 0x01 */ ROCK_LARGE From 7f71a8f610628714ffc87a0f039d6df6f58a4f85 Mon Sep 17 00:00:00 2001 From: fig02 Date: Tue, 16 Jan 2024 17:15:53 -0500 Subject: [PATCH 13/16] actually remove PARAMS_GET_S --- include/z64actor.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index d5bc834ee3b..8bf94a33d93 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -660,11 +660,6 @@ typedef struct { #define PARAMS_GET_NOSHIFT(p, s, n) \ ((p) & (NBITS_TO_MASK(n) << (s))) -// Extracts the `n`-bit value at position `s1` in `p` and shifts it down to position `s2`, shifts then masks -// No possibility of sign extension -#define PARAMS_GET_S(p, s1, s2, n) \ - (((p) >> ((s1) - (s2))) & (NBITS_TO_MASK(n) << (s2))) - // Extracts the `n`-bit value at position `s1` in `p` and shifts it down to position `s2`, masks then shifts // Possibility of sign extension #define PARAMS_GET2_S(p, s1, s2, n) \ From 0c4ec9d3b6b75a853c9ec912230f38f93185470a Mon Sep 17 00:00:00 2001 From: fig02 Date: Wed, 17 Jan 2024 11:17:08 -0500 Subject: [PATCH 14/16] remove PARAMS_GET2_S --- include/z64actor.h | 5 ----- src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 2 +- src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h | 3 +++ src/overlays/actors/ovl_En_Ishi/z_en_ishi.h | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index 8bf94a33d93..f0ef81bdf41 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -660,11 +660,6 @@ typedef struct { #define PARAMS_GET_NOSHIFT(p, s, n) \ ((p) & (NBITS_TO_MASK(n) << (s))) -// Extracts the `n`-bit value at position `s1` in `p` and shifts it down to position `s2`, masks then shifts -// Possibility of sign extension -#define PARAMS_GET2_S(p, s1, s2, n) \ - (((p) & (NBITS_TO_MASK(n) << (s1))) >> ((s1) - (s2))) - // Generates a bitmask for bit position `s` of length `n` #define PARAMS_MAKE_MASK(s, n) PARAMS_GET_NOSHIFT(~0, s, n) diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 1b022851237..489e05f4443 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -70,7 +70,7 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 6); this->switchFlag = (Flags_GetSwitch(play, this->switchFlag)) ? 1 : 0; } - this->dyna.actor.params = PARAMS_GET2_S(this->dyna.actor.params, 15, 1, 1); + this->dyna.actor.params = TWISTED_HALLWAY_GET_PARAM_15(&this->dyna.actor); if (Flags_GetSwitch(play, switchFlagParam)) { if (this->dyna.actor.params == 0) { this->dyna.actor.params = 1; diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index 8d4323e6305..b9a99e36b17 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -6,6 +6,9 @@ struct BgMoriHineri; +// Due to a unique access pattern, this param cannot use the generic "PARAMS_GET" macros +#define TWISTED_HALLWAY_GET_PARAM_15(thisx) (((thisx)->params & (NBITS_TO_MASK(1) << (15))) >> ((15) - (1))) + typedef void (*BgMoriHineriActionFunc)(struct BgMoriHineri*, PlayState*); typedef struct BgMoriHineri { diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 8c8e765e7f2..063fe7b6bb7 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -15,8 +15,8 @@ // Due to the unique form of access to obtain the upper bits of the switch flag, `ISHI_GET_SWITCH_FLAG_UPPER` // cannot use the generic `PARAMS_GET` macros. #define ISHI_GET_SWITCH_FLAG_UPPER(thisx) ((((thisx)->params) >> (12 - 2)) & (NBITS_TO_MASK(4) << 2)) -#define ISHI_GET_SWITCH_FLAG_LOWER(thisx) PARAMS_GET((thisx)->params, 6, 2) -#define ISHI_GET_SWITCH_FLAG(thisx) (ISHI_GET_SWITCH_FLAG_UPPER(thisx) | ISHI_GET_SWITCH_FLAG_LOWER(thisx) ) +#define ISHI_GET_SWITCH_FLAG_LOWER(thisx) PARAMS_GET((thisx)->params, 6, 2) +#define ISHI_GET_SWITCH_FLAG(thisx) (ISHI_GET_SWITCH_FLAG_UPPER(thisx) | ISHI_GET_SWITCH_FLAG_LOWER(thisx)) typedef enum { /* 0x00 */ ROCK_SMALL, From 6c53f04bf7de59f9e00ea6f94ef07e0380231772 Mon Sep 17 00:00:00 2001 From: fig02 Date: Wed, 17 Jan 2024 11:26:13 -0500 Subject: [PATCH 15/16] PARAMS_GET_U and PARAMS_GET_S --- include/z64actor.h | 8 +- src/code/z_en_a_keep.c | 2 +- src/code/z_en_item00.c | 2 +- src/code/z_play.c | 2 +- .../ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c | 2 +- .../ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c | 38 +++--- .../actors/ovl_Bg_Bombwall/z_bg_bombwall.c | 6 +- .../actors/ovl_Bg_Breakwall/z_bg_breakwall.c | 10 +- .../actors/ovl_Bg_Dodoago/z_bg_dodoago.c | 8 +- .../ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c | 30 ++-- .../ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c | 2 +- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 18 +-- .../actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c | 2 +- .../actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c | 2 +- .../ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c | 2 +- .../ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c | 4 +- .../actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c | 2 +- .../actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c | 2 +- .../actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c | 2 +- .../ovl_Bg_Heavy_Block/z_bg_heavy_block.c | 20 +-- .../ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c | 4 +- .../ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c | 2 +- .../ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c | 38 +++--- .../ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c | 4 +- .../ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c | 20 +-- .../z_bg_hidan_kowarerukabe.c | 24 ++-- .../ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c | 4 +- .../ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c | 8 +- .../ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c | 4 +- .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 +- .../ovl_Bg_Jya_1flift/z_bg_jya_1flift.c | 4 +- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.c | 2 +- .../z_bg_jya_bombchuiwa.c | 2 +- .../ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c | 8 +- .../actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 36 ++--- .../ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c | 8 +- .../ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c | 4 +- .../actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c | 4 +- .../ovl_Bg_Jya_Megami/z_bg_jya_megami.c | 4 +- .../z_bg_menkuri_nisekabe.c | 2 +- .../ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c | 20 +-- .../ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c | 10 +- .../ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h | 6 +- .../ovl_Bg_Mizu_Water/z_bg_mizu_water.c | 4 +- .../ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c | 8 +- .../ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 8 +- .../ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c | 2 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c | 4 +- .../ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h | 2 +- .../ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c | 4 +- .../actors/ovl_Bg_Po_Event/z_bg_po_event.c | 4 +- .../ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c | 2 +- .../ovl_Bg_Relay_Objects/z_bg_relay_objects.c | 4 +- .../z_bg_spot01_objects2.c | 10 +- .../z_bg_spot02_objects.c | 2 +- .../ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c | 2 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 2 +- .../z_bg_spot06_objects.c | 4 +- .../z_bg_spot08_bakudankabe.c | 4 +- .../z_bg_spot08_iceblock.c | 8 +- .../z_bg_spot11_bakudankabe.c | 4 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 4 +- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 4 +- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 2 +- .../z_bg_spot16_bombstone.c | 4 +- .../z_bg_spot17_bakudankabe.c | 4 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 8 +- .../ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c | 22 +-- .../z_bg_spot18_shutter.c | 8 +- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 4 +- .../ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c | 4 +- .../actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c | 6 +- src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c | 4 +- .../actors/ovl_Boss_Ganon2/z_boss_ganon2.c | 8 +- src/overlays/actors/ovl_Boss_Va/z_boss_va.c | 2 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 14 +- src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c | 6 +- src/overlays/actors/ovl_Door_Ana/z_door_ana.c | 4 +- .../actors/ovl_Door_Gerudo/z_door_gerudo.c | 6 +- .../actors/ovl_Door_Killer/z_door_killer.c | 14 +- .../actors/ovl_Door_Shutter/z_door_shutter.h | 4 +- src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c | 22 +-- src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c | 16 +-- src/overlays/actors/ovl_En_Ba/z_en_ba.c | 2 +- src/overlays/actors/ovl_En_Box/z_en_box.c | 22 +-- src/overlays/actors/ovl_En_Brob/z_en_brob.c | 6 +- src/overlays/actors/ovl_En_Butte/z_en_butte.c | 8 +- src/overlays/actors/ovl_En_Bx/z_en_bx.c | 4 +- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 2 +- src/overlays/actors/ovl_En_Daiku/z_en_daiku.c | 40 +++--- .../z_en_daiku_kakariko.c | 22 +-- .../actors/ovl_En_Dekunuts/z_en_dekunuts.c | 2 +- src/overlays/actors/ovl_En_Dog/z_en_dog.c | 16 +-- src/overlays/actors/ovl_En_Door/z_en_door.h | 6 +- .../actors/ovl_En_Encount1/z_en_encount1.c | 6 +- .../actors/ovl_En_Ex_Item/z_en_ex_item.c | 4 +- .../actors/ovl_En_Fd_Fire/z_en_fd_fire.c | 18 +-- .../actors/ovl_En_G_Switch/z_en_g_switch.c | 6 +- src/overlays/actors/ovl_En_Ge1/z_en_ge1.c | 8 +- src/overlays/actors/ovl_En_Ge2/z_en_ge2.c | 12 +- src/overlays/actors/ovl_En_Go/z_en_go.c | 8 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 128 +++++++++--------- .../actors/ovl_En_Goroiwa/z_en_goroiwa.c | 48 +++---- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 6 +- .../actors/ovl_En_Heishi1/z_en_heishi1.c | 4 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 6 +- .../actors/ovl_En_Heishi4/z_en_heishi4.c | 6 +- .../actors/ovl_En_Hintnuts/z_en_hintnuts.c | 2 +- src/overlays/actors/ovl_En_Holl/z_en_holl.h | 4 +- .../ovl_En_Horse_Normal/z_en_horse_normal.c | 4 +- src/overlays/actors/ovl_En_Hy/z_en_hy.c | 92 ++++++------- src/overlays/actors/ovl_En_Ik/z_en_ik.h | 4 +- .../actors/ovl_En_Insect/z_en_insect.c | 20 +-- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 24 ++-- src/overlays/actors/ovl_En_Ishi/z_en_ishi.h | 4 +- .../actors/ovl_En_Kakasi2/z_en_kakasi2.c | 4 +- .../actors/ovl_En_Karebaba/z_en_karebaba.c | 2 +- src/overlays/actors/ovl_En_Ko/z_en_ko.c | 4 +- src/overlays/actors/ovl_En_Kusa/z_en_kusa.c | 16 +-- src/overlays/actors/ovl_En_Kz/z_en_kz.c | 4 +- src/overlays/actors/ovl_En_Light/z_en_light.c | 14 +- .../actors/ovl_En_M_Thunder/z_en_m_thunder.c | 12 +- src/overlays/actors/ovl_En_Mb/z_en_mb.c | 2 +- src/overlays/actors/ovl_En_Md/z_en_md.c | 4 +- src/overlays/actors/ovl_En_Mm/z_en_mm.c | 2 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 4 +- .../actors/ovl_En_Niw_Girl/z_en_niw_girl.c | 2 +- .../ovl_En_Okarina_Tag/z_en_okarina_tag.c | 6 +- src/overlays/actors/ovl_En_Okuta/z_en_okuta.c | 2 +- src/overlays/actors/ovl_En_Owl/z_en_owl.c | 12 +- .../actors/ovl_En_Po_Desert/z_en_po_desert.c | 2 +- .../actors/ovl_En_Po_Field/z_en_po_field.c | 2 +- .../ovl_En_Po_Sisters/z_en_po_sisters.c | 4 +- src/overlays/actors/ovl_En_Rd/z_en_rd.h | 2 +- .../ovl_En_River_Sound/z_en_river_sound.c | 4 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 8 +- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 4 +- src/overlays/actors/ovl_En_Si/z_en_si.c | 2 +- .../actors/ovl_En_Siofuki/z_en_siofuki.c | 28 ++-- src/overlays/actors/ovl_En_Skj/z_en_skj.c | 2 +- .../actors/ovl_En_Stream/z_en_stream.c | 2 +- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 42 +++--- src/overlays/actors/ovl_En_Trap/z_en_trap.c | 2 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 4 +- .../actors/ovl_En_Vb_Ball/z_en_vb_ball.c | 2 +- .../actors/ovl_En_Wallmas/z_en_wallmas.c | 4 +- .../ovl_En_Weather_Tag/z_en_weather_tag.c | 2 +- src/overlays/actors/ovl_En_Wf/z_en_wf.c | 2 +- .../ovl_En_Wonder_Item/z_en_wonder_item.c | 6 +- .../ovl_En_Wonder_Talk/z_en_wonder_talk.c | 6 +- .../ovl_En_Wonder_Talk2/z_en_wonder_talk2.c | 6 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 2 +- src/overlays/actors/ovl_En_Zf/z_en_zf.c | 2 +- src/overlays/actors/ovl_En_Zl3/z_en_zl3.c | 6 +- src/overlays/actors/ovl_En_Zo/z_en_zo.c | 6 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 8 +- .../actors/ovl_Item_Inbox/z_item_inbox.c | 4 +- src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c | 14 +- .../ovl_Obj_Blockstop/z_obj_blockstop.c | 4 +- .../actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c | 6 +- src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c | 6 +- .../actors/ovl_Obj_Elevator/z_obj_elevator.c | 6 +- .../actors/ovl_Obj_Hamishi/z_obj_hamishi.c | 4 +- src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c | 8 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 14 +- .../actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c | 2 +- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 4 +- src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c | 20 +-- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 34 ++--- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 16 +-- src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c | 8 +- .../actors/ovl_Obj_Mure2/z_obj_mure2.c | 20 +-- .../actors/ovl_Obj_Mure3/z_obj_mure3.c | 10 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 24 ++-- .../ovl_Obj_Roomtimer/z_obj_roomtimer.c | 4 +- .../actors/ovl_Obj_Switch/z_obj_switch.c | 8 +- .../actors/ovl_Obj_Syokudai/z_obj_syokudai.c | 8 +- .../ovl_Obj_Timeblock/z_obj_timeblock.c | 42 +++--- .../actors/ovl_Obj_Tsubo/z_obj_tsubo.c | 16 +-- .../ovl_Obj_Warp2block/z_obj_warp2block.c | 36 ++--- src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 8 +- .../actors/ovl_player_actor/z_player.c | 8 +- 182 files changed, 880 insertions(+), 880 deletions(-) diff --git a/include/z64actor.h b/include/z64actor.h index f0ef81bdf41..61e89d1302a 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -643,13 +643,13 @@ typedef struct { ((1 << (n)) - 1) // Extracts the `n`-bit value at position `s` in `p`, shifts then masks -// No possibility of sign extension -#define PARAMS_GET(p, s, n) \ +// Unsigned variant, no possibility of sign extension +#define PARAMS_GET_U(p, s, n) \ (((p) >> (s)) & NBITS_TO_MASK(n)) // Extracts the `n`-bit value at position `s` in `p`, masks then shifts -// Possibility of sign extension -#define PARAMS_GET2(p, s, n) \ +// Signed variant, possibility of sign extension +#define PARAMS_GET_S(p, s, n) \ (((p) & (NBITS_TO_MASK(n) << (s))) >> (s)) // Extracts all bits past position `s` in `p` diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index b13efe20536..0247adfe295 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -80,7 +80,7 @@ void EnAObj_Init(Actor* thisx, PlayState* play) { EnAObj* this = (EnAObj*)thisx; f32 shadowScale = 6.0f; - this->textId = PARAMS_GET(thisx->params, 8, 8); + this->textId = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; switch (thisx->params) { diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index b1d75a8ae40..d2db1281027 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -145,7 +145,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { s16 spawnParam8000 = PARAMS_GET_NOSHIFT(this->actor.params, 15, 1); s32 pad1; - this->collectibleFlag = PARAMS_GET2(this->actor.params, 8, 6); + this->collectibleFlag = PARAMS_GET_S(this->actor.params, 8, 6); this->actor.params &= 0xFF; diff --git a/src/code/z_play.c b/src/code/z_play.c index 24c8620e111..2b727f5d8f5 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -414,7 +414,7 @@ void Play_Init(GameState* thisx) { Camera_InitDataUsingPlayer(&this->mainCamera, player); Camera_RequestMode(&this->mainCamera, CAM_MODE_NORMAL); - playerStartBgCamIndex = PARAMS_GET(player->actor.params, 0, 8); + playerStartBgCamIndex = PARAMS_GET_U(player->actor.params, 0, 8); if (playerStartBgCamIndex != 0xFF) { PRINTF("player has start camera ID (" VT_FGCOL(BLUE) "%d" VT_RST ")\n", playerStartBgCamIndex); Camera_RequestBgCam(&this->mainCamera, playerStartBgCamIndex); diff --git a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c index fc6ee412902..94f06d1b82e 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Objects/z_bg_bdan_objects.c @@ -123,7 +123,7 @@ void BgBdanObjects_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - this->var.switchFlag = PARAMS_GET(thisx->params, 8, 6); + this->var.switchFlag = PARAMS_GET_U(thisx->params, 8, 6); thisx->params &= 0xFF; if (thisx->params == JABU_OBJECTS_TYPE_WATERBOX_HEIGHT_CHANGER) { thisx->flags |= ACTOR_FLAG_4 | ACTOR_FLAG_5; diff --git a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c index dfb760a9057..83f2f51d75f 100644 --- a/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c +++ b/src/overlays/actors/ovl_Bg_Bdan_Switch/z_bg_bdan_switch.c @@ -116,7 +116,7 @@ void func_8086D0EC(BgBdanSwitch* this) { this->unk_1CC += 0xFA0; } - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -139,7 +139,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { s16 type; s32 flag; - type = PARAMS_GET(this->dyna.actor.params, 0, 8); + type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (type == YELLOW_TALL_1 || type == YELLOW_TALL_2) { this->dyna.actor.scale.z = 0.05f; @@ -165,7 +165,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { break; } - flag = Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + flag = Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); switch (type) { case BLUE: @@ -202,7 +202,7 @@ void BgBdanSwitch_Init(Actor* thisx, PlayState* play) { void BgBdanSwitch_Destroy(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: case YELLOW_HEAVY: case YELLOW: @@ -219,9 +219,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { s32 pad; s32 type; - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { - type = PARAMS_GET(this->dyna.actor.params, 0, 8); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { + type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); if (type == BLUE || type == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } else { @@ -231,9 +231,9 @@ void func_8086D4B4(BgBdanSwitch* this, PlayState* play) { } void func_8086D548(BgBdanSwitch* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == YELLOW_TALL_2) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == YELLOW_TALL_2) { OnePointCutscene_AttentionSetSfx(play, &this->dyna.actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -245,7 +245,7 @@ void func_8086D5C4(BgBdanSwitch* this) { } void func_8086D5E0(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: if (func_800435B4(&this->dyna)) { func_8086D67C(this); @@ -284,7 +284,7 @@ void func_8086D730(BgBdanSwitch* this) { } void func_8086D754(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case BLUE: if (!func_800435B4(&this->dyna)) { if (this->unk_1D8 <= 0) { @@ -296,7 +296,7 @@ void func_8086D754(BgBdanSwitch* this, PlayState* play) { } break; case YELLOW: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_8086D7FC(this); } break; @@ -406,7 +406,7 @@ void func_8086DB4C(BgBdanSwitch* this) { } void func_8086DB68(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { default: return; case YELLOW_TALL_1: @@ -447,9 +447,9 @@ void func_8086DCCC(BgBdanSwitch* this) { } void func_8086DCE8(BgBdanSwitch* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case YELLOW_TALL_1: - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_8086DDA8(this); } break; @@ -469,7 +469,7 @@ void func_8086DDA8(BgBdanSwitch* this) { } void func_8086DDC0(BgBdanSwitch* this, PlayState* play) { - if (((PARAMS_GET(this->dyna.actor.params, 0, 8) != YELLOW_TALL_2) || + if (((PARAMS_GET_U(this->dyna.actor.params, 0, 8) != YELLOW_TALL_2) || (func_8005B198() == this->dyna.actor.category)) || (this->unk_1DA <= 0)) { this->unk_1C8 += 0.3f; @@ -490,7 +490,7 @@ void BgBdanSwitch_Update(Actor* thisx, PlayState* play) { } this->actionFunc(this, play); func_8086D0EC(this); - type = PARAMS_GET(this->dyna.actor.params, 0, 8); + type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); if (type != 3 && type != 4) { this->unk_1D8--; } else { @@ -516,7 +516,7 @@ void func_8086DF58(BgBdanSwitch* this, PlayState* play, Gfx* dlist) { void BgBdanSwitch_Draw(Actor* thisx, PlayState* play) { BgBdanSwitch* this = (BgBdanSwitch*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case YELLOW_HEAVY: case YELLOW: func_8086DF58(this, play, gJabuYellowFloorSwitchDL); diff --git a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c index 66c0890fe8a..1740c8ad0a8 100644 --- a/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c +++ b/src/overlays/actors/ovl_Bg_Bombwall/z_bg_bombwall.c @@ -122,7 +122,7 @@ void BgBombwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_SetScale(&this->dyna.actor, 0.1f); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_8086EE94(this, play); } else { BgBombwall_InitDynapoly(this, play); @@ -213,7 +213,7 @@ void func_8086ED70(BgBombwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; func_8086EDFC(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } else if (this->dyna.actor.xzDistToPlayer < 600.0f) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -232,7 +232,7 @@ void func_8086EE40(BgBombwall* this, PlayState* play) { } else { func_8086EE94(this, play); - if (PARAMS_GET(this->dyna.actor.params, 15, 1) != 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 15, 1) != 0) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } } diff --git a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c index 3e369df57f8..71e4b3af9f0 100644 --- a/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c +++ b/src/overlays/actors/ovl_Bg_Breakwall/z_bg_breakwall.c @@ -79,7 +79,7 @@ void BgBreakwall_SetupAction(BgBreakwall* this, BgBreakwallActionFunc actionFunc void BgBreakwall_Init(Actor* thisx, PlayState* play) { BgBreakwall* this = (BgBreakwall*)thisx; s32 pad; - s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 2); + s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); @@ -91,7 +91,7 @@ void BgBreakwall_Init(Actor* thisx, PlayState* play) { } if (this->bombableWallDList != NULL) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -203,7 +203,7 @@ Actor* BgBreakwall_SpawnFragments(PlayState* play, BgBreakwall* this, Vec3f* pos void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { CollisionHeader* colHeader = NULL; - s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 2); + s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); this->dyna.actor.objectSlot = this->requiredObjectSlot; Actor_SetObjectDependency(play, &this->dyna.actor); @@ -227,7 +227,7 @@ void BgBreakwall_WaitForObject(BgBreakwall* this, PlayState* play) { void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { Vec3f effectPos; - s32 wallType = (u8)PARAMS_GET(this->dyna.actor.params, 13, 2); + s32 wallType = (u8)PARAMS_GET_U(this->dyna.actor.params, 13, 2); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); effectPos.y = effectPos.z = effectPos.x = 0.0f; @@ -240,7 +240,7 @@ void BgBreakwall_Wait(BgBreakwall* this, PlayState* play) { } BgBreakwall_SpawnFragments(play, this, &effectPos, 0.0f, 6.4f, 5.0f, 1, 2.0f); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); if (wallType == BWALL_KD_FLOOR) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_EXPLOSION); diff --git a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index 2a5fc42699f..6a1ef69bc9e 100644 --- a/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -118,7 +118,7 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); ActorShape_Init(&this->dyna.actor.shape, 0.0f, NULL, 0.0f); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { BgDodoago_SetupAction(this, BgDodoago_DoNothing); this->dyna.actor.shape.rot.x = 0x1333; play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] = play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] = 255; @@ -156,7 +156,7 @@ void BgDodoago_WaitExplosives(BgDodoago* this, PlayState* play) { if (((play->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] == 255) && (this->state == BGDODOAGO_EYE_RIGHT)) || ((play->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] == 255) && (this->state == BGDODOAGO_EYE_LEFT))) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); this->state = 0; Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); @@ -296,9 +296,9 @@ void BgDodoago_Update(Actor* thisx, PlayState* play) { } } else { sTimer++; - Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); if (!sDisableBombCatcher && sTimer > 140) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { // this prevents clearing the actor's parent pointer, effectively disabling the bomb catcher sDisableBombCatcher++; } else { diff --git a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c index 852b8c7088a..8dd0da19e7d 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Darkmeiro/z_bg_gnd_darkmeiro.c @@ -52,7 +52,7 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->updateFunc = BgGndDarkmeiro_Noop; Actor_SetScale(&this->dyna.actor, 0.1f); - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case DARKMEIRO_INVISIBLE_PATH: this->dyna.actor.draw = BgGndDarkmeiro_DrawInvisiblePath; this->dyna.actor.flags |= ACTOR_FLAG_REACT_TO_LENS; @@ -60,14 +60,14 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { case DARKMEIRO_CLEAR_BLOCK: CollisionHeader_GetVirtual(&gClearBlockCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (PARAMS_GET(this->dyna.actor.params, 8, 6) == 0x3F) { + if (PARAMS_GET_U(this->dyna.actor.params, 8, 6) == 0x3F) { this->updateFunc = BgGndDarkmeiro_UpdateStaticBlock; this->dyna.actor.draw = BgGndDarkmeiro_DrawStaticBlock; } else { this->actionFlags = this->timer1 = this->timer2 = 0; thisx->draw = BgGndDarkmeiro_DrawSwitchBlock; this->updateFunc = BgGndDarkmeiro_UpdateSwitchBlock; - if (!Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); } else { this->timer1 = 64; @@ -79,18 +79,18 @@ void BgGndDarkmeiro_Init(Actor* thisx, PlayState* play2) { this->actionFlags = this->timer1 = this->timer2 = 0; this->updateFunc = BgGndDarkmeiro_UpdateBlockTimer; thisx->draw = NULL; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 1)) { this->timer1 = 64; this->actionFlags |= 4; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 2)) { this->timer2 = 64; this->actionFlags |= 8; } if ((this->timer1 != 0) || (this->timer2 != 0)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } break; } @@ -100,7 +100,7 @@ void BgGndDarkmeiro_Destroy(Actor* thisx, PlayState* play2) { PlayState* play = play2; BgGndDarkmeiro* this = (BgGndDarkmeiro*)thisx; - if (PARAMS_GET(this->dyna.actor.params, 0, 8) != 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) != 1) { return; } @@ -113,12 +113,12 @@ void BgGndDarkmeiro_Noop(BgGndDarkmeiro* this, PlayState* play) { void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { s16 timeLeft; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 1)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 1)) { if (this->actionFlags & 4) { if (this->timer1 > 0) { this->timer1--; } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 1); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 1); this->actionFlags &= ~4; } } else { @@ -129,12 +129,12 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { } } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 2)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 2)) { if (this->actionFlags & 8) { if (this->timer2 > 0) { this->timer2--; } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6) + 2); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6) + 2); this->actionFlags &= ~8; } } else { @@ -150,9 +150,9 @@ void BgGndDarkmeiro_UpdateBlockTimer(BgGndDarkmeiro* this, PlayState* play) { func_8002F994(&this->dyna.actor, timeLeft); } if ((this->timer1 >= 64) || (this->timer2 >= 64)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } else { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); } } @@ -164,7 +164,7 @@ void BgGndDarkmeiro_UpdateSwitchBlock(BgGndDarkmeiro* this, PlayState* play) { this->timer1--; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { this->timer1 = 64; } diff --git a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c index 4d7cabcd875..4620658d2cf 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Nisekabe/z_bg_gnd_nisekabe.c @@ -53,7 +53,7 @@ void BgGndNisekabe_Draw(Actor* thisx, PlayState* play) { gGanonsCastleScrubsFakeWallDL, }; BgGndNisekabe* this = (BgGndNisekabe*)thisx; - u32 index = PARAMS_GET(this->actor.params, 0, 8); + u32 index = PARAMS_GET_U(this->actor.params, 0, 8); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, dLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 4300b24a349..1b609c06631 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -65,12 +65,12 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); this->actionFunc = NULL; - switch (PARAMS_GET(this->actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->actor.params, 0, 8)) { case 0: Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); this->actionFunc = func_8087B284; - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 9); @@ -83,7 +83,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { break; case 1: case 2: - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -96,7 +96,7 @@ void BgGndSoulmeiro_Init(Actor* thisx, PlayState* play) { void BgGndSoulmeiro_Destroy(Actor* thisx, PlayState* play) { BgGndSoulmeiro* this = (BgGndSoulmeiro*)thisx; - if (PARAMS_GET(this->actor.params, 0, 8) == 0) { + if (PARAMS_GET_U(this->actor.params, 0, 8) == 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -112,13 +112,13 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { } if (this->unk_198 == 20) { - Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6)); thisx->draw = NULL; } // This should be this->unk_198 == 0, this is required to match if (!this->unk_198) { - Flags_SetSwitch(play, PARAMS_GET(thisx->params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6)); Actor_Kill(&this->actor); Actor_Spawn(&play->actorCtx, play, ACTOR_MIR_RAY, thisx->world.pos.x, thisx->world.pos.y, thisx->world.pos.z, 0, 0, 0, 9); @@ -159,7 +159,7 @@ void func_8087AF38(BgGndSoulmeiro* this, PlayState* play) { void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { s32 pad; - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; if (this->collider.base.acFlags & AC_HIT) { Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, @@ -174,7 +174,7 @@ void func_8087B284(BgGndSoulmeiro* this, PlayState* play) { } void func_8087B350(BgGndSoulmeiro* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.draw = BgGndSoulmeiro_Draw; } else { this->actor.draw = NULL; @@ -195,7 +195,7 @@ void BgGndSoulmeiro_Draw(Actor* thisx, PlayState* play) { gSpiritTrialLightSourceDL, gSpiritTrialLightFloorDL, }; - s32 params = PARAMS_GET(thisx->params, 0, 8); + s32 params = PARAMS_GET_U(thisx->params, 0, 8); if (1) {} diff --git a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 0da30c6a22f..65977188fc7 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -74,7 +74,7 @@ void BgHakaGate_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, 0); if (thisx->params == BGHAKAGATE_SKULL) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c index 31a3b2052fa..7fae7b55e39 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c +++ b/src/overlays/actors/ovl_Bg_Haka_Huta/z_bg_haka_huta.c @@ -49,7 +49,7 @@ void BgHakaHuta_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); CollisionHeader_GetVirtual(&gBotwCoffinLidCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - this->unk_16A = PARAMS_GET(thisx->params, 8, 8); + this->unk_16A = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (Flags_GetSwitch(play, thisx->params)) { this->counter = -1; diff --git a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c index 02d0d7c8947..0bf6b938481 100644 --- a/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c +++ b/src/overlays/actors/ovl_Bg_Haka_MeganeBG/z_bg_haka_meganebg.c @@ -59,7 +59,7 @@ void BgHakaMeganeBG_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->unk_168 = PARAMS_GET(thisx->params, 8, 8); + this->unk_168 = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 2) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c index 8416eb99a54..6e47017fd11 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c +++ b/src/overlays/actors/ovl_Bg_Haka_Sgami/z_bg_haka_sgami.c @@ -138,8 +138,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->unk_151 = PARAMS_GET(thisx->params, 0, 8); - thisx->params = PARAMS_GET(thisx->params, 8, 8); + this->unk_151 = PARAMS_GET_U(thisx->params, 0, 8); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); if (this->unk_151 != 0) { thisx->flags |= ACTOR_FLAG_REACT_TO_LENS; diff --git a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c index e9132330078..666a562963c 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c +++ b/src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.c @@ -44,7 +44,7 @@ void BgHakaShip_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c index 37605f378cd..43d9386f5f1 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c +++ b/src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c @@ -197,7 +197,7 @@ void BgHakaTubo_DropCollectible(BgHakaTubo* this, PlayState* play) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } else { // Drops a small key and sets a collect flag - collectibleParams = (PARAMS_GET(this->dyna.actor.params, 0, 6) << 8) | ITEM00_SMALL_KEY; + collectibleParams = (PARAMS_GET_U(this->dyna.actor.params, 0, 6) << 8) | ITEM00_SMALL_KEY; Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } if (collectibleParams != -1) { diff --git a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c index 98f73c4ab69..a72eee685f6 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c +++ b/src/overlays/actors/ovl_Bg_Haka_Zou/z_bg_haka_zou.c @@ -77,7 +77,7 @@ void BgHakaZou_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == STA_UNKNOWN) { diff --git a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c index f9a1367b931..90e740b4146 100644 --- a/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c +++ b/src/overlays/actors/ovl_Bg_Heavy_Block/z_bg_heavy_block.c @@ -94,7 +94,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { thisx->params |= 4; } - switch (PARAMS_GET(thisx->params, 0, 8)) { + switch (PARAMS_GET_U(thisx->params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: thisx->draw = BgHeavyBlock_DrawPiece; this->actionFunc = BgHeavyBlock_MovePiece; @@ -114,7 +114,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { Actor_Kill(thisx); return; } @@ -124,7 +124,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SetupDynapoly(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { this->actionFunc = BgHeavyBlock_DoNothing; thisx->shape.rot.x = thisx->world.rot.x = 0x8AD0; thisx->shape.rot.y = thisx->world.rot.y = 0xC000; @@ -151,7 +151,7 @@ void BgHeavyBlock_Init(Actor* thisx, PlayState* play) { void BgHeavyBlock_Destroy(Actor* thisx, PlayState* play) { BgHeavyBlock* this = (BgHeavyBlock*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: break; case HEAVYBLOCK_SMALL_PIECE: @@ -320,7 +320,7 @@ void BgHeavyBlock_Wait(BgHeavyBlock* this, PlayState* play) { if (Actor_HasParent(&this->dyna.actor, play)) { this->timer = 0; - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BREAKABLE: OnePointCutscene_Init(play, 4020, 270, &this->dyna.actor, CAM_ID_MAIN); break; @@ -393,10 +393,10 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { if (this->dyna.actor.home.pos.y <= yIntersect) { Rumble_Request(0.0f, 255, 60, 4); - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_BREAKABLE: BgHeavyBlock_SpawnPieces(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); Actor_Kill(&this->dyna.actor); quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); @@ -420,7 +420,7 @@ void BgHeavyBlock_Fly(BgHeavyBlock* this, PlayState* play) { Quake_SetDuration(quakeIndex, 40); this->actionFunc = BgHeavyBlock_Land; - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); break; case HEAVYBLOCK_UNBREAKABLE: Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BUYOSTAND_STOP_U); @@ -457,7 +457,7 @@ void BgHeavyBlock_Land(BgHeavyBlock* this, PlayState* play) { this->dyna.actor.world.pos = this->dyna.actor.home.pos; Actor_MoveXZGravity(&this->dyna.actor); this->dyna.actor.home.pos = this->dyna.actor.world.pos; - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case HEAVYBLOCK_UNBREAKABLE_OUTSIDE_CASTLE: BgHeavyBlock_SpawnDust(play, Rand_CenteredFloat(30.0f) + 1678.0f, Rand_ZeroFloat(100.0f) + 1286.0f, Rand_CenteredFloat(30.0f) + 552.0f, 0.0f, 0.0f, 0.0f, 0); @@ -511,7 +511,7 @@ void BgHeavyBlock_Draw(Actor* thisx, PlayState* play) { } void BgHeavyBlock_DrawPiece(Actor* thisx, PlayState* play) { - switch (PARAMS_GET(thisx->params, 0, 8)) { + switch (PARAMS_GET_U(thisx->params, 0, 8)) { case HEAVYBLOCK_BIG_PIECE: Matrix_Translate(50.0f, -260.0f, -20.0f, MTXMODE_APPLY); Gfx_DrawDListOpa(play, gHeavyBlockBigPieceDL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c index 505d6e07b90..68d751b39b2 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Curtain/z_bg_hidan_curtain.c @@ -72,7 +72,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { PRINTF("Curtain (arg_data 0x%04x)\n", this->actor.params); Actor_SetFocus(&this->actor, 20.0f); - this->type = PARAMS_GET(thisx->params, 12, 4); + this->type = PARAMS_GET_U(thisx->params, 12, 4); if (this->type > 6) { // "Type is not set" PRINTF("Error : object のタイプが設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_curtain.c", 352, @@ -83,7 +83,7 @@ void BgHidanCurtain_Init(Actor* thisx, PlayState* play) { this->size = ((this->type == 2) || (this->type == 4)) ? 1 : 0; hcParams = &sHCParams[this->size]; - this->treasureFlag = PARAMS_GET(thisx->params, 6, 6); + this->treasureFlag = PARAMS_GET_U(thisx->params, 6, 6); thisx->params &= 0x3F; if ((this->actor.params < 0) || (this->actor.params > 0x3F)) { diff --git a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c index 6f5fdfbe95b..2419ebe7c41 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Dalm/z_bg_hidan_dalm.c @@ -106,7 +106,7 @@ void BgHidanDalm_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (Flags_GetSwitch(play, this->switchFlag)) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c index fb8963231d8..06995d4b475 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hamstep/z_bg_hidan_hamstep.c @@ -138,7 +138,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->colliderItems); @@ -152,7 +152,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { } } - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { CollisionHeader_GetVirtual(&gFireTempleStoneStep1Col, &colHeader); } else { CollisionHeader_GetVirtual(&gFireTempleStoneStep2Col, &colHeader); @@ -160,16 +160,16 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 8))) { - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 8))) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + (-20.0f); BgHidanHamstep_SetupAction(this, 4); } else { this->dyna.actor.world.pos.y = - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } - } else if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + } else if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { BgHidanHamstep_SetupAction(this, 0); } else { BgHidanHamstep_SetupAction(this, 2); @@ -178,7 +178,7 @@ void BgHidanHamstep_Init(Actor* thisx, PlayState* play) { this->dyna.actor.gravity = -1.2f; this->dyna.actor.minVelocityY = -12.0f; - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { // "Fire Temple Object [Hammer Step] appears" PRINTF("◯◯◯炎の神殿オブジェクト【ハンマーステップ】出現\n"); if (BgHidanHamstep_SpawnChildren(this, play) == 0) { @@ -201,7 +201,7 @@ void BgHidanHamstep_Destroy(Actor* thisx, PlayState* play) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { Collider_DestroyTris(play, &this->collider); } } @@ -232,7 +232,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { BgHidanHamstep* child = (BgHidanHamstep*)this->dyna.actor.child; while (child != NULL) { - if (PARAMS_GET(child->dyna.actor.params, 0, 8) != 0) { + if (PARAMS_GET_U(child->dyna.actor.params, 0, 8) != 0) { func_808884C8(child, play); } child = (BgHidanHamstep*)child->dyna.actor.child; @@ -242,7 +242,7 @@ void func_80888638(BgHidanHamstep* this, PlayState* play) { void func_80888694(BgHidanHamstep* this, BgHidanHamstep* parent) { BgHidanHamstep* child; - if (PARAMS_GET(this->dyna.actor.params, 0, 8) >= 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 2) { if (parent->dyna.actor.world.pos.y < this->dyna.actor.world.pos.y) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y; } else if ((this->dyna.actor.world.pos.y - parent->dyna.actor.world.pos.y) < -100.0f) { @@ -267,7 +267,7 @@ void func_80888734(BgHidanHamstep* this) { if (parent != NULL) { this->dyna.actor.velocity.y = parent->dyna.actor.velocity.y; - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 1) { this->dyna.actor.world.pos.y = parent->dyna.actor.world.pos.y - 100.0f; } else { this->dyna.actor.world.pos.y += (this->dyna.actor.velocity.y * frameDivisor); @@ -283,7 +283,7 @@ void func_808887C4(BgHidanHamstep* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_HAMMER_SWITCH); this->collider.base.acFlags = AC_NONE; BgHidanHamstep_SetupAction(this, 1); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 8)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 8)); } else { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } @@ -329,9 +329,9 @@ void func_808889B8(BgHidanHamstep* this, PlayState* play) { func_80888734(this); if ((parent->action == 4) || ((parent->action == 3) && (parent->unk_244 >= 5))) { - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 1) { this->dyna.actor.world.pos.y = - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 4); } else { BgHidanHamstep_SetupAction(this, 3); @@ -347,20 +347,20 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Actor_MoveXZGravity(&this->dyna.actor); func_80888694(this, (BgHidanHamstep*)this->dyna.actor.parent); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET(this->dyna.actor.params, 0, 8) >= 6) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) <= 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 8) >= 6) { // "[Hammer Step] arg_data strange (arg_data = %d)" PRINTF("【ハンマーステップ】 arg_data おかしい (arg_data = %d)", this->dyna.actor.params); PRINTF("%s %d\n", "../z_bg_hidan_hamstep.c", 696); } if (((this->dyna.actor.world.pos.y - this->dyna.actor.home.pos.y) <= - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1]) && + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1]) && (this->dyna.actor.velocity.y <= 0.0f)) { this->unk_244++; if (this->unk_244 >= 7) { this->dyna.actor.world.pos.y = - sYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; + sYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8) - 1] + this->dyna.actor.home.pos.y; BgHidanHamstep_SetupAction(this, 3); } else { this->dyna.actor.velocity.y *= -0.24f; @@ -377,7 +377,7 @@ void func_80888A58(BgHidanHamstep* this, PlayState* play) { Rumble_Request(SQ(100.0f), 255, 20, 150); func_808884C8(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 5) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 5) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } @@ -404,7 +404,7 @@ void BgHidanHamstep_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_hamstep.c", 787), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - if (PARAMS_GET(thisx->params, 0, 8) == 0) { + if (PARAMS_GET_U(thisx->params, 0, 8) == 0) { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep1DL); } else { gSPDisplayList(POLY_OPA_DISP++, gFireTempleStoneStep2DL); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c index d7ffaa59647..53b2fb4bc29 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Hrock/z_bg_hidan_hrock.c @@ -84,8 +84,8 @@ void BgHidanHrock_Init(Actor* thisx, PlayState* play) { CollisionHeader* collisionHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->unk_16A = PARAMS_GET(thisx->params, 0, 6); - thisx->params = PARAMS_GET(thisx->params, 8, 8); + this->unk_16A = PARAMS_GET_U(thisx->params, 0, 6); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, thisx, &sTrisInit, this->colliderItems); DynaPolyActor_Init(&this->dyna, 0); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c index 43628bf6efa..99537b94116 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kousi/z_bg_hidan_kousi.c @@ -70,17 +70,17 @@ void BgHidanKousi_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_SetFocus(thisx, 50.0f); PRINTF("◯◯◯炎の神殿オブジェクト【格子(arg_data : %0x)】出現 (%d %d)\n", thisx->params, - PARAMS_GET(thisx->params, 0, 8), PARAMS_GET((s32)thisx->params, 8, 8)); + PARAMS_GET_U(thisx->params, 0, 8), PARAMS_GET_U((s32)thisx->params, 8, 8)); Actor_ProcessInitChain(thisx, sInitChain); - if (PARAMS_GET(thisx->params, 0, 8) < 0 || PARAMS_GET(thisx->params, 0, 8) >= 3) { + if (PARAMS_GET_U(thisx->params, 0, 8) < 0 || PARAMS_GET_U(thisx->params, 0, 8) >= 3) { PRINTF("arg_data おかしい 【格子】\n"); } - CollisionHeader_GetVirtual(sMetalFencesCollisions[PARAMS_GET(thisx->params, 0, 8)], &colHeader); + CollisionHeader_GetVirtual(sMetalFencesCollisions[PARAMS_GET_U(thisx->params, 0, 8)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - thisx->world.rot.y = D_80889E7C[PARAMS_GET(this->dyna.actor.params, 0, 8)] + thisx->shape.rot.y; - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 8))) { + thisx->world.rot.y = D_80889E7C[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] + thisx->shape.rot.y; + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 8))) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); } else { @@ -96,15 +96,15 @@ void BgHidanKousi_Destroy(Actor* thisx, PlayState* play) { void func_80889ACC(BgHidanKousi* this) { s32 pad[2]; Vec3s* rot = &this->dyna.actor.world.rot; - f32 temp1 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 8)] * Math_SinS(rot->y); - f32 temp2 = D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 8)] * Math_CosS(rot->y); + f32 temp1 = D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] * Math_SinS(rot->y); + f32 temp2 = D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] * Math_CosS(rot->y); this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x + temp1; this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z + temp2; } void func_80889B5C(BgHidanKousi* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 8))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 8))) { BgHidanKousi_SetupAction(this, func_80889BC0); OnePointCutscene_Attention(play, &this->dyna.actor); this->unk_168 = 0xC8; @@ -130,7 +130,7 @@ void func_80889C18(BgHidanKousi* this, PlayState* play) { void func_80889C90(BgHidanKousi* this, PlayState* play) { Actor_UpdatePos(&this->dyna.actor); - if (D_80889E40[PARAMS_GET(this->dyna.actor.params, 0, 8)] < + if (D_80889E40[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] < Math_Vec3f_DistXYZ(&this->dyna.actor.home.pos, &this->dyna.actor.world.pos)) { func_80889ACC(this); BgHidanKousi_SetupAction(this, func_80889D28); @@ -156,7 +156,7 @@ void BgHidanKousi_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 354), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[PARAMS_GET(thisx->params, 0, 8)]); + gSPDisplayList(POLY_OPA_DISP++, sMetalFencesDLs[PARAMS_GET_U(thisx->params, 0, 8)]); CLOSE_DISPS(play->state.gfxCtx, "../z_bg_hidan_kousi.c", 359); } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 45dc6c18122..1e24e902e27 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -77,9 +77,9 @@ void BgHidanKowarerukabe_InitDynaPoly(BgHidanKowarerukabe* this, PlayState* play CollisionHeader* colHeader = NULL; s32 pad2; - if (collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 8)] != NULL) { + if (collisionHeaders[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] != NULL) { DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(collisionHeaders[PARAMS_GET(this->dyna.actor.params, 0, 8)], &colHeader); + CollisionHeader_GetVirtual(collisionHeaders[PARAMS_GET_U(this->dyna.actor.params, 0, 8)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); } else { this->dyna.bgId = BGACTOR_NEG_ONE; @@ -94,15 +94,15 @@ void BgHidanKowarerukabe_InitColliderSphere(BgHidanKowarerukabe* this, PlayState Collider_InitJntSph(play, &this->collider); Collider_SetJntSph(play, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderItems); - this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET(this->dyna.actor.params, 0, 8)]; - this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET(this->dyna.actor.params, 0, 8)]; + this->collider.elements[0].dim.modelSphere.radius = sphereRadii[PARAMS_GET_U(this->dyna.actor.params, 0, 8)]; + this->collider.elements[0].dim.modelSphere.center.y = sphereYPositions[PARAMS_GET_U(this->dyna.actor.params, 0, 8)]; } void BgHidanKowarerukabe_OffsetActorYPos(BgHidanKowarerukabe* this) { static f32 actorYPosOffsets[] = { 0.7f, 0.0f, 0.0f }; this->dyna.actor.world.pos.y = - actorYPosOffsets[PARAMS_GET(this->dyna.actor.params, 0, 8)] + this->dyna.actor.home.pos.y; + actorYPosOffsets[PARAMS_GET_U(this->dyna.actor.params, 0, 8)] + this->dyna.actor.home.pos.y; } static InitChainEntry sInitChain[] = { @@ -116,8 +116,8 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { BgHidanKowarerukabe_InitDynaPoly(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) < CRACKED_STONE_FLOOR || - PARAMS_GET(this->dyna.actor.params, 0, 8) > LARGE_BOMBABLE_WALL) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) < CRACKED_STONE_FLOOR || + PARAMS_GET_U(this->dyna.actor.params, 0, 8) > LARGE_BOMBABLE_WALL) { // "Error: Fire Temple Breakable Walls. arg_data I can't determine the (%s %d)(arg_data 0x%04x)" PRINTF("Error : 炎の神殿 壊れる壁 の arg_data が判別出来ない(%s %d)(arg_data 0x%04x)\n", "../z_bg_hidan_kowarerukabe.c", 254, this->dyna.actor.params); @@ -125,7 +125,7 @@ void BgHidanKowarerukabe_Init(Actor* thisx, PlayState* play) { return; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -284,7 +284,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, PlayState* pl } void BgHidanKowarerukabe_Break(BgHidanKowarerukabe* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case CRACKED_STONE_FLOOR: BgHidanKowarerukabe_FloorBreak(this, play); break; @@ -305,9 +305,9 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) { if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) { BgHidanKowarerukabe_Break(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); - if (PARAMS_GET(this->dyna.actor.params, 0, 8) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 8) == 0) { SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_EXPLOSION); } else { SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); @@ -330,7 +330,7 @@ void BgHidanKowarerukabe_Draw(Actor* thisx, PlayState* play) { gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_bg_hidan_kowarerukabe.c", 568), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[PARAMS_GET(this->dyna.actor.params, 0, 8)]); + gSPDisplayList(POLY_OPA_DISP++, sBreakableWallDLists[PARAMS_GET_U(this->dyna.actor.params, 0, 8)]); Collider_UpdateSpheres(0, &this->collider); diff --git a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 03da44cda1d..bcdff203d1b 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -74,10 +74,10 @@ void BgHidanRock_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - this->type = PARAMS_GET(thisx->params, 0, 8); + this->type = PARAMS_GET_U(thisx->params, 0, 8); this->unk_169 = 0; - thisx->params = PARAMS_GET(thisx->params, 8, 8); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); diff --git a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c index f3cfb6b37fe..e35fa1b126d 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shelter/z_bg_ice_shelter.c @@ -9,8 +9,8 @@ #define FLAGS 0 -#define BGICESHELTER_GET_TYPE(thisx) PARAMS_GET((thisx)->params, 8, 3) -#define BGICESHELTER_NO_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 6, 1) +#define BGICESHELTER_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 8, 3) +#define BGICESHELTER_NO_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 6, 1) void BgIceShelter_Init(Actor* thisx, PlayState* play); void BgIceShelter_Destroy(Actor* thisx, PlayState* play); @@ -180,7 +180,7 @@ void BgIceShelter_Init(Actor* thisx, PlayState* play) { // The only red ice actor in the game that doesn't use a switch flag is the one for King Zora if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor) && - (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)))) { + (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)))) { Actor_Kill(&this->dyna.actor); return; } @@ -429,7 +429,7 @@ void BgIceShelter_Melt(BgIceShelter* this, PlayState* play) { if (this->alpha <= 0) { if (!BGICESHELTER_NO_SWITCH_FLAG(&this->dyna.actor)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } if (type == RED_ICE_KING_ZORA) { diff --git a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c index 082557b8577..daf4f536e38 100644 --- a/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c +++ b/src/overlays/actors/ovl_Bg_Ice_Shutter/z_bg_ice_shutter.c @@ -54,8 +54,8 @@ void BgIceShutter_Init(Actor* thisx, PlayState* play) { colHeader = NULL; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, 0); - sp28 = PARAMS_GET(this->dyna.actor.params, 0, 8); - this->dyna.actor.params = PARAMS_GET(this->dyna.actor.params, 8, 8); + sp28 = PARAMS_GET_U(this->dyna.actor.params, 0, 8); + this->dyna.actor.params = PARAMS_GET_U(this->dyna.actor.params, 8, 8); CollisionHeader_GetVirtual(&object_ice_objects_Col_002854, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); if (sp28 == 2) { diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index e8d3d8791b9..93ab7db046c 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -51,7 +51,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->dyna.actor, 0.1f); - if ((PARAMS_GET(this->dyna.actor.params, 0, 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { + if ((PARAMS_GET_U(this->dyna.actor.params, 0, 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { play->csCtx.curFrame = 0; BgInGate_SetupAction(this, func_80892890); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index 8d4cfef7015..2cf5a7f1c25 100644 --- a/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -102,7 +102,7 @@ void BgJya1flift_Init(Actor* thisx, PlayState* play) { BgJya1flift_InitDynapoly(this, play, &g1fliftCol, 0); Actor_ProcessInitChain(thisx, sInitChain); BgJya1flift_InitCollision(thisx, play); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { LINK_AGE_IN_YEARS == YEARS_ADULT ? BgJya1flift_ChangeDirection(this) : BgJya1flift_SetupDoNothing(this); } else { BgJya1flift_SetupWaitForSwitch(this); @@ -128,7 +128,7 @@ void BgJya1flift_SetupWaitForSwitch(BgJya1flift* this) { } void BgJya1flift_WaitForSwitch(BgJya1flift* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { BgJya1flift_ChangeDirection(this); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index e56a541d314..d376aec0fca 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -43,7 +43,7 @@ void BgJyaBlock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { + if ((LINK_AGE_IN_YEARS != YEARS_CHILD) || !Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c index 799a3ab08c8..f7ed229ad55 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombchuiwa/z_bg_jya_bombchuiwa.c @@ -78,7 +78,7 @@ void BgJyaBombchuiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); BgJyaBombchuiwa_SetupCollider(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { BgJyaBombchuiwa_SpawnLightRay(this, play); } else { BgJyaBombchuiwa_SetupWaitForExplosion(this, play); diff --git a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c index 0b9599d995e..2495d10f035 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c +++ b/src/overlays/actors/ovl_Bg_Jya_Bombiwa/z_bg_jya_bombiwa.c @@ -88,17 +88,17 @@ void BgJyaBombiwa_InitCollider(BgJyaBombiwa* this, PlayState* play) { void BgJyaBombiwa_Init(Actor* thisx, PlayState* play) { BgJyaBombiwa* this = (BgJyaBombiwa*)thisx; - if (PARAMS_GET(this->dyna.actor.params, 0, 6) != 0x29) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 6) != 0x29) { PRINTF(VT_COL(YELLOW, BLACK)); // "Warning: Switch Number changed (%s %d)(SW %d)" PRINTF("Warning : Switch Number が変更された(%s %d)(SW %d)\n", "../z_bg_jya_bombiwa.c", 218, - PARAMS_GET(this->dyna.actor.params, 0, 6)); + PARAMS_GET_U(this->dyna.actor.params, 0, 6)); PRINTF(VT_RST); } BgJyaBombiwa_SetupDynaPoly(this, play, &gBombiwaCol, 0); BgJyaBombiwa_InitCollider(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -164,7 +164,7 @@ void BgJyaBombiwa_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { BgJyaBombiwa_Break(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Actor_Kill(&this->dyna.actor); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 578656287e3..2f750a9abdf 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -146,7 +146,7 @@ void func_80895A70(BgJyaCobra* this) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; MirRay* mirRay; - switch (PARAMS_GET(this->dyna.actor.params, 0, 2)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 2)) { case 0: mirRay = (MirRay*)this->dyna.actor.child; if (mirRay == NULL) { @@ -179,7 +179,7 @@ void func_80895A70(BgJyaCobra* this) { mirRay->unLit = 0; Math_Vec3f_Copy(&mirRay->sourcePt, &this->unk_180); Matrix_RotateY(BINANG_TO_RAD(this->dyna.actor.shape.rot.y), MTXMODE_NEW); - Matrix_RotateX(BINANG_TO_RAD(D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 2)]), MTXMODE_APPLY); + Matrix_RotateX(BINANG_TO_RAD(D_80897308[PARAMS_GET_U(this->dyna.actor.params, 0, 2)]), MTXMODE_APPLY); sp28.x = 0.0f; sp28.y = 0.0; sp28.z = this->unk_190 * 2800.0f; @@ -205,14 +205,14 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; f32 phi_f0; - if (PARAMS_GET(params, 0, 2) == 2 && mirror != NULL && + if (PARAMS_GET_U(params, 0, 2) == 2 && mirror != NULL && (!(mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) || !(mirror->puzzleFlags & BIGMIR_PUZZLE_COBRA1_SOLVED))) { Math_StepToF(&this->unk_18C, 0.0f, 0.05f); } else { this->unk_18C = 1.0f; - if (D_80897310[PARAMS_GET(params, 0, 2)]) { - phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[PARAMS_GET(params, 0, 2)]; + if (D_80897310[PARAMS_GET_U(params, 0, 2)]) { + phi_v0 = this->dyna.actor.shape.rot.y - D_80897314[PARAMS_GET_U(params, 0, 2)]; phi_v0 = ABS(phi_v0); if (phi_v0 < 0x2000 && phi_v0 != -0x8000) { this->unk_18C += (phi_v0 - 0x2000) * (3.0f / 0x4000); @@ -227,9 +227,9 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { this->unk_180.y = this->dyna.actor.world.pos.y + 57.0f; this->unk_180.z = this->dyna.actor.world.pos.z; - if (PARAMS_GET(params, 0, 2) == 0) { + if (PARAMS_GET_U(params, 0, 2) == 0) { this->unk_190 = 0.1f; - } else if (PARAMS_GET(params, 0, 2) == 1) { + } else if (PARAMS_GET_U(params, 0, 2) == 1) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -242,7 +242,7 @@ void func_80895C74(BgJyaCobra* this, PlayState* play) { } } Math_StepToF(&this->unk_190, phi_f0, 0.04f); - } else if (PARAMS_GET(params, 0, 2) == 2) { + } else if (PARAMS_GET_U(params, 0, 2) == 2) { phi_f0 = 0.1f; phi_v0 = this->dyna.actor.shape.rot.y - 0x8000; if (phi_v0 < 0x500 && phi_v0 > -0x500) { @@ -279,7 +279,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { Lib_MemSet(shadowTex, COBRA_SHADOW_TEX_SIZE, 0); Matrix_RotateX((M_PI / 4), MTXMODE_NEW); - rotY = !PARAMS_GET(this->dyna.actor.params, 0, 2) ? (this->dyna.actor.shape.rot.y + 0x4000) + rotY = !PARAMS_GET_U(this->dyna.actor.params, 0, 2) ? (this->dyna.actor.shape.rot.y + 0x4000) : (this->dyna.actor.shape.rot.y - 0x4000); Matrix_RotateY(BINANG_TO_RAD(rotY), MTXMODE_APPLY); Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); @@ -401,22 +401,22 @@ void BgJyaCobra_Init(Actor* thisx, PlayState* play) { BgJyaCobra_InitDynapoly(this, play, &gCobraCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (!PARAMS_GET(this->dyna.actor.params, 0, 2) && - Flags_GetSwitch(play, PARAMS_GET((s32)this->dyna.actor.params, 8, 6))) { + if (!PARAMS_GET_U(this->dyna.actor.params, 0, 2) && + Flags_GetSwitch(play, PARAMS_GET_U((s32)this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.rot.y = this->dyna.actor.home.rot.y = this->dyna.actor.shape.rot.y = 0; } - if (!PARAMS_GET(this->dyna.actor.params, 0, 2)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 0, 2)) { BgJyaCobra_SpawnRay(this, play); } func_80896918(this, play); - if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 1 || PARAMS_GET(this->dyna.actor.params, 0, 2) == 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 1 || PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 2) { this->dyna.actor.room = -1; } - if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 1) { BgJyaCobra_UpdateShadowFromTop(this); } @@ -522,7 +522,7 @@ void BgJyaCobra_Update(Actor* thisx, PlayState* play2) { func_80895C74(this, play); func_80895A70(this); - if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 0 || PARAMS_GET(this->dyna.actor.params, 0, 2) == 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 0 || PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 2) { BgJyaCobra_UpdateShadowFromSide(this); } } @@ -545,7 +545,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { OPEN_DISPS(play->state.gfxCtx, "../z_bg_jya_cobra.c", 924); Gfx_SetupDL_25Xlu(play->state.gfxCtx); - sp44.x = D_80897308[PARAMS_GET(this->dyna.actor.params, 0, 2)] + this->dyna.actor.shape.rot.x; + sp44.x = D_80897308[PARAMS_GET_U(this->dyna.actor.params, 0, 2)] + this->dyna.actor.shape.rot.x; sp44.y = this->dyna.actor.shape.rot.y; sp44.z = this->dyna.actor.shape.rot.z; Matrix_SetTranslateRotateYXZ(this->unk_180.x, this->unk_180.y, this->unk_180.z, &sp44); @@ -561,7 +561,7 @@ void func_80896D78(BgJyaCobra* this, PlayState* play) { void BgJyaCobra_DrawShadow(BgJyaCobra* this, PlayState* play) { s32 pad; - s16 params = PARAMS_GET(this->dyna.actor.params, 0, 2); + s16 params = PARAMS_GET_U(this->dyna.actor.params, 0, 2); Vec3f sp64; Vec3s* phi_a3; @@ -612,7 +612,7 @@ void BgJyaCobra_Draw(Actor* thisx, PlayState* play) { func_80896D78(this, play); } - if (PARAMS_GET(this->dyna.actor.params, 0, 2) == 2) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 2) == 2) { BgJyaBigmirror* mirror = (BgJyaBigmirror*)this->dyna.actor.parent; if (mirror != NULL && (mirror->puzzleFlags & BIGMIR_PUZZLE_BOMBIWA_DESTROYED) && diff --git a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c index e3d8ebc1a3a..167cefb2385 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c +++ b/src/overlays/actors/ovl_Bg_Jya_Ironobj/z_bg_jya_ironobj.c @@ -84,7 +84,7 @@ void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) { Collider_InitCylinder(play, colCylinder); Collider_SetCylinder(play, colCylinder, &this->dyna.actor, &sCylinderInit); - if (PARAMS_GET(this->dyna.actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->dyna.actor.params, 0, 1) == 1) { this->colCylinder.dim.radius = 40; this->colCylinder.dim.height = 100; } @@ -221,7 +221,7 @@ void BgJyaIronobj_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); BgJyaIronobj_InitCylinder(this, play); - CollisionHeader_GetVirtual(sCollisionHeaders[PARAMS_GET(thisx->params, 0, 1)], &colHeader); + CollisionHeader_GetVirtual(sCollisionHeaders[PARAMS_GET_U(thisx->params, 0, 1)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); func_808992D8(this); } @@ -247,7 +247,7 @@ void func_808992E8(BgJyaIronobj* this, PlayState* play) { actor = this->colCylinder.base.ac; this->colCylinder.base.acFlags &= ~AC_HIT; if (actor != NULL && actor->id == ACTOR_EN_IK) { - particleFunc[PARAMS_GET(this->dyna.actor.params, 0, 1)](this, play, (EnIk*)actor); + particleFunc[PARAMS_GET_U(this->dyna.actor.params, 0, 1)](this, play, (EnIk*)actor); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 80, NA_SE_EN_IRONNACK_BREAK_PILLAR); dropPos.x = this->dyna.actor.world.pos.x; dropPos.y = this->dyna.actor.world.pos.y + 20.0f; @@ -271,5 +271,5 @@ void BgJyaIronobj_Update(Actor* thisx, PlayState* play) { } void BgJyaIronobj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sOpaDL[PARAMS_GET(thisx->params, 0, 1)]); + Gfx_DrawDListOpa(play, sOpaDL[PARAMS_GET_U(thisx->params, 0, 1)]); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c index b4dbef476a3..d1aba8c22de 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Kanaami/z_bg_jya_kanaami.c @@ -59,7 +59,7 @@ void BgJyaKanaami_Init(Actor* thisx, PlayState* play) { BgJyaKanaami_InitDynaPoly(this, play, &gKanaamiCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_80899A08(this); } else { func_80899880(this); @@ -79,7 +79,7 @@ void func_80899880(BgJyaKanaami* this) { } void func_80899894(BgJyaKanaami* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) || this->unk_16A > 0) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || this->unk_16A > 0) { if (this->dyna.actor.world.pos.x > -1000.0f && this->unk_16A == 0) { OnePointCutscene_Init(play, 3450, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index c72b393d956..fb50562198f 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -63,7 +63,7 @@ void BgJyaLift_Init(Actor* thisx, PlayState* play) { PRINTF("女神リフト CT\n"); BgJyaLift_InitDynapoly(this, play, &gLiftCol, 0); Actor_ProcessInitChain(thisx, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { BgJyaLift_SetFinalPosY(this); } else { BgJyaLift_SetInitPosY(this); @@ -92,7 +92,7 @@ void BgJyaLift_SetInitPosY(BgJyaLift* this) { } void BgJyaLift_DelayMove(BgJyaLift* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) || (this->moveDelay > 0)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || (this->moveDelay > 0)) { this->moveDelay++; if (this->moveDelay >= 20) { OnePointCutscene_Init(play, 3430, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c index 4f393a08c33..a83b2d0e80a 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c +++ b/src/overlays/actors/ovl_Bg_Jya_Megami/z_bg_jya_megami.c @@ -161,7 +161,7 @@ void BgJyaMegami_Init(Actor* thisx, PlayState* play) { BgJyaMegami_InitDynaPoly(this, play, &GMegamiCol, 0); BgJyaMegami_InitCollider(this, play); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); } else { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -195,7 +195,7 @@ void BgJyaMegami_DetectLight(BgJyaMegami* this, PlayState* play) { this->lightTimer--; } if (this->lightTimer > 40) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); BgJyaMegami_SetupExplode(this); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 100, NA_SE_EV_FACE_EXPLOSION); OnePointCutscene_Init(play, 3440, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c index 972a02e3950..cf54671571a 100644 --- a/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c +++ b/src/overlays/actors/ovl_Bg_Menkuri_Nisekabe/z_bg_menkuri_nisekabe.c @@ -49,7 +49,7 @@ void BgMenkuriNisekabe_Update(Actor* thisx, PlayState* play) { void BgMenkuriNisekabe_Draw(Actor* thisx, PlayState* play) { BgMenkuriNisekabe* this = (BgMenkuriNisekabe*)thisx; - u32 index = PARAMS_GET(this->actor.params, 0, 8); + u32 index = PARAMS_GET_U(this->actor.params, 0, 8); if (CHECK_FLAG_ALL(this->actor.flags, ACTOR_FLAG_REACT_TO_LENS)) { Gfx_DrawDListXlu(play, sDLists[index]); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c index 5498442d2dd..ad2ebaee475 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Bwall/z_bg_mizu_bwall.c @@ -176,14 +176,14 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->yRot = this->dyna.actor.world.pos.y; - this->dList = sDLists[PARAMS_GET((u16)this->dyna.actor.params, 0, 4)]; + this->dList = sDLists[PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)]; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - CollisionHeader_GetVirtual(sColHeaders[PARAMS_GET((u16)this->dyna.actor.params, 0, 4)], &colHeader); + CollisionHeader_GetVirtual(sColHeaders[PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); - switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)) { case MIZUBWALL_FLOOR: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -218,7 +218,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_RUTO_ROOM: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -253,7 +253,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_UNUSED: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -290,7 +290,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_STINGER_ROOM_1: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -328,7 +328,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) { } break; case MIZUBWALL_STINGER_ROOM_2: - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6))) { DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; this->actionFunc = BgMizuBwall_DoNothing; @@ -425,7 +425,7 @@ void BgMizuBwall_SpawnDebris(BgMizuBwall* this, PlayState* play) { Vec3f debrisOffsets[15]; for (i = 0; i < ARRAY_COUNT(debrisOffsets); i++) { - switch (PARAMS_GET((u16)this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U((u16)this->dyna.actor.params, 0, 4)) { case MIZUBWALL_FLOOR: debrisOffsets[i].x = (Rand_ZeroOne() * 80.0f) - 40.0f; debrisOffsets[i].y = Rand_ZeroOne() * 0; @@ -465,7 +465,7 @@ void BgMizuBwall_Idle(BgMizuBwall* this, PlayState* play) { BgMizuBwall_SetAlpha(this, play); if (this->collider.base.acFlags & AC_HIT) { this->collider.base.acFlags &= ~AC_HIT; - Flags_SetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 8, 6)); this->breakTimer = 1; DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->dList = NULL; diff --git a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c index c6249d43972..c8cf4111173 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Movebg/z_bg_mizu_movebg.c @@ -10,11 +10,11 @@ #define FLAGS ACTOR_FLAG_4 -#define MOVEBG_TYPE(params) PARAMS_GET((u16)(params), 12, 4) -#define MOVEBG_FLAGS(params) PARAMS_GET((u16)(params), 0, 6) -#define MOVEBG_PATH_ID(params) PARAMS_GET((u16)(params), 8, 4) -#define MOVEBG_POINT_ID(params) PARAMS_GET((u16)(params), 0, 4) -#define MOVEBG_SPEED(params) PARAMS_GET((u16)(params), 4, 4) +#define MOVEBG_TYPE(params) PARAMS_GET_U((u16)(params), 12, 4) +#define MOVEBG_FLAGS(params) PARAMS_GET_U((u16)(params), 0, 6) +#define MOVEBG_PATH_ID(params) PARAMS_GET_U((u16)(params), 8, 4) +#define MOVEBG_POINT_ID(params) PARAMS_GET_U((u16)(params), 0, 4) +#define MOVEBG_SPEED(params) PARAMS_GET_U((u16)(params), 4, 4) void BgMizuMovebg_Init(Actor* thisx, PlayState* play); void BgMizuMovebg_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h index c0043f7622d..cc42e4ddf35 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h +++ b/src/overlays/actors/ovl_Bg_Mizu_Shutter/z_bg_mizu_shutter.h @@ -4,9 +4,9 @@ #include "ultra64.h" #include "global.h" -#define BGMIZUSHUTTER_GET_SIZE(thisx) PARAMS_GET((u16)(thisx)->params, 12, 4) -#define BGMIZUSHUTTER_GET_TIMER(thisx) PARAMS_GET((u16)(thisx)->params, 6, 6) -#define BGMIZUSHUTTER_GET_SWITCH(thisx) PARAMS_GET((u16)(thisx)->params, 0, 6) +#define BGMIZUSHUTTER_GET_SIZE(thisx) PARAMS_GET_U((u16)(thisx)->params, 12, 4) +#define BGMIZUSHUTTER_GET_TIMER(thisx) PARAMS_GET_U((u16)(thisx)->params, 6, 6) +#define BGMIZUSHUTTER_GET_SWITCH(thisx) PARAMS_GET_U((u16)(thisx)->params, 0, 6) #define BGMIZUSHUTTER_PARAMS(size, timer, switchFlag) (((size) << 12) | ((timer) << 6) | (switchFlag)) diff --git a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c index 91a7d8ec060..766b3059fd1 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Water/z_bg_mizu_water.c @@ -95,8 +95,8 @@ void BgMizuWater_Init(Actor* thisx, PlayState* play) { s32 waterLevelActionIndex; waterBoxes = play->colCtx.colHeader->waterBoxes; - this->type = PARAMS_GET(this->actor.params, 0, 8); - this->switchFlag = PARAMS_GET(this->actor.params, 8, 8); + this->type = PARAMS_GET_U(this->actor.params, 0, 8); + this->switchFlag = PARAMS_GET_U(this->actor.params, 8, 8); Actor_ProcessInitChain(&this->actor, sInitChain); initialActorY = this->actor.world.pos.y; this->baseY = initialActorY; diff --git a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c index c37d5e1ed9a..18f83d3f101 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c +++ b/src/overlays/actors/ovl_Bg_Mori_Bigst/z_bg_mori_bigst.c @@ -72,7 +72,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { // "mori (bigST.keyceiling)" PRINTF("mori (bigST.鍵型天井)(arg : %04x)(sw %d)(noE %d)(roomC %d)(playerPosY %f)\n", this->dyna.actor.params, - Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)), + Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)), Flags_GetTempClear(play, this->dyna.actor.room), Flags_GetClear(play, this->dyna.actor.room), GET_PLAYER(play)->actor.world.pos.y); BgMoriBigst_InitDynapoly(this, play, &gMoriBigstCol, 0); @@ -85,7 +85,7 @@ void BgMoriBigst_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; } else { this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 270.0f; @@ -111,7 +111,7 @@ void BgMoriBigst_WaitForMoriTex(BgMoriBigst* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) { thisx->draw = BgMoriBigst_Draw; if (Flags_GetClear(play, thisx->room) && (GET_PLAYER(play)->actor.world.pos.y > 700.0f)) { - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { BgMoriBigst_SetupDone(this, play); } else { BgMoriBigst_SetupStalfosFight(this, play); @@ -216,7 +216,7 @@ void BgMoriBigst_SetupStalfosPairFight(BgMoriBigst* this, PlayState* play) { void BgMoriBigst_StalfosPairFight(BgMoriBigst* this, PlayState* play) { if ((this->dyna.actor.home.rot.z == 0) && !Player_InCsMode(play)) { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); BgMoriBigst_SetupDone(this, play); } } diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index b64ae333d60..2205a0f7268 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -135,7 +135,7 @@ void BgMoriElevator_SetupWaitAfterInit(BgMoriElevator* this) { void BgMoriElevator_WaitAfterInit(BgMoriElevator* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->moriTexObjectSlot)) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { if (play->roomCtx.curRoom.num == 2) { this->dyna.actor.world.pos.y = 73.0f; BgMoriElevator_SetupSetPosition(this); @@ -210,11 +210,11 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) { } else if ((play->roomCtx.curRoom.num == 17) && (-275.0f < this->dyna.actor.world.pos.y)) { this->targetY = -779.0f; BgMoriElevator_StopMovement(this); - } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) && + } else if ((play->roomCtx.curRoom.num == 2) && Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) && (this->unk_16C == 0)) { this->targetY = 73.0f; func_808A1C30(this); - } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) && + } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) && (this->unk_16C != 0)) { this->targetY = 233.0f; func_808A1CF4(this, play); @@ -245,7 +245,7 @@ void BgMoriElevator_Update(Actor* thisx, PlayState* play) { this->actionFunc(this, play); this->unk_170 = this->dyna.interactFlags; - this->unk_16C = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6)); + this->unk_16C = Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6)); } void BgMoriElevator_Draw(Actor* thisx, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c index e3c264ad634..c81b8ef8d8b 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hashira4/z_bg_mori_hashira4.c @@ -69,7 +69,7 @@ void BgMoriHashira4_Init(Actor* thisx, PlayState* play) { s32 pad; BgMoriHashira4* this = (BgMoriHashira4*)thisx; - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 6); + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 8, 6); this->dyna.actor.params &= 0xFF; if (this->dyna.actor.params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 489e05f4443..606d67265da 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -61,13 +61,13 @@ void BgMoriHineri_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - switchFlagParam = PARAMS_GET(this->dyna.actor.params, 0, 6); + switchFlagParam = PARAMS_GET_U(this->dyna.actor.params, 0, 6); t6 = PARAMS_GET_NOSHIFT(this->dyna.actor.params, 14, 1); if (t6 != 0) { this->switchFlag = switchFlagParam; } else { - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 8, 6); + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 8, 6); this->switchFlag = (Flags_GetSwitch(play, this->switchFlag)) ? 1 : 0; } this->dyna.actor.params = TWISTED_HALLWAY_GET_PARAM_15(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h index b9a99e36b17..468bb296569 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h +++ b/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.h @@ -6,7 +6,7 @@ struct BgMoriHineri; -// Due to a unique access pattern, this param cannot use the generic "PARAMS_GET" macros +// Due to a unique access pattern, this param cannot use the generic "PARAMS_GET_U" macros #define TWISTED_HALLWAY_GET_PARAM_15(thisx) (((thisx)->params & (NBITS_TO_MASK(1) << (15))) >> ((15) - (1))) typedef void (*BgMoriHineriActionFunc)(struct BgMoriHineri*, PlayState*); diff --git a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index b04aa2d0525..2c86ad8ce02 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -58,7 +58,7 @@ void BgMoriIdomizu_Init(Actor* thisx, PlayState* play) { this->actor.scale.z = 1.0f; this->actor.world.pos.x = 119.0f; this->actor.world.pos.z = -1820.0f; - this->prevSwitchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); + this->prevSwitchFlagSet = Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); if (this->prevSwitchFlagSet != 0) { this->actor.world.pos.y = -282.0f; BgMoriIdomizu_SetWaterLevel(play, -282); @@ -111,7 +111,7 @@ void BgMoriIdomizu_Main(BgMoriIdomizu* this, PlayState* play) { s32 switchFlagSet; roomNum = play->roomCtx.curRoom.num; - switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6)); + switchFlagSet = Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6)); if (switchFlagSet) { this->targetWaterLevel = -282.0f; } else { diff --git a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index f6a7ce13b10..865136ef414 100644 --- a/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -196,8 +196,8 @@ void BgPoEvent_Init(Actor* thisx, PlayState* play) { BgPoEvent* this = (BgPoEvent*)thisx; Actor_ProcessInitChain(thisx, sInitChain); - this->type = PARAMS_GET(thisx->params, 8, 4); - this->index = PARAMS_GET(thisx->params, 12, 4); + this->type = PARAMS_GET_U(thisx->params, 8, 4); + this->index = PARAMS_GET_U(thisx->params, 12, 4); thisx->params &= 0x3F; if (this->type >= 2) { diff --git a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c index bcdfe74a871..4bf7bcd8a08 100644 --- a/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c +++ b/src/overlays/actors/ovl_Bg_Po_Syokudai/z_bg_po_syokudai.c @@ -80,7 +80,7 @@ void BgPoSyokudai_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); - this->flameColor = PARAMS_GET(thisx->params, 8, 8); + this->flameColor = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0x3F; thisx->colChkInfo.mass = MASS_IMMOVABLE; diff --git a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 53064795d05..3eb30a25db1 100644 --- a/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -50,8 +50,8 @@ void BgRelayObjects_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 0, 6); - thisx->params = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 0, 6); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS | DYNA_TRANSFORM_ROT_Y); if (thisx->params == WINDMILL_ROTATING_GEAR) { CollisionHeader_GetVirtual(&gWindmillRotatingPlatformCol, &colHeader); diff --git a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c index f7e2e4c1b1c..fbbba12a533 100644 --- a/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c +++ b/src/overlays/actors/ovl_Bg_Spot01_Objects2/z_bg_spot01_objects2.c @@ -45,7 +45,7 @@ static Gfx* D_808AC510[] = { void BgSpot01Objects2_Init(Actor* thisx, PlayState* play) { BgSpot01Objects2* this = (BgSpot01Objects2*)thisx; - switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 3)) { case 0: case 1: case 2: @@ -99,7 +99,7 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { this->dyna.actor.objectSlot = this->requiredObjectSlot; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); - switch (PARAMS_GET(this->dyna.actor.params, 0, 3)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 3)) { case 4: // Shooting gallery CollisionHeader_GetVirtual(&gKakarikoShootingGalleryCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); @@ -108,10 +108,10 @@ void func_808AC2BC(BgSpot01Objects2* this, PlayState* play) { CollisionHeader_GetVirtual(&object_spot01_matoyab_col, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); if (IS_DAY) { - func_808AC22C(play->pathList, &position, PARAMS_GET((s32)thisx->params, 8, 8), 0); + func_808AC22C(play->pathList, &position, PARAMS_GET_U((s32)thisx->params, 8, 8), 0); Actor_SpawnAsChild(&play->actorCtx, thisx, play, ACTOR_EN_DAIKU_KAKARIKO, position.x, position.y, position.z, thisx->world.rot.x, thisx->world.rot.y, thisx->world.rot.z, - (PARAMS_GET((s32)thisx->params, 8, 8) << 8) + 1); + (PARAMS_GET_U((s32)thisx->params, 8, 8) << 8) + 1); } break; case 0: // Potion Shop Poster @@ -135,5 +135,5 @@ void BgSpot01Objects2_Update(Actor* thisx, PlayState* play) { } void func_808AC4A4(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_808AC510[PARAMS_GET(thisx->params, 0, 3)]); + Gfx_DrawDListOpa(play, D_808AC510[PARAMS_GET_U(thisx->params, 0, 3)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c index 22d88371867..189e32d9028 100644 --- a/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot02_Objects/z_bg_spot02_objects.c @@ -54,7 +54,7 @@ void BgSpot02Objects_Init(Actor* thisx, PlayState* play) { DynaPolyActor_Init(&this->dyna, 0); this->unk_16B = (u16)PARAMS_GET_NOMASK(thisx->params, 8); - thisx->params = (u16)PARAMS_GET(thisx->params, 0, 8); + thisx->params = (u16)PARAMS_GET_U(thisx->params, 0, 8); switch (thisx->params) { case 0: diff --git a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c index 7d6e392dbfc..db617abe9c2 100644 --- a/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c +++ b/src/overlays/actors/ovl_Bg_Spot03_Taki/z_bg_spot03_taki.c @@ -47,7 +47,7 @@ void BgSpot03Taki_Init(Actor* thisx, PlayState* play) { s16 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); DynaPolyActor_Init(&this->dyna, 0); CollisionHeader_GetVirtual(&object_spot03_object_Col_000C98, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 81d68151dec..ec7ffb820c8 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -45,7 +45,7 @@ void BgSpot05Soko_Init(Actor* thisx, PlayState* play) { s32 pad2; Actor_ProcessInitChain(thisx, sInitChain); - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; DynaPolyActor_Init(&this->dyna, 0); if (thisx->params == 0) { diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index db027932cba..074adc98075 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -96,8 +96,8 @@ void BgSpot06Objects_Init(Actor* thisx, PlayState* play) { s32 pad; CollisionHeader* colHeader = NULL; - this->switchFlag = PARAMS_GET(thisx->params, 0, 8); - thisx->params = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 0, 8); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); PRINTF("spot06 obj nthisx->arg_data=[%d]", thisx->params); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c index 1ef960f5e33..d3869b9ceb1 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Bakudankabe/z_bg_spot08_bakudankabe.c @@ -162,7 +162,7 @@ void BgSpot08Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -184,7 +184,7 @@ void BgSpot08Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B0324(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index a57c5b186de..8149e3a65e7 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -55,7 +55,7 @@ void BgSpot08Iceblock_InitDynaPoly(BgSpot08Iceblock* this, PlayState* play, Coll // Sets params to 0x10 (medium, nonrotating) if not in the cases listed. void BgSpot08Iceblock_CheckParams(BgSpot08Iceblock* this) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case 0xFF: this->dyna.actor.params = 0x10; break; @@ -173,7 +173,7 @@ void BgSpot08Iceblock_Roll(BgSpot08Iceblock* this, PlayState* play) { s32 pad; Player* player = GET_PLAYER(play); - switch (PARAMS_GET(this->dyna.actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 8)) { case 0x11: // Medium nonrotating rollDataIndex = 0; break; @@ -296,7 +296,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { break; } - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case 2: case 3: BgSpot08Iceblock_InitDynaPoly(this, play, colHeader, DYNA_TRANSFORM_POS | DYNA_TRANSFORM_ROT_Y); @@ -330,7 +330,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, PlayState* play) { this->surfaceNormal.y = 1.0f; this->rotationAxis.x = 1.0f; - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case 0: case 1: BgSpot08Iceblock_SetupFloatNonrotating(this); diff --git a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c index 740a48b2830..5d216ebcfbd 100644 --- a/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot11_Bakudankabe/z_bg_spot11_bakudankabe.c @@ -113,7 +113,7 @@ void BgSpot11Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -136,7 +136,7 @@ void BgSpot11Bakudankabe_Update(Actor* thisx, PlayState* play) { if (this->collider.base.acFlags & AC_HIT) { func_808B2218(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &D_808B2738, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index a2a052a9d27..188ea2d7efa 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -63,7 +63,7 @@ void BgSpot12Gate_Init(Actor* thisx, PlayState* play) { BgSpot12Gate_InitDynaPoly(this, play, &gGerudoFortressWastelandGateCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B3274(this); } else { func_808B30C0(this); @@ -82,7 +82,7 @@ void func_808B30C0(BgSpot12Gate* this) { } void func_808B30D8(BgSpot12Gate* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B3134(this); OnePointCutscene_Init(play, 4160, -99, &this->dyna.actor, CAM_ID_MAIN); } diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index bc04b07597a..b7461fffb04 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -59,7 +59,7 @@ void BgSpot12Saku_Init(Actor* thisx, PlayState* play) { func_808B3420(this, play, &gGerudoFortressGTGShutterCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B3714(this); } else { func_808B3550(this); @@ -80,7 +80,7 @@ void func_808B3550(BgSpot12Saku* this) { } void func_808B357C(BgSpot12Saku* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B35E4(this); this->timer = 20; OnePointCutscene_Init(play, 4170, -99, &this->dyna.actor, CAM_ID_MAIN); diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 15ef48c05f0..55002fe51f6 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -124,7 +124,7 @@ void BgSpot15Rrbox_Init(Actor* thisx, PlayState* play) { func_808B3960(this, play, &gLonLonMilkCrateCol, 0); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); func_808B3A34(this); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { func_808B44B8(this, play); this->dyna.actor.world.pos = D_808B45C4[D_808B4590]; D_808B4590++; diff --git a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c index 3952dc7789e..e942303b062 100644 --- a/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c +++ b/src/overlays/actors/ovl_Bg_Spot16_Bombstone/z_bg_spot16_bombstone.c @@ -144,8 +144,8 @@ static f32 D_808B6074[] = { 66.0f, 51.0f, 48.0f, 36.0f, 21.0f }; static s16 D_808B6088[] = { 0, 1, 2, 3, 4 }; void func_808B4C30(BgSpot16Bombstone* this) { - this->switchFlag = PARAMS_GET(this->actor.params, 8, 6); - this->actor.params = PARAMS_GET(this->actor.params, 0, 8); + this->switchFlag = PARAMS_GET_U(this->actor.params, 8, 6); + this->actor.params = PARAMS_GET_U(this->actor.params, 0, 8); } void func_808B4C4C(BgSpot16Bombstone* this, PlayState* play) { diff --git a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c index e2fb1a160a3..5aabd41f607 100644 --- a/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c +++ b/src/overlays/actors/ovl_Bg_Spot17_Bakudankabe/z_bg_spot17_bakudankabe.c @@ -96,7 +96,7 @@ void BgSpot17Bakudankabe_Init(Actor* thisx, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_Kill(&this->dyna.actor); return; } @@ -115,7 +115,7 @@ void BgSpot17Bakudankabe_Update(Actor* thisx, PlayState* play) { BgSpot17Bakudankabe* this = (BgSpot17Bakudankabe*)thisx; if (this->dyna.actor.xzDistToPlayer < 650.0f && func_80033684(play, &this->dyna.actor) != NULL) { func_808B6BC0(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_Kill(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index ea3914bdbcb..30ee1a2d940 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -144,7 +144,7 @@ void BgSpot18Basket_Init(Actor* thisx, PlayState* play) { this->dyna.actor.home.pos.y += 0.01f; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_808B7BB0(this); return; } @@ -174,7 +174,7 @@ void func_808B7AEC(BgSpot18Basket* this) { } void func_808B7AFC(BgSpot18Basket* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { OnePointCutscene_Init(play, 4220, 80, &this->dyna.actor, CAM_ID_MAIN); func_808B7B58(this); } @@ -385,7 +385,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } } else if (this->unk_218 == 2) { - if ((this->unk_21A != 0) || Flags_GetCollectible(play, PARAMS_GET(actor->params, 0, 6))) { + if ((this->unk_21A != 0) || Flags_GetCollectible(play, PARAMS_GET_U(actor->params, 0, 6))) { collectible = Item_DropCollectible(play, &tempVector, ITEM00_RUPEE_PURPLE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; @@ -393,7 +393,7 @@ void func_808B81A0(BgSpot18Basket* this, PlayState* play) { } } else { collectible = Item_DropCollectible(play, &tempVector, - (PARAMS_GET(actor->params, 0, 6) << 8) | ITEM00_HEART_PIECE); + (PARAMS_GET_U(actor->params, 0, 6) << 8) | ITEM00_HEART_PIECE); if (collectible != NULL) { collectible->actor.velocity.y = 11.0f; collectible->actor.world.rot.y = D_808B85E4[1]; diff --git a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c index f069dc38ce2..b00c9cea3c5 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Obj/z_bg_spot18_obj.c @@ -101,13 +101,13 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { return 0; } - switch (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 4)][age]) { + switch (D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age]) { case 0: case 1: - if (D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 4)][age] == 0) { + if (D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age] == 0) { PRINTF("出現しない Object (0x%04x)\n", this->dyna.actor.params); } - return D_808B90F0[PARAMS_GET(this->dyna.actor.params, 0, 4)][age]; + return D_808B90F0[PARAMS_GET_U(this->dyna.actor.params, 0, 4)][age]; case 2: PRINTF("Error : Obj出現判定が設定されていない(%s %d)(arg_data 0x%04x)\n", "../z_bg_spot18_obj.c", 202, this->dyna.actor.params); @@ -120,7 +120,7 @@ s32 func_808B8910(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8A5C(BgSpot18Obj* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, D_808B90F4[PARAMS_GET(this->dyna.actor.params, 0, 4)]); + Actor_SetScale(&this->dyna.actor, D_808B90F4[PARAMS_GET_U(this->dyna.actor.params, 0, 4)]); return 1; } @@ -129,13 +129,13 @@ s32 func_808B8A98(BgSpot18Obj* this, PlayState* play) { CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(D_808B90FC[PARAMS_GET(this->dyna.actor.params, 0, 4)], &colHeader); + CollisionHeader_GetVirtual(D_808B90FC[PARAMS_GET_U(this->dyna.actor.params, 0, 4)], &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); return 1; } s32 func_808B8B08(BgSpot18Obj* this, PlayState* play) { - this->dyna.actor.flags |= D_808B9104[PARAMS_GET(this->dyna.actor.params, 0, 4)]; + this->dyna.actor.flags |= D_808B9104[PARAMS_GET_U(this->dyna.actor.params, 0, 4)]; return 1; } @@ -155,7 +155,7 @@ s32 func_808B8BB4(BgSpot18Obj* this, PlayState* play) { if (LINK_AGE_IN_YEARS == YEARS_CHILD) { func_808B9030(this); - } else if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_808B9030(this); this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; @@ -172,8 +172,8 @@ s32 func_808B8C90(BgSpot18Obj* this, PlayState* play) { } s32 func_808B8CC8(BgSpot18Obj* this, PlayState* play) { - if ((D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 4)] != NULL) && - (!D_808B913C[PARAMS_GET(this->dyna.actor.params, 0, 4)](this, play))) { + if ((D_808B913C[PARAMS_GET_U(this->dyna.actor.params, 0, 4)] != NULL) && + (!D_808B913C[PARAMS_GET_U(this->dyna.actor.params, 0, 4)](this, play))) { return 0; } return 1; @@ -257,7 +257,7 @@ void func_808B8F08(BgSpot18Obj* this, PlayState* play) { this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.actor.world.rot.y) * 80.0f) + this->dyna.actor.home.pos.z; this->dyna.unk_150 = 0.0f; player->stateFlags2 &= ~PLAYER_STATE2_4; - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6)); Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BLOCK_BOUND); } else { @@ -283,5 +283,5 @@ void BgSpot18Obj_Update(Actor* thisx, PlayState* play) { } void BgSpot18Obj_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sDlists[PARAMS_GET(thisx->params, 0, 4)]); + Gfx_DrawDListOpa(play, sDlists[PARAMS_GET_U(thisx->params, 0, 4)]); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c index d3e8a2f3585..deb254f4ac9 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Shutter/z_bg_spot18_shutter.c @@ -39,7 +39,7 @@ static InitChainEntry sInitChain[] = { void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { s32 pad; BgSpot18Shutter* this = (BgSpot18Shutter*)thisx; - s32 param = PARAMS_GET(this->dyna.actor.params, 8, 1); + s32 param = PARAMS_GET_U(this->dyna.actor.params, 8, 1); CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); @@ -54,7 +54,7 @@ void BgSpot18Shutter_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_808B9618; } } else { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { this->actionFunc = func_808B95AC; this->dyna.actor.world.pos.y += 180.0f; } else { @@ -85,7 +85,7 @@ void func_808B95AC(BgSpot18Shutter* this, PlayState* play) { } void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { Actor_SetFocus(&this->dyna.actor, 70.0f); OnePointCutscene_Attention(play, &this->dyna.actor); this->actionFunc = func_808B9698; @@ -95,7 +95,7 @@ void func_808B95B8(BgSpot18Shutter* this, PlayState* play) { void func_808B9618(BgSpot18Shutter* this, PlayState* play) { if (GET_INFTABLE(INFTABLE_109)) { Actor_SetFocus(&this->dyna.actor, 70.0f); - if (PARAMS_GET(this->dyna.actor.params, 8, 1) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 8, 1) == 0) { this->actionFunc = func_808B9698; } else { this->actionFunc = func_808B971C; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 769be6bf932..96dd658293e 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -44,8 +44,8 @@ void BgYdanHasi_Init(Actor* thisx, PlayState* play) { WaterBox* waterBox; Actor_ProcessInitChain(thisx, sInitChain); - this->type = PARAMS_GET(thisx->params, 8, 6); - thisx->params = PARAMS_GET(thisx->params, 0, 8); + this->type = PARAMS_GET_U(thisx->params, 8, 6); + thisx->params = PARAMS_GET_U(thisx->params, 0, 8); waterBox = &play->colCtx.colHeader->waterBoxes[1]; DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); if (thisx->params == HASI_WATER) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c index 6d435d745cb..12e135cbbea 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c @@ -88,8 +88,8 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) { Collider_InitTris(play, &this->collider); Collider_SetTris(play, &this->collider, &this->dyna.actor, &sTrisInit, this->elements); - this->switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 16); - thisx->params = PARAMS_GET(thisx->params, 8, 8); // thisx is required to match here + this->switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 16); + thisx->params = PARAMS_GET_U(thisx->params, 8, 8); // thisx is required to match here if (this->dyna.actor.params == 0) { triInit = &sTrisElementsInit[0]; diff --git a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c index a1d1ced4e63..88428144923 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Sp/z_bg_ydan_sp.c @@ -91,9 +91,9 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) { f32 nSinsX; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - this->isDestroyedSwitchFlag = PARAMS_GET(thisx->params, 0, 6); - this->burnSwitchFlag = PARAMS_GET(thisx->params, 6, 6); - this->dyna.actor.params = PARAMS_GET(thisx->params, 12, 4); + this->isDestroyedSwitchFlag = PARAMS_GET_U(thisx->params, 0, 6); + this->burnSwitchFlag = PARAMS_GET_U(thisx->params, 6, 6); + this->dyna.actor.params = PARAMS_GET_U(thisx->params, 12, 4); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); Collider_InitTris(play, &this->trisCollider); Collider_SetTris(play, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems); diff --git a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c index 28cb257289b..b4db8352ff7 100644 --- a/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c +++ b/src/overlays/actors/ovl_Bg_Zg/z_bg_zg.c @@ -59,13 +59,13 @@ void func_808C0C50(BgZg* this) { } s32 func_808C0C98(BgZg* this, PlayState* play) { - s32 flag = PARAMS_GET(this->dyna.actor.params, 8, 8); + s32 flag = PARAMS_GET_U(this->dyna.actor.params, 8, 8); return Flags_GetSwitch(play, flag); } s32 func_808C0CC8(BgZg* this) { - s32 flag = PARAMS_GET(this->dyna.actor.params, 0, 8); + s32 flag = PARAMS_GET_U(this->dyna.actor.params, 0, 8); return flag; } diff --git a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 53e8b0cda04..9c66b094529 100644 --- a/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -910,8 +910,8 @@ void func_808FF898(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if ((PARAMS_GET(actor->params, 0, 8) == 0x10) || (PARAMS_GET(actor->params, 0, 8) == 0x11) || - (PARAMS_GET(actor->params, 0, 8) == 0x16)) { + if ((PARAMS_GET_U(actor->params, 0, 8) == 0x10) || (PARAMS_GET_U(actor->params, 0, 8) == 0x11) || + (PARAMS_GET_U(actor->params, 0, 8) == 0x16)) { if (SQ(this->unk_218.x - gj->dyna.actor.world.pos.x) + SQ(this->unk_218.z - gj->dyna.actor.world.pos.z) < SQ(100.0f)) { @@ -951,8 +951,8 @@ s32 func_808FFA24(BossGanon2* this, PlayState* play) { if (actor->id == ACTOR_DEMO_GJ) { DemoGj* gj = (DemoGj*)actor; - if ((PARAMS_GET(actor->params, 0, 8) == 0x10) || (PARAMS_GET(actor->params, 0, 8) == 0x11) || - (PARAMS_GET(actor->params, 0, 8) == 0x16)) { + if ((PARAMS_GET_U(actor->params, 0, 8) == 0x10) || (PARAMS_GET_U(actor->params, 0, 8) == 0x11) || + (PARAMS_GET_U(actor->params, 0, 8) == 0x16)) { if (SQ(this->actor.world.pos.x - gj->dyna.actor.world.pos.x) + SQ(this->actor.world.pos.z - gj->dyna.actor.world.pos.z) < SQ(200.0f)) { diff --git a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index dd05ebe572a..5b443c97b98 100644 --- a/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -2658,7 +2658,7 @@ void BossVa_BariPhase2Attack(BossVa* this, PlayState* play) { sp4C = 200.0f; BossVa_Spark(play, this, 1, 125, 15.0f, 7.0f, SPARK_TETHER, 1.0f, true); this->actor.flags &= ~ACTOR_FLAG_0; - if (PARAMS_GET(this->actor.params, 0, 1)) { + if (PARAMS_GET_U(this->actor.params, 0, 1)) { sp4C = -200.0f; } diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 77d93122d80..80dd6c75fc3 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -170,8 +170,8 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { DemoEffect* crystalLight; DemoEffect* lightRing; - effectType = PARAMS_GET2(this->actor.params, 0, 8); - lightEffect = PARAMS_GET2(this->actor.params, 12, 4); + effectType = PARAMS_GET_S(this->actor.params, 0, 8); + lightEffect = PARAMS_GET_S(this->actor.params, 12, 4); PRINTF(VT_FGCOL(CYAN) " no = %d\n" VT_RST, effectType); @@ -504,7 +504,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play2) { void DemoEffect_Destroy(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; - s32 effectType = PARAMS_GET2(this->actor.params, 0, 8); + s32 effectType = PARAMS_GET_S(this->actor.params, 0, 8); if (effectType == DEMO_EFFECT_TIMEWARP_MASTERSWORD || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { @@ -661,7 +661,7 @@ void DemoEffect_UpdateGetItem(DemoEffect* this, PlayState* play) { * 3) Timeblock is cleared with the Song of Time (Large and Small have different versions of Timewarp) */ void DemoEffect_InitTimeWarp(DemoEffect* this, PlayState* play) { - s32 effectType = PARAMS_GET2(this->actor.params, 0, 8); + s32 effectType = PARAMS_GET_S(this->actor.params, 0, 8); if (!SkelCurve_Init(play, &this->skelCurve, &gTimeWarpSkel, &gTimeWarpAnim)) { ASSERT(0, "0", "../z_demo_effect.c", 1283); @@ -773,7 +773,7 @@ void DemoEffect_UpdateTimeWarpTimeblock(DemoEffect* this, PlayState* play) { shrinkProgress = (100 - this->timeWarp.shrinkTimer) * 0.010f; scale = shrinkProgress * 0.14f; - if (PARAMS_GET2(this->actor.params, 0, 8) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { + if (PARAMS_GET_S(this->actor.params, 0, 8) == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL) { scale *= 0.6f; } @@ -1016,7 +1016,7 @@ void DemoEffect_UpdateLightEffect(DemoEffect* this, PlayState* play) { u16 pad; s32 isLargeSize; - isLargeSize = PARAMS_GET2(this->actor.params, 8, 4); + isLargeSize = PARAMS_GET_S(this->actor.params, 8, 4); if (play->csCtx.state != CS_STATE_IDLE && play->csCtx.actorCues[this->cueChannel] != NULL) { DemoEffect_SetPosRotFromCue(this, play, this->cueChannel, 0); @@ -2006,7 +2006,7 @@ s32 DemoEffect_OverrideLimbDrawTimeWarp(PlayState* play, SkelCurve* skelCurve, s void DemoEffect_DrawTimeWarp(Actor* thisx, PlayState* play) { DemoEffect* this = (DemoEffect*)thisx; GraphicsContext* gfxCtx = play->state.gfxCtx; - u8 effectType = PARAMS_GET2(this->actor.params, 0, 8); + u8 effectType = PARAMS_GET_S(this->actor.params, 0, 8); if (effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE || effectType == DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL || CutsceneFlags_Get(play, 1) || IS_CUTSCENE_LAYER || gSaveContext.save.entranceIndex == ENTR_TEMPLE_OF_TIME_4) { diff --git a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c index 4b0086aa43e..8b75c83f6e1 100644 --- a/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c +++ b/src/overlays/actors/ovl_Demo_Gj/z_demo_gj.c @@ -77,21 +77,21 @@ typedef void (*DemoGjDrawFunc)(DemoGj*, PlayState*); // bits 11-15 s32 DemoGj_GetCollectibleType(DemoGj* this) { - s32 type = PARAMS_GET(this->dyna.actor.params, 11, 5); + s32 type = PARAMS_GET_U(this->dyna.actor.params, 11, 5); return type; } // bits 8-10 s32 DemoGj_GetCollectibleAmount(DemoGj* this) { - s32 amount = PARAMS_GET(this->dyna.actor.params, 8, 3); + s32 amount = PARAMS_GET_U(this->dyna.actor.params, 8, 3); return amount; } // bits 0-7 s32 DemoGj_GetType(DemoGj* this) { - s32 type = PARAMS_GET(this->dyna.actor.params, 0, 8); + s32 type = PARAMS_GET_U(this->dyna.actor.params, 0, 8); return type; } diff --git a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c index 47cac6d1178..a1ac29776da 100644 --- a/src/overlays/actors/ovl_Door_Ana/z_door_ana.c +++ b/src/overlays/actors/ovl_Door_Ana/z_door_ana.c @@ -130,11 +130,11 @@ void DoorAna_WaitOpen(DoorAna* this, PlayState* play) { if (Math_StepToF(&this->actor.scale.x, 0.01f, 0.001f)) { if ((this->actor.targetMode != 0) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && (player->stateFlags1 & PLAYER_STATE1_31) && (player->av1.actionVar1 == 0)) { - destinationIdx = PARAMS_GET(this->actor.params, 12, 3) - 1; + destinationIdx = PARAMS_GET_U(this->actor.params, 12, 3) - 1; Play_SetupRespawnPoint(play, RESPAWN_MODE_RETURN, 0x4FF); gSaveContext.respawn[RESPAWN_MODE_RETURN].pos.y = this->actor.world.pos.y; gSaveContext.respawn[RESPAWN_MODE_RETURN].yaw = this->actor.home.rot.y; - gSaveContext.respawn[RESPAWN_MODE_RETURN].data = PARAMS_GET(this->actor.params, 0, 16); + gSaveContext.respawn[RESPAWN_MODE_RETURN].data = PARAMS_GET_U(this->actor.params, 0, 16); if (destinationIdx < 0) { destinationIdx = this->actor.home.rot.z + 1; } diff --git a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c index 6edd453d964..2559122d513 100644 --- a/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c +++ b/src/overlays/actors/ovl_Door_Gerudo/z_door_gerudo.c @@ -44,7 +44,7 @@ void DoorGerudo_Init(Actor* thisx, PlayState* play) { CollisionHeader_GetVirtual(&gGerudoCellDoorCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { this->actionFunc = func_8099485C; thisx->world.pos.y = thisx->home.pos.y + 200.0f; } else { @@ -100,7 +100,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (this->isActive) { this->actionFunc = func_8099496C; gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1; - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK); } else { s32 direction = func_80994750(this, play); @@ -110,7 +110,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) { if (gSaveContext.save.info.inventory.dungeonKeys[gSaveContext.mapIndex] <= 0) { player->naviTextId = -0x203; - } else if (!Flags_GetCollectible(play, PARAMS_GET(this->dyna.actor.params, 8, 5))) { + } else if (!Flags_GetCollectible(play, PARAMS_GET_U(this->dyna.actor.params, 8, 5))) { player->naviTextId = -0x225; } else { player->doorType = PLAYER_DOORTYPE_SLIDING; diff --git a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c index e8a93e5395e..50e447d88a4 100644 --- a/src/overlays/actors/ovl_Door_Killer/z_door_killer.c +++ b/src/overlays/actors/ovl_Door_Killer/z_door_killer.c @@ -121,7 +121,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->openAnim = 0; this->playerIsOpening = false; - switch ((u8)PARAMS_GET(this->actor.params, 0, 8)) { + switch ((u8)PARAMS_GET_U(this->actor.params, 0, 8)) { case DOOR_KILLER_DOOR: // `jointTable` is used for both the `jointTable` and `morphTable` args here. Because this actor doesn't // play any animations it does not cause problems, but it would need to be changed otherwise. @@ -144,8 +144,8 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { this->colliderJntSph.elements[0].dim.worldSphere.center.z = (s16)this->actor.world.pos.z; // If tied to a switch flag and that switch flag is already set, kill the actor. - if ((PARAMS_GET(this->actor.params, 8, 6) != 0x3F) && - Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if ((PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) && + Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { Actor_Kill(&this->actor); } break; @@ -180,7 +180,7 @@ void DoorKiller_Init(Actor* thisx, PlayState* play2) { void DoorKiller_Destroy(Actor* thisx, PlayState* play) { DoorKiller* this = (DoorKiller*)thisx; - if (PARAMS_GET(thisx->params, 0, 8) == DOOR_KILLER_DOOR) { + if (PARAMS_GET_U(thisx->params, 0, 8) == DOOR_KILLER_DOOR) { Collider_DestroyCylinder(play, &this->colliderCylinder); Collider_DestroyJntSph(play, &this->colliderJntSph); } @@ -241,7 +241,7 @@ void DoorKiller_SetAC(DoorKiller* this, PlayState* play) { } void DoorKiller_Die(DoorKiller* this, PlayState* play) { - s32 switchFlag = PARAMS_GET(this->actor.params, 8, 6); + s32 switchFlag = PARAMS_GET_U(this->actor.params, 8, 6); // Can set a switch flag on death based on params if (switchFlag != 0x3F) { @@ -472,7 +472,7 @@ void DoorKiller_UpdateTexture(Actor* thisx, PlayState* play) { void DoorKiller_WaitForObject(DoorKiller* this, PlayState* play) { if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot)) { DoorKiller_UpdateTexture(&this->actor, play); - switch (PARAMS_GET(this->actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->actor.params, 0, 8)) { case DOOR_KILLER_DOOR: this->actionFunc = DoorKiller_Wait; this->actor.draw = DoorKiller_DrawDoor; @@ -515,7 +515,7 @@ void DoorKiller_DrawDoor(Actor* thisx, PlayState* play) { void DoorKiller_DrawRubble(Actor* thisx, PlayState* play) { static Gfx* dLists[] = { object_door_killer_DL_001250, object_door_killer_DL_001550, object_door_killer_DL_0017B8, object_door_killer_DL_001A58 }; - s32 rubblePieceIndex = PARAMS_GET(thisx->params, 0, 8) - 1; + s32 rubblePieceIndex = PARAMS_GET_U(thisx->params, 0, 8) - 1; DoorKiller* this = (DoorKiller*)thisx; if ((this->timer >= 20) || ((this->timer & 1) == 0)) { diff --git a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h index d4b149ad15d..aed46406f00 100644 --- a/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h +++ b/src/overlays/actors/ovl_Door_Shutter/z_door_shutter.h @@ -20,8 +20,8 @@ * */ -#define DOORSHUTTER_GET_TYPE(actor) PARAMS_GET((actor)->params, 6, 4) -#define DOORSHUTTER_GET_SWITCH_FLAG(actor) PARAMS_GET((actor)->params, 0, 6) +#define DOORSHUTTER_GET_TYPE(actor) PARAMS_GET_U((actor)->params, 6, 4) +#define DOORSHUTTER_GET_SWITCH_FLAG(actor) PARAMS_GET_U((actor)->params, 0, 6) #define DOORSHUTTER_PARAMS(type, switchFlag) ((((type) & 0xF) << 6) | ((switchFlag) & 0x3F)) diff --git a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index e738cb4899b..5a499982f32 100644 --- a/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -47,21 +47,21 @@ s32 ElfMsg_KillCheck(ElfMsg* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 161); // "Mutual destruction" - if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ", "../z_elf_msg.c", 172); // "Mutual destruction" - if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; - } else if (PARAMS_GET(this->actor.params, 8, 6) == 0x3F) { + } else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { Actor_Kill(&this->actor); return 1; } @@ -72,7 +72,7 @@ void ElfMsg_Init(Actor* thisx, PlayState* play) { ElfMsg* this = (ElfMsg*)thisx; // "Conditions for Elf Tag disappearing" - PRINTF(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET(thisx->params, 8, 6)); + PRINTF(VT_FGCOL(CYAN) "\nエルフ タグ 消える条件 %d" VT_RST "\n", PARAMS_GET_U(thisx->params, 8, 6)); PRINTF(VT_FGCOL(CYAN) "\nthisx->shape.angle.sy = %d\n" VT_RST, thisx->shape.rot.y); if (thisx->shape.rot.y >= 0x41) { // "Conditions for Elf Tag appearing" @@ -110,9 +110,9 @@ void ElfMsg_Destroy(Actor* thisx, PlayState* play) { s32 ElfMsg_GetMessageId(ElfMsg* this) { // Negative message ID forces link to talk to Navi if (PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { - return PARAMS_GET(this->actor.params, 0, 8) + 0x100; + return PARAMS_GET_U(this->actor.params, 0, 8) + 0x100; } else { - return -(PARAMS_GET(this->actor.params, 0, 8) + 0x100); + return -(PARAMS_GET_U(this->actor.params, 0, 8) + 0x100); } } @@ -150,8 +150,8 @@ void ElfMsg_Update(Actor* thisx, PlayState* play) { if (!ElfMsg_KillCheck(this, play)) { if (Actor_TalkOfferAccepted(&this->actor, play)) { - if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return; diff --git a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index 868e93742b3..a031397b454 100644 --- a/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -47,21 +47,21 @@ s32 ElfMsg2_KillCheck(ElfMsg2* this, PlayState* play) { if ((this->actor.world.rot.y > 0) && (this->actor.world.rot.y < 0x41) && Flags_GetSwitch(play, this->actor.world.rot.y - 1)) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 171); // "Mutual destruction" - if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; } else if ((this->actor.world.rot.y == -1) && Flags_GetClear(play, this->actor.room)) { LOG_STRING("共倒れ2", "../z_elf_msg2.c", 182); // "Mutual destruction 2" - if (PARAMS_GET(this->actor.params, 8, 6) != 0x3F) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + if (PARAMS_GET_U(this->actor.params, 8, 6) != 0x3F) { + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } Actor_Kill(&this->actor); return 1; - } else if (PARAMS_GET(this->actor.params, 8, 6) == 0x3F) { + } else if (PARAMS_GET_U(this->actor.params, 8, 6) == 0x3F) { return 0; - } else if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + } else if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { LOG_STRING("共倒れ", "../z_elf_msg2.c", 192); // "Mutual destruction" Actor_Kill(&this->actor); return 1; @@ -93,7 +93,7 @@ void ElfMsg2_Destroy(Actor* thisx, PlayState* play) { } s32 ElfMsg2_GetMessageId(ElfMsg2* this) { - return PARAMS_GET(this->actor.params, 0, 8) + 0x100; + return PARAMS_GET_U(this->actor.params, 0, 8) + 0x100; } /** @@ -106,7 +106,7 @@ void ElfMsg2_WaitForTextClose(ElfMsg2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { if (this->actor.world.rot.z != 1) { Actor_Kill(&this->actor); - switchFlag = PARAMS_GET(this->actor.params, 8, 6); + switchFlag = PARAMS_GET_U(this->actor.params, 8, 6); if (switchFlag != 0x3F) { Flags_SetSwitch(play, switchFlag); } diff --git a/src/overlays/actors/ovl_En_Ba/z_en_ba.c b/src/overlays/actors/ovl_En_Ba/z_en_ba.c index 45a09126f19..e2fd2f4b3f7 100644 --- a/src/overlays/actors/ovl_En_Ba/z_en_ba.c +++ b/src/overlays/actors/ovl_En_Ba/z_en_ba.c @@ -104,7 +104,7 @@ void EnBa_Init(Actor* thisx, PlayState* play) { } this->actor.targetMode = 4; - this->upperParams = PARAMS_GET(thisx->params, 8, 8); + this->upperParams = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (this->actor.params < EN_BA_DEAD_BLOB) { diff --git a/src/overlays/actors/ovl_En_Box/z_en_box.c b/src/overlays/actors/ovl_En_Box/z_en_box.c index a6f0a73d787..94896f66e39 100644 --- a/src/overlays/actors/ovl_En_Box/z_en_box.c +++ b/src/overlays/actors/ovl_En_Box/z_en_box.c @@ -109,7 +109,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { DynaPoly_DisableCeilingCollision(play, &play->colCtx.dyna, this->dyna.bgId); this->movementFlags = 0; - this->type = PARAMS_GET(thisx->params, 12, 4); + this->type = PARAMS_GET_U(thisx->params, 12, 4); this->iceSmokeTimer = 0; this->unk_1FB = ENBOX_STATE_0; this->dyna.actor.gravity = -5.5f; @@ -118,7 +118,7 @@ void EnBox_Init(Actor* thisx, PlayState* play2) { if (play) {} // helps the compiler store play2 into s1 - if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 5))) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5))) { this->alpha = 255; this->iceSmokeTimer = 100; EnBox_SetupAction(this, EnBox_Open); @@ -264,7 +264,7 @@ void EnBox_Fall(EnBox* this, PlayState* play) { } void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); @@ -283,7 +283,7 @@ void EnBox_FallOnSwitchFlag(EnBox* this, PlayState* play) { // used for types 9, 10 void func_809C9700(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); Player* player = GET_PLAYER(play); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { @@ -320,7 +320,7 @@ void func_809C9700(EnBox* this, PlayState* play) { } void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); @@ -334,7 +334,7 @@ void EnBox_AppearOnSwitchFlag(EnBox* this, PlayState* play) { } void EnBox_AppearOnRoomClear(EnBox* this, PlayState* play) { - s32 treasureFlag = PARAMS_GET(this->dyna.actor.params, 0, 5); + s32 treasureFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 5); if (treasureFlag >= ENBOX_TREASURE_FLAG_UNK_MIN && treasureFlag < ENBOX_TREASURE_FLAG_UNK_MAX) { Actor_SetClosestSecretDistance(&this->dyna.actor, play); @@ -417,16 +417,16 @@ void EnBox_WaitOpen(EnBox* this, PlayState* play) { Audio_PlayFanfare(NA_BGM_OPEN_TRE_BOX | 0x900); } } - PRINTF("Actor_Environment_Tbox_On() %d\n", PARAMS_GET(this->dyna.actor.params, 0, 5)); - Flags_SetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 5)); + PRINTF("Actor_Environment_Tbox_On() %d\n", PARAMS_GET_U(this->dyna.actor.params, 0, 5)); + Flags_SetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5)); } else { player = GET_PLAYER(play); func_8002DBD0(&this->dyna.actor, &sp4C, &player->actor.world.pos); if (sp4C.z > -50.0f && sp4C.z < 0.0f && fabsf(sp4C.y) < 10.0f && fabsf(sp4C.x) < 20.0f && Player_IsFacingActor(&this->dyna.actor, 0x3000, play)) { - Actor_OfferGetItemNearby(&this->dyna.actor, play, -PARAMS_GET(this->dyna.actor.params, 5, 7)); + Actor_OfferGetItemNearby(&this->dyna.actor, play, -PARAMS_GET_U(this->dyna.actor.params, 5, 7)); } - if (Flags_GetTreasure(play, PARAMS_GET(this->dyna.actor.params, 0, 5))) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->dyna.actor.params, 0, 5))) { EnBox_SetupAction(this, EnBox_Open); } } @@ -537,7 +537,7 @@ void EnBox_Update(Actor* thisx, PlayState* play) { Actor_SetFocus(&this->dyna.actor, 40.0f); } - if (PARAMS_GET(this->dyna.actor.params, 5, 7) == GI_ICE_TRAP && this->actionFunc == EnBox_Open && + if (PARAMS_GET_U(this->dyna.actor.params, 5, 7) == GI_ICE_TRAP && this->actionFunc == EnBox_Open && this->skelanime.curFrame > 45 && this->iceSmokeTimer < 100) { EnBox_SpawnIceSmoke(this, play); } diff --git a/src/overlays/actors/ovl_En_Brob/z_en_brob.c b/src/overlays/actors/ovl_En_Brob/z_en_brob.c index 994a308f7c8..4433ab6b885 100644 --- a/src/overlays/actors/ovl_En_Brob/z_en_brob.c +++ b/src/overlays/actors/ovl_En_Brob/z_en_brob.c @@ -70,17 +70,17 @@ void EnBrob_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->colliders[1]); Collider_SetCylinder(play, &this->colliders[1], &this->dyna.actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); - if (PARAMS_GET(thisx->params, 8, 8) == 0) { + if (PARAMS_GET_U(thisx->params, 8, 8) == 0) { Actor_SetScale(&this->dyna.actor, 0.01f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= PARAMS_GET(thisx->params, 0, 8) * (1.0f / 30.0f); + thisx->scale.y *= PARAMS_GET_U(thisx->params, 0, 8) * (1.0f / 30.0f); } } else { Actor_SetScale(&this->dyna.actor, 0.005f); thisx->params &= 0xFF; if (thisx->params != 0xFF) { - thisx->scale.y *= PARAMS_GET(thisx->params, 0, 8) * (2.0f / 30.0f); + thisx->scale.y *= PARAMS_GET_U(thisx->params, 0, 8) * (2.0f / 30.0f); } } diff --git a/src/overlays/actors/ovl_En_Butte/z_en_butte.c b/src/overlays/actors/ovl_En_Butte/z_en_butte.c index 066bfd8eed8..0ca7ae3f233 100644 --- a/src/overlays/actors/ovl_En_Butte/z_en_butte.c +++ b/src/overlays/actors/ovl_En_Butte/z_en_butte.c @@ -154,7 +154,7 @@ void EnButte_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); - if (PARAMS_GET(this->actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { this->actor.uncullZoneScale = 200.0f; } @@ -268,7 +268,7 @@ void EnButte_FlyAround(EnButte* this, PlayState* play) { EnButte_SelectFlightParams(this, &sFlyAroundParams[this->flightParamsIdx]); } - if ((PARAMS_GET(this->actor.params, 0, 1) == 1) && (player->heldItemAction == PLAYER_IA_DEKU_STICK) && + if ((PARAMS_GET_U(this->actor.params, 0, 1) == 1) && (player->heldItemAction == PLAYER_IA_DEKU_STICK) && (this->swordDownTimer <= 0) && ((Math3D_Dist2DSq(player->actor.world.pos.x, player->actor.world.pos.z, this->actor.home.pos.x, this->actor.home.pos.z) < SQ(120.0f)) || @@ -396,7 +396,7 @@ void EnButte_Update(Actor* thisx, PlayState* play) { this->unk_25E += 0x1000; this->unk_260 += 0x600; - if (PARAMS_GET(this->actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { if (GET_PLAYER(play)->meleeWeaponState == 0) { if (this->swordDownTimer > 0) { this->swordDownTimer--; @@ -427,7 +427,7 @@ void EnButte_Draw(Actor* thisx, PlayState* play) { Collider_UpdateSpheres(0, &this->collider); } - if ((PARAMS_GET(this->actor.params, 0, 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { + if ((PARAMS_GET_U(this->actor.params, 0, 1) == 1) && (this->actionFunc == EnButte_TransformIntoFairy)) { EnButte_DrawTransformationEffect(this, play); } } diff --git a/src/overlays/actors/ovl_En_Bx/z_en_bx.c b/src/overlays/actors/ovl_En_Bx/z_en_bx.c index d2333beb986..91d86e5fd5b 100644 --- a/src/overlays/actors/ovl_En_Bx/z_en_bx.c +++ b/src/overlays/actors/ovl_En_Bx/z_en_bx.c @@ -99,7 +99,7 @@ void EnBx_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.mass = MASS_IMMOVABLE; this->unk_14C = 0; thisx->uncullZoneDownward = 2000.0f; - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 8))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 8))) { Actor_Kill(&this->actor); } thisx->params &= 0xFF; @@ -211,7 +211,7 @@ void EnBx_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gSPSegment(POLY_OPA_DISP++, 0x0C, mtx); - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[PARAMS_GET(this->actor.params, 0, 7)])); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(D_809D2560[PARAMS_GET_U(this->actor.params, 0, 7)])); gSPSegment(POLY_OPA_DISP++, 0x09, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 16, 16, 1, 0, (play->gameplayFrames * -10) % 128, 32, 32)); diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 3264eaec663..d9606fdf192 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -144,7 +144,7 @@ void EnCs_Init(Actor* thisx, PlayState* play) { sAnimationInfo[ENCS_ANIM_0].morphFrames); this->actor.targetMode = 6; - this->path = PARAMS_GET(this->actor.params, 0, 8); + this->path = PARAMS_GET_U(this->actor.params, 0, 8); this->unk_1EC = 0; // This variable is unused anywhere else this->talkState = 0; this->currentAnimIndex = -1; diff --git a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c index 15c2acadc80..c75dcbe24c6 100644 --- a/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c +++ b/src/overlays/actors/ovl_En_Daiku/z_en_daiku.c @@ -152,13 +152,13 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { s32 noKill = true; s32 isFree = false; - if (PARAMS_GET(this->actor.params, 0, 2) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { + if (PARAMS_GET_U(this->actor.params, 0, 2) == 0 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(0))) { isFree = true; - } else if (PARAMS_GET(this->actor.params, 0, 2) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { + } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(1))) { isFree = true; - } else if (PARAMS_GET(this->actor.params, 0, 2) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { + } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 2 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(2))) { isFree = true; - } else if (PARAMS_GET(this->actor.params, 0, 2) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { + } else if (PARAMS_GET_U(this->actor.params, 0, 2) == 3 && GET_EVENTCHKINF(EVENTCHKINF_CARPENTERS_FREE(3))) { isFree = true; } @@ -200,7 +200,7 @@ void EnDaiku_Init(Actor* thisx, PlayState* play) { this->stateFlags |= ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2; this->actionFunc = EnDaiku_Jailed; } else { - if (PARAMS_GET(this->actor.params, 0, 2) == 1 || PARAMS_GET(this->actor.params, 0, 2) == 3) { + if (PARAMS_GET_U(this->actor.params, 0, 2) == 1 || PARAMS_GET_U(this->actor.params, 0, 2) == 3) { EnDaiku_ChangeAnim(this, ENDAIKU_ANIM_SIT, &this->currentAnimIndex); this->stateFlags |= ENDAIKU_STATEFLAG_1; } else { @@ -295,7 +295,7 @@ void EnDaiku_UpdateText(EnDaiku* this, PlayState* play) { this->actor.textId = 0x6007; } } else if (play->sceneId == SCENE_CARPENTERS_TENT) { - switch (PARAMS_GET(this->actor.params, 0, 2)) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case 0: if (CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT)) { this->actor.textId = 0x6060; @@ -378,7 +378,7 @@ void EnDaiku_Jailed(EnDaiku* this, PlayState* play) { void EnDaiku_WaitFreedom(EnDaiku* this, PlayState* play) { SkelAnime_Update(&this->skelAnime); - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { this->actor.flags |= ACTOR_FLAG_0 | ACTOR_FLAG_3; EnDaiku_UpdateText(this, play); } @@ -400,14 +400,14 @@ void EnDaiku_InitEscape(EnDaiku* this, PlayState* play) { this->stateFlags &= ~(ENDAIKU_STATEFLAG_1 | ENDAIKU_STATEFLAG_2); gSaveContext.save.info.eventChkInf[EVENTCHKINF_CARPENTERS_FREE_INDEX] |= - EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET(this->actor.params, 0, 2)); + EVENTCHKINF_CARPENTERS_FREE_MASK(PARAMS_GET_U(this->actor.params, 0, 2)); this->actor.gravity = -1.0f; - this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive; EnDaiku_InitSubCamera(this, play); exitLoop = false; - path = &play->pathList[PARAMS_GET(this->actor.params, 4, 4)]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 4, 4)]; while (!exitLoop) { pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; @@ -444,11 +444,11 @@ void EnDaiku_InitSubCamera(EnDaiku* this, PlayState* play) { Vec3f eyePosDeltaWorld; this->subCamActive = true; - this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].maxFramesActive; + this->escapeSubCamTimer = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].maxFramesActive; - eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].eyePosDeltaLocal.x; - eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].eyePosDeltaLocal.y; - eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET(this->actor.params, 0, 2)].eyePosDeltaLocal.z; + eyePosDeltaLocal.x = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.x; + eyePosDeltaLocal.y = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.y; + eyePosDeltaLocal.z = sEscapeSubCamParams[PARAMS_GET_U(this->actor.params, 0, 2)].eyePosDeltaLocal.z; Matrix_RotateY(BINANG_TO_RAD(this->actor.world.rot.y), MTXMODE_NEW); Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld); @@ -522,7 +522,7 @@ void EnDaiku_EscapeRun(EnDaiku* this, PlayState* play) { f32 dxz; Vec3s* pointPos; - path = &play->pathList[PARAMS_GET(this->actor.params, 4, 4)]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 4, 4)]; pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint; dx = pointPos->x - this->actor.world.pos.x; dz = pointPos->z - this->actor.world.pos.z; @@ -592,13 +592,13 @@ void EnDaiku_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (PARAMS_GET(thisx->params, 0, 2) == 0) { + if (PARAMS_GET_U(thisx->params, 0, 2) == 0) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 2) == 1) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == 1) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if (PARAMS_GET(thisx->params, 0, 2) == 2) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == 2) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 2) == 3) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == 3) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } @@ -635,7 +635,7 @@ void EnDaiku_PostLimbDraw(PlayState* play, s32 limb, Gfx** dList, Vec3s* rot, vo if (limb == 15) { // head Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET(this->actor.params, 0, 2)]); + gSPDisplayList(POLY_OPA_DISP++, hairDLists[PARAMS_GET_U(this->actor.params, 0, 2)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku.c", 1330); diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index e10bb0467ac..fa7e9b37abd 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -133,7 +133,7 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { case SCENE_KAKARIKO_VILLAGE: if (IS_DAY) { this->flags |= 1; - this->flags |= initFlags[PARAMS_GET(this->actor.params, 0, 2)]; + this->flags |= initFlags[PARAMS_GET_U(this->actor.params, 0, 2)]; } break; case SCENE_KAKARIKO_CENTER_GUEST_HOUSE: @@ -184,8 +184,8 @@ void EnDaikuKakariko_Init(Actor* thisx, PlayState* play) { this->actionFunc = EnDaikuKakariko_Run; } else { if (this->flags & 8) { - if ((PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SABOORO) || - (PARAMS_GET(this->actor.params, 0, 2) == CARPENTER_SHIRO)) { + if ((PARAMS_GET_U(this->actor.params, 0, 2) == CARPENTER_SABOORO) || + (PARAMS_GET_U(this->actor.params, 0, 2) == CARPENTER_SHIRO)) { EnDaikuKakariko_ChangeAnim(this, ENDAIKUKAKARIKO_ANIM_5, &this->currentAnimIndex); this->flags |= 0x800; } else { @@ -245,10 +245,10 @@ void EnDaikuKakariko_HandleTalking(EnDaikuKakariko* this, PlayState* play) { if ((sp26 >= 0) && (sp26 <= 320) && (sp24 >= 0) && (sp24 <= 240) && (this->talkState == 0) && (Actor_OfferTalk(&this->actor, play, 100.0f) == 1)) { - this->actor.textId = MaskReaction_GetTextId(play, sMaskReactionSets[PARAMS_GET(this->actor.params, 0, 2)]); + this->actor.textId = MaskReaction_GetTextId(play, sMaskReactionSets[PARAMS_GET_U(this->actor.params, 0, 2)]); if (this->actor.textId == 0) { - switch (PARAMS_GET(this->actor.params, 0, 2)) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case 0: if (this->flags & 8) { this->actor.textId = 0x5076; @@ -365,7 +365,7 @@ void EnDaikuKakariko_Run(EnDaikuKakariko* this, PlayState* play) { s32 run; do { - path = &play->pathList[PARAMS_GET(this->actor.params, 8, 8)]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 8, 8)]; pathPos = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->waypoint]; xDist = pathPos->x - this->actor.world.pos.x; zDist = pathPos->z - this->actor.world.pos.z; @@ -537,7 +537,7 @@ void EnDaikuKakariko_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, V if (limbIndex == 15) { Matrix_MultVec3f(&unkVec, &this->actor.focus.pos); - gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET(this->actor.params, 0, 2)]); + gSPDisplayList(POLY_OPA_DISP++, carpenterHeadDLists[PARAMS_GET_U(this->actor.params, 0, 2)]); } CLOSE_DISPS(play->state.gfxCtx, "../z_en_daiku_kakariko.c", 1113); @@ -550,13 +550,13 @@ void EnDaikuKakariko_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); - if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_ICHIRO) { + if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_ICHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 10, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_SABOORO) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_SABOORO) { gDPSetEnvColor(POLY_OPA_DISP++, 170, 200, 255, 255); - } else if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_JIRO) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_JIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 230, 70, 255); - } else if (PARAMS_GET(thisx->params, 0, 2) == CARPENTER_SHIRO) { + } else if (PARAMS_GET_U(thisx->params, 0, 2) == CARPENTER_SHIRO) { gDPSetEnvColor(POLY_OPA_DISP++, 200, 0, 150, 255); } diff --git a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c index 872e3dc59ef..9a35fac9ade 100644 --- a/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c +++ b/src/overlays/actors/ovl_En_Dekunuts/z_en_dekunuts.c @@ -119,7 +119,7 @@ void EnDekunuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->shotsPerRound = PARAMS_GET(thisx->params, 8, 8); + this->shotsPerRound = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if ((this->shotsPerRound == 0xFF) || (this->shotsPerRound == 0)) { this->shotsPerRound = 1; diff --git a/src/overlays/actors/ovl_En_Dog/z_en_dog.c b/src/overlays/actors/ovl_En_Dog/z_en_dog.c index 0253ac1f95b..50816276cd6 100644 --- a/src/overlays/actors/ovl_En_Dog/z_en_dog.c +++ b/src/overlays/actors/ovl_En_Dog/z_en_dog.c @@ -190,7 +190,7 @@ s8 EnDog_CanFollow(EnDog* this, PlayState* play) { if (gSaveContext.dogParams != 0) { return 0; } - gSaveContext.dogParams = PARAMS_GET2(this->actor.params, 0, 15); + gSaveContext.dogParams = PARAMS_GET_S(this->actor.params, 0, 15); return 1; } @@ -249,11 +249,11 @@ void EnDog_Init(Actor* thisx, PlayState* play) { Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENDOG_ANIM_0); if (!PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { - this->actor.params = (this->actor.params & ~(0xF << 8)) | ((PARAMS_GET2(this->actor.params, 8, 4) + 1) << 8); + this->actor.params = (this->actor.params & ~(0xF << 8)) | ((PARAMS_GET_S(this->actor.params, 8, 4) + 1) << 8); } followingDog = ((gSaveContext.dogParams & 0x0F00) >> 8); - if (followingDog == PARAMS_GET2(this->actor.params, 8, 4) && !PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { + if (followingDog == PARAMS_GET_S(this->actor.params, 8, 4) && !PARAMS_GET_NOSHIFT(this->actor.params, 15, 1)) { Actor_Kill(&this->actor); return; } @@ -264,11 +264,11 @@ void EnDog_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.0075f); this->waypoint = 0; this->actor.gravity = -1.0f; - this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 4, 4), 0xF); + this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 4, 4), 0xF); switch (play->sceneId) { case SCENE_MARKET_NIGHT: - if ((!gSaveContext.dogIsLost) && PARAMS_GET2(this->actor.params, 8, 4) == 1) { + if ((!gSaveContext.dogIsLost) && PARAMS_GET_S(this->actor.params, 8, 4) == 1) { Actor_Kill(&this->actor); } break; @@ -477,9 +477,9 @@ void EnDog_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); gDPPipeSync(POLY_OPA_DISP++); - gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET2(this->actor.params, 0, 4)].r, - colors[PARAMS_GET2(this->actor.params, 0, 4)].g, colors[PARAMS_GET2(this->actor.params, 0, 4)].b, - colors[PARAMS_GET2(this->actor.params, 0, 4)].a); + gDPSetEnvColor(POLY_OPA_DISP++, colors[PARAMS_GET_S(this->actor.params, 0, 4)].r, + colors[PARAMS_GET_S(this->actor.params, 0, 4)].g, colors[PARAMS_GET_S(this->actor.params, 0, 4)].b, + colors[PARAMS_GET_S(this->actor.params, 0, 4)].a); SkelAnime_DrawFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable, this->skelAnime.dListCount, EnDog_OverrideLimbDraw, EnDog_PostLimbDraw, this); diff --git a/src/overlays/actors/ovl_En_Door/z_en_door.h b/src/overlays/actors/ovl_En_Door/z_en_door.h index 2bbf5c8175f..c97216c54a2 100644 --- a/src/overlays/actors/ovl_En_Door/z_en_door.h +++ b/src/overlays/actors/ovl_En_Door/z_en_door.h @@ -24,14 +24,14 @@ #define ENDOOR_PARAMS_TYPE_SHIFT 7 #define ENDOOR_PARAMS_TYPE_MASK PARAMS_MAKE_MASK(7, 3) -#define ENDOOR_GET_TYPE(thisx) PARAMS_GET((thisx)->params, 7, 3) +#define ENDOOR_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 7, 3) #define ENDOOR_PARAMS_IS_DOUBLE_DOOR_MASK PARAMS_MAKE_MASK(6, 1) #define ENDOOR_GET_IS_DOUBLE_DOOR(thisx) PARAMS_GET_NOSHIFT((thisx)->params, 6, 1) -#define ENDOOR_GET_LOCKED_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 0, 6) +#define ENDOOR_GET_LOCKED_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 0, 6) -#define ENDOOR_GET_CHECKABLE_TEXT_ID(thisx) PARAMS_GET((thisx)->params, 0, 6) +#define ENDOOR_GET_CHECKABLE_TEXT_ID(thisx) PARAMS_GET_U((thisx)->params, 0, 6) typedef enum { /* 0x00 */ DOOR_ROOMLOAD, // loads rooms diff --git a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c index 71622a40aec..a236f8bd641 100644 --- a/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c +++ b/src/overlays/actors/ovl_En_Encount1/z_en_encount1.c @@ -44,9 +44,9 @@ void EnEncount1_Init(Actor* thisx, PlayState* play) { return; } - this->spawnType = PARAMS_GET(this->actor.params, 11, 5); - this->maxCurSpawns = PARAMS_GET(this->actor.params, 6, 5); - this->maxTotalSpawns = PARAMS_GET(this->actor.params, 0, 6); + this->spawnType = PARAMS_GET_U(this->actor.params, 11, 5); + this->maxCurSpawns = PARAMS_GET_U(this->actor.params, 6, 5); + this->maxTotalSpawns = PARAMS_GET_U(this->actor.params, 0, 6); this->curNumSpawn = this->totalNumSpawn = 0; spawnRange = 120.0f + (40.0f * this->actor.world.rot.z); this->spawnRange = spawnRange; diff --git a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index a7c9729e5a4..0c323a90ffa 100644 --- a/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -52,8 +52,8 @@ void EnExItem_Init(Actor* thisx, PlayState* play) { EnExItem* this = (EnExItem*)thisx; this->actor.flags &= ~ACTOR_FLAG_0; - this->type = PARAMS_GET(this->actor.params, 0, 8); - this->unusedParam = PARAMS_GET(this->actor.params, 8, 8); + this->type = PARAMS_GET_U(this->actor.params, 0, 8); + this->unusedParam = PARAMS_GET_U(this->actor.params, 8, 8); PRINTF("\n\n"); // "What will come out?" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ なにがでるかな? ☆☆☆☆☆ %d\n" VT_RST, this->type); diff --git a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c index 9577fd23253..7f550e23a68 100644 --- a/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c +++ b/src/overlays/actors/ovl_En_Fd_Fire/z_en_fd_fire.c @@ -179,7 +179,7 @@ void EnFdFire_DanceTowardsPlayer(EnFdFire* this, PlayState* play) { Vec3f pos; s16 idx; - idx = ((play->state.frames / 10) + PARAMS_GET2(this->actor.params, 0, 15)) % ARRAY_COUNT(angles); + idx = ((play->state.frames / 10) + PARAMS_GET_S(this->actor.params, 0, 15)) % ARRAY_COUNT(angles); pos = player->actor.world.pos; pos.x += 120.0f * sinf(angles[idx]); pos.z += 120.0f * cosf(angles[idx]); @@ -271,14 +271,14 @@ void EnFdFire_Draw(Actor* thisx, PlayState* play) { gSPSegment(POLY_XLU_DISP++, 0x8, Gfx_TwoTexScroll(play->state.gfxCtx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0, play->state.frames * this->tile2Y, 0x20, 0x80)); - gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[PARAMS_GET2(this->actor.params, 15, 1)].r, - primColors[PARAMS_GET2(this->actor.params, 15, 1)].g, - primColors[PARAMS_GET2(this->actor.params, 15, 1)].b, - primColors[PARAMS_GET2(this->actor.params, 15, 1)].a); - gDPSetEnvColor(POLY_XLU_DISP++, envColors[PARAMS_GET2(this->actor.params, 15, 1)].r, - envColors[PARAMS_GET2(this->actor.params, 15, 1)].g, - envColors[PARAMS_GET2(this->actor.params, 15, 1)].b, - envColors[PARAMS_GET2(this->actor.params, 15, 1)].a); + gDPSetPrimColor(POLY_XLU_DISP++, 128, 128, primColors[PARAMS_GET_S(this->actor.params, 15, 1)].r, + primColors[PARAMS_GET_S(this->actor.params, 15, 1)].g, + primColors[PARAMS_GET_S(this->actor.params, 15, 1)].b, + primColors[PARAMS_GET_S(this->actor.params, 15, 1)].a); + gDPSetEnvColor(POLY_XLU_DISP++, envColors[PARAMS_GET_S(this->actor.params, 15, 1)].r, + envColors[PARAMS_GET_S(this->actor.params, 15, 1)].g, + envColors[PARAMS_GET_S(this->actor.params, 15, 1)].b, + envColors[PARAMS_GET_S(this->actor.params, 15, 1)].a); gDPPipeSync(POLY_XLU_DISP++); gSPDisplayList(POLY_XLU_DISP++, gEffFire1DL); diff --git a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c index c16b8adad0b..0cfae5d62e2 100644 --- a/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c +++ b/src/overlays/actors/ovl_En_G_Switch/z_en_g_switch.c @@ -80,8 +80,8 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { s32 pad; EnGSwitch* this = (EnGSwitch*)thisx; - this->type = PARAMS_GET(this->actor.params, 12, 4); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); + this->type = PARAMS_GET_U(this->actor.params, 12, 4); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); this->numEffects = EN_GSWITCH_EFFECT_COUNT; // "index" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ インデックス ☆☆☆☆☆ %x\n" VT_RST, this->type); @@ -94,7 +94,7 @@ void EnGSwitch_Init(Actor* thisx, PlayState* play) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 親スイッチ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); sCollectedCount = 0; // Ideally the following two lines would be - // this->silverCount = PARAMS_GET(this->actor.params, 6, 6); + // this->silverCount = PARAMS_GET_U(this->actor.params, 6, 6); this->silverCount = PARAMS_GET_NOMASK(this->actor.params, 6); this->silverCount &= 0x3F; // "maximum number of checks" diff --git a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c index 1c143358ec2..1a707d3fb0d 100644 --- a/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c +++ b/src/overlays/actors/ovl_En_Ge1/z_en_ge1.c @@ -103,7 +103,7 @@ void EnGe1_Init(Actor* thisx, PlayState* play) { this->actor.uncullZoneForward = ((play->sceneId == SCENE_GERUDO_VALLEY) ? 1000.0f : 1200.0f); - switch (PARAMS_GET(this->actor.params, 0, 8)) { + switch (PARAMS_GET_U(this->actor.params, 0, 8)) { case GE1_TYPE_GATE_GUARD: this->hairstyle = GE1_HAIR_SPIKY; @@ -329,7 +329,7 @@ void EnGe1_WaitTillOpened_GTGGuard(EnGe1* this, PlayState* play) { void EnGe1_Open_GTGGuard(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitTillOpened_GTGGuard; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -422,7 +422,7 @@ void EnGe1_WaitUntilGateOpened_GateOp(EnGe1* this, PlayState* play) { void EnGe1_OpenGate_GateOp(EnGe1* this, PlayState* play) { if (this->stateFlags & GE1_STATE_IDLE_ANIM) { this->actionFunc = EnGe1_WaitUntilGateOpened_GateOp; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); this->cutsceneTimer = 50; Message_CloseTextbox(play); } else if ((this->skelAnime.curFrame == 15.0f) || (this->skelAnime.curFrame == 19.0f)) { @@ -444,7 +444,7 @@ void EnGe1_SetupOpenGate_GateOp(EnGe1* this, PlayState* play) { } void EnGe1_CheckGate_GateOp(EnGe1* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { EnGe1_SetTalkAction(this, play, 0x6018, 100.0f, EnGe1_WaitGateOpen_GateOp); } else { EnGe1_SetTalkAction(this, play, 0x6017, 100.0f, EnGe1_SetupOpenGate_GateOp); diff --git a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c index f15e0930930..a7a8b6512e9 100644 --- a/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c +++ b/src/overlays/actors/ovl_En_Ge2/z_en_ge2.c @@ -133,7 +133,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.world.rot.z = 0; this->actor.shape.rot.z = 0; - switch (PARAMS_GET2(this->actor.params, 0, 8)) { + switch (PARAMS_GET_S(this->actor.params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_WALK); if (EnGe2_CheckCarpentersFreed()) { @@ -165,7 +165,7 @@ void EnGe2_Init(Actor* thisx, PlayState* play) { this->actor.minVelocityY = -4.0f; this->actor.gravity = -1.0f; this->walkDirection = this->actor.world.rot.y; - this->walkDuration = PARAMS_GET2(this->actor.params, 8, 8) * 10; + this->walkDuration = PARAMS_GET_S(this->actor.params, 8, 8) * 10; } void EnGe2_Destroy(Actor* thisx, PlayState* play) { @@ -425,7 +425,7 @@ void EnGe2_LookAtPlayer(EnGe2* this, PlayState* play) { void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) { if (Actor_TextboxIsClosing(&this->actor, play)) { - switch (PARAMS_GET2(this->actor.params, 0, 8)) { + switch (PARAMS_GET_S(this->actor.params, 0, 8)) { case GE2_TYPE_PATROLLING: EnGe2_ChangeAction(this, GE2_ACTION_ABOUTTURN); break; @@ -520,7 +520,7 @@ void EnGe2_UpdateFriendly(Actor* thisx, PlayState* play) { this->actionFunc(this, play); if (Actor_TalkOfferAccepted(&this->actor, play)) { - if (PARAMS_GET2(this->actor.params, 0, 8) == GE2_TYPE_PATROLLING) { + if (PARAMS_GET_S(this->actor.params, 0, 8) == GE2_TYPE_PATROLLING) { this->actor.speed = 0.0f; EnGe2_ChangeAction(this, GE2_ACTION_WAITLOOKATPLAYER); } @@ -577,7 +577,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { EnGe2_SetupCapturePlayer(this, play); } - if ((PARAMS_GET2(this->actor.params, 0, 8) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { + if ((PARAMS_GET_S(this->actor.params, 0, 8) == GE2_TYPE_STATIONARY) && (this->actor.xzDistToPlayer < 100.0f)) { // "Discovered!" PRINTF(VT_FGCOL(GREEN) "発見!!!!!!!!!!!!\n" VT_RST); EnGe2_SetupCapturePlayer(this, play); @@ -585,7 +585,7 @@ void EnGe2_Update(Actor* thisx, PlayState* play) { } if (!(this->stateFlags & GE2_STATE_KO)) { - paramsType = PARAMS_GET2(this->actor.params, 0, 8); // Not necessary, but looks a bit nicer + paramsType = PARAMS_GET_S(this->actor.params, 0, 8); // Not necessary, but looks a bit nicer if ((paramsType == GE2_TYPE_PATROLLING) || (paramsType == GE2_TYPE_STATIONARY)) { CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index c5231496076..301a74631aa 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -471,11 +471,11 @@ s32 EnGo_FollowPath(EnGo* this, PlayState* play) { f32 xDist; f32 zDist; - if (PARAMS_GET(this->actor.params, 0, 4) == 15) { + if (PARAMS_GET_U(this->actor.params, 0, 4) == 15) { return false; } - path = &play->pathList[PARAMS_GET(this->actor.params, 0, 4)]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->unk_218; xDist = pointPos->x - this->actor.world.pos.x; @@ -506,10 +506,10 @@ s32 EnGo_SetMovedPos(EnGo* this, PlayState* play) { Path* path; Vec3s* pointPos; - if (PARAMS_GET(this->actor.params, 0, 4) == 0xF) { + if (PARAMS_GET_U(this->actor.params, 0, 4) == 0xF) { return false; } else { - path = &play->pathList[PARAMS_GET(this->actor.params, 0, 4)]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += (path->count - 1); this->actor.world.pos.x = pointPos->x; diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 53236328b88..4c28a196c4e 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -287,7 +287,7 @@ s32 EnGo2_GetDialogState(EnGo2* this, PlayState* play) { } u16 EnGo2_GoronFireGenericGetTextId(EnGo2* this) { - switch (PARAMS_GET2(this->actor.params, 10, 6)) { + switch (PARAMS_GET_S(this->actor.params, 10, 6)) { case 3: return 0x3069; case 5: @@ -632,7 +632,7 @@ s16 EnGo2_UpdateTalkStateGoronDmtBiggoron(PlayState* play, EnGo2* this) { } u16 EnGo2_GetTextIdGoronFireGeneric(PlayState* play, EnGo2* this) { - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 10, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) { return 0x3071; } else { return 0x3051; @@ -732,7 +732,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { if (textId != 0) { return textId; } else { - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetTextIdGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -770,7 +770,7 @@ u16 EnGo2_GetTextId(PlayState* play, Actor* thisx) { s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) { EnGo2* this = (EnGo2*)thisx; - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: return EnGo2_UpdateTalkStateGoronCityRollingBig(play, this); case GORON_CITY_LINK: @@ -808,11 +808,11 @@ s16 EnGo2_UpdateTalkState(PlayState* play, Actor* thisx) { } s32 func_80A44790(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BIGGORON && - PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON && + PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) { return Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange, EnGo2_GetTextId, EnGo2_UpdateTalkState); - } else if ((PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) && + } else if ((PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) && !(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { return false; } else { @@ -830,14 +830,14 @@ s32 func_80A44790(EnGo2* this, PlayState* play) { } void EnGo2_SetColliderDim(EnGo2* this) { - u8 index = PARAMS_GET2(this->actor.params, 0, 5); + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); this->collider.dim.radius = D_80A4816C[index].radius; this->collider.dim.height = D_80A4816C[index].height; } void EnGo2_SetShape(EnGo2* this) { - u8 index = PARAMS_GET2(this->actor.params, 0, 5); + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); this->actor.shape.shadowScale = D_80A481F8[index].shape_unk_10; Actor_SetScale(&this->actor, D_80A481F8[index].scale); @@ -853,10 +853,10 @@ void EnGo2_CheckCollision(EnGo2* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - xzDist = D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].xzDist; + xzDist = D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].xzDist; pos.x += (s16)(xzDist * Math_SinS(this->actor.shape.rot.y)); pos.z += (s16)(xzDist * Math_CosS(this->actor.shape.rot.y)); - pos.y += D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].yDist; + pos.y += D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].yDist; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); @@ -874,7 +874,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) { Player* player = GET_PLAYER(play); f32 arg2; - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { return false; } else { if ((this->actionFunc != EnGo2_SlowRolling) && (this->actionFunc != EnGo2_ReverseRolling) && @@ -954,11 +954,11 @@ s32 func_80A44D84(EnGo2* this) { s32 EnGo2_IsWakingUp(EnGo2* this) { s16 yawDiff; - f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; - f32 yDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 yDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; s16 yawDiffAbs; - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (!(this->collider.base.ocFlags2 & OC2_HIT_PLAYER)) { this->actor.flags &= ~ACTOR_FLAG_0; return false; @@ -995,7 +995,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { } if (this->unk_59C >= 2) { - Actor_PlaySfx(&this->actor, (PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG) + Actor_PlaySfx(&this->actor, (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG) ? NA_SE_EN_GOLON_LAND_BIG : NA_SE_EN_DODO_M_GND); } @@ -1019,7 +1019,7 @@ s32 EnGo2_IsRollingOnGround(EnGo2* this, s16 arg1, f32 arg2, s16 arg3) { void EnGo2_BiggoronSetTextId(EnGo2* this, PlayState* play, Player* player) { u16 textId; - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (gSaveContext.save.info.playerData.bgsFlag) { if (func_8002F368(play) == EXCH_ITEM_CLAIM_CHECK) { this->actor.textId = 0x3003; @@ -1083,7 +1083,7 @@ void func_80A45288(EnGo2* this, PlayState* play) { if (this->actionFunc != EnGo2_GoronFireGenericAction) { this->interactInfo.trackPos = player->actor.world.pos; this->interactInfo.yOffset = - sPlayerTrackingYOffsets[PARAMS_GET2(this->actor.params, 0, 5)][((void)0, gSaveContext.save.linkAge)]; + sPlayerTrackingYOffsets[PARAMS_GET_S(this->actor.params, 0, 5)][((void)0, gSaveContext.save.linkAge)]; Npc_TrackPoint(&this->actor, &this->interactInfo, 4, this->trackingMode); } if ((this->actionFunc != EnGo2_SetGetItem) && (this->isAwake == true)) { @@ -1116,7 +1116,7 @@ void EnGo2_RollForward(EnGo2* this) { } void func_80A454CC(EnGo2* this) { - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ROLLING_BIG: case GORON_DMT_DC_ENTRANCE: case GORON_CITY_ENTRANCE: @@ -1138,8 +1138,8 @@ void func_80A454CC(EnGo2* this) { } f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { - f32 yDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; - s32 index = PARAMS_GET2(this->actor.params, 0, 5); + f32 yDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 400.0f : 60.0f; + s32 index = PARAMS_GET_S(this->actor.params, 0, 5); if (index == GORON_CITY_LINK && (fabsf(this->actor.yDistToPlayer) < yDist) && (this->actor.xzDistToPlayer < 400.0f)) { @@ -1152,7 +1152,7 @@ f32 EnGo2_GetTargetXZSpeed(EnGo2* this) { s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { Camera* mainCam = play->cameraPtrs[CAM_ID_MAIN]; - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { if (EnGo2_IsWakingUp(this)) { Camera_RequestSetting(mainCam, CAM_SET_DIRECTED_YAW); Camera_UnsetStateFlag(mainCam, CAM_STATE_CHECK_BG); @@ -1162,11 +1162,11 @@ s32 EnGo2_IsCameraModified(EnGo2* this, PlayState* play) { } } - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_FIRE_GENERIC || - PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || - PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_STAIRWELL || - PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON || - PARAMS_GET2(this->actor.params, 0, 5) == GORON_MARKET_BAZAAR) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_FIRE_GENERIC || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_STAIRWELL || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_MARKET_BAZAAR) { return true; } else if (!CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) && CHECK_OWNED_EQUIP(EQUIP_TYPE_TUNIC, EQUIP_INV_TUNIC_GORON)) { return true; @@ -1190,7 +1190,7 @@ void EnGo2_DefaultWakingUp(EnGo2* this) { } void EnGo2_WakingUp(EnGo2* this) { - f32 xyzDist = PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; + f32 xyzDist = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON ? 800.0f : 200.0f; s32 isTrue = true; xyzDist = SQ(xyzDist); @@ -1213,7 +1213,7 @@ void EnGo2_BiggoronWakingUp(EnGo2* this) { } void EnGo2_SelectGoronWakingUp(EnGo2* this) { - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_DMT_BOMB_FLOWER: this->isAwake = true; this->trackingMode = EnGo2_IsWakingUp(this) ? NPC_TRACKING_HEAD_AND_TORSO : NPC_TRACKING_NONE; @@ -1268,7 +1268,7 @@ void EnGo2_EyeMouthTexState(EnGo2* this) { void EnGo2_SitDownAnimation(EnGo2* this) { if ((this->skelAnime.playSpeed != 0.0f) && (this->skelAnime.animation == &gGoronAnim_004930)) { if (this->skelAnime.playSpeed > 0.0f && this->skelAnime.curFrame == 14.0f) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_SIT_DOWN); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_SIT_DOWN, 60); @@ -1286,7 +1286,7 @@ void EnGo2_SitDownAnimation(EnGo2* this) { } void EnGo2_GetDustData(EnGo2* this, s32 index2) { - s32 index1 = PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? 1 : 0; + s32 index1 = PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG ? 1 : 0; EnGo2DustEffectData* dustEffectData = &sDustEffectData[index1][index2]; EnGo2_SpawnDust(this, dustEffectData->initialTimer, dustEffectData->scale, dustEffectData->scaleStep, @@ -1294,7 +1294,7 @@ void EnGo2_GetDustData(EnGo2* this, s32 index2) { } void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { this->actor.flags &= ~ACTOR_FLAG_0; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = -0.5f; @@ -1311,13 +1311,13 @@ void EnGo2_RollingAnimation(EnGo2* this, PlayState* play) { void EnGo2_WakeUp(EnGo2* this, PlayState* play) { if (this->skelAnime.playSpeed == 0.0f) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BIGGORON) { Actor_PlaySfx(&this->actor, NA_SE_EN_GOLON_WAKE_UP); } else { func_800F4524(&gSfxDefaultPos, NA_SE_EN_GOLON_WAKE_UP, 60); } } - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { OnePointCutscene_Init(play, 4200, -99, &this->actor, CAM_ID_MAIN); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENGO2_ANIM_10); this->skelAnime.playSpeed = 0.5f; @@ -1338,8 +1338,8 @@ void EnGo2_GetItemAnimation(EnGo2* this, PlayState* play) { } void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || - PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_LINK) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_ROLLING_BIG || + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) { this->collider.elem.bumperFlags = BUMP_ON; this->actor.speed = GET_INFTABLE(INFTABLE_11E) ? 6.0f : 3.6000001f; } else { @@ -1355,9 +1355,9 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) { void EnGo2_StopRolling(EnGo2* this, PlayState* play) { EnBom* bomb; - if ((PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) && - (PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_LINK)) { - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_ROLLING_SMALL) { + if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG) && + (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK)) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_ROLLING_SMALL) { bomb = (EnBom*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_BOM, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); if (bomb != NULL) { @@ -1377,20 +1377,20 @@ void EnGo2_StopRolling(EnGo2* this, PlayState* play) { } s32 EnGo2_IsFreeingGoronInFire(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) { + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) { return false; } // shaking curled up this->actor.world.pos.x += (play->state.frames & 1) ? 1.0f : -1.0f; - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 10, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) { return true; } return false; } s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_BOMB_FLOWER || + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_BOMB_FLOWER || this->interactInfo.talkState != NPC_TALK_STATE_ACTION) { return false; } @@ -1404,7 +1404,7 @@ s32 EnGo2_IsGoronDmtBombFlower(EnGo2* this) { } s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG || + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_ROLLING_BIG || (this->interactInfo.talkState != NPC_TALK_STATE_ACTION)) { return false; } @@ -1415,7 +1415,7 @@ s32 EnGo2_IsGoronRollingBig(EnGo2* this, PlayState* play) { } s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_FIRE_GENERIC || + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC || this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { return false; } @@ -1424,7 +1424,7 @@ s32 EnGo2_IsGoronFireGeneric(EnGo2* this) { } s32 EnGo2_IsGoronLinkReversing(EnGo2* this) { - if (PARAMS_GET2(this->actor.params, 0, 5) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || + if (PARAMS_GET_S(this->actor.params, 0, 5) != GORON_CITY_LINK || (this->waypoint >= this->unk_216) || !EnGo2_IsWakingUp(this)) { return false; } @@ -1447,7 +1447,7 @@ s32 EnGo2_IsRolling(EnGo2* this) { void EnGo2_GoronLinkAnimation(EnGo2* this, PlayState* play) { s32 animation = ARRAY_COUNT(sAnimationInfo); - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_CITY_LINK) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_CITY_LINK) { if ((this->actor.textId == 0x3035 && this->unk_20C == 0) || (this->actor.textId == 0x3036 && this->unk_20C == 0)) { if (this->skelAnime.animation != &gGoronAnim_000D5C) { @@ -1500,7 +1500,7 @@ void EnGo2_GoronFireClearCamera(EnGo2* this, PlayState* play) { void EnGo2_BiggoronAnimation(EnGo2* this) { if (INV_CONTENT(ITEM_TRADE_ADULT) >= ITEM_BROKEN_GORONS_SWORD && INV_CONTENT(ITEM_TRADE_ADULT) <= ITEM_EYE_DROPS && - PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON && + PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON && this->interactInfo.talkState == NPC_TALK_STATE_IDLE) { if (DECR(this->animTimer) == 0) { this->animTimer = Rand_S16Offset(30, 30); @@ -1520,7 +1520,7 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); // Not GORON_CITY_ROLLING_BIG, GORON_CITY_LINK, GORON_DMT_BIGGORON - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_FIRE_GENERIC: case GORON_DMT_BOMB_FLOWER: case GORON_DMT_ROLLING_SMALL: @@ -1548,8 +1548,8 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { this->waypoint = 0; this->unk_216 = this->actor.shape.rot.z; this->trackingMode = NPC_TRACKING_NONE; - this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 5, 5), 0x1F); - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 5, 5), 0x1F); + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_ENTRANCE: case GORON_CITY_ISLAND: case GORON_CITY_LOWEST_FLOOR: @@ -1578,18 +1578,18 @@ void EnGo2_Init(Actor* thisx, PlayState* play) { } } else { CLEAR_INFTABLE(INFTABLE_10C); - this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f); EnGo2_SetupRolling(this, play); this->isAwake = true; } break; case GORON_CITY_ROLLING_BIG: case GORON_DMT_ROLLING_SMALL: - this->collider.dim.height = (D_80A4816C[PARAMS_GET2(this->actor.params, 0, 5)].height * 0.6f); + this->collider.dim.height = (D_80A4816C[PARAMS_GET_S(this->actor.params, 0, 5)].height * 0.6f); EnGo2_SetupRolling(this, play); break; case GORON_FIRE_GENERIC: - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 10, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 10, 6))) { Actor_Kill(&this->actor); } else { this->isAwake = true; @@ -1625,12 +1625,12 @@ void EnGo2_Destroy(Actor* thisx, PlayState* play) { } void EnGo2_CurledUp(EnGo2* this, PlayState* play) { - u8 index = PARAMS_GET2(this->actor.params, 0, 5); + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); s16 height; s32 quakeIndex; if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_3); Quake_SetSpeed(quakeIndex, -0x3CB0); Quake_SetPerturbations(quakeIndex, 8, 0, 0, 0); @@ -1653,13 +1653,13 @@ void EnGo2_CurledUp(EnGo2* this, PlayState* play) { this->isAwake = false; EnGo2_WakeUp(this, play); } - if ((PARAMS_GET2(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { + if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_FIRE_GENERIC) && EnGo2_IsWakingUp(this)) { EnGo2_WakeUp(this, play); } } void func_80A46B40(EnGo2* this, PlayState* play) { - u8 index = PARAMS_GET2(this->actor.params, 0, 5); + u8 index = PARAMS_GET_S(this->actor.params, 0, 5); f32 height; if (this->unk_211 == true) { @@ -1676,7 +1676,7 @@ void func_80A46B40(EnGo2* this, PlayState* play) { } } else { if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { - if (PARAMS_GET2(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { + if (PARAMS_GET_S(this->actor.params, 0, 5) == GORON_DMT_BIGGORON) { this->actor.flags |= ACTOR_FLAG_0; } func_80A454CC(this); @@ -1714,7 +1714,7 @@ void EnGo2_GoronRollingBigContinueRolling(EnGo2* this, PlayState* play) { void EnGo2_ContinueRolling(EnGo2* this, PlayState* play) { f32 float1 = 1000.0f; - if ((PARAMS_GET2(this->actor.params, 0, 5) != GORON_DMT_ROLLING_SMALL || + if ((PARAMS_GET_S(this->actor.params, 0, 5) != GORON_DMT_ROLLING_SMALL || !(this->actor.xyzDistToPlayerSq > SQ(float1))) && DECR(this->animTimer) == 0) { this->actionFunc = EnGo2_SlowRolling; @@ -1736,7 +1736,7 @@ void EnGo2_SlowRolling(EnGo2* this, PlayState* play) { EnGo2_GetDustData(this, 3); } orientation = EnGo2_Orient(this, play); - index = PARAMS_GET2(this->actor.params, 0, 5); + index = PARAMS_GET_S(this->actor.params, 0, 5); if (index != GORON_CITY_LINK) { if ((index == GORON_DMT_ROLLING_SMALL) && (orientation == 1) && (this->waypoint == 0)) { EnGo2_StopRolling(this, play); @@ -1755,7 +1755,7 @@ void EnGo2_GroundRolling(EnGo2* this, PlayState* play) { if (EnGo2_IsRollingOnGround(this, 4, 8.0f, 0)) { EnGo2_GetDustData(this, 0); if (this->unk_59C == 0) { - switch (PARAMS_GET2(this->actor.params, 0, 5)) { + switch (PARAMS_GET_S(this->actor.params, 0, 5)) { case GORON_CITY_LINK: this->goronState = 0; this->actionFunc = EnGo2_GoronLinkStopRolling; @@ -1937,9 +1937,9 @@ void EnGo2_GoronFireGenericAction(EnGo2* this, PlayState* play) { } else { this->animTimer = 0; this->actor.speed = 0.0f; - if ((PARAMS_GET2(this->actor.params, 10, 6) != 1) && (PARAMS_GET2(this->actor.params, 10, 6) != 2) && - (PARAMS_GET2(this->actor.params, 10, 6) != 4) && (PARAMS_GET2(this->actor.params, 10, 6) != 5) && - (PARAMS_GET2(this->actor.params, 10, 6) != 9) && (PARAMS_GET2(this->actor.params, 10, 6) != 11)) { + if ((PARAMS_GET_S(this->actor.params, 10, 6) != 1) && (PARAMS_GET_S(this->actor.params, 10, 6) != 2) && + (PARAMS_GET_S(this->actor.params, 10, 6) != 4) && (PARAMS_GET_S(this->actor.params, 10, 6) != 5) && + (PARAMS_GET_S(this->actor.params, 10, 6) != 9) && (PARAMS_GET_S(this->actor.params, 10, 6) != 11)) { this->goronState++; } this->goronState++; diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 217cd28bbb3..9918272bed4 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -91,7 +91,7 @@ void EnGoroiwa_UpdateCollider(EnGoroiwa* this) { Sphere16* worldSphere = &this->collider.elements[0].dim.worldSphere; worldSphere->center.x = this->actor.world.pos.x; - worldSphere->center.y = this->actor.world.pos.y + yOffsets[PARAMS_GET(this->actor.params, 10, 1)]; + worldSphere->center.y = this->actor.world.pos.y + yOffsets[PARAMS_GET_U(this->actor.params, 10, 1)]; worldSphere->center.z = this->actor.world.pos.z; } @@ -137,7 +137,7 @@ void EnGoroiwa_SetSpeed(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3f nextPosF; @@ -149,8 +149,8 @@ void EnGoroiwa_FaceNextWaypoint(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest) { - s16 loopMode = PARAMS_GET(this->actor.params, 8, 2); - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + s16 loopMode = PARAMS_GET_U(this->actor.params, 8, 2); + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; s16 prevWaypoint = this->currentWaypoint - this->pathDirection; Vec3s* prevPointPos; Vec3s* currentPointPos; @@ -177,7 +177,7 @@ void EnGoroiwa_GetPrevWaypointDiff(EnGoroiwa* this, PlayState* play, Vec3f* dest } void EnGoroiw_CheckEndOfPath(EnGoroiwa* this) { - s16 loopMode = PARAMS_GET(this->actor.params, 8, 2); + s16 loopMode = PARAMS_GET_U(this->actor.params, 8, 2); if (this->nextWaypoint < 0) { if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY || loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK) { @@ -215,14 +215,14 @@ void EnGoroiwa_ReverseDirection(EnGoroiwa* this) { } void EnGoroiwa_InitPath(EnGoroiwa* this, PlayState* play) { - this->endWaypoint = play->pathList[PARAMS_GET(this->actor.params, 0, 8)].count - 1; + this->endWaypoint = play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)].count - 1; this->currentWaypoint = 0; this->nextWaypoint = 1; this->pathDirection = 1; } void EnGoroiwa_TeleportToWaypoint(EnGoroiwa* this, PlayState* play, s32 waypoint) { - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + waypoint; this->actor.world.pos.x = pointPos->x; @@ -237,7 +237,7 @@ void EnGoroiwa_InitRotation(EnGoroiwa* this) { s32 EnGoroiwa_GetAscendDirection(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -301,7 +301,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { Math_StepToF(&this->actor.speed, R_EN_GOROIWA_SPEED * 0.01f, 0.3f); Actor_UpdateVelocityXZGravity(&this->actor); - path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; result = true; result &= Math_StepToF(&this->actor.world.pos.x, nextPointPos->x, fabsf(this->actor.velocity.x)); @@ -311,7 +311,7 @@ s32 EnGoroiwa_MoveAndFall(EnGoroiwa* this, PlayState* play) { } s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; s32 pad; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Vec3s* currentPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->currentWaypoint; @@ -343,7 +343,7 @@ s32 EnGoroiwa_Move(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; Math_StepToF(&this->actor.velocity.y, (R_EN_GOROIWA_SPEED * 0.01f) * 0.5f, 0.18f); @@ -354,7 +354,7 @@ s32 EnGoroiwa_MoveUpToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 EnGoroiwa_MoveDownToNextWaypoint(EnGoroiwa* this, PlayState* play) { s32 pad; - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 8)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 8)]; Vec3s* nextPointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->nextWaypoint; f32 nextPointY; f32 thisY; @@ -472,7 +472,7 @@ void EnGoroiwa_UpdateRotation(EnGoroiwa* this, PlayState* play) { } void EnGoroiwa_NextWaypoint(EnGoroiwa* this, PlayState* play) { - s16 loopMode = PARAMS_GET(this->actor.params, 8, 2); + s16 loopMode = PARAMS_GET_U(this->actor.params, 8, 2); EnGoroiwa_SetNextWaypoint(this); @@ -496,7 +496,7 @@ void EnGoroiwa_SpawnFragments(EnGoroiwa* this, PlayState* play) { f32 cos1; f32 sin1; f32 sin2; - s16 yOffsetIdx = PARAMS_GET(this->actor.params, 10, 1); + s16 yOffsetIdx = PARAMS_GET_U(this->actor.params, 10, 1); s32 i; for (i = 0, angle1 = 0; i < 16; i++, angle1 += 0x4E20) { @@ -535,7 +535,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->actor, sInitChain); EnGoroiwa_InitCollider(this, play); - pathIdx = PARAMS_GET(this->actor.params, 0, 8); + pathIdx = PARAMS_GET_U(this->actor.params, 0, 8); if (pathIdx == 0xFF) { // "Error: Invalid arg_data" PRINTF("Error : arg_data が不正(%s %d)(arg_data 0x%04x)\n", "../z_en_gr.c", 1033, this->actor.params); @@ -549,7 +549,7 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, yOffsets[PARAMS_GET(this->actor.params, 10, 1)], ActorShadow_DrawCircle, 9.4f); + ActorShape_Init(&this->actor.shape, yOffsets[PARAMS_GET_U(this->actor.params, 10, 1)], ActorShadow_DrawCircle, 9.4f); this->actor.shape.shadowAlpha = 200; EnGoroiwa_SetSpeed(this, play); EnGoroiwa_InitPath(this, play); @@ -559,8 +559,8 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { EnGoroiwa_SetupRoll(this); // "(Goroiwa)" PRINTF("(ごろ岩)(arg 0x%04x)(rail %d)(end %d)(bgc %d)(hit %d)\n", this->actor.params, - PARAMS_GET(this->actor.params, 0, 8), PARAMS_GET(this->actor.params, 8, 2), - PARAMS_GET(this->actor.params, 10, 1), this->actor.home.rot.z & 1); + PARAMS_GET_U(this->actor.params, 0, 8), PARAMS_GET_U(this->actor.params, 8, 2), + PARAMS_GET_U(this->actor.params, 10, 1), this->actor.home.rot.z & 1); } void EnGoroiwa_Destroy(Actor* thisx, PlayState* play2) { @@ -590,7 +590,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { yawDiff = this->actor.yawTowardsPlayer - this->actor.world.rot.y; if (yawDiff > -0x4000 && yawDiff < 0x4000) { this->stateFlags |= ENGOROIWA_PLAYER_IN_THE_WAY; - if (PARAMS_GET(this->actor.params, 10, 1) || (this->actor.home.rot.z & 1) != 1) { + if (PARAMS_GET_U(this->actor.params, 10, 1) || (this->actor.home.rot.z & 1) != 1) { EnGoroiwa_ReverseDirection(this); EnGoroiwa_FaceNextWaypoint(this, play); } @@ -599,13 +599,13 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { PRINTF(VT_FGCOL(CYAN)); PRINTF("Player ぶっ飛ばし\n"); // "Player knocked down" PRINTF(VT_RST); - onHitSetupFuncs[PARAMS_GET(this->actor.params, 10, 1)](this); + onHitSetupFuncs[PARAMS_GET_U(this->actor.params, 10, 1)](this); Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT); if ((this->actor.home.rot.z & 1) == 1) { this->collisionDisabledTimer = 50; } - } else if (moveFuncs[PARAMS_GET(this->actor.params, 10, 1)](this, play)) { - loopMode = PARAMS_GET(this->actor.params, 8, 2); + } else if (moveFuncs[PARAMS_GET_U(this->actor.params, 10, 1)](this, play)) { + loopMode = PARAMS_GET_U(this->actor.params, 8, 2); if (loopMode == ENGOROIWA_LOOPMODE_ONEWAY_BREAK && (this->nextWaypoint == 0 || this->nextWaypoint == this->endWaypoint)) { EnGoroiwa_SpawnFragments(this, play); @@ -614,7 +614,7 @@ void EnGoroiwa_Roll(EnGoroiwa* this, PlayState* play) { if ((loopMode == ENGOROIWA_LOOPMODE_ROUNDTRIP) && (this->currentWaypoint == 0 || this->currentWaypoint == this->endWaypoint)) { EnGoroiwa_SetupWait(this); - } else if (!PARAMS_GET(this->actor.params, 10, 1) && this->currentWaypoint != 0 && + } else if (!PARAMS_GET_U(this->actor.params, 10, 1) && this->currentWaypoint != 0 && this->currentWaypoint != this->endWaypoint) { ascendDirection = EnGoroiwa_GetAscendDirection(this, play); if (ascendDirection > 0) { @@ -730,7 +730,7 @@ void EnGoroiwa_Update(Actor* thisx, PlayState* play) { this->collisionDisabledTimer--; } this->actionFunc(this, play); - switch (PARAMS_GET(this->actor.params, 10, 1)) { + switch (PARAMS_GET_U(this->actor.params, 10, 1)) { case 1: Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_3 | UPDBGCHECKINFO_FLAG_4); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 21cb05f7867..7495df3bd68 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -123,7 +123,7 @@ s32 func_80A4E3EC(EnGs* this, PlayState* play) { if (Message_ShouldAdvance(play)) { switch (this->actor.textId) { case 0x2054: - this->actor.textId = PARAMS_GET(this->actor.params, 0, 8) + 0x400; + this->actor.textId = PARAMS_GET_U(this->actor.params, 0, 8) + 0x400; ret = 1; break; default: @@ -163,7 +163,7 @@ void func_80A4E470(EnGs* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_BUTTERFRY_TO_FAIRY); } this->unk_19D = 0; - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); } else if (play->msgCtx.ocarinaMode == OCARINA_MODE_01) { player->stateFlags2 |= PLAYER_STATE2_23; } @@ -490,7 +490,7 @@ void func_80A4F700(EnGs* this, PlayState* play) { } void func_80A4F734(EnGs* this, PlayState* play) { - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { func_80A4E470(this, play); } } diff --git a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c index 23e36921fdb..74559893cde 100644 --- a/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c +++ b/src/overlays/actors/ovl_En_Heishi1/z_en_heishi1.c @@ -72,8 +72,8 @@ void EnHeishi1_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->actor, 0.01f); SkelAnime_Init(play, &this->skelAnime, &gEnHeishiSkel, &gEnHeishiIdleAnim, this->jointTable, this->morphTable, 17); - this->type = PARAMS_GET(this->actor.params, 8, 8); - this->path = PARAMS_GET(this->actor.params, 0, 8); + this->type = PARAMS_GET_U(this->actor.params, 8, 8); + this->path = PARAMS_GET_U(this->actor.params, 0, 8); for (i = 0; i < ARRAY_COUNT(sAnimParamsInit[0]); i++) { this->animParams[i] = sAnimParamsInit[this->type][i]; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index eccb1858c74..e12ebcb26e0 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -87,7 +87,7 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { EnHeishi2* this = (EnHeishi2*)thisx; Actor_SetScale(&this->actor, 0.01f); - this->type = PARAMS_GET(this->actor.params, 0, 8); + this->type = PARAMS_GET_U(this->actor.params, 0, 8); this->actor.colChkInfo.mass = MASS_IMMOVABLE; if ((this->type == 6) || (this->type == 9)) { @@ -148,14 +148,14 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { break; } - this->unk_2F0 = PARAMS_GET(this->actor.params, 8, 8); + this->unk_2F0 = PARAMS_GET_U(this->actor.params, 8, 8); PRINTF("\n\n"); // "Soldier Set 2 Completed!" PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, this->actor.params); // "Identification Completed!" PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); // "Message completed!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET(this->actor.params, 8, 4)); + PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET_U(this->actor.params, 8, 4)); } } diff --git a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c index 6116c0aadbe..b83ff757b0c 100644 --- a/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c +++ b/src/overlays/actors/ovl_En_Heishi4/z_en_heishi4.c @@ -59,7 +59,7 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { EnHeishi4* this = (EnHeishi4*)thisx; Actor_SetScale(thisx, 0.01f); - this->type = PARAMS_GET(thisx->params, 0, 8); + this->type = PARAMS_GET_U(thisx->params, 0, 8); thisx->colChkInfo.mass = MASS_IMMOVABLE; this->pos = thisx->world.pos; thisx->targetMode = 6; @@ -93,11 +93,11 @@ void EnHeishi4_Init(Actor* thisx, PlayState* play) { this->actionFunc = func_80A56544; break; } - this->unk_27C = PARAMS_GET(thisx->params, 8, 8); + this->unk_27C = PARAMS_GET_U(thisx->params, 8, 8); PRINTF("\n\n"); PRINTF(VT_FGCOL(GREEN) " ☆☆☆☆☆ 兵士2セット完了! ☆☆☆☆☆ %d\n" VT_RST, thisx->params); PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了!\t ☆☆☆☆☆ %d\n" VT_RST, this->type); - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET(thisx->params, 8, 4)); + PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET_U(thisx->params, 8, 4)); PRINTF("\n\n"); } diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index 8225912668c..f08aa23f8a7 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -83,7 +83,7 @@ void EnHintnuts_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - Actor_SetTextWithPrefix(play, &this->actor, PARAMS_GET(this->actor.params, 8, 8)); + Actor_SetTextWithPrefix(play, &this->actor, PARAMS_GET_U(this->actor.params, 8, 8)); this->textIdCopy = this->actor.textId; this->actor.params &= 0xFF; sPuzzleCounter = 0; diff --git a/src/overlays/actors/ovl_En_Holl/z_en_holl.h b/src/overlays/actors/ovl_En_Holl/z_en_holl.h index 80edf1decdb..0c71c82cd94 100644 --- a/src/overlays/actors/ovl_En_Holl/z_en_holl.h +++ b/src/overlays/actors/ovl_En_Holl/z_en_holl.h @@ -4,8 +4,8 @@ #include "ultra64.h" #include "global.h" -#define ENHOLL_GET_TYPE(thisx) PARAMS_GET((thisx)->params, 6, 3) -#define ENHOLL_GET_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 0, 6) +#define ENHOLL_GET_TYPE(thisx) PARAMS_GET_U((thisx)->params, 6, 3) +#define ENHOLL_GET_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 0, 6) /** * Two kinds of holls: diff --git a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c index 13f485da5c2..a477ad2c2ee 100644 --- a/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c +++ b/src/overlays/actors/ovl_En_Horse_Normal/z_en_horse_normal.c @@ -259,7 +259,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) { Skin_Init(play, &this->skin, &gHorseNormalSkel, &gHorseNormalIdleAnim); Animation_PlayOnce(&this->skin.skelAnime, sAnimations[this->animationIdx]); } - if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10 && PARAMS_GET(this->actor.params, 0, 4) != 0xF) { + if (PARAMS_GET_NOSHIFT(this->actor.params, 4, 4) == 0x10 && PARAMS_GET_U(this->actor.params, 0, 4) != 0xF) { func_80A6B91C(this, play); } else { func_80A6BC48(this); @@ -286,7 +286,7 @@ void func_80A6B91C(EnHorseNormal* this, PlayState* play) { } void EnHorseNormal_FollowPath(EnHorseNormal* this, PlayState* play) { - Path* path = &play->pathList[PARAMS_GET(this->actor.params, 0, 4)]; + Path* path = &play->pathList[PARAMS_GET_U(this->actor.params, 0, 4)]; Vec3s* pointPos = SEGMENTED_TO_VIRTUAL(path->points); f32 dx; f32 dz; diff --git a/src/overlays/actors/ovl_En_Hy/z_en_hy.c b/src/overlays/actors/ovl_En_Hy/z_en_hy.c index 68371373170..d9aeeaff952 100644 --- a/src/overlays/actors/ovl_En_Hy/z_en_hy.c +++ b/src/overlays/actors/ovl_En_Hy/z_en_hy.c @@ -352,9 +352,9 @@ static EnHyInit2Info sInit2Info[] = { }; s32 EnHy_FindSkelAndHeadObjects(EnHy* this, PlayState* play) { - u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].headInfoIndex; - u8 skelInfoIndex2 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex2; - u8 skelInfoIndex1 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex1; + u8 headInfoIndex = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].headInfoIndex; + u8 skelInfoIndex2 = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].skelInfoIndex2; + u8 skelInfoIndex1 = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].skelInfoIndex1; this->objectSlotSkel1 = Object_GetSlot(&play->objectCtx, sSkeletonInfo[skelInfoIndex1].objectId); if (this->objectSlotSkel1 < 0) { @@ -417,16 +417,16 @@ void func_80A6F7CC(EnHy* this, PlayState* play, s32 getItemId) { u16 EnHy_GetTextId(PlayState* play, Actor* thisx) { Player* player = GET_PLAYER(play); EnHy* this = (EnHy*)thisx; - u16 textId = MaskReaction_GetTextId(play, MASK_REACTION_SET_37 + PARAMS_GET2(this->actor.params, 0, 7)); + u16 textId = MaskReaction_GetTextId(play, MASK_REACTION_SET_37 + PARAMS_GET_S(this->actor.params, 0, 7)); if (textId != 0) { - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_5) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_5) { player->exchangeItemId = EXCH_ITEM_BOTTLE_BLUE_FIRE; } return textId; } - switch (PARAMS_GET2(this->actor.params, 0, 7)) { + switch (PARAMS_GET_S(this->actor.params, 0, 7)) { case ENHY_TYPE_AOB: if (play->sceneId == SCENE_KAKARIKO_CENTER_GUEST_HOUSE) { return (this->unk_330 & EVENTCHKINF_TALON_RETURNED_FROM_KAKARIKO_MASK) @@ -678,7 +678,7 @@ s16 EnHy_UpdateTalkState(PlayState* play, Actor* thisx) { void EnHy_UpdateEyes(EnHy* this) { if (DECR(this->nextEyeIndexTimer) == 0) { - u8 headInfoIndex = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].headInfoIndex; + u8 headInfoIndex = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].headInfoIndex; this->curEyeIndex++; if ((sHeadInfo[headInfoIndex].eyeTextures != NULL) && @@ -690,14 +690,14 @@ void EnHy_UpdateEyes(EnHy* this) { } void EnHy_InitCollider(EnHy* this) { - u8 type = PARAMS_GET2(this->actor.params, 0, 7); + u8 type = PARAMS_GET_S(this->actor.params, 0, 7); this->collider.dim.radius = sColliderInfo[type].radius; this->collider.dim.height = sColliderInfo[type].height; } void EnHy_InitSetProperties(EnHy* this) { - u8 type = PARAMS_GET2(this->actor.params, 0, 7); + u8 type = PARAMS_GET_S(this->actor.params, 0, 7); this->actor.shape.shadowScale = sInit2Info[type].shadowScale; Actor_SetScale(&this->actor, sInit2Info[type].scale); @@ -713,9 +713,9 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { pos.x = this->actor.world.pos.x; pos.y = this->actor.world.pos.y; pos.z = this->actor.world.pos.z; - pos.x += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 7)].offset.x; - pos.y += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 7)].offset.y; - pos.z += sColliderInfo[PARAMS_GET2(this->actor.params, 0, 7)].offset.z; + pos.x += sColliderInfo[PARAMS_GET_S(this->actor.params, 0, 7)].offset.x; + pos.y += sColliderInfo[PARAMS_GET_S(this->actor.params, 0, 7)].offset.y; + pos.z += sColliderInfo[PARAMS_GET_S(this->actor.params, 0, 7)].offset.z; this->collider.dim.pos = pos; CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } @@ -723,7 +723,7 @@ void EnHy_UpdateCollider(EnHy* this, PlayState* play) { void func_80A70834(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_5) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_5) { if (!Inventory_HasSpecificBottle(ITEM_BOTTLE_BLUE_FIRE) && !Inventory_HasSpecificBottle(ITEM_BOTTLE_BUG) && !Inventory_HasSpecificBottle(ITEM_BOTTLE_FISH)) { switch (func_8002F368(play)) { @@ -765,7 +765,7 @@ void func_80A70978(EnHy* this, PlayState* play) { Player* player = GET_PLAYER(play); s16 trackingMode; - switch (PARAMS_GET2(this->actor.params, 0, 7)) { + switch (PARAMS_GET_S(this->actor.params, 0, 7)) { case ENHY_TYPE_BOJ_3: case ENHY_TYPE_BJI_7: case ENHY_TYPE_BOJ_9: @@ -793,13 +793,13 @@ void func_80A70978(EnHy* this, PlayState* play) { this->interactInfo.trackPos = player->actor.world.pos; if (LINK_IS_ADULT) { - this->interactInfo.yOffset = sPlayerTrackingInfo[PARAMS_GET2(this->actor.params, 0, 7)].adultYOffset; + this->interactInfo.yOffset = sPlayerTrackingInfo[PARAMS_GET_S(this->actor.params, 0, 7)].adultYOffset; } else { - this->interactInfo.yOffset = sPlayerTrackingInfo[PARAMS_GET2(this->actor.params, 0, 7)].childYOffset; + this->interactInfo.yOffset = sPlayerTrackingInfo[PARAMS_GET_S(this->actor.params, 0, 7)].childYOffset; } Npc_TrackPoint(&this->actor, &this->interactInfo, - sPlayerTrackingInfo[PARAMS_GET2(this->actor.params, 0, 7)].presetIndex, trackingMode); + sPlayerTrackingInfo[PARAMS_GET_S(this->actor.params, 0, 7)].presetIndex, trackingMode); if (Npc_UpdateTalking(play, &this->actor, &this->interactInfo.talkState, this->interactRange, EnHy_GetTextId, EnHy_UpdateTalkState)) { @@ -810,31 +810,31 @@ void func_80A70978(EnHy* this, PlayState* play) { s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { switch (play->sceneId) { case SCENE_KAKARIKO_VILLAGE: - if (!(PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_12 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { + if (!(PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_12 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { return true; } else if (!LINK_IS_ADULT) { return true; - } else if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { + } else if (PARAMS_GET_S(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_12 && IS_NIGHT) { return false; } else { return true; } case SCENE_IMPAS_HOUSE: - if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_10) { + if (PARAMS_GET_S(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_10) { return true; } else if (LINK_IS_CHILD) { return false; - } else if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 && IS_DAY) { + } else if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_10 && IS_DAY) { return false; } else { return true; } case SCENE_DOG_LADY_HOUSE: - if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_AOB) { + if (PARAMS_GET_S(this->actor.params, 0, 7) != ENHY_TYPE_AOB) { return true; } else if (IS_DAY) { return false; @@ -842,11 +842,11 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } case SCENE_KAKARIKO_CENTER_GUEST_HOUSE: - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AOB) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_AOB) { return !LINK_IS_ADULT ? false : true; - } else if (!(PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { + } else if (!(PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_9 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_AHG_2 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BJI_7)) { return true; } else if (IS_DAY) { return false; @@ -857,7 +857,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { } case SCENE_BACK_ALLEY_DAY: case SCENE_BACK_ALLEY_NIGHT: - if (PARAMS_GET2(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_14) { + if (PARAMS_GET_S(this->actor.params, 0, 7) != ENHY_TYPE_BOJ_14) { return true; } else if (IS_NIGHT) { return false; @@ -867,7 +867,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { return true; } default: - switch (PARAMS_GET2(this->actor.params, 0, 7)) { + switch (PARAMS_GET_S(this->actor.params, 0, 7)) { case ENHY_TYPE_BJI_19: case ENHY_TYPE_AHG_20: if (LINK_IS_ADULT) { @@ -881,7 +881,7 @@ s32 EnHy_ShouldSpawn(EnHy* this, PlayState* play) { void EnHy_Init(Actor* thisx, PlayState* play) { EnHy* this = (EnHy*)thisx; - if (PARAMS_GET2(this->actor.params, 0, 7) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || + if (PARAMS_GET_S(this->actor.params, 0, 7) >= ENHY_TYPE_MAX || !EnHy_FindOsAnimeObject(this, play) || !EnHy_FindSkelAndHeadObjects(this, play)) { Actor_Kill(&this->actor); } @@ -904,7 +904,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { this->actor.objectSlot = this->objectSlotSkel1; gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->actor.objectSlot].segment); SkelAnime_InitFlex(play, &this->skelAnime, - sSkeletonInfo[sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].skelInfoIndex1].skeleton, + sSkeletonInfo[sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].skelInfoIndex1].skeleton, NULL, this->jointTable, this->morphTable, 16); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment); @@ -913,7 +913,7 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { EnHy_InitCollider(this); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, - sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].animInfoIndex); + sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].animInfoIndex); if ((play->sceneId == SCENE_BACK_ALLEY_DAY) || (play->sceneId == SCENE_MARKET_DAY)) { this->actor.flags &= ~ACTOR_FLAG_4; @@ -925,9 +925,9 @@ void EnHy_InitImpl(EnHy* this, PlayState* play) { } EnHy_InitSetProperties(this); - this->path = Path_GetByIndex(play, PARAMS_GET2(this->actor.params, 7, 4), 15); + this->path = Path_GetByIndex(play, PARAMS_GET_S(this->actor.params, 7, 4), 15); - switch (PARAMS_GET2(this->actor.params, 0, 7)) { + switch (PARAMS_GET_S(this->actor.params, 0, 7)) { case ENHY_TYPE_BOJ_3: if (this->path != NULL) { this->actor.speed = 3.0f; @@ -1116,7 +1116,7 @@ s32 EnHy_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po if (limbIndex == 15) { gSPSegment(POLY_OPA_DISP++, 0x06, play->objectCtx.slots[this->objectSlotHead].segment); gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotHead].segment); - i = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].headInfoIndex; + i = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].headInfoIndex; *dList = sHeadInfo[i].headDList; if (sHeadInfo[i].eyeTextures != NULL) { @@ -1163,7 +1163,7 @@ void EnHy_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotSkel2].segment); } - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_BOJ_3 && limbIndex == 8) { gSPDisplayList(POLY_OPA_DISP++, object_boj_DL_005BC8); } @@ -1195,10 +1195,10 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { if (this->actionFunc != EnHy_InitImpl) { Gfx_SetupDL_25Opa(play->state.gfxCtx); Matrix_Translate(this->modelOffset.x, this->modelOffset.y, this->modelOffset.z, MTXMODE_APPLY); - envColorSeg8 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].envColorSeg8; - envColorSeg9 = sModelInfo[PARAMS_GET2(this->actor.params, 0, 7)].envColorSeg9; + envColorSeg8 = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].envColorSeg8; + envColorSeg9 = sModelInfo[PARAMS_GET_S(this->actor.params, 0, 7)].envColorSeg9; - switch (PARAMS_GET2(this->actor.params, 0, 7)) { + switch (PARAMS_GET_S(this->actor.params, 0, 7)) { // ENHY_TYPE_AOB // ENHY_TYPE_COB case ENHY_TYPE_AHG_2: @@ -1227,12 +1227,12 @@ void EnHy_Draw(Actor* thisx, PlayState* play) { EnHy_SetEnvColor(play->state.gfxCtx, envColorSeg9.r, envColorSeg9.g, envColorSeg9.b, envColorSeg9.a)); - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8 || - PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8 || + PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_CNE_8) { envColorSeg10 = envColorSeg8; } - if (PARAMS_GET2(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { + if (PARAMS_GET_S(this->actor.params, 0, 7) == ENHY_TYPE_CNE_11) { envColorSeg10.r = envColorSeg10.g = envColorSeg10.b = 255; envColorSeg10.a = 0; } diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h index 4a3136c528a..dbd7dd317dc 100644 --- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h +++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h @@ -9,8 +9,8 @@ struct EnIk; typedef void (*EnIkActionFunc)(struct EnIk*, PlayState*); #define IK_GET_UPPER_PARAMS(thisx) PARAMS_GET_NOSHIFT(this->actor.params, 8, 8) -#define IK_GET_ARMOR_TYPE(thisx) PARAMS_GET((thisx)->params, 0, 8) -#define IK_GET_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 8, 8) +#define IK_GET_ARMOR_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 8) +#define IK_GET_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 8) typedef enum { /* 0 */ IK_TYPE_NABOORU, diff --git a/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/src/overlays/actors/ovl_En_Insect/z_en_insect.c index fe3e61bd131..71ed6db847d 100644 --- a/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -99,7 +99,7 @@ static InitChainEntry sInitChain[] = { }; void EnInsect_InitFlags(EnInsect* this) { - this->insectFlags = sInitInsectFlags[PARAMS_GET(this->actor.params, 0, 2)]; + this->insectFlags = sInitInsectFlags[PARAMS_GET_U(this->actor.params, 0, 2)]; } f32 EnInsect_XZDistanceSquared(Vec3f* v1, Vec3f* v2) { @@ -187,7 +187,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) { Actor_ProcessInitChain(&this->actor, sInitChain); EnInsect_InitFlags(this); - type = PARAMS_GET(this->actor.params, 0, 2); + type = PARAMS_GET_U(this->actor.params, 0, 2); SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24); Collider_InitJntSph(play, &this->collider); @@ -242,7 +242,7 @@ void EnInsect_Destroy(Actor* thisx, PlayState* play) { s16 type; EnInsect* this = (EnInsect*)thisx; - type = PARAMS_GET(this->actor.params, 0, 2); + type = PARAMS_GET_U(this->actor.params, 0, 2); Collider_DestroyJntSph(play, &this->collider); if ((type == INSECT_TYPE_FIRST_DROPPED || type == INSECT_TYPE_EXTRA_DROPPED) && sDroppedCount > 0) { sDroppedCount--; @@ -261,7 +261,7 @@ void EnInsect_SlowDown(EnInsect* this, PlayState* play) { s16 type; f32 playSpeed; - type = PARAMS_GET(this->actor.params, 0, 2); + type = PARAMS_GET_U(this->actor.params, 0, 2); Math_SmoothStepToF(&this->actor.speed, 0.0f, 0.1f, 0.5f, 0.0f); @@ -297,7 +297,7 @@ void EnInsect_Crawl(EnInsect* this, PlayState* play) { s32 pad1; s32 pad2; s16 yaw; - s16 type = PARAMS_GET(this->actor.params, 0, 2); + s16 type = PARAMS_GET_U(this->actor.params, 0, 2); Math_SmoothStepToF(&this->actor.speed, 1.5f, 0.1f, 0.5f, 0.0f); @@ -469,7 +469,7 @@ void EnInsect_WalkOnWater(EnInsect* this, PlayState* play) { s16 type; Vec3f ripplePoint; - type = PARAMS_GET(this->actor.params, 0, 2); + type = PARAMS_GET_U(this->actor.params, 0, 2); if (this->actionTimer > 80) { Math_StepToF(&this->actor.speed, 0.6f, 0.08f); @@ -571,7 +571,7 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { f32 sp34; sp50 = 0; - type = PARAMS_GET(this->actor.params, 0, 2); + type = PARAMS_GET_U(this->actor.params, 0, 2); if (this->soilActor != NULL) { distanceSq = Math3D_Vec3fDistSq(&this->actor.world.pos, &this->soilActor->actor.world.pos); @@ -672,8 +672,8 @@ void EnInsect_Dropped(EnInsect* this, PlayState* play) { !(this->insectFlags & INSECT_FLAG_7)) { if (this->unk_32A >= 15) { if (this->soilActor != NULL) { - if (!(GET_GS_FLAGS(PARAMS_GET(this->soilActor->actor.params, 8, 5) - 1) & - PARAMS_GET(this->soilActor->actor.params, 0, 8))) { + if (!(GET_GS_FLAGS(PARAMS_GET_U(this->soilActor->actor.params, 8, 5) - 1) & + PARAMS_GET_U(this->soilActor->actor.params, 0, 8))) { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); } } @@ -764,7 +764,7 @@ void EnInsect_Update(Actor* thisx, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { this->actor.parent = NULL; - tmp = PARAMS_GET(this->actor.params, 0, 2); + tmp = PARAMS_GET_U(this->actor.params, 0, 2); if (tmp == INSECT_TYPE_FIRST_DROPPED || tmp == INSECT_TYPE_EXTRA_DROPPED) { Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 4399b0c71f2..5412649331b 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -106,7 +106,7 @@ void EnIshi_InitCollider(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; Collider_InitCylinder(play, &this->collider); - Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInits[PARAMS_GET(this->actor.params, 0, 1)]); + Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInits[PARAMS_GET_U(this->actor.params, 0, 1)]); Collider_UpdateCylinder(&this->actor, &this->collider); } @@ -249,8 +249,8 @@ void EnIshi_SpawnDustLarge(EnIshi* this, PlayState* play) { void EnIshi_DropCollectible(EnIshi* this, PlayState* play) { s16 dropParams; - if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_SMALL) { - dropParams = PARAMS_GET(this->actor.params, 8, 4); + if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_SMALL) { + dropParams = PARAMS_GET_U(this->actor.params, 8, 4); if (dropParams >= 0xD) { dropParams = 0; @@ -308,7 +308,7 @@ static InitChainEntry sInitChains[][5] = { void EnIshi_Init(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; - s16 type = PARAMS_GET(this->actor.params, 0, 1); + s16 type = PARAMS_GET_U(this->actor.params, 0, 1); Actor_ProcessInitChain(&this->actor, sInitChains[type]); if (play->csCtx.state != CS_STATE_IDLE) { @@ -326,7 +326,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); this->actor.shape.yOffset = D_80A7FA20[type]; - if (!PARAMS_GET(this->actor.params, 5, 1) && !EnIshi_SnapToFloor(this, play, 0.0f)) { + if (!PARAMS_GET_U(this->actor.params, 5, 1) && !EnIshi_SnapToFloor(this, play, 0.0f)) { Actor_Kill(&this->actor); return; } @@ -347,12 +347,12 @@ void EnIshi_SetupWait(EnIshi* this) { void EnIshi_Wait(EnIshi* this, PlayState* play) { static u16 liftSfxIds[] = { NA_SE_PL_PULL_UP_ROCK, NA_SE_PL_PULL_UP_BIGROCK }; s32 pad; - s16 type = PARAMS_GET(this->actor.params, 0, 1); + s16 type = PARAMS_GET_U(this->actor.params, 0, 1); if (Actor_HasParent(&this->actor, play)) { EnIshi_SetupLiftedUp(this); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, liftSfxIds[type]); - if (PARAMS_GET(this->actor.params, 4, 1)) { + if (PARAMS_GET_U(this->actor.params, 4, 1)) { EnIshi_SpawnBugs(this, play); } } else if ((this->collider.base.acFlags & AC_HIT) && (type == ROCK_SMALL) && @@ -389,12 +389,12 @@ void EnIshi_SetupLiftedUp(EnIshi* this) { void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { if (Actor_HasNoParent(&this->actor, play)) { this->actor.room = play->roomCtx.curRoom.num; - if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_LARGE) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_LARGE) { Flags_SetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor)); } EnIshi_SetupFly(this); EnIshi_Fall(this); - func_80A7ED94(&this->actor.velocity, D_80A7FA28[PARAMS_GET(this->actor.params, 0, 1)]); + func_80A7ED94(&this->actor.velocity, D_80A7FA28[PARAMS_GET_U(this->actor.params, 0, 1)]); Actor_UpdatePos(&this->actor); Actor_UpdateBgCheckInfo(play, &this->actor, 7.5f, 35.0f, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2 | UPDBGCHECKINFO_FLAG_6 | @@ -405,7 +405,7 @@ void EnIshi_LiftedUp(EnIshi* this, PlayState* play) { void EnIshi_SetupFly(EnIshi* this) { this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speed; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speed; - if (PARAMS_GET(this->actor.params, 0, 1) == ROCK_SMALL) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == ROCK_SMALL) { sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; } else { @@ -418,7 +418,7 @@ void EnIshi_SetupFly(EnIshi* this) { void EnIshi_Fly(EnIshi* this, PlayState* play) { s32 pad; - s16 type = PARAMS_GET(this->actor.params, 0, 1); + s16 type = PARAMS_GET_U(this->actor.params, 0, 1); s32 pad2; s32 quakeIndex; Vec3f contactPos; @@ -501,5 +501,5 @@ static EnIshiDrawFunc sDrawFuncs[] = { EnIshi_DrawSmall, EnIshi_DrawLarge }; void EnIshi_Draw(Actor* thisx, PlayState* play) { EnIshi* this = (EnIshi*)thisx; - sDrawFuncs[PARAMS_GET(this->actor.params, 0, 1)](this, play); + sDrawFuncs[PARAMS_GET_U(this->actor.params, 0, 1)](this, play); } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h index 063fe7b6bb7..6f49e597ac2 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.h @@ -13,9 +13,9 @@ // After the OR operation, the final switch flag is constructed to form "0bABCDEF" // // Due to the unique form of access to obtain the upper bits of the switch flag, `ISHI_GET_SWITCH_FLAG_UPPER` -// cannot use the generic `PARAMS_GET` macros. +// cannot use the generic `PARAMS_GET_U` macros. #define ISHI_GET_SWITCH_FLAG_UPPER(thisx) ((((thisx)->params) >> (12 - 2)) & (NBITS_TO_MASK(4) << 2)) -#define ISHI_GET_SWITCH_FLAG_LOWER(thisx) PARAMS_GET((thisx)->params, 6, 2) +#define ISHI_GET_SWITCH_FLAG_LOWER(thisx) PARAMS_GET_U((thisx)->params, 6, 2) #define ISHI_GET_SWITCH_FLAG(thisx) (ISHI_GET_SWITCH_FLAG_UPPER(thisx) | ISHI_GET_SWITCH_FLAG_LOWER(thisx)) typedef enum { diff --git a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c index 02776dc5020..7795539d8b9 100644 --- a/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c +++ b/src/overlays/actors/ovl_En_Kakasi2/z_en_kakasi2.c @@ -63,8 +63,8 @@ void EnKakasi2_Init(Actor* thisx, PlayState* play) { // "Visit Umeda" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 梅田参号見参! ☆☆☆☆☆ \n" VT_RST); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); - spawnRangeY = PARAMS_GET(this->actor.params, 6, 8); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); + spawnRangeY = PARAMS_GET_U(this->actor.params, 6, 8); spawnRangeXZ = this->actor.world.rot.z; if (this->switchFlag == 0x3F) { this->switchFlag = -1; diff --git a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c index ae8159d061b..7bc3d318d85 100644 --- a/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c +++ b/src/overlays/actors/ovl_En_Karebaba/z_en_karebaba.c @@ -471,7 +471,7 @@ void EnKarebaba_Draw(Actor* thisx, PlayState* play) { Gfx_SetupDL_25Opa(play->state.gfxCtx); if (this->actionFunc == EnKarebaba_DeadItemDrop) { - if (this->actor.params > 40 || PARAMS_GET(this->actor.params, 0, 1)) { + if (this->actor.params > 40 || PARAMS_GET_U(this->actor.params, 0, 1)) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, MATRIX_NEW(play->state.gfxCtx, "../z_en_karebaba.c", 1066), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index b1fd8417b53..5335682a09e 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -13,8 +13,8 @@ #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3 | ACTOR_FLAG_4) -#define ENKO_TYPE PARAMS_GET2(this->actor.params, 0, 8) -#define ENKO_PATH PARAMS_GET2(this->actor.params, 8, 8) +#define ENKO_TYPE PARAMS_GET_S(this->actor.params, 0, 8) +#define ENKO_PATH PARAMS_GET_S(this->actor.params, 8, 8) void EnKo_Init(Actor* thisx, PlayState* play); void EnKo_Destroy(Actor* thisx, PlayState* play); diff --git a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 9546136a860..ac15505415f 100644 --- a/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -126,10 +126,10 @@ s32 EnKusa_SnapToFloor(EnKusa* this, PlayState* play, f32 yOffset) { void EnKusa_DropCollectible(EnKusa* this, PlayState* play) { s16 dropParams; - switch (PARAMS_GET(this->actor.params, 0, 2)) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: - dropParams = PARAMS_GET(this->actor.params, 8, 4); + dropParams = PARAMS_GET_U(this->actor.params, 8, 4); if (dropParams >= 0xD) { dropParams = 0; @@ -253,7 +253,7 @@ void EnKusa_Init(Actor* thisx, PlayState* play) { return; } - this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET(thisx->params, 0, 2)]); + this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(thisx->params, 0, 2)]); if (this->requiredObjectSlot < 0) { // "Bank danger!" @@ -307,11 +307,11 @@ void EnKusa_Main(EnKusa* this, PlayState* play) { EnKusa_DropCollectible(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 20, NA_SE_EV_PLANT_BROKEN); - if (PARAMS_GET(this->actor.params, 4, 1)) { + if (PARAMS_GET_U(this->actor.params, 4, 1)) { EnKusa_SpawnBugs(this, play); } - if (PARAMS_GET(this->actor.params, 0, 2) == ENKUSA_TYPE_0) { + if (PARAMS_GET_U(this->actor.params, 0, 2) == ENKUSA_TYPE_0) { Actor_Kill(&this->actor); return; } @@ -379,7 +379,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } EnKusa_SpawnFragments(this, play); EnKusa_DropCollectible(this, play); - switch (PARAMS_GET(this->actor.params, 0, 2)) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case ENKUSA_TYPE_0: case ENKUSA_TYPE_2: Actor_Kill(&this->actor); @@ -424,7 +424,7 @@ void EnKusa_Fall(EnKusa* this, PlayState* play) { } void EnKusa_SetupCut(EnKusa* this) { - switch (PARAMS_GET(this->actor.params, 0, 2)) { + switch (PARAMS_GET_U(this->actor.params, 0, 2)) { case ENKUSA_TYPE_2: EnKusa_SetupAction(this, EnKusa_DoNothing); break; @@ -504,6 +504,6 @@ void EnKusa_Draw(Actor* thisx, PlayState* play) { if (this->actor.flags & ACTOR_FLAG_ENKUSA_CUT) { Gfx_DrawDListOpa(play, object_kusa_DL_0002E0); } else { - Gfx_DrawDListOpa(play, dLists[PARAMS_GET(thisx->params, 0, 2)]); + Gfx_DrawDListOpa(play, dLists[PARAMS_GET_U(thisx->params, 0, 2)]); } } diff --git a/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/src/overlays/actors/ovl_En_Kz/z_en_kz.c index b53027ada49..832e6876718 100644 --- a/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -285,7 +285,7 @@ s32 EnKz_FollowPath(EnKz* this, PlayState* play) { return 0; } - path = &play->pathList[PARAMS_GET2(this->actor.params, 8, 8)]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -311,7 +311,7 @@ s32 EnKz_SetMovedPos(EnKz* this, PlayState* play) { return 0; } - path = &play->pathList[PARAMS_GET2(this->actor.params, 8, 8)]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; diff --git a/src/overlays/actors/ovl_En_Light/z_en_light.c b/src/overlays/actors/ovl_En_Light/z_en_light.c index 57378edd492..9ec4a8d0423 100644 --- a/src/overlays/actors/ovl_En_Light/z_en_light.c +++ b/src/overlays/actors/ovl_En_Light/z_en_light.c @@ -60,7 +60,7 @@ void EnLight_Init(Actor* thisx, PlayState* play) { } this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); - Actor_SetScale(&this->actor, D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)].scale * 0.0001f); + Actor_SetScale(&this->actor, D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)].scale * 0.0001f); this->timer = (s32)(Rand_ZeroOne() * 255.0f); if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1)) { @@ -92,7 +92,7 @@ void EnLight_Update(Actor* thisx, PlayState* play) { s16 radius; EnLight* this = (EnLight*)thisx; - flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)]; + flameParams = &D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)]; intensity = (Rand_ZeroOne() * 0.5f) + 0.5f; radius = (this->actor.params < 0) ? 100 : 300; Lights_PointSetColorAndRadius(&this->lightInfo, (flameParams->primColor.r * intensity), @@ -111,11 +111,11 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { EnLight* this = (EnLight*)thisx; f32 scale; - flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)]; + flameParams = &D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)]; scale = this->actor.scale.x / ((f32)flameParams->scale * 0.0001); if (PARAMS_GET_NOSHIFT(this->actor.params, 11, 1)) { - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 4, 6))) { Math_StepToF(&scale, 1.0f, 0.05f); } else { if (scale < 0.1f) { @@ -125,7 +125,7 @@ void EnLight_UpdateSwitch(Actor* thisx, PlayState* play) { Math_StepToF(&scale, 0.0f, 0.05f); } } else { - if (Flags_GetSwitch(play, PARAMS_GET2(this->actor.params, 4, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_S(this->actor.params, 4, 6))) { if (scale < 0.1f) { Actor_SetScale(&this->actor, 0.0f); return; @@ -156,7 +156,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { if (1) {} - flameParams = &D_80A9E840[PARAMS_GET2(this->actor.params, 0, 4)]; + flameParams = &D_80A9E840[PARAMS_GET_S(this->actor.params, 0, 4)]; OPEN_DISPS(play->state.gfxCtx, "../z_en_light.c", 441); @@ -184,7 +184,7 @@ void EnLight_Draw(Actor* thisx, PlayState* play) { Matrix_RotateY(BINANG_TO_RAD((s16)((Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) - this->actor.shape.rot.y) + 0x8000)), MTXMODE_APPLY); - if (PARAMS_GET2(this->actor.params, 0, 1)) { + if (PARAMS_GET_S(this->actor.params, 0, 1)) { Matrix_RotateY(M_PI, MTXMODE_APPLY); } diff --git a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c index ceb38263baa..f675d2f6751 100644 --- a/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c +++ b/src/overlays/actors/ovl_En_M_Thunder/z_en_m_thunder.c @@ -66,7 +66,7 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &D_80AA0420); - this->unk_1C7 = PARAMS_GET2(this->actor.params, 0, 8) - 1; + this->unk_1C7 = PARAMS_GET_S(this->actor.params, 0, 8) - 1; Lights_PointNoGlowSetInfo(&this->lightInfo, this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 255, 255, 255, 0); this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); @@ -85,8 +85,8 @@ void EnMThunder_Init(Actor* thisx, PlayState* play2) { if (player->stateFlags2 & PLAYER_STATE2_17) { if (!gSaveContext.save.info.playerData.isMagicAcquired || (gSaveContext.magicState != MAGIC_STATE_IDLE) || - (PARAMS_GET2(this->actor.params, 8, 8) && - !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 8), MAGIC_CONSUME_NOW)))) { + (PARAMS_GET_S(this->actor.params, 8, 8) && + !(Magic_RequestChange(play, PARAMS_GET_S(this->actor.params, 8, 8), MAGIC_CONSUME_NOW)))) { Audio_PlaySfxGeneral(NA_SE_IT_ROLLING_CUT, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); Audio_PlaySfxGeneral(NA_SE_IT_SWORD_SWING_HARD, &player->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, @@ -158,8 +158,8 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { if (this->unk_1CA == 0) { if (player->unk_858 >= 0.1f) { if ((gSaveContext.magicState != MAGIC_STATE_IDLE) || - (PARAMS_GET2(this->actor.params, 8, 8) && - !(Magic_RequestChange(play, PARAMS_GET2(this->actor.params, 8, 8), MAGIC_CONSUME_WAIT_PREVIEW)))) { + (PARAMS_GET_S(this->actor.params, 8, 8) && + !(Magic_RequestChange(play, PARAMS_GET_S(this->actor.params, 8, 8), MAGIC_CONSUME_WAIT_PREVIEW)))) { func_80A9F350(this, play); func_80A9EFE0(this, func_80A9F350); this->unk_1C8 = 0; @@ -192,7 +192,7 @@ void func_80A9F408(EnMThunder* this, PlayState* play) { return; } else { player->stateFlags2 &= ~PLAYER_STATE2_17; - if (PARAMS_GET2(this->actor.params, 8, 8)) { + if (PARAMS_GET_S(this->actor.params, 8, 8)) { gSaveContext.magicState = MAGIC_STATE_CONSUME_SETUP; } if (player->unk_858 < 0.85f) { diff --git a/src/overlays/actors/ovl_En_Mb/z_en_mb.c b/src/overlays/actors/ovl_En_Mb/z_en_mb.c index 3e58a3b0cad..290fdb23ff4 100644 --- a/src/overlays/actors/ovl_En_Mb/z_en_mb.c +++ b/src/overlays/actors/ovl_En_Mb/z_en_mb.c @@ -316,7 +316,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) { this->morphTable, 28); Actor_SetScale(&this->actor, 0.014f); - this->path = PARAMS_GET2(thisx->params, 8, 8); + this->path = PARAMS_GET_S(thisx->params, 8, 8); this->actor.params = ENMB_TYPE_SPEAR_PATROL; this->waypoint = 0; this->actor.colChkInfo.health = 1; diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index f3c4869eff9..5b23d0711ef 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -596,7 +596,7 @@ u8 EnMd_FollowPath(EnMd* this, PlayState* play) { return 0; } - path = &play->pathList[PARAMS_GET2(this->actor.params, 8, 8)]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; pointPos = SEGMENTED_TO_VIRTUAL(path->points); pointPos += this->waypoint; @@ -623,7 +623,7 @@ u8 EnMd_SetMovedPos(EnMd* this, PlayState* play) { return 0; } - path = &play->pathList[PARAMS_GET2(this->actor.params, 8, 8)]; + path = &play->pathList[PARAMS_GET_S(this->actor.params, 8, 8)]; lastPointPos = SEGMENTED_TO_VIRTUAL(path->points); lastPointPos += path->count - 1; diff --git a/src/overlays/actors/ovl_En_Mm/z_en_mm.c b/src/overlays/actors/ovl_En_Mm/z_en_mm.c index 566865e74e2..c5e0a670899 100644 --- a/src/overlays/actors/ovl_En_Mm/z_en_mm.c +++ b/src/overlays/actors/ovl_En_Mm/z_en_mm.c @@ -173,7 +173,7 @@ void EnMm_Init(Actor* thisx, PlayState* play) { Animation_GetLastFrame(sAnimationInfo[RM_ANIM_RUN].animation), sAnimationInfo[RM_ANIM_RUN].mode, sAnimationInfo[RM_ANIM_RUN].morphFrames); - this->path = PARAMS_GET(this->actor.params, 0, 8); + this->path = PARAMS_GET_U(this->actor.params, 0, 8); this->unk_1F0 = 2; this->unk_1E8 = 0; this->actor.targetMode = 2; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index fc43a17ebfe..4411023aa8d 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -89,13 +89,13 @@ static s32 D_80AB4318 = 0; #include "z_en_nb_cutscene_data.inc.c" s32 EnNb_GetPath(EnNb* this) { - s32 path = PARAMS_GET(this->actor.params, 8, 8); + s32 path = PARAMS_GET_U(this->actor.params, 8, 8); return path; } s32 EnNb_GetType(EnNb* this) { - s32 type = PARAMS_GET(this->actor.params, 0, 8); + s32 type = PARAMS_GET_U(this->actor.params, 0, 8); return type; } diff --git a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c index 0f646a0a882..8b8d007cafa 100644 --- a/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c +++ b/src/overlays/actors/ovl_En_Niw_Girl/z_en_niw_girl.c @@ -65,7 +65,7 @@ void EnNiwGirl_Init(Actor* thisx, PlayState* play) { if (this->actor.params < 0) { this->actor.params = 0; } - this->path = PARAMS_GET(this->actor.params, 8, 8); + this->path = PARAMS_GET_U(this->actor.params, 8, 8); this->actor.gravity = -3.0f; Matrix_RotateY(BINANG_TO_RAD_ALT(this->actor.shape.rot.y), MTXMODE_NEW); vec2.x = vec2.y = vec2.z = 0.0f; diff --git a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c index c3f47f22365..6bfda42af8a 100644 --- a/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c +++ b/src/overlays/actors/ovl_En_Okarina_Tag/z_en_okarina_tag.c @@ -47,9 +47,9 @@ void EnOkarinaTag_Init(Actor* thisx, PlayState* play) { // "Ocarina tag outbreak" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ オカリナタグ発生 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->actor.flags &= ~ACTOR_FLAG_0; - this->type = PARAMS_GET(this->actor.params, 10, 6); - this->ocarinaSong = PARAMS_GET(this->actor.params, 6, 4); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); + this->type = PARAMS_GET_U(this->actor.params, 10, 6); + this->ocarinaSong = PARAMS_GET_U(this->actor.params, 6, 4); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c index ebcf5e26db6..74d6b1fc2cb 100644 --- a/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c +++ b/src/overlays/actors/ovl_En_Okuta/z_en_okuta.c @@ -121,7 +121,7 @@ void EnOkuta_Init(Actor* thisx, PlayState* play) { s32 floorBgId; Actor_ProcessInitChain(thisx, sInitChain); - this->numShots = PARAMS_GET(thisx->params, 8, 8); + this->numShots = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params == 0) { SkelAnime_Init(play, &this->skelAnime, &gOctorokSkel, &gOctorokAppearAnim, this->jointTable, this->morphTable, diff --git a/src/overlays/actors/ovl_En_Owl/z_en_owl.c b/src/overlays/actors/ovl_En_Owl/z_en_owl.c index 6bdcf38e20e..eca46dab587 100644 --- a/src/overlays/actors/ovl_En_Owl/z_en_owl.c +++ b/src/overlays/actors/ovl_En_Owl/z_en_owl.c @@ -125,8 +125,8 @@ void EnOwl_Init(Actor* thisx, PlayState* play) { this->unk_405 = 4; this->unk_404 = this->unk_407 = 0; this->unk_408 = 4; - owlType = PARAMS_GET2(this->actor.params, 6, 6); - switchFlag = PARAMS_GET2(this->actor.params, 0, 6); + owlType = PARAMS_GET_S(this->actor.params, 6, 6); + switchFlag = PARAMS_GET_S(this->actor.params, 0, 6); if (this->actor.params == 0xFFF) { owlType = OWL_OUTSIDE_KOKIRI; switchFlag = 0x20; @@ -302,7 +302,7 @@ void func_80ACA5C8(EnOwl* this) { } void func_80ACA62C(EnOwl* this, PlayState* play) { - s32 switchFlag = PARAMS_GET2(this->actor.params, 0, 6); + s32 switchFlag = PARAMS_GET_S(this->actor.params, 0, 6); if (switchFlag < 0x20) { Flags_SetSwitch(play, switchFlag); @@ -728,7 +728,7 @@ void func_80ACB748(EnOwl* this, PlayState* play) { static Vec3f D_80ACD62C = { 0.0f, 0.0f, 0.0f }; f32 dist; f32 weight; - s32 owlType = PARAMS_GET2(this->actor.params, 6, 6); + s32 owlType = PARAMS_GET_S(this->actor.params, 6, 6); dist = Math3D_Vec3f_DistXYZ(&this->eye, &play->view.eye) / 45.0f; this->eye.x = play->view.eye.x; @@ -926,7 +926,7 @@ void func_80ACC00C(EnOwl* this, PlayState* play) { if (this->actor.xzDistToPlayer < 50.0f) { if (!Play_InCsMode(play)) { - owlType = PARAMS_GET2(this->actor.params, 6, 6); + owlType = PARAMS_GET_S(this->actor.params, 6, 6); PRINTF(VT_FGCOL(CYAN)); PRINTF("%dのフクロウ\n", owlType); // "%d owl" PRINTF(VT_RST); @@ -1057,7 +1057,7 @@ s32 func_80ACC5CC(EnOwl* this) { } s32 func_80ACC624(EnOwl* this, PlayState* play) { - s32 switchFlag = PARAMS_GET2(this->actor.params, 6, 6); + s32 switchFlag = PARAMS_GET_S(this->actor.params, 6, 6); if (play->sceneId != SCENE_DESERT_COLOSSUS) { return true; diff --git a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c index 91aafe1207d..3c519cdd6e3 100644 --- a/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c +++ b/src/overlays/actors/ovl_En_Po_Desert/z_en_po_desert.c @@ -74,7 +74,7 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) { 255, 255, 255, 200); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 37.0f); this->currentPathPoint = 1; - this->actor.params = PARAMS_GET(this->actor.params, 8, 8); + this->actor.params = PARAMS_GET_U(this->actor.params, 8, 8); this->targetY = this->actor.world.pos.y; EnPoDesert_SetNextPathPoint(this, play); } diff --git a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index fff176cf90d..c5316620d53 100644 --- a/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -153,7 +153,7 @@ void EnPoField_Init(Actor* thisx, PlayState* play) { sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; - sSpawnSwitchFlags[sNumSpawned] = PARAMS_GET(this->actor.params, 0, 8); + sSpawnSwitchFlags[sNumSpawned] = PARAMS_GET_U(this->actor.params, 0, 8); sNumSpawned++; } if (sNumSpawned >= 2) { diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index ba3246fde0b..fc5af5c5551 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -191,10 +191,10 @@ void EnPoSisters_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); - this->unk_194 = PARAMS_GET(thisx->params, 8, 2); + this->unk_194 = PARAMS_GET_U(thisx->params, 8, 2); this->actor.naviEnemyId = this->unk_194 + NAVI_ENEMY_POE_SISTER_MEG; if (1) {} - this->unk_195 = PARAMS_GET(thisx->params, 10, 2); + this->unk_195 = PARAMS_GET_U(thisx->params, 10, 2); this->unk_196 = 32; this->unk_197 = 20; this->unk_198 = 1; diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.h b/src/overlays/actors/ovl_En_Rd/z_en_rd.h index 4f81f37bd3c..f145908f276 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.h +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.h @@ -8,7 +8,7 @@ struct EnRd; typedef void (*EnRdActionFunc)(struct EnRd*, PlayState*); -#define REDEAD_GET_RDFLAGS(thisx) PARAMS_GET2((thisx)->params, 8, 8) +#define REDEAD_GET_RDFLAGS(thisx) PARAMS_GET_S((thisx)->params, 8, 8) typedef enum { /* 0 */ REDEAD_GIBDO_LIMB_NONE, diff --git a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c index e90237d41ba..2ae88fe1d84 100644 --- a/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c +++ b/src/overlays/actors/ovl_En_River_Sound/z_en_river_sound.c @@ -29,8 +29,8 @@ void EnRiverSound_Init(Actor* thisx, PlayState* play) { EnRiverSound* this = (EnRiverSound*)thisx; this->playSfx = false; - this->pathIndex = PARAMS_GET(this->actor.params, 8, 8); - this->actor.params = PARAMS_GET(this->actor.params, 0, 8); + this->pathIndex = PARAMS_GET_U(this->actor.params, 8, 8); + this->actor.params = PARAMS_GET_U(this->actor.params, 0, 8); if (this->actor.params >= RS_GANON_TOWER_0) { // Incrementally increase volume of NA_BGM_GANON_TOWER for each new room during the climb of Ganon's Tower diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 79613b8d190..07daa2c973b 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -190,13 +190,13 @@ void func_80AEADD8(EnRu1* this) { } u8 func_80AEADE0(EnRu1* this) { - u8 params = PARAMS_GET(this->actor.params, 8, 8); + u8 params = PARAMS_GET_U(this->actor.params, 8, 8); return params; } u8 func_80AEADF0(EnRu1* this) { - u8 params = PARAMS_GET(this->actor.params, 0, 8); + u8 params = PARAMS_GET_U(this->actor.params, 0, 8); return params; } @@ -325,7 +325,7 @@ Actor* func_80AEB124(PlayState* play) { Actor* actorIt = play->actorCtx.actorLists[ACTORCAT_BOSS].head; while (actorIt != NULL) { - if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET(actorIt->params, 0, 8) == DEMO_EFFECT_JEWEL_ZORA)) { + if ((actorIt->id == ACTOR_DEMO_EFFECT) && (PARAMS_GET_U(actorIt->params, 0, 8) == DEMO_EFFECT_JEWEL_ZORA)) { return actorIt; } actorIt = actorIt->next; @@ -1518,7 +1518,7 @@ void func_80AEE2F8(EnRu1* this, PlayState* play) { floorBgId = this->actor.floorBgId; dynaPolyActor = DynaPoly_GetActor(&play->colCtx, floorBgId); if ((dynaPolyActor != NULL) && (dynaPolyActor->actor.id == ACTOR_BG_BDAN_SWITCH)) { - if (PARAMS_GET(dynaPolyActor->actor.params, 8, 6) == 0x38) { + if (PARAMS_GET_U(dynaPolyActor->actor.params, 8, 6) == 0x38) { SET_INFTABLE(INFTABLE_140); return; } diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 10b7254830a..59c3793c746 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -126,13 +126,13 @@ void func_80AF2608(EnRu2* this) { } s32 func_80AF2690(EnRu2* this) { - s32 params_shift = PARAMS_GET(this->actor.params, 8, 8); + s32 params_shift = PARAMS_GET_U(this->actor.params, 8, 8); return params_shift; } s32 func_80AF26A0(EnRu2* this) { - s32 params = PARAMS_GET(this->actor.params, 0, 8); + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); return params; } diff --git a/src/overlays/actors/ovl_En_Si/z_en_si.c b/src/overlays/actors/ovl_En_Si/z_en_si.c index bad1af56575..b94424f1d02 100644 --- a/src/overlays/actors/ovl_En_Si/z_en_si.c +++ b/src/overlays/actors/ovl_En_Si/z_en_si.c @@ -128,7 +128,7 @@ void func_80AFB950(EnSi* this, PlayState* play) { if (Message_GetState(&play->msgCtx) != TEXT_STATE_CLOSING) { player->actor.freezeTimer = 10; } else { - SET_GS_FLAGS(PARAMS_GET2(this->actor.params, 8, 5), PARAMS_GET2(this->actor.params, 0, 8)); + SET_GS_FLAGS(PARAMS_GET_S(this->actor.params, 8, 5), PARAMS_GET_S(this->actor.params, 0, 8)); Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c index 64906692a51..85333ed5e65 100644 --- a/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c +++ b/src/overlays/actors/ovl_En_Siofuki/z_en_siofuki.c @@ -51,7 +51,7 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); this->sfxFlags |= 1; - type = PARAMS_GET((u16)thisx->params, 12, 4); + type = PARAMS_GET_U((u16)thisx->params, 12, 4); if (!((type == 0) || (type == 1))) { Actor_Kill(thisx); return; @@ -81,13 +81,13 @@ void EnSiofuki_Init(Actor* thisx, PlayState* play) { thisx->shape.rot.y = 0; thisx->shape.rot.z = 0; - type = PARAMS_GET((u16)thisx->params, 12, 4); + type = PARAMS_GET_U((u16)thisx->params, 12, 4); if (type == EN_SIOFUKI_RAISING) { this->currentHeight = 10.0f; this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; } else if (type == EN_SIOFUKI_LOWERING) { - if (Flags_GetTreasure(play, PARAMS_GET((u16)thisx->params, 0, 6))) { + if (Flags_GetTreasure(play, PARAMS_GET_U((u16)thisx->params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -189,8 +189,8 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { this->timer--; if (this->timer < 0) { - Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6)); - switch (PARAMS_GET((u16)this->dyna.actor.params, 12, 4)) { + Flags_UnsetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6)); + switch (PARAMS_GET_U((u16)this->dyna.actor.params, 12, 4)) { case EN_SIOFUKI_RAISING: this->targetHeight = 10.0f; this->actionFunc = func_80AFC34C; @@ -204,11 +204,11 @@ void func_80AFC218(EnSiofuki* this, PlayState* play) { func_8002F994(&this->dyna.actor, this->timer); } - if ((PARAMS_GET((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) && - Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 6))) { + if ((PARAMS_GET_U((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) && + Flags_GetTreasure(play, PARAMS_GET_U((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; - Flags_UnsetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6)); + Flags_UnsetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6)); this->actionFunc = func_80AFC544; } } @@ -218,7 +218,7 @@ void func_80AFC34C(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6))) { this->targetHeight = 400.0f; this->timer = 300; this->actionFunc = func_80AFC218; @@ -237,7 +237,7 @@ void func_80AFC3C8(EnSiofuki* this, PlayState* play) { this->actionFunc = func_80AFC218; } - if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 6))) { + if (Flags_GetTreasure(play, PARAMS_GET_U((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -249,14 +249,14 @@ void func_80AFC478(EnSiofuki* this, PlayState* play) { func_80AFBE8C(this, play); func_80AFC1D0(this, play); - if (PARAMS_GET((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) { - if (Flags_GetSwitch(play, PARAMS_GET((u16)this->dyna.actor.params, 6, 6))) { + if (PARAMS_GET_U((u16)this->dyna.actor.params, 12, 4) == EN_SIOFUKI_LOWERING) { + if (Flags_GetSwitch(play, PARAMS_GET_U((u16)this->dyna.actor.params, 6, 6))) { this->timer = 20; this->actionFunc = func_80AFC3C8; OnePointCutscene_Init(play, 5010, 40, &this->dyna.actor, CAM_ID_MAIN); } - if (Flags_GetTreasure(play, PARAMS_GET((u16)this->dyna.actor.params, 0, 6))) { + if (Flags_GetTreasure(play, PARAMS_GET_U((u16)this->dyna.actor.params, 0, 6))) { this->currentHeight = -45.0f; this->targetHeight = -45.0f; this->actionFunc = func_80AFC544; @@ -296,7 +296,7 @@ void EnSiofuki_Draw(Actor* thisx, PlayState* play) { if (this->sfxFlags & 1) { f32 heightRatio; - switch (PARAMS_GET((u16)thisx->params, 12, 4)) { + switch (PARAMS_GET_U((u16)thisx->params, 12, 4)) { case EN_SIOFUKI_RAISING: heightRatio = (this->currentHeight - 10.0f) / (400.0f - 10.0f); func_800F436C(&thisx->projectedPos, NA_SE_EV_FOUNTAIN - SFX_FLAG, 1.0f + heightRatio); diff --git a/src/overlays/actors/ovl_En_Skj/z_en_skj.c b/src/overlays/actors/ovl_En_Skj/z_en_skj.c index 87d0455feb0..2d5f7ba3d46 100644 --- a/src/overlays/actors/ovl_En_Skj/z_en_skj.c +++ b/src/overlays/actors/ovl_En_Skj/z_en_skj.c @@ -360,7 +360,7 @@ void EnSkj_SetNaviId(EnSkj* this) { } void EnSkj_Init(Actor* thisx, PlayState* play2) { - s16 type = PARAMS_GET(thisx->params, 10, 6); + s16 type = PARAMS_GET_U(thisx->params, 10, 6); EnSkj* this = (EnSkj*)thisx; PlayState* play = play2; s32 pad; diff --git a/src/overlays/actors/ovl_En_Stream/z_en_stream.c b/src/overlays/actors/ovl_En_Stream/z_en_stream.c index 8fc5e460958..966a6b259f0 100644 --- a/src/overlays/actors/ovl_En_Stream/z_en_stream.c +++ b/src/overlays/actors/ovl_En_Stream/z_en_stream.c @@ -38,7 +38,7 @@ void EnStream_SetupAction(EnStream* this, EnStreamActionFunc actionFunc) { void EnStream_Init(Actor* thisx, PlayState* play) { EnStream* this = (EnStream*)thisx; - this->unk_150 = PARAMS_GET(thisx->params, 0, 8); + this->unk_150 = PARAMS_GET_U(thisx->params, 0, 8); Actor_ProcessInitChain(thisx, sInitChain); if ((this->unk_150 != 0) && (this->unk_150 == 1)) { thisx->scale.y = 0.01f; diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index c4d356bc6db..ada9fd70854 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -221,17 +221,17 @@ void EnSw_Init(Actor* thisx, PlayState* play) { s32 pad; if (PARAMS_GET_NOSHIFT(thisx->params, 15, 1)) { - phi_v0 = PARAMS_GET2(thisx->params - 0x8000, 13, 3) + 1; - thisx->params = PARAMS_GET2(thisx->params, 0, 13) | (phi_v0 << 0xD); + phi_v0 = PARAMS_GET_S(thisx->params - 0x8000, 13, 3) + 1; + thisx->params = PARAMS_GET_S(thisx->params, 0, 13) | (phi_v0 << 0xD); } - if (PARAMS_GET2(thisx->params, 13, 3) > 0) { - phi_v0 = PARAMS_GET2(thisx->params, 8, 5) - 1; + if (PARAMS_GET_S(thisx->params, 13, 3) > 0) { + phi_v0 = PARAMS_GET_S(thisx->params, 8, 5) - 1; thisx->params = (thisx->params & ~(0x1F << 8)) | (phi_v0 << 8); } // Check to see if this gold skull token has already been retrieved. - if (GET_GS_FLAGS(PARAMS_GET2(thisx->params, 8, 5)) & PARAMS_GET2(thisx->params, 0, 8)) { + if (GET_GS_FLAGS(PARAMS_GET_S(thisx->params, 8, 5)) & PARAMS_GET_S(thisx->params, 0, 8)) { Actor_Kill(&this->actor); return; } @@ -244,7 +244,7 @@ void EnSw_Init(Actor* thisx, PlayState* play) { CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xE), &D_80B0F074); this->actor.scale.x = 0.02f; - if (PARAMS_GET2(thisx->params, 13, 3) == 0) { + if (PARAMS_GET_S(thisx->params, 13, 3) == 0) { this->actor.world.rot.x = 0; this->actor.world.rot.z = 0; thisx->shape.rot = this->actor.world.rot; @@ -266,12 +266,12 @@ void EnSw_Init(Actor* thisx, PlayState* play) { func_80B0C0CC(this, play, 1); } - if (PARAMS_GET2(thisx->params, 13, 3) >= 3) { + if (PARAMS_GET_S(thisx->params, 13, 3) >= 3) { Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } - switch (PARAMS_GET2(thisx->params, 13, 3)) { + switch (PARAMS_GET_S(thisx->params, 13, 3)) { case 3: case 4: this->unk_360 = 1; @@ -299,11 +299,11 @@ void EnSw_Init(Actor* thisx, PlayState* play) { this->actor.home.pos = this->actor.world.pos; thisx->shape.rot = this->actor.world.rot; - if (PARAMS_GET2(thisx->params, 13, 3) >= 3) { + if (PARAMS_GET_S(thisx->params, 13, 3) >= 3) { this->unk_38C = 0x28; this->unk_394 = 1; this->actionFunc = func_80B0D364; - } else if (PARAMS_GET2(thisx->params, 13, 3) == 0) { + } else if (PARAMS_GET_S(thisx->params, 13, 3) == 0) { this->actionFunc = func_80B0E5E0; } else { this->actionFunc = func_80B0D590; @@ -319,7 +319,7 @@ void EnSw_Destroy(Actor* thisx, PlayState* play) { s32 func_80B0C9F0(EnSw* this, PlayState* play) { s32 phi_v1 = false; - if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET2(this->actor.params, 13, 3) == 0 && + if (this->actor.xyzDistToPlayerSq < SQ(400.0f) && PARAMS_GET_S(this->actor.params, 13, 3) == 0 && play->actorCtx.unk_02 != 0) { this->actor.colChkInfo.damage = this->actor.colChkInfo.health; @@ -336,7 +336,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { return true; } Enemy_StartFinishingBlow(play, &this->actor); - if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->skelAnime.playSpeed = 8.0f; if ((play->state.frames & 1) == 0) { this->unk_420 = 0.1f; @@ -370,7 +370,7 @@ s32 func_80B0C9F0(EnSw* this, PlayState* play) { } void func_80B0CBE8(EnSw* this, PlayState* play) { - if ((PARAMS_GET2(this->actor.params, 13, 3) > 0) && (this->actionFunc != func_80B0D590)) { + if ((PARAMS_GET_S(this->actor.params, 13, 3) > 0) && (this->actionFunc != func_80B0D590)) { if (this->unk_392 != 0) { this->unk_392--; } @@ -438,7 +438,7 @@ void func_80B0CEA8(EnSw* this, PlayState* play) { Camera* activeCam = GET_ACTIVE_CAM(play); if (!(Math_Vec3f_DistXYZ(&this->actor.world.pos, &activeCam->eye) >= 380.0f)) { - Actor_PlaySfx(&this->actor, (PARAMS_GET2(this->actor.params, 13, 3) > 0) ? NA_SE_EN_STALGOLD_ROLL + Actor_PlaySfx(&this->actor, (PARAMS_GET_S(this->actor.params, 13, 3) > 0) ? NA_SE_EN_STALGOLD_ROLL : NA_SE_EN_STALWALL_ROLL); } } @@ -483,7 +483,7 @@ void func_80B0D14C(EnSw* this, PlayState* play, s32 cnt) { } void func_80B0D364(EnSw* this, PlayState* play) { - if (PARAMS_GET2(this->actor.params, 13, 3) == 4) { + if (PARAMS_GET_S(this->actor.params, 13, 3) == 4) { this->unk_38C = 0; this->actionFunc = func_80B0D3AC; } else { @@ -536,7 +536,7 @@ void func_80B0D3AC(EnSw* this, PlayState* play) { void func_80B0D590(EnSw* this, PlayState* play) { f32 sp2C; - if (PARAMS_GET2(this->actor.params, 13, 3) == 2) { + if (PARAMS_GET_S(this->actor.params, 13, 3) == 2) { if (this->actor.scale.x < 0.0139999995f) { this->collider.elements[0].base.toucherFlags = TOUCH_NONE; this->collider.elements[0].base.bumperFlags = BUMP_NONE; @@ -560,7 +560,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_420 = ((play->state.frames % 2) == 0) ? 0.1f : -0.1f; this->unk_38A = 1; this->unk_38C = Rand_S16Offset(30, 60); - if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->unk_38C *= 2; this->unk_420 *= 2.0f; } @@ -571,7 +571,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { this->unk_38E = Rand_S16Offset(15, 30); this->unk_38A = 0; this->skelAnime.playSpeed = 0.0f; - if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->unk_38E /= 2; } } else if (this->unk_38A != 0) { @@ -581,7 +581,7 @@ void func_80B0D590(EnSw* this, PlayState* play) { if (this->skelAnime.playSpeed > 0.0f) { func_80B0CEA8(this, play); } - if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { this->skelAnime.playSpeed *= 2.0f; } } else { @@ -910,7 +910,7 @@ s32 EnSw_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* po OPEN_DISPS(play->state.gfxCtx, "../z_en_sw.c", 2084); - if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { switch (limbIndex) { case 23: *dList = object_st_DL_004788; @@ -1001,7 +1001,7 @@ void EnSw_Draw(Actor* thisx, PlayState* play) { EnSw* this = (EnSw*)thisx; Color_RGBA8 sp30 = { 184, 0, 228, 255 }; - if (PARAMS_GET2(this->actor.params, 13, 3) != 0) { + if (PARAMS_GET_S(this->actor.params, 13, 3) != 0) { Matrix_RotateX(DEG_TO_RAD(-80), MTXMODE_APPLY); if (this->actor.colChkInfo.health != 0) { Matrix_Translate(0.0f, 0.0f, 200.0f, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_En_Trap/z_en_trap.c b/src/overlays/actors/ovl_En_Trap/z_en_trap.c index cbf3806ee24..ac2b4236282 100644 --- a/src/overlays/actors/ovl_En_Trap/z_en_trap.c +++ b/src/overlays/actors/ovl_En_Trap/z_en_trap.c @@ -67,7 +67,7 @@ void EnTrap_Init(Actor* thisx, PlayState* play) { EnTrap* this = (EnTrap*)thisx; ColliderCylinder* unused = &this->collider; // required to match - this->upperParams = PARAMS_GET(thisx->params, 8, 8); + this->upperParams = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; Actor_SetScale(thisx, 0.1f); thisx->gravity = -2.0f; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index ec6315bc313..c6dc25cc72d 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -72,10 +72,10 @@ void EnTuboTrap_Destroy(Actor* thisx, PlayState* play) { void EnTuboTrap_DropCollectible(EnTuboTrap* this, PlayState* play) { s16 params = this->actor.params; - s16 dropType = PARAMS_GET(params, 6, 10); + s16 dropType = PARAMS_GET_U(params, 6, 10); if (dropType >= 0 && dropType < ITEM00_MAX) { - Item_DropCollectible(play, &this->actor.world.pos, dropType | (PARAMS_GET(params, 0, 6) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, dropType | (PARAMS_GET_U(params, 0, 6) << 8)); } } diff --git a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c index 693b6fee2ac..85bcfc5be19 100644 --- a/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c +++ b/src/overlays/actors/ovl_En_Vb_Ball/z_en_vb_ball.c @@ -134,7 +134,7 @@ void EnVbBall_UpdateBones(EnVbBall* this, PlayState* play) { this->actor.velocity.x = sinf(angle) * 10.0f; this->actor.velocity.z = cosf(angle) * 10.0f; this->actor.velocity.y *= -0.5f; - if (PARAMS_GET(this->actor.params, 0, 1)) { + if (PARAMS_GET_U(this->actor.params, 0, 1)) { Audio_PlaySfxGeneral(NA_SE_EN_VALVAISA_LAND, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); } diff --git a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c index 5e08ca60e5e..5dcf7decca5 100644 --- a/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c +++ b/src/overlays/actors/ovl_En_Wallmas/z_en_wallmas.c @@ -124,8 +124,8 @@ void EnWallmas_Init(Actor* thisx, PlayState* play) { Collider_InitCylinder(play, &this->collider); Collider_SetCylinder(play, &this->collider, thisx, &sCylinderInit); CollisionCheck_SetInfo(&thisx->colChkInfo, &sDamageTable, &sColChkInfoInit); - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); - thisx->params = PARAMS_GET(thisx->params, 0, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); + thisx->params = PARAMS_GET_U(thisx->params, 0, 8); if (thisx->params == WMT_FLAG) { if (Flags_GetSwitch(play, this->switchFlag) != 0) { diff --git a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c index a3008f6e253..b2c52bbe49c 100644 --- a/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c +++ b/src/overlays/actors/ovl_En_Weather_Tag/z_en_weather_tag.c @@ -55,7 +55,7 @@ void EnWeatherTag_Init(Actor* thisx, PlayState* play) { this->actor.flags &= ~ACTOR_FLAG_0; - switch (PARAMS_GET(this->actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->actor.params, 0, 4)) { case EN_WEATHER_TAG_TYPE_CLOUDY_MARKET: PRINTF("\n\n"); // "☆☆☆☆☆ (;o;) About ☆☆☆☆☆☆" diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index 93e5d550aab..8be6c1ccb4e 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -220,7 +220,7 @@ void EnWf_Init(Actor* thisx, PlayState* play) { thisx->colChkInfo.health = 8; thisx->colChkInfo.cylRadius = 50; thisx->colChkInfo.cylHeight = 100; - this->switchFlag = PARAMS_GET(thisx->params, 8, 8); + this->switchFlag = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; this->eyeIndex = 0; this->unk_2F4 = 10.0f; // Set and not used diff --git a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c index 5e498629905..fa96361b5db 100644 --- a/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c +++ b/src/overlays/actors/ovl_En_Wonder_Item/z_en_wonder_item.c @@ -122,9 +122,9 @@ void EnWonderItem_Init(Actor* thisx, PlayState* play) { PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 不思議不思議まか不思議 \t ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); this->actor.flags &= ~ACTOR_FLAG_0; - this->wonderMode = PARAMS_GET(this->actor.params, 11, 5); - this->itemDrop = PARAMS_GET(this->actor.params, 6, 5); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); + this->wonderMode = PARAMS_GET_U(this->actor.params, 11, 5); + this->itemDrop = PARAMS_GET_U(this->actor.params, 6, 5); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c index 92b6489146a..27d2be282a6 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk/z_en_wonder_talk.c @@ -39,9 +39,9 @@ void EnWonderTalk_Init(Actor* thisx, PlayState* play) { // "Special conversation" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 特殊会話くん ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->unk_150 = PARAMS_GET(this->actor.params, 11, 5); - this->unk_152 = PARAMS_GET(this->actor.params, 6, 5); - this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); + this->unk_150 = PARAMS_GET_U(this->actor.params, 11, 5); + this->unk_152 = PARAMS_GET_U(this->actor.params, 6, 5); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); if (this->switchFlag == 0x3F) { this->switchFlag = -1; } diff --git a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c index 307e27b0824..592257aaa6b 100644 --- a/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c +++ b/src/overlays/actors/ovl_En_Wonder_Talk2/z_en_wonder_talk2.c @@ -43,7 +43,7 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { PRINTF("\n\n"); // "Transparent message" PRINTF(VT_FGCOL(GREEN) "☆☆☆☆☆ 透明メッセージ君 ☆☆☆☆☆ %x\n" VT_RST, this->actor.params); - this->baseMsgId = PARAMS_GET(this->actor.params, 6, 8); + this->baseMsgId = PARAMS_GET_U(this->actor.params, 6, 8); if (this->actor.world.rot.z > 0) { s32 rangeIndex = 0; s16 rotZmod10 = this->actor.world.rot.z; @@ -73,8 +73,8 @@ void EnWonderTalk2_Init(Actor* thisx, PlayState* play) { } this->initPos = this->actor.world.pos; - this->switchFlag = PARAMS_GET(this->actor.params, 0, 6); - this->talkMode = PARAMS_GET(this->actor.params, 14, 2); + this->switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); + this->talkMode = PARAMS_GET_U(this->actor.params, 14, 2); if (this->switchFlag == 0x3F) { this->switchFlag = -1; diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index a3ec901881b..c01fd2c4508 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -169,7 +169,7 @@ void EnWood02_Init(Actor* thisx, PlayState* play2) { spawnType = WOOD_SPAWN_NORMAL; actorScale = 1.0f; - this->unk_14C = PARAMS_GET(this->actor.params, 8, 8); + this->unk_14C = PARAMS_GET_U(this->actor.params, 8, 8); if (this->actor.home.rot.z != 0) { this->actor.home.rot.z = (this->actor.home.rot.z << 8) | this->unk_14C; diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index 1bd7816d7ac..22a3b78bef2 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -283,7 +283,7 @@ void EnZf_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); thisx->targetMode = 3; - this->clearFlag = PARAMS_GET2(thisx->params, 8, 8); + this->clearFlag = PARAMS_GET_S(thisx->params, 8, 8); /* Strip the top byte of params */ thisx->params &= 0xFF; diff --git a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 08622cf3a9a..1b41bc644a0 100644 --- a/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -708,19 +708,19 @@ void EnZl3_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, } s32 func_80B54DB4(EnZl3* this) { - s32 params = PARAMS_GET(this->actor.params, 8, 8); + s32 params = PARAMS_GET_U(this->actor.params, 8, 8); return params; } s32 func_80B54DC4(EnZl3* this) { - s32 params = PARAMS_GET(this->actor.params, 4, 4); + s32 params = PARAMS_GET_U(this->actor.params, 4, 4); return params; } s32 func_80B54DD4(EnZl3* this) { - s32 params = PARAMS_GET(this->actor.params, 0, 4); + s32 params = PARAMS_GET_U(this->actor.params, 0, 4); return params; } diff --git a/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/src/overlays/actors/ovl_En_Zo/z_en_zo.c index 04b72ef250d..9a1c534867d 100644 --- a/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -363,7 +363,7 @@ u16 EnZo_GetTextId(PlayState* play, Actor* thisx) { return textId; } - switch (PARAMS_GET(thisx->params, 0, 6)) { + switch (PARAMS_GET_U(thisx->params, 0, 6)) { case 8: if (GET_EVENTCHKINF(EVENTCHKINF_30)) { return 0x402A; @@ -581,7 +581,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInit); - if (LINK_IS_ADULT && (PARAMS_GET(this->actor.params, 0, 6) == 8)) { + if (LINK_IS_ADULT && (PARAMS_GET_U(this->actor.params, 0, 6) == 8)) { Actor_Kill(&this->actor); return; } @@ -596,7 +596,7 @@ void EnZo_Init(Actor* thisx, PlayState* play) { Actor_UpdateBgCheckInfo(play, &this->actor, this->collider.dim.height * 0.5f, this->collider.dim.radius, 0.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2); - if (this->actor.yDistToWater < 54.0f || PARAMS_GET(this->actor.params, 0, 6) == 8) { + if (this->actor.yDistToWater < 54.0f || PARAMS_GET_U(this->actor.params, 0, 6) == 8) { this->actor.shape.shadowDraw = ActorShadow_DrawCircle; this->actor.shape.shadowScale = 24.0f; Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, ENZO_ANIM_1); diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index 0a78bf5d9e4..a846a12a4d3 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -96,7 +96,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { s32 type; s32 objectSlot; - type = PARAMS_GET(this->actor.params, 0, 8); + type = PARAMS_GET_U(this->actor.params, 0, 8); PRINTF("no = %d\n", type); objectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[type]); PRINTF("bank_ID = %d\n", objectSlot); @@ -152,7 +152,7 @@ void ItemEtcetera_WaitForObject(ItemEtcetera* this, PlayState* play) { void func_80B85824(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if (PARAMS_GET(this->actor.params, 0, 8) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 8) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -164,7 +164,7 @@ void func_80B85824(ItemEtcetera* this, PlayState* play) { void func_80B858B4(ItemEtcetera* this, PlayState* play) { if (Actor_HasParent(&this->actor, play)) { - if (PARAMS_GET(this->actor.params, 0, 8) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 8) == 1) { SET_EVENTCHKINF(EVENTCHKINF_31); Flags_SetSwitch(play, 0xB); } @@ -206,7 +206,7 @@ void ItemEtcetera_MoveFireArrowDown(ItemEtcetera* this, PlayState* play) { } void func_80B85B28(ItemEtcetera* this, PlayState* play) { - if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 5))) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->actor.params, 8, 5))) { Actor_Kill(&this->actor); } } diff --git a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c index 9a59d5507e9..a8ffa1ce350 100644 --- a/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c +++ b/src/overlays/actors/ovl_Item_Inbox/z_item_inbox.c @@ -38,7 +38,7 @@ void ItemInbox_Destroy(Actor* thisx, PlayState* play) { } void ItemInbox_Wait(ItemInbox* this, PlayState* play) { - if (Flags_GetTreasure(play, PARAMS_GET(this->actor.params, 8, 5))) { + if (Flags_GetTreasure(play, PARAMS_GET_U(this->actor.params, 8, 5))) { Actor_Kill(&this->actor); } } @@ -54,5 +54,5 @@ void ItemInbox_Draw(Actor* thisx, PlayState* play) { func_8002EBCC(&this->actor, play, 0); func_8002ED80(&this->actor, play, 0); - GetItem_Draw(play, PARAMS_GET(this->actor.params, 0, 8)); + GetItem_Draw(play, PARAMS_GET_U(this->actor.params, 0, 8)); } diff --git a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c index f9bf55b5574..cd1e10cf4c8 100644 --- a/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c +++ b/src/overlays/actors/ovl_Obj_Bean/z_obj_bean.c @@ -226,13 +226,13 @@ void ObjBean_SetDrawMode(ObjBean* this, u8 drawFlag) { } void ObjBean_SetupPathCount(ObjBean* this, PlayState* play) { - this->pathCount = play->pathList[PARAMS_GET(this->dyna.actor.params, 8, 5)].count - 1; + this->pathCount = play->pathList[PARAMS_GET_U(this->dyna.actor.params, 8, 5)].count - 1; this->currentPointIndex = 0; this->nextPointIndex = 1; } void ObjBean_SetupPath(ObjBean* this, PlayState* play) { - Path* path = &play->pathList[PARAMS_GET(this->dyna.actor.params, 8, 5)]; + Path* path = &play->pathList[PARAMS_GET_U(this->dyna.actor.params, 8, 5)]; Math_Vec3s_ToVec3f(&this->pathPoints, SEGMENTED_TO_VIRTUAL(path->points)); } @@ -250,7 +250,7 @@ void ObjBean_FollowPath(ObjBean* this, PlayState* play) { f32 mag; Math_StepToF(&this->dyna.actor.speed, sBeanSpeeds[this->unk_1F6].velocity, sBeanSpeeds[this->unk_1F6].accel); - path = &play->pathList[PARAMS_GET(this->dyna.actor.params, 8, 5)]; + path = &play->pathList[PARAMS_GET_U(this->dyna.actor.params, 8, 5)]; nextPathPoint = &((Vec3s*)SEGMENTED_TO_VIRTUAL(path->points))[this->nextPointIndex]; Math_Vec3s_ToVec3f(&pathPointsFloat, nextPathPoint); @@ -469,8 +469,8 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(&this->dyna.actor, sInitChain); if (LINK_AGE_IN_YEARS == YEARS_ADULT) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) || (mREG(1) == 1)) { - path = PARAMS_GET(this->dyna.actor.params, 8, 5); + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) || (mREG(1) == 1)) { + path = PARAMS_GET_U(this->dyna.actor.params, 8, 5); if (path == 0x1F) { PRINTF(VT_COL(RED, WHITE)); // "No path data?" @@ -504,7 +504,7 @@ void ObjBean_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->dyna.actor); return; } - } else if ((Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)) != 0) || (mREG(1) == 1)) { + } else if ((Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) != 0) || (mREG(1) == 1)) { ObjBean_SetupWaitForWater(this); } else { ObjBean_SetupWaitForBean(this); @@ -538,7 +538,7 @@ void ObjBean_WaitForBean(ObjBean* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->dyna.actor, play)) { if (func_8002F368(play) == EXCH_ITEM_MAGIC_BEAN) { func_80B8FE00(this); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } } else { Actor_OfferTalkExchangeEquiCylinder(&this->dyna.actor, play, 40.0f, EXCH_ITEM_MAGIC_BEAN); diff --git a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c index c10139073d2..68c0a843dba 100644 --- a/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c +++ b/src/overlays/actors/ovl_Obj_Blockstop/z_obj_blockstop.c @@ -50,8 +50,8 @@ void ObjBlockstop_Update(Actor* thisx, PlayState* play) { dynaPolyActor = DynaPoly_GetActor(&play->colCtx, bgId); if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_OBJ_OSHIHIKI) { - if (PARAMS_GET(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_ON || - PARAMS_GET(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_OFF) { + if (PARAMS_GET_U(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_ON || + PARAMS_GET_U(dynaPolyActor->actor.params, 0, 4) == PUSHBLOCK_HUGE_START_OFF) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } else { Sfx_PlaySfxCentered(NA_SE_SY_TRE_BOX_APPEAR); diff --git a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c index 12fcf101b67..5fbc0d50c9f 100644 --- a/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c +++ b/src/overlays/actors/ovl_Obj_Bombiwa/z_obj_bombiwa.c @@ -74,7 +74,7 @@ void ObjBombiwa_InitCollision(Actor* thisx, PlayState* play) { void ObjBombiwa_Init(Actor* thisx, PlayState* play) { Actor_ProcessInitChain(thisx, sInitChain); ObjBombiwa_InitCollision(thisx, play); - if ((Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6)) != 0)) { + if ((Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6)) != 0)) { Actor_Kill(thisx); } else { CollisionCheck_SetInfo(&thisx->colChkInfo, NULL, &sColChkInfoInit); @@ -127,9 +127,9 @@ void ObjBombiwa_Update(Actor* thisx, PlayState* play) { if ((func_80033684(play, &this->actor) != NULL) || ((this->collider.base.acFlags & AC_HIT) && (this->collider.elem.acHitElem->toucher.dmgFlags & DMG_HAMMER))) { ObjBombiwa_Break(this, play); - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 80, NA_SE_EV_WALL_BROKEN); - if (PARAMS_GET(this->actor.params, 15, 1) != 0) { + if (PARAMS_GET_U(this->actor.params, 15, 1) != 0) { Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME); } Actor_Kill(&this->actor); diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c index 035734d2e00..bc7befcc4c5 100644 --- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c +++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c @@ -128,14 +128,14 @@ void ObjComb_Break(ObjComb* this, PlayState* play) { } void ObjComb_ChooseItemDrop(ObjComb* this, PlayState* play) { - s16 params = PARAMS_GET(this->actor.params, 0, 5); + s16 params = PARAMS_GET_U(this->actor.params, 0, 5); if ((params > 0) || (params < ITEM00_MAX)) { // conditional always true. May have been intended to be && if (params == ITEM00_HEART_PIECE) { - if (Flags_GetCollectible(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (Flags_GetCollectible(play, PARAMS_GET_U(this->actor.params, 8, 6))) { params = -1; } else { - params = (params | (PARAMS_GET(this->actor.params, 8, 6) << 8)); + params = (params | (PARAMS_GET_U(this->actor.params, 8, 6) << 8)); } } else if (Rand_ZeroOne() < 0.5f) { params = -1; diff --git a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c index 39eecdce3da..fc8f675bab3 100644 --- a/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c +++ b/src/overlays/actors/ovl_Obj_Elevator/z_obj_elevator.c @@ -63,9 +63,9 @@ void ObjElevator_Init(Actor* thisx, PlayState* play) { f32 temp_f0; func_80B92B08(this, play, &object_d_elevator_Col_000360, DYNA_TRANSFORM_POS); - Actor_SetScale(thisx, sScales[PARAMS_GET(thisx->params, 0, 1)]); + Actor_SetScale(thisx, sScales[PARAMS_GET_U(thisx->params, 0, 1)]); Actor_ProcessInitChain(thisx, sInitChain); - temp_f0 = PARAMS_GET(thisx->params, 8, 4); + temp_f0 = PARAMS_GET_U(thisx->params, 8, 4); this->unk_16C = temp_f0 + temp_f0; func_80B92C5C(this); PRINTF("(Dungeon Elevator)(arg_data 0x%04x)\n", thisx->params); @@ -88,7 +88,7 @@ void func_80B92C80(ObjElevator* this, PlayState* play) { if ((this->dyna.interactFlags & DYNA_INTERACT_PLAYER_ON_TOP) && !(this->unk_170 & DYNA_INTERACT_PLAYER_ON_TOP)) { sub = thisx->world.pos.y - thisx->home.pos.y; if (fabsf(sub) < 0.1f) { - this->unk_168 = thisx->home.pos.y + (PARAMS_GET(thisx->params, 12, 4)) * 80.0f; + this->unk_168 = thisx->home.pos.y + (PARAMS_GET_U(thisx->params, 12, 4)) * 80.0f; } else { this->unk_168 = thisx->home.pos.y; } diff --git a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c index 55df8e07426..ae78511a94d 100644 --- a/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c +++ b/src/overlays/actors/ovl_Obj_Hamishi/z_obj_hamishi.c @@ -149,7 +149,7 @@ void ObjHamishi_Init(Actor* thisx, PlayState* play) { ObjHamishi_InitCollision(&this->actor, play); CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { Actor_Kill(&this->actor); return; } @@ -180,7 +180,7 @@ void ObjHamishi_Update(Actor* thisx, PlayState* play) { } else { ObjHamishi_Break(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EV_WALL_BROKEN); - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); Actor_Kill(&this->actor); } } else { diff --git a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c index 8a82fd58091..5f56eeead9f 100644 --- a/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c +++ b/src/overlays/actors/ovl_Obj_Hana/z_obj_hana.c @@ -71,7 +71,7 @@ static InitChainEntry sInitChain[] = { void ObjHana_Init(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - s16 type = PARAMS_GET(this->actor.params, 0, 2); + s16 type = PARAMS_GET_U(this->actor.params, 0, 2); HanaParams* params = &sHanaParams[type]; Actor_ProcessInitChain(&this->actor, sInitChain); @@ -94,7 +94,7 @@ void ObjHana_Init(Actor* thisx, PlayState* play) { void ObjHana_Destroy(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[PARAMS_GET(this->actor.params, 0, 2)].radius >= 0) { + if (sHanaParams[PARAMS_GET_U(this->actor.params, 0, 2)].radius >= 0) { Collider_DestroyCylinder(play, &this->collider); } } @@ -102,11 +102,11 @@ void ObjHana_Destroy(Actor* thisx, PlayState* play) { void ObjHana_Update(Actor* thisx, PlayState* play) { ObjHana* this = (ObjHana*)thisx; - if (sHanaParams[PARAMS_GET(this->actor.params, 0, 2)].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { + if (sHanaParams[PARAMS_GET_U(this->actor.params, 0, 2)].radius >= 0 && this->actor.xzDistToPlayer < 400.0f) { CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base); } } void ObjHana_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, sHanaParams[PARAMS_GET(thisx->params, 0, 2)].dList); + Gfx_DrawDListOpa(play, sHanaParams[PARAMS_GET_U(thisx->params, 0, 2)].dList); } diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index fee1617a065..6b538fb243b 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -67,7 +67,7 @@ void func_80B93B68(ObjHsblock* this, PlayState* play, CollisionHeader* collision } void func_80B93BF0(ObjHsblock* this, PlayState* play) { - if (PARAMS_GET(this->dyna.actor.params, 5, 1)) { + if (PARAMS_GET_U(this->dyna.actor.params, 5, 1)) { Actor_SpawnAsChild(&play->actorCtx, &this->dyna.actor, play, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); @@ -77,17 +77,17 @@ void func_80B93BF0(ObjHsblock* this, PlayState* play) { void ObjHsblock_Init(Actor* thisx, PlayState* play) { ObjHsblock* this = (ObjHsblock*)thisx; - func_80B93B68(this, play, sCollisionHeaders[PARAMS_GET(thisx->params, 0, 2)], 0); + func_80B93B68(this, play, sCollisionHeaders[PARAMS_GET_U(thisx->params, 0, 2)], 0); Actor_ProcessInitChain(thisx, sInitChain); func_80B93BF0(this, play); - switch (PARAMS_GET(thisx->params, 0, 2)) { + switch (PARAMS_GET_U(thisx->params, 0, 2)) { case 0: case 2: func_80B93D90(this); break; case 1: - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { func_80B93D90(this); } else { func_80B93DB0(this); @@ -116,7 +116,7 @@ void func_80B93DB0(ObjHsblock* this) { } void func_80B93DF4(ObjHsblock* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { func_80B93E38(this); } } @@ -141,7 +141,7 @@ void ObjHsblock_Update(Actor* thisx, PlayState* play) { if (this->actionFunc != NULL) { this->actionFunc(this, play); } - Actor_SetFocus(thisx, D_80B940C0[PARAMS_GET(thisx->params, 0, 2)]); + Actor_SetFocus(thisx, D_80B940C0[PARAMS_GET_U(thisx->params, 0, 2)]); } void ObjHsblock_Draw(Actor* thisx, PlayState* play) { @@ -165,7 +165,7 @@ void ObjHsblock_Draw(Actor* thisx, PlayState* play) { } gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 255); - gSPDisplayList(POLY_OPA_DISP++, sDLists[PARAMS_GET(thisx->params, 0, 2)]); + gSPDisplayList(POLY_OPA_DISP++, sDLists[PARAMS_GET_U(thisx->params, 0, 2)]); CLOSE_DISPS(play->state.gfxCtx, "../z_obj_hsblock.c", 399); } diff --git a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c index 0f08958b3c2..daf67b3d261 100644 --- a/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c +++ b/src/overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.c @@ -77,7 +77,7 @@ static Color_RGBA8 sColorGray = { 180, 180, 180, 255 }; void ObjIcePoly_Init(Actor* thisx, PlayState* play) { ObjIcePoly* this = (ObjIcePoly*)thisx; - this->unk_151 = PARAMS_GET(thisx->params, 8, 8); + this->unk_151 = PARAMS_GET_U(thisx->params, 8, 8); thisx->params &= 0xFF; if (thisx->params < 0 || thisx->params >= 3) { Actor_Kill(thisx); diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 243961a91db..a14ff80df3c 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -66,9 +66,9 @@ static InitChainEntry sInitChain[] = { void ObjKibako_SpawnCollectible(ObjKibako* this, PlayState* play) { s16 collectible; - collectible = PARAMS_GET(this->actor.params, 0, 5); + collectible = PARAMS_GET_U(this->actor.params, 0, 5); if ((collectible >= 0) && (collectible < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, collectible | (PARAMS_GET(this->actor.params, 8, 6) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, collectible | (PARAMS_GET_U(this->actor.params, 8, 6) << 8)); } } diff --git a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c index ee514dfe959..6a739b32234 100644 --- a/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c +++ b/src/overlays/actors/ovl_Obj_Lift/z_obj_lift.c @@ -97,9 +97,9 @@ void ObjLift_SpawnFragments(ObjLift* this, PlayState* play) { OBJECT_D_LIFT, gCollapsingPlatformDL); } - if (PARAMS_GET(this->dyna.actor.params, 1, 1) == 0) { + if (PARAMS_GET_U(this->dyna.actor.params, 1, 1) == 0) { func_80033480(play, &this->dyna.actor.world.pos, 120.0f, 12, 120, 100, 1); - } else if (PARAMS_GET(this->dyna.actor.params, 1, 1) == 1) { + } else if (PARAMS_GET_U(this->dyna.actor.params, 1, 1) == 1) { func_80033480(play, &this->dyna.actor.world.pos, 60.0f, 8, 60, 100, 1); } } @@ -109,12 +109,12 @@ void ObjLift_Init(Actor* thisx, PlayState* play) { ObjLift_InitDynaPoly(this, play, &gCollapsingPlatformCol, DYNA_TRANSFORM_POS); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 2, 6))) { Actor_Kill(&this->dyna.actor); return; } - Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET(this->dyna.actor.params, 1, 1)]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET_U(this->dyna.actor.params, 1, 1)]); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); this->shakeOrientation.x = Rand_ZeroOne() * 65535.5f; this->shakeOrientation.y = Rand_ZeroOne() * 65535.5f; @@ -130,7 +130,7 @@ void ObjLift_Destroy(Actor* thisx, PlayState* play) { } void ObjLift_SetupWait(ObjLift* this) { - this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 3)]; + this->timer = sFallTimerDurations[PARAMS_GET_U(this->dyna.actor.params, 8, 3)]; ObjLift_SetupAction(this, ObjLift_Wait); } @@ -140,7 +140,7 @@ void ObjLift_Wait(ObjLift* this, PlayState* play) { if (DynaPolyActor_IsPlayerOnTop(&this->dyna)) { if (this->timer <= 0) { - if (PARAMS_GET(this->dyna.actor.params, 8, 3) == 7) { + if (PARAMS_GET_U(this->dyna.actor.params, 8, 3) == 7) { ObjLift_SetupFall(this); } else { quakeIndex = Quake_Request(GET_ACTIVE_CAM(play), QUAKE_TYPE_1); @@ -151,7 +151,7 @@ void ObjLift_Wait(ObjLift* this, PlayState* play) { } } } else { - this->timer = sFallTimerDurations[PARAMS_GET(this->dyna.actor.params, 8, 3)]; + this->timer = sFallTimerDurations[PARAMS_GET_U(this->dyna.actor.params, 8, 3)]; } } @@ -196,15 +196,15 @@ void ObjLift_Fall(ObjLift* this, PlayState* play) { Actor_MoveXZGravity(&this->dyna.actor); Math_Vec3f_Copy(&pos, &this->dyna.actor.prevPos); - pos.y += sMaxFallDistances[PARAMS_GET(this->dyna.actor.params, 1, 1)]; + pos.y += sMaxFallDistances[PARAMS_GET_U(this->dyna.actor.params, 1, 1)]; this->dyna.actor.floorHeight = BgCheck_EntityRaycastDown4(&play->colCtx, &this->dyna.actor.floorPoly, &bgId, &this->dyna.actor, &pos); if ((this->dyna.actor.floorHeight - this->dyna.actor.world.pos.y) >= - (sMaxFallDistances[PARAMS_GET(this->dyna.actor.params, 1, 1)] - 0.001f)) { + (sMaxFallDistances[PARAMS_GET_U(this->dyna.actor.params, 1, 1)] - 0.001f)) { ObjLift_SpawnFragments(this, play); SfxSource_PlaySfxAtFixedWorldPos(play, &this->dyna.actor.world.pos, 20, NA_SE_EV_BOX_BREAK); - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 2, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 2, 6)); Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 425885767c0..d5f69c2b47e 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -104,10 +104,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { Actor* thisx = &this->actor; // required s32 type; - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { - type = PARAMS_GET(this->actor.params, 4, 2); + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { + type = PARAMS_GET_U(this->actor.params, 4, 2); - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); if (type == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, thisx, NA_SE_SY_TRE_BOX_APPEAR); @@ -120,10 +120,10 @@ void ObjLightswitch_SetSwitchFlag(ObjLightswitch* this, PlayState* play) { } void ObjLightswitch_ClearSwitchFlag(ObjLightswitch* this, PlayState* play) { - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { - Flags_UnsetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { + Flags_UnsetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); - if (PARAMS_GET(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_1) { + if (PARAMS_GET_U(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_1) { OnePointCutscene_AttentionSetSfx(play, &this->actor, NA_SE_SY_TRE_BOX_APPEAR); } } @@ -161,13 +161,13 @@ void ObjLightswitch_SpawnDisappearEffects(ObjLightswitch* this, PlayState* play) void ObjLightswitch_Init(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; - s32 switchFlagSet = Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6)); + s32 switchFlagSet = Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6)); s32 removeSelf = false; Actor_ProcessInitChain(&this->actor, sInitChain); Actor_SetFocus(&this->actor, 0.0f); if (switchFlagSet) { - if (PARAMS_GET(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN) { + if (PARAMS_GET_U(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN) { removeSelf = true; } else { ObjLightswitch_SetupOn(this); @@ -175,7 +175,7 @@ void ObjLightswitch_Init(Actor* thisx, PlayState* play) { } else { ObjLightswitch_SetupOff(this); } - if (PARAMS_GET(this->actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { if (switchFlagSet) { Math_Vec3f_Copy(&this->actor.world.pos, &D_80B97F68); Math_Vec3f_Copy(&this->actor.home.pos, &D_80B97F68); @@ -221,7 +221,7 @@ void ObjLightswitch_SetupOff(ObjLightswitch* this) { } void ObjLightswitch_Off(ObjLightswitch* this, PlayState* play) { - switch (PARAMS_GET(this->actor.params, 4, 2)) { + switch (PARAMS_GET_U(this->actor.params, 4, 2)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: case OBJLIGHTSWITCH_TYPE_2: if (this->collider.base.acFlags & AC_HIT) { @@ -288,9 +288,9 @@ void ObjLightswitch_SetupOn(ObjLightswitch* this) { } void ObjLightswitch_On(ObjLightswitch* this, PlayState* play) { - switch (PARAMS_GET(this->actor.params, 4, 2)) { + switch (PARAMS_GET_U(this->actor.params, 4, 2)) { case OBJLIGHTSWITCH_TYPE_STAY_ON: - if (!Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 8, 6))) { + if (!Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 8, 6))) { ObjLightswitch_SetupTurnOff(this); } break; @@ -324,7 +324,7 @@ void ObjLightswitch_SetupTurnOff(ObjLightswitch* this) { } void ObjLightswitch_TurnOff(ObjLightswitch* this, PlayState* play) { - if (PARAMS_GET(this->actor.params, 4, 2) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || + if (PARAMS_GET_U(this->actor.params, 4, 2) != OBJLIGHTSWITCH_TYPE_1 || func_8005B198() == this->actor.category || this->toggleDelay <= 0) { this->timer--; @@ -378,7 +378,7 @@ void ObjLightswitch_Update(Actor* thisx, PlayState* play2) { this->actionFunc(this, play); if (this->actor.update != NULL) { - if (PARAMS_GET(this->actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { this->actor.world.pos.x = this->actor.child->world.pos.x; this->actor.world.pos.y = this->actor.child->world.pos.y + 60.0f; this->actor.world.pos.z = this->actor.child->world.pos.z; @@ -404,7 +404,7 @@ void ObjLightswitch_DrawOpa(ObjLightswitch* this, PlayState* play) { (u8)(this->alpha >> 6)); gSPSegment(POLY_OPA_DISP++, 0x09, &D_80116280[2]); - if (PARAMS_GET(this->actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { child = this->actor.child; this->actor.world.pos.x = child->world.pos.x; this->actor.world.pos.y = child->world.pos.y + 60.0f; @@ -487,11 +487,11 @@ void ObjLightswitch_Draw(Actor* thisx, PlayState* play) { ObjLightswitch* this = (ObjLightswitch*)thisx; s32 alpha = this->alpha >> 6 & 0xFF; - if (PARAMS_GET(this->actor.params, 0, 1) == 1) { + if (PARAMS_GET_U(this->actor.params, 0, 1) == 1) { Collider_UpdateSpheres(0, &this->collider); } - if (PARAMS_GET(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { + if (PARAMS_GET_U(this->actor.params, 4, 2) == OBJLIGHTSWITCH_TYPE_BURN && (alpha > 0 || alpha < 255)) { ObjLightswitch_DrawXlu(this, play); } else { ObjLightswitch_DrawOpa(this, play); diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index a22bad06ef6..afa7be6f6a4 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -59,9 +59,9 @@ void ObjMakeoshihiki_Init(Actor* thisx, PlayState* play) { s32 typeIdx; Vec3f* spawnPos; - if (!PARAMS_GET(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { + if (!PARAMS_GET_U(thisx->params, 6, 1) && Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { typeIdx = 1; - } else if (!PARAMS_GET(thisx->params, 14, 1) && Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { + } else if (!PARAMS_GET_U(thisx->params, 14, 1) && Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { typeIdx = 2; } else { typeIdx = 0; @@ -96,10 +96,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { for (i = 0; i < 3; i++) { if (Math3D_Vec3fDistSq(&thisx->child->world.pos, &block->posVecs[i]) < 0.001f) { if (block->unk_24[i] & 1) { - if (PARAMS_GET(thisx->params, 6, 1)) { + if (PARAMS_GET_U(thisx->params, 6, 1)) { sfxCond1 = false; } else { - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 0, 6))) { cond = true; } else { cond = false; @@ -107,10 +107,10 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { sfxCond1 = sFlags[i][0] ^ cond; } - if (PARAMS_GET(thisx->params, 14, 1)) { + if (PARAMS_GET_U(thisx->params, 14, 1)) { sfxCond2 = false; } else { - if (Flags_GetSwitch(play, PARAMS_GET(thisx->params, 8, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(thisx->params, 8, 6))) { cond2 = true; } else { cond2 = false; @@ -123,8 +123,8 @@ void ObjMakeoshihiki_Draw(Actor* thisx, PlayState* play) { } } - sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET(thisx->params, 0, 6)); - sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET(thisx->params, 8, 6)); + sFlagSwitchFuncs[sFlags[i][0]](play, PARAMS_GET_U(thisx->params, 0, 6)); + sFlagSwitchFuncs[sFlags[i][1]](play, PARAMS_GET_U(thisx->params, 8, 6)); if (block->unk_24[i] & 2) { ((ObjOshihiki*)thisx->child)->cantMove = true; diff --git a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c index ffc691fa298..e3990943aa4 100644 --- a/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c +++ b/src/overlays/actors/ovl_Obj_Mure/z_obj_mure.c @@ -89,10 +89,10 @@ s32 ObjMure_SetCulling(Actor* thisx, PlayState* play) { void ObjMure_Init(Actor* thisx, PlayState* play) { ObjMure* this = (ObjMure*)thisx; - this->chNum = PARAMS_GET(thisx->params, 12, 4); - this->ptn = PARAMS_GET(thisx->params, 8, 3); - this->svNum = PARAMS_GET(thisx->params, 5, 2); - this->type = PARAMS_GET(thisx->params, 0, 5); + this->chNum = PARAMS_GET_U(thisx->params, 12, 4); + this->ptn = PARAMS_GET_U(thisx->params, 8, 3); + this->svNum = PARAMS_GET_U(thisx->params, 5, 2); + this->type = PARAMS_GET_U(thisx->params, 0, 5); if (this->ptn >= 4) { PRINTF("Error 群れな敵 (%s %d)(arg_data 0x%04x)\n", "../z_obj_mure.c", 237, thisx->params); diff --git a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c index 798005c1d09..043f6a8a343 100644 --- a/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c +++ b/src/overlays/actors/ovl_Obj_Mure2/z_obj_mure2.c @@ -52,7 +52,7 @@ void ObjMure2_SetPosShrubCircle(Vec3f* vec, ObjMure2* this) { s32 i; Math_Vec3f_Copy(vec, &this->actor.world.pos); - for (i = 1; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { + for (i = 1; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS((i - 1) * 0x2000)); (vec + i)->z += (80.0f * Math_CosS((i - 1) * 0x2000)); @@ -67,7 +67,7 @@ static Mure2sScatteredShrubInfo sScatteredShrubInfo[] = { void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (sScatteredShrubInfo[i].radius * Math_CosS(sScatteredShrubInfo[i].angle)); (vec + i)->z -= (sScatteredShrubInfo[i].radius * Math_SinS(sScatteredShrubInfo[i].angle)); @@ -77,7 +77,7 @@ void ObjMure2_SetPosShrubScattered(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { Math_Vec3f_Copy(vec + i, &this->actor.world.pos); (vec + i)->x += (80.0f * Math_SinS(i * 0x2000)); (vec + i)->z += (80.0f * Math_CosS(i * 0x2000)); @@ -86,12 +86,12 @@ void ObjMure2_SetPosRockCircle(Vec3f* vec, ObjMure2* this) { void ObjMure2_SetActorSpawnParams(s16* params, ObjMure2* this) { static s16 actorSpawnParams[] = { 0, 0, 0 }; - s16 dropTable = PARAMS_GET(this->actor.params, 8, 4); + s16 dropTable = PARAMS_GET_U(this->actor.params, 8, 4); if (dropTable >= 13) { dropTable = 0; } - *params = actorSpawnParams[PARAMS_GET(this->actor.params, 0, 2)] & 0xF0FF; + *params = actorSpawnParams[PARAMS_GET_U(this->actor.params, 0, 2)] & 0xF0FF; *params |= (dropTable << 8); } @@ -101,7 +101,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { ObjMure2_SetPosShrubScattered, ObjMure2_SetPosRockCircle, }; - s32 actorNum = PARAMS_GET(this->actor.params, 0, 2); + s32 actorNum = PARAMS_GET_U(this->actor.params, 0, 2); s32 i; Vec3f spawnPos[12]; s16 params; @@ -130,7 +130,7 @@ void ObjMure2_SpawnActors(ObjMure2* this, PlayState* play) { void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { if (((this->currentActorNum >> i) & 1) == 0) { if (this->actorSpawnPtrList[i] != NULL) { if (Actor_HasParent(this->actorSpawnPtrList[i], play)) { @@ -149,7 +149,7 @@ void ObjMure2_CleanupAndDie(ObjMure2* this, PlayState* play) { void func_80B9A534(ObjMure2* this) { s32 i; - for (i = 0; i < D_80B9A818[PARAMS_GET(this->actor.params, 0, 2)]; i++) { + for (i = 0; i < D_80B9A818[PARAMS_GET_U(this->actor.params, 0, 2)]; i++) { if (this->actorSpawnPtrList[i] != NULL && (((this->currentActorNum >> i) & 1) == 0) && (this->actorSpawnPtrList[i]->update == NULL)) { this->currentActorNum |= (1 << i); @@ -188,7 +188,7 @@ void func_80B9A658(ObjMure2* this) { void func_80B9A668(ObjMure2* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < - (sDistSquared1[PARAMS_GET(this->actor.params, 0, 2)] * this->unk_184)) { + (sDistSquared1[PARAMS_GET_U(this->actor.params, 0, 2)] * this->unk_184)) { this->actor.flags |= ACTOR_FLAG_4; ObjMure2_SpawnActors(this, play); func_80B9A6E8(this); @@ -201,7 +201,7 @@ void func_80B9A6E8(ObjMure2* this) { void func_80B9A6F8(ObjMure2* this, PlayState* play) { func_80B9A534(this); - if ((sDistSquared2[PARAMS_GET(this->actor.params, 0, 2)] * this->unk_184) <= + if ((sDistSquared2[PARAMS_GET_U(this->actor.params, 0, 2)] * this->unk_184) <= Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z)) { this->actor.flags &= ~ACTOR_FLAG_4; ObjMure2_CleanupAndDie(this, play); diff --git a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c index 260702f6da8..b89f4357a82 100644 --- a/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c +++ b/src/overlays/actors/ovl_Obj_Mure3/z_obj_mure3.c @@ -104,7 +104,7 @@ void func_80B9ABA0(ObjMure3* this, PlayState* play) { } void func_80B9ACE4(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 3)]; + s16 count = sRupeeCounts[PARAMS_GET_U(this->actor.params, 13, 3)]; s32 i; for (i = 0; i < count; i++) { @@ -122,7 +122,7 @@ void func_80B9ACE4(ObjMure3* this, PlayState* play) { } void func_80B9ADCC(ObjMure3* this, PlayState* play) { - s16 count = sRupeeCounts[PARAMS_GET(this->actor.params, 13, 3)]; + s16 count = sRupeeCounts[PARAMS_GET_U(this->actor.params, 13, 3)]; s32 i; for (i = 0; i < count; i++) { @@ -130,7 +130,7 @@ void func_80B9ADCC(ObjMure3* this, PlayState* play) { if ((*collectible != NULL) && !((this->unk_16C >> i) & 1)) { if (Actor_HasParent(&(*collectible)->actor, play)) { - Flags_SetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)); } if ((*collectible)->actor.update == NULL) { this->unk_16C |= (1 << i); @@ -144,7 +144,7 @@ void ObjMure3_Init(Actor* thisx, PlayState* play) { s32 pad; ObjMure3* this = (ObjMure3*)thisx; - if (Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6))) { Actor_Kill(&this->actor); return; } @@ -172,7 +172,7 @@ void func_80B9AF64(ObjMure3* this, PlayState* play) { if (Math3D_Dist1DSq(this->actor.projectedPos.x, this->actor.projectedPos.z) < SQ(1150.0f)) { this->actor.flags |= ACTOR_FLAG_4; - spawnFuncs[PARAMS_GET(this->actor.params, 13, 3)](this, play); + spawnFuncs[PARAMS_GET_U(this->actor.params, 13, 3)](this, play); func_80B9AFEC(this); } } diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index d54c5b77719..f87ad6880b2 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -113,7 +113,7 @@ s32 ObjOshihiki_StrongEnough(ObjOshihiki* this) { return 0; } strength = Player_GetStrength(); - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -180,16 +180,16 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* if (dyna == NULL) { return 1; } else if (dyna->actor.id == ACTOR_OBJ_SWITCH) { - dynaSwitchFlag = PARAMS_GET(dyna->actor.params, 8, 6); + dynaSwitchFlag = PARAMS_GET_U(dyna->actor.params, 8, 6); switch (dyna->actor.params & 0x33) { // Does not fit any standard params getter macro case 0x20: // Normal blue switch - if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 6)) && + if ((dynaSwitchFlag == PARAMS_GET_U(this->dyna.actor.params, 8, 6)) && Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } break; case 0x30: // Inverse blue switch - if ((dynaSwitchFlag == PARAMS_GET(this->dyna.actor.params, 8, 6)) && + if ((dynaSwitchFlag == PARAMS_GET_U(this->dyna.actor.params, 8, 6)) && !Flags_GetSwitch(play, dynaSwitchFlag)) { return 0; } @@ -200,7 +200,7 @@ s32 ObjOshihiki_NoSwitchPress(ObjOshihiki* this, DynaPolyActor* dyna, PlayState* } void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -220,11 +220,11 @@ void ObjOshihiki_CheckType(ObjOshihiki* this, PlayState* play) { } void ObjOshihiki_SetScale(ObjOshihiki* this, PlayState* play) { - Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET(this->dyna.actor.params, 0, 4)]); + Actor_SetScale(&this->dyna.actor, sScales[PARAMS_GET_U(this->dyna.actor.params, 0, 4)]); } void ObjOshihiki_SetTexture(ObjOshihiki* this, PlayState* play) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: @@ -248,7 +248,7 @@ void ObjOshihiki_SetColor(ObjOshihiki* this, PlayState* play) { s16 paramsColorIdx; s32 i; - paramsColorIdx = PARAMS_GET(this->dyna.actor.params, 6, 2); + paramsColorIdx = PARAMS_GET_U(this->dyna.actor.params, 6, 2); for (i = 0; i < ARRAY_COUNT(sSceneIds); i++) { if (sSceneIds[i] == play->sceneId) { @@ -274,9 +274,9 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { ObjOshihiki_CheckType(this, play); - if ((PARAMS_GET(this->dyna.actor.params, 8, 8) >= 0) && (PARAMS_GET(this->dyna.actor.params, 8, 8) <= 0x3F)) { - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 8, 6))) { - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + if ((PARAMS_GET_U(this->dyna.actor.params, 8, 8) >= 0) && (PARAMS_GET_U(this->dyna.actor.params, 8, 8) <= 0x3F)) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 8, 6))) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_ON: case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_LARGE_START_ON: @@ -285,7 +285,7 @@ void ObjOshihiki_Init(Actor* thisx, PlayState* play2) { return; } } else { - switch (PARAMS_GET(this->dyna.actor.params, 0, 4)) { + switch (PARAMS_GET_U(this->dyna.actor.params, 0, 4)) { case PUSHBLOCK_SMALL_START_OFF: case PUSHBLOCK_MEDIUM_START_OFF: case PUSHBLOCK_LARGE_START_OFF: diff --git a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c index 974aa0104c8..2b63d9be16f 100644 --- a/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c +++ b/src/overlays/actors/ovl_Obj_Roomtimer/z_obj_roomtimer.c @@ -30,8 +30,8 @@ ActorInit Obj_Roomtimer_InitVars = { void ObjRoomtimer_Init(Actor* thisx, PlayState* play) { ObjRoomtimer* this = (ObjRoomtimer*)thisx; - this->switchFlag = PARAMS_GET(this->actor.params, 10, 6); - this->actor.params = PARAMS_GET(this->actor.params, 0, 10); + this->switchFlag = PARAMS_GET_U(this->actor.params, 10, 6); + this->actor.params = PARAMS_GET_U(this->actor.params, 0, 10); if (this->actor.params != 0x3FF) { this->actor.params = CLAMP_MAX(this->actor.params, 600); diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index bdc629f792e..eb0023d5c1f 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -10,10 +10,10 @@ #define FLAGS ACTOR_FLAG_4 -#define OBJSWITCH_TYPE(thisx) PARAMS_GET((thisx)->params, 0, 3) -#define OBJSWITCH_SUBTYPE(thisx) PARAMS_GET((thisx)->params, 4, 3) -#define OBJSWITCH_SWITCH_FLAG(thisx) PARAMS_GET((thisx)->params, 8, 6) -#define OBJSWITCH_FROZEN(thisx) PARAMS_GET((thisx)->params, 7, 1) +#define OBJSWITCH_TYPE(thisx) PARAMS_GET_U((thisx)->params, 0, 3) +#define OBJSWITCH_SUBTYPE(thisx) PARAMS_GET_U((thisx)->params, 4, 3) +#define OBJSWITCH_SWITCH_FLAG(thisx) PARAMS_GET_U((thisx)->params, 8, 6) +#define OBJSWITCH_FROZEN(thisx) PARAMS_GET_U((thisx)->params, 7, 1) #define OBJSWITCH_FROZEN_FLAG (1 << 7) diff --git a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c index 2497e839fc8..6029eab0353 100644 --- a/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c +++ b/src/overlays/actors/ovl_Obj_Syokudai/z_obj_syokudai.c @@ -100,7 +100,7 @@ void ObjSyokudai_Init(Actor* thisx, PlayState* play) { this->lightNode = LightContext_InsertLight(play, &play->lightCtx, &this->lightInfo); if (PARAMS_GET_NOSHIFT(this->actor.params, 10, 1) || - ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET(this->actor.params, 0, 6)))) { + ((torchType != 2) && Flags_GetSwitch(play, PARAMS_GET_U(this->actor.params, 0, 6)))) { this->litTimer = -1; } @@ -121,8 +121,8 @@ void ObjSyokudai_Destroy(Actor* thisx, PlayState* play) { void ObjSyokudai_Update(Actor* thisx, PlayState* play2) { PlayState* play = play2; ObjSyokudai* this = (ObjSyokudai*)thisx; - s32 torchCount = PARAMS_GET(this->actor.params, 6, 4); - s32 switchFlag = PARAMS_GET(this->actor.params, 0, 6); + s32 torchCount = PARAMS_GET_U(this->actor.params, 6, 4); + s32 switchFlag = PARAMS_GET_U(this->actor.params, 0, 6); s32 torchType = PARAMS_GET_NOSHIFT(this->actor.params, 12, 4); s32 litTimeScale; WaterBox* dummy; @@ -264,7 +264,7 @@ void ObjSyokudai_Draw(Actor* thisx, PlayState* play) { ObjSyokudai* this = (ObjSyokudai*)thisx; s32 timerMax; - timerMax = PARAMS_GET(this->actor.params, 6, 4) * 50 + 100; + timerMax = PARAMS_GET_U(this->actor.params, 6, 4) * 50 + 100; OPEN_DISPS(play->state.gfxCtx, "../z_obj_syokudai.c", 707); Gfx_SetupDL_25Opa(play->state.gfxCtx); diff --git a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c index a47a875064b..4d2ed7cb548 100644 --- a/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c +++ b/src/overlays/actors/ovl_Obj_Timeblock/z_obj_timeblock.c @@ -63,11 +63,11 @@ static Color_RGB8 sPrimColors[] = { }; u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { - if (!PARAMS_GET(this->dyna.actor.params, 10, 1)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 10, 1)) { if (this->unk_177 == 0) { return this->unk_175; } else { - u8 temp = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; + u8 temp = PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false; if (this->unk_177 == 1) { return this->unk_174 ^ temp; @@ -78,14 +78,14 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) { } } } else { - return (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false) ^ this->unk_174; + return (PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false) ^ this->unk_174; } } void ObjTimeblock_SpawnDemoEffect(ObjTimeblock* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, 0, 0, - sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].demoEffectParams); + sSizeOptions[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].demoEffectParams); } void ObjTimeblock_ToggleSwitchFlag(PlayState* play, s32 flag) { @@ -109,23 +109,23 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetScale(&this->dyna.actor, sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].scale); + Actor_SetScale(&this->dyna.actor, sSizeOptions[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].scale); - if (PARAMS_GET(this->dyna.actor.params, 6, 1)) { + if (PARAMS_GET_U(this->dyna.actor.params, 6, 1)) { this->unk_177 = 0; } else { - this->unk_177 = (PARAMS_GET(this->dyna.actor.params, 0, 6) < 0x38) ? 2 : 1; + this->unk_177 = (PARAMS_GET_U(this->dyna.actor.params, 0, 6) < 0x38) ? 2 : 1; } this->songObserverFunc = ObjTimeblock_WaitForOcarina; - Actor_SetFocus(&this->dyna.actor, sSizeOptions[PARAMS_GET(this->dyna.actor.params, 8, 1)].height); + Actor_SetFocus(&this->dyna.actor, sSizeOptions[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].height); - this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) ? true : false; - this->unk_175 = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) ? true : false; + this->unk_175 = PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false; this->isVisible = ObjTimeblock_CalculateIsVisible(this); - if (!PARAMS_GET(this->dyna.actor.params, 10, 1)) { + if (!PARAMS_GET_U(this->dyna.actor.params, 10, 1)) { ObjTimeblock_SetupNormal(this); } else if (this->isVisible) { ObjTimeblock_SetupAltBehaviorVisible(this); @@ -135,8 +135,8 @@ void ObjTimeblock_Init(Actor* thisx, PlayState* play) { // "Block of time" PRINTF("時のブロック ( %04xH save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params, - this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET(this->dyna.actor.params, 11, 3), - PARAMS_GET(this->dyna.actor.params, 10, 1)); + this->unk_177, this->dyna.actor.home.rot.z & 7, PARAMS_GET_U(this->dyna.actor.params, 11, 3), + PARAMS_GET_U(this->dyna.actor.params, 10, 1)); } void ObjTimeblock_Destroy(Actor* thisx, PlayState* play) { @@ -151,7 +151,7 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, PlayState* play) { return false; } - if (this->dyna.actor.xzDistToPlayer <= sRanges[PARAMS_GET(this->dyna.actor.params, 11, 3)]) { + if (this->dyna.actor.xzDistToPlayer <= sRanges[PARAMS_GET_U(this->dyna.actor.params, 11, 3)]) { Vec3f distance; f32 blockSize; @@ -225,7 +225,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { if (this->unk_177 == 0) { this->dyna.actor.params ^= 0x8000; } else { - ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } } @@ -234,9 +234,9 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { this->demoEffectFirstPartTimer--; if (this->demoEffectFirstPartTimer == 0) { if (this->unk_177 == 0) { - this->unk_175 = PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false; + this->unk_175 = PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false; } else { - this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) ? true : false; + this->unk_174 = (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) ? true : false; } } } @@ -253,7 +253,7 @@ void ObjTimeblock_Normal(ObjTimeblock* this, PlayState* play) { } void func_80BA06AC(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); + s32 switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); this->unk_172 = play->msgCtx.lastPlayedSong; @@ -277,7 +277,7 @@ void ObjTimeblock_AltBehaviorVisible(ObjTimeblock* this, PlayState* play) { OnePointCutscene_Attention(play, &this->dyna.actor); // "Time Block Attention Camera (frame counter)" PRINTF("◯◯◯◯ Time Block 注目カメラ (frame counter %d)\n", play->state.frames); - ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + ObjTimeblock_ToggleSwitchFlag(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } func_80BA06AC(this, play); @@ -296,11 +296,11 @@ void ObjTimeblock_SetupAltBehaviourNotVisible(ObjTimeblock* this) { } void ObjTimeblock_AltBehaviourNotVisible(ObjTimeblock* this, PlayState* play) { - s32 switchFlag = PARAMS_GET(this->dyna.actor.params, 0, 6); + s32 switchFlag = PARAMS_GET_U(this->dyna.actor.params, 0, 6); s8 switchFlagIsSet = (Flags_GetSwitch(play, switchFlag)) ? true : false; if (this->unk_176 ^ switchFlagIsSet && - switchFlagIsSet ^ (PARAMS_GET(this->dyna.actor.params, 15, 1) ? true : false)) { + switchFlagIsSet ^ (PARAMS_GET_U(this->dyna.actor.params, 15, 1) ? true : false)) { if (this->demoEffectTimer <= 0) { ObjTimeblock_SpawnDemoEffect(this, play); this->demoEffectTimer = 160; diff --git a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c index 7760ca7c287..5ae0973268c 100644 --- a/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c +++ b/src/overlays/actors/ovl_Obj_Tsubo/z_obj_tsubo.c @@ -83,10 +83,10 @@ static InitChainEntry sInitChain[] = { }; void ObjTsubo_SpawnCollectible(ObjTsubo* this, PlayState* play) { - s16 dropParams = PARAMS_GET(this->actor.params, 0, 5); + s16 dropParams = PARAMS_GET_U(this->actor.params, 0, 5); if ((dropParams >= 0) && (dropParams < ITEM00_MAX)) { - Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET(this->actor.params, 9, 6) << 8)); + Item_DropCollectible(play, &this->actor.world.pos, dropParams | (PARAMS_GET_U(this->actor.params, 9, 6) << 8)); } } @@ -135,7 +135,7 @@ void ObjTsubo_Init(Actor* thisx, PlayState* play) { Actor_Kill(&this->actor); return; } - this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET(this->actor.params, 8, 1)]); + this->requiredObjectSlot = Object_GetSlot(&play->objectCtx, sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)]); if (this->requiredObjectSlot < 0) { PRINTF("Error : バンク危険! (arg_data 0x%04x)(%s %d)\n", this->actor.params, "../z_obj_tsubo.c", 410); Actor_Kill(&this->actor); @@ -183,8 +183,8 @@ void ObjTsubo_AirBreak(ObjTsubo* this, PlayState* play) { } EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -240, arg5, 10, 10, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 60, KAKERA_COLOR_NONE, - sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], - D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); + sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)], + D_80BA1B8C[PARAMS_GET_U(this->actor.params, 8, 1)]); } func_80033480(play, &this->actor.world.pos, 30.0f, 4, 20, 50, 1); } @@ -213,8 +213,8 @@ void ObjTsubo_WaterBreak(ObjTsubo* this, PlayState* play) { phi_s0 = (Rand_ZeroOne() < .2f) ? 64 : 32; EffectSsKakera_Spawn(play, &pos, &velocity, &this->actor.world.pos, -180, phi_s0, 30, 30, 0, (Rand_ZeroOne() * 95.0f) + 15.0f, 0, 32, 70, KAKERA_COLOR_NONE, - sObjectIds[PARAMS_GET(this->actor.params, 8, 1)], - D_80BA1B8C[PARAMS_GET(this->actor.params, 8, 1)]); + sObjectIds[PARAMS_GET_U(this->actor.params, 8, 1)], + D_80BA1B8C[PARAMS_GET_U(this->actor.params, 8, 1)]); } } @@ -340,5 +340,5 @@ void ObjTsubo_Update(Actor* thisx, PlayState* play) { } void ObjTsubo_Draw(Actor* thisx, PlayState* play) { - Gfx_DrawDListOpa(play, D_80BA1B84[PARAMS_GET(thisx->params, 8, 1)]); + Gfx_DrawDListOpa(play, D_80BA1B84[PARAMS_GET_U(thisx->params, 8, 1)]); } diff --git a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c index 2e915ca3bb3..3ce601f4a2f 100644 --- a/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c +++ b/src/overlays/actors/ovl_Obj_Warp2block/z_obj_warp2block.c @@ -66,11 +66,11 @@ static Color_RGB8 sColors[] = { void ObjWarp2block_Spawn(ObjWarp2block* this, PlayState* play) { Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, - this->dyna.actor.world.pos.z, 0, 0, 0, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].params); + this->dyna.actor.world.pos.z, 0, 0, 0, sSpawnData[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].params); Actor_Spawn(&play->actorCtx, play, ACTOR_DEMO_EFFECT, this->dyna.actor.child->world.pos.x, this->dyna.actor.child->world.pos.y, this->dyna.actor.child->world.pos.z, 0, 0, 0, - sSpawnData[PARAMS_GET(this->dyna.actor.child->params, 8, 1)].params); + sSpawnData[PARAMS_GET_U(this->dyna.actor.child->params, 8, 1)].params); } s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { @@ -86,8 +86,8 @@ s32 func_80BA1ECC(ObjWarp2block* this, PlayState* play) { temp_a3 = this->dyna.actor.child; player = GET_PLAYER(play); - if ((this->dyna.actor.xzDistToPlayer <= sDistances[PARAMS_GET(this->dyna.actor.params, 11, 3)]) || - (temp_a3->xzDistToPlayer <= sDistances[PARAMS_GET(temp_a3->params, 11, 3)])) { + if ((this->dyna.actor.xzDistToPlayer <= sDistances[PARAMS_GET_U(this->dyna.actor.params, 11, 3)]) || + (temp_a3->xzDistToPlayer <= sDistances[PARAMS_GET_U(temp_a3->params, 11, 3)])) { func_8002DBD0(&this->dyna.actor, &sp20, &player->actor.world.pos); temp_f2 = (this->dyna.actor.scale.x * 50.0f) + 6.0f; @@ -142,15 +142,15 @@ void ObjWarp2block_SwapWithChild(ObjWarp2block* this, PlayState* play) { this->dyna.actor.focus.rot = this->dyna.actor.child->focus.rot; this->dyna.actor.child->focus.rot = tempRot; - temp = PARAMS_GET(this->dyna.actor.params, 0, 15); + temp = PARAMS_GET_U(this->dyna.actor.params, 0, 15); this->dyna.actor.params = - PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET(this->dyna.actor.child->params, 0, 15); + PARAMS_GET_NOSHIFT(this->dyna.actor.params, 15, 1) | PARAMS_GET_U(this->dyna.actor.child->params, 0, 15); this->dyna.actor.child->params = PARAMS_GET_NOSHIFT(this->dyna.actor.child->params, 15, 1) | (temp & 0x7FFF); if (Math3D_Vec3fDistSq(&this->dyna.actor.world.pos, &this->dyna.actor.home.pos) < 0.01f) { - Flags_UnsetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_UnsetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } else { - Flags_SetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6)); + Flags_SetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)); } } @@ -204,13 +204,13 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); - Actor_SetScale(&this->dyna.actor, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].scale); + Actor_SetScale(&this->dyna.actor, sSpawnData[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].scale); this->func_168 = func_80BA2218; - Actor_SetFocus(&this->dyna.actor, sSpawnData[PARAMS_GET(this->dyna.actor.params, 8, 1)].focus); + Actor_SetFocus(&this->dyna.actor, sSpawnData[PARAMS_GET_U(this->dyna.actor.params, 8, 1)].focus); - if (PARAMS_GET(this->dyna.actor.params, 15, 1)) { + if (PARAMS_GET_U(this->dyna.actor.params, 15, 1)) { func_80BA24E8(this); - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { this->dyna.actor.draw = NULL; } DynaPolyActor_Init(&this->dyna, 0); @@ -221,13 +221,13 @@ void ObjWarp2block_Init(Actor* thisx, PlayState* play2) { } PRINTF("時のブロック(ワープ2) ( %04xH color:%d range:%d)\n", - PARAMS_GET(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7, - PARAMS_GET(this->dyna.actor.params, 11, 3)); + PARAMS_GET_U(this->dyna.actor.params, 0, 16), this->dyna.actor.home.rot.z & 7, + PARAMS_GET_U(this->dyna.actor.params, 11, 3)); } void ObjWarp2block_Destroy(Actor* thisx, PlayState* play) { ObjWarp2block* this = (ObjWarp2block*)thisx; - if (PARAMS_GET(this->dyna.actor.params, 15, 1)) { + if (PARAMS_GET_U(this->dyna.actor.params, 15, 1)) { DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); } } @@ -248,10 +248,10 @@ void func_80BA24F8(ObjWarp2block* this, PlayState* play) { Actor* current = play->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; while (current != NULL) { - if (current->id == ACTOR_OBJ_WARP2BLOCK && !PARAMS_GET(current->params, 15, 1) && - (PARAMS_GET(this->dyna.actor.params, 0, 6) == PARAMS_GET(current->params, 0, 6))) { + if (current->id == ACTOR_OBJ_WARP2BLOCK && !PARAMS_GET_U(current->params, 15, 1) && + (PARAMS_GET_U(this->dyna.actor.params, 0, 6) == PARAMS_GET_U(current->params, 0, 6))) { this->dyna.actor.child = current; - if (Flags_GetSwitch(play, PARAMS_GET(this->dyna.actor.params, 0, 6))) { + if (Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6))) { ObjWarp2block_SwapWithChild(this, play); this->dyna.actor.draw = ObjWarp2block_Draw; } diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index d9e6b245a7e..79f844319f0 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -65,7 +65,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { // "Ocarina secret occurrence" PRINTF("%d ---- オカリナの秘密発生!!!!!!!!!!!!!\n", this->actor.params); - params = PARAMS_GET(this->actor.params, 0, 8); + params = PARAMS_GET_U(this->actor.params, 0, 8); if (params == 0x40 || params == 0x41) { this->fairySpawnerState = SPAWNER_OUT_OF_RANGE; this->actor.flags |= ACTOR_FLAG_4; @@ -82,7 +82,7 @@ void ShotSun_Init(Actor* thisx, PlayState* play) { void ShotSun_Destroy(Actor* thisx, PlayState* play) { ShotSun* this = (ShotSun*)thisx; - s32 params = PARAMS_GET(this->actor.params, 0, 8); + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); if (params != 0x40 && params != 0x41) { Collider_DestroyCylinder(play, &this->collider); @@ -90,7 +90,7 @@ void ShotSun_Destroy(Actor* thisx, PlayState* play) { } void ShotSun_SpawnFairy(ShotSun* this, PlayState* play) { - s32 params = PARAMS_GET(this->actor.params, 0, 8); + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); s32 fairyType; if (this->timer > 0) { @@ -128,7 +128,7 @@ void ShotSun_TriggerFairy(ShotSun* this, PlayState* play) { void ShotSun_UpdateFairySpawner(ShotSun* this, PlayState* play) { Player* player = GET_PLAYER(play); s32 pad; - s32 params = PARAMS_GET(this->actor.params, 0, 8); + s32 params = PARAMS_GET_U(this->actor.params, 0, 8); if (Math3D_Vec3fDistSq(&this->actor.world.pos, &player->actor.world.pos) > SQ(150.0f)) { this->fairySpawnerState = SPAWNER_OUT_OF_RANGE; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index 00ba81858b7..ff627e153fd 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -5107,7 +5107,7 @@ void func_8083A0F4(PlayState* play, Player* this) { Player_SetupAction(play, this, Player_Action_80846120, 0); this->stateFlags1 |= PLAYER_STATE1_29; anim = &gPlayerAnim_link_normal_heavy_carry; - } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET(interactRangeActor->params, 0, 4) == 1)) { + } else if ((interactActorId == ACTOR_EN_ISHI) && (PARAMS_GET_U(interactRangeActor->params, 0, 4) == 1)) { Player_SetupAction(play, this, Player_Action_80846260, 0); anim = &gPlayerAnim_link_silver_carry; } else if (((interactActorId == ACTOR_EN_BOMBF) || (interactActorId == ACTOR_EN_KUSA)) && @@ -6804,7 +6804,7 @@ s32 Player_ActionChange_2(Player* this, PlayState* play) { } else { s32 strength = Player_GetStrength(); - if ((interactedActor->id == ACTOR_EN_ISHI) && (PARAMS_GET(interactedActor->params, 0, 4) == 1) && + if ((interactedActor->id == ACTOR_EN_ISHI) && (PARAMS_GET_U(interactedActor->params, 0, 4) == 1) && (strength < PLAYER_STR_SILVER_G)) { return 0; } @@ -10029,7 +10029,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { } if (func_80845C68(play, (respawnFlag == 2) ? 1 : 0) == 0) { - gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PARAMS_GET2(thisx->params, 0, 8) | 0xD00; + gSaveContext.respawn[RESPAWN_MODE_DOWN].playerParams = PARAMS_GET_S(thisx->params, 0, 8) | 0xD00; } gSaveContext.respawn[RESPAWN_MODE_DOWN].data = 1; @@ -10038,7 +10038,7 @@ void Player_Init(Actor* thisx, PlayState* play2) { gSaveContext.save.info.infTable[INFTABLE_1AX_INDEX] |= gBitFlags[play->sceneId]; } - initMode = PARAMS_GET2(thisx->params, 8, 4); + initMode = PARAMS_GET_S(thisx->params, 8, 4); if ((initMode == 5) || (initMode == 6)) { if (gSaveContext.save.cutsceneIndex >= 0xFFF0) { initMode = 13; From 1dff28aadec835115b5294f83c0146530c61c0c2 Mon Sep 17 00:00:00 2001 From: fig02 Date: Wed, 17 Jan 2024 11:28:26 -0500 Subject: [PATCH 16/16] format --- src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c | 3 ++- src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c | 2 +- src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c | 4 ++-- .../actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c | 3 ++- src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c | 3 ++- src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c | 3 ++- src/overlays/actors/ovl_En_Ishi/z_en_ishi.c | 3 +-- src/overlays/actors/ovl_En_Sw/z_en_sw.c | 2 +- 8 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 93ab7db046c..e031c467b66 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -51,7 +51,8 @@ void BgInGate_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->dyna.actor, 0.1f); - if ((PARAMS_GET_U(this->dyna.actor.params, 0, 1) != 0) && (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { + if ((PARAMS_GET_U(this->dyna.actor.params, 0, 1) != 0) && + (GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) { play->csCtx.curFrame = 0; BgInGate_SetupAction(this, func_80892890); } else { diff --git a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 2f750a9abdf..cd119b7d822 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -280,7 +280,7 @@ void BgJyaCobra_UpdateShadowFromSide(BgJyaCobra* this) { Matrix_RotateX((M_PI / 4), MTXMODE_NEW); rotY = !PARAMS_GET_U(this->dyna.actor.params, 0, 2) ? (this->dyna.actor.shape.rot.y + 0x4000) - : (this->dyna.actor.shape.rot.y - 0x4000); + : (this->dyna.actor.shape.rot.y - 0x4000); Matrix_RotateY(BINANG_TO_RAD(rotY), MTXMODE_APPLY); Matrix_Scale(0.9f, 0.9f, 0.9f, MTXMODE_APPLY); diff --git a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index 2205a0f7268..7fe8bebda02 100644 --- a/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -214,8 +214,8 @@ void BgMoriElevator_SetPosition(BgMoriElevator* this, PlayState* play) { (this->unk_16C == 0)) { this->targetY = 73.0f; func_808A1C30(this); - } else if ((play->roomCtx.curRoom.num == 2) && !Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) && - (this->unk_16C != 0)) { + } else if ((play->roomCtx.curRoom.num == 2) && + !Flags_GetSwitch(play, PARAMS_GET_U(this->dyna.actor.params, 0, 6)) && (this->unk_16C != 0)) { this->targetY = 233.0f; func_808A1CF4(this, play); } diff --git a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c index fa7e9b37abd..cc2fa2dba24 100644 --- a/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c +++ b/src/overlays/actors/ovl_En_Daiku_Kakariko/z_en_daiku_kakariko.c @@ -245,7 +245,8 @@ void EnDaikuKakariko_HandleTalking(EnDaikuKakariko* this, PlayState* play) { if ((sp26 >= 0) && (sp26 <= 320) && (sp24 >= 0) && (sp24 <= 240) && (this->talkState == 0) && (Actor_OfferTalk(&this->actor, play, 100.0f) == 1)) { - this->actor.textId = MaskReaction_GetTextId(play, sMaskReactionSets[PARAMS_GET_U(this->actor.params, 0, 2)]); + this->actor.textId = + MaskReaction_GetTextId(play, sMaskReactionSets[PARAMS_GET_U(this->actor.params, 0, 2)]); if (this->actor.textId == 0) { switch (PARAMS_GET_U(this->actor.params, 0, 2)) { diff --git a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c index 9918272bed4..9913d186d19 100644 --- a/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c +++ b/src/overlays/actors/ovl_En_Goroiwa/z_en_goroiwa.c @@ -549,7 +549,8 @@ void EnGoroiwa_Init(Actor* thisx, PlayState* play) { return; } CollisionCheck_SetInfo(&this->actor.colChkInfo, NULL, &sColChkInfoInit); - ActorShape_Init(&this->actor.shape, yOffsets[PARAMS_GET_U(this->actor.params, 10, 1)], ActorShadow_DrawCircle, 9.4f); + ActorShape_Init(&this->actor.shape, yOffsets[PARAMS_GET_U(this->actor.params, 10, 1)], ActorShadow_DrawCircle, + 9.4f); this->actor.shape.shadowAlpha = 200; EnGoroiwa_SetSpeed(this, play); EnGoroiwa_InitPath(this, play); diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index e12ebcb26e0..d2bf9a24fc9 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -155,7 +155,8 @@ void EnHeishi2_Init(Actor* thisx, PlayState* play) { // "Identification Completed!" PRINTF(VT_FGCOL(YELLOW) " ☆☆☆☆☆ 識別完了! ☆☆☆☆☆ %d\n" VT_RST, this->type); // "Message completed!" - PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, PARAMS_GET_U(this->actor.params, 8, 4)); + PRINTF(VT_FGCOL(MAGENTA) " ☆☆☆☆☆ メッセージ完了! ☆☆☆☆☆ %x\n\n" VT_RST, + PARAMS_GET_U(this->actor.params, 8, 4)); } } diff --git a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 5412649331b..08cbe08ed8e 100644 --- a/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -319,8 +319,7 @@ void EnIshi_Init(Actor* thisx, PlayState* play) { } Actor_SetScale(&this->actor, sRockScales[type]); EnIshi_InitCollider(&this->actor, play); - if ((type == ROCK_LARGE) && - Flags_GetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor))) { + if ((type == ROCK_LARGE) && Flags_GetSwitch(play, ISHI_GET_SWITCH_FLAG(&this->actor))) { Actor_Kill(&this->actor); return; } diff --git a/src/overlays/actors/ovl_En_Sw/z_en_sw.c b/src/overlays/actors/ovl_En_Sw/z_en_sw.c index ada9fd70854..c0919c21b12 100644 --- a/src/overlays/actors/ovl_En_Sw/z_en_sw.c +++ b/src/overlays/actors/ovl_En_Sw/z_en_sw.c @@ -439,7 +439,7 @@ void func_80B0CEA8(EnSw* this, PlayState* play) { if (!(Math_Vec3f_DistXYZ(&this->actor.world.pos, &activeCam->eye) >= 380.0f)) { Actor_PlaySfx(&this->actor, (PARAMS_GET_S(this->actor.params, 13, 3) > 0) ? NA_SE_EN_STALGOLD_ROLL - : NA_SE_EN_STALWALL_ROLL); + : NA_SE_EN_STALWALL_ROLL); } } }