Commit graph

81 commits

Author SHA1 Message Date
water111 542edfb164
[compiler/decompiler] Take the address of a variable (#554)
* support taking the address of variables

* partially working stack variables

* implement type cast stuff

* remove final
2021-06-04 13:43:19 -04:00
water111 84c0522102
[decompiler] Add pass to generate a symbol definition map file (#546)
* add symbol order file

* class to struct fix for windows
2021-05-31 10:43:25 -04:00
water111 b1a76b2291
[decomp] Small fixes (#541)
* fix a few bugs

* fix local vars missing in top level

* more small fixes

* support missing inline array access case

* one more fix
2021-05-30 19:57:11 -04:00
water111 0f0902eabf
add config option for changing cond splitting behavior (#522) 2021-05-24 19:52:19 -04:00
water111 223adeeb0c
Automatically get float label type in most cases (#463)
* automatically get float type in most cases

* try harder to print json errors

* fix test
2021-05-11 21:57:05 -04:00
water111 0599d144f8
[decompiler] Clean up config more (#458)
* remove global config

* fix dir
2021-05-11 20:49:54 -04:00
water111 d7d563814f
clean up config (#456) 2021-05-11 19:19:23 -04:00
water111 3d2ca71fe3
[Decompile] pad and gs (#389)
* update stuff

* gs reference added

* update config
2021-04-26 21:40:08 -04:00
water111 64c35ca453
[Decompiler] Stack Variables (#338)
* clean up type analysis

* get everything set up

* basic stack variables working

* partial load fix

* most of matrix

* add offline tests
2021-03-27 15:18:59 -04:00
water111 814480f9e5
[Decompiler] Replace type hint system and improve variable types. (#320)
* get gkernel and gkernel-h at least somewhat working in the offline tests

* strip comments from json

* switch hints to casts. online tests passing, offline passing up to gkernel

* variable retyping is added

* fix up casts in lets

* update
2021-03-13 16:10:39 -05:00
water111 65ffe83468
[Decompiler] Decompile let (#309)
* test

* fix bug

* fix tests for let

* missing formatting fix
2021-03-05 18:48:01 -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 8775840265
[Decomp] Decompile engine math library types (#272)
* decompile some stuff

* fix typo

* playing around with trigonometry

* more progress on trig

* more trig

* comments and small fixes

* finish trig
2021-02-20 11:42:46 -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 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 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 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 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 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
water 921ae50669 add more utils 2020-11-27 16:38:36 -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 4cafe04af3 support loading streaming data in decompiler 2020-11-21 15:58:51 -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 0767321934
Extract Textures (#119)
* temp

* cleanup

* documentation, enable alpha

* add subfolder

* support all textures
2020-11-16 19:57:45 -05: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 b561cdfade
Make decompiler naming consistent (#94)
* use a fixed object file naming by default, option to allow new map file creation

* fix prints

* fixing up edge cases

* update json config
2020-10-24 14:27:50 -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 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
water c3aff47886 add decompiler 2020-08-22 23:30:17 -04:00