summaryrefslogtreecommitdiff
path: root/src/code/z_lib.c
AgeCommit message (Collapse)Author
2024-09-18Add rand.h for non-qrand.c rand functions (#1684)Dragorn421
* sync rand.h with related oot PR * fix * yeet comment
2024-09-07[headers] Move padmgr, scheduler, irqmgr symbols to respective headers; add ↵Dragorn421
segmented_address.h (#1681) * [headers] Move padmgr, scheduler symbols to respective headers * fix revealed header problems * Fix bss * review * bss * segmented_address.h --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
2024-06-25Add a `z64play.h` header (#1646)Anghelo Carvajal
* z64play.h * Move macros, functions and variables to header * cleanup * Reduce needed headers on z_collision_check * Change play functions to take PlayState * Move `Actor_ProcessInitChain` to `ichain.h` * format * Update src/code/z_play.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * Add macros.h to sys_math3d.c * Rename SequenceContext to SceneSequences --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
2024-06-03More General Cleanup (#1638)Derek Hensley
* LINKER_FILES in makefile * COLPOLY_GET_NORMAL * math header * libc * M_PI for cosf and sinf files * MAXFLOAT * Revert "MAXFLOAT" This reverts commit 96b75ffaa89b1a4ca1c08278b28bc3c70224701a. * Remove SHT_MINV * SHRT_MAX * Add M_PI * Angle macros * f suffix * Format
2023-12-13Use more `TRUNCF_BINANG` for f32 -> s16 casts (#1503)engineer124
* TRUNCF_BINANG * brackets * extra cast
2023-11-27Misc Cleanup (#1509)engineer124
* begin anim R * sTexturesDesegmented * more misc docs * more misc cleanup * small adjustments * oh sneaky * PR Review * adj comment, reads better * missed an enum * this one actor reverses true/false * bool * CARNIVOROUS_LILY
2023-11-23Yet another header cleanup (#1508)Anghelo Carvajal
* lights.c * z64skin_matrix.h * Move out some stuff from macros.h * gamealloc.h * move most transition functions to z64transition.h * z64lib.h * `include` cleanup on transition files * z_overlay cleanup * z64malloc.h * format * forgot to remove those * forgot this * fix borken includes
2023-11-02Enable `-Wint-conversion` warning (#1266)Anghelo Carvajal
* fixing some warnings * more pointer fixing * Use `-Wno-int-conversion` on audio files * more progress * fix * more pointer fixes * kinda progress * Fix remaining casts * Format * fix merge * fix warnings * fix parameter * use SEGMENT_ROM_START_OFFSET a bit more * format * fix audio warnings * some more fixes * fix en_go * review * review * whoops, missing cast * review * review * ->data * format * review * fix * asPtr * fix * Update src/code/sched.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * review * fix in EnDnh * improve format * engo * format * fix * format * Update include/z64.h Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * TexturePtr * fix warnings * fix warnings * format * fix * review --------- Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
2023-10-31z_kankyo Decompiled (3 non-matching) (#1451)engineer124
* z_Kankyo progress * build OK * progress * more progress * Kankyo WIP * Add docs * func_800FEAF4 * more docs * func_800FEAF4 * improve Init * Small cleanup * kankyo data * data cleanup * Environment_DrawLensFlare * Match Environment_UpdateSkybox * Match Environment_DrawRainImpl * Start on Environment_UpdateLights * Match Environment_DrawSandstorm * gRainDropDL * Some light renamings * Fix merge * cleanup * improve non-equivalents * cleanup * PR Review * match Environment_UpdatePostmanEvents * PR Review * small improvement to Environment_UpdatePostmanEvents from anon * more cleanup * void * bits * fix comment * improve Environment_UpdateLights * Skybox Stars Docs * PR Review * fix merge * macros * Add comments * PR Review * gRandFloat * bug --------- Co-authored-by: Rozelette <Uberpanzermensch@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
2023-10-26Yet another libultra cleanup (#1384)Anghelo Carvajal
* os symbols * various variables * more variables * more cleanup * yeet HW_REG * OS_PHYSICAL_TO_K0 and other cleanups * Rename r4300.h * migrate pimgr data and cleanup on initialize.c * rename osFlash symbols * cleanup gu * vimodes * yeet rmon, do libc files * some os files * hardwareinterrupt * cleanup a lot of os files * cleanup osVirtualToPhysical * various io files * another io chunk * final io chunk * yeet hardware.h * yeet PHYSICAL_TO_VIRTUAL and VIRTUAL_TO_PHYSICAL * fix typo * fix merge * remove global.h from libultra files * fixes and format * brief explanation * review * review * review * review * SEGMENTED_TO_K0 * Revert "SEGMENTED_TO_K0" This reverts commit f8d62d670f91af401feb56489e1cbc45a1260049. * take two * bss * bss
2023-10-05z_kankyo pt 1 (#1377)Derek Hensley
* z64environment.h * remove todo * Cleanup * data + bss + 2 functions * Bring over simple functions * Remove lerp comment * code functions csv * Remove docs changes * ZBufValToFixedPoint * Remove leading 0's * SEGMENT macros * eventDayCount * format * z64bombers_notebook.h * fix merge * Comments --------- Co-authored-by: angie <angheloalf95@gmail.com>
2023-09-23Player docs: Control Stick Input and Movement (#1385)engineer124
* player input docs * player prefix * rm comments * TRUNCF_BINANG
2023-06-20Audio Sfx Functions Decompiled and Documented (code_8019AF00.c) (#1242)engineer124
* sfx decomp and docs * function headers * namefixer * oops * better sfx name * PR review * namefixer * PR review * float * namefixer * namefixer * namefixer * PR Suggestions
2023-06-05sys_math.c Rename (#1258)engineer124
* rename via comments * missed a comment * math header * name boot_80086760.c functions * PR Review * rm cam comment * Elliptic review * alphabetical
2022-11-07Fix last two functions in sys_math_atan (#1066)mzxrules
* Fix extra Atan2 funcs * format * make Math_GetAtan2Tbl private * rename Depr to XY * ./format.sh i loathe thee * namefixer.py changes
2022-10-04z_overlay and z_fbdemo_dlftbls (Transition overlay handling), clean up a lot ↵petrie911
of u32s used to store pointers (#1073) * overlay matches * prototypes * fbdemo too * virtual to physical * names, cleanup, etc * bss reordering * uintptr stuff * fixed now? * one fix * headers and such * fixes'n'stuff * XXX action * docs of a sort * useless error codes * n * format * header? I barely know her! Co-authored-by: petrie911 <petrie911@users.noreply.github.com>
2022-07-22EnBjt OK and documented (#912)EllipticEllipsis
* OK, data imported * Fix some typos * Start docs * Struct almost finished * Start object, add state enum * undefined_syms * Finish object, name some more stuff * Name a few states and another function * PlayState * Minor tweaks in z_room and z_sub_s * Complete documentation * spec * Review 1 * functions.txt * Schedule result enum * Rename schedule results * Review * Remove update comments * Inventory_DeleteItem * PLAYER_STATE * Format * Review * Update struct name
2022-03-24En_Tanron4 OK (seagulls) (#714)fig02
* Seagull OK * small fixes * review 1 * review 2
2022-02-20Camera Preparation (#644)engineer124
* Copy progress from z_camera * cleanup functions.h * Oops * Revert `SUB16` and `ADD16` back to original names * PR Suggestions * PR Suggestions * Fix merge with master
2022-01-11z_sound_source OK (#353)engineer124
* z_sound_source OK * Fix Pos * Lib_PlaySfxByPos * Change function names * format * Update names to match OoT * cleanup from the merge * Fix name
2021-08-03Overhaul the build system (#234)Tharo
* wip * fix * add disassembler * Disasm builds OK * Variable addends * More wip * Rodata migration implemented * Cleanup old tools * Try fix submodule -> subrepo merge * git subrepo pull --force --remote=https://github.com/zeldaret/ZAPD.git tools/ZAPD subrepo: subdir: "tools/ZAPD" merged: "602e609" upstream: origin: "https://github.com/zeldaret/ZAPD.git" branch: "master" commit: "602e609" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Builds again but assets are totally broken * git subrepo pull --force tools/asm-processor subrepo: subdir: "tools/asm-processor" merged: "1ffdb08a" upstream: origin: "https://github.com/simonlindholm/asm-processor.git" branch: "master" commit: "1ffdb08a" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * More cleanup, move functions.txt and variables.txt to tools/disasm and rm tables * rm z64compress in preparation for subrepo * git subrepo clone (merge) https://github.com/z64me/z64compress.git tools/z64compress subrepo: subdir: "tools/z64compress" merged: "eb11085c" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "eb11085c" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Fix asset extraction * Fix diff-init make rule * Split code bss * Split assumed linker bug padding from assembly files * add filelists for mm.us.rev1 * Maybe working, but I'm not sure * add overlays to spec * Add rodata to actos * Everything compiles * Make a lot of C files for code * Add almost every file in code to spec * whoops * 3 code files left * add scenes to spec * More progress on progress.py * Fix skelanime in spec * audio files! * Fix merge issues * Fix some C files in code * Fix remaining code files * Use existing O1 C files in spec * reorder boot order in spec * update spec * fault.c * Convert relocs on completed actors, fixbaserom uses current rom name * more boot files * Add VT macros and script * finish already existing boot files * most of libultra * fix 64bits libultra files * Use C files for libultra, wrap some functions in NON_MATCHING * Remove duplicate of OS_CLOCK_RATE from fault.c * C files for fbdemos * delete dumb files * bootstrap C files, still need to add them to the spec * update fixbaserom * boot OK? * I forgot to commit the spec * C for gamestates * C for kaleido * Change all includes to "" * copy actor sizes script from oot * I forgot to delete those files * Basic C files for effects * Add effects initvars names * Remove mislabelled boot functions from header/txt * Begin porting bootstrap_fx, some sizes * Fix <> * Fix enum * Fix diff.py * fix libultra stuff * update regconvert * update setup warnings * add some missing ; * Fix some makefile stuff and other fixes on some non_matching functions * add executable flag in extract_baserom and fixbaserom * fix relative path * copy assist from oot * fix map path * another assist path fix * Delete C files for handwritten files * add code_801A51F0 to spec * add gfxbuffers to spec * Move rodata to top of each file when possible * UNK_TYPEs for func_801A51F0 * Remove kaleido rodata from spec * Update spec and undefined_syms for recent merge * GCC warnings and fix errors in nonmatchings, * round percentage numbers * progress script: format changes * progress: error on non-existing files * fix warning in z_scene_table * Match 2 nonmatchings in z_actor * Warnings in lightswitch and invadepoh * Fix warning in z_actor_dlftbls * I though I fixed this one * whoops * Comment out CC_CHECK * Removed redundant ultra64.h includes * Update asm_processor, sorted boot_O1 into other folders, completed the fbdemo bootstrap, cleaned up undefined_syms * Completed gamestates bootstrap * Split kaleido_scope * Remove section.h and segment.h, move keep object externs to a common location in variables.h * Completed effects bootstrap * Segmented address externs for effects, fbdemos, gamestates and kaleido * Move actor data externs out of the if 0 * Segmented address externs for actors * Prepare actionfunc detection * fix script, how did it even work before * Fix actionfunc script again, re-introduce some more intermediate prints to the disassembler * Automated actionFunc detection in actors * Segmented addresses from player .text * rm old segment addrs script and fix build * Move sizes folder to tools * Make build.py executable * New Jenkinsfile Prayge * Remove numpy dependencies * Add warnings_disasm_current.txt * my bad * Update spec and undefined_syms * Add z_eff_ss_hahen to pametfrog * git subrepo pull (merge) --force tools/z64compress subrepo: subdir: "tools/z64compress" merged: "163ca2af" upstream: origin: "https://github.com/z64me/z64compress.git" branch: "main" commit: "163ca2af" git-subrepo: version: "0.4.3" origin: "https://github.com/ingydotnet/git-subrepo" commit: "2f68596" * Make z64compress print to stdout * sneeky commit to update warnings tooling * test * Another test * Mark fixing overlay reloc generating as a TODO * Update warnings stuff * Communicate the return code from running z64compress back to the Makefile through the wrapper * Run formatter, remove extra commented copy of function * Re-fix some includes * Convert atan to hex to conform to decided style * Some tidying up, remove c for fp and the other two handwritten code files * BSS in z_collision_check & z_scene_proc * add static back in * Fix timerintr bss, add file to spec, some cleanup * Remove externs * Newline * Readd enums * Typo * Colours * Comments for hitmark enum values Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com> * Improvements and suggestions * Organize and remove unused imports and use env for python3 scripts, delete unused overlay.py Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com> Co-authored-by: engineer124 <engineer124engineer124@gmail.com> Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
2021-06-11Importing Sound Effects from MM3D (#179)engineer124
* Add sfx & update Audio_PlayActorSound2 * more sfx * Match Enemies sfxId * Update with PR * Update sfx for new pr * Fix commit
2021-05-18Format everything (#141)Anghelo Carvajal
* Add trailing comma * Run format and add some missing trailing commas * Enforce the same clang-format version for everybody * z_en_m_fire1
2021-04-07z_lib fully matched (#85)Rozelette
* z_lib OK * Documentation * Added stdbool and stdint * Fixup for new names * Fixup bad merge * Feedback * Use u/s32 for intptr_t
2021-03-27Some OOT transfers, some renaming, etc (#75)Lucas Shaw
* Progress on various files * gfxprint stuff * split some rodata, add iconv for rodata string parsing * z_std_dma rodata * 2 nonmatchings in gfxprint * mtxuty-cvt ok * more * match a function in idle.c * progress * Cleanup * Rename BgPolygon to CollisionPoly * progress * some effect stuff * more effect progress * updates * made suggested changes * z_effect_soft_sprite_old_init mostly ok Co-authored-by: Lucas Shaw <lucas.shaw1123@gmail.com> Co-authored-by: Rozelette <Rozelette@users.noreply.github.com>
2021-03-27z_lights fully matched (#80)Rozelette
* z_lights OK * Documentation * Fixup for z_collision_check * Improve function types of bind functions * Fixup for types
2021-03-16yaz0.c OK (#71)Rozelette
2021-03-10Initial support of tracking progress per code/boot/overlay, and outputs the ↵Kenix3
stats to csv.
2021-02-23pragma variant for GLOBAL_ASM (#49)Tharo
* pragma GLOBAL_ASM * Revert split_asm.py arg description change
2020-10-11Arms_Hook OK (#33)fullgrowngaming
* All but 2 functions matched * More work on hookshot * hookshot work * 2 functions left (and one is almost done) * sp issues with draw, but matching otherwise * hookshot matching * Changed rodata inclusion for armshook * Hookshot OK * Resolve script conflicts * Rename unk variables to match MM standard * Made requested changes
2020-08-31Split headers to be more similar to OOT (#13)Rozelette
2020-07-24Initial code formatKenix3
2020-06-04z_lib now uses SEGMENTED_TO_VIRTUAL macroKenix3
Additionally removed some TODO comments in z_scene and defining gRspSegmentPhysAddrs array size as NUM_SEGMENTS
2020-06-04Added macros headerKenix3
Additionally, updated code to use PHYSICAL_TO_VIRTUAL and ALIGN16 macros. Additionally, retyped gRspSegmentPhysAddrs back to u32 as in OOT. These get the straight return value of PHYSICAL_TO_VIRTUAL, so they are u32.
2020-06-04Fixes known undefined behaviour from DmaMgr and Lib_Ptr taking u32 rather ↵Kenix3
than void*
2020-03-15Rename many functions, structs, and variables to match the oot decomp. Some ↵rozlette
things have not been renamed as their respective files have not been decompiled yet.
2020-02-20Make non-matchings consistent with ootrozlette
2020-01-08Update to latest ghidra projectrozlette
2019-12-29More work on z_scene_proc.c 31/36 matching, 3 non-matching, 2 not attemptedrozlette
2019-12-18Decompile code_0x800E8EA0.crozlette
2019-12-17Cleanup files in code. Decompile code_800CAAD0.crozlette
2019-12-14Update to latest from ghidra projectrozlette
2019-12-07Generate all major headers from ghidra projectrozlette
2019-11-28Use variable names from ghidra project. Reorganize some data tables and ↵rozlette
header files to work easier with it.
2019-11-14Rename tons of structs because we aren't using the z_ prefix anymore ;_;rozlette
2019-11-13Update structs.h because Ghidra can handle bitfields nowrozlette
2019-09-29Use structs.h generated from Ghidra projectrozlette
2019-09-20Use per-function ASM blocksrozlette
2019-09-20Add tons of function names. Datatypes TODOrozlette
2019-03-31Add more filenamesrozlette