Commit graph

74 commits

Author SHA1 Message Date
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
ManDude 87f2984cf5
add emacs temp files to gitignore + remove some redundant quotes (#273)
* 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

* [main-h] remove redundant quote

* Update .gitignore

* Update main-h.gc
2021-02-18 22:24:10 -05:00
water111 db48d94270
[Decompiler] Clean Up (#271)
* clean up

* fix up until generic ops

* finish kernel

* documentation

* types

* add missing file
2021-02-18 11:35:45 -05:00
water111 f1a93886e7
[Decomp] Decompile gstring (#267)
* decompile gstring

* update

* Update code_status.md

* Update code_status.md

* decompile gstate

* add test for states, hope it passes

* also test throw and catch xmms

* update doc
2021-02-16 20:37:48 -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
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
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
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
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
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 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
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 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 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
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 c811778d00
[Compiler] Add reset-here option to colored and constrained rlet vars (#169)
* add reset-here to clear coloring at entry to rlet

* update doc
2020-12-27 14:21:48 -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 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 e05f3ceefc
Implement gkernel: Part 2 (#155)
* update

* small fixes

* deactivate

* simple kernel test
2020-12-08 21:41:36 -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 90e5c023f1
Basic Inline Assembly (#149)
* basic inline assembly support

* fix rlet

* clean up detail in IR and update documentation
2020-12-04 12:57:10 -05:00
water111 ea479bee98
Add enums and some cleanup (#148)
* support enums

* better compiler warnings

* tweaks to build with clang
2020-12-02 19:51:42 -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
water e93b54347f add float min max to the compiler 2020-11-29 10:46:14 -05:00
water dc32b59217 update 2020-11-28 20:53:13 -05:00
water 5b4b5c238e update 2020-11-28 19:59:23 -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 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 951f31878e
[Source Line Debugger] Tracking objects and IR (#115)
* track where segments are when debugging

* missing windows include

* figure out what function we're in

* addr to IR is working
2020-11-13 22:33:57 -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
Tyler Wilding bb9fb3b2cd Update all lisp headers to reduce size of formatting PR 2020-10-26 21:08:24 -04:00
water111 dfe129373a
fix float loads, add dgo loading to game test (#101)
* fix float loads, add dgo loading to game test

* build and load dgos in order
2020-10-25 20:30:25 -04:00
water acb91dbf48 some work on vector types 2020-10-25 18:02:03 -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
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