summaryrefslogtreecommitdiff
path: root/src/code/z_play.c
AgeCommit message (Collapse)Author
2024-07-06Set up build system and disassembly for gc-us (#1982)cadmic
* Build gc-us * Set up gc-us disassembly * Don't disasm unchanged overlays * Fix gc-eu-mq BSS * romalign link_animetion for NTSC * Explicitly set CPP defines to 0/1 * Add #ifs to segment_symbols.h * Add sButtonTextures now * Fix message _SHIFTL usage * Don't ifdef LANGUAGE_MAX
2024-06-25Move `PlayState` to a new `z64play.h` (#1966)Anghelo Carvajal
* ActorContext * frameadvance * SfxSource * GameOverContext * RoomContext * TransitionActorContext * fix bss * Move PlayState * Move play functions to new header * SAC_ENABLE * no longer needed * SAC_ENABLE again * z_demo being silly * comment * format headers * fix retail bss * actually fix bss * Cutscene_ProcessScript comment * bss again * Update src/code/z_demo.c Co-authored-by: cadmic <cadmic24@gmail.com> * rename to frame_advance and remove it from z64.h * move macros too * review * Rename SequenceContext to SceneSequences --------- Co-authored-by: cadmic <cadmic24@gmail.com>
2024-06-18Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)fig02
* start using task terminology * more docs * format * cleanups * MoveActor -> ActorMove * missed a couple * hopefully the last changes * comment explaining the group change * some review * dragorn review * remove accidental file * fix matching issue, now use while loop
2024-04-14Match retail BSS ordering (#1927)cadmic
* Match retail BSS ordering * Revert moving some global variables to headers * Adjust block numbers after header changes * Fix debug build * Overlay bss ordering * Fix BSS ordering after header changes * gc-eu-mq OK * Implement preprocessor for #pragma increment_block_number * Transfer usage comment from reencode.sh * Use temporary directory instead of temporary file * Move ColChkMassType back
2024-03-29Fix various data issues in gc-eu-mq (#1921)cadmic
* Fix various data issues * D_80153D78 -> sMessageDebuggerTextboxCount
2024-02-27Match retail code data sizes (#1741)cadmic
* Match retail audio data * Fix various small code data problems * Disable terminal colors in debug builds * Match z_actor_dlftbls.c .rodata * Use _3 for unused nameString macro parameter * Move sDebugCutsceneScriptBuf to be in-function static * Comment on actor name being NULL * Split out padding the fault_drawer.bss.s
2024-02-01z_play retail OK (#1688)engineer124
* z_play OK * cleanup spacing * PR
2024-01-31Gamealloc, Graph, and Graphalloc retail OK (#1675)Derek Hensley
* Gamealloc OK * Graph + Graphalloc OK * PR review * gfxalloc * new lines * Remove imposter
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-11-19Struct Returns (#1574)engineer124
* change args * PR Review * format
2023-11-19More Camera Flags (#1453)engineer124
* Generic Camera Flags * New flag names * Add flags to functions * Finish flag docs * More docs * More cleanup * More clarity * Better shrinkwindow flag docs * Improve name * CAM_INTERFACE_FLAGS * Better approach to edge cases * Change ordering for consistency * Oops * Add masks to macro * PR/Discord discussions * cleanup comment * Oops * PR Suggestions * More PR Feedback * More PR Suggestions * More Camera Flags * PR Suggestions * More flag style change * Small cleanup * More flag docs * Another flag * Fix flags * sync names with other PRs * more fixes * fix comments * update with hud visibility mode docs * missed one * fix comments * Roman PR Suggestions * interfaceField * small fix * letterbox cleanup * cleanup * fix macro arg * fix func declaration * many more docs * better docs? * missed some * oops, revert * add flags to name * cleanup * flag * double signal * simplify cam func name * more suggestions * PR Suggestion
2023-11-12Fix misc 21 (#1573)Dragorn421
* Make `sNew` in (unused) `code_800FC620.c` a string It is passed as a filename to `__osMallocDebug` so should be a nul-terminated string, not a char[3] missing an explicit \0 * Fix gcc warning in `JpegDecoder_ParseNextSymbol` about SLL on negative value -1U is an unsigned value, aka 0xFFFFFFFF I keep -1 because it seems that's what a jpeg standard has too References: https://stackoverflow.com/questions/40508958/shifting-a-negative-signed-value-is-undefined https://www.w3.org/Graphics/JPEG/itu-t81.pdf (page 105, figure F.12) * Small cleanup * Fix few mistakes (thanks gcc warnings) * Add `@bug` in file select settings draw code, using the wrong array * format * format main * rename arg for a happy formatter * Move important function call out of a printf
2023-10-28Player Docs: public facing csAction things (#1561)fig02
* name public csAction functions * format * adjust function comment * format
2023-10-17Use `long` over `int` for s32/u32 types (#1546)Tharo
* long s32 * Suggested changes
2023-09-19Doc/Cleanup pass on object handling (#1227)Dragorn421
* `Object_InitBank` -> `Object_InitContext` * Add and use `OBJECT_SPACE_SIZE_BASE` * Remove `OBJECT_EXCHANGE_BANK_MAX` -> use `ARRAY_COUNT()` instead * "object status" -> "object load entry" * Misc. cleanup/renames * Partial docs and way too much batch renaming and cleanup for a single commit * ctrl shift h * format * format clang-11.1 * fix regressions * Improve a `@bug` comment * Move `OBJECT_SPACE_SIZE_BASE` from header to near `Object_InitContext` * "objectID" -> "objectId" * Revert iterator index to `i` in `Actor_KillActorsWithUnloadedObject` * "object load entry index" -> "object entry" * `Object_UpdateLoadEntries` -> `Object_UpdateEntries` * Run format.sh * "object entry" -> "object slot" (except internal usage) * Proper `Object_SpawnPersistent` doc Co-authored-by: fig02 <fig02srl@gmail.com> * fixup one comment "object bank index" -> "object slot" * Amend `Object_SpawnPersistent` comment to mention running out of free slots * `Actor_KillActorsWithUnloadedObject` -> `Actor_KillAllWithMissingObject` * Remove useless mention of what uses `Object_SpawnPersistent` * Fix mistake on `Object_SpawnPersistent` doing sync dma, not async * run formatter * `Object_InitContext` -> `Object_Init` * `waitObjectSlot` -> `requiredObjectSlot` * `Object_Init` -> `func_80097DD8` * one objectIndex -> objectSlot * Remove `OBJECT_SPACE_SIZE_BASE` * light fix on the merge (rm OBJECT_EXCHANGE_BANK_MAX) * `func_80097DD8` -> `Object_InitContext` --------- Co-authored-by: fig02 <fig02srl@gmail.com>
2023-09-16Document Framebuffer Filters, VisCvg and VisZbuf (#1534)Tharo
* Document z_viscvg and z_viszbuf Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * Few more notes * Some more notes Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * Review * Americanisation, FB RGB * Oops * Review * Minor documentation modifications * Header, base struct and enums Co-authored-by: Tharo <17233964+Thar0@users.noreply.github.com> * functions.h fix * Suggested changes, further adjustments to file doc comments * Further suggested changes, standardize capitalization of gfxP * g --------- Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2023-09-06Document pause states (excluding gameover) (#1483)Dragorn421
* Document PauseContext.state * Very light docs surrounding pause states * PAUSE_STATE_UNPAUSE -> PAUSE_STATE_RESUME_GAMEPLAY and comment on purpose in the enum * PAUSE_STATE_MAIN -> PAUSE_STATE_6 * format * Player_InitDrawPause -> Player_InitPauseDrawData
2023-08-15Document z_lib Sfx Functions (#1470)engineer124
* document lib sfx * rename functions
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-08-13Cleanup?: Use gotos in z_play for large else blocks (#1486)Dragorn421
* remove else when using `goto Play_Draw_DrawOverlayElements` * Add `goto Play_Draw_skip`, use on prerender save * format
2023-07-10Use intptr in most remaining code files (#1438)Roman971
* Use intptr in most remaining code files * Fix missing uintptr_t in actor * Use u8* casts for texture pointer arithmetic * Use bg + 1 instead of casting in Room_DrawBackground2D
2023-07-03Documentation for skybox drawing (#1515)Tharo
2023-02-26Minor Misc Cleanup 2 (#1422)engineer124
* misc cleanup * more cleanup * more cleanup * PR Suggestions * cleanup cond
2023-01-12`EnHoll` docs (door-less transition between rooms) (#1419)Dragorn421
* some EnHoll cleanup * some more EnHoll cleanup * even more EnHoll cleanup * EnHoll docs * `enHollFillAlpha` -> `bgCoverAlpha` * Dl -> DL * one temp: action -> type * Move static data out of `EnHoll_HorizontalVisibleNarrow` * "fade" -> "bgcover" * spread sentence over several lines * tweak comments formatting Co-authored-by: fig02 <fig02srl@gmail.com>
2023-01-12DbCamera to DebugCamera (#1482)engineer124
* better dbCam prefix * missed some * PR Suggestions * alignment * more debug * cleanup
2022-12-28Fbdemo Docs: `TransitionTile` (#1471)Derek Hensley
* TransitionTile' * Final clean up * PR * Header comment * vtx_tn * Name background DL * row <-> col * Rename update functions * Update header * Enum * Done -> Ready + cleanups * Update include/z64transition.h Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-12-26Misc. small cam doc (#1461)Dragorn421
* `Camera.posOffset` -> `Camera.playerToAtOffset` * calcSlopeYAdj bool cleanup * `Camera_CalcAtForLockOn` flags defines -> `CAM_LOCKON_AT_FLAG_` * yOffset * More cleanup * isOffGround
2022-12-24z_demo documentation (#1327)fig02
* commit old stuff * progress * progress * progress * progress * more progress, renaming cues next * small changes * enum values added for all actions * hardcoded values removed when possible * commands renamed * first pass of action -> cue * fix some matches * some more cleanup * scriptPtr * forgot one * remove cue rot union * more changes * some more stuff * more stuff * fix matching issues * some more things * progress, starting to rename destinations * small changes * name some destinations * more names * need to switch branch * progress * first pass of destination names * usages fixed * use destination enum * fix csdis * format * command descriptions * revert accidental zap changes * forgot some things * use a single macro for CutsceneCameraPoint (idk why i didnt think of this sooner) * typo * review1 * clarify ruby/sapphire comment * remove endframe for commands that dont use it * some more review * most review, but not all * scriptPtr -> script, and another small change * ocarina action * remove +1 from light settings command, change comment * actionIndex -> cueIdTemp (i guess) * _SetCueX -> _SetXFromCue * format * tweak fade out seq arg names * use spline terminology * more dragorn and engineer review * misc start/end frame note * cleanup StartPosRotFromCue vs PosRotFromCue * cleanup spline terminology * sPrevCamId -> sReturnToCamId * comment on debug cs data address * Cutscene_Init -> Cutscene_InitContext * single point types are not a list * remove todo comment * some more review * rumble struct names * some review * more review * missed one * reword pointer comment * even more review * match transition terminology with z_play * change condition and format * frame count * command specific structs with alignment * anon review * remove unneeded arg from time macro * yeet `CsCmdGeneric` * remove unused from single point types * typo * compromise attempt -- name endFrame everywhere * fixes * fix again * copied the wrong note * cutscene data note * review, format * compat defines * idk whats going on man Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-12-24TransitionFade docs and clean up other transitions (#1459)Derek Hensley
* TransitionFade docs * PR suggestions * Fix * Fill * Other transitions + enums * Prefix transition assests with trans * Fix end_title * format * OutNames * nitpicks PR * cleaner
2022-12-19`R_PAUSE_MENU_MODE` -> `R_PAUSE_BG_PRERENDER_STATE` and docs (#1368)Dragorn421
* `R_PAUSE_MENU_MODE` -> `R_PAUSE_BG_PRERENDER_STATE` and document values and usage * `SREG(33)` -> `R_GRAPH_TASKSET00_FLAGS` * format * `PAUSE_BG_PRERENDER_DRAW` -> `PAUSE_BG_PRERENDER_SETUP` * `PAUSE_BG_PRERENDER_FILTER` -> `PAUSE_BG_PRERENDER_PROCESS` * DList -> display list
2022-12-17`z_play`: Camera Docs and Cleanup (#1460)engineer124
* begin docs * More suggestions * more docs * timer to duration * partial PR review * init data with player * consistent comments * withPlayer to usingPlayer
2022-12-04Camera Flags (#1225)engineer124
* Generic Camera Flags * New flag names * Add flags to functions * Finish flag docs * More docs * More cleanup * More clarity * Better shrinkwindow flag docs * Improve name * CAM_INTERFACE_FLAGS * Better approach to edge cases * Change ordering for consistency * Oops * Add masks to macro * PR/Discord discussions * cleanup comment * Oops * PR Suggestions * More PR Feedback * More PR Suggestions * PR Suggestions * More flag style change * Small cleanup * sync names with other PRs * more fixes * fix comments * update with hud visibility mode docs * missed one * fix comments * Roman PR Suggestions * interfaceField * small fix * letterbox cleanup * fix macro arg * fix func declaration
2022-11-26Add skybox .h and cleanup, `SkyboxDraw_` -> `Skybox_` (#1435)Dragorn421
* Add skybox .h and cleanup * move forward declared structs to top of file * `SkyboxDraw_` -> `Skybox_` * format * move more forward declared structs to top of file
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-26Document HREG debugging system (#1351)fig02
* progress * progress * change * named most * name prerender things * fix and format * play prefix * address most comments (still a few more things to do) * fix error * reword input test comments * some more * rework env draw flags * add hilite * merge and format * init to proper values * rename env draw flag names * 7 to 6 * more small changes
2022-11-22Document Hud Mode (#1323)engineer124
* begin interface alpha docs * more progress/docs * First draft of docs done * cleanup * Consistency * Display -> Mode * Remaining display -> mode * Better docs * Small touchups * Small Update * Apply discord discussion * small fix * More discussions * PR Suggestions * Roman PR Suggestions * better comments * PR Suggestions * another suggestion * discord discussions * cleanup comments * more discord/pr suggestions
2022-11-16More documentation for `z_std_dma.c` (#1415)Tharo
* More documentation for z_std_dma * uintptr casts for rom symbols in z64animation.h and z_kanfont.c * Format * Suggested changes, more defines for static texture sizes * PI Interface -> PI * Further suggested changes * Format * Comments about item_name and map_name texture assumptions
2022-11-13TwoHeadArena and TwoHeadGfxArena docs (#1349)Tharo
* TwoHeadArena and TwoHeadGfxArena docs, ALIGNOF macro * AllocStart -> AllocHead , AllocEnd -> AllocTail * Format * Suggested changes * Fix * Further suggested changes
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-11-01Some doc on env light settings (#1307)Dragorn421
* remove `LightSettings` struct, typedef for zapd * more decimal * fog far -> z far * `LIGHTCTX_FOGNEAR_MAX`, `LIGHTCTX_ZFAR_MAX` * name sp88,sp8C in `Environment_Update` * `EnvLightSettings.fogNear` -> `blendRateAndFogNear` and macros * A different struct for `EnvironmentContext.lightSettings` * Uniform zapd compat typedefs todos * `LIGHTCTX_` -> `ENV_` * Comment on `blendRateAndFogNear` + "fogFar" * Move fogFar~1000 comment to zFar * comment rewrite attempt * move relevant macros down Co-authored-by: fig02 <fig02srl@gmail.com>
2022-10-16Rename scene lists (#1344)fig02
* first pass * revert unwanted zap change * review * name Actor_InitContext, change arg name * change bzero to use type
2022-10-15Document elf_message scripting system (#1398)fig02
* `cUpElfMsgs` -> `cUpMsgs` Motivation: ElfMessage is the name of the system that handles c-up messages from navi, but also messages from child/adult saria so it would make sense to name this after the system name like "ElfMsg" but "cUpElf" primarily reads like (to me) "c up navi" since the actor implementing navi is EnElf I think it'd be better to clear that confusion between "navi" and "elfmsg system" by just not using "elf" in the name * Standardize c-up navi messages ElfMessage data to be named after "CUp" * -> "Navi" * Make symbols in `elf_message_` segments static * new docs * change commands, format * introduce navi file id * use enum * remove concat * add clarifying comment for skip * concat cmd type * Hints -> QuestHint * rename command header * s -> g * missed enum name * singular * missed one Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2022-10-15Quake Documentation Pass (#1402)engineer124
* begin quake docs * continue cleanup * quake offset * many more docs * cleanup * more cleanup * cleanup headers * move quake value to internal * update, still need to test shake zoom/yaw * more docs * better docs * add file descriptions * fix comment * explain random index * cleanup comments * better type 6 docs * expand orientation comment * fix old names, add comment * remove comment, twas a mistake * easy PR feedback * duration in dec * rm offset, clear up roll * oops * merge shakeInfo and QuakeCamData * match order that always appears in code * more PR suggestions * adjust comment * zeroVec * rm extra space * roman PR suggestions
2022-10-15`GameInfo` -> `RegEditor` (#1354)Dragorn421
* -> `RegsContext* gRegsContext` * Name regs-related functions * Revert naming `GameState_UpdateRegs` * -> `gRegEditor` * `Regs_InitContext` -> `Regs_Init` * remove mistakenly added file
2022-10-04Fix many missing NULLs (#1389)Roman971
* Fix many missing NULLs * Fix a raw actor id in en_horse
2022-09-27Rumble doc (#1375)Tharo
* Rumble doc * Fixes, suggested changes * Improve padmgr retrace callback related code * Name some rumble-adjacent things, further suggested changes * Further suggested changes * Suggested changes
2022-08-31Doc room drawing (#1283)Dragorn421
* (wip) some doc on room draw2 * doc room_draw2 * do what can be done for `func_80095AA0` * wip * more cleanup around Room_DrawBackground2D * format" * commit to naming things * move forward declarations of draw handlers to draw handlers array * two z_room regs * `R_MESH2_` -> `R_ROOM_CULL_` * offset -> quakeOffset * kb -> kB * Improve cull mesh type doc * `Sphere16` MeshHeaderCullEntry.bounds * Revert "`Sphere16` MeshHeaderCullEntry.bounds" (ZAPD...) This reverts commit cbe55e8090f2fcd00be3a81e64ae133254417599. * Mesh header type: "cull" -> "cullable" * Reword some Cullable doc Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * `boundsSphere*` for now for the can't-be-`Sphere16 bounds` * Improve the PrerenderMulti bgCamInfo usage situation * Comment on `overrideBgCamIndex` * "are left" -> "remain" * enum and defines for room draw debug regs * drawBg -> drawBackground * "mesh header all" -> "mesh header normal" :shrug: * array_count back to define * Name some temps a lot less specifically * "mesh header" -> "room shape" * "Room shape prerender" -> "Room shape image" * `ROOM_SHAPE_IMAGE_FORMAT_` -> `ROOM_SHAPE_IMAGE_AMOUNT_` * `RoomShapeImageMultiBackgroundEntry` -> `RoomShapeImageMultiBgEntry` * Remove references to "header" (old "mesh header" name) * Axe variable names Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
2022-08-30Fix misc 16 (#1371)Dragorn421
* Replace tabs in exceptasm.s source * Replace tabs with \t in strings * Fix grammar in various comments * Fix "initalize" typos in code * (fix typo) `__osMallocIsInitalized` -> `__osMallocIsInitialized` * Some Link -> Player * Use `EXCH_ITEM_` more * "bgm music" -> "background music" * Fix typos in `place_title_cards.xml` * `SkelAnime_Update` returns a boolean * Run formatter
2022-08-30Fix RaycastFloor flags (#1328)mzxrules
* fix raycast floor flags * format.sh * Name flags * Rename RaycastFloor functions, clean up caller code, document z_bg_spot15_rrbox * change comment to prevent format wrap * change to "if BGCHECK_GROUND_CHECK_ON is set" * roman suggestions