Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decomp: decompile trajectory #499

Merged
merged 3 commits into from
May 19, 2021
Merged

Conversation

xTVaser
Copy link
Member

@xTVaser xTVaser commented May 17, 2021

I'm pretty confident about the signature for add-debug-line but might be worth an extra pair of eyes.

@coveralls
Copy link

coveralls commented May 17, 2021

Pull Request Test Coverage Report for Build 855283245

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 240 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.09%) to 69.271%

Files with Coverage Reduction New Missed Lines %
common/type_system/deftype.cpp 2 81.94%
goalc/compiler/compilation/Define.cpp 2 93.13%
test/goalc/test_with_game.cpp 3 98.6%
goalc/compiler/compilation/Atoms.cpp 6 93.28%
goalc/compiler/Compiler.h 12 40.74%
goalc/compiler/Val.cpp 12 89.82%
common/type_system/defenum.cpp 14 79.52%
goalc/compiler/Val.h 20 72.84%
goalc/compiler/compilation/Type.cpp 45 90.74%
common/type_system/TypeSystem.cpp 53 72.62%
Totals Coverage Status
Change from base Build 848129577: 0.09%
Covered Lines: 34569
Relevant Lines: 49904

💛 - Coveralls

Copy link
Collaborator

@water111 water111 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think add-debug-line might not be right but everything else looks good

)
(let ((t2-0 -1))
)
(t9-1 a0-6 a1-1 a2-1 a3-0 (the-as int t0-0) t1-0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on the code here, i'd guess that add-debug-line takes one more argument (possibly unused inside the function).
If you try that, does this get a lot nicer?

(a1-1 68)
(a2-1 s5-0)
(a3-0 s4-0)
(t0-0 #x800000ff)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a rgba color to me. If you change the type of add-debug-line to make this argument an rgba, it should convert this to (new 'static 'rgba :r #xff :a #x80) automatically.

;; Used lq/sq
(defmethod TODO-RENAME-15 trajectory ((obj trajectory))
(let ((s5-0 (new 'stack-no-clear 'trajectory))
(s4-0 (new 'stack-no-clear 'trajectory))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing these are vector instead of trajectory?

decompiler/config/all-types.gc Show resolved Hide resolved
(defmethod
TODO-RENAME-9
trajectory
((obj trajectory) (arg0 float) (arg1 trajectory))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think arg1 here is a vector. Thie method does "evaluate trajectory at time arg0" and its output is just a vector for the point.

(defmethod
TODO-RENAME-10
trajectory
((obj trajectory) (arg0 float) (arg1 trajectory) (arg2 trajectory))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think arg1 is a vector and arg2 can be removed. This function computes the derivative of the trajectory and stores it in a vector (arg2).

((method-of-type trajectory TODO-RENAME-9)
obj
f0-1
(the-as trajectory s4-0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casting a to a larger type (trajectory > vector) is a sign that something isn't quite right here. I think once you change the arguments on this method it will go away.

@water111 water111 merged commit ce6ebc3 into open-goal:master May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants