Commit graph

311 commits

Author SHA1 Message Date
water111 8f68d35cbb
[Decomp] Some more collision header files and speed up tests (#296)
* some more

* faster tests

* on by default
2021-03-01 11:15:24 -05:00
water111 57eca1dee9
[Decomp] Decompile more files. (#290)
* decompile ocean trans tables

* more

* exclude tables from decomp progress

* format'
2021-02-27 14:40:18 -05:00
water111 791c4abfc0
[Decompiler] Static Data Decomp (#280)
* update all-types

* begin work on static data decompiler

* working for vif disasm array

* mostly working

* finish static data decompilation
2021-02-25 09:51:28 -05:00
water111 5ec9a91eb9
Decompiler fixes + decompiling (#276)
* decomp pad

* more decompilation

* update

* fix test name
2021-02-22 09:36:30 -05:00
water111 4b1b7e9507
[Decompile] DMA and similar (#275)
* add some dma

* clean up

* add progress script and make codacy happy
2021-02-21 11:02:28 -05:00
water111 14d602c594
[Decompiler] More fixes for gkernel (#261)
* fix bugs and more address of support

* support for zero checks

* fix tests
2021-02-14 18:50:45 -05:00
water111 126dfc1c45
[Decompiler] Misc fixes for gkernel/math (#257)
* more cases

* some work on math and floating point stuff

* some decompiling for fun
2021-02-13 11:32:52 -05:00
water e8231c2708 fix 2021-02-11 16:13:03 -05:00
water111 d9a8f28e52
remove useless sets (#252) 2021-02-11 14:35:28 -05:00
water111 43c1d223a6
[Decomp] Decompile gcommon, gstring-h, and gkernel-h (#249)
* begin decomp

* untabify

* finish decomp of gcommon

* warning with function name

* clean up gkernel-h

* fix all types
2021-02-11 09:49:15 -05:00
water111 6e0ff4c9d0
[Decompiler] Clean up the output (#245)
* fix parent issue

* fix compiler issue

* update

* add error messages

* fix error

* fix array access, temporary

* more clean

* fix

* rename arg variables better

* fix method name

* fix no return value in decompiler

* many small fixes

* cheat types so it works

* name map

* fix old test'
2021-02-09 20:59:14 -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 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
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 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 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
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 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
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 a80b331c27
[Compiler] In-progress support for vector float (AVX) (#171)
* begin work on vf support

* split reg kind into reg hw kind and class, use class for ireg

* try test

* clang format

* add some more ops and some example functions

* better lvf on statics

* add documentation
2020-12-30 15:33:51 -05:00
water111 4d713d5c8c
[Runtime] misc fixes to runtime and listener (#170)
* misc runtime fixes

* clang format
2020-12-28 18:37:05 -05:00
water111 25301a8bbc
[Decompiler, Game] Run type prop on gstring (#168)
* run type prop on gstring

* add types-h

* new settings

* cmake switch

* down to 4 failing functions

* clang format
2020-12-26 11:09:59 -05:00
water111 6bf9d97c51
[Decompiler] Improve reverse field lookup (#167)
* start on new reverse lookup

* use new reverse lookup
2020-12-25 15:04:03 -05:00
water111 5cb6368b9a
Clean up asm for format (#164)
* clean up asm for format

* fix windows

* remove rpc-call hack

* revert cmake version change

* clang format

* asm fix for windows
2020-12-23 11:15:41 -05:00
water111 3355df809a
Add boxed array type (#163)
* add array

* support static arrays
2020-12-19 21:05:18 -05:00
water111 11a82bbf08
[Compiler] Add static data features (#162)
* support static pairs

* also support strings

* reorganize static stuff

* add test

* support inlined fields

* add missing type check
2020-12-19 15:21:29 -05:00
water111 cae3871730
[Decompiler] Experimental Expression Stack (#157)
* begin framework for expressions

* more

* clean up warnings

* small fixes

* update

* wip type prop improvements

* see if nasm works

* fix format strings
2020-12-17 15:48:07 -05:00
water111 ba919a069c
Add another kernel test, fix small bugs (#156)
* temp

* run function in process test

* windows debug

* debug

* update

* update

* again

* update

* fix same bug in debugger
2020-12-10 20:26:40 -05:00
water111 06918e1fea
Implement gkernel: Part 1 (#150)
* start gkernel implementation

* progress

* more of kernel

* swap to new dispatcher, will it work on windows

* update
2020-12-05 17:09:46 -05:00
water111 71dda76e2b
Add some compiler features and documentation (#147)
* update doc

* add disassemble and type checking

* improve compiler error messages
2020-12-01 21:39:46 -05:00
water111 21fbdce7aa
[Compiler] Bitfield Types (#146)
* add the ability to define and read bitfield types

* new set

* add bitfield setting

* add static bitfields
2020-11-29 18:01:30 -05:00
water111 9b32835faa
Type Prop - Second Attempt (#142)
* setup and run on identity

* temp

* temp2

* temp

* update

* mroe

* successful in gcommon
2020-11-28 15:35:38 -05:00
water111 09142d1712
Support "game count" and v4 objects (#140)
* generate object, but not supported in linker yet

* add link and tests

* update types
2020-11-24 20:48:38 -05:00
water eb30fc88b0 fix compiler bugs 2020-11-22 20:10:33 -05:00
water111 19b8bb81c9
Add the STR RPC to overlord and game code (#134)
* work in progress streaming rpc, simple test is working

* actually add the test

* debug windows failure

* windows fix maybe

* windows 2

* use str-load-status

* update types
2020-11-22 12:59:55 -05:00
water 4cafe04af3 support loading streaming data in decompiler 2020-11-21 15:58:51 -05:00
water111 660ef41136
Update documentation and clean up (#129)
* cleanup

* clean up file layout
2020-11-21 12:52:38 -05:00
water111 29e4ff9e51
remove match param (#127) 2020-11-20 20:17:37 -05:00
water111 953c1512db
Process Text Files in Decompiler (#122)
* begin support for v2

* export game text

* generate text files

* working text load

* fix windows

* add test and clean up game tests a bit

* load the right file

* add separate program to launch the data compiler

* add offline test script
2020-11-19 21:22:16 -05:00
water111 ae053870c3
support escaping any character (#125) 2020-11-17 15:25:48 -05:00
water111 0767321934
Extract Textures (#119)
* temp

* cleanup

* documentation, enable alpha

* add subfolder

* support all textures
2020-11-16 19:57:45 -05:00
water111 c09541fa98
Add some debugger memory utilities (#109)
* add some memory utilities

* run waitpid in a separate thread and support very simple breakpoints

* fix breakpoints

* add missing windows stub function

* fix error message on exit
2020-11-06 13:59:39 -05:00
Hunter Breathat 1ff2031e75 Added missing import causing runtime_error to not be found. 2020-11-05 17:43:47 -05:00
water111 0451a06d76
Set up the compiler to ptrace the runtime (#107)
* set up the compiler to ptrace the runtime

* clang format

* move debugger state to a separate Debugger class

* support registers and break and continue

* documentation and fix windows

* make listener part of compiler, not a separate library

* implement memory read and write

* fix for windows
2020-10-31 14:07:43 -04:00
water111 a45d180f2c
Try to speed up the build (#106)
* first attempt

* attempt 2

* windows and formatting fix
2020-10-29 21:27:52 -04:00
water acb91dbf48 some work on vector types 2020-10-25 18:02:03 -04:00
water 710f6be13b Merge branch 'master' of https://github.com/water111/jak-project into w/add-types-to-all-types 2020-10-25 13:21:34 -04:00
water 15a66d9c62 add types 2020-10-25 12:07:10 -04:00
Tyler Wilding 5a5d88eb17 Amalgamate FileIO and remove duplicate Timer header
Closes #8
2020-10-25 02:27:48 -04:00
water111 b56025412b
Recognize auto-generated inspect methods and create deftypes from them (#95)
- Recognize new type definitions/parents/type flags in the decompiler
- Analyze autogenerated inspect methods and dump guesses at fields to a file
- Utility functions for accessing static data by label
- Better ordering in the decompiler to go through functions in the order they appeared in the source
- Added a decent number of types to `all-types.gc` based on the new field analyzer
- Correct a few `int`/`integer` mistakes in `gcommon.gc` (this should really be a warning)
- Correct a few type issues in `gcommon` and `gkernel-h`
- Option in the decompiler to be strict about `define-extern` redefining a type of a symbol
- Add a test to check consistency in types between `all-types.gc` (used by decompiler) and `goal_src` (used by the compiler)
2020-10-24 22:51:40 -04:00
water111 fc1a8f37c6
Partially Implement Decompiler Type Analysis (#90)
* implement basic framework for decompiler type analysis

* before type system changes

* add some decompiler stuff to the type system

* try algorithm on a few functions
2020-10-18 15:44:19 -04:00
water111 3e798cd3aa
Add features for gkernel 2 (#89)
* in progress

* format
2020-10-17 11:18:58 -04:00
water111 d5d0d7f924
Add compiler features for gkernel (#83)
* add some type stuff for gkernel

* more tweaks

* blah

* more little tweaks and more of gkernel

* add static structures with integer fields but not basics

* static structures

* update gkernel
2020-10-16 17:08:26 -04: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 3616b790bd
Add more array stuff and clean up field access (#80)
* implement some array stuff and clean up field access

* update goal change log
2020-10-14 13:42:14 -04:00
water111 a64dd6c90b
Add CFG to IR decompiler pass (#60)
* add some more cfg ir stuff

* add cond with else

* add type of recognition

* add cond to compare conversion

* finally all conds are passing

* started sc recognize, but ash min and max should be recognized first

* fix ash showing up as sc

* add abs

* fix merge issues

* try building goos with optimizations on

* sc mostly working, still need to fix right aligned nesting

* ands and ors are converting correctly now

* clean up
2020-10-06 18:14:27 -04:00
water111 b102d22dd9
Replace Form with goos::Object (#64)
* add pretty printing to goos form

* temp

* fix format

* fix format

* fix windows build

* again

* windows

* Revert "windows"

This reverts commit b7d448e733.

* windows again

* give up and just add a getter function
2020-10-04 17:08:10 -04:00
doctashay c2cb053a5d
spdlog implementation (#58)
* Commit new spdlog implementation 

Hopefully resolves Linux build dependency errors

* clang formatting

* Fix Linux-only definition

Found the culprit!

* More Linux fixes

Linus Torvalds have mercy on my soul

* Replace printf logging with spdlog equivalent

Preserve previous printfs in comments for now. Spdlog needs to be configured to be thread-safe. Few additional printfs to convert later. No changes have been made to GOAL's internal printing system

* clang-format stuff

* ugh more clang-format

why

* Another shot

* CMakeLists.txt update

Fix issues related to spdlog version targeting

* Remove old prints + fix log types

Up next is the transition to a git submodule, should be simple enough

* spdlog is now a git submodule

* adapted for project

* Linux fix

* More fixes

Yikes

* Update for linux

I should really fix my WSL environment

* Update workflow.yaml

Hopefully will resolve issues with GitHub Actions on Linux
2020-10-03 09:39:04 -04:00
water111 376c273845
Add decompiler IR, basic operations, all-types file (#57)
* framework for basic op

* started IR framework

* check in type info file

* add some basic operations to the first pass ir conversion

* use a single condition system

* add more basic op decoding

* more ir
2020-09-29 20:24:15 -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
water111 2d11e44eaf
Compiler Cleanup and Documentation (#54)
* start cleanup

* fix typos

* fix syntax highlighting in doc

* lots of documentation updates

* clean and add tests

* more documentation and more error messages

* more document and try building kernel differently
2020-09-24 17:19:23 -04:00
water111 27b865c0df
Add methods and pointers (#53)
* method calls and sorting

* add more tests and fix some alias stuff
2020-09-19 16:50:42 -04:00
water111 cee6c21603
Add basic features for types and objects (#52)
* started adding simple functions in gcommon

* more tests and features

* more tests, debug windows

* debug prints for windows

* back up some regs for windows

* remove debugging prints
2020-09-19 13:22:14 -04:00
water111 c7c342ce7e
Add defmethod and some uses of the deref operator (#51)
* add tests for various xmms

* use unaligned stores and loads to back up and restore xmm128s and also fix argument spilling bug

* add deftype

* add deref and fix some method _type_ things
2020-09-18 22:02:27 -04:00
water111 abcd444a3b
Add deftype (#48)
* initial deftype implementation

* fix library setup for windows

* implement deftype

* fix memory bug

* fix formatting
2020-09-17 21:47:52 -04:00
water111 bb854dd81e
Fix a Listener Bug (#45)
* try a fix

* add debug prints

* more prints

* try again

* more stderr

* print again

* am idiot

* cleanup

* cleanup
2020-09-14 22:14:07 -04:00
water111 7ffcfc4703
Merge pull request #41 from xTVaser/pragma-once
Add #pragma once to all header files
2020-09-14 20:31:41 -04:00
Tyler Wilding 345b8e30d8 Resolve a good chunk of windows compiler warnings
Mostly revolved around the new MSVC check for functions that don't cover all paths (ie. a switch statement without a default case).  It appears to not see an assert as a valid default case.

I switched assert(false) to exceptions in these cases.  I believe this should also abort the program, but will also provide a hopefully useful message?  Hopefully this is an improvement.

Resolves #32
2020-09-13 22:02:27 -04:00
Tyler Wilding 9737dfad34 Add #pragma once to all headers
Resolves #19
2020-09-13 21:36:35 -04:00
water111 90a7e9b4b9
Add addition and subtraction for integers, build macros, dgo building, and build/load test (#35)
* see if math works on windows

* add dgo

* windows debug

* windows debug 2

* one more debug try

* add extra debug print and change logic for slashes

* update

* again

* try again

* remove build game

* remove build game

* add back build-game

* remove runtime from test

* test

* reduce number of files

* go to c++ 14

* big stacks

* increase stack size again

* clean up cmake files
2020-09-12 20:41:12 -04:00
water111 d56540f8c0
Add lambda and static objects (#30)
* add some more tests for let

* support static strings

* add function calling

* add prints for windows debgu

* one test only

* try swapping r14 and r15 in windows

* swap back

* disable defun for now

* fix massive bug

* fix formatting
2020-09-12 13:11:42 -04:00
water111 de5aa7e5e4
Move duplicated utilities to the common util folder and remove NEXT_DIR (#29)
* move things to the common library and remove next_dir

* fix for windows

* one last windows fix

* last fix for real this time

* debug listener test

* fix listener threading bug
2020-09-10 20:03:31 -04:00
blahpy 06963ed36f reformat using clang-format 2020-09-11 10:30:45 +12:00
blahpy 6703ce2f32 Merge remote-tracking branch 'origin/master' 2020-09-11 09:24:19 +12:00
blahpy a7ff8d9e1d Format using clang-format 2020-09-11 09:24:03 +12:00
blahpy 89e8ec40ed
Merge branch 'master' into master 2020-09-11 09:18:12 +12:00
blahpy 2e270eeab4 Update function names and file path stripping 2020-09-10 22:26:13 +12:00
blahpy 369a1031e1 Update functions 2020-09-10 22:07:23 +12:00
water111 01883da47e
Fix Listener Socket Timeout on Windows (#28)
* try checking for timeouts differently on windows

* hopefully this test fails on windows

* hopefully this test passes on windows

* remove debug prints

* remove commented otu code
2020-09-09 20:14:13 -04:00
blahpy efe94dca79 Format using clang-format 2020-09-10 10:35:29 +12:00
blahpy 9f1d6792e2 Fix errors in common_util 2020-09-09 18:41:45 +12:00
blahpy eb886d0c45 Upload new files 2020-09-09 16:54:16 +12:00
water c04ab1a6ff try different print format for windows 2020-09-08 20:55:48 -04:00
water a47504b812 only take address once 2020-09-08 20:49:37 -04:00
water e5631ea5c8 debug print 2020-09-08 20:46:09 -04:00
water f0328dcc92 Merge branch 'master' of https://github.com/water111/jak-project into w/ir 2020-09-08 19:39:39 -04:00
Tyler Wilding fff501d786 Corrections to fix linux, and further cleanup 2020-09-08 19:15:14 -04:00
Tyler Wilding 4b6223a6d0 Extract adding timeout to socket 2020-09-08 14:33:28 -04:00
Tyler Wilding 871f1b43b0 Remove the problematic Multiple Deci tests 2020-09-08 14:12:04 -04:00
Tyler Wilding f8fccbf7a6 Additional progress, listener tests are starting to pass 2020-09-08 00:01:46 -04:00
Tyler Wilding 1ab8329e3c Created a cross-platform socket shim 2020-09-07 19:58:54 -04:00
water d49b01e310 working return integer tests as part of gtest 2020-09-06 16:58:25 -04:00
water 8bf0bd86d3 integer constant program working up to ir 2020-09-06 12:45:31 -04:00
water111 2075dd66b6
Add ObjectGenerator and Register Allocator (#10)
* start the ObjectFileGenerator

* finish v3 generation

* add analysis for register allocator

* add register allocator

* fix const

* fix build

* fix formatting for clang-format

* attempt to fix windows build

* windows 2

* windows 3

* windows 4

* windows 5

* windows 6
2020-09-05 16:37:37 -04:00
Tyler Wilding f68f220e5b Merge remote-tracking branch 'water111/master' into windows-nodeci 2020-09-03 20:16:28 -04:00
Tyler Wilding a87060320a Cleaned up some unneeded changes 2020-08-29 15:11:16 -04:00
Tyler Wilding c5bb7aab54 nasm fixes #1 2020-08-28 20:26:27 -04:00
water bdde6d933c update doc and finish lca implementation 2020-08-28 14:29:38 -04:00
water 7b6807ad6a type system builtin types 2020-08-27 20:53:11 -04:00
water 75f63d8ff3 add typecheck and tests 2020-08-27 16:47:54 -04:00
doctaweed 92976234a1 Replacing std::exception with std::runtime_error 2020-08-26 22:24:03 -06:00
water a32e6288ac Merge branch 'master' of https://github.com/water111/jak-project into w/type-system 2020-08-26 23:29:23 -04:00
water d2992ba4fe type system method tests 2020-08-26 23:07:55 -04:00
Tyler Wilding e6e96400c8 commit doctor's latest changes 2020-08-26 21:02:24 -04:00
Tyler Wilding 3c4fcbdd34 clang-format all the things 2020-08-26 01:21:33 -04:00
water 8927bd976d more progress on the type system 2020-08-24 21:20:32 -04:00
water 7b641170bf begin work on new type system 2020-08-24 00:06:07 -04:00
water acf086a3d2 check in existing work 2020-08-22 22:30:12 -04:00