98 Commits

Author SHA1 Message Date
camthesaxman 30f37f7b3d decompile recplay.s (#39)
* start decompiling recplay.s

* decompile more of recplay.s

* decompile the behemoth that is func_8004A0C8

* decompile more of recplay.s

* decompile more of recplay.s

* finish decompiling recplay.s

* labeling
2022-07-04 16:39:21 -05:00
camthesaxman be817a6a6f decompile mtx44.s 2022-07-04 09:56:20 -05:00
camthesaxman d8b50e36c9 decompile code_1.s 2022-06-30 21:51:24 -05:00
camthesaxman 50e76a02af put FLT_EPSILON in float.h 2022-06-30 16:51:11 -05:00
camthesaxman b1f5db7755 decompile GXFifo.s and GXStubs.s 2022-06-19 22:45:28 -05:00
camthesaxman 9e7cdcd208 decompile GXTev.s 2022-06-19 18:07:59 -05:00
camthesaxman ff285b61c5 decompile GXLight.s 2022-06-18 15:22:49 -05:00
camthesaxman c26b3d2e3d decompile rend_efc.s (#37)
* start decompiling rend_efc.s

* decompile more of rend_efc.s

* decompile more of rend_efc.s

* decompile more of rend_efc.s

* finish decompiling rend_efc.s

* labeling
2022-06-09 23:36:42 -05:00
camthesaxman a4b047042a decompile mbstring.s 2022-06-06 23:44:06 -05:00
camthesaxman 4f91b1408b decompile buffer_io.s 2022-06-06 23:22:31 -05:00
camthesaxman 218d7d9b57 decompile GXTransform.s 2022-06-06 18:13:33 -05:00
camthesaxman cf9e05a405 decompile GXGeometry.s 2022-06-05 22:04:03 -05:00
camthesaxman a0214ede7c Allow compiling with gcc (#35)
* initial work on gcc support

* fix more gcc issues

* fix ball.c crash when compiled with gcc

* fixed white monkey face glitch

* no need to support R_PPC_REL32 relocs after all

* stop generating .eh_frame and .gnu.attributes sections

* fix more instances of undefined behavior
2022-06-05 20:38:16 -05:00
camthesaxman 80deff3684 decompile bg_end.s 2022-05-25 22:38:47 -05:00
camthesaxman 5fa0ab0fd1 labeling 2022-05-19 17:20:41 -05:00
cameron 04b156d6c6 add missing GX function declarations 2022-05-05 16:45:31 -05:00
ch-mcl e670da52b9 decompile tevutil (#24)
* 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

* decomp 3 functions

* decomp 3 functions (0x8009E270 - 0x8009E394)

* decomp tevutil_init

* decomp 2 functions (0x8009E398 - 0x8009E440)

* decomp 4 func (0x8009E444 - 0x8009E584)

* decompile 3 functions (0x8009E588 - 0x8009E614)

* change name GMATevLayer.unk4 to GMATevLayer.texIndex

* clean up ZMode structure

* start decompiling code_0.s

* decompile more of code_0.s

* remove dump file

* decomp 6 functions (0x8009E618 - 0x8009E914)

* clean up codes

* decomp 2 functions (0x8009E918 - 0x8009EA2C)

* rename "GXCache_child_0x712" to "GXTexSize"

* decompile more of code_0.s

* decomp 10 functions (0x8009F10C - 0x8009F498)

* fix parameters

* Revert "Merge remote-tracking branch 'ORIGINAL_CAMTHESAXMAN/decomp-code_0' into tevutil_decomp"

This reverts commit ba26513e501eb2a151873d8808fba70cfcc66d58, reversing
changes made to 45e128785a65b96b06a3f16bc6507cf6c8236356.

* write comment in func_8009EA30

* decomp func_8009EA30

* decompile GXSetTevOrder_cached

* fix func_8009EA30 (parameters and local value change)

* fix func_8009EA30 (parameters and local value change.)
It's not "GXTevMode". GX_BLEND not set GX_CC_ONE in Color regB.

* define GXSetTevColorOp, GXSetTevAlphaOp (and functions define order sort by asm address)

* decompile GXSetTevColorOp_cached, GXSetTevAlphaOp_cached (0x8009E8B4 - 0x8009E914, 0x8009E9CC - 0x8009EA2C)

* clean up GXPixel.h

* clean up GXTev.h

* fix 9 functions define arg type

* clean up type.h (remove "0x" from gxChace relate structure names)

* clean up codes (affect by review. https://github.com/camthesaxman/smb-decomp/pull/24#discussion_r865864481)

* fix comment locations

Co-authored-by: ComplexPlane <complexplanegames@gmail.com>
Co-authored-by: camthesaxman <camthesaxman@users.noreply.github.com>
2022-05-05 16:32:30 -05:00
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 23c5eef656 decompile mot_ape.s (#15)
* start decompiling mot_ape.s

* decompile more of mot_ape.s

* decompile more of mot_ape.s

* decompile more of mot_ape.s

* could not match func_8008B3B8

* decompile more of mot_ape.s

* decompile more of mot_ape.s

* finish decompiling mot_ape.s

* match func_8008B3B8 (thanks, EpochFlame)

* clean up func_8008B3B8
2022-04-19 20:24:02 -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
ComplexPlane 0bff44d57f Tevutil labels (#19)
* 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
2022-04-13 17:44:54 -05:00
ComplexPlane 74e69e9c7e Separately compilable headers (#13)
* 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

* Remove stcoli changes from this PR

* Fix EOF newlines
2022-02-21 18:23:59 -06:00
camthesaxman dbb0f7c477 decompile dsp_task.s 2022-02-02 22:16:08 -06:00
camthesaxman 3774b0f678 C versions of some mathutil functions 2022-01-31 22:42:10 -06:00