mirror of
https://github.com/open-goal/jak-project
synced 2026-09-08 11:56:11 -04:00
[jak2] fill in a lot of flags for decomp + mouse macros (#2927)
Also changed the default type of enums to `int64` (same as `int`).
This commit is contained in:
+5
-6
@@ -1605,6 +1605,7 @@
|
||||
)
|
||||
|
||||
;; definition for method 3 of type debug-vertex-stats
|
||||
;; INFO: this function exists in multiple non-identical object files
|
||||
(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats))
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~Tlength: ~D~%" (-> obj length))
|
||||
@@ -1726,8 +1727,7 @@
|
||||
|
||||
;; definition (debug) for function add-debug-cursor
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun-debug add-debug-cursor ((enable symbol) (bucket bucket-id) (x int) (y int) (arg4 int))
|
||||
(defun-debug add-debug-cursor ((enable symbol) (bucket bucket-id) (x int) (y int) (arg4 mouse-buttons))
|
||||
(when enable
|
||||
(with-dma-buffer-add-bucket ((buf (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
bucket
|
||||
@@ -1740,13 +1740,13 @@
|
||||
(+ x -5)
|
||||
(+ y -4)
|
||||
(cond
|
||||
((= v1-7 1)
|
||||
((= v1-7 (mouse-buttons left))
|
||||
(font-color red)
|
||||
)
|
||||
((= v1-7 2)
|
||||
((= v1-7 (mouse-buttons right))
|
||||
(font-color yellow)
|
||||
)
|
||||
((= v1-7 4)
|
||||
((= v1-7 (mouse-buttons middle))
|
||||
(font-color green)
|
||||
)
|
||||
(else
|
||||
@@ -1759,7 +1759,6 @@
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; this part is debug only
|
||||
|
||||
+35
-26
@@ -3989,7 +3989,7 @@
|
||||
)
|
||||
(logior! (-> *game-info* features) (game-feature darkjak))
|
||||
(logior! (-> *game-info* debug-features) (game-feature darkjak))
|
||||
(send-event *target* 'change-mode 'darkjak #f 3)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active))
|
||||
)
|
||||
)
|
||||
(function "indax" #f ,(lambda ()
|
||||
@@ -4050,7 +4050,7 @@
|
||||
)
|
||||
(logior! (-> *game-info* features) (game-feature darkjak))
|
||||
(logior! (-> *game-info* debug-features) (game-feature darkjak))
|
||||
(send-event *target* 'change-mode 'darkjak #f 3)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active))
|
||||
)
|
||||
)
|
||||
(function "rapid" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
@@ -4059,37 +4059,46 @@
|
||||
)
|
||||
(logior! (-> *game-info* features) (game-feature darkjak))
|
||||
(logior! (-> *game-info* debug-features) (game-feature darkjak))
|
||||
(send-event *target* 'change-mode 'darkjak #f 2)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage active))
|
||||
)
|
||||
)
|
||||
(function "bomb0" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f 7)
|
||||
)
|
||||
)
|
||||
(function "bomb1" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f 15)
|
||||
)
|
||||
)
|
||||
(function "invinc" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f 31)
|
||||
)
|
||||
)
|
||||
(function "giant" #f ,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f 63)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0))
|
||||
)
|
||||
)
|
||||
(function
|
||||
"bomb1"
|
||||
#f
|
||||
,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1))
|
||||
)
|
||||
)
|
||||
(function
|
||||
"invinc"
|
||||
#f
|
||||
,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1 invinc))
|
||||
)
|
||||
)
|
||||
(function
|
||||
"giant"
|
||||
#f
|
||||
,(lambda ((arg0 object) (arg1 debug-menu-msg))
|
||||
(if (not *target*)
|
||||
(start 'debug (get-current-continue-forced *game-info*))
|
||||
)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active bomb0 bomb1 invinc giant))
|
||||
)
|
||||
)
|
||||
)
|
||||
(menu
|
||||
"Gun"
|
||||
@@ -6092,7 +6101,7 @@
|
||||
)
|
||||
(logior! (-> *game-info* features) (game-feature darkjak))
|
||||
(logior! (-> *game-info* debug-features) (game-feature darkjak))
|
||||
(send-event *target* 'change-mode 'darkjak #f 3)
|
||||
(send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on active))
|
||||
)
|
||||
)
|
||||
(function "indax" #f ,(lambda ()
|
||||
|
||||
+13
-9
@@ -1460,19 +1460,19 @@
|
||||
*stdcon*
|
||||
"~16S~16S~16S~%"
|
||||
(editable-command->string
|
||||
(if (and (nonzero? (-> obj command 1)) (or (zero? (-> obj command 0)) (logtest? (-> *mouse* button0-abs 0) 1)))
|
||||
(if (and (nonzero? (-> obj command 1)) (or (zero? (-> obj command 0)) (mouse-hold? left)))
|
||||
(the-as editable-command (-> obj command 1))
|
||||
(the-as editable-command (-> obj command 0))
|
||||
)
|
||||
)
|
||||
(editable-command->string
|
||||
(if (and (nonzero? (-> obj command 5)) (or (zero? (-> obj command 4)) (logtest? (-> *mouse* button0-abs 0) 4)))
|
||||
(if (and (nonzero? (-> obj command 5)) (or (zero? (-> obj command 4)) (mouse-hold? middle)))
|
||||
(the-as editable-command (-> obj command 5))
|
||||
(the-as editable-command (-> obj command 4))
|
||||
)
|
||||
)
|
||||
(editable-command->string
|
||||
(if (and (nonzero? (-> obj command 3)) (or (zero? (-> obj command 2)) (logtest? (-> *mouse* button0-abs 0) 2)))
|
||||
(if (and (nonzero? (-> obj command 3)) (or (zero? (-> obj command 2)) (mouse-hold? right)))
|
||||
(the-as editable-command (-> obj command 3))
|
||||
(the-as editable-command (-> obj command 2))
|
||||
)
|
||||
@@ -2026,19 +2026,19 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (logtest? (-> *mouse* button0-rel 0) 1)
|
||||
(if (mouse-pressed? left)
|
||||
(editable-array-method-9 gp-0 (the-as editable-command (-> self command 0)) (the-as editable-array *mouse*))
|
||||
)
|
||||
(if (logtest? (-> *mouse* button0-abs 0) 1)
|
||||
(if (mouse-hold? left)
|
||||
(editable-array-method-9 gp-0 (the-as editable-command (-> self command 1)) (the-as editable-array *mouse*))
|
||||
)
|
||||
(if (logtest? (-> *mouse* button0-rel 0) 2)
|
||||
(if (mouse-pressed? right)
|
||||
(editable-array-method-9 gp-0 (the-as editable-command (-> self command 2)) (the-as editable-array *mouse*))
|
||||
)
|
||||
(if (logtest? (-> *mouse* button0-abs 0) 2)
|
||||
(if (mouse-hold? right)
|
||||
(editable-array-method-9 gp-0 (the-as editable-command (-> self command 3)) (the-as editable-array *mouse*))
|
||||
)
|
||||
(when (logtest? (-> *mouse* button0-rel 0) 4)
|
||||
(when (mouse-pressed? middle)
|
||||
(let ((a2-11 (-> self command 4)))
|
||||
(case a2-11
|
||||
((36)
|
||||
@@ -2053,7 +2053,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (logtest? (-> *mouse* button0-abs 0) 4)
|
||||
(if (mouse-hold? middle)
|
||||
(editable-array-method-9 gp-0 (the-as editable-command (-> self command 5)) (the-as editable-array *mouse*))
|
||||
)
|
||||
)
|
||||
@@ -2619,3 +2619,7 @@
|
||||
*debug-hook*
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+54
-59
@@ -1539,7 +1539,7 @@
|
||||
(nav-graph-editor-method-34 obj)
|
||||
(nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index))
|
||||
(cond
|
||||
((not (logtest? (-> *mouse* button0-abs 0) 1))
|
||||
((not (mouse-hold? left))
|
||||
(let ((a0-4 (nav-graph-editor-method-49 obj)))
|
||||
(vector-!
|
||||
(-> a0-4 move-vec)
|
||||
@@ -1590,12 +1590,12 @@
|
||||
(defstate adjust-plane (nav-graph-editor)
|
||||
:virtual #t
|
||||
:trans (behavior ()
|
||||
(if (logtest? (-> *mouse* button0-abs 0) 1)
|
||||
(if (mouse-hold? left)
|
||||
(go-virtual move-plane)
|
||||
)
|
||||
(when (and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> self selected-index) 0))
|
||||
(logand! (-> *mouse* button0-abs 0) -5)
|
||||
(logand! (-> *mouse* button0-rel 0) -5)
|
||||
(when (and (mouse-hold? middle) (>= (-> self selected-index) 0))
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle))
|
||||
(set! (-> self plane-height) (-> self nav-graph node-array data (-> self selected-index) position y))
|
||||
)
|
||||
(nav-graph-editor-method-41 self)
|
||||
@@ -1622,7 +1622,7 @@
|
||||
(none)
|
||||
)
|
||||
:trans (behavior ()
|
||||
(if (not (logtest? (-> *mouse* button0-abs 0) 1))
|
||||
(if (not (mouse-hold? left))
|
||||
(go-virtual adjust-plane)
|
||||
)
|
||||
(none)
|
||||
@@ -1668,12 +1668,13 @@
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((and (logtest? (-> *mouse* button0-rel 0) 1)
|
||||
(begin (logand! (-> *mouse* button0-abs 0) -2) (let ((v1-20 (logand -2 (-> *mouse* button0-rel 0))))
|
||||
(set! (-> *mouse* button0-rel 0) v1-20)
|
||||
(and v1-20 (!= (-> obj selected-index) (-> obj edge-src)))
|
||||
)
|
||||
)
|
||||
((and (mouse-pressed? left) (begin
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons left))
|
||||
(let ((v1-20 (logclear (-> *mouse* button0-rel 0) (mouse-buttons left))))
|
||||
(set! (-> *mouse* button0-rel 0) v1-20)
|
||||
(and v1-20 (!= (-> obj selected-index) (-> obj edge-src)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((>= (-> obj selected-index) 0)
|
||||
@@ -1692,12 +1693,12 @@
|
||||
(nav-graph-editor-method-47 obj)
|
||||
(set! (-> obj edge-src) (-> obj edge-dst))
|
||||
)
|
||||
((logtest? (-> *mouse* button0-rel 0) 2)
|
||||
((mouse-pressed? right)
|
||||
(if (= (-> obj edge-dst) -2)
|
||||
(nav-graph-editor-method-58 obj)
|
||||
)
|
||||
(logand! (-> *mouse* button0-abs 0) -3)
|
||||
(logand! (-> *mouse* button0-rel 0) -3)
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons right))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons right))
|
||||
(go (method-of-object obj create))
|
||||
)
|
||||
)
|
||||
@@ -1742,15 +1743,12 @@
|
||||
(nav-graph-editor-method-43 obj)
|
||||
(nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index))
|
||||
(cond
|
||||
((logtest? (-> *mouse* button0-rel 0) 1)
|
||||
(logand! (-> *mouse* button0-abs 0) -2)
|
||||
(logand! (-> *mouse* button0-rel 0) -2)
|
||||
((mouse-pressed? left)
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons left))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons left))
|
||||
(go (method-of-object obj create-edge))
|
||||
)
|
||||
((and (logtest? (-> *mouse* button0-rel 0) 2)
|
||||
(>= (-> obj selected-index) 0)
|
||||
(not (-> obj selected-node-edge?))
|
||||
)
|
||||
((and (mouse-pressed? right) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?)))
|
||||
)
|
||||
(else
|
||||
(nav-graph-editor-method-59 obj)
|
||||
@@ -1798,19 +1796,19 @@
|
||||
(nav-graph-editor-method-42 self)
|
||||
(nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index))
|
||||
(cond
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> self selected-index) 0))
|
||||
(logand! (-> *mouse* button0-abs 0) -2)
|
||||
(logand! (-> *mouse* button0-rel 0) -2)
|
||||
((and (mouse-hold? left) (>= (-> self selected-index) 0))
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons left))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons left))
|
||||
(nav-graph-editor-method-53 self (-> self edge-visibility) (-> self selected-index))
|
||||
)
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> self selected-index) 0))
|
||||
(logand! (-> *mouse* button0-abs 0) -5)
|
||||
(logand! (-> *mouse* button0-rel 0) -5)
|
||||
((and (mouse-hold? middle) (>= (-> self selected-index) 0))
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle))
|
||||
(nav-graph-editor-method-57 self (-> self edge-visibility) (-> self selected-index))
|
||||
)
|
||||
((logtest? (-> *mouse* button0-abs 0) 2)
|
||||
(logand! (-> *mouse* button0-abs 0) -3)
|
||||
(logand! (-> *mouse* button0-rel 0) -3)
|
||||
((mouse-hold? right)
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons right))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons right))
|
||||
(go-virtual adjust-minimap)
|
||||
)
|
||||
)
|
||||
@@ -1830,7 +1828,7 @@
|
||||
(nav-graph-editor-method-28 self)
|
||||
(nav-graph-editor-method-34 self)
|
||||
(cond
|
||||
((not (logtest? (-> *mouse* button0-abs 0) 1))
|
||||
((not (mouse-hold? left))
|
||||
(go-virtual adjust-it)
|
||||
)
|
||||
(else
|
||||
@@ -1857,7 +1855,7 @@
|
||||
(nav-graph-editor-method-28 self)
|
||||
(nav-graph-editor-method-34 self)
|
||||
(cond
|
||||
((not (logtest? (-> *mouse* button0-abs 0) 2))
|
||||
((not (mouse-hold? right))
|
||||
(go-virtual adjust-it)
|
||||
)
|
||||
(else
|
||||
@@ -1887,7 +1885,7 @@
|
||||
(nav-graph-editor-method-28 self)
|
||||
(nav-graph-editor-method-34 self)
|
||||
(cond
|
||||
((not (logtest? (-> *mouse* button0-abs 0) 2))
|
||||
((not (mouse-hold? right))
|
||||
(go-virtual adjust-it)
|
||||
)
|
||||
(else
|
||||
@@ -1918,7 +1916,7 @@
|
||||
(nav-graph-editor-method-34 self)
|
||||
(nav-graph-editor-method-32 self (-> self selected-node-edge?) (-> self selected-index))
|
||||
(cond
|
||||
((not (logtest? (-> *mouse* button0-abs 0) 4))
|
||||
((not (mouse-hold? middle))
|
||||
(go-virtual adjust-it)
|
||||
)
|
||||
(else
|
||||
@@ -1954,21 +1952,18 @@
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0))
|
||||
((and (mouse-hold? left) (>= (-> obj selected-index) 0))
|
||||
(if (-> obj selected-node-edge?)
|
||||
(go (method-of-object obj adjust-node-angle))
|
||||
)
|
||||
)
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 2) (>= (-> obj selected-index) 0))
|
||||
((and (mouse-hold? right) (>= (-> obj selected-index) 0))
|
||||
(if (-> obj selected-node-edge?)
|
||||
(go (method-of-object obj adjust-node-radius))
|
||||
(go (method-of-object obj adjust-edge-width))
|
||||
)
|
||||
)
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 4)
|
||||
(>= (-> obj selected-index) 0)
|
||||
(not (-> obj selected-node-edge?))
|
||||
)
|
||||
((and (mouse-hold? middle) (>= (-> obj selected-index) 0) (not (-> obj selected-node-edge?)))
|
||||
(go (method-of-object obj adjust-edge-density))
|
||||
)
|
||||
(else
|
||||
@@ -2016,14 +2011,14 @@
|
||||
(nav-graph-editor-method-30 obj (-> obj selected-index))
|
||||
)
|
||||
(cond
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0))
|
||||
(logand! (-> *mouse* button0-abs 0) -2)
|
||||
(logand! (-> *mouse* button0-rel 0) -2)
|
||||
((and (mouse-hold? left) (>= (-> obj selected-index) 0))
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons left))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons left))
|
||||
(go (method-of-object obj adjust-edge-visibility))
|
||||
)
|
||||
((logtest? (-> *mouse* button0-abs 0) 2)
|
||||
(logand! (-> *mouse* button0-abs 0) -3)
|
||||
(logand! (-> *mouse* button0-rel 0) -3)
|
||||
((mouse-hold? right)
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons right))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons right))
|
||||
(go (method-of-object obj draw-closest-minimap))
|
||||
)
|
||||
(else
|
||||
@@ -2096,9 +2091,9 @@
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((logtest? (-> *mouse* button0-abs 0) 2)
|
||||
(logand! (-> *mouse* button0-abs 0) -3)
|
||||
(logand! (-> *mouse* button0-rel 0) -3)
|
||||
((mouse-hold? right)
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons right))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons right))
|
||||
(go-virtual adjust-minimap)
|
||||
)
|
||||
(else
|
||||
@@ -2118,19 +2113,19 @@
|
||||
(nav-graph-editor-method-43 obj)
|
||||
(nav-graph-editor-method-32 obj (-> obj selected-node-edge?) (-> obj selected-index))
|
||||
(cond
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 1) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?))
|
||||
(logand! (-> *mouse* button0-abs 0) -2)
|
||||
(logand! (-> *mouse* button0-rel 0) -2)
|
||||
((and (mouse-hold? left) (>= (-> obj selected-index) 0) (-> obj selected-node-edge?))
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons left))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons left))
|
||||
(go (method-of-object obj move-node))
|
||||
)
|
||||
((logtest? (-> *mouse* button0-abs 0) 2)
|
||||
(logand! (-> *mouse* button0-abs 0) -3)
|
||||
(logand! (-> *mouse* button0-rel 0) -3)
|
||||
((mouse-hold? right)
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons right))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons right))
|
||||
(go (method-of-object obj create-edge))
|
||||
)
|
||||
((and (logtest? (-> *mouse* button0-abs 0) 4) (>= (-> obj selected-index) 0))
|
||||
(logand! (-> *mouse* button0-abs 0) -5)
|
||||
(logand! (-> *mouse* button0-rel 0) -5)
|
||||
((and (mouse-hold? middle) (>= (-> obj selected-index) 0))
|
||||
(logclear! (-> *mouse* button0-abs 0) (mouse-buttons middle))
|
||||
(logclear! (-> *mouse* button0-rel 0) (mouse-buttons middle))
|
||||
(if (-> obj selected-node-edge?)
|
||||
(nav-graph-editor-method-55 obj (-> obj selected-index))
|
||||
(nav-graph-editor-method-56 obj (-> obj selected-index))
|
||||
|
||||
Reference in New Issue
Block a user