Commit graph

487 commits

Author SHA1 Message Date
Tyler Wilding 373e9059eb
decomp: add powerups to ref-tests and finish target-flut | target-death (#1017)
* decomp: add `powerups` to ref-tests

* decomp: finish `target-flut`

* decomp: finish `target-death`
2021-12-18 19:13:40 -05:00
Tyler Wilding 547e37d8f1
decomp: finish vol | helix-water | minecart (#1016)
* some fixes, but no file unblocked completely yet - `balloonlurker` is close

* decomp: finish `vol` - i did it!...i think

* decomp: finish `helix-water`

* decomp: finish `minecart`

* fix `define-perm`s
2021-12-18 17:15:11 -05:00
Tyler Wilding e8027eaeb8
decomp: finish cave-trap (#1015)
* decomp: finish `cave-trap`

* address feedback

* fix stack casts
2021-12-18 16:05:33 -05:00
Tyler Wilding 89980bd61d
decomp: finish mother-spider (#1014)
* decomp: finish `mother-spider`

* address feedback
2021-12-18 01:32:46 -05:00
Tyler Wilding e6d17eb78f
decomp: finish plant-boss and crates (#1012)
* stuck: `crates` has issues setting bitfield with `r0`

* decomp: finish `plant-boss` except for 1 function

* decomp: finish `crates`

* address feedback
2021-12-18 01:31:14 -05:00
Tyler Wilding 574a61e02a
decomp: finish mistycannon (#1009)
* stuck: a bit more progress in `snow-ball`

* decomp: finish `mistycannon`

* address feedback
2021-12-15 21:19:22 -05:00
Tyler Wilding 39f6575661
decomp: finish kermit (#1007)
* decomp: finish `kermit`

* fix function split
2021-12-14 23:49:20 -05:00
Tyler Wilding 83b88d74ff
decomp: finish target-ice (#1005) 2021-12-12 23:27:18 -05:00
Tyler Wilding 7edfc8bcec
decomp: Re-attempting previously blocked state decomp files (#907)
* blocked: `part-tester` - `code` handler thinks it returns nothing

* blocked: `crates` finished but `go` is returning none causing issues

* blocked: `(event ram-boss-idle)::snow-ram-boss` expression building fails due to delay slot issue

* decomp: finish `snow-ram` | `seagull` blocked, new static data issue

* decomp: finish `snow-bumper`

* stuck: `snow-ball` close, can't figure out a type made on the stack

* decomp: finish `spider-egg`

* decomp: finish `puffer`

* decomp: finish `driller-lurker`

* decomp: finish `dark-crystal`

* stuck: `kermit` - mostly done but stuck on a joint related callback arg

* decomp: finish `gnawer`

* decomp: finish `mother-spider-egg`

* decomp: finish `swamp-blimp`

* stuck: `mistycannon` prebind function signature

* decomp: finish `citb-plat`

* decomp: finish `darkvine`

* blocked: `jungle-mirrors` - issues with `link` macro

* decomp: finish `launcherdoor`

* decomp: finish `quicksandlurker` except for 1 unused function

* stuck: `balloonlurker` - `(code balloonlurker-mine-explode)` has some weird joint related code

* stuck: need to decompile an asm func in `orbit-plat`

* decomp: finish `voicebox`

* blocked: `mother-spider` has issues where `go` returns none

* decomp: finish `bully`

* decomp: finish `seagull`

* fixed up after merge conflicts

* decomp: finish `jungle-mirrors`

* update gsrc

* double checked files, fixed issues

* decomp: revert change to projectile methods

* decomp: some more fixes

* address feedback

* fix up remaining method calls in `cam-states`

* fix jungle-mirrors
2021-12-11 13:27:24 -05:00
water111 fe9c5c10d1
[goos] support improper lists in pretty printer (#1001) 2021-12-09 20:56:50 -05:00
ManDude 59a12029a0
[decomp] cleanup default-menu, fix dangerous IOP bug, autoconvert ints in pairs to/from bintegers (#997)
* fix a couple macros in ref tests

* `default-menu` cleanup

* add `find-instance-by-name` func

* improve debugger slightly hopefully

* fix IOP PLAY buffer overrun bug

* fix `default-menu` more

* automatically convert ints in static pairs to/from bintegers

* fix test

* clang

* fix a few more lambdas

* update refs

* add custom menu cuz cool

* oopsie! also make `default-level` and `halfpipe` go away

* add camera teleport menu

* update types in debug menu
2021-12-09 18:39:40 -05:00
water111 dbc266c00b
New Pretty Printer (#994)
* begin work on improved pretty printer

* update ref

* finish pretty printer

* force line break for defstate
2021-12-04 16:06:01 -05:00
water111 28b6584cd4
add ref tests for tfrag (#989) 2021-12-04 13:14:40 -05:00
water111 083202929c
[graphics] tfrag3 renderer (#978)
* begin work

* work

* working objs

* exporting

* it works

* before some time of day fixes

* add time of day interp and also fix zbuffer

* some small blending fixes

* improve randomess

* clean up extraction and missing blend mode

* culling, time of day, more level fixes

* more cleanup

* cleanup memory usage

* windows fix
2021-12-04 12:33:18 -05:00
ManDude d845524c23
[decompiler] detect cpad-hold? and cpad-pressed? (#986)
* [decompiler] detect `cpad-hold?` and `cpad-pressed?`

* cleanup cpad macro button lookup

* better

* fix
2021-12-01 19:41:49 -05:00
ManDude 6a38597cbc
[decomp] make use of the generated load boundary data (#984)
* make use of the generated load boundary data

* reverse load boundaries
2021-11-30 19:14:43 -05:00
Tyler Wilding 111af1ec19
decomp: finish the remainder of untouched gameplay code (#893)
* decomp: finish `sidekick`

* decomp: got a lot of `target` done

* decompiler: Add support for non power of 2 offsets for inline arr access

* decomp: finish `target` mostly

* decomp: finish `water`

* decomp: finished `robotboss-weapon`

* decomp: finish `robotboss-misc`

* decomp: finish the majority of `robotboss`

* blocked: `racer` has an issue around entering a state

* blocked: `target-racer` done mostly, but NYI case in one function

* blocked: `racer-states` mostly finished, but bitfield issue

* blocked: `billy` on state decomping

* blocked: `bully` on state decomping

* waiting: `rolling-lightning-mole` waiting on navigate for 2 funcs

* blocked: `rolling-robber` finished but `s6-1` issue

* blocked: `ogreboss` uint64's for types cant label load em!

* blocked: `mother-spider` state decompilation

* half-done `target-flut`

* blocked: `target-flut` some sort of new bitfield state

* some improvements in `racer-states` with my new-found knowledge

* progress: started on `target-death`

* blocked: `target-death` handle casts

* decomp: finish `collide-reaction-racer`

* blocked: `target-handler` handler forced to return `none`

* decomp: 99% of `target2` finished

* decomp: finish `target2`

* gsrc: update

* update post merge

* address feedback

* scripts: add script to detect decomp issues

* fix wide-spread `collide-shape` method missing arg

* some small things i changed from master

* address feedback

* fix typeconsistency issue
2021-11-24 00:33:10 -05:00
ManDude 25b0e1be7d
[decomp] collectables + works ingame! (#971)
* decomp: `collectables`

* fix types

* `powerups` and fixes

* fixes

* Merge branch 'pr/929' into d/temp/collectables

* fix collide stuff

* update things...

* update

* update

* temp bump global heap mem

* fix `defstate` hooks wrong/unnecessary sets & collide stuff for collectables

* dumb mistakes :)

* stub out broken process-drawable stuff

* update refs

* add `:no-inspect` key and save some memory & remove birth logs

* Update kmachine.h

* clang

* add citadel

* fix no-inspect key

* fix tests!!

* fix stupid mistake in `collide-shape-prim-sphere` alloc

* comment annoying print

* feedback

* fix edge-case probably

* remove `:no-inspect`s
2021-11-23 18:25:57 -05:00
ManDude 80a002f8c0
[decomp] entity birth (#964)
* make birthing work

* fix float representation on defskelgroup

* test

* update

* debugger improvements & dont upload aux sprites

* ?

* fix progress

* fixes

* fixes

* Create bea.gd

* fix test

* fix xmm reg clobbering in kernel (water)

* cleanup cam-start

* clear gamepad state every frame

* allow controller connects and disconnects while running
2021-11-15 19:05:28 -05:00
water111 380e7b3580
clean up a few small things (#968) 2021-11-14 12:45:47 -05:00
Tyler Wilding c8a31d4d1b
decomp: Pass of the final remaining gameplay related files (#921)
* blocked: `plant-boss` has `go` returning none issues

* blocked: `ice-cube` return value getting forced to none

* blocked: `ropebridge` has static data isue

* blocked: `double-lurker` handle cast issues

* decomp: finish `billy`

* decomp: finish `lurkerworm`

* blocked: `pelican` handle casts

* decomp: finish `citb-bunny`

* blocked: inherited states in `snow-bunny`

* blocked: CFG resolution in `lavatube-energy`

* decomp: finish `citadel-sages`

* progress: working through `collectables`

* blocked: finished as much as currently possible in `collectables`

- process-tree's 10 method pparently has a 3rd arg -- im doubtful
- set-to-run function
- branch delay unimplemented case
- weird method 21 eco-collectable

* pre-merge

* decomp: update source files / ref tests

* decomp: finish `floating-launcher`, `shover`, `steam-cap`, `sun-iris-door`, `whirlpool`

* decomp: address feedback

* update ref tests and gsrc
2021-11-14 11:14:43 -05:00
Tyler Wilding f605b0ee38
decomp: generic-obs (#894)
* stash

* more

* and more

* like 80% done

* trying to update things

* refreshed work on generic-obs

* blocked: down to only decompiler issues!

* decomp: finish `generic-obs` skip over the failing functions for now

* `pair` -> `object`s and fix 2/4 of the functions i had skipped

* address feedback
2021-11-13 23:31:29 -05:00
Tyler Wilding 44c43610ce
game: Get camera code working (#965)
* cmake: disable edit&continue flags

* goos: make the build system work for alternate file paths nicely

* vs: update vs config

* vscode: extend terminal buffer!

* vs: fix presets

* debugger: fix exception handler

* game: add logo to application

* decomp: get `cam-master` to "work" -- manually changed return type

* debugger: fix printing issue

* game: get the camera actually working

* game: neutralize the analog sticks

* game: support analog sticks

* tests: update ref tests

* temp commit - inprogress stuff

* fix `send-macro`

* turn camera stuff back on, seems to work.  Still kernel-dispatch problem though

* address feedback

* formatting
2021-11-13 22:41:15 -05:00
water111 3afd99a8e3
[graphics] partial tfrag implementation (#958)
* temp

* some decomp

* tfrag dma setup

* fix negative label bug

* tfrag dma setup

* tfrag, with pipeline tricks

* kinda works

* cleanup before trying some color stuff

* time of day works

* clean up

* temp before render changes

* a few more fixes

* fix up tests

* clean up

* fix

* fix alignment

* one more cleanup
2021-11-13 20:44:17 -05:00
ManDude ae22ba42d0
[decomp] orb-cache (#956)
* begin

* tests

* missing stuff
2021-11-09 23:22:31 -05:00
Tyler Wilding 5f1ed7ab60
decomp: decompile *-obs files (#856)
* decomp: mostly finish `cam-master`

* decomp/scripts: lots of work in cam-states

* stash

* Merge remote-tracking branch 'water111/master' into decomp/camera-master

Updated submodule third-party/googletest

* decompiler: Add support for non power of 2 offsets for inline arr access

* decomp: mostly finish `cam-states` need to fix a macro issue

* blocked: `cam-master` decompiler crash when adding casts

* decomp: finish `cam-states-dbg`

* decomp: mostly finish `pov-camera` with the exception of joint-related code

* decomp: `cam-debug` finished decompiling, no way does this compile yet though

* decomp: considerable work done in `cam-layout`

* decomp: `cam-layout` almost done!

* decomp: `pov-camera` finished, TC tests will fail for now

* decomp: working on resolving issues

* decomp: cam-layout decompiling

* fixing more issues in cam-master...one event handler remains

* skip problematic function in `cam-master` for now

* gsrc: update res macros

* decomp: finish `cam-states`

* decomp: giving up on `cam-debug`

* tests: allow skipping state handlers in ref tests

* decomp: working through cam-layout bugs

* decomp: allow for shifting non-integers

* decomp: finalize `cam-layout` and `cam-master`

* decomp: finalize `cam-states`

* cleanup: bi-annual formatting of the casting files

* formatting

* decomp: start working on beach-obs

* blocked: `beach-obs` mostly finished, but handle cast issues and unknown `prebind` func signature

* blocked: `villagep-obs` done, `s6` not being referred to as `self`

* decomp: finish `citadel-obs`

* decomp: finish `darkcave-obs`

* blocked: need to allow `hud-h` to decompile properly (#f as static pointer)

* decomp: finish `jungle-obs`

* decomp: finish `village-obs`

* blocked: `misty-obs` handle cast issues

* decomp: finish `village2-obs`

* decomp: 1 function left in `swamp-obs`, particle related -- maybe we know now?

* decomp: finish `swamp-obs`

* blocked: `maincave-obs` handle casts

* decomp: finish `sunken-obs`

* blocked: `rolling-obs` handle casts and hud-parts

* decomp: finish `firecanyon-obs`

* decomp: finish `ogre-obs`

* blocked: `village3-obs` gives up type analysis!

* blocked: `snow-obs` has hud-parts and handle casts code

* decomp: finish `snow-flutflut-obs`

* blocked: `lavatube-obs` has s6-1 issue

* blocked: `title-obs` handle cast issues

* fixed post merge problems

* decomp: finish `jungleb-obs`

* blocked: `training-obs` has `s6-1` issue

* fix type consistency

* scripts: Extend update script to handle the game-text-id enum as well

* git: Update git attributes to effectively halve PR burden

* fixed `sound-play-by-name` signature

* fix particle definitions in firecanyon-obs

* fix func signature in racer-states

* update ref tests

* tests: update current ref tests

* tests: add `joint` to ref-tests

* tests: add `process-drawable` to ref-tests

* updated gsrc

* add back manual fix

* address most feedback, update source files

* get rid of forward declarations in `darkcave-obs`

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2021-11-05 21:29:32 -04:00
ManDude 2ea2d6a58a
[decompiler] implement defskelgroup (#955)
* implement `defskelgroup` in decompiler

0 lines removed!

* clang

* fix matcher code

* it was fine actually

* update all files (pt 1)

* update all files

* remaining fixes!

* null deref

* use METER_LENGTH

* move max lod warning

* clang

* math error

* fix macros too

* fix bug in a print
2021-11-04 19:10:39 -04:00
water111 8846968963
[Debugger] windows debugger and process drawable (#953)
* Update assert.h

* stuff for `process-drawable` to work

* add windows code for debugger

* debugger attaches

* something works

* remove bad ideas

* `(:break)` works

* connection fixes

* fixes + update docs

* crates & `defskelgroup` macro

* clang

* update tests and a few types

* temp

* temp

* fix files

* game builds

* reverse TypeConsistency operation

* add eye stuff for merc art login

* add `(:sym-name)`

* oops

* add `--auto-dbg` option to gc args

* codacy

* improve robustness of dgo unpacker and objectfiledb reading

* `cavegeyserrock`

* hopefully fix linux

* windows FormatMessage weirdness?

* mutex fixes

* fix merge conflicts

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2021-10-31 11:01:15 -04:00
Tyler Wilding 6299335625
decomp: finish junglesnake and viewer (#951)
* decomp: finish `junglesnake`

* decomp: finish `viewer`
2021-10-29 19:19:51 -04:00
water111 8b25a19e92
add ref test for text (#947) 2021-10-26 21:35:23 -04:00
water111 66bd7cb464
[decomp] memory usage (#945)
* fix type bug for memory-usage

* avoid name conflict in link method and function
2021-10-26 21:14:50 -04:00
Tyler Wilding 5f040792e9
decomp: finish merc-death and some progress on ocean / powerups (#940)
* blocked: `powerups` finicky handle casts

* stuck: decompiled `ocean-texture` but `ocean-verts` is a mystery to me

* decomp: finish `merc-death`

* fix some issues, add a way to remind us for files we've manually touched

* tests: add `ambient` to ref tests, uncover compiler error

* tests: add `main` and `font` to ref tests
2021-10-26 19:16:16 -04:00
Tyler Wilding 236f298138
decomp: add default-menu to ref tests, cleanup irrelevant gsrc forward decls (#941)
* decomp: add `default-menu` to ref tests, cleanup gsrc

* re-disable function

* decomp: add `drawable-group` to ref-tests
2021-10-25 19:22:52 -04:00
water111 d6e82eedb0
[decomp] fix and decomp part tester (#935)
* temp

* update tests
2021-10-23 20:15:31 -04:00
water111 d6f631383e
decomp more level stuff (#932)
* more level stuff

* vi1 to jun load working, with multiple skies

* small fixes

* add level ref test

* clang
2021-10-23 16:00:49 -04:00
ManDude 8ca67a5c21
[decomp] add (most) PAL changes to main (#925)
* add (most) PAL changes to `main`

* fix examplecam movement

* fix up camera code

* Use `score` system when decompiling structures

* typo

* restore asserts
2021-10-23 15:38:06 -04:00
water111 49e3fa2963
fix decomp bugs and add ref tests (#930) 2021-10-23 10:41:11 -04:00
water111 44626cfedd
fix issues and decompile racer-states (#924)
* fix issues and decompile racer-states

* type fix
2021-10-21 22:38:39 -04:00
water111 b7fe8447e2
[decomp] improve types around enter-state (#923)
* clean up

* restore hack
2021-10-20 20:55:25 -04:00
water111 18714ba536
[decomp] load boundaries (#922)
* mostly working

* fixes

* very small fixes

* fix tests

* clang
2021-10-20 19:49:32 -04:00
ManDude 0e96cdb6c5
[de/compiler] New text tool (#918)
* fix `citb-drop-plat` a bit and PAL `fisher`

* Clean up `pc-pad-utils`. Looks so clean!

* Increase process stacks by ~2x

* Convert `game_text` custom encoding to and from a readable one (UTF-8)

* clang

* add missing characters

* support all diacritic variants

* fix a character

* remaining cases

* fix tests

* fix memory leak?

* clang

* add custom characters w/ diacritics

* Update all-types.gc

* robustness

* minor bug

* move custom font decoding function to `FontUtils.cpp`

* Move valid source chars patching to Reader constructor
2021-10-19 00:02:18 -04:00
Tyler Wilding 45318be063
decomp: finish _almost all of_ the remaining camera code (#845)
* decomp: mostly finish `cam-master`

* decomp/scripts: lots of work in cam-states

* stash

* Merge remote-tracking branch 'water111/master' into decomp/camera-master

Updated submodule third-party/googletest

* decompiler: Add support for non power of 2 offsets for inline arr access

* decomp: mostly finish `cam-states` need to fix a macro issue

* blocked: `cam-master` decompiler crash when adding casts

* decomp: finish `cam-states-dbg`

* decomp: mostly finish `pov-camera` with the exception of joint-related code

* decomp: `cam-debug` finished decompiling, no way does this compile yet though

* decomp: considerable work done in `cam-layout`

* decomp: `cam-layout` almost done!

* decomp: `pov-camera` finished, TC tests will fail for now

* decomp: working on resolving issues

* decomp: cam-layout decompiling

* fixing more issues in cam-master...one event handler remains

* skip problematic function in `cam-master` for now

* gsrc: update res macros

* decomp: finish `cam-states`

* decomp: giving up on `cam-debug`

* tests: allow skipping state handlers in ref tests

* decomp: working through cam-layout bugs

* decomp: allow for shifting non-integers

* decomp: finalize `cam-layout` and `cam-master`

* decomp: finalize `cam-states`

* cleanup: bi-annual formatting of the casting files

* formatting

* address feedback - leave the float labels alone for now

* address feedback

* linting/formatting

* update gsrc and ref tests

Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
2021-10-16 21:01:23 -04:00
water111 993f348c93
[decomp] recognize most cases send-event macro (#906)
* recognize send-event macro

* missing forward def

* resolve merge conflicts
2021-10-16 15:12:01 -04:00
ManDude caac740aff
[decomp] fisher and FIN.DGO (finalboss) level (#899)
* decomp `fisher`, `robotboss`, `light-eco`, `green-eco-lurker`, `sage-finalboss`, `robotboss-weapon`, `robotboss-misc`

* fixes

* add files

* add `:states` list to `deftype` and fix files

* test state forward decl's on a few more types

* also the refs

* add light-eco

* whatever
2021-10-16 14:06:33 -04:00
water111 9225d28444
clean up casts around conds with elses (#904) 2021-10-16 12:02:49 -04:00
water111 f87646e8ce
Small state fixes (#901)
* small fixes

* catch uncaught exception
2021-10-15 21:31:22 -04:00
water111 08e98b49c6
[goalc] improve reliability of debugger tests (#898)
* try fixing debugger test

* poke first

* debug print

* another try on debug prints

* start watcher after we did a break

* cleanup print statements, use sleep_for instead of usleep
2021-10-15 19:24:52 -04:00
ManDude bacf9fd130
PAL jak 1 decompiler profile (#891)
* [decompiler] pal "support"

* inoffensively add some PAL-updated types

* fixes!

* clarify some things for windows

* Update README.md

* dummy

* config fixes

* dummy
2021-10-15 18:17:51 -04:00
water111 3a1c9eaf75
[decompiler] clean up offline test program, reorganize decomp order (#895)
* make a new offline test

* finish up offline test and fix crash bugs
2021-10-12 20:33:26 -04:00
water111 b2052016e2
[decomp] sky/time of day (#883)
* time of day

* goal code seems to work

* stars at wrong spot

* stars and sun work

* debugging clouds

* fix texture correction

* sky works

* cleanup, add profiler

* clean up

* final clean up

* offline tests

* missing include
2021-10-10 20:07:03 -04:00