A few issues:
- lwidea's fr3 is getting loaded and unloaded all the time
- the debug line drawing clipping is wrong (doesn't seem wrong in pcsx2,
so I think this is on us)
- nothing actually using vis data yet
- at a large distance, our view frustum culling seems slightly too
aggressive (might be that viewport scissoring is wrong)
- in the city, things seem darker as you move away. unclear how this is
happening (fog?)
Favors the `lg` namespace over `fmt` directly, as this will output the
logs to a file / has log levels.
I also made assertion errors go to a file, this unfortunately means
importing `lg` and hence `fmt` which was attempted to be avoided before.
But I'm not sure how else to do this aspect without re-inventing the
file logging.
We have a lot of commented out prints as well that we should probably
cleanup at some point / switch them to trace level and default to `info`
level.
I noticed the pattern of disabling debug logs behind some boolean,
something to consider cleaning up in the future -- if our logs were more
structured (knowing where they are coming from) then a lot this
boilerplate could be eliminated.
Closes#1358
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`
eg
```
(set! (-> obj sound-pre-open) (static-sound-spec "airlock-slider"))
```
it is the same as jak 1, but the `fo-curve` option is set to 1
sometimes.
Just missing `target-board-handler` because it errored with `Bad delay
slot in clean_up_cond_no_else_final` and I wasn't able to figure out
where the asm branch was.
Commented out `target-board-clone-anim` because it crashes even after
adding `clone-anim` and `clone-anim-once`.
Some notes:
- `draw-prototype-inline-array-shrub` can probably be decompiled but I'm
not comfortable doing this function myself. It's got a ton of inline
assembly (or at least I think it's inline assembly) and is very long. I
left this marked as asm for now but I am confident in the function
definition.
- The VU program is identical to Jak 1 (yay)
- There's some new `dma-test` stuff at the end of the file, not really
sure what it's doing but it runs in the top-level.
- decompile `subdivide`, `wind-work`, `tie-work`, `bsp`, `focus`
- support `ppacb` in compiler
- don't assert when bitfield stuff fails due to constant propgataion
weirdness
- finish up history
- div/mod unsigned assert fix in decompiler
- empty assert fix in decompiler for failed `add` type prop
- make jak 1 performance counters "work" (just measure time)
- fix cast/typos on pcgtb/vftoi15
Fixes a crash when there's a `(new 'static 'something :field <some
anonymous function with a particular set of errors in the decompler>)`.
The output will now be
```
(set! *duck-mods* (new 'static 'surface
:name 'duck
...
:mult-hook <lambda at L615>
:flags (surface-flag duck)
)
```
fixes https://github.com/open-goal/jak-project/issues/1882
Has boxed array accessing that prevents me from adding anything to ref
tests (the entire file is lambdas so the access pattern that i would
like to ignore happens at the top-level, can't ignore it.
This code actually already has quite a bit of original docstrings so
it's not too bad in that regard considering a `script-context` can have
16 arbitrary objects. It seems they rarely put more than a single object
in the context and the types are usually obvious / are actually type
checked!
The merc VU1 program is identical to Jak 1. Jak 2's merc is doing some
new texture login stuff and the DMA buffer setup is a bit different, but
overall very similar.
Fixes https://github.com/open-goal/jak-project/issues/1821 by adding a
special case for `new` method calls where the argument with type
`symbol` is actually an address to uninitialized structure on the stack.
Fixes https://github.com/open-goal/jak-project/issues/1849 (or at least
the cause of the issue Vaser gave in chat, and one random one I found in
`debug-sphere`)
Fixes https://github.com/open-goal/jak-project/issues/1853
Fixes https://github.com/open-goal/jak-project/issues/1857 by moving the
cast into the cond if the body is a single form and the destination type
is a bitfield/enum which is likely to work well. Seems to work on the
examples we could find in jak 1 and jak 2.
Also fixes an issue with casts on the result of `handle->process` (a
common place to use casts)
the output of process->handle is a plain process. Most of the time, you
end up casting this to a more specific. If you add a cast on every use
of the variable, the decompiler will decide to change the type of that
variable to the more specific type, and this breaks the handle cast.
so previously it was impossible to get code like
```
(let* ((s2-0 (the-as swingpole (handle->process (-> self control hack))))
(gp-0 (-> s2-0 dir))
)
```
But now it will work
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 .
I wasn't able to 100% complete `debug` due to a bunch of level boundary
debug stuff I couldn't figure out. But, I added a ref test and
documented/copied over everything else into goal_src.
Most of the functions that existed in Jak 1 are identical, others got an
extra param or 2 and some now make copies of arguments instead of
modifying them. There's a bunch of new functions, including all of the
debug functions that used to be in `level-boundary` are now in `debug`.
At the very end of `debug` there's also some weird asm functions
checking for some EE memory controller bug (not sure what's up with
that)?
* 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
* jak1: put common speedrunning code into it's own file
* jak1: enforce `60` fps while in speedrunning mode
* jak1: when speedrunning, display the version until you get the first powercell
* jak1: add an explicit option for skipping cutscenes
* jak1: extend `game-option` to allow any menu option to be disabled
* tests/jak1: allow whitelisting types to be redefined to satisfy typeconsistency checks
* jak1: add file headers
* jak1: cleanup bool checking
* test: delete the es substitle file
* test: add it back
* jak1: missed one cleanup spot related to bool comparisons
* First pass at rigid-body-h
* More rigid-body stuff
* More rigid-body
* A little bit of rigid-body-plat
* Method types for known rigid-body-control proxy methods
* Add back note
* Move rigid body label types to a better spot
* d/jak2: finish `cylinder`
* d/jak2: mostly finish `history`
* d/jak2: finish a bit of `ripple` and `sync-info`
* d/jak2: finish `font-data` and chip away at some other files
* d/jak2: most of `text` done, a bit of `script` - symbol arr issue in `level-info`
* d/jak2: finish `mech-h`
* lint: format
* tests: fix typeconsistency
* d/jak2: address feedback
* 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
* decomp: add `docstring` support to relevant places in `all-types`
* decomp: output method docstring into the `defmethod` instead
* goalc: handle docstrings in `define[-extern]` (gracefully ignore for now)
* decomp: output docstrings for bitfield deftypes too
* goalc: fix `defenum` parsing when coming from the compiler (no symbol metadata to store to)
* lsp/tests: fix ups
* lint: formatting
* goalc: handle edge-case of defining a string constant
* cleanup leftovers, fix codacy issues, rename struct
* redo cheat encodings
* fix error
* add no texture cheat
* tiny cleanup + add sidekick stats button
* crappy implementation of big/small head mode
* more correct bone scaling
* redo bone manip code a bit
* jp text fixes
* improved matrix math!
* add big fist cheat, minor type cleanup, add some debug toggles
* move all this mess to a new file
* slightly rework joint scaling function
* add big head npc cheat
* subtitles typo
* WIP mirror mode
* fix mirrored hud sprites
* fix mirror mode sound pan
* add cheats to menu!
* split some subtitles
* dont crash on inline static value array
* [goalc] add support for non-static inline arrays of values
* add a kernel group to jak1
* move and cleanup pc debug code
* random cleanup in `hud-classes`
* pc port fix for gondola spools
* format
* address feedback (wow it was actually just changing 1 line all along...)
* minor decomp cleanup
* ref test
* use `game-text-id->string` function here
* small cleanup to pc progress code
* better way to handle "locked" texts
* this is better
* fix potential incompatibilities with merc & ocean renderers
* show cheat requirements in menu + change requirements
* increase size of money starburst
* split some more subtitles
* potentially fix a vsync bug?
* change territory encoding logic
* pass game territory to compiler
* ugh LOL
* 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
* Add in-game option to switch fullscreen monitor
* mmm undefined memory :)
* Fix type consistency
* Optimize get_monitor and get_monitor_count since they're called often
* Address PR feedback
* Track fullscreen mode and minimized state to reduce GLFW calls per frame
* raise particles cap to 10x
* change a text line
* allow sound bank load during vag
* fix default settings and fps setting
* keep "auto save disabled" option in menu
* cheats menu!
* Update game_text_ja.gs
* fix battle hud crash
* add cheats menu to title
* update settings version
* Update all-types.gc
* disable envmap fade out with hires actor lod setting
* disable merc fadeout if not using ps2 actor lods
* dont update aspect ratio if game size is bad
* set vsync later
* increase memory for generic, sprite and dma.
* fix issues with aspect ratio not saving
* split forcing envmap to a separate toggle
* too slow, dont expose to users yet
* lsp: json-rpc example is working, a decent place to start...
* lsp: vendor library
* lsp: cleanup and time to get started
* lsp: commit what i got so far
* lsp: example `initialize` payload
* lsp: switch to `stdio`
* stash
* modularize the lsp implementation
* lsp: implement first actual LSP feature - function names in outline
* lsp: produce document diagnostics
* lsp: remove unused third-party lib
* lsp: support hovering MIPS instructions in IR files
* lsp: basic go-to all-types definition
* stash
* lsp: cleanup code, just need to add it to the release artifacts
* fix some project configuration
* fix linux build
* lsp: add lsp to PR artifacts and release assets
* lsp: address feedback
* 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
* fix utf-8 handling around env-vars
* fix file opening errors related to unicode
* add uncaught exception handler in `gk` to ensure something is logged
* gracefully fail if window icon cant be loaded and work with unicode
* linux fix and add changes to vendor file
* add final cutscene subtitle and fix some editor bugs
* `title` and `finalboss` hints
* messages and notices for subtitle toggling
* fix colors in currently selected cutscene menu
* subtitle positioning fixes
* Update game_subtitle_en.gd
* extractor: refactor and cleanup for multi-game support
* deps: switch to `ghc::filesystem` as it is utf-8 everywhere by default
* extractor: finally working with unicode
* unicode: fix unicode cli args on windows in all `main` functions
* git: ignore vs build dir
* cmake: ditch `clang-cl` on windows in favor of actual `clang`
* build: suppress a significant number of warnings
* build: adjust workflows and vendor nasm
* docs: update docs to remove `clang-cl` mentions
* build: fix some copy-paste mistakes in the linux build
* build: remove C++20 compat warnings as that is useful if we want to upgrade
* put some duplicated code in a func
* make jak 2 text "work"
* group up all subtitles c++ code into one folder
* compact single-line subtitles
* fix a couple compiler crashes
* Update game_subtitle_en.gd
* `rolling` and `sunken`
* `swamp`
* `ogre`
* `village3`
* `maincave`
* `snow`
* `lavatube`
* `citadel`
* Update .gitignore
* clang
* fix encoding and decoding for quote
* properly fix quotes
* subtitle deserialize: sort by kind, ID and name
* sub editor: fix line speaker not being converted
* cleanup game text ids 1
* update text ids 2
* update source
* update refs
* Remove assets folder, use more std::filesystem
* windows fix
* another one for windows
* another one
* better system for different folders
* rm debugging stuff
* let extractor override everything
* dont revert jak1 change
* [extractor] validate files when extracted as folder
* jp text fixes
* move game text version to the text file and fix subtitle editor escape chars
* make bad subtitles not crash the game
* fix texscroll in lag
* fix mood, fix decomp of other versions, fix text decomp
* clang
* fix tests
* oops dammit
* new fixes
* shut up codacy
* fix nonexistant subtitles crashing the game
* fix text hacks and extractor re-use on folders
* in-game vsync option, automatically framelimit correctly, fix minimize/alttab bugs
* fix jp text errors
* bump version number as panic
* this makes more sense i think
* clang
* oops delete debug print
* Replace assert with user-friendly error if ISO not found
When the extractor runs and can't detect a game folder, it will assume there is an ISO file in the directory instead. If there isn't an ISO file, or it's a different extension, it will trigger an assert. This adds an additional check to make sure the file extension is of type `.iso` and returns a more clear message to the user.
Once I get home I'll iterate upon this a bit to add file size checks and reading header data as well as making sure the error code is able to be reported to the launcher.
* Fix `extension` call & formatting
more de-rust lol
* fix extension call (again)
* fix ONE extra parenthesis
* argument incompatible with fmt print
will fix print later
* add ONE missing parenthesis
never taking intellisense for granted again
* Add ISO size checks and rework type check
* actually print `data_dir_path` :p
* Normalize extension case before verifying file type
+ clang-format
* clang-format
Co-authored-by: doctashay <doctashay@github.com>
* 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
* 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>
* wip
* learning about colors
* gltf node stuff working
* cleanup
* support textures
* bvh generation seems reasonable
* tree layout
* frag packer, untested and doesnt do real stripping yet
* temp
* working collide frags
* handle bad inputs better
* clean up
* format
* include
* another include
* reorganize for release build use
* release: include error metadata file for launcher purposes
* release: put release assets in the top level of the 7z/tarball (no out/ dir)
* extractor: ensure critical directories are created
* extractor: handle weird Win32 path prefix `\\?\` by stripping it out
* release: avoid using `-C` with `tar`
* entity decomp and update battle hud code
* disable lag compensation in pc port
* delete unnecessary forward decls
* make battle hud track specific tasks
* fix mem leak + debug flying-lurker hud
* improve battle hud lights and fix bug
* tests
* stash
* temp
* tools: subtitle tool works! just gotta fill out the db / polish UX
* tools: added configuration for every subtitle we have so far
* tools: add some colors to the editor, time for repl controls and make it run the code!
* tools: continuing polish of tool, getting very close
* tools: finished UX polish, just need to write deserializers
* tools: added deserializer for subtitle data
* tools: exported subtitle files, all data appears intact
* tools: more UX polish and test all the cutscenes, majority work
* assets: update subtitle files
* lint: formatting and cleanup
* lint: codacy lints
* fix IOP getting stuck on music load
* fix regression? and clang
* fix a decomp
* fix another regression
* another
* fix "all actors"
* another regression!
* 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!
* music flava hack toggle
* fix hint subtitles not being considered offscreen
* music player works
* fixes + citadel, maincave, lavatube music
* add remaining tracks
* fix test
* fixes
* fix lib
* add "quit game" option to title
* reduce amount of particles in particle system
* increase merc2 memory
* enable extra particles by default
* fix tests
* tfrag3 data for merc2
* dma hooks for merc2
* start designing merc2 opengl, seems like the simple approach will be the best here
* before bone packing experiment
* fix up bones.gc
* use uniform buffer
* speedup, fix faces and eyes
* final fixes
* update refs
* [decompiler] read and process art groups
* finish decompiler art group selection & detect in `ja-group?`
* make art stuff work on offline tests!
* [decompiler] detect `ja-group!` (primitive)
* corrections.
* more
* use new feature on skel groups!
* find `loop!` as well
* fully fledged `ja` macro & decomp + `loop` detect
* fancy fixed point printing!
* update source
* `:num! max` (i knew i should've done this)
* Update jak1_ntsc_black_label.jsonc
* hi imports
* make compiling the game work
* fix `defskelgroup`
* clang
* update refs
* fix chan
* fix seek and finalboss
* fix tests
* delete unused function
* track let rewrite stats
* reorder `rewrite_let`
* Update .gitattributes
* fix bug with `:num! max`
* Update robotboss-part.gc
* Update goal-lib.gc
* document `ja`
* get rid of pc fixes thing
* use std::abs
* docs for ee merc code
* wip
* more extraction stuff
* partial mat1 working
* mat1
* cleanup
* partial mat2 and mat3 support
* merc extraction seems to work
* Split cam inversion settings into first/third person settings. Connect settings to controls for main first/third person cameras
* inverted -> flipped everywhere
* cam-billy first-person camera impl
* respect camera inversion in cam-stick (debug option only), launcher cams
* refactor into common functions
* couple more cams
* tweak menu text and size, fix function ordering
* convert to macros, more descriptive names
* pc port comments
* one missed comment
* menu text/size/display tweaks
* respect flipped in main debug cam
* 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>