summaryrefslogtreecommitdiff
path: root/src/code/z_sram.c
AgeCommit message (Collapse)Author
2026-05-27Document `EnSa` (#2744)Jordan Longstaff
* Document `EnSa` * Rename INFTABLE entries * Animation set -> group * Remove trailing commas * Rename textState field * Remove trailing comma * Rename EVENTCHKINF flag * Correct frowning/closed swap of enum * Rename INFTABLE flag
2025-06-17Document `Save.cutsceneIndex` and adjacent data / code (#2286)Leonid Kapitonov
* introduce `enum CutsceneIndex` as a first step * crudely rename `enum CutsceneIndex` entries * run `check_format.py ...` separetely so that it doesn't clutter previous commit. still, allowing `clangd LSP` to run format-on-save yields inconsistent results for me with the project's tooling, especially for header files * apply a draft PR suggestion Co-authored-by: mzxrules <mzxrules@gmail.com> * rename `CS_INDEX_*` with PR suggestions and some additional observations reverified with > `check_format.py ...` > `make ...` additionally: - current clang-format lacks a rule for trailing commas - compiler says about them `cfe: Warning 624` * improve `CS_INDEX_*` naming, rem `ENTRANCE` suffix https://github.com/zeldaret/oot/pull/2286#discussion_r1829165205 reverified with > `check_format.py ...` > `make ...` * apply Jenkins fixes https://jenkins.deco.mp/job/OOT/job/PR-2286/4/console hmm, i do need this automation locally to * apply a PR suggestion https://github.com/zeldaret/oot/pull/2286#discussion_r1829219841 * remove redundant comments, fix the header comment and add a comment chunk from https://github.com/zeldaret/oot/pull/2286#discussion_r1829108940 * rename the flag for freeing `nextCutsceneIndex` * rename the flag for automatic `sceneLayer` calc it gets assigned to the `nextCutsceneIndex`, so `CS_INDEX_NONE` name was misleading * use explicit scene layer names instead of numbers * ok, now the last two `CS_INDEX_*` are less unknown the purpose of `CS_INDEX_BARRIER` is not quite clear still * apply Jenkins fixes https://jenkins.deco.mp/job/OOT/job/PR-2286/14/console * run `fix_bss` locally `ntsc-1.2` refused to comply though * revert all local to the branch bss shifts * ugh, use defines instead of an enum probably size of enum entries doesn't match well? originally these were just numbers. besides, not like it's a real enumeration from zero to a value or some bit flags * still, add a BSS pragma for `z_demo.c` * apply review changes * factor out a cutscene layer formula * give scene layers names throughout code * apply Jenkins fixes https://jenkins.deco.mp/job/OOT/job/PR-2286/32/console * tweak `CS_INDEX` descriptions * apply PR review suggestions * rename "auto" -> "default" * apply PR review suggestions https://github.com/zeldaret/oot/pull/2286#discussion_r1868693980 essentially reverts 106cb1021be88f745ee303838c11c7d7cbf9c79d, except for 2 generic `z_scene.c` lines * apply Jenkins fixes https://jenkins.deco.mp/job/OOT/job/PR-2286/77/console * Apply suggestions from code review Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: mzxrules <mzxrules@gmail.com> * apply Jenkins fixes https://jenkins.deco.mp/job/OOT/job/PR-2286/175/console * Move CS_INDEX_* macros to z64save.h, with the definition of gSaveContext.save.cutsceneIndex * `#define CS_INDEX_D 0xFFFD` and co. Co-authored-by: cadmic <cadmic24@gmail.com> * add comment on CS_INDEX_D * review * CS_INDEX_NONE is back * bss * expand comment about 0xFFFD * fix comment about 0xFFFF usage * review --------- Co-authored-by: mzxrules <mzxrules@gmail.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: cadmic <cadmic24@gmail.com>
2025-06-04Remove "z64" prefix from all headers (#2518)fig02
* z64 - a * z64 - b * z64 - c * z64 - d * z64 - e * z64 - f * z64 - g * z64 - h * z64 - i * z64 - l * z64 - m * z64 - o * z64 - p * z64 - q * z64 - r * z64 - s * z64 - t * z64 - v * restore file * fix merge * fix merge --------- Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2025-04-27Delete macros.h; Delete global.h (#2516)fig02
2025-04-26add array_count.h (#2514)fig02
2025-04-23macros.h 1/?: `PRINTF` and `T` (#2509)fig02
* create printf and translation headers * non-overlays complete * printf finished * move T macro * edit comment * fix error * fix bss * remove is_64 * fix bss
2025-04-19Remove Variables.h; Decouple z64.h from global.h (#2507)fig02
* progress * z64.h issues sorted * remove variables.h * format * n64 fix * another fix * did the wrong fix * fix libleo * fix bss * review * remove instead of comment
2025-04-05Remove functions.h (#2501)fig02
* split most of functions.h * osdriverominit * forgot include * fix * remove functions.h * temporary fix for fix_bss * fix bss * revert fix_bss.py change
2025-03-27SoundMode -> SoundOutputMode (#2475)fig02
* SoundOutputMode, and move SoundSetting * missed a couple * format * move SoundSetting
2025-02-24Reduce dependencies on global.h (9) (#2488)mzxrules
* split game states * split all GameState headers * match fig names * deduplicate headers from bad merge * split z64actor.h into z64actor_profile.h, z_actor_dlftbls.h * fix compile error * .bss
2025-02-20Create headers for Game States (#2482)fig02
* make headers for gamestates * fixes * fixes 2 * bss
2025-02-19Reduce overlay dependencies on global.h (8) (#2478)mzxrules
* move variables into z64environment.h * z_room.h * z64sram.h, z64ss_sram.h, z64font.h, kanread.h * z64lifemeter.h, z64debug.h, debug_arena.h * buffers.h * remove z_bgcheck global * gamealloc.h * suggestions * .bdd
2025-02-16Reduce overlay dependencies on global.h (7) (#2472)mzxrules
* z64env_flags, z64quest_hint_commands * z64cutscene_spline, z64save.h moved from z64.h * bss * pr suggestion * bss * suggestions
2025-02-15Use enums for settings in SRAM header (#2429)cadmic
* Use enums for settings in SRAM header * Fix bss * Uglify z_en_mag to match ique
2025-01-20Write about IDO and EGCS in compilers.md (#2432)cadmic
* Write about IDO and EGCS in compilers.md * Fix typo * Fix another typo * Apply suggestions from code review Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> --------- Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com>
2025-01-17[iQue] Match z_sram (#2426)cadmic
* [iQue] z_sram: Use iQue-specific read/write macros * [iQue] z_sram: Make checksum a struct * [iQue] z_sram: Finish matching * Call the trigraph usage a bug * Fix bss * Sram_iQueReadWrite -> Sram_ReadWriteIQue * Use SRAM_HEADER_MAGIC for loop bound * Rename sZeldaMagic -> sSramDefaultHeader and use less char literals
2025-01-08[iQue] Create/update macros for printing debug strings (#2398)cadmic
2024-12-21Restructure event flags in z64save.h (1/?) (#2380)mzxrules
* Simplify most event flags * EVENTINF_HORSES_INDEX -> EVENTINF_INDEX_HORSES * Add missing index numbers * pr suggestions * Clean up INGO_RACE flags
2024-11-17Decouple Debug Features From gc-eu-mq-dbg (#2296)fig02
* rename OOT_DEBUG to DEBUG_FEATURES * makefile changes * add DEBUG_ASSETS * fix DEBUG_FEATURES usages * format * fix errors * review * fix problem and review2 * review * add DEBUG_FEATURES to DEBUG_ASSETS check * review * whoops * format
2024-09-30[ntsc-1.0/1.1] Match "game engine" files (#2244)cadmic
* [ntsc-1.0/1.1] Match "game engine" files * Use R_START_BTN_X/R_START_BTN_Y * Comment obvious bugs * Move Magic_Fill comments * Move EVENTINF_HORSES_INDEX printf inside #if * Replace "this function"
2024-09-28[PAL N64] Match file select language selection (#2240)cadmic
* [PAL N64] Match file select language selection * sInitialLanguageInputTimerY -> sInitialLanguageInputTimerX
2024-09-12Add OOT_PAL_N64 and move other shorthands to versions.h (#2188)cadmic
* Move definitions of OOT_NTSC/OOT_PAL/OOT_MQ to versions.h * Add PAL_N64 shorthand
2024-08-24T() macro 4 (#2084)Dragorn421
* T() in z_kankyo.c * T() in z_demo.c * T() in z_effect.c * remaining T() in z_sram.c * T() in z_en_encount1.c * T() in z_en_owl.c * T() in z_en_wonder_item.c * fix forgot T * Demonstration -> Demo
2024-08-23T() macro 2 (#2073)Dragorn421
* T() in idle.c, irqmgr.c, padmgr.c, z_locale.c * T() in z_sram.c * T() in z_bgcheck.c, z_scene.c * format
2024-08-08Match NTSC file select (#1998)cadmic
* Match NTSC file select Co-authored-by: inspectredc <inspectredc@gmail.com> * nes -> eng in macros * Duplicate more code but use less #ifs * Format --------- Co-authored-by: inspectredc <inspectredc@gmail.com>
2024-07-17Create FILENAME_ macros for NTSC filename encoding (#1986)cadmic
* Create FILENAME_ macros for NTSC filename encoding * Add defines/comments for all filename characters * FILENAME_EXCLAMATION_POINT -> FILENAME_EXCLAMATION_MARK to match kanji file * hirigana -> hiragana
2024-02-27Add proper bug comment for gSaveContext.save.dayTime getting cleared as s32 ↵Tharo
when it is u16 (#1900) * Add proper bug comment for gSaveContext.save.dayTime getting cleared as s32 when it is u16 * Formatting?
2024-02-07Match retail z_sram.c (#1722)cadmic
2024-01-12Replace most osSyncPrintf calls with PRINTF macro (#1598)cadmic
* Replace most osSyncPrintf calls with PRINTF macro * DEBUG -> OOT_DEBUG
2024-01-09Create debug macros for common functions (#1597)cadmic
* 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
2023-08-13Split `SaveContext` into sub-structs (#1393)Dragorn421
* Split SaveContext struct * run formatter * Remove temporary-until-split stuff in z_sram * . * run formatter
2023-01-10Fix misc 19 (#1488)Dragorn421
* "bgs sword" -> "biggoron sword" * Animation_ChangeImpl: last arg is `ANIMTAPER_` enum * TransitionTileStatus -> state * Tiny gbi.h formatting fixups * some cleanup on floormaster * misc float ops cleanup * sunsSongState = SUNSSONG_INACTIVE * continueFlag == CS_CMD_STOP * fix few camera names inconsistency * textual 0 padding? not on my lawn * libultra: construct address from end of dmem rather than oob from imem * more free1 -> 2 fixup
2022-12-05Cleanup post good scene names (#1452)Dragorn421
* Cleanup scene names * missing scene id use * rename scene draw config functions * remove now useless comments * format * fix double defense/magic swapped * try precision on "from potion shop" Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
2022-11-26Name scenes (scene enum, entrance enum, various identifiers) (#1343)Dragorn421
* Comment names on titled scenes * Comment some more scene names * Comment some map assets symbol prefixes * Name collapse sequence scenes (from the non-collapse equivalent scene's name + `_COLLAPSE`) * Name ganon/ganondorf boss scenes (symbol prefix suffixed with `Scene` to prevent confusion with boss actors) * Fix symbol prefix for back alley night scene * Name the two grave scenes (normal and fairy's fountain variant) * Name most houses, name/update misc scenes Co-authored-by: fig02 <fig02srl@gmail.com> * (hakaana) `GRAVE` -> `REDEAD_GRAVE` to be more specific Co-authored-by: fig02 <fig02srl@gmail.com> * `miharigoya_scene`: `market_guard_house` * `kakariko_scene` -> `kakariko_center_house` * `richards_house` -> `dog_lady_house` (for localization differences) * Revert "Comment some map assets symbol prefixes" This reverts commit 210a38a6288d5d2fa318059f31988ca7ceb5c708. * remove other xml prefixes * ganon_boss, ganondorf_boss * comments to namefixer * `KAKARIKO_CENTER_HOUSE` -> `KAKARIKO_CENTER_GUEST_HOUSE` * two collapse sequence scenes -> `GANONS_TOWER_COLLAPSE_`interior/exterior * Run namefixer `find src include -type f -exec ./tools/namefixer.py {} \;` * run formatter Co-authored-by: fig02 <fig02srl@gmail.com>
2022-11-16Update item names (#1376)Dragorn421
* 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-01Rename `vt.h` to `terminal.h` (#1339)Dragorn421
* `vt.h` -> `terminal.h` * `VT_` -> `T_` (as in Terminal) * `vt.h` -> `terminal.h` in includes too Pepega * Sort out tiny terminal.h include inconsistencies * Format * -> `TE_` * format * `TE_` -> back to `VT_` (parkour!) * explicit VT
2022-10-15Enum comments on some arrays (#1404)Dragorn421
* Comment enums on some big arrays * z_camera_data too * comment in get item table on own lines * `sDebugSaveInventory.ammo` * More in z_sram * `0xFF` -> `ITEM_NONE` in `sNewSaveInventory.items`
2022-10-13Fix misc 17 (#1392)Dragorn421
* Some cleanup on bgcheck waterbox y funcs * Fix some typo/spelling * EnFz_ApplyDamage match fixup * Turn another sus construction into a switch * Fixup comment on restoring MS as adult * "doesnt, isnt" -> "doesn't, isn't" * Hunt down whitespace at end of lines * Format (clang-format does not like figs bug comment on bongo cutscene unskip sadge) * Viewport z scale/translation: `0x1FF` -> `G_MAXZ/2` (see proman "9.7 Mixing CPU and SP Addresses", "12.7.6 Depth Source") * static symbols: g -> s prefix * Link young/old -> child/adult * Fixups * Get rid of signed vs unsigned comparison warning by changing room temps to s32 * waterbox search funcs consistency * Revert "waterbox search funcs consistency" This reverts commit 8f386e038f5e735f0f5f1240fc4da7bec4e8c7e2. * `curWaterBox` -> `waterBox`
2022-08-23Minor Misc Cleanup (#1360)engineer124
* misc cleanup * missed one * EffectSsDust_UpdateFire * revert change, needs more testing
2022-07-31sceneNum -> sceneId (#1338)Derek Hensley
* sceneNum -> sceneId * forgot to save play * scene -> sceneId where appropriate * Missed 1 + format * Update src/code/z_sram.c Co-authored-by: mzxrules <mzxrules@gmail.com> * Update src/code/z_sram.c Co-authored-by: mzxrules <mzxrules@gmail.com> * PR * Fix Co-authored-by: mzxrules <mzxrules@gmail.com>
2022-06-23Rename game states (#1294)Dragorn421
* `TitleSetup` -> `Setup` * `Title` -> `ConsoleLogo` * `Opening` -> `TitleSetup` * `FileChoose` -> `FileSelect` * `Select` -> `MapSelect` * prenmi/sample `Context` -> `State` * Revert filename changes * . * setupstate cleanup * Oops, `GameState` -> `SetupState`
2022-06-13Fix misc 14 (#1279)Dragorn421
* Remove fake temp in `BossDodongo_DrawEffects` * `OS_WRITE` for `__osSpRawStartDma` `direction` * remove outdated comment * fixup osRecvMesg * make sShopkeeperStores static * `PHYSICAL_TO_VIRTUAL(gSegments[0])` -> `SEGMENTED_TO_VIRTUAL(NULL)` (mimics `CollisionHeader_SegmentedToVirtual`) * Run formatter * Remove assets from include path in suggested vscode properties * Fix `osCreateMesgQueue` getting `OS_MESG_BLOCK` as `count` instead of `1`
2022-05-23Document Magic (#1199)engineer124
* Magic docs WIP * More docs, first round finished * Better docs * More renaming * Simpler name * Another small adjustment * rm if(1) * Better names again after in-game testing * Change comments * change comment * Big rename based on all the suggestions * Small touch-up * More PR Suggestions * RESTORE_IDLE -> RESET * More docs * Capitalization * PR suggestions * Make declaration consistent * Health_ChangeBy (amount) * PR Suggestions * Missed one * More PR Suggestions * Change comment * Add another clarity comment * Discord discussions on `magicFillTarget` * Comments * grammar * More comment clarity * Another bad comment * PR suggestions, improved comments * One more comment * one more thing * bar -> meter
2022-05-21PlayState Rename (#1231)fig02
* global context -> play * fix PlayState* PlayState
2022-05-20Environment documentation pass (#1115)fig02
* 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-09Introduce DEFINE_ENTRANCE for entrance table and create entrance enum (#1213)fig02
* 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-09Audio Ocarina Documentation (#1026)engineer124
* Begin ocarina documentation * Many ocarina-related docs * More ocarina docs * Introduce Ocarina Fonts Enum * Fix ocarina font enum * Fix incorrect documentation, more documentation * Ocarina recording documentation * cleanup * Small touch-ups * Fix font -> instrument * format * Better docs on playback, memory game * more cleanup * Add z64ocarina.h * Clean up names * final cleanup * typo * Fix description * better docs * Fix channel -> channelIdx * Fix old "font" name to correct "instrument" name, add io port docs * Add comments to clarify certain lines/functions * format * Rename noteIdx to pitch * Missed a name * Add comment on pitch * `reset` -> `SetInstrument` and `displayed` -> `playback` * Clarify audio_update and windmill comment * Minor PR fixes * Revert Audio_Update because there are 2 different Audio_Update functions * PR Feedback * Ocarina Idx -> Index * Introduce OCARINA_BTN_C_RIGHT_OR_C_LEFT * PR Suggestions * Next PR Suggestions * Next PR Feedback * consistency * Better docs (PR) * Better comment
2022-05-02Memstuff (#1164)EllipticEllipsis
* Un-fake a couple of matches in memory manip functions * Document fmodf * Un-fake a couple of matches in memory manip functions * Document fmodf * Rename functions and files * Document memmove, memsets, memcpys * Format * Sort out some missing sizeofs * Name fmodf * Rename local variables * size_t * Use COBRA_SHADOW_TEX_SIZE * Review * Tweak the Doxyfile to remove @brief requirement * Roman's review * Fix a bug comment * Change fmodf
2022-04-30Doc equips usage (inventory, current and player-specific constants) (#1142)Dragorn421
* 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-29Defines for `SaveContext` flags (`eventChkInf`, `itemGetInf`, `infTable`, ↵Dragorn421
`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