Commit graph

333 commits

Author SHA1 Message Date
water111 b2052016e2
[decomp] sky/time of day (#883)
* time of day

* goal code seems to work

* stars at wrong spot

* stars and sun work

* debugging clouds

* fix texture correction

* sky works

* cleanup, add profiler

* clean up

* final clean up

* offline tests

* missing include
2021-10-10 20:07:03 -04:00
water111 911a8e32a4
[decomp] minor type cleanup (#874)
* clean up some types

* clean up settings
2021-10-02 11:50:12 -04:00
water111 b1e987c42f
fix pointer set to #f in static (#864) 2021-09-28 22:20:45 -04:00
water111 f0ceea8b2e
[sparticle] 2d hud particles (#849)
* wip, taking a break to work on asm stuff first

* the goal code for sparticle

* mips2c the first sparticle asm function

* temp

* particle processing no longer crashing

* temp

* working texture cache for vi1 and hud textures

* sprites

* cleanup 1

* temp

* temp

* add zstd library

* temp

* working

* tests

* include fix

* uncomment

* better decomp of sparticle stuff, part 1

* update references
2021-09-26 11:41:58 -04:00
ManDude d8e659df66
[decomp] flying-lurker (#846)
* `flying-lurker`

* why'd this get left behind?

* also `ambient` and add a `banned_objects` config and fix offline tests

* clang

* fix `ambient-type-sound`
2021-09-21 18:40:38 -04:00
water111 5683f04046
[decomp] handle handle->process inside an and (#851)
* fix the loader example

* improve compiler error message

* fix missing cast issue
2021-09-21 00:12:37 -04:00
water111 9fdbc2d974
[goalc] fix static array length (#836)
* fix static array length

* add some more small fixes
2021-09-08 18:49:49 -04:00
ManDude 89ccb8cbc7
[decomp] progress (#780)
* cleanup `main`

* whitespace

* start `progress` decomp pt1

* fill in more stuff

* Update label_types.jsonc

* run cheats

* clang

* make most of `progress` decompile

* `progress` pt 2

* [decompiler] support dynamic format strings

* Make `progress-draw` decompile and almost all `progress`

* make clang shut up

* fix unhandled format string

* fix `progress-draw`

* Update DecompilerTypeSystem.cpp

* fix?

* fixes

* fix a few functions

* make `language-enum`

* warn on weird floats

* fix minor pad bug

* dump stuff in `progress`

* make `progress-screen` enum

* progress progress

* update refs and fix stupid bug

* trying to get it to work

* it works!?

* disable sound functions

* fixes

* final touches

* tests

* tests

* add process allocations

* use the right register for windows

* another try for windows, counting is hard

* one more try

* use process allocations

Co-authored-by: water <awaterford111445@gmail.com>
2021-09-06 20:35:03 -04:00
water111 ac3092093c
fix really old compiler bug (#799) 2021-08-31 22:12:30 -04:00
water111 34e8afa0ee
get started on entity (#793) 2021-08-31 11:05:03 -04:00
water111 d9f9e076af
[decompiler] automatically label things when possible (#784)
* improve label system

* clean up menu

* debug menu working, still need to fix tests

* fix tests and clean up
2021-08-29 11:13:06 -04:00
water111 24fe2c78c0
[goalc] Address-to-line (#783)
* refactor debug info stuff before adding form to emit

* source mapping working for non-macro sourced forms

* support macros
2021-08-26 20:33:00 -04:00
water111 7a5562106e
Compiler performance improvements and error clean-up (#782)
* compiler cleanup and error improvement

* fix test
2021-08-24 22:15:26 -04:00
water111 403bb5f4de
[decomp] game-info (#779)
* support more process stuff

* more of game info

* add ref file

* progress on save
2021-08-22 20:12:47 -04:00
water111 97ab6a4e12
add support for non virtual states (#764)
* add support for non virtual states

* typecheck go

* start on virtual states

* more support for virtual states

* offline passes

* fix tests

* use behavior shortcut instead of lambda

* final cleanup of virtual go

* unused var warnings and fix inconsistent enum decompile order on win vs linux

* fix thread safety bug with goal symbol table and vif1 interrupt handler

* fix type mistake
2021-08-17 20:54:03 -04:00
water 5aa15afe29 decompile sprite-distort without vu1 stuff 2021-08-13 18:50:29 -04:00
water d5f05f723e Merge branch 'master' of https://github.com/water111/jak-project into w/dma-for-font 2021-08-12 20:31:51 -04:00
water d829db1da5 set u64 from float 2021-08-12 20:09:25 -04:00
water 688e291672 try to fix debugger issue 2021-08-11 21:40:58 -04:00
water a65357642d fix debugger 2021-08-11 20:21:58 -04:00
water 21684bd104 misc bug fixes, now draw string generates dma data 2021-08-05 20:29:36 -04:00
water 821c2ab42a display loop runs 2021-08-04 21:30:08 -04:00
water111 4d76d2f11a
add get-enum-vals (#737) 2021-08-02 22:01:10 -04:00
water111 aa58d146c2
[goalc] register allocator v2 (#731)
* clean up allocator interface to be simpler

* working on functions without spills

* working for all

* fix missing includes for windows

* more windows includes

* initialize regs to zero so printing value unintiailized by game code is repeatable
2021-08-01 17:46:55 -04:00
ManDude 26c3fb65e9
make some macros for DMA stuff (#725)
* [compiler] allow infinite args for `logior`

* make some dma macros and use them on `display`

* [goos] add `string->symbol`

* make a sketchy macro

* fix tests

* `with-dma-bucket` and `dma-buffer-add-vector4w-2`

* cleanup `debug`

* cleanup `menu`

* go thru `texture` pt 1

* finish `texture`

* `sprite` pt 1

* `sprite` pt 2

* `generic`

* `gs` and `main`
2021-08-01 17:11:32 -04:00
Tyler Wilding d317497c64
decomp: main-collide and support a bunch of new inline-asm operations (#673)
* decomp/goal-lib: Implement all fixed point macros

* decompiler/goalc: Support half-word and byte parallel extend ops

* decompiler/goalc: Support all parallel compare instructions

* decompiler/goalc: Wire up PPACH and parallel bitwise operations

* goalc: Add emitter tests

* decomp: finalize `main-collide`

* codacy lint
2021-07-27 19:57:14 -04:00
water111 eee8390ec0
support inline arrays on stack (#726) 2021-07-26 21:39:05 -04:00
water111 2b6684aa5c
[decompiler] Working toward bsp (#717)
* clean up

* before int to float stuff

* before trying to eliminate the separate read and write maps

* partial fix for register issues

* add missing include
2021-07-25 15:30:37 -04:00
water111 09c09ce35f
allow aliasing of registers in variables if we explictly ask for it (#711) 2021-07-22 20:14:08 -04:00
water111 ef011f4fe8
[goalc] add a build system (#704)
* add first attempt at build system

* fix stupid bug

* try again
2021-07-15 21:37:15 -04:00
water111 f6d5952498
[decompiler] handle nested conditionals and gotos better (#693)
* diff check

* try that again

* more small fixes
2021-07-11 21:59:27 -04:00
water111 0a9cc68a27
[decompiler] Use meters, degrees, and seconds (#689)
* use meters degrees and seconds

* update changelog
2021-07-11 18:19:41 -04:00
water111 656489e942
[decomp] Clean up - part 2 (#687)
* temp

* temp2

* basic case support

* working for or without else

* support more cases

* clean up to drawable headers

* ocean

* format json
2021-07-11 16:35:25 -04:00
water111 e251f8b2d9
Support Behaviors (#678)
* temp

* working, but type pass got really slow

* clean up

* changelog and flip order

* clean up and add tests

* fix zero size array

* handle lambdas correctly

* another windows fix
2021-07-04 16:54:07 -04:00
water111 784cd5debb
[decomp] get started on game info (#674)
* temp

* menu text

* wip

* recognize handle to process

* more
2021-07-03 16:18:41 -04:00
water111 6366068bc0
Support dir tpages (#671)
* support dir tpages

* fix warnings and bad return

* one more try

* revive the offline test script

* fix this null bug
2021-07-02 14:50:58 -04:00
water111 4bea175140
[decompiler/compiler] Fixes for task-control (#668)
* fix decompiler for task control

* support in compiler

* changelog

* typo
2021-07-01 21:38:19 -04:00
water111 fe5635227a
[compiler] print a backtrace as part of di (#658)
* print a backtrace as part of di

* missing include
2021-06-30 22:13:15 -04:00
water111 a81aef889a
Level load test (#656)
* tweaks for loading VI1

* temp

* clean up
2021-06-30 19:20:31 -04:00
water111 322a4ed9b2
Fix compiler crashes and improve return statements. (#652)
* fix a few small bugs

* fi

* fix merge conflict
2021-06-30 00:11:46 -04:00
ManDude 1af0f4a1a7
[decomp] most of level and some game loop functions + couple decomp… (#651)
* [decomp] most of `level` and some game loop functions + couple decompiler fixes

* add ART.CGO to fake-iso
2021-06-29 20:30:52 -04:00
water111 9433724bbd
another fix for forward declared types (#647) 2021-06-28 20:34:13 -04:00
water111 2ee48e08f3
Allow setting a field with partially defined field (#646)
* allow setting a field with partially defined field

* actually run the test
2021-06-28 19:20:36 -04:00
water111 2506325f30
fix cast bug (#640) 2021-06-27 22:23:27 -04:00
water111 bfc1173ed5
Clean up files in kernel (#625)
* clean up gcommon

* cleanup kernel
2021-06-25 17:55:50 -04:00
water111 4f8403d8e6
support type-ref (#613) 2021-06-20 12:59:39 -04:00
ManDude 46b83bda2a
[decomp] debug (#607)
* [decomp] `debug`

* shut up
2021-06-19 14:24:55 -04:00
water111 d79937fb62
Improve forward declaring types (#596)
* improve forward declare type

* display type differences

* make codacy happy
2021-06-15 21:03:55 -04:00
water111 0aa474f12b
[decomp] finish actor-link-h and a few more (#592)
* finish actor-link-h

* decompile files

* fix pp issue
2021-06-14 20:46:54 -04:00
water111 5b24e43143
Change syntax for boxed array to support different length and allocated-length (#568)
* change syntax for boxed array

* fix test and make the flava thing kind of work
2021-06-07 20:22:06 -04:00
water111 f516737cf7
[decompile] bsp-h (#562)
* decompile bsp-h

* a few more

* some more

* fix merge conflicts
2021-06-07 18:30:16 -04:00
ManDude 63821755e6
[compiler] add psize-of (#564) 2021-06-06 23:02:00 -04:00
Tyler Wilding 698d96cc4e
Decompilation: Next batch of files (#539)
* decomp: `collide-frag-h`

* decomp: `effect-control-h`

* decomp: `cam-update-h`

* decomp: `collide-func`

variable pass failed on ray-plane-intersect: invalid unordered_map<K, T> key

* decomp: `cylinder` with vector dot product issue

* decomp: `debug-sphere`

* decomp: `generic`

* decomp: fix `effect-control-h`

* scripts: improve decomp-next script

* decomp: Fix `debug-sphere` issues via type casting

* decomp: Add `collide-frag-h` to reference tests

* scripts: Add script to add a new reference test

* decomp: Add `cam-update-h` to reference tests

* goalc: Fix empty let removal issue

* decomp: Not adding cylinder to goal_src yet either

* decomp: Add `debug-sphere` to reference tests

* decomp: Attempt to finish `generic` but blocked by decomp issue

https://github.com/water111/jak-project/issues/563

* linting

* decomp: Resolve failing tests

* decomp: Address feedback
2021-06-06 23:01:30 -04:00
water111 a572587a0e
add types (#559) 2021-06-05 16:58:32 -04:00
water111 2851cae13b
[decompile] fact-h (#556)
* decompile fact-h

* fix unused var

* codacy again
2021-06-05 11:15:34 -04:00
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
ManDude 784119188c
[decomp] even more res (#529)
* [decomp] even more `res`

* [decompiler] make `logand` with pointers and constants return pointer

* [decomp] more work

* update offline tests

* fix tests(?)

* `*res-static-buf*`

* fixes

* fix reference

* [opengoal] make `logand` work directly with pointers

* [decomp] `inspect res-lump`

* use the inline methods

* don't use a math mode for pointers

* [compiler] allow optionally setting disassembly output file

* [x86 disasm] Keep casing consistent between instructions and offsets
2021-06-01 16:07:45 -04:00
water111 c4f44e265f
[decompiler] Better support for non-virtual methods (#543)
* fix up nonvirtual method calls and stack new method calls

* look at final in compiler too
2021-05-30 22:52:40 -04:00
water111 0f0902eabf
add config option for changing cond splitting behavior (#522) 2021-05-24 19:52:19 -04:00
water111 663b5c7899
[OpenGOAL] Support for 128-bit arguments and return values (WIP) (#510)
* xmm call and return working, needs some careful double checking and tests

* clean up and test
2021-05-20 20:12:49 -04:00
water111 a6258f3654
[compiler] support 128-bit bitfields (#500)
* support setting and accessing fields of a 128-bit bitfield

* remove print

* rework static constants

* support 128-bit bitfields as part of static structures

* dynamic construction
2021-05-18 21:25:29 -04:00
water111 79d10979da
[decomp] math-camera (#491)
* decompile math camera

* missing line
2021-05-15 20:08:08 -04:00
water111 d9f9d36f37
[OpenGOAL] make multiplication/divsion like GOAL and support in decompiler (#483)
* support in compiler

* multiplication in the decompiler

* update divisions
2021-05-14 18:43:12 -04:00
water111 0ab916e122
fix quote issue and decompile level-info (#474) 2021-05-12 21:57:19 -04:00
water111 433993074a
Clean up some errors/crashes in decompiler (#452)
* fix offline tests, clean up some warnings

* clean up warnings during decomp

* fix remaining crash issues
2021-05-11 16:43:13 -04:00
ManDude 1d72e79df8
[repl] Always reset runtime before disconnecting (#448) 2021-05-11 15:14:09 -04:00
ManDude fef9b139d7
Force-enable assert on release mode Windows build (#440) 2021-05-10 23:03:56 -04:00
water111 0a6602e320
[Decompile] connect, text-h, settings-h, capture, memory-usage-h (#410)
* decompile stuff

* temp

* temp2

* fix

* temp

* preparing for merge

* working

* fix stupid format

* fix codacy
2021-05-05 17:38:16 -04:00
ManDude 7cb04c6cd5
[decomp] font-h, fix a vector type, minor decompiler fixes (#411)
* Make `:do-not-decompile` work on field lookup as well

* decompile `font-h` and update a vector type + minor fixes

* fix some types

* fix font-h

* fix font-h (again)

* update a script

* fixes

* Fix segfault

* Fix `PROT_NONE` page protection on windows
2021-05-01 21:09:48 -04:00
water111 7018827a50
decompile display (#408) 2021-05-01 15:51:53 -04:00
Tyler Wilding 7c182db7ea
Compiler: Auto-generate inspect methods for bitfields (#407)
* goalc: Auto-generate inspect methods for bitfields

* goalc: Don't generate inspect methods for 128-bit bitfields
2021-05-01 15:29:56 -04:00
Tyler Wilding 44fa183922
repl: Add auto-listening capabilities -auto-lt (#405)
Closes #403
2021-05-01 10:33:41 -04:00
water111 70d93354eb
[Decompile] file-io, loader-h, texture-h, level-h, math-camera-h (#397)
* file-io and loader-h

* add test for level-h

* math camera-h
2021-04-28 20:51:17 -04:00
water111 14028b90bc
[Decompile] vector.gc (finally) (#394)
* support psubw

* do half of vector

* rest of vector

* add test

* format
2021-04-28 17:14:54 -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 2002db359a
[Decompiler] WIP: Stack Spills (#382)
* set up types

* cleaned up type analysis and got things working through atomic ops

* expression working, need types

* improved types and names

* getting close

* finish up dma-disasm

* fix
2021-04-25 14:48:54 -04:00
water111 0b8a878533
[Compiler] Fix branch targets in disassembly (#379)
* fix diassembly

* update changelog

* fix exit crash

* doc
2021-04-23 15:07:22 -04:00
water111 060b125324
[Compiler/Decompiler] Better support for Bitfield and Enum types (#374)
* compiler fixes, a decent amount of decompiler stuff is working too

* more support in decompiler, fix some casts

* decompile static data too
2021-04-22 19:08:58 -04:00
ManDude 0560136f08
Allow enum names to serve as types (using the enum's type) (#372)
* Allow enum names to serve as types (using the enum's type)

* Formatting

* add doc to `get_enum_type_name`

* Ban enum forward-declaring, and remove unneeded checks
2021-04-19 20:29:38 -04:00
water111 c09e18f3a7
Fix stack new and add size-of to compiler (#370)
* make decompiler output stack-no-clear

* add size-of
2021-04-18 19:51:15 -04:00
water111 9867155e7c
[Decompiler] More support for bitfields (#363)
* temp

* initial support for dynamic bitfields

* some more progress on display

* dma-buffer good

* small fixes
2021-04-17 18:35:50 -04:00
water111 a863542fa3
[Compiler] Support dynamically constructed bitfields (#354)
* support dynamic bitfields

* update doc
2021-04-11 19:21:49 -04:00
water111 9969445cf7
[Decomp] Math library: transform and quaternion (#344)
* decompile transform

* types for quaternion

* part of quaternion

* finish quaternion

* fix offline test reference

* wip fix to let issue

* fix
2021-04-02 11:35:14 -04:00
water111 0a76e6e157
[Decompiler] Make matrix decompile (#341)
* small fixes

* update

* add instructions

* finish matrix

* add matrix test cases
2021-03-28 20:26:30 -04:00
water111 7fac11ddf5
Support 128-bit variables (#336)
* wip 128 bit support

* add a few more files to offline test
2021-03-25 16:02:48 -04:00
water111 99683c0dac
[decompiler] Add tests and fixes for vector-h and math (#333)
* before messing with ssa stuff

* fix ash

* bounding box
2021-03-24 19:16:31 -04:00
water111 0d8742241b
support for i128 (#331) 2021-03-23 15:56:23 -04:00
water111 fe336b7b5f
[compiler] fix warnings in repl lib and add macros to autocomplete (#317)
* fix warnings in repl lib and add macros to autocomplete

* fix crash on ctrl-c, build runtime as static lib and make goos prompt look fancier

* some tweaks for linux build
2021-03-11 12:54:16 -05:00
Tyler Wilding 8bba3d7fd7
REPL: Add clear-screen / auto-complete / basic hints and syntax highlighting (#316)
* swap to replxx from linenoise

* repl: Implement form auto-tab-completion

* repl: color coordinate the prompts

* repl: Add some basic syntax highlighting, bracket pairs and forms (all one color)

* repl: A more consistent starting screen for the repl

* repl: bug fix for auto-complete

* debug linux

* linting
2021-03-07 23:41:21 -05:00
water111 9074a35b9b
[Decompiler] Fix printing of lets (#314)
* fix let prints and windows warnings

* missing include for windows

* windows again
2021-03-07 12:01:59 -05:00
Tyler Wilding f123bf368a
decomp - vector.gc - Decompile vector.gc (#289)
* temp: commit what i have so far


decomp: Fix nonempty_intersection impl for MSVC Debugging use-case


docs: Add info on getting ASan builds running on Visual Studio w/o exceptions

* decomp: initial rlet implementation

* decomp: cleanup pass of vector-rewrite stage

* decomp: Commit in-progress vector.gc, shortcomings are TODO commented

* decomp: More cleanup, rename from being `vector` instr specific

Fundamentally, this process can be used for re-writing ANY inline-asm instruction

* decomp: Support 4th arg ACC instructions

* decomp: Final pass of vector.gc before implementing last instructions

* decomp: Better warnings when hitting unimplemented instructs

* compiler: Implement inverse-sqrt and mov.vf

* decomp: Final manual pass over vector.gc, documented gaps

* decomp: Finish decompiling what currently is possible in vector.gc

* decomp: Fix Variable -> RegisterAccess conflict

* decomp: codacy lint

* Address review feedback

* Address feedback part 2

* Resolve build failures
2021-03-06 10:46:26 -05:00
water111 9168f03289
[Compiler] Add get-info (#306)
* wip symbol info

* finish implementation
2021-03-04 10:33:59 -05:00
water111 d9aa535dd0
[Decompiler] Fix issues in gcommon (#305)
* fix several issues

* small fixes
2021-03-03 20:52:25 -05:00
water111 413c1f5c74
[Decompiler] Add offline tests (#303)
* add offline test for gcommon as an example.

* fix test

* unused var
2021-03-03 15:42:55 -05:00
Tyler Wilding 2eca9ab801
repl: Support cross-session history (#301) 2021-03-03 00:05:13 -05:00
Tyler Wilding 3e0e370343
repl: Add a (repl-help) command for forgetful people like me (#298) 2021-03-02 13:16:47 -05:00
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 d6d5203695
[Decomp] Minor fixes plus some math camera decomp (#287)
* make some progress on math camera

* minor fixes plus start of decomp of math camera
2021-02-26 15:27:13 -05:00
water111 cadd014add
[Compiler] Support array fields in static objects (#284)
* first part of static inline array fields

* level h
2021-02-25 22:49:46 -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 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 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 1b5b9a2469
add sqrt (#270) 2021-02-17 00:57:21 -05:00
Tyler Wilding cdce4d9612
compiler: Support the majority of the remaining VU VF instructions (#258)
* compiler: Support the majority of the remaining VU VF instructions

- VWAIT
- VMADD variants
- VMSUB variants
- VSQRT
- VDIV
- outer product (VOPMULA + VOPMSUB)

* compiler: Fix some bugs / optimize some instructions

* tests/compiler: Add test coverage for new instructions

* docs: Add documentation for new inline assembly functions

* lint: Formatting / fix failing test

* Remove my comment about ftf/fsf encoding, it's been fixed

* address review feedback

* correct VSQRTPS implementation
2021-02-16 21:41:33 -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
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
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 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 3331e9cd00
Replace spdlog (#185)
* remove spdlog

* clang format and fix windows

* add format shared

* windows sucks
2021-01-06 12:16:39 -05:00
water111 95c81b675a
add asan build (#179) 2021-01-03 12:31:42 -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
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 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 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 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 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 d86964985a
Improve Register Allocator (#154)
* before adding IRegSet stuff

* use bitsets for live analysis

* speed up

* add stack structures

* organize new better
2020-12-06 15:42:26 -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
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
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
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
water111 460ec874bb
Add support for stack integers (#135)
* add support for stack integers

* update documentation

* revise value type stack variables
2020-11-22 12:22:19 -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 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
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
doctashay 985549f27c
Compiler logging (#92)
* 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

* Implement basic compiler logging

* clang-format

Still working on finding a solution to the spdlog shared library issue.

* clang-format

Yup, I literally have nothing else atm
2020-10-29 19:03:44 -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