22 Commits

Author SHA1 Message Date
camthesaxman e9c56c40c9 decompile code_0.s (#23)
* start decompiling code_0.s

* decompile more of code_0.s

* remove dump file

* decompile more of code_0.s

* decompile more of code_0.s

* finish decompiling code_0.s

* damn tabs

* cleanup

* more labeling

* rename code_0_2.c to light.c

* migrate code_0.s .sbss variables

* migrate more data from code_0.s

* rename code_0.c to frustum.c

* more labeling

* dump remaining .data section from code_0.s
2022-04-24 19:37:04 -05:00
ComplexPlane cbe20cee10 More avdisp-related labels (#22)
* zMode -> gxCache

* More polydisp labels

* The usual

The usual

* Trying to figure out func_8008D6D4

* Color labels

* More avdisp color stuff

* Implement set_tev_material_ambient_colors() in C

* Fix mot_ape.c after merge
2022-04-21 19:14:47 -04:00
camthesaxman 3741f2e85e labeling 2022-04-20 22:25:34 -05:00
ComplexPlane 85e42eb3ec Labels. Mostly related to physics and animation. (#18)
* Rename stcoli functions

* Add gen_compile_commands.py script

* Add shebang

* gen_compile_commands: pretend to be GCC

* Separately compilable game headers

* Separately compilable system dolphin headers

* Work in progress starting stcoli.c

* Partially label PhysicsBall type

And some stcoli funcs

* Stcoli labelling

* Add Vec2d type

* Collision body labels

* StageGoal labels

* More goal labels

* gen_compile_commands.py: Prefer nonmatching C to matching asm

* sda2-^>_SDA2_BASE_ in stcoli.s

* Match first stcoli function (dol not matching atm though)

* Fix float literals (still not OK)

* gen_compile_commands.py absolute paths (needed on Linux?)

* gen_compile_commands.py fixes

- Export absolute paths, even on Linux
- Add some defines so more C code is exposed for clangd
- Remove extraneous spaces in output
- Executable bit

* Executable bit

* stcoli: match function 2 (meshcoli_grid_lookup())

Didn't fix asm/float literals though

* Small refactor fixes

* First 2 stcoli functions OK

* PhysicsBall labels

* Decompile stcoli_sub03

DOL not matching again though...

* Fix stcoli.s sdata2 alignment after stcoli.c's

* Stcoli func labels

* Format somewhat more reasonably

* Decompile stcoli_sub04

* Decompile stcoli_sub05

Small stcoli_sub05 cleanup

static.lcf

* Labelling

Labelling

Labelling

Labelling

Labelling

* Coli struct labels

* Decompile collide_ball_with_tri_verts

* Decompile collide_ball_with_tri_vert

* Small labels

* Move vec mag sq function to mathutil.h

* Decompile collide_ball_with_rect

* More labels

* Even more labels

* Decompile collide_ball_with_cylinder

Cleanup

* Correct mathutil ifdefs

* Decompile collide_ball_with_circle

* Format

* Labels

* Decompile g_collide_ball_with_sphere

* Decompile g_collide_ball_with_cone

* Little labelling

* Update static.lcf

* PhysicsBall labels

* hit -> plane

* PhysicsBall docs

* Add .clang-format

Not everything follows this but it's generally close to the observed
style

* Rename, and tidy unused stack vars

* Misc

* Remove duplicate ColiRect type

* Label check_ball_in_goal()

* Rename stagedef itemgroupo init pos/rot

* Decompile collide_ball_with_plane (woo)

This function was an extremely tough one, probably harder than all the
previous stcoli funcs combined. Lots of playing around with
combining/splitting temps that may be Vec's or individual temps.

Remove thing

* Document collide_ball_with_plane

* Reword some collide_ball_with_plane docs

* f32 -> float

* accel -> gravityAccel

* Decompile test_line_intersects_rect

* Decompile stcoli_sub15

* Clean up stcoli_sub15 a little

* RaycastHit result

* Renames

* MovableStagePart -> Itemgroup

* stcoli raycast renames

* ItemgroupInfo field labels

* Decompile raycast_stage_down()

* Clean up raycast_stage_down()

* Label bonus_wave_raycast_down()

* Fix bonus_wave_raycast_down() return type

asdf

* Decompile raycast_tri()

* Cleanup raycast_tri()

* Skip raycast_cone(), decompile raycast_sphere()

* Decompile raycast_cylinder()

* .clang-format

* Freecam stub

* 32-byte align dvd read buffers

* Working freecam

* Rename some stagedef stuff

* More stagedef renames

* Stage object labels

* Slight freecam improvements

* Remove nonmatching code

* Label GMA stuff

* Keyframe labels

* Bg model stuff

* Fix stcoli shiftability

* Bg model animation labels

* Bg anim labels again

* Stuff

* Fix wrong label

* The great itemgroup rename

* More consistent .gitignore

* Undo erroneous labels in input.c

* Fix newline

* Label tevutil function names

* GX enums

* Propagate tevutil.h include

* Remove unnecessary tevutil includes

* Tevutil function signatures

* Fix GXSetFog_cached arg order

* Format tevutil.h

* GXSetCullMode checkpoint

* Finish GXSetCullMode enum labels

* Fix enum, update .gitignore

* Itemgroup -> AnimGroup rename pt1

* animgroup -> anim_group

* Fix

* Fix aniimGroup

* Sampler label

* Avdisp checkpoint

* More avdisp label

* More avdisp

Fog

* build_tev_material checkpoint

checkpoint

checkpoint

* Restore matching

* avdisp checkpoint

* Renames

* Label some GMA shape flags

* Propagate GXSetBlendMode_cached

* Propagate GXSetTevSwapMode

* Propagate GXSetFog

* Tev material setup funcs

* Propagate GXSetTevColorIn

* Propagate GXSetTevAlphaIn

* Propagate GXSetTevColor/AlphaOp

* Propagate GXSetTevOrder

* Propagate GXLoadTexObj_cached

* Rematch

* Sampler -> TevStageDesc

* More tev-related labels

* Yes this is probably the unlit flag

* TevMaterialCache-related labels

* Rematch

* Document extra disp lists

* GMA header and flags

* Idk

* Stuff

* More stuff

* Tev post mul/add labels

* Idk

* Draw func labels

* GMA docs

* Layer funcs

* Color/alpha in

* Rematch

* Quick comment remove

* Fix couple function names

* Fix tev layer flag names

* Fix tev layer flags again

* Fix Dolphin includes

* Fix check_ball_entered_goal

* Remove unnecessary stcoli include
2022-04-17 16:02:56 -05:00
camthesaxman 7245b46c74 decompile info.s (#11)
* start decompiling info.s

* decompile ev_info_main

* decompile more of info.s

* finish decompiling info.s

* clean up code
2022-01-30 19:51:45 -06:00
camthesaxman 26eeb5f717 decompile code_1.s (#10) 2022-01-29 10:28:32 -06:00
camthesaxman dd7dbc7402 use .4byte whenever possible 2022-01-28 18:45:20 -06:00
camthesaxman 3e015e3c6d fix some shiftability issues 2022-01-27 22:14:34 -06:00
camthesaxman 9362b4c89d add test recipe and fix up some lwzu instructions 2022-01-27 20:50:36 -06:00
camthesaxman 039ac0e1f5 remove hardcoded _SDA2_BASE_ in assembly files 2022-01-26 19:35:57 -06:00
camthesaxman 4e98f9c0e7 more renaming and decompile dsp.s 2022-01-16 11:47:15 -06:00
camthesaxman 281d4e5c5b labeling 2022-01-15 20:39:45 -06:00
camthesaxman 4dbc9270eb some adv.c cleanup 2022-01-14 18:48:50 -06:00
camthesaxman aa9bb62ca3 add NAOMIOBJ_MODEL macro and add model IDs for common.gma 2022-01-02 21:59:20 -06:00
camthesaxman 4a452787ce more nl2ngc.c labeling 2021-12-26 22:02:43 -06:00
camthesaxman 69ff7f65be remove all remaining hardcoded pointers 2021-12-22 21:34:57 -06:00
camthesaxman 51bd330969 remove some hardcoded pointers 2021-12-22 17:56:40 -06:00
camthesaxman d69cf621b6 build rel files (#6)
* initial work on reldisasm

* super janky WIP elf2rel tool finally produces a matching file

* build mkbe.sel_stage.rel

* decompile mkbe.sel_stage.rel

* oops

* accentally broke dependencies

* disassemble mkbe.rel_mini_pilot.rel

* refactor elf2dol

* disassemble mkbe.option.rel

* disassemble mkbe.rel_mini_bowling.rel

* disassemble mkbe.rel_mini_race.rel

* disassemble mkbe.test_mode.rel

* disassemble mkbe.sel_ngc.rel

* disassemble mkbe.rel_mini_fight.rel

* disassemble mkbe.rel_mini_billiards.rel

* disassemble mkbe.rel_mini_golf.rel
2021-12-20 22:09:56 -06:00
camthesaxman ad7ef2b1ae label bitmap.c and some more of avdisp.c 2021-12-15 00:35:17 -06:00
camthesaxman bb8a6ada41 decompile more of input.s 2021-12-09 22:45:25 -06:00
camthesaxman f8c6faa971 split out camera.h header and label some more 2021-11-21 20:12:05 -06:00
camthesaxman e36aeb6a03 finish decompiling camera.s 2021-11-21 16:09:19 -06:00