Commit Graph

238 Commits

Author SHA1 Message Date
LagoLunatic 4c3bd2c651 Missed some spots where cPhs_State should be used 2025-03-18 15:10:32 -04:00
LagoLunatic 822b13e57a Add cPhs_State typedef and use it everywhere 2025-03-17 22:26:56 -04:00
mattias-blum ae528dc3d9 d_a_fganon 100% (#695)
* added `cBgS_Chk::OffSameActorChk`inline function

* initial progress of d_a_fganon

100% Matching:
- `anim_init`
- `tama_draw`
- `daFganon_Draw`
- `daFganon_IsDelete`

Partial Matching:
- `daFganon_Hio_C::daFganon_HIO_c` (88%)
- `deru_brk` (98%, code is matching, variable memory locations needed for 100% match)
- `kieru_brk` (98%, code is matching, variable memory locations needed for 100% match)
- `deru_brk2` (98%, code is matching, variable memory locations needed for 100% match)
- `kieru_brk2` (98%, code is matching, variable memory locations needed for 100% match)
- `pos_move` (73%)
- `move` (80%)
- `mahou_se_set` (82%)
- `daFganon_Delete` (94%, code is matching, variable memory locations needed for 100% match)
- `useHeapInit` (92%)
- `daFganon_Create` (77%)
- `fgannon_class::fganon_class()` (88%)

Remainder haven't been started

* Additional progress, more functions at 100% matching

100% Matching:
- `daFganon_Hio_C::daFganon_HIO_c`
- `anim_init`
- `tama_draw`
- `daFganon_Draw`
- `deru_brk`
- `kieru_brk`
- `deru_brk2`
- `kieru_brk2`
- `pos_move`
- `fly_se_set`
- `mahou_set`
- `mahou_se_set`
- `daFganon_IsDelete`
- `daFganon_Delete`
- `useHeapInit`

Partial Matching:
- `fly` (60%)
- `shot` (46%)
- `move` (92%)
- `daFganon_Execute` (11%)
- `daFganon_Create` (60%)
- `fgannon_class::fganon_class()` (93%)

* More functions at 100% matching

- Added a `cXyz` member to `mant_class` that is referenced in this TU.
- Changed 'fganon_class` to inherit from `fopEn_enemy_c` instead of `fopAc_ac_c`

100% Matching:
- `daFganon_Hio_C::daFganon_HIO_c`
- `anim_init`
- `tama_draw`
- `daFganon_Draw`
- `deru_brk`
- `kieru_brk`
- `deru_brk2`
- `kieru_brk2`
- `pos_move`
- `fly_se_set`
- `fly`
- `shot`
- `spinattack`
- `fly2`
- `tama_set`
- `mahou_set`
- `mahou_set`
- `mahou_se_set`
- `daFganon_IsDelete`
- `daFganon_Delete`
- `useHeapInit`
- `fgannon_class::fganon_class()`

Partial Matching:
- `move` (96%, code is matching, variable memory locations needed for 100% match)
- `daFganon_Execute` (96%, code is matching, variable memory locations needed for 100% match)
- `daFganon_Create` (96%, code is matching, variable memory locations needed for 100% match)

* additional functions at 100% matching

Cleaned up the values of the static globals, will resolve their symbols later

100% Matching:
- `daFganon_Hio_C::daFganon_HIO_c`
- `anim_init`
- `tama_draw`
- `daFganon_Draw`
- `deru_brk`
- `kieru_brk`
- `deru_brk2`
- `kieru_brk2`
- `pos_move`
- `fly_se_set`
- `fly`
- `shot`
- `spinattack`
- `fly2`
- `tama_set`
- `mahou_set`
- `shot2`
- `spinattack2`
- `down`
- `kabe_check`
- `deru`
- `kieru`
- `fail`
- `standby`
- `start`
- `last_end`
- `damage_check`
- `ball_tg_check`
- `mahou_se_set`
- `daFganon_IsDelete`
- `daFganon_Delete`
- `useHeapInit`
- `fgannon_class::fganon_class()`

Partial Matching:
- `end` (97%, code is matching, variable memory locations needed for 100% match)
- `move` (97%, code is matching, variable memory locations needed for 100% match)
- `demo_camera` (63%)
- `daFganon_Execute` (97%, code is matching, variable memory locations needed for 100% match)
- `daFganon_Create` (98%, code is matching, variable memory locations needed for 100% match)

* added `mDoAud_changeSubBgmStatus` inline

* changed return type of `dComIfGp_getPlayerCameraID` inline

needed this change to get a match for this `d_a_fganon`

* d_a_fganon 100% matching

Currently the checksum fails but I have some theories as to why that might be. I'll continue to cleanup the symbols.

* symbol cleanup

* fixed `mDoAud_changeSubBgmStatus` calling wrong function

* 100% matching now, checksum passes

There is a weak function ordering issue so I included the param in `configure.py`

* PR changes made

* Additional PR changes, better naming of class members
2025-03-16 19:04:00 -04:00
LagoLunatic a9e1527253 Work on d_a_bk, c_damagereaction 2025-03-12 22:30:10 -04:00
LagoLunatic 49c69eeb0f C_BG_MIN_HEIGHT, C_BG_MAX_HEIGHT 2025-03-06 20:41:37 -05:00
LagoLunatic 6c75c400f2 Reorder dComIfG inlines 2025-03-01 00:54:57 -05:00
LagoLunatic 6e83a87f42 Implement dCom attention inlines 2025-03-01 00:54:52 -05:00
LagoLunatic 901bc51f40 d_a_npc_md work 2025-01-27 19:26:14 -05:00
LagoLunatic e8adc6c9e5 Rename more item enums 2025-01-17 20:58:43 -05:00
LagoLunatic 37dbfd75de Add item button enum and talk button enum 2025-01-06 00:23:55 -05:00
Jasper St. Pierre 72bbd3ea1f f_op_msg_mng work 2024-12-28 15:33:02 -08:00
Jasper St. Pierre c7e3e7ffea small fixes 2024-12-27 01:32:02 -08:00
Jasper St. Pierre 929027bfc1 document inventory slots 2024-12-27 01:23:55 -08:00
Mike Lester 64cc277d05 d_wood (bushes) matching (#682)
* d_wood (bushes) 73% matching

* d_wood::Unit_c::set_ground 100% match

Jasper pointed me to the fact that the complicated inv_sqrt function I wrote was indeed just std::sqrtf(), which unlocked the rest of the match

* Replace some bitshifts with multiplies based on PR feedback

* Remove all instances of "this->" from d_wood

* Add missing struct offset comment for mTevStr

* Cleaned up d_tree externs

* Use MTXIdentity instead of PSMTXIdentity

* Remove incorrect TODO rearding cCcD_ObjAtType enum

* Use the mDoAud_seStart inline function

* Remove unnecessary parenthesis

* Fix incorrect branching logic in d_wood::cc_hit_before_cut()

* d_wood data sections fixup

* Re-add "Nonmatching" comments to all nonmatching functions

* Formatting: reformat from 2 to 4 space indentation

This was a local system problem which slipped by me in a previous commit

* 100% match for d_wood::Anm_c::mode_norm()

Thanks Chippy! https://discord.com/channels/727908905392275526/873250400483024976/1298360716964790294

* Use cLib_*Bit() functions for flag checking and setting

Based on the inline functions from the .map

* d_wood: Use AnmID_e according to the .map file

* d_wood: add a couple AnmID_e related inlines from the .map

* d_wood: Name remaining unknowns related to animation

* d_wood: Match cc_hit_before_cut()

* d_wood: Match calc_cc() by using the dComIfGp_roomControl_getStayNo() inline

* d_wood: Match string table and search_anm() by using a constant in assert string

* d_wood: Match mode_to_norm()

Switching normAnim to a const* did most of the work

* d_wood: 100% match for L_attr and the .rodata section

* d_wood: Fill in .data section. Still some extra data from vtables

* d_wood: Match .sbss section

* d_wood: Match .sdata section

* d_wood: 98% match for Packet_c::draw()

The only error is that g_dTree_shadowTexCoord is still using a 32-bit load instead of 16. the only way I know of to fix that is to define the data in this compilation unit. But that can't be right

* d_wood: Various small formatting changes

- No one line function implementations
- Replaced instances of (SomeType*)0x0 (copy/pasted from Ghidra) with NULL
- Replaced a few instances of 0.0 with 0.0f
- Replaced one instance where a number was used instead of an enum value

* d_wood: More formatting fixes

- Removed unused variables from functions
- Removed unnecessary iVar1 loop variables (leftover Ghidra detritus)
- Fixed dtk function comments being wrapped by autoformatter. They now always appear on one line

* d_tree: 100% match of data which is used by d_wood

This moves g_dTree_shadowTexCoord into .sdata which allows d_wood::Packet_c::draw() to load its address with a single instruction. This  makes a 100% match for draw()

* d_wood: Removed unnecessary comment now that draw() matches

g_dTree_shadowTexCoord now lives in the d_tree .sdata section, so its instruction can be loaded with a single instruction. This makes a 100% match with draw().

* d_wood: 100% match for mode_cut()

* d_wood: Match mode_push_into()

Also renamed mWindDir to mForceDir as it represents both wind and an actor pushing from a vector

* d_wood: Match mode_push_back

* d_wood: Match __sinit_d_wood_cpp

The l_matDL display list is dynamically patched to reference the l_Txa_swood_bTEX texture at static initialization time. Is there a better way to represent this?

* d_wood: Fix incorrect constant in set_ground()

* d_wood: Simplify dummy data at the top of .data section

* d_wood: Mark as matching in configure.py

Had to move Packet_c destructor to get the functions in the right order. See discussion: https://discord.com/channels/727908905392275526/873250400483024976/1300680009458913280

* d_wood: Add `d/d_cc_d.h` include as some enums have moved

* d_wood: Clean up some types at the top

* Mark d_wood as non-matching for the Japanese version
2024-10-31 16:58:37 -04:00
LagoLunatic fab0d7a5ba misc cleanup, mostly inlines 2024-10-29 00:22:32 -04:00
SuperDude88 716492b7b9 First Person Item Procs (#680)
* First Person Item Procs

Match a couple of Link's proc functions

* Cleanup
2024-10-19 13:03:32 -04:00
LagoLunatic 202851599f More warning/error cleanup, mostly includes 2024-10-17 23:46:30 -04:00
LagoLunatic 34afbd84db clangd: Started fixing warnings and errors, code cleanup 2024-10-17 21:35:18 -04:00
Daniel Hajjar c2bacf5658 d_a_player_particle (#674)
* daPy_mtxPosFollowEcallBack_c::execute matching

* daPy_waterDropEcallBack_c::end matching

* daPy_dmEcallBack_c::execute matching

* daPy_fanSwingEcallBack_c::execute matching

* daPy_waterDropPcallBack_c::execute matching

* daPy_sightPacket_c::draw matching

* daPy_sightPacket_c::setSight matching

* daPy_swBlur_c::initSwBlur matching

* daPy_swBlur_c matching

* daPy_lk_c::setWaterDrop matching

* daPy_lk_c::setFootMark matching

* daPy_footEffect_c work

* daPy_lk_c::resetFootEffect matching

* daPy_lk_c::setSwimTail matching

* daPy_lk_c::setCutWaterSplash matching

* daPy_lk_c::setDamageCurseEmitter matching

* daPy_lk_c::setDamageElecEmitter matching

* daPy_lk_c::setDamageEmitter matching

* daPy_lk_c::endFlameDamageEmitter matching

* daPy_lk_c::setSwimWaterDrop matching

* daPy_lk_c::setItemWaterEffect matching

* daPy_lk_c::setFootEffectType matching

* daPy_lk_c::setFootEffect matching

* daPy_lk_c::setAuraEffect work

* daPy_lk_c::setWaterRipple matching

* d_a_player_particle minor cleanup

* daPy_lk_c::setAuraEffect matching

* Removed comment

* Removed another old comment

* PR suggestions
2024-08-09 17:05:24 -04:00
Jasper St. Pierre 2b4fcbecee build fix 2024-07-27 07:51:12 -07:00
Jasper St. Pierre 63aecb6166 d_map work 2024-07-26 22:06:20 -07:00
Erilea 202fce5fa7 d_vibration / d_vib_pattern 2024-07-25 19:13:30 +02:00
LagoLunatic bad4ac23e9 work on various inlines, JASSeqCtrl OK 2024-07-17 11:51:58 -04:00
Jasper St. Pierre 7cc7ad2b14 m_Do_MemCardRWmng work 2024-07-14 11:02:23 -07:00
LagoLunatic 11362ce122 build fix 2024-07-14 13:32:54 -04:00
Jasper St. Pierre 96596b299e build fix 2024-07-14 10:06:19 -07:00
Jasper St. Pierre 0614e8cb9e m_Do_MemCardRWmng work 2024-07-14 10:04:25 -07:00
LagoLunatic 2def735282 Add fpc_ProcID type and use it for all process IDs
See https://github.com/zeldaret/tp/pull/2173
2024-07-12 21:14:13 -04:00
Jasper St. Pierre a597a1902b d_operate_wind work 2024-07-11 23:37:28 -07:00
LagoLunatic ee8b3967a5 Fix getPalLanguage name 2024-07-06 09:45:47 -04:00
LagoLunatic b825eebd9d Fix JPN build 2024-07-04 13:25:42 -04:00
LagoLunatic c3722dbeb5 Add some dCom inlines from TP debug 2024-07-04 13:19:51 -04:00
Jasper St. Pierre 84c76203fc d_s_menu work 2024-07-02 16:31:05 -07:00
LagoLunatic 8f371a7c1b d_door 100%, weak order not matching 2024-06-30 11:14:10 -04:00
Jasper St. Pierre a1068eae25 fix build 2024-06-29 20:15:09 -07:00
Jasper St. Pierre ec93cb6da5 d_door work 2024-06-29 19:38:18 -07:00
Jasper St. Pierre 9eea54fe9e d_door work 2024-06-28 23:29:06 -07:00
SuperDude88 3f08458809 d_a_npc_people Almost OK (#658)
* daNpcPeople Work

* Oops

Somehow I break this file every time I touch it
2024-06-15 22:55:31 -07:00
LagoLunatic eec24f6c27 procTactWait 2024-06-06 18:48:25 -04:00
Daniel Hajjar ed7a50cd86 d_a_auction (#654)
* Started working on d_a_auction

* daAuction_c Updated member variables

* daAuction_c Refactored class

* daAuction_c::getRand matching

* daAuction_c constructor matching

* d_a_auction CheckCreateHeap matching

* daAuction_c::_create matching

* d_a_auction l_item_dat matching

* daAuction_c::createHeap matching

* d_a_auction Added HIO classes

* daAuction_c::createInit WIP

* daAuction_c::_delete matching

* daAuction_c::_draw matching

* daAuction_c::_execute matching

* d_a_auction Fixed procfunc arrays

* daAuction_c moveProc funcs matching

* daAuction_c::checkOrder matching

* daAuction_c::eventOrder WIP

* daAuction_c::eventMove matching

* daAuction_c::privateCut WIP

* daAuction_c::eventTalkInit matching

* daAuction_c::eventMesSet matching

* daAuction_c::eventMesEnd matching

* daAuction_c::eventStartInit matching

* daAuction_c::eventStart matching

* daAuction_c::eventMainInit matching

* daAuction_c::eventMain matching

* daAuction_c::eventMainKai matching

* daAuction_c::eventMainKai Fixed formatting

* daAuction_c::eventMainUri matching

* d_a_auction matching fixes

* daAuction_c::eventMainMsgSet matching

* daAuction_c::eventMainMsgEnd matching

* daAuction_c::setMtx matching

* daAuction_c::getItemNo matching

* daAuction_c::setLinkAnm matching

* d_a_auction matched some functions

* d_a_auction matched SetMessage functions

* daAuction_c::getNpcActorP matching

* daAuction_c::eventMainMsgBikonC matching

* daAuction_c::eventMainMsgBikonW matching

* daAuction_c::eventGetItemInit matching

* daAuction_c::eventGetItemNpcInit matching

* daAuction_c::eventGetItemMesInit matching

* d_a_auction matched some functions

* daAuction_c::setCameraNpc matching

* daAuction_c::nextBet matching

* daAuction_c::privateCut Fixed matching

* d_a_auction .data section matching

* daAuction_c::next_msgStatus WIP

* daAuction_c::next_msgStatus matching

* Fixed variable names

* d_a_auction cleanup

* d_a_auction more cleanup

* d_a_auction non-matching

* d_a_auction minor tweak
2024-06-02 10:48:53 -07:00
Erilea 6f01730ab2 Add dComIfGp_particle_addModelEmitter wrapper 2024-05-24 18:56:46 +02:00
LagoLunatic 3e02c1e450 minor cleanup and matches 2024-05-12 12:26:10 -04:00
LagoLunatic af61ba5f0a d_a_player_tact work 2024-05-08 19:11:20 -04:00
SuperDude88 899ae98e7d daObj_Roten_c OK, daNpcRoten_c Almost Matching (#618)
* Roten Work

- daNpcRoten_c almost matching
- daObj_Roten_c OK

I don't think these are actually related but they had the same name so I put them together

* Minor Cleanup
2024-04-24 14:28:38 -04:00
LagoLunatic 1c80dde547 d_s_name: a few small matches 2024-04-18 23:19:12 -04:00
LagoLunatic 459cf6caa7 clean up some inline parameters 2024-04-18 23:16:38 -04:00
LagoLunatic c93901ce2c d_a_boko start 2024-04-17 13:35:53 -04:00
LagoLunatic 8238d12e71 add more default parameters for common funcs 2024-04-16 13:44:24 -04:00
LagoLunatic ad0478fe15 d_a_tag_event OK 2024-04-16 13:28:35 -04:00
LagoLunatic 95f93e05d7 improve some npc_bs1 matches slightly 2024-04-10 23:51:34 -04:00