diff --git a/common/type_system/Type.cpp b/common/type_system/Type.cpp index 7dbd35e74d..77b00582ed 100644 --- a/common/type_system/Type.cpp +++ b/common/type_system/Type.cpp @@ -886,9 +886,9 @@ int BasicType::get_offset() const { } int BasicType::get_inline_array_start_alignment() const { - if (m_pack) { + if (m_pack || m_allow_misalign) { // make elements of inline array the minimum allowable alignment. - int alignment = 8; + int alignment = m_allow_misalign ? 4 : 8; // TODO - I don't know if GOAL actually did this check, maybe packed inline arrays could // violate these? for (const auto& field : m_fields) { diff --git a/common/type_system/TypeSystem.cpp b/common/type_system/TypeSystem.cpp index e5559ec2a3..c37fc7dc7a 100644 --- a/common/type_system/TypeSystem.cpp +++ b/common/type_system/TypeSystem.cpp @@ -954,8 +954,9 @@ int TypeSystem::add_field_to_type(StructureType* type, int aligned_offset = align(offset, field_alignment); field.mark_as_user_placed(); if (offset != aligned_offset) { - throw_typesystem_error("Tried to place field {} at {}, but it is not aligned correctly\n", - field_name, offset); + throw_typesystem_error( + "Tried to place field {} at {}, but it is not aligned correctly, requires {}\n", + field_name, offset, field_alignment); } } diff --git a/common/type_system/deftype.cpp b/common/type_system/deftype.cpp index df6731a600..2076e3e56d 100644 --- a/common/type_system/deftype.cpp +++ b/common/type_system/deftype.cpp @@ -624,11 +624,7 @@ DeftypeResult parse_deftype(const goos::Object& deftype, new_type->set_pack(true); } if (sr.allow_misaligned) { - lg::print( - "[TypeSystem] :allow-misaligned was set on {}, which is a basic and cannot " - "be misaligned\n", - name); - throw std::runtime_error("invalid pack option on basic"); + new_type->set_allow_misalign(true); } if (sr.always_stack_singleton) { lg::print( diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index 7d23417c94..6bff432d64 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -6967,6 +6967,7 @@ (text-x24d #x024d) (text-x24e #x024e) (text-x24f #x024f) + (text-x277 #x0277) (scene-subtitles-enabled #x30d) (scene-subtitles-disabled #x30e) (progress-unknown-continue #x310) @@ -7426,19 +7427,19 @@ (minimap-method-12 (_type_ process uint int vector int) connection-minimap 12) (minimap-method-13 () none 13) (minimap-method-14 () none 14) - (minimap-method-15 () none 15) + (minimap-method-15 (_type_ dma-buffer vector4w symbol) none 15) ;; hud sprite 1 draw (minimap-method-16 () none 16) (minimap-method-17 () none 17) (minimap-method-18 () none 18) (minimap-method-19 () none 19) - (minimap-method-20 () none 20) + (minimap-method-20 (_type_) symbol 20) (minimap-method-21 () none 21) (minimap-method-22 () none 22) (minimap-method-23 () none 23) - (minimap-method-24 () none 24) - (minimap-method-25 () none 25) + (minimap-method-24 (_type_ dma-buffer vector4w symbol) none 24) ;; hud sprite 2 draw + (minimap-method-25 (_type_ texture float) none 25) (minimap-method-26 () none 26) - (minimap-method-27 () none 27) + (minimap-method-27 (_type_ float float) none 27) ) ) @@ -12919,7 +12920,7 @@ (race-total-lap-count int32 :offset-assert 508) (race-position int32 :offset-assert 512) (race-number-turbos int32 :offset-assert 516) - (bot-health uint32 3 :offset-assert 520) + (bot-health float 3 :offset-assert 520) (demo-state uint32 :offset-assert 532) (wanted-flash basic :offset-assert 536) (distance float :offset-assert 540) @@ -12990,6 +12991,17 @@ (fade 9) ) +(defenum gui-status + :type uint8 ;; not sure + :bitfield #f + (unknown 0) + (pending 1) + (ready 2) + (active 3) + (hide 4) + (stop 5) + ) + (defenum gui-channel :type uint8 :bitfield #f @@ -13040,12 +13052,22 @@ (max 96) ) +(defenum gui-connection-flags + :type uint8 + :bitfield #t + (gcf0 0) + (gcf1 1) + (fo-curve 2) + (fo-min 3) + (fo-max 4) + ) + (deftype gui-connection (connection) ((priority float :offset 16 :score 1) (action gui-action :offset 20) (channel gui-channel :offset 21) (anim-part uint8 :offset 22) - (flags uint8 :offset 23) + (flags gui-connection-flags :offset 23) (name string :offset 24) (id sound-id :offset 28) (handle handle :offset 0) @@ -13082,21 +13104,21 @@ ;; Failed to read fields. (:methods (new (symbol type int) _type_ 0) - (gui-control-method-9 (_type_ process gui-channel gui-action string float time-frame) sound-id 9) - (gui-control-method-10 (_type_ process gui-channel) none 10) - (gui-control-method-11 (_type_ gui-connection) int 11) + (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id 9) + (remove-process (_type_ process gui-channel) none 10) + (stop-str (_type_ gui-connection) int 11) (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) (update (_type_ symbol) int 13) - (gui-control-method-14 (_type_ string gui-channel gui-action) int 14) - (gui-control-method-15 (_type_ process gui-channel string sound-id) gui-connection 15) - (gui-control-method-16 (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) - (gui-control-method-17 (_type_ sound-id) gui-action 17) + (lookup-gui-connection-id (_type_ string gui-channel gui-action) int 14) + (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection 15) + (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) + (get-status (_type_ sound-id) gui-status 17) (gui-control-method-18 (_type_ gui-channel) symbol 18) - (gui-control-method-19 (_type_ gui-channel gui-connection) symbol 19) - (gui-control-method-20 (_type_ sound-id symbol int int int) gui-connection 20) + (handle-command-list (_type_ gui-channel gui-connection) symbol 19) + (set-falloff! (_type_ sound-id symbol int int int) gui-connection 20) (gui-control-method-21 (_type_ gui-connection vector) int 21) (gui-control-method-22 (_type_ gui-connection process symbol) none 22) - (gui-control-method-23 (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) + (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) (channel-id-set! (_type_ gui-connection sound-id) int 24) ) ) @@ -14625,7 +14647,7 @@ ;; Failed to read fields. (:methods (new (symbol type process-drawable pickup-type float) _type_ 0) - (get-gun-ammo (_type_ target) float 12) + (get-gun-ammo (_type_) float 12) ) ) @@ -20906,10 +20928,12 @@ (deftype hud-string (basic) ((text string :offset-assert 4) (scale float :offset-assert 8) - (color uint32 :offset-assert 12) - (flags uint32 :offset-assert 16) - (pos vector4w :inline :offset-assert 32) + (color font-color :offset-assert 12) + (flags font-flags :offset-assert 16) + ;(pos vector4w :inline :offset-assert 32) + (pos int32 4 :offset 32) ) + :allow-misaligned :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 @@ -20918,6 +20942,7 @@ (deftype hud-sprite (structure) ((pos vector4w :inline :offset-assert 0) (color vector4w :inline :offset-assert 16) + (color2 int32 4 :offset 16 :score 1) (flags uint32 :offset-assert 32) (scale-x float :offset-assert 36) (scale-y float :offset-assert 40) @@ -20928,7 +20953,7 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (hud-sprite-method-9 (_type_ dma-buffer level) none 9) + (draw (_type_ dma-buffer level) none 9) (hud-sprite-method-10 (_type_) none 10) ) ) @@ -20942,22 +20967,24 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (hud-box-method-9 (_type_ dma-buffer) none 9) - (hud-box-method-10 () none 10) - (hud-box-method-11 () none 11) - (hud-box-method-12 () none 12) - (hud-box-method-13 (_type_ dma-buffer float) int 13) - (hud-box-method-14 (_type_) none 14) - (hud-box-method-15 (_type_) none 15) + (draw-box-prim-only (_type_ dma-buffer) none 9) + (draw-box-alpha-1 (_type_ dma-buffer) none 10) + (draw-box-alpha-2 (_type_ dma-buffer) none 11) + (draw-box-alpha-3 (_type_ dma-buffer) none 12) + (draw-scan-and-line (_type_ dma-buffer float) int 13) + (setup-scissor (_type_ dma-buffer) none 14) + (restore-scissor (_type_ dma-buffer) none 15) ) ) (deftype hud-icon (basic) ((icon (pointer manipy) :offset-assert 4) ;; guessed by decompiler - (pos vector4w :inline :offset-assert 16) + ;(pos vector4w :inline :offset-assert 16) + (pos int32 4 :offset 16) (scale-x float :offset-assert 32) (scale-y float :offset-assert 36) ) + :allow-misaligned :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 @@ -20969,7 +20996,7 @@ (flags uint16 :offset-assert 12) (counter uint16 :offset-assert 14) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -20978,6 +21005,9 @@ (defenum hud-flags :type uint32 :bitfield #t + (disable 0) + (should-die 1) + (show 2) ) (deftype hud (process) @@ -20985,29 +21015,29 @@ (last-hide-time time-frame :offset-assert 136) ;; time-frame (offset float :offset-assert 144) ;; int32 (flags hud-flags :offset-assert 148) - (values hud-value 8 :inline :offset-assert 152 :score 999) - (strings hud-string 14 :inline :offset-assert 288 :score 999) - (sprites hud-sprite 30 :inline :offset-assert 960) - (icons hud-icon 2 :inline :offset-assert 2880) ;; guessed by decompiler - (gui-id sound-id :offset-assert 2976) + (values hud-value 8 :inline :offset 148) + (strings hud-string 14 :inline :offset 284 :score 999) + (sprites hud-sprite 30 :inline :offset 960 :score 999) + (icons hud-icon 2 :inline :offset 2876) ;; guessed by decompiler + (gui-id sound-id :offset 2976) ) :method-count-assert 27 :size-assert #xba4 :flag-assert #x1b0b300ba4 (:methods (hidden? (_type_) symbol 14) ;; (hidden? (_type_) symbol 14) - (hud-method-15 (_type_) none 15) ;; (draw-hud (_type_) none 15) - (hud-method-16 (_type_ int int) none 16) ;; (tally-value (_type_ int int) none 16) - (hud-method-17 (_type_) none 17) ;; (draw-icons (_type_) none 17) - (hud-method-18 (_type_) symbol 18) ;; (draw-particles (_type_) none 18) + (draw (_type_) none 15) ;; (draw-hud (_type_) none 15) + (update-values (_type_) none 16) ;; (tally-value (_type_ int int) none 16) + (init-callback (_type_) none 17) ;; (draw-icons (_type_) none 17) + (event-callback (_type_ process int symbol event-message-block) symbol 18) ;; (draw-particles (_type_) none 18) (hud-method-19 (_type_) none 19) ;; (hud-update (_type_) none 19) (hud-method-20 (_type_) none 20) ;; (init-particles! (_type_ int) none 20) (hud-method-21 (_type_) none 21) ;; (get-icon-pos-x (_type_) int 21) (hud-method-22 (_type_) none 22) ;; (get-icon-pos-y (_type_) int 22) (hud-method-23 (_type_) none 23) ;; (dummy-23 (_type_) none 23) - (hud-method-24 (_type_ symbol) none 24) ;; (set-pos-and-scale (_type_ symbol symbol) none 24) - (hud-method-25 (_type_) none 25) ;; (get-icon-scale-x (_type_) float 25) - (hud-method-26 (_type_ int) none 26) ;; (get-icon-scale-y (_type_) float 26) + (check-ready-and-maybe-show "Is this element ready to be shown? If arg0 is set, show it now." (_type_ symbol) symbol 24) + (update-value-callback (_type_ int int) none 25) ;; (get-icon-scale-x (_type_) float 25) + (alloc-string-if-needed (_type_ int) none 26) ;; (get-icon-scale-y (_type_) float 26) ) ) @@ -21495,7 +21525,7 @@ (gone () _type_ :state 23) ;; (adjust-ratios (_type_ symbol symbol) none 23) (init-defaults "Initialize default menu settings." (_type_) connection 24) ;; (draw-fuel-cell-screen (_type_ int) none 24) (progress-method-25 (_type_) none 25) ;; (draw-money-screen (_type_ int) none 25) - (progress-method-26 (_type_) object 26) ;; (draw-buzzer-screen (_type_ int) none 26) + (is-gone (_type_) object 26) ;; (draw-buzzer-screen (_type_ int) none 26) (can-go-back? (_type_) symbol 27) ;; (draw-notice-screen (_type_) none 27) (progress-method-28 (_type_ symbol) symbol 28) ;; (draw-options (_type_ int int float) none 28) (progress-method-29 (_type_) int 29) ;; (respond-common (_type_) none 29) @@ -21570,7 +21600,7 @@ (deftype menu-slider-option (menu-option) ((value-to-modify pointer :offset-assert 48) - (sprites hud-sprite 5 :inline :offset-assert 64) ;; guess + (sprites hud-sprite 5 :inline :offset 64) ;; guess ) :method-count-assert 12 :size-assert #x180 @@ -21639,7 +21669,7 @@ ) (deftype menu-memcard-slot-option (menu-option) - ((sprites hud-sprite 5 :inline :offset-assert 48 :score 999) ;; total guess + ((sprites hud-sprite 5 :inline :offset 48 :score 999) ;; total guess (pad uint8 32) ) :method-count-assert 12 @@ -21732,7 +21762,7 @@ ) (deftype menu-icon-info-option (menu-option) - ((sprites hud-sprite 2 :inline :offset-assert 48) + ((sprites hud-sprite 2 :inline :offset 48) ) :method-count-assert 12 :size-assert #xb0 @@ -21862,7 +21892,7 @@ (deftype menu-highscores-option (paged-menu-option) ((last-move uint64 :offset-assert 64) - (sprites hud-sprite 2 :inline :offset-assert 80) + (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 :size-assert #xd0 @@ -21891,7 +21921,7 @@ (num-hero-items int32 :offset-assert 60) (secret-items (array secret-item-option) :offset-assert 64) (last-move uint64 :offset-assert 72) - (sprites hud-sprite 2 :inline :offset-assert 80) + (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 :size-assert #xd0 @@ -25211,7 +25241,7 @@ (notify handle :offset-assert 456) (force symbol :offset-assert 464) (state-time time-frame :offset-assert 472) - (icon hud-sprite :inline :offset-assert 480) + (icon hud-sprite :inline :offset 480) ) :method-count-assert 23 :size-assert #x214 @@ -30344,7 +30374,8 @@ (mask-tmpl dma-gif-packet :inline :offset-assert 160) (line-tmpl dma-gif-packet :inline :offset-assert 192) (scan-tmpl dma-gif-packet :inline :offset-assert 224) - (line-color vector4w :inline :offset-assert 256) + ;(line-color vector4w :inline :offset-assert 256) + (line-color gs-rgbaq) (scan-colors vector4w 32 :inline :offset 272) (scanline uint32 :offset 784) ) @@ -30354,25 +30385,25 @@ ) (define-extern *hud-sprite-work* hud-sprite-work) -(define-extern hud-create-icon (function none)) +(define-extern hud-create-icon (function hud int int (pointer manipy))) (define-extern hud-hidden (state hud)) ;; (state hud) (define-extern hud-arriving (state hud)) ;; (define-extern hud-in (state hud)) ;; (state hud) -(define-extern hud-leaving (state int hud)) ;; (state int hud) +(define-extern hud-leaving (state float hud)) ;; (state int hud) (define-extern hud-init-by-other (function object :behavior hud)) (define-extern hide-hud (function symbol none)) -;; (define-extern enable-hud function) ;; (function none) +(define-extern enable-hud (function none)) (define-extern hide-hud-quick (function symbol none)) (define-extern show-hud (function object none)) (define-extern hud-hidden? (function symbol)) (define-extern set-hud-piece-position! (function hud-sprite int int none)) -;; (define-extern set-as-offset-from! function) +(define-extern set-as-offset-from! (function hud-sprite vector4w int int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hud-classes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *hud-skullgem* object) +(define-extern *hud-skullgem* (pointer hud-skullgem)) (define-extern activate-hud (function target none)) ;; (function process none) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index 997bfecf12..c409315d2d 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -525,6 +525,12 @@ [444, 1], [479, 1], [510, 1] + ], + "(method 17 hud-goal)": [ + [71, 0] + ], + "(method 15 hud-miss)": [ + [44, 0] ] }, diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index cb8fd450b8..ec227715e7 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -801,5 +801,8 @@ ["L801", "uint64", true], ["L802", "uint64", true], ["L803", "uint64", true] + ], + "hud": [ + ["L217", "vector"] ] } diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index a3b8d786ff..912a179e95 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -5535,5 +5535,97 @@ "(method 7 fodder)": [[19, "t9", "(function nav-enemy int nav-enemy)"]], "(post idle fodder)": [[4, "t9", "(function none)"]], "(method 180 fodder)": [[24, "s1", "fodder"]], - "(method 55 fodder)": [[29, "s5", "process-drawable"]] + "(method 55 fodder)": [[29, "s5", "process-drawable"]], + "(method 13 hud-box)": [ + [[63, 70], "t4", "dma-packet"], + [[72, 79], "t4", "gs-gif-tag"], + [83, "t4", "(pointer gs-test)"], + [85, "t4", "(pointer gs-reg64)"], + [87, "t4", "(pointer gs-alpha)"], + [89, "t4", "(pointer gs-reg64)"], + [[96, 101], "t3", "(pointer uint128)"], + [[110, 144], "t4", "(inline-array vector4w)"], + [[156, 163], "t2", "dma-packet"], + [[165, 172], "t2", "gs-gif-tag"], + [176, "t2", "(pointer gs-alpha)"], + [178, "t2", "(pointer gs-reg64)"], + [180, "t2", "(pointer gs-rgbaq)"], + [182, "t2", "(pointer gs-reg64)"], + [[187, 212], "t2", "(inline-array vector4w)"] + ], + "(method 9 hud-sprite)": [ + [[27, 34], "v1", "(pointer uint128)"], + [[39, 280], "v1", "(inline-array vector)"], + [[280, 316], "v1", "(inline-array vector4w)"] + ], + "(method 9 hud-box)": [ + [[1, 53], "v1", "(inline-array vector4w)"] + ], + "(method 10 hud-box)": [ + [[1, 8], "a2", "dma-packet"], + [[10, 17], "a2", "gs-gif-tag"], + [21, "a2", "(pointer gs-test)"], + [23, "a2", "(pointer gs-reg64)"], + [25, "a2", "(pointer gs-alpha)"], + [27, "a2", "(pointer gs-reg64)"], + [[31, 77], "v1", "(inline-array vector4w)"] + ], + "(method 11 hud-box)": [ + [[1, 8], "a2", "dma-packet"], + [[10, 17], "a2", "gs-gif-tag"], + [21, "a2", "(pointer gs-test)"], + [23, "a2", "(pointer gs-reg64)"], + [25, "a2", "(pointer gs-alpha)"], + [27, "a2", "(pointer gs-reg64)"], + [[31, 77], "v1", "(inline-array vector4w)"] + ], + "(method 12 hud-box)": [ + [[1, 8], "a2", "dma-packet"], + [[10, 17], "a2", "gs-gif-tag"], + [21, "a2", "(pointer gs-test)"], + [23, "a2", "(pointer gs-reg64)"], + [25, "a2", "(pointer gs-alpha)"], + [27, "a2", "(pointer gs-reg64)"], + [[31, 77], "v1", "(inline-array vector4w)"] + ], + "(method 14 hud-box)": [ + [[1, 8], "a2", "dma-packet"], + [[10, 17], "a2", "gs-gif-tag"], + [43, "a1", "(pointer gs-scissor)"], + [45, "a1", "(pointer gs-reg64)"] + ], + "(method 15 hud-box)": [ + [[1, 8], "a0", "dma-packet"], + [[10, 17], "a0", "gs-gif-tag"], + [21, "a0", "(pointer gs-scissor)"], + [23, "a0", "(pointer gs-reg64)"] + ], + "hud-create-icon": [ + [35, "a0", "process-drawable"] + ], + "hide-hud": [ + [11, "v1", "connection"], + [23, "v1", "connection"] + ], + "enable-hud": [ + [17, "v1", "connection"] + ], + "hide-hud-quick": [ + [11, "v1", "connection"], + [23, "v1", "connection"] + ], + "show-hud": [ + [22, "v1", "connection"], + [34, "v1", "connection"] + ], + "hud-hidden?": [ + [9, "v1", "connection"], + [[9, 13], "a0", "hud"] + ], + "(method 15 hud-dark-eco-symbol)": [ + [[9, 14], "v1", "hud-health"] + ], + "(method 15 hud-gun)": [ + [[251, 256], "v1", "dma-packet"] + ] } diff --git a/decompiler/types2/ForwardProp.cpp b/decompiler/types2/ForwardProp.cpp index 092e5a9c83..234ea03a5c 100644 --- a/decompiler/types2/ForwardProp.cpp +++ b/decompiler/types2/ForwardProp.cpp @@ -36,7 +36,7 @@ void types2_from_ambiguous_deref(types2::Instruction& instr, // HACK - this is disabled for now. This probably works, but the expression pass needs // a way to get the decisions. - type.type = TP_Type::make_from_ts(out.front().result_type); + type.type = TP_Type::make_from_ts(coerce_to_reg_type(out.front().result_type)); return; // see if we've tagged this instruction in a previous iteration.. @@ -51,7 +51,7 @@ void types2_from_ambiguous_deref(types2::Instruction& instr, for (auto& sel : out) { if (sel.result_type == desired_type) { // found one, take it. - type.type = TP_Type::make_from_ts(desired_type); + type.type = TP_Type::make_from_ts(coerce_to_reg_type(desired_type)); return; } } @@ -59,11 +59,11 @@ void types2_from_ambiguous_deref(types2::Instruction& instr, // use the first one (highest scored). lg::print("type2_from_ambiguous_deref: wanted type {}, but couldn't find it.\n", desired_type.print()); - type.type = TP_Type::make_from_ts(out.front().result_type); + type.type = TP_Type::make_from_ts(coerce_to_reg_type(out.front().result_type)); return; } else { // we've got a tag, but no info, just pick the first. - type.type = TP_Type::make_from_ts(out.front().result_type); + type.type = TP_Type::make_from_ts(coerce_to_reg_type(out.front().result_type)); return; } } else { @@ -81,7 +81,7 @@ void types2_from_ambiguous_deref(types2::Instruction& instr, // don't think this should be possible lg::warn("Tag lock prevented the creation of a tag in types2_from_ambiguous_deref"); } - type.type = TP_Type::make_from_ts(out.front().result_type); + type.type = TP_Type::make_from_ts(coerce_to_reg_type(out.front().result_type)); return; } } diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index 200b7d1942..064eb2b8bb 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -213,5 +213,5 @@ else() target_link_libraries(runtime pthread dl) endif() -add_executable(gk main.cpp "tools/filter_menu/filter_menu.cpp" "tools/filter_menu/filter_menu.h") +add_executable(gk main.cpp) target_link_libraries(gk runtime) diff --git a/game/tools/filter_menu/filter_menu.cpp b/game/tools/filter_menu/filter_menu.cpp index e31b6b6c70..eb27307db9 100644 --- a/game/tools/filter_menu/filter_menu.cpp +++ b/game/tools/filter_menu/filter_menu.cpp @@ -18,14 +18,14 @@ void FiltersMenu::draw_window() { if (ImGui::TreeNode("Debug Text Filters")) { auto& current_filters = Gfx::g_debug_settings.debug_text_filters; // Iterate and display all current debug text filters - for (int i = 0; i < current_filters.size(); i++) { + for (size_t i = 0; i < current_filters.size(); i++) { std::string label = "contains?"; if (current_filters[i].type == DebugTextFilter::Type::NOT_CONTAINS) { label = "not-contains?"; } else if (current_filters[i].type == DebugTextFilter::Type::REGEX) { label = "regex?"; } - ImGui::Text(label.c_str()); + ImGui::Text("%s", label.c_str()); ImGui::SameLine(); ImGui::InputText(fmt::format("##filter-{}", i).c_str(), ¤t_filters[i].content); } diff --git a/goal_src/jak2/engine/ai/enemy.gc b/goal_src/jak2/engine/ai/enemy.gc index 545c245847..06d11dd12a 100644 --- a/goal_src/jak2/engine/ai/enemy.gc +++ b/goal_src/jak2/engine/ai/enemy.gc @@ -756,7 +756,7 @@ (set! (-> obj incoming blue-juggle-count) (the-as uint 1)) ) (else - (set! (-> obj incoming blue-juggle-count) (the-as uint (+ (-> obj incoming blue-juggle-count) 1))) + (+! (-> obj incoming blue-juggle-count) 1) ) ) (set! (-> obj incoming attack-time) a0-4) @@ -3132,7 +3132,7 @@ ) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-blue-vxz-lo) (-> s5-0 knocked-blue-vxz-hi) f30-7)) (cond - ((>= (the-as uint 4) (the-as uint (-> obj incoming blue-juggle-count))) + ((>= (the-as uint 4) (-> obj incoming blue-juggle-count)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-blue-vy-lo) (-> s5-0 knocked-blue-vy-hi) f30-7)) ) (else diff --git a/goal_src/jak2/engine/ambient/ambient.gc b/goal_src/jak2/engine/ambient/ambient.gc index f445df561d..6c6fa2dde3 100644 --- a/goal_src/jak2/engine/ambient/ambient.gc +++ b/goal_src/jak2/engine/ambient/ambient.gc @@ -25,7 +25,7 @@ ) ) ) - (= (gui-control-method-17 *gui-control* a1-3) (gui-action playing)) + (= (get-status *gui-control* a1-3) (gui-status active)) ) ) @@ -41,7 +41,7 @@ (defun kill-current-talker ((arg0 symbol) (arg1 pair) (arg2 symbol)) (if (not (member 'daxter arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -53,7 +53,7 @@ ) ) (if (not (member 'voicebox arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -65,7 +65,7 @@ ) ) (if (not (member 'message arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -77,7 +77,7 @@ ) ) (when (not (member 'notice arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -87,7 +87,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -173,7 +173,7 @@ ) (talker-speech-class-method-10 arg0) ) - (set! s2-0 (gui-control-method-14 *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) + (set! s2-0 (lookup-gui-connection-id *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) (set! s2-0 (cond ((zero? s2-0) (let ((v1-17 (process-spawn talker :init talker-init arg0 arg2 arg3 :to arg1))) @@ -211,13 +211,13 @@ ) ) (set! (-> self voice-id) - (gui-control-method-9 *gui-control* self (-> arg0 channel) (gui-action queue) (-> arg0 name) 81920.0 0) + (add-process *gui-control* self (-> arg0 channel) (gui-action queue) (-> arg0 name) 81920.0 0) ) ) ) (when (nonzero? (-> arg0 text-message)) (let* ((a0-6 *gui-control*) - (t9-1 (method-of-object a0-6 gui-control-method-9)) + (t9-1 (method-of-object a0-6 add-process)) (a1-3 self) (v1-15 (shr (the-as int (-> arg0 channel)) 4)) ) @@ -362,10 +362,8 @@ ) ) (while (< (- (-> self clock frame-counter) (-> self start-time)) (the-as time-frame (+ (-> self message delay) 300))) - (if (and (or (zero? (-> self voice-id)) (= (gui-control-method-17 *gui-control* (-> self voice-id)) (gui-action play))) - (or (zero? (-> self message-id)) - (= (gui-control-method-17 *gui-control* (-> self message-id)) (gui-action playing)) - ) + (if (and (or (zero? (-> self voice-id)) (= (get-status *gui-control* (-> self voice-id)) (gui-status ready))) + (or (zero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active))) ) (go-virtual active) ) @@ -386,7 +384,7 @@ (set-setting! 'hint (process->ppointer self) 0 0) (set-setting! 'speech-control #f 0 0) (if (nonzero? (-> self voice-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self voice-id) @@ -432,7 +430,7 @@ (auto-save-user) ) (if (nonzero? (-> self voice-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> self voice-id) @@ -444,7 +442,7 @@ ) ) (if (nonzero? (-> self message-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> self message-id) @@ -467,8 +465,8 @@ (local-vars (v1-43 symbol)) (let ((gp-1 (zero? (logand (-> self message flags) 2)))) (while (or (and (nonzero? (-> self voice-id)) - (let ((v1-34 (gui-control-method-17 *gui-control* (-> self voice-id)))) - (or (= v1-34 (gui-action play)) (= v1-34 (gui-action playing))) + (let ((v1-34 (get-status *gui-control* (-> self voice-id)))) + (or (= v1-34 (gui-status ready)) (= v1-34 (gui-status active))) ) (begin (dotimes (s5-2 4) @@ -486,24 +484,21 @@ ) ) (and (nonzero? (-> self message-id)) - (= (gui-control-method-17 *gui-control* (-> self message-id)) (gui-action playing)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (or (< (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self message text-duration))) (and (logtest? (-> self message flags) 16) (-> self region) (region-method-9 (-> self region) (target-pos 0))) ) ) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) ) - (when (and (nonzero? (-> self voice-id)) - (not gp-1) - (zero? (gui-control-method-17 *gui-control* (-> self voice-id))) - ) + (when (and (nonzero? (-> self voice-id)) (not gp-1) (zero? (get-status *gui-control* (-> self voice-id)))) (remove-setting! 'music-volume) (remove-setting! 'sfx-volume) (remove-setting! 'dialog-volume) (set! gp-1 #t) ) (when (and (nonzero? (-> self message-id)) - (= (gui-control-method-17 *gui-control* (-> self message-id)) (gui-action playing)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?)) ) (if (logtest? (-> self message flags) 32) diff --git a/goal_src/jak2/engine/camera/cam-debug.gc b/goal_src/jak2/engine/camera/cam-debug.gc index ad9ca7c847..67acf970a1 100644 --- a/goal_src/jak2/engine/camera/cam-debug.gc +++ b/goal_src/jak2/engine/camera/cam-debug.gc @@ -1109,9 +1109,9 @@ (else (vector+float*! s5-1 s4-1 (the-as vector (-> arg0 tracking)) 2048.0) (camera-line s4-1 s5-1 (new 'static 'vector4w :x #xff :w #x80)) - (vector+float*! s5-1 s4-1 (the-as vector (&-> arg0 stack 96)) 2048.0) + (vector+float*! s5-1 s4-1 (-> arg0 tracking inv-mat vector 1) 2048.0) (camera-line s4-1 s5-1 (new 'static 'vector4w :y #xff :w #x80)) - (vector+float*! s5-1 s4-1 (the-as vector (&-> arg0 stack 112)) 2048.0) + (vector+float*! s5-1 s4-1 (-> arg0 tracking inv-mat vector 2) 2048.0) (camera-line s4-1 s5-1 (new 'static 'vector4w :z #xff :w #x80)) ) ) @@ -1603,14 +1603,14 @@ (set! (-> *camera-combiner* trans quad) (-> arg0 quad)) (let* ((v1-6 (-> *camera-combiner* inv-camera-rot)) (a3-0 arg1) - (a0-3 (-> a3-0 vector 0 quad)) - (a1-1 (-> a3-0 vector 1 quad)) - (a2-0 (-> a3-0 vector 2 quad)) + (a0-3 (-> a3-0 quad 0)) + (a1-1 (-> a3-0 quad 1)) + (a2-0 (-> a3-0 quad 2)) (a3-1 (-> a3-0 trans quad)) ) - (set! (-> v1-6 vector 0 quad) a0-3) - (set! (-> v1-6 vector 1 quad) a1-1) - (set! (-> v1-6 vector 2 quad) a2-0) + (set! (-> v1-6 quad 0) a0-3) + (set! (-> v1-6 quad 1) a1-1) + (set! (-> v1-6 quad 2) a2-0) (set! (-> v1-6 trans quad) a3-1) ) (set-setting-by-param *setting-control* 'mode-name 'cam-fixed 0 0) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index 07f9cc0cbd..c160d853fb 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -19,10 +19,8 @@ ;; this file is debug only (declare-file (debug)) (when *debug-segment* -;; definition for symbol *camera-layout-blink*, type symbol (define *camera-layout-blink* #f) -;; definition of type cam-layout-bank (deftype cam-layout-bank (basic) ((spline-t float :offset-assert 4) (spline-step float :offset-assert 8) @@ -36,7 +34,7 @@ :flag-assert #x90000001c ) -;; definition for symbol *CAM_LAYOUT-bank*, type cam-layout-bank + (define *CAM_LAYOUT-bank* (new 'static 'cam-layout-bank :spline-t 0.01 :spline-step 0.0016666667 @@ -47,10 +45,8 @@ ) ) -;; definition for symbol *camera-layout-message-ypos*, type int (define *camera-layout-message-ypos* 30) -;; definition of type clm-basic (deftype clm-basic (basic) () :method-count-assert 9 @@ -58,7 +54,7 @@ :flag-assert #x900000004 ) -;; definition of type clm-item-action + (deftype clm-item-action (structure) ((button uint64 :offset-assert 0) (options uint64 :offset-assert 8) @@ -74,7 +70,7 @@ :flag-assert #x90000001c ) -;; definition of type clm-item + (deftype clm-item (clm-basic) ((description string :offset-assert 4) (button-symbol symbol :offset-assert 8) @@ -85,7 +81,7 @@ :flag-assert #x90000002c ) -;; definition of type clm-list-item + (deftype clm-list-item (basic) ((description string :offset-assert 4) (track-val symbol :offset-assert 8) @@ -102,7 +98,7 @@ :flag-assert #x90000001c ) -;; definition of type clm-list + (deftype clm-list (clm-basic) ((tracker symbol :offset-assert 4) (cur-list-item int32 :offset-assert 8) @@ -113,7 +109,7 @@ :flag-assert #x900000010 ) -;; definition of type clm + (deftype clm (basic) ((title string :offset-assert 4) (items (array clm-basic) :offset-assert 8) @@ -123,19 +119,15 @@ :flag-assert #x90000000c ) -;; definition for symbol *volume-point-current*, type int + (define *volume-point-current* 0) -;; definition for symbol *volume-point*, type vector-array (define *volume-point* (new 'debug 'vector-array 1000)) -;; definition for symbol *volume-normal-current*, type int (define *volume-normal-current* 0) -;; definition for symbol *volume-normal*, type vector-array (define *volume-normal* (new 'debug 'vector-array 600)) -;; definition of type volume-descriptor-array (deftype volume-descriptor-array (inline-array-class) ((data plane-volume :inline :dynamic :offset 16) ) @@ -144,16 +136,13 @@ :flag-assert #x900000010 ) -;; failed to figure out what this is: + (set! (-> volume-descriptor-array heap-base) (the-as uint 24)) -;; definition for symbol *volume-descriptor-current*, type int (define *volume-descriptor-current* 0) -;; definition for symbol *volume-descriptor*, type vol-control (define *volume-descriptor* (the-as vol-control (new 'debug 'volume-descriptor-array 100))) -;; definition of type cam-layout (deftype cam-layout (process) ((cam-entity entity-camera :offset-assert 128) (num-entities int32 :offset-assert 132) @@ -173,30 +162,17 @@ ) ) -;; definition for function cam-layout-print + +;; WARN: Failed store: (s.w! (+ v1-6 8) 0) at op 22 +;; WARN: Failed store: (s.w! (+ v1-6 12) 0) at op 23 (defun cam-layout-print ((arg0 int) (arg1 int) (arg2 string)) - (let* ((s5-0 (-> *display* frames (-> *display* on-screen) debug-buf)) - (gp-0 (-> s5-0 base)) - ) + (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (bucket-id debug2) + ) (draw-string-xy arg2 s5-0 arg0 arg1 (font-color #dadada) (font-flags shadow kerning)) - (let ((a3-2 (-> s5-0 base))) - (let ((v1-6 (the-as object (-> s5-0 base)))) - (set! (-> (the-as dma-packet v1-6) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - (set! (-> (the-as dma-packet v1-6) vif0) (new 'static 'vif-tag)) - (set! (-> (the-as dma-packet v1-6) vif1) (new 'static 'vif-tag)) - (set! (-> s5-0 base) (&+ (the-as pointer v1-6) 16)) - ) - (dma-bucket-insert-tag - (-> *display* frames (-> *display* on-screen) bucket-group) - (bucket-id debug2) - gp-0 - (the-as (pointer dma-tag) a3-2) - ) - ) ) ) -;; definition for function cam-layout-intersect-dist (defun cam-layout-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) (let ((f0-1 (vector-dot arg1 arg0)) (f1-1 (vector-dot arg2 arg0)) @@ -208,28 +184,6 @@ ) ) -;; definition for function cam-layout-entity-volume-info-create -;; INFO: Used lq/sq -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch ;; WARN: new jak 2 until loop case, check carefully (defbehavior cam-layout-entity-volume-info-create cam-layout ((arg0 entity-camera) (arg1 symbol)) (local-vars @@ -407,7 +361,6 @@ #f ) -;; definition for function cam-layout-entity-volume-info (defbehavior cam-layout-entity-volume-info cam-layout () (dotimes (gp-0 (-> self num-volumes)) (cond @@ -453,8 +406,6 @@ #f ) -;; definition for function v-slrp! -;; INFO: Used lq/sq (defun v-slrp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (let ((s2-0 (new-stack-vector0)) (s1-0 (new-stack-vector0)) @@ -484,7 +435,6 @@ ) ) -;; definition of type interp-test-info (deftype interp-test-info (structure) ((from vector :inline :offset-assert 0) (to vector :inline :offset-assert 16) @@ -498,8 +448,7 @@ :flag-assert #x90000003c ) -;; definition for function interp-test -;; INFO: Used lq/sq + (defun interp-test ((arg0 (function vector vector vector float vector float none)) (arg1 interp-test-info)) (let ((s3-0 (new-stack-vector0)) (s5-0 (new-stack-vector0)) @@ -521,8 +470,6 @@ (none) ) -;; definition for function interp-test-deg -;; INFO: Used lq/sq (defun interp-test-deg ((arg0 (function vector vector vector vector float none)) (arg1 interp-test-info)) (let ((s3-0 (new-stack-vector0)) (s5-0 (new-stack-vector0)) @@ -544,8 +491,6 @@ (none) ) -;; definition for function cam-layout-entity-info -;; INFO: Used lq/sq ;; WARN: Function cam-layout-entity-info has a return type of none, but the expression builder found a return statement. (defun cam-layout-entity-info ((arg0 entity-actor)) (if (not arg0) @@ -807,7 +752,6 @@ (none) ) -;; definition for function clmf-button-test (defun clmf-button-test () "Displays the message `button test`" (cam-layout-print 16 *camera-layout-message-ypos* "button test") @@ -816,7 +760,6 @@ #f ) -;; definition for function clmf-bna (defun clmf-bna () "Displays the message `button not available`" (cam-layout-print 16 *camera-layout-message-ypos* "button not applicable") @@ -825,7 +768,6 @@ #t ) -;; definition for function clmf-implement (defun clmf-implement () "Displays the message `button not implemented yet`" (cam-layout-print 16 *camera-layout-message-ypos* "button not implemented yet") @@ -834,8 +776,6 @@ #t ) -;; definition for function clmf-input -;; INFO: Used lq/sq (defun clmf-input ((arg0 vector) (arg1 vector) (arg2 int)) (vector-reset! arg0) (vector-reset! arg1) @@ -882,8 +822,6 @@ arg1 ) -;; definition for function clmf-pos-rot -;; INFO: Used lq/sq (defbehavior clmf-pos-rot cam-layout ((arg0 symbol) (arg1 symbol)) (local-vars (s2-0 structure) (s3-1 vector) (sv-192 matrix)) (cam-layout-print 16 *camera-layout-message-ypos* "x/z pos: left stick, down: l1, up: r1") @@ -910,10 +848,7 @@ res-tag (make-u128 (logior (shl (shl #x8001 16) 32) (shr (shl (the-as int vector) 32) 32)) - (the-as - res-tag - (logior (shl (-> (new 'static 'array uint64 1 #xce6e6b28) 0) 32) (shr (shl (the-as int arg0) 32) 32)) - ) + (the-as res-tag (logior (shl (the-as uint #xce6e6b28) 32) (shr (shl (the-as int arg0) 32) 32))) ) ) (the-as pointer (new 'static 'vector4w)) @@ -942,7 +877,7 @@ res-tag (make-u128 (the-as res-tag (logior (shl (shl #x8001 16) 32) (shr (shl (the-as int quaternion) 32) 32))) - (logior (shl (-> (new 'static 'array uint64 1 #xce6e6b28) 0) 32) (shr (shl (the-as int arg1) 32) 32)) + (logior (shl (the-as uint #xce6e6b28) 32) (shr (shl (the-as int arg1) 32) 32)) ) ) (the-as pointer (quaternion-identity! (new 'static 'quaternion))) @@ -995,7 +930,6 @@ #t ) -;; definition for function clmf-next-volume (defbehavior clmf-next-volume cam-layout ((arg0 int)) (if (zero? (-> self num-volumes)) (return #f) @@ -1007,7 +941,6 @@ #t ) -;; definition for function clmf-next-vol-dpad (defun clmf-next-vol-dpad () (local-vars (a0-1 int)) (cam-layout-print 16 *camera-layout-message-ypos* "dpad selects volume") @@ -1034,17 +967,14 @@ #t ) -;; definition for function clmf-to-edit-cam (defun clmf-to-edit-cam () (clmf-next-volume 0) (set! *clm* *clm-edit*) #t ) -;; definition for symbol *last-cur-entity*, type int (define *last-cur-entity* -1) -;; definition for function clmf-next-entity (defbehavior clmf-next-entity cam-layout ((arg0 int)) (let ((v1-0 (/ arg0 8))) (when (zero? (-> self num-entities)) @@ -1099,46 +1029,38 @@ #t ) -;; definition for function clmf-to-spline-attr (defun clmf-to-spline-attr () (set! *clm* *clm-spline-attr*) #t ) -;; definition for function clmf-to-intro-attr (defun clmf-to-intro-attr () (set! *clm* *clm-intro-attr*) #t ) -;; definition for function clmf-to-index-attr (defun clmf-to-index-attr () (set! *clm* *clm-index-attr*) #t ) -;; definition for function clmf-to-focalpull-attr (defun clmf-to-focalpull-attr () (set! *clm* *clm-focalpull-attr*) #t ) -;; definition for function clmf-to-edit (defbehavior clmf-to-edit cam-layout () (set! (-> self res-key) -1000000000.0) (set! *clm* *clm-edit*) #t ) -;; definition for function clmf-to-select (defun clmf-to-select () (set! *camera-layout-blink* #f) (set! *clm* *clm-select*) #t ) -;; definition for function clmf-look-through -;; INFO: Used lq/sq (defbehavior clmf-look-through cam-layout () (set! (-> *camera-other-fov* data) (cam-slave-get-fov (-> self cam-entity))) (cam-slave-get-vector-with-offset (the-as entity-actor (-> self cam-entity)) *camera-other-trans* 'trans) @@ -1149,7 +1071,6 @@ #f ) -;; definition for function fov->maya (defun fov->maya ((arg0 float)) (if (= arg0 0.0) 0.0 @@ -1157,7 +1078,6 @@ ) ) -;; definition for function cam-layout-save-cam-rot ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-cam-rot ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s3-0 (-> arg2 quat)) @@ -1183,8 +1103,6 @@ (none) ) -;; definition for function cam-layout-save-cam-trans -;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-cam-trans ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s1-0 (-> arg2 trans)) @@ -1255,8 +1173,6 @@ (none) ) -;; definition for function cam-layout-save-pivot -;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-pivot ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 (res-lump-struct arg2 'pivot vector)) @@ -1303,8 +1219,6 @@ (none) ) -;; definition for function cam-layout-save-align -;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-align ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 (res-lump-struct arg2 'align vector)) @@ -1351,8 +1265,6 @@ (none) ) -;; definition for function cam-layout-save-interesting -;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-interesting ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s2-0 (res-lump-struct arg2 'interesting vector)) @@ -1399,7 +1311,6 @@ (none) ) -;; definition for function cam-layout-save-fov ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-fov ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f28-0 (res-lump-float arg2 'fov)) @@ -1440,7 +1351,6 @@ (none) ) -;; definition for function cam-layout-save-focalpull ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-focalpull ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'focalPull)) @@ -1473,7 +1383,6 @@ (none) ) -;; definition for function cam-layout-save-flags ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-flags ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s4-0 (res-lump-value arg2 'flags uint128 :time -1000000000.0)) @@ -1529,7 +1438,6 @@ (none) ) -;; definition for function cam-layout-save-focalpull-flags ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-focalpull-flags ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s4-0 (res-lump-value arg2 'focalpull-flags uint128 :time -1000000000.0)) @@ -1585,7 +1493,6 @@ (none) ) -;; definition for function cam-layout-save-campoints-flags ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-campoints-flags ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s4-0 (res-lump-value arg2 'campoints-flags uint128 :time -1000000000.0)) @@ -1641,7 +1548,6 @@ (none) ) -;; definition for function cam-layout-save-introsplinetime ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-introsplinetime ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f28-0 (res-lump-float arg2 'intro-time)) @@ -1682,7 +1588,6 @@ (none) ) -;; definition for function cam-layout-save-introsplineexitval ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-introsplineexitval ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'intro-exitValue)) @@ -1718,7 +1623,6 @@ (none) ) -;; definition for function cam-layout-save-interptime ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-interptime ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'interpTime)) @@ -1751,7 +1655,6 @@ (none) ) -;; definition for function cam-layout-save-splineoffset ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-splineoffset ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (when (and (not (res-lump-struct arg2 'pivot structure)) (res-lump-struct arg2 'spline-offset structure)) @@ -1773,7 +1676,6 @@ (none) ) -;; definition for function cam-layout-save-spline-follow-dist-offset ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-spline-follow-dist-offset ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'spline-follow-dist-offset))) @@ -1787,7 +1689,6 @@ (none) ) -;; definition for function cam-layout-save-campointsoffset ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-campointsoffset ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((s5-0 (res-lump-struct arg2 'campoints-offset vector))) @@ -1807,7 +1708,6 @@ (none) ) -;; definition for function cam-layout-save-tiltAdjust ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-tiltAdjust ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'tiltAdjust)) @@ -1840,7 +1740,6 @@ (none) ) -;; definition for function cam-layout-save-stringMinLength ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-stringMinLength ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'stringMinLength)) @@ -1873,7 +1772,6 @@ (none) ) -;; definition for function cam-layout-save-stringMaxLength ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-stringMaxLength ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'stringMaxLength)) @@ -1906,7 +1804,6 @@ (none) ) -;; definition for function cam-layout-save-stringMinHeight ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-stringMinHeight ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'stringMinHeight)) @@ -1939,7 +1836,6 @@ (none) ) -;; definition for function cam-layout-save-stringMaxHeight ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-stringMaxHeight ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'stringMaxHeight)) @@ -1972,7 +1868,6 @@ (none) ) -;; definition for function cam-layout-save-stringCliffHeight ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-stringCliffHeight ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'stringCliffHeight)) @@ -2005,7 +1900,6 @@ (none) ) -;; definition for function cam-layout-save-maxAngle ;; WARN: Return type mismatch object vs none. (defun cam-layout-save-maxAngle ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (let ((f30-0 (res-lump-float arg2 'maxAngle)) @@ -2038,7 +1932,6 @@ (none) ) -;; definition for function clmf-save-single (defbehavior clmf-save-single cam-layout ((arg0 entity-camera) (arg1 symbol) (arg2 symbol)) (clear *temp-string*) (if arg2 @@ -2079,7 +1972,6 @@ ) ) -;; definition for function clmf-save-one (defbehavior clmf-save-one cam-layout ((arg0 symbol)) (let ((s5-1 (logtest? (the-as int arg0) 8)) (gp-1 (logtest? (the-as int arg0) 16)) @@ -2098,7 +1990,6 @@ #t ) -;; definition for function clmf-save-all (defbehavior clmf-save-all cam-layout ((arg0 symbol)) (let ((s5-1 (logtest? (the-as int arg0) 8)) (gp-1 (logtest? (the-as int arg0) 16)) @@ -2129,7 +2020,6 @@ #t ) -;; definition of type clmf-cam-flag-toggle-info (deftype clmf-cam-flag-toggle-info (structure) ((key float :offset-assert 0) (force-on int32 :offset-assert 4) @@ -2140,7 +2030,7 @@ :flag-assert #x90000000c ) -;; definition for function clmf-cam-flag-toggle + (defbehavior clmf-cam-flag-toggle cam-layout ((arg0 int) (arg1 int)) (let ((s4-0 (/ arg0 8)) (gp-0 (new 'stack 'clmf-cam-flag-toggle-info)) @@ -2264,7 +2154,6 @@ #t ) -;; definition for function clmf-cam-flag (defbehavior clmf-cam-flag cam-layout ((arg0 string) (arg1 uint) (arg2 uint)) (let ((s5-0 (/ (the-as int arg1) 8)) (f30-0 (-> self res-key)) @@ -2315,7 +2204,7 @@ ) (format arg0 ": on") ) - ((zero? (logand ((method-of-type res-lump get-property-value) + ((not (logtest? ((method-of-type res-lump get-property-value) (-> self cam-entity) (the-as symbol arg2) 'exact @@ -2326,7 +2215,7 @@ ) s5-0 ) - ) + ) (format arg0 ": off(maya)") ) (else @@ -2338,7 +2227,6 @@ #t ) -;; definition for function clmf-cam-float-adjust (defbehavior clmf-cam-float-adjust cam-layout ((arg0 symbol) (arg1 (pointer float))) (cam-layout-print 16 *camera-layout-message-ypos* "left stick adjusts value") (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) @@ -2351,13 +2239,11 @@ (let ((f0-2 (+ f30-0 (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 f0-0)))) (add-32bit-data! (-> self cam-entity) - (the-as - res-tag - (make-u128 - (the-as res-tag (logior (shl #x10000 32) (shr (shl (the-as int float) 32) 32))) - (logior (shl (-> (new 'static 'array uint64 1 #xce6e6b28) 0) 32) (shr (shl (the-as int arg0) 32) 32)) - ) - ) + (the-as res-tag (make-u128 + (the-as res-tag (logior (shl #x10000 32) (shr (shl (the-as int float) 32) 32))) + (logior (shl (the-as uint #xce6e6b28) 32) (shr (shl (the-as int arg0) 32) 32)) + ) + ) f0-2 ) ) @@ -2366,7 +2252,6 @@ #t ) -;; definition for function clmf-cam-meters (defbehavior clmf-cam-meters cam-layout ((arg0 meters) (arg1 symbol)) (let ((f0-0 (cam-slave-get-float (-> self cam-entity) arg1 0.0))) (format arg0 ": ~M" f0-0) @@ -2374,19 +2259,16 @@ #t ) -;; definition for function clmf-cam-fov (defbehavior clmf-cam-fov cam-layout ((arg0 degrees) (arg1 symbol)) (format arg0 ": ~R" (cam-slave-get-fov (-> self cam-entity))) #t ) -;; definition for function clmf-cam-deg (defbehavior clmf-cam-deg cam-layout ((arg0 degrees) (arg1 symbol)) (format arg0 ": ~R" (cam-slave-get-float (-> self cam-entity) arg1 0.0)) #t ) -;; definition for function clmf-cam-intro-time (defbehavior clmf-cam-intro-time cam-layout ((arg0 float) (arg1 symbol)) (let ((f30-0 (cam-slave-get-intro-step (-> self cam-entity)))) (format arg0 ": ~f" (/ 0.016666668 f30-0)) @@ -2395,20 +2277,16 @@ #t ) -;; definition for function clmf-cam-interp-time (defbehavior clmf-cam-interp-time cam-layout ((arg0 float) (arg1 symbol)) (format arg0 ": ~f" (cam-slave-get-interp-time (-> self cam-entity))) #t ) -;; definition for function clmf-cam-float (defbehavior clmf-cam-float cam-layout ((arg0 float) (arg1 symbol)) (format arg0 ": ~f" (cam-slave-get-float (-> self cam-entity) arg1 0.0)) #t ) -;; definition for function clmf-cam-string -;; INFO: Used lq/sq (defbehavior clmf-cam-string cam-layout ((arg0 string) (arg1 symbol)) (local-vars (r0-0 uint128) (v1-5 uint128) (sv-16 int)) (format arg0 ":") @@ -2431,7 +2309,6 @@ #t ) -;; definition for symbol *clm-focalpull-attr*, type clm (define *clm-focalpull-attr* (new 'static 'clm :title "---focalpull attributes--" @@ -2486,7 +2363,6 @@ ) ) -;; definition for symbol *clm-index-attr*, type clm (define *clm-index-attr* (new 'static 'clm :title "---index attributes--" @@ -2541,7 +2417,6 @@ ) ) -;; definition for symbol *clm-intro-attr*, type clm (define *clm-intro-attr* (new 'static 'clm :title "---intro attributes--" @@ -2592,7 +2467,6 @@ ) ) -;; definition for symbol *clm-spline-attr*, type clm (define *clm-spline-attr* (new 'static 'clm :title "---spline attributes--" @@ -2629,7 +2503,6 @@ ) ) -;; definition for symbol *clm-cam-attr*, type clm (define *clm-cam-attr* (new 'static 'clm :title "---camera attributes--" @@ -2931,7 +2804,6 @@ ) ) -;; definition for symbol *clm-cam-lookthrough*, type clm (define *clm-cam-lookthrough* (new 'static 'clm :title "---cam-lookthrough---" @@ -2984,7 +2856,6 @@ ) ) -;; definition for symbol *clm-edit*, type clm (define *clm-edit* (new 'static 'clm :title "---edit---" @@ -3116,7 +2987,6 @@ ) ) -;; definition for symbol *clm-save-all*, type clm (define *clm-save-all* (new 'static 'clm :title "---save all?---" @@ -3140,7 +3010,6 @@ ) ) -;; definition for symbol *clm-save-one*, type clm (define *clm-save-one* (new 'static 'clm :title "---single save?---" @@ -3164,7 +3033,6 @@ ) ) -;; definition for symbol *clm-select*, type clm (define *clm-select* (new 'static 'clm :title "---camera---" @@ -3208,10 +3076,8 @@ ) ) -;; definition for symbol *clm*, type clm (define *clm* *clm-select*) -;; definition for function cam-layout-do-action (defbehavior cam-layout-do-action cam-layout ((arg0 clm-item-action)) (let ((s5-0 (-> arg0 func value))) (cond @@ -3227,13 +3093,13 @@ ((and (logtest? (-> arg0 options) 8) (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) #f ) - ((and (zero? (logand (-> arg0 options) 28)) + ((and (not (logtest? (-> arg0 options) 28)) (logtest? (-> arg0 options) 1) (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) ) #f ) - ((and (zero? (logand (-> arg0 options) 29)) + ((and (not (logtest? (-> arg0 options) 29)) (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) ) #f @@ -3256,7 +3122,6 @@ ) ) -;; definition for function cam-layout-function-call (defbehavior cam-layout-function-call cam-layout ((arg0 symbol) (arg1 string) (arg2 int) (arg3 basic)) (let ((gp-0 (-> arg0 value))) (cond @@ -3272,7 +3137,6 @@ #f ) -;; definition for function cam-layout-do-menu (defbehavior cam-layout-do-menu cam-layout ((arg0 clm)) (set! *camera-layout-message-ypos* 30) (+! (-> *CAM_LAYOUT-bank* spline-t) (-> *CAM_LAYOUT-bank* spline-step)) @@ -3325,7 +3189,7 @@ (cam-layout-function-call (-> s3-1 items s2-1 val-func) *temp-string* - (the-as int (-> s3-1 items s2-1 val-parm0)) + (-> s3-1 items s2-1 val-parm0) (the-as basic (-> s3-1 items s2-1 val-parm1)) ) (cam-layout-print 320 s4-2 *temp-string*) @@ -3418,7 +3282,6 @@ #f ) -;; failed to figure out what this is: (defstate cam-layout-active (cam-layout) :code (behavior () (until #f @@ -3431,7 +3294,6 @@ ) ) -;; definition for function cam-layout-init (defbehavior cam-layout-init cam-layout () (set! (-> self res-key) -1000000000.0) (set! (-> self num-entities) 0) @@ -3453,13 +3315,11 @@ (go cam-layout-active) ) -;; definition for function cam-layout-stop (defun cam-layout-stop () (set! *cam-layout* #f) (kill-by-name "cam-layout" *active-pool*) ) -;; definition for function cam-layout-start (defun cam-layout-start () (let ((a0-1 (new 'global 'file-stream "dd_next/caminfo/garbage" 'read))) (file-stream-close a0-1) @@ -3486,7 +3346,6 @@ *cam-layout* ) -;; definition for function cam-layout-restart (defun cam-layout-restart () (cam-layout-stop) (cam-layout-start) diff --git a/goal_src/jak2/engine/camera/cam-update.gc b/goal_src/jak2/engine/camera/cam-update.gc index 6ab05e6eaf..da56d7ef99 100644 --- a/goal_src/jak2/engine/camera/cam-update.gc +++ b/goal_src/jak2/engine/camera/cam-update.gc @@ -224,20 +224,20 @@ (set! (-> a3-6 quad) (-> s5-2 bsp bsp-offset quad)) (cond ((zero? (-> s5-2 bsp cam-using-back)) - (+! (-> a2-9 x) (the float (* (the-as int (-> v1-107 front-box-min x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a2-9 y) (the float (* (the-as int (-> v1-107 front-box-min y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a2-9 z) (the float (* (the-as int (-> v1-107 front-box-min z)) (the int (-> s5-2 bsp bsp-scale z))))) - (+! (-> a3-6 x) (the float (* (the-as int (-> v1-107 front-box-max x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a3-6 y) (the float (* (the-as int (-> v1-107 front-box-max y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a3-6 z) (the float (* (the-as int (-> v1-107 front-box-max z)) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a2-9 x) (the float (* (-> v1-107 front-box-min x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a2-9 y) (the float (* (-> v1-107 front-box-min y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a2-9 z) (the float (* (-> v1-107 front-box-min z) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a3-6 x) (the float (* (-> v1-107 front-box-max x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a3-6 y) (the float (* (-> v1-107 front-box-max y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a3-6 z) (the float (* (-> v1-107 front-box-max z) (the int (-> s5-2 bsp bsp-scale z))))) ) (else - (+! (-> a2-9 x) (the float (* (the-as int (-> v1-107 back-box-min x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a2-9 y) (the float (* (the-as int (-> v1-107 back-box-min y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a2-9 z) (the float (* (the-as int (-> v1-107 back-box-min z)) (the int (-> s5-2 bsp bsp-scale z))))) - (+! (-> a3-6 x) (the float (* (the-as int (-> v1-107 back-box-max x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a3-6 y) (the float (* (the-as int (-> v1-107 back-box-max y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a3-6 z) (the float (* (the-as int (-> v1-107 back-box-max z)) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a2-9 x) (the float (* (-> v1-107 back-box-min x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a2-9 y) (the float (* (-> v1-107 back-box-min y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a2-9 z) (the float (* (-> v1-107 back-box-min z) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a3-6 x) (the float (* (-> v1-107 back-box-max x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a3-6 y) (the float (* (-> v1-107 back-box-max y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a3-6 z) (the float (* (-> v1-107 back-box-max z) (the int (-> s5-2 bsp bsp-scale z))))) ) ) (add-debug-box #t (bucket-id debug2) a2-9 a3-6 (new 'static 'rgba :g #xff :b #xff :a #x80)) diff --git a/goal_src/jak2/engine/collide/collide-shape-rider.gc b/goal_src/jak2/engine/collide/collide-shape-rider.gc index eaaa9858a4..b78a0779b1 100644 --- a/goal_src/jak2/engine/collide/collide-shape-rider.gc +++ b/goal_src/jak2/engine/collide/collide-shape-rider.gc @@ -7,7 +7,6 @@ ;; DECOMP BEGINS -;; definition for method 39 of type collide-shape (defmethod on-platform collide-shape ((obj collide-shape) (arg0 collide-shape) (arg1 collide-query)) (let ((v1-0 arg1)) (set! (-> v1-0 best-dist) 0.0) @@ -38,20 +37,17 @@ (< (-> arg1 best-dist) 122.88) ) -;; definition for method 17 of type collide-shape-prim ;; WARN: Return type mismatch object vs none. (defmethod on-platform-test collide-shape-prim ((obj collide-shape-prim) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (format 0 "ERROR: collide-shape-prim::on-platform-test was called illegally!~%") (none) ) -;; definition for method 17 of type collide-shape-prim-group -;; WARN: Return type mismatch int vs none. (defmethod on-platform-test collide-shape-prim-group ((obj collide-shape-prim-group) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (let ((s4-0 (-> arg0 prim-core collide-as)) (s3-0 (-> obj child 0)) ) - (countdown (s2-0 (the-as uint (-> obj num-children))) + (countdown (s2-0 (-> obj num-children)) (when (and (logtest? (-> s3-0 prim-core collide-with) s4-0) (logtest? (-> s3-0 prim-core action) (collide-action rideable)) ) @@ -74,8 +70,6 @@ (none) ) -;; definition for method 17 of type collide-shape-prim-mesh -;; INFO: Used lq/sq ;; WARN: Return type mismatch pat-surface vs none. (defmethod on-platform-test collide-shape-prim-mesh ((obj collide-shape-prim-mesh) (arg0 collide-shape-prim) (arg1 collide-query) (arg2 float)) (case (-> arg0 type) @@ -141,7 +135,6 @@ (none) ) -;; definition for method 9 of type collide-rider-pool (defmethod add-rider collide-rider-pool ((obj collide-rider-pool) (arg0 handle)) (let ((v1-0 (-> obj alloc-count))) (cond @@ -161,7 +154,6 @@ ) ) -;; definition for method 35 of type collide-shape ;; WARN: Return type mismatch joint-control-status vs symbol. (defmethod detect-riders! collide-shape ((obj collide-shape)) (local-vars (v0-7 joint-control-status) (a2-5 float) (a2-12 float)) @@ -319,7 +311,6 @@ ) ) -;; definition for method 44 of type collide-shape ;; WARN: Return type mismatch int vs symbol. (defmethod pull-riders! collide-shape ((obj collide-shape)) (let ((s5-0 (-> obj riders))) @@ -355,8 +346,6 @@ (the-as symbol 0) ) -;; definition for method 43 of type collide-shape -;; INFO: Used lq/sq ;; WARN: Return type mismatch object vs none. (defmethod pull-rider! collide-shape ((obj collide-shape) (arg0 pull-rider-info)) (local-vars (at-0 int)) @@ -438,7 +427,3 @@ ) ) ) - - - - diff --git a/goal_src/jak2/engine/common_objs/plat.gc b/goal_src/jak2/engine/common_objs/plat.gc index bbf6a9261f..83900185b2 100644 --- a/goal_src/jak2/engine/common_objs/plat.gc +++ b/goal_src/jak2/engine/common_objs/plat.gc @@ -272,15 +272,7 @@ ) :trans (the-as (function none :behavior drop-plat) plat-trans) :code (behavior () - (gui-control-method-9 - *gui-control* - self - (gui-channel art-load) - (gui-action queue) - (-> self anim name) - -99.0 - 0 - ) + (add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0) (until #f (when (not (-> self bouncing)) (logior! (-> self mask) (process-mask sleep-code)) diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index 00450f713b..f22af253e7 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -125,7 +125,7 @@ (format (clear *temp-string*) "region-~D~%" (-> obj id)) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) (when (>= arg1 1) (let ((s4-1 (-> obj on-enter))) (when s4-1 @@ -136,7 +136,7 @@ (format (clear *temp-string*) "(on-enter ~S)" s4-1) (s3-1 s2-1 (the-as bucket-id s1-1) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((s4-2 (-> obj on-inside))) @@ -148,7 +148,7 @@ (format (clear *temp-string*) "(on-inside ~S)" s4-2) (s3-2 s2-2 (the-as bucket-id s1-2) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((s5-1 (-> obj on-exit))) @@ -160,7 +160,7 @@ (format (clear *temp-string*) "(on-exit ~S)" s5-1) (s4-3 s3-3 (the-as bucket-id s2-3) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) ) diff --git a/goal_src/jak2/engine/game/fact-h.gc b/goal_src/jak2/engine/game/fact-h.gc index 29ce807ed8..409e9a45bb 100644 --- a/goal_src/jak2/engine/game/fact-h.gc +++ b/goal_src/jak2/engine/game/fact-h.gc @@ -368,7 +368,7 @@ :flag-assert #xd00000110 (:methods (new (symbol type process-drawable pickup-type float) _type_ 0) - (get-gun-ammo (_type_ target) float 12) + (get-gun-ammo (_type_) float 12) ) ) diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 494b28bd8a..2424d5522b 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -315,7 +315,7 @@ (race-total-lap-count int32 :offset-assert 508) (race-position int32 :offset-assert 512) (race-number-turbos int32 :offset-assert 516) - (bot-health uint32 3 :offset-assert 520) + (bot-health float 3 :offset-assert 520) (demo-state uint32 :offset-assert 532) (wanted-flash basic :offset-assert 536) (distance float :offset-assert 540) diff --git a/goal_src/jak2/engine/game/game-info.gc b/goal_src/jak2/engine/game/game-info.gc index ff7576bbd6..bccd6c3e2e 100644 --- a/goal_src/jak2/engine/game/game-info.gc +++ b/goal_src/jak2/engine/game/game-info.gc @@ -886,24 +886,21 @@ (let ((s3-0 (new 'stack-no-clear 'vector4w))) (set! (-> s3-0 quad) (the-as uint128 0)) (when (transform-point-qword! s3-0 (the-as vector arg0)) - (let ((s5-0 - (new - 'stack - 'font-context - *font-default-matrix* - (+ (the int (/ (the float (+ (/ (the-as int (-> s3-0 x)) 16) -1792)) (-> *video-params* relative-x-scale))) - -48 - ) - (the-as int (+ (/ (the-as int (-> s3-0 y)) 16) -1855)) - 0.0 - (font-color gold-#ba9200) - (font-flags shadow kerning) - ) - ) + (let ((s5-0 (new + 'stack + 'font-context + *font-default-matrix* + (+ (the int (/ (the float (+ (/ (-> s3-0 x) 16) -1792)) (-> *video-params* relative-x-scale))) -48) + (+ (/ (-> s3-0 y) 16) -1855) + 0.0 + (font-color gold-#ba9200) + (font-flags shadow kerning) + ) + ) ) (set! (-> s5-0 scale) (lerp-scale 0.6 1.0 (the-as float arg1) 50.0 8000.0)) (let ((v1-9 s5-0)) - (set! (-> v1-9 origin z) (the float (/ (the-as int (-> s3-0 z)) 16))) + (set! (-> v1-9 origin z) (the float (/ (-> s3-0 z) 16))) ) (set! (-> s5-0 flags) (font-flags shadow kerning large)) (let ((s3-1 (-> self clock frame-counter))) diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index e7c5c3dbd6..757a561ba3 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -1624,7 +1624,7 @@ (notify handle :offset-assert 456) (force symbol :offset-assert 464) (state-time time-frame :offset-assert 472) - (icon hud-sprite :inline :offset-assert 480) + (icon hud-sprite :inline :offset 480) ) :heap-base #x1a0 :method-count-assert 23 @@ -1714,7 +1714,7 @@ (with-dma-buffer-add-bucket ((s5-3 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (hud-sprite-method-9 (-> self icon) s5-3 (-> self level)) + (draw (-> self icon) s5-3 (-> self level)) ) ) ) @@ -1757,7 +1757,12 @@ auto-save-post ) ) (set! (-> *setting-control* user-default auto-save) #f) - (set-vector! (-> self icon color) 128 128 128 128) + (let ((v1-51 (-> self icon color2))) + (set! (-> v1-51 0) 128) + (set! (-> v1-51 1) 128) + (set! (-> v1-51 2) 128) + (set! (-> v1-51 3) 128) + ) (set! (-> self icon pos x) 440) (set! (-> self icon pos y) 200) (set! (-> self icon pos z) #xffffff) diff --git a/goal_src/jak2/engine/game/task/task-control.gc b/goal_src/jak2/engine/game/task/task-control.gc index 887e4f046d..4feea34a96 100644 --- a/goal_src/jak2/engine/game/task/task-control.gc +++ b/goal_src/jak2/engine/game/task/task-control.gc @@ -1415,7 +1415,7 @@ (defmethod print-text fail-mission ((obj fail-mission)) (when (and (not (logtest? (-> obj flags) (fail-mission-flags famflags-6))) - (= (gui-control-method-17 *gui-control* (the-as sound-id (-> obj message-id))) (gui-action playing)) + (= (get-status *gui-control* (the-as sound-id (-> obj message-id))) (gui-status active)) ) (let ((gp-0 (new 'stack @@ -1748,7 +1748,7 @@ (set! (-> self fail-message) (the-as uint (-> arg0 fail-message))) (set-setting! 'allow-continue #f 0 0) (set-setting! 'minimap 'clear 0 128) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -1758,7 +1758,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -1771,10 +1771,7 @@ (when (not (logtest? (-> arg0 flags) (fail-mission-flags famflags-4))) (if (not (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) (zero? (-> self message)))) (set! (-> self stinger) - (the-as - uint - (gui-control-method-9 *gui-control* *target* (gui-channel background) (gui-action play) "lose1" -99.0 0) - ) + (the-as uint (add-process *gui-control* *target* (gui-channel background) (gui-action play) "lose1" -99.0 0)) ) ) ) @@ -1788,10 +1785,7 @@ (= (-> self message) (fail-mission-message fammsg-1)) ) (set! (-> self message-id) - (the-as - uint - (gui-control-method-9 *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0) - ) + (the-as uint (add-process *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0)) ) ) (go-virtual idle) diff --git a/goal_src/jak2/engine/gfx/foreground/foreground.gc b/goal_src/jak2/engine/gfx/foreground/foreground.gc index be7abad112..0084682c45 100644 --- a/goal_src/jak2/engine/gfx/foreground/foreground.gc +++ b/goal_src/jak2/engine/gfx/foreground/foreground.gc @@ -13,6 +13,12 @@ ) +;; todo hack +(defun foreground-draw-hud ((a draw-control) (b dma-buffer) (c float)) + (none) + ) + + ;; DECOMP BEGINS (define foreground-vu0-block (new 'static 'vu-function :length 9 :qlength 5)) diff --git a/goal_src/jak2/engine/gfx/lights.gc b/goal_src/jak2/engine/gfx/lights.gc index dde8d6b89c..fa0f022ec7 100644 --- a/goal_src/jak2/engine/gfx/lights.gc +++ b/goal_src/jak2/engine/gfx/lights.gc @@ -48,6 +48,7 @@ arg0 ) +;; WARN: Return type mismatch pointer vs none. (defun-debug init-light-hash () (when (not *light-hash*) (set! *light-hash* (new 'loading-level 'light-hash)) @@ -65,16 +66,10 @@ (init-light-hash) -;; definition (debug) for function light-hash-count-items -;; ERROR: function was not converted to expressions. Cannot decompile. (def-mips2c light-hash-count-items (function light-hash light-sphere none)) - -;; definition (debug) for function light-hash-add-items -;; ERROR: function was not converted to expressions. Cannot decompile. (def-mips2c light-hash-add-items (function light-hash light-sphere integer object)) - (defun-debug reset-light-hash ((arg0 light-hash)) (set! (-> *light-hash* num-lights) (the-as uint 0)) (set! (-> *light-hash* num-indices) (the-as uint 0)) @@ -120,9 +115,7 @@ (set! (-> arg0 dimension-array z) (max 1 (min 16 (the int (+ 0.5 (* f0-5 (-> s4-0 z))))))) ) ) - (set! (-> arg0 bucket-step 0) - (the-as uint (* (the-as int (-> arg0 dimension-array z)) (the-as int (-> arg0 dimension-array x)))) - ) + (set! (-> arg0 bucket-step 0) (the-as uint (* (-> arg0 dimension-array z) (-> arg0 dimension-array x)))) (set! (-> arg0 bucket-step 1) (the-as uint (-> arg0 dimension-array x))) (dotimes (v1-13 3) (set! (-> arg0 axis-scale data v1-13) @@ -131,10 +124,7 @@ ) ) (set! (-> arg0 num-buckets) - (the-as uint (* (* (the-as int (-> arg0 dimension-array x)) (the-as int (-> arg0 dimension-array y))) - (the-as int (-> arg0 dimension-array z)) - ) - ) + (the-as uint (* (* (-> arg0 dimension-array x) (-> arg0 dimension-array y)) (-> arg0 dimension-array z))) ) (dotimes (v1-19 (the-as int (-> arg0 num-buckets))) (let ((a0-27 (-> arg0 bucket-array v1-19))) @@ -179,10 +169,4 @@ (def-mips2c light-hash-get-bucket-index (function light-hash vector int)) -;; definition for function add-light-sphere-to-light-group -;; ERROR: function was not converted to expressions. Cannot decompile. (def-mips2c add-light-sphere-to-light-group (function object object object object object)) - - - - diff --git a/goal_src/jak2/engine/level/region.gc b/goal_src/jak2/engine/level/region.gc index 79d34e8ca6..de77e5be6f 100644 --- a/goal_src/jak2/engine/level/region.gc +++ b/goal_src/jak2/engine/level/region.gc @@ -96,7 +96,7 @@ (format (clear *temp-string*) "region-~D~%" (-> obj region id)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) (let ((s5-1 (-> obj region on-enter))) (when s5-1 (let ((s4-1 add-debug-text-3d) @@ -106,7 +106,7 @@ (format (clear *temp-string*) "(on-enter ~S)" s5-1) (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((s5-2 (-> obj region on-inside))) @@ -118,7 +118,7 @@ (format (clear *temp-string*) "(on-inside ~S)" s5-2) (s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((gp-1 (-> obj region on-exit))) @@ -130,7 +130,7 @@ (format (clear *temp-string*) "(on-exit ~S)" gp-1) (s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) ) diff --git a/goal_src/jak2/engine/load/loader.gc b/goal_src/jak2/engine/load/loader.gc index c4f1c343ba..bcb486fb8f 100644 --- a/goal_src/jak2/engine/load/loader.gc +++ b/goal_src/jak2/engine/load/loader.gc @@ -802,7 +802,7 @@ (set! (-> s5-0 paused?) #f) ) (let ((v1-7 - (gui-control-method-15 *gui-control* self (gui-channel art-load) (-> gp-0 anim name) (new 'static 'sound-id)) + (lookup-gui-connection *gui-control* self (gui-channel art-load) (-> gp-0 anim name) (new 'static 'sound-id)) ) ) (if v1-7 @@ -817,7 +817,7 @@ (talker-surpress!) (apply-settings *setting-control*) (when (or (and (-> *setting-control* user-current spooling) - (or (< 2 (the-as int (-> gp-0 anim parts))) + (or (< 2 (-> gp-0 anim parts)) (not (string= (-> *setting-control* user-current spool-anim name) (-> gp-0 anim name))) ) ) @@ -836,7 +836,7 @@ ) ) (while (or (and (-> *setting-control* user-current spooling) - (or (< 2 (the-as int (-> gp-0 anim parts))) + (or (< 2 (-> gp-0 anim parts)) (not (string= (-> *setting-control* user-current spool-anim name) (-> gp-0 anim name))) ) ) @@ -867,7 +867,7 @@ (set-setting! 'spool-anim (-> gp-0 anim) 0 0) (apply-settings *setting-control*) (set! (-> gp-0 old-time) (-> self clock frame-counter)) - (while (< (-> gp-0 part) (the-as int (-> gp-0 anim parts))) + (while (< (-> gp-0 part) (-> gp-0 anim parts)) (when (> (-> gp-0 part) 0) (while (let ((v1-99 (file-status *art-control* (-> gp-0 anim name) (-> gp-0 part)))) (not (or (= v1-99 'active) (= v1-99 'locked))) @@ -1033,7 +1033,7 @@ -20.0 (-> gp-0 sid) ) - (if (< (+ (-> gp-0 part) 1) (the-as int (-> gp-0 anim parts))) + (if (< (+ (-> gp-0 part) 1) (-> gp-0 anim parts)) (gui-control-method-12 *gui-control* self @@ -1099,7 +1099,7 @@ (defbehavior ja-abort-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 int)) (let ((s3-0 (new 'static 'sound-id))) (let ((v1-1 - (gui-control-method-15 *gui-control* self (gui-channel art-load) (-> arg0 name) (new 'static 'sound-id)) + (lookup-gui-connection *gui-control* self (gui-channel art-load) (-> arg0 name) (new 'static 'sound-id)) ) ) (when v1-1 @@ -1339,28 +1339,28 @@ (let ((s5-0 format) (s4-0 #t) (s3-0 " ~6S <@ #x~A>") - (v1-3 (gui-control-method-17 *gui-control* (-> obj id))) + (v1-3 (get-status *gui-control* (-> obj id))) ) (s5-0 s4-0 s3-0 (cond - ((= v1-3 (gui-action play)) + ((= v1-3 (gui-status ready)) "ready" ) - ((= v1-3 (gui-action playing)) + ((= v1-3 (gui-status active)) "active" ) - ((= v1-3 (gui-action stopping)) + ((= v1-3 (gui-status stop)) "stop" ) - ((= v1-3 (gui-action none)) + ((= v1-3 (gui-status unknown)) "unknown" ) - ((= v1-3 (gui-action stop)) + ((= v1-3 (gui-status hide)) "hide" ) - ((= v1-3 (gui-action queue)) + ((= v1-3 (gui-status pending)) "pending" ) (else @@ -1378,7 +1378,7 @@ 0 ) -(defmethod gui-control-method-15 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) +(defmethod lookup-gui-connection gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) (let ((s1-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) (let ((s0-0 (-> s1-0 next0))) @@ -1412,7 +1412,7 @@ (the-as gui-connection #f) ) -(defmethod gui-control-method-14 gui-control ((obj gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) +(defmethod lookup-gui-connection-id gui-control ((obj gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) (let ((s2-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) (let ((s1-0 (-> s2-0 next0))) @@ -1443,23 +1443,23 @@ 0 ) -(defmethod gui-control-method-20 gui-control ((obj gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) +(defmethod set-falloff! gui-control ((obj gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) (when (nonzero? arg0) - (let ((v1-2 (gui-control-method-15 *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) + (let ((v1-2 (lookup-gui-connection *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) (when v1-2 (if arg1 - (logior! (-> v1-2 flags) 2) + (logior! (-> v1-2 flags) (gui-connection-flags gcf1)) ) (when (>= arg2 0) - (logior! (-> v1-2 flags) 8) + (logior! (-> v1-2 flags) (gui-connection-flags fo-min)) (set! (-> v1-2 fo-min) arg2) ) (when (>= arg3 0) - (logior! (-> v1-2 flags) 16) + (logior! (-> v1-2 flags) (gui-connection-flags fo-max)) (set! (-> v1-2 fo-max) arg3) ) (when (>= arg4 0) - (logior! (-> v1-2 flags) 4) + (logior! (-> v1-2 flags) (gui-connection-flags fo-curve)) (set! (-> v1-2 fo-curve) arg4) ) v1-2 @@ -1491,21 +1491,21 @@ ) ) -(defmethod gui-control-method-23 gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) +(defmethod handle-command gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) (let ((s5-0 (-> obj ids arg1))) (cond ((nonzero? s5-0) (case arg2 (('wait) - (if (nonzero? (gui-control-method-17 obj s5-0)) + (if (nonzero? (get-status obj s5-0)) (return #f) ) ) (('stop 'priority-stop) (when (nonzero? (-> obj ids arg1)) - (let ((s2-0 (gui-control-method-15 obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (let ((s2-0 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and s2-0 (or (= arg2 'priority) (= s2-0 arg3) (and arg3 (< (-> arg3 priority) (-> s2-0 priority))))) - (gui-control-method-11 obj s2-0) + (stop-str obj s2-0) (cond ((= (shr (the-as int arg1) 4) 5) (set! (-> obj times arg1) @@ -1523,14 +1523,14 @@ ) ) ) - (if (nonzero? (gui-control-method-17 obj s5-0)) + (if (nonzero? (get-status obj s5-0)) (return #f) ) ) (('hide) - (let ((v1-34 (gui-control-method-15 obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (let ((v1-34 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and v1-34 (!= (-> v1-34 action) 8)) - (gui-control-method-16 + (set-action! obj (gui-action hide) s5-0 @@ -1545,7 +1545,7 @@ ) ) ) - (if (nonzero? (gui-control-method-17 obj s5-0)) + (if (nonzero? (get-status obj s5-0)) (return #f) ) ) @@ -1561,7 +1561,7 @@ #t ) -(defmethod gui-control-method-19 gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-connection)) +(defmethod handle-command-list gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-connection)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((gp-0 #t)) (cond @@ -1581,7 +1581,7 @@ (let ((s0-0 80)) (set! sv-16 90) (while (>= (the-as uint sv-16) (the-as uint s0-0)) - (if (not (gui-control-method-23 obj arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-0 1) @@ -1592,7 +1592,7 @@ (let ((s0-1 66)) (set! sv-32 70) (while (>= (the-as uint sv-32) (the-as uint s0-1)) - (if (not (gui-control-method-23 obj arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-1 1) @@ -1603,7 +1603,7 @@ (let ((s0-2 18)) (set! sv-48 32) (while (>= (the-as uint sv-48) (the-as uint s0-2)) - (if (not (gui-control-method-23 obj arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-2 1) @@ -1611,7 +1611,7 @@ ) ) (else - (if (not (gui-control-method-23 obj arg0 a2-1 (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 a2-1 (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) ) @@ -1627,11 +1627,11 @@ ) ) -;; WARN: Return type mismatch int vs gui-action. -(defmethod gui-control-method-17 gui-control ((obj gui-control) (arg0 sound-id)) +;; WARN: Return type mismatch int vs gui-status. +(defmethod get-status gui-control ((obj gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) - (return (gui-action none)) + (return (gui-status unknown)) ) (let ((v1-4 (-> obj engine alive-list next0))) (-> obj engine) @@ -1658,14 +1658,14 @@ ) (label cfg-15) (the-as - gui-action + gui-status (cond ((= (-> gp-0 channel) (gui-channel movie)) (cond ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) 3 ) - ((gui-control-method-19 obj (-> gp-0 channel) gp-0) + ((handle-command-list obj (-> gp-0 channel) gp-0) 2 ) (else @@ -1693,16 +1693,16 @@ ) (cond ((logtest? (-> *sound-iop-info* stream-status s4-0) (stream-status ststatus-four)) - (return (gui-action playing)) + (return (gui-status active)) ) ((logtest? (-> *sound-iop-info* stream-status s4-0) (stream-status ststatus-nine)) - (return (gui-action stopping)) + (return (gui-status stop)) ) - ((or (= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) (gui-control-method-19 obj (-> gp-0 channel) gp-0)) - (return (gui-action play)) + ((or (= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) (handle-command-list obj (-> gp-0 channel) gp-0)) + (return (gui-status ready)) ) (else - (return (gui-action queue)) + (return (gui-status pending)) ) ) (the-as none 0) @@ -1728,7 +1728,7 @@ 3 ) ) - ((gui-control-method-19 obj (-> gp-0 channel) gp-0) + ((handle-command-list obj (-> gp-0 channel) gp-0) 2 ) (else @@ -1743,7 +1743,7 @@ ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) 3 ) - ((gui-control-method-19 obj (-> gp-0 channel) gp-0) + ((handle-command-list obj (-> gp-0 channel) gp-0) 2 ) (else @@ -1761,15 +1761,15 @@ ) ) -(defmethod gui-control-method-16 gui-control ((obj gui-control) - (arg0 gui-action) - (arg1 sound-id) - (arg2 gui-channel) - (arg3 gui-action) - (arg4 string) - (arg5 (function gui-connection symbol)) - (arg6 process) - ) +(defmethod set-action! gui-control ((obj gui-control) + (arg0 gui-action) + (arg1 sound-id) + (arg2 gui-channel) + (arg3 gui-action) + (arg4 string) + (arg5 (function gui-connection symbol)) + (arg6 process) + ) (local-vars (sv-16 gui-action) (sv-17 gui-action) (sv-20 string) (sv-24 (function gui-connection symbol))) (set! sv-16 arg0) (set! sv-17 arg3) @@ -1794,7 +1794,7 @@ ) (else (set! (-> s1-0 action) sv-16) - (if (and (= sv-16 'play) (gui-control-method-19 obj (-> s1-0 channel) s1-0)) + (if (and (= sv-16 'play) (handle-command-list obj (-> s1-0 channel) s1-0)) (channel-id-set! obj s1-0 (-> s1-0 id)) ) ) @@ -1810,14 +1810,14 @@ ) ;; WARN: Return type mismatch int vs sound-id. -(defmethod gui-control-method-9 gui-control ((obj gui-control) - (arg0 process) - (arg1 gui-channel) - (arg2 gui-action) - (arg3 string) - (arg4 float) - (arg5 time-frame) - ) +(defmethod add-process gui-control ((obj gui-control) + (arg0 process) + (arg1 gui-channel) + (arg2 gui-action) + (arg3 string) + (arg4 float) + (arg5 time-frame) + ) (local-vars (sv-16 int) (sv-20 gui-connection) @@ -1870,7 +1870,7 @@ (set! (-> sv-32 action) arg2) (set! (-> sv-32 param2) (the-as int arg3)) (set! (-> sv-32 hold-time) arg5) - (set! (-> sv-32 flags) (the-as uint 1)) + (set! (-> sv-32 flags) (gui-connection-flags gcf0)) (set! (-> sv-32 fade) (the-as uint 0)) (the-as int (-> (the-as gui-connection sv-32) id)) ) @@ -1882,7 +1882,7 @@ ) ) -(defmethod gui-control-method-10 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) +(defmethod remove-process gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) (let ((s2-0 (-> s3-0 next0))) @@ -1946,7 +1946,7 @@ (when (or (zero? (-> a0-15 id)) (not (handle->process (-> a0-15 handle)))) (set! sv-16 a0-15) (set! (-> sv-16 param3) 0) - (set! (-> sv-16 flags) (the-as uint 0)) + (set! (-> sv-16 flags) (gui-connection-flags)) (goto cfg-44) ) ) @@ -1956,7 +1956,7 @@ (sv-16 (when (zero? (-> (the-as gui-connection sv-16) id)) (when (zero? sv-20) - (let ((v1-46 (gui-control-method-15 obj arg0 arg1 arg3 (new 'static 'sound-id)))) + (let ((v1-46 (lookup-gui-connection obj arg0 arg1 arg3 (new 'static 'sound-id)))) (if v1-46 (set! sv-20 (the-as int (-> v1-46 id))) ) @@ -2072,10 +2072,10 @@ 0 ) -(defmethod gui-control-method-11 gui-control ((obj gui-control) (arg0 gui-connection)) +(defmethod stop-str gui-control ((obj gui-control) (arg0 gui-connection)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) - (if (= (gui-control-method-17 obj (-> arg0 id)) (gui-action playing)) + (if (= (get-status obj (-> arg0 id)) (gui-status active)) (str-play-stop (-> arg0 name) (-> arg0 id)) ) ) @@ -2095,7 +2095,9 @@ (case (-> arg0 action) (((gui-action queue)) (spool-push *art-control* (-> arg0 name) (the-as int (-> arg0 anim-part)) arg1 (-> arg0 priority)) - (if (and (logtest? (-> arg0 flags) 1) (= (gui-control-method-17 obj (-> arg0 id)) (gui-action playing))) + (if (and (logtest? (-> arg0 flags) (gui-connection-flags gcf0)) + (= (get-status obj (-> arg0 id)) (gui-status active)) + ) (set! (-> arg0 action) (gui-action playing)) ) ) @@ -2103,13 +2105,11 @@ ) (let ((v1-16 (-> arg0 action))) (b! (!= v1-16 (gui-action play)) cfg-39 :delay (empty-form)) - (if (gui-control-method-19 obj (-> arg0 channel) arg0) + (if (handle-command-list obj (-> arg0 channel) arg0) (channel-id-set! obj arg0 (-> arg0 id)) ) (b! - (not (or (not (gui-control-method-18 obj (-> arg0 channel))) - (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping)) - ) + (not (or (not (gui-control-method-18 obj (-> arg0 channel))) (= (get-status obj (-> arg0 id)) (gui-status stop))) ) cfg-27 :delay (empty-form) @@ -2118,7 +2118,7 @@ (channel-id-set! obj arg0 (new 'static 'sound-id)) ) (if (and arg2 (or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping)) + (= (get-status obj (-> arg0 id)) (gui-status stop)) ) ) (move-to-dead arg0) @@ -2128,8 +2128,8 @@ (let ((v1-40 (-> arg0 id))) (b! (!= (-> obj ids (-> arg0 channel)) v1-40) cfg-38 :delay (empty-form)) ) - (let ((v1-43 (gui-control-method-17 obj (-> arg0 id)))) - (b! (!= v1-43 (gui-action play)) cfg-36 :delay (empty-form)) + (let ((v1-43 (get-status obj (-> arg0 id)))) + (b! (!= v1-43 (gui-status ready)) cfg-36 :delay (empty-form)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) (if (not (paused?)) @@ -2139,7 +2139,7 @@ ) (b! #t cfg-38 :delay (nop!)) (label cfg-36) - (b! (!= v1-43 (gui-action playing)) cfg-38 :delay (empty-form)) + (b! (!= v1-43 (gui-status active)) cfg-38 :delay (empty-form)) ) (set! (-> arg0 action) (gui-action playing)) (label cfg-38) @@ -2147,7 +2147,7 @@ (label cfg-39) (b! (not (or (= v1-16 (gui-action playing)) (= v1-16 (gui-action fade)))) cfg-117 :delay (empty-form)) (b! - (not (and (= (gui-control-method-17 obj (-> arg0 id)) (gui-action playing)) + (not (and (= (get-status obj (-> arg0 id)) (gui-status active)) (gui-control-method-18 obj (-> arg0 channel)) (or (= (-> arg0 action) (gui-action playing)) (< (-> arg0 fade) (the-as uint 30))) ) @@ -2182,7 +2182,9 @@ (label cfg-73) (cond ((not v1-66) - (when (and (logtest? (-> arg0 flags) 30) (logtest? (-> arg0 flags) 1)) + (when (and (logtest? (-> arg0 flags) (gui-connection-flags gcf1 fo-curve fo-min fo-max)) + (logtest? (-> arg0 flags) (gui-connection-flags gcf0)) + ) (let* ((s5-1 (get-process arg0)) (s4-1 (if (type? s5-1 process-drawable) s5-1 @@ -2209,16 +2211,16 @@ (set! (-> s5-2 params fo-min) (-> arg0 fo-min)) (set! (-> s5-2 params fo-max) (-> arg0 fo-max)) (set! (-> s5-2 params mask) (the-as uint 0)) - (if (logtest? (-> arg0 flags) 2) + (if (logtest? (-> arg0 flags) (gui-connection-flags gcf1)) (logior! (-> s5-2 params mask) 32) ) - (if (logtest? (-> arg0 flags) 4) + (if (logtest? (-> arg0 flags) (gui-connection-flags fo-curve)) (logior! (-> s5-2 params mask) 256) ) - (if (logtest? (-> arg0 flags) 8) + (if (logtest? (-> arg0 flags) (gui-connection-flags fo-min)) (logior! (-> s5-2 params mask) 64) ) - (if (logtest? (-> arg0 flags) 16) + (if (logtest? (-> arg0 flags) (gui-connection-flags fo-max)) (logior! (-> s5-2 params mask) 128) ) ) @@ -2249,7 +2251,7 @@ (let ((a0-75 (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)))) (b! a0-75 cfg-113 :likely-delay (set! v1-143 a0-75)) ) - (set! v1-143 (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping))) + (set! v1-143 (= (get-status obj (-> arg0 id)) (gui-status stop))) (label cfg-113) (if v1-143 (move-to-dead arg0) @@ -2260,7 +2262,7 @@ (b! #t cfg-139 :delay (nop!)) (label cfg-117) (b! (!= v1-16 (gui-action stop)) cfg-121 :delay (empty-form)) - (gui-control-method-11 obj arg0) + (stop-str obj arg0) (if arg2 (move-to-dead arg0) ) @@ -2280,9 +2282,9 @@ ((= v1-16 (gui-action hidden)) (cond ((or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping)) + (= (get-status obj (-> arg0 id)) (gui-status stop)) ) - (gui-control-method-11 obj arg0) + (stop-str obj arg0) (if arg2 (move-to-dead arg0) ) @@ -2302,7 +2304,6 @@ ) ) - (defmethod update gui-control ((obj gui-control) (arg0 symbol)) (set! (-> obj ids 65) (the-as sound-id (if (and (>= (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) diff --git a/goal_src/jak2/engine/nav/nav-control.gc b/goal_src/jak2/engine/nav/nav-control.gc index 0452f4a72c..94475f81a5 100644 --- a/goal_src/jak2/engine/nav/nav-control.gc +++ b/goal_src/jak2/engine/nav/nav-control.gc @@ -7,13 +7,10 @@ ;; DECOMP BEGINS -;; definition for symbol *nav-triangle-test-count*, type int (define *nav-triangle-test-count* 0) -;; definition for symbol *nav-last-triangle-test-count*, type int (define *nav-last-triangle-test-count* 0) -;; definition for function debug-nav-validate-current-poly (defun debug-nav-validate-current-poly ((arg0 nav-mesh) (arg1 nav-poly) (arg2 vector)) (local-vars (sv-32 vector) (sv-36 float)) (when (not (point-in-poly? arg0 arg1 arg2)) @@ -24,23 +21,18 @@ ) ) -;; definition for function debug-report-nav-stats -;; WARN: Return type mismatch int vs none. (defun debug-report-nav-stats () "Does nothing" 0 (none) ) -;; definition for method 7 of type nav-control (defmethod relocate nav-control ((obj nav-control) (arg0 int)) (&+! (-> obj process) arg0) (&+! (-> obj shape) arg0) obj ) -;; definition for method 41 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod remove! nav-control ((obj nav-control)) "Remove this nav-control from the nav-mesh it belongs to." (remove-nav-control (-> obj state mesh) obj) @@ -48,8 +40,6 @@ (none) ) -;; definition for method 28 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod enable-extra-sphere! nav-control ((obj nav-control)) "Sets a flag indicating that this nav-control has an extra-nav-sphere." (logior! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) @@ -57,8 +47,6 @@ (none) ) -;; definition for method 29 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod disable-extra-sphere! nav-control ((obj nav-control)) "Clears a flag indicating that this nav-control has an extra-nav-sphere." (logclear! (-> obj shape nav-flags) (nav-flags has-extra-sphere)) @@ -66,8 +54,6 @@ (none) ) -;; definition for method 30 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod copy-extra-nav-sphere! nav-control ((obj nav-control) (arg0 sphere)) "Copies the given [[sphere]] into `extra-nav-sphere`" (mem-copy! (the-as pointer (-> obj extra-nav-sphere)) (the-as pointer arg0) 16) @@ -75,9 +61,6 @@ (none) ) -;; definition for method 31 of type nav-control -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod set-extra-nav-sphere-xyz! nav-control ((obj nav-control) (arg0 sphere)) "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (let ((f0-0 (-> obj extra-nav-sphere w))) @@ -88,8 +71,6 @@ (none) ) -;; definition for method 32 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-extra-nav-sphere-radius! nav-control ((obj nav-control) (arg0 float)) "Set's `extra-nav-sphere`'s radius" (set! (-> obj extra-nav-sphere w) arg0) @@ -97,8 +78,6 @@ (none) ) -;; definition for method 33 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-nearest-y-thres! nav-control ((obj nav-control) (arg0 float)) "Set `nearest-y-threshold`" (set! (-> obj nearest-y-threshold) arg0) @@ -106,8 +85,6 @@ (none) ) -;; definition for method 34 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-nav-cull-radius! nav-control ((obj nav-control) (arg0 meters)) "Set `nav-cull-radius`" (set! (-> obj nav-cull-radius) arg0) @@ -115,8 +92,6 @@ (none) ) -;; definition for method 35 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-speed-scale! nav-control ((obj nav-control) (arg0 float)) "Set `speed-scale`" (set! (-> obj speed-scale) arg0) @@ -124,8 +99,6 @@ (none) ) -;; definition for method 36 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-target-speed! nav-control ((obj nav-control) (arg0 meters)) "Set `target-speed`" (set! (-> obj target-speed) arg0) @@ -133,13 +106,10 @@ (none) ) -;; definition for method 27 of type nav-control (defmethod get-target-speed nav-control ((obj nav-control)) (-> obj target-speed) ) -;; definition for method 37 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-acceleration! nav-control ((obj nav-control) (arg0 meters)) "Set `acceleration`" (set! (-> obj acceleration) arg0) @@ -147,8 +117,6 @@ (none) ) -;; definition for method 38 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-turning-acceleration! nav-control ((obj nav-control) (arg0 meters)) "Set `turning-acceleration`" (set! (-> obj turning-acceleration) arg0) @@ -156,8 +124,6 @@ (none) ) -;; definition for method 39 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-max-rotation-rate! nav-control ((obj nav-control) (arg0 float)) "Set `max-rotation-rate`" (set! (-> obj max-rotation-rate) arg0) @@ -165,13 +131,10 @@ (none) ) -;; definition for method 25 of type nav-control (defmethod get-max-rotation-rate nav-control ((obj nav-control)) (-> obj max-rotation-rate) ) -;; definition for method 40 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-sphere-mask! nav-control ((obj nav-control) (arg0 uint)) "TODO - probably an enum - Set `sphere-mask`" (set! (-> obj sphere-mask) arg0) @@ -179,12 +142,10 @@ (none) ) -;; definition for method 26 of type nav-control (defmethod get-sphere-mask nav-control ((obj nav-control)) (-> obj sphere-mask) ) -;; definition for method 10 of type nav-control (defmethod point-in-bsphere? nav-control ((obj nav-control) (arg0 vector)) "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" (let ((v1-1 (-> obj state mesh bounds))) @@ -192,14 +153,11 @@ ) ) -;; definition for method 43 of type nav-control (defmethod display-marks? nav-control ((obj nav-control)) "Returns if navigation related marks should be displayed" (and *display-nav-marks* (logtest? (-> obj flags) (nav-control-flag display-marks))) ) -;; definition for method 42 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod init! nav-control ((obj nav-control) (arg0 collide-shape)) "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (set! (-> obj callback-info) #f) @@ -223,7 +181,6 @@ (none) ) -;; definition for function get-nav-control ;; WARN: Function get-nav-control has a return type of none, but the expression builder found a return statement. (defun get-nav-control ((arg0 process-drawable) (arg1 nav-mesh)) "Given a [[process-drawable]] get the associated [[nav-control]] using either: @@ -245,7 +202,6 @@ (none) ) -;; definition for method 13 of type nav-control (defmethod find-nearest-poly-to-point nav-control ((obj nav-control) (arg0 vector)) "Find the nav-poly closest to this point in the nav-mesh." (let ((gp-0 (new 'stack 'nav-find-poly-parms))) @@ -257,8 +213,6 @@ ) ) -;; definition for method 14 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod project-point-onto-plane-of-poly nav-control ((obj nav-control) (arg0 nav-poly) (arg1 vector) (arg2 vector) (arg3 vector)) "Move a point to the be on the plane containing the given nav-poly. Return the normal too" (project-point-onto-plane-of-poly-local @@ -273,7 +227,6 @@ (none) ) -;; definition for method 17 of type nav-control (defmethod is-in-mesh? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) "Is this point in the mesh?" (let ((v1-0 (new 'stack-no-clear 'vector))) @@ -284,8 +237,6 @@ ) ) -;; definition for method 9 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod debug-draw nav-control ((obj nav-control)) (local-vars (sv-32 nav-mesh) (sv-36 vector)) (when (display-marks? obj) @@ -340,7 +291,6 @@ (none) ) -;; definition for method 11 of type nav-control (defmethod find-poly-containing-point-1 nav-control ((obj nav-control) (arg0 vector)) "Find nav-poly containing this point." (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) @@ -351,7 +301,6 @@ ) ) -;; definition for method 15 of type nav-control (defmethod find-poly-containing-point-2 nav-control ((obj nav-control) (arg0 vector)) "Find nav-poly containing this point - same as 1" (let ((v1-0 (new 'stack-no-clear 'nav-find-poly-parms))) @@ -362,7 +311,6 @@ ) ) -;; definition for method 16 of type nav-control ;; WARN: Return type mismatch object vs symbol. (defmethod is-above-poly-max-height? nav-control ((obj nav-control) (arg0 vector) (arg1 float)) "Is the point in a poly, and lower than a max height?" @@ -377,7 +325,6 @@ ) ) -;; definition for method 45 of type nav-control (defmethod find-first-sphere-intersecting-ray nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) "Find the first sphere that this ray intersects" (let ((s5-0 (the-as sphere #f))) @@ -398,8 +345,6 @@ ) ) -;; definition for function add-nav-sphere -;; WARN: Return type mismatch int vs none. (defun add-nav-sphere ((nav nav-control) (sphere sphere) (max-spheres int)) "Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as `max-spheres` is less than [[nav-control]]'s `sphere-count`" @@ -439,9 +384,6 @@ ) ) -;; definition for function add-collide-shape-spheres -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defun add-collide-shape-spheres ((arg0 nav-control) (arg1 collide-shape) (arg2 sphere)) (local-vars (a2-6 float) (t0-4 float)) (rlet ((vf1 :class vf) @@ -521,9 +463,6 @@ ) ) -;; definition for method 46 of type nav-control -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod find-sphere-ids-from-sphere-hash nav-control ((obj nav-control) (arg0 symbol)) "Use sphere-hash to look up navigation sphere IDs and save them." (let ((s5-0 (new 'stack-no-clear 'find-nav-sphere-ids-params))) @@ -540,8 +479,6 @@ (none) ) -;; definition for method 23 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod set-spheres-from-nav-ids nav-control ((obj nav-control)) "Set up spheres from sphere ids previously found by find-sphere-ids-from-sphere-hash" (let ((v1-2 (-> obj state mesh sphere-hash sphere-array)) @@ -563,7 +500,6 @@ (none) ) -;; definition of type nav-control-cfs-work (deftype nav-control-cfs-work (structure) ((in-dir vector :inline :offset-assert 0) (right-dir vector :inline :offset-assert 16) @@ -590,38 +526,7 @@ :flag-assert #x9000000c0 ) -;; definition for method 3 of type nav-control-cfs-work -(defmethod inspect nav-control-cfs-work ((obj nav-control-cfs-work)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (format #t "[~8x] ~A~%" obj 'nav-control-cfs-work) - (format #t "~1Tin-dir: #~%" (-> obj in-dir)) - (format #t "~1Tright-dir: #~%" (-> obj right-dir)) - (format #t "~1Tbest-dir[2] @ #x~X~%" (-> obj best-dir)) - (format #t "~1Ttemp-dir[2] @ #x~X~%" (-> obj temp-dir)) - (format #t "~1Taway-dir: #~%" (-> obj away-dir)) - (format #t "~1Tbest-dir-angle[2] @ #x~X~%" (-> obj best-dir-angle)) - (format #t "~1Tignore-mask: ~D~%" (-> obj ignore-mask)) - (format #t "~1Tinitial-ignore-mask: ~D~%" (-> obj initial-ignore-mask)) - (format #t "~1Ti-sphere: ~D~%" (-> obj i-sphere)) - (format #t "~1Ti-first-sphere: ~D~%" (-> obj i-first-sphere)) - (format #t "~1Ti-inside-sphere: ~D~%" (-> obj i-inside-sphere)) - (format #t "~1Tinside-sphere-dist: ~f~%" (-> obj inside-sphere-dist)) - (format #t "~1Tsign: ~f~%" (-> obj sign)) - (format #t "~1Ttravel-len: ~f~%" (-> obj travel-len)) - (format #t "~1Tdist2: ~f~%" (-> obj dist2)) - (format #t "~1Tinside-dist: ~f~%" (-> obj inside-dist)) - (format #t "~1Trand-angle: ~f~%" (-> obj rand-angle)) - (format #t "~1Tdir-update: ~A~%" (-> obj dir-update)) - (format #t "~1Tdebug-offset: #~%" (-> obj debug-offset)) - (label cfg-4) - obj - ) -;; definition for function circle-tangent-directions -;; INFO: Used lq/sq (defun circle-tangent-directions ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) (rlet ((acc :class vf) (Q :class vf) @@ -711,7 +616,6 @@ ) ) -;; definition for function circle-ray-intersection? (defun circle-ray-intersection? ((arg0 vector) (arg1 vector) (arg2 float) (arg3 vector)) (let ((f1-1 (- (-> arg3 x) (-> arg0 x))) (f0-2 (- (-> arg3 z) (-> arg0 z))) @@ -744,7 +648,6 @@ ) ) -;; definition for function find-closest-circle-ray-intersection (defun find-closest-circle-ray-intersection ((arg0 vector) (arg1 vector) (arg2 float) (arg3 int) (arg4 (inline-array vector)) (arg5 int)) 1.0 (let ((v0-0 -1)) @@ -803,7 +706,6 @@ ) ) -;; definition for function compute-dir-parm (defun compute-dir-parm ((arg0 vector) (arg1 vector) (arg2 vector)) (let ((a2-1 (the-as number (vector-dot arg0 arg2))) (a3-1 #xffffffff80000000) @@ -813,8 +715,6 @@ ) ) -;; definition for method 18 of type nav-control -;; INFO: Used lq/sq (defmethod avoid-spheres-1! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (v1-28 int) (a0-29 int) (a1-3 float)) (rlet ((acc :class vf) @@ -1111,8 +1011,6 @@ ) ) -;; definition for method 19 of type nav-control -;; INFO: Used lq/sq (defmethod avoid-spheres-2! nav-control ((obj nav-control) (arg0 nav-avoid-spheres-params)) (local-vars (a0-32 int) (a1-3 float)) (rlet ((acc :class vf) @@ -1244,137 +1142,12 @@ ) ) -;; definition for method 21 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod clamp-vector-to-mesh-no-gaps nav-control ((obj nav-control) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) (clamp-vector-to-mesh-no-gaps (-> obj state mesh) arg0 arg1 arg2 arg3) 0 (none) ) -;; definition for method 19 of type nav-mesh -;; INFO: Used lq/sq -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Return type mismatch int vs none. (defmethod clamp-vector-to-mesh-no-gaps nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 vector) (arg3 clamp-travel-vector-to-mesh-return-info)) (local-vars (v1-12 symbol) @@ -1386,7 +1159,7 @@ (sv-136 int) (sv-144 nav-mesh-work) (sv-148 nav-poly) - (sv-152 uint8) + (sv-152 uint) (sv-156 (pointer int8)) (sv-160 (pointer int8)) (sv-164 float) @@ -1594,13 +1367,12 @@ ) ) -;; definition for method 21 of type nav-mesh ;; WARN: Return type mismatch object vs none. ;; WARN: Function (method 21 nav-mesh) has a return type of none, but the expression builder found a return statement. (defmethod find-adjacent-bounds-one nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) (local-vars (sv-16 nav-poly)) (if (zero? arg3) - (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> arg1 vertex-count))))) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) ) (set! sv-16 arg1) (let ((s2-0 (-> sv-16 vertex arg2)) @@ -1610,18 +1382,13 @@ (while (begin (label cfg-21) (nonzero? s1-0)) (+! s1-0 -1) (if (nonzero? arg3) - (set! arg2 - (the-as - int - (mod (the-as uint (+ (+ arg2 arg3) (the-as int (-> s3-0 vertex-count)))) (the-as uint (-> s3-0 vertex-count))) - ) - ) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 arg3 (-> s3-0 vertex-count))) (-> s3-0 vertex-count)))) ) (let ((v1-12 (-> s3-0 adj-poly arg2))) (cond ((= v1-12 255) (if (zero? arg3) - (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> s3-0 vertex-count))))) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> s3-0 vertex-count)))) ) (vector+! arg0 (-> s3-0 vertex arg2) (-> obj bounds)) (return #f) @@ -1649,8 +1416,6 @@ (none) ) -;; definition for method 20 of type nav-mesh -;; WARN: Return type mismatch int vs none. (defmethod set-normals-from-adjacent-bounds nav-mesh ((obj nav-mesh) (arg0 clamp-travel-vector-to-mesh-return-info)) (find-adjacent-bounds-one obj (-> arg0 vert-prev) (-> arg0 poly) (-> arg0 edge) -1) (find-adjacent-bounds-one obj (-> arg0 vert-next) (-> arg0 poly) (-> arg0 edge) 0) @@ -1672,189 +1437,6 @@ (none) ) -;; definition for method 18 of type nav-mesh -;; INFO: Used lq/sq -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Return type mismatch int vs none. (defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) @@ -1874,7 +1456,7 @@ (sv-128 int) (sv-136 nav-mesh-work) (sv-140 nav-poly) - (sv-144 uint8) + (sv-144 uint) (sv-148 (pointer int8)) (sv-152 (pointer int8)) (sv-156 float) @@ -2107,7 +1689,6 @@ ) ) -;; definition for method 22 of type nav-control (defmethod find-first-sphere-and-update-avoid-params nav-control ((obj nav-control) (arg0 vector) (arg1 nav-avoid-spheres-params)) (rlet ((acc :class vf) (Q :class vf) @@ -2176,7 +1757,6 @@ ) ) -;; definition for method 24 of type nav-control (defmethod add-root-sphere-to-hash! nav-control ((obj nav-control) (arg0 vector) (arg1 int)) "Add our root sphere to the hash (if enabled with output-sphere-hash flag) at the given location." (if (logtest? (-> obj flags) (nav-control-flag output-sphere-hash)) @@ -2190,8 +1770,6 @@ (none) ) -;; definition for method 47 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod reset! nav-state ((obj nav-state) (arg0 nav-control)) (set! (-> obj nav) arg0) (set! (-> obj flags) (nav-state-flag)) @@ -2203,88 +1781,65 @@ (none) ) -;; definition for method 7 of type nav-state (defmethod relocate nav-state ((obj nav-state) (arg0 int)) (break!) (&+! (-> obj nav) arg0) obj ) -;; definition for method 12 of type nav-state -;; INFO: Used lq/sq (defmethod get-velocity nav-state ((obj nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> obj velocity quad)) arg0 ) -;; definition for method 14 of type nav-state -;; INFO: Used lq/sq (defmethod get-heading nav-state ((obj nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> obj heading quad)) arg0 ) -;; definition for method 15 of type nav-state -;; INFO: Used lq/sq (defmethod get-target-post nav-state ((obj nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> obj target-post quad)) arg0 ) -;; definition for method 19 of type nav-state (defmethod get-current-poly nav-state ((obj nav-state)) "@returns `current-poly`" (-> obj current-poly) ) -;; definition for method 16 of type nav-state (defmethod get-speed nav-state ((obj nav-state)) "@returns `speed`" (-> obj speed) ) -;; definition for method 17 of type nav-state (defmethod get-rotation-rate nav-state ((obj nav-state)) "@returns `rotation-rate`" (-> obj rotation-rate) ) -;; definition for method 13 of type nav-state -;; INFO: Used lq/sq (defmethod get-travel nav-state ((obj nav-state) (arg0 vector)) (set! (-> arg0 quad) (-> obj travel quad)) arg0 ) -;; definition for method 44 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod set-velocity! nav-state ((obj nav-state) (velocity vector)) (set! (-> obj velocity quad) (-> velocity quad)) 0 (none) ) -;; definition for method 45 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod set-heading! nav-state ((obj nav-state) (arg0 vector)) (set! (-> obj heading quad) (-> arg0 quad)) 0 (none) ) -;; definition for method 46 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod set-speed! nav-state ((obj nav-state) (arg0 meters)) (set! (-> obj speed) arg0) 0 (none) ) -;; definition for method 42 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod set-target-post! nav-state ((obj nav-state) (arg0 vector)) (logclear! (-> obj flags) (nav-state-flag directional-mode)) (logior! (-> obj flags) (nav-state-flag target-poly-dirty)) @@ -2293,9 +1848,6 @@ (none) ) -;; definition for method 43 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod set-travel! nav-state ((obj nav-state) (arg0 vector)) (logior! (-> obj flags) (nav-state-flag directional-mode)) (set! (-> obj travel quad) (-> arg0 quad)) @@ -2303,8 +1855,6 @@ (none) ) -;; definition for method 20 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod copy-nav-state! nav-state ((obj nav-state) (arg0 (pointer nav-state))) "Copies the [[nav-state]] the given pointer points to into the current object" (mem-copy! (the-as pointer obj) arg0 176) @@ -2312,17 +1862,12 @@ (none) ) -;; definition for method 10 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod nav-state-method-10 nav-state ((obj nav-state)) "Virtual/Stub" 0 (none) ) -;; definition for method 9 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod debug-draw nav-state ((obj nav-state)) (let ((s5-0 (-> obj mesh))) (if (-> obj next-poly) @@ -2365,15 +1910,12 @@ (none) ) -;; definition for method 38 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod set-current-poly! nav-state ((obj nav-state) (arg0 nav-poly)) (set! (-> obj current-poly) arg0) 0 (none) ) -;; definition for method 41 of type nav-state (defmethod clamp-vector-to-mesh-cross-gaps nav-state ((obj nav-state) (arg0 vector)) (when (-> obj current-poly) (clamp-vector-to-mesh-cross-gaps @@ -2389,9 +1931,6 @@ ) ) -;; definition for method 40 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod do-navigation-to-destination nav-state ((obj nav-state) (arg0 vector)) (local-vars (v1-15 symbol)) (rlet ((acc :class vf) @@ -2502,7 +2041,6 @@ ) ) -;; definition for method 18 of type nav-state (defmethod try-projecting-to-current-poly nav-state ((obj nav-state) (arg0 vector) (arg1 object) (arg2 vector)) (cond ((-> obj current-poly) @@ -2532,8 +2070,6 @@ ) ) -;; definition for method 20 of type nav-control -;; WARN: Return type mismatch int vs none. (defmethod clamp-vector-to-mesh-cross-gaps nav-control ((obj nav-control) (arg0 vector) (arg1 nav-poly) @@ -2550,7 +2086,6 @@ (none) ) -;; definition for method 12 of type nav-control (defmethod cloest-point-on-mesh nav-control ((obj nav-control) (arg0 vector) (arg1 vector) (arg2 nav-poly)) (local-vars (sv-16 vector)) (set! sv-16 arg0) @@ -2570,7 +2105,6 @@ ) ) -;; definition for function vector-rotate-y-sincos! (defun vector-rotate-y-sincos! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) (let ((f0-0 (-> arg1 x)) (f1-0 (-> arg1 z)) @@ -2581,19 +2115,14 @@ ) ) -;; definition for method 39 of type nav-state -;; INFO: function output is handled by mips2c (defmethod-mips2c "(method 39 nav-state)" 39 nav-state) -;; definition for method 50 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod nav-state-method-50 nav-state ((obj nav-state)) "Virtual/Stub" 0 (none) ) -;; definition for function test-xz-point-on-line-segment? (defun test-xz-point-on-line-segment? ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) (local-vars (v1-2 float) (v1-4 float)) (rlet ((vf1 :class vf) @@ -2653,9 +2182,6 @@ ) ) -;; definition for method 51 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod navigate-using-route-portals nav-state ((obj nav-state)) (local-vars (v1-117 float) @@ -2845,111 +2371,12 @@ ) ) -;; definition for method 49 of type nav-state -;; INFO: Used lq/sq -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((obj nav-state) (arg0 nav-avoid-spheres-params)) (local-vars (sv-96 int) (sv-104 nav-mesh-work) (sv-108 nav-poly) - (sv-112 uint8) + (sv-112 uint) (sv-116 (pointer int8)) (sv-120 (pointer int8)) (sv-124 float) @@ -3103,111 +2530,12 @@ ) ) -;; definition for method 52 of type nav-state -;; INFO: Used lq/sq -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((obj nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) (sv-204 nav-poly) - (sv-208 uint8) + (sv-208 uint) (sv-212 (pointer int8)) (sv-216 (pointer int8)) (sv-220 float) @@ -3374,9 +2702,6 @@ ) ) -;; definition for method 53 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod navigate-within-poly nav-state ((obj nav-state)) (rlet ((acc :class vf) (Q :class vf) @@ -3491,8 +2816,6 @@ ) ) -;; definition for method 54 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod clamp-travel-vector nav-state ((obj nav-state)) (let ((s5-0 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) (clamp-vector-to-mesh-cross-gaps @@ -3528,17 +2851,11 @@ (none) ) -;; definition for method 11 of type nav-state -;; INFO: Used lq/sq -;; WARN: Stack slot offset 56 signed mismatch -;; WARN: Stack slot offset 56 signed mismatch -;; WARN: Stack slot offset 56 signed mismatch -;; WARN: Stack slot offset 56 signed mismatch (defmethod plan-over-pat1-polys-using-route nav-state ((obj nav-state) (arg0 nav-gap-info)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (let ((a1-1 (-> obj next-poly))) - (when (logtest? (the-as int (-> a1-1 pat)) 1) - (while (and a1-1 (logtest? (the-as int (-> a1-1 pat)) 1)) + (when (logtest? (-> a1-1 pat) 1) + (while (and a1-1 (logtest? (-> a1-1 pat) 1)) (set! a1-1 (lookup-poly-on-route-to-target (-> obj mesh) a1-1 (-> obj target-poly))) ) (when (and a1-1 (!= a1-1 (-> obj current-poly))) @@ -3574,9 +2891,6 @@ ) ) -;; definition for method 24 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod turn-and-navigate-to-destination nav-state ((obj nav-state)) (rlet ((acc :class vf) (Q :class vf) @@ -3636,58 +2950,24 @@ ) ) -;; definition for method 25 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod navigate-using-route-portals-wrapper nav-state ((obj nav-state)) (navigate-using-route-portals obj) 0 (none) ) -;; definition for method 26 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-recompute-avoid-spheres-1-wrapper nav-state ((obj nav-state)) (navigate-using-best-dir-recompute-avoid-spheres-1 obj) 0 (none) ) -;; definition for method 27 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod navigate-within-poly-wrapper nav-state ((obj nav-state)) (navigate-within-poly obj) 0 (none) ) -;; definition for method 28 of type nav-state -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 192 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 196 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Return type mismatch int vs none. (defmethod compute-travel-speed nav-state ((obj nav-state)) (local-vars (sv-192 float) (sv-196 float) (sv-200 float) (sv-204 float) (sv-224 vector)) (let ((s5-0 obj)) @@ -3757,9 +3037,6 @@ (none) ) -;; definition for method 34 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod navigate-v1! nav-state ((obj nav-state)) (rlet ((acc :class vf) (Q :class vf) @@ -3846,141 +3123,34 @@ ) ) -;; definition for method 35 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod reset-target! nav-state ((obj nav-state)) (vector-reset! (-> obj target-dir)) 0 (none) ) -;; definition for method 36 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod add-offset-to-target! nav-state ((obj nav-state) (arg0 vector)) (vector+! (-> obj target-dir) (-> obj target-dir) arg0) 0 (none) ) -;; definition for method 29 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod nav-state-method-29 nav-state ((obj nav-state)) 0 (none) ) -;; definition for method 30 of type nav-state -;; WARN: Return type mismatch int vs none. (defmethod nav-state-method-30 nav-state ((obj nav-state)) 0 (none) ) -;; definition for method 31 of type nav-state -;; INFO: Used lq/sq -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((obj nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) (sv-204 nav-poly) - (sv-208 uint8) + (sv-208 uint) (sv-212 (pointer int8)) (sv-216 (pointer int8)) (sv-220 float) @@ -4152,9 +3322,6 @@ ) ) -;; definition for method 32 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod update-travel-dir-from-spheres nav-state ((obj nav-state)) (local-vars (v1-11 float) (v1-25 float)) (rlet ((acc :class vf) @@ -4217,9 +3384,6 @@ ) ) -;; definition for method 33 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod compute-speed-simple nav-state ((obj nav-state)) (rlet ((acc :class vf) (Q :class vf) @@ -4279,9 +3443,6 @@ ) ) -;; definition for method 37 of type nav-state -;; INFO: Used lq/sq -;; WARN: Return type mismatch int vs none. (defmethod navigate-v2! nav-state ((obj nav-state)) (rlet ((acc :class vf) (Q :class vf) diff --git a/goal_src/jak2/engine/nav/nav-enemy.gc b/goal_src/jak2/engine/nav/nav-enemy.gc index 92f0be90d4..c0c6c57c46 100644 --- a/goal_src/jak2/engine/nav/nav-enemy.gc +++ b/goal_src/jak2/engine/nav/nav-enemy.gc @@ -288,7 +288,7 @@ (defmethod nav-enemy-method-177 nav-enemy ((obj nav-enemy)) (let ((v1-2 (-> obj nav state current-poly))) - (when (and v1-2 (logtest? (the-as int (-> v1-2 pat)) 4) (!= (-> v1-2 link) 255)) + (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) (let ((v1-6 (-> obj nav state mesh link-array (-> v1-2 link) dest-mesh))) (if v1-6 (change-to v1-6 obj) diff --git a/goal_src/jak2/engine/nav/nav-mesh-h.gc b/goal_src/jak2/engine/nav/nav-mesh-h.gc index 4f9a29b815..d9cdc15b8c 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -483,7 +483,7 @@ (next-poly-idx int) (work nav-mesh-work) (current-poly nav-poly) - (current-poly-vtx-count uint8) + (current-poly-vtx-count uint) (v0-table (pointer int8)) (v1-table (pointer int8)) (delta-x float) diff --git a/goal_src/jak2/engine/nav/nav-mesh.gc b/goal_src/jak2/engine/nav/nav-mesh.gc index 356787ddae..9fa7a94661 100644 --- a/goal_src/jak2/engine/nav/nav-mesh.gc +++ b/goal_src/jak2/engine/nav/nav-mesh.gc @@ -517,7 +517,7 @@ (defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) (set! (-> gp-0 0 quad) (-> obj bounds quad)) - (if (logtest? (the-as int (-> arg0 pat)) 7) + (if (logtest? (-> arg0 pat) 7) (set! (-> gp-0 0 y) (+ 409.6 (-> gp-0 0 y))) ) (let ((v1-7 (the-as int (+ (-> arg0 vertex-count) -1)))) @@ -534,7 +534,7 @@ (set! v1-7 s2-0) ) ) - (when (and (logtest? (the-as int (-> arg0 pat)) 4) (< (the-as uint (-> arg0 link)) (-> obj link-count))) + (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> obj link-count))) (poly-centroid obj arg0 (-> gp-0 1)) (let ((s5-1 (-> obj link-array (-> arg0 link)))) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) @@ -1482,13 +1482,13 @@ (dotimes (s5-1 (the-as int (-> obj poly-count))) (let ((s4-1 (-> obj poly-array s5-1))) (debug-draw-poly obj s4-1 (cond - ((logtest? (the-as int (-> s4-1 pat)) 1) + ((logtest? (-> s4-1 pat) 1) *color-black* ) - ((logtest? (the-as int (-> s4-1 pat)) 2) + ((logtest? (-> s4-1 pat) 2) *color-gray* ) - ((logtest? (the-as int (-> s4-1 pat)) 4) + ((logtest? (-> s4-1 pat) 4) (if (-> obj link-array (-> s4-1 link) dest-mesh) *color-green* *color-light-red* @@ -2031,7 +2031,7 @@ ((and arg0 arg1 (!= arg0 arg1)) (let* ((a1-1 obj) (v1-1 (-> arg0 id)) - (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a1-1 poly-count))) 2)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a1-1 poly-count))) 2)) (s3-0 (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 @@ -2051,7 +2051,7 @@ (let ((a0-7 s3-0) (v1-16 (the-as int (+ s3-0 1))) ) - (if (>= (the-as uint v1-16) (the-as uint (-> arg0 vertex-count))) + (if (>= (the-as uint v1-16) (-> arg0 vertex-count)) (set! v1-16 0) ) (set! (-> arg2 vertex 1 quad) (-> arg0 vertex a0-7 quad)) @@ -2073,7 +2073,7 @@ ((and arg0 arg1 (!= arg0 arg1)) (let* ((a3-0 obj) (v1-1 (-> arg0 id)) - (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a3-0 poly-count))) 2)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a3-0 poly-count))) 2)) (v1-9 (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 @@ -2159,7 +2159,7 @@ (set! sv-64 (the-as symbol #f)) (countdown (s5-0 sv-36) (let ((v1-3 (-> obj poly-array s5-0))) - (if (logtest? (the-as int (-> v1-3 pat)) 1) + (if (logtest? (-> v1-3 pat) 1) (set! sv-56 (+ sv-56 1)) ) (set! sv-68 (-> v1-3 vertex)) @@ -2279,7 +2279,7 @@ (s1-0 vector) (sv-16 int) (sv-24 nav-mesh-work) - (sv-28 uint8) + (sv-28 uint) (sv-32 (pointer int8)) (sv-36 (pointer int8)) (sv-40 vector) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable.gc b/goal_src/jak2/engine/process-drawable/process-drawable.gc index 3e60c95047..09f8a411f5 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable.gc @@ -219,7 +219,7 @@ ) (defmethod lod-set! draw-control ((obj draw-control) (arg0 int)) - (let ((v1-1 (max 0 (min arg0 (the-as int (-> obj lod-set max-lod)))))) + (let ((v1-1 (max 0 (min arg0 (-> obj lod-set max-lod))))) (set! (-> obj desired-lod) v1-1) (when (!= (-> obj cur-lod) v1-1) (set! (-> obj mgeo) (-> obj lod-set lod v1-1 geo)) @@ -235,7 +235,7 @@ (defmethod lods-assign! draw-control ((obj draw-control) (arg0 lod-set)) (mem-copy! (the-as pointer (-> obj lod-set)) (the-as pointer arg0) 49) - (let ((a1-2 (min (-> obj cur-lod) (the-as int (-> obj lod-set max-lod))))) + (let ((a1-2 (min (-> obj cur-lod) (-> obj lod-set max-lod)))) (set! (-> obj cur-lod) -1) (lod-set! obj a1-2) ) @@ -275,8 +275,8 @@ (let ((v1-0 (-> arg1 length)) (s3-0 (-> arg0 max-lod)) ) - (set! (-> obj max-lod) (the-as int s3-0)) - (dotimes (a0-1 (the-as int (+ s3-0 1))) + (set! (-> obj max-lod) s3-0) + (dotimes (a0-1 (+ s3-0 1)) (when (or (< (-> arg0 mgeo a0-1) 0) (>= (-> arg0 mgeo a0-1) v1-0)) (set! obj (the-as lod-set #f)) (goto cfg-22) @@ -519,7 +519,7 @@ (let ((a2-3 *temp-string*)) (add-debug-text-3d #t (bucket-id debug-no-zbuf1) a2-3 s3-0 (font-color blue-#003cf1) s5-0) ) - (set! (-> s5-0 x) (the-as int (+ (-> s5-0 x) 10))) + (+! (-> s5-0 x) 10) ) ) (none) @@ -569,13 +569,13 @@ (defstate process-drawable-art-error (process-drawable) :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) - (let ((v1-0 event-type)) - (the-as object (when (= v1-0 'nav-mesh-kill) - (deactivate self) - #t - ) - ) - ) + (the-as object (case event-type + (('nav-mesh-kill) + (deactivate self) + #t + ) + ) + ) ) :code (behavior ((arg0 string)) (format 0 "ART ERROR: ~A for ~A~%" arg0 self) diff --git a/goal_src/jak2/engine/scene/scene.gc b/goal_src/jak2/engine/scene/scene.gc index d52daf2a70..01e95d67c5 100644 --- a/goal_src/jak2/engine/scene/scene.gc +++ b/goal_src/jak2/engine/scene/scene.gc @@ -24,7 +24,7 @@ (defmethod scene-method-15 scene ((obj scene) (arg0 spool-anim)) (set! (-> arg0 name) (-> obj anim)) (set! (-> arg0 anim-name) (-> obj anim)) - (set! (-> arg0 parts) (the-as int (-> obj parts))) + (set! (-> arg0 parts) (-> obj parts)) (set! (-> arg0 command-list) (-> obj command-list)) (none) ) @@ -992,7 +992,7 @@ (!= (-> *setting-control* user-current movie) (process->ppointer self)) ) *progress-process* - (!= (gui-control-method-17 *gui-control* (the-as sound-id (-> self gui-id))) 3) + (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) 3) ) ) (suspend) @@ -1060,16 +1060,16 @@ (nonzero? (-> self anim anim-name)) (let ((v1-161 (file-status *art-control* (-> self anim name) 0))) (or (not (or (= v1-161 'active) (= v1-161 'locked))) - (let* ((a1-26 (gui-control-method-14 + (let* ((a1-26 (lookup-gui-connection-id *gui-control* (the-as string (-> self anim anim-name)) (gui-channel none) (gui-action none) ) ) - (v1-167 (gui-control-method-17 *gui-control* (the-as sound-id a1-26))) + (v1-167 (get-status *gui-control* (the-as sound-id a1-26))) ) - (not (or (= v1-167 (gui-action play)) (= v1-167 (gui-action playing)))) + (not (or (= v1-167 (gui-status ready)) (= v1-167 (gui-status active)))) ) ) ) @@ -1485,7 +1485,7 @@ (process-drawable-draw-subtitles) (when (and (= *cheat-mode* 'debug) (-> self scene)) (let ((gp-7 - (gui-control-method-15 *gui-control* self (gui-channel art-load) (-> self scene name) (new 'static 'sound-id)) + (lookup-gui-connection *gui-control* self (gui-channel art-load) (-> self scene name) (new 'static 'sound-id)) ) ) (when (!= *external-cam-mode* 'pad-0) @@ -1667,7 +1667,7 @@ (set! (-> self scene) #f) ) ) - (set! (-> self gui-id) (the-as uint (gui-control-method-9 + (set! (-> self gui-id) (the-as uint (add-process *gui-control* self (gui-channel movie) diff --git a/goal_src/jak2/engine/sound/speech.gc b/goal_src/jak2/engine/sound/speech.gc index c1741f11ac..cedb492dd6 100644 --- a/goal_src/jak2/engine/sound/speech.gc +++ b/goal_src/jak2/engine/sound/speech.gc @@ -90,9 +90,7 @@ (the-as uint (rand-vu-int-range (the-as int (-> s5-1 min-delay)) (the-as int (-> s5-1 max-delay)))) ) (set! (-> s5-1 delay) (-> obj delay)) - (set! (-> obj id) - (gui-control-method-9 *gui-control* s4-0 (-> obj gui-channel) (gui-action play) s3-1 -99.0 0) - ) + (set! (-> obj id) (add-process *gui-control* s4-0 (-> obj gui-channel) (gui-action play) s3-1 -99.0 0)) ) (speech-channel-method-12 obj) (logior! (-> obj flags) (speech-channel-flag disable)) @@ -137,7 +135,7 @@ ) ) (else - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj id) @@ -152,10 +150,10 @@ ) ) ) - (case (gui-control-method-17 *gui-control* (-> obj id)) - (((gui-action queue)) + (case (get-status *gui-control* (-> obj id)) + (((gui-status pending)) (when (>= (- (-> pp clock frame-counter) (-> obj start-time)) (seconds 1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj id) @@ -169,7 +167,7 @@ (set! (-> obj end-time) (-> obj update-time)) ) ) - (((gui-action none)) + (((gui-status unknown)) (set! (-> obj id) (new 'static 'sound-id)) (set! (-> obj last-request handle) (the-as handle #f)) (set! (-> obj end-time) (-> obj update-time)) @@ -207,7 +205,7 @@ (defmethod speech-channel-method-10 speech-channel ((obj speech-channel) (arg0 handle)) (when (= arg0 (handle->process (-> obj last-request handle))) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj id) @@ -299,7 +297,7 @@ ) (defmethod speech-control-method-16 speech-control ((obj speech-control)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -309,7 +307,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) diff --git a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc index ca5909c946..18637ba30c 100644 --- a/goal_src/jak2/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak2/engine/target/gun/gun-dark-shot.gc @@ -154,12 +154,9 @@ (set! (-> obj fire-sound) (the-as uint (new-sound-id))) (set! (-> obj trail-sound) (the-as uint (new-sound-id))) (set! (-> obj explode-sound) - (the-as - uint - (gui-control-method-9 *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0) - ) + (the-as uint (add-process *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0)) ) - (gui-control-method-20 *gui-control* (the-as sound-id (-> obj explode-sound)) #t 50 150 11) + (set-falloff! *gui-control* (the-as sound-id (-> obj explode-sound)) #t 50 150 11) (set! (-> obj start-pilot?) (the-as basic (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) ) @@ -636,10 +633,10 @@ (send-event (ppointer->process (-> self parent)) 'release) ) (sound-stop (the-as sound-id (-> self trail-sound))) - (let ((v1-10 (gui-control-method-17 *gui-control* (the-as sound-id (-> self explode-sound))))) + (let ((v1-10 (get-status *gui-control* (the-as sound-id (-> self explode-sound))))) (cond - ((= v1-10 (gui-action play)) - (gui-control-method-16 + ((= v1-10 (gui-status ready)) + (set-action! *gui-control* (gui-action play) (the-as sound-id (-> self explode-sound)) @@ -651,7 +648,7 @@ ) ) (else - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id (-> self explode-sound)) @@ -881,10 +878,9 @@ ) ) (let ((gp-3 (-> self clock frame-counter))) - (while (or (-> self child) - (and (nonzero? (gui-control-method-17 *gui-control* (the-as sound-id (-> self explode-sound)))) - (< (- (-> self clock frame-counter) gp-3) (seconds 10)) - ) + (while (or (-> self child) (and (nonzero? (get-status *gui-control* (the-as sound-id (-> self explode-sound)))) + (< (- (-> self clock frame-counter) gp-3) (seconds 10)) + ) ) (suspend) ) diff --git a/goal_src/jak2/engine/target/gun/gun-h.gc b/goal_src/jak2/engine/target/gun/gun-h.gc index 44981f6413..ea1ad60a02 100644 --- a/goal_src/jak2/engine/target/gun/gun-h.gc +++ b/goal_src/jak2/engine/target/gun/gun-h.gc @@ -187,7 +187,7 @@ ) ) -(defmethod get-gun-ammo fact-info-target ((obj fact-info-target) (arg0 target)) +(defmethod get-gun-ammo fact-info-target ((obj fact-info-target)) (let ((current-gun (gun->ammo (-> (the-as target (-> obj process)) gun gun-type)))) (if (zero? current-gun) 0.0 diff --git a/goal_src/jak2/engine/target/target-darkjak.gc b/goal_src/jak2/engine/target/target-darkjak.gc index 5b399ac948..4d45f7650c 100644 --- a/goal_src/jak2/engine/target/target-darkjak.gc +++ b/goal_src/jak2/engine/target/target-darkjak.gc @@ -954,7 +954,7 @@ (-> self skel effect) 'punch -1.0 - (the-as int (-> self control impact-ctrl joint)) + (-> self control impact-ctrl joint) (the-as basic #f) (the-as sound-name t1-3) ) @@ -1091,12 +1091,12 @@ (set! (-> self darkjak clock-vel) 0.0) (set! (-> self darkjak clock-on) #f) (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* self (gui-channel jak) (gui-action queue) "darkbom0" -99.0 0) + (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom0" -99.0 0) ) (none) ) :exit (behavior () - (gui-control-method-16 + (set-action! *gui-control* (gui-action fade) (-> self control unknown-sound-id00) @@ -1231,7 +1231,7 @@ (suspend) (ja :num! (seek! (ja-aframe 35.0 0))) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self control unknown-sound-id00) @@ -1623,7 +1623,7 @@ (set-setting! 'music-volume 'rel 0 0) (set-setting! 'ambient-volume 'rel 0 0) (compute-alignment! (-> self align)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self control unknown-sound-id00) diff --git a/goal_src/jak2/engine/target/target-death.gc b/goal_src/jak2/engine/target/target-death.gc index 4c62acf585..a43ad72d87 100644 --- a/goal_src/jak2/engine/target/target-death.gc +++ b/goal_src/jak2/engine/target/target-death.gc @@ -590,10 +590,10 @@ ) ) (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* *target* (gui-channel daxter) (gui-action play) t0-1 -99.0 0) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) t0-1 -99.0 0) ) ) - (gui-control-method-20 *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) ) (else (case (-> arg0 angle) @@ -1881,9 +1881,9 @@ (local-vars (v1-24 symbol)) (sound-play "death-fall") (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) ) - (gui-control-method-20 *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) (set-setting! 'mode-name 'cam-endlessfall 0 0) (logclear! (-> self water flags) (water-flags swim-ground)) (let ((f0-1 (fmin -4096.0 (- (-> self control ground-impact-vel))))) diff --git a/goal_src/jak2/engine/target/target-gun.gc b/goal_src/jak2/engine/target/target-gun.gc index 71b9f7a190..d8bbf4c8af 100644 --- a/goal_src/jak2/engine/target/target-gun.gc +++ b/goal_src/jak2/engine/target/target-gun.gc @@ -1353,8 +1353,8 @@ (let ((s3-1 (new 'stack-no-clear 'vector4w))) (cond ((and (logtest? (process-mask enemy guard) (-> s5-2 mask)) (transform-point-qword! s3-1 s4-5)) - (let ((v1-173 (the-as int (+ (/ (the-as int (-> s3-1 x)) 16) -2048)))) - (+ (/ (the-as int (-> s3-1 y)) 16) -2048) + (let ((v1-173 (+ (/ (-> s3-1 x) 16) -2048))) + (+ (/ (-> s3-1 y) 16) -2048) (let ((a0-91 (abs v1-173))) (cond ((< a0-91 65) diff --git a/goal_src/jak2/engine/target/target.gc b/goal_src/jak2/engine/target/target.gc index 91f452143c..c6bfe341db 100644 --- a/goal_src/jak2/engine/target/target.gc +++ b/goal_src/jak2/engine/target/target.gc @@ -2378,7 +2378,7 @@ (logtest? (-> v1-14 root-prim prim-core action) (collide-action no-smack)) ) ) - (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + (+! (-> self control unknown-word04) 1) ) ) ) @@ -2742,7 +2742,7 @@ (-> self skel effect) 'punch -1.0 - (the-as int (-> self control impact-ctrl joint)) + (-> self control impact-ctrl joint) (the-as basic #f) (the-as sound-name t1-6) ) @@ -3073,7 +3073,7 @@ ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self control unknown-sound-id00) @@ -3146,7 +3146,7 @@ (logtest? (-> self darkjak stage) 8) ) (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) + (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) ) (ja-no-eval :group! (-> self draw art-group data 391) :num! (seek! (ja-aframe 7.0 0)) @@ -3463,7 +3463,7 @@ (and (logtest? (-> self control status) (collide-status touch-wall)) (< 0.7 (-> self control poly-angle))) ) (not (logtest? (-> self control status) (collide-status touch-actor))) - (>= (the-as uint (-> self control unknown-word04)) (the-as uint 2)) + (>= (-> self control unknown-word04) (the-as uint 2)) ) (set! (-> self control last-time-of-stuck) (-> self clock frame-counter)) (set! gp-1 'stuck) @@ -3602,7 +3602,7 @@ ) (suspend) (until #f - (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + (+! (-> self control unknown-word04) 1) (ja :num! (seek!)) (let ((gp-1 (-> self skel root-channel 1))) (let ((f0-28 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 0.0 40960.0))) diff --git a/goal_src/jak2/engine/ui/credits.gc b/goal_src/jak2/engine/ui/credits.gc index a8ff9f3ae6..d799d3468a 100644 --- a/goal_src/jak2/engine/ui/credits.gc +++ b/goal_src/jak2/engine/ui/credits.gc @@ -25,10 +25,10 @@ ) ) (let ((v1-2 s4-0)) - (set! (-> v1-2 width) (the float (the-as float #x1f4))) + (set! (-> v1-2 width) (the float 500)) ) (let ((v1-3 s4-0)) - (set! (-> v1-3 height) (the float (the-as float #x96))) + (set! (-> v1-3 height) (the float 150)) ) (let ((v1-4 s4-0)) (set! (-> v1-4 scale) 0.8) @@ -82,6 +82,8 @@ ) ) +;; definition for function start-credits +;; WARN: Return type mismatch int vs none. (defun start-credits ((arg0 process)) (remove-setting! 'movie) (remove-setting! 'music-volume) @@ -97,7 +99,7 @@ (apply-settings *setting-control*) (let ((gp-0 (ppointer->process (-> self parent)))) (when (type? gp-0 scene-player) - (if (gui-control-method-15 + (if (lookup-gui-connection *gui-control* (the-as process gp-0) (gui-channel art-load) @@ -117,7 +119,7 @@ ) (let ((gp-2 (ppointer->process (-> self parent)))) (when (type? gp-2 scene-player) - (if (gui-control-method-15 + (if (lookup-gui-connection *gui-control* (the-as process gp-2) (gui-channel art-load) @@ -136,6 +138,7 @@ (none) ) +;; failed to figure out what this is: (defpartgroup group-ctyport-fireworks :id 1272 :duration (seconds 169.6) @@ -201,6 +204,7 @@ ) ) +;; failed to figure out what this is: (defpart 5408 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) (sp-flt spt-num 0.01) @@ -226,6 +230,7 @@ ) ) +;; failed to figure out what this is: (defpart 5405 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xdb9)) (sp-flt spt-num 1.0) @@ -251,6 +256,7 @@ ) ) +;; failed to figure out what this is: (defpartgroup group-ctyport-firework-green-pop :id 1273 :duration (seconds 0.835) @@ -336,6 +342,7 @@ ) ) +;; failed to figure out what this is: (defpart 5412 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) (sp-flt spt-num 1.0) @@ -359,6 +366,7 @@ ) ) +;; failed to figure out what this is: (defpart 5415 :init-specs ((sp-flt spt-scale-x (meters 8)) (sp-copy-from-other spt-scale-y -4) @@ -367,6 +375,7 @@ ) ) +;; failed to figure out what this is: (defpart 5413 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) (sp-flt spt-num 1.0) @@ -386,6 +395,7 @@ ) ) +;; failed to figure out what this is: (defpart 5416 :init-specs ((sp-flt spt-scale-x (meters 4)) (sp-copy-from-other spt-scale-y -4) @@ -394,6 +404,7 @@ ) ) +;; failed to figure out what this is: (defpart 5414 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) (sp-rnd-flt spt-num 0.0 1.0 1.0) @@ -414,6 +425,7 @@ ) ) +;; failed to figure out what this is: (defpart 5410 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) (sp-flt spt-num 1.0) @@ -438,6 +450,7 @@ ) ) +;; failed to figure out what this is: (defpart 5411 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) (sp-func spt-birth-func 'birth-func-firework-color) @@ -466,6 +479,7 @@ ) ) +;; failed to figure out what this is: (defpart 5417 :init-specs ((sp-rnd-flt spt-scale-x (meters 1) (meters 1) 1.0) (sp-copy-from-other spt-scale-y -4) @@ -479,6 +493,7 @@ ) ) +;; failed to figure out what this is: (defpart 5407 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xca :page #xc)) (sp-flt spt-num 0.01) @@ -504,6 +519,7 @@ ) ) +;; failed to figure out what this is: (defpart 5403 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) (sp-flt spt-num 1.0) @@ -526,6 +542,7 @@ ) ) +;; failed to figure out what this is: (defpart 5404 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xdb9)) (sp-flt spt-num 1.0) @@ -550,6 +567,7 @@ ) ) +;; failed to figure out what this is: (defpartgroup group-ctyport-firework-red-pop :id 1274 :duration (seconds 0.75) @@ -558,6 +576,7 @@ :parts ((sp-item 5419 :flags (launch-asap)) (sp-item 5420 :flags (launch-asap) :binding 5418)) ) +;; failed to figure out what this is: (defpart 5419 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) (sp-flt spt-num 1.0) @@ -581,10 +600,12 @@ ) ) +;; failed to figure out what this is: (defpart 5421 :init-specs ((sp-flt spt-scalevel-x (meters -0.09142857)) (sp-copy-from-other spt-scalevel-y -4)) ) +;; failed to figure out what this is: (defpart 5420 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x4 :page #xdb9)) (sp-flt spt-num 128.0) @@ -612,6 +633,7 @@ ) ) +;; failed to figure out what this is: (defpart 5422 :init-specs ((sp-flt spt-scale-x (meters 2.5)) (sp-copy-from-other spt-scale-y -4) @@ -624,6 +646,7 @@ ) ) +;; failed to figure out what this is: (defpart 5423 :init-specs ((sp-flt spt-scale-x (meters 3)) (sp-copy-from-other spt-scale-y -4) @@ -637,6 +660,7 @@ ) ) +;; failed to figure out what this is: (defpart 5424 :init-specs ((sp-flt spt-scale-x (meters 2)) (sp-copy-from-other spt-scale-y -4) @@ -645,6 +669,8 @@ ) ) +;; definition for function check-pop-level-firework-userdata +;; INFO: Used lq/sq (defun check-pop-level-firework-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (when (< (-> arg1 user-float) (-> arg2 launchrot y)) (let ((s3-0 (new 'stack-no-clear 'vector))) @@ -691,6 +717,8 @@ (none) ) +;; definition for function check-pop-level-firework-red-userdata +;; INFO: Used lq/sq (defun check-pop-level-firework-red-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (when (< (-> arg1 user-float) (-> arg2 launchrot y)) (let ((s3-0 (new 'stack-no-clear 'vector))) @@ -737,6 +765,8 @@ (none) ) +;; definition for function check-pop-level-firework-green-userdata +;; INFO: Used lq/sq (defun check-pop-level-firework-green-userdata ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) (when (< (-> arg1 user-float) (-> arg2 launchrot y)) (let ((s3-0 (new 'stack-no-clear 'vector))) @@ -783,6 +813,7 @@ (none) ) +;; failed to figure out what this is: (defpartgroup group-ctyport-firework-pop :id 1275 :duration (seconds 0.75) @@ -832,6 +863,8 @@ ) ) +;; definition for function birth-func-firework-color +;; WARN: Return type mismatch int vs none. (defun birth-func-firework-color ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-3d) @@ -847,6 +880,7 @@ (none) ) +;; failed to figure out what this is: (defpart 5418 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x3 :page #xdb9)) (sp-func spt-birth-func 'birth-func-firework-color) @@ -875,6 +909,7 @@ ) ) +;; failed to figure out what this is: (defpart 5427 :init-specs ((sp-rnd-flt spt-scalevel-x (meters 0.0016666667) (meters 0.0033333334) 1.0) (sp-copy-from-other spt-scalevel-y -4) @@ -883,6 +918,7 @@ ) ) +;; failed to figure out what this is: (defpart 5428 :init-specs ((sp-rnd-flt spt-scalevel-x (meters -0.00083333335) (meters -0.0016666667) 1.0) (sp-copy-from-other spt-scalevel-y -4) @@ -891,6 +927,7 @@ ) ) +;; failed to figure out what this is: (defpart 5429 :init-specs ((sp-flt spt-scale-x (meters 1)) (sp-copy-from-other spt-scale-y -4) @@ -903,10 +940,12 @@ ) ) +;; failed to figure out what this is: (defpart 5430 :init-specs ((sp-flt spt-r 128.0) (sp-flt spt-g 128.0) (sp-flt spt-b 128.0) (sp-flt spt-a 64.0) (sp-flt spt-fade-a -0.8)) ) +;; failed to figure out what this is: (defpart 5425 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #xbb :page #xc)) (sp-flt spt-num 1.0) @@ -930,6 +969,7 @@ ) ) +;; failed to figure out what this is: (defpart 5431 :init-specs ((sp-flt spt-r 0.0) (sp-flt spt-scalevel-x (meters -0.09142857)) @@ -940,6 +980,7 @@ ) ) +;; failed to figure out what this is: (defpart 5426 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x2 :page #xdb9)) (sp-rnd-flt spt-num 24.0 12.0 1.0) @@ -967,10 +1008,12 @@ ) ) +;; failed to figure out what this is: (defpart 5432 :init-specs ((sp-flt spt-fade-g 0.0) (sp-rnd-flt spt-fade-a -0.85333335 -0.85333335 1.0)) ) +;; failed to figure out what this is: (defpart 5406 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xdb9)) (sp-flt spt-num 0.01) @@ -996,10 +1039,12 @@ ) ) +;; failed to figure out what this is: (defpart 5409 :init-specs ((sp-flt spt-userdata -4096000.0)) ) +;; failed to figure out what this is: (defpart 5402 :init-specs ((sp-tex spt-texture (new 'static 'texture-id :index #x1 :page #xdb9)) (sp-flt spt-num 1.0) @@ -1024,3 +1069,7 @@ (sp-rnd-flt spt-conerot-z (degrees 0.0) (degrees 3600.0) 1.0) ) ) + + + + diff --git a/goal_src/jak2/engine/ui/gui-h.gc b/goal_src/jak2/engine/ui/gui-h.gc index dab3a61258..b1b60080cc 100644 --- a/goal_src/jak2/engine/ui/gui-h.gc +++ b/goal_src/jak2/engine/ui/gui-h.gc @@ -70,27 +70,48 @@ (max 96) ) +(defenum gui-connection-flags + :type uint8 + :bitfield #t + (gcf0 0) + (gcf1 1) + (fo-curve 2) + (fo-min 3) + (fo-max 4) + ) + +(defenum gui-status + :type uint8 ;; not sure + :bitfield #f + (unknown 0) + (pending 1) + (ready 2) + (active 3) + (hide 4) + (stop 5) + ) + (declare-type gui-control basic) (define-extern *gui-control* gui-control) ;; DECOMP BEGINS (deftype gui-connection (connection) - ((priority float :offset 16) - (action gui-action :offset 20) - (channel gui-channel :offset 21) - (anim-part uint8 :offset 22) - (flags uint8 :offset 23) - (name string :offset 24) - (id sound-id :offset 28) - (handle handle :offset 0) - (time-stamp time-frame :offset 8) - (hold-time time-frame :offset-assert 32) - (fo-min int16 :offset-assert 40) - (fo-max int16 :offset-assert 42) - (fo-curve int8 :offset-assert 44) - (fade uint8 :offset-assert 45) - (pad uint8 2 :offset-assert 46) + ((priority float :offset 16) + (action gui-action :offset 20) + (channel gui-channel :offset 21) + (anim-part uint8 :offset 22) + (flags gui-connection-flags :offset 23) + (name string :offset 24) + (id sound-id :offset 28) + (handle handle :offset 0) + (time-stamp time-frame :offset 8) + (hold-time time-frame :offset-assert 32) + (fo-min int16 :offset-assert 40) + (fo-max int16 :offset-assert 42) + (fo-curve int8 :offset-assert 44) + (fade uint8 :offset-assert 45) + (pad uint8 2 :offset-assert 46) ) :method-count-assert 14 :size-assert #x30 @@ -112,27 +133,21 @@ :flag-assert #x1900000cd0 (:methods (new (symbol type int) _type_ 0) - (gui-control-method-9 (_type_ process gui-channel gui-action string float time-frame) sound-id 9) - (gui-control-method-10 (_type_ process gui-channel) none 10) - (gui-control-method-11 (_type_ gui-connection) int 11) + (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id 9) + (remove-process (_type_ process gui-channel) none 10) + (stop-str (_type_ gui-connection) int 11) (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) (update (_type_ symbol) int 13) - (gui-control-method-14 (_type_ string gui-channel gui-action) int 14) - (gui-control-method-15 (_type_ process gui-channel string sound-id) gui-connection 15) - (gui-control-method-16 (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) - (gui-control-method-17 (_type_ sound-id) gui-action 17) + (lookup-gui-connection-id (_type_ string gui-channel gui-action) int 14) + (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection 15) + (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) + (get-status (_type_ sound-id) gui-status 17) (gui-control-method-18 (_type_ gui-channel) symbol 18) - (gui-control-method-19 (_type_ gui-channel gui-connection) symbol 19) - (gui-control-method-20 (_type_ sound-id symbol int int int) gui-connection 20) + (handle-command-list (_type_ gui-channel gui-connection) symbol 19) + (set-falloff! (_type_ sound-id symbol int int int) gui-connection 20) (gui-control-method-21 (_type_ gui-connection vector) int 21) (gui-control-method-22 (_type_ gui-connection process symbol) none 22) - (gui-control-method-23 (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) + (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) (channel-id-set! (_type_ gui-connection sound-id) int 24) ) ) - -0 - - - - diff --git a/goal_src/jak2/engine/ui/hud-classes.gc b/goal_src/jak2/engine/ui/hud-classes.gc index 98c59ac355..d52c020d0d 100644 --- a/goal_src/jak2/engine/ui/hud-classes.gc +++ b/goal_src/jak2/engine/ui/hud-classes.gc @@ -7,7 +7,1127 @@ ;; DECOMP BEGINS -(defun activate-hud ((arg0 target)) - (format 0 "no hud~%") +;; WARN: Failed store: (s.w! (+ v1-35 8) 0) at op 135 +;; WARN: Failed store: (s.w! (+ v1-35 12) 0) at op 136 +;; WARN: Failed store: (s.w! (+ v1-61 8) 0) at op 213 +;; WARN: Failed store: (s.w! (+ v1-61 12) 0) at op 214 +;; WARN: Failed store: (s.w! (+ v1-86 8) 0) at op 292 +;; WARN: Failed store: (s.w! (+ v1-86 12) 0) at op 293 +;; WARN: Failed store: (s.w! (+ v1-111 8) 0) at op 371 +;; WARN: Failed store: (s.w! (+ v1-111 12) 0) at op 372 +(defmethod draw hud-map ((obj hud-map)) + (set-hud-piece-position! + (-> obj sprites 1) + (the int (+ 492.0 (* 140.0 (-> obj offset)))) + (the int (+ 281.0 (* 140.0 (-> obj offset)))) + ) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 1)) 11 -11) + (set! (-> obj sprites 0 color w) + (the int (+ 70.0 (* 70.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + ) + (when (nonzero? *minimap*) ;; added check + (set! (-> *minimap* color y) + (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + ) + (set! (-> *minimap* color z) + (the int (- 96.0 (* 32.0 (sin (* 182.04445 (the float (-> obj values 1 current))))))) + ) + ) + (set! (-> obj sprites 0 scale-x) 1.0) + (set! (-> obj sprites 0 scale-y) 1.0) + (when (>= (-> *setting-control* user-current race-minimap) 0) + (set! (-> obj sprites 0 scale-x) 0.0) + (set! (-> obj sprites 0 scale-y) 0.0) + (set! (-> obj sprites 1 scale-x) 0.0) + (set! (-> obj sprites 1 scale-y) 0.0) + ) + (let ((t9-5 (method-of-type hud draw))) + (t9-5 obj) + ) + (cond + ((< (-> *setting-control* user-current race-minimap) 0) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id progress) + ) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 2 -3) + (minimap-method-15 *minimap* s4-0 (the-as vector4w (-> obj sprites 2)) #t) + ) + ) + ((zero? (-> *setting-control* user-current race-minimap)) + (let ((s5-1 (level-get *level* 'stadiumb))) + (when (and s5-1 (= (-> s5-1 status) 'active)) + (minimap-method-25 + *minimap* + (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #xc25)) + 16837.018 + ) + (minimap-method-27 *minimap* -1609044.0 -2978676.8) + (with-dma-buffer-add-bucket ((s4-2 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id progress) + ) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 10 -15) + (minimap-method-24 *minimap* s4-2 (the-as vector4w (-> obj sprites 2)) #t) + ) + ) + ) + ) + ((= (-> *setting-control* user-current race-minimap) 1) + (let ((s5-3 (level-get *level* 'stadiumc))) + (when (and s5-3 (= (-> s5-3 status) 'active)) + (minimap-method-27 *minimap* -951910.4 -3694182.5) + (minimap-method-25 + *minimap* + (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd17)) + 13907.148 + ) + (with-dma-buffer-add-bucket ((s4-4 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id progress) + ) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 20 -8) + (minimap-method-24 *minimap* s4-4 (the-as vector4w (-> obj sprites 2)) #t) + ) + ) + ) + ) + ((= (-> *setting-control* user-current race-minimap) 2) + (let ((s5-5 (level-get *level* 'stadiumd))) + (when (and s5-5 (= (-> s5-5 status) 'active)) + (minimap-method-27 *minimap* -1862860.8 -3283353.5) + (minimap-method-25 + *minimap* + (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xd18)) + 18255.871 + ) + (with-dma-buffer-add-bucket ((s4-6 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id progress) + ) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 1)) 10 -8) + (minimap-method-24 *minimap* s4-6 (the-as vector4w (-> obj sprites 2)) #t) + ) + ) + ) + ) + ((= (-> *setting-control* user-current race-minimap) 3) + 0 + ) + ) + 0 (none) - ) \ No newline at end of file + ) + +(defmethod update-values hud-map ((obj hud-map)) + (cond + ((minimap-method-20 *minimap*) + (logior! (-> obj flags) (hud-flags show)) + (let ((t9-1 (method-of-type hud update-values))) + (t9-1 obj) + ) + ) + (else + (send-event obj 'force-hide) + ) + ) + (when (not (paused?)) + (let ((v1-10 8)) + (if (and (< (-> obj values 1 target) 270) (< 270 (+ (-> obj values 1 target) v1-10))) + (set! (-> obj values 1 target) 270) + ) + (if (or (-> *game-info* wanted-flash) (!= (-> obj values 1 target) 270)) + (set! (-> obj values 1 target) (mod (+ (-> obj values 1 target) v1-10) 360)) + ) + ) + ) + 0 + (none) + ) + +(defmethod init-callback hud-map ((obj hud-map)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-lower-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 0 pos z) #xffff00) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x6 :page #x67a))) + (set! (-> obj sprites 1 scale-x) 0.85) + (set! (-> obj sprites 1 scale-y) 0.85) + (set! (-> obj sprites 1 flags) (the-as uint 4)) + (set! (-> obj sprites 1 pos z) #xffff00) + (set! (-> obj values 0 current) 0) + (minimap-method-20 *minimap*) + 0 + (none) + ) + +(defmethod draw hud-health ((obj hud-health)) + (set-hud-piece-position! + (-> obj sprites 8) + (the int (+ (* -130.0 (-> obj offset)) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 20.0 + 30.0 + ) + ) + ) + (the int (+ 306.0 (* 130.0 (-> obj offset)))) + ) + (set-as-offset-from! (-> obj sprites 9) (the-as vector4w (-> obj sprites 8)) 40 0) + (set-as-offset-from! (-> obj sprites 10) (the-as vector4w (-> obj sprites 8)) 0 40) + (set-as-offset-from! (-> obj sprites 11) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 12) (the-as vector4w (-> obj sprites 8)) 2 32) + (set-as-offset-from! (-> obj sprites 13) (the-as vector4w (-> obj sprites 8)) 7 60) + (set-as-offset-from! (-> obj sprites 14) (the-as vector4w (-> obj sprites 8)) 40 60) + (set-as-offset-from! (-> obj sprites 15) (the-as vector4w (-> obj sprites 8)) 63 32) + (set-as-offset-from! (-> obj sprites 16) (the-as vector4w (-> obj sprites 8)) 63 16) + (set-as-offset-from! (-> obj sprites 17) (the-as vector4w (-> obj sprites 8)) 41 4) + (set-as-offset-from! (-> obj sprites 18) (the-as vector4w (-> obj sprites 8)) 6 4) + (set-as-offset-from! (-> obj sprites 19) (the-as vector4w (-> obj sprites 8)) 2 17) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 7) (the-as vector4w (-> obj sprites 8)) 40 40) + (set-as-offset-from! (-> obj sprites 21) (the-as vector4w (-> obj sprites 8)) 25 25) + (let ((v1-12 + (+ (the int (* 127.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 2)))))) 127) + ) + ) + (set! (-> obj sprites 1 color x) v1-12) + (set! (-> obj sprites 1 color y) v1-12) + (set! (-> obj sprites 1 color z) v1-12) + ) + (set! (-> obj sprites 3 color x) (-> obj sprites 1 color x)) + (set! (-> obj sprites 5 color x) (-> obj sprites 1 color x)) + (set! (-> obj sprites 7 color x) (-> obj sprites 1 color x)) + (set! (-> obj sprites 3 color y) (-> obj sprites 1 color y)) + (set! (-> obj sprites 5 color y) (-> obj sprites 1 color y)) + (set! (-> obj sprites 7 color y) (-> obj sprites 1 color y)) + (set! (-> obj sprites 3 color z) (-> obj sprites 1 color z)) + (set! (-> obj sprites 5 color z) (-> obj sprites 1 color z)) + (set! (-> obj sprites 7 color z) (-> obj sprites 1 color z)) + (let ((f30-1 (the float (-> obj values 2 current)))) + (if (= f30-1 100.0) + (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1f :page #x67a))) + (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) + ) + (cond + ((< 75.0 f30-1) + (set! (-> obj sprites 0 angle) (* 182.04445 (- 180.0 (* 3.6 (+ -75.0 f30-1))))) + (set! (-> obj sprites 2 angle) 32768.0) + (set! (-> obj sprites 4 angle) 49152.0) + (set! (-> obj sprites 6 angle) 0.0) + ) + ((< 50.0 f30-1) + (set! (-> obj sprites 0 angle) 32768.0) + (set! (-> obj sprites 2 angle) (* 182.04445 (- 270.0 (* 3.6 (+ -50.0 f30-1))))) + (set! (-> obj sprites 4 angle) 49152.0) + (set! (-> obj sprites 6 angle) 0.0) + ) + ((< 25.0 f30-1) + (set! (-> obj sprites 0 angle) 32768.0) + (set! (-> obj sprites 2 angle) 49152.0) + (set! (-> obj sprites 4 angle) (* 182.04445 (- (* 3.6 (+ -25.0 f30-1))))) + (set! (-> obj sprites 6 angle) 0.0) + ) + (else + (set! (-> obj sprites 0 angle) 32768.0) + (set! (-> obj sprites 2 angle) 49152.0) + (set! (-> obj sprites 4 angle) 0.0) + (set! (-> obj sprites 6 angle) (* 182.04445 (- 90.0 (* 3.6 f30-1)))) + ) + ) + ) + (let ((v1-55 (-> obj values 0 current)) + (a0-25 12) + ) + (while (< a0-25 20) + (set! (-> obj sprites a0-25 scale-x) (if (> v1-55 0) + 1.0 + 0.0 + ) + ) + (+! a0-25 1) + (+! v1-55 -10) + ) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-health ((obj hud-health)) + (set! (-> obj values 0 target) (the int (* 10.0 (-> *target* fact-override health)))) + (set! (-> obj values 1 target) (the-as int (-> *target* fact-override health-pickup-time))) + (set! (-> obj values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) + (set! (-> obj values 3 target) (the-as int (-> *target* fact-override eco-pill-dark-pickup-time))) + (if (and (zero? (-> obj values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) + (set! (-> obj values 2 target) 100) + ) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-health ((obj hud-health)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-lower-left-1) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 0 pos z) #xfffff1) + (set! (-> obj sprites 0 scale-x) 8.0) + (set! (-> obj sprites 0 scale-y) 8.0) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> obj sprites 1 angle) 32768.0) + (set! (-> obj sprites 1 pos z) #xfffff0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 2 pos z) #xfffff3) + (set! (-> obj sprites 2 scale-x) 8.0) + (set! (-> obj sprites 2 scale-y) 8.0) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> obj sprites 3 angle) 49152.0) + (set! (-> obj sprites 3 pos z) #xfffff2) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 4 pos z) #xfffff5) + (set! (-> obj sprites 4 scale-x) 8.0) + (set! (-> obj sprites 4 scale-y) 8.0) + (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> obj sprites 5 angle) 0.0) + (set! (-> obj sprites 5 pos z) #xfffff4) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 6 pos z) #xfffff7) + (set! (-> obj sprites 6 scale-x) 8.0) + (set! (-> obj sprites 6 scale-y) 8.0) + (set! (-> obj sprites 7 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1a :page #x67a))) + (set! (-> obj sprites 7 angle) 16384.0) + (set! (-> obj sprites 7 pos z) #xfffff6) + (set! (-> obj sprites 8 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2 :page #x67a))) + (set! (-> obj sprites 9 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x67a))) + (set! (-> obj sprites 10 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #x67a))) + (set! (-> obj sprites 11 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #x67a))) + (set! (-> obj sprites 12 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> obj sprites 12 flags) (the-as uint 3)) + (set! (-> obj sprites 12 scale-x) 0.9) + (set! (-> obj sprites 12 scale-y) 1.0) + (set! (-> obj sprites 13 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> obj sprites 13 flags) (the-as uint 3)) + (set! (-> obj sprites 13 scale-x) 0.9) + (set! (-> obj sprites 13 scale-y) 1.0) + (set! (-> obj sprites 14 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> obj sprites 14 flags) (the-as uint 2)) + (set! (-> obj sprites 14 scale-x) 0.9) + (set! (-> obj sprites 14 scale-y) 1.0) + (set! (-> obj sprites 15 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> obj sprites 15 flags) (the-as uint 2)) + (set! (-> obj sprites 15 scale-x) 0.9) + (set! (-> obj sprites 15 scale-y) 1.0) + (set! (-> obj sprites 16 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> obj sprites 16 scale-x) 0.9) + (set! (-> obj sprites 16 scale-y) 1.0) + (set! (-> obj sprites 17 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> obj sprites 17 scale-x) 0.9) + (set! (-> obj sprites 17 scale-y) 1.0) + (set! (-> obj sprites 18 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x18 :page #x67a))) + (set! (-> obj sprites 18 flags) (the-as uint 1)) + (set! (-> obj sprites 18 scale-x) 0.9) + (set! (-> obj sprites 18 scale-y) 1.0) + (set! (-> obj sprites 19 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x2e :page #x67a))) + (set! (-> obj sprites 19 flags) (the-as uint 1)) + (set! (-> obj sprites 19 scale-x) 0.9) + (set! (-> obj sprites 19 scale-y) 1.0) + (set! (-> obj sprites 21 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #x67a))) + 0 + (none) + ) + +(defmethod draw hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) + (let ((v1-0 (process-by-name "hud-health" *active-pool*)) + (f30-0 (-> obj offset)) + ) + (if (and v1-0 (< (-> (the-as hud-health v1-0) offset) f30-0)) + (set! f30-0 (-> (the-as hud-health v1-0) offset)) + ) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + (the int (+ 13.0 (* -130.0 f30-0))) + (the int (+ 25.0 (* -130.0 f30-0))) + ) + (the int (+ 299.0 (* 130.0 f30-0))) + ) + (cond + ((or (= (-> obj values 2 target) 100) (= (-> *target* game eco-pill-dark) 100.0)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x11 :page #x67a))) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + (the int (+ 13.0 (* -130.0 f30-0))) + (the int (+ 25.0 (* -130.0 f30-0))) + ) + (the int (+ 299.0 (* 130.0 f30-0))) + ) + (set! (-> obj sprites 0 scale-x) 1.5) + (set! (-> obj sprites 0 scale-y) 1.5) + (let ((v1-31 + (+ (the int (* 15.0 (sin (* 182.04445 (the float (* (-> *display* game-clock frame-counter) 4)))))) 160) + ) + ) + (set! (-> obj sprites 0 color x) v1-31) + (set! (-> obj sprites 0 color y) v1-31) + (set! (-> obj sprites 0 color z) v1-31) + ) + ) + (else + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + (the int (+ 29.0 (* -130.0 f30-0))) + (the int (+ 36.0 (* -130.0 f30-0))) + ) + (the int (+ 315.0 (* 130.0 f30-0))) + ) + (set! (-> obj sprites 0 scale-x) 1.0) + (set! (-> obj sprites 0 scale-y) 1.0) + (set! (-> obj sprites 0 color x) 128) + (set! (-> obj sprites 0 color y) 128) + (set! (-> obj sprites 0 color z) 128) + ) + ) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) + (set! (-> obj values 0 target) (the int (* 10.0 (-> *target* fact-override health)))) + (set! (-> obj values 1 target) (the-as int (-> *target* fact-override health-pickup-time))) + (set! (-> obj values 2 target) (mod (the int (+ 0.5 (-> *target* game eco-pill-dark))) 100)) + (set! (-> obj values 3 target) (the-as int (-> *target* fact-override eco-pill-dark-pickup-time))) + (if (and (or (and (zero? (-> obj values 2 target)) (!= (-> *target* game eco-pill-dark) 0.0)) + (logtest? (focus-status dark) (-> *target* focus-status)) + ) + (and (not (logtest? (focus-status indax) (-> *target* focus-status))) + (-> *setting-control* user-current darkjak) + ) + ) + (set! (-> obj values 2 target) 100) + ) + (if (= (-> obj values 2 target) 100) + (+! (-> obj values 4 target) 1) + ) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-lower-left-2) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x10 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.5) + (set! (-> obj sprites 0 scale-y) 1.5) + 0 + (none) + ) + +(define *hud-skullgem* (the-as (pointer hud-skullgem) #f)) + +(defmethod draw hud-skullgem ((obj hud-skullgem)) + (set-hud-piece-position! + (the-as hud-sprite (&-> obj stack 2764)) + (the int (+ 60.0 (* -130.0 (-> obj offset)))) + 150 + ) + (set-as-offset-from! + (the-as hud-sprite (-> obj sprites)) + (the-as vector4w (&-> obj stack 2764)) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + -27 + -35 + ) + 20 + ) + (set! (-> obj sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 0.86 + 1.1 + ) + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (&-> obj stack 2764)) 0 45) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-skullgem ((obj hud-skullgem)) + (set! (-> obj values 0 target) (the int (-> *target* game gem))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-skullgem ((obj hud-skullgem)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-center-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (hud-create-icon obj 0 (the-as int (art-group-get-by-name *level* "skel-gem" (the-as (pointer uint32) #f)))) + (set! (-> obj icons 0 scale-x) 0.025) + (set! (-> obj icons 0 scale-y) 0.035) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 0.86) + (set! (-> obj sprites 0 scale-y) 1.05) + (set! (-> obj sprites 0 pos z) #xfff9ff) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (set! (-> obj strings 0 scale) 0.5) + 0 + (none) + ) + +(defmethod draw hud-skill ((obj hud-skill)) + (set-hud-piece-position! + (the-as hud-sprite (&-> obj stack 2764)) + (the int (+ 60.0 (* -130.0 (-> obj offset)))) + 270 + ) + (set-as-offset-from! + (the-as hud-sprite (-> obj sprites)) + (the-as vector4w (&-> obj stack 2764)) + (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + -19 + -25 + ) + -39 + ) + (set! (-> obj sprites 0 scale-x) (if (= (-> *setting-control* user-default aspect-ratio) 'aspect4x3) + 0.62 + 0.77 + ) + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (&-> obj stack 2764)) 0 -5) + (when (not (paused?)) + (let ((s5-1 (new 'stack-no-clear 'quaternion))) + (quaternion-axis-angle! s5-1 0.0 1.0 0.0 364.0889) + (quaternion*! (-> obj icons 0 icon 0 root-override quat) s5-1 (-> obj icons 0 icon 0 root-override quat)) + ) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-skill ((obj hud-skill)) + (set! (-> obj values 0 target) (the int (-> *target* game skill))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-skill ((obj hud-skill)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-middle-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (hud-create-icon obj 0 (the-as int (art-group-get-by-name *level* "skel-skill" (the-as (pointer uint32) #f)))) + (set! (-> obj icons 0 scale-x) 0.009) + (set! (-> obj icons 0 scale-y) -0.018) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x30 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 0.62) + (set! (-> obj sprites 0 scale-y) 1.34) + (set! (-> obj sprites 0 pos z) #xfff9ff) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (set! (-> obj strings 0 scale) 0.5) + (logior! (-> obj values 0 flags) 1) + 0 + (none) + ) + +(defmethod update-value-callback hud-skill ((obj hud-skill) (arg0 int) (arg1 int)) + (if (> arg1 0) + (sound-play "skill-pickup" :pitch 0.5) + ) + 0 + (none) + ) + +(defmethod draw hud-score ((obj hud-score)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 480.0 (* 130.0 (-> obj offset)))) + 140 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -12 8) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-score ((obj hud-score)) + (set! (-> obj values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-score ((obj hud-score)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-center-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.5) + (set! (-> obj strings 0 scale) 0.5) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 flags) (font-flags kerning right large)) + (set! (-> obj strings 0 color) (font-color precursor-#ec3b00)) + 0 + (none) + ) + +(defmethod draw hud-timer ((obj hud-timer)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + 264 + (the int (+ 50.0 (* -100.0 (-> obj offset)))) + ) + (format (clear (-> obj strings 0 text)) "~1,'0D" (/ (-> obj values 0 current) 10)) + (format (clear (-> obj strings 1 text)) "~1,'0D" (mod (-> obj values 0 current) 10)) + (format (clear (-> obj strings 2 text)) ":") + (format (clear (-> obj strings 3 text)) "~1,'0D" (/ (-> obj values 1 current) 10)) + (format (clear (-> obj strings 4 text)) "~1,'0D" (mod (-> obj values 1 current) 10)) + (let ((s5-5 20) + (s4-0 -42) + ) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) s4-0 -24) + (let ((s4-1 (+ s4-0 s5-5))) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) s4-1 -24) + (let ((s4-2 (+ s4-1 16))) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 2 pos)) (the-as vector4w (-> obj sprites)) s4-2 -24) + (let ((s4-3 (+ s4-2 16))) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 3 pos)) (the-as vector4w (-> obj sprites)) s4-3 -24) + (let ((a2-13 (+ s4-3 s5-5))) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 4 pos)) (the-as vector4w (-> obj sprites)) a2-13 -24) + ) + ) + ) + ) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-timer ((obj hud-timer)) + (set! (-> obj values 0 target) (/ (-> *game-info* timer) #x4650)) + (set! (-> obj values 1 target) (/ (mod (-> *game-info* timer) #x4650) 300)) + (let ((v1-8 (abs (- (-> obj values 1 target) (-> obj values 2 target))))) + (when (> v1-8 0) + (set! (-> obj values 2 target) (-> obj values 1 target)) + (if (and (< (-> obj values 0 target) 1) (< (-> obj values 1 target) 10)) + (sound-play "timer-warn") + (sound-play "timer-beep") + ) + ) + ) + (logclear! (-> obj flags) (hud-flags disable)) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-timer ((obj hud-timer)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) + (set! (-> obj sprites 0 flags) (the-as uint 8)) + (set! (-> obj sprites 0 scale-x) 2.2) + (set! (-> obj sprites 0 scale-y) 2.0) + (dotimes (s5-0 5) + (alloc-string-if-needed obj s5-0) + (set! (-> obj strings s5-0 scale) 0.8) + (set! (-> obj strings s5-0 flags) (font-flags kerning middle large)) + (set! (-> obj strings s5-0 color) (font-color green-#3df23d)) + ) + (set! (-> obj values 2 target) (-> obj values 1 target)) + 0 + (none) + ) + +(defmethod draw hud-big-score ((obj hud-big-score)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + 264 + (the int (+ 50.0 (* -100.0 (-> obj offset)))) + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) -7 -24) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-big-score ((obj hud-big-score)) + (set! (-> obj values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-big-score ((obj hud-big-score)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-center) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x16 :page #x67a))) + (set! (-> obj sprites 0 flags) (the-as uint 8)) + (set! (-> obj sprites 0 scale-x) 2.7) + (set! (-> obj sprites 0 scale-y) 2.0) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.8) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (set! (-> obj strings 0 color) (font-color green-#3df23d)) + 0 + (none) + ) + +(defmethod draw hud-goal ((obj hud-goal)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 65.0 (* -130.0 (-> obj offset)))) + 70 + ) + (format (clear (-> obj strings 0 text)) "~D" (-> obj values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) 0 -40) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-goal ((obj hud-goal)) + (set! (-> obj values 0 target) (the int (-> *game-info* goal))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-goal ((obj hud-goal)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 8)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.5) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (set! (-> obj strings 0 color) (font-color precursor-#ec3b00)) + (alloc-string-if-needed obj 1) + (set! (-> obj strings 1 scale) 0.75) + (set! (-> obj strings 1 flags) (font-flags kerning middle large)) + (set! (-> obj strings 1 color) (font-color precursor-#ec3b00)) + (let ((s5-0 format) + (gp-1 (clear (-> obj strings 1 text))) + (s4-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id text-x235) #f)) + (s5-0 gp-1 s4-0 *temp-string*) + ) + 0 + (none) + ) + +(defmethod draw hud-miss ((obj hud-miss)) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (the int (+ 448.0 (* 130.0 (-> obj offset)))) + 70 + ) + (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 0 current) (-> obj values 1 current)) + (let ((s5-1 format) + (s4-0 (clear (-> obj strings 1 text))) + (s3-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (game-text-id text-x277) #f)) + (s5-1 s4-0 s3-0 *temp-string*) + ) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 0 pos)) (the-as vector4w (-> obj sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> obj strings 1 pos)) (the-as vector4w (-> obj sprites)) 0 -40) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-miss ((obj hud-miss)) + (set! (-> obj values 0 target) (the int (-> *game-info* miss))) + (set! (-> obj values 1 target) (the int (-> *game-info* miss-max))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-miss ((obj hud-miss)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x14 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 flags) (the-as uint 8)) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 scale) 0.5) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (set! (-> obj strings 0 color) (font-color precursor-#ec3b00)) + (alloc-string-if-needed obj 1) + (set! (-> obj strings 1 scale) 0.75) + (set! (-> obj strings 1 flags) (font-flags kerning middle large)) + (set! (-> obj strings 1 color) (font-color precursor-#ec3b00)) + 0 + (none) + ) + +(defmethod draw hud-progress ((obj hud-progress)) + (with-pp + (let ((f0-0 (if (process-by-name "hud-timer" *active-pool*) + 65.0 + 35.0 + ) + ) + ) + (seek! (-> obj sprites 2 scale-y) f0-0 (* 2.0 (-> pp clock time-adjust-ratio))) + ) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + 256 + (the int (+ (* -100.0 (-> obj offset)) (-> obj sprites 2 scale-y))) + ) + (set-as-offset-from! + (-> obj sprites 1) + (the-as vector4w (-> obj sprites)) + (+ (the int (* 0.09 (the float (-> obj values 0 current)))) -42) + 0 + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + ) + +(defmethod update-values hud-progress ((obj hud-progress)) + (set! (-> obj values 0 target) (the int (* 1000.0 (-> *game-info* distance)))) + (logclear! (-> obj flags) (hud-flags disable)) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-progress ((obj hud-progress)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-center-2) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x33 :page #x67a))) + (set! (-> obj sprites 0 flags) (the-as uint 8)) + (set! (-> obj sprites 0 scale-x) 1.2) + (set! (-> obj sprites 0 scale-y) 1.2) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x34 :page #x67a))) + (set! (-> obj sprites 1 flags) (the-as uint 8)) + (set! (-> obj sprites 1 scale-x) 1.8) + (set! (-> obj sprites 1 scale-y) 1.8) + (set! (-> obj sprites 2 scale-y) (if (process-by-name "hud-timer" *active-pool*) + 65.0 + 35.0 + ) + ) + 0 + (none) + ) + +(defmethod draw hud-gun ((obj hud-gun)) + (local-vars (s3-0 int) (sv-16 int) (sv-32 dma-buffer)) + (let ((s4-0 0) + (s5-0 0) + ) + 0 + (let ((s2-0 20)) + (cond + ((= (-> obj values 0 current) 1) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xf :page #x67a))) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x23 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.1) + (set! (-> obj sprites 0 scale-y) 1.5) + (set! (-> obj sprites 1 scale-x) 0.0) + (set! s5-0 -3) + (set! s3-0 (the int (-> *FACT-bank* ammo-yellow-max))) + ) + ((= (-> obj values 0 current) 4) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xd :page #x67a))) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x21 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.8) + (set! (-> obj sprites 0 scale-y) 1.6) + (set! (-> obj sprites 1 scale-x) 0.0) + (set! s4-0 14) + (set! s3-0 (the int (-> *FACT-bank* ammo-dark-max))) + (set! s2-0 10) + ) + ((= (-> obj values 0 current) 3) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #x67a))) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #x67a))) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x20 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.4) + (set! (-> obj sprites 0 scale-y) 1.4) + (set! (-> obj sprites 1 scale-x) 1.4) + (set! (-> obj sprites 1 scale-y) 1.4) + (set! s4-0 43) + (set! s5-0 6) + (set! s3-0 (the int (-> *FACT-bank* ammo-blue-max))) + ) + (else + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xe :page #x67a))) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x22 :page #x67a))) + (set! (-> obj sprites 0 scale-x) 1.8) + (set! (-> obj sprites 0 scale-y) 1.6) + (set! (-> obj sprites 1 scale-x) 0.0) + (set! s4-0 14) + (set! s5-0 -2) + (set! s3-0 (the int (-> *FACT-bank* ammo-red-max))) + (set! s2-0 10) + ) + ) + (if (logtest? (-> *game-info* features) (game-feature gun-upgrade-ammo)) + (set! s3-0 (* s3-0 2)) + ) + (set-hud-piece-position! + (the-as hud-sprite (-> obj sprites)) + (- (the int (+ 507.0 (* 130.0 (-> obj offset)))) s4-0) + (the int (+ (- 25.0 (the float s5-0)) (* -100.0 (-> obj offset)))) + ) + (let ((f30-0 1.0)) + (cond + ((zero? (-> obj values 0 current)) + (set! f30-0 0.0) + (set! (-> obj strings 0 pos 0) 0) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -3 0) + ) + (else + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites)) -4 11) + (set-as-offset-from! + (the-as hud-sprite (-> obj strings 0 pos)) + (the-as vector4w (-> obj sprites)) + (+ s4-0 -70) + (+ s5-0 18) + ) + (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) (+ s4-0 -68) (+ (if (= s2-0 20) + 98 + 73 + ) + s5-0 + ) + ) + (set! (-> obj sprites 6 scale-x) 1.0) + (let ((s0-0 (mod (-> obj values 1 current) s2-0))) + (if (and (zero? s0-0) (nonzero? (-> obj values 1 current))) + (set! s0-0 s2-0) + ) + (set! sv-32 (-> *display* frames (-> *display* on-screen) global-buf)) + (let ((s1-0 (-> sv-32 base))) + (set! sv-16 0) + (while (< sv-16 s2-0) + (if (= sv-16 s0-0) + (set! (-> obj sprites 6 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x24 :page #x67a))) + ) + (draw (-> obj sprites 6) sv-32 (-> obj level)) + (+! (-> obj sprites 6 pos y) -5) + (if (= sv-16 (+ (/ s2-0 2) -1)) + (set-as-offset-from! (-> obj sprites 6) (the-as vector4w (-> obj sprites)) (+ s4-0 -83) (+ (if (= s2-0 20) + 98 + 73 + ) + s5-0 + ) + ) + ) + (set! sv-16 (+ sv-16 1)) + ) + (let ((a3-5 (-> sv-32 base))) + (let ((v1-67 (the-as dma-packet (-> sv-32 base)))) + (set! (-> v1-67 dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> v1-67 vif0) (new 'static 'vif-tag)) + (set! (-> v1-67 vif1) (new 'static 'vif-tag)) + (set! (-> sv-32 base) (the-as pointer (&+ v1-67 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id progress) + s1-0 + (the-as (pointer dma-tag) a3-5) + ) + ) + ) + ) + ) + ) + (set! (-> obj sprites 6 scale-x) 0.0) + (set! (-> obj sprites 2 scale-x) + (if (and (logtest? (-> *target* game features) (game-feature gun)) + (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-blue)) + (-> *target* game features) + ) + ) + f30-0 + 0.0 + ) + ) + (set! (-> obj sprites 3 scale-x) + (if (and (logtest? (-> *target* game features) (game-feature gun)) + (and (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-dark)) + (-> *target* game features) + ) + ) + ) + f30-0 + 0.0 + ) + ) + (set! (-> obj sprites 4 scale-x) + (if (and (logtest? (-> *target* game features) (game-feature gun)) + (and (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-red)) + (-> *target* game features) + ) + ) + ) + f30-0 + 0.0 + ) + ) + (set! (-> obj sprites 5 scale-x) + (if (and (logtest? (-> *target* game features) (game-feature gun)) + (and (-> *setting-control* user-current gun) + (logtest? (logand (-> *setting-control* user-current features) (game-feature gun-yellow)) + (-> *target* game features) + ) + ) + ) + f30-0 + 0.0 + ) + ) + ) + ) + (format (clear (-> obj strings 0 text)) "~D/~D" (-> obj values 1 current) s3-0) + (set-as-offset-from! (-> obj sprites 2) (the-as vector4w (-> obj sprites)) (+ s4-0 -110) (+ s5-0 18)) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites)) (+ s4-0 -36) (+ s5-0 19)) + (set-as-offset-from! (-> obj sprites 4) (the-as vector4w (-> obj sprites)) (+ s4-0 -78) (+ s5-0 7)) + (set-as-offset-from! (-> obj sprites 5) (the-as vector4w (-> obj sprites)) (+ s4-0 -78) (+ s5-0 37)) + ) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-gun ((obj hud-gun)) + (cond + ((logtest? (focus-status gun) (-> *target* focus-status)) + (set! (-> obj values 0 target) (the-as int (-> *target* gun gun-type))) + (set! (-> obj values 1 target) (the int (get-gun-ammo (-> *target* fact-override)))) + (logclear! (-> obj flags) (hud-flags disable)) + (logior! (-> obj flags) (hud-flags show)) + ) + (else + (logior! (-> obj flags) (hud-flags disable)) + (logclear! (-> obj flags) (hud-flags show)) + (send-event obj 'hide) + ) + ) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-gun ((obj hud-gun)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-right) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (set! (-> obj sprites 0 flags) (the-as uint 4)) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x8 :page #x67a))) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x9 :page #x67a))) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #x67a))) + (set! (-> obj sprites 5 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x7 :page #x67a))) + (alloc-string-if-needed obj 0) + (set! (-> obj strings 0 flags) (font-flags kerning middle large)) + (set! (-> obj strings 0 scale) 0.5) + (logior! (-> obj flags) (hud-flags disable)) + 0 + (none) + ) + +(defmethod draw hud-samos-young ((obj hud-samos-young)) + (set-hud-piece-position! + (-> obj sprites 2) + (the int (+ 30.0 (* -130.0 (-> obj offset)))) + (the int (+ 30.0 (* -100.0 (-> obj offset)))) + ) + (set! (-> obj sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> obj values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> obj sprites)) (the-as vector4w (-> obj sprites 2)) 40 16) + (set-as-offset-from! (-> obj sprites 1) (the-as vector4w (-> obj sprites 2)) 1 16) + (set-as-offset-from! (-> obj sprites 3) (the-as vector4w (-> obj sprites 2)) 7 5) + ((method-of-type hud draw) obj) + 0 + (none) + ) + +(defmethod update-values hud-samos-young ((obj hud-samos-young)) + (set! (-> obj values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values) obj) + 0 + (none) + ) + +(defmethod init-callback hud-samos-young ((obj hud-samos-young)) + (set! (-> obj gui-id) + (add-process *gui-control* obj (gui-channel hud-upper-left) (gui-action hidden) (-> obj name) 81920.0 0) + ) + (logior! (-> obj flags) (hud-flags show)) + (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x1e :page #x67a))) + (set! (-> obj sprites 0 scale-x) 12.0) + (set! (-> obj sprites 0 scale-y) 11.2) + (set! (-> obj sprites 0 pos z) #xfffff2) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x25 :page #x67a))) + (set! (-> obj sprites 1 pos z) #xfffff0) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x12 :page #x67a))) + (set! (-> obj sprites 2 pos z) #xffffff) + (set! (-> obj sprites 3 tex) + (lookup-texture-by-name "hud-samos-young-head-01" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + (set! (-> obj sprites 3 scale-x) 0.8) + (set! (-> obj sprites 3 scale-y) 0.8) + (set! (-> obj sprites 3 pos z) #xffffff) + 0 + (none) + ) + +(defun activate-hud ((arg0 target)) + (process-spawn hud-dark-eco-symbol :init hud-init-by-other :to arg0) + (process-spawn hud-health :init hud-init-by-other :to arg0) + (process-spawn hud-map :init hud-init-by-other :to arg0) + (set! *hud-skullgem* (process-spawn hud-skullgem :init hud-init-by-other :to arg0)) + (process-spawn hud-skill :init hud-init-by-other :to arg0) + (process-spawn hud-gun :init hud-init-by-other :to arg0) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/ui/hud-h.gc b/goal_src/jak2/engine/ui/hud-h.gc index abf554065b..0c1660e9f5 100644 --- a/goal_src/jak2/engine/ui/hud-h.gc +++ b/goal_src/jak2/engine/ui/hud-h.gc @@ -8,6 +8,9 @@ (defenum hud-flags :type uint32 :bitfield #t + (disable 0) + (should-die 1) + (show 2) ) ;; NOTE - for progress @@ -18,16 +21,20 @@ (define-extern show-hud (function object none)) (declare-type hud process) (define-extern hud-init-by-other (function object :behavior hud)) +(define-extern hud-arriving (state hud)) +(define-extern hud-leaving (state float hud)) +(define-extern hud-in (state hud)) ;; DECOMP BEGINS (deftype hud-string (basic) - ((text string :offset-assert 4) - (scale float :offset-assert 8) - (color uint32 :offset-assert 12) - (flags uint32 :offset-assert 16) - (pos vector4w :inline :offset-assert 32) + ((text string :offset-assert 4) + (scale float :offset-assert 8) + (color font-color :offset-assert 12) + (flags font-flags :offset-assert 16) + (pos int32 4 :offset 32) ) + :allow-misaligned :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 @@ -37,6 +44,7 @@ (deftype hud-sprite (structure) ((pos vector4w :inline :offset-assert 0) (color vector4w :inline :offset-assert 16) + (color2 int32 4 :offset 16) (flags uint32 :offset-assert 32) (scale-x float :offset-assert 36) (scale-y float :offset-assert 40) @@ -47,7 +55,7 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (hud-sprite-method-9 (_type_ dma-buffer level) none 9) + (draw (_type_ dma-buffer level) none 9) (hud-sprite-method-10 (_type_) none 10) ) ) @@ -62,23 +70,24 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (hud-box-method-9 (_type_ dma-buffer) none 9) - (hud-box-method-10 () none 10) - (hud-box-method-11 () none 11) - (hud-box-method-12 () none 12) - (hud-box-method-13 (_type_ dma-buffer float) int 13) - (hud-box-method-14 (_type_) none 14) - (hud-box-method-15 (_type_) none 15) + (draw-box-prim-only (_type_ dma-buffer) none 9) + (draw-box-alpha-1 (_type_ dma-buffer) none 10) + (draw-box-alpha-2 (_type_ dma-buffer) none 11) + (draw-box-alpha-3 (_type_ dma-buffer) none 12) + (draw-scan-and-line (_type_ dma-buffer float) int 13) + (setup-scissor (_type_ dma-buffer) none 14) + (restore-scissor (_type_ dma-buffer) none 15) ) ) (deftype hud-icon (basic) - ((icon (pointer manipy) :offset-assert 4) - (pos vector4w :inline :offset-assert 16) - (scale-x float :offset-assert 32) - (scale-y float :offset-assert 36) + ((icon (pointer manipy) :offset-assert 4) + (pos int32 4 :offset 16) + (scale-x float :offset-assert 32) + (scale-y float :offset-assert 36) ) + :allow-misaligned :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 @@ -91,7 +100,7 @@ (flags uint16 :offset-assert 12) (counter uint16 :offset-assert 14) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -103,11 +112,11 @@ (last-hide-time time-frame :offset-assert 136) (offset float :offset-assert 144) (flags hud-flags :offset-assert 148) - (values hud-value 8 :inline :offset-assert 152) - (strings hud-string 14 :inline :offset-assert 288) - (sprites hud-sprite 30 :inline :offset-assert 960) - (icons hud-icon 2 :inline :offset-assert 2880) - (gui-id sound-id :offset-assert 2976) + (values hud-value 8 :inline :offset 148) + (strings hud-string 14 :inline :offset 284) + (sprites hud-sprite 30 :inline :offset 960) + (icons hud-icon 2 :inline :offset 2876) + (gui-id sound-id :offset 2976) ) :heap-base #xb30 :method-count-assert 27 @@ -115,18 +124,18 @@ :flag-assert #x1b0b300ba4 (:methods (hidden? (_type_) symbol 14) - (hud-method-15 (_type_) none 15) - (hud-method-16 (_type_ int int) none 16) - (hud-method-17 (_type_) none 17) - (hud-method-18 (_type_) symbol 18) + (draw (_type_) none 15) + (update-values (_type_) none 16) + (init-callback (_type_) none 17) + (event-callback (_type_ process int symbol event-message-block) symbol 18) (hud-method-19 (_type_) none 19) (hud-method-20 (_type_) none 20) (hud-method-21 (_type_) none 21) (hud-method-22 (_type_) none 22) (hud-method-23 (_type_) none 23) - (hud-method-24 (_type_ symbol) none 24) - (hud-method-25 (_type_) none 25) - (hud-method-26 (_type_ int) none 26) + (check-ready-and-maybe-show (_type_ symbol) symbol 24) + (update-value-callback (_type_ int int) none 25) + (alloc-string-if-needed (_type_ int) none 26) ) ) diff --git a/goal_src/jak2/engine/ui/hud.gc b/goal_src/jak2/engine/ui/hud.gc index 07d256d376..9ddaf14670 100644 --- a/goal_src/jak2/engine/ui/hud.gc +++ b/goal_src/jak2/engine/ui/hud.gc @@ -7,10 +7,1324 @@ ;; DECOMP BEGINS +(defmethod check-ready-and-maybe-show hud ((obj hud) (arg0 symbol)) + "Is this element ready to be shown? If arg0 is set, show it now." + (case (get-status *gui-control* (-> obj gui-id)) + (((gui-status ready) (gui-status active)) + (if arg0 + (set-action! + *gui-control* + (gui-action play) + (-> obj gui-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + #t + ) + (else + #f + ) + ) + ) + +(deftype hud-sprite-work (structure) + ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl dma-gif-packet :inline :offset-assert 32) + (draw-tmpl dma-gif-packet :inline :offset-assert 64) + (box-tmpl dma-gif-packet :inline :offset-assert 96) + (box2-tmpl dma-gif-packet :inline :offset-assert 128) + (mask-tmpl dma-gif-packet :inline :offset-assert 160) + (line-tmpl dma-gif-packet :inline :offset-assert 192) + (scan-tmpl dma-gif-packet :inline :offset-assert 224) + (line-color gs-rgbaq :offset-assert 256) + (scan-colors vector4w 32 :inline :offset 272) + (scanline uint32 :offset 784) + ) + :method-count-assert 9 + :size-assert #x314 + :flag-assert #x900000314 + ) + + +(define *hud-sprite-work* (new 'static 'hud-sprite-work + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) + ) + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id xyz2) + ) + ) + :draw-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xd :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xd :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1 :abe #x1) + :nreg #xc + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id rgbaq) + :regs4 (gif-reg-id st) + :regs5 (gif-reg-id xyz2) + :regs6 (gif-reg-id rgbaq) + :regs7 (gif-reg-id st) + :regs8 (gif-reg-id xyz2) + :regs9 (gif-reg-id rgbaq) + :regs10 (gif-reg-id st) + :regs11 (gif-reg-id xyz2) + ) + ) + :box-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x7 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x7 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :abe #x1) + :nreg #x6 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyz2) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id xyz2) + :regs4 (gif-reg-id xyz2) + :regs5 (gif-reg-id xyz2) + ) + ) + :box2-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :abe #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyz2) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id xyz2) + :regs4 (gif-reg-id xyz2) + ) + ) + :mask-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :abe #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyz2) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id xyz2) + :regs4 (gif-reg-id xyz2) + ) + ) + :line-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x2 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :abe #x1) + :nreg #x2 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id xyz2) + :regs1 (gif-reg-id xyz2) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id xyz2) + ) + ) + :scan-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xa1 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xa1 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x20 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :abe #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyz2) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id xyz2) + :regs4 (gif-reg-id xyz2) + ) + ) + :line-color (new 'static 'gs-rgbaq :r #x80 :g #x80 :b #x80 :a #x80 :q 1.0) + :scan-colors (new 'static 'inline-array vector4w 32 + (new 'static 'vector4w :y 1 :z 1) + (new 'static 'vector4w :x 1 :y 2 :z 1) + (new 'static 'vector4w :x 1 :y 3 :z 2) + (new 'static 'vector4w :x 2 :y 6 :z 4) + (new 'static 'vector4w :x 2 :y 8 :z 6) + (new 'static 'vector4w :x 4 :y 12 :z 10) + (new 'static 'vector4w :x 4 :y 12 :z 10) + (new 'static 'vector4w :x 4 :y 12 :z 10) + (new 'static 'vector4w :x 6 :y 16 :z 14) + (new 'static 'vector4w :x 6 :y 16 :z 14) + (new 'static 'vector4w :x 6 :y 16 :z 14) + (new 'static 'vector4w :x 6 :y 16 :z 14) + (new 'static 'vector4w :x 10 :y 22 :z 20) + (new 'static 'vector4w :x 10 :y 22 :z 20) + (new 'static 'vector4w :x 10 :y 22 :z 20) + (new 'static 'vector4w :x 10 :y 22 :z 20) + (new 'static 'vector4w :x 12 :y 28 :z 26) + (new 'static 'vector4w :x 12 :y 28 :z 26) + (new 'static 'vector4w :x 12 :y 28 :z 26) + (new 'static 'vector4w :x 12 :y 28 :z 26) + (new 'static 'vector4w :x 18 :y 40 :z 34) + (new 'static 'vector4w :x 18 :y 40 :z 34) + (new 'static 'vector4w :x 18 :y 40 :z 34) + (new 'static 'vector4w :x 18 :y 40 :z 34) + (new 'static 'vector4w :x 26 :y 54 :z 42) + (new 'static 'vector4w :x 26 :y 54 :z 42) + (new 'static 'vector4w :x 26 :y 54 :z 42) + (new 'static 'vector4w :x 26 :y 54 :z 42) + (new 'static 'vector4w :x 34 :y 72 :z 48) + (new 'static 'vector4w :x 34 :y 72 :z 48) + (new 'static 'vector4w :x 44 :y 90 :z 56) + (new 'static 'vector4w :x 64 :y #x7e :z 64) + ) + :scanline #x60 + ) + ) + +(defmethod draw-scan-and-line hud-box ((obj hud-box) (arg0 dma-buffer) (arg1 float)) + (let ((v1-0 *hud-sprite-work*) + (f0-0 (-> *video-params* relative-x-scale)) + ) + (set! (-> v1-0 line-color a) (the int (* 24.0 arg1))) + (let ((a2-1 (the int (* 255.0 arg1)))) + (dotimes (a3-5 15) + (set! (-> v1-0 scan-colors a3-5 w) a2-1) + ) + ) + (let* ((a2-8 (* (+ (the int (* (+ -256.0 (-> obj min x)) f0-0)) 256 1792) 16)) + (a3-10 (* (+ (the int (* (+ -256.0 (-> obj max x)) f0-0)) 256 1792) 16)) + (t0-9 (* (+ (the int (-> obj min y)) 1840) 16)) + (t2-0 (the int (- (-> obj max y) (-> obj min y)))) + (t1-0 (/ t2-0 4)) + ) + (let* ((t3-0 arg0) + (t4-0 (the-as dma-packet (-> t3-0 base))) + ) + (set! (-> t4-0 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> t4-0 vif0) (new 'static 'vif-tag)) + (set! (-> t4-0 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> t3-0 base) (the-as pointer (&+ t4-0 16))) + ) + (let* ((t3-1 arg0) + (t4-2 (the-as gs-gif-tag (-> t3-1 base))) + ) + (set! (-> t4-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> t4-2 regs) GIF_REGS_ALL_AD) + (set! (-> t3-1 base) (the-as pointer (&+ t4-2 16))) + ) + (let* ((t3-2 arg0) + (t4-4 (-> t3-2 base)) + ) + (set! (-> (the-as (pointer gs-test) t4-4) 0) + (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) t4-4) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) t4-4) 2) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) t4-4) 3) (gs-reg64 alpha-1)) + (set! (-> t3-2 base) (&+ t4-4 32)) + ) + (set! (-> v1-0 scanline) (mod (+ (-> v1-0 scanline) 6) (the-as uint t2-0))) + (let ((t3-6 (the-as (pointer uint128) (-> arg0 base)))) + (set! (-> t3-6 0) (-> v1-0 scan-tmpl dma-vif quad)) + (set! (-> t3-6 1) (-> v1-0 scan-tmpl quad 1)) + ) + (&+! (-> arg0 base) 32) + (let ((a0-2 (+ (the int (-> obj min y)) 1840))) + (dotimes (t3-9 32) + (let ((t4-8 (the-as (inline-array vector4w) (-> arg0 base))) + (t5-13 (* (+ a0-2 (mod (+ (-> v1-0 scanline) (* t3-9 2)) (the-as uint t2-0))) 16)) + (t6-6 (* (+ a0-2 (mod (the-as uint (+ (* t3-9 2) 1 (-> v1-0 scanline))) (the-as uint t2-0))) 16)) + ) + (set! (-> t4-8 0 quad) (-> v1-0 scan-colors t3-9 quad)) + (set-vector! (-> t4-8 1) a2-8 t5-13 0 0) + (set-vector! (-> t4-8 2) a3-10 t5-13 0 0) + (set-vector! (-> t4-8 3) a2-8 t6-6 0 0) + (set-vector! (-> t4-8 4) a3-10 t6-6 0 0) + ) + (&+! (-> arg0 base) 80) + ) + ) + (let* ((a0-5 arg0) + (t2-1 (the-as dma-packet (-> a0-5 base))) + ) + (set! (-> t2-1 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> t2-1 vif0) (new 'static 'vif-tag)) + (set! (-> t2-1 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a0-5 base) (the-as pointer (&+ t2-1 16))) + ) + (let* ((a0-6 arg0) + (t2-3 (the-as gs-gif-tag (-> a0-6 base))) + ) + (set! (-> t2-3 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> t2-3 regs) GIF_REGS_ALL_AD) + (set! (-> a0-6 base) (the-as pointer (&+ t2-3 16))) + ) + (let* ((a0-7 arg0) + (t2-5 (-> a0-7 base)) + ) + (set! (-> (the-as (pointer gs-alpha) t2-5) 0) (new 'static 'gs-alpha :a #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) t2-5) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-rgbaq) t2-5) 2) (-> v1-0 line-color)) + (set! (-> (the-as (pointer gs-reg64) t2-5) 3) (gs-reg64 rgbaq)) + (set! (-> a0-7 base) (&+ t2-5 32)) + ) + (dotimes (a0-8 t1-0) + (let ((t2-7 (the-as (inline-array vector4w) (-> arg0 base)))) + (set! (-> t2-7 0 quad) (-> v1-0 line-tmpl dma-vif quad)) + (set! (-> t2-7 1 quad) (-> v1-0 line-tmpl quad 1)) + (set-vector! (-> t2-7 2) a2-8 t0-9 #xffffff 0) + (set-vector! (-> t2-7 3) a3-10 t0-9 #xffffff 0) + (set-vector! (-> t2-7 4) a2-8 (+ t0-9 16) #xffffff 0) + (set-vector! (-> t2-7 5) a3-10 (+ t0-9 16) #xffffff 0) + ) + (&+! (-> arg0 base) 96) + (+! t0-9 64) + ) + ) + ) + 0 + ) + +(defmethod draw hud-sprite ((obj hud-sprite) (arg0 dma-buffer) (arg1 level)) + (local-vars + (v1-5 uint128) + (a1-14 int) + (a2-3 int) + (a3-0 int) + (t0-2 int) + (t1-0 int) + (t3-0 int) + (t5-0 int) + (t6-0 int) + ) + (let ((s4-0 *hud-sprite-work*) + (s3-0 (-> obj tex)) + (f28-0 0.0) + (f30-0 1.0) + ) + (when (!= (-> obj angle) 0.0) + (set! f28-0 (sin (-> obj angle))) + (set! f30-0 (cos (-> obj angle))) + ) + (when s3-0 + (let ((v1-4 (-> arg1 texture-mask 8 mask quad)) + (a0-3 (-> s3-0 masks data 0 mask quad)) + ) + (.por v1-5 v1-4 a0-3) + ) + (set! (-> arg1 texture-mask 8 mask quad) v1-5) + (let ((v1-6 (the-as (pointer uint128) (-> arg0 base)))) + (set! (-> v1-6 0) (-> s4-0 adgif-tmpl dma-vif quad)) + (set! (-> v1-6 1) (-> s4-0 adgif-tmpl quad 1)) + (adgif-shader<-texture-simple! (the-as adgif-shader (&-> v1-6 2)) s3-0) + ) + (&+! (-> arg0 base) 112) + (let ((v1-9 (the-as (inline-array structure) (-> arg0 base))) + (t0-0 (the int (* f30-0 (the float (-> s3-0 w)) (-> obj scale-x) (-> *video-params* relative-x-scale)))) + (a2-1 (the int (* -1.0 (-> obj scale-x) (the float (-> s3-0 w)) f28-0))) + (t4-0 (the int (* f28-0 (the float (-> s3-0 h)) (-> obj scale-y) (-> *video-params* relative-x-scale)))) + (t2-0 (the int (* f30-0 (the float (-> s3-0 h)) (-> obj scale-y)))) + (a0-15 (if (nonzero? (-> obj pos z)) + (-> obj pos z) + #xffffff + ) + ) + ) + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + (cond + ((logtest? (-> obj flags) 4) + (set! t1-0 (+ (-> obj pos x) 1792)) + (set! t3-0 (+ (-> obj pos y) 1840)) + (set! a1-14 (- t1-0 t0-0)) + (set! a3-0 (- t3-0 a2-1)) + (set! t5-0 (+ (- t1-0 t0-0) t4-0)) + (set! t6-0 (+ (- t3-0 a2-1) t2-0)) + (set! t0-2 (+ t1-0 t4-0)) + (set! a2-3 (+ t3-0 t2-0)) + ) + ((logtest? (-> obj flags) 8) + (set! a1-14 (+ (- 1792 (the int (* 0.5 (the float (+ t0-0 t4-0))))) (-> obj pos x))) + (set! a3-0 (+ (- 1840 (the int (* 0.5 (the float (+ a2-1 t2-0))))) (-> obj pos y))) + (set! t1-0 (+ (the int (* 0.5 (the float (+ t0-0 t4-0)))) 1792 (-> obj pos x))) + (set! t3-0 (+ (- 1840 (the int (* 0.5 (the float (+ a2-1 t2-0))))) (-> obj pos y))) + (set! t5-0 (+ (- 1792 (the int (* 0.5 (the float (+ t0-0 t4-0))))) (-> obj pos x))) + (set! t6-0 (+ (the int (* 0.5 (the float (+ a2-1 t2-0)))) 1840 (-> obj pos y))) + (set! t0-2 (+ (the int (* 0.5 (the float (+ t0-0 t4-0)))) 1792 (-> obj pos x))) + (set! a2-3 (+ (the int (* 0.5 (the float (+ a2-1 t2-0)))) 1840 (-> obj pos y))) + ) + (else + (set! a1-14 (+ (-> obj pos x) 1792)) + (set! a3-0 (+ (-> obj pos y) 1840)) + (set! t1-0 (+ a1-14 t0-0)) + (set! t3-0 (+ a3-0 a2-1)) + (set! t5-0 (+ a1-14 t4-0)) + (set! t6-0 (+ a3-0 t2-0)) + (set! t0-2 (+ a1-14 t0-0 t4-0)) + (set! a2-3 (+ a3-0 a2-1 t2-0)) + ) + ) + (set! (-> (the-as (inline-array vector) v1-9) 0 quad) (-> s4-0 draw-tmpl dma-vif quad)) + (set! (-> (the-as (inline-array vector) v1-9) 1 quad) (-> s4-0 draw-tmpl quad 1)) + (set! (-> (the-as (inline-array vector) v1-9) 2 quad) (-> obj color quad)) + (set! (-> (the-as (inline-array vector) v1-9) 5 quad) (-> obj color quad)) + (set! (-> (the-as (inline-array vector) v1-9) 8 quad) (-> obj color quad)) + (set! (-> (the-as (inline-array vector) v1-9) 11 quad) (-> obj color quad)) + (let ((f0-49 (if (logtest? (-> obj flags) 1) + 1.0 + 0.0 + ) + ) + (f1-25 (if (logtest? (-> obj flags) 2) + 1.0 + 0.0 + ) + ) + ) + (set-vector! (-> (the-as (inline-array vector) v1-9) 3) f0-49 f1-25 1.0 0.0) + (set-vector! (-> (the-as (inline-array vector) v1-9) 6) (- 1.0 f0-49) f1-25 1.0 0.0) + (set-vector! (-> (the-as (inline-array vector) v1-9) 9) f0-49 (- 1.0 f1-25) 1.0 0.0) + (set-vector! (-> (the-as (inline-array vector) v1-9) 12) (- 1.0 f0-49) (- 1.0 f1-25) 1.0 0.0) + ) + (set-vector! (-> (the-as (inline-array vector4w) v1-9) 4) (* a1-14 16) (* a3-0 16) a0-15 #x10000) + (set-vector! (-> (the-as (inline-array vector4w) v1-9) 7) (* t1-0 16) (* t3-0 16) a0-15 #x10000) + (set-vector! (-> (the-as (inline-array vector4w) v1-9) 10) (* t5-0 16) (* t6-0 16) a0-15 #x10000) + (set-vector! (-> (the-as (inline-array vector4w) v1-9) 13) (* t0-2 16) (* a2-3 16) a0-15 #x10000) + ) + (&+! (-> arg0 base) 224) + ) + ) + 0 + (none) + ) + + +(defmethod draw-box-prim-only hud-box ((obj hud-box) (arg0 dma-buffer)) + (let ((t1-0 *hud-sprite-work*) + (v1-0 (the-as (inline-array vector4w) (-> arg0 base))) + (a2-2 (* (+ (the int (-> obj min x)) 1792) 16)) + (t0-0 (* (+ (the int (-> obj max x)) 1792) 16)) + (a3-4 (* (+ (the int (-> obj min y)) 1840) 16)) + ) + (let ((t2-2 (* (+ (the int (-> obj max y)) 1840) 16))) + (set! (-> v1-0 0 quad) (-> t1-0 box-tmpl dma-vif quad)) + (set! (-> v1-0 1 quad) (-> t1-0 box-tmpl quad 1)) + (set! (-> v1-0 2 quad) (-> obj color quad)) + (set-vector! (-> v1-0 3) a2-2 a3-4 #xffffff 0) + (set-vector! (-> v1-0 4) t0-0 a3-4 #xffffff 0) + (set-vector! (-> v1-0 5) t0-0 t2-2 #xffffff 0) + (set-vector! (-> v1-0 6) a2-2 t2-2 #xffffff 0) + ) + (set-vector! (-> v1-0 7) a2-2 a3-4 #xffffff 0) + ) + (&+! (-> arg0 base) 128) + 0 + (none) + ) + +(defmethod draw-box-alpha-1 hud-box ((obj hud-box) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a2-0 (the-as dma-packet (-> v1-0 base))) + ) + (set! (-> a2-0 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> a2-0 vif0) (new 'static 'vif-tag)) + (set! (-> a2-0 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ a2-0 16))) + ) + (let* ((v1-1 arg0) + (a2-2 (the-as gs-gif-tag (-> v1-1 base))) + ) + (set! (-> a2-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> a2-2 regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (the-as pointer (&+ a2-2 16))) + ) + (let* ((v1-2 arg0) + (a2-4 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-test) a2-4) 0) + (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a2-4) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a2-4) 2) (new 'static 'gs-alpha :a #x1 :d #x2)) + (set! (-> (the-as (pointer gs-reg64) a2-4) 3) (gs-reg64 alpha-1)) + (set! (-> v1-2 base) (&+ a2-4 32)) + ) + (let ((t0-0 *hud-sprite-work*) + (v1-3 (the-as (inline-array vector4w) (-> arg0 base))) + (a2-8 (* (+ (the int (-> obj min x)) 1792) 16)) + (a3-11 (* (+ (the int (-> obj max x)) 1792) 16)) + (t2-0 (* (+ (the int (-> obj min y)) 1840) 16)) + (t1-4 (* (+ (the int (-> obj max y)) 1840) 16)) + ) + (set! (-> v1-3 0 quad) (-> t0-0 box2-tmpl dma-vif quad)) + (set! (-> v1-3 1 quad) (-> t0-0 box2-tmpl quad 1)) + (set! (-> v1-3 2 quad) (-> obj color quad)) + (set-vector! (-> v1-3 3) a2-8 t2-0 #xffffff 0) + (set-vector! (-> v1-3 4) a3-11 t2-0 #xffffff 0) + (set-vector! (-> v1-3 5) a2-8 t1-4 #xffffff 0) + (set-vector! (-> v1-3 6) a3-11 t1-4 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +(defmethod draw-box-alpha-2 hud-box ((obj hud-box) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a2-0 (the-as dma-packet (-> v1-0 base))) + ) + (set! (-> a2-0 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> a2-0 vif0) (new 'static 'vif-tag)) + (set! (-> a2-0 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ a2-0 16))) + ) + (let* ((v1-1 arg0) + (a2-2 (the-as gs-gif-tag (-> v1-1 base))) + ) + (set! (-> a2-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> a2-2 regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (the-as pointer (&+ a2-2 16))) + ) + (let* ((v1-2 arg0) + (a2-4 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-test) a2-4) 0) + (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a2-4) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a2-4) 2) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a2-4) 3) (gs-reg64 alpha-1)) + (set! (-> v1-2 base) (&+ a2-4 32)) + ) + (let ((t0-0 *hud-sprite-work*) + (v1-3 (the-as (inline-array vector4w) (-> arg0 base))) + (a2-8 (* (+ (the int (-> obj min x)) 1792) 16)) + (a3-11 (* (+ (the int (-> obj max x)) 1792) 16)) + (t2-0 (* (+ (the int (-> obj min y)) 1840) 16)) + (t1-4 (* (+ (the int (-> obj max y)) 1840) 16)) + ) + (set! (-> v1-3 0 quad) (-> t0-0 box2-tmpl dma-vif quad)) + (set! (-> v1-3 1 quad) (-> t0-0 box2-tmpl quad 1)) + (set! (-> v1-3 2 quad) (-> obj color quad)) + (set-vector! (-> v1-3 3) a2-8 t2-0 #xffffff 0) + (set-vector! (-> v1-3 4) a3-11 t2-0 #xffffff 0) + (set-vector! (-> v1-3 5) a2-8 t1-4 #xffffff 0) + (set-vector! (-> v1-3 6) a3-11 t1-4 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +(defmethod draw-box-alpha-3 hud-box ((obj hud-box) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a2-0 (the-as dma-packet (-> v1-0 base))) + ) + (set! (-> a2-0 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))) + (set! (-> a2-0 vif0) (new 'static 'vif-tag)) + (set! (-> a2-0 vif1) (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ a2-0 16))) + ) + (let* ((v1-1 arg0) + (a2-2 (the-as gs-gif-tag (-> v1-1 base))) + ) + (set! (-> a2-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x2)) + (set! (-> a2-2 regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (the-as pointer (&+ a2-2 16))) + ) + (let* ((v1-2 arg0) + (a2-4 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-test) a2-4) 0) + (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + ) + (set! (-> (the-as (pointer gs-reg64) a2-4) 1) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-alpha) a2-4) 2) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a2-4) 3) (gs-reg64 alpha-1)) + (set! (-> v1-2 base) (&+ a2-4 32)) + ) + (let ((t0-0 *hud-sprite-work*) + (v1-3 (the-as (inline-array vector4w) (-> arg0 base))) + (a2-8 (* (+ (the int (-> obj min x)) 1792) 16)) + (a3-11 (* (+ (the int (-> obj max x)) 1792) 16)) + (t2-0 (* (+ (the int (-> obj min y)) 1840) 16)) + (t1-4 (* (+ (the int (-> obj max y)) 1840) 16)) + ) + (set! (-> v1-3 0 quad) (-> t0-0 box2-tmpl dma-vif quad)) + (set! (-> v1-3 1 quad) (-> t0-0 box2-tmpl quad 1)) + (set! (-> v1-3 2 quad) (-> obj color quad)) + (set-vector! (-> v1-3 3) a2-8 t2-0 #xffffff 0) + (set-vector! (-> v1-3 4) a3-11 t2-0 #xffffff 0) + (set-vector! (-> v1-3 5) a2-8 t1-4 #xffffff 0) + (set-vector! (-> v1-3 6) a3-11 t1-4 #xffffff 0) + ) + (&+! (-> arg0 base) 112) + 0 + (none) + ) + +(defmethod setup-scissor hud-box ((obj hud-box) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a2-0 (the-as dma-packet (-> v1-0 base))) + ) + (set! (-> a2-0 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> a2-0 vif0) (new 'static 'vif-tag)) + (set! (-> a2-0 vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ a2-0 16))) + ) + (let* ((v1-1 arg0) + (a2-2 (the-as gs-gif-tag (-> v1-1 base))) + ) + (set! (-> a2-2 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> a2-2 regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (the-as pointer (&+ a2-2 16))) + ) + (let* ((v1-2 arg0) + (a1-1 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-scissor) a1-1) 0) (new 'static 'gs-scissor + :scax0 (the int (-> obj min x)) + :scay0 (the int (-> obj min y)) + :scax1 (the int (-> obj max x)) + :scay1 (the int (-> obj max y)) + ) + ) + (set! (-> (the-as (pointer gs-reg64) a1-1) 1) (gs-reg64 scissor-1)) + (set! (-> v1-2 base) (&+ a1-1 16)) + ) + 0 + (none) + ) + +(defmethod restore-scissor hud-box ((obj hud-box) (arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as dma-packet (-> v1-0 base))) + ) + (set! (-> a0-1 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> a0-1 vif0) (new 'static 'vif-tag)) + (set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ a0-1 16))) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as gs-gif-tag (-> v1-1 base))) + ) + (set! (-> a0-3 tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> a0-3 regs) GIF_REGS_ALL_AD) + (set! (-> v1-1 base) (the-as pointer (&+ a0-3 16))) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-scissor) a0-5) 0) (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 scissor-1)) + (set! (-> v1-2 base) (&+ a0-5 16)) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch process vs hud. +(defmethod relocate hud ((obj hud) (arg0 int)) + (dotimes (v1-0 14) + (if (-> obj strings v1-0 text) + (&+! (-> obj strings v1-0 text) arg0) + ) + ) + (the-as hud ((method-of-type process relocate) obj arg0)) + ) + +;; WARN: Failed store: (s.w! (+ v1-47 8) 0) at op 126 +;; WARN: Failed store: (s.w! (+ v1-47 12) 0) at op 127 +(defmethod draw hud ((obj hud)) + (when (not (hidden? obj)) + (with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id progress) + ) + (dotimes (s3-0 30) + (if (and (-> obj sprites s3-0 tex) (!= (-> obj sprites s3-0 scale-x) 0.0)) + (draw (-> obj sprites s3-0) s4-0 (-> obj level)) + ) + ) + (let ((s3-1 (new + 'stack + 'font-context + *font-default-matrix* + 0 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + ) + (dotimes (s2-0 14) + (when (and (-> obj strings s2-0 text) (nonzero? (-> obj strings s2-0 pos 0))) + (set-vector! + (-> s3-1 origin) + (the float (-> obj strings s2-0 pos 0)) + (the float (-> obj strings s2-0 pos 1)) + (the float (-> obj strings s2-0 pos 2)) + 1.0 + ) + (set! (-> s3-1 scale) (-> obj strings s2-0 scale)) + (set! (-> s3-1 flags) (-> obj strings s2-0 flags)) + (set! (-> s3-1 color) (-> obj strings s2-0 color)) + (draw-string (-> obj strings s2-0 text) s4-0 s3-1) + ) + ) + ) + ) + (dotimes (v1-55 2) + (when (-> obj icons v1-55 icon) + (set-vector! + (-> obj icons v1-55 icon 0 root-override scale) + (* (-> obj icons v1-55 scale-x) (-> *video-params* relative-x-scale)) + (-> obj icons v1-55 scale-y) + (* (-> obj icons v1-55 scale-x) (-> *video-params* relative-x-scale)) + 1.0 + ) + (if (-> *blit-displays-work* horizontal-flip-flag) + (set! (-> obj icons v1-55 icon 0 root-override trans x) (the float (- 256 (-> obj icons v1-55 pos 0)))) + (set! (-> obj icons v1-55 icon 0 root-override trans x) (the float (+ (-> obj icons v1-55 pos 0) -256))) + ) + (set! (-> obj icons v1-55 icon 0 root-override trans y) (the float (* (+ (-> obj icons v1-55 pos 1) -208) 2))) + (set! (-> obj icons v1-55 icon 0 root-override trans z) (the float (-> obj icons v1-55 pos 2))) + ) + ) + ) + 0 + (none) + ) + +(defmethod update-value-callback hud ((obj hud) (arg0 int) (arg1 int)) + 0 + (none) + ) + +(defmethod update-values hud ((obj hud)) + (with-pp + (let ((s5-0 #f)) + (let ((v1-0 #f)) + (dotimes (a0-1 8) + (when (!= (-> obj values a0-1 current) (-> obj values a0-1 target)) + (if (= (-> obj values a0-1 current) -1) + (set! v1-0 #t) + (set! s5-0 #t) + ) + ) + ) + (set! v1-0 (or s5-0 v1-0)) + (when v1-0 + (dotimes (s4-0 8) + (cond + ((and (logtest? (-> obj values s4-0 flags) 1) (!= (-> obj values s4-0 current) -1)) + (set! (-> obj values s4-0 counter) + (the-as uint (seekl + (the-as int (-> obj values s4-0 counter)) + 0 + (the-as int (- (-> pp clock frame-counter) (-> pp clock old-frame-counter))) + ) + ) + ) + (when (and (zero? (-> obj values s4-0 counter)) (!= (-> obj values s4-0 current) (-> obj values s4-0 target))) + (let ((v1-27 (abs (- (-> obj values s4-0 current) (-> obj values s4-0 target)))) + (s3-0 1) + ) + (cond + ((>= v1-27 100) + (set! s3-0 100) + ) + ((>= v1-27 10) + (set! s3-0 10) + ) + ) + (update-value-callback obj s4-0 (if (< (-> obj values s4-0 current) (-> obj values s4-0 target)) + s3-0 + (- s3-0) + ) + ) + (seekl! (-> obj values s4-0 current) (-> obj values s4-0 target) s3-0) + ) + (set! (-> obj values s4-0 counter) (the-as uint 30)) + ) + ) + (else + (set! (-> obj values s4-0 current) (-> obj values s4-0 target)) + ) + ) + ) + ) + ) + (if (and (not *progress-process*) + (>= (- (-> pp clock frame-counter) (-> obj last-hide-time)) (seconds 0.05)) + (>= (- (-> *display* base-clock frame-counter) (-> *game-info* letterbox-time)) (seconds 0.1)) + (>= (- (-> *display* base-clock frame-counter) (-> *game-info* blackout-time)) (seconds 0.1)) + (or (not *target*) + (not (logtest? (-> *target* focus-status) (focus-status grabbed))) + (logtest? (-> obj flags) (hud-flags show)) + ) + (not (logtest? (-> obj flags) (hud-flags disable))) + (not (or (= *master-mode* 'progress) (= *master-mode* 'menu))) + (or s5-0 + (cond + (*debug-segment* + (let ((a0-32 (-> *cpad-list* cpads 0))) + (logtest? (logclear (pad-buttons l3) (-> a0-32 button0-abs 0)) + (logior (-> a0-32 button0-abs 2) (-> a0-32 button0-abs 1)) + ) + ) + ) + (else + (cpad-hold? 0 l3) + ) + ) + (logtest? (-> obj flags) (hud-flags show)) + ) + (check-ready-and-maybe-show obj #t) + ) + (go hud-arriving) + ) + ) + 0 + (none) + ) + ) + +(defmethod init-callback hud ((obj hud)) + 0 + (none) + ) + +(defmethod event-callback hud ((obj hud) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + #f + ) + +(defmethod hud-method-19 hud ((obj hud)) + 0 + (none) + ) + +(defmethod hud-method-20 hud ((obj hud)) + 0 + (none) + ) + +(defmethod hud-method-21 hud ((obj hud)) + 0 + (none) + ) + +(defmethod hud-method-22 hud ((obj hud)) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod hidden? hud ((obj hud)) + (the-as symbol (and (-> obj next-state) (= (-> obj next-state name) 'hud-hidden))) + ) + +(defun hud-create-icon ((arg0 hud) (arg1 int) (arg2 int)) + (let ((s4-0 (process-spawn manipy :init manipy-init (new 'static 'vector :w 1.0) #f arg2 #f 0 :to arg0))) + (when s4-0 + (set! (-> (the-as process-drawable (-> s4-0 0)) draw dma-add-func) + (the-as (function process-drawable draw-control symbol object none) dma-add-process-drawable-hud) + ) + (logior! (-> s4-0 0 mask) (process-mask freeze pause)) + (logclear! (-> s4-0 0 mask) (process-mask menu progress)) + (send-event (ppointer->process s4-0) 'draw #f) + (set! (-> arg0 icons arg1 icon) (the-as (pointer manipy) s4-0)) + s4-0 + ) + ) + ) + +(defmethod alloc-string-if-needed hud ((obj hud) (arg0 int)) + (if (not (-> obj strings arg0 text)) + (set! (-> obj strings arg0 text) (new 'process 'string 32 (the-as string #f))) + ) + 0 + (none) + ) + +(defstate hud-hidden (hud) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-1 object)) + (case event-type + (('show) + (if (and (not *progress-process*) + (!= (-> self last-hide-time) (-> self clock frame-counter)) + (check-ready-and-maybe-show self #t) + ) + (go hud-arriving) + ) + ) + (('hide) + (set! v0-1 (-> self clock frame-counter)) + (set! (-> self last-hide-time) (the-as time-frame v0-1)) + v0-1 + ) + (('force-hide) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (set! v0-1 (logclear (-> self flags) (hud-flags show))) + (set! (-> self flags) (the-as hud-flags v0-1)) + v0-1 + ) + (('force-show) + (logior! (-> self flags) (hud-flags show)) + (if (and (not *progress-process*) + (!= (-> self last-hide-time) (-> self clock frame-counter)) + (check-ready-and-maybe-show self #t) + ) + (go hud-arriving) + ) + ) + (('hide-quick) + (set! v0-1 (-> self clock frame-counter)) + (set! (-> self last-hide-time) (the-as time-frame v0-1)) + v0-1 + ) + (('hide-and-die) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (logior! (-> self flags) (hud-flags should-die)) + (set! v0-1 (logclear (-> self flags) (hud-flags show))) + (set! (-> self flags) (the-as hud-flags v0-1)) + v0-1 + ) + (('sync) + (dotimes (v1-23 8) + (set! (-> self values v1-23 current) -1) + ) + #f + ) + (('disable) + (set! v0-1 (logior (-> self flags) (hud-flags disable))) + (set! (-> self flags) (the-as hud-flags v0-1)) + v0-1 + ) + (('enable) + (set! v0-1 (logclear (-> self flags) (hud-flags disable))) + (set! (-> self flags) (the-as hud-flags v0-1)) + v0-1 + ) + (else + (event-callback self proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (set-action! + *gui-control* + (gui-action hidden) + (-> self gui-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (set! (-> self offset) 1.0) + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'draw #f) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (none) + ) + :code (the-as (function none :behavior hud) sleep-code) + :post (behavior () + (if (logtest? (-> self flags) (hud-flags should-die)) + (deactivate self) + ) + (update-values self) + (none) + ) + ) + +(defstate hud-arriving (hud) + :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) + (local-vars (v0-1 object)) + (case event-type + (('hide-quick) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (set! (-> self offset) 1.0) + (update-values self) + (go hud-hidden) + ) + (('force-hide) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (logclear! (-> self flags) (hud-flags show)) + (go hud-leaving 0.1) + ) + (('force-show) + (logior! (-> self flags) (hud-flags show)) + (if (and (not *progress-process*) + (!= (-> self last-hide-time) (-> self clock frame-counter)) + (check-ready-and-maybe-show self #t) + ) + (go hud-arriving) + ) + ) + (('hide) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (go hud-leaving 0.1) + ) + (('hide-and-die) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (logior! (-> self flags) (hud-flags should-die)) + (logclear! (-> self flags) (hud-flags show)) + (go hud-leaving 0.1) + ) + (('show) + (if (and (not *progress-process*) + (!= (-> self last-hide-time) (-> self clock frame-counter)) + (check-ready-and-maybe-show self #t) + ) + (go hud-arriving) + ) + ) + (('sync) + (dotimes (v1-34 8) + (set! (-> self values v1-34 current) -1) + ) + #f + ) + (('disable) + (set! v0-1 (logior (-> self flags) (hud-flags disable))) + (set! (-> self flags) (the-as hud-flags v0-1)) + v0-1 + ) + (('enable) + (set! v0-1 (logclear (-> self flags) (hud-flags disable))) + (set! (-> self flags) (the-as hud-flags v0-1)) + v0-1 + ) + (else + (event-callback self proc arg1 event-type event) + ) + ) + ) + :enter (behavior () + (set! (-> self trigger-time) (-> self clock frame-counter)) + (let ((gp-0 (-> self child))) + (while gp-0 + (send-event (ppointer->process gp-0) 'draw #t) + (set! gp-0 (-> gp-0 0 brother)) + ) + ) + (none) + ) + :code (behavior () + (until #f + (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) + (seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio))) + ) + (if (>= 0.0 (-> self offset)) + (go hud-in) + ) + (when (= (get-status *gui-control* (-> self gui-id)) (gui-status pending)) + (set! (-> self event-hook) #f) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (set! (-> self offset) 1.0) + (update-values self) + (go hud-hidden) + ) + (suspend) + ) + #f + (none) + ) + :post (behavior () + (update-values self) + (if (not (and (nonzero? *screen-shot-work*) + (!= (-> *screen-shot-work* count) -1) + (not (-> *screen-shot-work* hud-enable)) + ) + ) + (draw self) + ) + (none) + ) + ) + +(defstate hud-in (hud) + :event (-> hud-arriving event) + :code (behavior () + (set! (-> self trigger-time) (-> self clock frame-counter)) + (while (and (< (- (-> self clock frame-counter) (-> self trigger-time)) (seconds 2)) + (check-ready-and-maybe-show self #f) + ) + (set! (-> self offset) 0.0) + (suspend) + ) + (when (= (get-status *gui-control* (-> self gui-id)) (gui-status pending)) + (set! (-> self event-hook) #f) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (set! (-> self offset) 1.0) + (update-values self) + (go hud-hidden) + ) + (go hud-leaving 0.05) + (none) + ) + :post (-> hud-arriving post) + ) + +(defstate hud-leaving (hud) + :event (-> hud-arriving event) + :code (behavior ((arg0 float)) + (until #f + (if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause))) + (seek! (-> self offset) 1.0 (* arg0 (-> self clock time-adjust-ratio))) + ) + (when (= (get-status *gui-control* (-> self gui-id)) (gui-status pending)) + (set! (-> self event-hook) #f) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (set! (-> self offset) 1.0) + (update-values self) + (go hud-hidden) + ) + (if (>= (-> self offset) 1.0) + (go hud-hidden) + ) + (suspend) + ) + #f + (none) + ) + :post (-> hud-arriving post) + ) + +(defbehavior hud-init-by-other hud () + (add-connection *hud-engine* self #f self (-> self type symbol) #f) + (set! (-> self mask) (process-mask menu)) + (set! (-> self clock) (-> *display* real-clock)) + (set! (-> self flags) (hud-flags)) + (set! (-> self last-hide-time) (-> self clock frame-counter)) + (set! (-> self offset) 1.0) + (dotimes (v1-9 14) + (set! (-> self strings v1-9 text) #f) + (set! (-> self strings v1-9 scale) 1.0) + (set! (-> self strings v1-9 color) (font-color #dadada)) + (set! (-> self strings v1-9 flags) (font-flags shadow kerning large)) + (set! (-> self strings v1-9 pos 0) 0) + (set! (-> self strings v1-9 pos 2) #xfffffff) + (set! (-> self strings v1-9 pos 3) 0) + ) + (dotimes (v1-12 30) + (let ((a0-18 (&+ (-> self sprites 0 color2) (* v1-12 64)))) + (set! (-> a0-18 0) 128) + (set! (-> a0-18 1) 128) + (set! (-> a0-18 2) 128) + (set! (-> a0-18 3) 128) + ) + (set! (-> self sprites v1-12 pos z) #xffffff) + (set! (-> self sprites v1-12 pos w) 0) + (set! (-> self sprites v1-12 scale-x) 1.0) + (set! (-> self sprites v1-12 scale-y) 1.0) + (set! (-> self sprites v1-12 angle) 0.0) + (set! (-> self sprites v1-12 flags) (the-as uint 0)) + (set! (-> self sprites v1-12 tex) #f) + ) + (dotimes (v1-15 2) + (set! (-> self icons v1-15 icon) (the-as (pointer manipy) #f)) + (set! (-> self icons v1-15 pos 2) 1024) + (set! (-> self icons v1-15 scale-x) 1.0) + (set! (-> self icons v1-15 scale-y) 1.0) + ) + (dotimes (v1-18 8) + (set! (-> self values v1-18 current) -1) + (set! (-> self values v1-18 target) 0) + ) + (init-callback self) + (go hud-hidden) + ) + (defun hide-hud ((arg0 symbol)) + (when *target* + (let ((v1-3 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> v1-3 next0))) + (while (!= v1-3 (-> *hud-engine* alive-list-end)) + (if (or (not arg0) (= arg0 (-> (the-as connection v1-3) param2))) + (send-event (the-as process-tree (-> (the-as connection v1-3) param1)) 'hide) + ) + (set! v1-3 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + ) + 0 + (none) + ) + +(defun enable-hud () + (when *target* + (let ((v1-3 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((gp-0 (-> v1-3 next0))) + (while (!= v1-3 (-> *hud-engine* alive-list-end)) + (send-event (the-as process-tree (-> (the-as connection v1-3) param1)) 'enable) + (set! v1-3 gp-0) + *hud-engine* + (set! gp-0 (-> gp-0 next0)) + ) + ) + ) + ) + 0 + (none) + ) + +(defun hide-hud-quick ((arg0 symbol)) + (when *target* + (let ((v1-3 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> v1-3 next0))) + (while (!= v1-3 (-> *hud-engine* alive-list-end)) + (if (or (not arg0) (= arg0 (-> (the-as connection v1-3) param2))) + (send-event (the-as process-tree (-> (the-as connection v1-3) param1)) 'hide-quick) + ) + (set! v1-3 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + ) + 0 + (none) + ) + +(defun show-hud ((arg0 object)) + (when (and *target* (or (not *progress-process*) (is-gone (-> *progress-process* 0)))) + (let ((v1-7 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> v1-7 next0))) + (while (!= v1-7 (-> *hud-engine* alive-list-end)) + (if (or (not arg0) (= arg0 (-> (the-as connection v1-7) param2))) + (send-event (the-as process-tree (-> (the-as connection v1-7) param1)) 'show) + ) + (set! v1-7 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + ) + 0 (none) ) (defun hud-hidden? () - #t - ) \ No newline at end of file + (local-vars (gp-0 symbol)) + (cond + (*target* + (set! gp-0 #t) + (let ((v1-2 (-> *hud-engine* alive-list next0))) + *hud-engine* + (let ((s5-0 (-> v1-2 next0))) + (while (!= v1-2 (-> *hud-engine* alive-list-end)) + (if (not (hidden? (the-as hud (-> (the-as connection v1-2) param1)))) + (set! gp-0 #f) + ) + (set! v1-2 s5-0) + *hud-engine* + (set! s5-0 (-> s5-0 next0)) + ) + ) + ) + ) + (else + (set! gp-0 #t) + ) + ) + gp-0 + ) + +(defun set-hud-piece-position! ((arg0 hud-sprite) (arg1 int) (arg2 int)) + (set! (-> arg0 pos x) arg1) + (set! (-> arg0 pos y) arg2) + 0 + (none) + ) + +(defun set-as-offset-from! ((arg0 hud-sprite) (arg1 vector4w) (arg2 int) (arg3 int)) + (set! (-> arg0 pos x) (+ (-> arg1 x) (the int (* (the float arg2) (-> *video-params* relative-x-scale))))) + (set! (-> arg0 pos y) (+ (-> arg1 y) arg3)) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/ui/minimap-h.gc b/goal_src/jak2/engine/ui/minimap-h.gc index d9f490ad76..b22dc3fd7c 100644 --- a/goal_src/jak2/engine/ui/minimap-h.gc +++ b/goal_src/jak2/engine/ui/minimap-h.gc @@ -222,18 +222,18 @@ (minimap-method-12 (_type_ process uint int vector int) connection-minimap 12) (minimap-method-13 () none 13) (minimap-method-14 () none 14) - (minimap-method-15 () none 15) + (minimap-method-15 (_type_ dma-buffer vector4w symbol) none 15) (minimap-method-16 () none 16) (minimap-method-17 () none 17) (minimap-method-18 () none 18) (minimap-method-19 () none 19) - (minimap-method-20 () none 20) + (minimap-method-20 (_type_) symbol 20) (minimap-method-21 () none 21) (minimap-method-22 () none 22) (minimap-method-23 () none 23) - (minimap-method-24 () none 24) - (minimap-method-25 () none 25) + (minimap-method-24 (_type_ dma-buffer vector4w symbol) none 24) + (minimap-method-25 (_type_ texture float) none 25) (minimap-method-26 () none 26) - (minimap-method-27 () none 27) + (minimap-method-27 (_type_ float float) none 27) ) ) diff --git a/goal_src/jak2/engine/ui/minimap.gc b/goal_src/jak2/engine/ui/minimap.gc index 32da8f4416..e9dc899e92 100644 --- a/goal_src/jak2/engine/ui/minimap.gc +++ b/goal_src/jak2/engine/ui/minimap.gc @@ -46,3 +46,19 @@ ;; s3-0 ;; ) ) + +(defmethod minimap-method-20 minimap ((obj minimap)) + #t) + + +(defmethod minimap-method-15 minimap ((obj minimap) (dma dma-buffer) (a vector4w) (k symbol)) + (none)) + +(defmethod minimap-method-24 minimap ((obj minimap) (dma dma-buffer) (a vector4w) (k symbol)) + (none)) + +(defmethod minimap-method-25 minimap ((obj minimap) (text texture) (a float)) + (none)) + +(defmethod minimap-method-27 minimap ((obj minimap) (dma float) (a float)) + (none)) \ No newline at end of file diff --git a/goal_src/jak2/engine/ui/progress/progress-draw.gc b/goal_src/jak2/engine/ui/progress/progress-draw.gc index e6472dba31..5428e1d714 100644 --- a/goal_src/jak2/engine/ui/progress/progress-draw.gc +++ b/goal_src/jak2/engine/ui/progress/progress-draw.gc @@ -298,7 +298,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-23 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-23) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -322,7 +322,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -360,7 +360,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -384,7 +384,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -422,7 +422,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -446,7 +446,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -484,7 +484,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -508,7 +508,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -546,7 +546,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -570,7 +570,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -1419,7 +1419,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - ((method-of-type hud-box hud-box-method-9) (the-as hud-box (-> arg0 box)) s5-0) + ((method-of-type hud-box draw-box-prim-only) (the-as hud-box (-> arg0 box)) s5-0) (let ((a3-1 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2486,42 +2486,67 @@ (set! (-> arg1 height) 190.0) (let ((s2-8 (-> *progress-save-info* file arg2 level-index))) (when (= arg2 sv-20) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) - (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-199 (-> obj sprites 0 color2))) + (set! (-> v1-199 0) 128) + (set! (-> v1-199 1) 128) + (set! (-> v1-199 2) 128) + (set! (-> v1-199 3) (the int (* 128.0 sv-16))) + ) + (let ((v1-200 (-> obj sprites 1 color2))) + (set! (-> v1-200 0) 128) + (set! (-> v1-200 1) 128) + (set! (-> v1-200 2) 128) + (set! (-> v1-200 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 1 pos z) #xffffff) (set! (-> obj sprites 1 pos w) 1) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 (the-as int s2-8)))) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8))) (set! (-> obj sprites 1 scale-x) 1.0) (set! (-> obj sprites 1 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48) - (set-vector! (-> obj sprites 2 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-205 (-> obj sprites 2 color2))) + (set! (-> v1-205 0) 128) + (set! (-> v1-205 1) 128) + (set! (-> v1-205 2) 128) + (set! (-> v1-205 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 2 pos z) #xffffff) (set! (-> obj sprites 2 pos w) 1) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 (the-as int s2-8)))) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8))) (set! (-> obj sprites 2 scale-x) 1.0) (set! (-> obj sprites 2 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48) - (set-vector! (-> obj sprites 3 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-211 (-> obj sprites 3 color2))) + (set! (-> v1-211 0) 128) + (set! (-> v1-211 1) 128) + (set! (-> v1-211 2) 128) + (set! (-> v1-211 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 3 pos z) #xffffff) (set! (-> obj sprites 3 pos w) 1) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 (the-as int s2-8)))) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8))) (set! (-> obj sprites 3 scale-x) 1.0) (set! (-> obj sprites 3 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64)) - (set-vector! (-> obj sprites 4 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-217 (-> obj sprites 4 color2))) + (set! (-> v1-217 0) 128) + (set! (-> v1-217 1) 128) + (set! (-> v1-217 2) 128) + (set! (-> v1-217 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 4 pos z) #xffffff) (set! (-> obj sprites 4 pos w) 1) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 (the-as int s2-8)))) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8))) (set! (-> obj sprites 4 scale-x) 1.0) (set! (-> obj sprites 4 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) (let* ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-9 (-> s1-7 base)) ) - (hud-sprite-method-9 (-> obj sprites 1) s1-7 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 2) s1-7 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 3) s1-7 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 4) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 1) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 2) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 3) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 4) s1-7 (-> *level* default-level)) (let ((a3-35 (-> s1-7 base))) (let ((v1-237 (the-as object (-> s1-7 base)))) (set! (-> (the-as dma-packet v1-237) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2551,11 +2576,7 @@ (let* ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-10 (-> s1-8 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-8 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-8 (-> *level* default-level)) (let ((a3-36 (-> s1-8 base))) (let ((v1-260 (the-as object (-> s1-8 base)))) (set! (-> (the-as dma-packet v1-260) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2574,7 +2595,7 @@ (set! (-> arg1 origin y) (+ 1.0 (-> arg1 origin y))) (set! (-> arg1 origin x) (+ 28.0 (-> arg1 origin x))) (let* ((v1-272 (-> *progress-save-info* file arg2 game-time0)) - (v1-273 (logior (shl (the-as int (-> *progress-save-info* file arg2 game-time1)) 32) v1-272)) + (v1-273 (logior (shl (-> *progress-save-info* file arg2 game-time1) 32) v1-272)) (s2-11 (/ (the-as int v1-273) #x107ac0)) ) (set! sv-112 (/ (mod (the-as int v1-273) #x107ac0) #x4650)) @@ -2588,11 +2609,7 @@ (let* ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-12 (-> s1-10 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-10 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-10 (-> *level* default-level)) (let ((a3-39 (-> s1-10 base))) (let ((v1-285 (the-as object (-> s1-10 base)))) (set! (-> (the-as dma-packet v1-285) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2618,11 +2635,7 @@ (let* ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-14 (-> s1-12 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-12 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-12 (-> *level* default-level)) (let ((a3-41 (-> s1-12 base))) (let ((v1-304 (the-as object (-> s1-12 base)))) (set! (-> (the-as dma-packet v1-304) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2650,11 +2663,7 @@ (let* ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-16 (-> s1-14 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-14 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-14 (-> *level* default-level)) (let ((a3-43 (-> s1-14 base))) (let ((v1-325 (the-as object (-> s1-14 base)))) (set! (-> (the-as dma-packet v1-325) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -3299,18 +3308,19 @@ (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) (set! (-> obj sprites 0 scale-x) 1.0) (set! (-> obj sprites 0 scale-y) 1.0) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) + (let ((v1-6 (-> obj sprites 0 color2))) + (set! (-> v1-6 0) 128) + (set! (-> v1-6 1) 128) + (set! (-> v1-6 2) 128) + (set! (-> v1-6 3) (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) + ) (set! (-> obj sprites 0 pos z) #xffffff) (set! (-> obj sprites 0 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 240 160) (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s4-1 (-> s3-0 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s3-0 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) (let ((a3-1 (-> s3-0 base))) (let ((v1-16 (the-as object (-> s3-0 base)))) (set! (-> (the-as dma-packet v1-16) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -4698,18 +4708,19 @@ (set! (-> obj sprites 0 flags) (the-as uint 4)) (set! (-> obj sprites 0 scale-x) 0.64) (set! (-> obj sprites 0 scale-y) 0.64) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-32 (-> obj sprites 0 color2))) + (set! (-> v1-32 0) 128) + (set! (-> v1-32 1) 128) + (set! (-> v1-32 2) 128) + (set! (-> v1-32 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 0 pos z) #xffffff) (set! (-> obj sprites 0 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 100 128) (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s4-0 (-> s3-0 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s3-0 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) (let ((a3-1 (-> s3-0 base))) (let ((v1-42 (the-as object (-> s3-0 base)))) (set! (-> (the-as dma-packet v1-42) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -4893,11 +4904,7 @@ (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-1 (-> s4-1 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> arg0 sprites)) - s4-1 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> arg0 sprites)) s4-1 (-> *level* default-level)) (let ((a3-1 (-> s4-1 base))) (let ((v1-8 (the-as object (-> s4-1 base)))) (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -4946,11 +4953,7 @@ (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-1 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (&-> arg0 pad 3)) - s4-1 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (&-> arg0 pad 3)) s4-1 (-> *level* default-level)) (let ((a3-1 (-> s4-1 base))) (let ((v1-20 (the-as object (-> s4-1 base)))) (set! (-> (the-as dma-packet v1-20) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -5751,7 +5754,12 @@ (set! (-> sv-144 sprites 0 flags) (the-as uint 4)) (set! (-> sv-144 sprites 0 scale-x) sv-100) (set! (-> sv-144 sprites 0 scale-y) sv-100) - (set-vector! (-> sv-144 sprites 0 color) 128 128 128 (the int (* 128.0 sv-96))) + (let ((v1-33 (-> sv-144 sprites 0 color2))) + (set! (-> v1-33 0) 128) + (set! (-> v1-33 1) 128) + (set! (-> v1-33 2) 128) + (set! (-> v1-33 3) (the int (* 128.0 sv-96))) + ) (set! (-> sv-144 sprites 0 pos z) #xfffff0) (set! (-> sv-144 sprites 0 pos w) 0) (if (= (-> *setting-control* user-default language) (language-enum spanish)) @@ -7050,25 +7058,45 @@ (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) (set! (-> obj sprites 0 scale-x) f28-0) (set! (-> obj sprites 0 scale-y) 0.7) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-57 (-> obj sprites 0 color2))) + (set! (-> v1-57 0) 128) + (set! (-> v1-57 1) 128) + (set! (-> v1-57 2) 128) + (set! (-> v1-57 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 0 pos z) #x3fffff) (set! (-> obj sprites 0 pos w) 0) (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) (set! (-> obj sprites 1 scale-x) 0.2) (set! (-> obj sprites 1 scale-y) 1.33) - (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-62 (-> obj sprites 1 color2))) + (set! (-> v1-62 0) 128) + (set! (-> v1-62 1) 128) + (set! (-> v1-62 2) 128) + (set! (-> v1-62 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 1 pos z) #x3fffff) (set! (-> obj sprites 1 pos w) 0) (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) (set! (-> obj sprites 2 scale-x) 1.0) (set! (-> obj sprites 2 scale-y) 1.0) - (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-67 (-> obj sprites 2 color2))) + (set! (-> v1-67 0) sv-80) + (set! (-> v1-67 1) sv-96) + (set! (-> v1-67 2) sv-112) + (set! (-> v1-67 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 2 pos z) #xffffff) (set! (-> obj sprites 2 pos w) 0) (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) (set! (-> obj sprites 3 scale-x) 1.0) (set! (-> obj sprites 3 scale-y) 1.0) - (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-72 (-> obj sprites 3 color2))) + (set! (-> v1-72 0) sv-80) + (set! (-> v1-72 1) sv-96) + (set! (-> v1-72 2) sv-112) + (set! (-> v1-72 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 3 pos z) #xffffff) (set! (-> obj sprites 3 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) @@ -7081,11 +7109,7 @@ (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-176 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-192 (-> sv-176 base)) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - sv-176 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-176 (-> *level* default-level)) (draw-sprite2d-xy sv-176 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) @@ -7094,9 +7118,9 @@ 9 (the-as rgba sv-160) ) - (hud-sprite-method-9 (-> obj sprites 1) sv-176 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 2) sv-176 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 3) sv-176 (-> *level* default-level)) + (draw (-> obj sprites 1) sv-176 (-> *level* default-level)) + (draw (-> obj sprites 2) sv-176 (-> *level* default-level)) + (draw (-> obj sprites 3) sv-176 (-> *level* default-level)) (let ((a3-6 (-> sv-176 base))) (let ((v1-100 (the-as object (-> sv-176 base)))) (set! (-> (the-as dma-packet v1-100) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -7165,25 +7189,45 @@ (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) (set! (-> obj sprites 0 scale-x) f28-0) (set! (-> obj sprites 0 scale-y) 0.7) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-140 (-> obj sprites 0 color2))) + (set! (-> v1-140 0) 128) + (set! (-> v1-140 1) 128) + (set! (-> v1-140 2) 128) + (set! (-> v1-140 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 0 pos z) #x3fffff) (set! (-> obj sprites 0 pos w) 0) (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) (set! (-> obj sprites 1 scale-x) 0.2) (set! (-> obj sprites 1 scale-y) 1.33) - (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-145 (-> obj sprites 1 color2))) + (set! (-> v1-145 0) 128) + (set! (-> v1-145 1) 128) + (set! (-> v1-145 2) 128) + (set! (-> v1-145 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 1 pos z) #x3fffff) (set! (-> obj sprites 1 pos w) 0) (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) (set! (-> obj sprites 2 scale-x) 1.0) (set! (-> obj sprites 2 scale-y) 1.0) - (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-150 (-> obj sprites 2 color2))) + (set! (-> v1-150 0) sv-80) + (set! (-> v1-150 1) sv-96) + (set! (-> v1-150 2) sv-112) + (set! (-> v1-150 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 2 pos z) #xffffff) (set! (-> obj sprites 2 pos w) 0) (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) (set! (-> obj sprites 3 scale-x) 1.0) (set! (-> obj sprites 3 scale-y) 1.0) - (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-155 (-> obj sprites 3 color2))) + (set! (-> v1-155 0) sv-80) + (set! (-> v1-155 1) sv-96) + (set! (-> v1-155 2) sv-112) + (set! (-> v1-155 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 3 pos z) #xffffff) (set! (-> obj sprites 3 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) @@ -7196,11 +7240,7 @@ (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-256 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-272 (-> sv-256 base)) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - sv-256 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-256 (-> *level* default-level)) (draw-sprite2d-xy sv-256 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) @@ -7209,9 +7249,9 @@ 9 (the-as rgba sv-240) ) - (hud-sprite-method-9 (-> obj sprites 1) sv-256 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 2) sv-256 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 3) sv-256 (-> *level* default-level)) + (draw (-> obj sprites 1) sv-256 (-> *level* default-level)) + (draw (-> obj sprites 2) sv-256 (-> *level* default-level)) + (draw (-> obj sprites 3) sv-256 (-> *level* default-level)) (let ((a3-13 (-> sv-256 base))) (let ((v1-183 (the-as object (-> sv-256 base)))) (set! (-> (the-as dma-packet v1-183) dma) (new 'static 'dma-tag :id (dma-tag-id next))) diff --git a/goal_src/jak2/engine/ui/progress/progress-h.gc b/goal_src/jak2/engine/ui/progress/progress-h.gc index 479256efe0..ffe17154d9 100644 --- a/goal_src/jak2/engine/ui/progress/progress-h.gc +++ b/goal_src/jak2/engine/ui/progress/progress-h.gc @@ -61,7 +61,7 @@ (gone () _type_ :state 23) (init-defaults (_type_) connection 24) (progress-method-25 (_type_) none 25) - (progress-method-26 (_type_) object 26) + (is-gone (_type_) object 26) (can-go-back? (_type_) symbol 27) (progress-method-28 (_type_ symbol) symbol 28) (progress-method-29 (_type_) int 29) @@ -130,7 +130,7 @@ (deftype menu-slider-option (menu-option) ((value-to-modify pointer :offset-assert 48) - (sprites hud-sprite 5 :inline :offset-assert 64) + (sprites hud-sprite 5 :inline :offset 64) ) :method-count-assert 12 :size-assert #x180 @@ -192,7 +192,7 @@ (deftype menu-memcard-slot-option (menu-option) - ((sprites hud-sprite 5 :inline :offset-assert 48) + ((sprites hud-sprite 5 :inline :offset 48) (pad uint8 32 :offset-assert 368) ) :method-count-assert 12 @@ -275,7 +275,7 @@ (deftype menu-icon-info-option (menu-option) - ((sprites hud-sprite 2 :inline :offset-assert 48) + ((sprites hud-sprite 2 :inline :offset 48) ) :method-count-assert 12 :size-assert #xb0 @@ -392,7 +392,7 @@ (deftype menu-highscores-option (paged-menu-option) ((last-move uint64 :offset-assert 64) - (sprites hud-sprite 2 :inline :offset-assert 80) + (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 :size-assert #xd0 @@ -419,7 +419,7 @@ (num-hero-items int32 :offset-assert 60) (secret-items (array secret-item-option) :offset-assert 64) (last-move uint64 :offset-assert 72) - (sprites hud-sprite 2 :inline :offset-assert 80) + (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 :size-assert #xd0 diff --git a/goal_src/jak2/engine/ui/progress/progress.gc b/goal_src/jak2/engine/ui/progress/progress.gc index 8a56eff500..9bfe617204 100644 --- a/goal_src/jak2/engine/ui/progress/progress.gc +++ b/goal_src/jak2/engine/ui/progress/progress.gc @@ -502,7 +502,7 @@ (none) ) -(defmethod progress-method-26 progress ((obj progress)) +(defmethod is-gone progress ((obj progress)) (and *progress-process* (-> *progress-process* 0 next-state) (= (-> *progress-process* 0 next-state name) 'gone) @@ -1299,7 +1299,7 @@ (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (hud-box-method-13 arg0 s5-0 arg1) + (draw-scan-and-line arg0 s5-0 arg1) ) 0 ) @@ -1394,13 +1394,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector4w))) (set! (-> s5-1 quad) (the-as uint128 0)) (if (and (transform-point-qword! gp-1 s4-2) (transform-point-qword! s5-1 s3-1)) - (bigmap-method-11 - *bigmap* - (the-as int (/ (the-as int (-> s5-1 x)) 16)) - (the-as int (/ (the-as int (-> s5-1 y)) 16)) - (the-as int (/ (the-as int (-> gp-1 x)) 16)) - (the-as int (/ (the-as int (-> gp-1 y)) 16)) - ) + (bigmap-method-11 *bigmap* (/ (-> s5-1 x) 16) (/ (-> s5-1 y) 16) (/ (-> gp-1 x) 16) (/ (-> gp-1 y) 16)) ) ) ) diff --git a/goal_src/jak2/engine/ui/text-id-h.gc b/goal_src/jak2/engine/ui/text-id-h.gc index 4e9193d3cf..96d9f52bc7 100644 --- a/goal_src/jak2/engine/ui/text-id-h.gc +++ b/goal_src/jak2/engine/ui/text-id-h.gc @@ -372,6 +372,7 @@ (text-x24d #x024d) (text-x24e #x024e) (text-x24f #x024f) + (text-x277 #x0277) (scene-subtitles-enabled #x30d) (scene-subtitles-disabled #x30e) (progress-unknown-continue #x310) diff --git a/goal_src/jak2/levels/common/airlock.gc b/goal_src/jak2/levels/common/airlock.gc index 6cd7a0891f..5c8b1f5099 100644 --- a/goal_src/jak2/levels/common/airlock.gc +++ b/goal_src/jak2/levels/common/airlock.gc @@ -338,7 +338,7 @@ (cond ((and gp-0 (>= (- (-> self clock frame-counter) (-> obj spool-sound-time)) (seconds 2))) (set! (-> obj spool-sound-time) (-> self clock frame-counter)) - (gui-control-method-9 + (add-process *gui-control* obj (gui-channel alert) diff --git a/goal_src/jak2/levels/common/battle.gc b/goal_src/jak2/levels/common/battle.gc index 7ace926c46..655a0d94e6 100644 --- a/goal_src/jak2/levels/common/battle.gc +++ b/goal_src/jak2/levels/common/battle.gc @@ -792,13 +792,13 @@ ) ) (('beaten) - (set! (-> self flags) (the-as uint (logior (the-as int (-> self flags)) 4))) + (logior! (-> self flags) 4) (if (and (-> self next-state) (= (-> self next-state name) 'idle)) (go-virtual beaten) ) ) (('resume) - (set! (-> self flags) (the-as uint (logand -5 (-> self flags)))) + (set! (-> self flags) (logand -5 (-> self flags))) (process-entity-status! self (entity-perm-status subtask-complete) #f) (if (and (-> self next-state) (= (-> self next-state name) 'beaten)) (go-virtual hostile) @@ -989,7 +989,7 @@ ) (defmethod battle-method-25 battle ((obj battle) (arg0 battle-spawner)) - (when (not (logtest? (the-as int (-> obj flags)) 8)) + (when (not (logtest? (-> obj flags) 8)) (let ((f0-0 (-> obj info spawner-blocked-by-player-xz))) (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) (return #t) @@ -1184,7 +1184,7 @@ ) (defmethod battle-method-51 battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) - (when (and (logtest? (the-as int (-> obj flags)) 2) (zero? (logand (the-as int (-> obj flags)) 4))) + (when (and (logtest? (-> obj flags) 2) (zero? (logand (-> obj flags) 4))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond ((zero? v1-5) @@ -1402,10 +1402,10 @@ (if (-> self spawn-initial-creatures?) (battle-method-40 self) ) - (if (logtest? (the-as int (-> self flags)) 1) + (if (logtest? (-> self flags) 1) (go-virtual hostile) ) - (set! (-> self flags) (the-as uint (logior (the-as int (-> self flags)) 1))) + (logior! (-> self flags) 1) (none) ) :trans (behavior () @@ -1460,11 +1460,11 @@ (v1-4 (-> obj max-count)) ) (when (zero? a0-4) - (if (or (logtest? (the-as int (-> obj flags)) 4) (>= (-> obj die-count) v1-4)) + (if (or (logtest? (-> obj flags) 4) (>= (-> obj die-count) v1-4)) (return #t) ) ) - (set! (-> obj flags) (the-as uint (logand -9 (-> obj flags)))) + (set! (-> obj flags) (logand -9 (-> obj flags))) (cond ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> obj die-count))))) (let ((a1-14 (-> obj jammed-starting-time))) @@ -1474,7 +1474,7 @@ ) (else (if (>= (- (-> pp clock frame-counter) a1-14) (seconds 3.5)) - (set! (-> obj flags) (the-as uint (logior (the-as int (-> obj flags)) 8))) + (logior! (-> obj flags) 8) ) ) ) @@ -1486,7 +1486,7 @@ ) ) (cond - ((and (not (logtest? (the-as int (-> obj flags)) 4)) + ((and (not (logtest? (-> obj flags) 4)) (> (-> obj spawners length) 0) (< a0-4 (the-as int (-> obj info desired-alive-count))) (< (-> obj count) v1-4) @@ -1521,8 +1521,8 @@ :event battle-event-handler :enter (behavior () (set! (-> self state-time) (-> self clock frame-counter)) - (set! (-> self flags) (the-as uint (logior (the-as int (-> self flags)) 2))) - (set! (-> self flags) (the-as uint (logand -9 (-> self flags)))) + (logior! (-> self flags) 2) + (set! (-> self flags) (logand -9 (-> self flags))) (set! (-> self jammed-starting-time) 0) (set! (-> self cant-spawn-time) 0) (set! (-> self next-spawn-delay) (the-as uint 0)) @@ -1568,10 +1568,10 @@ :code (the-as (function none :behavior battle) sleep-code) ) -;; WARN: Return type mismatch uint8 vs none. +;; WARN: Return type mismatch uint vs none. (defmethod battle-method-47 battle ((obj battle)) (let ((a3-0 (-> obj info play-battle-music))) - (when (and a3-0 (zero? (logand (the-as int (-> obj flags)) 16))) + (when (and a3-0 (zero? (logand (-> obj flags) 16))) (case a3-0 (('sound-mode) (set-setting! 'sound-mode #f 0 1) @@ -1580,14 +1580,14 @@ (set-setting! 'music a3-0 0 0) ) ) - (set! (-> obj flags) (the-as uint (logior (the-as int (-> obj flags)) 16))) + (logior! (-> obj flags) 16) ) ) (none) ) (defmethod battle-method-48 battle ((obj battle)) - (when (logtest? (the-as int (-> obj flags)) 16) + (when (logtest? (-> obj flags) 16) (remove-setting! 'sound-mode) (remove-setting! 'music) ) diff --git a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc index 6e46cbc879..173d8c8560 100644 --- a/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc +++ b/goal_src/jak2/levels/common/enemy/guards/guard-conversation.gc @@ -218,7 +218,7 @@ ) ) ) - (gui-control-method-9 + (add-process *gui-control* obj (gui-channel guard) @@ -294,11 +294,11 @@ (go-virtual die) ) ) - (if (nonzero? (gui-control-method-17 + (if (nonzero? (get-status *gui-control* (the-as sound-id - (gui-control-method-14 *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) + (lookup-gui-connection-id *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) ) ) ) @@ -315,7 +315,7 @@ (defstate notice (guard-conversation) :virtual #t :code (behavior () - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -326,7 +326,7 @@ (the-as process #f) ) (let ((v1-2 (rand-vu-int-count 3))) - (gui-control-method-9 + (add-process *gui-control* self (gui-channel guard) @@ -346,14 +346,14 @@ 0 ) ) - (until (= (gui-control-method-17 + (until (= (get-status *gui-control* (the-as sound-id - (gui-control-method-14 *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) + (lookup-gui-connection-id *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) ) ) - (gui-action none) + (gui-status unknown) ) (suspend) ) diff --git a/goal_src/jak2/levels/common/flitter.gc b/goal_src/jak2/levels/common/flitter.gc index 8e6867ddbe..4e5b6fa5bf 100644 --- a/goal_src/jak2/levels/common/flitter.gc +++ b/goal_src/jak2/levels/common/flitter.gc @@ -399,10 +399,10 @@ ) -(defskelgroup skel-flitter flitter 0 -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) +(defskelgroup skel-flitter flitter flitter-lod0-jg -1 + ((flitter-lod0-mg (meters 20)) (flitter-lod1-mg (meters 40)) (flitter-lod2-mg (meters 999999))) :bounds (static-spherem 0 0 0 5.5) - :shadow 4 + :shadow flitter-shadow-mg :origin-joint-index 3 ) @@ -590,7 +590,7 @@ (defmethod enemy-method-78 flitter ((obj flitter) (arg0 (pointer float))) (case (-> obj incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (the-as uint (-> obj incoming blue-juggle-count)) (the-as uint 2)) + (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) (let ((v1-4 (-> obj skel root-channel 0))) (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) (set! (-> v1-4 param 0) @@ -739,8 +739,8 @@ ) :code (behavior () (ja-channel-push! 1 (seconds 0.1)) - (ja-no-eval :group! (-> self draw art-group data 10) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 10)) frames num-frames) -1))) + (ja-no-eval :group! flitter-ambush-jump-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim flitter-ambush-jump-ja) frames num-frames) -1))) ) (until #f (when (< (-> self base-height) (-> self root-override2 trans y)) @@ -814,8 +814,8 @@ ) #f (label cfg-26) - (ja-no-eval :group! (-> self draw art-group data 11) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 11)) frames num-frames) -1))) + (ja-no-eval :group! flitter-ambush-land-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim flitter-ambush-land-ja) frames num-frames) -1))) :frame-num 0.0 ) (until (ja-done? 0) @@ -979,7 +979,7 @@ 0 (ja-no-eval :num! (loop!)) (ja-channel-push! 1 (seconds 0.2)) - (ja :group! (-> self draw art-group data 15)) + (ja :group! flitter-turn-ja) (ja :num-func num-func-identity :frame-num 0.0) (until (enemy-method-96 self 1820.4445 #t) (ja-blend-eval) @@ -1249,17 +1249,17 @@ :code (behavior () (ja-channel-push! 2 (seconds 0.1)) (let ((f30-0 (flitter-method-183 self))) - (ja-no-eval :group! (-> self draw art-group data 16) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 16)) frames num-frames) -1)) 0.8) + (ja-no-eval :group! flitter-attack-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim flitter-attack-ja) frames num-frames) -1)) 0.8) :frame-num 0.0 ) (let ((a0-3 (-> self skel root-channel 1))) (set! (-> a0-3 frame-interp 1) f30-0) (set! (-> a0-3 frame-interp 0) f30-0) - (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 17))) + (set! (-> a0-3 frame-group) (the-as art-joint-anim flitter-attack-high-ja)) (set! (-> a0-3 param 0) 0.0) (set! (-> a0-3 frame-num) 0.0) - (joint-control-channel-group! a0-3 (the-as art-joint-anim (-> self draw art-group data 17)) num-func-chan) + (joint-control-channel-group! a0-3 (the-as art-joint-anim flitter-attack-high-ja) num-func-chan) ) (until (ja-done? 0) (suspend) @@ -1284,8 +1284,8 @@ (logclear! (-> self focus-status) (focus-status dangerous)) ) (dotimes (gp-1 (get-rand-int self 3)) - (ja-no-eval :group! (-> self draw art-group data 5) - :num! (seek! (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) frames num-frames) -1))) + (ja-no-eval :group! flitter-idle-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim flitter-idle-ja) frames num-frames) -1))) :frame-num 0.0 ) (until (ja-done? 0) diff --git a/goal_src/jak2/levels/common/grunt.gc b/goal_src/jak2/levels/common/grunt.gc index 50edbb4797..33b5e93e72 100644 --- a/goal_src/jak2/levels/common/grunt.gc +++ b/goal_src/jak2/levels/common/grunt.gc @@ -7,10 +7,10 @@ ;; DECOMP BEGINS -(defskelgroup skel-grunt grunt 0 -1 - ((1 (meters 20)) (2 (meters 40)) (3 (meters 999999))) +(defskelgroup skel-grunt grunt grunt-lod0-jg -1 + ((grunt-lod0-mg (meters 20)) (grunt-lod1-mg (meters 40)) (grunt-lod2-mg (meters 999999))) :bounds (static-spherem 0 0 0 5) - :shadow 4 + :shadow grunt-shadow-mg :origin-joint-index 18 ) @@ -521,17 +521,10 @@ :virtual #t :code (behavior () (let ((v1-2 (ja-group))) - (when (or (and v1-2 (or (= v1-2 (-> self draw art-group data 14)) - (= v1-2 (-> self draw art-group data 15)) - (= v1-2 (-> self draw art-group data 16)) - ) - ) + (when (or (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) (let ((v1-8 (ja-group))) - (and v1-8 (or (= v1-8 (-> self draw art-group data 11)) - (= v1-8 (-> self draw art-group data 12)) - (= v1-8 (-> self draw art-group data 14)) - (= v1-8 (-> self draw art-group data 15)) - ) + (and v1-8 + (or (= v1-8 grunt-patrol0-ja) (= v1-8 grunt-patrol1-ja) (= v1-8 grunt-charge0-ja) (= v1-8 grunt-charge1-ja)) ) ) ) @@ -743,11 +736,7 @@ ) :code (behavior () (let ((v1-2 (ja-group))) - (when (and v1-2 (or (= v1-2 (-> self draw art-group data 14)) - (= v1-2 (-> self draw art-group data 15)) - (= v1-2 (-> self draw art-group data 16)) - ) - ) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) ) @@ -987,11 +976,7 @@ :virtual #t :code (behavior () (let ((v1-2 (ja-group))) - (when (and v1-2 (or (= v1-2 (-> self draw art-group data 14)) - (= v1-2 (-> self draw art-group data 15)) - (= v1-2 (-> self draw art-group data 16)) - ) - ) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) ) @@ -1064,27 +1049,21 @@ 0 (vector-reset! (-> self root-override2 transv)) (let ((v1-77 (ja-group))) - (if (not (and v1-77 (= v1-77 (-> self draw art-group data 30)))) + (if (not (and v1-77 (= v1-77 grunt-celebrate-start-ja))) (ja-channel-push! 1 (seconds 0.1)) ) ) (let ((f30-2 (get-rand-float-range self 0.9 1.1))) - (ja-no-eval :group! (-> self draw art-group data 30) - :num! (seek! - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 30)) frames num-frames) -1)) - f30-2 - ) + (ja-no-eval :group! grunt-celebrate-start-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim grunt-celebrate-start-ja) frames num-frames) -1)) f30-2) :frame-num 0.0 ) (until (ja-done? 0) (suspend) (ja :num! (seek! max f30-2)) ) - (ja-no-eval :group! (-> self draw art-group data 31) - :num! (seek! - (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 31)) frames num-frames) -1)) - f30-2 - ) + (ja-no-eval :group! grunt-celebrate-finish-ja + :num! (seek! (the float (+ (-> (the-as art-joint-anim grunt-celebrate-finish-ja) frames num-frames) -1)) f30-2) :frame-num 0.0 ) (until (ja-done? 0) @@ -1103,11 +1082,7 @@ :virtual #t :code (behavior () (let ((v1-2 (ja-group))) - (when (and v1-2 (or (= v1-2 (-> self draw art-group data 14)) - (= v1-2 (-> self draw art-group data 15)) - (= v1-2 (-> self draw art-group data 16)) - ) - ) + (when (and v1-2 (or (= v1-2 grunt-charge0-ja) (= v1-2 grunt-charge1-ja) (= v1-2 grunt-charge2-ja))) (let ((v1-6 (-> self nav))) (set! (-> v1-6 target-speed) (-> self charge-anim travel-speed)) ) @@ -1260,7 +1235,7 @@ ) ) ) - (if (>= (the-as uint (-> obj incoming blue-juggle-count)) (the-as uint 2)) + (if (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 2))) ) (cond diff --git a/goal_src/jak2/levels/fortress/prison/prison-obs.gc b/goal_src/jak2/levels/fortress/prison/prison-obs.gc index 320d282c49..fd90396e3b 100644 --- a/goal_src/jak2/levels/fortress/prison/prison-obs.gc +++ b/goal_src/jak2/levels/fortress/prison/prison-obs.gc @@ -10,10 +10,6 @@ ;; DECOMP BEGINS -;;-*-Lisp-*- -(in-package goal) - -;; failed to figure out what this is: (set! (-> *lightning-spec-id-table* 19) (new 'static 'lightning-spec :name "lightning-darkjak-prison" :flags (lightning-spec-flags lsf0) @@ -33,7 +29,6 @@ ) ) -;; failed to figure out what this is: (set! (-> *lightning-spec-id-table* 20) (new 'static 'lightning-spec :name "lightning-darkjak-prison-shock" :flags (lightning-spec-flags lsf0) @@ -55,14 +50,10 @@ ) ) -;; definition for symbol *prsn-torture-lightning-joints*, type (array int32) (define *prsn-torture-lightning-joints* (new 'static 'boxed-array :type int32 14 16 18 20)) -;; definition for symbol *prsn-chair-shackle-lightning-joints*, type (array int32) (define *prsn-chair-shackle-lightning-joints* (new 'static 'boxed-array :type int32 4 5 6 7)) -;; definition for function dark-lightning-handler -;; INFO: Used lq/sq ;; WARN: Return type mismatch none vs object. ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 119] ;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 195] @@ -79,18 +70,10 @@ (let ((s1-0 (command-get-process "prsn-chair-shackle" *target*)) (gp-1 (new 'stack-no-clear 'matrix)) (s2-0 *prsn-torture-lightning-joints*) - (s3-1 - (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (the-as int (-> s3-0 x))) - ) + (s3-1 (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (-> s3-0 x))) ) *prsn-chair-shackle-lightning-joints* - (let ((v1-7 (rand-vu-int-range-exclude - 0 - (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) - (the-as int (-> s4-0 x)) - ) - ) - ) + (let ((v1-7 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) (when s1-0 (set! (-> s4-0 x) v1-7) (vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13)) @@ -118,13 +101,7 @@ ((= arg2 'lightning-needle) (let ((gp-2 (command-get-process "prsn-chair-shackle" *target*))) *prsn-chair-shackle-lightning-joints* - (let ((v1-38 (rand-vu-int-range-exclude - 0 - (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) - (the-as int (-> s4-0 x)) - ) - ) - ) + (let ((v1-38 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) (when gp-2 (set! (-> s4-0 x) v1-38) (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8))) @@ -176,8 +153,8 @@ (when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel))) (let* ((v1-52 (-> s2-3 length)) (s1-3 (-> s5-3 length)) - (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (the-as int (-> s3-0 x)))) - (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (the-as int (-> s4-0 x)))) + (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (-> s3-0 x))) + (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (-> s4-0 x))) ) (set! sv-112 (-> *part-id-table* 179)) (set! (-> s3-0 x) s0-2) @@ -235,7 +212,6 @@ ) ) -;; definition of type prsn-hang-cell (deftype prsn-hang-cell (process-drawable) ((path-u float :offset-assert 200) (path-du float :offset-assert 204) @@ -249,28 +225,12 @@ ) ) -;; definition for method 3 of type prsn-hang-cell -(defmethod inspect prsn-hang-cell ((obj prsn-hang-cell)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) - ) - (format #t "~2Tpath-u: ~f~%" (-> obj path-u)) - (format #t "~2Tpath-du: ~f~%" (-> obj path-du)) - (label cfg-4) - obj - ) -;; failed to figure out what this is: -(defskelgroup skel-prsn-hang-cell prsn-hang-cell 0 2 - ((1 (meters 999999))) +(defskelgroup skel-prsn-hang-cell prsn-hang-cell prsn-hang-cell-lod0-jg prsn-hang-cell-idle-ja + ((prsn-hang-cell-lod0-mg (meters 999999))) :bounds (static-spherem 0 -9.5 0 10) ) -;; failed to figure out what this is: (defstate idle (prsn-hang-cell) :virtual #t :code (behavior () @@ -299,7 +259,6 @@ ) ) -;; definition for method 11 of type prsn-hang-cell ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! prsn-hang-cell ((obj prsn-hang-cell) (arg0 entity-actor)) (with-pp @@ -340,7 +299,6 @@ ) ) -;; definition for function prsn-hang-cell-init-by-other ;; WARN: Return type mismatch object vs none. (defbehavior prsn-hang-cell-init-by-other prsn-hang-cell ((arg0 float)) (set! (-> self root) (new 'process 'trsqv)) @@ -359,14 +317,12 @@ (none) ) -;; failed to figure out what this is: -(defskelgroup skel-warp-gate-b warp-gate-b 0 2 - ((1 (meters 999999))) +(defskelgroup skel-warp-gate-b warp-gate-b warp-gate-b-lod0-jg warp-gate-b-idle-ja + ((warp-gate-b-lod0-mg (meters 999999))) :bounds (static-spherem 0 3 0 4) :origin-joint-index 3 ) -;; definition of type warp-gate-b (deftype warp-gate-b (warp-gate) () :heap-base #x80 @@ -375,20 +331,7 @@ :flag-assert #x1a00800100 ) -;; definition for method 3 of type warp-gate-b -(defmethod inspect warp-gate-b ((obj warp-gate-b)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (let ((t9-0 (method-of-type warp-gate inspect))) - (t9-0 obj) - ) - (label cfg-4) - obj - ) -;; definition for method 23 of type warp-gate-b ;; WARN: Return type mismatch draw-control vs none. (defmethod init-skel-and-collide warp-gate-b ((obj warp-gate-b)) (let ((s5-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) @@ -416,7 +359,6 @@ (none) ) -;; definition of type prsn-cell-door (deftype prsn-cell-door (process-drawable) ((frame float :offset-assert 200) (desired float :offset-assert 204) @@ -430,29 +372,13 @@ ) ) -;; definition for method 3 of type prsn-cell-door -(defmethod inspect prsn-cell-door ((obj prsn-cell-door)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) - ) - (format #t "~2Tframe: ~f~%" (-> obj frame)) - (format #t "~2Tdesired: ~f~%" (-> obj desired)) - (label cfg-4) - obj - ) -;; failed to figure out what this is: -(defskelgroup skel-prsn-cell-door prsn-cell-door 0 2 - ((1 (meters 999999))) +(defskelgroup skel-prsn-cell-door prsn-cell-door prsn-cell-door-lod0-jg prsn-cell-door-idle-ja + ((prsn-cell-door-lod0-mg (meters 999999))) :bounds (static-spherem -2.5 3.25 0 4.25) :origin-joint-index 3 ) -;; failed to figure out what this is: (defstate idle (prsn-cell-door) :virtual #t :event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block)) @@ -487,7 +413,6 @@ :post (the-as (function none :behavior prsn-cell-door) transform-post) ) -;; definition for method 11 of type prsn-cell-door ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! prsn-cell-door ((obj prsn-cell-door) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player)))) @@ -520,7 +445,6 @@ (none) ) -;; definition of type prsn-vent-fan (deftype prsn-vent-fan (process-drawable) () :heap-base #x50 @@ -532,27 +456,13 @@ ) ) -;; definition for method 3 of type prsn-vent-fan -(defmethod inspect prsn-vent-fan ((obj prsn-vent-fan)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) - ) - (label cfg-4) - obj - ) -;; failed to figure out what this is: -(defskelgroup skel-prsn-vent-fan prsn-vent-fan 0 3 - ((1 (meters 999999))) +(defskelgroup skel-prsn-vent-fan prsn-vent-fan prsn-vent-fan-lod0-jg prsn-vent-fan-idle-ja + ((prsn-vent-fan-lod0-mg (meters 999999))) :bounds (static-spherem -2.5 3.25 0 4.25) :origin-joint-index 3 ) -;; failed to figure out what this is: (defstate idle (prsn-vent-fan) :virtual #t :code (behavior () @@ -572,7 +482,6 @@ :post (the-as (function none :behavior prsn-vent-fan) ja-post) ) -;; definition for method 11 of type prsn-vent-fan ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! prsn-vent-fan ((obj prsn-vent-fan) (arg0 entity-actor)) (set! (-> obj root) (new 'process 'trsqv)) @@ -587,7 +496,6 @@ (none) ) -;; definition of type prsn-torture (deftype prsn-torture (process-drawable) () :heap-base #x50 @@ -599,23 +507,13 @@ ) ) -;; definition for method 3 of type prsn-torture -(defmethod inspect prsn-torture ((obj prsn-torture)) - (when (not obj) - (set! obj obj) - (goto cfg-4) - ) - (let ((t9-0 (method-of-type process-drawable inspect))) - (t9-0 obj) - ) - (label cfg-4) - obj - ) -;; failed to figure out what this is: (defstate idle (prsn-torture) :virtual #t - :event dark-lightning-handler + :event (the-as + (function process int symbol event-message-block object :behavior prsn-torture) + dark-lightning-handler + ) :code (behavior () (until #f (ja-no-eval :group! (ja-group) @@ -636,7 +534,6 @@ ) ) -;; definition for method 11 of type prsn-torture ;; WARN: Return type mismatch object vs none. (defmethod init-from-entity! prsn-torture ((obj prsn-torture) (arg0 entity-actor)) (let ((s4-0 (new 'process 'collide-shape obj (collide-list-enum usually-hit-by-player)))) @@ -732,7 +629,6 @@ (none) ) -;; failed to figure out what this is: (scene-method-16 (new 'static 'scene :name "fortress-save-friends-res" @@ -886,7 +782,3 @@ :save #t ) ) - - - - diff --git a/goal_src/jak2/levels/gungame/gungame-obs.gc b/goal_src/jak2/levels/gungame/gungame-obs.gc index 0baa0e42b4..4fbfce1b0b 100644 --- a/goal_src/jak2/levels/gungame/gungame-obs.gc +++ b/goal_src/jak2/levels/gungame/gungame-obs.gc @@ -87,7 +87,7 @@ (defmethod training-manager-method-32 training-manager ((obj training-manager)) (when (handle->process (-> obj voicebox)) - (if (= (gui-control-method-17 *gui-control* (-> obj last-sound-id)) (gui-action none)) + (if (= (get-status *gui-control* (-> obj last-sound-id)) (gui-status unknown)) (send-event (handle->process (-> obj voicebox)) 'speak-effect #f) (send-event (handle->process (-> obj voicebox)) 'speak-effect #t) ) @@ -96,13 +96,13 @@ ((= (-> (level-get-target-inside *level*) name) 'gungame) (if (zero? (-> obj gui-id)) (set! (-> obj gui-id) - (gui-control-method-9 *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) + (add-process *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) ) ) ) (else (when (nonzero? (-> obj gui-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj gui-id) @@ -215,7 +215,7 @@ ) (defmethod training-manager-method-30 training-manager ((obj training-manager) (arg0 game-text-id)) - (when (= (gui-control-method-17 *gui-control* (-> obj gui-id)) (gui-action playing)) + (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context @@ -270,15 +270,15 @@ (set! (-> self voicebox) (ppointer->handle (voicebox-spawn *target* (target-pos 0)))) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc001" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc001" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc002" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc002" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc003" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc003" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (until (cpad-pressed? 0 r1) @@ -286,18 +286,18 @@ (suspend) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc004" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc004" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc005" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc005" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc006" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc006" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc007" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc007" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (when *target* @@ -307,12 +307,12 @@ ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* *target* (gui-channel sig) (gui-action play) "sigc008" -99.0 0) + (add-process *gui-control* *target* (gui-channel sig) (gui-action play) "sigc008" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc009" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc009" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (while (or (not *target*) (zero? (logand (focus-status gun) (-> *target* focus-status)))) @@ -320,17 +320,17 @@ (suspend) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc010" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc010" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc011" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc011" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (when (nonzero? (training-manager-method-26 self)) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc012" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc012" -99.0 0) ) (let ((gp-2 (training-manager-method-26 self))) (while (= (training-manager-method-26 self) gp-2) @@ -339,13 +339,13 @@ ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc013" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc013" -99.0 0) ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc014" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc014" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (task-node-close! (game-task-node city-red-gun-training-introduction)) @@ -849,7 +849,7 @@ (set! (-> self egg-count) 0) (if (not (task-node-open? (game-task-node sewer-enemy-resolution))) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv178" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv178" -99.0 0) ) ) (until #f @@ -1006,15 +1006,15 @@ (set! (-> self voicebox) (ppointer->handle (voicebox-spawn *target* (target-pos 0)))) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc015" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc015" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc016" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc016" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc017" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc017" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (let ((gp-2 (-> *game-info* gun-type))) @@ -1024,12 +1024,12 @@ ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc073" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc073" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc075" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc075" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (set! (-> self combo-done?) #f) @@ -1054,9 +1054,9 @@ (cond ((-> self combo-done?) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc080" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc080" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) #t @@ -1064,9 +1064,9 @@ ) (else (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc077" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc077" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) ) @@ -1075,12 +1075,12 @@ #f (label cfg-61) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc018" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc018" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc022" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc022" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (task-node-close! (game-task-node city-yellow-gun-training-introduction)) @@ -1230,12 +1230,12 @@ (cond ((zero? v1-106) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc026" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc026" -99.0 0) ) ) ((= v1-106 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc027" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc027" -99.0 0) ) ) ) @@ -1271,7 +1271,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-1 format) - (gp-1 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-1 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-0 "~S") ) (let* ((s3-0 format) @@ -1289,7 +1289,7 @@ ((>= (-> *game-info* score) (-> s5-0 1)) (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-2 format) - (gp-2 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-2 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-1 "~S") ) (let* ((s3-1 format) @@ -1307,7 +1307,7 @@ ((>= (-> *game-info* score) (-> s5-0 2)) (set! (-> *game-info* goal) (-> s5-0 1)) (let ((s5-3 format) - (gp-3 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-3 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-2 "~S") ) (let* ((s3-2 format) @@ -1325,7 +1325,7 @@ (else (set! (-> *game-info* goal) (-> s5-0 2)) (let ((s5-4 format) - (gp-4 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-4 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-3 "~S") ) (let* ((s3-3 format) @@ -1347,7 +1347,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-5 format) - (gp-5 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-5 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-4 "~S") ) (let* ((s3-4 format) @@ -1365,7 +1365,7 @@ ((>= (-> *game-info* score) (-> s5-0 1)) (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-6 format) - (gp-6 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-6 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-5 "~S") ) (let* ((s3-5 format) @@ -1383,7 +1383,7 @@ (else (set! (-> *game-info* goal) (-> s5-0 1)) (let ((s5-7 format) - (gp-7 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-7 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-6 "~S") ) (let* ((s3-6 format) @@ -1407,7 +1407,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-8 format) - (gp-8 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-8 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-7 "~S") ) (let* ((s3-7 format) @@ -1425,7 +1425,7 @@ (else (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-9 format) - (gp-9 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-9 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-8 "~S") ) (let* ((s3-8 format) @@ -1445,7 +1445,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-10 format) - (gp-10 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-10 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-9 "~S") ) (let* ((s3-9 format) @@ -1463,7 +1463,7 @@ ((>= (-> *game-info* score) (-> s5-0 1)) (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-11 format) - (gp-11 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-11 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-10 "~S") ) (let* ((s3-10 format) @@ -1481,7 +1481,7 @@ ((>= (-> *game-info* score) (-> s5-0 2)) (set! (-> *game-info* goal) (-> s5-0 1)) (let ((s5-12 format) - (gp-12 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-12 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-11 "~S") ) (let* ((s3-11 format) @@ -1499,7 +1499,7 @@ ((>= (-> *game-info* score) (-> self training-goal)) (set! (-> *game-info* goal) (-> s5-0 2)) (let ((s5-13 format) - (gp-13 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-13 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-12 "~S") ) (let* ((s3-12 format) @@ -1517,7 +1517,7 @@ (else (set! (-> *game-info* goal) (-> self training-goal)) (let ((s5-14 format) - (gp-14 (clear (the-as string (-> (the-as hud gp-0) strings 1 type)))) + (gp-14 (clear (-> (the-as hud gp-0) strings 1 text))) (s4-13 "~S") ) (let* ((s3-13 format) @@ -1592,7 +1592,7 @@ (when (and (not (logtest? (-> s5-0 flags) 4)) (not (-> self first-enemy-shown?))) (if (task-node-open? (game-task-node city-red-gun-training-try-once)) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc024" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc024" -99.0 0) ) ) (set! (-> self first-enemy-shown?) #t) @@ -1600,7 +1600,7 @@ (when (and (logtest? (-> s5-0 flags) 4) (not (-> self first-citizen-shown?))) (if (task-node-open? (game-task-node city-red-gun-training-try-once)) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc025" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc025" -99.0 0) ) ) (set! (-> self first-citizen-shown?) #t) @@ -1791,17 +1791,17 @@ (cond ((zero? v1-10) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv179" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv179" -99.0 0) ) ) ((= v1-10 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv180" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv180" -99.0 0) ) ) ((= v1-10 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv181" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv181" -99.0 0) ) ) ) @@ -1816,22 +1816,22 @@ (cond ((zero? v1-17) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) ) ) ((= v1-17 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) ) ) ((= v1-17 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) ) ) ((= v1-17 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) ) ) ) @@ -1845,22 +1845,22 @@ (cond ((zero? v1-28) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) ) ) ((= v1-28 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) ) ) ((= v1-28 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) ) ) ((= v1-28 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) ) ) ) @@ -1879,22 +1879,22 @@ (cond ((zero? v1-35) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) ) ) ((= v1-35 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) ) ) ((= v1-35 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) ) ) ((= v1-35 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) ) ) ) @@ -1908,22 +1908,22 @@ (cond ((zero? v1-46) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) ) ) ((= v1-46 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) ) ) ((= v1-46 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) ) ) ((= v1-46 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) ) ) ) @@ -1947,7 +1947,7 @@ (none) ) :code (behavior () - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (when (> (-> self egg-count) 0) diff --git a/goal_src/jak2/levels/intro/intro-scenes.gc b/goal_src/jak2/levels/intro/intro-scenes.gc index 33ba12a410..9facb6878a 100644 --- a/goal_src/jak2/levels/intro/intro-scenes.gc +++ b/goal_src/jak2/levels/intro/intro-scenes.gc @@ -2294,7 +2294,12 @@ (set! (-> gp-0 flags) (the-as uint 8)) (set! (-> gp-0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xdbc))) (set-vector! (-> gp-0 pos) 256 180 #xffffff 0) - (set-vector! (-> gp-0 color) 128 128 128 128) + (let ((v1-7 (-> gp-0 color2))) + (set! (-> v1-7 0) 128) + (set! (-> v1-7 1) 128) + (set! (-> v1-7 2) 128) + (set! (-> v1-7 3) 128) + ) (set! (-> gp-0 scale-x) 1.0) (set! (-> gp-0 scale-y) 1.0) (when (and s5-0 (-> gp-0 tex)) @@ -2314,7 +2319,7 @@ (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s3-0 (-> s2-0 base)) ) - (hud-sprite-method-9 gp-0 s2-0 s5-0) + (draw gp-0 s2-0 s5-0) (let ((a3-0 (-> s2-0 base))) (let ((v1-31 (the-as object (-> s2-0 base)))) (set! (-> (the-as dma-packet v1-31) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2375,13 +2380,23 @@ (set! (-> gp-0 flags) (the-as uint 8)) (set! (-> gp-0 scale-x) 0.85) (set! (-> gp-0 scale-y) 0.85) - (set-vector! (-> gp-0 color) 128 128 128 128) + (let ((v1-8 (-> gp-0 color2))) + (set! (-> v1-8 0) 128) + (set! (-> v1-8 1) 128) + (set! (-> v1-8 2) 128) + (set! (-> v1-8 3) 128) + ) (case (scf-get-territory) ((1) (set-vector! (-> gp-0 pos) 256 170 #xffffff 0) (set! (-> gp-0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #xdbc))) (set! (-> s5-0 flags) (the-as uint 8)) - (set-vector! (-> s5-0 color) 128 128 128 128) + (let ((v1-13 (-> s5-0 color2))) + (set! (-> v1-13 0) 128) + (set! (-> v1-13 1) 128) + (set! (-> v1-13 2) 128) + (set! (-> v1-13 3) 128) + ) (set! (-> s5-0 scale-x) 0.55) (set-vector! (-> s5-0 pos) 285 255 #xffffff 0) (case (-> *setting-control* user-current language) @@ -2428,9 +2443,9 @@ (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-0 (-> s1-0 base)) ) - (hud-sprite-method-9 gp-0 s1-0 s4-0) + (draw gp-0 s1-0 s4-0) (if (-> s5-0 tex) - (hud-sprite-method-9 s5-0 s1-0 s4-0) + (draw s5-0 s1-0 s4-0) ) (let ((a3-0 (-> s1-0 base))) (let ((v1-59 (the-as object (-> s1-0 base)))) diff --git a/goal_src/jak2/levels/temple/mountain-scenes.gc b/goal_src/jak2/levels/temple/mountain-scenes.gc index fc050d420c..0c329447b1 100644 --- a/goal_src/jak2/levels/temple/mountain-scenes.gc +++ b/goal_src/jak2/levels/temple/mountain-scenes.gc @@ -1716,7 +1716,7 @@ (while (movie?) (suspend) ) - (gui-control-method-10 *gui-control* self (gui-channel art-load)) + (remove-process *gui-control* self (gui-channel art-load)) ) (ja-channel-set! 1) (set! (-> self draw bounds w) 491520.0) @@ -1767,15 +1767,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-plat-buried-rocks-a" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-plat-buried-rocks-a" -99.0 0) (go (method-of-object obj idle)) ) ) @@ -3175,15 +3167,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-step-plat-rocks-a" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-a" -99.0 0) (go (method-of-object obj idle)) ) ) @@ -3279,15 +3263,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-step-plat-rocks-b" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-b" -99.0 0) (go (method-of-object obj idle)) ) ) @@ -3390,15 +3366,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-step-plat-rocks-c" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-c" -99.0 0) (go (method-of-object obj idle)) ) ) diff --git a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc index 9590e91850..3e8ef72806 100644 --- a/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/ai/enemy_REF.gc @@ -805,7 +805,7 @@ (set! (-> obj incoming blue-juggle-count) (the-as uint 1)) ) (else - (set! (-> obj incoming blue-juggle-count) (the-as uint (+ (-> obj incoming blue-juggle-count) 1))) + (+! (-> obj incoming blue-juggle-count) 1) ) ) (set! (-> obj incoming attack-time) a0-4) @@ -3269,7 +3269,7 @@ ) (vector-float*! arg0 arg0 (lerp (-> s5-0 knocked-blue-vxz-lo) (-> s5-0 knocked-blue-vxz-hi) f30-7)) (cond - ((>= (the-as uint 4) (the-as uint (-> obj incoming blue-juggle-count))) + ((>= (the-as uint 4) (-> obj incoming blue-juggle-count)) (set! (-> arg0 y) (lerp (-> s5-0 knocked-blue-vy-lo) (-> s5-0 knocked-blue-vy-hi) f30-7)) ) (else diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc index 5fc5ae134e..592a680f3c 100644 --- a/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/jak2/engine/ambient/ambient_REF.gc @@ -18,7 +18,7 @@ ) ) ) - (= (gui-control-method-17 *gui-control* a1-3) (gui-action playing)) + (= (get-status *gui-control* a1-3) (gui-status active)) ) ) @@ -39,7 +39,7 @@ ;; WARN: Return type mismatch int vs none. (defun kill-current-talker ((arg0 symbol) (arg1 pair) (arg2 symbol)) (if (not (member 'daxter arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -51,7 +51,7 @@ ) ) (if (not (member 'voicebox arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -63,7 +63,7 @@ ) ) (if (not (member 'message arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -75,7 +75,7 @@ ) ) (when (not (member 'notice arg1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -85,7 +85,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -182,7 +182,7 @@ ) (talker-speech-class-method-10 arg0) ) - (set! s2-0 (gui-control-method-14 *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) + (set! s2-0 (lookup-gui-connection-id *gui-control* (-> arg0 name) (-> arg0 channel) (gui-action none))) (set! s2-0 (cond ((zero? s2-0) (let ((v1-17 (process-spawn talker :init talker-init arg0 arg2 arg3 :to arg1))) @@ -223,13 +223,13 @@ ) ) (set! (-> self voice-id) - (gui-control-method-9 *gui-control* self (-> arg0 channel) (gui-action queue) (-> arg0 name) 81920.0 0) + (add-process *gui-control* self (-> arg0 channel) (gui-action queue) (-> arg0 name) 81920.0 0) ) ) ) (when (nonzero? (-> arg0 text-message)) (let* ((a0-6 *gui-control*) - (t9-1 (method-of-object a0-6 gui-control-method-9)) + (t9-1 (method-of-object a0-6 add-process)) (a1-3 self) (v1-15 (shr (the-as int (-> arg0 channel)) 4)) ) @@ -378,10 +378,8 @@ ) ) (while (< (- (-> self clock frame-counter) (-> self start-time)) (the-as time-frame (+ (-> self message delay) 300))) - (if (and (or (zero? (-> self voice-id)) (= (gui-control-method-17 *gui-control* (-> self voice-id)) (gui-action play))) - (or (zero? (-> self message-id)) - (= (gui-control-method-17 *gui-control* (-> self message-id)) (gui-action playing)) - ) + (if (and (or (zero? (-> self voice-id)) (= (get-status *gui-control* (-> self voice-id)) (gui-status ready))) + (or (zero? (-> self message-id)) (= (get-status *gui-control* (-> self message-id)) (gui-status active))) ) (go-virtual active) ) @@ -403,7 +401,7 @@ (set-setting! 'hint (process->ppointer self) 0 0) (set-setting! 'speech-control #f 0 0) (if (nonzero? (-> self voice-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self voice-id) @@ -449,7 +447,7 @@ (auto-save-user) ) (if (nonzero? (-> self voice-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> self voice-id) @@ -461,7 +459,7 @@ ) ) (if (nonzero? (-> self message-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> self message-id) @@ -484,8 +482,8 @@ (local-vars (v1-43 symbol)) (let ((gp-1 (zero? (logand (-> self message flags) 2)))) (while (or (and (nonzero? (-> self voice-id)) - (let ((v1-34 (gui-control-method-17 *gui-control* (-> self voice-id)))) - (or (= v1-34 (gui-action play)) (= v1-34 (gui-action playing))) + (let ((v1-34 (get-status *gui-control* (-> self voice-id)))) + (or (= v1-34 (gui-status ready)) (= v1-34 (gui-status active))) ) (begin (dotimes (s5-2 4) @@ -503,24 +501,21 @@ ) ) (and (nonzero? (-> self message-id)) - (= (gui-control-method-17 *gui-control* (-> self message-id)) (gui-action playing)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (or (< (- (-> self clock frame-counter) (-> self state-time)) (the-as time-frame (-> self message text-duration))) (and (logtest? (-> self message flags) 16) (-> self region) (region-method-9 (-> self region) (target-pos 0))) ) ) (< (- (-> self clock frame-counter) (-> self state-time)) (seconds 0.05)) ) - (when (and (nonzero? (-> self voice-id)) - (not gp-1) - (zero? (gui-control-method-17 *gui-control* (-> self voice-id))) - ) + (when (and (nonzero? (-> self voice-id)) (not gp-1) (zero? (get-status *gui-control* (-> self voice-id)))) (remove-setting! 'music-volume) (remove-setting! 'sfx-volume) (remove-setting! 'dialog-volume) (set! gp-1 #t) ) (when (and (nonzero? (-> self message-id)) - (= (gui-control-method-17 *gui-control* (-> self message-id)) (gui-action playing)) + (= (get-status *gui-control* (-> self message-id)) (gui-status active)) (not (paused?)) ) (if (logtest? (-> self message flags) 32) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc index ba03745163..0b12944af9 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug_REF.gc @@ -267,16 +267,16 @@ ;; definition for function camera-line2d (defun camera-line2d ((arg0 vector4w) (arg1 vector4w)) - (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 x) (the-as int (* (+ (-> arg0 x) 1792) 16))) + (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 x) (* (+ (-> arg0 x) 1792) 16)) (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 y) - (the-as int (* (- 2256 (the-as int (-> (the-as cam-dbg-scratch arg0) linevec4w 0 y))) 16)) + (* (- 2256 (-> (the-as cam-dbg-scratch arg0) linevec4w 0 y)) 16) ) (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 0 z) #x7fffff) (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 x) - (the-as int (* (+ (-> (the-as cam-dbg-scratch arg1) linevec4w 0 x) 1792) 16)) + (* (+ (-> (the-as cam-dbg-scratch arg1) linevec4w 0 x) 1792) 16) ) (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 y) - (the-as int (* (- 2256 (the-as int (-> (the-as cam-dbg-scratch arg1) linevec4w 0 y))) 16)) + (* (- 2256 (-> (the-as cam-dbg-scratch arg1) linevec4w 0 y)) 16) ) (set! (-> (the-as cam-dbg-scratch #x70000000) linevec4w 1 z) #x7fffff) (cam-line-dma) @@ -304,7 +304,7 @@ ) (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) 20) (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x)) + (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 x) ) (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) (+ (the int (* f28-0 f24-0)) 20)) (camera-line2d @@ -319,7 +319,7 @@ ) (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 x) (+ (the int (* f26-0 f30-0)) 20)) (set! (-> (the-as cam-dbg-scratch #x70000000) plotvec 1 y) - (the-as int (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y)) + (-> (the-as cam-dbg-scratch #x70000000) plotvec 0 y) ) (camera-line2d (the-as vector4w (-> (the-as cam-dbg-scratch #x70000000) plotvec)) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc index 9e854a2dcb..c4239861e1 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -3476,7 +3476,7 @@ (cam-layout-function-call (-> s3-1 items s2-1 val-func) *temp-string* - (the-as int (-> s3-1 items s2-1 val-parm0)) + (-> s3-1 items s2-1 val-parm0) (the-as basic (-> s3-1 items s2-1 val-parm1)) ) (cam-layout-print 320 s4-2 *temp-string*) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc index 73c99b64b9..04437c97f3 100644 --- a/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc +++ b/test/decompiler/reference/jak2/engine/camera/cam-update_REF.gc @@ -225,20 +225,20 @@ (set! (-> a3-6 quad) (-> s5-2 bsp bsp-offset quad)) (cond ((zero? (-> s5-2 bsp cam-using-back)) - (+! (-> a2-9 x) (the float (* (the-as int (-> v1-107 front-box-min x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a2-9 y) (the float (* (the-as int (-> v1-107 front-box-min y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a2-9 z) (the float (* (the-as int (-> v1-107 front-box-min z)) (the int (-> s5-2 bsp bsp-scale z))))) - (+! (-> a3-6 x) (the float (* (the-as int (-> v1-107 front-box-max x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a3-6 y) (the float (* (the-as int (-> v1-107 front-box-max y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a3-6 z) (the float (* (the-as int (-> v1-107 front-box-max z)) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a2-9 x) (the float (* (-> v1-107 front-box-min x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a2-9 y) (the float (* (-> v1-107 front-box-min y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a2-9 z) (the float (* (-> v1-107 front-box-min z) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a3-6 x) (the float (* (-> v1-107 front-box-max x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a3-6 y) (the float (* (-> v1-107 front-box-max y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a3-6 z) (the float (* (-> v1-107 front-box-max z) (the int (-> s5-2 bsp bsp-scale z))))) ) (else - (+! (-> a2-9 x) (the float (* (the-as int (-> v1-107 back-box-min x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a2-9 y) (the float (* (the-as int (-> v1-107 back-box-min y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a2-9 z) (the float (* (the-as int (-> v1-107 back-box-min z)) (the int (-> s5-2 bsp bsp-scale z))))) - (+! (-> a3-6 x) (the float (* (the-as int (-> v1-107 back-box-max x)) (the int (-> s5-2 bsp bsp-scale x))))) - (+! (-> a3-6 y) (the float (* (the-as int (-> v1-107 back-box-max y)) (the int (-> s5-2 bsp bsp-scale y))))) - (+! (-> a3-6 z) (the float (* (the-as int (-> v1-107 back-box-max z)) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a2-9 x) (the float (* (-> v1-107 back-box-min x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a2-9 y) (the float (* (-> v1-107 back-box-min y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a2-9 z) (the float (* (-> v1-107 back-box-min z) (the int (-> s5-2 bsp bsp-scale z))))) + (+! (-> a3-6 x) (the float (* (-> v1-107 back-box-max x) (the int (-> s5-2 bsp bsp-scale x))))) + (+! (-> a3-6 y) (the float (* (-> v1-107 back-box-max y) (the int (-> s5-2 bsp bsp-scale y))))) + (+! (-> a3-6 z) (the float (* (-> v1-107 back-box-max z) (the int (-> s5-2 bsp bsp-scale z))))) ) ) (add-debug-box #t (bucket-id debug2) a2-9 a3-6 (new 'static 'rgba :g #xff :b #xff :a #x80)) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc index 069d9a8a1f..eeb627f5bb 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-rider_REF.gc @@ -45,7 +45,7 @@ (let ((s4-0 (-> arg0 prim-core collide-as)) (s3-0 (-> obj child 0)) ) - (countdown (s2-0 (the-as uint (-> obj num-children))) + (countdown (s2-0 (-> obj num-children)) (when (and (logtest? (-> s3-0 prim-core collide-with) s4-0) (logtest? (-> s3-0 prim-core action) (collide-action rideable)) ) @@ -432,7 +432,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc index df388c9557..53a2f70b77 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape_REF.gc @@ -96,7 +96,7 @@ (init-vf0-vector) (nop!) (let ((s4-0 (the-as collide-shape-prim obj)) - (s3-0 (the-as uint (-> obj num-children))) + (s3-0 (-> obj num-children)) ) (nop!) (let ((v1-0 (-> other prim-core collide-as))) @@ -154,7 +154,7 @@ (init-vf0-vector) (nop!) (let ((s4-0 (the-as object other)) - (s3-0 (the-as uint (-> other num-children))) + (s3-0 (-> other num-children)) ) (nop!) (let ((v1-0 (-> obj prim-core collide-with))) @@ -493,7 +493,7 @@ (let ((s4-0 (-> arg1 prim-core collide-as)) (s3-0 (-> obj child 0)) ) - (countdown (s2-0 (the-as uint (-> obj num-children))) + (countdown (s2-0 (-> obj num-children)) (if (logtest? (-> s3-0 prim-core collide-with) s4-0) (collide-with-collide-cache-prim-mesh s3-0 arg0 arg1) ) @@ -593,7 +593,7 @@ (let ((s4-0 (-> arg1 prim-core collide-as)) (s3-0 (-> obj child 0)) ) - (countdown (s2-0 (the-as uint (-> obj num-children))) + (countdown (s2-0 (-> obj num-children)) (if (logtest? (-> s3-0 prim-core collide-with) s4-0) (collide-with-collide-cache-prim-sphere s3-0 arg0 arg1) ) @@ -2421,7 +2421,7 @@ (-> obj local-sphere w) (new 'static 'rgba :g #xff :a #x10) ) - (countdown (s5-0 (the-as uint (-> obj num-children))) + (countdown (s5-0 (-> obj num-children)) (debug-draw (-> obj child s5-0)) ) 0 @@ -2795,7 +2795,7 @@ ) (let ((a1-1 (-> arg0 collide-with-filter))) (nop!) - (let ((s3-0 (the-as uint (-> obj num-children))) + (let ((s3-0 (-> obj num-children)) (v1-1 (logand v1-0 a1-1)) ) (.lvf vf1 (&-> arg1 prim-core world-sphere quad)) @@ -2854,7 +2854,7 @@ (nop!) (let ((a0-1 (-> arg0 collide-with-filter))) (nop!) - (let ((s3-0 (the-as uint (-> arg1 num-children))) + (let ((s3-0 (-> arg1 num-children)) (v1-1 (logand v1-0 a0-1)) ) (.lvf vf2 (&-> obj prim-core world-sphere quad)) diff --git a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc index a793b7cdc4..525d06d610 100644 --- a/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc +++ b/test/decompiler/reference/jak2/engine/common_objs/plat_REF.gc @@ -314,15 +314,7 @@ ) :trans (the-as (function none :behavior drop-plat) plat-trans) :code (behavior () - (gui-control-method-9 - *gui-control* - self - (gui-channel art-load) - (gui-action queue) - (-> self anim name) - -99.0 - 0 - ) + (add-process *gui-control* self (gui-channel art-load) (gui-action queue) (-> self anim name) -99.0 0) (until #f (when (not (-> self bouncing)) (logior! (-> self mask) (process-mask sleep-code)) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index 15b7aef966..44fb018560 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -94,7 +94,7 @@ (set! (-> s5-0 vector 1 y) 128) (set! (-> s5-0 vector 1 z) 128) (set! (-> s5-0 vector 1 w) 128) - (set! (-> s5-0 vector 0 y) (the-as int (+ (-> s5-0 vector 0 y) 288))) + (+! (-> s5-0 vector 0 y) 288) (let* ((a1-11 buf) (a3-4 (the-as vector4w-2 (-> a1-11 base))) ) @@ -102,8 +102,8 @@ (set! (-> a3-4 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a1-11 base) (&+ (the-as pointer a3-4) 32)) ) - (set! (-> s5-0 vector 0 x) (the-as int (+ (-> s5-0 vector 0 x) -256))) - (set! (-> s5-0 vector 0 y) (the-as int (+ (-> s5-0 vector 0 y) -288))) + (+! (-> s5-0 vector 0 x) -256) + (+! (-> s5-0 vector 0 y) -288) (set! (-> s5-0 vector 1 x) 128) (set! (-> s5-0 vector 1 y) 255) (let* ((a1-18 buf) @@ -113,7 +113,7 @@ (set! (-> a3-6 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a1-18 base) (&+ (the-as pointer a3-6) 32)) ) - (set! (-> s5-0 vector 0 x) (the-as int (+ (-> s5-0 vector 0 x) 512))) + (+! (-> s5-0 vector 0 x) 512) (set! (-> s5-0 vector 1 y) 128) (set! (-> s5-0 vector 1 z) 255) (let* ((a1-23 buf) @@ -123,8 +123,8 @@ (set! (-> a3-8 vector 1 quad) (-> s5-0 vector 0 quad)) (set! (-> a1-23 base) (&+ (the-as pointer a3-8) 32)) ) - (set! (-> s5-0 vector 0 x) (the-as int (+ (-> s5-0 vector 0 x) -256))) - (set! (-> s5-0 vector 0 y) (the-as int (+ (-> s5-0 vector 0 y) -288))) + (+! (-> s5-0 vector 0 x) -256) + (+! (-> s5-0 vector 0 y) -288) (set! (-> s5-0 vector 1 x) 255) (set! (-> s5-0 vector 1 y) 128) (let* ((a3-10 buf) @@ -260,8 +260,8 @@ (set! (-> s3-0 vector 1 w) (the-as int (-> var-end-color a))) ) ) - (set! (-> s4-0 vector 0 z) (the-as int (+ (-> s4-0 vector 0 z) -8192))) - (set! (-> s4-0 vector 1 z) (the-as int (+ (-> s4-0 vector 1 z) -8192))) + (+! (-> s4-0 vector 0 z) -8192) + (+! (-> s4-0 vector 1 z) -8192) (let* ((a3-7 buf2) (a1-50 (the-as (inline-array vector4w-2) (-> a3-7 base))) ) @@ -305,8 +305,8 @@ 'stack 'font-context *font-default-matrix* - (the-as int (+ (-> screen-offset x) -1792 (/ (the-as int (-> screen-pos x)) 16))) - (the-as int (+ (-> screen-offset y) -1855 (/ (the-as int (-> screen-pos y)) 16))) + (+ (-> screen-offset x) -1792 (/ (-> screen-pos x) 16)) + (+ (-> screen-offset y) -1855 (/ (-> screen-pos y) 16)) 0.0 color (font-flags shadow kerning) @@ -314,7 +314,7 @@ ) ) (let ((v1-10 font-ctx)) - (set! (-> v1-10 origin z) (the float (/ (the-as int (-> screen-pos z)) 16))) + (set! (-> v1-10 origin z) (the float (/ (-> screen-pos z) 16))) ) (draw-string text buf font-ctx) ) @@ -418,9 +418,9 @@ (set! (-> s4-0 vector 0 y) (the-as int (-> s3-0 g))) (set! (-> s4-0 vector 0 z) (the-as int (-> s3-0 b))) (set! (-> s4-0 vector 0 w) (the-as int (-> s3-0 a))) - (set! (-> s5-0 vector 0 z) (the-as int (+ (-> s5-0 vector 0 z) -8192))) - (set! (-> s5-0 vector 1 z) (the-as int (+ (-> s5-0 vector 1 z) -8192))) - (set! (-> s5-0 vector 2 z) (the-as int (+ (-> s5-0 vector 2 z) -8192))) + (+! (-> s5-0 vector 0 z) -8192) + (+! (-> s5-0 vector 1 z) -8192) + (+! (-> s5-0 vector 2 z) -8192) (let* ((a1-21 buf) (a3-5 (the-as (inline-array vector) (-> a1-21 base))) ) @@ -673,11 +673,11 @@ (let ((p1 (new 'stack 'vector4w))) (set! (-> p0 quad) (-> start quad)) (set! (-> p1 quad) (-> end quad)) - (set! (-> p0 x) (the-as int (* (+ (-> p0 x) 2048) 16))) - (set! (-> p0 y) (* -16 (the-as int (- 2048 (the-as int (-> p0 y)))))) + (set! (-> p0 x) (* (+ (-> p0 x) 2048) 16)) + (set! (-> p0 y) (* -16 (- 2048 (-> p0 y)))) (set! (-> p0 z) #x7fffff) - (set! (-> p1 x) (the-as int (* (+ (-> p1 x) 2048) 16))) - (set! (-> p1 y) (* -16 (the-as int (- 2048 (the-as int (-> p1 y)))))) + (set! (-> p1 x) (* (+ (-> p1 x) 2048) 16)) + (set! (-> p1 y) (* -16 (- 2048 (-> p1 y)))) (set! (-> p1 z) #x7fffff) (let ((a0-18 (the-as (pointer uint64) (-> buf base)))) (let* ((a1-7 buf) @@ -941,8 +941,8 @@ (set! (-> v1-2 pos quad) (-> position quad)) (cond (screen-offset - (set! (-> v1-2 offset x) (the-as int (-> screen-offset x))) - (set! (-> v1-2 offset y) (the-as int (-> screen-offset y))) + (set! (-> v1-2 offset x) (-> screen-offset x)) + (set! (-> v1-2 offset y) (-> screen-offset y)) ) (else (set! (-> v1-2 offset x) 0) @@ -1619,7 +1619,6 @@ ) ;; 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)) diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index dd610149de..5f84d5218d 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -126,7 +126,7 @@ (format (clear *temp-string*) "region-~D~%" (-> obj id)) (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) (when (>= arg1 1) (let ((s4-1 (-> obj on-enter))) (when s4-1 @@ -137,7 +137,7 @@ (format (clear *temp-string*) "(on-enter ~S)" s4-1) (s3-1 s2-1 (the-as bucket-id s1-1) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((s4-2 (-> obj on-inside))) @@ -149,7 +149,7 @@ (format (clear *temp-string*) "(on-inside ~S)" s4-2) (s3-2 s2-2 (the-as bucket-id s1-2) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((s5-1 (-> obj on-exit))) @@ -161,7 +161,7 @@ (format (clear *temp-string*) "(on-exit ~S)" s5-1) (s4-3 s3-3 (the-as bucket-id s2-3) *temp-string* arg0 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc index 0161848819..93ffa760d6 100644 --- a/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/draw/drawable_REF.gc @@ -504,8 +504,8 @@ (defun-debug draw-instance-info ((arg0 string)) (local-vars (sv-16 uint) - (sv-32 uint32) - (sv-48 uint32) + (sv-32 uint) + (sv-48 uint) (sv-64 int) (sv-80 int) (sv-96 int) @@ -632,14 +632,14 @@ s0-1 sv-16 sv-32 - (/ (* 2.0 (the float sv-16)) (the float (- sv-32 (the-as uint sv-16)))) + (/ (* 2.0 (the float sv-16)) (the float (- sv-32 sv-16))) sv-48 ) (+! s3-2 sv-16) - (+! s4-3 (the-as int sv-32)) + (+! s4-3 sv-32) (set! f30-0 (+ 29.0 - (* 5.5 (the float (- sv-32 (the-as uint sv-16)))) + (* 5.5 (the float (- sv-32 sv-16))) (* 22.0 (the float sv-48)) (* 8.0 (the float sv-32)) (* 53.0 (the float (/ (+ s2-2 9) (the-as uint 10)))) @@ -679,7 +679,7 @@ (set! sv-112 (+ sv-112 (-> v1-100 data a0-36 debug num-dverts))) (set! sv-128 (+ sv-128 (-> v1-100 data a0-36 tex-count))) ) - (set! sv-144 (+ sv-144 (the-as int (-> (the-as prototype-bucket-tie s5-0) count sv-64)))) + (set! sv-144 (+ sv-144 (-> (the-as prototype-bucket-tie s5-0) count sv-64))) (format arg0 "~5D ~7D ~5D ~5D" @@ -695,10 +695,10 @@ sv-112 (/ (* 2.0 (the float sv-96)) (the float (- sv-112 sv-96))) sv-128 - (* (the-as uint sv-96) (the-as uint (-> (the-as prototype-bucket-tie s5-0) count sv-64))) + (* (the-as uint sv-96) (-> (the-as prototype-bucket-tie s5-0) count sv-64)) ) - (+! s1-3 (* (the-as uint sv-96) (the-as uint (-> (the-as prototype-bucket-tie s5-0) count sv-64)))) - (+! s0-2 (* (the-as uint sv-112) (the-as uint (-> (the-as prototype-bucket-tie s5-0) count sv-64)))) + (+! s1-3 (* (the-as uint sv-96) (-> (the-as prototype-bucket-tie s5-0) count sv-64))) + (+! s0-2 (* (the-as uint sv-112) (-> (the-as prototype-bucket-tie s5-0) count sv-64))) (+! s3-2 sv-96) (+! s4-3 sv-112) (+! s2-3 sv-128) @@ -1070,7 +1070,7 @@ ) ) (else - (while (and (< lod-idx (the-as int (-> dc lod-set max-lod))) (< (-> dc lod-set lod lod-idx dist) dist-w)) + (while (and (< lod-idx (-> dc lod-set max-lod)) (< (-> dc lod-set lod lod-idx dist) dist-w)) (+! lod-idx 1) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc index 2e2371b842..be52e3c1db 100644 --- a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc @@ -516,7 +516,7 @@ :flag-assert #xd00000110 (:methods (new (symbol type process-drawable pickup-type float) _type_ 0) - (get-gun-ammo (_type_ target) float 12) + (get-gun-ammo (_type_) float 12) ) ) diff --git a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc index 0ac6be1618..6daa56d270 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc @@ -301,7 +301,7 @@ (race-total-lap-count int32 :offset-assert 508) (race-position int32 :offset-assert 512) (race-number-turbos int32 :offset-assert 516) - (bot-health uint32 3 :offset-assert 520) + (bot-health float 3 :offset-assert 520) (demo-state uint32 :offset-assert 532) (wanted-flash basic :offset-assert 536) (distance float :offset-assert 540) diff --git a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc index 06d56e2c61..11d0623d74 100644 --- a/test/decompiler/reference/jak2/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-info_REF.gc @@ -773,24 +773,21 @@ (let ((s3-0 (new 'stack-no-clear 'vector4w))) (set! (-> s3-0 quad) (the-as uint128 0)) (when (transform-point-qword! s3-0 (the-as vector arg0)) - (let ((s5-0 - (new - 'stack - 'font-context - *font-default-matrix* - (+ (the int (/ (the float (+ (/ (the-as int (-> s3-0 x)) 16) -1792)) (-> *video-params* relative-x-scale))) - -48 - ) - (the-as int (+ (/ (the-as int (-> s3-0 y)) 16) -1855)) - 0.0 - (font-color gold-#ba9200) - (font-flags shadow kerning) - ) - ) + (let ((s5-0 (new + 'stack + 'font-context + *font-default-matrix* + (+ (the int (/ (the float (+ (/ (-> s3-0 x) 16) -1792)) (-> *video-params* relative-x-scale))) -48) + (+ (/ (-> s3-0 y) 16) -1855) + 0.0 + (font-color gold-#ba9200) + (font-flags shadow kerning) + ) + ) ) (set! (-> s5-0 scale) (lerp-scale 0.6 1.0 (the-as float arg1) 50.0 8000.0)) (let ((v1-9 s5-0)) - (set! (-> v1-9 origin z) (the float (/ (the-as int (-> s3-0 z)) 16))) + (set! (-> v1-9 origin z) (the float (/ (-> s3-0 z) 16))) ) (set! (-> s5-0 flags) (font-flags shadow kerning large)) (let ((s3-1 (-> self clock frame-counter))) diff --git a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc index 1fd3c2cf30..d188954970 100644 --- a/test/decompiler/reference/jak2/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/game-save_REF.gc @@ -1833,7 +1833,7 @@ (notify handle :offset-assert 456) (force symbol :offset-assert 464) (state-time time-frame :offset-assert 472) - (icon hud-sprite :inline :offset-assert 480) + (icon hud-sprite :inline :offset 480) ) :heap-base #x1a0 :method-count-assert 23 @@ -1948,7 +1948,7 @@ (with-dma-buffer-add-bucket ((s5-3 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (hud-sprite-method-9 (-> self icon) s5-3 (-> self level)) + (draw (-> self icon) s5-3 (-> self level)) ) ) ) @@ -1993,7 +1993,12 @@ auto-save-post ) ) (set! (-> *setting-control* user-default auto-save) #f) - (set-vector! (-> self icon color) 128 128 128 128) + (let ((v1-51 (-> self icon color2))) + (set! (-> v1-51 0) 128) + (set! (-> v1-51 1) 128) + (set! (-> v1-51 2) 128) + (set! (-> v1-51 3) 128) + ) (set! (-> self icon pos x) 440) (set! (-> self icon pos y) 200) (set! (-> self icon pos z) #xffffff) diff --git a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc index f2c42c75aa..cc061f4dec 100644 --- a/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/game/task/task-control_REF.gc @@ -1466,7 +1466,7 @@ ;; definition for method 16 of type fail-mission (defmethod print-text fail-mission ((obj fail-mission)) (when (and (not (logtest? (-> obj flags) (fail-mission-flags famflags-6))) - (= (gui-control-method-17 *gui-control* (the-as sound-id (-> obj message-id))) (gui-action playing)) + (= (get-status *gui-control* (the-as sound-id (-> obj message-id))) (gui-status active)) ) (let ((gp-0 (new 'stack @@ -1803,7 +1803,7 @@ (set! (-> self fail-message) (the-as uint (-> arg0 fail-message))) (set-setting! 'allow-continue #f 0 0) (set-setting! 'minimap 'clear 0 128) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -1813,7 +1813,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -1826,10 +1826,7 @@ (when (not (logtest? (-> arg0 flags) (fail-mission-flags famflags-4))) (if (not (and *target* (logtest? (-> *target* focus-status) (focus-status dead)) (zero? (-> self message)))) (set! (-> self stinger) - (the-as - uint - (gui-control-method-9 *gui-control* *target* (gui-channel background) (gui-action play) "lose1" -99.0 0) - ) + (the-as uint (add-process *gui-control* *target* (gui-channel background) (gui-action play) "lose1" -99.0 0)) ) ) ) @@ -1843,10 +1840,7 @@ (= (-> self message) (fail-mission-message fammsg-1)) ) (set! (-> self message-id) - (the-as - uint - (gui-control-method-9 *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0) - ) + (the-as uint (add-process *gui-control* self (gui-channel supertitle) (gui-action play) "fail" 81920.0 0)) ) ) (go-virtual idle) diff --git a/test/decompiler/reference/jak2/engine/gfx/lights_REF.gc b/test/decompiler/reference/jak2/engine/gfx/lights_REF.gc index 7e6509e524..b5c6d43da4 100644 --- a/test/decompiler/reference/jak2/engine/gfx/lights_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/lights_REF.gc @@ -126,9 +126,7 @@ (set! (-> arg0 dimension-array z) (max 1 (min 16 (the int (+ 0.5 (* f0-5 (-> s4-0 z))))))) ) ) - (set! (-> arg0 bucket-step 0) - (the-as uint (* (the-as int (-> arg0 dimension-array z)) (the-as int (-> arg0 dimension-array x)))) - ) + (set! (-> arg0 bucket-step 0) (the-as uint (* (-> arg0 dimension-array z) (-> arg0 dimension-array x)))) (set! (-> arg0 bucket-step 1) (the-as uint (-> arg0 dimension-array x))) (dotimes (v1-13 3) (set! (-> arg0 axis-scale data v1-13) @@ -137,10 +135,7 @@ ) ) (set! (-> arg0 num-buckets) - (the-as uint (* (* (the-as int (-> arg0 dimension-array x)) (the-as int (-> arg0 dimension-array y))) - (the-as int (-> arg0 dimension-array z)) - ) - ) + (the-as uint (* (* (-> arg0 dimension-array x) (-> arg0 dimension-array y)) (-> arg0 dimension-array z))) ) (dotimes (v1-19 (the-as int (-> arg0 num-buckets))) (let ((a0-27 (-> arg0 bucket-array v1-19))) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc index f7388734ab..2b5e256163 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood_REF.gc @@ -1505,15 +1505,15 @@ (let ((a0-6 (-> s4-0 iweather fog)) (v1-30 (-> s4-0 iweather cloud)) ) - (set! (-> s4-0 index 0) (+ (* 3 (the-as int v1-30)) (the-as int a0-6))) - (set! (-> s4-0 index 1) (the-as int (+ a0-6 1 (* 3 (the-as int v1-30))))) - (set! (-> s4-0 index 2) (+ (* 3 (the-as int (+ v1-30 1))) (the-as int a0-6))) - (set! (-> s4-0 index 3) (the-as int (+ a0-6 1 (* 3 (the-as int (+ v1-30 1)))))) + (set! (-> s4-0 index 0) (+ (* 3 v1-30) a0-6)) + (set! (-> s4-0 index 1) (+ a0-6 1 (* 3 v1-30))) + (set! (-> s4-0 index 2) (+ (* 3 (+ v1-30 1)) a0-6)) + (set! (-> s4-0 index 3) (+ a0-6 1 (* 3 (+ v1-30 1)))) ) (let ((v1-34 (-> s4-0 iweather cloud))) (set! (-> s4-0 color-interp) (-> s4-0 interp cloud)) - (set! (-> s4-0 color-index 0) (the-as int v1-34)) - (set! (-> s4-0 color-index 1) (the-as int (+ v1-34 1))) + (set! (-> s4-0 color-index 0) v1-34) + (set! (-> s4-0 color-index 1) (+ v1-34 1)) ) 0 (let ((f0-23 (- (-> s4-0 weather cloud) (the float (-> s4-0 iweather cloud))))) diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc index 2fd0ad9f9f..3d1c1f666e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery_REF.gc @@ -234,9 +234,8 @@ (define shrub-vu1-block (new 'static 'vu-function :length #x26a :qlength #x135)) ;; definition for function shrub-num-tris -;; WARN: Return type mismatch uint32 vs uint. (defun shrub-num-tris ((shrub shrubbery)) - (the-as uint (- (-> shrub header data 2) (the-as uint (* (-> shrub header data 1) 2)))) + (- (-> shrub header data 2) (* (-> shrub header data 1) 2)) ) ;; definition for function shrub-make-perspective-matrix @@ -389,7 +388,7 @@ ) (set! (-> a3-0 dma) (new 'static 'dma-tag :id (dma-tag-id ref) - :addr (the-as int (-> shrub obj)) + :addr (-> shrub obj) :qwc (+ (-> shrub obj-qwc) (-> shrub vtx-qwc) (-> shrub col-qwc) (-> shrub stq-qwc)) ) ) @@ -1175,7 +1174,7 @@ (while (nonzero? s2-0) (+! s2-0 -1) (let ((a0-15 (* (shrub-num-tris (the-as shrubbery s3-0)) s4-0)) - (v1-26 (* (the-as uint (-> (the-as shrubbery s3-0) header data 2)) s4-0)) + (v1-26 (* (-> (the-as shrubbery s3-0) header data 2) s4-0)) ) (+! (-> *terrain-stats* shrub tris) a0-15) (+! (-> *terrain-stats* shrub dverts) v1-26) @@ -1200,7 +1199,7 @@ (while (nonzero? s2-1) (+! s2-1 -1) (let ((a0-28 (* (shrub-num-tris (the-as shrubbery s3-1)) s4-1)) - (v1-44 (* (the-as uint (-> (the-as shrubbery s3-1) header data 2)) s4-1)) + (v1-44 (* (-> (the-as shrubbery s3-1) header data 2) s4-1)) ) (+! (-> *terrain-stats* trans-shrub tris) a0-28) (+! (-> *terrain-stats* trans-shrub dverts) v1-44) diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc index ab6daadc8f..5fbd4db2a6 100644 --- a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher_REF.gc @@ -2,7 +2,6 @@ (in-package goal) ;; definition for method 3 of type sparticle-launcher -;; INFO: this function exists in multiple non-identical object files ;; WARN: Return type mismatch int vs sparticle-launcher. (defmethod inspect sparticle-launcher ((obj sparticle-launcher)) (format #t "~X: sparticle-launcher~%" obj) @@ -2090,7 +2089,7 @@ object (-> (the-as (array int32) a1-4) (+ (mod - (the-as int (/ (-> a0-1 state-counter) (/ (the-as int (-> (the-as vector4w a1-4) w)) 8))) + (the-as int (/ (-> a0-1 state-counter) (the-as uint (/ (-> (the-as vector4w a1-4) w) 8)))) (+ (-> (the-as (pointer int32) a1-4) 0) -1) ) 1 diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc index e7b432b81d..11a05c99cb 100644 --- a/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture_REF.gc @@ -2327,8 +2327,8 @@ ) (set! (-> v1-5 mask dword 0) (ash (-> v1-5 mask dword 0) s5-0)) ) - (set! (-> gp-0 mask dword 0) (the-as uint (logior (-> gp-0 mask dword 0) (-> v1-5 mask dword 0)))) - (set! (-> gp-0 mask dword 1) (the-as uint (logior (-> gp-0 mask dword 1) (-> v1-5 mask dword 1)))) + (logior! (-> gp-0 mask dword 0) (-> v1-5 mask dword 0)) + (logior! (-> gp-0 mask dword 1) (-> v1-5 mask dword 1)) ) 0 (none) diff --git a/test/decompiler/reference/jak2/engine/level/region_REF.gc b/test/decompiler/reference/jak2/engine/level/region_REF.gc index 7c33086aa4..91878b7331 100644 --- a/test/decompiler/reference/jak2/engine/level/region_REF.gc +++ b/test/decompiler/reference/jak2/engine/level/region_REF.gc @@ -103,7 +103,7 @@ (format (clear *temp-string*) "region-~D~%" (-> obj region id)) (s5-0 s4-0 (the-as bucket-id s3-0) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) (let ((s5-1 (-> obj region on-enter))) (when s5-1 (let ((s4-1 add-debug-text-3d) @@ -113,7 +113,7 @@ (format (clear *temp-string*) "(on-enter ~S)" s5-1) (s4-1 s3-1 (the-as bucket-id s2-1) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((s5-2 (-> obj region on-inside))) @@ -125,7 +125,7 @@ (format (clear *temp-string*) "(on-inside ~S)" s5-2) (s4-2 s3-2 (the-as bucket-id s2-2) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) (let ((gp-1 (-> obj region on-exit))) @@ -137,7 +137,7 @@ (format (clear *temp-string*) "(on-exit ~S)" gp-1) (s5-3 s4-3 (the-as bucket-id s3-3) *temp-string* sv-36 (font-color #dadada) sv-32) ) - (set! (-> sv-32 y) (the-as int (+ (-> sv-32 y) 8))) + (+! (-> sv-32 y) 8) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/load/loader_REF.gc b/test/decompiler/reference/jak2/engine/load/loader_REF.gc index d118248c6f..5d3fa2023c 100644 --- a/test/decompiler/reference/jak2/engine/load/loader_REF.gc +++ b/test/decompiler/reference/jak2/engine/load/loader_REF.gc @@ -558,9 +558,7 @@ (let ((s3-0 (-> obj rec s4-0))) (when (-> s3-0 name) (dotimes (s2-0 2) - (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (the-as int (-> s3-0 parts))) - (not (-> obj buffer s2-0 frame-lock)) - ) + (when (and (file-status (-> obj buffer s2-0) (-> s3-0 name) (-> s3-0 parts)) (not (-> obj buffer s2-0 frame-lock))) (set! (-> obj buffer s2-0 frame-lock) #t) (set! (-> s3-0 anim-name) (-> obj buffer s2-0)) (set! (-> obj buffer s2-0 pending-load-file-owner) (-> s3-0 owner)) @@ -583,13 +581,7 @@ (dotimes (s2-1 2) (when (not (-> obj buffer s2-1 frame-lock)) (set! (-> obj buffer s2-1 frame-lock) #t) - (set-pending-file - (-> obj buffer s2-1) - (-> s3-1 name) - (the-as int (-> s3-1 parts)) - (-> s3-1 owner) - (-> s3-1 priority) - ) + (set-pending-file (-> obj buffer s2-1) (-> s3-1 name) (-> s3-1 parts) (-> s3-1 owner) (-> s3-1 priority)) (set! (-> s3-1 anim-name) (-> obj buffer s2-1)) (goto cfg-46) ) @@ -869,7 +861,7 @@ (set! (-> s5-0 paused?) #f) ) (let ((v1-7 - (gui-control-method-15 *gui-control* self (gui-channel art-load) (-> gp-0 anim name) (new 'static 'sound-id)) + (lookup-gui-connection *gui-control* self (gui-channel art-load) (-> gp-0 anim name) (new 'static 'sound-id)) ) ) (if v1-7 @@ -884,7 +876,7 @@ (talker-surpress!) (apply-settings *setting-control*) (when (or (and (-> *setting-control* user-current spooling) - (or (< 2 (the-as int (-> gp-0 anim parts))) + (or (< 2 (-> gp-0 anim parts)) (not (string= (-> *setting-control* user-current spool-anim name) (-> gp-0 anim name))) ) ) @@ -903,7 +895,7 @@ ) ) (while (or (and (-> *setting-control* user-current spooling) - (or (< 2 (the-as int (-> gp-0 anim parts))) + (or (< 2 (-> gp-0 anim parts)) (not (string= (-> *setting-control* user-current spool-anim name) (-> gp-0 anim name))) ) ) @@ -934,7 +926,7 @@ (set-setting! 'spool-anim (-> gp-0 anim) 0 0) (apply-settings *setting-control*) (set! (-> gp-0 old-time) (-> self clock frame-counter)) - (while (< (-> gp-0 part) (the-as int (-> gp-0 anim parts))) + (while (< (-> gp-0 part) (-> gp-0 anim parts)) (when (> (-> gp-0 part) 0) (while (let ((v1-99 (file-status *art-control* (-> gp-0 anim name) (-> gp-0 part)))) (not (or (= v1-99 'active) (= v1-99 'locked))) @@ -1100,7 +1092,7 @@ -20.0 (-> gp-0 sid) ) - (if (< (+ (-> gp-0 part) 1) (the-as int (-> gp-0 anim parts))) + (if (< (+ (-> gp-0 part) 1) (-> gp-0 anim parts)) (gui-control-method-12 *gui-control* self @@ -1167,7 +1159,7 @@ (defbehavior ja-abort-spooled-anim process-drawable ((arg0 spool-anim) (arg1 art-joint-anim) (arg2 int)) (let ((s3-0 (new 'static 'sound-id))) (let ((v1-1 - (gui-control-method-15 *gui-control* self (gui-channel art-load) (-> arg0 name) (new 'static 'sound-id)) + (lookup-gui-connection *gui-control* self (gui-channel art-load) (-> arg0 name) (new 'static 'sound-id)) ) ) (when v1-1 @@ -1425,28 +1417,28 @@ (let ((s5-0 format) (s4-0 #t) (s3-0 " ~6S <@ #x~A>") - (v1-3 (gui-control-method-17 *gui-control* (-> obj id))) + (v1-3 (get-status *gui-control* (-> obj id))) ) (s5-0 s4-0 s3-0 (cond - ((= v1-3 (gui-action play)) + ((= v1-3 (gui-status ready)) "ready" ) - ((= v1-3 (gui-action playing)) + ((= v1-3 (gui-status active)) "active" ) - ((= v1-3 (gui-action stopping)) + ((= v1-3 (gui-status stop)) "stop" ) - ((= v1-3 (gui-action none)) + ((= v1-3 (gui-status unknown)) "unknown" ) - ((= v1-3 (gui-action stop)) + ((= v1-3 (gui-status hide)) "hide" ) - ((= v1-3 (gui-action queue)) + ((= v1-3 (gui-status pending)) "pending" ) (else @@ -1466,7 +1458,7 @@ ) ;; definition for method 15 of type gui-control -(defmethod gui-control-method-15 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) +(defmethod lookup-gui-connection gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel) (arg2 string) (arg3 sound-id)) (let ((s1-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) (let ((s0-0 (-> s1-0 next0))) @@ -1501,7 +1493,7 @@ ) ;; definition for method 14 of type gui-control -(defmethod gui-control-method-14 gui-control ((obj gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) +(defmethod lookup-gui-connection-id gui-control ((obj gui-control) (arg0 string) (arg1 gui-channel) (arg2 gui-action)) (let ((s2-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) (let ((s1-0 (-> s2-0 next0))) @@ -1533,23 +1525,23 @@ ) ;; definition for method 20 of type gui-control -(defmethod gui-control-method-20 gui-control ((obj gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) +(defmethod set-falloff! gui-control ((obj gui-control) (arg0 sound-id) (arg1 symbol) (arg2 int) (arg3 int) (arg4 int)) (when (nonzero? arg0) - (let ((v1-2 (gui-control-method-15 *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) + (let ((v1-2 (lookup-gui-connection *gui-control* (the-as process #f) (gui-channel none) (the-as string #f) arg0))) (when v1-2 (if arg1 - (logior! (-> v1-2 flags) 2) + (logior! (-> v1-2 flags) (gui-connection-flags gcf1)) ) (when (>= arg2 0) - (logior! (-> v1-2 flags) 8) + (logior! (-> v1-2 flags) (gui-connection-flags fo-min)) (set! (-> v1-2 fo-min) arg2) ) (when (>= arg3 0) - (logior! (-> v1-2 flags) 16) + (logior! (-> v1-2 flags) (gui-connection-flags fo-max)) (set! (-> v1-2 fo-max) arg3) ) (when (>= arg4 0) - (logior! (-> v1-2 flags) 4) + (logior! (-> v1-2 flags) (gui-connection-flags fo-curve)) (set! (-> v1-2 fo-curve) arg4) ) v1-2 @@ -1583,21 +1575,21 @@ ) ;; definition for method 23 of type gui-control -(defmethod gui-control-method-23 gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) +(defmethod handle-command gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-channel) (arg2 symbol) (arg3 gui-connection)) (let ((s5-0 (-> obj ids arg1))) (cond ((nonzero? s5-0) (case arg2 (('wait) - (if (nonzero? (gui-control-method-17 obj s5-0)) + (if (nonzero? (get-status obj s5-0)) (return #f) ) ) (('stop 'priority-stop) (when (nonzero? (-> obj ids arg1)) - (let ((s2-0 (gui-control-method-15 obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (let ((s2-0 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and s2-0 (or (= arg2 'priority) (= s2-0 arg3) (and arg3 (< (-> arg3 priority) (-> s2-0 priority))))) - (gui-control-method-11 obj s2-0) + (stop-str obj s2-0) (cond ((= (shr (the-as int arg1) 4) 5) (set! (-> obj times arg1) @@ -1615,14 +1607,14 @@ ) ) ) - (if (nonzero? (gui-control-method-17 obj s5-0)) + (if (nonzero? (get-status obj s5-0)) (return #f) ) ) (('hide) - (let ((v1-34 (gui-control-method-15 obj (the-as process #f) arg1 (the-as string #f) s5-0))) + (let ((v1-34 (lookup-gui-connection obj (the-as process #f) arg1 (the-as string #f) s5-0))) (when (and v1-34 (!= (-> v1-34 action) 8)) - (gui-control-method-16 + (set-action! obj (gui-action hide) s5-0 @@ -1637,7 +1629,7 @@ ) ) ) - (if (nonzero? (gui-control-method-17 obj s5-0)) + (if (nonzero? (get-status obj s5-0)) (return #f) ) ) @@ -1655,7 +1647,7 @@ ;; definition for method 19 of type gui-control ;; INFO: Used lq/sq -(defmethod gui-control-method-19 gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-connection)) +(defmethod handle-command-list gui-control ((obj gui-control) (arg0 gui-channel) (arg1 gui-connection)) (local-vars (sv-16 int) (sv-32 int) (sv-48 int)) (let ((gp-0 #t)) (cond @@ -1675,7 +1667,7 @@ (let ((s0-0 80)) (set! sv-16 90) (while (>= (the-as uint sv-16) (the-as uint s0-0)) - (if (not (gui-control-method-23 obj arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 (the-as gui-channel s0-0) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-0 1) @@ -1686,7 +1678,7 @@ (let ((s0-1 66)) (set! sv-32 70) (while (>= (the-as uint sv-32) (the-as uint s0-1)) - (if (not (gui-control-method-23 obj arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 (the-as gui-channel s0-1) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-1 1) @@ -1697,7 +1689,7 @@ (let ((s0-2 18)) (set! sv-48 32) (while (>= (the-as uint sv-48) (the-as uint s0-2)) - (if (not (gui-control-method-23 obj arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 (the-as gui-channel s0-2) (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) (+! s0-2 1) @@ -1705,7 +1697,7 @@ ) ) (else - (if (not (gui-control-method-23 obj arg0 a2-1 (the-as symbol s1-0) arg1)) + (if (not (handle-command obj arg0 a2-1 (the-as symbol s1-0) arg1)) (set! gp-0 #f) ) ) @@ -1722,11 +1714,11 @@ ) ;; definition for method 17 of type gui-control -;; WARN: Return type mismatch int vs gui-action. -(defmethod gui-control-method-17 gui-control ((obj gui-control) (arg0 sound-id)) +;; WARN: Return type mismatch int vs gui-status. +(defmethod get-status gui-control ((obj gui-control) (arg0 sound-id)) (let ((gp-0 (the-as gui-connection #f))) (if (zero? arg0) - (return (gui-action none)) + (return (gui-status unknown)) ) (let ((v1-4 (-> obj engine alive-list next0))) (-> obj engine) @@ -1753,14 +1745,14 @@ ) (label cfg-15) (the-as - gui-action + gui-status (cond ((= (-> gp-0 channel) (gui-channel movie)) (cond ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) 3 ) - ((gui-control-method-19 obj (-> gp-0 channel) gp-0) + ((handle-command-list obj (-> gp-0 channel) gp-0) 2 ) (else @@ -1788,16 +1780,16 @@ ) (cond ((logtest? (-> *sound-iop-info* stream-status s4-0) (stream-status ststatus-four)) - (return (gui-action playing)) + (return (gui-status active)) ) ((logtest? (-> *sound-iop-info* stream-status s4-0) (stream-status ststatus-nine)) - (return (gui-action stopping)) + (return (gui-status stop)) ) - ((or (= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) (gui-control-method-19 obj (-> gp-0 channel) gp-0)) - (return (gui-action play)) + ((or (= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) (handle-command-list obj (-> gp-0 channel) gp-0)) + (return (gui-status ready)) ) (else - (return (gui-action queue)) + (return (gui-status pending)) ) ) (the-as none 0) @@ -1823,7 +1815,7 @@ 3 ) ) - ((gui-control-method-19 obj (-> gp-0 channel) gp-0) + ((handle-command-list obj (-> gp-0 channel) gp-0) 2 ) (else @@ -1838,7 +1830,7 @@ ((= (-> gp-0 id) (-> obj ids (-> gp-0 channel))) 3 ) - ((gui-control-method-19 obj (-> gp-0 channel) gp-0) + ((handle-command-list obj (-> gp-0 channel) gp-0) 2 ) (else @@ -1857,15 +1849,15 @@ ) ;; definition for method 16 of type gui-control -(defmethod gui-control-method-16 gui-control ((obj gui-control) - (arg0 gui-action) - (arg1 sound-id) - (arg2 gui-channel) - (arg3 gui-action) - (arg4 string) - (arg5 (function gui-connection symbol)) - (arg6 process) - ) +(defmethod set-action! gui-control ((obj gui-control) + (arg0 gui-action) + (arg1 sound-id) + (arg2 gui-channel) + (arg3 gui-action) + (arg4 string) + (arg5 (function gui-connection symbol)) + (arg6 process) + ) (local-vars (sv-16 gui-action) (sv-17 gui-action) (sv-20 string) (sv-24 (function gui-connection symbol))) (set! sv-16 arg0) (set! sv-17 arg3) @@ -1890,7 +1882,7 @@ ) (else (set! (-> s1-0 action) sv-16) - (if (and (= sv-16 'play) (gui-control-method-19 obj (-> s1-0 channel) s1-0)) + (if (and (= sv-16 'play) (handle-command-list obj (-> s1-0 channel) s1-0)) (channel-id-set! obj s1-0 (-> s1-0 id)) ) ) @@ -1908,14 +1900,14 @@ ;; definition for method 9 of type gui-control ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs sound-id. -(defmethod gui-control-method-9 gui-control ((obj gui-control) - (arg0 process) - (arg1 gui-channel) - (arg2 gui-action) - (arg3 string) - (arg4 float) - (arg5 time-frame) - ) +(defmethod add-process gui-control ((obj gui-control) + (arg0 process) + (arg1 gui-channel) + (arg2 gui-action) + (arg3 string) + (arg4 float) + (arg5 time-frame) + ) (local-vars (sv-16 int) (sv-20 gui-connection) @@ -1968,7 +1960,7 @@ (set! (-> sv-32 action) arg2) (set! (-> sv-32 param2) (the-as int arg3)) (set! (-> sv-32 hold-time) arg5) - (set! (-> sv-32 flags) (the-as uint 1)) + (set! (-> sv-32 flags) (gui-connection-flags gcf0)) (set! (-> sv-32 fade) (the-as uint 0)) (the-as int (-> (the-as gui-connection sv-32) id)) ) @@ -1982,7 +1974,7 @@ ;; definition for method 10 of type gui-control ;; WARN: Return type mismatch int vs none. -(defmethod gui-control-method-10 gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) +(defmethod remove-process gui-control ((obj gui-control) (arg0 process) (arg1 gui-channel)) (let ((s3-0 (the-as gui-connection (-> obj engine alive-list next0)))) (-> obj engine) (let ((s2-0 (-> s3-0 next0))) @@ -2048,7 +2040,7 @@ (when (or (zero? (-> a0-15 id)) (not (handle->process (-> a0-15 handle)))) (set! sv-16 a0-15) (set! (-> sv-16 param3) 0) - (set! (-> sv-16 flags) (the-as uint 0)) + (set! (-> sv-16 flags) (gui-connection-flags)) (goto cfg-44) ) ) @@ -2058,7 +2050,7 @@ (sv-16 (when (zero? (-> (the-as gui-connection sv-16) id)) (when (zero? sv-20) - (let ((v1-46 (gui-control-method-15 obj arg0 arg1 arg3 (new 'static 'sound-id)))) + (let ((v1-46 (lookup-gui-connection obj arg0 arg1 arg3 (new 'static 'sound-id)))) (if v1-46 (set! sv-20 (the-as int (-> v1-46 id))) ) @@ -2176,10 +2168,10 @@ ) ;; definition for method 11 of type gui-control -(defmethod gui-control-method-11 gui-control ((obj gui-control) (arg0 gui-connection)) +(defmethod stop-str gui-control ((obj gui-control) (arg0 gui-connection)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) - (if (= (gui-control-method-17 obj (-> arg0 id)) (gui-action playing)) + (if (= (get-status obj (-> arg0 id)) (gui-status active)) (str-play-stop (-> arg0 name) (-> arg0 id)) ) ) @@ -2201,7 +2193,9 @@ (case (-> arg0 action) (((gui-action queue)) (spool-push *art-control* (-> arg0 name) (the-as int (-> arg0 anim-part)) arg1 (-> arg0 priority)) - (if (and (logtest? (-> arg0 flags) 1) (= (gui-control-method-17 obj (-> arg0 id)) (gui-action playing))) + (if (and (logtest? (-> arg0 flags) (gui-connection-flags gcf0)) + (= (get-status obj (-> arg0 id)) (gui-status active)) + ) (set! (-> arg0 action) (gui-action playing)) ) ) @@ -2209,13 +2203,11 @@ ) (let ((v1-16 (-> arg0 action))) (b! (!= v1-16 (gui-action play)) cfg-39 :delay (empty-form)) - (if (gui-control-method-19 obj (-> arg0 channel) arg0) + (if (handle-command-list obj (-> arg0 channel) arg0) (channel-id-set! obj arg0 (-> arg0 id)) ) (b! - (not (or (not (gui-control-method-18 obj (-> arg0 channel))) - (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping)) - ) + (not (or (not (gui-control-method-18 obj (-> arg0 channel))) (= (get-status obj (-> arg0 id)) (gui-status stop))) ) cfg-27 :delay (empty-form) @@ -2224,7 +2216,7 @@ (channel-id-set! obj arg0 (new 'static 'sound-id)) ) (if (and arg2 (or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping)) + (= (get-status obj (-> arg0 id)) (gui-status stop)) ) ) (move-to-dead arg0) @@ -2234,8 +2226,8 @@ (let ((v1-40 (-> arg0 id))) (b! (!= (-> obj ids (-> arg0 channel)) v1-40) cfg-38 :delay (empty-form)) ) - (let ((v1-43 (gui-control-method-17 obj (-> arg0 id)))) - (b! (!= v1-43 (gui-action play)) cfg-36 :delay (empty-form)) + (let ((v1-43 (get-status obj (-> arg0 id)))) + (b! (!= v1-43 (gui-status ready)) cfg-36 :delay (empty-form)) (case (shr (the-as int (-> arg0 channel)) 4) ((1 2) (if (not (paused?)) @@ -2245,7 +2237,7 @@ ) (b! #t cfg-38 :delay (nop!)) (label cfg-36) - (b! (!= v1-43 (gui-action playing)) cfg-38 :delay (empty-form)) + (b! (!= v1-43 (gui-status active)) cfg-38 :delay (empty-form)) ) (set! (-> arg0 action) (gui-action playing)) (label cfg-38) @@ -2253,7 +2245,7 @@ (label cfg-39) (b! (not (or (= v1-16 (gui-action playing)) (= v1-16 (gui-action fade)))) cfg-117 :delay (empty-form)) (b! - (not (and (= (gui-control-method-17 obj (-> arg0 id)) (gui-action playing)) + (not (and (= (get-status obj (-> arg0 id)) (gui-status active)) (gui-control-method-18 obj (-> arg0 channel)) (or (= (-> arg0 action) (gui-action playing)) (< (-> arg0 fade) (the-as uint 30))) ) @@ -2288,7 +2280,9 @@ (label cfg-73) (cond ((not v1-66) - (when (and (logtest? (-> arg0 flags) 30) (logtest? (-> arg0 flags) 1)) + (when (and (logtest? (-> arg0 flags) (gui-connection-flags gcf1 fo-curve fo-min fo-max)) + (logtest? (-> arg0 flags) (gui-connection-flags gcf0)) + ) (let* ((s5-1 (get-process arg0)) (s4-1 (if (type? s5-1 process-drawable) s5-1 @@ -2315,16 +2309,16 @@ (set! (-> s5-2 params fo-min) (-> arg0 fo-min)) (set! (-> s5-2 params fo-max) (-> arg0 fo-max)) (set! (-> s5-2 params mask) (the-as uint 0)) - (if (logtest? (-> arg0 flags) 2) + (if (logtest? (-> arg0 flags) (gui-connection-flags gcf1)) (logior! (-> s5-2 params mask) 32) ) - (if (logtest? (-> arg0 flags) 4) + (if (logtest? (-> arg0 flags) (gui-connection-flags fo-curve)) (logior! (-> s5-2 params mask) 256) ) - (if (logtest? (-> arg0 flags) 8) + (if (logtest? (-> arg0 flags) (gui-connection-flags fo-min)) (logior! (-> s5-2 params mask) 64) ) - (if (logtest? (-> arg0 flags) 16) + (if (logtest? (-> arg0 flags) (gui-connection-flags fo-max)) (logior! (-> s5-2 params mask) 128) ) ) @@ -2355,7 +2349,7 @@ (let ((a0-75 (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)))) (b! a0-75 cfg-113 :likely-delay (set! v1-143 a0-75)) ) - (set! v1-143 (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping))) + (set! v1-143 (= (get-status obj (-> arg0 id)) (gui-status stop))) (label cfg-113) (if v1-143 (move-to-dead arg0) @@ -2366,7 +2360,7 @@ (b! #t cfg-139 :delay (nop!)) (label cfg-117) (b! (!= v1-16 (gui-action stop)) cfg-121 :delay (empty-form)) - (gui-control-method-11 obj arg0) + (stop-str obj arg0) (if arg2 (move-to-dead arg0) ) @@ -2386,9 +2380,9 @@ ((= v1-16 (gui-action hidden)) (cond ((or (< (shr (the-as int (-> arg0 channel)) 4) (the-as uint 4)) - (= (gui-control-method-17 obj (-> arg0 id)) (gui-action stopping)) + (= (get-status obj (-> arg0 id)) (gui-status stop)) ) - (gui-control-method-11 obj arg0) + (stop-str obj arg0) (if arg2 (move-to-dead arg0) ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc index 12cb5b6fc8..5750cfbc5d 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control_REF.gc @@ -1282,38 +1282,6 @@ ;; WARN: Stack slot offset 168 signed mismatch ;; WARN: Stack slot offset 164 signed mismatch ;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 180 signed mismatch -;; WARN: Stack slot offset 184 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 164 signed mismatch -;; WARN: Stack slot offset 168 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch -;; WARN: Stack slot offset 200 signed mismatch -;; WARN: Stack slot offset 204 signed mismatch ;; WARN: Stack slot offset 164 signed mismatch ;; WARN: Stack slot offset 168 signed mismatch ;; WARN: Stack slot offset 164 signed mismatch @@ -1380,7 +1348,7 @@ (sv-136 int) (sv-144 nav-mesh-work) (sv-148 nav-poly) - (sv-152 uint8) + (sv-152 uint) (sv-156 (pointer int8)) (sv-160 (pointer int8)) (sv-164 float) @@ -1594,7 +1562,7 @@ (defmethod find-adjacent-bounds-one nav-mesh ((obj nav-mesh) (arg0 vector) (arg1 nav-poly) (arg2 int) (arg3 int)) (local-vars (sv-16 nav-poly)) (if (zero? arg3) - (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> arg1 vertex-count))))) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> arg1 vertex-count)))) ) (set! sv-16 arg1) (let ((s2-0 (-> sv-16 vertex arg2)) @@ -1604,18 +1572,13 @@ (while (begin (label cfg-21) (nonzero? s1-0)) (+! s1-0 -1) (if (nonzero? arg3) - (set! arg2 - (the-as - int - (mod (the-as uint (+ (+ arg2 arg3) (the-as int (-> s3-0 vertex-count)))) (the-as uint (-> s3-0 vertex-count))) - ) - ) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 arg3 (-> s3-0 vertex-count))) (-> s3-0 vertex-count)))) ) (let ((v1-12 (-> s3-0 adj-poly arg2))) (cond ((= v1-12 255) (if (zero? arg3) - (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (the-as uint (-> s3-0 vertex-count))))) + (set! arg2 (the-as int (mod (the-as uint (+ arg2 1)) (-> s3-0 vertex-count)))) ) (vector+! arg0 (-> s3-0 vertex arg2) (-> obj bounds)) (return #f) @@ -1748,18 +1711,6 @@ ;; WARN: Stack slot offset 160 signed mismatch ;; WARN: Stack slot offset 156 signed mismatch ;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch ;; WARN: Stack slot offset 192 signed mismatch ;; WARN: Stack slot offset 196 signed mismatch ;; WARN: Stack slot offset 192 signed mismatch @@ -1836,18 +1787,6 @@ ;; WARN: Stack slot offset 176 signed mismatch ;; WARN: Stack slot offset 156 signed mismatch ;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 172 signed mismatch -;; WARN: Stack slot offset 176 signed mismatch -;; WARN: Stack slot offset 156 signed mismatch -;; WARN: Stack slot offset 160 signed mismatch ;; WARN: Return type mismatch int vs none. (defmethod clamp-vector-to-mesh-cross-gaps nav-mesh ((obj nav-mesh) (arg0 vector) @@ -1868,7 +1807,7 @@ (sv-128 int) (sv-136 nav-mesh-work) (sv-140 nav-poly) - (sv-144 uint8) + (sv-144 uint) (sv-148 (pointer int8)) (sv-152 (pointer int8)) (sv-156 float) @@ -2913,37 +2852,13 @@ ;; WARN: Stack slot offset 144 signed mismatch ;; WARN: Stack slot offset 124 signed mismatch ;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 140 signed mismatch -;; WARN: Stack slot offset 144 signed mismatch -;; WARN: Stack slot offset 124 signed mismatch -;; WARN: Stack slot offset 128 signed mismatch ;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-use-existing-avoid-spheres nav-state ((obj nav-state) (arg0 nav-avoid-spheres-params)) (local-vars (sv-96 int) (sv-104 nav-mesh-work) (sv-108 nav-poly) - (sv-112 uint8) + (sv-112 uint) (sv-116 (pointer int8)) (sv-120 (pointer int8)) (sv-124 float) @@ -3171,37 +3086,13 @@ ;; WARN: Stack slot offset 240 signed mismatch ;; WARN: Stack slot offset 220 signed mismatch ;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch ;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-recompute-avoid-spheres-1 nav-state ((obj nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) (sv-204 nav-poly) - (sv-208 uint8) + (sv-208 uint) (sv-212 (pointer int8)) (sv-216 (pointer int8)) (sv-220 float) @@ -3531,8 +3422,8 @@ (defmethod plan-over-pat1-polys-using-route nav-state ((obj nav-state) (arg0 nav-gap-info)) (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (let ((a1-1 (-> obj next-poly))) - (when (logtest? (the-as int (-> a1-1 pat)) 1) - (while (and a1-1 (logtest? (the-as int (-> a1-1 pat)) 1)) + (when (logtest? (-> a1-1 pat) 1) + (while (and a1-1 (logtest? (-> a1-1 pat) 1)) (set! a1-1 (lookup-poly-on-route-to-target (-> obj mesh) a1-1 (-> obj target-poly))) ) (when (and a1-1 (!= a1-1 (-> obj current-poly))) @@ -3944,37 +3835,13 @@ ;; WARN: Stack slot offset 240 signed mismatch ;; WARN: Stack slot offset 220 signed mismatch ;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 236 signed mismatch -;; WARN: Stack slot offset 240 signed mismatch -;; WARN: Stack slot offset 220 signed mismatch -;; WARN: Stack slot offset 224 signed mismatch ;; WARN: Return type mismatch int vs none. (defmethod navigate-using-best-dir-recompute-avoid-spheres-2 nav-state ((obj nav-state)) (local-vars (sv-192 int) (sv-200 nav-mesh-work) (sv-204 nav-poly) - (sv-208 uint8) + (sv-208 uint) (sv-212 (pointer int8)) (sv-216 (pointer int8)) (sv-220 float) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc index 4485c57798..0fc61dd5ae 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-enemy_REF.gc @@ -298,7 +298,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod nav-enemy-method-177 nav-enemy ((obj nav-enemy)) (let ((v1-2 (-> obj nav state current-poly))) - (when (and v1-2 (logtest? (the-as int (-> v1-2 pat)) 4) (!= (-> v1-2 link) 255)) + (when (and v1-2 (logtest? (-> v1-2 pat) 4) (!= (-> v1-2 link) 255)) (let ((v1-6 (-> obj nav state mesh link-array (-> v1-2 link) dest-mesh))) (if v1-6 (change-to v1-6 obj) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc index 924838f26d..48f3655306 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -784,7 +784,7 @@ (next-poly-idx int) (work nav-mesh-work) (current-poly nav-poly) - (current-poly-vtx-count uint8) + (current-poly-vtx-count uint) (v0-table (pointer int8)) (v1-table (pointer int8)) (delta-x float) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc index 39f9a352cd..1543f6aba9 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh_REF.gc @@ -545,7 +545,7 @@ (defmethod debug-draw-poly nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 rgba)) (let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 3))) (set! (-> gp-0 0 quad) (-> obj bounds quad)) - (if (logtest? (the-as int (-> arg0 pat)) 7) + (if (logtest? (-> arg0 pat) 7) (set! (-> gp-0 0 y) (+ 409.6 (-> gp-0 0 y))) ) (let ((v1-7 (the-as int (+ (-> arg0 vertex-count) -1)))) @@ -562,7 +562,7 @@ (set! v1-7 s2-0) ) ) - (when (and (logtest? (the-as int (-> arg0 pat)) 4) (< (the-as uint (-> arg0 link)) (-> obj link-count))) + (when (and (logtest? (-> arg0 pat) 4) (< (-> arg0 link) (-> obj link-count))) (poly-centroid obj arg0 (-> gp-0 1)) (let ((s5-1 (-> obj link-array (-> arg0 link)))) (add-debug-x #t (bucket-id debug-no-zbuf1) (-> gp-0 1) *color-magenta*) @@ -1573,13 +1573,13 @@ (dotimes (s5-1 (the-as int (-> obj poly-count))) (let ((s4-1 (-> obj poly-array s5-1))) (debug-draw-poly obj s4-1 (cond - ((logtest? (the-as int (-> s4-1 pat)) 1) + ((logtest? (-> s4-1 pat) 1) *color-black* ) - ((logtest? (the-as int (-> s4-1 pat)) 2) + ((logtest? (-> s4-1 pat) 2) *color-gray* ) - ((logtest? (the-as int (-> s4-1 pat)) 4) + ((logtest? (-> s4-1 pat) 4) (if (-> obj link-array (-> s4-1 link) dest-mesh) *color-green* *color-light-red* @@ -2163,7 +2163,7 @@ ((and arg0 arg1 (!= arg0 arg1)) (let* ((a1-1 obj) (v1-1 (-> arg0 id)) - (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a1-1 poly-count))) 2)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a1-1 poly-count))) 2)) (s3-0 (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 @@ -2183,7 +2183,7 @@ (let ((a0-7 s3-0) (v1-16 (the-as int (+ s3-0 1))) ) - (if (>= (the-as uint v1-16) (the-as uint (-> arg0 vertex-count))) + (if (>= (the-as uint v1-16) (-> arg0 vertex-count)) (set! v1-16 0) ) (set! (-> arg2 vertex 1 quad) (-> arg0 vertex a0-7 quad)) @@ -2206,7 +2206,7 @@ ((and arg0 arg1 (!= arg0 arg1)) (let* ((a3-0 obj) (v1-1 (-> arg0 id)) - (v1-4 (* (+ (-> arg1 id) (* (the-as uint v1-1) (-> a3-0 poly-count))) 2)) + (v1-4 (* (+ (-> arg1 id) (* v1-1 (-> a3-0 poly-count))) 2)) (v1-9 (logand (ash (-> (the-as (pointer uint8) (&+ (-> obj route) (shr v1-4 3)))) (- (the-as int (logand v1-4 7)))) 3 @@ -2296,7 +2296,7 @@ (set! sv-64 (the-as symbol #f)) (countdown (s5-0 sv-36) (let ((v1-3 (-> obj poly-array s5-0))) - (if (logtest? (the-as int (-> v1-3 pat)) 1) + (if (logtest? (-> v1-3 pat) 1) (set! sv-56 (+ sv-56 1)) ) (set! sv-68 (-> v1-3 vertex)) @@ -2420,7 +2420,7 @@ (s1-0 vector) (sv-16 int) (sv-24 nav-mesh-work) - (sv-28 uint8) + (sv-28 uint) (sv-32 (pointer int8)) (sv-36 (pointer int8)) (sv-40 vector) diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc index a811a56804..33492b7d58 100644 --- a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable_REF.gc @@ -196,7 +196,7 @@ ;; definition for method 10 of type draw-control ;; WARN: Return type mismatch int vs none. (defmethod lod-set! draw-control ((obj draw-control) (arg0 int)) - (let ((v1-1 (max 0 (min arg0 (the-as int (-> obj lod-set max-lod)))))) + (let ((v1-1 (max 0 (min arg0 (-> obj lod-set max-lod))))) (set! (-> obj desired-lod) v1-1) (when (!= (-> obj cur-lod) v1-1) (set! (-> obj mgeo) (-> obj lod-set lod v1-1 geo)) @@ -214,7 +214,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod lods-assign! draw-control ((obj draw-control) (arg0 lod-set)) (mem-copy! (the-as pointer (-> obj lod-set)) (the-as pointer arg0) 49) - (let ((a1-2 (min (-> obj cur-lod) (the-as int (-> obj lod-set max-lod))))) + (let ((a1-2 (min (-> obj cur-lod) (-> obj lod-set max-lod)))) (set! (-> obj cur-lod) -1) (lod-set! obj a1-2) ) @@ -258,8 +258,8 @@ (let ((v1-0 (-> arg1 length)) (s3-0 (-> arg0 max-lod)) ) - (set! (-> obj max-lod) (the-as int s3-0)) - (dotimes (a0-1 (the-as int (+ s3-0 1))) + (set! (-> obj max-lod) s3-0) + (dotimes (a0-1 (+ s3-0 1)) (when (or (< (-> arg0 mgeo a0-1) 0) (>= (-> arg0 mgeo a0-1) v1-0)) (set! obj (the-as lod-set #f)) (goto cfg-22) @@ -511,7 +511,7 @@ (let ((a2-3 *temp-string*)) (add-debug-text-3d #t (bucket-id debug-no-zbuf1) a2-3 s3-0 (font-color blue-#003cf1) s5-0) ) - (set! (-> s5-0 x) (the-as int (+ (-> s5-0 x) 10))) + (+! (-> s5-0 x) 10) ) ) (none) @@ -661,11 +661,7 @@ ) (set! sv-16 (-> s1-0 data (-> arg1 jgeo))) (set! sv-20 (-> s1-0 length)) - (when (or (< (the-as int (-> arg1 jgeo)) 0) - (>= (the-as int (-> arg1 jgeo)) sv-20) - (not sv-16) - (!= (-> sv-16 type) art-joint-geo) - ) + (when (or (< (-> arg1 jgeo) 0) (>= (-> arg1 jgeo) sv-20) (not sv-16) (!= (-> sv-16 type) art-joint-geo)) (go process-drawable-art-error "joint-geo") (set! s2-0 (the-as draw-control #f)) (goto cfg-50) @@ -764,8 +760,8 @@ (let ((s4-0 v0-3)) (let ((s3-1 (-> s3-0 art-group))) (cond - ((>= (the-as int (-> arg0 janim)) 0) - (when (or (>= (the-as int (-> arg0 janim)) (-> s3-1 length)) + ((>= (-> arg0 janim) 0) + (when (or (>= (-> arg0 janim) (-> s3-1 length)) (begin (set! v1-14 (-> s3-1 data (-> arg0 janim))) (not v1-14)) (!= (-> v1-14 type) art-joint-anim) ) diff --git a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc index 8dede04d2e..53b8489200 100644 --- a/test/decompiler/reference/jak2/engine/scene/scene_REF.gc +++ b/test/decompiler/reference/jak2/engine/scene/scene_REF.gc @@ -158,7 +158,7 @@ (defmethod scene-method-15 scene ((obj scene) (arg0 spool-anim)) (set! (-> arg0 name) (-> obj anim)) (set! (-> arg0 anim-name) (-> obj anim)) - (set! (-> arg0 parts) (the-as int (-> obj parts))) + (set! (-> arg0 parts) (-> obj parts)) (set! (-> arg0 command-list) (-> obj command-list)) (none) ) @@ -1157,7 +1157,7 @@ (!= (-> *setting-control* user-current movie) (process->ppointer self)) ) *progress-process* - (!= (gui-control-method-17 *gui-control* (the-as sound-id (-> self gui-id))) 3) + (!= (get-status *gui-control* (the-as sound-id (-> self gui-id))) 3) ) ) (suspend) @@ -1225,16 +1225,16 @@ (nonzero? (-> self anim anim-name)) (let ((v1-161 (file-status *art-control* (-> self anim name) 0))) (or (not (or (= v1-161 'active) (= v1-161 'locked))) - (let* ((a1-26 (gui-control-method-14 + (let* ((a1-26 (lookup-gui-connection-id *gui-control* (the-as string (-> self anim anim-name)) (gui-channel none) (gui-action none) ) ) - (v1-167 (gui-control-method-17 *gui-control* (the-as sound-id a1-26))) + (v1-167 (get-status *gui-control* (the-as sound-id a1-26))) ) - (not (or (= v1-167 (gui-action play)) (= v1-167 (gui-action playing)))) + (not (or (= v1-167 (gui-status ready)) (= v1-167 (gui-status active)))) ) ) ) @@ -1652,7 +1652,7 @@ (process-drawable-draw-subtitles) (when (and (= *cheat-mode* 'debug) (-> self scene)) (let ((gp-7 - (gui-control-method-15 *gui-control* self (gui-channel art-load) (-> self scene name) (new 'static 'sound-id)) + (lookup-gui-connection *gui-control* self (gui-channel art-load) (-> self scene name) (new 'static 'sound-id)) ) ) (when (!= *external-cam-mode* 'pad-0) @@ -1835,7 +1835,7 @@ (set! (-> self scene) #f) ) ) - (set! (-> self gui-id) (the-as uint (gui-control-method-9 + (set! (-> self gui-id) (the-as uint (add-process *gui-control* self (gui-channel movie) diff --git a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc index f61699f9e9..cef20256e1 100644 --- a/test/decompiler/reference/jak2/engine/sound/speech_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/speech_REF.gc @@ -91,9 +91,7 @@ (the-as uint (rand-vu-int-range (the-as int (-> s5-1 min-delay)) (the-as int (-> s5-1 max-delay)))) ) (set! (-> s5-1 delay) (-> obj delay)) - (set! (-> obj id) - (gui-control-method-9 *gui-control* s4-0 (-> obj gui-channel) (gui-action play) s3-1 -99.0 0) - ) + (set! (-> obj id) (add-process *gui-control* s4-0 (-> obj gui-channel) (gui-action play) s3-1 -99.0 0)) ) (speech-channel-method-12 obj) (logior! (-> obj flags) (speech-channel-flag disable)) @@ -138,7 +136,7 @@ ) ) (else - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj id) @@ -153,10 +151,10 @@ ) ) ) - (case (gui-control-method-17 *gui-control* (-> obj id)) - (((gui-action queue)) + (case (get-status *gui-control* (-> obj id)) + (((gui-status pending)) (when (>= (- (-> pp clock frame-counter) (-> obj start-time)) (seconds 1)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj id) @@ -170,7 +168,7 @@ (set! (-> obj end-time) (-> obj update-time)) ) ) - (((gui-action none)) + (((gui-status unknown)) (set! (-> obj id) (new 'static 'sound-id)) (set! (-> obj last-request handle) (the-as handle #f)) (set! (-> obj end-time) (-> obj update-time)) @@ -212,7 +210,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod speech-channel-method-10 speech-channel ((obj speech-channel) (arg0 handle)) (when (= arg0 (handle->process (-> obj last-request handle))) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj id) @@ -318,7 +316,7 @@ ;; definition for method 16 of type speech-control ;; WARN: Return type mismatch int vs none. (defmethod speech-control-method-16 speech-control ((obj speech-control)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -328,7 +326,7 @@ (the-as (function gui-connection symbol) #f) (the-as process #f) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) diff --git a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc index 8118ae0d76..334c1e116f 100644 --- a/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial-hash/collide-hash_REF.gc @@ -648,12 +648,12 @@ (set! (-> arg0 data 55 name) (symbol->string 'prototype-fragment)) (+! (-> arg0 data 55 count) 1) (set! (-> arg0 data 56 name) (symbol->string 'prototype-poly)) - (+! (-> arg0 data 56 count) (the-as int (-> obj stats num-polys))) + (+! (-> arg0 data 56 count) (-> obj stats num-polys)) (set! (-> arg0 data 57 name) (symbol->string 'prototype-vertex)) - (+! (-> arg0 data 57 count) (the-as int (-> obj stats num-verts))) + (+! (-> arg0 data 57 count) (-> obj stats num-verts)) (let ((a3-0 (+ (-> obj num-indices) 112 (* (-> obj num-buckets) 4))) (a2-9 (* (-> obj stats num-polys) 4)) - (v1-22 (* (the-as uint 6) (the-as uint (-> obj stats num-verts)))) + (v1-22 (* (the-as uint 6) (-> obj stats num-verts))) ) (+! (-> arg0 data 55 used) a3-0) (+! (-> arg0 data 55 total) (- (logand -16 (+ v1-22 15 a2-9 a3-0)) (the-as int (+ a2-9 v1-22)))) @@ -668,12 +668,12 @@ (set! (-> arg0 data 51 name) (symbol->string 'collision-fragment)) (+! (-> arg0 data 51 count) 1) (set! (-> arg0 data 52 name) (symbol->string 'collision-poly)) - (+! (-> arg0 data 52 count) (the-as int (-> obj stats num-polys))) + (+! (-> arg0 data 52 count) (-> obj stats num-polys)) (set! (-> arg0 data 53 name) (symbol->string 'collision-vertex)) - (+! (-> arg0 data 53 count) (the-as int (-> obj stats num-verts))) + (+! (-> arg0 data 53 count) (-> obj stats num-verts)) (let ((a3-8 (+ (-> obj num-indices) 112 (* (-> obj num-buckets) 4))) (a2-22 (* (-> obj stats num-polys) 4)) - (v1-45 (* (the-as uint 6) (the-as uint (-> obj stats num-verts)))) + (v1-45 (* (the-as uint 6) (-> obj stats num-verts))) ) (+! (-> arg0 data 51 used) a3-8) (+! (-> arg0 data 51 total) (- (logand -16 (+ v1-45 15 a2-22 a3-8)) (the-as int (+ a2-22 v1-45)))) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc index a40e9c145f..7929327c13 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-dark-shot_REF.gc @@ -177,12 +177,9 @@ (set! (-> obj fire-sound) (the-as uint (new-sound-id))) (set! (-> obj trail-sound) (the-as uint (new-sound-id))) (set! (-> obj explode-sound) - (the-as - uint - (gui-control-method-9 *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0) - ) + (the-as uint (add-process *gui-control* obj (gui-channel background) (gui-action queue) "pmkrxplo" -99.0 0)) ) - (gui-control-method-20 *gui-control* (the-as sound-id (-> obj explode-sound)) #t 50 150 11) + (set-falloff! *gui-control* (the-as sound-id (-> obj explode-sound)) #t 50 150 11) (set! (-> obj start-pilot?) (the-as basic (and *target* (logtest? (focus-status pilot) (-> *target* focus-status)))) ) diff --git a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc index 104c2b006c..74fc8ba8f9 100644 --- a/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/gun/gun-h_REF.gc @@ -523,7 +523,7 @@ ) ;; definition for method 12 of type fact-info-target -(defmethod get-gun-ammo fact-info-target ((obj fact-info-target) (arg0 target)) +(defmethod get-gun-ammo fact-info-target ((obj fact-info-target)) (let ((current-gun (gun->ammo (-> (the-as target (-> obj process)) gun gun-type)))) (if (zero? current-gun) 0.0 diff --git a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc index 91ca5483e0..96740afee0 100644 --- a/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-darkjak_REF.gc @@ -955,7 +955,7 @@ (-> self skel effect) 'punch -1.0 - (the-as int (-> self control impact-ctrl joint)) + (-> self control impact-ctrl joint) (the-as basic #f) (the-as sound-name t1-3) ) @@ -1097,12 +1097,12 @@ (set! (-> self darkjak clock-vel) 0.0) (set! (-> self darkjak clock-on) #f) (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* self (gui-channel jak) (gui-action queue) "darkbom0" -99.0 0) + (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom0" -99.0 0) ) (none) ) :exit (behavior () - (gui-control-method-16 + (set-action! *gui-control* (gui-action fade) (-> self control unknown-sound-id00) @@ -1237,7 +1237,7 @@ (suspend) (ja :num! (seek! (ja-aframe 35.0 0))) ) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self control unknown-sound-id00) @@ -1633,7 +1633,7 @@ (set-setting! 'music-volume 'rel 0 0) (set-setting! 'ambient-volume 'rel 0 0) (compute-alignment! (-> self align)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self control unknown-sound-id00) diff --git a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc index 4d98f45a2d..416c32a89e 100644 --- a/test/decompiler/reference/jak2/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-death_REF.gc @@ -590,10 +590,10 @@ ) ) (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* *target* (gui-channel daxter) (gui-action play) t0-1 -99.0 0) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) t0-1 -99.0 0) ) ) - (gui-control-method-20 *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) ) (else (case (-> arg0 angle) @@ -1917,9 +1917,9 @@ (local-vars (v1-24 symbol)) (sound-play "death-fall") (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) + (add-process *gui-control* *target* (gui-channel daxter) (gui-action play) "jakfall" -99.0 0) ) - (gui-control-method-20 *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) + (set-falloff! *gui-control* (-> self control unknown-sound-id00) #t -1 100 2) (set-setting! 'mode-name 'cam-endlessfall 0 0) (logclear! (-> self water flags) (water-flags swim-ground)) (let ((f0-1 (fmin -4096.0 (- (-> self control ground-impact-vel))))) @@ -2178,7 +2178,3 @@ ) :post target-no-stick-post ) - - - - diff --git a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc index 352147e455..c938206961 100644 --- a/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target-gun_REF.gc @@ -1368,8 +1368,8 @@ (let ((s3-1 (new 'stack-no-clear 'vector4w))) (cond ((and (logtest? (process-mask enemy guard) (-> s5-2 mask)) (transform-point-qword! s3-1 s4-5)) - (let ((v1-173 (the-as int (+ (/ (the-as int (-> s3-1 x)) 16) -2048)))) - (+ (/ (the-as int (-> s3-1 y)) 16) -2048) + (let ((v1-173 (+ (/ (-> s3-1 x) 16) -2048))) + (+ (/ (-> s3-1 y) 16) -2048) (let ((a0-91 (abs v1-173))) (cond ((< a0-91 65) diff --git a/test/decompiler/reference/jak2/engine/target/target_REF.gc b/test/decompiler/reference/jak2/engine/target/target_REF.gc index f27a405960..93a073b49a 100644 --- a/test/decompiler/reference/jak2/engine/target/target_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/target_REF.gc @@ -2404,7 +2404,7 @@ (logtest? (-> v1-14 root-prim prim-core action) (collide-action no-smack)) ) ) - (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + (+! (-> self control unknown-word04) 1) ) ) ) @@ -2768,7 +2768,7 @@ (-> self skel effect) 'punch -1.0 - (the-as int (-> self control impact-ctrl joint)) + (-> self control impact-ctrl joint) (the-as basic #f) (the-as sound-name t1-6) ) @@ -3104,7 +3104,7 @@ ) :exit (behavior () (if (not (and (-> self next-state) (= (-> self next-state name) 'target-darkjak-bomb1))) - (gui-control-method-16 + (set-action! *gui-control* (gui-action play) (-> self control unknown-sound-id00) @@ -3177,7 +3177,7 @@ (logtest? (-> self darkjak stage) 8) ) (set! (-> self control unknown-sound-id00) - (gui-control-method-9 *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) + (add-process *gui-control* self (gui-channel jak) (gui-action queue) "darkbom1" -99.0 0) ) (ja-no-eval :group! (-> self draw art-group data 391) :num! (seek! (ja-aframe 7.0 0)) @@ -3496,7 +3496,7 @@ (and (logtest? (-> self control status) (collide-status touch-wall)) (< 0.7 (-> self control poly-angle))) ) (not (logtest? (-> self control status) (collide-status touch-actor))) - (>= (the-as uint (-> self control unknown-word04)) (the-as uint 2)) + (>= (-> self control unknown-word04) (the-as uint 2)) ) (set! (-> self control last-time-of-stuck) (-> self clock frame-counter)) (set! gp-1 'stuck) @@ -3635,7 +3635,7 @@ ) (suspend) (until #f - (set! (-> self control unknown-word04) (the-as uint (+ (-> self control unknown-word04) 1))) + (+! (-> self control unknown-word04) 1) (ja :num! (seek!)) (let ((gp-1 (-> self skel root-channel 1))) (let ((f0-28 (lerp-scale 0.0 1.0 (-> self control ctrl-xz-vel) 0.0 40960.0))) diff --git a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc index 774d99f9db..59970ece80 100644 --- a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc @@ -3,21 +3,21 @@ ;; definition of type gui-connection (deftype gui-connection (connection) - ((priority float :offset 16) - (action gui-action :offset 20) - (channel gui-channel :offset 21) - (anim-part uint8 :offset 22) - (flags uint8 :offset 23) - (name string :offset 24) - (id sound-id :offset 28) - (handle handle :offset 0) - (time-stamp time-frame :offset 8) - (hold-time time-frame :offset-assert 32) - (fo-min int16 :offset-assert 40) - (fo-max int16 :offset-assert 42) - (fo-curve int8 :offset-assert 44) - (fade uint8 :offset-assert 45) - (pad uint8 2 :offset-assert 46) + ((priority float :offset 16) + (action gui-action :offset 20) + (channel gui-channel :offset 21) + (anim-part uint8 :offset 22) + (flags gui-connection-flags :offset 23) + (name string :offset 24) + (id sound-id :offset 28) + (handle handle :offset 0) + (time-stamp time-frame :offset 8) + (hold-time time-frame :offset-assert 32) + (fo-min int16 :offset-assert 40) + (fo-max int16 :offset-assert 42) + (fo-curve int8 :offset-assert 44) + (fade uint8 :offset-assert 45) + (pad uint8 2 :offset-assert 46) ) :method-count-assert 14 :size-assert #x30 @@ -262,21 +262,21 @@ :flag-assert #x1900000cd0 (:methods (new (symbol type int) _type_ 0) - (gui-control-method-9 (_type_ process gui-channel gui-action string float time-frame) sound-id 9) - (gui-control-method-10 (_type_ process gui-channel) none 10) - (gui-control-method-11 (_type_ gui-connection) int 11) + (add-process (_type_ process gui-channel gui-action string float time-frame) sound-id 9) + (remove-process (_type_ process gui-channel) none 10) + (stop-str (_type_ gui-connection) int 11) (gui-control-method-12 (_type_ process gui-channel gui-action string int float sound-id) sound-id 12) (update (_type_ symbol) int 13) - (gui-control-method-14 (_type_ string gui-channel gui-action) int 14) - (gui-control-method-15 (_type_ process gui-channel string sound-id) gui-connection 15) - (gui-control-method-16 (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) - (gui-control-method-17 (_type_ sound-id) gui-action 17) + (lookup-gui-connection-id (_type_ string gui-channel gui-action) int 14) + (lookup-gui-connection (_type_ process gui-channel string sound-id) gui-connection 15) + (set-action! (_type_ gui-action sound-id gui-channel gui-action string (function gui-connection symbol) process) int 16) + (get-status (_type_ sound-id) gui-status 17) (gui-control-method-18 (_type_ gui-channel) symbol 18) - (gui-control-method-19 (_type_ gui-channel gui-connection) symbol 19) - (gui-control-method-20 (_type_ sound-id symbol int int int) gui-connection 20) + (handle-command-list (_type_ gui-channel gui-connection) symbol 19) + (set-falloff! (_type_ sound-id symbol int int int) gui-connection 20) (gui-control-method-21 (_type_ gui-connection vector) int 21) (gui-control-method-22 (_type_ gui-connection process symbol) none 22) - (gui-control-method-23 (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) + (handle-command (_type_ gui-channel gui-channel symbol gui-connection) symbol 23) (channel-id-set! (_type_ gui-connection sound-id) int 24) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc index 4ad93e29e7..81676548c7 100644 --- a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc @@ -3,12 +3,13 @@ ;; definition of type hud-string (deftype hud-string (basic) - ((text string :offset-assert 4) - (scale float :offset-assert 8) - (color uint32 :offset-assert 12) - (flags uint32 :offset-assert 16) - (pos vector4w :inline :offset-assert 32) + ((text string :offset-assert 4) + (scale float :offset-assert 8) + (color font-color :offset-assert 12) + (flags font-flags :offset-assert 16) + (pos int32 4 :offset 32) ) + :allow-misaligned :method-count-assert 9 :size-assert #x30 :flag-assert #x900000030 @@ -34,6 +35,7 @@ (deftype hud-sprite (structure) ((pos vector4w :inline :offset-assert 0) (color vector4w :inline :offset-assert 16) + (color2 int32 4 :offset 16) (flags uint32 :offset-assert 32) (scale-x float :offset-assert 36) (scale-y float :offset-assert 40) @@ -44,7 +46,7 @@ :size-assert #x34 :flag-assert #xb00000034 (:methods - (hud-sprite-method-9 (_type_ dma-buffer level) none 9) + (draw (_type_ dma-buffer level) none 9) (hud-sprite-method-10 (_type_) none 10) ) ) @@ -57,7 +59,7 @@ ) (format #t "[~8x] ~A~%" obj 'hud-sprite) (format #t "~1Tpos: #~%" (-> obj pos)) - (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tcolor: #~%" (-> obj color2)) (format #t "~1Tflags: ~D~%" (-> obj flags)) (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) @@ -77,13 +79,13 @@ :size-assert #x20 :flag-assert #x1000000020 (:methods - (hud-box-method-9 (_type_ dma-buffer) none 9) - (hud-box-method-10 () none 10) - (hud-box-method-11 () none 11) - (hud-box-method-12 () none 12) - (hud-box-method-13 (_type_ dma-buffer float) int 13) - (hud-box-method-14 (_type_) none 14) - (hud-box-method-15 (_type_) none 15) + (draw-box-prim-only (_type_ dma-buffer) none 9) + (draw-box-alpha-1 (_type_ dma-buffer) none 10) + (draw-box-alpha-2 (_type_ dma-buffer) none 11) + (draw-box-alpha-3 (_type_ dma-buffer) none 12) + (draw-scan-and-line (_type_ dma-buffer float) int 13) + (setup-scissor (_type_ dma-buffer) none 14) + (restore-scissor (_type_ dma-buffer) none 15) ) ) @@ -103,11 +105,12 @@ ;; definition of type hud-icon (deftype hud-icon (basic) - ((icon (pointer manipy) :offset-assert 4) - (pos vector4w :inline :offset-assert 16) - (scale-x float :offset-assert 32) - (scale-y float :offset-assert 36) + ((icon (pointer manipy) :offset-assert 4) + (pos int32 4 :offset 16) + (scale-x float :offset-assert 32) + (scale-y float :offset-assert 36) ) + :allow-misaligned :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 @@ -135,7 +138,7 @@ (flags uint16 :offset-assert 12) (counter uint16 :offset-assert 14) ) - :pack-me + :allow-misaligned :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 @@ -162,11 +165,11 @@ (last-hide-time time-frame :offset-assert 136) (offset float :offset-assert 144) (flags hud-flags :offset-assert 148) - (values hud-value 8 :inline :offset-assert 152) - (strings hud-string 14 :inline :offset-assert 288) - (sprites hud-sprite 30 :inline :offset-assert 960) - (icons hud-icon 2 :inline :offset-assert 2880) - (gui-id sound-id :offset-assert 2976) + (values hud-value 8 :inline :offset 148) + (strings hud-string 14 :inline :offset 284) + (sprites hud-sprite 30 :inline :offset 960) + (icons hud-icon 2 :inline :offset 2876) + (gui-id sound-id :offset 2976) ) :heap-base #xb30 :method-count-assert 27 @@ -174,18 +177,18 @@ :flag-assert #x1b0b300ba4 (:methods (hidden? (_type_) symbol 14) - (hud-method-15 (_type_) none 15) - (hud-method-16 (_type_ int int) none 16) - (hud-method-17 (_type_) none 17) - (hud-method-18 (_type_) symbol 18) + (draw (_type_) none 15) + (update-values (_type_) none 16) + (init-callback (_type_) none 17) + (event-callback (_type_ process int symbol event-message-block) symbol 18) (hud-method-19 (_type_) none 19) (hud-method-20 (_type_) none 20) (hud-method-21 (_type_) none 21) (hud-method-22 (_type_) none 22) (hud-method-23 (_type_) none 23) - (hud-method-24 (_type_ symbol) none 24) - (hud-method-25 (_type_) none 25) - (hud-method-26 (_type_ int) none 26) + (check-ready-and-maybe-show (_type_ symbol) symbol 24) + (update-value-callback (_type_ int int) none 25) + (alloc-string-if-needed (_type_ int) none 26) ) ) @@ -202,10 +205,10 @@ (format #t "~2Tlast-hide-time: ~D~%" (-> obj last-hide-time)) (format #t "~2Toffset: ~f~%" (-> obj offset)) (format #t "~2Tflags: ~D~%" (-> obj flags)) - (format #t "~2Tvalues[8] @ #x~X~%" (&-> obj values 0 type)) - (format #t "~2Tstrings[14] @ #x~X~%" (&-> obj strings 0 type)) + (format #t "~2Tvalues[8] @ #x~X~%" (-> obj values)) + (format #t "~2Tstrings[14] @ #x~X~%" (-> obj strings)) (format #t "~2Tsprites[30] @ #x~X~%" (-> obj sprites)) - (format #t "~2Ticons[2] @ #x~X~%" (&-> obj stack 2752)) + (format #t "~2Ticons[2] @ #x~X~%" (-> obj icons)) (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) (label cfg-4) obj diff --git a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc index 49e4b9291d..f1126afcea 100644 --- a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc @@ -556,19 +556,19 @@ (minimap-method-12 (_type_ process uint int vector int) connection-minimap 12) (minimap-method-13 () none 13) (minimap-method-14 () none 14) - (minimap-method-15 () none 15) + (minimap-method-15 (_type_ dma-buffer vector4w symbol) none 15) (minimap-method-16 () none 16) (minimap-method-17 () none 17) (minimap-method-18 () none 18) (minimap-method-19 () none 19) - (minimap-method-20 () none 20) + (minimap-method-20 (_type_) symbol 20) (minimap-method-21 () none 21) (minimap-method-22 () none 22) (minimap-method-23 () none 23) - (minimap-method-24 () none 24) - (minimap-method-25 () none 25) + (minimap-method-24 (_type_ dma-buffer vector4w symbol) none 24) + (minimap-method-25 (_type_ texture float) none 25) (minimap-method-26 () none 26) - (minimap-method-27 () none 27) + (minimap-method-27 (_type_ float float) none 27) ) ) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc index 3464e9b3df..ae15929f20 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-draw_REF.gc @@ -305,7 +305,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-23 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-23) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -331,7 +331,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -371,7 +371,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -397,7 +397,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -437,7 +437,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -463,7 +463,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -503,7 +503,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -529,7 +529,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -569,7 +569,7 @@ (let* ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-0 base)) ) - (hud-box-method-14 arg0) + (setup-scissor arg0 s4-0) (let ((a3-0 (-> s4-0 base))) (let ((v1-17 (the-as object (-> s4-0 base)))) (set! (-> (the-as dma-packet v1-17) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -595,7 +595,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - (hud-box-method-15 arg0) + (restore-scissor arg0 s5-0) (let ((a3-0 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -1467,7 +1467,7 @@ (let* ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-0 (-> s5-0 base)) ) - ((method-of-type hud-box hud-box-method-9) (the-as hud-box (-> arg0 box)) s5-0) + ((method-of-type hud-box draw-box-prim-only) (the-as hud-box (-> arg0 box)) s5-0) (let ((a3-1 (-> s5-0 base))) (let ((v1-7 (the-as object (-> s5-0 base)))) (set! (-> (the-as dma-packet v1-7) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2641,42 +2641,67 @@ (set! (-> arg1 height) 190.0) (let ((s2-8 (-> *progress-save-info* file arg2 level-index))) (when (= arg2 sv-20) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) - (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-199 (-> obj sprites 0 color2))) + (set! (-> v1-199 0) 128) + (set! (-> v1-199 1) 128) + (set! (-> v1-199 2) 128) + (set! (-> v1-199 3) (the int (* 128.0 sv-16))) + ) + (let ((v1-200 (-> obj sprites 1 color2))) + (set! (-> v1-200 0) 128) + (set! (-> v1-200 1) 128) + (set! (-> v1-200 2) 128) + (set! (-> v1-200 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 1 pos z) #xffffff) (set! (-> obj sprites 1 pos w) 1) - (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 (the-as int s2-8)))) + (set! (-> obj sprites 1 tex) (lookup-texture-by-id (get-level-icon-id-01 s2-8))) (set! (-> obj sprites 1 scale-x) 1.0) (set! (-> obj sprites 1 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 1) sv-40 sv-48) - (set-vector! (-> obj sprites 2 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-205 (-> obj sprites 2 color2))) + (set! (-> v1-205 0) 128) + (set! (-> v1-205 1) 128) + (set! (-> v1-205 2) 128) + (set! (-> v1-205 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 2 pos z) #xffffff) (set! (-> obj sprites 2 pos w) 1) - (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 (the-as int s2-8)))) + (set! (-> obj sprites 2 tex) (lookup-texture-by-id (get-level-icon-id-02 s2-8))) (set! (-> obj sprites 2 scale-x) 1.0) (set! (-> obj sprites 2 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 2) (+ sv-40 sv-56) sv-48) - (set-vector! (-> obj sprites 3 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-211 (-> obj sprites 3 color2))) + (set! (-> v1-211 0) 128) + (set! (-> v1-211 1) 128) + (set! (-> v1-211 2) 128) + (set! (-> v1-211 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 3 pos z) #xffffff) (set! (-> obj sprites 3 pos w) 1) - (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 (the-as int s2-8)))) + (set! (-> obj sprites 3 tex) (lookup-texture-by-id (get-level-icon-id-03 s2-8))) (set! (-> obj sprites 3 scale-x) 1.0) (set! (-> obj sprites 3 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 3) sv-40 (+ sv-48 64)) - (set-vector! (-> obj sprites 4 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-217 (-> obj sprites 4 color2))) + (set! (-> v1-217 0) 128) + (set! (-> v1-217 1) 128) + (set! (-> v1-217 2) 128) + (set! (-> v1-217 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 4 pos z) #xffffff) (set! (-> obj sprites 4 pos w) 1) - (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 (the-as int s2-8)))) + (set! (-> obj sprites 4 tex) (lookup-texture-by-id (get-level-icon-id-04 s2-8))) (set! (-> obj sprites 4 scale-x) 1.0) (set! (-> obj sprites 4 scale-y) 1.0) (set-hud-piece-position! (-> obj sprites 4) (+ sv-40 sv-56) (+ sv-48 64)) (let* ((s1-7 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-9 (-> s1-7 base)) ) - (hud-sprite-method-9 (-> obj sprites 1) s1-7 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 2) s1-7 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 3) s1-7 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 4) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 1) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 2) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 3) s1-7 (-> *level* default-level)) + (draw (-> obj sprites 4) s1-7 (-> *level* default-level)) (let ((a3-35 (-> s1-7 base))) (let ((v1-237 (the-as object (-> s1-7 base)))) (set! (-> (the-as dma-packet v1-237) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2706,11 +2731,7 @@ (let* ((s1-8 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-10 (-> s1-8 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-8 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-8 (-> *level* default-level)) (let ((a3-36 (-> s1-8 base))) (let ((v1-260 (the-as object (-> s1-8 base)))) (set! (-> (the-as dma-packet v1-260) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2729,7 +2750,7 @@ (set! (-> arg1 origin y) (+ 1.0 (-> arg1 origin y))) (set! (-> arg1 origin x) (+ 28.0 (-> arg1 origin x))) (let* ((v1-272 (-> *progress-save-info* file arg2 game-time0)) - (v1-273 (logior (shl (the-as int (-> *progress-save-info* file arg2 game-time1)) 32) v1-272)) + (v1-273 (logior (shl (-> *progress-save-info* file arg2 game-time1) 32) v1-272)) (s2-11 (/ (the-as int v1-273) #x107ac0)) ) (set! sv-112 (/ (mod (the-as int v1-273) #x107ac0) #x4650)) @@ -2743,11 +2764,7 @@ (let* ((s1-10 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-12 (-> s1-10 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-10 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-10 (-> *level* default-level)) (let ((a3-39 (-> s1-10 base))) (let ((v1-285 (the-as object (-> s1-10 base)))) (set! (-> (the-as dma-packet v1-285) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2773,11 +2790,7 @@ (let* ((s1-12 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-14 (-> s1-12 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-12 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-12 (-> *level* default-level)) (let ((a3-41 (-> s1-12 base))) (let ((v1-304 (the-as object (-> s1-12 base)))) (set! (-> (the-as dma-packet v1-304) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2805,11 +2818,7 @@ (let* ((s1-14 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-16 (-> s1-14 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s1-14 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s1-14 (-> *level* default-level)) (let ((a3-43 (-> s1-14 base))) (let ((v1-325 (the-as object (-> s1-14 base)))) (set! (-> (the-as dma-packet v1-325) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -3474,18 +3483,19 @@ (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x48 :page #x67a))) (set! (-> obj sprites 0 scale-x) 1.0) (set! (-> obj sprites 0 scale-y) 1.0) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) + (let ((v1-6 (-> obj sprites 0 color2))) + (set! (-> v1-6 0) 128) + (set! (-> v1-6 1) 128) + (set! (-> v1-6 2) 128) + (set! (-> v1-6 3) (the int (* 128.0 (- 1.0 (-> arg0 menu-transition))))) + ) (set! (-> obj sprites 0 pos z) #xffffff) (set! (-> obj sprites 0 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 240 160) (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s4-1 (-> s3-0 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s3-0 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) (let ((a3-1 (-> s3-0 base))) (let ((v1-16 (the-as object (-> s3-0 base)))) (set! (-> (the-as dma-packet v1-16) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -5279,18 +5289,19 @@ (set! (-> obj sprites 0 flags) (the-as uint 4)) (set! (-> obj sprites 0 scale-x) 0.64) (set! (-> obj sprites 0 scale-y) 0.64) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 sv-16))) + (let ((v1-32 (-> obj sprites 0 color2))) + (set! (-> v1-32 0) 128) + (set! (-> v1-32 1) 128) + (set! (-> v1-32 2) 128) + (set! (-> v1-32 3) (the int (* 128.0 sv-16))) + ) (set! (-> obj sprites 0 pos z) #xffffff) (set! (-> obj sprites 0 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) 100 128) (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s4-0 (-> s3-0 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - s3-0 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) s3-0 (-> *level* default-level)) (let ((a3-1 (-> s3-0 base))) (let ((v1-42 (the-as object (-> s3-0 base)))) (set! (-> (the-as dma-packet v1-42) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -5495,11 +5506,7 @@ (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (gp-1 (-> s4-1 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> arg0 sprites)) - s4-1 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> arg0 sprites)) s4-1 (-> *level* default-level)) (let ((a3-1 (-> s4-1 base))) (let ((v1-8 (the-as object (-> s4-1 base)))) (set! (-> (the-as dma-packet v1-8) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -5549,11 +5556,7 @@ (let* ((s4-1 (-> *display* frames (-> *display* on-screen) global-buf)) (s5-1 (-> s4-1 base)) ) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (&-> arg0 pad 3)) - s4-1 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (&-> arg0 pad 3)) s4-1 (-> *level* default-level)) (let ((a3-1 (-> s4-1 base))) (let ((v1-20 (the-as object (-> s4-1 base)))) (set! (-> (the-as dma-packet v1-20) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -6483,7 +6486,12 @@ (set! (-> sv-144 sprites 0 flags) (the-as uint 4)) (set! (-> sv-144 sprites 0 scale-x) sv-100) (set! (-> sv-144 sprites 0 scale-y) sv-100) - (set-vector! (-> sv-144 sprites 0 color) 128 128 128 (the int (* 128.0 sv-96))) + (let ((v1-33 (-> sv-144 sprites 0 color2))) + (set! (-> v1-33 0) 128) + (set! (-> v1-33 1) 128) + (set! (-> v1-33 2) 128) + (set! (-> v1-33 3) (the int (* 128.0 sv-96))) + ) (set! (-> sv-144 sprites 0 pos z) #xfffff0) (set! (-> sv-144 sprites 0 pos w) 0) (if (= (-> *setting-control* user-default language) (language-enum spanish)) @@ -7805,25 +7813,45 @@ (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) (set! (-> obj sprites 0 scale-x) f28-0) (set! (-> obj sprites 0 scale-y) 0.7) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-57 (-> obj sprites 0 color2))) + (set! (-> v1-57 0) 128) + (set! (-> v1-57 1) 128) + (set! (-> v1-57 2) 128) + (set! (-> v1-57 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 0 pos z) #x3fffff) (set! (-> obj sprites 0 pos w) 0) (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) (set! (-> obj sprites 1 scale-x) 0.2) (set! (-> obj sprites 1 scale-y) 1.33) - (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-62 (-> obj sprites 1 color2))) + (set! (-> v1-62 0) 128) + (set! (-> v1-62 1) 128) + (set! (-> v1-62 2) 128) + (set! (-> v1-62 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 1 pos z) #x3fffff) (set! (-> obj sprites 1 pos w) 0) (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) (set! (-> obj sprites 2 scale-x) 1.0) (set! (-> obj sprites 2 scale-y) 1.0) - (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-67 (-> obj sprites 2 color2))) + (set! (-> v1-67 0) sv-80) + (set! (-> v1-67 1) sv-96) + (set! (-> v1-67 2) sv-112) + (set! (-> v1-67 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 2 pos z) #xffffff) (set! (-> obj sprites 2 pos w) 0) (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) (set! (-> obj sprites 3 scale-x) 1.0) (set! (-> obj sprites 3 scale-y) 1.0) - (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-72 (-> obj sprites 3 color2))) + (set! (-> v1-72 0) sv-80) + (set! (-> v1-72 1) sv-96) + (set! (-> v1-72 2) sv-112) + (set! (-> v1-72 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 3 pos z) #xffffff) (set! (-> obj sprites 3 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) @@ -7836,11 +7864,7 @@ (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-176 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-192 (-> sv-176 base)) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - sv-176 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-176 (-> *level* default-level)) (draw-sprite2d-xy sv-176 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-128))))) @@ -7849,9 +7873,9 @@ 9 (the-as rgba sv-160) ) - (hud-sprite-method-9 (-> obj sprites 1) sv-176 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 2) sv-176 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 3) sv-176 (-> *level* default-level)) + (draw (-> obj sprites 1) sv-176 (-> *level* default-level)) + (draw (-> obj sprites 2) sv-176 (-> *level* default-level)) + (draw (-> obj sprites 3) sv-176 (-> *level* default-level)) (let ((a3-6 (-> sv-176 base))) (let ((v1-100 (the-as object (-> sv-176 base)))) (set! (-> (the-as dma-packet v1-100) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -7920,25 +7944,45 @@ (set! (-> obj sprites 0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xc93))) (set! (-> obj sprites 0 scale-x) f28-0) (set! (-> obj sprites 0 scale-y) 0.7) - (set-vector! (-> obj sprites 0 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-140 (-> obj sprites 0 color2))) + (set! (-> v1-140 0) 128) + (set! (-> v1-140 1) 128) + (set! (-> v1-140 2) 128) + (set! (-> v1-140 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 0 pos z) #x3fffff) (set! (-> obj sprites 0 pos w) 0) (set! (-> obj sprites 1 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xc :page #xc93))) (set! (-> obj sprites 1 scale-x) 0.2) (set! (-> obj sprites 1 scale-y) 1.33) - (set-vector! (-> obj sprites 1 color) 128 128 128 (the int (* 128.0 f30-0))) + (let ((v1-145 (-> obj sprites 1 color2))) + (set! (-> v1-145 0) 128) + (set! (-> v1-145 1) 128) + (set! (-> v1-145 2) 128) + (set! (-> v1-145 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 1 pos z) #x3fffff) (set! (-> obj sprites 1 pos w) 0) (set! (-> obj sprites 2 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3e :page #xc93))) (set! (-> obj sprites 2 scale-x) 1.0) (set! (-> obj sprites 2 scale-y) 1.0) - (set-vector! (-> obj sprites 2 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-150 (-> obj sprites 2 color2))) + (set! (-> v1-150 0) sv-80) + (set! (-> v1-150 1) sv-96) + (set! (-> v1-150 2) sv-112) + (set! (-> v1-150 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 2 pos z) #xffffff) (set! (-> obj sprites 2 pos w) 0) (set! (-> obj sprites 3 tex) (lookup-texture-by-id (new 'static 'texture-id :index #x3f :page #xc93))) (set! (-> obj sprites 3 scale-x) 1.0) (set! (-> obj sprites 3 scale-y) 1.0) - (set-vector! (-> obj sprites 3 color) sv-80 sv-96 sv-112 (the int (* 128.0 f30-0))) + (let ((v1-155 (-> obj sprites 3 color2))) + (set! (-> v1-155 0) sv-80) + (set! (-> v1-155 1) sv-96) + (set! (-> v1-155 2) sv-112) + (set! (-> v1-155 3) (the int (* 128.0 f30-0))) + ) (set! (-> obj sprites 3 pos z) #xffffff) (set! (-> obj sprites 3 pos w) 0) (set-hud-piece-position! (the-as hud-sprite (-> obj sprites)) s1-0 s2-0) @@ -7951,11 +7995,7 @@ (set-hud-piece-position! (-> obj sprites 3) (+ sv-64 242 s1-0) (+ s2-0 -4)) (set! sv-256 (-> *display* frames (-> *display* on-screen) global-buf)) (set! sv-272 (-> sv-256 base)) - ((method-of-type hud-sprite hud-sprite-method-9) - (the-as hud-sprite (-> obj sprites)) - sv-256 - (-> *level* default-level) - ) + ((method-of-type hud-sprite draw) (the-as hud-sprite (-> obj sprites)) sv-256 (-> *level* default-level)) (draw-sprite2d-xy sv-256 (+ s1-0 s0-0 (the int (* 230.0 (-> (the-as (pointer float) sv-208))))) @@ -7964,9 +8004,9 @@ 9 (the-as rgba sv-240) ) - (hud-sprite-method-9 (-> obj sprites 1) sv-256 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 2) sv-256 (-> *level* default-level)) - (hud-sprite-method-9 (-> obj sprites 3) sv-256 (-> *level* default-level)) + (draw (-> obj sprites 1) sv-256 (-> *level* default-level)) + (draw (-> obj sprites 2) sv-256 (-> *level* default-level)) + (draw (-> obj sprites 3) sv-256 (-> *level* default-level)) (let ((a3-13 (-> sv-256 base))) (let ((v1-183 (the-as object (-> sv-256 base)))) (set! (-> (the-as dma-packet v1-183) dma) (new 'static 'dma-tag :id (dma-tag-id next))) diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc index 322eff54a6..f143995305 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc @@ -40,7 +40,7 @@ (gone () _type_ :state 23) (init-defaults (_type_) connection 24) (progress-method-25 (_type_) none 25) - (progress-method-26 (_type_) object 26) + (is-gone (_type_) object 26) (can-go-back? (_type_) symbol 27) (progress-method-28 (_type_ symbol) symbol 28) (progress-method-29 (_type_) int 29) @@ -223,7 +223,7 @@ ;; definition of type menu-slider-option (deftype menu-slider-option (menu-option) ((value-to-modify pointer :offset-assert 48) - (sprites hud-sprite 5 :inline :offset-assert 64) + (sprites hud-sprite 5 :inline :offset 64) ) :method-count-assert 12 :size-assert #x180 @@ -392,7 +392,7 @@ ;; definition of type menu-memcard-slot-option (deftype menu-memcard-slot-option (menu-option) - ((sprites hud-sprite 5 :inline :offset-assert 48) + ((sprites hud-sprite 5 :inline :offset 48) (pad uint8 32 :offset-assert 368) ) :method-count-assert 12 @@ -618,7 +618,7 @@ ;; definition of type menu-icon-info-option (deftype menu-icon-info-option (menu-option) - ((sprites hud-sprite 2 :inline :offset-assert 48) + ((sprites hud-sprite 2 :inline :offset 48) ) :method-count-assert 12 :size-assert #xb0 @@ -933,7 +933,7 @@ ;; definition of type menu-highscores-option (deftype menu-highscores-option (paged-menu-option) ((last-move uint64 :offset-assert 64) - (sprites hud-sprite 2 :inline :offset-assert 80) + (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 :size-assert #xd0 @@ -998,7 +998,7 @@ (num-hero-items int32 :offset-assert 60) (secret-items (array secret-item-option) :offset-assert 64) (last-move uint64 :offset-assert 72) - (sprites hud-sprite 2 :inline :offset-assert 80) + (sprites hud-sprite 2 :inline :offset 80) ) :method-count-assert 12 :size-assert #xd0 diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc index 029ca81f0b..9a0432e1c5 100644 --- a/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress_REF.gc @@ -591,7 +591,7 @@ ) ;; definition for method 26 of type progress -(defmethod progress-method-26 progress ((obj progress)) +(defmethod is-gone progress ((obj progress)) (and *progress-process* (-> *progress-process* 0 next-state) (= (-> *progress-process* 0 next-state name) 'gone) @@ -1402,7 +1402,7 @@ (with-dma-buffer-add-bucket ((s5-0 (-> *display* frames (-> *display* on-screen) global-buf)) (bucket-id progress) ) - (hud-box-method-13 arg0 s5-0 arg1) + (draw-scan-and-line arg0 s5-0 arg1) ) 0 ) @@ -1515,13 +1515,7 @@ (let ((s5-1 (new 'stack-no-clear 'vector4w))) (set! (-> s5-1 quad) (the-as uint128 0)) (if (and (transform-point-qword! gp-1 s4-2) (transform-point-qword! s5-1 s3-1)) - (bigmap-method-11 - *bigmap* - (the-as int (/ (the-as int (-> s5-1 x)) 16)) - (the-as int (/ (the-as int (-> s5-1 y)) 16)) - (the-as int (/ (the-as int (-> gp-1 x)) 16)) - (the-as int (/ (the-as int (-> gp-1 y)) 16)) - ) + (bigmap-method-11 *bigmap* (/ (-> s5-1 x) 16) (/ (-> s5-1 y) 16) (/ (-> gp-1 x) 16) (/ (-> gp-1 y) 16)) ) ) ) diff --git a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc index 54ea16f3ef..c009e6f466 100644 --- a/test/decompiler/reference/jak2/levels/common/airlock_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/airlock_REF.gc @@ -391,7 +391,7 @@ (cond ((and gp-0 (>= (- (-> self clock frame-counter) (-> obj spool-sound-time)) (seconds 2))) (set! (-> obj spool-sound-time) (-> self clock frame-counter)) - (gui-control-method-9 + (add-process *gui-control* obj (gui-channel alert) diff --git a/test/decompiler/reference/jak2/levels/common/battle_REF.gc b/test/decompiler/reference/jak2/levels/common/battle_REF.gc index 774f4f265e..e6601dd880 100644 --- a/test/decompiler/reference/jak2/levels/common/battle_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/battle_REF.gc @@ -937,13 +937,13 @@ ) ) (('beaten) - (set! (-> self flags) (the-as uint (logior (the-as int (-> self flags)) 4))) + (logior! (-> self flags) 4) (if (and (-> self next-state) (= (-> self next-state name) 'idle)) (go-virtual beaten) ) ) (('resume) - (set! (-> self flags) (the-as uint (logand -5 (-> self flags)))) + (set! (-> self flags) (logand -5 (-> self flags))) (process-entity-status! self (entity-perm-status subtask-complete) #f) (if (and (-> self next-state) (= (-> self next-state name) 'beaten)) (go-virtual hostile) @@ -1140,7 +1140,7 @@ ;; definition for method 25 of type battle (defmethod battle-method-25 battle ((obj battle) (arg0 battle-spawner)) - (when (not (logtest? (the-as int (-> obj flags)) 8)) + (when (not (logtest? (-> obj flags) 8)) (let ((f0-0 (-> obj info spawner-blocked-by-player-xz))) (if (and (< 0.0 f0-0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 attack-pos)))) (return #t) @@ -1343,7 +1343,7 @@ ;; definition for method 51 of type battle (defmethod battle-method-51 battle ((obj battle) (arg0 battle-spawner) (arg1 symbol)) - (when (and (logtest? (the-as int (-> obj flags)) 2) (zero? (logand (the-as int (-> obj flags)) 4))) + (when (and (logtest? (-> obj flags) 2) (zero? (logand (-> obj flags) 4))) (let ((v1-5 (-> arg0 noticed-attack-time))) (cond ((zero? v1-5) @@ -1574,10 +1574,10 @@ (if (-> self spawn-initial-creatures?) (battle-method-40 self) ) - (if (logtest? (the-as int (-> self flags)) 1) + (if (logtest? (-> self flags) 1) (go-virtual hostile) ) - (set! (-> self flags) (the-as uint (logior (the-as int (-> self flags)) 1))) + (logior! (-> self flags) 1) (none) ) :trans (behavior () @@ -1634,11 +1634,11 @@ (v1-4 (-> obj max-count)) ) (when (zero? a0-4) - (if (or (logtest? (the-as int (-> obj flags)) 4) (>= (-> obj die-count) v1-4)) + (if (or (logtest? (-> obj flags) 4) (>= (-> obj die-count) v1-4)) (return #t) ) ) - (set! (-> obj flags) (the-as uint (logand -9 (-> obj flags)))) + (set! (-> obj flags) (logand -9 (-> obj flags))) (cond ((and (> s5-0 0) (>= s5-0 (the-as int (- v1-4 (-> obj die-count))))) (let ((a1-14 (-> obj jammed-starting-time))) @@ -1648,7 +1648,7 @@ ) (else (if (>= (- (-> pp clock frame-counter) a1-14) (seconds 3.5)) - (set! (-> obj flags) (the-as uint (logior (the-as int (-> obj flags)) 8))) + (logior! (-> obj flags) 8) ) ) ) @@ -1660,7 +1660,7 @@ ) ) (cond - ((and (not (logtest? (the-as int (-> obj flags)) 4)) + ((and (not (logtest? (-> obj flags) 4)) (> (-> obj spawners length) 0) (< a0-4 (the-as int (-> obj info desired-alive-count))) (< (-> obj count) v1-4) @@ -1696,8 +1696,8 @@ :event battle-event-handler :enter (behavior () (set! (-> self state-time) (-> self clock frame-counter)) - (set! (-> self flags) (the-as uint (logior (the-as int (-> self flags)) 2))) - (set! (-> self flags) (the-as uint (logand -9 (-> self flags)))) + (logior! (-> self flags) 2) + (set! (-> self flags) (logand -9 (-> self flags))) (set! (-> self jammed-starting-time) 0) (set! (-> self cant-spawn-time) 0) (set! (-> self next-spawn-delay) (the-as uint 0)) @@ -1745,10 +1745,10 @@ ) ;; definition for method 47 of type battle -;; WARN: Return type mismatch uint8 vs none. +;; WARN: Return type mismatch uint vs none. (defmethod battle-method-47 battle ((obj battle)) (let ((a3-0 (-> obj info play-battle-music))) - (when (and a3-0 (zero? (logand (the-as int (-> obj flags)) 16))) + (when (and a3-0 (zero? (logand (-> obj flags) 16))) (case a3-0 (('sound-mode) (set-setting! 'sound-mode #f 0 1) @@ -1757,7 +1757,7 @@ (set-setting! 'music a3-0 0 0) ) ) - (set! (-> obj flags) (the-as uint (logior (the-as int (-> obj flags)) 16))) + (logior! (-> obj flags) 16) ) ) (none) @@ -1766,7 +1766,7 @@ ;; definition for method 48 of type battle ;; WARN: Return type mismatch int vs none. (defmethod battle-method-48 battle ((obj battle)) - (when (logtest? (the-as int (-> obj flags)) 16) + (when (logtest? (-> obj flags) 16) (remove-setting! 'sound-mode) (remove-setting! 'music) ) diff --git a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc index 177bf2f648..4804e1f67a 100644 --- a/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/enemy/guards/guard-conversation_REF.gc @@ -271,7 +271,7 @@ ) ) ) - (gui-control-method-9 + (add-process *gui-control* obj (gui-channel guard) @@ -349,11 +349,11 @@ (go-virtual die) ) ) - (if (nonzero? (gui-control-method-17 + (if (nonzero? (get-status *gui-control* (the-as sound-id - (gui-control-method-14 *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) + (lookup-gui-connection-id *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) ) ) ) @@ -371,7 +371,7 @@ (defstate notice (guard-conversation) :virtual #t :code (behavior () - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (the-as sound-id 1) @@ -382,7 +382,7 @@ (the-as process #f) ) (let ((v1-2 (rand-vu-int-count 3))) - (gui-control-method-9 + (add-process *gui-control* self (gui-channel guard) @@ -402,14 +402,14 @@ 0 ) ) - (until (= (gui-control-method-17 + (until (= (get-status *gui-control* (the-as sound-id - (gui-control-method-14 *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) + (lookup-gui-connection-id *gui-control* (the-as string #f) (gui-channel guard) (gui-action none)) ) ) - (gui-action none) + (gui-status unknown) ) (suspend) ) diff --git a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc index dcd89be02a..29cf19bc65 100644 --- a/test/decompiler/reference/jak2/levels/common/flitter_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/flitter_REF.gc @@ -628,7 +628,7 @@ (defmethod enemy-method-78 flitter ((obj flitter) (arg0 (pointer float))) (case (-> obj incoming knocked-type) (((knocked-type knocked-type-6)) - (when (>= (the-as uint (-> obj incoming blue-juggle-count)) (the-as uint 2)) + (when (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) (let ((v1-4 (-> obj skel root-channel 0))) (set! (-> v1-4 frame-group) (the-as art-joint-anim (-> obj draw art-group data 22))) (set! (-> v1-4 param 0) diff --git a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc index 63d6df951a..b0436602ef 100644 --- a/test/decompiler/reference/jak2/levels/common/grunt_REF.gc +++ b/test/decompiler/reference/jak2/levels/common/grunt_REF.gc @@ -1337,7 +1337,7 @@ ) ) ) - (if (>= (the-as uint (-> obj incoming blue-juggle-count)) (the-as uint 2)) + (if (>= (-> obj incoming blue-juggle-count) (the-as uint 2)) (set! (-> obj unknown-byte-n123n) (the-as int (logior (-> obj stack 511) 2))) ) (cond diff --git a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc index 536f6f9957..b564d3bf2b 100644 --- a/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/fortress/prison/prison-obs_REF.gc @@ -67,18 +67,10 @@ (let ((s1-0 (command-get-process "prsn-chair-shackle" *target*)) (gp-1 (new 'stack-no-clear 'matrix)) (s2-0 *prsn-torture-lightning-joints*) - (s3-1 - (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (the-as int (-> s3-0 x))) - ) + (s3-1 (rand-vu-int-range-exclude 0 (+ (-> *prsn-torture-lightning-joints* length) -1) (-> s3-0 x))) ) *prsn-chair-shackle-lightning-joints* - (let ((v1-7 (rand-vu-int-range-exclude - 0 - (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) - (the-as int (-> s4-0 x)) - ) - ) - ) + (let ((v1-7 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) (when s1-0 (set! (-> s4-0 x) v1-7) (vector<-cspace! (the-as vector (-> gp-1 vector)) (-> self node-list data 13)) @@ -106,13 +98,7 @@ ((= arg2 'lightning-needle) (let ((gp-2 (command-get-process "prsn-chair-shackle" *target*))) *prsn-chair-shackle-lightning-joints* - (let ((v1-38 (rand-vu-int-range-exclude - 0 - (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) - (the-as int (-> s4-0 x)) - ) - ) - ) + (let ((v1-38 (rand-vu-int-range-exclude 0 (+ (-> *prsn-chair-shackle-lightning-joints* length) -1) (-> s4-0 x)))) (when gp-2 (set! (-> s4-0 x) v1-38) (let ((s4-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 8))) @@ -164,8 +150,8 @@ (when (and (nonzero? (-> self skel)) (nonzero? (-> (the-as process-drawable gp-3) skel))) (let* ((v1-52 (-> s2-3 length)) (s1-3 (-> s5-3 length)) - (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (the-as int (-> s3-0 x)))) - (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (the-as int (-> s4-0 x)))) + (s0-2 (rand-vu-int-range-exclude 0 (+ v1-52 -1) (-> s3-0 x))) + (s1-4 (rand-vu-int-range-exclude 0 (+ s1-3 -1) (-> s4-0 x))) ) (set! sv-112 (-> *part-id-table* 179)) (set! (-> s3-0 x) s0-2) diff --git a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc index 019a17b283..4ff4b36f53 100644 --- a/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc +++ b/test/decompiler/reference/jak2/levels/gungame/gungame-obs_REF.gc @@ -145,7 +145,7 @@ ;; WARN: Return type mismatch int vs none. (defmethod training-manager-method-32 training-manager ((obj training-manager)) (when (handle->process (-> obj voicebox)) - (if (= (gui-control-method-17 *gui-control* (-> obj last-sound-id)) (gui-action none)) + (if (= (get-status *gui-control* (-> obj last-sound-id)) (gui-status unknown)) (send-event (handle->process (-> obj voicebox)) 'speak-effect #f) (send-event (handle->process (-> obj voicebox)) 'speak-effect #t) ) @@ -154,13 +154,13 @@ ((= (-> (level-get-target-inside *level*) name) 'gungame) (if (zero? (-> obj gui-id)) (set! (-> obj gui-id) - (gui-control-method-9 *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) + (add-process *gui-control* obj (gui-channel message) (gui-action play) (-> obj name) 81920.0 0) ) ) ) (else (when (nonzero? (-> obj gui-id)) - (gui-control-method-16 + (set-action! *gui-control* (gui-action stop) (-> obj gui-id) @@ -279,7 +279,7 @@ ;; definition for method 30 of type training-manager (defmethod training-manager-method-30 training-manager ((obj training-manager) (arg0 game-text-id)) - (when (= (gui-control-method-17 *gui-control* (-> obj gui-id)) (gui-action playing)) + (when (= (get-status *gui-control* (-> obj gui-id)) (gui-status active)) (let ((s5-1 (new 'stack 'font-context @@ -335,15 +335,15 @@ (set! (-> self voicebox) (ppointer->handle (voicebox-spawn *target* (target-pos 0)))) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc001" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc001" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc002" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc002" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc003" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc003" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (until (cpad-pressed? 0 r1) @@ -351,18 +351,18 @@ (suspend) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc004" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc004" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc005" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc005" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc006" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc006" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc007" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc007" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (when *target* @@ -372,12 +372,12 @@ ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* *target* (gui-channel sig) (gui-action play) "sigc008" -99.0 0) + (add-process *gui-control* *target* (gui-channel sig) (gui-action play) "sigc008" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc009" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc009" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (while (or (not *target*) (zero? (logand (focus-status gun) (-> *target* focus-status)))) @@ -385,17 +385,17 @@ (suspend) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc010" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc010" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc011" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc011" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (when (nonzero? (training-manager-method-26 self)) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc012" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc012" -99.0 0) ) (let ((gp-2 (training-manager-method-26 self))) (while (= (training-manager-method-26 self) gp-2) @@ -404,13 +404,13 @@ ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc013" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc013" -99.0 0) ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc014" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc014" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (task-node-close! (game-task-node city-red-gun-training-introduction)) @@ -917,7 +917,7 @@ (set! (-> self egg-count) 0) (if (not (task-node-open? (game-task-node sewer-enemy-resolution))) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv178" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv178" -99.0 0) ) ) (until #f @@ -1076,15 +1076,15 @@ (set! (-> self voicebox) (ppointer->handle (voicebox-spawn *target* (target-pos 0)))) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc015" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc015" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc016" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc016" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc017" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc017" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (let ((gp-2 (-> *game-info* gun-type))) @@ -1094,12 +1094,12 @@ ) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc073" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc073" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc075" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc075" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (set! (-> self combo-done?) #f) @@ -1124,9 +1124,9 @@ (cond ((-> self combo-done?) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc080" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc080" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) #t @@ -1134,9 +1134,9 @@ ) (else (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc077" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc077" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) ) @@ -1145,12 +1145,12 @@ #f (label cfg-61) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc018" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc018" -99.0 0) ) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc022" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc022" -99.0 0) ) - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (task-node-close! (game-task-node city-yellow-gun-training-introduction)) @@ -1301,12 +1301,12 @@ (cond ((zero? v1-106) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc026" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc026" -99.0 0) ) ) ((= v1-106 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc027" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc027" -99.0 0) ) ) ) @@ -1342,7 +1342,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-1 format) - (gp-1 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-1 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-0 "~S") ) (let* ((s3-0 format) @@ -1360,7 +1360,7 @@ ((>= (-> *game-info* score) (-> s5-0 1)) (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-2 format) - (gp-2 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-2 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-1 "~S") ) (let* ((s3-1 format) @@ -1378,7 +1378,7 @@ ((>= (-> *game-info* score) (-> s5-0 2)) (set! (-> *game-info* goal) (-> s5-0 1)) (let ((s5-3 format) - (gp-3 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-3 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-2 "~S") ) (let* ((s3-2 format) @@ -1396,7 +1396,7 @@ (else (set! (-> *game-info* goal) (-> s5-0 2)) (let ((s5-4 format) - (gp-4 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-4 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-3 "~S") ) (let* ((s3-3 format) @@ -1418,7 +1418,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-5 format) - (gp-5 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-5 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-4 "~S") ) (let* ((s3-4 format) @@ -1436,7 +1436,7 @@ ((>= (-> *game-info* score) (-> s5-0 1)) (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-6 format) - (gp-6 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-6 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-5 "~S") ) (let* ((s3-5 format) @@ -1454,7 +1454,7 @@ (else (set! (-> *game-info* goal) (-> s5-0 1)) (let ((s5-7 format) - (gp-7 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-7 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-6 "~S") ) (let* ((s3-6 format) @@ -1478,7 +1478,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-8 format) - (gp-8 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-8 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-7 "~S") ) (let* ((s3-7 format) @@ -1496,7 +1496,7 @@ (else (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-9 format) - (gp-9 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-9 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-8 "~S") ) (let* ((s3-8 format) @@ -1516,7 +1516,7 @@ ((>= (-> *game-info* score) (-> s5-0 0)) (set! (-> *game-info* goal) (-> *game-info* score)) (let ((s5-10 format) - (gp-10 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-10 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-9 "~S") ) (let* ((s3-9 format) @@ -1534,7 +1534,7 @@ ((>= (-> *game-info* score) (-> s5-0 1)) (set! (-> *game-info* goal) (-> s5-0 0)) (let ((s5-11 format) - (gp-11 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-11 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-10 "~S") ) (let* ((s3-10 format) @@ -1552,7 +1552,7 @@ ((>= (-> *game-info* score) (-> s5-0 2)) (set! (-> *game-info* goal) (-> s5-0 1)) (let ((s5-12 format) - (gp-12 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-12 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-11 "~S") ) (let* ((s3-11 format) @@ -1570,7 +1570,7 @@ ((>= (-> *game-info* score) (-> self training-goal)) (set! (-> *game-info* goal) (-> s5-0 2)) (let ((s5-13 format) - (gp-13 (the-as hud (clear (the-as string (-> (the-as hud gp-0) strings 1 type))))) + (gp-13 (the-as hud (clear (-> (the-as hud gp-0) strings 1 text)))) (s4-12 "~S") ) (let* ((s3-12 format) @@ -1588,7 +1588,7 @@ (else (set! (-> *game-info* goal) (-> self training-goal)) (let ((s5-14 format) - (gp-14 (clear (the-as string (-> (the-as hud gp-0) strings 1 type)))) + (gp-14 (clear (-> (the-as hud gp-0) strings 1 text))) (s4-13 "~S") ) (let* ((s3-13 format) @@ -1663,7 +1663,7 @@ (when (and (not (logtest? (-> s5-0 flags) 4)) (not (-> self first-enemy-shown?))) (if (task-node-open? (game-task-node city-red-gun-training-try-once)) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc024" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc024" -99.0 0) ) ) (set! (-> self first-enemy-shown?) #t) @@ -1671,7 +1671,7 @@ (when (and (logtest? (-> s5-0 flags) 4) (not (-> self first-citizen-shown?))) (if (task-node-open? (game-task-node city-red-gun-training-try-once)) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc025" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc025" -99.0 0) ) ) (set! (-> self first-citizen-shown?) #t) @@ -1863,17 +1863,17 @@ (cond ((zero? v1-10) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv179" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv179" -99.0 0) ) ) ((= v1-10 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv180" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv180" -99.0 0) ) ) ((= v1-10 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "cityv181" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "cityv181" -99.0 0) ) ) ) @@ -1888,22 +1888,22 @@ (cond ((zero? v1-17) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) ) ) ((= v1-17 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) ) ) ((= v1-17 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) ) ) ((= v1-17 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) ) ) ) @@ -1917,22 +1917,22 @@ (cond ((zero? v1-28) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) ) ) ((= v1-28 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) ) ) ((= v1-28 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) ) ) ((= v1-28 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) ) ) ) @@ -1951,22 +1951,22 @@ (cond ((zero? v1-35) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc028" -99.0 0) ) ) ((= v1-35 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc029" -99.0 0) ) ) ((= v1-35 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc030" -99.0 0) ) ) ((= v1-35 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc031" -99.0 0) ) ) ) @@ -1980,22 +1980,22 @@ (cond ((zero? v1-46) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc032" -99.0 0) ) ) ((= v1-46 1) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc033" -99.0 0) ) ) ((= v1-46 2) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc034" -99.0 0) ) ) ((= v1-46 3) (set! (-> self last-sound-id) - (gui-control-method-9 *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) + (add-process *gui-control* self (gui-channel sig) (gui-action play) "sigc035" -99.0 0) ) ) ) @@ -2019,7 +2019,7 @@ (none) ) :code (behavior () - (while (nonzero? (gui-control-method-17 *gui-control* (-> self last-sound-id))) + (while (nonzero? (get-status *gui-control* (-> self last-sound-id))) (suspend) ) (when (> (-> self egg-count) 0) diff --git a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc index 2dac758a08..2c0a0268a1 100644 --- a/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/intro/intro-scenes_REF.gc @@ -2435,7 +2435,12 @@ (set! (-> gp-0 flags) (the-as uint 8)) (set! (-> gp-0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xb :page #xdbc))) (set-vector! (-> gp-0 pos) 256 180 #xffffff 0) - (set-vector! (-> gp-0 color) 128 128 128 128) + (let ((v1-7 (-> gp-0 color2))) + (set! (-> v1-7 0) 128) + (set! (-> v1-7 1) 128) + (set! (-> v1-7 2) 128) + (set! (-> v1-7 3) 128) + ) (set! (-> gp-0 scale-x) 1.0) (set! (-> gp-0 scale-y) 1.0) (when (and s5-0 (-> gp-0 tex)) @@ -2455,7 +2460,7 @@ (let* ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s3-0 (-> s2-0 base)) ) - (hud-sprite-method-9 gp-0 s2-0 s5-0) + (draw gp-0 s2-0 s5-0) (let ((a3-0 (-> s2-0 base))) (let ((v1-31 (the-as object (-> s2-0 base)))) (set! (-> (the-as dma-packet v1-31) dma) (new 'static 'dma-tag :id (dma-tag-id next))) @@ -2516,13 +2521,23 @@ (set! (-> gp-0 flags) (the-as uint 8)) (set! (-> gp-0 scale-x) 0.85) (set! (-> gp-0 scale-y) 0.85) - (set-vector! (-> gp-0 color) 128 128 128 128) + (let ((v1-8 (-> gp-0 color2))) + (set! (-> v1-8 0) 128) + (set! (-> v1-8 1) 128) + (set! (-> v1-8 2) 128) + (set! (-> v1-8 3) 128) + ) (case (scf-get-territory) ((1) (set-vector! (-> gp-0 pos) 256 170 #xffffff 0) (set! (-> gp-0 tex) (lookup-texture-by-id (new 'static 'texture-id :index #xa :page #xdbc))) (set! (-> s5-0 flags) (the-as uint 8)) - (set-vector! (-> s5-0 color) 128 128 128 128) + (let ((v1-13 (-> s5-0 color2))) + (set! (-> v1-13 0) 128) + (set! (-> v1-13 1) 128) + (set! (-> v1-13 2) 128) + (set! (-> v1-13 3) 128) + ) (set! (-> s5-0 scale-x) 0.55) (set-vector! (-> s5-0 pos) 285 255 #xffffff 0) (case (-> *setting-control* user-current language) @@ -2569,9 +2584,9 @@ (let* ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s2-0 (-> s1-0 base)) ) - (hud-sprite-method-9 gp-0 s1-0 s4-0) + (draw gp-0 s1-0 s4-0) (if (-> s5-0 tex) - (hud-sprite-method-9 s5-0 s1-0 s4-0) + (draw s5-0 s1-0 s4-0) ) (let ((a3-0 (-> s1-0 base))) (let ((v1-59 (the-as object (-> s1-0 base)))) diff --git a/test/decompiler/reference/jak2/levels/temple/mountain-scenes_REF.gc b/test/decompiler/reference/jak2/levels/temple/mountain-scenes_REF.gc index 8ab10b3c7b..c0bddeb014 100644 --- a/test/decompiler/reference/jak2/levels/temple/mountain-scenes_REF.gc +++ b/test/decompiler/reference/jak2/levels/temple/mountain-scenes_REF.gc @@ -1779,7 +1779,7 @@ (while (movie?) (suspend) ) - (gui-control-method-10 *gui-control* self (gui-channel art-load)) + (remove-process *gui-control* self (gui-channel art-load)) ) (ja-channel-set! 1) (set! (-> self draw bounds w) 491520.0) @@ -1831,15 +1831,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-plat-buried-rocks-a" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-plat-buried-rocks-a" -99.0 0) (go (method-of-object obj idle)) ) ) @@ -3430,15 +3422,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-step-plat-rocks-a" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-a" -99.0 0) (go (method-of-object obj idle)) ) ) @@ -3549,15 +3533,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-step-plat-rocks-b" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-b" -99.0 0) (go (method-of-object obj idle)) ) ) @@ -3675,15 +3651,7 @@ (go (method-of-object obj done) #t) ) (else - (gui-control-method-9 - *gui-control* - obj - (gui-channel art-load) - (gui-action queue) - "mtn-step-plat-rocks-c" - -99.0 - 0 - ) + (add-process *gui-control* obj (gui-channel art-load) (gui-action queue) "mtn-step-plat-rocks-c" -99.0 0) (go (method-of-object obj idle)) ) )