Commit graph

384 commits

Author SHA1 Message Date
ManDude fa061ef7eb
[timer decomp] (#248)
* [timer decomp] preliminary decomp

* [goal-lib] add inplace macros for logior, logxor, lognor and logand

* [timer decomp] Finish decomp for now

* [timer decomp] OCD whitespace

* [all-types] fix type consistency

Sorry mr. decompiler but you will have to take the hit

* [timer decomp] Fix more type consistency

* [timer decomp] ACTUALLY fix it + script so I don't forget

* [timer] automatically choose gpr for rlet's
2021-02-09 20:24:33 -05:00
ManDude 3c7067fe4a
[timer-h decomp] timer-h decomp (#246)
* ObjectFileDB: Fix crash if obj list text has no objects

* rename "decomp.bat" to "decomp-jak1.bat"

* config: enable expression analysis

* decompile timer-h

* Tab to space.

* add a note to deftype profile-name for the future

* timer-mode: use register name instead of full name

looking at the other types, it looks like NDI seemed to have preferred it this way

* [timer-h] set -> timer-bank mode type to timer-mode

* [timer-h] use register-friendly return value for method

* [timer-h] comment out unsupported feature
2021-02-09 11:00:49 -05:00
ManDude 47fbc5e106
update decomp.bat in accordance to project directory changes + bugfix (#243)
* ObjectFileDB: Fix crash if obj list text has no objects

* rename "decomp.bat" to "decomp-jak1.bat"
2021-02-07 21:51:44 -05:00
water111 499f614cd1
create output folder (#242) 2021-02-07 19:06:05 -05:00
water111 e01e065170
[gcommon decomp] compiler and decompiler fixes (#239)
* wip

* decompile file-io

* a

* fix
2021-02-07 18:21:00 -05:00
water111 f8b63a3f92
[Decompiler] Put likely delay slots in their own block (#237)
* first part of fix

* atomic op conversion fix

* update tests

* oops
2021-02-06 17:04:03 -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
water111 ddffda1e8c
[Decompilation] Fixes to compiler/decompiler for gcommon (#227)
* fix shift naming issue

* fix bad argument variable names

* fix missing variable issue

* small missing things

* wip

* cleanup

* wip

* fix conditions

* small bug fix in rewriter

* fix incredibly stupid printing bug
2021-02-05 19:41:09 -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
bb010g 2436a8a541
Nixpkgs support (#228)
* Use env shebangs

* CMake cleanup, install() invocations, & CTest

`ctest` & the `test` target work now

* Nixpkgs support
2021-02-03 21:29:46 -05:00
water111 45f74f078a
[Compiler] Implement and/or in the compiler instead of a macro (#231)
* fix sc

* doc update

* another doc update
2021-02-03 16:12:51 -05:00
water111 425cc6794c
[Compiler] Bug fixes (#230)
* fix method name and use-after-free during compile error

* doc fix
2021-02-03 11:07:47 -05:00
water111 bbe5a10d76
fix stuck inline test (#229) 2021-02-03 08:36:22 -05:00
water111 a870bb53e4
[Decompiler] Expression 5 (#218)
* new method of inline-array-class

* up to new array

* wip side effect stuff

* prepare for pop barrier stuff

* add pop barrier

* add local vars hack to compiler

* fix bug, make sort work

* add test for array

* bug fixes

* another bug fix

* refactoring env variable print for casts

* more tweaks

* updates

* final cleanup

* codacy fixes
2021-02-01 20:41:37 -05:00
water111 51f70b6f4b
[Tools] Add DGO packer and unpacker (#219)
* add dgo tools

* make codacy happy
2021-01-27 20:46:58 -05:00
water111 3ea8cbea6f
misc small improvements (#217) 2021-01-27 15:39:50 -05:00
water111 b35beab372
[Decompiler] Add more expressions (Part 4) (#215)
* ref

* more

* one more

* up to insert cons

* recognize new

* fix memory bug!

* some mods to pair fields
2021-01-27 13:47:54 -05:00
water111 b59e33c005
[Decompiler] Expressions (Part 3) (#213)
* before inserting bonus instruction

* first part of refactor for return values

* find parent method working
2021-01-25 22:08:58 -05:00
water111 2f722e6379
[Decompiler] Expression Building (#211)
* up to ash

* add more expressions

* fix some return variable usage nonsense

* bfloat print working

* basic-type working

* type working, fix decompiler on all files

* clang format
2021-01-24 16:39:15 -05:00
water111 27f0a7ca44
[Decompiler] Begin expression conversion, rearrange tests (#209)
* refactor tests and analysis passes

* identity test working

* combine test categories with only a few cases

* more fixes
2021-01-23 16:32:56 -05:00
water111 4a97e15b40
[Decompiler] Remove most IR1 Analysis (#207)
* temp

* remove some of ir1
2021-01-22 22:03:58 -05:00
water111 8135c18e91
Merge pull request #206 from water111/w/ir2-stacking
[Decompiler] Add stacking framework
2021-01-22 21:08:10 -05:00
water 56d4ed1228 add stacking framework 2021-01-22 20:50:37 -05:00
water111 679b17ae6f
[Decompiler] Get used variables, handle function calls better, and minor cleanup (#205)
* small fixes, implement getting used variables

* improve printing of variables

* missing include
2021-01-19 21:45:17 -05:00
water111 af328ffa29
Merge pull request #204 from VodBox/patch-1
doc: fix heading
2021-01-19 18:54:54 -05:00
Dillon Pentz bd5e0e07f7
doc: fix heading 2021-01-20 12:47:55 +13:00
water111 f94818e184
Merge pull request #203 from ManDude/master
doc: typo fixes
2021-01-19 18:40:54 -05:00
doctashay 79ed82425b
Append README.md to include Arch Linux documentation (#202)
* Begin spdlog integration for decompiler

* Replace old prints with spdlog equivalents

* clang-format

* Add Arch Linux documentation

* Remove spdlog (again)...
2021-01-19 18:40:11 -05:00
ManDude 1876e02314 doc: typo fixes 2021-01-19 23:38:28 +00:00
water111 40d328f4eb
[Decompiler] Test framework for decompiler regression tests and gcommon tests (#200)
* test framework for pre-expression compact stuff

* check ordering

* more tests

* final tests gcommon
2021-01-18 13:33:32 -05:00
doctashay e8ad91a454
Arch fixes (#199)
* Change declaration case

Arch Linux is so very picky...

* Remove spdlog (?)
2021-01-17 21:37:08 -05:00
water111 d6bbca5620
[Decompiler] IR2 form implementation (#197)
* begin ir2 form implementation

* temp

* small fixes

* fix test
2021-01-17 18:08:18 -05:00
water111 1071ff6003
[Decompiler] WIP Conversion to SSA and variable naming (#195)
* begin ssa algorithm

* ssa based splitting appears to work

* add merge pass

* finish basic implementation

* better output

* bug fix
2021-01-16 10:54:09 -05:00
water111 8f86f0f00e
add register usage pass (#194) 2021-01-12 19:20:08 -05:00
water111 fe693b5da2
[Decompiler] Implement IR2 Type Analysis Pass (#193)
* type analysis setup

* more framework

* update printing

* wip

* add type analysis pass

* fix tests
2021-01-10 20:46:49 -05:00
ManDude 45d37733a8
log: Fix Windows console text coloring issue (#192)
* Add a Release build configuration.

* Batch file alternatives for decomp/gc/gk

For the shell-less, or people with a different Windows configuration.

* all-types.gc: Fix typo.

* gcommon.gc: Typo.

* debugger: use enum class for InstructionInfo::Kind

* decompilerIR: use enum class for IR_Store::Kind

* Update all-types.gc

* decompiler: tab to spaces

* root batch files: update directories

* Use a gitignore inside "log" folder to fix windows crashes

* Revert "Update all-types.gc"

This reverts commit 5ef179bb4e.

* log: Fix broken ANSI color support for Windows console (stdout)

* Update log.cpp

* log: Fix clang formatting Lol.
2021-01-10 15:55:21 -05:00
Tyler Wilding e63abb0ea1
Improved test namings for multi-operations, added new ones, still a few failures (#190)
* Improved test namings for multi-operations, added new ones, still a few failures

* Review - Modifications to get all tests passing
2021-01-10 15:46:46 -05:00
water111 cd9a9af6dd
fix register info duplication (#191) 2021-01-10 11:08:03 -05:00
ManDude e5b0541d98
Typo fixes & Windows QoL changes (#189)
* Add a Release build configuration.

* Batch file alternatives for decomp/gc/gk

For the shell-less, or people with a different Windows configuration.

* all-types.gc: Fix typo.

* gcommon.gc: Typo.

* debugger: use enum class for InstructionInfo::Kind

* decompilerIR: use enum class for IR_Store::Kind

* Update all-types.gc

* decompiler: tab to spaces

* root batch files: update directories

* Use a gitignore inside "log" folder to fix windows crashes

* Revert "Update all-types.gc"

This reverts commit 5ef179bb4e.
2021-01-10 10:39:32 -05:00
water111 2901f4a99e
[Decompiler] Write IR2 to file and implement some Atomic Op conversions (#187) 2021-01-09 20:01:48 -05:00
water111 5093b97cda
[Decompiler - New IR] Add AtomicOp (#181)
* wip decompiler ir

* add AtomicOp stuff

* fix windows build and warnings

* add instruction parser

* include

* make minilzo shared

* odr fix

* a

* fix merge conflicts

* move decompiler into namespace

* update the code coverage to include the decompiler

* add demo test

* add register use test to example test
2021-01-06 20:04:15 -05:00
water111 3331e9cd00
Replace spdlog (#185)
* remove spdlog

* clang format and fix windows

* add format shared

* windows sucks
2021-01-06 12:16:39 -05:00
Tyler Wilding 69f7f46477
Add Address Sanitizer support to MSVC and CMake (#182)
* msvc: Add Address Sanitizer

https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/

* cmake: Add Address Sanitizer

* docs: Update ReadME

* see if we can replicate the test failure

* windows fixes maybe

* cmake: Compile with gcc and clang (only coverage on

* hacky try again

* clean up

* fix clang issues

* linting

Co-authored-by: water <awaterford111445@gmail.com>
2021-01-04 23:32:51 -05:00
water111 3c2faed367
Merge pull request #180 from ManDude/master
Add logs folder to root gitignore
2021-01-03 18:01:47 -05:00
ManDude 59125acb42 Add logs folder to root gitignore 2021-01-03 22:57:12 +00:00
ManDude 0102dff96d Create .gitignore 2021-01-03 22:53:04 +00:00
water111 95c81b675a
add asan build (#179) 2021-01-03 12:31:42 -05:00
water111 7af6dce1b2
[Decompiler] WIP Expression Stacking (#178)
* wip

* fix the stupid if thing

* update

* fix

* fix some ordering issues
2021-01-02 18:24:45 -05:00
water111 feead303aa
better array indexing (#176) 2020-12-31 22:15:17 -05:00
water111 c8d382b35c
[Compiler] Improve spills and register backups (#175)
* xmm spill

* improve getting stack variables

* improve symbol getting

* update changelog
2020-12-31 15:59:11 -05:00