[decompiler] detect cpad-hold? and cpad-pressed? (#986)

* [decompiler] detect `cpad-hold?` and `cpad-pressed?`

* cleanup cpad macro button lookup

* better

* fix
This commit is contained in:
ManDude
2021-12-02 00:41:49 +00:00
committed by GitHub
parent 6a4348287e
commit d845524c23
30 changed files with 308 additions and 355 deletions
+3 -13
View File
@@ -148,15 +148,12 @@
(cond
((!= (-> obj decision) 'undecided)
)
((and
(logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x))
(not (-> obj only-allow-cancel))
)
((and (cpad-pressed? 0 x) (not (-> obj only-allow-cancel)))
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons x))
(set! (-> obj decision) 'yes)
)
((logtest? (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
((cpad-pressed? 0 triangle)
(logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle))
(logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle))
(set! (-> obj decision) 'no)
@@ -1404,14 +1401,7 @@
22
)
)
(when
(and
(logtest?
(-> *cpad-list* cpads 0 button0-rel 0)
(pad-buttons circle)
)
(process-grab? *target*)
)
(when (and (cpad-pressed? 0 circle) (process-grab? *target*))
(logclear!
(-> *cpad-list* cpads 0 button0-abs 0)
(pad-buttons circle)