1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00
Commit Graph

70 Commits

Author SHA1 Message Date
cadmic
67d4f0f36a
Match retail z_skin.c, z_skin_awb.c, z_skin_matrix.c (#1697)
* Match retail z_skin_matrix.c

* Match retail z_skin_awb.c

* Match retail z_skin.c

* Remove same-line hacks
2024-02-02 13:29:58 -05:00
cadmic
4e2d2885bc
Match retail padmgr.c and sys_rumble.c (#1693)
* Match retail padmgr.c

* Match retail sys_rumble.c

* Poke jenkins
2024-02-02 12:25:44 -05:00
engineer124
1e21f69b37
z_play retail OK (#1688)
* z_play OK

* cleanup spacing

* PR
2024-02-01 17:00:27 -05:00
Tharo
5e8e01f110
z_view.c gc-eu-mq OK (#1681)
* z_view.c retail

* Replace PERSPECTIVE_EDITOR_ACTIVE, adjust PRINTF selection condition

* Macro-ify View_ErrorCheckEyePosition
2024-01-31 20:09:16 -05:00
cadmic
4bd005520d
Remove a double #endif (#1672) 2024-01-30 20:15:57 -05:00
cadmic
9816f62129
Define OOT_DEBUG=0 in retail builds (#1658)
* Define OOT_DEBUG=0 in retail builds

* Fix ifndef

* Replace VI_MODE_EDITOR_INACTIVE

* Revert "Replace VI_MODE_EDITOR_INACTIVE"

This reverts commit f7c4cae7c3.

* Replace VI_MODE_EDITOR_INACTIVE, take 2

* Revert EnBom_Draw
2024-01-30 13:54:38 -05:00
Yanis42
9f169a67cd
Match `game.c` - OK (#1644) 2024-01-29 15:27:29 -05:00
cadmic
90a6268460
Test for __sgi instead of __GNUC__ for PRINTF macro (#1612) 2024-01-18 08:47:22 -05:00
cadmic
6b5533ccd9
Create debug macros for LogUtils functions (#1610) 2024-01-16 09:59:02 -05:00
cadmic
324db1d578
Replace most osSyncPrintf calls with PRINTF macro (#1598)
* Replace most osSyncPrintf calls with PRINTF macro

* DEBUG -> OOT_DEBUG
2024-01-12 10:38:13 -05:00
cadmic
cd917b0cb8
Create debug macros for common functions (#1597)
* Create debug macros for common functions

* Revert NDEBUG change

* MALLOCR -> MALLOC_R

* DEBUG -> OOT_DEBUG

* Use the same name for debug and non-debug matrix functions

* Fix file/line argument order

* Revert g[s]DPNoOp[Tag]

* Use SystemArena_MallocDebug directly in GameAlloc_MallocDebug

* MTXF_TO_MTX -> MATRIX_TO_MTX
2024-01-09 07:59:03 -05:00
Tharo
3475651701
libc cleanup (#1568)
* libc cleanup

* Suggested changes, small alloca tweak

* Remove printf include
2023-10-27 16:06:44 +02:00
Tharo
7235af2249
Apply noreturn attribute where applicable (#1532) 2023-09-09 10:24:52 -04:00
Dragorn421
6e7a6d4181
Split SaveContext into sub-structs (#1393)
* Split SaveContext struct

* run formatter

* Remove temporary-until-split stuff in z_sram

* .

* run formatter
2023-08-13 15:24:26 -04:00
Dragorn421
da2e8a8f2c
Skelanime/Animation header cleanup (#1434)
* Skelanime/Animation header cleanup

* touch up names of the two existing moveFlags macros

* formatter is a dum dum D:
2022-11-30 18:46:12 +01:00
Dragorn421
cc2409606e
Update item names (#1376)
* Reevaluate item names (`ItemID` enum)

* format

* Carry `ItemID` changes to `ExchangeItemID`

* format

* Add item enum comments on items to slots array

* Rename slots according to current item enum names

* Add item enum comments on items to PlayerItemAction array

* Rename PlayerItemAction enum names according to current item enum names

* gi, gid names...

* `QUEST_GERUDO_CARD` -> `QUEST_GERUDOS_CARD`

* `DUNGEON_KEY_BOSS` -> `DUNGEON_BOSS_KEY`

* `UPG_` sticks/nuts : +deku

* Fixed remove array enum comments in `sDebugSaveEquips`

* "magic beans" -> "magic bean" (singular)

* cucco -> chicken (the one from weird egg, "alarm clock bird" from literal japanese translation)
2022-11-16 13:23:27 -05:00
Tharo
c165ed015c
Improvements to Video Interface related functions and data (#1332)
* Improvements to VI related functions

* Fix

* Suggested changes

* Comment enum values

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

* Suggested changes, plus comments in visetspecial.c

* Name gViConfigModeType

* Further suggested changes

* Format

* Fix comment on modeLPN2

Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
2022-11-13 18:07:27 -05:00
Roman971
f5a7c5612b
Use intptr types in more code files (#1385)
* Use intptr types for segments and a few system files

* Use intptr types for more dma rom addresses

* Use intptr types in data referring to rom files

* Update and cleanup a few message casts

* Change sys_cfb functions and debugHeapStart to use pointers

* Update graph.c for the sys_cfb return type change
2022-10-02 11:38:09 -04:00
Tharo
0d52a4aebd
More documentation for PreRender.c (#1340)
* More documentation for PreRender.c

* Comment fix

* Suggested changes

* More on coverage reading functions

* Further comment changes

* Further suggestions
2022-08-28 12:18:20 -04:00
Tharo
451b24f79b
Fix a number of warnings when compiling with GCC (#1239)
* Silence a number of GCC warnings

* Remove

* Suggested changes

* Format

* Fix comment in en_go2
2022-06-03 18:51:23 +02:00
fig02
2e6279bc8e
PlayState Rename (#1231)
* global context -> play

* fix PlayState* PlayState
2022-05-21 14:23:43 -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
engineer124
bf56c94f0f
Document Sub-Cameras (#989)
* Copying SubCam Changes from PR 908, made it to the end of bosses

* Finish copying over PR

* format

* More cleanup

* clean-up

* PR Suggestions, Clean-Up, Improvement in CS

* Remove substructs from fd/fd2

* format

* Improve fishing

* minor fix

* Make CutsceneCameraDir more general

* `sActiveCamMove` -> `sCamMove`

* Fix conflict with object kankyo

* Add CAM_ID_MAIN to object_kankyo

* Improve cam cutscenes further

* Revert cutscene cmd names (better for a separate PR)

* At -> LookAt in the context of Cutscenes

* Missed naming in diving game

* Format

* Fill in Ganon2 Names (now that it's matching)

* format

* `sActiveCamId` -> `sReturnToCamId`

* activeCamId -> returnToCamId

* Discord Discussions

* FIRST

* Move macro to bottom, comments

* More suggestions

* PR suggestion, cleanup comment

* Oops

* add comments

* Adjust comment

* Change edge-case

* whoops

Co-authored-by: fig02 <fig02srl@gmail.com>
2022-05-12 20:35:31 +02:00
Dragorn421
b9fded7b4e
Doc equips usage (inventory, current and player-specific constants) (#1142)
* Doc equips usage (inventory, current and player-specific constants)

* Improve some comments

* `currentSword`(`Item`) -> `currentSwordItemId`

* Comments on the right in `D_801261F8`

* Improve `sDebugSaveInventory.equipment` formatting with extra parentheses

* Use constants for `sNewSaveInventory.equipment`

* Run formatter

* Make comments in z64save.h header a single line even if very long

* `CHECK_OWNED_EQUIP_ALT`

* One more use of `CHECK_OWNED_EQUIP`

* `OWNED_EQUIP_FLAG`

* `OWNED_EQUIP_FLAG_ALT`

* Improve (?) giving sword by item id

* "half-byte" -> "nibble"

* Improve equips for setting kokiri sword

* Improve (?) checking boots by item id

* Improve (?) checking equips by item id

* Fixup one spot assuming `EQUIP_TYPE_SWORD == 0`

* Comments on the right in `sBootDListGroups`
2022-04-30 18:18:56 +02: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
Anghelo Carvajal
2191c8b0a0
Use __builtin_offsetof for non IDO builds (#1140)
* Add offsetof macro

* Change old uses of OFFSETOF with offsetof
2022-02-13 00:05:11 -05:00
Anghelo Carvajal
8926b08582
Force required alignment on DMA related stuff (#1135)
* Force dword alignment on OSPifRam

* force_structure_alignment on each Font buffer

* Add ALIGNED8 macro to gSaveContext to ensure alignment

* create alignment.h header and use ALIGN8 in PLAYER_LIMB_BUF_COUNT

* add comment in common_data

* Roman's suggestion

* player_limb_buf_count

Co-authored-by: fig02 <fig02srl@gmail.com>
2022-02-11 18:23:57 -05:00
playerskel
82cedcc3ef
proposal for link age macros (#1119)
* proposal for link age macros

* apply @Dragorn421 suggestions

* also annotate the slinkage variable
2022-01-24 19:08:37 -05:00
Dragorn421
a9284494f2
Use defines for actor flags (#873)
* Add ACTOR_FLAG_ defines

* Add ACTOR_FLAGS_ALL macro and use ACTOR_FLAG_* constants everywhere

* Remove unused ACTOR_FLAG_* constants

* actor flags in bigokuta & ko

* actor flags in obj_mure

* actor flags in stalfos, twinrova & ganon2

* actor flags in morpha & barinade

* name some previously missed actor flags

* found some comments using hex for actor flags

* Actor flags in ovl_En_Ganon_Mant

* Actor flags in EnWf

* Flags in en_zf

* Actor flags in BossGanon (FeelsOKMan)

* Remove `ACTOR_FLAG_NONE`

* Wrap expansion of `FLAGS` in parentheses

* `ACTOR_FLAGS_ALL` -> `CHECK_FLAG_ALL`

* Move `CHECK_FLAG_ALL` to `macros.h`

* Run formatter
2021-12-05 19:11:38 -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
Roman971
6efb590699
Various minor cleanups (#1029)
* Fix some disp usage in EffectSsGMagma2

* Fix some incorrect SAC flags

* Remove some instances where bool was used

* Fix a few line numbers to be decimal

* Remove MatrixInternal and use Mtx instead

* Fix gs flag names to be plural for consistency

* Fix some hex numbers to be uppercase

* Fix instances of 0X for hex numbers
2021-11-26 17:37:33 -05:00
Anghelo Carvajal
c36decaf50
Texture alignment macro and a bit of cleaning (#927)
* Add ALIGNED8

* Add designated initializers for cutscene macros

* Fix typo in ovl_Boss_Sst XML

* Fix extraction of ovlMagicDark

* names suggestions

* Remove braces

* fix
2021-11-24 21:41:23 -05:00
fig02
a3b4dcf388
File Select (z_file_choose) OK (#1012)
* matching split

* migrate progress

* split done and rodata migrated

* all data migrated to c

* start init

* progress

* progress

* progress

* progress

* progress

* progress

* copy done

* progress

* erase and settings done

* progress

* progress

* progress

* start keyboard

* progress

* progress

* progress

* progress

* Minor progress

* fix z_magic_dark issue

* func_80806F34 decomp'd

* verified equivalence

* one fix

* format

* merge petries work

* reorganizing

* lots of reorganizing and wraning fixing

* rename file

* remove language enum

* unwanted changes

* some symbol replacement, organization, and some names

* all symbols replaced, some organization

* some more cleanup

* continue docs

* Match the remaining functions in file_choose

* merge master

* select mode documented, all functions in file_choose.c named

* nameset functions named, some other cleaning

* some more general cleanup

* stub comments for cm, name a few things

* fix data and sizeof

* copy/erase functions and modes named

* rename assets, format

* change some struct members

* fixes

* review1

* fix maching error

* extract VTX data

* re add werror to ZAPD

* review 2

* fix

* remove file boundary padding

* remove zeroes

* review3

* change skybox stuff

* changes to  vs  etc

Co-authored-by: KrimtonZ <krimtonz@gmail.com>
Co-authored-by: Thar0 <17233964+Thar0@users.noreply.github.com>
Co-authored-by: mzxrules <mzxrules@gmail.com>
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Roman971 <romanlasnier@hotmail.com>
Co-authored-by: Louis <louist103@gmail.com>
2021-11-15 22:33:44 +01:00
louist103
e3f1ccd902
Fix all headers to comply with C standard (#957)
* Fix all headers to comply with C standard

* fix a file in libultra

* Update include/stdbool.h

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

* Update stdbool.h

* Update z64animation.h

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2021-09-15 19:24:19 -04:00
zelda2774
4444c5ea35
audio_synthesis OK + partially documented (#920)
* Match func_800DDB64

* Match func_800DC910

* remove stack comments

* Move nop padding to ucode_disas

* Partially label audio_synthesis

To some extent copied from sm64.

* cleanup

* Reverb and ReverbBits have nothing to do with reverbs

* review

* naming

* Undo changes to permuter_settings.toml

Co-authored-by: zelda2774 <zelda2774@invalid>
2021-08-31 18:53:35 -04:00
engineer124
1117783731
Macros: PLAYER -> GET_PLAYER(globalCtx), ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx) (#921)
* PLAYER -> GET_PLAYER(globalCtx)

* ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx)

* PR Suggestions

* formatter

* Add brackets

* remove from actorfixer.py

* Bring back actorfixer.py change
2021-08-31 12:22:03 +02:00
louist103
556cdad7eb
Big cleanup (#775)
* Adult and child2 macros OK

* ICHAIN cleanup

* almost all overlay data

* format.sh

* func_8002FBAC NON_EQUIVALENT

* PR fixes (MZXrules)

* fix

* change //@ bug to //! @bug

* merge master and missed a //@bug

* fix ruto

* some more cleanup (#2)

* more `! @bug` formatting cleanup

* parenthesis cleanup

* hex naviEnemyId

* run formatter

* replace `IS_NOT_` macros with `!IS_`

* run formatter

* run formatter

* PR fixes (fig)

* Missed something

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2021-08-22 01:12:57 +02:00
Random
d223e246c7
db_camera (#842)
* Decompile shrink_window.c

* progress

* progress

* makefile

* progress

* match 8 functions

* 1 more match

* match 2 functions

* decompile func_800B9638

* fix flow

* migrate .bss

* doc

* name some stuff

* fixes

* comment fix

* remove scene .c files

* old z_camera .s files

* revert z_camera change

* revert unwanted z_camera change

* fixes

* remove unused files, run clang-format and fix non-matching

* fix clang-format causing non-matching

* remove newline + old comment in func_800B3BD4

* make db_camera global variables static

* add s prefix to startic variables

* change magic constants

* rename "unk_50"

* Match func_800B3BD4 and Match DbCamera_UpdateDemoControl (-bss)

* Lots of progress on update

* Mainly cleanup

* run format.sh + remove unused asm

* replace chevrons with add quotes

* remove useless cast + use correct empty argument function declaration

Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
2021-07-26 00:34:25 +02:00
Roman971
a53e084cd2
Decompile the pause menu aka. ovl_kaleido_scope (+ minor changes) (#803)
* Decompile ovl_kaleido_scope + minor cleanups

* Add a common header for ovl_kaleido_scope

* Start cleaning up and documenting kaleido_scope (+ some interface docs)

* Improve and fix some kaleido_scope non matchings

* Match KaleidoSetup_Init

* Extract icon_item_fra/ger_static files

* Add more documentation and matches to kaleido_scope

* Improve the z_kaleido_collect.c non matching

* Rename z_kaleido_8081EFF0.c to z_kaleido_prompt.c

* Update most kaleido variables to be static

* Improve GS flag macros

* Improve z_lmap_mark.c and extract z_lmap_mark_data.c with a script

* Various minor fixes and improvements

* Minor fixes and review changes

* Review changes part 2

* Rename gSetTileCustom to gDPSetTileCustom

* Review changes part 3
2021-05-02 19:15:16 -04:00
Anghelo Carvajal
98aef8988a
assert macro OK (#755)
* create assert macro and replace a bunch of __assert

Signed-off-by: angie <angheloalf95@gmail.com>

* Another bunch of assert

Signed-off-by: angie <angheloalf95@gmail.com>

* more assert

Signed-off-by: angie <angheloalf95@gmail.com>

* assert(false)

Signed-off-by: angie <angheloalf95@gmail.com>

* last assert used in matching code

Signed-off-by: angie <angheloalf95@gmail.com>

* the non-matchings

Signed-off-by: angie <angheloalf95@gmail.com>

* typo

Signed-off-by: angie <angheloalf95@gmail.com>

* format

Signed-off-by: angie <angheloalf95@gmail.com>

* change macro to uppercase

Signed-off-by: angie <angheloalf95@gmail.com>

* Apply suggestions from code review

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

* Change ASSERT(false) to ASSERT(0)

Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
2021-04-29 14:39:46 -04:00
petrie911
8f0549cd9a
PreRender decomped and equivalent (one small non-matching) (#723)
* now equivalent

* stuff

* remove struct

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2021-03-20 15:10:10 -04:00
Synray
79c8accfab
z_play.c OK (#701)
* z_play.c OK

* Change ~0x13 -> -20

* Back to hex
2021-02-15 18:29:06 +01:00
Tharo
f9d96d9f73
Fix most compiler warnings in the boot and code segments (#674)
* Less warnings in boot & code segments

* few more warnings gone

* Ran formatter

* z_view warning gone

* -> 1

* f31 -> 31

* Remove function casts

* Few more small improvements

* Separate declaration and assignment in func_80091738 and Item_Give

Co-authored-by: Thar0 <maximilianc64@gmail.com>
2021-02-13 19:49:40 -05:00
petrie911
7c6b953f38
Change DECR to use -- (#649)
* DECR fix

* cleanup on some literals

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2021-01-19 14:27:57 -05:00
fig02
00a5edea71
Actor Struct Changes (and a few related things) (#617)
* reformat header

* type -> category

* done for now i think

* some more stuff

* first -> head

* focus

* flag comment

* ground -> floor

* remove asm, name wrapper funcs

* name func, format

* review

* targetPriority, format

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0305ec2c2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0305ec2c2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* comment

* review

* feet flags

* horse shadow
2021-01-18 16:04:04 -05:00
Tharo
2a13d71848
Highscores array (#600)
* Highscores

* Review suggestions

Co-authored-by: Thar0 <maximilianc64@gmail.com>
2021-01-05 14:57:18 -05:00
petrie911
695bc37be4
Bg_Gnd_Iceblock and Bg_Ice_Objects (sliding ice blocks) (#534)
* 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

* a good start

* done

* Log

* formatting

* thisx

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
2020-12-29 13:11:11 -05:00
Tharo
26c38834ec
ovl_Door_Shutter OK (#413)
* Initial progress

* Some more progress

* Fix merge

* OK

* Small improvements

* Further improvements

* Some documentation, ran formatter

* Small fix

* Several review suggestions

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

* Further review changes

* Space out declarations, better boolean comparisons

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

* Some ands to modulos

* Swap condition

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

* Fix merge, PR suggestions

* review

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Co-authored-by: fig <fig02srl@gmail.com>
2020-12-03 16:55:01 -05:00
fig02
3c5fe66dcd
Use macros for oGfxCtx accesses (#465)
* fix colliderinit typo

* fix initchain

* reloc

* add defines

* add defines

* missed some on merge

* rename gfxCtx and add comment

* remove space
2020-10-29 17:31:09 -04: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