clean up casts around conds with elses (#904)

This commit is contained in:
water111
2021-10-16 12:02:49 -04:00
committed by GitHub
parent 7e91fc1f3c
commit 9225d28444
25 changed files with 712 additions and 1079 deletions
+73 -106
View File
@@ -2641,46 +2641,37 @@
(else
(when
(zero? (logand (-> (the-as anim-test-seq-item gp-0) flags) 4))
(let ((v1-334 (-> *anim-tester* 0 item-field)))
(the-as int (cond
((= v1-334 5)
(anim-test-seq-mark-as-edited
(the-as anim-test-sequence s4-0)
)
(let
((v1-331
(logxor
(-> (the-as anim-test-seq-item gp-0) flags)
2
)
)
)
(set!
(-> (the-as anim-test-seq-item gp-0) flags)
v1-331
)
v1-331
)
)
((= v1-334 6)
(the-as int #f)
)
((= v1-334 7)
(the-as int #f)
)
((= v1-334 8)
(the-as int #f)
)
(else
(logior! (-> *anim-tester* 0 flags) 8)
(set!
(-> *anim-tester* 0 inc-delay)
(-> *DISP_LIST-bank* INC_DELAY)
)
(set! (-> *anim-tester* 0 inc-timer) 0)
0
)
)
(case (-> *anim-tester* 0 item-field)
((5)
(anim-test-seq-mark-as-edited
(the-as anim-test-sequence s4-0)
)
(let
((v1-331
(logxor (-> (the-as anim-test-seq-item gp-0) flags) 2)
)
)
(set! (-> (the-as anim-test-seq-item gp-0) flags) v1-331)
v1-331
)
)
((6)
(the-as int #f)
)
((7)
(the-as int #f)
)
((8)
(the-as int #f)
)
(else
(logior! (-> *anim-tester* 0 flags) 8)
(set!
(-> *anim-tester* 0 inc-delay)
(-> *DISP_LIST-bank* INC_DELAY)
)
(set! (-> *anim-tester* 0 inc-timer) 0)
0
)
)
)
@@ -2735,69 +2726,48 @@
)
)
)
(the-as none (cond
(s2-0
(display-list-control (-> *anim-tester* 0 pick-con))
)
(else
(let*
((s4-2
(->
*display*
frames
(-> *display* on-screen)
frame
debug-buf
)
)
(gp-3 (-> s4-2 base))
)
(draw-string-xy
"-spd-blnd-1st-lst-flgs-mov-"
s4-2
(+
(-> arg1 xpos)
(*
(-> *ANIM_TESTER-bank* EDIT_STATS_X)
(-> *DISP_LIST-bank* CHAR_WIDTH)
)
)
(-> arg1 ypos)
(font-color dim-white)
(font-flags shadow kerning)
)
(let ((a3-21 (-> s4-2 base)))
(let ((v1-367 (the-as object (-> s4-2 base))))
(set!
(-> (the-as dma-packet v1-367) dma)
(new 'static 'dma-tag :id (dma-tag-id next))
)
(set!
(-> (the-as dma-packet v1-367) vif0)
(new 'static 'vif-tag)
)
(set!
(-> (the-as dma-packet v1-367) vif1)
(new 'static 'vif-tag)
)
(set! (-> s4-2 base) (&+ (the-as pointer v1-367) 16))
)
(dma-bucket-insert-tag
(->
*display*
frames
(-> *display* on-screen)
frame
bucket-group
)
(bucket-id debug-draw0)
gp-3
(the-as (pointer dma-tag) a3-21)
)
)
)
)
)
(cond
(s2-0
(display-list-control (-> *anim-tester* 0 pick-con))
)
(else
(let*
((s4-2 (-> *display* frames (-> *display* on-screen) frame debug-buf))
(gp-3 (-> s4-2 base))
)
(draw-string-xy
"-spd-blnd-1st-lst-flgs-mov-"
s4-2
(+
(-> arg1 xpos)
(*
(-> *ANIM_TESTER-bank* EDIT_STATS_X)
(-> *DISP_LIST-bank* CHAR_WIDTH)
)
)
(-> arg1 ypos)
(font-color dim-white)
(font-flags shadow kerning)
)
(let ((a3-21 (-> s4-2 base)))
(let ((v1-367 (the-as object (-> s4-2 base))))
(set!
(-> (the-as dma-packet v1-367) dma)
(new 'static 'dma-tag :id (dma-tag-id next))
)
(set! (-> (the-as dma-packet v1-367) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-367) vif1) (new 'static 'vif-tag))
(set! (-> s4-2 base) (&+ (the-as pointer v1-367) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) frame bucket-group)
(bucket-id debug-draw0)
gp-3
(the-as (pointer dma-tag) a3-21)
)
)
)
)
)
)
)
@@ -3950,6 +3920,3 @@
)
)
+19 -27
View File
@@ -743,38 +743,30 @@
)
;; definition (debug) for function get-debug-line
(defun-debug get-debug-line ()
(the-as debug-line (cond
((<
(-> *debug-lines-trk* length)
(-> *debug-lines-trk* allocated-length)
)
(+! (-> *debug-lines-trk* length) 1)
(-> *debug-lines* (+ (-> *debug-lines-trk* length) -1))
)
(else
(the-as debug-line #f)
)
)
(cond
((< (-> *debug-lines-trk* length) (-> *debug-lines-trk* allocated-length))
(+! (-> *debug-lines-trk* length) 1)
(-> *debug-lines* (+ (-> *debug-lines-trk* length) -1))
)
(else
(the-as debug-line #f)
)
)
)
;; definition (debug) for function get-debug-text-3d
(defun-debug get-debug-text-3d ()
(the-as debug-text-3d (cond
((<
(-> *debug-text-3d-trk* length)
(-> *debug-text-3d-trk* allocated-length)
)
(+! (-> *debug-text-3d-trk* length) 1)
(->
*debug-text-3ds*
(+ (-> *debug-text-3d-trk* length) -1)
)
)
(else
(the-as debug-text-3d #f)
)
)
(cond
((<
(-> *debug-text-3d-trk* length)
(-> *debug-text-3d-trk* allocated-length)
)
(+! (-> *debug-text-3d-trk* length) 1)
(-> *debug-text-3ds* (+ (-> *debug-text-3d-trk* length) -1))
)
(else
(the-as debug-text-3d #f)
)
)
)