1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-22 13:25:00 +00:00
Commit Graph

33 Commits

Author SHA1 Message Date
fig02
2e6279bc8e
PlayState Rename (#1231)
* global context -> play

* fix PlayState* PlayState
2022-05-21 14:23:43 -04:00
Dragorn421
154f44b6da
Documentation pass on scene/room commands (#1226)
* Rename handler functions

* Rename cmd_id enum names for consistency

* `char` -> `s8` for explicit padding in cmd structs

* `Room.unk03/03` -> `behaviorType2/1`

* `UNK_PTR` -> `void*`

* `showInvisActors` -> `lensActorsMode` + enum

* Add `ROOM_BEHAVIOR_TYPE1/2_` enums

* "mesh" -> "mesh header"

* `Polygon polygon` -> `PolygonBase base` (for now...)

* Misc cleanup

* "lens actors mode" -> "lens actor mode"

* Revert "`char` -> `s8` for explicit padding in cmd structs"

This reverts commit 59b9295828.

* `LENS_ACTOR_MODE_` -> `LENS_MODE_HIDE/SHOW_ACTORS`
2022-05-21 08:54:51 -04:00
fig02
4f0018bf36
Environment documentation pass (#1115)
* some docs, start introducing time macro

* most usages of CLOCK_TIME

* finish up clock time defines, format

* saving incase i need to revert

* more docs

* more docs progress

* some more docs

* format with 11

* change sos to storm

* update functions.h

* some depth stuff

* review 1 and 2

* whoops

* update zbuf stuff

* most of review 3

* enum name

* storm state enum

* review 4

* fix enum

* add comment to skyboxischanging

* review

* things dont match, committing so i can change branches

* revert struct changes

* define for override_full_control

* new clock_time macro

* fill alpha -> glare strength

* update comment

* remove indoor/outdoor, new name for underwater light variable

* remove copy pasted comment

* fix comments

* remove whitespave

* review
2022-05-20 14:40:13 -04:00
Dragorn421
811b2d6ad2
Fix misc 12 (#1222)
* (light) `src` to `src/code/code_8006C510.c`

* `setup + entrance` -> `entrance + setup`

* Decimal for `gdSPDefLights1` args (colors, unit vector)

* Run formatter

* `firstDone` bool -> `materialFlag`

* `ENTR_MAX`: 0x613 -> 0x614

* revert `materialFlag` to bool++ for now
2022-05-15 16:38:31 +02:00
fig02
2efd00863a
Introduce DEFINE_ENTRANCE for entrance table and create entrance enum (#1213)
* entrance table OK

* entrance enum fixed

* most entrances using enum, still need to do conditionals

* more entrances

* entrance_table.h cleanups

* some review

* remove _0 from first entrance in a group of setups

* change table description

* typo

* wens spellcheck in vscode

* remove extra line
2022-05-09 13:45:53 -04:00
Dragorn421
6336df5fcd
Defines for SaveContext flags (eventChkInf, itemGetInf, infTable, eventInf) (#1094)
* script-assisted `itemGetInf` flags

* comment near non-trivial `itemGetInf` usage

* Run formatter

* Try something with the itemgetinf flags that can't use the packed value

* Add defines for `eventChkInf` (direct access)

* Add defines for `eventChkInf` (access through `Flags_GetEventChkInf`)

* Add defines for `eventChkInf` (access through `Flags_SetEventChkInf`)

* Add defines for `infTable` (direct access)

* Add defines for `infTable` (used by `Flags_GetInfTable`)

* Add defines for `infTable` (used by `Flags_SetInfTable`)

* Add defines for `eventInf`

* parenthesis cleanup near `GET_EVENTCHKINF` usage

* parenthesis cleanup near `GET_ITEMGETINF` usage

* parenthesis cleanup near `GET_INFTABLE` usage

* fixup one `eventInf` usage

* parenthesis cleanup near `GET_EVENTINF` usage

* parenthesis cleanup near `Flags_GetEventChkInf` usage

* slight `z64save.h` formatting improvement

* Improve itemGetInf flags in z_bg_dy_yoseizo

* Questionable improvement in z_en_ge2

* Questionable improvement in z_en_daiku

* Questionable improvement in z_en_mu

* Run formatter

* Parentheses around `gSaveContext` macros arguments

* Move individual flags define to the end of z64save.h, and improve comments separating the groups
2022-04-29 14:19:48 -04:00
fig02
16790bc253
Document Transition System (#1131)
* transition type enum

* mode enum, start documenting some types

* some more

* use enums for entrance table

* entrance table filled out

* sceneLoadFlag -> transitionTrigger

* sandstorm state/mode/type

* done i think

* fixes

* clean up circle weirdness

* circle use enum + fix texture names

* fix

* how did that even happen lol

* jesus

* review2

* some more review

* most review, still some more to do

* new transition trigger names

* some of review

* next type default
2022-04-27 16:00:25 -04:00
Tharo
7068ad3703
Message Queues, Threads, and surroundings cleanup (#1178)
* message queues, threads, and surroundings cleanup

* Format, make the formatter prefer clang-format-11 if found

* Fix __osThreadTail type

* Q -> Queue, thread defines renamed

* Reformat, add missing NULL

* Suggested changes and further casting cleanup

* Reformat

* padmgr name fixes
2022-04-08 20:20:23 -04:00
Robin Allen
9984c267d9
Names for some view things (#1191)
* Names for some view things

* Review: ORTHOGRAPHIC → ORTHO

* Review: dirty → dirtyFlags

* Review: Doc comment style

* Review: Define constants in terms of each other

* Review: Rename the ApplyToOverlay functions

* Update include/z64.h

Co-authored-by: fig02 <fig02srl@gmail.com>

* Review: Better View_LookAtInternal doc

* arg1 → mask

* View_LookAtInternal → View_LookAtUnsafe

* Review: View_SanityCheckEyePosition → View_ErrorCheckEyePosition

* sViewNotInitialized → sLogOnNextViewInit

* Remove VIEW_FORCE_ALL

* near/far → zNear/zFar

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* lookAt → at

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>

* near/far → zNear/zFar

* View_ApplyPerspective/Ortho: Remove from header instead of commenting

* lookAt → at

* Add fwd decls

* Fix external view->at accesses

* Missed these somehow

* lookAt → at

* Omit "Apply" in comments

* dirtyFlags → flags

* View_ApplyScissor → View_ApplyShrinkWindow

* Update src/code/z_view.c

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-04-09 00:50:28 +02:00
Dragorn421
4729ac131a
Angle cleanup - DEG_TO_RAD (#1157)
* Run formatter

* Touch up angle macros (parentheses and hex constants)

* Remove `DEGF_TO_RADF`, use `DEG_TO_RAD` instead

* Remove `DEGTORAD`, use `DEG_TO_RAD` instead

* Use `DEG_TO_RAD` more
2022-03-20 19:33:29 -04:00
Dragorn421
b2a3fb2f7f
Fix misc 8 (#1150)
* Use `s32` as type instead of `StackStatus` enum type

* `bossLimbDl` -> `bossLimbDL`

* Fixup comment refering to `Actor.velocity` by struct offset

* Fixup `feetFloorFlags` doc and -> `feetFloorFlag`

* Fixup `xyzDistToPlayerSq` comment

* Make `SkelAnime.mode` comment refer to `AnimationMode` (<- `AnimationModes`)

* Use enum names to refer to anim modes and break long lines in z64animation.h

* `EnDha_OverridePostDraw` -> `EnDha_PostLimbDraw`

* ichains cleanup

* Scene command ids usage cleanup

* Properly name unkXXX members as unk_XXX

* change `gSceneCmdHandlers` length in variables.h too

* Revert Unknown flags to unk0 & unk1

* Remove "current scene" mention from `Flags_*Unknown` as they aren't saved or loaded so not scene-specific

* `Struct_8011FAF0`: unk_00, unk_04

* Run formatter

* Do not break long lines in headers

* Revert "Fixup `feetFloorFlags` doc and -> `feetFloorFlag`"

This reverts commit c45b3611e7.
2022-03-16 22:14:56 +01:00
Dragorn421
a9526a3354
Fix misc 6 (#1148)
* Fix typo `vertexs` -> `vertices`

* Fix typo `limbMatricies` -> `limbMatrices`

* Fix some `gSPTextureRectangle` usage of fixed point constants

* Run formatter

* `ALIGN8` macro

* `object_skj` cleanup

* sholder -> shoulder

* cleanup `stdbool.h`

* Some function prototypes cleanup

* Use macros in `osVirtualToPhysical`
2022-02-20 14:22:29 +01:00
Dragorn421
e5ecdfd559
Misc. doc/cleanup 5 (#1096)
* `0` -> `CHEST_ANIM_SHORT` in `GET_ITEM` z_player macro

* fix typos in z_en_skj

Co-authored-by: Yanis42 <yalink88@gmail.com>

* `unkSkjStruct` -> `EnSkjUnkStruct`

* Use `EFFECT_SS_` enum in all `EffectSs_Spawn` calls

* Decimal for all `EffectSs_Spawn` priorities

* Use `OBJECT_INVALID` more

* `Object_IsLoaded` returns a boolean

* Add `@bug` in `DmaMgr_SendRequestImpl` about passing partially uninitialized struct

* Fix typo `forc_structure_alignment` -> "force"

* Move `CMD_F` to `z64cutscene_commands.h` since it is specifically for cutscene data

* Use `ALIGN16` macro more

* Use `ALIGN256` macro more

* Add `@bug` on two messed up 8-bytes-aligns

* Set `gSaveContext.nightFlag` to 0/1 instead of false/true

* Use `IS_DAY` macro more

* Run formatter

Co-authored-by: Yanis42 <yalink88@gmail.com>
2022-01-12 15:48:04 -05:00
engineer124
b8b983dd7f
Nature Ambience Documentation (#1063)
* Document nature ambience io data

* Document nature ambience functions

* Function headers

* Doc storing main bgm for nature/miniboss bgm

* Give temporary names to functions

* small cleanup

* add docs to clarify

* Break up nature ambience channel io data for easier reading

* Add info to where each nature ambience Id is used

* Name environmental sequence functions

* Use channel macros globally

* Add nature enum, revert env name

* Revert tough-to-name functions, use nature channel enum instead

* Fill in remaining enums from sequence 1

* PR Suggestions

* Improve macros

* remove clang-format off

* MINI_GAME_2 -> TIMED_MINI_GAME

* Revert to generic name

* Fix Spacing
2021-12-27 12:35:05 -05:00
engineer124
5e9d24fca4
Clean Up Sequence Structs in Scene/Save/z64 (#1051)
* Clean up sound scene struct

* Follow-up cleaning

* cleanup

* Document forcedSeqId

* Update include/z64save.h

Co-authored-by: fig02 <fig02srl@gmail.com>

* Update include/z64.h

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>

Co-authored-by: fig02 <fig02srl@gmail.com>
Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
2021-12-03 09:49:32 -05:00
fig02
4390dd74b6
boss_ganon (Ganondorf) OK (#1037)
* data migrated and OK

* some functions ported

* everything ported and updated

* merge message

* plenty of functions matched

* remove unwanted file

* 5 more, progress on update

* update matched

* fix proto

* fix

* func_808E06FC

* asm

* 2 left

* 1 more

* last function inital decomp

* Dbg MQ OK

* docs progress

* revert limb stuff

* some more docs

* docs progress

* more docs

* done with docs for now i think

* revert unwanted change

* some symbols

* anime2

* format

* small changes

* some more changes

* merge master and fix matrices

* reviews 1 and 2

* remove continue

* review 3 and 4

* un-name bodyPartsPos for now
2021-12-02 17:31:39 -05:00
Dragorn421
669732abbe
Misc Cleanup 2 (#1007)
* Cleanup `UNK_TYPE`, `UNK_PTR` usage

* Add some missing empty lines after declarations

* Remove some legacy comments from non-matching times

* Fix some grammar (mostly "it's"/"its")

* Use proper names for two symbols after ZAPD bugfix

* Cleanup `place_title_cards.xml`

* Use `NULL` to check against `D_8012D260` pointer

* Parentheses around some macro arguments

* wip proofread headers up to z64animation.h
2021-11-30 18:40:42 -05:00
engineer124
783ef3a117
Audio Sequence Player Ids Enum (#1040)
* bgm.h -> sequence.h

* First round of filling in enum

* More

* seqCmd

* format
2021-11-30 13:47:09 -05:00
Roman971
54d77c71f1
Improve gfxprint documentation and strings (#1028)
* Improve gfxprint documentation and strings

* Add GFXP_UNUSED_CHAR and rename bss variable
2021-11-28 08:48:17 -05:00
Tharo
a497f33bda
z_message_PAL, message_data_static and surrounding doc (#996)
* Initial progress on z_message_PAL, very messy

* Fix merge

* Some more progress

* Fix merge

* More z_message_PAL

* Small progress

* More small progress

* message_data_static files OK

* Prepare z_message_tables

* Matched another function, small updates

* Attempt to use asm-processor static-symbols branch

* Refactor text id declarations

* Begin large text codes parser function

* Fix merge

* Refactor done

* Build OK, add color and highscore names

* Remove encoded text headers and automatically encode during build

* Fix kanfont

* Various cleanups

* DISP macros

* Another match aside data

* Further progress

* Small improvements

* Deduplicate magic values for text control codes, small improvements

* Tiny progress

* Minor cleanups

* Clean up z_message_PAL comment

* Progress on large functions

* Further progress on large functions

* Changes to mkldscript to link .data in the .rodata section

* data OK

* Few improvements

* Use gDPLoadTextureBlock macros where appropriate

* rm z_message_tables, progress on large functions

* 2 more matches

* Improvements

* Small progress

* More progress on big function

* progress

* match func_80107980

* match Message_Update

* match func_8010BED8

* done

* Progress on remaining large functions

* Small progress on largest function

* Another match, extract text and move to assets, improve text build system

* Small nonmatchings improvements

* docs wip

* Largest function maybe equivalent

* Fix merge

* Document do_action values, largest function is almost instruction-matching

* Rename NAVI do_action to NONE, as that appears to be how that value is used in practice

* Fix merge

* one match

* Last function is instruction-matching

* Fix

* Improvements thanks to engineer124

* Stack matched thanks to petrie911, now just a/v/low t regalloc issues, some cleanup

* More variables labeled, use text state enum everywhere

* More labels and names

* Fix

* Actor_IsTalking -> Actor_TalkRequested

* Match func_8010C39C and remove unused asm

* More docs

* Mostly ocarina related docs

* All msgModes named

* Fix assetclean

* Cleanup

* Extraction fixes and headers

* Suggestions

* Review suggestions

* Change text extraction again, only extract if the headers do not already exist

* Fix

* Use ast for charmap, fix assetclean for real this time

* Review suggestions

* BGM ids and ran formatter

* Review comments

* rename include_readonly to include_data_with_rodata

* Remove leading 0s in number directives

* Review suggestions for message_data_static

* textbox pos enum comments, rename several enum names from Message to TextBox

Co-authored-by: Thar0 <maximilianc64@gmail.com>
Co-authored-by: Zelllll <56516451+Zelllll@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
2021-11-22 20:20:30 -05:00
engineer124
970513253b
Introducing Macros for BGM (Background Music) (#979)
* Import bgm Ids

* Small correction

* Fix kaleido

* Add defines for 0, 1, 0xFFFF. Fill in missing macros

* Improve names, move to bgm.h, add in macros to kankyo.c

* format

* Swap order of bgm macros and flags
2021-11-01 13:54:19 -04:00
Roman971
f8015f4cd5
Match the last function in z_kankyo.c (#984) 2021-09-21 16:19:04 -04:00
Synray
3b7ed8d943
Match Environment_Update and EnMThunder_Draw (#982)
* Match Environment_Update

* Match EnMThunder_Draw

* Format

* Capitalize hex
2021-09-21 18:29:43 +02:00
petrie911
b18227e6ad
Decomp the remaining functions in vr_box and import its data (#917)
* stuff

* not quite there

* data imported

* fixed some things and adjusted sSetupDLs

* remove setup dls

* remove alloc casts

* format

* palette swap

* Update src/code/z_vr_box_draw.c

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* improved loop matches

* fixed some comments

* format and adjustments

* palettes

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2021-09-21 04:48:43 -04:00
Roman971
a9604e267f
Match Skybox_Setup and 2 functions in z_kankyo.c (#980) 2021-09-20 19:33:44 -04:00
petrie911
e51f50f0ff
Decompile z_kankyo (#956)
* working

* start color switch

* progress

* progress

* progress on bgm func

* progress

* game over matched (except the rodata meme)

* start update

* progress

* lightning docs done

* progress

* progress

* progress

* progress

* progress

* can compile at least

* suns state, progress on kankyo_update

* some new names

* progress

* progress

* progress

* new functions

* cleanup

* more matches

* another match

* now functional

* format

* better match

* hugely improved update

* cleanup/review

* remove old changes

* review2

* review3

* missed one

* review4

* change asm filenames

* update doorwarp1

* review5

* Kankyo_ -> Environment_

* format

* merge master and format functions.h

Co-authored-by: Jacob Young <jacobly0@users.noreply.github.com>
Co-authored-by: fig <fig02srl@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2021-09-20 12:51:35 -04:00
louist103
201c9ec1cd
Decompile a bunch of objects (#603)
* Mostly done but shifted

* still messed up

* Almost OK

* OBJECT_JYA_OBJ OK, OBJECT_GR OK

* Done

* Merge master and format

* Cleanup

* Cleanup 2

* Start object MB dont merge yet

* Object_MB OK

* Object_ydan_objects OK

* General 'ydan' actor cleanup

* Forgot some small things

* Object_EC OK

* add .gitkeep and run format

* Object_sd OK but no textures cause of a zap issue

* PR fixes

* Fix object_sd

* fix ydan

* delete .gitkeep files

* OBJECT_BOX as far as it can go with current ZAP

* Fix undefined_syms

* Start child link object

* Push progress, dont merge yet

* Object_mori_objects OK

* Fixed?

* Fix conflicts again

* Seems like i missed some textures

* Extract data for BgBombwall

* More field

* ZAP YEP 2.0

* Object_Box OK

* Object_SD ok.  Ready to merge

* remove ASM and merge master

* remove ASM

* remove files wrongfully added to docs/

* Almost done

* Change comment in z_player_lib.c

* forgot some DLists in player_lib.c

* Fix conflict, run format

* Same as before but this time with Tex and TLUT

* Last few things

* fix object_GR and add limbs to object_sd

* Nane -> Name

* gChildDekuShieldMtx is now a matrix and not a blob

* PR fixes (Fig)

* add a space for comment in z_player_lib.c

* re push and new lines

* PR fixes (AngheloAlf)

* PR fixes (Roman)

* Fix Heishi2

* PR fixes (Fig)

* Replace spacing in a file

* PR fixes (Roman)
2021-05-26 18:59:21 -04:00
fig02
1639417327
code_80110450 (game over) OK* (#739)
* OK (sort of)

* remove hack

* clean up comments
2021-03-28 19:50:46 -04:00
petrie911
8fa6cb6ff9
Consistent naming for Math_ functions (#542)
* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* ZAP2 stuff

* ZAP why

* ZAP again

* maths

* Factoriali -> Factorial

* soon, soon

* renames

* rand

* docs

* merged

* formatting

* little more cleanup

* asm crept back in

* changes to MathF

* smooth criminal

* functions.h
2020-12-26 05:44:53 -05:00
Random
b010db7c19
Decompile z_sram.c (#431)
* Decompile z_sram.c

* rename Sram_CalcChecksum to Sram_WriteSaveSlot

* progress

* done i think

* add original name comments

* temp substructs

* minor fixes

* review

* review 2

* fix

Co-authored-by: fig <fig02srl@gmail.com>
2020-10-11 13:45:08 -04:00
Random
174af7384d
libultra cleanup (#215)
* cleanup libultra

* fixes

- use quotes instead of <> for includes
- add macros for zelda specific thread priorities
- fix Makefile
- properly format the remaining pfs structs

* fix button macros + add CHECK_BTN_ANY/CHECK_BTN_ALL

* remove ULTRA_ABS

* fix includes

* update z_player.c/z_lib.c + run format.sh

* merge upstream/master

* fix include in En_Goroiwa

* fix includes
2020-10-03 11:22:44 -04:00
Roman971
8cfe7cce9f Format all src C files 2020-03-22 22:20:03 +01:00
Jack Walker
087f561f77 First proper commit. 2020-03-17 00:31:30 -04:00