Commit graph

34 commits

Author SHA1 Message Date
Tyler Wilding 6446389263
extractor: cleanup, support unicode properly, and add multi-game support (#1609)
* 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
2022-07-05 20:38:13 -04:00
ManDude 8caa5bfa70
disable goal networking when not in debug mode (#1602) 2022-07-04 13:52:05 -04:00
ManDude 9676100039
finish out english subtitles (#1586)
* 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
2022-07-03 17:25:28 -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 36dc015d62
jak2: Create goal_src skeleton (#1576) 2022-06-29 22:20:09 -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
Tyler Wilding 9fdf0bbc2f
tools: Add cutscene player / subtitle editor window (#1429)
* 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
2022-06-11 16:32:27 +01: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 c18502d5f5
extractor: Validate ISO contents and report specific errors (#1322)
* deps: add `xxhash` library

* extractor: hash ISO files as they are extracted

* extractor: report on game data validation errors

* lint: formatting

* extractor: automatically pick the right decompiler config
2022-04-18 18:33:55 -04:00
Tyler Wilding ab063bf7b0
extractor: split up extraction process and allow overriding data dir path (#1302)
* extractor: split up extraction process and allow overriding `data` dir path

* lint: formatting

* deps: add CLI11 dependency

* extractor: refactor CLI arg handling
2022-04-15 18:01:47 -04:00
Tyler Wilding 014da6f59d
game: auto-save pc-settings to user's home directory as well as memcard files (#1233)
* cmake: reduce warning spam especially from libs

* runtime: add FS helper functions

* game: save/restore pc-settings | add original aspect option

* game: overwrite unloadable settings with defaults

* temp: unable to set the games aspect-ratio in the boot else crash?

* runtime: save memcard files to user directory as well

* runtime: fix `pckernel` load order which resolves setting the orig aspect ratio

* lint: format

* cmake: revert warning suppression, it's just causing problems it seems

* fix the order of the rest of `pckernel` and creation of obj file paths

* lint: formatting

* game: don't save settings on startup even if they are corrupted
2022-03-20 20:29:44 -04: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 24578b64b9
proper support for hardcoded "time" types (#1141)
* hardcode `time-frame`things

* Update cam-states_REF.gc

* Update level-info_REF.gc

* update refs 1

* update refs 2

* update refs 3

* update refs 4

* update refs 5

* update detection and casting

* Update FormExpressionAnalysis.cpp

* update refs 6

* update mood decomp

* update refs 7

* update refs 8

* remove temp entity birth code

* update time-frame casts

* fix compiler

* hardcode stuff and fix some types

* fix some bitfield detection being wrong

* bug fixes

* detect seconds on adds with immediate

* update refs 9

* fix casts and rand-vu-int-range bugs (update refs 10)

* update refs 11

* update 12

* update 13

* update 14

* Update game-info_REF.gc

* improve cpad macros detection

* remove unused code

* update refs

* clang

* update source code

* Update cam-states.gc

* `lavatube-energy` finish

* update refs

* fix actor bank stuff

* Update navigate.gc

* reduce entity default stack size

* Update transformq-h.gc

* oops forgot these

* fix code and tests

* fix mood sound stuff

* Update load-dgo.gc

* Update README.md
2022-02-12 12:26:19 -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 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 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
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
Tyler Wilding 4ff2130d55
decomp: decompile almost all the platform related files (#812)
* deocmp: `plat` finished, `baseplat` started

* decomp: finish `baseplat`

* decomp: finish `plat-button`

* decomp: finish `plat-eco`

* decomp: finish `citb-drop-plat-CIT`

* decomp: finish `cit-drop-plat-L1`

* decomp: finish `plat-flip`

* decomp: added a bunch of label defs

* decomp: `plat-button` ref test added

* stash

* decomp: finish `baseplat`

* decomp: finish `plat`

* decomp: finish `plat-button`

* tests: fix offline-test to handle multi-DGO files better

* decomp: finish `citb-drop-plat-CIT`

* decomp: finish `plat-flip`

* decomp: finish `wedge-plats`

* tools: fix memory analyzer, skip invalid type

* decomp: finish `wall-plat`

* fix ordering

* fix some casting issues

* cleanup after conflict resolution

* address reviews
2021-09-06 21:10:19 -04:00
Tyler Wilding 253d7996e8
decomp: almost all of the NPCs! (#748)
* all-types: add all missing `:heap-base`s

* decomp: error encountered when compiling `mayor`

`IR_StoreConstOffset::do_codegen can't handle this` for method `play-anim!`

* decomp: finalize `mayor`

* decomp: finish `bird-lady`

* decomp: finish `bird-lady-beach`

* decomp: finish `sculptor`

* decomp: finish `geologist`

* decomp: finish `oracle`

* decomp: finish `farmer` | `explorer` | almost `assistant`

blocked on sparticle-launch-group

* decomp: finish `sage`

* decomp: finish `gambler`

* decomp: finish `warrior`

* decomp: mostly finish `miners`, blocked by sp-launch-group

* fix issue in `sage`

* fix all the reference tests to use the new state stuff

* fix all of goal_src

* address feedback

* re-gen with `until` fixes
2021-08-18 21:33:31 -04:00
ManDude a850b5d5cb
revamp the gfx+display systems a bit (#739)
* revamp gfx and display systems a bit

* Use some fancy c++ pointers instead of just raw pointers

* Tidy some things up.

* clang

* clang 2

* fixes

* fixesss

* error detection when making display
2021-08-09 19:16:39 -04:00
ManDude 1e11a588f5
[decomp] loader prelim work + some cleanup (#697)
* [decomp] `loader` prelim work + some cleanup

* more things

* more

* even more

* yet even more

* minor fixes

* decompiler fix + use behaviors for two funcs

* last functions

* Create loader_REF.gc

* more work

* change vag tool config format + unrelated farmer and yakow stuff

* update some things

* fix some decomp

* cleanup things i came across + make dgo compileable

* fix consistency test

* update refs

* offline test: skip buggy `external-art-buffer` method

* fix test
2021-07-23 18:30:49 -04:00
Tyler Wilding 17aedd894d
decomp: hint-control | menu | default-menu (as much as possible) (#632)
* decomp: mostly done `hint-control`

* decomp: Started and decent chunk of `menu` done

* temp stash

* decomp: escape from `menu` hell

* decomp: starting on `default-menu`

* decomp: As much as i can do in `default-menu` at this time

* decomp: clean up `hint-control`

* decomp: fix reference tests

* temp stash

* decomp: finalize `menu`

* decomp: add `menu` to goal_src

* decomp: finalize `hint-control`

* decomp: Resolve TypeConsistency issues

* and fix reference tests

* address feedback

* format and lint

* fix tests
2021-07-04 18:25:08 -04:00
Tyler Wilding 504a073f8f
ee-analysis: Output and append to JSON file (#580)
ee-analysis: Output and append to JSON file
2021-06-11 19:09:12 -04:00
Tyler Wilding 2b3c4d957a
Organize all types (#523)
* get a full mapping of all `symbol:file-name` for jak1

* cleanup before any additional work is done

* more pre-organize changes

* scripts: script written to cleanup all-types...but what will cleanup the script...

* resolve clashing enum symbol names

* some manual changes to symbol order

* very close! don't completely lose types that are fully commented out

* scripts: New symbol mapping and further script polishing

* changes needed to make the script function properly

* brand new all-types!

* remove now irrelevant symbol definitions

* formatting cpp

* decompiler: Remove symbol dumping feature, not accurate anyway
2021-06-01 22:41:37 -04:00
Tyler Wilding 73a4f2c83e
decomp: lights.gc (#420)
* scripts: Hack script to quickly identify the next goal_src file that hasn't been decomp'd yet

* config: Delete old type_hints file

* decomp: Decompile lights.gc

* decomp-tests: Add offline tests and temporary forward defs

* vs: Rename / add new offline test run config

* decomp: Add formatted lights.gc source

* decomp: Temporary define stub in geometry,gc

* decomp: Cleanup `lights-group` handling
2021-05-07 20:54:20 -04:00
ManDude 8cc63ff35c
Add a debug PS2 VM to the runtime (#401)
* update VS launch target params

* remove redundant VS launch option

* Add a debug PS2 VM to the runtime, currently only for the DMAC

* Formatting

* remove broken assert

* Avoid weird buffer overflow bug

* Test on `VIF0_DMA_BANK`!

* Add a docstring

* patch pointers for the other dma channels

* patch DMAC pointer

* remove dead leftover code

* Change default return value for `get_vm_ptr`
2021-05-01 00:32:19 -04:00
ManDude 9430b4772a
Implement runtime display (test) (#318)
* Implement runtime display (test)

* Update runtime.cpp

* [game display] add "-nodisplay" argument

* style fixes

* Update gfx.cpp

* [deci2server] fix deadlock when killing a Deci2Server

* add libxrandr to linux github test

* correct package name to libxrandr-dev

* set g_main_thread_id in exec_runtime

* add libxinerama to linux test packages

* correct the name

* add libxcursor1 package

* Update linux-workflow.yaml

* add libxi-dev

* fix constructor for g_main_thread_id

* fix submodules + use -nodisplay during tests

* move the gfx loop to its own function and use a lambda for exit conditions

* fix include

* fix include

* fix includes (for real this time)
2021-03-09 23:51:28 -05:00
Tyler Wilding 5b6a8dcf98
third-party/licensing: Switch miniLZO usage to LZOkay (#232)
* add rough jak 2 config so the decompiler can atleast unpack dgos

* third-party: commit lzokay

* Switch to lzokay for DGO decompression

* third-party: Remove minilzo library

* third-party: Add lzokay as a SHARED lib
2021-02-06 09:54:23 -05:00
Tyler Wilding 65206823ef
Compiler - Implementing more VU Instructions (Part 1 of 2) (#221)
* A little project cleanup

* Script to grep decompiler results

* Compiler: Implement VNOP -> FNOP (.nop.vf)


temp: test new addition

* Compiler: Implement VMUL.xyzw (.mul.vf)


squash: cleaning up files i don't want to accidentally stage

* Compiler: Implement V[ADD|SUB|MUL].dest instructions

* Compiler:  Implement V[ADD|SUB|MUL][x|y|w|z].dest instructions

* Compiler: Implement V[MIN|MAX]{[x|y|z|w]}.dest instructions

* Compiler: Implement V[ABS]{[x|y|z|w]}.dest instructions

* Cleanup review feedback before adding tests and docs

* Tests: Added missing emitter tests

* tests/compiler: Comprehensively test all new instructions

* docs: Add documentation for newly supported operations

* Remove unused vector-h function

* Address review feedback
2021-02-05 15:00:17 -05:00
doctashay 9410e01aaf
Implement logging features for decompiler (#78)
* Begin spdlog integration for decompiler

* Replace old prints with spdlog equivalents

* clang-format

* Fixes

* Log output to /logs/decompiler.log.

The console now prints that the disassembly has begun and it may take a few minutes to complete. This will reduce the amount of verbose logging output directly to a console stream.

* Update .gitignore

Ignore decompiler output for now

* Resolve more issues

Fixed percentage printing and various other issues

* Fixed stuff I broke (sorry)

* Fix more broke stuff
2020-10-15 20:59:30 -04:00
water111 c9b53d51ff
Compiler Cleanup (Part 2) (#56)
* check on windows

* fix windows build

* version test

* clean up - will it work on windows

* fix formatting
2020-09-25 21:11:27 -04:00
Tyler Wilding 6187b31f2c Changes needed to get build passing 2020-09-04 23:24:16 -04:00
Tyler Wilding 14c1b8be74 working my way through the tests 2020-08-29 14:52:45 -04:00
Tyler Wilding d38ec3f44c Add some premade launch configs, and fix google test 2020-08-29 00:01:55 -04:00