Commit graph

128 commits

Author SHA1 Message Date
Tyler Wilding be1e40a041
d/jak2: decompile conveyor | elevator | plat | bouncer | basebutton | base-plat | most of sampler | simple-nav-sphere | simple-focus | elec-gate and blocking-plane (#1942)
Most of these have been atleast partially documented / named / cleaned
up as well.

Co-authored-by: water <awaterford111445@gmail.com>
2022-10-08 12:42:52 -04:00
Tyler Wilding 2d1b5fa57c
d/jak2: finish region as well as some typedef files - ctywide-obs-h | vehicle-h | rigid-body-h (#1935) 2022-10-08 11:45:41 -04:00
ManDude 9351bf782e
[decomp2] game-info, game-task and task-control (#1884)
And everything else needed for them!

A couple functions are bad currently.

- fixes #1929 - untested on linux
- fixes #1924 - now you need to type `,` before a lambda you want to put
in a pair.
- fix debugger symbol table in jak 2
- made the decompiler output `(meters 2)` instead of `(meters 2.0)`
- fixed a bug with the bitfield enum special -1 case
- made bad game text decomp not exit the decompiler
- added `editable-player` and `script`
2022-09-27 19:44:20 -04:00
Tyler Wilding 332f0b2f2b
tools: add a tool to search for types based on size / type chain / fields (#1906)
Just a small simple tool that can search through `all-types` for a type
based on a bunch of criteria.

For example:

![image](https://user-images.githubusercontent.com/13153231/192043561-181e5c5d-d5b1-41a9-8891-5cc3ed1a0efa.png)

The results are printed to stdout, as well as output to a json file so
they can be consumed by another tool (in my plans, the VSCode extension)
2022-09-24 16:04:52 -04:00
Tyler Wilding e64414d9d0
d/jak2: finish drawable-group | drawable-inline-array | drawable-tree and path (#1899) 2022-09-24 12:27:02 -04:00
water111 6a1bde4168
[decomp] fix up debug menu rendering, add a few others (#1892)
![image](https://user-images.githubusercontent.com/48171810/190832869-e609d346-9c4a-43fb-ad94-2a9690521adc.png)
actor vis boxes for PRI.DGO
2022-09-16 20:42:33 -04:00
Tyler Wilding 8117ed3bc7
scripts: make update_decomp_ref.py respect the game we are operating on (#1880) 2022-09-13 20:03:00 -04:00
Tyler Wilding 4620f96574
d/jak2: mostly finish mysql-nav-graph and fix docstring handling around with-pp/local-vars (#1869) 2022-09-13 18:15:02 -04:00
water111 4eea31c3e9
[jak 2] texture (#1866)
- Decompile and patch `texture.gc` for PC
- Improve decompiler when offset doesn't fit in immediate (for types
larger than 8k and some scratchpad accesses)
- Fix symbol->string issues in both jak 1 and 2
- Fix bug with VIF interrupt used to profile VU code (hooked up to
OpenGLRenderer BucketRenderers in PC port)
- Support `~o` in `format`.
- Uncomment stuff in `merc.gc` that now works!

![image](https://user-images.githubusercontent.com/48171810/189505469-941b4a3e-23c7-4740-aa1b-2e461ed19fa9.png)

fixes https://github.com/open-goal/jak-project/issues/1850
2022-09-11 14:17:55 -04:00
Tyler Wilding 81b6d5fe08
d/jak2: finish find-nearest | trajectory | editable-h and most of editable and editable-player (#1847)
Also made a first-pass of their SQL schema in preparation for getting
that working.
2022-09-10 18:03:17 -04:00
ManDude cfb6abb24d
[decompiler] rewrite set lets as just sets (#1858)
Rewrites specific kinds of lets where the return value of the `set!`
itself is meant to be used to just be `set!`s. Implemented at the let
rewrite level. Seems to work for Jak 2 so far.

Fixes #1854 .
2022-09-07 18:28:01 -04:00
Tyler Wilding 44d59e6b33
d/jak2: finish mood-funcs | mood-funcs2 | almost all of mood and airlock (#1842) 2022-09-06 20:35:00 -04:00
Tyler Wilding 80d0137dba
d/jak2: finish the majority of sparticle and sparticle-launcher (#1840)
* sparticle-launcher

* d/jak2: large amount of `sparticle-launcher` done

* d/jak2: finish the majority of `sparticle`

* decomp: improve format code ignoring

* d/jak2: make bits unique in `sp-cpuinfo-flag`

* d/jak1: revert config change
2022-09-05 18:03:46 -04:00
ManDude f1f18e7e05
[decomp2] joint-mod, chain-physics, loader (#1816)
* prep

* Update repo-settings-mark.bat

* Update repo-settings-unmark.bat

* decomp `joint-mod`

* add `joint-mod-ik-callback` to ref exceptions

* `chain-physics`

* Update jak2_ntsc_v1.jsonc

* update bat scripts

* `loader`

* pretty

* refs

* support `process->handle` (and `ppointer->handle`?)

* refs

* source and fixes

* fix `ja` detect

* `ja` macro implement

* fix a method

* update source

* merge fixes

* annoying fixes

* format

* arg

* hack

* fix test
2022-09-02 18:13:38 -04:00
Tyler Wilding d264779173
d/jak2: finish glist | glist-h | camera | cam-interface | cam-states-dbg | cam-combiner | cam-debug | cam-start (#1829)
* d/jak2: finish `glist` and `glist-h` partially done `time-of-day`

* d/jak2: finish `camera` and `cam-interface`

* d/jak2: partially finish `cam-master` `cam-states`, and `cam-update` finish `cam-states-dbg` `cam-combiner` `cam-debug` and `cam-start`

* tests: update ref tests

* scripts: add scripts to automatically update gsrc files

* d/jak2: update gsrc
2022-08-31 19:22:47 -04:00
Tyler Wilding d176b294b9
d/jak2: finish entity-table | sky-data | relocate | and the majority of default-menu (#1812)
* d/jak2: finish `entity-table`

* d/jak2: finish `sky-data`

* d/jak2: finish `relocate`

* d/jak2: halfway through `default-menu`

* d/jak2: 75% done `default-menu`....

* d/jak2: add `default-menu` to ref tests (partially)

* d/jak2: finish updating related code

* scripts: add tooling to automatically keep code from `all-types` up to date

* d/jak2: fixed vector types
2022-08-29 18:49:57 -04:00
Tyler Wilding 01abde35d8
d/jak2: First few files, mood-tables and vol-h (#1796)
* decomp: format jak1 cast files

* decomp: finish `mood-tables` and `mood-tables2`

* jak2: stop disasm'ing

* jak2: format jak2 cast files, start working on the rest of the `mood` files

* scripts: fix running pcsx2 watcher

* d/jak2: finish `vol-h`

* d/jak2: address feedback
2022-08-24 19:34:09 -04:00
water111 f7bd0752f8
[decomp] Decompile first batch of files in engine (#1787)
* wip

* getting stuff set up so we can actually run test cases

* better handle block entry stuff

* types2 working on gstring

* comments

* math ref working

* up to first stack stuff

* stack fixes

* bounding box

* math stuff is working

* float fixes

* temp debug for (method 9 profile-array)

* stupid stupid bug

* debugging

* everything is broken

* some amount of type stuff works

* bitfield

* texture bitfields not working

* temp

* types

* more stuff

* type check

* temp

* float related fixes for light and res problems

* revisit broken files, fix bugs

* more types

* vector debug

* bug fixes for decompiler crashes in harder functions

* update goal_src
2022-08-24 00:29:51 -04:00
Tyler Wilding b3c58d2247
scripts: Add a (hopefully) better goal_src updating script (#1769)
* scripts: cleanup scripts directory some more

* stash, getting there

* stash again

* closer!

* it works! decently....cleanup time and add some extra features

* minor cleanup
2022-08-19 11:30:07 -04:00
Tyler Wilding a66ec7c601
all-types: Improve Jak 2's all-types (#1728)
* all-types: improve all-types generation

* all-types: re-generate all-types

* tests: remove the test reporting feature

the format indeed doesn't work, and all current actions require too many permissions for forked PRs.

I'll make my own eventually that works properly (use the new markdown feature)

* all-types: put the states in the method table instead

* all-types: replace all `*time*...uint64` fields with `time-frame` type

* all-types: address feedback
2022-08-05 17:39:32 -04:00
Tyler Wilding c269374e24
gsrc: add decomp begins placeholder to all gsrc files (#1731) 2022-08-05 16:12:54 -04:00
ManDude 3e538dabe6
more random cleanup (#1716)
* correct some comments

* change `pc-cheats?` macro to be more generic

* more generic custom fps stuff

* better subtitle timings

* oopsie!

* fix burn effect stacking

* fix some windows scripts

* fix project

* cleanup this func

* more fix

* oops

* ???
2022-08-02 18:48:10 -04:00
Tyler Wilding eaac247074
Decompiler: Cleanup CLI and make overriding the config much easier (#1711)
* decomp: cleaned up CLI for decompiler

* decomp: much more flexible and clean decomp override mechanism

* decomp: cleanup scripts
2022-07-29 20:10:11 -04:00
ManDude 163e86130f
separate language settings into 3 settings/options (#1636)
* only show subtitle notices during a subtitle context

* move language & subtitles (back) to game options

* remove "accessibility" menu and put its option in "misc"

* new subtitle language selection

* properly split audio & text language

* Update game_text_en.gs

* misc setting size fixes

* better fix for subtitle notice

* final touches

* subtitle fixes & uk-english subtitles

* more english fixes
2022-07-12 18:00:52 -04:00
ManDude 8caa5bfa70
disable goal networking when not in debug mode (#1602) 2022-07-04 13:52:05 -04:00
Tyler Wilding 728d234976
scripts: update scripts and docs to support multiple games (#1584)
scripts: update scripts and docs to support multi-games disable broken scripts for now
2022-06-30 20:17:06 -04:00
ManDude 4ebb961246
fix windows scripts for jak 2 (#1580)
* fix scripts for jak 2

* delete duplicates

* disable game text for now (unsupported)
2022-06-30 01:22:58 -04:00
Tyler Wilding 345793af41
jak2: Generate goal_src skeleton (#1581)
* jak2: merge identical art files

* jak2: a skeleton is born
2022-06-30 01:22:51 -04:00
Tyler Wilding 36dc015d62
jak2: Create goal_src skeleton (#1576) 2022-06-29 22:20:09 -04:00
water111 91fa0122d8
[decompiler] Jak 2 modifications, new all-types code (#1553)
* temp

* look at old game types

* clean up
2022-06-25 21:26:15 -04:00
ManDude 85bef15364
full ntsc-j mode + greatest hits support (#1525)
* remove str files from inputs

* removed unused verbose flag

* allow some kind of conditional game building for JP extras

* make `PrintBankInfo` do nothing

* clang

* Update gltf_mesh_extract.cpp

* fix `*jak1-full-game*` in extractor

* use json library to build json file

* screw it red label support as well
2022-06-23 18:44:02 -04:00
ManDude 7d5045ab3f
PAL & NTSC-J support + updates (#1490)
* PAL dumps files

* alrighty then

* make PAL warning slightly more specific

* PAL patches for `title-obs`

* Update all-types.gc

* PAL patch `beach-obs`

* `process-taskable` PAL patch

* `ambient` PAL patch

* `yakow` PAL patch

* `village-obs` PAL patch

* `sparticle-launcher` patch

* `swamp-obs` PAL patch

* `sequence-a-village1` PAL patch

* typo

* errors

* `powerups` PAL patch

* `ogreboss` PAL patch

* jak 1 v2 encoding

* `load-boundary` PAL patch

* `flying-lurker` PAL patch

* `mayor` PAL patch

* update game encoding to PAL (v2) encoding

* `cam-debug` and `cam-update` PAL patch

* `fisher` PAL patch

* `target` PAL patch

* `target2` PAL patch and fix text compiling

* `target-death` PAL patch

* `target-racer-h` PAL patch

* `logic-target` PAL patch

* `main` PAL patch

* `snow-flutflut-obs` PAL patch

* `rolling-obs` PAL patch

* `gsound` PAL patch

* update refs

* `progress` and `progress-draw` PAL patches

* clang

* wrong.

* complain

* clang

* fix test

* fix blurry jp text

* fix weird interrupt lag from setting window size

* patch more text lines, special handling for credits

* Update FontUtils.cpp

* Add xdelta3 and file patching interface

* add window lock toggle and update settings ver

* better particle hacks

* add PAL support to extractor

* Fix credits

* also NTSC-J support

* make xdelta3 a separate library

* address feedback

Co-authored-by: water <awaterford111445@gmail.com>
2022-06-22 05:16:34 +01:00
ManDude 8ba89dd95e
fix IOP getting stuck on music load (#1437)
* fix IOP getting stuck on music load

* fix regression? and clang

* fix a decomp

* fix another regression

* another

* fix "all actors"

* another regression!
2022-06-10 19:04:16 -04:00
ManDude 7ce58f709f
process-spawn + pretty printer improvements (#1428)
* some jp support to fix some errors in the original game

* music fade toggle

* recognize `process-new` macros!!

* strip casts in this macro

* rename macro

* fix cast typecheck

* update source 1

* detect kernel stack case

* less boilerplate

* `manipy-spawn` special case

* pretty printer improvements

* revert dumb thing from earlier

* use shell detection on `send-event`

* fix some events

* remove unused argument

* detect `static-attack-info` and add `CondNoElse` to shell detect

* better `attack-info` detect

* support `process-spawn` in multi-lets

* detect `rand-float-gen` pt 1

* detect as return value

* detect in `countdown` and  `dotimes`

* oops this wasnt working

* fancier `send-event`s

* clang

* update source!!

* fix tests

* fine jeez

* uh okay

* fix some accidental regressions

* fix more regressions

* regression fixes

* fix big bug...

* extra safety!
2022-06-10 02:18:08 +01:00
water111 148f52876a
[decomp] add import statements for art groups (#1372)
* new code

* update goal_src and remove all_imports

* update reference

* add decompiler list of imports

* deduplicate and move below decomp begins
2022-05-23 18:53:02 -04:00
Tyler Wilding 7b6d732a77
goalc: Add TCP server socket in REPL process (#1335)
* goalc: cleanup goalc's main method and add nrepl listener socket

* deps: add standalone ASIO for sockets

* lint: formatting

* common: make a common interface for creating a server socket

* goalc: setup new repl server

* deps: remove asio

* goalc: debug issues, nrepl is working again

* git: rename files

* attempt to fix linux function call

* test

* scripts: make the error message even more obvious....

* goalc: make suggested changes, still can't reconnect properly

* game: pull out single-client logic from XSocketServer

* nrepl: supports multiple clients and disconnection/reconnects

* goalc: some minor fixes for tests

* goalc: save repl history when the compiler reloads

* common: add include for linux networking

* a few small changes to fix tests

* is it the assert?

* change thread start order and add a print to an assert

Co-authored-by: water <awaterford111445@gmail.com>
2022-05-06 18:19:37 -04:00
Tyler Wilding dba95660ea
release: fix windows artifacts and stop building asan when releasing on linux (#1283)
* release: fix windows artifacts and stop building asan when releasing on linux

* release: use valid paths in the container's context
2022-04-04 20:50:08 -04:00
water111 5bd0b735a5
Add extractor tool (#1276)
* first attempt

* fix

* zip to tar

* windows

* try again, std::filesystem sucks

* std::filesystem is still garbage

* std::filesystem is terrible

* std::filesystem continues to waste my time

* again

* neadsflaldksal;df
2022-04-03 19:17:03 -04:00
Tyler Wilding b21f0d3397
Add PC Port settings to legit start menu (#1217)
* decompiler: support adding new strings to the game_text.txt file

* gsrc: expand the pckernel type and functions to work better with the menu

* gsrc: add new text-ids

* gsrc: add new macros to help with menu code

* gsrc: make a new type to generalize their list menu options

* gsrc: add new menu options and enums

* gsrc: cleanup and refactor the list menu option drawing code

this allows us to easily add a new list menu option...well as easy as the rest is atleast (setting up static lists properly, etc)

* gsrc: add and cleanup handling of new menu options

* scripts: add checks with nice error messages for user facing taskfile recipes

* lint: formatting

* address simple feedback

* gsrc: move modified files to `pc/` folder

* gsrc: revert changes to originally decompiled files

* gsrc: move modified and new files to `goal_src/pc` folder

* gsrc: update paths in `all_files.gc`
2022-03-10 19:25:01 -05:00
Tyler Wilding 70fcb05a99
docs: fix Arch installation steps, and some typos (#1165)
* docs: fix Arch installation steps, and some typos

* task: fix linux binary paths

* docs: specify that we support the latest Visual Studio community edition
2022-02-13 22:09:34 -05:00
ManDude e91c581c2a
fix the filenames for the code files + minor fixes (#1159)
* some changes to make the `anim-tester` kinda work

* types for `lava` (who cares)

* fix divide by zero macros

* cleanup filenames

* fix tests + minor bug
2022-02-13 00:12:05 -05:00
Tyler Wilding ffb04ddd10
Documentation cleanup and some feature improvements (#1155)
* ci: switch to codacy for coverage

* docs: update badges

* decomp: allow overriding config flags via CLI

* cleanup: top level file cleanup

* docs: big README overhaul

Attempt to close #1128 and #1086

* decomp: attempt to detect if `iso_data` is missing or wrongly extracted

* game: switch to `fpng` for screenshots, allow for compression

closes #1035

* game: switch vsync control to a checkbox

* lint: format cpp files

* lint: format json files

* docs/scripts: organize taskfile
2022-02-12 17:48:50 -05:00
ManDude 5b44aece75
random fixes + support clang-cl on visual studio (#1129)
* delete unused shaders

* hide some options in debug menu

* change fullscreen logic a bit

* add "all actors" toggle

* borderless fix and fix alpha in direct renderer untextured (do we need a separate shader for that?)

* fix fuel cell orbit icons in widescreen

* fix `curve` types

* refs

* fix levitator task...

* fix some task stuff

* update font code a bit (temp)

* cmake, third-party and visual studio overhaul

* Update .gitmodules

* update modules

* clone repos

* fix encoding in zydis

* where did these come from

* try again

* add submodule

* Update 11zip

* Update 11zip

* Update 11zip

* delete

* try again

* clang

* update compiler flags

* delete 11zip. go away.

* Create memory-dump-p2s.py

* properly

* fix minimum architecture c++ compiler flags

* fix zydis

* oops

* Update all-types.gc

* fix clang-cl tests

* make "all actors" work better, entity debug qol

* update game-text conversion code to be more modularized

* Create vendor.txt

* fix typos and minor things

* update refs

* clang

* Attempt to add clang-cl support to vs2019 and CI

* vs2022 + clang-cl

* srsly? fix clang build

* Update launch.vs.json

* extend windows CI timer
2022-02-07 19:15:37 -05:00
ManDude 32d8ae9b6e
streamline newbie decomp/run process, update readme and gallery with new/updated information and pictures (#1132)
* streamline newbie decomp/run process, update readme and gallery with new/updated information and pictures

* and of course

* Fix errors

* fix gallery
2022-02-04 18:37:48 -05:00
ManDude bd1718dc9c
A lot of fixes (game is 100%'able!) (#1118)
* a crapton of fixes

* Update cavecrystal-light.gc

* damn you

* fix bunnies

* change codegen for int -> float cast (just add sign extension now)

* fix test

* this file is tagged anyway

* fix some stack types

* remove bad camera debug funcs

* add more heap bars and entity pick menu

* finish entity menu and make `music-flava` enum

* fix some `process-taskable` fields

* citadel sage crash fix

* fix citadel drop plats

* fix tests

* fix some casts

* update refs

* finish `village3-obs` and `snow-ball`

* Update README.md

* fix sidekick too

* fix issue?

* more entity inspect hardcoded checks

* more

* use `*display-actor-anim*` for something!

* CRAP

* also clear actor anim when deselecting entity

* *display-actor-anim* already renders this!

* do not display `path` tag info

* entity debug inspect tool

* one more

* make debug string even larger

* missing res tag types

* more polish and more known tags

* last few
2022-01-31 20:44:54 -05:00
ManDude eb53f410e5
test game actors and fix up/disable broken ones (#1103)
* test village1, beach, jungle actors

* fix jungle actors

* more anims and fixes

* Update launch.vs.json

* fix bad `robotboss` decomp

* fix `robotboss`

* Update robotboss.gc

* fix `mother-spider-proj`

* fix detach (windows)

* update refs

* village2 spools

* type fixes + a few more spols + add append/not-append to goos

* fix beach, misty, village1, village3, lavatube

* fix snow entities

* fix `target-flut`

* update refs

* forgot one

* fail

* sound fixes

* fix test

* complain if `heap-base` is bad

* correct `add-spheres!` decomp errors

* fix citadel

* fix target `change-state` handler

* fix `final-door` state

* fix `target-flut-falling`

* fix deftypes

* oopsie

* move heap memory display behind a toggle and make it fancy

* Update gstate.gc
2022-01-27 19:33:34 -05:00
Tyler Wilding 142961a747
decomp: the majority of navigate and rolling-lightning-mole (#741)
* decomp: Add texture-upload to ref tests

* maybe 50% done?

* 5 functions to go!

* decomp: stuck in `navigate`

* work-around fp issue

* some cleanup and label casts

* working on supporting asm instructions -- this is currently WRONG

* support ASM operations

* fixes for asm op support

* decomp: finish the vast majority of `navigate`

* format

* update test though i think this suggests a regression!

* decomp: cleanup some more of navigate

* decomp: finish `rolling-lightning-mole`

* revert `r0` handling for `pcpyud` and `pextuw`

* update ref tests

* lint

* fix a failing test

* help

* navigate mostly works now, with some potential bugs

* remove my debugging logs

* update ref tests

* review feedback cleanup

* these are all likely fine

* can't get the crab to chase me anymore

* the crab is back
2022-01-18 01:14:47 -05:00
Tyler Wilding e65c61f3e2
tests: add a bunch of missing ref tests (#1082)
* scripts: add a script to point out missing ref test files

* tests: add a bunch of files to ref tests we were missing
2022-01-17 11:51:26 -05:00
Tyler Wilding b95be06fef
decomp: mostly finish ogreboss (#1024)
* decomp: partially done `ogreboss`

* decomp: finish `ogreboss`

* update

* fix `ogreboss` and `viewer`

* update ref tests

* update ogreboss
2022-01-15 20:33:11 -05:00
ManDude 27bb6c6384
[decompiler] decompile particle defs using specialized macros (#1077)
* [decompiler] `defpart` and `defpartgroup`

* support sounds in part defs natively

* make `meters_to_string`

* update refs

* clang

* make macros in pair only work inside `(unquote ...`

* update source

* update finish

* fix
2022-01-15 20:01:38 -05:00