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

[Decompiler] Fixes for gkernel and pad #253

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Conversation

water111
Copy link
Collaborator

  • Expressions like (set! (-> a b) (-> c d)) are much less likely to have fake temporaries.
  • Many more useless set!s will be removed
  • Stores into arrays are supported
  • Fixed bug where unused/eliminated temporaries would sometimes be used as the result of a block

@water111
Copy link
Collaborator Author

water111 commented Feb 11, 2021

(defun cpad-invalid! ((arg0 cpad-info) (arg1 uint))
  (local-vars
   (v1-2 int)
   (v1-3 symbol)
   (v1-4 symbol)
   (v1-14 int)
   (v1-15 symbol)
   (v1-16 symbol)
   (v1-17 int)
   (v1-18 symbol)
   (v1-19 symbol)
   )
  (set! (-> arg0 valid) (logior (-> arg0 valid) 128))
  (set! (-> arg0 button0) 0)
  (set! (-> arg0 button0-abs 0) 0)
  (set! (-> arg0 button0-shadow-abs 0) 0)
  (set! (-> arg0 button0-rel 0) 0)
  (set! v1-2 0)
  (while
   (< v1-2 12)
   (nop!)
   (set! (-> arg0 abutton v1-2) 0)
   (set! v1-2 (+ v1-2 1))
   )
  (set! (-> arg0 stick0-dir) 0)
  (set! (-> arg0 stick0-speed) 0)
  (set! (-> arg0 rightx) 128)
  (set! (-> arg0 righty) 128)
  (set! (-> arg0 leftx) 128)
  (set! (-> arg0 lefty) 128)
  (set! (-> arg0 align 0) 0)
  (set! (-> arg0 align 1) 1)
  (set! (-> arg0 align 2) 255)
  (set! (-> arg0 align 3) 255)
  (set! (-> arg0 align 4) 255)
  (set! (-> arg0 align 5) 255)
  (set! v1-14 0)
  (while (< v1-14 6) (set! (-> arg0 direct v1-14) 0) (set! v1-14 (+ v1-14 1)))
  (set! v1-17 0)
  (while
   (< v1-17 2)
   (set! (-> arg0 buzz-val 0) 0)
   (set! (-> arg0 buzz-time 0) 0)
   (set! v1-17 (+ v1-17 1))
   )
  arg0
  )

@coveralls
Copy link

Pull Request Test Coverage Report for Build 559124237

  • 51 of 76 (67.11%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 67.52%

Changes Missing Coverage Covered Lines Changed/Added Lines %
decompiler/IR2/FormExpressionAnalysis.cpp 18 22 81.82%
decompiler/IR2/AtomicOpForm.cpp 1 22 4.55%
Totals Coverage Status
Change from base Build 558892819: -0.003%
Covered Lines: 28257
Relevant Lines: 41850

💛 - Coveralls

@water111 water111 merged commit 87ad398 into master Feb 11, 2021
@water111 water111 deleted the w/constants-in-conditions branch February 11, 2021 21:21
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.

2 participants