From 017070525a14d1f441fc6a43b615f1a6a1bc817c Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 11 Sep 2022 13:42:46 -0400 Subject: [PATCH] d/jak2: finish `vol` | `cam-layout` | `menu` | `default-menu` and start working on nav code (#1867) I also added font-color names since this PR adds quite a few: ![image](https://user-images.githubusercontent.com/13153231/189508209-c8849672-fac5-47cb-9652-f1d4648f0af8.png) --- Taskfile.yml | 2 +- decompiler/config/jak2/all-types.gc | 1050 +- .../jak2/anonymous_function_types.jsonc | 2 +- decompiler/config/jak2/hacks.jsonc | 24 +- decompiler/config/jak2/label_types.jsonc | 20 +- decompiler/config/jak2/stack_structures.jsonc | 155 +- decompiler/config/jak2/type_casts.jsonc | 174 +- decompiler/config/jak2/var_names.jsonc | 71 +- decompiler/util/data_decompile.cpp | 49 +- goal_src/jak2/engine/ai/traffic-h.gc | 4 + goal_src/jak2/engine/camera/cam-debug-h.gc | 8 + goal_src/jak2/engine/camera/cam-debug.gc | 17 +- goal_src/jak2/engine/camera/cam-layout.gc | 3649 +++++++ .../jak2/engine/collide/collide-shape-h.gc | 16 +- goal_src/jak2/engine/debug/anim-tester.gc | 83 + goal_src/jak2/engine/debug/debug-h.gc | 29 +- goal_src/jak2/engine/debug/debug.gc | 10 +- goal_src/jak2/engine/debug/default-menu.gc | 6055 +++++++++++ goal_src/jak2/engine/debug/editable.gc | 122 +- goal_src/jak2/engine/debug/menu.gc | 1697 +++ .../jak2/engine/debug/nav/mysql-nav-graph.gc | 53 + .../jak2/engine/debug/nav/nav-graph-editor.gc | 91 + goal_src/jak2/engine/draw/drawable-h.gc | 8 + goal_src/jak2/engine/entity/entity-h.gc | 42 +- goal_src/jak2/engine/game/game-info-h.gc | 196 +- goal_src/jak2/engine/game/game-save.gc | 3 + goal_src/jak2/engine/game/main-h.gc | 3 + goal_src/jak2/engine/game/main.gc | 8 +- .../jak2/engine/game/task/task-control-h.gc | 19 +- goal_src/jak2/engine/geometry/vol-h.gc | 16 +- goal_src/jak2/engine/geometry/vol.gc | 349 + .../jak2/engine/gfx/background/subdivide-h.gc | 7 + goal_src/jak2/engine/gfx/font-h.gc | 47 +- goal_src/jak2/engine/gfx/font.gc | 20 +- goal_src/jak2/engine/gfx/generic/generic-h.gc | 4 + goal_src/jak2/engine/gfx/hw/display.gc | 2 +- goal_src/jak2/engine/gfx/merc/merc-h.gc | 3 + .../jak2/engine/gfx/mood/time-of-day-h.gc | 5 + goal_src/jak2/engine/gfx/texture/texture-h.gc | 6 + goal_src/jak2/engine/gfx/vu1-user-h.gc | 2 +- goal_src/jak2/engine/nav/nav-control-h.gc | 62 +- goal_src/jak2/engine/nav/nav-mesh-h.gc | 210 +- goal_src/jak2/engine/ps2/memcard-h.gc | 2 +- goal_src/jak2/engine/scene/scene-h.gc | 4 + goal_src/jak2/engine/sound/gsound.gc | 12 +- .../engine/spatial-hash/spatial-hash-h.gc | 24 +- goal_src/jak2/engine/util/profile.gc | 18 +- goal_src/jak2/engine/util/script-h.gc | 4 + .../jak2/engine/camera/cam-layout_REF.gc | 3766 +++++++ .../engine/collide/collide-edge-grab-h_REF.gc | 24 +- .../engine/collide/collide-shape-h_REF.gc | 6 +- .../reference/jak2/engine/debug/debug_REF.gc | 10 +- .../jak2/engine/debug/default-menu_REF.gc | 9513 ++++++++--------- .../jak2/engine/debug/editable_REF.gc | 16 +- .../reference/jak2/engine/debug/menu_REF.gc | 1760 +++ .../jak2/engine/entity/entity-h_REF.gc | 12 +- .../jak2/engine/game/game-info-h_REF.gc | 192 +- .../jak2/engine/geometry/geometry_REF.gc | 18 +- .../jak2/engine/geometry/vol-h_REF.gc | 10 +- .../reference/jak2/engine/geometry/vol_REF.gc | 355 + .../jak2/engine/gfx/hw/display_REF.gc | 14 +- .../jak2/engine/gfx/mood/mood-funcs2_REF.gc | 14 +- .../jak2/engine/gfx/mood/mood-funcs_REF.gc | 7 +- .../particles/sparticle-launcher_REF.gc | 2 +- .../jak2/engine/math/vector-h_REF.gc | 4 +- .../reference/jak2/engine/math/vector_REF.gc | 6 +- .../jak2/engine/nav/nav-control-h_REF.gc | 62 +- .../jak2/engine/nav/nav-mesh-h_REF.gc | 124 +- .../jak2/engine/ps2/memcard-h_REF.gc | 2 +- .../reference/jak2/engine/sound/gsound_REF.gc | 12 +- .../engine/spatial_hash/spatial-hash-h_REF.gc | 16 +- .../jak2/engine/target/board/board-h_REF.gc | 6 +- .../jak2/engine/task/task-control-h_REF.gc | 12 +- .../reference/jak2/engine/ui/text_REF.gc | 6 +- .../reference/jak2/engine/util/profile_REF.gc | 16 +- test/offline/config/jak2/config.jsonc | 11 +- 76 files changed, 23936 insertions(+), 6517 deletions(-) create mode 100644 test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/debug/menu_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/geometry/vol_REF.gc diff --git a/Taskfile.yml b/Taskfile.yml index 68cd1eb159..500ada5aa8 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -55,7 +55,7 @@ tasks: - sh: test -f {{.GK_BIN_RELEASE_DIR}}/gk{{.EXE_FILE_EXTENSION}} msg: "Couldn't locate runtime executable in '{{.GK_BIN_RELEASE_DIR}}/gk'" cmds: - - "{{.GK_BIN_RELEASE_DIR}}/gk -fakeiso -debug -v" + - "{{.GK_BIN_RELEASE_DIR}}/gk -fakeiso -debug -{{.GAME}} -v" # DEVELOPMENT repl: desc: "Start the REPL" diff --git a/decompiler/config/jak2/all-types.gc b/decompiler/config/jak2/all-types.gc index c77e338ce7..2417646167 100644 --- a/decompiler/config/jak2/all-types.gc +++ b/decompiler/config/jak2/all-types.gc @@ -118,6 +118,9 @@ (define-extern *kernel-boot-message* symbol) (define-extern *kernel-boot-art-group* string) +;; added - part of the kernel +(define-extern dma-sync (function pointer int int int)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gcommon ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -1201,7 +1204,7 @@ ) (deftype sphere (vector) - ((r float :offset 12) + ((r float :offset 12 :score 999) ) :method-count-assert 9 :size-assert #x10 @@ -2997,6 +3000,7 @@ (bucket-323 323) (bucket-324 324) (debug-no-zbuf 325) + (debug-unknown-326 326) ) ;; TODO - names in `render` menu @@ -6082,14 +6086,51 @@ :flag-assert #x900000010 ) +;; +++font-h:font-color (defenum font-color :type uint32 - (default 0) - (one 1) - (orange-red 3) - (fc-5 5) - (fc-6 6) + (default-#cddbcd 0) + (#dadada 1) + (#ededed 2) + (precursor-#ec3b00 3) + (gold-#ba9200 4) + (yellow-#f3f300 5) + (green-#3df23d 6) + (blue-#003cf1 7) + (cyan-#00fefe 8) + (magenta-#f87df8 9) + (#a0d5d5 10) + (#7cbaba 11) + (white-#ffffff 12) + (#959595 13) + (#f9a400 14) + (#daf95e 15) + (#8aa81f 16) + (#a6b5a6 17) + (#757f75 18) + (#5e3f5e 19) + (#f0e387 20) + (#3fbaed 21) + (#3a3a3a 22) + (#5c5c5c 23) + (#f298c8 24) + (#f46868 25) + (#20ca98 26) + (#8289de 27) + (#a8f3f6 28) + (#fef666 29) + (#f1f104 30) + (#8ed0f4 31) + (#7efbfb 32) + (#7ffcfc 33) + (#f9f9f9 34) + (#408080 35) + (#e0f0e0 36) + (#c00000 37) + (#ffc040 38) + (#000000 39) ) +;; ---font-h:font-color (defenum font-flags :type uint32 @@ -7757,6 +7798,7 @@ (declare-type time-of-day-proc process) (define-extern *time-of-day* (pointer time-of-day-proc)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mspace-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -8511,8 +8553,8 @@ (deftype game-task-node-info (basic) ((level basic) (task game-task) - (name basic) - (when-open basic) + (name string) + (when-open array) (flags game-task-node-flag) (parent-node uint16 4) (task-mask task-mask) @@ -8541,14 +8583,14 @@ (deftype game-task-info (basic) - ((name basic :offset-assert 4) + ((name string :offset-assert 4) (text-name uint32 :offset-assert 8) (pre-play-node uint16 :offset-assert 12) (kiosk-play-node uint16 :offset-assert 14) - (pre-play-continue basic :offset-assert 16) + (pre-play-continue string :offset-assert 16) (play-node uint16 :offset-assert 20) - (play-continue basic :offset-assert 24) - (kiosk-play-continue basic :offset-assert 28) + (play-continue string :offset-assert 24) + (kiosk-play-continue string :offset-assert 28) ) :flag-assert #x900000020 ) @@ -11670,8 +11712,8 @@ (task-perm-list entity-perm-array :offset-assert 236) (current-continue continue-point :offset-assert 240) (last-continue continue-point :offset-assert 244) - (unknown-pad3 array :offset-assert 248) - (unknown-pad4 array :offset-assert 252) + (play-list (array game-task-info) :offset-assert 248) + (sub-task-list (array game-task-node-info) :offset-assert 252) (unknown-pad5 array :offset-assert 256) (task-counter uint32 :offset-assert 260) (unknown-pad6 uint32 :offset-assert 264) @@ -14986,11 +15028,20 @@ (player) ) +;; +++collide-shape-h:nav-flags +(defenum nav-flags + :type uint8 + :bitfield #t + (nav-flags0 0) + (nav-flags1 1) + ) +;; ---collide-shape-h:nav-flags + (deftype collide-shape (trsqv) ((actor-hash-index int16 :offset 12) - (process process :offset-assert 140) + (process process-drawable :offset-assert 140) (max-iteration-count uint8) - (nav-flags uint8) + (nav-flags nav-flags) (total-prims uint8) (num-riders uint8) (pat-ignore-mask pat-surface) @@ -18107,8 +18158,8 @@ :flag-assert #x1b00000034 ;; Failed to read fields. (:methods - (entity-method-22 () none 22) ;; (birth! (_type_) _type_ 22) - (entity-method-23 () none 23) ;; (kill! (_type_) _type_ 23) + (entity-method-22 (_type_) _type_ 22) ;; (birth! (_type_) _type_ 22) + (entity-method-23 (_type_) _type_ 23) ;; (kill! (_type_) _type_ 23) (entity-method-24 () none 24) ;; (add-to-level! (_type_ level-group level actor-id) none 24) (entity-method-25 () none 25) ;; (remove-from-level! (_type_ level-group) _type_ 25) (entity-method-26 () none 26) ;; (get-level (_type_) level 26) @@ -18122,14 +18173,13 @@ (declare-type nav-mesh basic) (deftype entity-nav-mesh (entity) - ((nav-mesh nav-mesh)) + ((nav-mesh nav-mesh :offset-assert 52)) :method-count-assert 29 :size-assert #x38 :flag-assert #x1d00000038 - ;; Failed to read fields. (:methods - (entity-nav-mesh-method-27 () none 27) - (entity-nav-mesh-method-28 () none 28) + (entity-nav-mesh-method-27 (_type_) none 27) + (debug-draw (_type_) none 28) ) ) @@ -18145,6 +18195,7 @@ ) (define-extern entity-actor type) +(declare-type nav-poly structure) (deftype entity-actor (entity) ((etype type :offset 56) (task game-task :offset-assert 60) @@ -18161,8 +18212,8 @@ (prev-actor (_type_) entity-actor 28) (entity-actor-method-29 () none 29) ;; (debug-print (_type_ symbol type) none 29) (entity-actor-method-30 () none 30) ;; (dummy-30 (_type_ entity-perm-status symbol) none 30) - (entity-actor-method-31 () none 31) - (entity-actor-method-32 () none 32) + (entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31) + (entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32) ) ) @@ -20502,10 +20553,10 @@ (work-struct-in-scratch int8 :offset-assert 292) (mesh-struct-in-scratch int8 :offset-assert 293) (polys-in-scratch int8 :offset-assert 294) - (mesh basic :offset-assert 296) + (mesh nav-mesh :offset-assert 296) (nav basic :offset-assert 300) - (poly0 basic :offset-assert 304) - (poly1 basic :offset-assert 308) + (poly0 nav-poly :offset-assert 304) + (poly1 nav-poly :offset-assert 308) (poly-id int32 :offset-assert 312) ) :method-count-assert 9 @@ -20530,7 +20581,7 @@ (deftype nav-poly (structure) ((data uint8 64 :offset-assert 0 :score -1) (vertex vector 4 :inline :offset 0) ;; changed to vector from uint8 in jak 1 - (vertex0 vector :inline :offset 0) + (vertex0 vector :inline :offset 0 :score 999) (vertex1 vector :inline :offset 16) (vertex2 vector :inline :offset 32) (vertex3 vector :inline :offset 48) @@ -20552,6 +20603,8 @@ ) (deftype nav-vertex (vector) + "A typedef for `vector`, not used because our code looks nicer if everything is `vector`s anyway + and declared out of order (cannot use forward declared structures in inline arrays)" () :method-count-assert 9 :size-assert #x10 @@ -20598,7 +20651,7 @@ (deftype nav-find-poly-parms (structure) ((point vector :inline :offset-assert 0) (y-threshold float :offset-assert 16) - (ignore uint8 :offset-assert 20) + (ignore uint8 :offset-assert 20) ;; TODO - bitfield of some kind (poly nav-poly :offset-assert 24) (dist float :offset-assert 28) (point-inside? symbol :offset-assert 32) @@ -20636,75 +20689,80 @@ (dummy 0) ) +(declare-type grid-hash basic) +(declare-type sphere-hash grid-hash) (deftype nav-mesh (basic) - ((work nav-mesh-work :offset-assert 4) - (poly-array (inline-array nav-poly)) - (static-sphere-count uint8) - (poly-count uint8) - (nav-control-count uint8) - (max-nav-control-count uint8) - (route uint32) - (poly-hash basic) - (nav-control-array uint32) - (sphere-hash basic) - (static-sphere uint32 :offset-assert 32) - (user-list basic) - (next-nav-mesh basic) - (prev-nav-mesh basic) - (bounds sphere :inline :offset-assert 48) - (origin vector :inline :offset 48) - (entity entity) - (link-array uint32) - (link-count uint8) - (flags nav-mesh-flag) - (pad1 uint8 2) - (nearest-y-threshold meters :offset-assert 76) - (water-max-height meters) - (pad2 uint32 7) + ((work nav-mesh-work :offset-assert 4) + (poly-array (inline-array nav-poly) :offset-assert 8) ;; is this actually an inline-array? + (static-sphere-count uint8 :offset-assert 12) + (poly-count uint8 :offset-assert 13) + (nav-control-count uint8 :offset-assert 14) + (max-nav-control-count uint8 :offset-assert 15) + (route uint32 :offset-assert 16) + (poly-hash grid-hash :offset-assert 20) + (nav-control-array (inline-array nav-control) :offset-assert 24) ;; 307 elts + (sphere-hash sphere-hash :offset-assert 28) + (static-sphere (inline-array sphere) :offset-assert 32) + (user-list engine :offset-assert 36) + (next-nav-mesh surface :offset-assert 40) + (prev-nav-mesh surface :offset-assert 44) + (bounds sphere :inline :offset-assert 48) + (origin vector :inline :offset 48) + (entity entity :offset-assert 64) + (link-array (array nav-mesh-link) :offset-assert 68) + (link-count uint8 :offset-assert 72) + (flags nav-mesh-flag :offset-assert 73) + (pad1 uint8 2 :offset-assert 74) + (nearest-y-threshold meters :offset-assert 76) + (water-max-height meters :offset-assert 80) + (pad2 uint32 7 :offset-assert 84) ) :method-count-assert 47 :size-assert #x70 :flag-assert #x2f00000070 - ;; Failed to read fields. (:methods - (nav-mesh-method-9 () none 9) ;; (tri-centroid-world (_type_ nav-poly vector) vector 9) - (nav-mesh-method-10 () none 10) ;; (tri-centroid-local (_type_ nav-poly vector) vector 10) - (nav-mesh-method-11 () none 11) ;; (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11) - (nav-mesh-method-12 () none 12) ;; (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) - (nav-mesh-method-13 () none 13) ;; (initialize-mesh! (_type_) none 13) - (nav-mesh-method-14 () none 14) ;; (move-along-nav-ray! (_type_ nav-ray) none 14) - (nav-mesh-method-15 () none 15) ;; (try-move-along-ray (_type_ nav-poly vector vector float) meters 15) + (nav-mesh-method-9 (_type_) none 9) ;; (tri-centroid-world (_type_ nav-poly vector) vector 9) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) ;; (tri-centroid-local (_type_ nav-poly vector) vector 10) + (nav-mesh-method-11 (_type_ nav-poly vector) vector 11) ;; (get-adj-poly (_type_ nav-poly nav-poly symbol) nav-poly 11) + (nav-mesh-method-12 (_type_ nav-poly vector) none 12) ;; (setup-portal (_type_ nav-poly nav-poly nav-route-portal) object 12) + (nav-mesh-method-13 (_type_ symbol symbol) none 13) ;; (initialize-mesh! (_type_) none 13) + (get-route-portal(_type_ object object nav-find-poly-parms) none 14) ;; (move-along-nav-ray! (_type_ nav-ray) none 14) + (initialize-mesh! (_type_) none 15) ;; (try-move-along-ray (_type_ nav-poly vector vector float) meters 15) (move-along-nav-ray! (_type_ nav-ray) none 16) ;; (TODO-RENAME-16 (_type_ vector nav-poly vector symbol float clip-travel-vector-to-mesh-return-info) none 16) - (nav-mesh-method-17 () none 17) ;; (update-route-table (_type_) none 17) + (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) ;; (update-route-table (_type_) none 17) (nav-mesh-method-18 () none 18) ;; (dummy-18 (_type_ int vector int (pointer int8) int) none 18) (nav-mesh-method-19 () none 19) ;; (compute-bounding-box (_type_ vector vector) none 19) (nav-mesh-method-20 () none 20) ;; (debug-draw-poly (_type_ nav-poly rgba) none 20) (nav-mesh-method-21 () none 21) ;; (point-in-poly? (_type_ nav-poly vector) symbol 21) - (nav-mesh-method-22 () none 22) ;; (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) - (nav-mesh-method-23 () none 23) ;; (dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23) - (nav-mesh-method-24 () none 24) ;; (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) - (nav-mesh-method-25 () none 25) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) - (nav-mesh-method-26 () none 26) ;; (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26) - (nav-mesh-method-27 () none 27) ;; (find-poly-fast (_type_ vector meters) nav-poly 27) - (nav-mesh-method-28 () none 28) ;; (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) - (nav-mesh-method-29 () none 29) ;; (is-in-mesh? (_type_ vector float meters) symbol 29) - (nav-mesh-method-30 () none 30) - (nav-mesh-method-31 () none 31) - (nav-mesh-method-32 () none 32) - (nav-mesh-method-33 () none 33) - (nav-mesh-method-34 () none 34) - (nav-mesh-method-35 () none 35) - (nav-mesh-method-36 () none 36) + (nav-mesh-method-22 (_type_ vector vector) none 22) ;; (find-opposite-vertices (_type_ nav-poly nav-poly) uint 22) + (nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) ;; (dummy-23 (_type_ nav-poly vector vector vector nav-route-portal) vector 23) + (nav-mesh-method-24 (_type_) none 24) ;; (closest-point-on-boundary (_type_ nav-poly vector vector) vector 24) + (nav-mesh-method-25 (_type_) none 25) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) none 25) + (nav-mesh-method-26 (_type_) none 26) ;; (project-point-into-tri-2d (_type_ nav-poly vector vector) vector 26) + (new-nav-control (_type_ vector int) nav-control 27) ;; (find-poly-fast (_type_ vector meters) nav-poly 27) + (nav-mesh-method-28 (_type_ object) none 28) ;; (find-poly (_type_ vector meters (pointer nav-control-flags)) nav-poly 28) + (nav-mesh-method-29 (_type_ object symbol) nav-control 29) ;; (is-in-mesh? (_type_ vector float meters) symbol 29) + (nav-mesh-method-30 (_type_ process-drawable) none 30) + (change-to (_type_ process-drawable) none 31) + (nav-mesh-method-32 "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint32) none 32) + (nav-mesh-method-33 "arg1 is a [[nav-mesh-link]] `id`" (_type_ uint32) symbol 33) + (nav-mesh-method-34 (_type_ object vector float) none 34) + (nav-mesh-method-35 + "TODO - Assertion failed: 'std::isfinite(value)' + Source: C:/Users/xtvas/Repositories/opengoal/jak-project/common/util/print_float.cpp:90 + Function: int __cdecl float_to_cstr(float, char *, bool)" + () none 35) + (nav-mesh-method-36 (_type_ nav-poly rgba) none 36) (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 () none 38) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector object) vector 38) (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (nav-mesh-method-40 () none 40) + (nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40) (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (nav-mesh-method-42 () none 42) - (nav-mesh-method-43 () none 43) - (nav-mesh-method-44 () none 44) - (nav-mesh-method-45 () none 45) - (nav-mesh-method-46 () none 46) + (nav-mesh-method-42 (_type_ nav-find-poly-parms) symbol 42) + (nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43) + (nav-mesh-method-44 (_type_ vector float float) symbol 44) + (nav-mesh-method-45 "TODO - asm expression building error" (_type_ entity-perm) none 45) + (nav-mesh-method-46 (_type_ object) none 46) ) ) @@ -20783,27 +20841,27 @@ ) (deftype nav-state (structure) - ((flags nav-state-flag) - (nav basic) ;; ?? - (user-poly nav-poly) - (mesh nav-mesh) - (current-poly nav-poly) - (virtual-current-poly nav-poly) - (next-poly nav-poly) - (target-poly nav-poly) - (rotation-rate float :offset-assert 32) - (speed meters) - (prev-speed meters) - (pad0 uint32 1) - (travel vector :inline :offset-assert 48) - (target-post vector :inline) - (current-pos vector :inline) - (current-pos-local vector :inline) - (virtual-current-pos-local vector :inline) - (velocity vector :inline :offset-assert 128) - (heading vector :inline) - (target-dir vector :inline :offset-assert 160) - (accel vector :inline :offset 160) + ((flags nav-state-flag :offset-assert 0) + (nav basic :offset-assert 4) + (user-poly nav-poly :offset-assert 8) + (mesh nav-mesh :offset-assert 12) + (current-poly nav-poly :offset-assert 16) + (virtual-current-poly nav-poly :offset-assert 20) + (next-poly nav-poly :offset-assert 24) + (target-poly nav-poly :offset-assert 28) ;; wrong + (rotation-rate float :offset-assert 32) + (speed meters :offset-assert 36) + (prev-speed meters :offset-assert 40) + (pad0 uint32 1 :offset-assert 44) + (travel vector :inline :offset-assert 48) + (target-post vector :inline :offset-assert 64) + (current-pos vector :inline :offset-assert 80) + (current-pos-local vector :inline :offset-assert 96) + (virtual-current-pos-local vector :inline :offset-assert 112) + (velocity vector :inline :offset-assert 128) + (heading vector :inline :offset-assert 144) + (target-dir vector :inline :offset-assert 160) + (accel vector :inline :offset 160) ) :method-count-assert 55 :size-assert #xb0 @@ -20874,28 +20932,28 @@ ) (deftype nav-control (structure) - ((flags nav-control-flag) - (callback-info nav-callback-info) - (process process) - (pad0 uint32) - (shape basic) - (nearest-y-threshold meters) - (nav-cull-radius meters) - (sec-per-frame float) - (target-speed meters) - (acceleration meters) - (turning-acceleration meters) - (max-rotation-rate float) - (speed-scale float) - (sphere-count int32) - (sphere-array (inline-array sphere)) ;; guess - (root-sphere-id uint8) - (sphere-mask uint8) - (pad1 uint8 2) - (sphere-id-array uint8 16) - (extra-nav-sphere vector :inline) - (root-nav-sphere vector :inline) - (state nav-state :inline) + ((flags nav-control-flag :offset-assert 0) + (callback-info nav-callback-info :offset-assert 4) + (process process :offset-assert 8) + (pad0 uint32 :offset-assert 12) + (shape collide-shape :offset-assert 16) + (nearest-y-threshold meters :offset-assert 20) + (nav-cull-radius meters :offset-assert 24) + (sec-per-frame float :offset-assert 28) + (target-speed meters :offset-assert 32) + (acceleration meters :offset-assert 36) + (turning-acceleration meters :offset-assert 40) + (max-rotation-rate float :offset-assert 44) + (speed-scale float :offset-assert 48) + (sphere-count int32 :offset-assert 52) + (sphere-array (inline-array sphere) :offset-assert 56) + (root-sphere-id uint8 :offset-assert 60) + (sphere-mask uint8 :offset-assert 61) + (pad1 uint8 2 :offset-assert 62) + (sphere-id-array uint8 16 :offset-assert 64) + (extra-nav-sphere sphere :inline :offset-assert 80) + (root-nav-sphere sphere :inline :offset-assert 96) + (state nav-state :inline :offset-assert 112) ) :method-count-assert 47 :size-assert #x120 @@ -20904,43 +20962,45 @@ (:methods ;; (new (symbol type collide-shape int float) _type_ 0) (nav-control-method-9 () none 9) ;; (debug-draw (_type_) none 9) - (nav-control-method-10 () none 10) ;; (point-in-bounds? (_type_ vector) symbol 10) - (nav-control-method-11 (_type_ vector) vector 11) ;; (dummy-11 (_type_ vector) vector 11) + (point-in-bounds? + "Is the given point ([[vector]]) outside of the [[nav-mesh]]'s `bounds` [[sphere]] radius" + (_type_ vector) symbol 10) + (nav-control-method-11 "TODO" (_type_ vector) vector 11) ;; (dummy-11 (_type_ vector) vector 11) (nav-control-method-12 () none 12) ;; (TODO-RENAME-12 (_type_ nav-gap-info) symbol 12) - (nav-control-method-13 () none 13) ;; (dummy-13 (_type_ vector vector) vector 13) - (nav-control-method-14 () none 14) ;; (set-current-poly! (_type_ nav-poly) none 14) - (nav-control-method-15 () none 15) ;; (set-target-pos! (_type_ vector) none 15) - (nav-control-method-16 () none 16) ;; (dummy-16 (_type_ vector) nav-poly 16) - (nav-control-method-17 () none 17) ;; (project-onto-nav-mesh (_type_ vector vector) vector 17) + (find-poly "TODO" (_type_ vector) nav-poly 13) ;; (dummy-13 (_type_ vector vector) vector 13) + (nav-control-method-14 (_type_ nav-poly vector object vector) none 14) ;; (set-current-poly! (_type_ nav-poly) none 14) + (nav-control-method-15 "TODO - same as 11" (_type_ vector) none 15) ;; (set-target-pos! (_type_ vector) none 15) + (nav-control-method-16 (_type_ vector float) symbol 16) ;; (dummy-16 (_type_ vector) nav-poly 16) + (is-in-mesh? "TODO" (_type_ vector float) symbol 17) ;; (project-onto-nav-mesh (_type_ vector vector) vector 17) (nav-control-method-18 () none 18) ;; (find-poly (_type_ vector) nav-poly 18) (nav-control-method-19 () none 19) ;; (dummy-19 (_type_ vector collide-shape-moving vector float) none 19) (nav-control-method-20 (_type_ vector vector vector int symbol symbol) none 20) ;; (project-point-into-tri-3d (_type_ nav-poly vector vector) vector 20) (nav-control-method-21 () none 21) ;; (TODO-RENAME-21 (_type_ vector) nav-poly 21) (nav-control-method-22 () none 22) ;; (TODO-RENAME-22 (_type_ vector float) symbol 22) - (nav-control-method-23 () none 23) ;; (dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) + (nav-control-method-23 "TODO" (_type_) none 23) ;; (dummy-23 (_type_ vector check-vector-collision-with-nav-spheres-info) float 23) (nav-control-method-24 () none 24) ;; (dummy-24 (_type_ float clip-travel-vector-to-mesh-return-info) none 24) - (nav-control-method-25 () none 25) ;; (is-in-mesh? (_type_ vector float) symbol 25) - (nav-control-method-26 () none 26) ;; (TODO-RENAME-26 (_type_) none 26) - (nav-control-method-27 () none 27) ;; (TODO-RENAME-27 (_type_) none 27) - (nav-control-method-28 () none 28) ;; (TODO-RENAME-28 (_type_ collide-kind) none 28) - (nav-control-method-29 () none 29) ;; (should-display? (_type_) symbol 29) - (nav-control-method-30 () none 30) ;; (dummy-30 (_type_ vector vector vector) sphere 30) - (nav-control-method-31 () none 31) ;; (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31) - (nav-control-method-32 () none 32) ;; (TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32) - (nav-control-method-33 () none 33) ;; (TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33) - (nav-control-method-34 () none 34) ;; (dummy-34 () none 34) - (nav-control-method-35 () none 35) ;; (dummy-35 (_type_ vector vector vector vector float) none 35) - (nav-control-method-36 () none 36) - (nav-control-method-37 () none 37) - (nav-control-method-38 () none 38) - (nav-control-method-39 () none 39) - (nav-control-method-40 () none 40) - (nav-control-method-41 () none 41) - (nav-control-method-42 () none 42) - (nav-control-method-43 () none 43) + (get-max-rotation-rate (_type_) float 25) ;; (is-in-mesh? (_type_ vector float) symbol 25) + (get-sphere-mask (_type_) none 26) ;; (TODO-RENAME-26 (_type_) none 26) + (get-target-speed (_type_) meters 27) ;; (TODO-RENAME-27 (_type_) none 27) + (nav-control-method-28 "TODO - Clears `nav-flags::1` on `shape`'s `flags`" (_type_) none 28) ;; (TODO-RENAME-28 (_type_ collide-kind) none 28) + (nav-control-method-29 "TODO - Sets `nav-flags::1` on `shape`'s `flags`" (_type_) none 29) ;; (should-display? (_type_) symbol 29) + (copy-extra-nav-sphere! "Copies the given [[sphere]] into `extra-nav-sphere`" (_type_ sphere) none 30) ;; (dummy-30 (_type_ vector vector vector) sphere 30) + (set-extra-nav-sphere! "Set the `extra-nav-sphere` with the data in the given [[sphere]]" (_type_ sphere) none 31) ;; (intersect-ray-line-segment? (_type_ vector vector vector vector) symbol 31) + (set-extra-nav-sphere-radius! "Set's `extra-nav-sphere`'s radius" (_type_ float) none 32) ;; (TODO-ASM-32 (_type_ vector vector vector vector float) symbol 32) + (set-nearest-y-thres! "Set `nearest-y-threshold`" (_type_ float) none 33) ;; (TODO-RENAME-33 (_type_ vector vector vector vector float) symbol 33) + (set-nav-cull-radius! "Set `nav-cull-radius`" (_type_ meters) none 34) ;; (dummy-34 () none 34) + (set-speed-scale! "Set `speed-scale`" (_type_ float) none 35) ;; (dummy-35 (_type_ vector vector vector vector float) none 35) + (set-target-speed! "Set `target-speed`" (_type_ meters) none 36) + (set-acceleration! "Set `acceleration`" (_type_ meters) none 37) + (set-turning-acceleration! "Set `turning-acceleration`" (_type_ meters) none 38) + (set-max-rotation-rate! "Set `max-rotation-rate`" (_type_ float) none 39) + (set-sphere-mask! "TODO - probably an enum - Set `sphere-mask`" (_type_ uint) none 40) + (nav-control-method-41 "TODO - calls nav-mesh::28" (_type_) none 41) + (init! "Initializes the [[nav-control]], setting `shape` with the provided [[collide-shape]]" (_type_ collide-shape) none 42) + (display-marks? "Returns if navigation related marks should be displayed" (_type_) symbol 43) (nav-control-method-44 () none 44) - (nav-control-method-45 () none 45) - (nav-control-method-46 () none 46) + (nav-control-method-45 (_type_ vector vector vector) sphere 45) + (find-sphere "TODO" (_type_) none 46) ) ) @@ -21020,7 +21080,7 @@ ) (deftype sphere-hash (grid-hash) - ((sphere-array uint32 :offset-assert 88) + ((sphere-array (inline-array sphere) :offset-assert 88) (max-object-count int16 :offset-assert 92) (pad int16 :offset-assert 94) (mem-sphere-array uint32 :offset-assert 96) @@ -21035,7 +21095,7 @@ (sphere-hash-method-27 () none 27) (sphere-hash-method-28 () none 28) (sphere-hash-method-29 () none 29) - (sphere-hash-method-30 () none 30) + (sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30) (sphere-hash-method-31 () none 31) (sphere-hash-method-32 () none 32) (sphere-hash-method-33 () none 33) @@ -21351,7 +21411,7 @@ ;; (define-extern raw-ray-sphere-intersect function) ;; (function float float) (define-extern ray-sphere-intersect (function vector vector vector float float)) -;; (define-extern ray-circle-intersect function) ;; (function vector vector vector float float) +(define-extern ray-circle-intersect (function vector vector vector float float)) ;; (define-extern ray-cylinder-intersect (function vector vector vector vector float float vector float)) ;; (define-extern ray-plane-intersect function) ;; (function vector vector vector vector vector vector vector float) ;; (define-extern ray-triangle-intersect function) ;; (function vector vector float matrix vector vector float) @@ -22616,7 +22676,7 @@ (define-extern gen-font-12 (function string none)) (define-extern draw-string-asm (function string dma-buffer font-context uint)) (define-extern draw-string (function string dma-buffer font-context draw-string-result)) -(define-extern get-string-length (function string font-context float)) +(define-extern get-string-length (function string font-context draw-string-result)) (define-extern draw-string-xy (function string dma-buffer int int font-color font-flags draw-string-result)) (define-extern draw-string-adv (function string dma-buffer font-context none)) @@ -24899,7 +24959,9 @@ ) |# -;; (define-extern *grid-hash-work* grid-hash-work) +;; TODO remove this after spatial-hash PR merges +(declare-type grid-hash-work basic) +(define-extern *grid-hash-work* grid-hash-work) ;; (define-extern validate-bucket-bits function) ;; (define-extern draw-grid function) ;; (define-extern draw-sphere-box function) @@ -25432,17 +25494,22 @@ :size-assert #x18 :flag-assert #xc00000018 (:methods - (plane-volume-method-9 () none 9) ;; (dummy-9 (_type_ symbol vector-array vector-array) symbol 9) - (plane-volume-method-10 () none 10) ;; (debug-draw (_type_) none 10) - (plane-volume-method-11 () none 11) ;; (dummy-11 (_type_ vector float) symbol 11) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume 9) + (debug-draw (_type_) none 10) + (point-in-vol? + "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" + (_type_ vector float) symbol 11) ) ) +;; +++vol-h:vol-flags (defenum vol-flags :bitfield #t :type uint32 (display?) + (vol-flags-1) ) +;; ---vol-h:vol-flags (deftype vol-control (basic) ((flags vol-flags :offset-assert 4) @@ -25459,8 +25526,8 @@ :flag-assert #xc0000061c (:methods (new (symbol type process-drawable) _type_ 0) - (vol-control-method-9 (_type_) symbol 9) ;; (dummy-9 (_type_) symbol 9) - (vol-control-method-10 (_type_ vector) symbol 10) ;; (dummy-10 (_type_ vector) symbol 10) + (vol-control-method-9 (_type_) none 9) + (vol-control-method-10 (_type_ plane) symbol 10) (should-display? "Returns true/false if the volume's marks should be displayed" (_type_) symbol 11) @@ -25472,235 +25539,234 @@ ;; cam-layout ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype cam-layout-bank (UNKNOWN) - ((spline-t float :offset-assert 4) - (spline-step float :offset-assert 8) - (intro-t float :offset-assert 12) - (intro-step float :offset-assert 16) - (debug-t float :offset-assert 20) - (debug-step float :offset-assert 24) - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 +(deftype cam-layout-bank (basic) + ( + (spline-t float :offset-assert 4) + (spline-step float :offset-assert 8) + (intro-t float :offset-assert 12) + (intro-step float :offset-assert 16) + (debug-t float :offset-assert 20) + (debug-step float :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c ) -|# -#| -(deftype clm-basic (UNKNOWN) +(deftype clm-basic (basic) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 ) -|# -#| -(deftype clm-item-action (UNKNOWN) - ((button uint64 :offset-assert 0) - (options uint64 :offset-assert 8) - (func symbol :offset-assert 16) ;; guessed by decompiler - (parm0 int32 :offset-assert 20) ;; guessed by decompiler - (parm1 symbol :offset-assert 24) ;; guessed by decompiler +(deftype clm-item-action (structure) + ( + (button uint64 :offset-assert 0) + (options uint64 :offset-assert 8) + (func symbol :offset-assert 16) + (parm0 int32 :offset 20) + (parm0-symbol symbol :offset 20) + (parm0-basic basic :offset 20) + (parm1 symbol :offset 24) + (parm1-basic basic :offset 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(deftype clm-item (clm-basic) + ( + (description string :offset-assert 4) + (button-symbol symbol :offset-assert 8) + (action clm-item-action :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype clm-list-item (basic) + ( + (description string :offset-assert 4) + (track-val symbol :offset-assert 8) + (val-func symbol :offset-assert 12) + (val-parm0 int32 :offset 16) + (val-parm0-symbol symbol :offset 16) + (val-parm0-basic basic :offset 16) + (val-parm1 symbol :offset 20) + (val-parm1-basic basic :offset 20) + (actions (array clm-item-action) :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(deftype clm-list (clm-basic) + ( + (tracker symbol :offset-assert 4) + (cur-list-item int32 :offset-assert 8) + (items (array clm-list-item) :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype clm (basic) + ( + (title string :offset-assert 4) + (items (array clm-basic) :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype volume-descriptor-array (inline-array-class) + ((data plane-volume :inline :dynamic :offset 16) ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; field parm0 uses ~A with a signed load field parm1 uses ~A with a signed load + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 ) -|# -#| -(deftype clm-item (UNKNOWN) - ((description string :offset-assert 4) ;; guessed by decompiler - (button-symbol symbol :offset-assert 8) ;; guessed by decompiler - (action clm-item-action :inline :offset-assert 16) - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 +(deftype cam-layout (process) + ( + (cam-entity entity-camera :offset-assert 128) + (num-entities int32 :offset-assert 132) + (cur-entity int32 :offset-assert 136) + (num-volumes int32 :offset-assert 140) + (cur-volume int32 :offset-assert 144) + (first-pvol int32 :offset-assert 148) + (first-cutoutvol int32 :offset-assert 152) + (res-key float :offset-assert 156) ) -|# - -#| -(deftype clm-list-item (UNKNOWN) - ((description string :offset-assert 4) ;; guessed by decompiler - (track-val symbol :offset-assert 8) ;; guessed by decompiler - (val-func symbol :offset-assert 12) ;; guessed by decompiler - (val-parm0 int32 :offset-assert 16) ;; guessed by decompiler - (val-parm1 symbol :offset-assert 20) ;; guessed by decompiler - (actions (array clm-item-action) :offset-assert 24) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; field track-val uses ~A with a signed load field val-parm0 uses ~A with a signed load field val-parm1 uses ~A with a signed load + :method-count-assert 14 + :heap-base #x200 + :size-assert #xa0 + :flag-assert #xe020000a0 + (:states + cam-layout-active) ) -|# -#| -(deftype clm-list (UNKNOWN) - ((tracker symbol :offset-assert 4) ;; guessed by decompiler - (cur-list-item int32 :offset-assert 8) - (items (array clm-list-item) :offset-assert 12) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 +(deftype interp-test-info (structure) + ( + (from vector :inline :offset-assert 0) + (to vector :inline :offset-assert 16) + (origin vector :inline :offset-assert 32) + (color vector4w :offset-assert 48) + (axis vector :offset-assert 52) + (disp string :offset-assert 56) ) -|# - -#| -(deftype clm (UNKNOWN) - ((title string :offset-assert 4) ;; guessed by decompiler - (items (array clm-basic) :offset-assert 8) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c ) -|# -#| -(deftype volume-descriptor-array (UNKNOWN) - ((length int32 :offset-assert 4) - (allocated-length int32 :offset-assert 8) - (data plane-volume :dynamic :offset-assert 16) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 +(deftype clmf-cam-flag-toggle-info (structure) + ( + (key float :offset-assert 0) + (force-on int32 :offset-assert 4) + (force-off int32 :offset-assert 8) ) -|# - -#| -(deftype cam-layout (UNKNOWN) - () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ;; Failed to read fields. + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c ) -|# -#| -(deftype interp-test-info (UNKNOWN) - ((from vector :inline :offset-assert 0) - (to vector :inline :offset-assert 16) - (origin vector :inline :offset-assert 32) - (color vector4w :offset-assert 48) - (axis vector :offset-assert 52) - (disp string :offset-assert 56) ;; guessed by decompiler - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - -#| -(deftype clmf-cam-flag-toggle-info (UNKNOWN) - ((key float :offset-assert 0) - (force-on int32 :offset-assert 4) - (force-off int32 :offset-assert 8) - ) - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 - ) -|# - -;; (define-extern *camera-layout-blink* object) ;; symbol -;; (define-extern *CAM_LAYOUT-bank* cam-layout-bank) ;; cam-layout-bank -;; (define-extern *camera-layout-message-ypos* object) ;; int -;; (define-extern *volume-point-current* object) ;; int -;; (define-extern *volume-point* object) ;; vector-array -;; (define-extern *volume-normal-current* object) ;; int -;; (define-extern *volume-normal* object) ;; vector-array -;; (define-extern *volume-descriptor-current* object) ;; int -;; (define-extern *volume-descriptor* object) ;; vol-control -;; (define-extern cam-layout-print function) ;; (function int int string pointer) -;; (define-extern cam-layout-intersect-dist function) ;; (function vector vector vector float) -;; (define-extern cam-layout-entity-volume-info-create function) ;; (function entity-camera symbol symbol :behavior cam-layout) -;; (define-extern cam-layout-entity-volume-info function) ;; (function symbol :behavior cam-layout) -;; (define-extern v-slrp! function) ;; (function vector vector vector float vector) -;; (define-extern interp-test function) ;; (function (function vector vector vector float vector float none) interp-test-info basic) -;; (define-extern interp-test-deg function) ;; (function (function vector vector vector vector float none) interp-test-info basic) -;; (define-extern cam-layout-entity-info function) ;; (function entity-actor basic) -;; (define-extern clmf-button-test function) ;; (function symbol) -;; (define-extern clmf-bna function) ;; (function symbol) -;; (define-extern clmf-implement function) ;; (function symbol) -;; (define-extern clmf-input function) ;; (function vector vector int vector) -;; (define-extern clmf-pos-rot function) ;; (function symbol symbol symbol :behavior cam-layout) -;; (define-extern clmf-next-volume function) ;; (function int symbol :behavior cam-layout) -;; (define-extern clmf-next-vol-dpad function) ;; (function symbol) -;; (define-extern clmf-to-edit-cam function) ;; (function symbol) -;; (define-extern *last-cur-entity* object) ;; int -;; (define-extern clmf-next-entity function) ;; (function int symbol :behavior cam-layout) -;; (define-extern clmf-to-spline-attr function) ;; (function symbol) -;; (define-extern clmf-to-intro-attr function) ;; (function symbol) -;; (define-extern clmf-to-index-attr function) ;; (function symbol) -;; (define-extern clmf-to-focalpull-attr function) ;; (function symbol) -;; (define-extern clmf-to-edit function) ;; (function symbol :behavior cam-layout) -;; (define-extern clmf-to-select function) ;; (function symbol) -;; (define-extern clmf-look-through function) ;; (function symbol :behavior cam-layout) -;; (define-extern fov->maya function) ;; (function float float) -;; (define-extern cam-layout-save-cam-rot function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-cam-trans function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-pivot function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-align function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-interesting function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-fov function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-focalpull function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-flags function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-focalpull-flags function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-campoints-flags function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-introsplinetime function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-introsplineexitval function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-interptime function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-splineoffset function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-spline-follow-dist-offset function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-campointsoffset function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-tiltAdjust function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-stringMinLength function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-stringMaxLength function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-stringMinHeight function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-stringMaxHeight function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-stringCliffHeight function) ;; (function symbol string entity-actor string) -;; (define-extern cam-layout-save-maxAngle function) ;; (function symbol string entity-actor string) -;; (define-extern clmf-save-single function) ;; (function entity-camera symbol symbol file-stream :behavior cam-layout) -;; (define-extern clmf-save-one function) ;; (function symbol symbol :behavior cam-layout) -;; (define-extern clmf-save-all function) ;; (function symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-flag-toggle function) ;; (function int int symbol :behavior cam-layout) -;; (define-extern clmf-cam-flag function) ;; (function string uint uint symbol :behavior cam-layout) -;; (define-extern clmf-cam-float-adjust function) ;; (function symbol (pointer float) symbol :behavior cam-layout) -;; (define-extern clmf-cam-meters function) ;; (function meters symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-fov function) ;; (function degrees symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-deg function) ;; (function degrees symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-intro-time function) ;; (function float symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-interp-time function) ;; (function float symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-float function) ;; (function float symbol symbol :behavior cam-layout) -;; (define-extern clmf-cam-string function) ;; (function string symbol symbol :behavior cam-layout) -;; (define-extern *clm-focalpull-attr* clm) ;; clm -;; (define-extern *clm-index-attr* clm) ;; clm -;; (define-extern *clm-intro-attr* clm) ;; clm -;; (define-extern *clm-spline-attr* clm) ;; clm -;; (define-extern *clm-cam-attr* clm) ;; clm -;; (define-extern *clm-cam-lookthrough* clm) ;; clm -;; (define-extern *clm-edit* clm) ;; clm -;; (define-extern *clm-save-all* clm) ;; clm -;; (define-extern *clm-save-one* clm) ;; clm -;; (define-extern *clm-select* clm) ;; clm -;; (define-extern *clm* object) ;; clm -;; (define-extern cam-layout-do-action function) ;; (function clm-item-action symbol :behavior cam-layout) -;; (define-extern cam-layout-function-call function) ;; (function symbol string int basic symbol :behavior cam-layout) -;; (define-extern cam-layout-do-menu function) ;; (function clm none :behavior cam-layout) -;; (define-extern cam-layout-active state) ;; (state cam-layout) -;; (define-extern cam-layout-init function) ;; (function none :behavior cam-layout) +(define-extern *camera-layout-blink* symbol) ;; +(define-extern *CAM_LAYOUT-bank* cam-layout-bank) ;; cam-layout-bank +(define-extern *camera-layout-message-ypos* int) ;; int +(define-extern *volume-point-current* int) ;; int +(define-extern *volume-point* vector-array) ;; vector-array +(define-extern *volume-normal-current* int) ;; int +(define-extern *volume-normal* vector-array) ;; vector-array +(define-extern *volume-descriptor-current* int) ;; int +(define-extern *volume-descriptor* vol-control) ;; vol-control +(define-extern cam-layout-print (function int int string pointer)) ;; +(define-extern cam-layout-intersect-dist (function vector vector vector float)) ;; +(define-extern cam-layout-entity-volume-info-create (function entity-camera symbol symbol :behavior cam-layout)) ;; +(define-extern cam-layout-entity-volume-info (function symbol :behavior cam-layout)) ;; +(define-extern v-slrp! (function vector vector vector float vector)) ;; +(define-extern interp-test (function (function vector vector vector float vector float none) interp-test-info none)) ;; +(define-extern interp-test-deg (function (function vector vector vector vector float none) interp-test-info none)) ;; +(define-extern cam-layout-entity-info (function entity-actor none)) ;; +(define-extern clmf-button-test "Displays the message `button test`" (function symbol)) ;; +(define-extern clmf-bna "Displays the message `button not available`" (function symbol)) ;; +(define-extern clmf-implement "Displays the message `button not implemented yet`" (function symbol)) ;; +(define-extern clmf-input (function vector vector int vector)) ;; +(define-extern clmf-pos-rot (function symbol symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-next-volume (function int symbol :behavior cam-layout)) ;; +(define-extern clmf-next-vol-dpad (function symbol)) ;; +(define-extern clmf-to-edit-cam (function symbol)) ;; +(define-extern *last-cur-entity* int) ;; int +(define-extern clmf-next-entity (function int symbol :behavior cam-layout)) ;; +(define-extern clmf-to-spline-attr (function symbol)) ;; +(define-extern clmf-to-intro-attr (function symbol)) ;; +(define-extern clmf-to-index-attr (function symbol)) ;; +(define-extern clmf-to-focalpull-attr (function symbol)) ;; (function symbol) +(define-extern clmf-to-edit (function symbol :behavior cam-layout)) ;; +(define-extern clmf-to-select (function symbol)) ;; (function symbol) +(define-extern clmf-look-through (function symbol :behavior cam-layout)) ;; +(define-extern fov->maya (function float float)) ;; +(define-extern cam-layout-save-cam-rot (function symbol string entity-actor none)) ;; +(define-extern cam-layout-save-cam-trans (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-pivot (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-align (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-interesting (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-fov (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-focalpull (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-flags (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-focalpull-flags (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-campoints-flags (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-introsplinetime (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-introsplineexitval (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-interptime (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-splineoffset (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-spline-follow-dist-offset (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-campointsoffset (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-tiltAdjust (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-stringMinLength (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-stringMaxLength (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-stringMinHeight (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-stringMaxHeight (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-stringCliffHeight (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern cam-layout-save-maxAngle (function symbol string entity-actor none)) ;; (function symbol string entity-actor string) +(define-extern clmf-save-single (function entity-camera symbol symbol file-stream :behavior cam-layout)) ;; +(define-extern clmf-save-one (function symbol symbol :behavior cam-layout)) ;; (function symbol symbol :behavior cam-layout) +(define-extern clmf-save-all (function symbol symbol :behavior cam-layout)) ;; (function symbol symbol :behavior cam-layout) +(define-extern clmf-cam-flag-toggle (function int int symbol :behavior cam-layout)) ;; (function int int symbol :behavior cam-layout) +(define-extern clmf-cam-flag (function string uint uint symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-float-adjust (function symbol (pointer float) symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-meters (function meters symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-fov (function degrees symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-deg (function degrees symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-intro-time (function float symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-interp-time (function float symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-float (function float symbol symbol :behavior cam-layout)) ;; +(define-extern clmf-cam-string (function string symbol symbol :behavior cam-layout)) ;; +(define-extern *clm-focalpull-attr* clm) ;; clm +(define-extern *clm-index-attr* clm) ;; clm +(define-extern *clm-intro-attr* clm) ;; clm +(define-extern *clm-spline-attr* clm) ;; clm +(define-extern *clm-cam-attr* clm) ;; clm +(define-extern *clm-cam-lookthrough* clm) ;; clm +(define-extern *clm-edit* clm) ;; clm +(define-extern *clm-save-all* clm) ;; clm +(define-extern *clm-save-one* clm) ;; clm +(define-extern *clm-select* clm) ;; clm +(define-extern *clm* clm) ;; clm +(define-extern cam-layout-do-action (function clm-item-action symbol :behavior cam-layout)) ;; +(define-extern cam-layout-function-call (function symbol string int basic symbol :behavior cam-layout)) ;; +(define-extern cam-layout-do-menu (function clm symbol :behavior cam-layout)) ;; +(define-extern cam-layout-active (state cam-layout)) ;; +(define-extern cam-layout-init (function object :behavior cam-layout)) ;; (define-extern cam-layout-stop (function symbol)) (define-extern cam-layout-start (function symbol)) -(define-extern cam-layout-restart (function none)) +(define-extern cam-layout-restart (function symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; cam-debug ;; @@ -27528,6 +27594,8 @@ :method-count-assert 9 :size-assert #x44 :flag-assert #x900000044 + (:methods + (new (symbol type) _type_ 0)) ) (deftype debug-menu-node (basic) @@ -27552,6 +27620,8 @@ :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 + (:methods + (new (symbol type debug-menu-context string) _type_ 0)) ) (deftype debug-menu-item (debug-menu-node) @@ -27568,6 +27638,8 @@ :method-count-assert 9 :size-assert #x1c :flag-assert #x90000001c + (:methods + (new (symbol type string debug-menu) _type_ 0)) ) (deftype debug-menu-item-function (debug-menu-item) @@ -27577,8 +27649,11 @@ :method-count-assert 9 :size-assert #x1d :flag-assert #x90000001d + (:methods + (new (symbol type string object (function object object)) _type_ 0)) ) +;; +++debug-h:debug-menu-msg (defenum debug-menu-msg :type int32 (activate 1) @@ -27586,6 +27661,7 @@ (update 3) (press 4) ) +;; ---debug-h:debug-menu-msg (deftype debug-menu-item-flag (debug-menu-item) ((activate-func (function object debug-menu-msg object) :offset-assert 24) ;; guessed by decompiler @@ -27594,6 +27670,8 @@ :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 + (:methods + (new (symbol type string object (function object debug-menu-msg object)) _type_ 0)) ) (deftype debug-menu-item-var (debug-menu-item) @@ -27627,51 +27705,55 @@ :method-count-assert 9 :size-assert #x64 :flag-assert #x900000064 + (:methods + (new (symbol type string int int) _type_ 0)) ) +;; +++debug-h:debug-menu-dest (defenum debug-menu-dest :type int32 (activation 0) (root 1) (open-menus 2) (current-selection 3)) +;; ---debug-h:debug-menu-dest -;; (define-extern debug-menu-item-var-update-display-str function) ;; (function debug-menu-item-var debug-menu-item-var) +(define-extern debug-menu-item-var-update-display-str (function debug-menu-item-var debug-menu-item-var)) ;; (define-extern debug-menu-item-var-make-int (function debug-menu-item-var (function int debug-menu-msg int int int) int symbol int int symbol debug-menu-item-var)) (define-extern debug-menu-item-var-make-float (function debug-menu-item-var (function int debug-menu-msg float float float) float symbol float float int debug-menu-item-var)) -;; (define-extern debug-menu-context-grab-joypad function) ;; (function debug-menu-context basic (function basic none) symbol) -;; (define-extern debug-menu-context-release-joypad function) ;; (function debug-menu-context symbol) -;; (define-extern debug-menu-item-get-max-width function) ;; (function debug-menu-item debug-menu int) -;; (define-extern debug-menu-context-default-selection function) ;; (function debug-menu-context symbol debug-menu-context) -;; (define-extern debug-menu-rebuild function) ;; (function debug-menu debug-menu) +(define-extern debug-menu-context-grab-joypad (function debug-menu-context basic (function basic none) symbol)) ;; +(define-extern debug-menu-context-release-joypad (function debug-menu-context symbol)) ;; +(define-extern debug-menu-item-get-max-width (function debug-menu-item debug-menu int)) ;; +(define-extern debug-menu-context-default-selection (function debug-menu-context symbol debug-menu-context)) ;; +(define-extern debug-menu-rebuild (function debug-menu debug-menu)) ;; (define-extern debug-menu-context-set-root-menu (function debug-menu-context debug-menu debug-menu-context)) (define-extern debug-menu-append-item (function debug-menu debug-menu-node debug-menu-node)) (define-extern debug-menu-remove-all-items (function debug-menu debug-menu)) -;; (define-extern debug-menu-func-decode function) ;; (function object function) +(define-extern debug-menu-func-decode (function object function)) ;; (define-extern debug-menu-make-from-template (function debug-menu-context pair debug-menu-node)) (define-extern debug-menu-find-from-template (function debug-menu-context pair debug-menu)) -;; (define-extern debug-menu-item-submenu-render function) ;; (function debug-menu-item-submenu int int int symbol debug-menu-item-submenu) -;; (define-extern debug-menu-item-function-render function) ;; (function debug-menu-item-function int int int symbol debug-menu-item-function) -;; (define-extern debug-menu-item-flag-render function) ;; (function debug-menu-item-flag int int int symbol debug-menu-item-flag) -;; (define-extern debug-menu-item-var-render function) ;; (function debug-menu-item-var int int int symbol debug-menu-item-var) -;; (define-extern debug-menu-item-render function) ;; (function debug-menu-item int int int symbol debug-menu-item) -;; (define-extern debug-menu-render function) ;; (function debug-menu int int debug-menu-node int debug-menu) -;; (define-extern debug-menu-context-render function) ;; (function debug-menu-context debug-menu-context) -;; (define-extern debug-menu-context-select-next-or-prev-item function) ;; (function debug-menu-context int debug-menu-context) -;; (define-extern debug-menu-context-select-new-item function) ;; (function debug-menu-context int debug-menu-context) -;; (define-extern debug-menu-context-open-submenu function) ;; (function debug-menu-context debug-menu basic) -;; (define-extern debug-menu-context-close-submenu function) ;; (function debug-menu-context debug-menu-context) -;; (define-extern debug-menu-item-submenu-msg function) ;; (function debug-menu-item-submenu debug-menu-msg debug-menu-item-submenu) -;; (define-extern debug-menu-item-function-msg function) ;; (function debug-menu-item-function debug-menu-msg debug-menu-item-function) -;; (define-extern debug-menu-item-flag-msg function) ;; (function debug-menu-item-flag debug-menu-msg debug-menu-item-flag) -;; (define-extern debug-menu-item-var-joypad-handler function) ;; (function debug-menu-item-var debug-menu-item-var) -;; (define-extern debug-menu-item-var-msg function) ;; (function debug-menu-item-var debug-menu-msg debug-menu-item-var) -;; (define-extern debug-menu-item-send-msg function) ;; (function debug-menu-item debug-menu-msg debug-menu-item) -;; (define-extern debug-menu-send-msg function) ;; (function debug-menu debug-menu-msg symbol debug-menu) +(define-extern debug-menu-item-submenu-render (function debug-menu-item-submenu int int int symbol debug-menu-item-submenu)) ;; +(define-extern debug-menu-item-function-render (function debug-menu-item-function int int int symbol debug-menu-item-function)) ;; +(define-extern debug-menu-item-flag-render (function debug-menu-item-flag int int int symbol debug-menu-item-flag)) ;; +(define-extern debug-menu-item-var-render (function debug-menu-item-var int int int symbol debug-menu-item-var)) ;; +(define-extern debug-menu-item-render (function debug-menu-item int int int symbol debug-menu-item)) ;; +(define-extern debug-menu-render (function debug-menu int int debug-menu-node int debug-menu)) ;; +(define-extern debug-menu-context-render (function debug-menu-context debug-menu-context)) ;; +(define-extern debug-menu-context-select-next-or-prev-item (function debug-menu-context int debug-menu-context)) ;; +(define-extern debug-menu-context-select-new-item (function debug-menu-context int debug-menu-context)) ;; +(define-extern debug-menu-context-open-submenu (function debug-menu-context debug-menu basic)) ;; +(define-extern debug-menu-context-close-submenu (function debug-menu-context debug-menu-context)) ;; +(define-extern debug-menu-item-submenu-msg (function debug-menu-item-submenu debug-menu-msg debug-menu-item-submenu)) ;; +(define-extern debug-menu-item-function-msg (function debug-menu-item-function debug-menu-msg debug-menu-item-function)) ;; +(define-extern debug-menu-item-flag-msg (function debug-menu-item-flag debug-menu-msg debug-menu-item-flag)) ;; +(define-extern debug-menu-item-var-joypad-handler (function debug-menu-item-var debug-menu-msg debug-menu-item-var)) ;; +(define-extern debug-menu-item-var-msg (function debug-menu-item-var debug-menu-msg debug-menu-item-var)) ;; +(define-extern debug-menu-item-send-msg (function debug-menu-item debug-menu-msg debug-menu-item)) ;; +(define-extern debug-menu-send-msg (function debug-menu debug-menu-msg symbol debug-menu)) ;; (define-extern debug-menu-context-send-msg (function debug-menu-context debug-menu-msg debug-menu-dest debug-menu-context)) -;; (define-extern debug-menu-context-activate-selection function) ;; (function debug-menu-context debug-menu-context) -;; (define-extern debug-menus-default-joypad-func function) ;; (function debug-menu-context debug-menu-context) -;; (define-extern debug-menus-active function) ;; (function debug-menu-context debug-menu-context) +(define-extern debug-menu-context-activate-selection (function debug-menu-context debug-menu-context)) ;; +(define-extern debug-menus-default-joypad-func (function debug-menu-context debug-menu-context)) ;; +(define-extern debug-menus-active (function debug-menu-context debug-menu-context)) ;; (define-extern debug-menus-handler (function debug-menu-context debug-menu-context)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -27902,8 +27984,8 @@ (define-extern entity-by-type (function type entity-actor)) (define-extern entity-by-aid (function uint entity)) ;; (define-extern entity-actor-from-level-name function) -;; (define-extern entity-nav-mesh-by-aid function) -;; (define-extern nav-mesh-from-res-tag function) +(define-extern entity-nav-mesh-by-aid (function actor-id entity-nav-mesh)) +(define-extern nav-mesh-from-res-tag (function entity symbol int nav-mesh)) ;; (define-extern entity-by-meters function) ;; (function float float float entity-actor) ;; (define-extern process-by-ename function) ;; (function string process) ;; (define-extern entity-process-count function) ;; (function symbol int) @@ -27943,50 +28025,48 @@ ;; vol ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern plane-volume-intersect-dist function) ;; (function vector vector vector float) +(define-extern plane-volume-intersect-dist (function vector vector vector float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-mesh ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-engine-spr-buffer (structure) ((mem-addr uint32 :offset-assert 0) - (mem-nav uint32 :offset-assert 0) + (mem-nav uint32 :offset 0) (spr-addr uint32 :offset-assert 4) - (spr-nav uint32 :offset-assert 4) + (spr-nav uint32 :offset 4) (q-size uint32 :offset-assert 8) (i-nav uint8 :offset-assert 12) (done int8 :offset-assert 13) (nav-count int8 :offset-assert 14) (i-pass int8 :offset-assert 15) ) + :pack-me :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype nav-engine (structure) ((spr-addr uint32 :offset-assert 0) (nav-work-addr uint32 :offset-assert 4) - (nav-mesh-addr uint32 :offset-assert 8) + (nav-mesh-addr nav-mesh :offset-assert 8) (poly-array-addr uint32 :offset-assert 12) (hash-sphere-addr uint32 :offset-assert 16) (hash-buckets-addr uint32 :offset-assert 20) (buf-nav-control-count int8 :offset-assert 24) (max-pass-count int8 :offset-assert 25) (output-sphere-hash uint8 :offset-assert 26) - (work-buf-array UNKNOWN 3 :offset-assert 28) - (spr-work nav-mesh-work :offset-assert 4) + (work-buf-array nav-engine-spr-buffer 3 :inline :offset-assert 28) + (spr-work nav-mesh-work :offset 4) (mem-work nav-mesh-work :offset-assert 76) - (spr-mesh basic :offset-assert 8) - (mem-mesh basic :offset-assert 80) - (spr-poly-array uint32 :offset-assert 12) - (mem-poly-array uint32 :offset-assert 84) - (hash-sphere-list uint32 :offset-assert 16) - (hash-buckets uint32 :offset-assert 20) + (spr-mesh basic :offset 8) + (mem-mesh nav-mesh :offset-assert 80) + (spr-poly-array uint32 :offset 12) + (mem-poly-array (inline-array nav-poly) :offset-assert 84) + (hash-sphere-list uint32 :offset 16) + (hash-buckets uint32 :offset 20) (to-spr-wait uint32 :offset-assert 88) (from-spr-wait uint32 :offset-assert 92) ) @@ -27994,65 +28074,68 @@ :size-assert #x60 :flag-assert #x1600000060 (:methods - (nav-engine-method-9 () none 9) - (nav-engine-method-10 () none 10) - (nav-engine-method-11 () none 11) - (nav-engine-method-12 () none 12) - (nav-engine-method-13 () none 13) - (nav-engine-method-14 () none 14) - (nav-engine-method-15 () none 15) - (nav-engine-method-16 () none 16) - (nav-engine-method-17 () none 17) - (nav-engine-method-18 () none 18) - (nav-engine-method-19 () none 19) + (inc-spr-addr! "Adds the given integer to `spr-addr` and returns it" (_type_ uint) uint 9) + (nav-engine-method-10 (_type_ object) none 10) + (nav-engine-method-11 (_type_) none 11) + (nav-engine-method-12 (_type_ nav-mesh object) none 12) + (nav-engine-method-13 (_type_) none 13) + (nav-engine-method-14 (_type_) none 14) + (nav-engine-method-15 (_type_) none 15) + (update-nav-controls-in-spr (_type_) none 16) + (nav-engine-method-17 (_type_ nav-engine-spr-buffer) none 17) + (nav-engine-method-18 (_type_ nav-engine-spr-buffer) none 18) + (nav-engine-method-19 (_type_ nav-engine-spr-buffer) none 19) (nav-engine-method-20 () none 20) (nav-engine-method-21 () none 21) ) ) -|# -;; (define-extern *debug-nav-control-output* object) -;; (define-extern *debug-nav-control* object) -;; (define-extern *debug-nav-mesh-output* object) -;; (define-extern *debug-nav-ray* object) ;; nav-ray -;; (define-extern *debug-ray-offset* object) ;; vector -;; (define-extern *debug-offset* object) ;; vector -;; (define-extern *nav-mesh-work* object) -;; (define-extern *default-nav-mesh* nav-mesh) ;; nav-mesh -;; (define-extern nav-mesh-connect-from-ent function) -;; (define-extern connection-validate function) -;; (define-extern connection-list-validate function) -;; (define-extern nav-control-validate function) -;; (define-extern debug-validate-nav-poly function) -;; (define-extern nav-dma-send-to-spr-no-flush function) -;; (define-extern nav-dma-send-from-spr-no-flush function) -;; (define-extern inc-mod3 function) ;; (function int int) -;; (define-extern nav-state-patch-pointers function) -;; (define-extern vu-point-triangle-intersection? function) ;; (function vector vector vector vector symbol) -;; (define-extern poly-in-height-range? function) -;; (define-extern init-ray-local function) ;; (function nav-ray nav-poly vector vector symbol) -;; (define-extern init-ray-dir-local function) ;; (function nav-ray nav-poly vector vector float symbol) -;; (define-extern nav-ray-test function) ;; (function nav-mesh nav-poly vector vector meters) -;; (define-extern point-poly-distance-min function) -;; (define-extern nav-mesh-route-table-bit-index function) -;; (define-extern ray-ccw-line-segment-intersection? function) ;; (function vector vector vector vector symbol) -;; (define-extern ray-line-segment-intersection? function) ;; (function vector vector vector vector symbol) -;; (define-extern plane-height-at-xz-point function) -;; (define-extern nav-normal-from-3-points function) -;; (define-extern get-nav-mesh function) -;; (define-extern find-nearest-nav-mesh function) -;; (define-extern point-to-poly-boundary function) +(define-extern *debug-nav-control-output* symbol) +(define-extern *debug-nav-control* symbol) +(define-extern *debug-nav-mesh-output* symbol) +(define-extern *debug-nav-ray* nav-ray) ;; nav-ray +(define-extern *debug-ray-offset* vector) ;; vector +(define-extern *debug-offset* vector) ;; vector +(define-extern *nav-mesh-work* nav-mesh-work) +(define-extern *default-nav-mesh* nav-mesh) ;; nav-mesh +(define-extern nav-mesh-connect-from-ent (function entity-nav-mesh none)) +(define-extern connection-validate (function connection none)) +(define-extern connection-list-validate (function (inline-array connection) none)) +(define-extern nav-control-validate (function nav-control none)) +(define-extern debug-validate-nav-poly (function nav-mesh-link nav-poly none)) +(define-extern nav-dma-send-to-spr-no-flush (function object object object none)) +(define-extern nav-dma-send-from-spr-no-flush (function none)) +;; TODO - local vars and docstrings "Increments and returns the provided [[int]], if the value exceeds `2`, wrap back to `0`" +(define-extern inc-mod3 (function int int)) ;; +(define-extern nav-state-patch-pointers (function none)) +(define-extern vu-point-triangle-intersection? (function vector vector vector vector symbol)) ;; +(define-extern poly-in-height-range? (function nav-poly float float symbol)) +(define-extern init-ray-local (function nav-ray nav-poly vector vector none)) ;; +(define-extern init-ray-dir-local (function nav-ray nav-poly vector vector float none)) ;; +(define-extern nav-ray-test (function nav-mesh nav-poly vector vector meters)) ;; +(define-extern point-poly-distance-min (function nav-poly none)) +(define-extern nav-mesh-route-table-bit-index (function nav-mesh uint int int)) +(define-extern ray-ccw-line-segment-intersection? (function vector vector vector vector symbol)) ;; +(define-extern ray-line-segment-intersection? (function vector vector vector vector symbol)) ;; +(define-extern plane-height-at-xz-point (function plane vector float)) +(define-extern nav-normal-from-3-points (function vector vector vector vector none)) +(define-extern get-nav-mesh (function actor-id nav-mesh)) +(define-extern find-nearest-nav-mesh (function vector float nav-mesh)) +;; (define-extern point-to-poly-boundary +;; "TODO - assertion: +;; Assertion failed: 'std::isfinite(value)' +;; Source: C:/Users/xtvas/Repositories/opengoal/jak-project/common/util/print_float.cpp:90" +;; (function nav-poly object vector object none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nav-control ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype nav-control-cfs-work (structure) ((in-dir vector :inline :offset-assert 0) (right-dir vector :inline :offset-assert 16) - (best-dir vector 2 :offset-assert 32) ;; guessed by decompiler - (temp-dir vector 2 :offset-assert 64) ;; guessed by decompiler + (best-dir vector 2 :inline :offset-assert 32) ;; guessed by decompiler + (temp-dir vector 2 :inline :offset-assert 64) ;; guessed by decompiler (away-dir vector :inline :offset-assert 96) (best-dir-angle degrees 2 :offset-assert 112) ;; guessed by decompiler (ignore-mask uint64 :offset-assert 120) @@ -28073,18 +28156,25 @@ :size-assert #xc0 :flag-assert #x9000000c0 ) -|# -;; (define-extern *nav-triangle-test-count* object) ;; int -;; (define-extern *nav-last-triangle-test-count* object) ;; int -;; (define-extern debug-nav-validate-current-poly function) ;; (function nav-mesh nav-poly vector symbol) -;; (define-extern debug-report-nav-stats function) ;; (function none) -;; (define-extern get-nav-control function) -;; (define-extern add-nav-sphere function) ;; (function nav-control vector none) -;; (define-extern add-collide-shape-spheres function) ;; (function nav-control collide-shape vector none) -;; (define-extern circle-tangent-directions function) ;; (function vector vector vector vector vector) -;; (define-extern circle-ray-intersection? function) -;; (define-extern find-closest-circle-ray-intersection function) ;; (function vector vector float int (inline-array vector) int int) +(define-extern *nav-triangle-test-count* int) ;; int +(define-extern *nav-last-triangle-test-count* int) ;; int +(define-extern debug-nav-validate-current-poly (function nav-mesh nav-poly vector symbol)) +(define-extern debug-report-nav-stats "Does nothing" (function none)) +(define-extern get-nav-control + "Given a [[process-drawable]] return the associated [[nav-control]] using either: + - the provided `nav-mesh` arg + - the `nav-mesh` associated with the [[process-drawable]]'s [[entity]] + If no [[nav-mesh]] is set or found, set the [[entity]]'s [[entity-perm-status]] to TODO and return an error" + (function process-drawable nav-mesh nav-control)) +(define-extern add-nav-sphere + "Adds the given [[sphere]] to the [[nav-control]]'s `sphere-array` so long as + `max-spheres` is less than [[nav-control]]'s `sphere-count`" + (function nav-control sphere int none)) +(define-extern add-collide-shape-spheres (function nav-control collide-shape sphere none)) ;; +(define-extern circle-tangent-directions (function vector vector vector vector vector)) ;; +(define-extern circle-ray-intersection? (function vector vector float vector symbol)) +(define-extern find-closest-circle-ray-intersection (function vector vector float int (inline-array vector) int int)) ;; ;; (define-extern compute-dir-parm function) ;; (function vector vector vector float) ;; (define-extern vector-rotate-y-sincos! function) ;; (define-extern test-xz-point-on-line-segment? function) ;; (function vector vector vector float symbol) @@ -29962,7 +30052,7 @@ (define-extern dm-cam-settings-func (function cam-slave-options debug-menu-msg symbol)) (define-extern dm-cam-settings-func-int (function int debug-menu-msg int int int)) (define-extern dm-cam-externalize (function symbol debug-menu-msg symbol)) -;; (define-extern dm-cam-setting-float (function float debug-menu-msg symbol)) ;; TODO - causes decomp hang +(define-extern dm-cam-setting-float (function float debug-menu-msg float float float)) ;; TODO - omit the last 2 args and set the return type to `none` to get a hang (define-extern dm-cam-render-float (function int debug-menu-msg float float float)) (define-extern dm-subdiv-float (function symbol debug-menu-msg float float float)) (define-extern dm-subdiv-int (function symbol debug-menu-msg int int int)) @@ -30073,7 +30163,7 @@ (define-extern dm-play-task-with-continue (function game-task string none)) (define-extern dm-play-task (function game-task none)) (define-extern dm-play-race (function race-selection symbol none)) -(define-extern debug-menu-make-play-menu (function symbol none)) ;; TODO - need to figure out game-info more +(define-extern debug-menu-make-play-menu (function symbol none)) (define-extern dm-anim-tester-flag-func (function int debug-menu-msg symbol)) (define-extern dm-anim-tester-func (function int debug-menu-msg symbol)) (define-extern dm-pilot-mode "TODO - what is the third arg to target's change-mode?" (function object none)) diff --git a/decompiler/config/jak2/anonymous_function_types.jsonc b/decompiler/config/jak2/anonymous_function_types.jsonc index 2045b794c6..dbac05e81a 100644 --- a/decompiler/config/jak2/anonymous_function_types.jsonc +++ b/decompiler/config/jak2/anonymous_function_types.jsonc @@ -220,7 +220,7 @@ [189, "(function none)"], [190, "(function none)"], [191, "(function symbol debug-menu-msg float float float)"], - [193, "(function symbol int object)"], + [193, "(function symbol debug-menu-msg object)"], [198, "(function debug-menu debug-menu symbol)"], [199, "(function debug-menu debug-menu symbol)"], [200, "(function debug-menu debug-menu symbol)"], diff --git a/decompiler/config/jak2/hacks.jsonc b/decompiler/config/jak2/hacks.jsonc index a6a2823ce5..5f92ae4789 100644 --- a/decompiler/config/jak2/hacks.jsonc +++ b/decompiler/config/jak2/hacks.jsonc @@ -58,7 +58,6 @@ "(method 224 bot)", "(method 77 rapid-gunner)", // until loop without nop: - "cam-layout-entity-volume-info-create", "process-drawable-shock-skel-effect", "target-history-print", "display-list-control", @@ -196,6 +195,13 @@ "debug-menu-context-make-default-menus", "debug-menu-make-task-menu", "(method 19 gui-control)", + // menu + "debug-menu-rebuild", + "debug-menu-find-from-template", + "debug-menu-render", + "debug-menu-context-select-next-or-prev-item", + "debug-menu-context-select-new-item", + "debug-menu-send-msg", // airlock "(method 24 com-airlock)", "(method 19 gui-control)", @@ -241,7 +247,17 @@ "(method 11 perf-stat)": [0], "(method 22 gui-control)": [117, 121, 127, 128, 129, 139], "bsp-camera-asm": [1, 2, 3, 4, 6, 7], - "level-remap-texture": [2, 3, 4, 5, 6] + "level-remap-texture": [2, 3, 4, 5, 6], + "(method 27 nav-mesh)": [0, 1, 2, 4, 5], + "(method 31 nav-mesh)": [0, 1, 2, 7, 8, 9, 11, 12, 13, 15], + "(method 45 nav-mesh)": [1, 4, 5, 8], + "(method 46 nav-mesh)": [1, 2, 3, 5], + "(method 32 nav-mesh)": [0, 1, 2, 4], + "(method 33 nav-mesh)": [0, 1, 2, 4], + "(method 42 nav-mesh)": [1, 2, 3, 7], + "point-poly-distance-min": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], + "(method 34 nav-mesh)": [1, 2, 3, 7], + "(method 35 nav-mesh)": [2, 4] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -255,7 +271,9 @@ "collide-do-primitives", "moving-sphere-triangle-intersect", "calc-animation-from-spr", - "draw-string-asm", "draw-string", "get-string-length", + "draw-string-asm", + "draw-string", + "get-string-length", "init-boundary-regs" ], diff --git a/decompiler/config/jak2/label_types.jsonc b/decompiler/config/jak2/label_types.jsonc index 909391388f..8e376702a3 100644 --- a/decompiler/config/jak2/label_types.jsonc +++ b/decompiler/config/jak2/label_types.jsonc @@ -166,5 +166,23 @@ ["L479", "vector"], ["L474", "vector"] ], - "merc-vu1": [["L1", "vu-function"]] + "merc-vu1": [["L1", "vu-function"]], + "cam-layout": [ + ["L784", "vector4w"], // needed or it guesses pointer and hits an assert + ["L791", "vector4w"], + ["L793", "vector4w"], + ["L795", "vector4w"], + ["L797", "vector4w"], + ["L799", "vector4w"], + ["L801", "vector4w"], + ["L888", "(pointer uint64)", 1], + ["L891", "(pointer uint64)", 1], + ["L892", "(pointer uint64)", 1], + ["L893", "(pointer uint64)", 1], + ["L894", "(pointer uint64)", 1], + ["L895", "(pointer uint64)", 1], + ["L896", "(pointer uint64)", 1], + ["L897", "(pointer uint64)", 1] + ], + "nav-mesh": [["L347", "(inline-array vector)", 2]] } diff --git a/decompiler/config/jak2/stack_structures.jsonc b/decompiler/config/jak2/stack_structures.jsonc index 3db8e724e5..5bf580c982 100644 --- a/decompiler/config/jak2/stack_structures.jsonc +++ b/decompiler/config/jak2/stack_structures.jsonc @@ -227,9 +227,7 @@ [112, "vector"], [128, "vector"] ], - "add-debug-sphere-with-transform": [ - [16, "vector"] - ], + "add-debug-sphere-with-transform": [[16, "vector"]], "add-debug-line-sphere": [ [48, "matrix"], [112, "matrix"], @@ -244,15 +242,9 @@ [16, "vector"], [32, "vector"] ], - "add-debug-vector": [ - [16, "vector"] - ], - "add-debug-quaternion": [ - [16, "matrix"] - ], - "add-debug-yrot-vector": [ - [16, "vector"] - ], + "add-debug-vector": [[16, "vector"]], + "add-debug-quaternion": [[16, "matrix"]], + "add-debug-yrot-vector": [[16, "vector"]], "add-debug-arc": [ [16, "vector"], [32, "vector"] @@ -261,15 +253,9 @@ [16, "vector"], [32, "vector"] ], - "add-debug-points": [ - [16, "vector"] - ], - "add-debug-light": [ - [16, "vector"] - ], - "add-debug-cursor": [ - [16, "vector"] - ], + "add-debug-points": [[16, "vector"]], + "add-debug-light": [[16, "vector"]], + "add-debug-cursor": [[16, "vector"]], "dma-timeout-cam": [ [16, "vector"], [32, "matrix"] @@ -289,7 +275,6 @@ [48, "vector"], [64, "vector"] ], - "matrix-3x3-triple-transpose-product": [[16, ["inline-array", "matrix", 3]]], "(method 14 rigid-body)": [[16, "quaternion"]], "(method 19 rigid-body)": [ @@ -538,36 +523,20 @@ [32, "vector"], [48, "vector"] ], - "build-conversions": [ - [16, "vector"] - ], - "warp-vector-into-surface!": [ - [16, "matrix"] - ], - "vector<-pad-in-matrix!": [ - [16, "vector"] - ], - "target-no-ja-move-post": [ - [16, "overlaps-others-params"] - ], - "do-target-gspot": [ - [16, "collide-query"] - ], - "target-no-move-post": [ - [16, "overlaps-others-params"] - ], + "build-conversions": [[16, "vector"]], + "warp-vector-into-surface!": [[16, "matrix"]], + "vector<-pad-in-matrix!": [[16, "vector"]], + "target-no-ja-move-post": [[16, "overlaps-others-params"]], + "do-target-gspot": [[16, "collide-query"]], + "target-no-move-post": [[16, "overlaps-others-params"]], "add-gravity": [ [16, "vector"], [32, "vector"], [48, "vector"], [64, "vector"] ], - "target-no-stick-post": [ - [32, "collide-query"] - ], - "target-swim-post": [ - [32, "collide-query"] - ], + "target-no-stick-post": [[32, "collide-query"]], + "target-swim-post": [[32, "collide-query"]], "target-real-post": [ [16, "vector"], [32, "vector"], @@ -597,9 +566,7 @@ [16, "event-message-block"], [96, "bone"] ], - "bend-gravity": [ - [32, "vector"] - ], + "bend-gravity": [[32, "vector"]], "wall-hide?": [ [16, "collide-query"], [560, "vector"], @@ -622,12 +589,8 @@ [96, "vector"], [112, "vector"] ], - "do-rotations2": [ - [16, "vector"] - ], - "tobot-init": [ - [16, "event-message-block"] - ], + "do-rotations2": [[16, "vector"]], + "tobot-init": [[16, "event-message-block"]], "target-update-ik": [ [16, "collide-query"], [560, "vector"], @@ -648,9 +611,7 @@ [96, "vector"], [112, "vector"] ], - "draw-history": [ - [16, "history-iterator"] - ], + "draw-history": [[16, "history-iterator"]], "target-collision-reaction": [ [16, "vector"], [32, "vector"], @@ -667,8 +628,82 @@ [128, "vector"], [144, "vector"] ], - "target-move-dist": [ - [16, "vector"] + "target-move-dist": [[16, "vector"]], + "cam-layout-entity-volume-info-create": [ + // needed to prevent hang + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "vector"], + [96, "vector"], + [112, "vector"], + [128, "vector"], + [144, "vector"] + ], + "cam-layout-entity-info": [ + // needed to prevent a hang + [16, "matrix"], + [80, "vector"], + [96, "vector"], + [112, "vector"], + [128, "vector"], + [144, "curve"], + [176, "vector"], + [192, "vector"], + [208, "vector"], + [224, "curve"], + [256, "vector"], + [272, "vector"], + [288, "vector"], + [304, "curve"], + [336, "vector"], + [352, "vector"], + [368, "interp-test-info"], + [432, "vector"] + ], + "clmf-pos-rot": [ + // needed to prevent a hang + [16, "vector"], + [32, "vector"], + [48, "matrix"], + [112, "matrix"], + [176, "vector"] + ], + "(method 9 plane-volume)": [ + // needed to prevent a hang + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "vector"], + [96, "vector"], + [112, "vector"], + [128, "vector"] + ], + "(method 31 entity-actor)": [[16, "nav-find-poly-parms"]], + "(method 32 entity-actor)": [[32, "nav-find-poly-parms"]], + "(method 36 nav-mesh)": [[16, "nav-route-portal"]], + "(method 13 nav-engine)": [[16, "nav-vertex"]], + "(method 12 nav-mesh)": [[16, "nav-vertex"]], + "(method 44 nav-mesh)": [[32, "nav-poly"]], + "(method 15 nav-mesh)": [[16, "vector"]], + "(method 40 nav-mesh)": [ + [16, "vector"], + [32, "vector"] + ], + "find-nearest-nav-mesh": [[16, "nav-find-poly-parms"]], + "(method 10 nav-mesh)": [[32, "nav-find-poly-parms"]], + "(method 34 nav-mesh)": [[16, "nav-poly"]], + "(method 9 nav-mesh)": [[16, "vector"]], + "debug-nav-validate-current-poly": [[16, "vector"]], + "(method 11 nav-control)": [[16, "nav-find-poly-parms"]], + "(method 15 nav-control)": [[16, "nav-find-poly-parms"]], + "(method 16 nav-control)": [[16, "nav-find-poly-parms"]], + "(method 46 nav-control)": [[16, "find-nav-sphere-ids-params"]], + "circle-tangent-directions": [ + [16, "vector"], + [32, "vector"], + [48, "vector"] ], "(trans close com-airlock)": [[16, "script-context"]], "traj3d-calc-initial-velocity-using-tilt": [[16, "traj2d-params"]], diff --git a/decompiler/config/jak2/type_casts.jsonc b/decompiler/config/jak2/type_casts.jsonc index 8b43d50eae..305168baf2 100644 --- a/decompiler/config/jak2/type_casts.jsonc +++ b/decompiler/config/jak2/type_casts.jsonc @@ -929,9 +929,7 @@ "joint-mod-joint-set-world-handler": [[[6, 197], "s5", "joint-mod"]], "joint-mod-joint-set*-handler": [[[2, 39], "s5", "joint-mod"]], "joint-mod-joint-set*-world-handler": [[[4, 53], "s5", "joint-mod"]], - "joint-mod-debug-draw": [ - [8, "a3", "float"] - ], + "joint-mod-debug-draw": [[8, "a3", "float"]], "glst-find-node-by-name": [ [6, "s5", "glst-named-node"], [7, "v1", "glst-named-node"] @@ -1437,7 +1435,6 @@ [35, "s3", "pointer"] ], "sp-process-particle-system": [[14, "a1", "vector"]], - // debug "add-debug-point": [ [[35, 39], "a3", "dma-packet"], @@ -1458,9 +1455,7 @@ [[107, 267], "a0", "(pointer uint64)"], [[268, 273], "a0", "dma-packet"] ], - "internal-draw-debug-text-3d": [ - [[53, 56], "v1", "dma-packet"] - ], + "internal-draw-debug-text-3d": [[[53, 56], "v1", "dma-packet"]], "add-debug-flat-triangle": [ [[70, 76], "a3", "dma-packet"], [[79, 85], "a3", "gs-gif-tag"], @@ -1481,38 +1476,22 @@ [[17, 20], "t0", "float"], [[22, 29], "t0", "float"] ], - "add-debug-cspace": [ - [[4, 6], "a3", "float"] - ], - "add-debug-points": [ - [[52, 57], "a3", "rgba"] - ], - "debug-percent-bar": [ - [[44, 49], "v1", "dma-packet"] - ], - "debug-pad-display": [ - [[72, 77], "v1", "dma-packet"] - ], - "add-debug-light": [ - [[17, 20], "t0", "float"] - ], - "drawable-frag-count": [ - [[14, 20], "s5", "drawable-group"] - ], - "add-debug-cursor": [ - [[35, 40], "v1", "dma-packet"] - ], + "add-debug-cspace": [[[4, 6], "a3", "float"]], + "add-debug-points": [[[52, 57], "a3", "rgba"]], + "debug-percent-bar": [[[44, 49], "v1", "dma-packet"]], + "debug-pad-display": [[[72, 77], "v1", "dma-packet"]], + "add-debug-light": [[[17, 20], "t0", "float"]], + "drawable-frag-count": [[[14, 20], "s5", "drawable-group"]], + "add-debug-cursor": [[[35, 40], "v1", "dma-packet"]], "add-boundary-shader": [ [[6, 12], "a0", "gs-gif-tag"], [[14, 31], "s5", "adgif-shader"] ], - // debug-sphere "add-debug-sphere-from-table": [ [[38, 41], "v1", "vector"], [[55, 59], "s0", "(inline-array vector)"] ], - "drawable-load": [[[25, 28], "s5", "drawable"]], "art-load": [[[13, 16], "s5", "art"]], "art-group-load-check": [[[43, 53], "s3", "art-group"]], @@ -1553,32 +1532,22 @@ [14, "v1", "gui-connection"] ], "(method 10 gui-control)": [[[4, 32], "s3", "gui-connection"]], - - "(method 10 bsp-header)": [ - [49, "a3", "(pointer uint128)"] - ], - + "(method 10 bsp-header)": [[49, "a3", "(pointer uint128)"]], "bsp-camera-asm": [ [26, "v1", "pointer"], [[26, 63], "t1", "bsp-node"], [43, "t3", "uint"] ], - - "ja-post": [ - [[42, 46], "a0", "collide-shape"] - ], - + "ja-post": [[[42, 46], "a0", "collide-shape"]], "display-frame-start": [ [4, "v1", "vif-bank"], [9, "a0", "vif-bank"] ], - "display-frame-finish": [ [[178, 185], "a0", "dma-packet"], [[193, 194], "a0", "dma-packet"], [194, "a0", "(pointer int64)"] ], - "default-end-buffer": [ [9, "v1", "dma-bucket"], [[20, 28], "t1", "dma-packet"], @@ -1604,7 +1573,6 @@ [[79, 82], "a1", "dma-packet"], [85, "a1", "dma-bucket"] ], - "default-init-buffer": [ [[20, 28], "t1", "dma-packet"], [[30, 36], "t1", "gs-gif-tag"], @@ -1779,9 +1747,7 @@ [23, "v1", "fact-info-target"], [29, "v1", "fact-info-target"] ], - "target-real-post": [ - [97, "f28", "float"] - ], + "target-real-post": [[97, "f28", "float"]], "target-compute-pole": [ [12, "s2", "swingpole"], [20, "s2", "swingpole"], @@ -1791,20 +1757,114 @@ [99, "s2", "swingpole"], [122, "s2", "swingpole"] ], - "tobot-start": [ - [26, "s5", "target"] + "tobot-start": [[26, "s5", "target"]], + "(method 10 target)": [[28, "t9", "(function target none)"]], + "target-compute-edge": [[48, "a0", "process-drawable"]], + "target-compute-edge-rider": [[48, "a0", "process-drawable"]], + "target-update-ik": [[288, "f30", "float"]], + "cam-layout-entity-volume-info-create": [ + ["_stack_", 16, "res-tag"], + [16, "v0", "(inline-array vector)"], + [223, "v1", "float"], + [254, "v1", "float"], + [258, "v1", "float"], + [282, "v1", "float"], + [325, "f0", "float"] ], - "(method 10 target)": [ - [28, "t9", "(function target none)"] + "cam-layout-entity-info": [ + // can't just cast the return value from the res-tag retrieval + [202, "v1", "vector"] ], - "target-compute-edge": [ - [48, "a0", "process-drawable"] + "clmf-next-entity": [[38, "a0", "connection"]], + "cam-layout-save-cam-rot": [[13, "v0", "vector"]], + "cam-layout-save-cam-trans": [ + [29, "v0", "vector"], + [40, "v0", "vector"], + // super weird handling of vectors + [93, "s5", "symbol"], + [95, "s2", "symbol"], + [94, "s2", "symbol"] ], - "target-compute-edge-rider": [ - [48, "a0", "process-drawable"] + "cam-layout-save-pivot": [ + [38, "v0", "vector"], + [13, "v0", "vector"] ], - "target-update-ik": [ - [288, "f30", "float"] + "cam-layout-save-align": [ + [38, "v0", "vector"], + [13, "v0", "vector"] + ], + "cam-layout-save-interesting": [ + [38, "v0", "vector"], + [13, "v0", "vector"] + ], + "cam-layout-save-splineoffset": [[37, "v0", "vector"]], + "cam-layout-save-campointsoffset": [[12, "v0", "vector"]], + "clmf-save-all": [[18, "v1", "connection"]], + "cam-layout-do-action": [[99, "s5", "(function object symbol symbol)"]], + "cam-layout-function-call": [[15, "gp", "(function string int basic none)"]], + "cam-layout-do-menu": [ + [[280, 363], "s4", "clm-list"], + [374, "v1", "clm-item"], + [[136, 182], "s3", "clm-list"], + [209, "a0", "clm-item"], + [219, "v1", "clm-item"], + [234, "s3", "clm-item"], + [239, "v1", "clm-item"], + [244, "s3", "clm-item"] + ], + "cam-layout-init": [[10, "v1", "connection"]], + "cam-layout-print": [[[21, 24], "v1", "dma-packet"]], + "clmf-pos-rot": [ + [68, "a1", "res-tag"], + [139, "v1", "res-tag"], + [82, "v0", "vector"] + ], + "clmf-cam-float-adjust": [[53, "v1", "res-tag"]], + "(method 9 plane-volume)": [ + [185, "v1", "float"], + [216, "v1", "float"], + [241, "v1", "float"], + [281, "f0", "float"], + [220, "v1", "float"] + ], + "(method 45 nav-mesh)": [[15, "v1", "entity-nav-mesh"]], + "(method 13 nav-engine)": [ + [[53, 65], "s4", "nav-mesh"], + [[38, 50], "s3", "nav-mesh"] + ], + "(method 9 nav-mesh)": [[[81, 134], "s4", "nav-poly"]], + "(method 37 nav-mesh)": [[[4, 18], "a1", "(inline-array vector)"]], + "debug-menu-item-var-update-display-str": [ + [[44, 49], "v1", "int"], + [[61, 69], "v1", "int"] + ], + "debug-menu-item-var-make-float": [[31, "v0", "int"]], + "debug-menu-item-get-max-width": [[[18, 35], "a0", "debug-menu-item-var"]], + "debug-menu-find-from-template": [ + [10, "s4", "debug-menu-item"], + [18, "s4", "debug-menu-item-submenu"], + [3, "s5", "debug-menu"] + ], + "debug-menu-item-var-joypad-handler": [ + [206, "a1", "int"], + [207, "v1", "int"] + ], + "debug-menu-rebuild": [[7, "a0", "debug-menu-item"]], + "debug-menu-render": [ + [[45, 49], "v1", "dma-packet"], + [[108, 111], "v1", "dma-packet"] + ], + "debug-menu-item-submenu-render": [[[39, 44], "v1", "dma-packet"]], + "debug-menu-item-flag-render": [[[44, 49], "v1", "dma-packet"]], + "debug-menu-item-function-render": [[[46, 51], "v1", "dma-packet"]], + "debug-menu-item-var-render": [[[94, 98], "v1", "dma-packet"]], + "debug-menu-send-msg": [ + [[3, 14], "s2", "debug-menu-item"], + [[14, 21], "s2", "debug-menu-item-submenu"] + ], + "(anon-function 86 default-menu)": [ + // TODO - should not be required + [9, "a0", "state-flags"] ], "(anon-function 2 find-nearest)": [ [28, "s3", "collide-shape"], @@ -1865,7 +1925,7 @@ [582, "a0", "editable"], [611, "a0", "editable"] ], - + "(event idle editable-player)": [ [351, "s4", "editable-light"], [409, "s4", "editable-light"], diff --git a/decompiler/config/jak2/var_names.jsonc b/decompiler/config/jak2/var_names.jsonc index 17233c7fb4..1000e626ce 100644 --- a/decompiler/config/jak2/var_names.jsonc +++ b/decompiler/config/jak2/var_names.jsonc @@ -348,7 +348,15 @@ } }, "add-debug-line": { - "args": ["enable", "bucket", "start", "end", "start-color", "mode", "end-color"], + "args": [ + "enable", + "bucket", + "start", + "end", + "start-color", + "mode", + "end-color" + ], "vars": { "v1-2": "line" } @@ -476,7 +484,16 @@ } }, "add-debug-arc": { - "args": ["enable", "bucket", "position", "start-angle", "end-angle", "radius", "color", "orientation"], + "args": [ + "enable", + "bucket", + "position", + "start-angle", + "end-angle", + "radius", + "color", + "orientation" + ], "vars": { "f30-0": "angle", "sv-80": "i", @@ -485,7 +502,15 @@ } }, "add-debug-curve": { - "args": ["enable", "bucket", "cverts", "num-cverts", "knots", "num-knots", "color"], + "args": [ + "enable", + "bucket", + "cverts", + "num-cverts", + "knots", + "num-knots", + "color" + ], "vars": { "sv-80": "i", "s0-0": "p0", @@ -497,14 +522,31 @@ "args": ["enable", "bucket", "curve", "color", "arg4"] }, "add-debug-points": { - "args": ["enable", "bucket", "points", "num-points", "color", "y-override", "highlight"], + "args": [ + "enable", + "bucket", + "points", + "num-points", + "color", + "y-override", + "highlight" + ], "vars": { "s0-0": "i", "sv-96": "position" } }, "debug-percent-bar": { - "args": ["enable", "bucket", "x", "y", "percentage", "color", "width", "height"], + "args": [ + "enable", + "bucket", + "x", + "y", + "percentage", + "color", + "width", + "height" + ], "vars": { "s0-0": "buf", "s5-0": "tag-start", @@ -648,16 +690,16 @@ } }, "display-sync": { - "arg0":["disp"], + "arg0": ["disp"], "vars": { - "s4-0" : "just-rendered-frame", - "a1-1" : "current-time", - "s5-0" : "just-rendered-frame-start-time", - "a0-3" : "prev-vblank-time-1", - "v1-6" : "prev-vblank-time-2", + "s4-0": "just-rendered-frame", + "a1-1": "current-time", + "s5-0": "just-rendered-frame-start-time", + "a0-3": "prev-vblank-time-1", + "v1-6": "prev-vblank-time-2", "f28-0": "ticks-per-frame-f", - "f1-0" : "frame-duration", - "f0-2" : "frame-time-ratio", + "f1-0": "frame-duration", + "f0-2": "frame-time-ratio", "f26-0": "vysnc-progress", "f30-0": "last-dog", "f30-1": "next-dog", @@ -693,5 +735,8 @@ "s4-0": ["geo", "merc-fragment"], "s5-0": ["ctrl", "merc-fragment-control"] } + }, + "add-nav-sphere": { + "args": ["nav", "sphere", "max-spheres"] } } diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index 3fb1c5033f..28d7f7f570 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -436,9 +436,9 @@ goos::Object decomp_ref_to_inline_array_guess_size( // verify the stride matches the type system auto elt_type_info = ts.lookup_type(array_elt_type); - int ye = align(elt_type_info->get_size_in_memory(), - elt_type_info->get_inline_array_stride_alignment()); - ASSERT(stride == ye); + int elt_size = align(elt_type_info->get_size_in_memory(), + elt_type_info->get_inline_array_stride_alignment()); + ASSERT(stride == elt_size); // the input is the location of the data field. // we expect that to be a label: @@ -573,6 +573,29 @@ goos::Object nav_mesh_poly_arr_decompile(const std::vector& words, file, TypeSpec("nav-poly"), 8); } +goos::Object nav_mesh_poly_arr_jak2_decompile(const std::vector& words, + const std::vector& labels, + int my_seg, + int field_location, + const TypeSystem& ts, + const std::vector>& all_words, + const LinkedObjectFile* file) { + return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, + file, TypeSpec("nav-poly"), 64); +} + +goos::Object nav_mesh_nav_control_arr_decompile( + const std::vector& words, + const std::vector& labels, + int my_seg, + int field_location, + const TypeSystem& ts, + const std::vector>& all_words, + const LinkedObjectFile* file) { + return decomp_ref_to_inline_array_guess_size(words, labels, my_seg, field_location, ts, all_words, + file, TypeSpec("nav-control"), 288); +} + goos::Object nav_mesh_route_arr_decompile(const std::vector& words, const std::vector& labels, int my_seg, @@ -958,6 +981,7 @@ goos::Object decompile_structure(const TypeSpec& type, fmt::format("Dynamic value field {} in static data type {} not yet implemented", field.name(), actual_type.print())); } else { + // TODO - this is getting a little unwieldly -- refactor this at some point if (field.name() == "data" && type.print() == "ocean-near-indices") { // first, get the label: field_defs_out.emplace_back( @@ -971,15 +995,28 @@ goos::Object decompile_structure(const TypeSpec& type, field_defs_out.emplace_back( field.name(), sp_field_init_spec_decompile(obj_words, labels, label.target_segment, field_start, ts, words, file)); - } else if (field.name() == "vertex" && type.print() == "nav-mesh") { + } else if (field.name() == "vertex" && type.print() == "nav-mesh" && + file->version == GameVersion::Jak1) { field_defs_out.emplace_back( field.name(), nav_mesh_vertex_arr_decompile(obj_words, labels, label.target_segment, field_start, ts, words, file)); - } else if (field.name() == "poly" && type.print() == "nav-mesh") { + } else if (field.name() == "poly" && type.print() == "nav-mesh" && + file->version == GameVersion::Jak1) { field_defs_out.emplace_back( field.name(), nav_mesh_poly_arr_decompile(obj_words, labels, label.target_segment, field_start, ts, words, file)); - } else if (field.name() == "route" && type.print() == "nav-mesh") { + } else if (field.name() == "poly-array" && type.print() == "nav-mesh" && + file->version == GameVersion::Jak2) { + field_defs_out.emplace_back(field.name(), nav_mesh_poly_arr_jak2_decompile( + obj_words, labels, label.target_segment, + field_start, ts, words, file)); + } else if (field.name() == "nav-control-array" && type.print() == "nav-mesh" && + file->version == GameVersion::Jak2) { + field_defs_out.emplace_back(field.name(), nav_mesh_nav_control_arr_decompile( + obj_words, labels, label.target_segment, + field_start, ts, words, file)); + } else if (field.name() == "route" && type.print() == "nav-mesh" && + file->version == GameVersion::Jak1) { field_defs_out.emplace_back( field.name(), nav_mesh_route_arr_decompile(obj_words, labels, label.target_segment, field_start, ts, words, file)); diff --git a/goal_src/jak2/engine/ai/traffic-h.gc b/goal_src/jak2/engine/ai/traffic-h.gc index ff15b5e555..427e460a7a 100644 --- a/goal_src/jak2/engine/ai/traffic-h.gc +++ b/goal_src/jak2/engine/ai/traffic-h.gc @@ -7,6 +7,10 @@ ;; todo: some types, method names. +;; NOTE - for default-menu +(define-extern traffic-start (function none)) +(define-extern traffic-kill (function none)) + ;; DECOMP BEGINS (define *traffic-manager* (the-as process #f)) diff --git a/goal_src/jak2/engine/camera/cam-debug-h.gc b/goal_src/jak2/engine/camera/cam-debug-h.gc index 3246d360ff..5bc568efed 100644 --- a/goal_src/jak2/engine/camera/cam-debug-h.gc +++ b/goal_src/jak2/engine/camera/cam-debug-h.gc @@ -18,6 +18,14 @@ ;; NOTE - for cam-states (define-extern cam-collision-record-save (function vector vector int symbol camera-slave none)) +;; NOTE - for cam-layout +(define-extern camera-line-setup (function vector4w none)) +(define-extern camera-line-draw (function vector vector none)) +(define-extern camera-cross (function vector vector vector vector4w meters none)) +(define-extern camera-fov-frame (function matrix vector float float float vector4w symbol)) +(define-extern cam-slave-options->string (function cam-slave-options object string)) +(define-extern cam-index-options->string (function cam-index-options object string)) + ;; DECOMP BEGINS (declare-file (debug)) diff --git a/goal_src/jak2/engine/camera/cam-debug.gc b/goal_src/jak2/engine/camera/cam-debug.gc index 0b0c16e286..009c244944 100644 --- a/goal_src/jak2/engine/camera/cam-debug.gc +++ b/goal_src/jak2/engine/camera/cam-debug.gc @@ -200,13 +200,12 @@ :nreg #x4 ) ) - (set! (-> (the-as gs-gif-tag a3-2) regs) - (new 'static 'gif-tag-regs - :regs0 (gif-reg-id rgbaq) - :regs1 (gif-reg-id xyzf2) - :regs2 (gif-reg-id rgbaq) - :regs3 (gif-reg-id xyzf2) - ) + (set! (-> (the-as gs-gif-tag a3-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id xyzf2) + :regs2 (gif-reg-id rgbaq) + :regs3 (gif-reg-id xyzf2) + ) ) (set! (-> a1-1 base) (&+ (the-as pointer a3-2) 16)) ) @@ -1636,6 +1635,10 @@ ) ;; WARN: Return type mismatch int vs none. +;; WARN: Function may read a register that is not set: t0 +;; WARN: Function may read a register that is not set: t1 +;; WARN: Function may read a register that is not set: t2 +;; WARN: Function may read a register that is not set: t3 (defun cam-collision-record-draw () (cond ((cpad-pressed? 0 down) diff --git a/goal_src/jak2/engine/camera/cam-layout.gc b/goal_src/jak2/engine/camera/cam-layout.gc index ecded8b21e..81a69eb42e 100644 --- a/goal_src/jak2/engine/camera/cam-layout.gc +++ b/goal_src/jak2/engine/camera/cam-layout.gc @@ -5,5 +5,3654 @@ ;; name in dgo: cam-layout ;; dgos: ENGINE, GAME +(declare-type clm basic) +(define-extern *clm-edit* clm) +(define-extern *clm* clm) +(define-extern *clm-spline-attr* clm) +(define-extern *clm-intro-attr* clm) +(define-extern *clm-index-attr* clm) +(define-extern *clm-focalpull-attr* clm) +(define-extern *clm-select* clm) + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +(define *camera-layout-blink* #f) + +(deftype cam-layout-bank (basic) + ((spline-t float :offset-assert 4) + (spline-step float :offset-assert 8) + (intro-t float :offset-assert 12) + (intro-step float :offset-assert 16) + (debug-t float :offset-assert 20) + (debug-step float :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(defmethod inspect cam-layout-bank ((obj cam-layout-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tspline-t: ~f~%" (-> obj spline-t)) + (format #t "~1Tspline-step: ~f~%" (-> obj spline-step)) + (format #t "~1Tintro-t: ~f~%" (-> obj intro-t)) + (format #t "~1Tintro-step: ~f~%" (-> obj intro-step)) + (format #t "~1Tdebug-t: ~f~%" (-> obj debug-t)) + (format #t "~1Tdebug-step: ~f~%" (-> obj debug-step)) + (label cfg-4) + obj + ) + +(define *CAM_LAYOUT-bank* (new 'static 'cam-layout-bank + :spline-t 0.01 + :spline-step 0.0016666667 + :intro-t 0.01 + :intro-step 0.0016666667 + :debug-t 0.01 + :debug-step 0.0033333334 + ) + ) + +(define *camera-layout-message-ypos* 30) + +(deftype clm-basic (basic) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(defmethod inspect clm-basic ((obj clm-basic)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (label cfg-4) + obj + ) + +(deftype clm-item-action (structure) + ((button uint64 :offset-assert 0) + (options uint64 :offset-assert 8) + (func symbol :offset-assert 16) + (parm0 int32 :offset 20) + (parm0-symbol symbol :offset 20) + (parm0-basic basic :offset 20) + (parm1 symbol :offset 24) + (parm1-basic basic :offset 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(defmethod inspect clm-item-action ((obj clm-item-action)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'clm-item-action) + (format #t "~1Tbutton: ~D~%" (-> obj button)) + (format #t "~1Toptions: ~D~%" (-> obj options)) + (format #t "~1Tfunc: ~A~%" (-> obj func)) + (format #t "~1Tparm0: ~A~%" (-> obj parm0)) + (format #t "~1Tparm1: ~A~%" (-> obj parm1)) + (label cfg-4) + obj + ) + +(deftype clm-item (clm-basic) + ((description string :offset-assert 4) + (button-symbol symbol :offset-assert 8) + (action clm-item-action :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(defmethod inspect clm-item ((obj clm-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdescription: ~A~%" (-> obj description)) + (format #t "~1Tbutton-symbol: ~A~%" (-> obj button-symbol)) + (format #t "~1Taction: #~%" (-> obj action)) + (label cfg-4) + obj + ) + +(deftype clm-list-item (basic) + ((description string :offset-assert 4) + (track-val symbol :offset-assert 8) + (val-func symbol :offset-assert 12) + (val-parm0 int32 :offset 16) + (val-parm0-symbol symbol :offset 16) + (val-parm0-basic basic :offset 16) + (val-parm1 symbol :offset 20) + (val-parm1-basic basic :offset 20) + (actions (array clm-item-action) :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(defmethod inspect clm-list-item ((obj clm-list-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdescription: ~A~%" (-> obj description)) + (format #t "~1Ttrack-val: ~A~%" (-> obj track-val)) + (format #t "~1Tval-func: ~A~%" (-> obj val-func)) + (format #t "~1Tval-parm0: ~A~%" (-> obj val-parm0)) + (format #t "~1Tval-parm1: ~A~%" (-> obj val-parm1)) + (format #t "~1Tactions: ~A~%" (-> obj actions)) + (label cfg-4) + obj + ) + +(deftype clm-list (clm-basic) + ((tracker symbol :offset-assert 4) + (cur-list-item int32 :offset-assert 8) + (items (array clm-list-item) :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defmethod inspect clm-list ((obj clm-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttracker: ~A~%" (-> obj tracker)) + (format #t "~1Tcur-list-item: ~D~%" (-> obj cur-list-item)) + (format #t "~1Titems: ~A~%" (-> obj items)) + (label cfg-4) + obj + ) + +(deftype clm (basic) + ((title string :offset-assert 4) + (items (array clm-basic) :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(defmethod inspect clm ((obj clm)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttitle: ~A~%" (-> obj title)) + (format #t "~1Titems: ~A~%" (-> obj items)) + (label cfg-4) + obj + ) + +(define *volume-point-current* 0) + +(define *volume-point* (new 'debug 'vector-array 1000)) + +(define *volume-normal-current* 0) + +(define *volume-normal* (new 'debug 'vector-array 600)) + +(deftype volume-descriptor-array (inline-array-class) + ((data plane-volume :inline :dynamic :offset 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defmethod inspect volume-descriptor-array ((obj volume-descriptor-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +(set! (-> volume-descriptor-array heap-base) (the-as uint 24)) + +(define *volume-descriptor-current* 0) + +(define *volume-descriptor* (the-as vol-control (new 'debug 'volume-descriptor-array 100))) + +(deftype cam-layout (process) + ((cam-entity entity-camera :offset-assert 128) + (num-entities int32 :offset-assert 132) + (cur-entity int32 :offset-assert 136) + (num-volumes int32 :offset-assert 140) + (cur-volume int32 :offset-assert 144) + (first-pvol int32 :offset-assert 148) + (first-cutoutvol int32 :offset-assert 152) + (res-key float :offset-assert 156) + ) + :heap-base #x200 + :method-count-assert 14 + :size-assert #xa0 + :flag-assert #xe020000a0 + (:states + cam-layout-active + ) + ) + +(defmethod inspect cam-layout ((obj cam-layout)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tcam-entity: ~A~%" (-> obj cam-entity)) + (format #t "~2Tnum-entities: ~D~%" (-> obj num-entities)) + (format #t "~2Tcur-entity: ~D~%" (-> obj cur-entity)) + (format #t "~2Tnum-volumes: ~D~%" (-> obj num-volumes)) + (format #t "~2Tcur-volume: ~D~%" (-> obj cur-volume)) + (format #t "~2Tfirst-pvol: ~D~%" (-> obj first-pvol)) + (format #t "~2Tfirst-cutoutvol: ~D~%" (-> obj first-cutoutvol)) + (format #t "~2Tres-key: ~f~%" (-> obj res-key)) + (label cfg-4) + obj + ) + +(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)) + ) + (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 bucket-324) + gp-0 + (the-as (pointer dma-tag) a3-2) + ) + ) + ) + ) + +(defun cam-layout-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((f0-1 (vector-dot arg1 arg0)) + (f1-1 (vector-dot arg2 arg0)) + ) + (if (< 0.00001 (fabs f1-1)) + (/ (- (-> arg0 w) f0-1) f1-1) + 409600000.0 + ) + ) + ) + +;; 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 + (sv-16 res-tag) + (sv-160 vector) + (sv-164 number) + (sv-168 int) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + (sv-224 vector) + (sv-240 vector) + (sv-256 int) + (sv-272 int) + (sv-288 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 0)) + (until #f + (set! sv-16 (new 'static 'res-tag)) + (let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data) + arg0 + arg1 + 'exact + (the float s4-0) + (the-as pointer #f) + (& sv-16) + *res-static-buf* + ) + ) + ) + ) + (cond + (s3-0 + (when (>= *volume-descriptor-current* 100) + (format 0 "ERROR : camera editing out of volume descriptors~%") + (return #f) + ) + (let ((s2-0 (-> *volume-descriptor* pos-vol *volume-descriptor-current*))) + (set! (-> s2-0 volume-type) arg1) + (set! (-> s2-0 point-count) 0) + (set! (-> s2-0 first-point) (the-as (pointer vector) (-> *volume-point* data *volume-point-current*))) + (set! (-> s2-0 normal-count) 0) + (set! (-> s2-0 first-normal) (the-as (pointer vector) (-> *volume-normal* data *volume-normal-current*))) + (set! *volume-descriptor-current* (+ *volume-descriptor-current* 1)) + (+! (-> self num-volumes) 1) + (dotimes (s1-0 (the-as int (-> sv-16 elt-count))) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! (-> sv-192 quad) (the-as uint128 0)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (set! (-> sv-208 quad) (the-as uint128 0)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! (-> sv-224 quad) (the-as uint128 0)) + (set! sv-240 (new 'stack-no-clear 'vector)) + (set! (-> sv-240 quad) (the-as uint128 0)) + 0.0 + 0.0 + 0.0 + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s0-0 (new-stack-vector0))) + (set! sv-256 0) + (set! sv-272 0) + (while (< sv-272 (the-as int (-> sv-16 elt-count))) + (when (!= s1-0 sv-272) + (vector-float*! sv-192 (-> s3-0 sv-272) (-> s3-0 sv-272 w)) + (vector-cross! sv-208 (-> s3-0 sv-272) (-> s3-0 s1-0)) + (vector-normalize! sv-208 1.0) + (vector-cross! sv-224 sv-208 (-> s3-0 sv-272)) + (vector-normalize! sv-224 1.0) + (let ((f0-6 (cam-layout-intersect-dist (-> s3-0 s1-0) sv-192 sv-224))) + (when (!= f0-6 409600000.0) + (let ((v1-40 sv-240)) + (let ((a0-18 sv-192)) + (.lvf vf2 (&-> sv-224 quad)) + (.lvf vf1 (&-> a0-18 quad)) + ) + (let ((a0-19 f0-6)) + (.mov vf3 a0-19) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-40 quad) vf4) + ) + (set! sv-160 (new-stack-vector0)) + (set! sv-164 0.0) + (set! sv-168 0) + (set! sv-176 (new-stack-vector0)) + (set! (-> sv-160 quad) (-> sv-240 quad)) + (set! sv-288 0) + (while (< sv-288 (the-as int (-> sv-16 elt-count))) + (when (and (!= sv-288 s1-0) (!= sv-288 sv-272)) + (let ((f0-8 (cam-layout-intersect-dist (-> s3-0 sv-288) sv-160 sv-208))) + (cond + ((= f0-8 409600000.0) + ) + ((zero? sv-168) + (let ((v1-54 sv-160)) + (let ((a0-25 sv-160)) + (.lvf vf2 (&-> sv-208 quad)) + (.lvf vf1 (&-> a0-25 quad)) + ) + (let ((a0-26 f0-8)) + (.mov vf3 a0-26) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-54 quad) vf4) + ) + (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (set! sv-164 8192000.0) + (set! sv-168 1) + ) + ((begin (vector-float*! sv-240 sv-208 f0-8) (>= (vector-dot sv-240 sv-176) 0.0)) + ) + ((>= (vector-dot sv-240 (-> s3-0 sv-288)) 0.0) + (when (< (fabs f0-8) (fabs (the-as float sv-164))) + (set! sv-164 f0-8) + (set! sv-168 (+ sv-168 1)) + ) + ) + (else + (let ((v1-71 sv-160)) + (let ((a0-34 sv-160) + (a1-17 sv-208) + (f1-8 f0-8) + ) + (.lvf vf2 (&-> a1-17 quad)) + (.lvf vf1 (&-> a0-34 quad)) + (let ((a0-35 f1-8)) + (.mov vf3 a0-35) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-71 quad) vf4) + ) + (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (set! sv-168 (+ sv-168 1)) + (if (< (fabs f0-8) (fabs (the-as float sv-164))) + (set! sv-164 (- (the-as float sv-164) f0-8)) + (set! sv-164 0.0) + ) + ) + ) + ) + ) + (set! sv-288 (+ sv-288 1)) + ) + (cond + ((zero? sv-168) + ) + ((= (the-as float sv-164) 0.0) + ) + (else + (dotimes (v1-88 (the-as int (-> sv-16 elt-count))) + (when (and (!= v1-88 s1-0) (!= v1-88 sv-272)) + (if (< 4096.0 (- (vector-dot sv-160 (-> s3-0 v1-88)) (-> s3-0 v1-88 w))) + (goto cfg-47) + ) + ) + ) + (let ((v1-92 sv-240)) + (let ((a0-58 sv-160) + (a1-20 sv-208) + (f0-14 sv-164) + ) + (.lvf vf2 (&-> a1-20 quad)) + (.lvf vf1 (&-> a0-58 quad)) + (let ((a0-59 (the-as float f0-14))) + (.mov vf3 a0-59) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-92 quad) vf4) + ) + (cond + ((>= *volume-point-current* 999) + (format 0 "ERROR : camera editing out of volume points~%") + ) + (else + (set! (-> *volume-point* data *volume-point-current* quad) (-> sv-160 quad)) + (set! (-> *volume-point* data (+ *volume-point-current* 1) quad) (-> sv-240 quad)) + (set! *volume-point-current* (+ *volume-point-current* 2)) + (+! (-> s2-0 point-count) 2) + ) + ) + (vector+! s0-0 s0-0 sv-160) + (vector+! s0-0 s0-0 sv-240) + (set! sv-256 (+ sv-256 2)) + sv-256 + ) + ) + ) + ) + ) + (label cfg-47) + (set! sv-272 (+ sv-272 1)) + ) + (when (nonzero? sv-256) + (vector-float*! s0-0 s0-0 (/ 1.0 (the float sv-256))) + (cond + ((>= *volume-normal-current* 599) + (format 0 "ERROR : camera editing out of volume normals~%") + ) + (else + (set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad)) + (set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad)) + (set! *volume-normal-current* (+ *volume-normal-current* 2)) + (set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2)) + ) + ) + ) + ) + ) + ) + ) + (else + (return #f) + ) + ) + ) + (+! s4-0 1) + ) + ) + #f + ) + ) + +(defbehavior cam-layout-entity-volume-info cam-layout () + (dotimes (gp-0 (-> self num-volumes)) + (cond + ((and (= gp-0 (-> self cur-volume)) + (= *camera-layout-blink* 'volume) + (zero? (logand (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + ) + (else + (let ((s5-0 (-> *volume-descriptor* pos-vol gp-0))) + (let ((a0-8 (new 'static 'vector4w :w #x80))) + (cond + ((= (-> s5-0 volume-type) 'vol) + (set! (-> a0-8 x) 0) + (set! (-> a0-8 y) 192) + (set! (-> a0-8 z) 0) + 0 + ) + ((= (-> s5-0 volume-type) 'pvol) + (set! (-> a0-8 x) 128) + (set! (-> a0-8 y) 128) + (set! (-> a0-8 z) 128) + ) + ((= (-> s5-0 volume-type) 'cutoutvol) + (set! (-> a0-8 x) 192) + (set! (-> a0-8 y) 0) + (set! (-> a0-8 z) 0) + 0 + ) + ) + (camera-line-setup a0-8) + ) + (let ((s4-0 (-> s5-0 first-point))) + (dotimes (s3-0 (/ (-> s5-0 point-count) 2)) + (camera-line-draw (the-as vector s4-0) (the-as vector (&-> s4-0 4))) + (set! s4-0 (&-> s4-0 8)) + ) + ) + ) + ) + ) + ) + #f + ) + +(defun v-slrp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (new-stack-vector0)) + (s1-0 (new-stack-vector0)) + (s0-0 (new-stack-vector0)) + ) + 0.0 + 0.0 + 0.0 + 0.0 + (cond + ((< 1.0 arg3) + (set! arg3 1.0) + ) + ((< arg3 0.0) + (set! arg3 0.0) + ) + ) + (vector-normalize-copy! s2-0 arg1 1.0) + (vector-normalize-copy! s1-0 arg2 1.0) + (vector-cross! s0-0 s2-0 s1-0) + (let* ((f30-0 (vector-length s0-0)) + (f28-0 (asin f30-0)) + ) + (vector-float*! arg0 arg1 (/ (sin (* (- 1.0 arg3) f28-0)) f30-0)) + (let ((s3-1 arg0)) + (let ((f0-14 (/ (sin (* arg3 f28-0)) f30-0))) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg0 quad)) + (let ((v1-9 f0-14)) + (.mov vf3 v1-9) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> s3-1 quad) vf4) + s3-1 + ) + ) + ) + ) + ) + +(deftype interp-test-info (structure) + ((from vector :inline :offset-assert 0) + (to vector :inline :offset-assert 16) + (origin vector :inline :offset-assert 32) + (color vector4w :offset-assert 48) + (axis vector :offset-assert 52) + (disp string :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + +(defmethod inspect interp-test-info ((obj interp-test-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'interp-test-info) + (format #t "~1Tfrom: #~%" (-> obj from)) + (format #t "~1Tto: #~%" (-> obj to)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Taxis: #~%" (-> obj axis)) + (format #t "~1Tdisp: ~A~%" (-> obj disp)) + (label cfg-4) + obj + ) + +(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)) + ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) 0.0 (-> arg1 axis) 65536.0) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (dotimes (s2-0 10) + (set! (-> s5-0 quad) (-> s3-0 quad)) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (* 0.1 (+ 1.0 (the float s2-0))) (-> arg1 axis) 65536.0) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (camera-line s3-0 s5-0 (-> arg1 color)) + ) + (arg0 s5-0 (-> arg1 from) (-> arg1 to) (-> *CAM_LAYOUT-bank* debug-t) (-> arg1 axis) 65536.0) + (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length s5-0)) + (vector+! s5-0 s5-0 (-> arg1 origin)) + (camera-line (-> arg1 origin) s5-0 (-> arg1 color)) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-0 + (-> arg1 color) + (the-as meters #x45800000) + ) + ) + (none) + ) + +(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)) + ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) 0.0) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (dotimes (s2-0 10) + (set! (-> s5-0 quad) (-> s3-0 quad)) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 18.0 (+ 1.0 (the float s2-0))))) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (camera-line s3-0 s5-0 (-> arg1 color)) + ) + (arg0 s5-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 180.0 (-> *CAM_LAYOUT-bank* debug-t)))) + (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length s5-0)) + (vector+! s5-0 s5-0 (-> arg1 origin)) + (camera-line (-> arg1 origin) s5-0 (-> arg1 color)) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-0 + (-> arg1 color) + (the-as meters #x45800000) + ) + ) + (none) + ) + +;; 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) + (return #f) + ) + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-vector0)) + ) + (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) + (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cam-slave-get-rot arg0 s5-0) + (camera-fov-frame s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) 0.75 1.0 (new 'static 'vector4w :z #xff :w #x80)) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (if (and (cam-slave-get-vector-with-offset arg0 s5-1 'pivot) + (or (!= *camera-layout-blink* 'pivot) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-1 + (new 'static 'vector4w :x #x80 :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s5-2 (new-stack-vector0))) + (if (and (cam-slave-get-vector-with-offset arg0 s5-2 'align) + (or (!= *camera-layout-blink* 'align) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-2 + (new 'static 'vector4w :y #x80 :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s5-3 (new-stack-vector0))) + (if (and (cam-slave-get-vector-with-offset arg0 s5-3 'interesting) + (or (!= *camera-layout-blink* 'interesting) + (logtest? (-> *display* real-frame-clock integral-frame-counter) 8) + ) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-3 + (new 'static 'vector4w :x #x80 :z #x80 :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s3-1 (new 'stack 'curve)) + (s2-0 (new-stack-vector0)) + (s5-4 (new-stack-vector0)) + (s4-1 (new-stack-vector0)) + ) + (when (and (get-curve-data! arg0 s3-1 'campath 'campath-k -1000000000.0) + (or (!= *camera-layout-blink* 'spline) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cond + ((cam-slave-get-vector-with-offset arg0 s4-1 'pivot) + (curve-get-pos! s5-4 0.0 s3-1) + (vector-! s4-1 s4-1 s5-4) + ) + (else + (set! (-> s4-1 quad) + (-> (the-as + vector + ((method-of-type res-lump get-property-struct) + arg0 + 'spline-offset + 'interp + -1000000000.0 + s4-1 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + quad + ) + ) + ) + ) + (curve-get-pos! s5-4 0.0 s3-1) + (vector+! s5-4 s5-4 s4-1) + (dotimes (s1-1 8) + (set! (-> s2-0 quad) (-> s5-4 quad)) + (curve-get-pos! s5-4 (* 0.125 (the float (+ s1-1 1))) s3-1) + (vector+! s5-4 s5-4 s4-1) + (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) + ) + (curve-get-pos! s5-4 (-> *CAM_LAYOUT-bank* spline-t) s3-1) + (vector+! s5-4 s5-4 s4-1) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-4 + (new 'static 'vector4w :x #xff :y #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s3-2 (new 'stack 'curve)) + (s2-1 (new-stack-vector0)) + (s5-5 (new-stack-vector0)) + (s4-2 (new-stack-vector0)) + (s1-2 (new 'stack 'curve)) + ) + (when (and (get-curve-data! arg0 s3-2 'intro 'intro-k -1000000000.0) + (or (!= *camera-layout-blink* 'intro) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cond + ((cam-slave-get-vector-with-offset arg0 s4-2 'pivot) + (curve-get-pos! s5-5 1.0 s3-2) + (vector-! s4-2 s4-2 s5-5) + ) + ((get-curve-data! arg0 s1-2 'campath 'campath-k -1000000000.0) + (curve-get-pos! s4-2 0.0 s1-2) + (curve-get-pos! s5-5 1.0 s3-2) + (vector-! s4-2 s4-2 s5-5) + ) + ((cam-slave-get-vector-with-offset arg0 s4-2 'trans) + (curve-get-pos! s5-5 1.0 s3-2) + (vector-! s4-2 s4-2 s5-5) + ) + ) + (curve-get-pos! s5-5 0.0 s3-2) + (vector+! s5-5 s5-5 s4-2) + (dotimes (s1-3 8) + (set! (-> s2-1 quad) (-> s5-5 quad)) + (curve-get-pos! s5-5 (* 0.125 (the float (+ s1-3 1))) s3-2) + (vector+! s5-5 s5-5 s4-2) + (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) + ) + (curve-get-pos! s5-5 (-> *CAM_LAYOUT-bank* intro-t) s3-2) + (vector+! s5-5 s5-5 s4-2) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-5 + (new 'static 'vector4w :z #xff :w #x80) + (the-as meters #x45800000) + ) + (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue 0.0) s3-2) + (vector+! s5-5 s5-5 s4-2) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-5 + (new 'static 'vector4w :z #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s2-3 (res-lump-data arg0 'campoints pointer :time 1.0)) + (v1-73 (res-lump-struct arg0 'campoints-offset structure)) + (s4-3 (new 'stack-no-clear 'vector)) + (s3-3 (new 'stack-no-clear 'vector)) + (s5-6 (new 'static 'vector)) + ) + (when (and s2-3 + (or (!= *camera-layout-blink* 'index) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cond + (v1-73 + (vector+! s4-3 (the-as vector (&+ s2-3 0)) (the-as vector v1-73)) + (vector+! s3-3 (the-as vector (&+ s2-3 16)) (the-as vector v1-73)) + ) + (else + (set! (-> s4-3 quad) (-> (the-as (pointer uint128) (&+ s2-3 0)))) + (set! (-> s3-3 quad) (-> (the-as (pointer uint128) (&+ s2-3 16)))) + ) + ) + (camera-line s4-3 s3-3 (new 'static 'vector4w :y #x80 :w #x80)) + (vector-lerp-clamp! s5-6 s4-3 s3-3 (-> *CAM_LAYOUT-bank* spline-t)) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-6 + (new 'static 'vector4w :x #xff :y #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s4-4 (res-lump-data arg0 'focalpull pointer :time 1.0)) + (s5-7 (new 'static 'vector)) + ) + (when (and s4-4 + (or (!= *camera-layout-blink* 'focalpull) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (camera-line + (the-as vector (&+ s4-4 0)) + (the-as vector (&+ s4-4 16)) + (new 'static 'vector4w :y #xff :z #xff :w #x80) + ) + (vector-lerp-clamp! + s5-7 + (the-as vector (&+ s4-4 0)) + (the-as vector (&+ s4-4 16)) + (-> *CAM_LAYOUT-bank* spline-t) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-7 + (new 'static 'vector4w :y #xff :z #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s5-8 (new 'stack 'interp-test-info)) + (s4-5 (new-stack-vector0)) + ) + (when (and (cam-slave-get-vector-with-offset arg0 (-> s5-8 origin) 'pivot) + (cam-slave-get-vector-with-offset arg0 (-> s5-8 to) 'align) + (cam-slave-get-vector-with-offset arg0 (-> s5-8 from) 'trans) + ) + (camera-line (-> s5-8 from) (-> s5-8 origin) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) + (camera-line (-> s5-8 to) (-> s5-8 origin) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) + (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) + (vector-! (-> s5-8 to) (-> s5-8 to) (-> s5-8 origin)) + (vector-cross! s4-5 (-> s5-8 from) (-> s5-8 to)) + (vector-normalize! s4-5 8192.0) + (vector+! s4-5 s4-5 (-> s5-8 origin)) + (camera-line (-> s5-8 origin) s4-5 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) + (when (not (paused?)) + (+! (-> *CAM_LAYOUT-bank* debug-t) (-> *CAM_LAYOUT-bank* debug-step)) + (if (< 1.0 (-> *CAM_LAYOUT-bank* debug-t)) + (set! (-> *CAM_LAYOUT-bank* debug-t) 0.0) + ) + ) + (set! (-> s5-8 axis) #f) + (set! (-> s5-8 disp) "li") + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) vector-lerp!) s5-8) + (set! (-> s5-8 disp) "si") + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) v-slrp!) s5-8) + (set! (-> s5-8 disp) "si2") + (set! (-> s5-8 color) (new 'static 'vector4w :z #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8) + (set! (-> s5-8 disp) "si3") + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :z #xff :w #x80)) + (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8) + (set! (-> s5-8 axis) (-> *camera* local-down)) + (set! (-> s5-8 disp) "si2d") + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :z #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8) + (set! (-> s5-8 disp) "si3d") + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :y #xff :w #x80)) + (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8) + ) + ) + (none) + ) + +(defun clmf-button-test () + "Displays the message `button test`" + (cam-layout-print 16 *camera-layout-message-ypos* "button test") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (set-setting! 'master-options 'set 0 32) + #f + ) + +(defun clmf-bna () + "Displays the message `button not available`" + (cam-layout-print 16 *camera-layout-message-ypos* "button not applicable") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (set-setting! 'master-options 'set 0 32) + #t + ) + +(defun clmf-implement () + "Displays the message `button not implemented yet`" + (cam-layout-print 16 *camera-layout-message-ypos* "button not implemented yet") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (set-setting! 'master-options 'set 0 32) + #t + ) + +(defun clmf-input ((arg0 vector) (arg1 vector) (arg2 int)) + (vector-reset! arg0) + (vector-reset! arg1) + (cond + ((cpad-hold? arg2 l3) + (set! (-> arg0 z) + (- (-> arg0 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) 128.0 48.0 110.0 1.0)) + ) + ) + (else + (set! (-> arg0 y) + (- (-> arg0 y) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) 128.0 48.0 110.0 1.0)) + ) + (+! (-> arg0 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 righty)) 128.0 48.0 110.0 1.0)) + (set! (-> arg1 x) + (- (-> arg1 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 leftx)) 128.0 48.0 110.0 1.0)) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? arg2 r1) + (set! (-> arg1 y) + (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 9)) 0.0 32.0 230.0 0.5) (-> arg1 y)) + ) + ) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? arg2 l1) + (set! (-> arg1 y) + (- (-> arg1 y) (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 8)) 0.0 32.0 230.0 0.5))) + ) + ) + ) + (set! (-> arg1 z) + (- (-> arg1 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 lefty)) 128.0 48.0 110.0 1.0)) + ) + ) + ) + (let ((s5-1 (new-stack-matrix0))) + (let ((a2-8 (new-stack-vector0))) + (set! (-> a2-8 y) -1.0) + (forward-down-nopitch->inv-matrix s5-1 (-> *math-camera* inv-camera-rot vector 2) a2-8) + ) + (vector-matrix*! arg1 arg1 s5-1) + ) + arg1 + ) + +(defbehavior clmf-pos-rot cam-layout ((arg0 symbol) (arg1 symbol)) + (local-vars (s2-0 structure) (s3-1 vector) (sv-192 matrix)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (cam-layout-print 16 *camera-layout-message-ypos* "x/z pos: left stick, down: l1, up: r1") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (when (and arg1 (nonzero? arg1)) + (cam-layout-print 16 *camera-layout-message-ypos* "x/y rot: right stick") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (cam-layout-print 16 *camera-layout-message-ypos* "z rot: press left stick & move right") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + ) + (let ((s5-0 (new-stack-vector0)) + (s4-0 (new-stack-vector0)) + ) + (set! s3-1 + (cond + ((or (zero? arg0) (not arg0)) + (the-as vector #f) + ) + (else + (if (not (res-lump-struct (-> self cam-entity) arg0 structure)) + (add-data! + (-> self cam-entity) + (the-as + 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 pointer (new 'static 'vector4w)) + ) + ) + (set! s3-1 (res-lump-struct (-> self cam-entity) arg0 vector)) + (when (and (not s3-1) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (clear *temp-string*) + (format *temp-string* "ERROR : can't add ~A" 'vector) + (cam-layout-print 120 100 *temp-string*) + ) + s3-1 + ) + ) + ) + (set! s2-0 + (cond + ((or (zero? arg1) (not arg1)) + (the-as structure #f) + ) + (else + (if (not (res-lump-struct (-> self cam-entity) arg1 structure)) + (add-data! + (-> self cam-entity) + (the-as + 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)) + ) + ) + (the-as pointer (quaternion-identity! (new 'static 'quaternion))) + ) + ) + (set! s2-0 (res-lump-struct (-> self cam-entity) arg1 structure)) + (when (and (not s2-0) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (clear *temp-string*) + (format *temp-string* "ERROR : can't add ~A" 'quaternion) + (cam-layout-print 120 100 *temp-string*) + ) + s2-0 + ) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'matrix))) + (set! sv-192 (new 'stack-no-clear 'matrix)) + (let ((s0-1 (new 'stack-no-clear 'vector))) + (if (not s3-1) + (return #f) + ) + (clmf-input s5-0 s4-0 0) + (let ((v1-37 s3-1)) + (let ((f0-0 409.6)) + (.lvf vf2 (&-> s4-0 quad)) + (.lvf vf1 (&-> s3-1 quad)) + (let ((a0-34 f0-0)) + (.mov vf3 a0-34) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-37 quad) vf4) + ) + (cond + ((not arg1) + (the-as quaternion #f) + ) + ((zero? arg1) + (the-as quaternion #f) + ) + (else + (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) sv-192) + (vector-float*! s5-0 s5-0 100.0) + (matrix-rotate-x! s1-1 (- (-> s5-0 x))) + (matrix*! sv-192 s1-1 sv-192) + (matrix-rotate-y! s1-1 (-> s5-0 y)) + (matrix*! sv-192 sv-192 s1-1) + (matrix-rotate-z! s1-1 (- (-> s5-0 z))) + (matrix*! sv-192 s1-1 sv-192) + (matrix->quaternion (the-as quaternion s0-1) sv-192) + (quaternion-inverse! (the-as quaternion s2-0) (the-as quaternion (-> self cam-entity connect))) + (quaternion*! (the-as quaternion s2-0) (the-as quaternion s0-1) (the-as quaternion s2-0)) + (quaternion-normalize! (the-as quaternion s2-0)) + ) + ) + ) + ) + ) + (set-setting! 'master-options 'set 0 32) + #t + ) + ) + +(defbehavior clmf-next-volume cam-layout ((arg0 int)) + (if (zero? (-> self num-volumes)) + (return #f) + ) + (set! (-> self cur-volume) (mod (+ arg0 (-> self cur-volume)) (-> self num-volumes))) + (while (< (-> self cur-volume) 0) + (+! (-> self cur-volume) (-> self num-volumes)) + ) + #t + ) + +(defun clmf-next-vol-dpad () + (local-vars (a0-1 int)) + (cam-layout-print 16 *camera-layout-message-ypos* "dpad selects volume") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (cond + ((cpad-pressed? 0 down) + (set! a0-1 1) + ) + ((cpad-pressed? 0 right) + (set! a0-1 1) + ) + ((cpad-pressed? 0 up) + (set! a0-1 -1) + ) + ((cpad-pressed? 0 left) + (set! a0-1 -1) + ) + (else + (set! a0-1 0) + ) + ) + (clmf-next-volume a0-1) + (set-setting! 'master-options 'set 0 32) + #t + ) + +(defun clmf-to-edit-cam () + (clmf-next-volume 0) + (set! *clm* *clm-edit*) + #t + ) + +(define *last-cur-entity* -1) + +(defbehavior clmf-next-entity cam-layout ((arg0 int)) + (let ((v1-0 (/ arg0 8))) + (when (zero? (-> self num-entities)) + (set! (-> self cam-entity) #f) + (return #f) + ) + (if (= (- v1-0) (-> self num-entities)) + (set! v1-0 -1) + ) + (if (= v1-0 (-> self num-entities)) + (set! v1-0 1) + ) + (set! (-> self cur-entity) (mod (+ v1-0 (-> self cur-entity)) (-> self num-entities))) + ) + (while (< (-> self cur-entity) 0) + (+! (-> self cur-entity) (-> self num-entities)) + ) + (set! *last-cur-entity* (-> self cur-entity)) + (let ((v1-8 (-> self cur-entity)) + (a0-13 (-> *camera-engine* alive-list next0)) + ) + *camera-engine* + (let ((a1-3 (-> a0-13 next0))) + (while (!= a0-13 (-> *camera-engine* alive-list-end)) + (let ((a0-14 (-> (the-as connection a0-13) param1))) + (cond + ((zero? v1-8) + (set! (-> self cam-entity) (the-as entity-camera a0-14)) + (set! *volume-descriptor-current* 0) + (set! *volume-point-current* 0) + (set! *volume-normal-current* 0) + (set! (-> self num-volumes) 0) + (cam-layout-entity-volume-info-create (-> self cam-entity) 'vol) + (set! (-> self first-pvol) (-> self num-volumes)) + (cam-layout-entity-volume-info-create (-> self cam-entity) 'pvol) + (set! (-> self first-cutoutvol) (-> self num-volumes)) + (cam-layout-entity-volume-info-create (-> self cam-entity) 'cutoutvol) + (set! (-> *CAM_LAYOUT-bank* intro-step) (cam-slave-get-intro-step (-> self cam-entity))) + (return #f) + ) + (else + (+! v1-8 -1) + ) + ) + ) + (set! a0-13 a1-3) + *camera-engine* + (set! a1-3 (-> a1-3 next0)) + ) + ) + ) + #t + ) + +(defun clmf-to-spline-attr () + (set! *clm* *clm-spline-attr*) + #t + ) + +(defun clmf-to-intro-attr () + (set! *clm* *clm-intro-attr*) + #t + ) + +(defun clmf-to-index-attr () + (set! *clm* *clm-index-attr*) + #t + ) + +(defun clmf-to-focalpull-attr () + (set! *clm* *clm-focalpull-attr*) + #t + ) + +(defbehavior clmf-to-edit cam-layout () + (set! (-> self res-key) -1000000000.0) + (set! *clm* *clm-edit*) + #t + ) + +(defun clmf-to-select () + (set! *camera-layout-blink* #f) + (set! *clm* *clm-select*) + #t + ) + +(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) + (set! (-> *camera-other-root* quad) (-> *camera-other-trans* quad)) + (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) *camera-other-matrix*) + (set! *camera-look-through-other* 10) + (set-setting! 'master-options 'set 0 32) + #f + ) + +(defun fov->maya ((arg0 float)) + (if (= arg0 0.0) + 0.0 + (/ 12.700255 (tan (* 0.5 arg0))) + ) + ) + +;; 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)) + (s5-0 (res-lump-struct arg2 'rot-offset vector)) + ) + (if arg0 + (format #t "setup rot ~f ~f ~f ~f~%" (-> s3-0 x) (-> s3-0 y) (-> s3-0 z) (-> s3-0 w)) + ) + (when s5-0 + (if arg0 + (format #t "rot offset ~f ~f ~f ~f~%" (-> s5-0 x) (-> s5-0 y) (-> s5-0 z) (-> s5-0 w)) + ) + (format + arg1 + " tag rot-offset ~f ~f ~f ~f // vector (quaternion)~%" + (-> s5-0 x) + (-> s5-0 y) + (-> s5-0 z) + (-> s5-0 w) + ) + ) + ) + (none) + ) + +;; 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)) + (s5-0 (method-of-type res-lump get-property-struct)) + (s2-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'trans '-offset) + (let ((s5-1 (the-as object (s5-0 + s2-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (let ((s2-1 (the-as object (res-lump-struct arg2 'translation_info vector))) + (s3-1 (new-stack-vector0)) + ) + (if arg0 + (format #t "setup trans ~M ~M ~M (maya)~%" (-> s1-0 x) (-> s1-0 y) (-> s1-0 z)) + ) + (set! (-> s3-1 quad) (-> s1-0 quad)) + (when (the-as vector s5-1) + (if arg0 + (format + #t + "offset ~M ~M ~M (added)~%" + (-> (the-as vector s5-1) x) + (-> (the-as vector s5-1) y) + (-> (the-as vector s5-1) z) + ) + ) + (vector+! s3-1 s3-1 (the-as vector s5-1)) + ) + (when (the-as vector s2-1) + (if arg0 + (format + #t + "level-trans ~M ~M ~M (subtracted)~%" + (-> (the-as vector s2-1) x) + (-> (the-as vector s2-1) y) + (-> (the-as vector s2-1) z) + ) + ) + (vector-! s3-1 s3-1 (the-as vector s2-1)) + ) + (set! s2-1 (or (the-as vector s5-1) s2-1)) + (set! arg0 (and (the-as symbol s2-1) arg0)) + (if arg0 + (format #t "final trans ~M ~M ~M (maya)~%" (-> s3-1 x) (-> s3-1 y) (-> s3-1 z)) + ) + ) + (if (the-as vector s5-1) + (format + arg1 + " tag trans-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> (the-as vector s5-1) x) + (-> (the-as vector s5-1) y) + (-> (the-as vector s5-1) z) + ) + ) + ) + ) + (none) + ) + +;; 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)) + (s4-0 (method-of-type res-lump get-property-struct)) + ) + (format (clear *res-key-string*) "~S~S" 'pivot '-offset) + (let ((s5-1 (the-as vector (s4-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (s4-1 (new-stack-vector0)) + ) + (when s2-0 + (if s5-1 + (vector+! s4-1 s2-0 s5-1) + (set! (-> s4-1 quad) (-> s2-0 quad)) + ) + (if arg0 + (format #t "setup pivot ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) + ) + (when s5-1 + (when arg0 + (format #t "offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + (format #t "final pivot ~M ~M ~M~%" (-> s4-1 x) (-> s4-1 y) (-> s4-1 z)) + ) + (format + arg1 + " tag pivot-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + ) + (none) + ) + +;; 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)) + (s4-0 (method-of-type res-lump get-property-struct)) + ) + (format (clear *res-key-string*) "~S~S" 'align '-offset) + (let ((s5-1 (the-as vector (s4-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (s4-1 (new-stack-vector0)) + ) + (when s2-0 + (if s5-1 + (vector+! s4-1 s2-0 s5-1) + (set! (-> s4-1 quad) (-> s2-0 quad)) + ) + (if arg0 + (format #t "setup align ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) + ) + (when s5-1 + (when arg0 + (format #t "offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + (format #t "final align ~M ~M ~M~%" (-> s4-1 x) (-> s4-1 y) (-> s4-1 z)) + ) + (format + arg1 + " tag align-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + ) + (none) + ) + +;; 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)) + (s4-0 (method-of-type res-lump get-property-struct)) + ) + (format (clear *res-key-string*) "~S~S" 'interesting '-offset) + (let ((s5-1 (the-as vector (s4-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (s4-1 (new-stack-vector0)) + ) + (when s2-0 + (if s5-1 + (vector+! s4-1 s2-0 s5-1) + (set! (-> s4-1 quad) (-> s2-0 quad)) + ) + (if arg0 + (format #t "setup interesting ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) + ) + (when s5-1 + (when arg0 + (format #t "offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + (format #t "final interesting ~M ~M ~M~%" (-> s4-1 x) (-> s4-1 y) (-> s4-1 z)) + ) + (format + arg1 + " tag interesting-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'fov '-offset) + (let ((f30-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (cond + ((= f28-0 0.0) + (if arg0 + (format #t "setup fov deg 0.0 (defaults to 64.0)~%") + ) + (set! f28-0 11650.845) + ) + (arg0 + (format #t "setup fov deg ~R (~f in maya)~%" f28-0 (fov->maya f28-0)) + ) + ) + (when (!= f30-0 0.0) + (when arg0 + (format #t "offset ~R~%" f30-0) + (format #t "final ~R (~f in maya) ~%" (+ f28-0 f30-0) (fov->maya (+ f28-0 f30-0))) + ) + (format arg1 " tag fov-offset DEG(~R) // float~%" f30-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'focalPull '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup focalPull deg ~R (~f in maya)~%" f30-0 (fov->maya f30-0)) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~R~%" f28-0) + (format #t "final ~R (~f in maya) ~%" (+ f30-0 f28-0) (fov->maya (+ f30-0 f28-0))) + ) + (format arg1 " tag focalPull-offset DEG(~R) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s5-0 (method-of-type res-lump get-property-value)) + (s1-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-on) + (let ((s5-1 (s5-0 + s1-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s1-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-off) + (let ((s3-1 (s1-1 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (format #t "setup flags ") + (cam-slave-options->string (the-as cam-slave-options s4-0) #t) + (format #t "~%") + (format #t "forced on ") + (cam-slave-options->string (the-as cam-slave-options s5-1) #t) + (format #t "~%") + (format #t "forced off ") + (cam-slave-options->string (the-as cam-slave-options s3-1) #t) + (format #t "~%") + (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) + (format #t "final ") + (cam-slave-options->string (the-as cam-slave-options s4-1) #t) + ) + (format #t "~%") + ) + (format arg1 " tag flags-on 0x~X // int32~%" s5-1) + (format arg1 " tag flags-off 0x~X // int32~%" s3-1) + ) + ) + ) + (none) + ) + +;; 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)) + (s5-0 (method-of-type res-lump get-property-value)) + (s1-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'focalpull-flags '-on) + (let ((s5-1 (s5-0 + s1-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s1-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'focalpull-flags '-off) + (let ((s3-1 (s1-1 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (format #t "setup focalpull-flags ") + (cam-index-options->string (the-as cam-index-options s4-0) #t) + (format #t "~%") + (format #t "forced on ") + (cam-index-options->string (the-as cam-index-options s5-1) #t) + (format #t "~%") + (format #t "forced off ") + (cam-index-options->string (the-as cam-index-options s3-1) #t) + (format #t "~%") + (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) + (format #t "final ") + (cam-index-options->string (the-as cam-index-options s4-1) #t) + ) + (format #t "~%") + ) + (format arg1 " tag focalpull-flags-on 0x~X // int32~%" s5-1) + (format arg1 " tag focalpull-flags-off 0x~X // int32~%" s3-1) + ) + ) + ) + (none) + ) + +;; 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)) + (s5-0 (method-of-type res-lump get-property-value)) + (s1-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'campoints-flags '-on) + (let ((s5-1 (s5-0 + s1-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s1-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'campoints-flags '-off) + (let ((s3-1 (s1-1 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (format #t "setup campoints-flags ") + (cam-index-options->string (the-as cam-index-options s4-0) #t) + (format #t "~%") + (format #t "forced on ") + (cam-index-options->string (the-as cam-index-options s5-1) #t) + (format #t "~%") + (format #t "forced off ") + (cam-index-options->string (the-as cam-index-options s3-1) #t) + (format #t "~%") + (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) + (format #t "final ") + (cam-index-options->string (the-as cam-index-options s4-1) #t) + ) + (format #t "~%") + ) + (format arg1 " tag campoints-flags-on 0x~X // int32~%" s5-1) + (format arg1 " tag campoints-flags-off 0x~X // int32~%" s3-1) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'intro-time '-offset) + (let ((f30-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (cond + ((= f28-0 0.0) + (if arg0 + (format #t "setup intro-time 0.0 (defaults to 1 sec)~%") + ) + (set! f28-0 1.0) + ) + (arg0 + (format #t "setup intro-time ~f~%" f28-0) + ) + ) + (when (!= f30-0 0.0) + (when arg0 + (format #t "offset ~f~%" f30-0) + (format #t "final ~f~%" (+ f28-0 f30-0)) + ) + (format arg1 " tag intro-time-offset SECONDS(~f) // float~%" f30-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'intro-exitValue '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (if (= f30-0 0.0) + (format #t "setup intro-exitValue 0.0 (defaults to 0.5)~%") + (format #t "setup intro-exitValue ~f~%" f30-0) + ) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~f~%" f28-0) + (format #t "final ~f~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag intro-exitValue-offset ~f // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'interpTime '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup interpTime ~f~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~f~%" f28-0) + (format #t "final ~f~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag interpTime-offset SECONDS(~f) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (let ((s5-1 (res-lump-struct arg2 'spline-offset vector))) + (when s5-1 + (if arg0 + (format #t "spline offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + ) + (format + arg1 + " tag spline-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + (none) + ) + +;; 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))) + (when (the int f30-0) + (if arg0 + (format #t "spline follow dist offset ~M~%" f30-0) + ) + (format arg1 " tag spline-follow-dist-offset METERS(~M)~%" f30-0) + ) + ) + (none) + ) + +;; 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))) + (when s5-0 + (if arg0 + (format #t "index offset ~M ~M ~M~%" (-> s5-0 x) (-> s5-0 y) (-> s5-0 z)) + ) + (format + arg1 + " tag campoints-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-0 x) + (-> s5-0 y) + (-> s5-0 z) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'tiltAdjust '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup tiltAdjust deg ~R~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~R~%" f28-0) + (format #t "final ~R~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag tiltAdjust-offset DEG(~R) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMinLength '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMinLength ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMinLength-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMaxLength '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMaxLength ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMaxLength-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMinHeight '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMinHeight ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMinHeight-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMaxHeight '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMaxHeight ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMaxHeight-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringCliffHeight '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringCliffHeight ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringCliffHeight-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (none) + ) + +;; 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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'maxAngle '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup maxAngle ~R~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~R~%" f28-0) + (format #t "final ~R~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag maxAngle-offset DEG(~R) // float~%" f28-0) + ) + ) + ) + (none) + ) + +(defbehavior clmf-save-single cam-layout ((arg0 entity-camera) (arg1 symbol) (arg2 symbol)) + (clear *temp-string*) + (if arg2 + (format *temp-string* "db/caminfo/~s.cam" (res-lump-struct arg0 'name structure)) + (format *temp-string* "db/caminfo/garbage") + ) + (let ((s4-2 (new 'stack 'file-stream *temp-string* 'write))) + (if arg1 + (format #t "---------camera '~S'------------~%" (res-lump-struct arg0 'name structure)) + ) + (format s4-2 "#include /jak2/db/config/standard.m2d~%") + (format s4-2 "camera ~s {~%" (res-lump-struct arg0 'name structure)) + (cam-layout-save-cam-rot arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-cam-trans arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-pivot arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-align arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-interesting arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-fov arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-focalpull arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-flags arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-introsplinetime arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-introsplineexitval arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-interptime arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-splineoffset arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-spline-follow-dist-offset arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-campointsoffset arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-tiltAdjust arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMinLength arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMaxLength arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMinHeight arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMaxHeight arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringCliffHeight arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-maxAngle arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-campoints-flags arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-focalpull-flags arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (format s4-2 "}~%") + (file-stream-close s4-2) + ) + ) + +(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)) + ) + (if s5-1 + (format #t "~%~%~%=================================~%") + ) + (clmf-save-single (-> self cam-entity) s5-1 gp-1) + (if s5-1 + (format #t "===============================~%~%~%~%") + ) + (if gp-1 + (format #t "'~S' save completed~%" (res-lump-struct (-> self cam-entity) 'name structure)) + ) + ) + #t + ) + +(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)) + ) + (if s5-1 + (format #t "~%~%~%=================================~%") + ) + (let ((v1-5 (-> *camera-engine* alive-list next0))) + *camera-engine* + (let ((s4-0 (-> v1-5 next0))) + (while (!= v1-5 (-> *camera-engine* alive-list-end)) + (let ((a0-4 (-> (the-as connection v1-5) param1))) + (clmf-save-single (the-as entity-camera a0-4) s5-1 gp-1) + ) + (set! v1-5 s4-0) + *camera-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (if s5-1 + (format #t "===============================~%~%~%~%") + ) + (if gp-1 + (format #t "camera save all completed~%") + ) + ) + #t + ) + +(deftype clmf-cam-flag-toggle-info (structure) + ((key float :offset-assert 0) + (force-on int32 :offset-assert 4) + (force-off int32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(defmethod inspect clmf-cam-flag-toggle-info ((obj clmf-cam-flag-toggle-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'clmf-cam-flag-toggle-info) + (format #t "~1Tkey: ~f~%" (-> obj key)) + (format #t "~1Tforce-on: ~D~%" (-> obj force-on)) + (format #t "~1Tforce-off: ~D~%" (-> obj force-off)) + (label cfg-4) + obj + ) + +(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)) + ) + (set! (-> gp-0 key) (-> self res-key)) + (cond + ((and (= arg1 'vol-flags) (>= (-> self res-key) (the float (-> self first-cutoutvol)))) + (set! (-> gp-0 key) (- (-> gp-0 key) (the float (-> self first-cutoutvol)))) + (set! arg1 (the-as int 'cutoutvol-flags)) + ) + ((and (= arg1 'vol-flags) (>= (-> self res-key) (the float (-> self first-pvol)))) + (set! (-> gp-0 key) (- (-> gp-0 key) (the float (-> self first-pvol)))) + (set! arg1 (the-as int 'pvol-flags)) + ) + ) + (let ((s3-0 (method-of-type res-lump get-property-value)) + (s2-0 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-on) + (set! (-> gp-0 force-on) (the-as int (s3-0 + s2-0 + (string->symbol *res-key-string*) + 'exact + (-> gp-0 key) + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (let ((s3-1 (method-of-type res-lump get-property-value)) + (s2-1 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-off) + (set! (-> gp-0 force-off) (the-as int (s3-1 + s2-1 + (string->symbol *res-key-string*) + 'exact + (-> gp-0 key) + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (cond + ((logtest? (-> gp-0 force-off) s4-0) + (logclear! (-> gp-0 force-off) s4-0) + (logior! (-> gp-0 force-on) s4-0) + (let* ((s4-1 (-> self cam-entity)) + (s3-2 (method-of-object s4-1 add-32bit-data!)) + (s2-2 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-2 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-off) + (s3-2 + s4-1 + (the-as + res-tag + (make-u128 s2-2 (logior s1-2 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-off) + ) + ) + (let* ((s4-2 (-> self cam-entity)) + (s3-3 (method-of-object s4-2 add-32bit-data!)) + (s2-3 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-3 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-on) + (s3-3 + s4-2 + (the-as + res-tag + (make-u128 s2-3 (logior s1-3 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-on) + ) + ) + ) + ((logtest? (-> gp-0 force-on) s4-0) + (logclear! (-> gp-0 force-on) s4-0) + (let* ((s4-3 (-> self cam-entity)) + (s3-4 (method-of-object s4-3 add-32bit-data!)) + (s2-4 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-4 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-on) + (s3-4 + s4-3 + (the-as + res-tag + (make-u128 s2-4 (logior s1-4 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-on) + ) + ) + ) + (else + (logior! (-> gp-0 force-off) s4-0) + (let* ((s4-4 (-> self cam-entity)) + (s3-5 (method-of-object s4-4 add-32bit-data!)) + (s2-5 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-5 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-off) + (s3-5 + s4-4 + (the-as + res-tag + (make-u128 s2-5 (logior s1-5 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-off) + ) + ) + ) + ) + ) + #t + ) + +(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)) + ) + (cond + ((and (= arg2 'vol-flags) (>= (-> self res-key) (the float (-> self first-cutoutvol)))) + (set! f30-0 (- f30-0 (the float (-> self first-cutoutvol)))) + (set! arg2 (the-as uint 'cutoutvol-flags)) + ) + ((and (= arg2 'vol-flags) (>= (-> self res-key) (the float (-> self first-pvol)))) + (set! f30-0 (- f30-0 (the float (-> self first-pvol)))) + (set! arg2 (the-as uint 'pvol-flags)) + ) + ) + (let ((s3-0 (method-of-type res-lump get-property-value)) + (s2-0 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg2) '-off) + (cond + ((logtest? (s3-0 + s2-0 + (string->symbol *res-key-string*) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) + (format arg0 ": off") + ) + ((let ((s3-1 (method-of-type res-lump get-property-value)) + (s2-1 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg2) '-on) + (logtest? (s3-1 + s2-1 + (string->symbol *res-key-string*) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) + ) + (format arg0 ": on") + ) + ((zero? (logand ((method-of-type res-lump get-property-value) + (-> self cam-entity) + (the-as symbol arg2) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) + ) + (format arg0 ": off(maya)") + ) + (else + (format arg0 ": on(maya)") + ) + ) + ) + ) + #t + ) + +(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)) + (let ((f30-0 (res-lump-float (-> self cam-entity) arg0)) + (f0-0 (-> arg1 0)) + ) + (if (= f0-0 0.0) + (set! f0-0 1.0) + ) + (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)) + ) + ) + f0-2 + ) + ) + ) + (set-setting! 'master-options 'set 0 32) + #t + ) + +(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) + ) + #t + ) + +(defbehavior clmf-cam-fov cam-layout ((arg0 degrees) (arg1 symbol)) + (format arg0 ": ~R" (cam-slave-get-fov (-> self cam-entity))) + #t + ) + +(defbehavior clmf-cam-deg cam-layout ((arg0 degrees) (arg1 symbol)) + (format arg0 ": ~R" (cam-slave-get-float (-> self cam-entity) arg1 0.0)) + #t + ) + +(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)) + (set! (-> *CAM_LAYOUT-bank* intro-step) f30-0) + ) + #t + ) + +(defbehavior clmf-cam-interp-time cam-layout ((arg0 float) (arg1 symbol)) + (format arg0 ": ~f" (cam-slave-get-interp-time (-> self cam-entity))) + #t + ) + +(defbehavior clmf-cam-float cam-layout ((arg0 float) (arg1 symbol)) + (format arg0 ": ~f" (cam-slave-get-float (-> self cam-entity) arg1 0.0)) + #t + ) + +(defbehavior clmf-cam-string cam-layout ((arg0 string) (arg1 symbol)) + (local-vars (r0-0 uint128) (v1-5 uint128) (sv-16 int)) + (format arg0 ":") + (set! sv-16 0) + (let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (when s5-1 + (let ((s4-0 0)) + (while (begin + (let ((v1-4 (the-as uint128 sv-16))) + (.pcpyud v1-5 v1-4 r0-0) + ) + (< s4-0 (shr (* (the-as int v1-5) 2) 49)) + ) + (format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4))))) + (+! s4-0 1) + ) + ) + ) + ) + #t + ) + +(define *clm-focalpull-attr* + (new 'static 'clm + :title "---focalpull attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "radial " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 16 + :val-parm1 'focalpull-flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 16 + :parm1 'focalpull-flags + ) + ) + ) + (new 'static 'clm-list-item + :description "spherical " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 8 + :val-parm1 'focalpull-flags + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1 'focalpull-flags + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-index-attr* + (new 'static 'clm + :title "---index attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "radial " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 16 + :val-parm1 'campoints-flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 16 + :parm1 'campoints-flags + ) + ) + ) + (new 'static 'clm-list-item + :description "spherical " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 8 + :val-parm1 'campoints-flags + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1 'campoints-flags + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-intro-attr* + (new 'static 'clm + :title "---intro attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "time " + :track-val #f + :val-func 'clmf-cam-intro-time + :val-parm0-symbol 'intro-time + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'intro-time-offset + :parm1-basic (new 'static 'bfloat :data 0.01) + ) + ) + ) + (new 'static 'clm-list-item + :description "exitValue" + :track-val #f + :val-func 'clmf-cam-float + :val-parm0-symbol 'intro-exitValue + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'intro-exitValue-offset + :parm1-basic (new 'static 'bfloat :data 0.001) + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-spline-attr* + (new 'static 'clm + :title "---spline attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "followDist" + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'spline-follow-dist + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'spline-follow-dist-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-cam-attr* + (new 'static 'clm + :title "---camera attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "drag " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x400 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x400 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "fov " + :track-val #f + :val-func 'clmf-cam-fov + :val-parm0-symbol 'fov + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'fov-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "focalPull " + :track-val #f + :val-func 'clmf-cam-deg + :val-parm0-symbol 'focalPull + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'focalPull-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "interpTime " + :track-val #f + :val-func 'clmf-cam-interp-time + :val-parm0-symbol 'interpTime + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'interpTime-offset + :parm1-basic (new 'static 'bfloat :data 0.01) + ) + ) + ) + (new 'static 'clm-list-item + :description "sameSide " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 16 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-cam-flag-toggle :parm0 16 :parm1 'flags) + ) + ) + (new 'static 'clm-list-item + :description "spherical " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 32 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-cam-flag-toggle :parm0 32 :parm1 'flags) + ) + ) + (new 'static 'clm-list-item + :description "MinLength " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMinLength + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMinLength-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "MaxLength " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMaxLength + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMaxLength-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "MinHeight " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMinHeight + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMinHeight-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "MaxHeight " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMaxHeight + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMaxHeight-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "cliffHeight" + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringCliffHeight + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringCliffHeight-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "alternates " + :track-val #f + :val-func 'clmf-cam-string + :val-parm0-symbol 'alternates + :actions (new 'static 'boxed-array :type clm-item-action) + ) + (new 'static 'clm-list-item + :description "maxAngle " + :track-val #f + :val-func 'clmf-cam-deg + :val-parm0-symbol 'maxAngle + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'maxAngle-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "shrinkAngle" + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x4000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x4000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "noRotate " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x20000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x20000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "tiltAdjust " + :track-val #f + :val-func 'clmf-cam-deg + :val-parm0-symbol 'tiltAdjust + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'tiltAdjust-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "stickyAngle" + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x40000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x40000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "easeSpline " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x1000000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x1000000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "jumpPitch " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x80 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x80 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "rapid " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x800000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x800000 + :parm1 'flags + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-cam-lookthrough* + (new 'static 'clm + :title "---cam-lookthrough---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " " + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x4 :func 'clmf-look-through) + ) + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-edit) + ) + (new 'static 'clm-item + :description "pos/rot" + :button-symbol 'x + :action (new 'static 'clm-item-action + :button #x4000 + :options #x8 + :func 'clmf-pos-rot + :parm0-symbol 'trans-offset + :parm1 'rot-offset + ) + ) + (new 'static 'clm-item + :description " adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "fov" + :track-val #f + :val-func 'clmf-cam-fov + :val-parm0-symbol 'fov + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'fov-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-edit* + (new 'static 'clm + :title "---edit---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-select) + ) + (new 'static 'clm-item + :description "attributes" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func #f) + ) + (new 'static 'clm-item + :description " edit part" + :button-symbol 'circle + :action (new 'static 'clm-item-action :button #x2000 :options #x1 :func #f) + ) + (new 'static 'clm-item + :description "scale/next" + :button-symbol 'r2 + :action (new 'static 'clm-item-action :button #x200 :func #f) + ) + (new 'static 'clm-item + :description " pos/rot" + :button-symbol 'l2 + :action (new 'static 'clm-item-action :button #x100 :func #f) + ) + (new 'static 'clm-list + :tracker '*camera-layout-blink* + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "camera " + :track-val 'camera + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func '*clm-cam-attr*) + (new 'static 'clm-item-action :button #x2000 :func '*clm-cam-lookthrough*) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action + :button #x100 + :func 'clmf-pos-rot + :parm0-symbol 'trans-offset + :parm1 'rot-offset + ) + ) + ) + (new 'static 'clm-list-item + :description "align " + :track-val 'align + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'align-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "pivot " + :track-val 'pivot + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'pivot-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "interesting" + :track-val 'interesting + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'interesting-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "spline " + :track-val 'spline + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-spline-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'spline-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "intro " + :track-val 'intro + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-intro-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-implement) + ) + ) + (new 'static 'clm-list-item + :description "index " + :track-val 'index + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-index-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'campoints-offset) + ) + ) + (new 'static 'clm-list-item + :description "focalpull" + :track-val 'focalpull + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-focalpull-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-implement) + ) + ) + ) + ) + ) + ) + ) + +(define *clm-save-all* + (new 'static 'clm + :title "---save all?---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " save all" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-all :parm0 16) + ) + (new 'static 'clm-item + :description "print all" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-all :parm0 8) + ) + (new 'static 'clm-item + :description " done" + :button-symbol 'triangle + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + ) + ) + ) + ) + +(define *clm-save-one* + (new 'static 'clm + :title "---single save?---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " single save" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-one :parm0 16) + ) + (new 'static 'clm-item + :description "single print" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-one :parm0 8) + ) + (new 'static 'clm-item + :description " done" + :button-symbol 'triangle + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + ) + ) + ) + ) + +(define *clm-select* + (new 'static 'clm + :title "---camera---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " edit" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x3 :func 'clmf-to-edit-cam) + ) + (new 'static 'clm-item + :description "save one" + :button-symbol 'triangle + :action (new 'static 'clm-item-action :button #x1000 :options #x3 :func '*clm-save-one*) + ) + (new 'static 'clm-item + :description " quit" + :button-symbol 'circle + :action (new 'static 'clm-item-action :button #x2000 :options #x11 :func 'cam-layout-stop) + ) + (new 'static 'clm-item + :description " next" + :button-symbol 'down + :action (new 'static 'clm-item-action :button #x40 :options #x3 :func 'clmf-next-entity :parm0 8) + ) + (new 'static 'clm-item + :description " prev" + :button-symbol 'up + :action (new 'static 'clm-item-action :button #x10 :options #x3 :func 'clmf-next-entity :parm0 -8) + ) + (new 'static 'clm-item + :description " next 5" + :button-symbol 'right + :action (new 'static 'clm-item-action :button #x20 :options #x3 :func 'clmf-next-entity :parm0 40) + ) + (new 'static 'clm-item + :description " prev 5" + :button-symbol 'left + :action (new 'static 'clm-item-action :button #x80 :options #x3 :func 'clmf-next-entity :parm0 -40) + ) + ) + ) + ) + +(define *clm* *clm-select*) + +(defbehavior cam-layout-do-action cam-layout ((arg0 clm-item-action)) + (let ((s5-0 (-> arg0 func value))) + (cond + ((not s5-0) + #f + ) + ((zero? s5-0) + #f + ) + ((and (not (-> self cam-entity)) (logtest? (-> arg0 options) 2)) + #f + ) + ((and (logtest? (-> arg0 options) 8) (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + #f + ) + ((and (zero? (logand (-> 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)) + (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + ) + #f + ) + ((and (logtest? (-> arg0 options) 16) + (let ((a1-3 (-> *cpad-list* cpads 0))) + (not (logtest? (logclear (-> a1-3 button0-abs 1) (-> a1-3 button0-abs 0)) (-> arg0 button))) + ) + ) + #f + ) + ((type? s5-0 clm) + (set! *clm* (the-as clm s5-0)) + #t + ) + ((type? s5-0 function) + ((the-as (function object symbol symbol) s5-0) (-> arg0 parm0) (-> arg0 parm1)) + ) + ) + ) + ) + +(defbehavior cam-layout-function-call cam-layout ((arg0 symbol) (arg1 string) (arg2 int) (arg3 basic)) + (let ((gp-0 (-> arg0 value))) + (cond + ((not gp-0) + ) + ((zero? gp-0) + ) + ((type? gp-0 function) + ((the-as (function string int basic none) gp-0) arg1 arg2 arg3) + ) + ) + ) + #f + ) + +(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)) + (if (< 1.01 (-> *CAM_LAYOUT-bank* spline-t)) + (set! (-> *CAM_LAYOUT-bank* spline-t) -0.09) + ) + (+! (-> *CAM_LAYOUT-bank* intro-t) (-> *CAM_LAYOUT-bank* intro-step)) + (if (< 1.01 (-> *CAM_LAYOUT-bank* intro-t)) + (set! (-> *CAM_LAYOUT-bank* intro-t) -0.09) + ) + (let ((s5-0 30)) + (let ((s4-0 (cam-state-from-entity (-> self cam-entity)))) + (set-setting! 'master-options 'clear 0 32) + (let ((s3-0 (-> self cam-entity))) + (clear *temp-string*) + (if s3-0 + (format *temp-string* "\"~S\"~%" (res-lump-struct s3-0 'name structure)) + ) + ) + (if (not s4-0) + (format *temp-string* "no cameras in this level") + (format *temp-string* "~S" (-> s4-0 name)) + ) + ) + (cam-layout-print 320 s5-0 *temp-string*) + (let ((s5-1 (+ s5-0 28))) + (clear *temp-string*) + (format *temp-string* "~S~%" (-> arg0 title)) + (cam-layout-print 320 s5-1 *temp-string*) + (let ((s4-1 (+ s5-1 14))) + (dotimes (s5-2 (-> arg0 items length)) + (cond + ((type? (-> arg0 items s5-2) clm-list) + (clear *temp-string*) + (format *temp-string* "------------") + (cam-layout-print 320 s4-1 *temp-string*) + (let ((s4-2 (+ s4-1 14))) + (let ((s3-1 (the-as clm-list (-> arg0 items s5-2)))) + (dotimes (s2-1 (-> s3-1 items length)) + (clear *temp-string*) + (format + *temp-string* + "~S~S" + (if (= s2-1 (-> s3-1 cur-list-item)) + "> " + " " + ) + (-> s3-1 items s2-1 description) + ) + (cam-layout-function-call + (-> s3-1 items s2-1 val-func) + *temp-string* + (the-as int (-> 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*) + (+! s4-2 14) + ) + ) + (clear *temp-string*) + (format *temp-string* "------------") + (cam-layout-print 320 s4-2 *temp-string*) + (set! s4-1 (+ s4-2 14)) + ) + ) + ((and (not (-> self cam-entity)) (logtest? (-> (the-as clm-item (-> arg0 items s5-2)) action options) 2)) + ) + ((logtest? (-> (the-as clm-item (-> arg0 items s5-2)) action options) 4) + ) + (else + (let ((s3-2 (-> arg0 items s5-2))) + (clear *temp-string*) + (format + *temp-string* + "~S: ~A~%" + (-> (the-as clm-item s3-2) description) + (if (logtest? (-> (the-as clm-item (-> arg0 items s5-2)) action options) 8) + 'default + (-> (the-as clm-item s3-2) button-symbol) + ) + ) + ) + (cam-layout-print 320 s4-1 *temp-string*) + (+! s4-1 14) + ) + ) + ) + ) + ) + ) + (if (= *master-mode* 'menu) + (goto cfg-65) + ) + (dotimes (s5-3 (-> arg0 items length)) + (cond + ((type? (-> arg0 items s5-3) clm-list) + (let ((s4-3 (-> arg0 items s5-3)) + (s3-3 0) + ) + (if (-> (the-as clm-list s4-3) tracker) + (set! (-> (the-as clm-list s4-3) tracker value) + (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) track-val) + ) + ) + (dotimes (s2-2 (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions length)) + (if (cam-layout-do-action + (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions s2-2) + ) + (goto cfg-65) + ) + ) + (cond + ((cpad-pressed? 0 down) + (set! s3-3 1) + ) + ((cpad-pressed? 0 right) + (set! s3-3 1) + ) + ((cpad-pressed? 0 up) + (set! s3-3 -1) + ) + ((cpad-pressed? 0 left) + (set! s3-3 -1) + ) + ) + (when (nonzero? s3-3) + (set! (-> (the-as clm-list s4-3) cur-list-item) + (mod (+ (-> (the-as clm-list s4-3) cur-list-item) s3-3) (-> (the-as clm-list s4-3) items length)) + ) + (while (< (-> (the-as clm-list s4-3) cur-list-item) 0) + (+! (-> (the-as clm-list s4-3) cur-list-item) (-> (the-as clm-list s4-3) items length)) + ) + (goto cfg-65) + ) + ) + ) + ((cam-layout-do-action (-> (the-as clm-item (-> arg0 items s5-3)) action)) + (goto cfg-65) + ) + ) + ) + (label cfg-65) + #f + ) + +(defstate cam-layout-active (cam-layout) + :code (behavior () + (until #f + (cam-layout-entity-info (the-as entity-actor (-> self cam-entity))) + (cam-layout-do-menu *clm*) + (suspend) + ) + #f + (none) + ) + ) + +(defbehavior cam-layout-init cam-layout () + (set! (-> self res-key) -1000000000.0) + (set! (-> self num-entities) 0) + (let ((v1-2 (-> *camera-engine* alive-list next0))) + *camera-engine* + (let ((a0-2 (-> v1-2 next0))) + (while (!= v1-2 (-> *camera-engine* alive-list-end)) + (-> (the-as connection v1-2) param1) + (+! (-> self num-entities) 1) + (set! v1-2 a0-2) + *camera-engine* + (set! a0-2 (-> a0-2 next0)) + ) + ) + ) + (set! (-> self cur-entity) *last-cur-entity*) + (clmf-next-entity 0) + (set! *clm* *clm-select*) + (go cam-layout-active) + ) + +(defun cam-layout-stop () + (set! *cam-layout* #f) + (kill-by-name "cam-layout" *active-pool*) + ) + +(defun cam-layout-start () + (let ((a0-1 (new 'global 'file-stream "dd_next/caminfo/garbage" 'read))) + (file-stream-close a0-1) + ) + (cond + ((not *cam-layout*) + (let ((v1-4 (process-spawn-function cam-layout cam-layout-init :from *camera-dead-pool*))) + (cond + (v1-4 + (logclear! (-> v1-4 0 mask) (process-mask freeze pause menu)) + (set! *cam-layout* #t) + (set! *camera-layout-blink* #f) + ) + (else + (format 0 "ERROR : no process available to start cam editing mode~%") + ) + ) + ) + ) + (else + (format 0 "ERROR : cam editing mode already started~%") + ) + ) + *cam-layout* + ) + +(defun cam-layout-restart () + (cam-layout-stop) + (cam-layout-start) + ) + +) + + + diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 9c62b4ed69..13d1c407d9 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -237,6 +237,16 @@ (hit-by-others) (player) ) + +;; +++nav-flags +(defenum nav-flags + :type uint8 + :bitfield #t + (nav-flags0 0) + (nav-flags1 1) + ) +;; ---nav-flags + ;; DECOMP BEGINS (deftype collide-rider (structure) @@ -422,9 +432,9 @@ (deftype collide-shape (trsqv) ((actor-hash-index int16 :offset 12) - (process process :offset-assert 140) + (process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (total-prims uint8 :offset-assert 146) (num-riders uint8 :offset-assert 147) (pat-ignore-mask pat-surface :offset-assert 148) @@ -583,7 +593,7 @@ (set! (-> s5-0 actor-hash-index) -1) (set! (-> s5-0 process) arg0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> s5-0 nav-flags) (the-as uint 1)) + (set! (-> s5-0 nav-flags) (nav-flags nav-flags0)) (set! (-> s5-0 event-self) #f) (set! (-> s5-0 event-other) #f) (set! (-> s5-0 riders) (the-as pointer #f)) diff --git a/goal_src/jak2/engine/debug/anim-tester.gc b/goal_src/jak2/engine/debug/anim-tester.gc index 1b31e9d263..05616cb6d1 100644 --- a/goal_src/jak2/engine/debug/anim-tester.gc +++ b/goal_src/jak2/engine/debug/anim-tester.gc @@ -5,5 +5,88 @@ ;; name in dgo: anim-tester ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(define-extern anim-tester-start (function symbol)) + ;; DECOMP BEGINS +(defenum anim-tester-flags + :bitfield #t + :type int32 + (fanimt0) + (fanimt1) + (fanimt2) + (fanimt3) + (fanimt4) + (fanimt5) + ) + +(defenum anim-tester-debug-flags + :bitfield #t + :type int32 + (unk0) + (unk1) + (unk2) + (unk3) + (at-show-joint-info) + (at-apply-align) + (unk6) + ) + +(deftype list-control (structure) + ((listfunc (function int list-control symbol) :offset-assert 0) + (list-owner uint32 :offset-assert 4) + (top int32 :offset-assert 8) + (left int32 :offset-assert 12) + (list glst-list :offset-assert 16) + (the-node glst-node :offset-assert 20) + (top-index int32 :offset-assert 24) + (the-index int32 :offset-assert 28) + (the-disp-line int32 :offset-assert 32) + (highlight-index int32 :offset-assert 36) + (current-index int32 :offset-assert 40) + (numlines int32 :offset-assert 44) + (lines-to-disp int32 :offset-assert 48) + (charswide int32 :offset-assert 52) + (highlight-disp-line int32 :offset-assert 56) + (field-id int32 :offset-assert 60) + (xpos int32 :offset-assert 64) + (ypos int32 :offset-assert 68) + (user-info int32 :offset-assert 72) + (user-info-u uint32 :offset 72) ;; custom + (return-int int32 :offset-assert 76) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype anim-tester (process-drawable) + ((flags anim-tester-flags :offset-assert 200) + (debug-flags anim-tester-debug-flags :offset-assert 204) + (obj-list glst-list :inline :offset-assert 208) + (current-obj string :offset-assert 224) + (speed int32 :offset-assert 228) + (list-con list-control :inline :offset-assert 232) + (pick-con list-control :inline :offset-assert 312) + (item-field int64 :offset-assert 392) + (inc-delay int32 :offset-assert 400) + (inc-timer int32 :offset-assert 404) + (edit-mode int32 :offset-assert 408) + (old-mode int32 :offset-assert 412) + (anim-speed float :offset-assert 416) + (anim-gspeed float :offset-assert 420) + (anim-first float :offset-assert 424) + (anim-last float :offset-assert 428) + ) + :method-count-assert 20 + :size-assert #x1b0 + :heap-base #x130 + :flag-assert #x14013001b0 + (:states + anim-tester-process + ) + ) + +(define-extern *anim-tester* (pointer anim-tester)) diff --git a/goal_src/jak2/engine/debug/debug-h.gc b/goal_src/jak2/engine/debug/debug-h.gc index 1b09037fb7..d9edc437cc 100644 --- a/goal_src/jak2/engine/debug/debug-h.gc +++ b/goal_src/jak2/engine/debug/debug-h.gc @@ -22,6 +22,8 @@ ;; NOTE - for debug (define-extern add-debug-sphere (function symbol bucket-id vector meters rgba symbol)) +;; NOTE - for menu +;; +++debug-menu-msg (defenum debug-menu-msg :type int32 (activate 1) @@ -29,35 +31,28 @@ (update 3) (press 4) ) +;; ---debug-menu-msg +;; +++debug-menu-dest (defenum debug-menu-dest :type int32 (activation 0) (root 1) (open-menus 2) (current-selection 3)) +;; ---debug-menu-dest -;; NOTE - for editable-player (declare-type debug-menu basic) -(deftype debug-menu-context (basic) - ((is-active symbol :offset-assert 4) ;; guessed by decompiler - (sel-length int32 :offset-assert 8) - (sel-menu debug-menu 8 :offset-assert 12) ;; guessed by decompiler - (root-menu debug-menu :offset-assert 44) ;; guessed by decompiler - (joypad-func (function basic none) :offset-assert 48) ;; guessed by decompiler - (joypad-item basic :offset-assert 52) - (font font-context :offset-assert 56) ;; guessed by decompiler - (is-hidden symbol :offset-assert 60) ;; guessed by decompiler - (joypad-number int32 :offset-assert 64) - ) - :method-count-assert 9 - :size-assert #x44 - :flag-assert #x900000044 - ) +(declare-type debug-menu-node basic) +(declare-type debug-menu-item debug-menu-node) +(declare-type debug-menu-context basic) (define-extern debug-menu-context-send-msg (function debug-menu-context debug-menu-msg debug-menu-dest debug-menu-context)) +(define-extern debug-menu-make-from-template (function debug-menu-context pair debug-menu-node)) +(define-extern debug-menu-func-decode (function object function)) +(define-extern debug-menu-item-send-msg (function debug-menu-item debug-menu-msg debug-menu-item)) +(define-extern debug-menu-send-msg (function debug-menu debug-menu-msg symbol debug-menu)) (define-extern debug-menus-handler (function debug-menu-context debug-menu-context)) - ;; DECOMP BEGINS (deftype pos-history (structure) diff --git a/goal_src/jak2/engine/debug/debug.gc b/goal_src/jak2/engine/debug/debug.gc index bd48781dd0..b219d5990f 100644 --- a/goal_src/jak2/engine/debug/debug.gc +++ b/goal_src/jak2/engine/debug/debug.gc @@ -1078,7 +1078,7 @@ (defun-debug add-debug-text-sphere ((enable symbol) (bucket bucket-id) (position vector) (radius meters) (text string) (color rgba)) "Add a debug sphere at the given point, with some text. The color is for the sphere - the text is color 0." (add-debug-sphere enable bucket position radius color) - (add-debug-text-3d enable bucket text position (font-color default) (the-as vector2h #f)) + (add-debug-text-3d enable bucket text position (font-color default-#cddbcd) (the-as vector2h #f)) #f ) @@ -1777,16 +1777,16 @@ (+ y -4) (cond ((= v1-7 1) - (font-color orange-red) + (font-color precursor-#ec3b00) ) ((= v1-7 2) - (font-color fc-5) + (font-color yellow-#f3f300) ) ((= v1-7 4) - (font-color fc-6) + (font-color green-#3df23d) ) (else - (font-color default) + (font-color default-#cddbcd) ) ) (font-flags shadow) diff --git a/goal_src/jak2/engine/debug/default-menu.gc b/goal_src/jak2/engine/debug/default-menu.gc index 5ff0f8c5c1..99c7c117a5 100644 --- a/goal_src/jak2/engine/debug/default-menu.gc +++ b/goal_src/jak2/engine/debug/default-menu.gc @@ -7,5 +7,6060 @@ (declare-type debug-menu-context basic) +(defenum dm-time-of-day-setting + :type int64 + (7am-sunrise) + (10am-morning) + (12pm-noon) + (2pm-afternoon) + (6pm-sunset) + (7pm-twilight) + (11pm-evening) + (4am-green-sun) + (fast-mode)) + +(defenum dm-time-of-day-palette-settings + :type int64 + (palette-0) + (palette-1) + (palette-2) + (palette-3) + (palette-4) + (palette-5) + (palette-6) + (palette-7)) + +;; og:ignore-form:all-texture-tweak-adjust + ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +(define *debug-menu-context* (new 'debug 'debug-menu-context)) + +(define *dm-cam-mode-interpolation* 0) + +(defun dm-cam-mode-func ((arg0 (state camera-slave)) (arg1 debug-menu-msg)) + (if (and (= arg1 (debug-menu-msg press)) arg0) + (set-setting-by-param *setting-control* 'mode-name (-> arg0 name) 0 0) + ) + (if *camera* + (send-event *camera* 'query-state arg0) + (not arg0) + ) + ) + +(defun dm-cam-mode-default ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (remove-setting-by-arg0 *setting-control* 'mode-name) + ) + (not (setting-control-method-14 *setting-control* 'mode-name)) + ) + +(defun dm-cam-settings-default ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (remove-setting-by-arg0 *setting-control* 'fov) + (remove-setting-by-arg0 *setting-control* 'slave-options) + ) + (and (not (setting-control-method-14 *setting-control* 'fov)) + (not (setting-control-method-14 *setting-control* 'slave-options)) + ) + ) + +(defun dm-cam-settings-func ((arg0 cam-slave-options) (arg1 debug-menu-msg)) + (when (and (= arg1 (debug-menu-msg press)) *camera*) + (cond + ((zero? arg0) + (send-event *camera* 'toggle-slave-option 1) + ) + ((= arg0 (cam-slave-options BUTT_CAM)) + (send-event *camera* 'toggle-slave-option 2) + ) + ((= arg0 (cam-slave-options SAME_SIDE)) + (send-event *camera* 'toggle-slave-option 4) + ) + ((= arg0 (cam-slave-options BUTT_CAM SAME_SIDE)) + (send-event *camera* 'toggle-slave-option 128) + ) + ((= arg0 (cam-slave-options MOVE_SPHERICAL)) + (send-event *camera* 'toggle-slave-option 8) + ) + ((= arg0 (cam-slave-options SAME_SIDE MOVE_SPHERICAL)) + (set-setting-by-param *setting-control* 'slave-options 'clear 0 16) + ) + ((= arg0 (cam-slave-options BUTT_CAM SAME_SIDE MOVE_SPHERICAL)) + (send-event *camera* 'toggle-slave-option 64) + ) + ((= arg0 (cam-slave-options ALLOW_Z_ROT)) + (send-event *camera* 'toggle-slave-option 32) + ) + ((= arg0 (cam-slave-options BUTT_CAM ALLOW_Z_ROT)) + (send-event *camera* 'toggle-slave-option 512) + ) + ((= arg0 (cam-slave-options SAME_SIDE ALLOW_Z_ROT)) + (send-event *camera* 'toggle-slave-option #x4000) + ) + ((= arg0 (cam-slave-options BUTT_CAM SAME_SIDE ALLOW_Z_ROT)) + (send-event *camera* 'toggle-slave-option #x8000) + ) + ) + ) + (cond + (*camera* + (cond + ((zero? arg0) + (logtest? (-> *camera* slave-options) 1) + ) + ((= arg0 (cam-slave-options BUTT_CAM)) + (logtest? (-> *camera* slave-options) 2) + ) + ((= arg0 (cam-slave-options SAME_SIDE)) + (logtest? (-> *camera* slave-options) 4) + ) + ((= arg0 (cam-slave-options BUTT_CAM SAME_SIDE)) + (logtest? (-> *camera* slave-options) 128) + ) + ((= arg0 (cam-slave-options MOVE_SPHERICAL)) + (logtest? (-> *camera* slave-options) 8) + ) + ((= arg0 (cam-slave-options SAME_SIDE MOVE_SPHERICAL)) + (not (setting-control-method-14 *setting-control* 'slave-options)) + ) + ((= arg0 (cam-slave-options BUTT_CAM SAME_SIDE MOVE_SPHERICAL)) + (logtest? (-> *camera* slave-options) 64) + ) + ((= arg0 (cam-slave-options ALLOW_Z_ROT)) + (logtest? (-> *camera* slave-options) 32) + ) + ((= arg0 (cam-slave-options BUTT_CAM ALLOW_Z_ROT)) + (logtest? (-> *camera* slave-options) 512) + ) + ((= arg0 (cam-slave-options SAME_SIDE ALLOW_Z_ROT)) + (logtest? (-> *camera* slave-options) #x4000) + ) + ((= arg0 (cam-slave-options BUTT_CAM SAME_SIDE ALLOW_Z_ROT)) + (logtest? (-> *camera* slave-options) #x8000) + ) + (else + #f + ) + ) + ) + (else + #f + ) + ) + ) + +(defun dm-cam-settings-func-int ((arg0 int) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) + (when (and (= arg1 (debug-menu-msg press)) *camera*) + (if (= (/ arg0 8) 5) + (set! *dm-cam-mode-interpolation* arg2) + ) + ) + (cond + (*camera* + (if (= (/ arg0 8) 5) + *dm-cam-mode-interpolation* + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-cam-externalize ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((= arg0 'reset) + (if (!= *external-cam-mode* 'locked) + (external-cam-reset!) + ) + ) + ((= arg0 'allow-z) + (set! *external-cam-options* (logxor *external-cam-options* (external-cam-option allow-z))) + ) + ((= *external-cam-mode* arg0) + (set! *external-cam-mode* #f) + ) + (else + (if (not *external-cam-mode*) + (external-cam-reset!) + ) + (set! *external-cam-mode* arg0) + ) + ) + ) + (if (= arg0 'allow-z) + (logtest? *external-cam-options* (external-cam-option allow-z)) + (= *external-cam-mode* arg0) + ) + ) + +(defun dm-cam-setting-float ((arg0 float) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('fov) + (if (not (setting-control-method-14 *setting-control* 'fov)) + (set! arg2 64.0) + ) + (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) + (if *camera-combiner* + (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) + ) + (if (and *camera* (-> *camera* slave)) + (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) + ) + ) + ) + ) + (cond + ((= arg0 'fov) + (cond + ((setting-control-method-14 *setting-control* 'fov) + (empty) + arg2 + ) + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-cam-render-float ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (when (zero? (/ arg0 8)) + (when *math-camera* + (set! (-> *math-camera* fov) (* 182.04445 arg2)) + (update-math-camera + *math-camera* + (-> *setting-control* user-current video-mode) + (-> *setting-control* user-current aspect-ratio) + (-> *math-camera* fov) + ) + ) + ) + ) + (cond + ((zero? (/ arg0 8)) + (cond + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + +(defun dm-subdiv-float ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('close) + (if (and *math-camera* *subdivide-settings*) + (set! (-> *subdivide-settings* close 7) (* 4096.0 arg2)) + ) + ) + (('far) + (if (and *math-camera* *subdivide-settings*) + (set! (-> *subdivide-settings* far 7) (* 4096.0 arg2)) + ) + ) + ) + ) + (case arg0 + (('close) + (if (and *math-camera* *subdivide-settings*) + (* 0.00024414062 (-> *subdivide-settings* close 7)) + arg3 + ) + ) + (('far) + (if (and *math-camera* *subdivide-settings*) + (* 0.00024414062 (-> *subdivide-settings* far 7)) + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-subdiv-int ((arg0 symbol) (arg1 debug-menu-msg) (arg2 int) (arg3 int)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('anim-speed) + (if *anim-tester* + (set! (-> *anim-tester* 0 speed) arg2) + ) + ) + ) + ) + (case arg0 + (('anim-speed) + (if *anim-tester* + (-> *anim-tester* 0 speed) + arg3 + ) + ) + (else + arg3 + ) + ) + ) + +(defun dm-select-race-path ((arg0 object) (arg1 debug-menu-msg) (arg2 int)) + (if (= arg1 (debug-menu-msg press)) + (set! *select-race-path* arg2) + ) + *select-race-path* + ) + +(defun dm-setting-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default language) (/ arg0 8)) + ) + +(defun dm-setting-subtitle-language ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle-language) (the-as language-enum (/ arg0 8))) + ) + (= (-> *setting-control* user-default subtitle-language) (/ arg0 8)) + ) + +(defun dm-setting-stereo-mode ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default stereo-mode) (the-as int (/ (the-as int arg0) 8))) + ) + (= (-> *setting-control* user-default stereo-mode) (/ (the-as int arg0) 8)) + ) + +(defun dm-current-continue ((arg0 string) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (start 'play (get-continue-by-name *game-info* arg0)) + ) + (string= (-> (get-current-continue-point *game-info*) name) arg0) + ) + +(defun dm-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-draw-mode* (the-as subdivide-setting (/ arg0 8))) + ) + (= (/ arg0 8) *subdivide-draw-mode*) + ) + +(defun dm-scissor-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-scissor-draw-mode* (the-as subdivide-setting (/ arg0 8))) + ) + (= (/ arg0 8) *subdivide-scissor-draw-mode*) + ) + +(defun dm-foreground-subdiv-draw-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! *subdivide-foreground-draw-mode* (the-as subdivide-setting (/ arg0 8))) + (let ((v1-3 *generic-consts*) + (a1-1 (/ arg0 8)) + ) + (cond + ((zero? a1-1) + (set! (-> v1-3 base-strgif qword vector4w y) #x303e4000) + (set! (-> v1-3 base-strgif qword vector4w x) #x303ec000) + ) + ((= a1-1 1) + (set! (-> v1-3 base-strgif qword vector4w y) #x303d4000) + (set! (-> v1-3 base-strgif qword vector4w x) #x303d4000) + ) + ((= a1-1 2) + (set! (-> v1-3 base-strgif qword vector4w y) #x30364000) + (set! (-> v1-3 base-strgif qword vector4w x) #x3036c000) + ) + ((= a1-1 3) + (set! (-> v1-3 base-strgif qword vector4w y) #x30354000) + (set! (-> v1-3 base-strgif qword vector4w x) #x3036c000) + ) + ) + ) + ) + (= (/ arg0 8) *subdivide-foreground-draw-mode*) + ) + +(defun dm-col-rend-on-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 draw?) (not (-> v1-0 draw?))) + ) + (-> v1-0 draw?) + ) + ) + +(defun dm-col-rend-outline-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 outline?) (not (-> v1-0 outline?))) + ) + (-> v1-0 outline?) + ) + ) + +(defun dm-col-rend-back-face-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-back-faces?) (not (-> v1-0 show-back-faces?))) + ) + (-> v1-0 show-back-faces?) + ) + ) + +(defun dm-col-rend-normals-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-normals?) (not (-> v1-0 show-normals?))) + ) + (-> v1-0 show-normals?) + ) + ) + +(defun dm-col-rend-ghost-hidden-func ((arg0 object) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 ghost-hidden?) (not (-> v1-0 ghost-hidden?))) + ) + (-> v1-0 ghost-hidden?) + ) + ) + +(defun dm-col-rend-track-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 track) (the-as uint (/ arg0 8))) + ) + (= (/ arg0 8) (-> v1-0 track)) + ) + ) + +(defun dm-col-rend-show-only-toggle-func ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 show-only) arg0) + (set! (-> v1-0 show-only) (logand -57 (-> v1-0 show-only))) + ) + (logtest? (-> v1-0 show-only) arg0) + ) + ) + +(defun dm-col-rend-show-only-set-func ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 show-only) arg0) + ) + (= (-> v1-0 show-only) arg0) + ) + ) + +(defun dm-col-rend-cspec-toggle ((arg0 uint) (arg1 debug-menu-msg)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 cspec) arg0) + ) + (logtest? (-> v1-0 cspec) arg0) + ) + ) + +(defun dm-col-rend-size ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 bbox-radius) (* 2048.0 arg2)) + ) + (* 0.00024414062 (* 2.0 (-> v1-0 bbox-radius))) + ) + ) + +(defun dm-col-rend-cam-dist ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (let ((v1-0 *col-rend*)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2)) + ) + (* 0.00024414062 (-> v1-0 camera-to-bbox-dist)) + ) + ) + +(defun dm-ocean-height-func ((arg0 ocean-height-hack) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! *ocean-height-hack* (the-as ocean-height-hack (/ (the-as int arg0) 8))) + (let* ((v1-3 (/ (the-as int arg0) 8)) + (f0-0 (cond + ((= v1-3 2) + -16384000.0 + ) + ((= v1-3 3) + -216498.17 + ) + ((= v1-3 4) + -265650.2 + ) + ((= v1-3 5) + -314802.2 + ) + ((= v1-3 6) + -368050.2 + ) + (else + 0.0 + ) + ) + ) + ) + (set-height! *ocean-map-sewer* f0-0) + ) + ) + (= (/ (the-as int arg0) 8) *ocean-height-hack*) + ) + +(defun dm-ocean-subdiv-draw-func ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *subdivide-ocean-draw-mode* (the-as subdivide-setting (/ (the-as int arg0) 8))) + ) + (= (/ (the-as int arg0) 8) *subdivide-ocean-draw-mode*) + ) + +(defun dm-time-of-day-func ((arg0 dm-time-of-day-setting) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (cond + ((zero? (/ (the-as int arg0) 8)) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 7) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 1) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 10) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 2) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 12) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 3) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 14) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 4) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 18) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 5) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 19) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 6) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 23) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 7) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (send-event (ppointer->process *time-of-day*) 'change 'hour 4) + (set! (-> *time-of-day-context* mode) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + ) + ((= (/ (the-as int arg0) 8) 8) + (send-event + (ppointer->process *time-of-day*) + 'dest-clock-ratio-set + (if *time-of-day-fast* + #x42700000 + #x3f800000 + ) + 600 + ) + ) + (else + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + (set! (-> *time-of-day-context* mode) + (logand (logxor (-> *time-of-day-context* mode) (the-as uint (/ (the-as int arg0) 8))) + (time-of-day-palette-id palette-0 palette-1 palette-2 palette-3 palette-4 palette-5 palette-6 palette-7) + ) + ) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'minutes 0) + (send-event (ppointer->process *time-of-day*) 'change 'seconds 0) + (send-event (ppointer->process *time-of-day*) 'change 'frames 0) + (set! *teleport-count* 1) + ) + (cond + ((< (the-as int (/ (the-as int arg0) 8)) 9) + (= (/ (the-as int arg0) 8) (-> *time-of-day-context* mode)) + ) + ((< (the-as int (/ (the-as int arg0) 8)) 8) + #f + ) + (else + (logtest? (-> *time-of-day-context* mode) (/ (the-as int arg0) 8)) + ) + ) + ) + +(defun dm-time-of-day-func2 ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> arg0 value) (not (-> arg0 value))) + (if (nonzero? (send-event (ppointer->process *time-of-day*) 'ratio)) + (send-event + (ppointer->process *time-of-day*) + 'dest-clock-ratio-set + (if *time-of-day-fast* + #x42700000 + #x3f800000 + ) + 600 + ) + ) + ) + (-> arg0 value) + ) + +(defun dm-time-of-day-palette-func ((arg0 dm-time-of-day-palette-settings) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-palette) (the-as time-of-day-palette-id (/ (the-as int arg0) 8))) + (cond + ((zero? (/ (the-as int arg0) 8)) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-0)) + ) + ((= (/ (the-as int arg0) 8) 1) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-1)) + ) + ((= (/ (the-as int arg0) 8) 2) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-2)) + ) + ((= (/ (the-as int arg0) 8) 3) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-3)) + ) + ((= (/ (the-as int arg0) 8) 4) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-4)) + ) + ((= (/ (the-as int arg0) 8) 5) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-5)) + ) + ((= (/ (the-as int arg0) 8) 6) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-6)) + ) + ((= (/ (the-as int arg0) 8) 7) + (set! (-> *time-of-day-context* mode) (time-of-day-palette-id palette-7)) + ) + ) + (send-event (ppointer->process *time-of-day*) 'change 'ratio 0) + ) + (cond + ((zero? (/ (the-as int arg0) 8)) + (= (-> *time-of-day-context* mode) 16) + ) + ((= (/ (the-as int arg0) 8) 1) + (= (-> *time-of-day-context* mode) 32) + ) + ((= (/ (the-as int arg0) 8) 2) + (= (-> *time-of-day-context* mode) 64) + ) + ((= (/ (the-as int arg0) 8) 3) + (= (-> *time-of-day-context* mode) 128) + ) + ((= (/ (the-as int arg0) 8) 4) + (= (-> *time-of-day-context* mode) 256) + ) + ((= (/ (the-as int arg0) 8) 5) + (= (-> *time-of-day-context* mode) 512) + ) + ((= (/ (the-as int arg0) 8) 6) + (= (-> *time-of-day-context* mode) 1024) + ) + ((= (/ (the-as int arg0) 8) 7) + (= (-> *time-of-day-context* mode) 2048) + ) + ) + ) + +(defun dm-boolean-toggle-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> arg0 value) (not (-> arg0 value))) + ) + (-> arg0 value) + ) + +(defun dm-time-of-day-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (time-of-day-setup (= arg1 (debug-menu-msg press))) + ) + +(defun dm-stats-memory-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 (/ arg0 8))) + (if (= arg1 (debug-menu-msg press)) + (set! *stats-memory-level-index* v1-0) + ) + (= *stats-memory-level-index* v1-0) + ) + ) + +(defun dm-actor-marks-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-actor-marks* arg0) + ) + (= *display-actor-marks* arg0) + ) + +(defun dm-select-race-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *select-race* (the-as race-selection (/ arg0 8))) + ) + (= (/ arg0 8) *select-race*) + ) + +(defun dm-compact-actor-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *compact-actors* arg0) + ) + (= *compact-actors* arg0) + ) + +(defun dm-actor-vis-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-actor-vis* arg0) + ) + (= *display-actor-vis* arg0) + ) + +(defun dm-game-mode-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *game-info* mode) arg0) + ) + (= (-> *game-info* mode) arg0) + ) + +(defun dm-game-feature-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* features) (the-as uint (/ arg0 8))) + (set! (-> *game-info* debug-features) + (logior (logclear (-> *game-info* debug-features) (/ arg0 8)) (logand (-> *game-info* features) (/ arg0 8))) + ) + (if (logtest? (-> *game-info* features) (game-feature gun-yellow gun-red gun-blue gun-dark)) + (logior! (-> *game-info* features) (game-feature unk-game-feature-06)) + (logclear! (-> *game-info* features) (game-feature unk-game-feature-06)) + ) + (if (logtest? (-> *game-info* debug-features) (game-feature gun-yellow gun-red gun-blue gun-dark)) + (logior! (-> *game-info* debug-features) (game-feature unk-game-feature-06)) + (logclear! (-> *game-info* debug-features) (game-feature unk-game-feature-06)) + ) + ) + (logtest? (-> *game-info* features) (/ arg0 8)) + ) + +(defun dm-game-secret-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *game-info* secrets) (the-as uint (/ arg0 8))) + ) + (logtest? (-> *game-info* secrets) (/ arg0 8)) + ) + +(defun display-scene-control-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-scene-control* (logxor *display-scene-control* (the-as uint arg0))) + ) + (logtest? *display-scene-control* arg0) + ) + +(defun display-scene-control-set-pick-func ((arg0 scene-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-scene-control* arg0) + ) + (= *display-scene-control* arg0) + ) + +(defun display-bot-marks-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-bot-marks* (logxor *display-bot-marks* (the-as uint arg0))) + ) + (logtest? *display-bot-marks* arg0) + ) + +(defun display-bot-marks-set-pick-func ((arg0 bot-marks-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-bot-marks* arg0) + ) + (= *display-bot-marks* arg0) + ) + +(defun display-race-marks-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-race-marks* (logxor *display-race-marks* (the-as uint arg0))) + ) + (logtest? *display-race-marks* arg0) + ) + +(defun display-race-marks-set-pick-func ((arg0 race-marks-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-race-marks* arg0) + ) + (= *display-race-marks* arg0) + ) + +(defun dm-vu1-user-toggle-pick-func ((arg0 vu1-renderer-mask) (arg1 debug-menu-msg)) + (let ((v1-1 (ash 1 (/ (the-as int arg0) 8)))) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *display* vu1-enable-user-menu) (the-as uint v1-1)) + ) + (logtest? (-> *display* vu1-enable-user-menu) v1-1) + ) + ) + +(defun dm-vu1-user-all-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (let ((v1-1 (-> (new 'static 'array uint64 1 #x5fffffff8) 0))) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-1)) + ) + (= (-> *display* vu1-enable-user-menu) v1-1) + ) + ) + +(defun dm-vu1-user-none-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (let ((v1-0 0)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *display* vu1-enable-user-menu) (the-as vu1-renderer-mask v1-0)) + ) + (= (-> *display* vu1-enable-user-menu) v1-0) + ) + ) + +(defun dm-texture-user-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *texture-pool* texture-enable-user-menu) (the-as uint arg0)) + ) + (logtest? (-> *texture-pool* texture-enable-user-menu) arg0) + ) + +(defun dm-texture-user-set-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *texture-pool* texture-enable-user-menu) (the-as uint arg0)) + ) + (= (-> *texture-pool* texture-enable-user-menu) arg0) + ) + +(defun dm-strip-lines-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-strip-lines* (logxor *display-strip-lines* (the-as uint (/ arg0 8)))) + ) + (logtest? *display-strip-lines* (/ arg0 8)) + ) + +(defun dm-strip-lines-set-pick-func ((arg0 strip-lines-controls) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *display-strip-lines* (the-as strip-lines-controls (/ (the-as int arg0) 8))) + ) + (= *display-strip-lines* (/ (the-as int arg0) 8)) + ) + +(defun dm-edit-instance-toggle-pick-func ((arg0 int) (arg1 debug-menu-msg)) + (let ((v1-0 (find-instance-by-name *edit-instance*))) + (when v1-0 + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> v1-0 flags) (the-as uint arg0)) + ) + (logtest? (-> v1-0 flags) arg0) + ) + ) + ) + +;; WARN: Return type mismatch int vs none. +(defun all-texture-tweak-adjust ((arg0 texture-page-dir) (arg1 float)) + ;; TODO - currently broken + (none) + ) + +(defun dm-float-field-tie-rvanish-func ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + "NOTE - Weird cast, it's not an instance-tie...but it is?" + (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) + (cond + (gp-0 + (case (prototype-bucket-type gp-0) + ((instance-tie) + (let* ((f0-0 (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far)) + (f1-2 (- f0-0 (/ 128.0 (-> (the-as prototype-bucket-tie gp-0) tie-rvanish)))) + ) + (let ((f2-1 (-> (the-as prototype-bucket-tie gp-0) dists w))) + (when (= arg1 (debug-menu-msg press)) + (logior! (-> (the-as prototype-bucket-tie gp-0) flags) 8) + (set! f1-2 (fmax (fmin (* 4096.0 arg2) f0-0) (+ 4096.0 f2-1))) + (let ((f0-1 (fmax f0-0 (+ 4096.0 f1-2)))) + (set! (-> (the-as prototype-bucket-tie gp-0) tie-rvanish) (/ 128.0 (- f0-1 f1-2))) + (set! (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far) f0-1) + ) + ) + ) + (* 0.00024414062 f1-2) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + +(defun dm-float-field-tie-vanish-far-func ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + "NOTE - Weird cast, it's not an instance-tie...but it is?" + (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) + (cond + (gp-0 + (case (prototype-bucket-type gp-0) + ((instance-tie) + (let ((f0-0 (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far))) + (let ((f2-1 (- f0-0 (/ 128.0 (-> (the-as prototype-bucket-tie gp-0) tie-rvanish)))) + (f1-2 (-> (the-as prototype-bucket-tie gp-0) dists w)) + ) + (when (= arg1 (debug-menu-msg press)) + (logior! (-> (the-as prototype-bucket-tie gp-0) flags) 8) + (set! f0-0 (fmax (* 4096.0 arg2) (+ 4096.0 f2-1))) + (let ((f1-4 (fmax (fmin f2-1 f0-0) (+ 4096.0 f1-2)))) + (set! (-> (the-as prototype-bucket-tie gp-0) tie-rvanish) (/ 128.0 (- f0-0 f1-4))) + ) + (set! (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far) f0-0) + ) + ) + (* 0.00024414062 f0-0) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + +(defun dm-bug-report-output-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! *bug-report-output-mode* arg0) + ) + (= *bug-report-output-mode* arg0) + ) + +;; WARN: Return type mismatch int vs none. +(defun dm-bug-report-report-pick-func ((arg0 symbol) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (bug-report-display) + ) + 0 + (none) + ) + +(defun debug-menu-node arg0 name) (-> arg1 name)) + ) + +(defun dm-shader-pick-func ((arg0 texture-id) (arg1 debug-menu-msg)) + (if (and (= arg1 (debug-menu-msg press)) + *texture-page-dir* + (-> *texture-page-dir* entries (-> arg0 page) page) + (-> *texture-page-dir* entries (-> arg0 page) link) + (nonzero? (-> *texture-page-dir* entries (-> arg0 page) link next (-> arg0 index))) + ) + (set! *edit-shader* arg0) + ) + (and (nonzero? *edit-shader*) (= arg0 *edit-shader*)) + ) + +(define *shader-pick-menu* (the-as debug-menu #f)) + +;; WARN: Return type mismatch pair vs none. +(defun build-shader-list () + (debug-menu-remove-all-items *shader-pick-menu*) + (when *texture-page-dir* + (dotimes (gp-0 (-> *texture-page-dir* length)) + (let ((s5-0 (-> *texture-page-dir* entries gp-0 page)) + (s4-0 (-> *texture-page-dir* entries gp-0 link)) + ) + (when (and s5-0 s4-0) + (dotimes (s3-0 (-> s5-0 length)) + (when (and (-> s5-0 data s3-0) (nonzero? (-> s4-0 next s3-0))) + (let ((a1-1 (new + 'debug + 'debug-menu-item-flag + (-> s5-0 data s3-0 name) + (logior (shr (shl s3-0 52) 44) (shr (shl gp-0 52) 32)) + dm-shader-pick-func + ) + ) + ) + (debug-menu-append-item *shader-pick-menu* a1-1) + ) + ) + ) + ) + ) + ) + ) + (set! (-> *shader-pick-menu* items) (sort (-> *shader-pick-menu* items) debug-menu-node v1-0 flags) 1) + ) + (zero? (logand (-> v1-0 flags) 1)) + ) + (else + #f + ) + ) + ) + ) + +(define *instance-shrub-menu* (the-as debug-menu #f)) + +(define *instance-tie-menu* (the-as debug-menu #f)) + +(define *enable-instance-shrub-menu* (the-as debug-menu #f)) + +(define *enable-instance-tie-menu* (the-as debug-menu #f)) + +;; WARN: Return type mismatch int vs none. +(defun build-instance-list ((arg0 object)) + (debug-menu-remove-all-items *instance-shrub-menu*) + (debug-menu-remove-all-items *instance-tie-menu*) + (debug-menu-remove-all-items *enable-instance-shrub-menu*) + (debug-menu-remove-all-items *enable-instance-tie-menu*) + (set! *display-instance-info* #f) + (dotimes (gp-0 (-> *level* length)) + (let ((v1-3 (-> *level* level gp-0))) + (when (= (-> v1-3 status) 'active) + (let ((s5-0 (-> v1-3 bsp drawable-trees))) + (dotimes (s4-0 (-> s5-0 length)) + (let ((v1-7 (-> s5-0 trees s4-0))) + (case (-> v1-7 type) + ((drawable-tree-instance-shrub) + (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub))) + (dotimes (s2-0 (-> s3-0 length)) + (let ((a1-4 + (new 'global 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-instance-pick-func) + ) + ) + (debug-menu-append-item *instance-shrub-menu* a1-4) + ) + (let ((a1-6 + (new 'debug 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-enable-instance-func) + ) + ) + (set! (-> a1-6 is-on) #t) + (debug-menu-append-item *enable-instance-shrub-menu* a1-6) + ) + ) + ) + ) + ((drawable-tree-instance-tie) + (let ((s3-1 (-> (the-as drawable-tree-instance-tie v1-7) prototypes prototype-array-tie))) + (dotimes (s2-1 (-> s3-1 length)) + (let ((a1-9 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (-> s3-1 array-data s2-1 name) + dm-instance-pick-func + ) + ) + ) + (debug-menu-append-item *instance-tie-menu* a1-9) + ) + (let ((a1-11 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (-> s3-1 array-data s2-1 name) + dm-enable-instance-func + ) + ) + ) + (set! (-> a1-11 is-on) #t) + (debug-menu-append-item *enable-instance-tie-menu* a1-11) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (set! (-> *instance-shrub-menu* items) + (sort + (-> *instance-shrub-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *instance-tie-menu* items) + (sort + (-> *instance-tie-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *enable-instance-shrub-menu* items) + (sort + (-> *enable-instance-shrub-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + (set! (-> *enable-instance-tie-menu* items) + (sort + (-> *enable-instance-tie-menu* items) + (lambda ((arg0 debug-menu) (arg1 debug-menu)) (string<=? (-> arg0 name) (-> arg1 name))) + ) + ) + 0 + (none) + ) + +(defun dm-scene-load-pick-func ((arg0 pair) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((s5-0 *display-profile*)) + (play-clean #f) + (set! *display-profile* s5-0) + ) + (let ((s5-1 (car (cdr arg0)))) + (when (and (type? s5-1 string) (or (string= (the-as string s5-1) "outro-palace") + (string= (the-as string s5-1) "outro-hiphog") + (string= (the-as string s5-1) "outro-port") + (string= (the-as string s5-1) "outro-nest") + ) + ) + (set! (-> palout memory-mode) (the-as uint 4)) + (set! (-> hiphog memory-mode) (the-as uint 1)) + ) + (process-spawn scene-player :init scene-player-init s5-1 #t (car arg0)) + ) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (set-master-mode 'game) + ) + #f + ) + +;; WARN: Return type mismatch object vs none. +(defun debug-create-cam-restore () + (cond + (*math-camera* + (format #t "(defun-debug cam-restore ()~%") + (format #t " ;;this function is a hack, don't use it as an example~%") + (format #t " (let ((pos (new 'stack 'vector))~%") + (format #t " (rot (new 'stack 'matrix)))~%") + (format #t " (set! (-> pos x) ~12F)~%" (-> *math-camera* trans x)) + (format #t " (set! (-> pos y) ~12F)~%" (-> *math-camera* trans y)) + (format #t " (set! (-> pos z) ~12F)~%" (-> *math-camera* trans z)) + (format #t " (set! (-> pos w) 1.0)~%") + (format #t " (set! (-> rot data 0) ~12F)~%" (-> *math-camera* inv-camera-rot vector 0 x)) + (format #t " (set! (-> rot data 1) ~12F)~%" (-> *math-camera* inv-camera-rot vector 0 y)) + (format #t " (set! (-> rot data 2) ~12F)~%" (-> *math-camera* inv-camera-rot vector 0 z)) + (format #t " (set! (-> rot data 3) ~12F)~%" (-> *math-camera* inv-camera-rot vector 0 w)) + (format #t " (set! (-> rot data 4) ~12F)~%" (-> *math-camera* inv-camera-rot vector 1 x)) + (format #t " (set! (-> rot data 5) ~12F)~%" (-> *math-camera* inv-camera-rot vector 1 y)) + (format #t " (set! (-> rot data 6) ~12F)~%" (-> *math-camera* inv-camera-rot vector 1 z)) + (format #t " (set! (-> rot data 7) ~12F)~%" (-> *math-camera* inv-camera-rot vector 1 w)) + (format #t " (set! (-> rot data 8) ~12F)~%" (-> *math-camera* inv-camera-rot vector 2 x)) + (format #t " (set! (-> rot data 9) ~12F)~%" (-> *math-camera* inv-camera-rot vector 2 y)) + (format #t " (set! (-> rot data 10) ~12F)~%" (-> *math-camera* inv-camera-rot vector 2 z)) + (format #t " (set! (-> rot data 11) ~12F)~%" (-> *math-camera* inv-camera-rot vector 2 w)) + (format #t " (set! (-> rot data 12) ~12F)~%" 0) + (format #t " (set! (-> rot data 13) ~12F)~%" 0) + (format #t " (set! (-> rot data 14) ~12F)~%" 0) + (format #t " (set! (-> rot data 15) ~12F)~%" #x3f800000) + (let ((gp-0 (new 'stack-no-clear 'euler-angles))) + (matrix->eul gp-0 (-> *math-camera* inv-camera-rot) 21) + (format #t " ;; euler angles (xyz order degrees) x ~R y ~R z ~R~%" (-> gp-0 x) (-> gp-0 y) (-> gp-0 z)) + (format + #t + " ;; MAYA euler angles (xyz order degrees) x ~R y ~R z ~R~%" + (-> gp-0 x) + (- 32768.0 (-> gp-0 y)) + (-> gp-0 z) + ) + ) + (format #t " (debug-set-camera-pos-rot! pos rot)~%") + (format #t " (send-event *camera* 'set-fov (deg ~f))~%" (* 0.005493164 (-> *math-camera* fov))) + (format #t " (clear *camera-old-level*)~%") + (format #t " (format *camera-old-level* \"~A\")~%" (-> *level* level0 name)) + (let ((t9-31 format) + (a0-31 #t) + (a1-31 " (set! *camera-old-cpu* ~D)~%") + (a2-25 (-> *display* frames (-> *display* last-screen) profile-array data 0)) + ) + (t9-31 a0-31 a1-31 (- (-> a2-25 data 0 end-time) (-> a2-25 data 0 start-time))) + ) + (let ((t9-32 format) + (a0-32 #t) + (a1-32 " (set! *camera-old-vu* ~D)~%") + (a2-29 (-> *display* frames (-> *display* on-screen) profile-array data 1)) + ) + (t9-32 a0-32 a1-32 (- (-> a2-29 data 0 end-time) (-> a2-29 data 0 start-time))) + ) + (compute-memory-usage (-> *level* level0) #f) + (format #t " (set! *camera-old-tfrag-bytes* ~D)~%" (+ (-> *level* level0 mem-usage-block data 1 total) + (-> *level* level0 mem-usage-block data 2 total) + (-> *level* level0 mem-usage-block data 3 total) + (-> *level* level0 mem-usage-block data 4 total) + (-> *level* level0 mem-usage-block data 5 total) + (-> *level* level0 mem-usage-block data 6 total) + (-> *level* level0 mem-usage-block data 7 total) + (-> *level* level0 mem-usage-block data 8 total) + ) + ) + (format #t " (clear *camera-old-stat-string-tfrag*)~%") + (format #t " (clear *camera-old-stat-string-tfrag-near*)~%") + (format #t " (clear *camera-old-stat-string-total*)~%") + (when *stats-poly* + (format #t " (format *camera-old-stat-string-tfrag* \"~S\")~%" *stat-string-tfrag*) + (format #t " (format *camera-old-stat-string-tfrag-near* \"~S\")~%" *stat-string-tfrag-scissor*) + (format #t " (format *camera-old-stat-string-total* \"~S\")~%" *stat-string-total*) + ) + (format #t " (set! *display-camera-old-stats* #t)~%") + (format #t " )~%") + (format #t " )~%") + ) + (else + (format #t "camera save failed~%") + ) + ) + (none) + ) + +(defun debug-menu-make-camera-mode-menu ((arg0 debug-menu) (arg1 debug-menu)) + (new 'debug 'debug-menu-item-submenu "Camera" arg0) + (let ((a1-3 (new 'debug 'debug-menu-item-submenu "Mode" arg1))) + (debug-menu-append-item arg0 a1-3) + ) + (let ((a1-5 (new 'debug 'debug-menu-item-flag "Default" #f dm-cam-mode-default))) + (debug-menu-append-item arg1 a1-5) + ) + (let ((a1-7 (new 'debug 'debug-menu-item-flag "Free-floating" cam-free-floating dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-7) + ) + (let ((a1-9 (new 'debug 'debug-menu-item-flag "Fixed" cam-fixed dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-9) + ) + (let ((a1-11 (new 'debug 'debug-menu-item-flag "Pov" cam-pov dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-11) + ) + (let ((a1-13 (new 'debug 'debug-menu-item-flag "Pov180" cam-pov180 dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-13) + ) + (let ((a1-15 (new 'debug 'debug-menu-item-flag "Pov-track" cam-pov-track dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-15) + ) + (let ((a1-17 (new 'debug 'debug-menu-item-flag "Decel" cam-decel dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-17) + ) + (let ((a1-19 (new 'debug 'debug-menu-item-flag "Endless fall" cam-endlessfall dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-19) + ) + (let ((a1-21 (new 'debug 'debug-menu-item-flag "Eye" cam-eye dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-21) + ) + (let ((a1-23 (new 'debug 'debug-menu-item-flag "Stick" cam-stick dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-23) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "String" cam-string dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-25) + ) + (let ((a1-27 (new 'debug 'debug-menu-item-flag "Standoff" cam-standoff dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-27) + ) + (let ((a1-29 (new 'debug 'debug-menu-item-flag "Circular" cam-circular dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-29) + ) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Look At" cam-lookat dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-31) + ) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Center of world" cam-point-watch dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-33) + ) + (let ((a1-35 (new 'debug 'debug-menu-item-flag "Spline" cam-spline dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-35) + ) + (let ((a1-37 (new 'debug 'debug-menu-item-flag "Bike" cam-bike dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-37) + ) + (let ((a1-39 (new 'debug 'debug-menu-item-flag "Robotboss" cam-robotboss dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-39) + ) + ) + +(defun debug-menu-make-camera-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Camera menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Camera" gp-0)) + ) + (let ((a1-3 (new 'debug 'debug-menu arg0 "Camera mode menu"))) + (debug-menu-make-camera-mode-menu gp-0 a1-3) + ) + (let ((s3-0 (new 'debug 'debug-menu arg0 "Camera externalize menu"))) + (let ((a1-6 (new 'debug 'debug-menu-item-submenu "External" s3-0))) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((a1-8 (new 'debug 'debug-menu-item-flag "CPad 0" 'pad-0 dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-8) + ) + (let ((a1-10 (new 'debug 'debug-menu-item-flag "CPad 1" 'pad-1 dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-10) + ) + (let ((a1-12 (new 'debug 'debug-menu-item-flag "Lock" 'locked dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-12) + ) + (let ((a1-14 (new 'debug 'debug-menu-item-flag "Reset" 'reset dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-14) + ) + (let ((a1-16 (new 'debug 'debug-menu-item-flag "Allow z rot" 'allow-z dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-16) + ) + (let ((s2-0 (new 'debug 'debug-menu-item-var "Fov" 0 80))) + (debug-menu-item-var-make-float s2-0 dm-cam-render-float 1.0 #t 15.0 180.0 1) + (debug-menu-append-item s3-0 s2-0) + ) + ) + (let ((s3-1 (new 'debug 'debug-menu arg0 "Camera collision menu"))) + (let ((a1-22 (new 'debug 'debug-menu-item-submenu "Collision" s3-1))) + (debug-menu-append-item gp-0 a1-22) + ) + (let ((a1-24 (new 'debug 'debug-menu-item-flag "Record" '*record-cam-collide-history* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s3-1 a1-24) + ) + (let ((a1-26 + (new 'debug 'debug-menu-item-flag "Display" '*display-cam-collide-history* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s3-1 a1-26) + ) + ) + (let ((s4-1 (new 'debug 'debug-menu arg0 "Camera settings menu"))) + (let ((a1-29 (new 'debug 'debug-menu-item-submenu "Settings" s4-1))) + (debug-menu-append-item gp-0 a1-29) + ) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Default" #f dm-cam-settings-default))) + (debug-menu-append-item s4-1 a1-31) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "Fov" (the-as int 'fov) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-cam-setting-float) + 1.0 + #t + 15.0 + 180.0 + 1 + ) + (debug-menu-append-item s4-1 s3-2) + ) + (let ((a1-36 (new 'debug 'debug-menu-item-flag "Butt cam" 0 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-36) + ) + (let ((a1-38 (new 'debug 'debug-menu-item-flag "Same side" 1 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-38) + ) + (let ((a1-40 (new 'debug 'debug-menu-item-flag "Move spherical" 2 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-40) + ) + (let ((a1-42 (new 'debug 'debug-menu-item-flag "Drag" 3 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-42) + ) + (let ((a1-44 (new 'debug 'debug-menu-item-flag "Allow Z rot" 4 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-44) + ) + (let ((a1-46 (new 'debug 'debug-menu-item-flag "Pitch for jump" 6 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-46) + ) + (let ((a1-48 (new 'debug 'debug-menu-item-flag "Find hidden target" 7 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-48) + ) + (let ((a1-50 (new 'debug 'debug-menu-item-flag "Collide" 8 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-50) + ) + (let ((a1-52 (new 'debug 'debug-menu-item-flag "Line of Sight" 9 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-52) + ) + (let ((a1-54 (new 'debug 'debug-menu-item-flag "No Rotate" 10 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-54) + ) + (let ((a1-56 (new 'debug 'debug-menu-item-flag "Sticky Angle" 11 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-56) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "Interp Frms" 40 80))) + (debug-menu-item-var-make-int s3-3 dm-cam-settings-func-int 1 #f 0 0 #f) + (debug-menu-append-item s4-1 s3-3) + ) + (let ((a1-61 (new + 'debug + 'debug-menu-item-flag + "no mip/lod correction" + '*camera-no-mip-correction* + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-61) + ) + (let ((a1-63 + (new 'debug 'debug-menu-item-flag "last attacker" '*display-camera-last-attacker* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-63) + ) + (let ((a1-65 (new 'debug 'debug-menu-item-flag "old stats" '*display-camera-old-stats* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s4-1 a1-65) + ) + (let ((a1-67 (new 'debug 'debug-menu-item-flag "xyz axes" '*display-xyz-axes* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-67) + ) + (let ((a1-69 + (new 'debug 'debug-menu-item-flag "Master Marks" '*display-cam-master-marks* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-69) + ) + (let ((a1-71 (new 'debug 'debug-menu-item-flag "Other Marks" '*display-cam-other* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-71) + ) + (let ((a1-73 (new 'debug 'debug-menu-item-flag "los debug" '*display-cam-los-debug* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-73) + ) + (let ((a1-75 (new 'debug 'debug-menu-item-flag "los info" '*display-cam-los-info* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-75) + ) + (let ((a1-77 (new 'debug 'debug-menu-item-flag "los Marks" '*display-cam-los-marks* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-77) + ) + (let ((a1-79 (new 'debug 'debug-menu-item-flag "coll Marks" '*display-cam-coll-marks* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s4-1 a1-79) + ) + (let ((a1-81 (new 'debug 'debug-menu-item-flag "Camera Marks" '*display-camera-marks* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s4-1 a1-81) + ) + ) + (let ((a1-83 (new 'debug 'debug-menu-item-flag "Edit" '*cam-layout* (lambda ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if (-> arg0 value) + (cam-layout-stop) + (cam-layout-start) + ) + ) + (-> arg0 value) + ) + ) + ) + ) + (debug-menu-append-item gp-0 a1-83) + ) + (let ((a1-85 (new + 'debug + 'debug-menu-item-function + "Save Pos" + #f + (the-as (function object object) debug-create-cam-restore) + ) + ) + ) + (debug-menu-append-item gp-0 a1-85) + ) + s5-0 + ) + ) + +(defun debug-menu-make-shader-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Shader menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Shader" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Shader pick menu"))) + (set! *shader-pick-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shader" a3-3))) + (debug-menu-append-item gp-0 a1-4) + ) + ) + (let ((a1-6 (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-shader-list))) + ) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((s4-1 (new 'debug 'debug-menu-item-var "tweak" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-float + s4-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((s4-0 (the-as texture-id (-> arg0 value))) + (gp-0 (lookup-texture-by-id s4-0)) + (v1-3 (-> *texture-page-dir* entries (-> s4-0 page) link)) + ) + (cond + ((and gp-0 v1-3) + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 uv-dist) arg2) + (let ((s5-1 (the-as object (* (-> v1-3 next (-> s4-0 index) shader) 16)))) + (while (nonzero? (the-as uint s5-1)) + (adgif-shader-update! (the-as adgif-shader s5-1) gp-0) + (set! s5-1 (* (-> (the-as adgif-shader s5-1) next shader) 16)) + ) + ) + ) + (-> gp-0 uv-dist) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + 0.1 + #t + 0.1 + 30.0 + 1 + ) + (debug-menu-append-item gp-0 s4-1) + ) + (let ((a1-11 + (new + 'debug + 'debug-menu-item-function + "all tweak+" + #f + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* 0.1) (none))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((a1-13 + (new + 'debug + 'debug-menu-item-function + "all tweak-" + #f + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* -0.1) (none))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-13) + ) + (let ((s4-2 (new 'debug 'debug-menu-item-var "l" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-2 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 l) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 l) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #f + ) + (debug-menu-append-item gp-0 s4-2) + ) + (let ((s4-3 (new 'debug 'debug-menu-item-var "k" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-3 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + 0 ;; TODO - broken + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (sar (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex1))) 20) 52) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + -2048 + 2047 + #f + ) + (debug-menu-append-item gp-0 s4-3) + ) + (let ((s4-4 (new 'debug 'debug-menu-item-var "mmin" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-4 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmin) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmin) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 5 + #t + ) + (debug-menu-append-item gp-0 s4-4) + ) + (let ((s4-5 (new 'debug 'debug-menu-item-var "mmag" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-5 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmag) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmag) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-5) + ) + (let ((s4-6 (new 'debug 'debug-menu-item-var "lcm" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-6 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 lcm) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 lcm) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-6) + ) + (let ((s4-7 (new 'debug 'debug-menu-item-var "tfx" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-7 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; TODO - broken + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 27) 62) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-7) + ) + (let ((s4-8 (new 'debug 'debug-menu-item-var "tbp" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-8 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbp0) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbp0) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + #x4000 + #t + ) + (debug-menu-append-item gp-0 s4-8) + ) + (let ((s4-9 (new 'debug 'debug-menu-item-var "tbw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-9 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 15 + #t + ) + (debug-menu-append-item gp-0 s4-9) + ) + (let ((s4-10 (new 'debug 'debug-menu-item-var "tw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-10 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-10) + ) + (let ((s4-11 (new 'debug 'debug-menu-item-var "th" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-11 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; TODO - broken + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 30) 60) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-11) + ) + (let ((s4-12 (new 'debug 'debug-menu-item-var "mxl" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-12 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mxl) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mxl) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 6 + #t + ) + (debug-menu-append-item gp-0 s4-12) + ) + (let ((s4-13 (new 'debug 'debug-menu-item-var "wms" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-13 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wms) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wms) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-13) + ) + (let ((s4-14 (new 'debug 'debug-menu-item-var "wmt" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-14 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wmt) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wmt) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-14) + ) + (let ((s4-15 (new 'debug 'debug-menu-item-var "minu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-15 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp minu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-15) + ) + (let ((s4-16 (new 'debug 'debug-menu-item-var "maxu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-16 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp maxu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-16) + ) + (let ((s4-17 (new 'debug 'debug-menu-item-var "minv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-17 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; TODO - broken + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 30) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-17) + ) + (let ((s4-18 (new 'debug 'debug-menu-item-var "maxv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-18 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + ;; TODO - broken + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 20) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-18) + ) + s5-0 + ) + ) + +(defun debug-menu-make-instance-menu ((arg0 debug-menu-context)) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Instance menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Instance" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Instance shrub menu"))) + (set! *instance-shrub-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shrub" a3-3))) + (debug-menu-append-item gp-0 a1-4) + ) + ) + (let ((a3-5 (new 'debug 'debug-menu arg0 "Instance tie menu"))) + (set! *instance-tie-menu* a3-5) + (let ((a1-7 (new 'debug 'debug-menu-item-submenu "Pick Tie" a3-5))) + (debug-menu-append-item gp-0 a1-7) + ) + ) + (let ((a1-9 + (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list)) + ) + ) + (debug-menu-append-item gp-0 a1-9) + ) + (let ((a1-11 + (new 'debug 'debug-menu-item-function "Print Info" #f (the-as (function object object) print-prototype-list)) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-0 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists x) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists x)) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-0) + ) + (let ((s3-1 (new 'debug 'debug-menu-item-var "far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists w) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists w)) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-1) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "tie vanish near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-rvanish-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-2) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "tie vanish far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-3 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-vanish-far-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-3) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "invisible" 1 dm-edit-instance-toggle-pick-func))) + (debug-menu-append-item gp-0 a1-25) + ) + (let ((a3-18 (new 'debug 'debug-menu arg0 "Enable Instance Shrub Menu"))) + (set! *enable-instance-shrub-menu* a3-18) + (let ((a1-28 (new 'debug 'debug-menu-item-submenu "Enable Shrub" a3-18))) + (debug-menu-append-item gp-0 a1-28) + ) + ) + (let ((a3-20 (new 'debug 'debug-menu arg0 "Enable Instance Tie Menu"))) + (set! *enable-instance-tie-menu* a3-20) + (let ((a1-31 (new 'debug 'debug-menu-item-submenu "Enable Tie" a3-20))) + (debug-menu-append-item gp-0 a1-31) + ) + ) + (let ((a1-33 + (new 'debug 'debug-menu-item-flag "Instance Info" '*display-instance-info* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item gp-0 a1-33) + ) + s5-0 + ) + ) + +(defun dm-task-menu-pick-func ((arg0 game-task) (arg1 debug-menu-msg)) + (let ((gp-0 (/ (the-as int arg0) 8))) + (when (= arg1 (debug-menu-msg press)) + (if (cpad-hold? 0 l1) + (task-node-open! (the-as game-task gp-0)) + (task-node-close! (the-as game-task gp-0)) + ) + ) + (if (and (not (task-node-closed? (the-as game-task-node gp-0))) (not (task-node-open? (the-as game-task gp-0)))) + (return 'invalid) + ) + (task-node-closed? (the-as game-task-node gp-0)) + ) + ) + +(defun debug-menu-make-continue-sub-menu ((arg0 debug-menu-context) (arg1 symbol)) + (local-vars + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 string) + ) + (let ((s4-0 *level-load-list*) + (s5-0 '()) + ) + (while (not (null? s4-0)) + (let ((v1-1 (-> (the-as symbol (car s4-0)) value))) + (when (or (= arg1 'test) (= (-> (the-as level-load-info v1-1) taskname) arg1)) + (let ((s3-0 (-> (the-as level-load-info v1-1) continues))) + (while (not (null? s3-0)) + (let ((v1-2 (car s3-0)) + (a0-5 arg1) + ) + (when (if (= a0-5 'test) + (logtest? (continue-flags cf17) (-> (the-as continue-point v1-2) flags)) + #t + ) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> (the-as continue-point v1-2) name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (-> (the-as continue-point v1-2) name)) + (let* ((a3-1 (cons 'dm-current-continue '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! s5-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) s5-0)) + ) + ) + ) + ) + (set! s3-0 (cdr s3-0)) + ) + ) + ) + ) + (set! s4-0 (cdr s4-0)) + ) + (let ((a3-5 '())) + (let ((a2-6 (car s5-0))) + (while (not (null? s5-0)) + (set! a3-5 (cons a2-6 a3-5)) + (set! s5-0 (cdr s5-0)) + (set! a2-6 (car s5-0)) + ) + ) + (cons 'menu (cons (symbol->string arg1) a3-5)) + ) + ) + ) + +;; WARN: Return type mismatch pair vs debug-menu-node. +(defun debug-menu-make-task-sub-menu ((arg0 debug-menu-context)) + (local-vars + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 int) + ) + "TODO - need to know more about game-info" + (let ((gp-0 '())) + (let ((s4-0 (-> *game-info* sub-task-list))) + (countdown (s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((v1-4 (-> s4-0 s3-0))) + (when (= (-> v1-4 level) arg0) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> v1-4 name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (* s3-0 8)) + (let* ((a3-1 (cons 'dm-task-menu-pick-func '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! gp-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) gp-0)) + ) + ) + ) + ) + ) + ) + ) + (the-as debug-menu-node (cons 'menu (cons (-> (the-as (pointer uint32) (+ #xff37 (the-as int arg0)))) gp-0))) + ) + ) + +(defun debug-menu-make-task-menu ((arg0 debug-menu-context)) + (local-vars (sv-16 debug-menu-context)) + (let* ((s5-0 (new 'debug 'debug-menu arg0 "Task menu")) + (s4-0 (new 'debug 'debug-menu-item-submenu "Task" s5-0)) + ) + (let* ((s3-0 '(city + fortress + stadium + palace + castle + ruins + atoll + sewer + strip + mountain + forest + drill + tomb + dig + canyon + consite + under + nest + default + test + ) + ) + (a0-3 (car s3-0)) + ) + (while (not (null? s3-0)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s5-0) + (s0-0 debug-menu-make-from-template) + ) + (set! sv-16 arg0) + (let ((a1-2 (debug-menu-make-task-sub-menu (the-as debug-menu-context a0-3)))) + (s2-0 s1-0 (s0-0 sv-16 (the-as pair a1-2))) + ) + ) + (set! s3-0 (cdr s3-0)) + (set! a0-3 (car s3-0)) + ) + ) + s4-0 + ) + ) + +;; WARN: Return type mismatch int vs none. +(defun dm-play-task-with-continue ((arg0 game-task) (arg1 string)) + (let* ((t9-0 play-task) + (a1-1 'debug) + (a2-0 (cond + ((cpad-hold? 0 l1) + 'pre-play + ) + ((cpad-hold? 0 r1) + 'kiosk + ) + ) + ) + (a1-2 (t9-0 arg0 a1-1 a2-0)) + ) + (if arg1 + (set! a1-2 arg1) + ) + (start 'play (get-continue-by-name *game-info* a1-2)) + ) + (set-master-mode 'game) + 0 + (none) + ) + +(defun dm-play-task ((arg0 game-task)) + (dm-play-task-with-continue (the-as game-task (/ (the-as int arg0) 8)) (the-as string #f)) + (none) + ) + +(defun dm-play-race ((arg0 race-selection) (arg1 symbol)) + (let ((s5-0 (the-as string #f)) + (gp-0 0) + ) + (case arg0 + (((race-selection kiera-class3)) + (set! gp-0 43) + (set! s5-0 "stadiumb-record-path") + ) + (((race-selection kiera-class2)) + (set! gp-0 55) + (set! s5-0 "stadiumc-record-path") + ) + (((race-selection kiera-class1)) + (set! gp-0 63) + (set! s5-0 "stadiumd-record-path") + ) + (((race-selection errol)) + (set! gp-0 57) + (set! s5-0 "ctyport-errol-record-path") + ) + (((race-selection bush-class3)) + (set! gp-0 104) + (set! s5-0 "stadiumb-record-path") + ) + (((race-selection bush-class2)) + (set! gp-0 105) + (set! s5-0 "stadiumc-record-path") + ) + (((race-selection bush-class1)) + (set! gp-0 106) + (set! s5-0 "stadiumd-record-path") + ) + (((race-selection bush-errol)) + (set! gp-0 101) + (set! s5-0 "ctyport-errol-record-path") + ) + (((race-selection bush-port)) + (set! gp-0 102) + (set! s5-0 "ctyport-race-record-path") + ) + (((race-selection bush-class3-reverse)) + (set! gp-0 107) + (set! s5-0 "stadiumb-record-path") + ) + (((race-selection bush-class2-reverse)) + (set! gp-0 108) + (set! s5-0 "stadiumc-record-path") + ) + (((race-selection bush-class1-reverse)) + (set! gp-0 109) + (set! s5-0 "stadiumd-record-path") + ) + ) + (if (not arg1) + (set! s5-0 (the-as string #f)) + ) + (format #t "dm-play-race starting task ~d continue ~s~%" gp-0 s5-0) + (if (nonzero? gp-0) + (dm-play-task-with-continue (the-as game-task gp-0) s5-0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch debug-menu-node vs none. +(defun debug-menu-make-play-menu ((arg0 symbol)) + (local-vars + (sv-16 symbol) + (sv-32 type) + (sv-48 symbol) + (sv-64 (function symbol type object object pair)) + (sv-80 symbol) + (sv-96 type) + (sv-112 string) + (sv-128 (function symbol type object object pair)) + (sv-144 symbol) + (sv-160 type) + (sv-176 int) + ) + (let ((gp-0 '())) + (countdown (s4-0 (-> *game-info* play-list length)) + (let ((v1-4 (-> *game-info* play-list s4-0))) + (when (-> v1-4 play-continue) + (let ((s3-0 (method-of-type pair new)) + (s2-0 'global) + (s1-0 pair) + (s0-0 (method-of-type pair new)) + ) + (set! sv-16 'global) + (set! sv-32 pair) + (set! sv-48 'function) + (set! sv-64 (method-of-type pair new)) + (set! sv-80 'global) + (set! sv-96 pair) + (set! sv-112 (-> v1-4 name)) + (set! sv-128 (method-of-type pair new)) + (set! sv-144 'global) + (set! sv-160 pair) + (set! sv-176 (* s4-0 8)) + (let* ((a3-1 (cons 'dm-play-task '())) + (a3-2 (sv-128 sv-144 sv-160 sv-176 a3-1)) + (a3-3 (sv-64 sv-80 sv-96 sv-112 a3-2)) + ) + (set! gp-0 (s3-0 s2-0 s1-0 (s0-0 sv-16 sv-32 sv-48 a3-3) gp-0)) + ) + ) + ) + ) + ) + (debug-menu-make-from-template (the-as debug-menu-context arg0) (cons 'menu (cons "Play" gp-0))) + ) + (none) + ) + +(defun dm-anim-tester-flag-func ((arg0 int) (arg1 debug-menu-msg)) + (when *anim-tester* + (case arg0 + (('at-apply-align) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *anim-tester* 0 debug-flags) (anim-tester-debug-flags at-apply-align)) + ) + (return (logtest? (-> *anim-tester* 0 debug-flags) (anim-tester-debug-flags at-apply-align))) + ) + (('at-show-joint-info) + (if (= arg1 (debug-menu-msg press)) + (logxor! (-> *anim-tester* 0 debug-flags) (anim-tester-debug-flags at-show-joint-info)) + ) + (return (logtest? (-> *anim-tester* 0 debug-flags) (anim-tester-debug-flags at-show-joint-info))) + ) + ) + ) + #f + ) + +(defun dm-anim-tester-func ((arg0 int) (arg1 debug-menu-msg)) + (local-vars (v0-1 symbol)) + (if (not *anim-tester*) + (anim-tester-start) + ) + (when *anim-tester* + (cond + ((= arg0 'at-pick-object) + (send-event (ppointer->process *anim-tester*) 'pick-object) + (set! v0-1 #t) + (set! (-> *debug-menu-context* is-hidden) v0-1) + v0-1 + ) + ((= arg0 'at-pick-joint-anim) + (send-event (ppointer->process *anim-tester*) 'pick-joint-anim) + (set! v0-1 #t) + (set! (-> *debug-menu-context* is-hidden) v0-1) + v0-1 + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defun dm-pilot-mode ((arg0 object)) + "TODO - what is the third arg to target's change-mode?" + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'pilot #f arg0 #t) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defun dm-pilot-race-mode ((arg0 object)) + "TODO - what is the third arg to target's change-mode?" + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'pilot-race #f arg0 #t) + (none) + ) + +(defun stop-watch-display ((arg0 object) (arg1 object)) + (let ((v1-3 (- (-> *display* base-clock frame-counter) (the-as int (-> *game-info* stop-watch-start))))) + (format arg1 "Stop watch ~D:~D:~D~%" (/ v1-3 #x4650) (/ (mod v1-3 #x4650) 300) (/ (* 100 (mod v1-3 300)) 300)) + ) + #f + ) + +(defun debug-menu-context-make-default-menus ((arg0 debug-menu-context)) + (local-vars (sv-16 debug-menu-context)) + (let ((s5-0 (new 'debug 'debug-menu arg0 "Main menu"))) + (debug-menu-context-set-root-menu arg0 s5-0) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Artist" + (flag "Poly Stats" *stats-poly* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + ) + (flag "All Visible" *artist-all-visible* dm-boolean-toggle-pick-func) + (flag "Flip Visible" *artist-flip-visible* dm-boolean-toggle-pick-func) + (flag "Fix Visible" *artist-fix-visible* dm-boolean-toggle-pick-func) + (flag "Fix Frustum" *artist-fix-frustum* dm-boolean-toggle-pick-func) + (flag "Manual Sample Point" *manual-sample-point* dm-boolean-toggle-pick-func) + (flag "Error Spheres" *artist-error-spheres* dm-boolean-toggle-pick-func) + (flag "Use menu subdiv" *artist-use-menu-subdiv* dm-boolean-toggle-pick-func) + (float-var "Subdiv Close" close dm-subdiv-float 10 1 #t 1 200 1) + (float-var "Subdiv Far" far dm-subdiv-float 10 1 #t 1 200 1) + (function "Target Start" #f (lambda () (start 'debug (get-current-continue-point *game-info*)))) + (function "Target Stop" #f (lambda () (stop 'debug))) + (menu + "Anim Tester" + (int-var "Speed" anim-speed dm-subdiv-int 10 10 #t -300 1000) + (flag "Apply Align" at-apply-align dm-anim-tester-flag-func) + (flag "Show Joint Inf" at-show-joint-info dm-anim-tester-flag-func) + (function "Pick Object" at-pick-object dm-anim-tester-func) + (function "Pick Joint Anim" at-pick-joint-anim dm-anim-tester-func) + (function "Pick Sequence" at-pick-sequence dm-anim-tester-func) + (function "Save Sequences" at-save-sequences dm-anim-tester-func) + ) + (flag "Show Entity Errors" *display-entity-errors* dm-boolean-toggle-pick-func) + (flag "Sprite Info" *display-sprite-info* dm-boolean-toggle-pick-func) + (flag "Sprite Marks" *display-sprite-marks* dm-boolean-toggle-pick-func) + (flag "Sprite Spheres" *display-sprite-spheres* dm-boolean-toggle-pick-func) + (flag "Time of Day" #f dm-time-of-day-pick-func) + (flag "Preload Anims" *preload-spool-anims* dm-boolean-toggle-pick-func) + (function + "Mike F" + #f + (lambda () (debug-actor "drill-crane-14") (send-event (the-as process-tree *debug-actor*) 'die)) + ) + (function + "Editor" + #f + (lambda () + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :to *entity-pool*) + (set-master-mode 'game) + (none) + ) + ) + (flag + "Screen shot highres enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* highres-enable) (not (-> *screen-shot-work* highres-enable))) + ) + (-> *screen-shot-work* highres-enable) + ) + ) + (flag + "Screen shot hud enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* hud-enable) (not (-> *screen-shot-work* hud-enable))) + ) + (-> *screen-shot-work* hud-enable) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Game" + (function "New Game" #f (lambda () (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)))) + (function "New Life" #f (lambda () (initialize! *game-info* 'dead (the-as game-save #f) (the-as string #f)))) + (function + "Reset Game" + #f + (lambda () + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)) + ) + ) + (function "Reset Actors" #f (lambda () (reset-actors 'debug) (none))) + (function "Save Game" #f (lambda () (auto-save-command 'save 0 0 *default-pool* #f) (none))) + (function "Load Game" #f (lambda () (auto-save-command 'restore 0 0 *default-pool* #f) (none))) + (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-point *game-info*)) + ) + ) + *target* + ) + ) + (flag "Game Mode" play dm-game-mode-pick-func) + (flag "Debug Mode" debug dm-game-mode-pick-func) + (function + "Stop Watch Start" + #f + (lambda () + (remove-by-param0 *debug-engine* stop-watch-display) + (add-connection *debug-engine* *dproc* stop-watch-display *dproc* *stdcon0* #f) + (set! (-> *game-info* stop-watch-start) (the-as uint (-> *display* base-clock frame-counter))) + (set! (-> *game-info* stop-watch-stop) (the-as uint 0)) + (format #t "Stop watch started!~%") + (none) + ) + ) + (function + "Stop Watch Stop" + #f + (lambda () + (remove-by-param0 *debug-engine* stop-watch-display) + (set! (-> *game-info* stop-watch-stop) (the-as uint (-> *display* base-clock frame-counter))) + (let ((v1-7 (- (-> *game-info* stop-watch-stop) (-> *game-info* stop-watch-start)))) + (format + #t + "Stop watch elasped time was ~D:~D:~D~%" + (/ (the-as int v1-7) #x4650) + (/ (mod (the-as int v1-7) #x4650) 300) + (/ (* 100 (mod (the-as int v1-7) 300)) 300) + ) + ) + (none) + ) + ) + (function "Continue Start" #f (lambda () (start 'play (-> *game-info* current-continue)))) + (function "Kiosk Reset" #f (lambda () (auto-save-command 'restore 0 0 *default-pool* #f) (none))) + (menu + "Secrets" + (flag "toggle-beard" 1 dm-game-secret-toggle-pick-func) + (flag "hflip-screen" 2 dm-game-secret-toggle-pick-func) + (flag "endless-ammo" 4 dm-game-secret-toggle-pick-func) + (flag "invulnerable" 8 dm-game-secret-toggle-pick-func) + (flag "endless-dark" 16 dm-game-secret-toggle-pick-func) + (flag "scene-player-1" 32 dm-game-secret-toggle-pick-func) + (flag "scene-player-2" 64 dm-game-secret-toggle-pick-func) + (flag "scene-player-3" 128 dm-game-secret-toggle-pick-func) + (flag "level-select" 256 dm-game-secret-toggle-pick-func) + (flag "scrap-book-1" 512 dm-game-secret-toggle-pick-func) + (flag "scrap-book-2" 1024 dm-game-secret-toggle-pick-func) + (flag "gungame-blue" 4096 dm-game-secret-toggle-pick-func) + (flag "gungame-dark" 8192 dm-game-secret-toggle-pick-func) + (flag "reverse-races" 16384 dm-game-secret-toggle-pick-func) + (flag "hero-mode" 32768 dm-game-secret-toggle-pick-func) + (flag "big-head" 65536 dm-game-secret-toggle-pick-func) + (flag "little-head" 131072 dm-game-secret-toggle-pick-func) + ) + (menu "Continue") + (menu + "Settings" + (float-var + "sfx-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default sfx-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default sfx-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "ambient-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default ambient-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default ambient-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "music-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default music-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default music-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "dialog-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default dialog-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default dialog-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (menu + "Language" + (flag "english" 0 dm-setting-language) + (flag "french" 1 dm-setting-language) + (flag "german" 2 dm-setting-language) + (flag "spanish" 3 dm-setting-language) + (flag "italian" 4 dm-setting-language) + (flag "japanese" 5 dm-setting-language) + (flag "korean" 6 dm-setting-language) + (flag "uk-english" 7 dm-setting-language) + ) + (menu + "Subtitle Language" + (flag "english" 0 dm-setting-subtitle-language) + (flag "french" 1 dm-setting-subtitle-language) + (flag "german" 2 dm-setting-subtitle-language) + (flag "spanish" 3 dm-setting-subtitle-language) + (flag "italian" 4 dm-setting-subtitle-language) + (flag "japanese" 5 dm-setting-subtitle-language) + (flag "korean" 6 dm-setting-subtitle-language) + (flag "uk-english" 7 dm-setting-subtitle-language) + ) + (flag + "play-hints " + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default play-hints) (not (-> *setting-control* user-default play-hints))) + ) + (the-as uint (-> *setting-control* user-default play-hints)) + ) + ) + (flag + "subtitle " + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) + ) + (-> *setting-control* user-default subtitle) + ) + ) + (flag + "vibration" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default vibration) (not (-> *setting-control* user-default vibration))) + ) + (the-as uint (-> *setting-control* user-default vibration)) + ) + ) + (menu + "Stereo Mode" + (flag "mono" 0 dm-setting-stereo-mode) + (flag "stereo" 1 dm-setting-stereo-mode) + (flag "surround" 2 dm-setting-stereo-mode) + ) + (flag + "camera-stick-dir" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default unknowng-symbol-00) + (not (-> *setting-control* user-default unknowng-symbol-00)) + ) + ) + (the-as uint (-> *setting-control* user-default unknowng-symbol-00)) + ) + ) + (flag + "progressive-scan" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default unknown-uint32-00) + (the-as uint (not (-> *setting-control* user-default unknown-uint32-00))) + ) + ) + (-> *setting-control* user-default unknown-uint32-00) + ) + ) + (flag + "border-mode" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default border-mode) (not (-> *setting-control* user-default border-mode))) + (set! (-> *level* play?) (-> *setting-control* user-default border-mode)) + ) + (-> *setting-control* user-default border-mode) + ) + ) + ) + (menu + "Features" + (flag "board" 1024 dm-game-feature-toggle-pick-func) + (flag "board-training" 67108864 dm-game-feature-toggle-pick-func) + (flag "carry" 2048 dm-game-feature-toggle-pick-func) + (flag "sidekick" 4096 dm-game-feature-toggle-pick-func) + (flag "darkjak" 8192 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb0" 4194304 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb1" 8388608 dm-game-feature-toggle-pick-func) + (flag "darkjak-invinc" 16777216 dm-game-feature-toggle-pick-func) + (flag "darkjak-giant" 33554432 dm-game-feature-toggle-pick-func) + (flag "gun-yellow" 64 dm-game-feature-toggle-pick-func) + (flag "gun-red" 128 dm-game-feature-toggle-pick-func) + (flag "gun-blue" 256 dm-game-feature-toggle-pick-func) + (flag "gun-dark" 512 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-speed" 16384 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-ammo" 32768 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-damage" 65536 dm-game-feature-toggle-pick-func) + (flag "pass-red" 262144 dm-game-feature-toggle-pick-func) + (flag "pass-green" 524288 dm-game-feature-toggle-pick-func) + (flag "pass-yellow" 1048576 dm-game-feature-toggle-pick-func) + ) + ) + ) + ) + (let* ((s4-2 (debug-menu-find-from-template arg0 '("Game" "Continue"))) + (s3-2 + '(city + fortress + stadium + palace + castle + ruins + atoll + sewer + strip + mountain + forest + drill + tomb + dig + canyon + consite + under + nest + default + test + ) + ) + (a1-7 (car s3-2)) + ) + (while (not (null? s3-2)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s4-2) + (s0-0 debug-menu-make-from-template) + ) + (set! sv-16 arg0) + (let ((a1-8 (debug-menu-make-continue-sub-menu (the-as debug-menu-context *game-info*) (the-as symbol a1-7)))) + (s2-0 s1-0 (s0-0 sv-16 a1-8)) + ) + ) + (set! s3-2 (cdr s3-2)) + (set! a1-7 (car s3-2)) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Stats" + (flag "Poly" *stats-poly* dm-boolean-toggle-pick-func) + (flag "Collide" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Bsp" *stats-bsp* dm-boolean-toggle-pick-func) + (flag "Buffer" *stats-buffer* dm-boolean-toggle-pick-func) + (flag "Target" *stats-target* dm-boolean-toggle-pick-func) + (flag "Blerc" *stats-blerc* dm-boolean-toggle-pick-func) + (flag "Profile bars" *stats-profile-bars* dm-boolean-toggle-pick-func) + (flag "Perf" *stats-perf* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + ) + (function + "Print Entity Memory" + #f + (lambda () + (format #t "~%~%========================= Entity Memory =========================~%~%") + (let ((gp-0 (-> *level* level0))) + (inspect (-> gp-0 art-group)) + (dotimes (s5-0 (-> gp-0 art-group art-group-array length)) + (inspect (-> gp-0 art-group art-group-array s5-0)) + ) + ) + #f + ) + ) + (function + "Print Texture Info" + #f + (lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (inspect *texture-page-dir*) + ) + ) + (function + "Print Texture Verbose" + #f + (lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (texture-page-dir-inspect *texture-page-dir* #t) + (none) + ) + ) + (function + "Print Merc Stats" + #f + (lambda () + (format #t "~%~%========================== Merc Stats ==========================~%~%") + (merc-stats) + (none) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Render" + (menu + "Background" + (flag "Textured" 0 dm-subdiv-draw-func) + (flag "Outline" 1 dm-subdiv-draw-func) + (flag "Gouraud" 2 dm-subdiv-draw-func) + (flag "Hack" 3 dm-subdiv-draw-func) + ) + (menu + "Background Scissor" + (flag "Textured" 0 dm-scissor-subdiv-draw-func) + (flag "Outline" 1 dm-scissor-subdiv-draw-func) + (flag "Gouraud" 2 dm-scissor-subdiv-draw-func) + (flag "Hack" 3 dm-scissor-subdiv-draw-func) + ) + (menu + "Foreground" + (flag "Textured" 0 dm-foreground-subdiv-draw-func) + (flag "Outline" 1 dm-foreground-subdiv-draw-func) + (flag "Gouraud" 2 dm-foreground-subdiv-draw-func) + (flag "Hack" 3 dm-foreground-subdiv-draw-func) + ) + (menu + "Ocean" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + (flag "Hack" 3 dm-ocean-subdiv-draw-func) + ) + (flag "SKY TEXTURES" 32 dm-texture-user-toggle-pick-func) + (flag "sky" 3 dm-vu1-user-toggle-pick-func) + (flag "ocean" 4 dm-vu1-user-toggle-pick-func) + (flag "ocean-wave" 5 dm-vu1-user-toggle-pick-func) + (flag "TFRAG TIE TEXTURES" #x1 dm-texture-user-toggle-pick-func) + (flag "tfrag" 6 dm-vu1-user-toggle-pick-func) + (flag "tie" 8 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap" 9 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor" 7 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor" 10 dm-vu1-user-toggle-pick-func) + (flag "tie-vanish" 11 dm-vu1-user-toggle-pick-func) + (flag "SHRUB TEXTURES" #x4 dm-texture-user-toggle-pick-func) + (flag "shrub-near" 16 dm-vu1-user-toggle-pick-func) + (flag "shrubbery" 15 dm-vu1-user-toggle-pick-func) + (flag "shrubbery-vanish" 18 dm-vu1-user-toggle-pick-func) + (flag "billboard" 17 dm-vu1-user-toggle-pick-func) + (flag "ALPHA TEXTURES" 1 dm-texture-user-toggle-pick-func) + (flag "tfrag-trans" 19 dm-vu1-user-toggle-pick-func) + (flag "tie-trans" 21 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-trans" 22 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-trans" 20 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-trans" 23 dm-vu1-user-toggle-pick-func) + (flag "PRIS TEXTURES" #x2 dm-texture-user-toggle-pick-func) + (flag "merc" 13 dm-vu1-user-toggle-pick-func) + (flag "emerc" 14 dm-vu1-user-toggle-pick-func) + (flag "generic" 12 dm-vu1-user-toggle-pick-func) + (flag "WATER TEXTURES" 2 dm-texture-user-toggle-pick-func) + (flag "tfrag-water" 24 dm-vu1-user-toggle-pick-func) + (flag "tie-water" 26 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-water" 27 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-water" 25 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-water" 28 dm-vu1-user-toggle-pick-func) + (flag "SPRITE TEXTURES" 8 dm-texture-user-toggle-pick-func) + (flag "sprite" 29 dm-vu1-user-toggle-pick-func) + (flag "shadow" 30 dm-vu1-user-toggle-pick-func) + (flag "shadow-debug" *shadow-debug* dm-boolean-toggle-pick-func) + (flag "depth-cue" 34 dm-vu1-user-toggle-pick-func) + (flag "WARP TEXTURES" 4 dm-texture-user-toggle-pick-func) + (flag "HUD TEXTURES" 16 dm-texture-user-toggle-pick-func) + (flag "all on" #f dm-vu1-user-all-pick-func) + (flag "all off" #f dm-vu1-user-none-pick-func) + (flag "all textures on" #x1ff dm-texture-user-set-pick-func) + (flag "all textures off" 0 dm-texture-user-set-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Collision" + (menu + "Collision Renderer" + (flag "On" 0 dm-col-rend-on-func) + (flag "Track Player" 0 dm-col-rend-track-func) + (flag "Track Camera" 1 dm-col-rend-track-func) + (float-var " Dist" #f dm-col-rend-cam-dist 10 1 #t 0 80 1) + (flag "Fixed Pos" 2 dm-col-rend-track-func) + (float-var "Size" #f dm-col-rend-size 10 1 #t 1 20 1) + (flag "Outline" 0 dm-col-rend-outline-func) + (flag "Show Back-faces" 0 dm-col-rend-back-face-func) + (flag "Show Normals" 0 dm-col-rend-normals-func) + (flag "Ghost Hidden" 0 dm-col-rend-ghost-hidden-func) + (menu + "Show Only" + (flag "(board)" 1 dm-col-rend-show-only-set-func) + (flag "(grind)" 2 dm-col-rend-show-only-set-func) + (flag "(grindonly)" 4 dm-col-rend-show-only-set-func) + (flag "melt" 16384 dm-col-rend-show-only-toggle-func) + (flag "noboard" 8 dm-col-rend-show-only-toggle-func) + (flag "nocamera" 16 dm-col-rend-show-only-toggle-func) + (flag "noedge" 32 dm-col-rend-show-only-toggle-func) + (flag "noendlessfall" 64 dm-col-rend-show-only-toggle-func) + (flag "noentity" 128 dm-col-rend-show-only-toggle-func) + (flag "nogrind" 256 dm-col-rend-show-only-toggle-func) + (flag "nojak" 512 dm-col-rend-show-only-toggle-func) + (flag "nolineofsight" 1024 dm-col-rend-show-only-toggle-func) + (flag "nomech" 2048 dm-col-rend-show-only-toggle-func) + (flag "nopilot" 4096 dm-col-rend-show-only-toggle-func) + (flag "noproj" 8192 dm-col-rend-show-only-toggle-func) + (flag "probe" 32768 dm-col-rend-show-only-toggle-func) + (flag "Select All" 49144 dm-col-rend-show-only-set-func) + (flag "Unselect All" 0 dm-col-rend-show-only-set-func) + ) + (menu + "Find" + (flag "background" 1 dm-col-rend-cspec-toggle) + (flag "obstacles" 2 dm-col-rend-cspec-toggle) + (flag "pushers" 4 dm-col-rend-cspec-toggle) + (flag "Jak" 8 dm-col-rend-cspec-toggle) + (flag "other" 16 dm-col-rend-cspec-toggle) + ) + ) + (flag "Collision Cache" *display-collide-cache* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (flag "Ground Stats" *display-ground-stats* dm-boolean-toggle-pick-func) + (flag "Hipri Collision Marks" *display-hipri-collision-marks* dm-boolean-toggle-pick-func) + (flag "Edge Collision Marks" *display-edge-collision-marks* dm-boolean-toggle-pick-func) + (flag "Collide Stats" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Render Collision" *display-render-collision* dm-boolean-toggle-pick-func) + (flag "Collide List Boxes" *collide-list-boxes* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Display" + (flag "Profile" *display-profile* dm-boolean-toggle-pick-func) + (flag "Ticks" *profile-ticks* dm-boolean-toggle-pick-func) + (flag "File Info" *display-file-info* dm-boolean-toggle-pick-func) + (flag "Level Spheres" *display-level-spheres* dm-boolean-toggle-pick-func) + (flag "Camera Marks" *display-camera-marks* dm-boolean-toggle-pick-func) + (flag "Camera Info" *display-camera-info* dm-boolean-toggle-pick-func) + (flag "Geometry Marks" *display-geo-marks* dm-boolean-toggle-pick-func) + (flag "Art Control" *display-art-control* dm-boolean-toggle-pick-func) + (flag "Gui Control" *display-gui-control* dm-boolean-toggle-pick-func) + (flag "Instance Info" *display-instance-info* dm-boolean-toggle-pick-func) + (menu + "strip lines" + (flag "strippable" 1 dm-strip-lines-toggle-pick-func) + (flag "convertible" 2 dm-strip-lines-toggle-pick-func) + (flag "edgeable" 4 dm-strip-lines-toggle-pick-func) + (flag "ordinary" 8 dm-strip-lines-toggle-pick-func) + (flag "color mismatch" 16 dm-strip-lines-toggle-pick-func) + (flag "shader mismatch" 32 dm-strip-lines-toggle-pick-func) + (flag "uv mismatch" 64 dm-strip-lines-toggle-pick-func) + (flag "too big" 128 dm-strip-lines-toggle-pick-func) + (flag "good" 3 dm-strip-lines-set-pick-func) + (flag "bad" 240 dm-strip-lines-set-pick-func) + (flag "all edges" 255 dm-strip-lines-set-pick-func) + (flag "strips" 256 dm-strip-lines-set-pick-func) + (flag "frags" 512 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (menu + "collision mesh" + (flag "wall" 1024 dm-strip-lines-toggle-pick-func) + (flag "ground" 2048 dm-strip-lines-toggle-pick-func) + (flag "all" 3072 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (flag "Texture Distances" *display-texture-distances* dm-boolean-toggle-pick-func) + (flag "Texture Download" *display-texture-download* dm-boolean-toggle-pick-func) + (flag "Level Border" *display-level-border* dm-boolean-toggle-pick-func) + (flag "Split Boxes" *display-split-boxes* dm-boolean-toggle-pick-func) + (flag "Split Box Info" *display-split-box-info* dm-boolean-toggle-pick-func) + (flag "Memcard Info" *display-memcard-info* dm-boolean-toggle-pick-func) + (flag "Trail Graph" *display-trail-graph* dm-boolean-toggle-pick-func) + (flag "Color Bars" *display-color-bars* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Actor" + (flag "Spawn Actors" *spawn-actors* dm-boolean-toggle-pick-func) + (function "Reset Actors" #f (lambda () (reset-actors 'debug) (none))) + (function "Traffic Start" #f (lambda () + (let ((gp-0 traffic-start)) + (if (valid? gp-0 function (the-as symbol "") #t 0) + (gp-0) + ) + ) + (none) + ) + ) + (function "Traffic Kill" #f (lambda () + (let ((gp-0 traffic-kill)) + (if (valid? gp-0 function (the-as symbol "") #t 0) + (gp-0) + ) + ) + (none) + ) + ) + (menu + "Bot" + (function + "Bot Next" + #f + (lambda () + (send-event (process-by-name "sig-atoll-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-sewer-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-escort-1" *active-pool*) 'skip) + (send-event (process-by-name "squid-2" *active-pool*) 'skip) + (send-event (process-by-name "metalkor-1" *active-pool*) 'skip) + (send-event (process-by-name "sig-under-1" *active-pool*) 'skip) + ) + ) + (menu + "Bot Marks" + (flag "course spots" 1 display-bot-marks-toggle-pick-func) + (flag "task spots" 2 display-bot-marks-toggle-pick-func) + (flag "all on" 3 display-bot-marks-set-pick-func) + (flag "all off" 0 display-bot-marks-set-pick-func) + ) + (function + "Record sig5-cent1-path0" + #f + (lambda () + (set! *bot-record-path* 0) + (dm-play-task-with-continue (game-task under-sig) "cent1-path0-record-path") + (none) + ) + ) + (function + "Record sig5-cent2-path0" + #f + (lambda () + (set! *bot-record-path* 1) + (dm-play-task-with-continue (game-task under-sig) "cent2-path0-record-path") + (none) + ) + ) + ) + (menu + "Actor Compaction" + (flag "off" #f dm-compact-actor-pick-func) + (flag "on" #t dm-compact-actor-pick-func) + (flag "debug" debug dm-compact-actor-pick-func) + ) + (flag "Traffic height map" *display-traffic-height-map* dm-boolean-toggle-pick-func) + (flag "View Anims" *debug-view-anims* dm-boolean-toggle-pick-func) + (flag "Unkillable" *debug-unkillable* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Actor Vis" *vis-actors* dm-boolean-toggle-pick-func) + (flag "Battle Marks" *display-battle-marks* dm-boolean-toggle-pick-func) + (menu + "Hover Marks" + (flag "Nav Network" *display-nav-network* dm-boolean-toggle-pick-func) + (flag "Debug Hover" *debug-hover* dm-boolean-toggle-pick-func) + ) + (flag "Joint Axes" *display-joint-axes* dm-boolean-toggle-pick-func) + (flag "Path Marks" *display-path-marks* dm-boolean-toggle-pick-func) + (flag "Nav Marks" *display-nav-marks* dm-boolean-toggle-pick-func) + (flag "Vol Marks" *display-vol-marks* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (menu + "Actor Vis" + (flag "off" #f dm-actor-vis-pick-func) + (flag "box" box dm-actor-vis-pick-func) + (flag "sphere" sphere dm-actor-vis-pick-func) + (flag "all" #t dm-actor-vis-pick-func) + ) + (menu + "Actor Marks" + (flag "off" #f dm-actor-marks-pick-func) + (flag "alive entities" #t dm-actor-marks-pick-func) + (flag "all entities" full dm-actor-marks-pick-func) + (flag "processes" process dm-actor-marks-pick-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Target" + (menu + "Mode" + (function "normal" #f (lambda () (send-event *target* 'end-mode))) + (function "racer" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'racer #f) + ) + ) + (function "flut" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'flut #f) + ) + ) + (function "board" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature unk-game-feature-06)) + (logior! (-> *game-info* debug-features) (game-feature unk-game-feature-06)) + (send-event *target* 'change-mode 'gun #f 0) + ) + ) + (function "darkjak" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature darkjak)) + (logior! (-> *game-info* debug-features) (game-feature darkjak)) + (send-event *target* 'change-mode 'darkjak #f 3) + ) + ) + (function "indax" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f) + ) + ) + ) + (menu + "Pilot Mode" + (function "bikea" #f (lambda () (dm-pilot-mode 0) (none))) + (function "bikeb" #f (lambda () (dm-pilot-mode 1) (none))) + (function "bikec" #f (lambda () (dm-pilot-mode 2) (none))) + (function "crimson-bike" #f (lambda () (dm-pilot-mode 6) (none))) + (function "cara" #f (lambda () (dm-pilot-mode 3) (none))) + (function "carb" #f (lambda () (dm-pilot-mode 4) (none))) + (function "carc" #f (lambda () (dm-pilot-mode 5) (none))) + (function "hellcat" #f (lambda () (dm-pilot-mode 7) (none))) + (function "race-bike-a" #f (lambda () (dm-pilot-race-mode 0) (none))) + (function "race-bike-b" #f (lambda () (dm-pilot-race-mode 1) (none))) + (function "race-bike-c" #f (lambda () (dm-pilot-race-mode 2) (none))) + (function "evantestbike" #f (lambda () (dm-pilot-mode 8) (none))) + (function "test-bike" #f (lambda () (dm-pilot-mode 9) (none))) + (function "test-car" #f (lambda () (dm-pilot-mode 10) (none))) + ) + (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-point *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Darkjak" + (function + "get all" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (set! (-> *game-info* features) + (logior (game-feature darkjak darkjak-bomb0 darkjak-bomb1 darkjak-invinc darkjak-giant) + (-> *game-info* features) + ) + ) + (set! (-> *game-info* debug-features) + (logior (game-feature darkjak darkjak-bomb0 darkjak-bomb1 darkjak-invinc darkjak-giant) + (-> *game-info* debug-features) + ) + ) + (send-event *target* 'get-pickup 7 #x42c80000) + ) + ) + (function "manual" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature darkjak)) + (logior! (-> *game-info* debug-features) (game-feature darkjak)) + (send-event *target* 'change-mode 'darkjak #f 3) + ) + ) + (function "rapid" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature darkjak)) + (logior! (-> *game-info* debug-features) (game-feature darkjak)) + (send-event *target* 'change-mode 'darkjak #f 2) + ) + ) + (function "bomb0" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 7) + ) + ) + (function "bomb1" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 15) + ) + ) + (function "invinc" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 31) + ) + ) + (function "giant" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 63) + ) + ) + ) + (menu + "Gun" + (flag "yellow" 2 dm-game-inventory-toggle-pick-func) + (flag "red" 4 dm-game-inventory-toggle-pick-func) + (flag "blue" 8 dm-game-inventory-toggle-pick-func) + (flag "dark" 16 dm-game-inventory-toggle-pick-func) + (flag "gun-upgrade-speed" 16384 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-ammo" 32768 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-damage" 65536 dm-game-feature-toggle-pick-func) + ) + (flag "Target Marks" *display-target-marks* dm-boolean-toggle-pick-func) + (flag "Gun Marks" *gun-marks* dm-boolean-toggle-pick-func) + (flag "Target Stats" *stats-target* dm-boolean-toggle-pick-func) + (flag "Sidekick Stats" *display-sidekick-stats* dm-boolean-toggle-pick-func) + (flag "Invulnerable" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (logxor! (-> *target* state-flags) (state-flags sf2)) + ) + ) + (and *target* (logtest? (-> *target* state-flags) (state-flags sf2))) + ) + ) + (flag + "Endless Ammo" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (set! (-> *target* state-flags) (the-as state-flags (logxor #x10000 (the-as int (-> *target* state-flags))))) + ) + ) + (and *target* (logtest? (state-flags sf16) (-> *target* state-flags))) + ) + ) + (function + "Full Stuff" + #f + (lambda () + (send-event *target* 'get-pickup 18 #x447a0000) + (send-event *target* 'get-pickup 17 #x447a0000) + (send-event *target* 'get-pickup 13 #x447a0000) + (send-event *target* 'get-pickup 14 #x447a0000) + (send-event *target* 'get-pickup 15 #x447a0000) + (send-event *target* 'get-pickup 16 #x447a0000) + (send-event *target* 'get-pickup 7 #x42c80000) + (logior! + (-> *game-info* features) + (game-feature unk-game-feature-06 gun-yellow gun-red gun-blue gun-dark board darkjak) + ) + (let ((v0-7 + (logior (-> *game-info* debug-features) + (game-feature unk-game-feature-06 gun-yellow gun-red gun-blue gun-dark board darkjak) + ) + ) + ) + (set! (-> *game-info* debug-features) v0-7) + v0-7 + ) + ) + ) + (function + "Dump Stuff" + #f + (lambda () + (send-event *target* 'get-pickup 17 -998637568) + (send-event *target* 'get-pickup 13 -998637568) + (send-event *target* 'get-pickup 14 -998637568) + (send-event *target* 'get-pickup 15 -998637568) + (send-event *target* 'get-pickup 16 -998637568) + ) + ) + (function "Trick Mode" #f (lambda () (send-event *target* 'get-pickup 20 #x468ca000))) + (function "Reset Trans" #f (lambda () (when *target* + (position-in-front-of-camera! (target-pos 0) 40960.0 4096.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control unknown-quaternion00)) + (quaternion-identity! (-> *target* control dir-targ)) + ) + ) + ) + (function "Zero Trans" #f (lambda () (when *target* + (set-vector! (-> *target* control trans) 0.0 163840.0 0.0 1.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control unknown-quaternion00)) + (quaternion-identity! (-> *target* control dir-targ)) + ) + ) + ) + (flag "Slow Frame Rate" *slow-frame-rate* dm-boolean-toggle-pick-func) + (function "Print Pos" #f (lambda () + (let ((v1-0 (target-pos 0))) + (format #t "~6,,2m ~6,,2m ~6,,2m~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) + ) + 0 + ) + ) + (function "Save Continue" #f (lambda () (the-as symbol (if *target* + (trsq->continue-point (-> *target* control)) + ) + ) + ) + ) + (flag "RC Board Controls" *target-rc-board-controls* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-camera-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Racing" + (flag "Kiera Class 3 (kierac)" 0 dm-select-race-pick-func) + (flag "Kiera Class 2 (kierab)" 1 dm-select-race-pick-func) + (flag "Kiera Class 1 (kieraa)" 2 dm-select-race-pick-func) + (flag "Errol (errol)" 3 dm-select-race-pick-func) + (flag "Bush Class 3" 4 dm-select-race-pick-func) + (flag "Bush Class 2" 5 dm-select-race-pick-func) + (flag "Bush Class 1" 6 dm-select-race-pick-func) + (flag "Bush Class 3R" 9 dm-select-race-pick-func) + (flag "Bush Class 2R" 10 dm-select-race-pick-func) + (flag "Bush Class 1R" 11 dm-select-race-pick-func) + (flag "Bush Errol" 7 dm-select-race-pick-func) + (flag "Bush Port" 8 dm-select-race-pick-func) + (int-var "Select Path" 0 dm-select-race-path 10 1 #t 0 7) + (menu + "Race Marks" + (flag "Path 0 (Red)" 1 display-race-marks-toggle-pick-func) + (flag "Path 1 (Green)" 2 display-race-marks-toggle-pick-func) + (flag "Path 2 (Blue)" 4 display-race-marks-toggle-pick-func) + (flag "Path 3 (Yellow)" 8 display-race-marks-toggle-pick-func) + (flag "Path 4 (Cyan)" 16 display-race-marks-toggle-pick-func) + (flag "Path 5 (Violet)" 32 display-race-marks-toggle-pick-func) + (flag "Path 6 (Orange)" 64 display-race-marks-toggle-pick-func) + (flag "Path 7 (Black)" 128 display-race-marks-toggle-pick-func) + (flag "All Paths On" 255 display-race-marks-set-pick-func) + (flag "All Off" 0 display-race-marks-set-pick-func) + ) + (function + "Record Selected Path" + #f + (lambda () (set! *race-record-path* #t) (dm-play-race *select-race* #t) (none)) + ) + (function "Play Race" #f (lambda () (set! *race-record-path* #f) (dm-play-race *select-race* #f) (none))) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Nav Graph" + (function "Start Editor" #f (lambda () + (if (not (get-nav-graph-editor)) + (run-nav-graph-editor 'test) + ) + (none) + ) + ) + (function "Exit Editor" #f (lambda () + (if (get-nav-graph-editor) + (exit-nav-graph-editor) + ) + (none) + ) + ) + (function "Toggle Plane Mode" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (if a0-0 + ((method-of-object a0-0 nav-graph-editor-method-60)) + ) + ) + (none) + ) + ) + (function "Toggle Hover Mode" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (if a0-0 + ((method-of-object a0-0 nav-graph-editor-method-61)) + ) + ) + (none) + ) + ) + (menu + "Load" + (function "Hover Drillmid" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'drillmid + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Hover Forresca" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'forresca + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Hover Forest" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'forest + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Hover Under" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'under + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Traffic" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'traffic + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Minimap" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'minimap + (t9-1) + ) + ) + ) + (none) + ) + ) + ) + (function "Save" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (if a0-0 + ((method-of-object a0-0 nav-graph-editor-method-63)) + ) + ) + (none) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Map" + (flag "Record Mode" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *bigmap* recording-flag) (not (-> *bigmap* recording-flag))) + ) + (-> *bigmap* recording-flag) + ) + ) + (function + "Clear map" + #f + (lambda () + (let ((v1-1 + (process-spawn-function + process + (lambda () (with-pp + (set-master-mode 'game) + (let ((gp-0 (-> pp clock frame-counter))) + (until (>= (- (-> pp clock frame-counter) gp-0) (seconds 0.3)) + (suspend) + ) + ) + (until #f + (format *stdcon* "press x clear map, press circle cancel~%") + (cond + ((cpad-pressed? 0 x) + (initialize *bigmap*) + (return #f) + ) + ((cpad-pressed? 0 circle) + (return #f) + ) + ) + (suspend) + ) + #f + ) + ) + ) + ) + ) + (when v1-1 + (let ((v0-3 (logclear (-> v1-1 0 mask) (process-mask menu)))) + (set! (-> v1-1 0 mask) v0-3) + v0-3 + ) + ) + ) + ) + ) + (flag "Fill in" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *bigmap* fill-flag) (not (-> *bigmap* fill-flag))) + ) + (-> *bigmap* fill-flag) + ) + ) + (function + "Save" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) ((method-of-object *bigmap* bigmap-method-16)) (none)) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Ocean" + (menu + "Ocean Height" + (flag "zero" 1 dm-ocean-height-func) + (flag "far-below" 2 dm-ocean-height-func) + (flag "sewer-start" 3 dm-ocean-height-func) + (flag "sewer-hi" 4 dm-ocean-height-func) + (flag "sewer-med" 5 dm-ocean-height-func) + (flag "sewer-lo" 6 dm-ocean-height-func) + ) + (menu + "Ocean Subdiv" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Time of day" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "palette 0" 16 dm-time-of-day-func) + (flag "palette 1" 32 dm-time-of-day-func) + (flag "palette 2" 64 dm-time-of-day-func) + (flag "palette 3" 128 dm-time-of-day-func) + (flag "palette 4" 256 dm-time-of-day-func) + (flag "palette 5" 512 dm-time-of-day-func) + (flag "palette 6" 1024 dm-time-of-day-func) + (flag "palette 7" 2048 dm-time-of-day-func) + (flag "on" #f dm-time-of-day-pick-func) + (flag "Fast" *time-of-day-fast* dm-time-of-day-func2) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Mood" + (flag + "Overide Enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-enable) (not (-> *time-of-day-context* overide-enable))) + ) + (-> *time-of-day-context* overide-enable) + ) + ) + (menu + "Weather" + (flag + "Overide Weather Enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* overide-weather-flag) (not (-> *mood-control* overide-weather-flag))) + ) + (-> *mood-control* overide-weather-flag) + ) + ) + (flag + "Display Values" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* display-flag) (not (-> *mood-control* display-flag))) + ) + (-> *mood-control* display-flag) + ) + ) + (float-var + "Clouds" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide cloud) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0.0 + ) + (else + (-> *mood-control* overide cloud) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + (float-var + "Fog" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide fog) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0.0 + ) + (else + (-> *mood-control* overide fog) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + ) + (menu + "Colors" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Ambient Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (float-var + "Light Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (function + "reset selected time" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as + pointer + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + (the-as + pointer + (-> *mood-control* + mood-color-table + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + 32 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + 1.0 + ) + ) + ) + (function + "reset all times" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as pointer *overide-mood-color-table*) + (the-as pointer (-> *mood-control* mood-color-table)) + 256 + ) + (dotimes (v1-1 8) + (set! (-> *overide-mood-color-table* data v1-1 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-1 amb-color w) 1.0) + ) + (the-as float #f) + ) + ) + ) + (menu + "Fog" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Start" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + -1000 + 10000 + 0 + ) + (float-var + "End" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 10000 + 0 + ) + (float-var + "Max" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (float-var + "Min" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (function + "reset selected time" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as + pointer + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + (the-as + pointer + (-> *mood-control* + mood-fog-table + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + 48 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + ) + (function + "reset all times" + #f + (lambda () + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer (-> *mood-control* mood-fog-table)) 384) + (dotimes (v1-1 8) + (set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-1 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-1 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y)) + ) + ) + #f + ) + ) + ) + (menu + "Palette" + (flag "palette 0" 0 dm-time-of-day-palette-func) + (flag "palette 1" 1 dm-time-of-day-palette-func) + (flag "palette 2" 2 dm-time-of-day-palette-func) + (flag "palette 3" 3 dm-time-of-day-palette-func) + (flag "palette 4" 4 dm-time-of-day-palette-func) + (flag "palette 5" 5 dm-time-of-day-palette-func) + (flag "palette 6" 6 dm-time-of-day-palette-func) + (flag "palette 7" 7 dm-time-of-day-palette-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (function + "reset selected time" + #f + (lambda () (let ((v0-0 (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette)))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + (function "reset all times" #f (lambda () + (dotimes (v1-0 8) + (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) + ) + #f + ) + ) + ) + (menu + "Filter" + (float-var + "Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (function "reset filter" #f (lambda () (let ((v0-0 (-> *time-of-day-context* filter-color))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + (the-as symbol v0-0) + ) + ) + ) + ) + (menu + "Sky" + (float-var + "Cloud Min" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-min) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-min) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Cloud Max" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-max) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-max) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (function + "reset sky" + #f + (lambda () + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) + ) + ) + ) + (function "Print mood tables" #f (lambda () (print-mood-tables) (none))) + (function + "reset everything" + #f + (lambda () + (mem-copy! + (the-as pointer *overide-mood-color-table*) + (the-as pointer (-> *mood-control* mood-color-table)) + 256 + ) + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer (-> *mood-control* mood-fog-table)) 384) + (dotimes (v1-2 8) + (set! (-> *overide-mood-color-table* data v1-2 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-2 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-2 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y)) + ) + (set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0) + ) + (set-vector! (-> *time-of-day-context* filter-color) 1.0 1.0 1.0 1.0) + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Sound" + (flag "Effect Debug" *debug-effect-control* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) + (function "Reload Banks" #f sound-bank-reload) + (function "List Sounds" #f (lambda () (list-sounds) (none))) + (function "IOP Info" #f (lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-shader-menu arg0)) + (debug-menu-append-item s5-0 (debug-menu-make-instance-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Bug Report" + (flag "display" *display-bug-report* dm-boolean-toggle-pick-func) + (flag "screen" *stdcon* dm-bug-report-output-pick-func) + (flag "listener" listener dm-bug-report-output-pick-func) + (flag "file" file-stream dm-bug-report-output-pick-func) + (function "visgood" "visgood" dm-bug-report-report-pick-func) + (function "visbad" "visbad" dm-bug-report-report-pick-func) + (function "collision" "collision" dm-bug-report-report-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Scene" + (menu + "Scene Info" + (flag "channel" 1 display-scene-control-toggle-pick-func) + (flag "anim name" 2 display-scene-control-toggle-pick-func) + (flag "dma size" 4 display-scene-control-toggle-pick-func) + (flag "bounds spheres" 8 display-scene-control-toggle-pick-func) + (flag "actors" 16 display-scene-control-toggle-pick-func) + (flag "actor-marks" 32 display-scene-control-toggle-pick-func) + (flag "special fma spheres" 64 display-scene-control-toggle-pick-func) + (flag "all on" 95 display-scene-control-set-pick-func) + (flag "all off" 0 display-scene-control-set-pick-func) + ) + (menu + "city" + (function "city-help-kid-intro" ("ctyslumb-fort" "city-help-kid-intro") dm-scene-load-pick-func) + (function "city-help-kid-resolution" ("ctyslumb-fort" "city-help-kid-resolution") dm-scene-load-pick-func) + (function + "city-intercept-tanker-intro" + ("ctymarkb-tanker" "city-intercept-tanker-intro") + dm-scene-load-pick-func + ) + (function "city-intercept-tanker-res" ("ctymarkb-tanker" "city-intercept-tanker-res") dm-scene-load-pick-func) + (function "city-get-yellow-gun" ("gungame-movie" "city-get-yellow-gun") dm-scene-load-pick-func) + (function "city-get-hoverboard" ("ctyfarma-airlock-movie" "city-get-hoverboard") dm-scene-load-pick-func) + (function "city-get-dark-gun" ("gungame-movie" "city-get-dark-gun") dm-scene-load-pick-func) + (function "city-meet-brutter-res" ("kiosk-start" "city-meet-brutter-res") dm-scene-load-pick-func) + (function "city-save-lurkers-intro" ("kiosk-start" "city-save-lurkers-intro") dm-scene-load-pick-func) + (function + "city-errol-challenge-res" + ("garage-start-class3" "city-errol-challenge-res") + dm-scene-load-pick-func + ) + (function "city-air-train-in-caspad" ("ctyport-air-train" "city-air-train-in-caspad") dm-scene-load-pick-func) + (function "city-air-train-in-nest" ("ctyport-air-train" "city-air-train-in-nest") dm-scene-load-pick-func) + (function "city-air-train-out" ("ctyport-air-train" "city-air-train-out") dm-scene-load-pick-func) + (function + "city-ashelin-drop-off" + ("ctyport-air-train-ashelin" "city-ashelin-drop-off") + dm-scene-load-pick-func + ) + (function + "city-protect-slums-intro" + ("ctyslumc-seal-movie" "city-protect-slums-intro") + dm-scene-load-pick-func + ) + ) + (menu + "atoll" + (function "atoll-1-res" ("atoll-movie" "atoll-1-res") dm-scene-load-pick-func) + (function "atoll-save-ashelin-res-a" ("atoll-movie" "atoll-save-ashelin-res-a") dm-scene-load-pick-func) + (function "atoll-save-ashelin-res-b" ("atoll-movie" "atoll-save-ashelin-res-b") dm-scene-load-pick-func) + (function "atoll-sig-intro" ("atoll-movie" "atoll-sig-intro") dm-scene-load-pick-func) + (function "atoll-sig-tank" ("atoll-movie" "atoll-sig-tank") dm-scene-load-pick-func) + (function "atoll-sniper-a" ("atoll-movie" "atoll-sniper-a") dm-scene-load-pick-func) + (function "atoll-sniper-b" ("atoll-movie" "atoll-sniper-b") dm-scene-load-pick-func) + (function "atoll-sniper-c" ("atoll-movie" "atoll-sniper-c") dm-scene-load-pick-func) + (function "atoll-sniper-d" ("atoll-movie" "atoll-sniper-d") dm-scene-load-pick-func) + (function "atoll-sniper-e" ("atoll-movie" "atoll-sniper-e") dm-scene-load-pick-func) + ) + (menu + "canyon" + (function "canyon-insert-items-intro" ("mountain-movie" "canyon-insert-items-intro") dm-scene-load-pick-func) + (function "canyon-insert-items-res" ("mincan-city" "canyon-insert-items-res") dm-scene-load-pick-func) + ) + (menu + "caspad" + (function "caspad-air-train-in" ("caspad-warp" "caspad-air-train-in") dm-scene-load-pick-func) + (function "caspad-air-train-out" ("caspad-warp" "caspad-air-train-out") dm-scene-load-pick-func) + ) + (menu + "castle" + (function + "castle-krew-boss-fight-intro" + ("casboss-start" "castle-krew-boss-fight-intro") + dm-scene-load-pick-func + ) + (function "castle-krew-boss-fight-res" ("casboss-start" "castle-krew-boss-fight-res") dm-scene-load-pick-func) + ) + (menu + "consite" + (function "consite-find-baron-res" ("consite-start" "consite-find-baron-res") dm-scene-load-pick-func) + ) + (menu + "dig" + (function "dig-find-totem-res" ("dig-totem" "dig-find-totem-res") dm-scene-load-pick-func) + (function "dig-digger-explode" ("dig1-start" "dig-digger-explode") dm-scene-load-pick-func) + ) + (menu + "drill" + (function "drill-top-explode" ("drillmid-checkpoint" "drill-top-explode") dm-scene-load-pick-func) + ) + (menu + "forest" + (function + "forest-protect-samos-intro-b" + ("forest-tree" "forest-protect-samos-intro-b") + dm-scene-load-pick-func + ) + (function "forest-protect-samos-res" ("forest-tree" "forest-protect-samos-res") dm-scene-load-pick-func) + ) + (menu + "fortress" + (function + "fortress-blow-up-ammo-res-a" + ("fordumpc-start" "fortress-blow-up-ammo-res-a") + dm-scene-load-pick-func + ) + (function + "fortress-blow-up-ammo-res-b" + ("fordumpc-explode-movie" "fortress-blow-up-ammo-res-b") + dm-scene-load-pick-func + ) + (function "fortress-save-friends-res" ("prison-start" "fortress-save-friends-res") dm-scene-load-pick-func) + (function + "test-fortress-blow-up-ammo-res-b-a" + ("fordumpc-explode-movie" "test-fortress-blow-up-ammo-res-b-a") + dm-scene-load-pick-func + ) + (function "test-fortress-blast" ("fordumpc-explode-movie" "test-fortress-blast") dm-scene-load-pick-func) + ) + (menu + "hideout" + (function "city-krew-delivery-intro" ("hideout-start" "city-krew-delivery-intro") dm-scene-load-pick-func) + (function + "city-destroy-guard-vehicles-intro" + ("hideout-start" "city-destroy-guard-vehicles-intro") + dm-scene-load-pick-func + ) + (function "ruins-sacred-intro" ("hideout-start" "ruins-sacred-intro") dm-scene-load-pick-func) + (function "ruins-tower-intro" ("ctysluma-tower-intro" "ruins-tower-intro") dm-scene-load-pick-func) + (function "vin-rescue-intro" ("hideout-start" "vin-rescue-intro") dm-scene-load-pick-func) + (function "fortress-2-intro" ("hideout-start" "fortress-2-intro") dm-scene-load-pick-func) + (function "atoll-1-int" ("hideout-start" "atoll-1-int") dm-scene-load-pick-func) + (function "atoll-3-intro" ("hideout-start" "atoll-3-intro") dm-scene-load-pick-func) + (function + "city-shuttle-underground-intro" + ("hideout-start" "city-shuttle-underground-intro") + dm-scene-load-pick-func + ) + (function "city-escort-kid-intro" ("escort-kid-intro" "city-escort-kid-intro") dm-scene-load-pick-func) + (function "city-stop-bomb-bots-intro" ("hideout-start" "city-stop-bomb-bots-intro") dm-scene-load-pick-func) + (function + "forest-catch-metal-heads-intro" + ("hideout-start" "forest-catch-metal-heads-intro") + dm-scene-load-pick-func + ) + (function + "fortress-save-friends-intro-a" + ("hideout-start" "fortress-save-friends-intro-a") + dm-scene-load-pick-func + ) + ) + (menu + "hiphog" + (function "atoll-2-intro" ("hiphog-start" "atoll-2-intro") dm-scene-load-pick-func) + (function "sewer-1-intro" ("hiphog-start" "sewer-1-intro") dm-scene-load-pick-func) + (function "sewer-1-res" ("hiphog-start" "sewer-1-res") dm-scene-load-pick-func) + (function "sewer-2-intro" ("hiphog-start" "sewer-2-intro") dm-scene-load-pick-func) + (function "krew-delivery-res" ("hiphog-start" "krew-delivery-res") dm-scene-load-pick-func) + (function "city-meet-brutter-intro" ("hiphog-start" "city-meet-brutter-intro") dm-scene-load-pick-func) + (function "city-keira-delivery-intro" ("hiphog-start" "city-keira-delivery-intro") dm-scene-load-pick-func) + (function "city-krew-collection-intro" ("hiphog-start" "city-krew-collection-intro") dm-scene-load-pick-func) + (function "city-krew-collection-res" ("hiphog-start" "city-krew-collection-res") dm-scene-load-pick-func) + (function + "forest-hunt-camo-metal-heads-intro" + ("hiphog-start" "forest-hunt-camo-metal-heads-intro") + dm-scene-load-pick-func + ) + (function "sewer-blow-up-statue-intro" ("hiphog-start" "sewer-blow-up-statue-intro") dm-scene-load-pick-func) + (function "city-errol-challenge-intro" ("hiphog-start" "city-errol-challenge-intro") dm-scene-load-pick-func) + (function "city-whack-a-metal-intro" ("hiphog-start" "city-whack-a-metal-intro") dm-scene-load-pick-func) + (function "city-whack-a-metal-res" ("hiphog-start" "city-whack-a-metal-res") dm-scene-load-pick-func) + ) + (menu + "intro/outro" + (function + "intro" + ("village1-start" ("intro-samos-hut" "intro-vortex" "intro-city-square" "intro-prison")) + dm-scene-load-pick-func + ) + (function "intro-samos-hut" ("village1-start" "intro-samos-hut") dm-scene-load-pick-func) + (function "intro-vortex" ("village1-start" "intro-vortex") dm-scene-load-pick-func) + (function "intro-city-square" ("ctyindb-intro-start" "intro-city-square") dm-scene-load-pick-func) + (function "intro-prison" ("prison-intro-start" "intro-prison") dm-scene-load-pick-func) + (function + "outro" + ("nestb-outro" ("outro-nest" "outro-palace" "outro-hiphog" "outro-port")) + dm-scene-load-pick-func + ) + (function "outro-nest" ("nestb-outro" "outro-nest") dm-scene-load-pick-func) + (function "outro-palace" ("throne-outro" "outro-palace") dm-scene-load-pick-func) + (function "outro-hiphog" ("hiphog-outro" "outro-hiphog") dm-scene-load-pick-func) + (function "outro-port" ("ctyport-outro" "outro-port") dm-scene-load-pick-func) + ) + (menu + "mountain" + (function "mtn-step-plat-rocks-a" ("mountain-start" "mtn-step-plat-rocks-a") dm-scene-load-pick-func) + (function "mtn-step-plat-rocks-b" ("mountain-start" "mtn-step-plat-rocks-b") dm-scene-load-pick-func) + (function "mtn-step-plat-rocks-c" ("mountain-start" "mtn-step-plat-rocks-c") dm-scene-load-pick-func) + (function "mtn-plat-buried-rocks-a" ("mountain-start" "mtn-plat-buried-rocks-a") dm-scene-load-pick-func) + (function "mountain-lens-res" ("mountain-start" "mountain-lens-res") dm-scene-load-pick-func) + (function "mountain-shard-res" ("mountain-start" "mountain-shard-res") dm-scene-load-pick-func) + (function "mountain-gear-res" ("mountain-start" "mountain-gear-res") dm-scene-load-pick-func) + ) + (menu + "nest" + (function "nest-break-barrier-res" ("nest-gun" "nest-break-barrier-res") dm-scene-load-pick-func) + (function "nest-air-train-in" ("nest-warp" "nest-air-train-in") dm-scene-load-pick-func) + (function "nest-air-train-out" ("nest-warp" "nest-air-train-out") dm-scene-load-pick-func) + (function "nest-kor-boss-fight-intro-b" ("nestb-boss" "nest-kor-boss-fight-intro-b") dm-scene-load-pick-func) + (function "nest-kor-boss-fight-mid" ("nestb-boss" "nest-kor-boss-fight-mid") dm-scene-load-pick-func) + ) + (menu + "onintent" + (function "mountain-finditems-intro" ("onintent-start" "mountain-finditems-intro") dm-scene-load-pick-func) + (function "dig-find-totem-intro" ("onintent-start" "dig-find-totem-intro") dm-scene-load-pick-func) + (function + "forest-protect-samos-intro-a" + ("onintent-start" "forest-protect-samos-intro-a") + dm-scene-load-pick-func + ) + (function "city-play-onin-game-intro" ("onintent-start" "city-play-onin-game-intro") dm-scene-load-pick-func) + (function "city-play-onin-game-res" ("onintent-start" "city-play-onin-game-res") dm-scene-load-pick-func) + (function + "test-mountain-finditems-intro" + ("onintent-start" "test-mountain-finditems-intro") + dm-scene-load-pick-func + ) + ) + (menu + "oracle" + (function "city-oracle-intro" ("oracle-start" "city-oracle-intro") dm-scene-load-pick-func) + (function "city-oracle-level-0" ("oracle-start" "city-oracle-level-0") dm-scene-load-pick-func) + (function "city-oracle-level-1" ("oracle-start" "city-oracle-level-1") dm-scene-load-pick-func) + (function "city-oracle-level-2" ("oracle-start" "city-oracle-level-2") dm-scene-load-pick-func) + (function "city-oracle-level-3" ("oracle-start" "city-oracle-level-3") dm-scene-load-pick-func) + ) + (menu + "palace" + (function "palace-outside-window-res" ("palroof-throne" "palace-outside-window-res") dm-scene-load-pick-func) + (function + "palace-outside-window-res-b" + ("palroof-boss" "palace-outside-window-res-b") + dm-scene-load-pick-func + ) + (function "palace-boss-res" ("palroof-boss" "palace-boss-res") dm-scene-load-pick-func) + (function "palace-sneak-in-res" ("palroof-throne" "palace-sneak-in-res") dm-scene-load-pick-func) + ) + (menu + "ruins" + (function "ruins-tower-victory" ("ruins-hut" "ruins-tower-victory") dm-scene-load-pick-func) + (function "ruins-sacred-victory" ("ruins-hut" "ruins-sacred-victory") dm-scene-load-pick-func) + (function "ruins-get-to-hut-res" ("ruins-hut" "ruins-get-to-hut-res") dm-scene-load-pick-func) + (function "test-scene" ("ruins-hut" "test-scene") dm-scene-load-pick-func) + ) + (menu + "sewer" + (function "sewer-drain-res" ("sewer-start" "sewer-drain-res") dm-scene-load-pick-func) + (function "sewer-blow-up-statue-res" ("sewesc-start" "sewer-blow-up-statue-res") dm-scene-load-pick-func) + (function "sewer-hosehead" ("sewesc-start" "sewer-hosehead") dm-scene-load-pick-func) + ) + (menu + "stadium" + (function + "city-keira-hover-challenge-intro" + ("garage-start-skate" "city-keira-hover-challenge-intro") + dm-scene-load-pick-func + ) + (function + "city-keira-hover-challenge-res" + ("garage-start-skate" "city-keira-hover-challenge-res") + dm-scene-load-pick-func + ) + (function + "city-class-1-race-intro-a" + ("garage-class3-movie" "city-class-1-race-intro-a") + dm-scene-load-pick-func + ) + (function "city-class-1-race-intro-b" ("stadiumd-start" "city-class-1-race-intro-b") dm-scene-load-pick-func) + (function "city-class-1-race-res" ("stadiumd-start" "city-class-1-race-res") dm-scene-load-pick-func) + (function "city-class-3-race-intro" ("garage-class3-movie" "city-class-3-race-intro") dm-scene-load-pick-func) + (function "city-class-3-race-res" ("garage-class3-movie" "city-class-3-race-res") dm-scene-load-pick-func) + (function "city-put-hoverboard" ("skatea-start" "city-put-hoverboard") dm-scene-load-pick-func) + (function "city-class-2-race-intro" ("garage-class3-movie" "city-class-2-race-intro") dm-scene-load-pick-func) + (function "city-class-2-race-res" ("garage-class3-movie" "city-class-2-race-res") dm-scene-load-pick-func) + (function "city-defend-stadium-intro" ("stadium-blimp" "city-defend-stadium-intro") dm-scene-load-pick-func) + (function "city-defend-stadium-res" ("stadium-blimp" "city-defend-stadium-res") dm-scene-load-pick-func) + ) + (menu + "strip" + (function "crane-victory" ("strip-start" "crane-victory") dm-scene-load-pick-func) + (function "ecowells-victory" ("strip-start" "ecowells-victory") dm-scene-load-pick-func) + (function "vin-rescue" ("strip-start" "vin-rescue") dm-scene-load-pick-func) + (function "test-crane-victory" ("strip-start" "test-crane-victory") dm-scene-load-pick-func) + ) + (menu + "tomb" + (function "tomb-face-tests-intro" ("tombd-start" "tomb-face-tests-intro") dm-scene-load-pick-func) + (function "tomb-boulder-start" ("tomb-boulder" "tomb-boulder-start") dm-scene-load-pick-func) + (function "tomb-spider-scare" ("tomb-boulder-explode" "tomb-spider-scare") dm-scene-load-pick-func) + (function "tomb-unlock-start" ("tomb-water-switch" "tomb-unlock-start") dm-scene-load-pick-func) + (function "tomb-unlock-water" ("tomb-water-switch" "tomb-unlock-water") dm-scene-load-pick-func) + (function "tomb-unlock-poles" ("tomb-poles-switch" "tomb-unlock-poles") dm-scene-load-pick-func) + (function "tomb-boss-open" ("tombboss-start" "tomb-boss-open") dm-scene-load-pick-func) + (function "tomb-boss-intro" ("tombboss-start" "tomb-boss-intro") dm-scene-load-pick-func) + (function "tomb-boss-res" ("tombboss-start" "tomb-boss-res") dm-scene-load-pick-func) + ) + (menu + "under" + (function "under-find-sig-res" ("under-start" "under-find-sig-res") dm-scene-load-pick-func) + (function "under-centipede-one" ("under-start" "under-centipede-one") dm-scene-load-pick-func) + (function "under-centipede-two" ("under-start" "under-centipede-two") dm-scene-load-pick-func) + (function "under-centipede-three" ("under-start" "under-centipede-three") dm-scene-load-pick-func) + (function "under-get-sig-out-res" ("under-start" "under-get-sig-out-res") dm-scene-load-pick-func) + ) + (menu + "vinroom" + (function "crane-intro" ("vinroom-start" "crane-intro") dm-scene-load-pick-func) + (function + "drill-kill-metal-heads-intro" + ("vinroom-start" "drill-kill-metal-heads-intro") + dm-scene-load-pick-func + ) + (function "ecowells-intro" ("vinroom-start" "ecowells-intro") dm-scene-load-pick-func) + (function "city-switch-on-power-intro" ("vinroom-start" "city-switch-on-power-intro") dm-scene-load-pick-func) + (function + "dig-knock-down-scaffolding-intro" + ("vinroom-start" "dig-knock-down-scaffolding-intro") + dm-scene-load-pick-func + ) + (function "drill-destroy-ship-intro" ("vinroom-start" "drill-destroy-ship-intro") dm-scene-load-pick-func) + (function + "drill-destroy-control-tower-intro" + ("vinroom-start" "drill-destroy-control-tower-intro") + dm-scene-load-pick-func + ) + ) + (menu "demo" (function "demo-disk-intro" ("demo-movie" "demo-disk-intro") dm-scene-load-pick-func)) + (menu + "cover-test" + (function "cover-test-1" ("chartest-1" "cover-test-1") dm-scene-load-pick-func) + (function "cover-test-2" ("chartest-1" "cover-test-2") dm-scene-load-pick-func) + ) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-task-menu arg0)) + (debug-menu-append-item s5-0 (the-as debug-menu-node (debug-menu-make-play-menu (the-as symbol arg0)))) + ) + arg0 + ) + +(define *popup-menu-context* (new 'debug 'debug-menu-context)) + +(defun popup-menu-context-make-default-menus ((arg0 debug-menu-context)) + (debug-menu-make-from-template + arg0 + '(main-menu + "Popup" + (flag "Cam 1" pad-1 dm-cam-externalize) + (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-point *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Mode" + (function "normal" #f (lambda () (send-event *target* 'end-mode))) + (function "racer" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'racer #f) + ) + ) + (function "flut" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'flut #f) + ) + ) + (function "board" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature unk-game-feature-06)) + (logior! (-> *game-info* debug-features) (game-feature unk-game-feature-06)) + (send-event *target* 'change-mode 'gun #f 0) + ) + ) + (function "darkjak" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature darkjak)) + (logior! (-> *game-info* debug-features) (game-feature darkjak)) + (send-event *target* 'change-mode 'darkjak #f 3) + ) + ) + (function "indax" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f) + ) + ) + ) + (flag "Game" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((v1-3 (-> *game-info* mode))) + (set! (-> *game-info* mode) (cond + ((= v1-3 'play) + 'debug + ) + ((= v1-3 'debug) + 'play + ) + (else + (-> *game-info* mode) + ) + ) + ) + ) + ) + (= (-> *game-info* mode) 'play) + ) + ) + (function "Clean" #f (lambda () + (if (time-of-day-setup #f) + (time-of-day-setup #t) + ) + (play-clean #f) + (none) + ) + ) + (flag "Stats" *stats-target* dm-boolean-toggle-pick-func) + (function "Reset" #f (lambda () (reset-actors 'debug) (none))) + (function "Start" #f (lambda () (start 'play (-> *game-info* current-continue)) (none))) + (function "Editor" #f (lambda () + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :to *entity-pool*) + (set-master-mode 'game) + (none) + ) + ) + ) + ) + arg0 + ) + +(debug-menu-context-make-default-menus *debug-menu-context*) + +(popup-menu-context-make-default-menus *popup-menu-context*) + +(defun menu-respond-to-pause () + (case *master-mode* + (('menu) + (cond + ((and (cpad-hold? 0 l3) (cpad-hold? 0 select)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ((and (cpad-hold? 1 start) *editable*) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ((and (cpad-hold? 0 l3) (cpad-hold? 0 start)) + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg activate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ) + ) + (else + (debug-menu-context-send-msg *debug-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *popup-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + (debug-menu-context-send-msg *editable-menu-context* (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + ) + #f + ) + +(defun *menu-hook* () + (debug-menus-handler *debug-menu-context*) + (debug-menus-handler *popup-menu-context*) + ) + +) + + + + diff --git a/goal_src/jak2/engine/debug/editable.gc b/goal_src/jak2/engine/debug/editable.gc index 3e557ad9e2..f6a1a31dfb 100644 --- a/goal_src/jak2/engine/debug/editable.gc +++ b/goal_src/jak2/engine/debug/editable.gc @@ -131,7 +131,7 @@ (s1-0 318) ) (format (clear *temp-string*) "region-~D~%" (-> obj id)) - (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* arg0 (font-color one) sv-32) + (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))) (when (>= arg1 1) @@ -142,7 +142,7 @@ (s1-1 318) ) (format (clear *temp-string*) "(on-enter ~S)" s4-1) - (s3-1 s2-1 (the-as bucket-id s1-1) *temp-string* arg0 (font-color one) sv-32) + (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))) ) @@ -154,7 +154,7 @@ (s1-2 318) ) (format (clear *temp-string*) "(on-inside ~S)" s4-2) - (s3-2 s2-2 (the-as bucket-id s1-2) *temp-string* arg0 (font-color one) sv-32) + (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))) ) @@ -166,7 +166,7 @@ (s2-3 318) ) (format (clear *temp-string*) "(on-exit ~S)" s5-1) - (s4-3 s3-3 (the-as bucket-id s2-3) *temp-string* arg0 (font-color one) sv-32) + (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))) ) @@ -249,24 +249,30 @@ ;; WARN: Return type mismatch int vs none. (defmethod editable-method-28 editable ((obj editable) (arg0 editable-filter)) - (let* ((s5-0 (-> obj owner)) (a0-1 (car s5-0))) (while (not (null? s5-0)) - (editable-method-28 (the-as editable a0-1) arg0) - (set! s5-0 (cdr s5-0)) - (set! a0-1 (car s5-0)) - ) - ) + (let* ((s5-0 (-> obj owner)) + (a0-1 (car s5-0)) + ) + (while (not (null? s5-0)) + (editable-method-28 (the-as editable a0-1) arg0) + (set! s5-0 (cdr s5-0)) + (set! a0-1 (car s5-0)) + ) + ) 0 (none) ) ;; WARN: Return type mismatch int vs symbol. (defmethod editable-method-29 editable ((obj editable) (arg0 editable-filter)) - (let* ((s5-0 (-> obj owner)) (a0-1 (car s5-0))) (while (not (null? s5-0)) - (editable-method-29 (the-as editable a0-1) arg0) - (set! s5-0 (cdr s5-0)) - (set! a0-1 (car s5-0)) - ) - ) + (let* ((s5-0 (-> obj owner)) + (a0-1 (car s5-0)) + ) + (while (not (null? s5-0)) + (editable-method-29 (the-as editable a0-1) arg0) + (set! s5-0 (cdr s5-0)) + (set! a0-1 (car s5-0)) + ) + ) (the-as symbol 0) ) @@ -460,12 +466,15 @@ ) ) (logior! (-> obj flags) (editable-flag changed)) - (let* ((s4-0 (-> obj owner)) (a0-3 (car s4-0))) (while (not (null? s4-0)) - (editable-method-26 (the-as editable a0-3) obj arg0) - (set! s4-0 (cdr s4-0)) - (set! a0-3 (car s4-0)) - ) - ) + (let* ((s4-0 (-> obj owner)) + (a0-3 (car s4-0)) + ) + (while (not (null? s4-0)) + (editable-method-26 (the-as editable a0-3) obj arg0) + (set! s4-0 (cdr s4-0)) + (set! a0-3 (car s4-0)) + ) + ) 0 (none) ) @@ -674,7 +683,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> a0-1 quad) (-> obj trans quad)) - (set! (-> a0-1 w) (-> obj radius)) + (set! (-> a0-1 r) (-> obj radius)) (when (sphere-in-view-frustum? a0-1) (reverse-transform-point! s5-0 (-> obj trans) (-> *math-camera* inv-camera-rot vector 2) arg0) (let ((f0-1 (vector-vector-distance (edit-get-trans obj) s5-0))) @@ -978,7 +987,7 @@ (s3-1 318) ) (format (clear *temp-string*) "~S~%" (-> obj name)) - (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> obj trans) (font-color one) (the-as vector2h #f)) + (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> obj trans) (font-color #dadada) (the-as vector2h #f)) ) ) ((method-of-type editable-sphere editable-method-10) obj) @@ -1170,11 +1179,10 @@ (the-as bucket-id s1-1) *temp-string* (-> gp-0 s4-1) - (the-as font-color (if (logtest? (-> obj flags) (editable-flag orient)) - 5 - 1 - ) - ) + (if (logtest? (-> obj flags) (editable-flag orient)) + (font-color yellow-#f3f300) + (font-color #dadada) + ) (the-as vector2h #f) ) ) @@ -1184,16 +1192,14 @@ 324 (the-as transform gp-0) sv-112 - (the-as rgba (if (logtest? (-> obj flags) (editable-flag orient)) - (-> (new 'static 'array uint64 1 #x800000ff) 0) - (-> (new 'static 'array uint64 1 #x8000ffff) 0) - ) - ) - (the-as rgba (if (zero? (logand (-> obj flags) (editable-flag orient))) - (-> (new 'static 'array uint64 1 #x800000ff) 0) - (-> (new 'static 'array uint64 1 #x8000ffff) 0) - ) - ) + (if (logtest? (-> obj flags) (editable-flag orient)) + (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) + ) + (if (zero? (logand (-> obj flags) (editable-flag orient))) + (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) + ) (if (logtest? (-> obj flags) (editable-flag selected)) 1 0 @@ -1478,16 +1484,14 @@ 324 (the-as transform gp-0) s4-0 - (the-as rgba (if (logtest? (-> obj flags) (editable-flag orient)) - (-> (new 'static 'array uint64 1 #x800000ff) 0) - (-> (new 'static 'array uint64 1 #x8000ffff) 0) - ) - ) - (the-as rgba (if (zero? (logand (-> obj flags) (editable-flag orient))) - (-> (new 'static 'array uint64 1 #x800000ff) 0) - (-> (new 'static 'array uint64 1 #x8000ffff) 0) - ) - ) + (if (logtest? (-> obj flags) (editable-flag orient)) + (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) + ) + (if (zero? (logand (-> obj flags) (editable-flag orient))) + (the-as rgba (-> (new 'static 'array uint64 1 #x800000ff) 0)) + (the-as rgba (-> (new 'static 'array uint64 1 #x8000ffff) 0)) + ) (if (logtest? (-> obj flags) (editable-flag selected)) 1 0 @@ -1652,14 +1656,18 @@ (let ((gp-0 (-> arg0 region))) (when gp-0 (editable-method-25 arg0 obj) - (let* ((v1-3 (-> obj length)) (a0-2 0) (a1-4 (-> obj data a0-2))) (while (< a0-2 v1-3) - (if (and a1-4 (= arg0 a1-4)) - (set! (-> obj data a0-2) #f) - ) - (+! a0-2 1) - (set! a1-4 (-> obj data a0-2)) - ) - ) + (let* ((v1-3 (-> obj length)) + (a0-2 0) + (a1-4 (-> obj data a0-2)) + ) + (while (< a0-2 v1-3) + (if (and a1-4 (= arg0 a1-4)) + (set! (-> obj data a0-2) #f) + ) + (+! a0-2 1) + (set! a1-4 (-> obj data a0-2)) + ) + ) (let* ((v1-6 (-> obj length)) (a0-3 0) (a1-14 (-> obj data a0-3)) diff --git a/goal_src/jak2/engine/debug/menu.gc b/goal_src/jak2/engine/debug/menu.gc index 713d141a93..991d01dc9a 100644 --- a/goal_src/jak2/engine/debug/menu.gc +++ b/goal_src/jak2/engine/debug/menu.gc @@ -7,3 +7,1700 @@ ;; DECOMP BEGINS +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +(deftype debug-menu-context (basic) + ((is-active symbol :offset-assert 4) + (sel-length int32 :offset-assert 8) + (sel-menu debug-menu 8 :offset-assert 12) + (root-menu debug-menu :offset-assert 44) + (joypad-func (function basic none) :offset-assert 48) + (joypad-item basic :offset-assert 52) + (font font-context :offset-assert 56) + (is-hidden symbol :offset-assert 60) + (joypad-number int32 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +(defmethod inspect debug-menu-context ((obj debug-menu-context)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tis-active: ~A~%" (-> obj is-active)) + (format #t "~1Tsel-length: ~D~%" (-> obj sel-length)) + (format #t "~1Tsel-menu[8] @ #x~X~%" (-> obj sel-menu)) + (format #t "~1Troot-menu: ~A~%" (-> obj root-menu)) + (format #t "~1Tjoypad-func: ~A~%" (-> obj joypad-func)) + (format #t "~1Tjoypad-item: ~A~%" (-> obj joypad-item)) + (format #t "~1Tfont: ~A~%" (-> obj font)) + (format #t "~1Tis-hidden: ~A~%" (-> obj is-hidden)) + (format #t "~1Tjoypad-number: ~D~%" (-> obj joypad-number)) + (label cfg-4) + obj + ) + +(defmethod new debug-menu-context ((allocation symbol) (type-to-make type)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 is-active) #f) + (set! (-> gp-0 is-hidden) #f) + (set! (-> gp-0 sel-length) 0) + (set! (-> gp-0 root-menu) #f) + (set! (-> gp-0 joypad-func) #f) + (set! (-> gp-0 joypad-item) #f) + (set! (-> gp-0 font) (new + 'debug + 'font-context + *font-default-matrix* + 0 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (set! (-> gp-0 joypad-number) 0) + gp-0 + ) + ) + +(deftype debug-menu-node (basic) + ((name string :offset-assert 4) + (parent debug-menu :offset-assert 8) + (refresh-delay int32 :offset-assert 12) + (refresh-ctr int32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(defmethod inspect debug-menu-node ((obj debug-menu-node)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (label cfg-4) + obj + ) + +(defmethod print debug-menu-node ((obj debug-menu-node)) + (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) + obj + ) + +(deftype debug-menu (debug-menu-node) + ((context debug-menu-context :offset-assert 20) + (selected-item debug-menu-item :offset-assert 24) + (pix-width int32 :offset-assert 28) + (pix-height int32 :offset-assert 32) + (items pair :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type debug-menu-context string) _type_ 0) + ) + ) + +(defmethod inspect debug-menu ((obj debug-menu)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tcontext: ~A~%" (-> obj context)) + (format #t "~1Tselected-item: ~A~%" (-> obj selected-item)) + (format #t "~1Tpix-width: ~D~%" (-> obj pix-width)) + (format #t "~1Tpix-height: ~D~%" (-> obj pix-height)) + (format #t "~1Titems: ~A~%" (-> obj items)) + (label cfg-4) + obj + ) + +(defmethod new debug-menu ((allocation symbol) (type-to-make type) (arg0 debug-menu-context) (arg1 string)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 context) arg0) + (set! (-> v0-0 name) arg1) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 selected-item) #f) + (set! (-> v0-0 items) '()) + v0-0 + ) + ) + +(deftype debug-menu-item (debug-menu-node) + ((id int32 :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(defmethod inspect debug-menu-item ((obj debug-menu-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (label cfg-4) + obj + ) + +(deftype debug-menu-item-submenu (debug-menu-item) + ((submenu debug-menu :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + (:methods + (new (symbol type string debug-menu) _type_ 0) + ) + ) + +(defmethod inspect debug-menu-item-submenu ((obj debug-menu-item-submenu)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tsubmenu: ~A~%" (-> obj submenu)) + (label cfg-4) + obj + ) + +(defmethod new debug-menu-item-submenu ((allocation symbol) (type-to-make type) (arg0 string) (arg1 debug-menu)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 0) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 submenu) arg1) + (set! (-> v0-0 submenu parent) (the-as debug-menu v0-0)) + v0-0 + ) + ) + +(deftype debug-menu-item-function (debug-menu-item) + ((activate-func (function object object) :offset-assert 24) + (hilite-timer int8 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x1d + :flag-assert #x90000001d + (:methods + (new (symbol type string object (function object object)) _type_ 0) + ) + ) + +(defmethod inspect debug-menu-item-function ((obj debug-menu-item-function)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) + (format #t "~1Thilite-timer: ~D~%" (-> obj hilite-timer)) + (label cfg-4) + obj + ) + +(defmethod new debug-menu-item-function ((allocation symbol) (type-to-make type) (arg0 string) (arg1 object) (arg2 (function object object))) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 0) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 id) (the-as int arg1)) + (set! (-> v0-0 activate-func) arg2) + (set! (-> v0-0 hilite-timer) 0) + v0-0 + ) + ) + +(deftype debug-menu-item-flag (debug-menu-item) + ((activate-func (function object debug-menu-msg object) :offset-assert 24) + (is-on object :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + (:methods + (new (symbol type string object (function object debug-menu-msg object)) _type_ 0) + ) + ) + +(defmethod inspect debug-menu-item-flag ((obj debug-menu-item-flag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) + (format #t "~1Tis-on: ~A~%" (-> obj is-on)) + (label cfg-4) + obj + ) + +(defmethod new debug-menu-item-flag ((allocation symbol) + (type-to-make type) + (arg0 string) + (arg1 object) + (arg2 (function object debug-menu-msg object)) + ) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 23) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 id) (the-as int arg1)) + (set! (-> v0-0 activate-func) arg2) + (set! (-> v0-0 is-on) (the-as object #f)) + v0-0 + ) + ) + +(deftype debug-menu-item-var (debug-menu-item) + ((display-str string :offset-assert 24) + (grabbed-joypad-p symbol :offset-assert 28) + (float-p symbol :offset-assert 32) + (range-p symbol :offset-assert 36) + (show-len int32 :offset-assert 40) + (inc-delay int32 :offset-assert 44) + (inc-delay-ctr int32 :offset-assert 48) + (step-delay-ctr int32 :offset-assert 52) + (inc-dir int32 :offset-assert 56) + (fval float :offset-assert 60) + (fundo-val float :offset-assert 64) + (frange-min float :offset-assert 68) + (frange-max float :offset-assert 72) + (fstart-inc float :offset-assert 76) + (fstep float :offset-assert 80) + (fprecision int32 :offset-assert 84) + (factivate-func (function int debug-menu-msg float float float) :offset-assert 88) + (ival int32 :offset 60) + (iundo-val int32 :offset 64) + (irange-min int32 :offset 68) + (irange-max int32 :offset 72) + (istart-inc int32 :offset 76) + (istep int32 :offset 80) + (ihex-p symbol :offset-assert 92) + (iactivate-func (function int debug-menu-msg int int int) :offset 88) + (ifloat-p symbol :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x64 + :flag-assert #x900000064 + (:methods + (new (symbol type string int int) _type_ 0) + ) + ) + +(defmethod inspect debug-menu-item-var ((obj debug-menu-item-var)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tdisplay-str: ~A~%" (-> obj display-str)) + (format #t "~1Tgrabbed-joypad-p: ~A~%" (-> obj grabbed-joypad-p)) + (format #t "~1Tfloat-p: ~A~%" (-> obj float-p)) + (format #t "~1Trange-p: ~A~%" (-> obj range-p)) + (format #t "~1Tshow-len: ~D~%" (-> obj show-len)) + (format #t "~1Tinc-delay: ~D~%" (-> obj inc-delay)) + (format #t "~1Tinc-delay-ctr: ~D~%" (-> obj inc-delay-ctr)) + (format #t "~1Tstep-delay-ctr: ~D~%" (-> obj step-delay-ctr)) + (format #t "~1Tinc-dir: ~D~%" (-> obj inc-dir)) + (format #t "~1Tfval: ~f~%" (-> obj fval)) + (format #t "~1Tfundo-val: ~f~%" (-> obj fundo-val)) + (format #t "~1Tfrange-min: ~f~%" (-> obj frange-min)) + (format #t "~1Tfrange-max: ~f~%" (-> obj frange-max)) + (format #t "~1Tfstart-inc: ~f~%" (-> obj fstart-inc)) + (format #t "~1Tfstep: ~f~%" (-> obj fstep)) + (format #t "~1Tfprecision: ~D~%" (-> obj fprecision)) + (format #t "~1Tfactivate-func: ~A~%" (-> obj factivate-func)) + (format #t "~1Tival: ~D~%" (-> obj fval)) + (format #t "~1Tiundo-val: ~D~%" (-> obj fundo-val)) + (format #t "~1Tirange-min: ~D~%" (-> obj frange-min)) + (format #t "~1Tirange-max: ~D~%" (-> obj frange-max)) + (format #t "~1Tistart-inc: ~D~%" (-> obj fstart-inc)) + (format #t "~1Tistep: ~D~%" (-> obj fstep)) + (format #t "~1Tihex-p: ~A~%" (-> obj ihex-p)) + (format #t "~1Tiactivate-func: ~A~%" (-> obj factivate-func)) + (format #t "~1Tifloat-p: ~A~%" (-> obj ifloat-p)) + (label cfg-4) + obj + ) + +(defun debug-menu-item-var-update-display-str ((arg0 debug-menu-item-var)) + (cond + ((-> arg0 float-p) + (format (clear (-> arg0 display-str)) "~f" (-> arg0 fval)) + ) + ((-> arg0 ihex-p) + (format (clear (-> arg0 display-str)) "x~X" (-> arg0 fval)) + ) + ((-> arg0 ifloat-p) + (cond + ((and (< (the-as int (-> arg0 fval)) 0) (< -100 (the-as int (-> arg0 fval)))) + (let ((s5-2 format) + (a0-8 (clear (-> arg0 display-str))) + (a1-2 "-0.~1d") + (v1-8 (abs (the-as int (-> arg0 fval)))) + ) + (s5-2 a0-8 a1-2 (/ (mod v1-8 100) 10)) + ) + ) + (else + (let ((s5-3 format) + (a0-10 (clear (-> arg0 display-str))) + (a1-3 "~2d.~1d") + (a2-6 (/ (the-as int (-> arg0 fval)) 100)) + (v1-12 (abs (the-as int (-> arg0 fval)))) + ) + (s5-3 a0-10 a1-3 a2-6 (/ (mod v1-12 100) 10)) + ) + ) + ) + ) + (else + (format (clear (-> arg0 display-str)) "~D" (-> arg0 fval)) + ) + ) + arg0 + ) + +(defun debug-menu-item-var-make-int ((arg0 debug-menu-item-var) + (arg1 (function int debug-menu-msg int int int)) + (arg2 int) + (arg3 symbol) + (arg4 int) + (arg5 int) + (arg6 symbol) + ) + (set! (-> arg0 float-p) #f) + (set! (-> arg0 range-p) arg3) + (set! (-> arg0 frange-min) (the-as float arg4)) + (set! (-> arg0 frange-max) (the-as float arg5)) + (set! (-> arg0 fstart-inc) (the-as float arg2)) + (set! (-> arg0 fstep) (the-as float arg2)) + (set! (-> arg0 ihex-p) arg6) + (set! (-> arg0 factivate-func) (the-as (function int debug-menu-msg float float float) arg1)) + (cond + (arg3 + (set! (-> arg0 fval) (the-as float arg4)) + ) + (else + (set! (-> arg0 fval) 0.0) + 0 + ) + ) + (if arg1 + (set! (-> arg0 fval) + (the-as + float + (arg1 (-> arg0 id) (debug-menu-msg update) (the-as int (-> arg0 fval)) (the-as int (-> arg0 fval))) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + arg0 + ) + +(defun debug-menu-item-var-make-float ((arg0 debug-menu-item-var) + (arg1 (function int debug-menu-msg float float float)) + (arg2 float) + (arg3 symbol) + (arg4 float) + (arg5 float) + (arg6 int) + ) + (set! (-> arg0 float-p) #t) + (set! (-> arg0 range-p) arg3) + (set! (-> arg0 frange-min) arg4) + (set! (-> arg0 frange-max) arg5) + (set! (-> arg0 fstart-inc) arg2) + (set! (-> arg0 fstep) arg2) + (set! (-> arg0 fprecision) arg6) + (set! (-> arg0 factivate-func) arg1) + (if arg3 + (set! (-> arg0 fval) arg4) + (set! (-> arg0 fval) 0.0) + ) + (if arg1 + (set! (-> arg0 fval) + (the float (the-as int (arg1 (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)))) + ) + ) + (debug-menu-item-var-update-display-str arg0) + arg0 + ) + +(defmethod new debug-menu-item-var ((allocation symbol) (type-to-make type) (arg0 string) (arg1 int) (arg2 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((v1-2 (/ arg2 8))) + (set! (-> gp-0 name) arg0) + (set! (-> gp-0 parent) #f) + (set! (-> gp-0 refresh-delay) 31) + (set! (-> gp-0 refresh-ctr) (-> gp-0 refresh-delay)) + (set! (-> gp-0 id) arg1) + (set! v1-2 (cond + ((< 3 v1-2) + (empty) + v1-2 + ) + (else + 3 + ) + ) + ) + (set! (-> gp-0 show-len) v1-2) + ) + (set! (-> gp-0 grabbed-joypad-p) #f) + (set! (-> gp-0 ifloat-p) #f) + (set! (-> gp-0 display-str) (new 'debug 'string 64 (the-as string #f))) + (debug-menu-item-var-make-int gp-0 (the-as (function int debug-menu-msg int int int) #f) 1 #t 0 0 #f) + gp-0 + ) + ) + +(defun debug-menu-context-grab-joypad ((arg0 debug-menu-context) (arg1 basic) (arg2 (function basic none))) + (cond + ((-> arg0 joypad-func) + #f + ) + (else + (set! (-> arg0 joypad-func) arg2) + (set! (-> arg0 joypad-item) arg1) + #t + ) + ) + ) + +(defun debug-menu-context-release-joypad ((arg0 debug-menu-context)) + (set! (-> arg0 joypad-func) #f) + (set! (-> arg0 joypad-item) #f) + #f + ) + +(defun debug-menu-item-get-max-width ((arg0 debug-menu-item) (arg1 debug-menu)) + (local-vars (v0-1 int)) + 0 + (cond + ((= (-> arg0 type) debug-menu-item-submenu) + (set! v0-1 (+ (the int (-> (get-string-length (-> arg0 name) (-> arg1 context font)) length)) 16)) + ) + ((= (-> arg0 type) debug-menu-item-var) + (set! v0-1 + (the int + (-> (get-string-length + (the-as string (the-as debug-menu-item-var (-> (the-as debug-menu-item-var arg0) display-str))) + (-> arg1 context font) + ) + length + ) + ) + ) + ) + (else + (set! v0-1 + (+ (the int (-> (get-string-length + (the-as string (the-as debug-menu-item-var (-> (the-as debug-menu-item-var arg0) name))) + (-> arg1 context font) + ) + length + ) + ) + 6 + ) + ) + ) + ) + v0-1 + ) + +(defun debug-menu-context-default-selection ((arg0 debug-menu-context) (arg1 symbol)) + (when (or (zero? (-> arg0 sel-length)) (not arg1)) + (let ((s5-0 (-> arg0 root-menu))) + (when (and s5-0 (not (null? (-> s5-0 items)))) + (let ((s4-0 (-> arg0 is-active))) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg0 sel-length) 1) + (set! (-> arg0 sel-menu 0) s5-0) + (set! (-> s5-0 selected-item) (the-as debug-menu-item (-> s5-0 items car))) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + ) + ) + ) + arg0 + ) + +(defun debug-menu-rebuild ((arg0 debug-menu)) + (let ((s4-0 0) + (s5-0 0) + ) + (let* ((s3-0 (-> arg0 items)) + (a0-1 (car s3-0)) + ) + (while (not (null? s3-0)) + (+! s5-0 1) + (set! (-> (the-as debug-menu-item a0-1) parent) arg0) + (set! s4-0 (max s4-0 (debug-menu-item-get-max-width (the-as debug-menu-item a0-1) arg0))) + (set! s3-0 (cdr s3-0)) + (set! a0-1 (car s3-0)) + ) + ) + (set! (-> arg0 pix-width) (+ s4-0 18)) + (set! (-> arg0 pix-height) (+ (* 15 s5-0) 10)) + ) + (let ((a0-2 (-> arg0 context))) + (debug-menu-context-default-selection a0-2 #t) + ) + arg0 + ) + +(defun debug-menu-context-set-root-menu ((arg0 debug-menu-context) (arg1 debug-menu)) + (let ((s4-0 (-> arg0 is-active))) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg0 root-menu) arg1) + (debug-menu-context-default-selection arg0 #f) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + arg0 + ) + +(defun debug-menu-append-item ((arg0 debug-menu) (arg1 debug-menu-node)) + (let* ((gp-0 (-> arg0 context)) + (s4-0 (-> gp-0 is-active)) + ) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg1 parent) arg0) + (set! (-> arg0 items) (the-as pair (append! (-> arg0 items) (cons arg1 '())))) + (debug-menu-rebuild arg0) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + arg1 + ) + +(defun debug-menu-remove-all-items ((arg0 debug-menu)) + (let* ((gp-0 (-> arg0 context)) + (s4-0 (-> gp-0 is-active)) + ) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg0 items) '()) + (set! (-> arg0 selected-item) #f) + (debug-menu-rebuild arg0) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + arg0 + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +(defun debug-menu-make-from-template ((arg0 debug-menu-context) (arg1 pair)) + (local-vars + (s4-0 debug-menu-node) + (sv-16 object) + (sv-32 (function object int int)) + (sv-48 int) + (sv-64 (function object int int)) + (sv-80 (function object float float)) + (sv-96 float) + (sv-112 (function object float float)) + (sv-128 float) + (sv-144 (function object int int)) + ) + (when (or (not arg1) (null? arg1)) + (set! s4-0 (the-as debug-menu-node #f)) + (goto cfg-39) + ) + (let ((s5-0 (car arg1)) + (s4-1 (car (cdr arg1))) + ) + (cond + ((= s5-0 'menu) + (let ((s5-1 (new 'debug 'debug-menu arg0 (the-as string s4-1)))) + (set! s4-0 (new 'debug 'debug-menu-item-submenu (the-as string s4-1) s5-1)) + (let* ((gp-1 (cdr (cdr arg1))) + (a1-3 (car gp-1)) + ) + (while (not (null? gp-1)) + (let ((a1-4 (debug-menu-make-from-template arg0 (the-as pair a1-3)))) + (if a1-4 + (debug-menu-append-item s5-1 a1-4) + ) + ) + (set! gp-1 (cdr gp-1)) + (set! a1-3 (car gp-1)) + ) + ) + ) + ) + ((= s5-0 'main-menu) + (set! s4-0 (new 'debug 'debug-menu arg0 (the-as string s4-1))) + (let* ((gp-2 (cdr (cdr arg1))) + (a1-6 (car gp-2)) + ) + (while (not (null? gp-2)) + (let ((a1-7 (debug-menu-make-from-template arg0 (the-as pair a1-6)))) + (if a1-7 + (debug-menu-append-item (the-as debug-menu s4-0) a1-7) + ) + ) + (set! gp-2 (cdr gp-2)) + (set! a1-6 (car gp-2)) + ) + ) + (debug-menu-context-set-root-menu arg0 (the-as debug-menu s4-0)) + ) + (else + (set! s4-0 + (cond + ((= s5-0 'flag) + (new + 'debug + 'debug-menu-item-flag + (the-as string s4-1) + (car (cdr (cdr arg1))) + (the-as (function object debug-menu-msg object) (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + ) + ) + ((or (= s5-0 0) (= s5-0 'function)) + (new + 'debug + 'debug-menu-item-function + (the-as string s4-1) + (car (cdr (cdr arg1))) + (the-as (function object object) (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + ) + ) + ((= s5-0 'var) + (new + 'debug + 'debug-menu-item-var + (the-as string s4-1) + (the-as int (car (cdr (cdr arg1)))) + (the-as int (car (cdr (cdr (cdr arg1))))) + ) + ) + ((or (= s5-0 'int-var) (= s5-0 'int-var-gat1) (= s5-0 'hex-var)) + (set! s4-0 (new + 'debug + 'debug-menu-item-var + (the-as string s4-1) + (the-as int (car (cdr (cdr arg1)))) + (the-as int (ref arg1 4)) + ) + ) + (let ((s3-4 debug-menu-item-var-make-int) + (s2-3 (the-as debug-menu-item-var s4-0)) + (s1-3 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s0-2 (command-get-int (ref arg1 5) 0)) + ) + (set! sv-16 (ref arg1 6)) + (set! sv-32 command-get-int) + (let ((a0-24 (ref arg1 7)) + (a1-18 0) + ) + (set! sv-48 (sv-32 a0-24 a1-18)) + ) + (set! sv-64 command-get-int) + (let* ((a0-26 (ref arg1 8)) + (a1-20 0) + (t1-0 (sv-64 a0-26 a1-20)) + (t2-0 (= s5-0 'hex-var)) + ) + (s3-4 s2-3 (the-as (function int debug-menu-msg int int int) s1-3) s0-2 (the-as symbol sv-16) sv-48 t1-0 t2-0) + ) + ) + s4-0 + ) + ((= s5-0 'float-var) + (set! s4-0 (new + 'debug + 'debug-menu-item-var + (the-as string s4-1) + (the-as int (car (cdr (cdr arg1)))) + (the-as int (ref arg1 4)) + ) + ) + (let ((s5-5 debug-menu-item-var-make-float) + (s3-6 (the-as debug-menu-item-var s4-0)) + (s2-5 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s1-6 (command-get-float (ref arg1 5) 0.0)) + (s0-3 (ref arg1 6)) + ) + (set! sv-80 command-get-float) + (let ((a0-35 (ref arg1 7)) + (a1-28 0.0) + ) + (set! sv-96 (sv-80 a0-35 a1-28)) + ) + (set! sv-112 command-get-float) + (let ((a0-37 (ref arg1 8)) + (a1-30 0.0) + ) + (set! sv-128 (sv-112 a0-37 a1-30)) + ) + (set! sv-144 command-get-int) + (let* ((a0-39 (ref arg1 9)) + (a1-32 0) + (t2-1 (sv-144 a0-39 a1-32)) + ) + (s5-5 + s3-6 + (the-as (function int debug-menu-msg float float float) s2-5) + s1-6 + (the-as symbol s0-3) + sv-96 + sv-128 + t2-1 + ) + ) + ) + s4-0 + ) + (else + (the-as debug-menu-node #f) + ) + ) + ) + ) + ) + ) + (label cfg-39) + s4-0 + ) + +;; WARN: Return type mismatch object vs debug-menu. +(defun debug-menu-find-from-template ((arg0 debug-menu-context) (arg1 pair)) + (let ((s5-0 (the-as object (-> arg0 root-menu)))) + (while (begin (label cfg-12) (and s5-0 (type? s5-0 debug-menu) (not (null? arg1)))) + (let ((s3-0 (-> (the-as debug-menu s5-0) items)) + (s5-1 (car arg1)) + ) + (set! arg1 (cdr arg1)) + (let ((s4-0 (car s3-0))) + (while (not (null? s3-0)) + (when (string= (the-as string s5-1) (-> (the-as debug-menu-item s4-0) name)) + (if (type? s4-0 debug-menu-item-submenu) + (set! s5-0 (-> (the-as debug-menu-item-submenu s4-0) submenu)) + (set! s5-0 s4-0) + ) + (goto cfg-12) + ) + (set! s3-0 (cdr s3-0)) + (set! s4-0 (car s3-0)) + ) + ) + ) + (set! s5-0 #f) + (goto cfg-19) + ) + (label cfg-19) + (the-as debug-menu s5-0) + ) + ) + +(defun debug-menu-item-submenu-render ((arg0 debug-menu-item-submenu) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((s5-0 (-> arg0 parent context font))) + (let ((v1-2 s5-0) + (a0-1 arg2) + ) + (set! (-> v1-2 origin x) (the float arg1)) + (set! (-> v1-2 origin y) (the float a0-1)) + ) + (set! (-> s5-0 color) (cond + ((zero? arg3) + (font-color white-#ffffff) + ) + (arg4 + (font-color #7cbaba) + ) + (else + (font-color #959595) + ) + ) + ) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s4-0 (-> s3-0 base)) + ) + (draw-string-adv (-> arg0 name) s3-0 s5-0) + (draw-string-adv "..." s3-0 s5-0) + (let ((a3-1 (-> s3-0 base))) + (let ((v1-9 (the-as object (-> s3-0 base)))) + (set! (-> (the-as dma-packet v1-9) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-9) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-9) vif1) (new 'static 'vif-tag)) + (set! (-> s3-0 base) (&+ (the-as pointer v1-9) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s4-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +(defun debug-menu-item-function-render ((arg0 debug-menu-item-function) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((v1-2 (-> arg0 parent context font))) + (let ((a0-1 v1-2) + (a1-1 arg2) + ) + (set! (-> a0-1 origin x) (the float arg1)) + (set! (-> a0-1 origin y) (the float a1-1)) + ) + (set! (-> v1-2 color) (the-as font-color (cond + ((> (-> arg0 hilite-timer) 0) + (+! (-> arg0 hilite-timer) -1) + 10 + ) + ((< (-> arg0 hilite-timer) 0) + (+! (-> arg0 hilite-timer) 1) + 14 + ) + ((nonzero? arg3) + 13 + ) + (else + 12 + ) + ) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s5-0 (-> s4-0 base)) + ) + (draw-string (-> arg0 name) s4-0 v1-2) + (let ((a3-1 (-> s4-0 base))) + (let ((v1-3 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-3) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-3) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-3) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s5-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +(defun debug-menu-item-flag-render ((arg0 debug-menu-item-flag) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((v1-2 (-> arg0 parent context font))) + (let ((a0-1 v1-2) + (a1-1 arg2) + ) + (set! (-> a0-1 origin x) (the float arg1)) + (set! (-> a0-1 origin y) (the float a1-1)) + ) + (set! (-> v1-2 color) (cond + ((= (-> arg0 is-on) 'invalid) + (font-color #5e3f5e) + ) + ((-> arg0 is-on) + (if (zero? arg3) + (font-color #daf95e) + (font-color #8aa81f) + ) + ) + ((zero? arg3) + (font-color #a6b5a6) + ) + (else + (font-color #757f75) + ) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s5-0 (-> s4-0 base)) + ) + (draw-string (-> arg0 name) s4-0 v1-2) + (let ((a3-1 (-> s4-0 base))) + (let ((v1-3 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-3) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-3) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-3) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s5-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +(defun debug-menu-item-var-render ((arg0 debug-menu-item-var) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((s5-0 (-> arg0 parent context font))) + (let ((v1-2 s5-0) + (a0-1 arg2) + ) + (set! (-> v1-2 origin x) (the float arg1)) + (set! (-> v1-2 origin y) (the float a0-1)) + ) + (set! (-> s5-0 color) (cond + ((zero? arg3) + (if (-> arg0 grabbed-joypad-p) + (font-color #a0d5d5) + (font-color white-#ffffff) + ) + ) + (arg4 + (font-color #7cbaba) + ) + (else + (font-color #959595) + ) + ) + ) + (let* ((s1-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s4-0 (-> s1-0 base)) + ) + (draw-string-adv (-> arg0 name) s1-0 s5-0) + (draw-string-adv ":" s1-0 s5-0) + (cond + ((>= (-> arg0 show-len) (length (-> arg0 display-str))) + (draw-string (-> arg0 display-str) s1-0 s5-0) + ) + (else + (draw-string "..." s1-0 s5-0) + (set! arg4 (and (zero? arg3) arg4)) + (when arg4 + (let ((v1-14 s5-0) + (a1-5 20) + (a0-8 379) + ) + (set! (-> v1-14 origin x) (the float a1-5)) + (set! (-> v1-14 origin y) (the float a0-8)) + ) + (draw-string-adv (-> arg0 name) s1-0 s5-0) + (draw-string-adv ":" s1-0 s5-0) + (draw-string (-> arg0 display-str) s1-0 s5-0) + ) + ) + ) + (let ((a3-1 (-> s1-0 base))) + (let ((v1-16 (the-as object (-> s1-0 base)))) + (set! (-> (the-as dma-packet v1-16) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-16) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-16) vif1) (new 'static 'vif-tag)) + (set! (-> s1-0 base) (the-as pointer (&+ (the-as dma-packet v1-16) 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s4-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +(defun debug-menu-item-render ((arg0 debug-menu-item) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (when (> (-> arg0 refresh-delay) 0) + (+! (-> arg0 refresh-ctr) -1) + (when (<= (-> arg0 refresh-ctr) 0) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) + (debug-menu-item-send-msg arg0 (debug-menu-msg update)) + ) + ) + (cond + ((= (-> arg0 type) debug-menu-item-submenu) + (debug-menu-item-submenu-render (the-as debug-menu-item-submenu arg0) arg1 arg2 arg3 arg4) + ) + ((= (-> arg0 type) debug-menu-item-function) + (debug-menu-item-function-render (the-as debug-menu-item-function arg0) arg1 arg2 arg3 arg4) + ) + ((= (-> arg0 type) debug-menu-item-flag) + (debug-menu-item-flag-render (the-as debug-menu-item-flag arg0) arg1 arg2 arg3 arg4) + ) + ((= (-> arg0 type) debug-menu-item-var) + (debug-menu-item-var-render (the-as debug-menu-item-var arg0) arg1 arg2 arg3 arg4) + ) + (else + (format 0 "ERROR: Found unknown item type!~%") + ) + ) + arg0 + ) + +(defun debug-menu-render ((arg0 debug-menu) (arg1 int) (arg2 int) (arg3 debug-menu-node) (arg4 int)) + (local-vars (sv-16 dma-buffer) (sv-32 pointer)) + (let ((v1-0 0)) + (let* ((a0-1 (-> arg0 items)) + (a1-1 (car a0-1)) + ) + (while (not (null? a0-1)) + (if (= a1-1 arg3) + (goto cfg-7) + ) + (+! v1-0 1) + (set! a0-1 (cdr a0-1)) + (set! a1-1 (car a0-1)) + ) + ) + (label cfg-7) + (if (< 16 v1-0) + (set! arg2 (- arg2 (* 15 (+ v1-0 -16)))) + ) + ) + (let* ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s1-0 (-> s0-0 base)) + ) + (draw-sprite2d-xy s0-0 arg1 arg2 (-> arg0 pix-width) (-> arg0 pix-height) (new 'static 'rgba :a #x40)) + (let ((a3-2 (-> s0-0 base))) + (let ((v1-9 (the-as object (-> s0-0 base)))) + (set! (-> (the-as dma-packet v1-9) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-9) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-9) vif1) (new 'static 'vif-tag)) + (set! (-> s0-0 base) (&+ (the-as pointer v1-9) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s1-0 + (the-as (pointer dma-tag) a3-2) + ) + ) + ) + (let* ((s3-1 (+ arg1 3)) + (s2-1 (+ arg2 5)) + (s1-1 (-> arg0 items)) + (s0-1 (car s1-1)) + ) + (while (not (null? s1-1)) + (when (= s0-1 arg3) + (set! (-> arg0 context font color) (if (nonzero? arg4) + (font-color #959595) + (font-color white-#ffffff) + ) + ) + (let ((v1-20 (-> arg0 context font)) + (a1-5 s3-1) + (a0-15 s2-1) + ) + (set! (-> v1-20 origin x) (the float a1-5)) + (set! (-> v1-20 origin y) (the float a0-15)) + ) + (set! sv-16 (-> *display* frames (-> *display* on-screen) debug-buf)) + (set! sv-32 (-> sv-16 base)) + (draw-string ">" sv-16 (-> arg0 context font)) + (let ((a3-3 (-> sv-16 base))) + (let ((v1-32 (the-as object (-> sv-16 base)))) + (set! (-> (the-as dma-packet v1-32) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-32) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-32) vif1) (new 'static 'vif-tag)) + (set! (-> sv-16 base) (&+ (the-as pointer v1-32) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + sv-32 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + (debug-menu-item-render (the-as debug-menu-item s0-1) (+ s3-1 12) s2-1 arg4 (= s0-1 arg3)) + (+! s2-1 15) + (set! s1-1 (cdr s1-1)) + (set! s0-1 (car s1-1)) + ) + ) + arg0 + ) + +(defun debug-menu-context-render ((arg0 debug-menu-context)) + (let ((s4-0 6)) + (dotimes (s5-0 (-> arg0 sel-length)) + (let ((s3-0 (-> arg0 sel-menu s5-0))) + (let ((a3-0 (-> s3-0 selected-item))) + (debug-menu-render s3-0 s4-0 52 a3-0 (+ (- -1 s5-0) (-> arg0 sel-length))) + ) + (set! s4-0 (+ s4-0 3 (-> s3-0 pix-width))) + ) + ) + ) + arg0 + ) + +(defun debug-menu-context-select-next-or-prev-item ((arg0 debug-menu-context) (arg1 int)) + (local-vars (v1-6 object)) + (let ((s5-0 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)))) + (let ((a2-0 (-> s5-0 selected-item)) + (a0-1 '()) + (v1-4 '()) + ) + (let ((a3-0 (-> s5-0 items))) + (while (not (null? a3-0)) + (when (= (car a3-0) a2-0) + (set! v1-4 a3-0) + (goto cfg-7) + ) + (set! a0-1 a3-0) + (set! a3-0 (cdr a3-0)) + ) + ) + (label cfg-7) + (when (null? v1-4) + (format 0 "ERROR: Couldn't find selected item in menu.~%") + (set! arg0 arg0) + (goto cfg-19) + ) + (cond + ((>= arg1 0) + (if (null? (cdr v1-4)) + (set! v1-6 (car (-> s5-0 items))) + (set! v1-6 (car (cdr v1-4))) + ) + ) + ((null? a0-1) + (set! v1-6 (car (last (-> s5-0 items)))) + ) + (else + (set! v1-6 (car a0-1)) + ) + ) + ) + (set! (-> s5-0 selected-item) (the-as debug-menu-item v1-6)) + ) + (label cfg-19) + arg0 + ) + +(defun debug-menu-context-select-new-item ((arg0 debug-menu-context) (arg1 int)) + (let* ((a2-0 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1))) + (a1-1 (-> a2-0 selected-item)) + (a0-1 0) + (v1-4 -1) + ) + (let ((a2-1 (-> a2-0 items))) + (while (not (null? a2-1)) + (if (= (car a2-1) a1-1) + (set! v1-4 a0-1) + ) + (set! a2-1 (cdr a2-1)) + (+! a0-1 1) + ) + ) + (when (= v1-4 -1) + (format 0 "ERROR: Couldn't find selected item in menu.~%") + (set! arg0 arg0) + (goto cfg-25) + ) + (cond + ((>= arg1 0) + (cond + ((= v1-4 (+ a0-1 -1)) + (set! arg1 1) + ) + ((>= (+ v1-4 arg1) a0-1) + (set! arg1 (+ (- -1 v1-4) a0-1)) + ) + ) + (dotimes (s4-0 arg1) + (debug-menu-context-select-next-or-prev-item arg0 1) + ) + ) + (else + (cond + ((zero? v1-4) + (set! arg1 -1) + ) + ((< (+ v1-4 arg1) 0) + (set! arg1 (- v1-4)) + ) + ) + (dotimes (s4-1 (- arg1)) + (debug-menu-context-select-next-or-prev-item arg0 -1) + ) + ) + ) + ) + (label cfg-25) + arg0 + ) + +(defun debug-menu-context-open-submenu ((arg0 debug-menu-context) (arg1 debug-menu)) + (let ((v1-0 (-> arg0 sel-length))) + (when (>= v1-0 8) + (format 0 "ERROR: Trying to exceed maximum menu depth!") + (return arg1) + ) + (when (null? (-> arg1 items)) + (format 0 "ERROR: Submenu has no items!") + (return arg1) + ) + (set! (-> arg0 sel-menu v1-0) arg1) + (if (not (-> arg1 selected-item)) + (set! (-> arg1 selected-item) (the-as debug-menu-item (-> arg1 items car))) + ) + (set! (-> arg0 sel-length) (+ v1-0 1)) + ) + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest current-selection)) + ) + +(defun debug-menu-context-close-submenu ((arg0 debug-menu-context)) + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest current-selection)) + (if (< 1 (-> arg0 sel-length)) + (+! (-> arg0 sel-length) -1) + ) + arg0 + ) + +(defun debug-menu-item-submenu-msg ((arg0 debug-menu-item-submenu) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((a0-1 (-> arg0 parent context))) + (debug-menu-context-open-submenu a0-1 (-> arg0 submenu)) + ) + ) + arg0 + ) + +(defun debug-menu-item-function-msg ((arg0 debug-menu-item-function) (arg1 debug-menu-msg)) + (cond + ((= arg1 (debug-menu-msg press)) + (cond + ((-> arg0 activate-func) + (if ((-> arg0 activate-func) (-> arg0 id)) + (set! (-> arg0 hilite-timer) 6) + (set! (-> arg0 hilite-timer) -6) + ) + ) + (else + (set! (-> arg0 hilite-timer) -6) + ) + ) + ) + ((= arg1 (debug-menu-msg deactivate)) + (set! (-> arg0 hilite-timer) 0) + 0 + ) + ) + arg0 + ) + +(defun debug-menu-item-flag-msg ((arg0 debug-menu-item-flag) (arg1 debug-menu-msg)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (-> arg0 activate-func) + (set! (-> arg0 is-on) ((-> arg0 activate-func) (-> arg0 id) (debug-menu-msg press))) + ) + (let ((a0-2 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-2 (debug-menu-msg update) (debug-menu-dest open-menus)) + ) + ) + ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) + (if (-> arg0 activate-func) + (set! (-> arg0 is-on) ((-> arg0 activate-func) (-> arg0 id) (debug-menu-msg update))) + ) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) + ) + ) + arg0 + ) + +(defun debug-menu-item-var-joypad-handler ((arg0 debug-menu-item-var) (arg1 debug-menu-msg)) + (cond + ((zero? (logand (-> *cpad-list* cpads arg1 button0-abs 0) (pad-buttons x))) + (let ((a0-2 (-> arg0 parent context))) + (debug-menu-context-release-joypad a0-2) + ) + (set! (-> arg0 grabbed-joypad-p) #f) + (when (cpad-pressed? arg1 square) + (cond + ((-> arg0 float-p) + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 fundo-val) (-> arg0 fval)) + ) + ) + ) + (else + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 fundo-val) (-> arg0 fval)) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + ) + (let ((a0-7 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-7 (debug-menu-msg update) (debug-menu-dest open-menus)) + ) + ) + ((or (cpad-hold? arg1 right) (cpad-hold? arg1 left) (cpad-hold? arg1 down) (cpad-hold? arg1 up)) + (let ((v1-45 (cond + ((cpad-hold? arg1 right) + 10 + ) + ((cpad-hold? arg1 up) + 1 + ) + ((cpad-hold? arg1 down) + -1 + ) + (else + -10 + ) + ) + ) + ) + (when (!= v1-45 (-> arg0 inc-dir)) + (set! (-> arg0 inc-dir) v1-45) + (set! (-> arg0 inc-delay) 15) + (set! (-> arg0 inc-delay-ctr) 0) + (set! (-> arg0 step-delay-ctr) 30) + (set! (-> arg0 fstep) (-> arg0 fstart-inc)) + (set! (-> arg0 fstep) (-> arg0 fstart-inc)) + ) + ) + (cond + ((<= (-> arg0 inc-delay-ctr) 0) + (if (> (-> arg0 inc-delay) 0) + (+! (-> arg0 inc-delay) -1) + ) + (when (zero? (-> arg0 inc-delay)) + (cond + ((<= (-> arg0 step-delay-ctr) 0) + (set! (-> arg0 step-delay-ctr) 30) + (cond + ((-> arg0 float-p) + (if (< (-> arg0 fstep) 10000000.0) + (set! (-> arg0 fstep) (* 2.0 (-> arg0 fstep))) + ) + ) + (else + (if (< (the-as int (-> arg0 fstep)) #x989680) + (set! (-> arg0 fstep) (the-as float (* (-> arg0 fstep) 2))) + ) + ) + ) + ) + (else + (+! (-> arg0 step-delay-ctr) -1) + ) + ) + ) + (set! (-> arg0 inc-delay-ctr) (-> arg0 inc-delay)) + (cond + ((-> arg0 float-p) + (when (-> arg0 factivate-func) + (let ((f0-8 (+ (-> arg0 fval) (* (the float (-> arg0 inc-dir)) (-> arg0 fstep))))) + (if (-> arg0 range-p) + (set! f0-8 (fmin (fmax f0-8 (-> arg0 frange-min)) (-> arg0 frange-max))) + ) + (set! (-> arg0 fval) ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) f0-8 (-> arg0 fval))) + ) + ) + ) + (else + (when (-> arg0 factivate-func) + (let ((a2-4 (+ (the-as int (-> arg0 fval)) (* (-> arg0 inc-dir) (the-as int (-> arg0 fstep)))))) + (if (-> arg0 range-p) + (set! a2-4 (min (max a2-4 (the-as int (-> arg0 frange-min))) (the-as int (-> arg0 frange-max)))) + ) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (the-as float a2-4) (-> arg0 fval)) + ) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + (let ((a0-29 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-29 (debug-menu-msg update) (debug-menu-dest current-selection)) + ) + ) + (else + (+! (-> arg0 inc-delay-ctr) -1) + ) + ) + ) + (else + (set! (-> arg0 inc-dir) 0) + 0 + ) + ) + arg0 + ) + +(defun debug-menu-item-var-msg ((arg0 debug-menu-item-var) (arg1 debug-menu-msg)) + (cond + ((= arg1 (debug-menu-msg deactivate)) + (when (-> arg0 grabbed-joypad-p) + (let ((a0-1 (-> arg0 parent context))) + (debug-menu-context-release-joypad a0-1) + ) + (set! (-> arg0 grabbed-joypad-p) #f) + ) + ) + ((= arg1 (debug-menu-msg press)) + (when (not (-> arg0 grabbed-joypad-p)) + (let ((a0-2 (-> arg0 parent context))) + (when (debug-menu-context-grab-joypad a0-2 arg0 (the-as (function basic none) debug-menu-item-var-joypad-handler)) + (set! (-> arg0 grabbed-joypad-p) #t) + (set! (-> arg0 fundo-val) (-> arg0 fval)) + (set! (-> arg0 fundo-val) (-> arg0 fval)) + (set! (-> arg0 inc-dir) 0) + 0 + ) + ) + ) + ) + ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) + (cond + ((-> arg0 float-p) + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)) + ) + ) + ) + (else + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) + ) + ) + arg0 + ) + +(defun debug-menu-item-send-msg ((arg0 debug-menu-item) (arg1 debug-menu-msg)) + (cond + ((= (-> arg0 type) debug-menu-item-submenu) + (debug-menu-item-submenu-msg (the-as debug-menu-item-submenu arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-function) + (debug-menu-item-function-msg (the-as debug-menu-item-function arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-flag) + (debug-menu-item-flag-msg (the-as debug-menu-item-flag arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-var) + (debug-menu-item-var-msg (the-as debug-menu-item-var arg0) arg1) + ) + (else + (format 0 "ERROR: Found unknown item type!~%") + ) + ) + arg0 + ) + +(defun debug-menu-send-msg ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 symbol)) + (let* ((s3-0 (-> arg0 items)) + (s2-0 (car s3-0)) + ) + (while (not (null? s3-0)) + (debug-menu-item-send-msg (the-as debug-menu-item s2-0) arg1) + (if (and arg2 (= (-> (the-as debug-menu-item s2-0) type) debug-menu-item-submenu)) + (debug-menu-send-msg (-> (the-as debug-menu-item-submenu s2-0) submenu) arg1 #t) + ) + (set! s3-0 (cdr s3-0)) + (set! s2-0 (car s3-0)) + ) + ) + arg0 + ) + +(defun debug-menu-context-send-msg ((arg0 debug-menu-context) (arg1 debug-menu-msg) (arg2 debug-menu-dest)) + (cond + ((= arg2 (debug-menu-dest root)) + (debug-menu-send-msg (-> arg0 root-menu) arg1 #t) + ) + ((= arg2 (debug-menu-dest open-menus)) + (when (-> arg0 is-active) + (dotimes (s4-0 (-> arg0 sel-length)) + (let ((a0-2 (-> arg0 sel-menu s4-0))) + (debug-menu-send-msg a0-2 arg1 #f) + ) + ) + ) + ) + ((= arg2 (debug-menu-dest current-selection)) + (when (-> arg0 is-active) + (if (nonzero? (-> arg0 sel-length)) + (debug-menu-send-msg (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)) arg1 #f) + ) + ) + ) + ((= arg2 (debug-menu-dest activation)) + (cond + ((= arg1 (debug-menu-msg activate)) + (when (not (-> arg0 is-active)) + (set! (-> arg0 is-active) #t) + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest open-menus)) + ) + ) + ((= arg1 (debug-menu-msg deactivate)) + (when (-> arg0 is-active) + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest open-menus)) + (set! (-> arg0 is-active) #f) + ) + ) + ) + ) + ) + arg0 + ) + +(defun debug-menu-context-activate-selection ((arg0 debug-menu-context)) + (let ((a0-1 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1) selected-item))) + (debug-menu-item-send-msg a0-1 (debug-menu-msg press)) + ) + arg0 + ) + +(defun debug-menus-default-joypad-func ((arg0 debug-menu-context)) + (cond + ((cpad-pressed? (-> arg0 joypad-number) square) + (cond + ((< 1 (-> arg0 sel-length)) + (debug-menu-context-close-submenu arg0) + ) + (else + ) + ) + ) + ((cpad-pressed? (-> arg0 joypad-number) x) + (debug-menu-context-activate-selection arg0) + ) + ((cpad-pressed? (-> arg0 joypad-number) up) + (debug-menu-context-select-new-item arg0 -1) + ) + ((cpad-pressed? (-> arg0 joypad-number) down) + (debug-menu-context-select-new-item arg0 1) + ) + ((cpad-pressed? (-> arg0 joypad-number) left) + (debug-menu-context-select-new-item arg0 -5) + ) + ((cpad-pressed? (-> arg0 joypad-number) right) + (debug-menu-context-select-new-item arg0 5) + ) + ) + arg0 + ) + +(defun debug-menus-active ((arg0 debug-menu-context)) + (when (not (-> arg0 is-hidden)) + (cond + ((-> arg0 joypad-func) + (let ((t9-0 (-> arg0 joypad-func)) + (a0-1 (-> arg0 joypad-item)) + ) + (-> arg0 joypad-number) + (t9-0 a0-1) + ) + ) + (else + (debug-menus-default-joypad-func arg0) + ) + ) + (debug-menu-context-render arg0) + ) + arg0 + ) + +(defun debug-menus-handler ((arg0 debug-menu-context)) + (if (-> arg0 is-active) + (debug-menus-active arg0) + ) + arg0 + ) + +0 + +) + + + diff --git a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc index 10f4cdea9f..fa0851d20d 100644 --- a/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc +++ b/goal_src/jak2/engine/debug/nav/mysql-nav-graph.gc @@ -7,3 +7,56 @@ ;; DECOMP BEGINS +(deftype mysql-nav-node (structure) + ((mysql-save-flag uint32 :offset-assert 0) + (runtime-id uint32 :offset-assert 4) + (temp-edge-list basic :offset-assert 8) + (level-node-index int32 :offset-assert 12) + (cam-dist float :offset-assert 16) + (visible basic :offset-assert 20) + (nav_node_id uint32 :offset-assert 24) + (nav_graph_id uint32 :offset-assert 28) + (position vector :inline :offset-assert 32) + (level_name basic :offset-assert 48) + (angle float :offset-assert 52) + (radius float :offset-assert 56) + (nav_node_flag uint32 :offset-assert 60) + (nav_mesh_id uint32 :offset-assert 64) + ) + :pack-me + :method-count-assert 11 + :size-assert #x44 + :flag-assert #xb00000044 + (:methods + (mysql-nav-node-method-9 () none 9) + (mysql-nav-node-method-10 () none 10) + ) + ) + +(deftype mysql-nav-edge (structure) + ((mysql-save-flag uint32 :offset-assert 0) + (runtime-id uint32 :offset-assert 4) + (runtime-node-id-1 int32 :offset-assert 8) + (runtime-node-id-2 int32 :offset-assert 12) + (temp-next-edge mysql-nav-edge :offset-assert 16) + (nav_edge_id uint32 :offset-assert 20) + (nav_graph_id uint32 :offset-assert 24) + (nav_node_id_1 uint32 :offset-assert 28) + (nav_node_id_2 uint32 :offset-assert 32) + (directionality uint32 :offset-assert 36) + (speed_limit float :offset-assert 40) + (density float :offset-assert 44) + (traffic_edge_flag int32 :offset-assert 48) + (nav_clock_mask uint32 :offset-assert 52) + (nav_clock_type uint32 :offset-assert 56) + (width float :offset-assert 60) + (minimap_edge_flag int32 :offset-assert 64) + ) + :pack-me + :method-count-assert 10 + :size-assert #x44 + :flag-assert #xa00000044 + (:methods + (mysql-nav-edge-method-9 () none 9) + ) + ) diff --git a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc index 92c652e9a1..fd25ce226a 100644 --- a/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc +++ b/goal_src/jak2/engine/debug/nav/nav-graph-editor.gc @@ -5,5 +5,96 @@ ;; name in dgo: nav-graph-editor ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(declare-type nav-graph-editor process) +(define-extern get-nav-graph-editor (function nav-graph-editor)) +(define-extern run-nav-graph-editor (function symbol none)) +(define-extern exit-nav-graph-editor (function none)) + ;; DECOMP BEGINS +(deftype nav-graph-editor (process) + ((nav-graph basic :offset-assert 128) + (mode uint32 :offset-assert 132) + (command-id int32 :offset-assert 136) + (max-command int32 :offset-assert 140) + (selected-index int32 :offset-assert 144) + (selected-dist float :offset-assert 148) + (selected-node-edge? basic :offset-assert 152) + (closest-node int32 :offset-assert 156) + (dist-closest-node float :offset-assert 160) + (closest-edge int32 :offset-assert 164) + (dist-closest-edge float :offset-assert 168) + (mouse-pos vector :inline :offset-assert 176) + (mouse-hit vector :inline :offset-assert 192) + (mouse-hit-pick vector :inline :offset-assert 208) + (mouse-normal vector :inline :offset-assert 224) + (mouse-spos-hold vector :inline :offset-assert 240) + (edge-src int32 :offset-assert 256) + (edge-dst int32 :offset-assert 260) + (edge-visibility int32 :offset-assert 264) + (vehicle-edit-mode basic :offset-assert 268) + (hover-edit-mode basic :offset-assert 272) + (clipping-dist float :offset-assert 276) + (plane-height float :offset-assert 280) + (plane-height-hold float :offset-assert 284) + (default-node mysql-nav-node :inline :offset-assert 288) + (default-edge mysql-nav-edge :inline :offset-assert 356) + (command-array basic :offset-assert 424) + ) + :method-count-assert 64 + :size-assert #x1ac + :flag-assert #x40013001ac + (:methods + (move-node () _type_ :state 14) + (move-plane () _type_ :state 15) + (create () _type_ :state 16) + (edit-edge () _type_ :state 17) + (create-edge () _type_ :state 18) + (adjust-plane () _type_ :state 19) + (adjust-it () _type_ :state 20) + (adjust-minimap () _type_ :state 21) + (adjust-node-angle () _type_ :state 22) + (adjust-node-radius () _type_ :state 23) + (adjust-edge-visibility () _type_ :state 24) + (adjust-edge-width () _type_ :state 25) + (adjust-edge-density () _type_ :state 26) + (draw-closest-minimap () _type_ :state 27) + (nav-graph-editor-method-28 () none 28) + (nav-graph-editor-method-29 () none 29) + (nav-graph-editor-method-30 () none 30) + (nav-graph-editor-method-31 () none 31) + (nav-graph-editor-method-32 () none 32) + (nav-graph-editor-method-33 () none 33) + (nav-graph-editor-method-34 () none 34) + (nav-graph-editor-method-35 () none 35) + (nav-graph-editor-method-36 () none 36) + (nav-graph-editor-method-37 () none 37) + (nav-graph-editor-method-38 () none 38) + (nav-graph-editor-method-39 () none 39) + (nav-graph-editor-method-40 () none 40) + (nav-graph-editor-method-41 () none 41) + (nav-graph-editor-method-42 () none 42) + (nav-graph-editor-method-43 () none 43) + (nav-graph-editor-method-44 () none 44) + (nav-graph-editor-method-45 () none 45) + (nav-graph-editor-method-46 () none 46) + (nav-graph-editor-method-47 () none 47) + (nav-graph-editor-method-48 () none 48) + (nav-graph-editor-method-49 () none 49) + (nav-graph-editor-method-50 () none 50) + (nav-graph-editor-method-51 () none 51) + (nav-graph-editor-method-52 () none 52) + (nav-graph-editor-method-53 () none 53) + (nav-graph-editor-method-54 () none 54) + (nav-graph-editor-method-55 () none 55) + (nav-graph-editor-method-56 () none 56) + (nav-graph-editor-method-57 () none 57) + (nav-graph-editor-method-58 () none 58) + (nav-graph-editor-method-59 () none 59) + (nav-graph-editor-method-60 () none 60) + (nav-graph-editor-method-61 () none 61) + (nav-graph-editor-method-62 () none 62) + (nav-graph-editor-method-63 () none 63) + ) + ) diff --git a/goal_src/jak2/engine/draw/drawable-h.gc b/goal_src/jak2/engine/draw/drawable-h.gc index 5cff162ea0..7f7a249c12 100644 --- a/goal_src/jak2/engine/draw/drawable-h.gc +++ b/goal_src/jak2/engine/draw/drawable-h.gc @@ -9,6 +9,14 @@ ;; NOTE - for sparticle-launcher and editable (define-extern sphere-in-view-frustum? (function sphere symbol)) +;; NOTE - for default-menu +(define-extern *edit-instance* string) +(declare-type prototype-bucket basic) +(define-extern find-instance-by-name (function string prototype-bucket)) +(define-extern prototype-bucket-type (function prototype-bucket type)) +(define-extern print-prototype-list (function none)) +(define-extern prototype-bucket-recalc-fields (function prototype-bucket prototype-bucket)) + ;; DECOMP BEGINS (deftype drawable (basic) diff --git a/goal_src/jak2/engine/entity/entity-h.gc b/goal_src/jak2/engine/entity/entity-h.gc index 65578d3a70..a0b1d681ab 100644 --- a/goal_src/jak2/engine/entity/entity-h.gc +++ b/goal_src/jak2/engine/entity/entity-h.gc @@ -30,6 +30,13 @@ (define-extern process-entity-status! (function process entity-perm-status symbol int)) (define-extern process-drawable-from-entity! (function process-drawable entity-actor none)) +(declare-type nav-poly structure) + +;; NOTE - for default-menu +(define-extern *compact-actors* symbol) +(define-extern debug-actor (function string none)) +(define-extern reset-actors (function symbol none)) + ;; DECOMP BEGINS (define *generate-actor-vis* #f) @@ -62,6 +69,7 @@ ) ) + (deftype entity-links (structure) ((prev-link entity-links :offset-assert 0) (next-link entity-links :offset-assert 4) @@ -85,6 +93,7 @@ ) ) + (deftype entity-perm-array (inline-array-class) ((data entity-perm :inline :dynamic :offset-assert 16) ) @@ -92,6 +101,8 @@ :size-assert #x10 :flag-assert #x900000010 ) + + (set! (-> entity-perm-array heap-base) (the-as uint 16)) (deftype entity-links-array (inline-array-class) @@ -101,6 +112,8 @@ :size-assert #x10 :flag-assert #x900000010 ) + + (set! (-> entity-links-array heap-base) (the-as uint 64)) (deftype entity (res-lump) @@ -111,8 +124,8 @@ :size-assert #x34 :flag-assert #x1b00000034 (:methods - (entity-method-22 () none 22) - (entity-method-23 () none 23) + (entity-method-22 (_type_) _type_ 22) + (entity-method-23 (_type_) _type_ 23) (entity-method-24 () none 24) (entity-method-25 () none 25) (entity-method-26 () none 26) @@ -134,8 +147,8 @@ :size-assert #x38 :flag-assert #x1d00000038 (:methods - (entity-nav-mesh-method-27 () none 27) - (entity-nav-mesh-method-28 () none 28) + (entity-nav-mesh-method-27 (_type_) none 27) + (debug-draw (_type_) none 28) ) ) @@ -166,8 +179,8 @@ (prev-actor (_type_) entity-actor 28) (entity-actor-method-29 () none 29) (entity-actor-method-30 () none 30) - (entity-actor-method-31 () none 31) - (entity-actor-method-32 () none 32) + (entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31) + (entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32) ) ) @@ -180,6 +193,7 @@ :flag-assert #x900000008 ) + (deftype actor-group (inline-array-class) ((data actor-reference :inline :dynamic :offset-assert 16) ) @@ -187,20 +201,23 @@ :size-assert #x10 :flag-assert #x900000010 ) + + (set! (-> actor-group heap-base) (the-as uint 8)) (deftype entity-info (basic) - ((ptype type :offset-assert 4) + ((ptype type :offset-assert 4) (package string :offset-assert 8) - (art-group pair :offset-assert 12) + (art-group pair :offset-assert 12) (pool symbol :offset-assert 16) - (heap-size int32 :offset-assert 20) + (heap-size int32 :offset-assert 20) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) + (deftype actor-bank (basic) ((pause-dist meters :offset-assert 4) (birth-dist meters :offset-assert 8) @@ -211,4 +228,11 @@ :flag-assert #x900000010 ) + (define *ACTOR-bank* (new 'static 'actor-bank :pause-dist (meters 50) :birth-dist (meters 220) :birth-max 10)) + +0 + + + + diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 1b3571db0e..1dcc2b7c46 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -126,6 +126,10 @@ (define-extern process-drawable-art-error (state string process-drawable)) (define-extern part-group-pointer? (function pointer symbol)) +;; NOTE - for default-menu +(define-extern bug-report-display (function none)) +(define-extern trsq->continue-point (function trsq none)) + ;; DECOMP BEGINS (local-vars (gp-0 game-info)) @@ -247,102 +251,102 @@ (deftype game-info (basic) - ((mode symbol :offset-assert 4) - (save-name string :offset-assert 8) - (life float :offset-assert 12) - (life-max float :offset-assert 16) - (money float :offset-assert 20) - (money-total float :offset-assert 24) - (money-per-level uint8 32 :offset-assert 28) - (deaths-per-level uint8 32 :offset-assert 60) - (buzzer-total float :offset-assert 92) - (fuel float :offset-assert 96) - (gem float :offset-assert 100) - (gem-total float :offset-assert 104) - (skill float :offset-assert 108) - (skill-total float :offset-assert 112) - (karma float :offset-assert 116) - (eco-pill-dark float :offset-assert 120) - (eco-pill-dark-total float :offset-assert 124) - (features game-feature :offset-assert 128) - (debug-features game-feature :offset-assert 136) - (secrets game-secrets :offset-assert 144) - (unknown-pad1 uint32 :offset-assert 148) - (purchase-secrets uint32 :offset-assert 152) - (unknown-pad2 uint32 :offset-assert 156) - (gun-type int32 :offset-assert 160) - (gun-ammo float 4 :offset-assert 164) - (shield float :offset-assert 180) - (score float :offset-assert 184) - (score-owner uint64 :offset-assert 192) - (timer uint64 :offset-assert 200) - (timer-owner uint64 :offset-assert 208) - (timer-flash basic :offset-assert 216) - (counter float :offset-assert 220) - (counter-flash basic :offset-assert 224) - (attack-id uint32 :offset-assert 228) - (perm-list entity-perm-array :offset-assert 232) - (task-perm-list entity-perm-array :offset-assert 236) - (current-continue continue-point :offset-assert 240) - (last-continue continue-point :offset-assert 244) - (unknown-pad3 array :offset-assert 248) - (unknown-pad4 array :offset-assert 252) - (unknown-pad5 array :offset-assert 256) - (task-counter uint32 :offset-assert 260) - (unknown-pad6 uint32 :offset-assert 264) - (level-opened uint8 32 :offset-assert 268) - (total-deaths int32 :offset-assert 300) - (continue-deaths int32 :offset-assert 304) - (task-deaths int32 :offset-assert 308) - (total-trys int32 :offset-assert 312) - (game-start-time time-frame :offset-assert 320) - (continue-time time-frame :offset-assert 328) - (death-time time-frame :offset-assert 336) - (hit-time time-frame :offset-assert 344) - (task-pickup-time time-frame :offset-assert 352) - (unknown-array1 (array uint64) :offset-assert 360) - (unknown-array2 (array uint64) :offset-assert 364) - (unknown-array3 (array uint64) :offset-assert 368) - (death-pos vector-array :offset 372) - (stop-watch-start uint64 :offset-assert 376) - (stop-watch-stop uint64 :offset-assert 384) - (blackout-time time-frame :offset-assert 392) - (letterbox-time time-frame :offset-assert 400) - (hint-play-time time-frame :offset-assert 408) - (display-text-time time-frame :offset-assert 416) - (display-text-handle uint64 :offset-assert 424) - (death-movie-tick int32 :offset-assert 432) - (want-auto-save symbol :offset-assert 436) - (auto-save-proc handle :offset-assert 440) - (auto-save-status mc-status-code :offset-assert 448) - (auto-save-card int32 :offset-assert 452) - (auto-save-which int32 :offset-assert 456) - (auto-save-count int32 :offset-assert 460) - (pov-camera-handle uint64 :offset-assert 464) - (other-camera-handle uint64 :offset-assert 472) - (controller uint64 2 :offset-assert 480) - (race-timer uint64 :offset-assert 496) - (race-current-lap-count int32 :offset-assert 504) - (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) - (demo-state uint32 :offset-assert 532) - (wanted-flash basic :offset-assert 536) - (distance float :offset-assert 540) - (kiosk-timeout uint64 :offset-assert 544) - (pause-start-time time-frame :offset-assert 552) - (game-score (array highscore-info) :offset-assert 560) - (goal float :offset-assert 564) - (miss float :offset-assert 568) - (miss-max float :offset-assert 572) - (unknown-array4 (array uint64) :offset-assert 576) - (live-eco-pill-count int32 :offset-assert 580) - (live-gem-count int32 :offset-assert 584) - (air-supply float :offset-assert 588) - (homing-beacon int32 :offset-assert 592) - (dark-eco-pickup int32 :offset-assert 596) - (green-eco-pickup int32 :offset-assert 600) + ((mode symbol :offset-assert 4) + (save-name string :offset-assert 8) + (life float :offset-assert 12) + (life-max float :offset-assert 16) + (money float :offset-assert 20) + (money-total float :offset-assert 24) + (money-per-level uint8 32 :offset-assert 28) + (deaths-per-level uint8 32 :offset-assert 60) + (buzzer-total float :offset-assert 92) + (fuel float :offset-assert 96) + (gem float :offset-assert 100) + (gem-total float :offset-assert 104) + (skill float :offset-assert 108) + (skill-total float :offset-assert 112) + (karma float :offset-assert 116) + (eco-pill-dark float :offset-assert 120) + (eco-pill-dark-total float :offset-assert 124) + (features game-feature :offset-assert 128) + (debug-features game-feature :offset-assert 136) + (secrets game-secrets :offset-assert 144) + (unknown-pad1 uint32 :offset-assert 148) + (purchase-secrets uint32 :offset-assert 152) + (unknown-pad2 uint32 :offset-assert 156) + (gun-type int32 :offset-assert 160) + (gun-ammo float 4 :offset-assert 164) + (shield float :offset-assert 180) + (score float :offset-assert 184) + (score-owner uint64 :offset-assert 192) + (timer uint64 :offset-assert 200) + (timer-owner uint64 :offset-assert 208) + (timer-flash basic :offset-assert 216) + (counter float :offset-assert 220) + (counter-flash basic :offset-assert 224) + (attack-id uint32 :offset-assert 228) + (perm-list entity-perm-array :offset-assert 232) + (task-perm-list entity-perm-array :offset-assert 236) + (current-continue continue-point :offset-assert 240) + (last-continue continue-point :offset-assert 244) + (play-list (array game-task-info) :offset-assert 248) + (sub-task-list (array game-task-node-info) :offset-assert 252) + (unknown-pad5 array :offset-assert 256) + (task-counter uint32 :offset-assert 260) + (unknown-pad6 uint32 :offset-assert 264) + (level-opened uint8 32 :offset-assert 268) + (total-deaths int32 :offset-assert 300) + (continue-deaths int32 :offset-assert 304) + (task-deaths int32 :offset-assert 308) + (total-trys int32 :offset-assert 312) + (game-start-time time-frame :offset-assert 320) + (continue-time time-frame :offset-assert 328) + (death-time time-frame :offset-assert 336) + (hit-time time-frame :offset-assert 344) + (task-pickup-time time-frame :offset-assert 352) + (unknown-array1 (array uint64) :offset-assert 360) + (unknown-array2 (array uint64) :offset-assert 364) + (unknown-array3 (array uint64) :offset-assert 368) + (death-pos vector-array :offset 372) + (stop-watch-start uint64 :offset-assert 376) + (stop-watch-stop uint64 :offset-assert 384) + (blackout-time time-frame :offset-assert 392) + (letterbox-time time-frame :offset-assert 400) + (hint-play-time time-frame :offset-assert 408) + (display-text-time time-frame :offset-assert 416) + (display-text-handle uint64 :offset-assert 424) + (death-movie-tick int32 :offset-assert 432) + (want-auto-save symbol :offset-assert 436) + (auto-save-proc handle :offset-assert 440) + (auto-save-status mc-status-code :offset-assert 448) + (auto-save-card int32 :offset-assert 452) + (auto-save-which int32 :offset-assert 456) + (auto-save-count int32 :offset-assert 460) + (pov-camera-handle uint64 :offset-assert 464) + (other-camera-handle uint64 :offset-assert 472) + (controller uint64 2 :offset-assert 480) + (race-timer uint64 :offset-assert 496) + (race-current-lap-count int32 :offset-assert 504) + (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) + (demo-state uint32 :offset-assert 532) + (wanted-flash basic :offset-assert 536) + (distance float :offset-assert 540) + (kiosk-timeout uint64 :offset-assert 544) + (pause-start-time time-frame :offset-assert 552) + (game-score (array highscore-info) :offset-assert 560) + (goal float :offset-assert 564) + (miss float :offset-assert 568) + (miss-max float :offset-assert 572) + (unknown-array4 (array uint64) :offset-assert 576) + (live-eco-pill-count int32 :offset-assert 580) + (live-gem-count int32 :offset-assert 584) + (air-supply float :offset-assert 588) + (homing-beacon int32 :offset-assert 592) + (dark-eco-pickup int32 :offset-assert 596) + (green-eco-pickup int32 :offset-assert 600) ) :method-count-assert 31 :size-assert #x25c diff --git a/goal_src/jak2/engine/game/game-save.gc b/goal_src/jak2/engine/game/game-save.gc index c2943c7bbf..89c6334be1 100644 --- a/goal_src/jak2/engine/game/game-save.gc +++ b/goal_src/jak2/engine/game/game-save.gc @@ -5,5 +5,8 @@ ;; name in dgo: game-save ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(define-extern auto-save-command (function symbol int int process-tree symbol none)) + ;; DECOMP BEGINS diff --git a/goal_src/jak2/engine/game/main-h.gc b/goal_src/jak2/engine/game/main-h.gc index 168dcc235b..bbe746c23b 100644 --- a/goal_src/jak2/engine/game/main-h.gc +++ b/goal_src/jak2/engine/game/main-h.gc @@ -102,6 +102,9 @@ ;; NOTE - for settings (define-extern *master-exit* symbol) +;; NOTE - for default-menu +(define-extern set-master-mode (function symbol none)) + ;; DECOMP BEGINS ;; engine debug settings diff --git a/goal_src/jak2/engine/game/main.gc b/goal_src/jak2/engine/game/main.gc index 579d3e2fed..246f650544 100644 --- a/goal_src/jak2/engine/game/main.gc +++ b/goal_src/jak2/engine/game/main.gc @@ -67,7 +67,7 @@ ; (when *display-deci-count* ; (let ((s2-0 draw-string-xy)) ; (format (clear *temp-string*) "~D" *deci-count*) - ; (s2-0 *temp-string* s3-0 448 210 (font-color default) (font-flags shadow)) + ; (s2-0 *temp-string* s3-0 448 210 (font-color default-#cddbcd) (font-flags shadow)) ; ) ; ) ; (display-file-info) @@ -93,7 +93,7 @@ ; 352 ; 320 ; ) - ; (font-color orange-red) + ; (font-color precursor-#ec3b00) ; (font-flags shadow kerning middle large) ; ) ; ) @@ -113,7 +113,7 @@ ; s3-1 ; (the int (-> *font-context* origin x)) ; s2-2 - ; (font-color default) + ; (font-color default-#cddbcd) ; (font-flags shadow) ; ) ; ) @@ -124,7 +124,7 @@ ; s3-1 ; (the int (-> *font-context* origin x)) ; a3-6 - ; (font-color default) + ; (font-color default-#cddbcd) ; (font-flags shadow) ; ) ; ) diff --git a/goal_src/jak2/engine/game/task/task-control-h.gc b/goal_src/jak2/engine/game/task/task-control-h.gc index 9dd0368492..c7c4a70225 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -167,6 +167,13 @@ ;; NOTE - for settings (define-extern update-task-masks (function symbol none)) +;; NOTE - for default-menu +(define-extern play-clean (function symbol none)) +(define-extern task-node-open! (function game-task none)) +(define-extern task-node-close! (function game-task none)) +(define-extern task-node-open? (function game-task symbol)) +(define-extern play-task (function game-task symbol symbol string)) + ;; DECOMP BEGINS (defun-debug game-task->string ((arg0 game-task)) @@ -1291,8 +1298,8 @@ (deftype game-task-node-info (basic) ((level basic :offset-assert 4) (task game-task :offset-assert 8) - (name basic :offset-assert 12) - (when-open basic :offset-assert 16) + (name string :offset-assert 12) + (when-open array :offset-assert 16) (flags game-task-node-flag :offset-assert 20) (parent-node uint16 4 :offset-assert 24) (task-mask task-mask :offset-assert 32) @@ -1323,14 +1330,14 @@ (deftype game-task-info (basic) - ((name basic :offset-assert 4) + ((name string :offset-assert 4) (text-name uint32 :offset-assert 8) (pre-play-node uint16 :offset-assert 12) (kiosk-play-node uint16 :offset-assert 14) - (pre-play-continue basic :offset-assert 16) + (pre-play-continue string :offset-assert 16) (play-node uint16 :offset-assert 20) - (play-continue basic :offset-assert 24) - (kiosk-play-continue basic :offset-assert 28) + (play-continue string :offset-assert 24) + (kiosk-play-continue string :offset-assert 28) ) :method-count-assert 9 :size-assert #x20 diff --git a/goal_src/jak2/engine/geometry/vol-h.gc b/goal_src/jak2/engine/geometry/vol-h.gc index d5b9c04580..a6e17e6136 100644 --- a/goal_src/jak2/engine/geometry/vol-h.gc +++ b/goal_src/jak2/engine/geometry/vol-h.gc @@ -5,11 +5,14 @@ ;; name in dgo: vol-h ;; dgos: ENGINE, GAME +;; +++vol-flags (defenum vol-flags :bitfield #t :type uint32 (display?) + (vol-flags-1) ) +;; ---vol-flags ;; DECOMP BEGINS @@ -27,12 +30,13 @@ :size-assert #x18 :flag-assert #xc00000018 (:methods - (plane-volume-method-9 () none 9) - (plane-volume-method-10 () none 10) - (plane-volume-method-11 () none 11) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume 9) + (debug-draw (_type_) none 10) + (point-in-vol? (_type_ vector float) symbol 11) ) ) + (deftype vol-control (basic) ((flags vol-flags :offset-assert 4) (process process-drawable :offset-assert 8) @@ -48,12 +52,14 @@ :flag-assert #xc0000061c (:methods (new (symbol type process-drawable) _type_ 0) - (vol-control-method-9 (_type_) symbol 9) - (vol-control-method-10 (_type_ vector) symbol 10) + (vol-control-method-9 (_type_) none 9) + (vol-control-method-10 (_type_ plane) symbol 10) (should-display? (_type_) symbol 11) ) ) + +;; WARN: Return type mismatch object vs vol-control. (defmethod new vol-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) (let ((gp-0 (the-as object (object-new allocation type-to-make (the-as int (-> type-to-make size)))))) (when (zero? (the-as vol-control gp-0)) diff --git a/goal_src/jak2/engine/geometry/vol.gc b/goal_src/jak2/engine/geometry/vol.gc index dbe123c5ab..8d97eeeb01 100644 --- a/goal_src/jak2/engine/geometry/vol.gc +++ b/goal_src/jak2/engine/geometry/vol.gc @@ -7,3 +7,352 @@ ;; DECOMP BEGINS +(defun plane-volume-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((f0-1 (vector-dot arg1 arg0)) + (f1-1 (vector-dot arg2 arg0)) + ) + (if (< 0.00001 (fabs f1-1)) + (/ (- (-> arg0 w) f0-1) f1-1) + 409600000.0 + ) + ) + ) + +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +(defmethod plane-volume-method-9 plane-volume ((obj plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) + (local-vars + (sv-144 vector) + (sv-148 number) + (sv-152 int) + (sv-160 vector) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + (sv-224 vector) + (sv-240 int) + (sv-256 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (set! (-> obj volume-type) arg0) + (set! (-> obj point-count) 0) + (set! (-> obj first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> obj normal-count) 0) + (set! (-> obj first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> obj num-planes)) + (set! sv-176 (new 'stack-no-clear 'vector)) + (set! (-> sv-176 quad) (the-as uint128 0)) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! (-> sv-192 quad) (the-as uint128 0)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (set! (-> sv-208 quad) (the-as uint128 0)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! (-> sv-224 quad) (the-as uint128 0)) + 0.0 + 0.0 + 0.0 + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s1-0 (new-stack-vector0)) + (s0-0 0) + (s2-0 (-> obj plane)) + ) + (set! sv-240 0) + (while (< sv-240 (-> obj num-planes)) + (when (!= s3-0 sv-240) + (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) + (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) + (vector-normalize! sv-192 1.0) + (vector-cross! sv-208 sv-192 (the-as vector (-> s2-0 sv-240))) + (vector-normalize! sv-208 1.0) + (let ((f0-4 (plane-volume-intersect-dist (-> s2-0 s3-0) sv-176 sv-208))) + (when (!= f0-4 409600000.0) + (let ((v1-28 sv-224)) + (let ((a0-12 sv-176)) + (.lvf vf2 (&-> sv-208 quad)) + (.lvf vf1 (&-> a0-12 quad)) + ) + (let ((a0-13 f0-4)) + (.mov vf3 a0-13) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-28 quad) vf4) + ) + (set! sv-144 (new-stack-vector0)) + (set! sv-148 0.0) + (set! sv-152 0) + (set! sv-160 (new-stack-vector0)) + (set! (-> sv-144 quad) (-> sv-224 quad)) + (set! sv-256 0) + (while (< sv-256 (-> obj num-planes)) + (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) + (let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) + (cond + ((= f0-6 409600000.0) + ) + ((zero? sv-152) + (let ((v1-42 sv-144)) + (let ((a0-19 sv-144)) + (.lvf vf2 (&-> sv-192 quad)) + (.lvf vf1 (&-> a0-19 quad)) + ) + (let ((a0-20 f0-6)) + (.mov vf3 a0-20) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-42 quad) vf4) + ) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-148 8192000.0) + (set! sv-152 1) + ) + ((begin (vector-float*! sv-224 sv-192 f0-6) (>= (vector-dot sv-224 sv-160) 0.0)) + ) + ((>= (vector-dot sv-224 (the-as vector (-> s2-0 sv-256))) 0.0) + (when (< (fabs f0-6) (fabs (the-as float sv-148))) + (set! sv-148 f0-6) + (set! sv-152 (+ sv-152 1)) + ) + ) + (else + (let ((v1-59 sv-144)) + (let ((a0-28 sv-144) + (a1-15 sv-192) + (f1-8 f0-6) + ) + (.lvf vf2 (&-> a1-15 quad)) + (.lvf vf1 (&-> a0-28 quad)) + (let ((a0-29 f1-8)) + (.mov vf3 a0-29) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-59 quad) vf4) + ) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-152 (+ sv-152 1)) + (if (< (fabs f0-6) (fabs (the-as float sv-148))) + (set! sv-148 (- (the-as float sv-148) f0-6)) + (set! sv-148 0.0) + ) + ) + ) + ) + ) + (set! sv-256 (+ sv-256 1)) + ) + (cond + ((zero? sv-152) + ) + ((= (the-as float sv-148) 0.0) + ) + (else + (dotimes (v1-76 (-> obj num-planes)) + (when (and (!= v1-76 s3-0) (!= v1-76 sv-240)) + (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-76))) (-> s2-0 v1-76 w))) + (goto cfg-42) + ) + ) + ) + (let ((v1-80 sv-224)) + (let ((a0-46 sv-144) + (a1-18 sv-192) + (f0-12 sv-148) + ) + (.lvf vf2 (&-> a1-18 quad)) + (.lvf vf1 (&-> a0-46 quad)) + (let ((a0-47 (the-as float f0-12))) + (.mov vf3 a0-47) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-80 quad) vf4) + ) + (cond + ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume points~%" obj) + ) + (else + (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) + (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) + (+! (-> arg1 length) 2) + (+! (-> obj point-count) 2) + ) + ) + (vector+! s1-0 s1-0 sv-144) + (vector+! s1-0 s1-0 sv-224) + (+! s0-0 2) + ) + ) + ) + ) + ) + (label cfg-42) + (set! sv-240 (+ sv-240 1)) + ) + (when (nonzero? s0-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) + (cond + ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" obj) + ) + (else + (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) + (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) + (+! (-> arg2 length) 2) + (set! (-> obj normal-count) (+ (-> obj normal-count) 2)) + ) + ) + ) + ) + ) + obj + ) + ) + +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw plane-volume ((obj plane-volume)) + (let* ((v1-0 (-> obj volume-type)) + (s5-0 (cond + ((= v1-0 'vol) + (the-as uint #x8000c000) + ) + ((= v1-0 'pvol) + (the-as uint #x80808080) + ) + (else + (the-as uint #x800000c0) + ) + ) + ) + (s4-0 (-> obj first-point)) + ) + (dotimes (s3-0 (/ (-> obj point-count) 2)) + (add-debug-line + #t + (bucket-id bucket-318) + (the-as vector s4-0) + (the-as vector (&-> s4-0 4)) + (the-as rgba s5-0) + #f + (the-as rgba -1) + ) + (set! s4-0 (&-> s4-0 8)) + ) + ) + 0 + (none) + ) + +(defmethod point-in-vol? plane-volume ((obj plane-volume) (arg0 vector) (arg1 float)) + "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" + (dotimes (v1-0 (-> obj num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> obj plane v1-0))) (-> obj plane v1-0 w))) + (return #f) + ) + ) + #t + ) + +;; WARN: Return type mismatch int vs none. +(defmethod vol-control-method-9 vol-control ((obj vol-control)) + (with-pp + (let ((a0-1 obj)) + (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) + (logtest? (-> obj flags) (vol-flags vol-flags-1)) + ) + (when (zero? (-> obj debug-point)) + (let ((s5-0 pp)) + (set! pp (-> obj process)) + (let ((s4-0 0)) + (dotimes (v1-8 (-> obj pos-vol-count)) + (+! s4-0 (-> obj pos-vol v1-8 num-planes)) + ) + (dotimes (v1-11 (-> obj neg-vol-count)) + (+! s4-0 (-> obj neg-vol v1-11 num-planes)) + ) + (set! (-> obj debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> obj debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + ) + (set! pp s5-0) + ) + (set! (-> obj debug-point length) 0) + (set! (-> obj debug-normal length) 0) + (dotimes (s5-1 (-> obj pos-vol-count)) + (plane-volume-method-9 (-> obj pos-vol s5-1) 'vol (-> obj debug-point) (-> obj debug-normal)) + ) + (dotimes (s5-2 (-> obj neg-vol-count)) + (plane-volume-method-9 (-> obj neg-vol s5-2) 'vol (-> obj debug-point) (-> obj debug-normal)) + ) + ) + (dotimes (s5-3 (-> obj pos-vol-count)) + (debug-draw (-> obj pos-vol s5-3)) + ) + (dotimes (s5-4 (-> obj neg-vol-count)) + (debug-draw (-> obj neg-vol s5-4)) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod vol-control-method-10 vol-control ((obj vol-control) (arg0 plane)) + (dotimes (s4-0 (-> obj neg-vol-count)) + (if (point-in-vol? (-> obj neg-vol s4-0) arg0 0.0) + (return #f) + ) + ) + (dotimes (s4-1 (-> obj pos-vol-count)) + (if (point-in-vol? (-> obj pos-vol s4-1) arg0 0.0) + (return #t) + ) + ) + #f + ) + + + + diff --git a/goal_src/jak2/engine/gfx/background/subdivide-h.gc b/goal_src/jak2/engine/gfx/background/subdivide-h.gc index d70c25de6d..c493013000 100644 --- a/goal_src/jak2/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak2/engine/gfx/background/subdivide-h.gc @@ -5,6 +5,13 @@ ;; name in dgo: subdivide-h ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(declare-type subdivide-settings basic) +(define-extern *subdivide-settings* subdivide-settings) +(define-extern *stat-string-tfrag* string) +(define-extern *stat-string-tfrag-scissor* string) +(define-extern *stat-string-total* string) + ;; DECOMP BEGINS (deftype subdivide-settings (basic) diff --git a/goal_src/jak2/engine/gfx/font-h.gc b/goal_src/jak2/engine/gfx/font-h.gc index d1914eaa00..151b076b3e 100644 --- a/goal_src/jak2/engine/gfx/font-h.gc +++ b/goal_src/jak2/engine/gfx/font-h.gc @@ -9,14 +9,51 @@ ;; TODO: figure out what's weird with set-font-color ;; The font system draws all of the strings. +;; +++font-color (defenum font-color :type uint32 - (default 0) - (one 1) - (orange-red 3) - (fc-5 5) - (fc-6 6) + (default-#cddbcd 0) + (#dadada 1) + (#ededed 2) + (precursor-#ec3b00 3) + (gold-#ba9200 4) + (yellow-#f3f300 5) + (green-#3df23d 6) + (blue-#003cf1 7) + (cyan-#00fefe 8) + (magenta-#f87df8 9) + (#a0d5d5 10) + (#7cbaba 11) + (white-#ffffff 12) + (#959595 13) + (#f9a400 14) + (#daf95e 15) + (#8aa81f 16) + (#a6b5a6 17) + (#757f75 18) + (#5e3f5e 19) + (#f0e387 20) + (#3fbaed 21) + (#3a3a3a 22) + (#5c5c5c 23) + (#f298c8 24) + (#f46868 25) + (#20ca98 26) + (#8289de 27) + (#a8f3f6 28) + (#fef666 29) + (#f1f104 30) + (#8ed0f4 31) + (#7efbfb 32) + (#7ffcfc 33) + (#f9f9f9 34) + (#408080 35) + (#e0f0e0 36) + (#c00000 37) + (#ffc040 38) + (#000000 39) ) +;; ---font-color ;; copied from jak1, not completely confirmed. (defenum font-flags diff --git a/goal_src/jak2/engine/gfx/font.gc b/goal_src/jak2/engine/gfx/font.gc index 48d22db75e..d8fa0d00e0 100644 --- a/goal_src/jak2/engine/gfx/font.gc +++ b/goal_src/jak2/engine/gfx/font.gc @@ -5,11 +5,13 @@ ;; name in dgo: font ;; dgos: ENGINE, GAME +(def-mips2c draw-string-asm (function string dma-buffer font-context uint)) +(def-mips2c draw-string (function string dma-buffer font-context draw-string-result)) +(def-mips2c get-string-length (function string font-context draw-string-result)) + ;; DECOMP BEGINS - -;; definition for function gen-font-12 -;; INFO: Return type mismatch object vs none. +;; WARN: Return type mismatch object vs none. (defun gen-font-12 ((arg0 string)) (format #t "(define ~s~%" arg0) (format #t " (new 'static 'inline-array 'vector 0~%") @@ -142,28 +144,19 @@ (none) ) -;; definition for function draw-string-asm ;; ERROR: function was not converted to expressions. Cannot decompile. -;; definition for function draw-string ;; ERROR: function was not converted to expressions. Cannot decompile. -;; definition for function get-string-length ;; ERROR: function was not converted to expressions. Cannot decompile. -(def-mips2c draw-string-asm (function string dma-buffer font-context uint)) -(def-mips2c draw-string (function string dma-buffer font-context draw-string-result)) -(def-mips2c get-string-length (function string font-context float)) - -;; definition for function draw-string-xy (defun draw-string-xy ((arg0 string) (arg1 dma-buffer) (arg2 int) (arg3 int) (arg4 font-color) (arg5 font-flags)) (let ((a2-2 (new 'stack 'font-context *font-default-matrix* arg2 arg3 0.0 arg4 arg5))) (draw-string arg0 arg1 a2-2) ) ) -;; definition for function draw-string-adv -;; INFO: Return type mismatch float vs none. +;; WARN: Return type mismatch float vs none. (defun draw-string-adv ((arg0 string) (arg1 dma-buffer) (arg2 font-context)) (let ((v1-0 (draw-string arg0 arg1 arg2))) (+! (-> arg2 origin x) (-> v1-0 length)) @@ -174,3 +167,4 @@ + diff --git a/goal_src/jak2/engine/gfx/generic/generic-h.gc b/goal_src/jak2/engine/gfx/generic/generic-h.gc index 4fd59e8f87..a0ff630474 100644 --- a/goal_src/jak2/engine/gfx/generic/generic-h.gc +++ b/goal_src/jak2/engine/gfx/generic/generic-h.gc @@ -5,6 +5,10 @@ ;; name in dgo: generic-h ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(declare-type generic-consts structure) +(define-extern *generic-consts* generic-consts) + ;; DECOMP BEGINS (deftype gsf-vertex (structure) diff --git a/goal_src/jak2/engine/gfx/hw/display.gc b/goal_src/jak2/engine/gfx/hw/display.gc index 9d691d5455..f1581fe4e1 100644 --- a/goal_src/jak2/engine/gfx/hw/display.gc +++ b/goal_src/jak2/engine/gfx/hw/display.gc @@ -80,7 +80,7 @@ ) (define *font-context* - (new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) + (new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color default-#cddbcd) (font-flags shadow kerning)) ) (defun draw-sprite2d-xy ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) diff --git a/goal_src/jak2/engine/gfx/merc/merc-h.gc b/goal_src/jak2/engine/gfx/merc/merc-h.gc index 7f5be33299..1686b1a1ba 100644 --- a/goal_src/jak2/engine/gfx/merc/merc-h.gc +++ b/goal_src/jak2/engine/gfx/merc/merc-h.gc @@ -5,6 +5,9 @@ ;; name in dgo: merc-h ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(define-extern merc-stats (function none)) + ;; DECOMP BEGINS (deftype ripple-merc-query (inline-array-class) diff --git a/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc b/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc index c175963baa..63987d3868 100644 --- a/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc +++ b/goal_src/jak2/engine/gfx/mood/time-of-day-h.gc @@ -27,6 +27,11 @@ ;; NOTE - for mood-funcs (define-extern set-filter-color! (function float float float none)) +;; NOTE - for default-menu +(declare-type time-of-day-proc process) +(define-extern *time-of-day* (pointer time-of-day-proc)) +(define-extern time-of-day-setup (function symbol symbol)) + ;; DECOMP BEGINS (deftype palette-fade-control (structure) diff --git a/goal_src/jak2/engine/gfx/texture/texture-h.gc b/goal_src/jak2/engine/gfx/texture/texture-h.gc index bddd09b3e3..ad93c8a5c8 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-h.gc @@ -24,6 +24,12 @@ (define-extern adgif-shader<-texture-simple! (function adgif-shader texture adgif-shader)) (define-extern lookup-texture-by-id-fast (function texture-id texture)) +;; NOTE - for default-menu +(define-extern *edit-shader* texture-id) +(define-extern adgif-shader-update! (function adgif-shader texture none)) +(declare-type texture-page-dir basic) +(define-extern texture-page-dir-inspect (function texture-page-dir symbol none)) + ;; DECOMP BEGINS (deftype texture-id (uint32) diff --git a/goal_src/jak2/engine/gfx/vu1-user-h.gc b/goal_src/jak2/engine/gfx/vu1-user-h.gc index f2a665183d..52a7aed9fc 100644 --- a/goal_src/jak2/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak2/engine/gfx/vu1-user-h.gc @@ -363,7 +363,7 @@ (bucket-323 323) ;; hud (bucket-324 324) ;; debug (debug-no-zbuf 325) ;; debug - ;; (bucket-326 326) ;; debug + (debug-unknown-326 326) ;; debug ) (defenum vu1-renderer-mask diff --git a/goal_src/jak2/engine/nav/nav-control-h.gc b/goal_src/jak2/engine/nav/nav-control-h.gc index 07ee2a1041..f53cab45fc 100644 --- a/goal_src/jak2/engine/nav/nav-control-h.gc +++ b/goal_src/jak2/engine/nav/nav-control-h.gc @@ -169,7 +169,7 @@ (callback-info nav-callback-info :offset-assert 4) (process process :offset-assert 8) (pad0 uint32 :offset-assert 12) - (shape basic :offset-assert 16) + (shape collide-shape :offset-assert 16) (nearest-y-threshold meters :offset-assert 20) (nav-cull-radius meters :offset-assert 24) (sec-per-frame float :offset-assert 28) @@ -184,8 +184,8 @@ (sphere-mask uint8 :offset-assert 61) (pad1 uint8 2 :offset-assert 62) (sphere-id-array uint8 16 :offset-assert 64) - (extra-nav-sphere vector :inline :offset-assert 80) - (root-nav-sphere vector :inline :offset-assert 96) + (extra-nav-sphere sphere :inline :offset-assert 80) + (root-nav-sphere sphere :inline :offset-assert 96) (state nav-state :inline :offset-assert 112) ) :method-count-assert 47 @@ -193,43 +193,43 @@ :flag-assert #x2f00000120 (:methods (nav-control-method-9 () none 9) - (nav-control-method-10 () none 10) + (point-in-bounds? (_type_ vector) symbol 10) (nav-control-method-11 (_type_ vector) vector 11) (nav-control-method-12 () none 12) - (nav-control-method-13 () none 13) - (nav-control-method-14 () none 14) - (nav-control-method-15 () none 15) - (nav-control-method-16 () none 16) - (nav-control-method-17 () none 17) + (find-poly (_type_ vector) nav-poly 13) + (nav-control-method-14 (_type_ nav-poly vector object vector) none 14) + (nav-control-method-15 (_type_ vector) none 15) + (nav-control-method-16 (_type_ vector float) symbol 16) + (is-in-mesh? (_type_ vector float) symbol 17) (nav-control-method-18 () none 18) (nav-control-method-19 () none 19) (nav-control-method-20 (_type_ vector vector vector int symbol symbol) none 20) (nav-control-method-21 () none 21) (nav-control-method-22 () none 22) - (nav-control-method-23 () none 23) + (nav-control-method-23 (_type_) none 23) (nav-control-method-24 () none 24) - (nav-control-method-25 () none 25) - (nav-control-method-26 () none 26) - (nav-control-method-27 () none 27) - (nav-control-method-28 () none 28) - (nav-control-method-29 () none 29) - (nav-control-method-30 () none 30) - (nav-control-method-31 () none 31) - (nav-control-method-32 () none 32) - (nav-control-method-33 () none 33) - (nav-control-method-34 () none 34) - (nav-control-method-35 () none 35) - (nav-control-method-36 () none 36) - (nav-control-method-37 () none 37) - (nav-control-method-38 () none 38) - (nav-control-method-39 () none 39) - (nav-control-method-40 () none 40) - (nav-control-method-41 () none 41) - (nav-control-method-42 () none 42) - (nav-control-method-43 () none 43) + (get-max-rotation-rate (_type_) float 25) + (get-sphere-mask (_type_) none 26) + (get-target-speed (_type_) meters 27) + (nav-control-method-28 (_type_) none 28) + (nav-control-method-29 (_type_) none 29) + (copy-extra-nav-sphere! (_type_ sphere) none 30) + (set-extra-nav-sphere! (_type_ sphere) none 31) + (set-extra-nav-sphere-radius! (_type_ float) none 32) + (set-nearest-y-thres! (_type_ float) none 33) + (set-nav-cull-radius! (_type_ meters) none 34) + (set-speed-scale! (_type_ float) none 35) + (set-target-speed! (_type_ meters) none 36) + (set-acceleration! (_type_ meters) none 37) + (set-turning-acceleration! (_type_ meters) none 38) + (set-max-rotation-rate! (_type_ float) none 39) + (set-sphere-mask! (_type_ uint) none 40) + (nav-control-method-41 (_type_) none 41) + (init! (_type_ collide-shape) none 42) + (display-marks? (_type_) symbol 43) (nav-control-method-44 () none 44) - (nav-control-method-45 () none 45) - (nav-control-method-46 () none 46) + (nav-control-method-45 (_type_ vector vector vector) sphere 45) + (find-sphere (_type_) none 46) ) ) diff --git a/goal_src/jak2/engine/nav/nav-mesh-h.gc b/goal_src/jak2/engine/nav/nav-mesh-h.gc index 776f7baead..58ffd5e4d4 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -11,6 +11,9 @@ (dummy 0) ) +(declare-type grid-hash basic) +(declare-type sphere-hash grid-hash) + ;; DECOMP BEGINS (deftype nav-mesh-work-debug (structure) @@ -33,6 +36,7 @@ :flag-assert #x9000001c0 ) + (deftype nav-mesh-work (structure) ((vert0-table int8 4 :offset-assert 0) (vert1-table int8 4 :offset-assert 4) @@ -47,10 +51,10 @@ (work-struct-in-scratch int8 :offset-assert 292) (mesh-struct-in-scratch int8 :offset-assert 293) (polys-in-scratch int8 :offset-assert 294) - (mesh basic :offset-assert 296) + (mesh nav-mesh :offset-assert 296) (nav basic :offset-assert 300) - (poly0 basic :offset-assert 304) - (poly1 basic :offset-assert 308) + (poly0 nav-poly :offset-assert 304) + (poly1 nav-poly :offset-assert 308) (poly-id int32 :offset-assert 312) ) :method-count-assert 9 @@ -58,6 +62,7 @@ :flag-assert #x90000013c ) + (deftype nav-mesh-link (structure) ((id uint32 :offset-assert 0) (dest-mesh-id uint32 :offset-assert 4) @@ -72,6 +77,7 @@ :flag-assert #x900000010 ) + (deftype nav-poly (structure) ((data uint8 64 :offset-assert 0) (vertex vector 4 :inline :offset 0) @@ -96,13 +102,17 @@ :flag-assert #x900000040 ) + (deftype nav-vertex (vector) + "A typedef for `vector`, not used because our code looks nicer if everything is `vector`s anyway + and declared out of order (cannot use forward declared structures in inline arrays)" () :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) + (deftype nav-sphere (structure) ((trans sphere :inline :offset-assert 0) ) @@ -111,6 +121,7 @@ :flag-assert #x900000010 ) + (deftype nav-ray (structure) ((current-pos vector :inline :offset-assert 0) (dir vector :inline :offset-assert 16) @@ -130,6 +141,7 @@ :flag-assert #x900000050 ) + (deftype nav-route-portal (structure) ((vertex nav-vertex 2 :inline :offset-assert 0) (next-poly nav-poly :offset-assert 32) @@ -140,6 +152,7 @@ :flag-assert #x900000025 ) + (deftype nav-find-poly-parms (structure) ((point vector :inline :offset-assert 0) (y-threshold float :offset-assert 16) @@ -153,6 +166,7 @@ :flag-assert #x900000024 ) + (deftype clamp-travel-vector-to-mesh-return-info (structure) ((found-boundary basic :offset-assert 0) (intersection vector :inline :offset-assert 16) @@ -173,77 +187,79 @@ :flag-assert #x9000000a0 ) + (deftype nav-mesh (basic) - ((work nav-mesh-work :offset-assert 4) - (poly-array (inline-array nav-poly) :offset-assert 8) - (static-sphere-count uint8 :offset-assert 12) - (poly-count uint8 :offset-assert 13) - (nav-control-count uint8 :offset-assert 14) - (max-nav-control-count uint8 :offset-assert 15) - (route uint32 :offset-assert 16) - (poly-hash basic :offset-assert 20) - (nav-control-array uint32 :offset-assert 24) - (sphere-hash basic :offset-assert 28) - (static-sphere uint32 :offset-assert 32) - (user-list basic :offset-assert 36) - (next-nav-mesh basic :offset-assert 40) - (prev-nav-mesh basic :offset-assert 44) - (bounds sphere :inline :offset-assert 48) - (origin vector :inline :offset 48) - (entity entity :offset-assert 64) - (link-array uint32 :offset-assert 68) - (link-count uint8 :offset-assert 72) - (flags nav-mesh-flag :offset-assert 73) - (pad1 uint8 2 :offset-assert 74) - (nearest-y-threshold meters :offset-assert 76) - (water-max-height meters :offset-assert 80) - (pad2 uint32 7 :offset-assert 84) + ((work nav-mesh-work :offset-assert 4) + (poly-array (inline-array nav-poly) :offset-assert 8) + (static-sphere-count uint8 :offset-assert 12) + (poly-count uint8 :offset-assert 13) + (nav-control-count uint8 :offset-assert 14) + (max-nav-control-count uint8 :offset-assert 15) + (route uint32 :offset-assert 16) + (poly-hash grid-hash :offset-assert 20) + (nav-control-array (inline-array nav-control) :offset-assert 24) + (sphere-hash sphere-hash :offset-assert 28) + (static-sphere (inline-array sphere) :offset-assert 32) + (user-list engine :offset-assert 36) + (next-nav-mesh surface :offset-assert 40) + (prev-nav-mesh surface :offset-assert 44) + (bounds sphere :inline :offset-assert 48) + (origin vector :inline :offset 48) + (entity entity :offset-assert 64) + (link-array (array nav-mesh-link) :offset-assert 68) + (link-count uint8 :offset-assert 72) + (flags nav-mesh-flag :offset-assert 73) + (pad1 uint8 2 :offset-assert 74) + (nearest-y-threshold meters :offset-assert 76) + (water-max-height meters :offset-assert 80) + (pad2 uint32 7 :offset-assert 84) ) :method-count-assert 47 :size-assert #x70 :flag-assert #x2f00000070 (:methods - (nav-mesh-method-9 () none 9) - (nav-mesh-method-10 () none 10) - (nav-mesh-method-11 () none 11) - (nav-mesh-method-12 () none 12) - (nav-mesh-method-13 () none 13) - (nav-mesh-method-14 () none 14) - (nav-mesh-method-15 () none 15) + (nav-mesh-method-9 (_type_) none 9) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) + (nav-mesh-method-11 (_type_ nav-poly vector) vector 11) + (nav-mesh-method-12 (_type_ nav-poly vector) none 12) + (nav-mesh-method-13 (_type_ symbol symbol) none 13) + (get-route-portal (_type_ object object nav-find-poly-parms) none 14) + (initialize-mesh! (_type_) none 15) (move-along-nav-ray! (_type_ nav-ray) none 16) - (nav-mesh-method-17 () none 17) + (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) (nav-mesh-method-18 () none 18) (nav-mesh-method-19 () none 19) (nav-mesh-method-20 () none 20) (nav-mesh-method-21 () none 21) - (nav-mesh-method-22 () none 22) - (nav-mesh-method-23 () none 23) - (nav-mesh-method-24 () none 24) - (nav-mesh-method-25 () none 25) - (nav-mesh-method-26 () none 26) - (nav-mesh-method-27 () none 27) - (nav-mesh-method-28 () none 28) - (nav-mesh-method-29 () none 29) - (nav-mesh-method-30 () none 30) - (nav-mesh-method-31 () none 31) - (nav-mesh-method-32 () none 32) - (nav-mesh-method-33 () none 33) - (nav-mesh-method-34 () none 34) + (nav-mesh-method-22 (_type_ vector vector) none 22) + (nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) + (nav-mesh-method-24 (_type_) none 24) + (nav-mesh-method-25 (_type_) none 25) + (nav-mesh-method-26 (_type_) none 26) + (new-nav-control (_type_ vector int) nav-control 27) + (nav-mesh-method-28 (_type_ object) none 28) + (nav-mesh-method-29 (_type_ object symbol) nav-control 29) + (nav-mesh-method-30 (_type_ process-drawable) none 30) + (change-to (_type_ process-drawable) none 31) + (nav-mesh-method-32 (_type_ uint32) none 32) + (nav-mesh-method-33 (_type_ uint32) symbol 33) + (nav-mesh-method-34 (_type_ object vector float) none 34) (nav-mesh-method-35 () none 35) - (nav-mesh-method-36 () none 36) + (nav-mesh-method-36 (_type_ nav-poly rgba) none 36) (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 () none 38) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector object) vector 38) (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (nav-mesh-method-40 () none 40) + (nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40) (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (nav-mesh-method-42 () none 42) - (nav-mesh-method-43 () none 43) - (nav-mesh-method-44 () none 44) - (nav-mesh-method-45 () none 45) - (nav-mesh-method-46 () none 46) + (nav-mesh-method-42 (_type_ nav-find-poly-parms) symbol 42) + (nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43) + (nav-mesh-method-44 (_type_ vector float float) symbol 44) + (nav-mesh-method-45 (_type_ entity-perm) none 45) + (nav-mesh-method-46 (_type_ object) none 46) ) ) + (defun vector-normalize-unity! ((arg0 vector)) (rlet ((acc :class vf) (Q :class vf) @@ -313,6 +329,7 @@ #f ) +;; WARN: Return type mismatch int vs none. (defun init-ray ((arg0 nav-ray)) (rlet ((acc :class vf) (Q :class vf) @@ -357,8 +374,6 @@ ) (defun point-poly-intersection? ((arg0 nav-mesh) (arg1 vector) (arg2 int) (arg3 (inline-array vector))) - "Helper for point in poly... - Uses the vertex table of the nav-mesh, but user supplied vectors." (let ((v1-1 (-> arg0 work vert0-table)) (a0-2 (-> arg0 work vert1-table)) ) @@ -381,11 +396,10 @@ ) (defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) - "Is the point in the poly?" (let* ((a3-0 obj) (v1-0 arg1) (a0-1 (-> arg0 vertex-count)) - (a1-1 (-> arg0 vertex)) + (a1-1 (the-as (inline-array vector) (-> arg0 vertex0))) (a2-2 (-> a3-0 work vert0-table)) (a3-2 (-> a3-0 work vert1-table)) ) @@ -407,8 +421,12 @@ #t ) +;; 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 +;; WARN: Return type mismatch vector vs none. (defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) - "Set arg1 to the closest point to arg2 that's on the boundary of arg0." (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (set! sv-48 (new 'stack-no-clear 'vector)) (set! sv-52 (new 'stack-no-clear 'vector)) @@ -430,10 +448,12 @@ (none) ) +;; 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 +;; WARN: Return type mismatch vector vs none. (defmethod project-point-into-poly-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) - "Project into polygon. If it's not in the polygon, sets y to the height of the edge. - If it's in the polygon (in the xz plane), the output uses y from the input. - As a result, this doesn't make too much sense for 3d stuff." (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) (cond ((point-in-poly? obj arg0 arg2) @@ -464,9 +484,56 @@ (none) ) +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 60 signed mismatch +;; WARN: Stack slot offset 64 signed mismatch +;; WARN: Stack slot offset 44 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Return type mismatch int vs none. (defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (ray nav-ray)) - "Advance the ray into the next polygon. - update the ray's status as needed." (local-vars (next-poly-idx int) (work nav-mesh-work) @@ -495,16 +562,16 @@ (set! adj-vtx-1 (-> current-poly vertex (-> v1-table i))) (set! adj-edge-dz (- (-> adj-vtx-0 z) (-> adj-vtx-1 z))) (set! adj-edge-minus-dx (- (-> adj-vtx-1 x) (-> adj-vtx-0 x))) - (let ((f0-10 (+ (* delta-x adj-edge-dz) (* delta-z adj-edge-minus-dx)))) - (when (< 0.0 f0-10) + (let ((heading-dot (+ (* delta-x adj-edge-dz) (* delta-z adj-edge-minus-dx)))) + (when (< 0.0 heading-dot) (let ((f1-10 (+ (* adj-edge-dz (- (-> adj-vtx-0 x) (-> ray current-pos x))) (* adj-edge-minus-dx (- (-> adj-vtx-0 z) (-> ray current-pos z))) ) ) ) - (when (< f1-10 f0-10) + (when (< f1-10 heading-dot) (set! next-poly-idx i) - (let ((f0-12 (fmax 0.0 (/ f1-10 f0-10)))) + (let ((f0-12 (fmax 0.0 (/ f1-10 heading-dot)))) (set! delta-x (* delta-x f0-12)) (set! delta-z (* delta-z f0-12)) ) @@ -529,7 +596,7 @@ (+! (-> ray current-pos z) delta-z) (set! sv-68 (-> current-poly adj-poly next-poly-idx)) (if (!= sv-68 255) - (set! (-> ray next-poly) (-> obj poly-array sv-68)) + (set! (-> ray next-poly) (the-as nav-poly (-> obj poly-array sv-68 vertex0))) ) (cond ((and (-> ray next-poly) (zero? (logand (-> ray next-poly pat) (-> ray ignore)))) @@ -550,6 +617,7 @@ (none) ) +;; WARN: Return type mismatch int vs none. (defun-debug nav-sphere-from-cam () (let ((v1-0 (camera-pos))) (format #t "SPHEREM(~4,,1M, ~4,,1M, ~4,,1M, 1.0)~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) diff --git a/goal_src/jak2/engine/ps2/memcard-h.gc b/goal_src/jak2/engine/ps2/memcard-h.gc index e36786e07d..2a283c4f23 100644 --- a/goal_src/jak2/engine/ps2/memcard-h.gc +++ b/goal_src/jak2/engine/ps2/memcard-h.gc @@ -106,7 +106,7 @@ ) ) ) - (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color orange-red) (font-flags shadow)) + (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color precursor-#ec3b00) (font-flags shadow)) ) ) 0 diff --git a/goal_src/jak2/engine/scene/scene-h.gc b/goal_src/jak2/engine/scene/scene-h.gc index 2bfeb7f911..25b7b5a55c 100644 --- a/goal_src/jak2/engine/scene/scene-h.gc +++ b/goal_src/jak2/engine/scene/scene-h.gc @@ -5,6 +5,10 @@ ;; name in dgo: scene-h ;; dgos: ENGINE, GAME +;; NOTE - for default-menu +(declare-type scene-player process-drawable) +(define-extern scene-player-init (function string symbol object none :behavior scene-player)) + ;; DECOMP BEGINS (deftype scene-actor (basic) diff --git a/goal_src/jak2/engine/sound/gsound.gc b/goal_src/jak2/engine/sound/gsound.gc index 19862645f7..caf3c54b50 100644 --- a/goal_src/jak2/engine/sound/gsound.gc +++ b/goal_src/jak2/engine/sound/gsound.gc @@ -844,7 +844,7 @@ arg0 (+ (* s5-0 16) 16) 48 - (font-color default) + (font-color default-#cddbcd) (font-flags shadow) ) ) @@ -857,7 +857,7 @@ arg0 (+ (* s5-1 16) 16) 64 - (font-color default) + (font-color default-#cddbcd) (font-flags shadow) ) ) @@ -869,7 +869,7 @@ (-> *level* sound-bank 1) (-> *level* sound-bank 2) ) - (s5-2 *temp-string* arg0 16 88 (font-color default) (font-flags shadow)) + (s5-2 *temp-string* arg0 16 88 (font-color default-#cddbcd) (font-flags shadow)) ) (let ((s5-3 draw-string-xy)) (format @@ -882,7 +882,7 @@ (-> *setting-control* user-current sound-excitement) (-> *setting-control* user-current mode-sound-bank) ) - (s5-3 *temp-string* arg0 16 104 (font-color default) (font-flags shadow)) + (s5-3 *temp-string* arg0 16 104 (font-color default-#cddbcd) (font-flags shadow)) ) 0 ) @@ -895,7 +895,7 @@ (-> *sound-iop-info* freemem) (shr (-> *sound-iop-info* freemem) 10) ) - (s5-0 *temp-string* arg0 32 96 (font-color default) (font-flags shadow)) + (s5-0 *temp-string* arg0 32 96 (font-color default-#cddbcd) (font-flags shadow)) ) (let ((s5-1 draw-string-xy)) (format @@ -904,7 +904,7 @@ (-> *sound-iop-info* freemem2) (shr (-> *sound-iop-info* freemem2) 10) ) - (s5-1 *temp-string* arg0 32 64 (font-color default) (font-flags shadow)) + (s5-1 *temp-string* arg0 32 64 (font-color default-#cddbcd) (font-flags shadow)) ) 0 ) diff --git a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc index 700d512c01..4b58a6165c 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc @@ -24,6 +24,7 @@ :flag-assert #x900000006 ) + (deftype grid-hash (basic) ((work basic :offset-assert 4) (search-box grid-hash-box :inline :offset-assert 8) @@ -66,6 +67,7 @@ ) ) + (deftype find-nav-sphere-ids-params (structure) ((bsphere sphere :inline :offset-assert 0) (y-threshold float :offset-assert 16) @@ -79,12 +81,13 @@ :flag-assert #x900000020 ) + (deftype sphere-hash (grid-hash) - ((sphere-array uint32 :offset-assert 88) - (max-object-count int16 :offset-assert 92) - (pad int16 :offset-assert 94) - (mem-sphere-array uint32 :offset-assert 96) - (spr-sphere-array uint32 :offset-assert 100) + ((sphere-array (inline-array sphere) :offset-assert 88) + (max-object-count int16 :offset-assert 92) + (pad int16 :offset-assert 94) + (mem-sphere-array uint32 :offset-assert 96) + (spr-sphere-array uint32 :offset-assert 100) ) :method-count-assert 34 :size-assert #x68 @@ -95,13 +98,14 @@ (sphere-hash-method-27 () none 27) (sphere-hash-method-28 () none 28) (sphere-hash-method-29 () none 29) - (sphere-hash-method-30 () none 30) + (sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30) (sphere-hash-method-31 () none 31) (sphere-hash-method-32 () none 32) (sphere-hash-method-33 () none 33) ) ) + (deftype hash-object-info (structure) ((object basic :offset-assert 0) ) @@ -110,6 +114,7 @@ :flag-assert #x900000004 ) + (deftype spatial-hash (sphere-hash) ((object-array uint32 :offset-assert 104) (mem-object-array uint32 :offset-assert 108) @@ -128,3 +133,10 @@ (spatial-hash-method-40 () none 40) ) ) + + +0 + + + + diff --git a/goal_src/jak2/engine/util/profile.gc b/goal_src/jak2/engine/util/profile.gc index 77d477a886..9dc405d13a 100644 --- a/goal_src/jak2/engine/util/profile.gc +++ b/goal_src/jak2/engine/util/profile.gc @@ -689,8 +689,8 @@ 488 arg1 (if (>= f30-0 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -705,8 +705,8 @@ 488 arg1 (if (>= f30-0 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -740,8 +740,8 @@ 488 arg1 (if (>= f30-1 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -756,8 +756,8 @@ 488 arg1 (if (>= f30-1 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -859,4 +859,4 @@ ,@body (end-profiler) ) - ) \ No newline at end of file + ) diff --git a/goal_src/jak2/engine/util/script-h.gc b/goal_src/jak2/engine/util/script-h.gc index 11c7a89305..9f51ccdf33 100644 --- a/goal_src/jak2/engine/util/script-h.gc +++ b/goal_src/jak2/engine/util/script-h.gc @@ -12,6 +12,10 @@ (define-extern *syntax-context* script-context) (define-extern *script-context* script-context) +;; NOTE - for menu +(define-extern command-get-int (function object int int)) +(define-extern command-get-float (function object float float)) + ;; DECOMP BEGINS (deftype script-form (structure) diff --git a/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc new file mode 100644 index 0000000000..88aeb3c12f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/cam-layout_REF.gc @@ -0,0 +1,3766 @@ +;;-*-Lisp-*- +(in-package goal) + +;; 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) + (intro-t float :offset-assert 12) + (intro-step float :offset-assert 16) + (debug-t float :offset-assert 20) + (debug-step float :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type cam-layout-bank +(defmethod inspect cam-layout-bank ((obj cam-layout-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tspline-t: ~f~%" (-> obj spline-t)) + (format #t "~1Tspline-step: ~f~%" (-> obj spline-step)) + (format #t "~1Tintro-t: ~f~%" (-> obj intro-t)) + (format #t "~1Tintro-step: ~f~%" (-> obj intro-step)) + (format #t "~1Tdebug-t: ~f~%" (-> obj debug-t)) + (format #t "~1Tdebug-step: ~f~%" (-> obj debug-step)) + (label cfg-4) + obj + ) + +;; 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 + :intro-t 0.01 + :intro-step 0.0016666667 + :debug-t 0.01 + :debug-step 0.0033333334 + ) + ) + +;; 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 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type clm-basic +(defmethod inspect clm-basic ((obj clm-basic)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (label cfg-4) + obj + ) + +;; definition of type clm-item-action +(deftype clm-item-action (structure) + ((button uint64 :offset-assert 0) + (options uint64 :offset-assert 8) + (func symbol :offset-assert 16) + (parm0 int32 :offset 20) + (parm0-symbol symbol :offset 20) + (parm0-basic basic :offset 20) + (parm1 symbol :offset 24) + (parm1-basic basic :offset 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type clm-item-action +(defmethod inspect clm-item-action ((obj clm-item-action)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'clm-item-action) + (format #t "~1Tbutton: ~D~%" (-> obj button)) + (format #t "~1Toptions: ~D~%" (-> obj options)) + (format #t "~1Tfunc: ~A~%" (-> obj func)) + (format #t "~1Tparm0: ~A~%" (-> obj parm0)) + (format #t "~1Tparm1: ~A~%" (-> obj parm1)) + (label cfg-4) + obj + ) + +;; definition of type clm-item +(deftype clm-item (clm-basic) + ((description string :offset-assert 4) + (button-symbol symbol :offset-assert 8) + (action clm-item-action :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type clm-item +(defmethod inspect clm-item ((obj clm-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdescription: ~A~%" (-> obj description)) + (format #t "~1Tbutton-symbol: ~A~%" (-> obj button-symbol)) + (format #t "~1Taction: #~%" (-> obj action)) + (label cfg-4) + obj + ) + +;; definition of type clm-list-item +(deftype clm-list-item (basic) + ((description string :offset-assert 4) + (track-val symbol :offset-assert 8) + (val-func symbol :offset-assert 12) + (val-parm0 int32 :offset 16) + (val-parm0-symbol symbol :offset 16) + (val-parm0-basic basic :offset 16) + (val-parm1 symbol :offset 20) + (val-parm1-basic basic :offset 20) + (actions (array clm-item-action) :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type clm-list-item +(defmethod inspect clm-list-item ((obj clm-list-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdescription: ~A~%" (-> obj description)) + (format #t "~1Ttrack-val: ~A~%" (-> obj track-val)) + (format #t "~1Tval-func: ~A~%" (-> obj val-func)) + (format #t "~1Tval-parm0: ~A~%" (-> obj val-parm0)) + (format #t "~1Tval-parm1: ~A~%" (-> obj val-parm1)) + (format #t "~1Tactions: ~A~%" (-> obj actions)) + (label cfg-4) + obj + ) + +;; definition of type clm-list +(deftype clm-list (clm-basic) + ((tracker symbol :offset-assert 4) + (cur-list-item int32 :offset-assert 8) + (items (array clm-list-item) :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type clm-list +(defmethod inspect clm-list ((obj clm-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttracker: ~A~%" (-> obj tracker)) + (format #t "~1Tcur-list-item: ~D~%" (-> obj cur-list-item)) + (format #t "~1Titems: ~A~%" (-> obj items)) + (label cfg-4) + obj + ) + +;; definition of type clm +(deftype clm (basic) + ((title string :offset-assert 4) + (items (array clm-basic) :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type clm +(defmethod inspect clm ((obj clm)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttitle: ~A~%" (-> obj title)) + (format #t "~1Titems: ~A~%" (-> obj items)) + (label cfg-4) + obj + ) + +;; 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) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type volume-descriptor-array +(defmethod inspect volume-descriptor-array ((obj volume-descriptor-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; 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) + (cur-entity int32 :offset-assert 136) + (num-volumes int32 :offset-assert 140) + (cur-volume int32 :offset-assert 144) + (first-pvol int32 :offset-assert 148) + (first-cutoutvol int32 :offset-assert 152) + (res-key float :offset-assert 156) + ) + :heap-base #x200 + :method-count-assert 14 + :size-assert #xa0 + :flag-assert #xe020000a0 + (:states + cam-layout-active + ) + ) + +;; definition for method 3 of type cam-layout +(defmethod inspect cam-layout ((obj cam-layout)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tcam-entity: ~A~%" (-> obj cam-entity)) + (format #t "~2Tnum-entities: ~D~%" (-> obj num-entities)) + (format #t "~2Tcur-entity: ~D~%" (-> obj cur-entity)) + (format #t "~2Tnum-volumes: ~D~%" (-> obj num-volumes)) + (format #t "~2Tcur-volume: ~D~%" (-> obj cur-volume)) + (format #t "~2Tfirst-pvol: ~D~%" (-> obj first-pvol)) + (format #t "~2Tfirst-cutoutvol: ~D~%" (-> obj first-cutoutvol)) + (format #t "~2Tres-key: ~f~%" (-> obj res-key)) + (label cfg-4) + obj + ) + +;; definition for function cam-layout-print +(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)) + ) + (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 bucket-324) + 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)) + ) + (if (< 0.00001 (fabs f1-1)) + (/ (- (-> arg0 w) f0-1) f1-1) + 409600000.0 + ) + ) + ) + +;; 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 + (sv-16 res-tag) + (sv-160 vector) + (sv-164 number) + (sv-168 int) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + (sv-224 vector) + (sv-240 vector) + (sv-256 int) + (sv-272 int) + (sv-288 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 0)) + (until #f + (set! sv-16 (new 'static 'res-tag)) + (let ((s3-0 (the-as (inline-array vector) ((method-of-type res-lump get-property-data) + arg0 + arg1 + 'exact + (the float s4-0) + (the-as pointer #f) + (& sv-16) + *res-static-buf* + ) + ) + ) + ) + (cond + (s3-0 + (when (>= *volume-descriptor-current* 100) + (format 0 "ERROR : camera editing out of volume descriptors~%") + (return #f) + ) + (let ((s2-0 (-> *volume-descriptor* pos-vol *volume-descriptor-current*))) + (set! (-> s2-0 volume-type) arg1) + (set! (-> s2-0 point-count) 0) + (set! (-> s2-0 first-point) (the-as (pointer vector) (-> *volume-point* data *volume-point-current*))) + (set! (-> s2-0 normal-count) 0) + (set! (-> s2-0 first-normal) (the-as (pointer vector) (-> *volume-normal* data *volume-normal-current*))) + (set! *volume-descriptor-current* (+ *volume-descriptor-current* 1)) + (+! (-> self num-volumes) 1) + (dotimes (s1-0 (the-as int (-> sv-16 elt-count))) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! (-> sv-192 quad) (the-as uint128 0)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (set! (-> sv-208 quad) (the-as uint128 0)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! (-> sv-224 quad) (the-as uint128 0)) + (set! sv-240 (new 'stack-no-clear 'vector)) + (set! (-> sv-240 quad) (the-as uint128 0)) + 0.0 + 0.0 + 0.0 + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s0-0 (new-stack-vector0))) + (set! sv-256 0) + (set! sv-272 0) + (while (< sv-272 (the-as int (-> sv-16 elt-count))) + (when (!= s1-0 sv-272) + (vector-float*! sv-192 (-> s3-0 sv-272) (-> s3-0 sv-272 w)) + (vector-cross! sv-208 (-> s3-0 sv-272) (-> s3-0 s1-0)) + (vector-normalize! sv-208 1.0) + (vector-cross! sv-224 sv-208 (-> s3-0 sv-272)) + (vector-normalize! sv-224 1.0) + (let ((f0-6 (cam-layout-intersect-dist (-> s3-0 s1-0) sv-192 sv-224))) + (when (!= f0-6 409600000.0) + (let ((v1-40 sv-240)) + (let ((a0-18 sv-192)) + (.lvf vf2 (&-> sv-224 quad)) + (.lvf vf1 (&-> a0-18 quad)) + ) + (let ((a0-19 f0-6)) + (.mov vf3 a0-19) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-40 quad) vf4) + ) + (set! sv-160 (new-stack-vector0)) + (set! sv-164 0.0) + (set! sv-168 0) + (set! sv-176 (new-stack-vector0)) + (set! (-> sv-160 quad) (-> sv-240 quad)) + (set! sv-288 0) + (while (< sv-288 (the-as int (-> sv-16 elt-count))) + (when (and (!= sv-288 s1-0) (!= sv-288 sv-272)) + (let ((f0-8 (cam-layout-intersect-dist (-> s3-0 sv-288) sv-160 sv-208))) + (cond + ((= f0-8 409600000.0) + ) + ((zero? sv-168) + (let ((v1-54 sv-160)) + (let ((a0-25 sv-160)) + (.lvf vf2 (&-> sv-208 quad)) + (.lvf vf1 (&-> a0-25 quad)) + ) + (let ((a0-26 f0-8)) + (.mov vf3 a0-26) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-54 quad) vf4) + ) + (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (set! sv-164 8192000.0) + (set! sv-168 1) + ) + ((begin (vector-float*! sv-240 sv-208 f0-8) (>= (vector-dot sv-240 sv-176) 0.0)) + ) + ((>= (vector-dot sv-240 (-> s3-0 sv-288)) 0.0) + (when (< (fabs f0-8) (fabs (the-as float sv-164))) + (set! sv-164 f0-8) + (set! sv-168 (+ sv-168 1)) + ) + ) + (else + (let ((v1-71 sv-160)) + (let ((a0-34 sv-160) + (a1-17 sv-208) + (f1-8 f0-8) + ) + (.lvf vf2 (&-> a1-17 quad)) + (.lvf vf1 (&-> a0-34 quad)) + (let ((a0-35 f1-8)) + (.mov vf3 a0-35) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-71 quad) vf4) + ) + (set! (-> sv-176 quad) (-> s3-0 sv-288 quad)) + (set! sv-168 (+ sv-168 1)) + (if (< (fabs f0-8) (fabs (the-as float sv-164))) + (set! sv-164 (- (the-as float sv-164) f0-8)) + (set! sv-164 0.0) + ) + ) + ) + ) + ) + (set! sv-288 (+ sv-288 1)) + ) + (cond + ((zero? sv-168) + ) + ((= (the-as float sv-164) 0.0) + ) + (else + (dotimes (v1-88 (the-as int (-> sv-16 elt-count))) + (when (and (!= v1-88 s1-0) (!= v1-88 sv-272)) + (if (< 4096.0 (- (vector-dot sv-160 (-> s3-0 v1-88)) (-> s3-0 v1-88 w))) + (goto cfg-47) + ) + ) + ) + (let ((v1-92 sv-240)) + (let ((a0-58 sv-160) + (a1-20 sv-208) + (f0-14 sv-164) + ) + (.lvf vf2 (&-> a1-20 quad)) + (.lvf vf1 (&-> a0-58 quad)) + (let ((a0-59 (the-as float f0-14))) + (.mov vf3 a0-59) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-92 quad) vf4) + ) + (cond + ((>= *volume-point-current* 999) + (format 0 "ERROR : camera editing out of volume points~%") + ) + (else + (set! (-> *volume-point* data *volume-point-current* quad) (-> sv-160 quad)) + (set! (-> *volume-point* data (+ *volume-point-current* 1) quad) (-> sv-240 quad)) + (set! *volume-point-current* (+ *volume-point-current* 2)) + (+! (-> s2-0 point-count) 2) + ) + ) + (vector+! s0-0 s0-0 sv-160) + (vector+! s0-0 s0-0 sv-240) + (set! sv-256 (+ sv-256 2)) + sv-256 + ) + ) + ) + ) + ) + (label cfg-47) + (set! sv-272 (+ sv-272 1)) + ) + (when (nonzero? sv-256) + (vector-float*! s0-0 s0-0 (/ 1.0 (the float sv-256))) + (cond + ((>= *volume-normal-current* 599) + (format 0 "ERROR : camera editing out of volume normals~%") + ) + (else + (set! (-> *volume-normal* data *volume-normal-current* quad) (-> s0-0 quad)) + (set! (-> *volume-normal* data (+ *volume-normal-current* 1) quad) (-> s3-0 s1-0 quad)) + (set! *volume-normal-current* (+ *volume-normal-current* 2)) + (set! (-> s2-0 normal-count) (+ (-> s2-0 normal-count) 2)) + ) + ) + ) + ) + ) + ) + ) + (else + (return #f) + ) + ) + ) + (+! s4-0 1) + ) + ) + #f + ) + ) + +;; definition for function cam-layout-entity-volume-info +(defbehavior cam-layout-entity-volume-info cam-layout () + (dotimes (gp-0 (-> self num-volumes)) + (cond + ((and (= gp-0 (-> self cur-volume)) + (= *camera-layout-blink* 'volume) + (zero? (logand (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + ) + (else + (let ((s5-0 (-> *volume-descriptor* pos-vol gp-0))) + (let ((a0-8 (new 'static 'vector4w :w #x80))) + (cond + ((= (-> s5-0 volume-type) 'vol) + (set! (-> a0-8 x) 0) + (set! (-> a0-8 y) 192) + (set! (-> a0-8 z) 0) + 0 + ) + ((= (-> s5-0 volume-type) 'pvol) + (set! (-> a0-8 x) 128) + (set! (-> a0-8 y) 128) + (set! (-> a0-8 z) 128) + ) + ((= (-> s5-0 volume-type) 'cutoutvol) + (set! (-> a0-8 x) 192) + (set! (-> a0-8 y) 0) + (set! (-> a0-8 z) 0) + 0 + ) + ) + (camera-line-setup a0-8) + ) + (let ((s4-0 (-> s5-0 first-point))) + (dotimes (s3-0 (/ (-> s5-0 point-count) 2)) + (camera-line-draw (the-as vector s4-0) (the-as vector (&-> s4-0 4))) + (set! s4-0 (&-> s4-0 8)) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for function v-slrp! +;; INFO: Used lq/sq +(defun v-slrp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((s2-0 (new-stack-vector0)) + (s1-0 (new-stack-vector0)) + (s0-0 (new-stack-vector0)) + ) + 0.0 + 0.0 + 0.0 + 0.0 + (cond + ((< 1.0 arg3) + (set! arg3 1.0) + ) + ((< arg3 0.0) + (set! arg3 0.0) + ) + ) + (vector-normalize-copy! s2-0 arg1 1.0) + (vector-normalize-copy! s1-0 arg2 1.0) + (vector-cross! s0-0 s2-0 s1-0) + (let* ((f30-0 (vector-length s0-0)) + (f28-0 (asin f30-0)) + ) + (vector-float*! arg0 arg1 (/ (sin (* (- 1.0 arg3) f28-0)) f30-0)) + (let ((s3-1 arg0)) + (let ((f0-14 (/ (sin (* arg3 f28-0)) f30-0))) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg0 quad)) + (let ((v1-9 f0-14)) + (.mov vf3 v1-9) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> s3-1 quad) vf4) + s3-1 + ) + ) + ) + ) + ) + +;; definition of type interp-test-info +(deftype interp-test-info (structure) + ((from vector :inline :offset-assert 0) + (to vector :inline :offset-assert 16) + (origin vector :inline :offset-assert 32) + (color vector4w :offset-assert 48) + (axis vector :offset-assert 52) + (disp string :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + +;; definition for method 3 of type interp-test-info +(defmethod inspect interp-test-info ((obj interp-test-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'interp-test-info) + (format #t "~1Tfrom: #~%" (-> obj from)) + (format #t "~1Tto: #~%" (-> obj to)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Taxis: #~%" (-> obj axis)) + (format #t "~1Tdisp: ~A~%" (-> obj disp)) + (label cfg-4) + obj + ) + +;; 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)) + ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) 0.0 (-> arg1 axis) 65536.0) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (dotimes (s2-0 10) + (set! (-> s5-0 quad) (-> s3-0 quad)) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (* 0.1 (+ 1.0 (the float s2-0))) (-> arg1 axis) 65536.0) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (camera-line s3-0 s5-0 (-> arg1 color)) + ) + (arg0 s5-0 (-> arg1 from) (-> arg1 to) (-> *CAM_LAYOUT-bank* debug-t) (-> arg1 axis) 65536.0) + (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length s5-0)) + (vector+! s5-0 s5-0 (-> arg1 origin)) + (camera-line (-> arg1 origin) s5-0 (-> arg1 color)) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-0 + (-> arg1 color) + (the-as meters #x45800000) + ) + ) + (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)) + ) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) 0.0) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (dotimes (s2-0 10) + (set! (-> s5-0 quad) (-> s3-0 quad)) + (arg0 s3-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 18.0 (+ 1.0 (the float s2-0))))) + (vector+! s3-0 s3-0 (-> arg1 origin)) + (camera-line s3-0 s5-0 (-> arg1 color)) + ) + (arg0 s5-0 (-> arg1 from) (-> arg1 to) (-> arg1 axis) (* 182.04445 (* 180.0 (-> *CAM_LAYOUT-bank* debug-t)))) + (format *stdcon* "~S ~f~%" (-> arg1 disp) (vector-length s5-0)) + (vector+! s5-0 s5-0 (-> arg1 origin)) + (camera-line (-> arg1 origin) s5-0 (-> arg1 color)) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-0 + (-> arg1 color) + (the-as meters #x45800000) + ) + ) + (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) + (return #f) + ) + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-vector0)) + ) + (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) + (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cam-slave-get-rot arg0 s5-0) + (camera-fov-frame s5-0 s4-0 (* 0.5 (cam-slave-get-fov arg0)) 0.75 1.0 (new 'static 'vector4w :z #xff :w #x80)) + ) + ) + (let ((s5-1 (new-stack-vector0))) + (if (and (cam-slave-get-vector-with-offset arg0 s5-1 'pivot) + (or (!= *camera-layout-blink* 'pivot) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-1 + (new 'static 'vector4w :x #x80 :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s5-2 (new-stack-vector0))) + (if (and (cam-slave-get-vector-with-offset arg0 s5-2 'align) + (or (!= *camera-layout-blink* 'align) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-2 + (new 'static 'vector4w :y #x80 :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s5-3 (new-stack-vector0))) + (if (and (cam-slave-get-vector-with-offset arg0 s5-3 'interesting) + (or (!= *camera-layout-blink* 'interesting) + (logtest? (-> *display* real-frame-clock integral-frame-counter) 8) + ) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-3 + (new 'static 'vector4w :x #x80 :z #x80 :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s3-1 (new 'stack 'curve)) + (s2-0 (new-stack-vector0)) + (s5-4 (new-stack-vector0)) + (s4-1 (new-stack-vector0)) + ) + (when (and (get-curve-data! arg0 s3-1 'campath 'campath-k -1000000000.0) + (or (!= *camera-layout-blink* 'spline) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cond + ((cam-slave-get-vector-with-offset arg0 s4-1 'pivot) + (curve-get-pos! s5-4 0.0 s3-1) + (vector-! s4-1 s4-1 s5-4) + ) + (else + (set! (-> s4-1 quad) + (-> (the-as + vector + ((method-of-type res-lump get-property-struct) + arg0 + 'spline-offset + 'interp + -1000000000.0 + s4-1 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + quad + ) + ) + ) + ) + (curve-get-pos! s5-4 0.0 s3-1) + (vector+! s5-4 s5-4 s4-1) + (dotimes (s1-1 8) + (set! (-> s2-0 quad) (-> s5-4 quad)) + (curve-get-pos! s5-4 (* 0.125 (the float (+ s1-1 1))) s3-1) + (vector+! s5-4 s5-4 s4-1) + (camera-line s2-0 s5-4 (new 'static 'vector4w :x #xff :y #xff :w #x80)) + ) + (curve-get-pos! s5-4 (-> *CAM_LAYOUT-bank* spline-t) s3-1) + (vector+! s5-4 s5-4 s4-1) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-4 + (new 'static 'vector4w :x #xff :y #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s3-2 (new 'stack 'curve)) + (s2-1 (new-stack-vector0)) + (s5-5 (new-stack-vector0)) + (s4-2 (new-stack-vector0)) + (s1-2 (new 'stack 'curve)) + ) + (when (and (get-curve-data! arg0 s3-2 'intro 'intro-k -1000000000.0) + (or (!= *camera-layout-blink* 'intro) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cond + ((cam-slave-get-vector-with-offset arg0 s4-2 'pivot) + (curve-get-pos! s5-5 1.0 s3-2) + (vector-! s4-2 s4-2 s5-5) + ) + ((get-curve-data! arg0 s1-2 'campath 'campath-k -1000000000.0) + (curve-get-pos! s4-2 0.0 s1-2) + (curve-get-pos! s5-5 1.0 s3-2) + (vector-! s4-2 s4-2 s5-5) + ) + ((cam-slave-get-vector-with-offset arg0 s4-2 'trans) + (curve-get-pos! s5-5 1.0 s3-2) + (vector-! s4-2 s4-2 s5-5) + ) + ) + (curve-get-pos! s5-5 0.0 s3-2) + (vector+! s5-5 s5-5 s4-2) + (dotimes (s1-3 8) + (set! (-> s2-1 quad) (-> s5-5 quad)) + (curve-get-pos! s5-5 (* 0.125 (the float (+ s1-3 1))) s3-2) + (vector+! s5-5 s5-5 s4-2) + (camera-line s2-1 s5-5 (new 'static 'vector4w :z #xff :w #x80)) + ) + (curve-get-pos! s5-5 (-> *CAM_LAYOUT-bank* intro-t) s3-2) + (vector+! s5-5 s5-5 s4-2) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-5 + (new 'static 'vector4w :z #xff :w #x80) + (the-as meters #x45800000) + ) + (curve-get-pos! s5-5 (cam-slave-get-float arg0 'intro-exitValue 0.0) s3-2) + (vector+! s5-5 s5-5 s4-2) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-5 + (new 'static 'vector4w :z #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s2-3 (res-lump-data arg0 'campoints pointer :time 1.0)) + (v1-73 (res-lump-struct arg0 'campoints-offset structure)) + (s4-3 (new 'stack-no-clear 'vector)) + (s3-3 (new 'stack-no-clear 'vector)) + (s5-6 (new 'static 'vector)) + ) + (when (and s2-3 + (or (!= *camera-layout-blink* 'index) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (cond + (v1-73 + (vector+! s4-3 (the-as vector (&+ s2-3 0)) (the-as vector v1-73)) + (vector+! s3-3 (the-as vector (&+ s2-3 16)) (the-as vector v1-73)) + ) + (else + (set! (-> s4-3 quad) (-> (the-as (pointer uint128) (&+ s2-3 0)))) + (set! (-> s3-3 quad) (-> (the-as (pointer uint128) (&+ s2-3 16)))) + ) + ) + (camera-line s4-3 s3-3 (new 'static 'vector4w :y #x80 :w #x80)) + (vector-lerp-clamp! s5-6 s4-3 s3-3 (-> *CAM_LAYOUT-bank* spline-t)) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-6 + (new 'static 'vector4w :x #xff :y #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s4-4 (res-lump-data arg0 'focalpull pointer :time 1.0)) + (s5-7 (new 'static 'vector)) + ) + (when (and s4-4 + (or (!= *camera-layout-blink* 'focalpull) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + ) + (camera-line + (the-as vector (&+ s4-4 0)) + (the-as vector (&+ s4-4 16)) + (new 'static 'vector4w :y #xff :z #xff :w #x80) + ) + (vector-lerp-clamp! + s5-7 + (the-as vector (&+ s4-4 0)) + (the-as vector (&+ s4-4 16)) + (-> *CAM_LAYOUT-bank* spline-t) + ) + (camera-cross + (new 'static 'vector :y 1024.0) + (new 'static 'vector :z 1024.0) + s5-7 + (new 'static 'vector4w :y #xff :z #xff :w #x80) + (the-as meters #x45800000) + ) + ) + ) + (let ((s5-8 (new 'stack 'interp-test-info)) + (s4-5 (new-stack-vector0)) + ) + (when (and (cam-slave-get-vector-with-offset arg0 (-> s5-8 origin) 'pivot) + (cam-slave-get-vector-with-offset arg0 (-> s5-8 to) 'align) + (cam-slave-get-vector-with-offset arg0 (-> s5-8 from) 'trans) + ) + (camera-line (-> s5-8 from) (-> s5-8 origin) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) + (camera-line (-> s5-8 to) (-> s5-8 origin) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) + (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) + (vector-! (-> s5-8 to) (-> s5-8 to) (-> s5-8 origin)) + (vector-cross! s4-5 (-> s5-8 from) (-> s5-8 to)) + (vector-normalize! s4-5 8192.0) + (vector+! s4-5 s4-5 (-> s5-8 origin)) + (camera-line (-> s5-8 origin) s4-5 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) + (when (not (paused?)) + (+! (-> *CAM_LAYOUT-bank* debug-t) (-> *CAM_LAYOUT-bank* debug-step)) + (if (< 1.0 (-> *CAM_LAYOUT-bank* debug-t)) + (set! (-> *CAM_LAYOUT-bank* debug-t) 0.0) + ) + ) + (set! (-> s5-8 axis) #f) + (set! (-> s5-8 disp) "li") + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) vector-lerp!) s5-8) + (set! (-> s5-8 disp) "si") + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) v-slrp!) s5-8) + (set! (-> s5-8 disp) "si2") + (set! (-> s5-8 color) (new 'static 'vector4w :z #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8) + (set! (-> s5-8 disp) "si3") + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :z #xff :w #x80)) + (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8) + (set! (-> s5-8 axis) (-> *camera* local-down)) + (set! (-> s5-8 disp) "si2d") + (set! (-> s5-8 color) (new 'static 'vector4w :y #xff :z #xff :w #x80)) + (interp-test (the-as (function vector vector vector float vector float none) v-slrp2!) s5-8) + (set! (-> s5-8 disp) "si3d") + (set! (-> s5-8 color) (new 'static 'vector4w :x #xff :y #xff :w #x80)) + (interp-test-deg (the-as (function vector vector vector vector float none) v-slrp3!) s5-8) + ) + ) + (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") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (set-setting! 'master-options 'set 0 32) + #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") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (set-setting! 'master-options 'set 0 32) + #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") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (set-setting! 'master-options 'set 0 32) + #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) + (cond + ((cpad-hold? arg2 l3) + (set! (-> arg0 z) + (- (-> arg0 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) 128.0 48.0 110.0 1.0)) + ) + ) + (else + (set! (-> arg0 y) + (- (-> arg0 y) (analog-input (the-as int (-> *cpad-list* cpads arg2 rightx)) 128.0 48.0 110.0 1.0)) + ) + (+! (-> arg0 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 righty)) 128.0 48.0 110.0 1.0)) + (set! (-> arg1 x) + (- (-> arg1 x) (analog-input (the-as int (-> *cpad-list* cpads arg2 leftx)) 128.0 48.0 110.0 1.0)) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? arg2 r1) + (set! (-> arg1 y) + (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 9)) 0.0 32.0 230.0 0.5) (-> arg1 y)) + ) + ) + ) + (when (logtest? (-> *camera* settings master-options) (cam-master-options READ_BUTTONS)) + (if (cpad-hold? arg2 l1) + (set! (-> arg1 y) + (- (-> arg1 y) (+ 0.5 (analog-input (the-as int (-> *cpad-list* cpads arg2 abutton 8)) 0.0 32.0 230.0 0.5))) + ) + ) + ) + (set! (-> arg1 z) + (- (-> arg1 z) (analog-input (the-as int (-> *cpad-list* cpads arg2 lefty)) 128.0 48.0 110.0 1.0)) + ) + ) + ) + (let ((s5-1 (new-stack-matrix0))) + (let ((a2-8 (new-stack-vector0))) + (set! (-> a2-8 y) -1.0) + (forward-down-nopitch->inv-matrix s5-1 (-> *math-camera* inv-camera-rot vector 2) a2-8) + ) + (vector-matrix*! arg1 arg1 s5-1) + ) + 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)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (cam-layout-print 16 *camera-layout-message-ypos* "x/z pos: left stick, down: l1, up: r1") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (when (and arg1 (nonzero? arg1)) + (cam-layout-print 16 *camera-layout-message-ypos* "x/y rot: right stick") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (cam-layout-print 16 *camera-layout-message-ypos* "z rot: press left stick & move right") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + ) + (let ((s5-0 (new-stack-vector0)) + (s4-0 (new-stack-vector0)) + ) + (set! s3-1 + (cond + ((or (zero? arg0) (not arg0)) + (the-as vector #f) + ) + (else + (if (not (res-lump-struct (-> self cam-entity) arg0 structure)) + (add-data! + (-> self cam-entity) + (the-as + 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 pointer (new 'static 'vector4w)) + ) + ) + (set! s3-1 (res-lump-struct (-> self cam-entity) arg0 vector)) + (when (and (not s3-1) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (clear *temp-string*) + (format *temp-string* "ERROR : can't add ~A" 'vector) + (cam-layout-print 120 100 *temp-string*) + ) + s3-1 + ) + ) + ) + (set! s2-0 + (cond + ((or (zero? arg1) (not arg1)) + (the-as structure #f) + ) + (else + (if (not (res-lump-struct (-> self cam-entity) arg1 structure)) + (add-data! + (-> self cam-entity) + (the-as + 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)) + ) + ) + (the-as pointer (quaternion-identity! (new 'static 'quaternion))) + ) + ) + (set! s2-0 (res-lump-struct (-> self cam-entity) arg1 structure)) + (when (and (not s2-0) (logtest? (-> *display* real-frame-clock integral-frame-counter) 8)) + (clear *temp-string*) + (format *temp-string* "ERROR : can't add ~A" 'quaternion) + (cam-layout-print 120 100 *temp-string*) + ) + s2-0 + ) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'matrix))) + (set! sv-192 (new 'stack-no-clear 'matrix)) + (let ((s0-1 (new 'stack-no-clear 'vector))) + (if (not s3-1) + (return #f) + ) + (clmf-input s5-0 s4-0 0) + (let ((v1-37 s3-1)) + (let ((f0-0 409.6)) + (.lvf vf2 (&-> s4-0 quad)) + (.lvf vf1 (&-> s3-1 quad)) + (let ((a0-34 f0-0)) + (.mov vf3 a0-34) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-37 quad) vf4) + ) + (cond + ((not arg1) + (the-as quaternion #f) + ) + ((zero? arg1) + (the-as quaternion #f) + ) + (else + (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) sv-192) + (vector-float*! s5-0 s5-0 100.0) + (matrix-rotate-x! s1-1 (- (-> s5-0 x))) + (matrix*! sv-192 s1-1 sv-192) + (matrix-rotate-y! s1-1 (-> s5-0 y)) + (matrix*! sv-192 sv-192 s1-1) + (matrix-rotate-z! s1-1 (- (-> s5-0 z))) + (matrix*! sv-192 s1-1 sv-192) + (matrix->quaternion (the-as quaternion s0-1) sv-192) + (quaternion-inverse! (the-as quaternion s2-0) (the-as quaternion (-> self cam-entity connect))) + (quaternion*! (the-as quaternion s2-0) (the-as quaternion s0-1) (the-as quaternion s2-0)) + (quaternion-normalize! (the-as quaternion s2-0)) + ) + ) + ) + ) + ) + (set-setting! 'master-options 'set 0 32) + #t + ) + ) + +;; definition for function clmf-next-volume +(defbehavior clmf-next-volume cam-layout ((arg0 int)) + (if (zero? (-> self num-volumes)) + (return #f) + ) + (set! (-> self cur-volume) (mod (+ arg0 (-> self cur-volume)) (-> self num-volumes))) + (while (< (-> self cur-volume) 0) + (+! (-> self cur-volume) (-> self num-volumes)) + ) + #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") + (set! *camera-layout-message-ypos* (+ *camera-layout-message-ypos* 14)) + (cond + ((cpad-pressed? 0 down) + (set! a0-1 1) + ) + ((cpad-pressed? 0 right) + (set! a0-1 1) + ) + ((cpad-pressed? 0 up) + (set! a0-1 -1) + ) + ((cpad-pressed? 0 left) + (set! a0-1 -1) + ) + (else + (set! a0-1 0) + ) + ) + (clmf-next-volume a0-1) + (set-setting! 'master-options 'set 0 32) + #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)) + (set! (-> self cam-entity) #f) + (return #f) + ) + (if (= (- v1-0) (-> self num-entities)) + (set! v1-0 -1) + ) + (if (= v1-0 (-> self num-entities)) + (set! v1-0 1) + ) + (set! (-> self cur-entity) (mod (+ v1-0 (-> self cur-entity)) (-> self num-entities))) + ) + (while (< (-> self cur-entity) 0) + (+! (-> self cur-entity) (-> self num-entities)) + ) + (set! *last-cur-entity* (-> self cur-entity)) + (let ((v1-8 (-> self cur-entity)) + (a0-13 (-> *camera-engine* alive-list next0)) + ) + *camera-engine* + (let ((a1-3 (-> a0-13 next0))) + (while (!= a0-13 (-> *camera-engine* alive-list-end)) + (let ((a0-14 (-> (the-as connection a0-13) param1))) + (cond + ((zero? v1-8) + (set! (-> self cam-entity) (the-as entity-camera a0-14)) + (set! *volume-descriptor-current* 0) + (set! *volume-point-current* 0) + (set! *volume-normal-current* 0) + (set! (-> self num-volumes) 0) + (cam-layout-entity-volume-info-create (-> self cam-entity) 'vol) + (set! (-> self first-pvol) (-> self num-volumes)) + (cam-layout-entity-volume-info-create (-> self cam-entity) 'pvol) + (set! (-> self first-cutoutvol) (-> self num-volumes)) + (cam-layout-entity-volume-info-create (-> self cam-entity) 'cutoutvol) + (set! (-> *CAM_LAYOUT-bank* intro-step) (cam-slave-get-intro-step (-> self cam-entity))) + (return #f) + ) + (else + (+! v1-8 -1) + ) + ) + ) + (set! a0-13 a1-3) + *camera-engine* + (set! a1-3 (-> a1-3 next0)) + ) + ) + ) + #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) + (set! (-> *camera-other-root* quad) (-> *camera-other-trans* quad)) + (cam-slave-get-rot (the-as entity-actor (-> self cam-entity)) *camera-other-matrix*) + (set! *camera-look-through-other* 10) + (set-setting! 'master-options 'set 0 32) + #f + ) + +;; definition for function fov->maya +(defun fov->maya ((arg0 float)) + (if (= arg0 0.0) + 0.0 + (/ 12.700255 (tan (* 0.5 arg0))) + ) + ) + +;; 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)) + (s5-0 (res-lump-struct arg2 'rot-offset vector)) + ) + (if arg0 + (format #t "setup rot ~f ~f ~f ~f~%" (-> s3-0 x) (-> s3-0 y) (-> s3-0 z) (-> s3-0 w)) + ) + (when s5-0 + (if arg0 + (format #t "rot offset ~f ~f ~f ~f~%" (-> s5-0 x) (-> s5-0 y) (-> s5-0 z) (-> s5-0 w)) + ) + (format + arg1 + " tag rot-offset ~f ~f ~f ~f // vector (quaternion)~%" + (-> s5-0 x) + (-> s5-0 y) + (-> s5-0 z) + (-> s5-0 w) + ) + ) + ) + (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)) + (s5-0 (method-of-type res-lump get-property-struct)) + (s2-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'trans '-offset) + (let ((s5-1 (the-as object (s5-0 + s2-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (let ((s2-1 (the-as object (res-lump-struct arg2 'translation_info vector))) + (s3-1 (new-stack-vector0)) + ) + (if arg0 + (format #t "setup trans ~M ~M ~M (maya)~%" (-> s1-0 x) (-> s1-0 y) (-> s1-0 z)) + ) + (set! (-> s3-1 quad) (-> s1-0 quad)) + (when (the-as vector s5-1) + (if arg0 + (format + #t + "offset ~M ~M ~M (added)~%" + (-> (the-as vector s5-1) x) + (-> (the-as vector s5-1) y) + (-> (the-as vector s5-1) z) + ) + ) + (vector+! s3-1 s3-1 (the-as vector s5-1)) + ) + (when (the-as vector s2-1) + (if arg0 + (format + #t + "level-trans ~M ~M ~M (subtracted)~%" + (-> (the-as vector s2-1) x) + (-> (the-as vector s2-1) y) + (-> (the-as vector s2-1) z) + ) + ) + (vector-! s3-1 s3-1 (the-as vector s2-1)) + ) + (set! s2-1 (or (the-as vector s5-1) s2-1)) + (set! arg0 (and (the-as symbol s2-1) arg0)) + (if arg0 + (format #t "final trans ~M ~M ~M (maya)~%" (-> s3-1 x) (-> s3-1 y) (-> s3-1 z)) + ) + ) + (if (the-as vector s5-1) + (format + arg1 + " tag trans-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> (the-as vector s5-1) x) + (-> (the-as vector s5-1) y) + (-> (the-as vector s5-1) z) + ) + ) + ) + ) + (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)) + (s4-0 (method-of-type res-lump get-property-struct)) + ) + (format (clear *res-key-string*) "~S~S" 'pivot '-offset) + (let ((s5-1 (the-as vector (s4-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (s4-1 (new-stack-vector0)) + ) + (when s2-0 + (if s5-1 + (vector+! s4-1 s2-0 s5-1) + (set! (-> s4-1 quad) (-> s2-0 quad)) + ) + (if arg0 + (format #t "setup pivot ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) + ) + (when s5-1 + (when arg0 + (format #t "offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + (format #t "final pivot ~M ~M ~M~%" (-> s4-1 x) (-> s4-1 y) (-> s4-1 z)) + ) + (format + arg1 + " tag pivot-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + ) + (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)) + (s4-0 (method-of-type res-lump get-property-struct)) + ) + (format (clear *res-key-string*) "~S~S" 'align '-offset) + (let ((s5-1 (the-as vector (s4-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (s4-1 (new-stack-vector0)) + ) + (when s2-0 + (if s5-1 + (vector+! s4-1 s2-0 s5-1) + (set! (-> s4-1 quad) (-> s2-0 quad)) + ) + (if arg0 + (format #t "setup align ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) + ) + (when s5-1 + (when arg0 + (format #t "offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + (format #t "final align ~M ~M ~M~%" (-> s4-1 x) (-> s4-1 y) (-> s4-1 z)) + ) + (format + arg1 + " tag align-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + ) + (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)) + (s4-0 (method-of-type res-lump get-property-struct)) + ) + (format (clear *res-key-string*) "~S~S" 'interesting '-offset) + (let ((s5-1 (the-as vector (s4-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as structure #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (s4-1 (new-stack-vector0)) + ) + (when s2-0 + (if s5-1 + (vector+! s4-1 s2-0 s5-1) + (set! (-> s4-1 quad) (-> s2-0 quad)) + ) + (if arg0 + (format #t "setup interesting ~M ~M ~M~%" (-> s2-0 x) (-> s2-0 y) (-> s2-0 z)) + ) + (when s5-1 + (when arg0 + (format #t "offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + (format #t "final interesting ~M ~M ~M~%" (-> s4-1 x) (-> s4-1 y) (-> s4-1 z)) + ) + (format + arg1 + " tag interesting-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'fov '-offset) + (let ((f30-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (cond + ((= f28-0 0.0) + (if arg0 + (format #t "setup fov deg 0.0 (defaults to 64.0)~%") + ) + (set! f28-0 11650.845) + ) + (arg0 + (format #t "setup fov deg ~R (~f in maya)~%" f28-0 (fov->maya f28-0)) + ) + ) + (when (!= f30-0 0.0) + (when arg0 + (format #t "offset ~R~%" f30-0) + (format #t "final ~R (~f in maya) ~%" (+ f28-0 f30-0) (fov->maya (+ f28-0 f30-0))) + ) + (format arg1 " tag fov-offset DEG(~R) // float~%" f30-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'focalPull '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup focalPull deg ~R (~f in maya)~%" f30-0 (fov->maya f30-0)) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~R~%" f28-0) + (format #t "final ~R (~f in maya) ~%" (+ f30-0 f28-0) (fov->maya (+ f30-0 f28-0))) + ) + (format arg1 " tag focalPull-offset DEG(~R) // float~%" f28-0) + ) + ) + ) + (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)) + (s5-0 (method-of-type res-lump get-property-value)) + (s1-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-on) + (let ((s5-1 (s5-0 + s1-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s1-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'flags '-off) + (let ((s3-1 (s1-1 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (format #t "setup flags ") + (cam-slave-options->string (the-as cam-slave-options s4-0) #t) + (format #t "~%") + (format #t "forced on ") + (cam-slave-options->string (the-as cam-slave-options s5-1) #t) + (format #t "~%") + (format #t "forced off ") + (cam-slave-options->string (the-as cam-slave-options s3-1) #t) + (format #t "~%") + (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) + (format #t "final ") + (cam-slave-options->string (the-as cam-slave-options s4-1) #t) + ) + (format #t "~%") + ) + (format arg1 " tag flags-on 0x~X // int32~%" s5-1) + (format arg1 " tag flags-off 0x~X // int32~%" s3-1) + ) + ) + ) + (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)) + (s5-0 (method-of-type res-lump get-property-value)) + (s1-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'focalpull-flags '-on) + (let ((s5-1 (s5-0 + s1-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s1-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'focalpull-flags '-off) + (let ((s3-1 (s1-1 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (format #t "setup focalpull-flags ") + (cam-index-options->string (the-as cam-index-options s4-0) #t) + (format #t "~%") + (format #t "forced on ") + (cam-index-options->string (the-as cam-index-options s5-1) #t) + (format #t "~%") + (format #t "forced off ") + (cam-index-options->string (the-as cam-index-options s3-1) #t) + (format #t "~%") + (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) + (format #t "final ") + (cam-index-options->string (the-as cam-index-options s4-1) #t) + ) + (format #t "~%") + ) + (format arg1 " tag focalpull-flags-on 0x~X // int32~%" s5-1) + (format arg1 " tag focalpull-flags-off 0x~X // int32~%" s3-1) + ) + ) + ) + (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)) + (s5-0 (method-of-type res-lump get-property-value)) + (s1-0 arg2) + ) + (format (clear *res-key-string*) "~S~S" 'campoints-flags '-on) + (let ((s5-1 (s5-0 + s1-0 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (s1-1 (method-of-type res-lump get-property-value)) + ) + (format (clear *res-key-string*) "~S~S" 'campoints-flags '-off) + (let ((s3-1 (s1-1 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (format #t "setup campoints-flags ") + (cam-index-options->string (the-as cam-index-options s4-0) #t) + (format #t "~%") + (format #t "forced on ") + (cam-index-options->string (the-as cam-index-options s5-1) #t) + (format #t "~%") + (format #t "forced off ") + (cam-index-options->string (the-as cam-index-options s3-1) #t) + (format #t "~%") + (let ((s4-1 (logclear (logior s4-0 s5-1) s3-1))) + (format #t "final ") + (cam-index-options->string (the-as cam-index-options s4-1) #t) + ) + (format #t "~%") + ) + (format arg1 " tag campoints-flags-on 0x~X // int32~%" s5-1) + (format arg1 " tag campoints-flags-off 0x~X // int32~%" s3-1) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'intro-time '-offset) + (let ((f30-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (cond + ((= f28-0 0.0) + (if arg0 + (format #t "setup intro-time 0.0 (defaults to 1 sec)~%") + ) + (set! f28-0 1.0) + ) + (arg0 + (format #t "setup intro-time ~f~%" f28-0) + ) + ) + (when (!= f30-0 0.0) + (when arg0 + (format #t "offset ~f~%" f30-0) + (format #t "final ~f~%" (+ f28-0 f30-0)) + ) + (format arg1 " tag intro-time-offset SECONDS(~f) // float~%" f30-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'intro-exitValue '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (when arg0 + (if (= f30-0 0.0) + (format #t "setup intro-exitValue 0.0 (defaults to 0.5)~%") + (format #t "setup intro-exitValue ~f~%" f30-0) + ) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~f~%" f28-0) + (format #t "final ~f~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag intro-exitValue-offset ~f // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'interpTime '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup interpTime ~f~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~f~%" f28-0) + (format #t "final ~f~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag interpTime-offset SECONDS(~f) // float~%" f28-0) + ) + ) + ) + (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)) + (let ((s5-1 (res-lump-struct arg2 'spline-offset vector))) + (when s5-1 + (if arg0 + (format #t "spline offset ~M ~M ~M~%" (-> s5-1 x) (-> s5-1 y) (-> s5-1 z)) + ) + (format + arg1 + " tag spline-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-1 x) + (-> s5-1 y) + (-> s5-1 z) + ) + ) + ) + ) + (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))) + (when (the int f30-0) + (if arg0 + (format #t "spline follow dist offset ~M~%" f30-0) + ) + (format arg1 " tag spline-follow-dist-offset METERS(~M)~%" f30-0) + ) + ) + (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))) + (when s5-0 + (if arg0 + (format #t "index offset ~M ~M ~M~%" (-> s5-0 x) (-> s5-0 y) (-> s5-0 z)) + ) + (format + arg1 + " tag campoints-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%" + (-> s5-0 x) + (-> s5-0 y) + (-> s5-0 z) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'tiltAdjust '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup tiltAdjust deg ~R~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~R~%" f28-0) + (format #t "final ~R~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag tiltAdjust-offset DEG(~R) // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMinLength '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMinLength ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMinLength-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMaxLength '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMaxLength ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMaxLength-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMinHeight '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMinHeight ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMinHeight-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringMaxHeight '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringMaxHeight ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringMaxHeight-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'stringCliffHeight '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup stringCliffHeight ~M~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~M~%" f28-0) + (format #t "final ~M~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag stringCliffHeight-offset METERS(~M) // float~%" f28-0) + ) + ) + ) + (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)) + (s3-0 (method-of-type res-lump get-property-value-float)) + ) + (format (clear *res-key-string*) "~S~S" 'maxAngle '-offset) + (let ((f28-0 (s3-0 + arg2 + (string->symbol *res-key-string*) + 'interp + -1000000000.0 + 0.0 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + (if arg0 + (format #t "setup maxAngle ~R~%" f30-0) + ) + (when (!= f28-0 0.0) + (when arg0 + (format #t "offset ~R~%" f28-0) + (format #t "final ~R~%" (+ f30-0 f28-0)) + ) + (format arg1 " tag maxAngle-offset DEG(~R) // float~%" f28-0) + ) + ) + ) + (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 + (format *temp-string* "db/caminfo/~s.cam" (res-lump-struct arg0 'name structure)) + (format *temp-string* "db/caminfo/garbage") + ) + (let ((s4-2 (new 'stack 'file-stream *temp-string* 'write))) + (if arg1 + (format #t "---------camera '~S'------------~%" (res-lump-struct arg0 'name structure)) + ) + (format s4-2 "#include /jak2/db/config/standard.m2d~%") + (format s4-2 "camera ~s {~%" (res-lump-struct arg0 'name structure)) + (cam-layout-save-cam-rot arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-cam-trans arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-pivot arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-align arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-interesting arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-fov arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-focalpull arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-flags arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-introsplinetime arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-introsplineexitval arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-interptime arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-splineoffset arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-spline-follow-dist-offset arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-campointsoffset arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-tiltAdjust arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMinLength arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMaxLength arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMinHeight arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringMaxHeight arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-stringCliffHeight arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-maxAngle arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-campoints-flags arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (cam-layout-save-focalpull-flags arg1 (the-as string s4-2) (the-as entity-actor arg0)) + (format s4-2 "}~%") + (file-stream-close s4-2) + ) + ) + +;; 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)) + ) + (if s5-1 + (format #t "~%~%~%=================================~%") + ) + (clmf-save-single (-> self cam-entity) s5-1 gp-1) + (if s5-1 + (format #t "===============================~%~%~%~%") + ) + (if gp-1 + (format #t "'~S' save completed~%" (res-lump-struct (-> self cam-entity) 'name structure)) + ) + ) + #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)) + ) + (if s5-1 + (format #t "~%~%~%=================================~%") + ) + (let ((v1-5 (-> *camera-engine* alive-list next0))) + *camera-engine* + (let ((s4-0 (-> v1-5 next0))) + (while (!= v1-5 (-> *camera-engine* alive-list-end)) + (let ((a0-4 (-> (the-as connection v1-5) param1))) + (clmf-save-single (the-as entity-camera a0-4) s5-1 gp-1) + ) + (set! v1-5 s4-0) + *camera-engine* + (set! s4-0 (-> s4-0 next0)) + ) + ) + ) + (if s5-1 + (format #t "===============================~%~%~%~%") + ) + (if gp-1 + (format #t "camera save all completed~%") + ) + ) + #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) + (force-off int32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type clmf-cam-flag-toggle-info +(defmethod inspect clmf-cam-flag-toggle-info ((obj clmf-cam-flag-toggle-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'clmf-cam-flag-toggle-info) + (format #t "~1Tkey: ~f~%" (-> obj key)) + (format #t "~1Tforce-on: ~D~%" (-> obj force-on)) + (format #t "~1Tforce-off: ~D~%" (-> obj force-off)) + (label cfg-4) + obj + ) + +;; 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)) + ) + (set! (-> gp-0 key) (-> self res-key)) + (cond + ((and (= arg1 'vol-flags) (>= (-> self res-key) (the float (-> self first-cutoutvol)))) + (set! (-> gp-0 key) (- (-> gp-0 key) (the float (-> self first-cutoutvol)))) + (set! arg1 (the-as int 'cutoutvol-flags)) + ) + ((and (= arg1 'vol-flags) (>= (-> self res-key) (the float (-> self first-pvol)))) + (set! (-> gp-0 key) (- (-> gp-0 key) (the float (-> self first-pvol)))) + (set! arg1 (the-as int 'pvol-flags)) + ) + ) + (let ((s3-0 (method-of-type res-lump get-property-value)) + (s2-0 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-on) + (set! (-> gp-0 force-on) (the-as int (s3-0 + s2-0 + (string->symbol *res-key-string*) + 'exact + (-> gp-0 key) + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (let ((s3-1 (method-of-type res-lump get-property-value)) + (s2-1 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-off) + (set! (-> gp-0 force-off) (the-as int (s3-1 + s2-1 + (string->symbol *res-key-string*) + 'exact + (-> gp-0 key) + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (cond + ((logtest? (-> gp-0 force-off) s4-0) + (logclear! (-> gp-0 force-off) s4-0) + (logior! (-> gp-0 force-on) s4-0) + (let* ((s4-1 (-> self cam-entity)) + (s3-2 (method-of-object s4-1 add-32bit-data!)) + (s2-2 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-2 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-off) + (s3-2 + s4-1 + (the-as + res-tag + (make-u128 s2-2 (logior s1-2 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-off) + ) + ) + (let* ((s4-2 (-> self cam-entity)) + (s3-3 (method-of-object s4-2 add-32bit-data!)) + (s2-3 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-3 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-on) + (s3-3 + s4-2 + (the-as + res-tag + (make-u128 s2-3 (logior s1-3 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-on) + ) + ) + ) + ((logtest? (-> gp-0 force-on) s4-0) + (logclear! (-> gp-0 force-on) s4-0) + (let* ((s4-3 (-> self cam-entity)) + (s3-4 (method-of-object s4-3 add-32bit-data!)) + (s2-4 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-4 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-on) + (s3-4 + s4-3 + (the-as + res-tag + (make-u128 s2-4 (logior s1-4 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-on) + ) + ) + ) + (else + (logior! (-> gp-0 force-off) s4-0) + (let* ((s4-4 (-> self cam-entity)) + (s3-5 (method-of-object s4-4 add-32bit-data!)) + (s2-5 (logior (shl #x10000 32) (shr (shl (the-as int int32) 32) 32))) + (s1-5 (shl (the-as int (-> gp-0 key)) 32)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg1) '-off) + (s3-5 + s4-4 + (the-as + res-tag + (make-u128 s2-5 (logior s1-5 (shr (shl (the-as int (string->symbol *res-key-string*)) 32) 32))) + ) + (-> gp-0 force-off) + ) + ) + ) + ) + ) + #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)) + ) + (cond + ((and (= arg2 'vol-flags) (>= (-> self res-key) (the float (-> self first-cutoutvol)))) + (set! f30-0 (- f30-0 (the float (-> self first-cutoutvol)))) + (set! arg2 (the-as uint 'cutoutvol-flags)) + ) + ((and (= arg2 'vol-flags) (>= (-> self res-key) (the float (-> self first-pvol)))) + (set! f30-0 (- f30-0 (the float (-> self first-pvol)))) + (set! arg2 (the-as uint 'pvol-flags)) + ) + ) + (let ((s3-0 (method-of-type res-lump get-property-value)) + (s2-0 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg2) '-off) + (cond + ((logtest? (s3-0 + s2-0 + (string->symbol *res-key-string*) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) + (format arg0 ": off") + ) + ((let ((s3-1 (method-of-type res-lump get-property-value)) + (s2-1 (-> self cam-entity)) + ) + (format (clear *res-key-string*) "~S~S" (the-as object arg2) '-on) + (logtest? (s3-1 + s2-1 + (string->symbol *res-key-string*) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) + ) + (format arg0 ": on") + ) + ((zero? (logand ((method-of-type res-lump get-property-value) + (-> self cam-entity) + (the-as symbol arg2) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) + ) + (format arg0 ": off(maya)") + ) + (else + (format arg0 ": on(maya)") + ) + ) + ) + ) + #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)) + (let ((f30-0 (res-lump-float (-> self cam-entity) arg0)) + (f0-0 (-> arg1 0)) + ) + (if (= f0-0 0.0) + (set! f0-0 1.0) + ) + (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)) + ) + ) + f0-2 + ) + ) + ) + (set-setting! 'master-options 'set 0 32) + #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) + ) + #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)) + (set! (-> *CAM_LAYOUT-bank* intro-step) f30-0) + ) + #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 ":") + (set! sv-16 0) + (let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))) + (when s5-1 + (let ((s4-0 0)) + (while (begin + (let ((v1-4 (the-as uint128 sv-16))) + (.pcpyud v1-5 v1-4 r0-0) + ) + (< s4-0 (shr (* (the-as int v1-5) 2) 49)) + ) + (format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4))))) + (+! s4-0 1) + ) + ) + ) + ) + #t + ) + +;; definition for symbol *clm-focalpull-attr*, type clm +(define *clm-focalpull-attr* + (new 'static 'clm + :title "---focalpull attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "radial " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 16 + :val-parm1 'focalpull-flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 16 + :parm1 'focalpull-flags + ) + ) + ) + (new 'static 'clm-list-item + :description "spherical " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 8 + :val-parm1 'focalpull-flags + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1 'focalpull-flags + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-index-attr*, type clm +(define *clm-index-attr* + (new 'static 'clm + :title "---index attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "radial " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 16 + :val-parm1 'campoints-flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 16 + :parm1 'campoints-flags + ) + ) + ) + (new 'static 'clm-list-item + :description "spherical " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 8 + :val-parm1 'campoints-flags + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 8 + :parm1 'campoints-flags + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-intro-attr*, type clm +(define *clm-intro-attr* + (new 'static 'clm + :title "---intro attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "time " + :track-val #f + :val-func 'clmf-cam-intro-time + :val-parm0-symbol 'intro-time + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'intro-time-offset + :parm1-basic (new 'static 'bfloat :data 0.01) + ) + ) + ) + (new 'static 'clm-list-item + :description "exitValue" + :track-val #f + :val-func 'clmf-cam-float + :val-parm0-symbol 'intro-exitValue + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'intro-exitValue-offset + :parm1-basic (new 'static 'bfloat :data 0.001) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-spline-attr*, type clm +(define *clm-spline-attr* + (new 'static 'clm + :title "---spline attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "followDist" + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'spline-follow-dist + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'spline-follow-dist-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-cam-attr*, type clm +(define *clm-cam-attr* + (new 'static 'clm + :title "---camera attributes--" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func '*clm-edit*) + ) + (new 'static 'clm-item + :description "adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "drag " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x400 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x400 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "fov " + :track-val #f + :val-func 'clmf-cam-fov + :val-parm0-symbol 'fov + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'fov-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "focalPull " + :track-val #f + :val-func 'clmf-cam-deg + :val-parm0-symbol 'focalPull + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'focalPull-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "interpTime " + :track-val #f + :val-func 'clmf-cam-interp-time + :val-parm0-symbol 'interpTime + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'interpTime-offset + :parm1-basic (new 'static 'bfloat :data 0.01) + ) + ) + ) + (new 'static 'clm-list-item + :description "sameSide " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 16 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-cam-flag-toggle :parm0 16 :parm1 'flags) + ) + ) + (new 'static 'clm-list-item + :description "spherical " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 32 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-cam-flag-toggle :parm0 32 :parm1 'flags) + ) + ) + (new 'static 'clm-list-item + :description "MinLength " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMinLength + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMinLength-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "MaxLength " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMaxLength + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMaxLength-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "MinHeight " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMinHeight + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMinHeight-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "MaxHeight " + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringMaxHeight + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringMaxHeight-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "cliffHeight" + :track-val #f + :val-func 'clmf-cam-meters + :val-parm0-symbol 'stringCliffHeight + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'stringCliffHeight-offset + :parm1-basic (new 'static 'bfloat :data 409.6) + ) + ) + ) + (new 'static 'clm-list-item + :description "alternates " + :track-val #f + :val-func 'clmf-cam-string + :val-parm0-symbol 'alternates + :actions (new 'static 'boxed-array :type clm-item-action) + ) + (new 'static 'clm-list-item + :description "maxAngle " + :track-val #f + :val-func 'clmf-cam-deg + :val-parm0-symbol 'maxAngle + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'maxAngle-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "shrinkAngle" + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x4000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x4000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "noRotate " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x20000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x20000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "tiltAdjust " + :track-val #f + :val-func 'clmf-cam-deg + :val-parm0-symbol 'tiltAdjust + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'tiltAdjust-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + (new 'static 'clm-list-item + :description "stickyAngle" + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x40000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x40000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "easeSpline " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x1000000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x1000000 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "jumpPitch " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x80 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x80 + :parm1 'flags + ) + ) + ) + (new 'static 'clm-list-item + :description "rapid " + :track-val #f + :val-func 'clmf-cam-flag + :val-parm0 #x800000 + :val-parm1 'flags + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :options #x1 + :func 'clmf-cam-flag-toggle + :parm0 #x800000 + :parm1 'flags + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-cam-lookthrough*, type clm +(define *clm-cam-lookthrough* + (new 'static 'clm + :title "---cam-lookthrough---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " " + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x4 :func 'clmf-look-through) + ) + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-edit) + ) + (new 'static 'clm-item + :description "pos/rot" + :button-symbol 'x + :action (new 'static 'clm-item-action + :button #x4000 + :options #x8 + :func 'clmf-pos-rot + :parm0-symbol 'trans-offset + :parm1 'rot-offset + ) + ) + (new 'static 'clm-item + :description " adjust" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :func #f) + ) + (new 'static 'clm-list + :tracker #f + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "fov" + :track-val #f + :val-func 'clmf-cam-fov + :val-parm0-symbol 'fov + :actions (new 'static 'boxed-array :type clm-item-action (new 'static 'clm-item-action + :button #x4000 + :func 'clmf-cam-float-adjust + :parm0-symbol 'fov-offset + :parm1-basic (new 'static 'bfloat :data 91.022224) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-edit*, type clm +(define *clm-edit* + (new 'static 'clm + :title "---edit---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " ok" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-to-select) + ) + (new 'static 'clm-item + :description "attributes" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func #f) + ) + (new 'static 'clm-item + :description " edit part" + :button-symbol 'circle + :action (new 'static 'clm-item-action :button #x2000 :options #x1 :func #f) + ) + (new 'static 'clm-item + :description "scale/next" + :button-symbol 'r2 + :action (new 'static 'clm-item-action :button #x200 :func #f) + ) + (new 'static 'clm-item + :description " pos/rot" + :button-symbol 'l2 + :action (new 'static 'clm-item-action :button #x100 :func #f) + ) + (new 'static 'clm-list + :tracker '*camera-layout-blink* + :items (new 'static 'boxed-array :type clm-list-item + (new 'static 'clm-list-item + :description "camera " + :track-val 'camera + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func '*clm-cam-attr*) + (new 'static 'clm-item-action :button #x2000 :func '*clm-cam-lookthrough*) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action + :button #x100 + :func 'clmf-pos-rot + :parm0-symbol 'trans-offset + :parm1 'rot-offset + ) + ) + ) + (new 'static 'clm-list-item + :description "align " + :track-val 'align + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'align-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "pivot " + :track-val 'pivot + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'pivot-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "interesting" + :track-val 'interesting + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x200 :func 'clmf-bna) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'interesting-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "spline " + :track-val 'spline + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-spline-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'spline-offset :parm1 #f) + ) + ) + (new 'static 'clm-list-item + :description "intro " + :track-val 'intro + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-intro-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-implement) + ) + ) + (new 'static 'clm-list-item + :description "index " + :track-val 'index + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-index-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-pos-rot :parm0-symbol 'campoints-offset) + ) + ) + (new 'static 'clm-list-item + :description "focalpull" + :track-val 'focalpull + :val-func #f + :actions (new 'static 'boxed-array :type clm-item-action + (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-to-focalpull-attr) + (new 'static 'clm-item-action :button #x2000 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x200 :func 'clmf-implement) + (new 'static 'clm-item-action :button #x100 :func 'clmf-implement) + ) + ) + ) + ) + ) + ) + ) + +;; definition for symbol *clm-save-all*, type clm +(define *clm-save-all* + (new 'static 'clm + :title "---save all?---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " save all" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-all :parm0 16) + ) + (new 'static 'clm-item + :description "print all" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-all :parm0 8) + ) + (new 'static 'clm-item + :description " done" + :button-symbol 'triangle + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + ) + ) + ) + ) + +;; definition for symbol *clm-save-one*, type clm +(define *clm-save-one* + (new 'static 'clm + :title "---single save?---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " single save" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x1 :func 'clmf-save-one :parm0 16) + ) + (new 'static 'clm-item + :description "single print" + :button-symbol 'square + :action (new 'static 'clm-item-action :button #x8000 :options #x1 :func 'clmf-save-one :parm0 8) + ) + (new 'static 'clm-item + :description " done" + :button-symbol 'triangle + :action (new 'static 'clm-item-action :button #x1000 :options #x1 :func 'clmf-to-select) + ) + ) + ) + ) + +;; definition for symbol *clm-select*, type clm +(define *clm-select* + (new 'static 'clm + :title "---camera---" + :items (new 'static 'boxed-array :type clm-basic + (new 'static 'clm-item + :description " edit" + :button-symbol 'x + :action (new 'static 'clm-item-action :button #x4000 :options #x3 :func 'clmf-to-edit-cam) + ) + (new 'static 'clm-item + :description "save one" + :button-symbol 'triangle + :action (new 'static 'clm-item-action :button #x1000 :options #x3 :func '*clm-save-one*) + ) + (new 'static 'clm-item + :description " quit" + :button-symbol 'circle + :action (new 'static 'clm-item-action :button #x2000 :options #x11 :func 'cam-layout-stop) + ) + (new 'static 'clm-item + :description " next" + :button-symbol 'down + :action (new 'static 'clm-item-action :button #x40 :options #x3 :func 'clmf-next-entity :parm0 8) + ) + (new 'static 'clm-item + :description " prev" + :button-symbol 'up + :action (new 'static 'clm-item-action :button #x10 :options #x3 :func 'clmf-next-entity :parm0 -8) + ) + (new 'static 'clm-item + :description " next 5" + :button-symbol 'right + :action (new 'static 'clm-item-action :button #x20 :options #x3 :func 'clmf-next-entity :parm0 40) + ) + (new 'static 'clm-item + :description " prev 5" + :button-symbol 'left + :action (new 'static 'clm-item-action :button #x80 :options #x3 :func 'clmf-next-entity :parm0 -40) + ) + ) + ) + ) + +;; 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 + ((not s5-0) + #f + ) + ((zero? s5-0) + #f + ) + ((and (not (-> self cam-entity)) (logtest? (-> arg0 options) 2)) + #f + ) + ((and (logtest? (-> arg0 options) 8) (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + #f + ) + ((and (zero? (logand (-> 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)) + (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + ) + #f + ) + ((and (logtest? (-> arg0 options) 16) + (let ((a1-3 (-> *cpad-list* cpads 0))) + (not (logtest? (logclear (-> a1-3 button0-abs 1) (-> a1-3 button0-abs 0)) (-> arg0 button))) + ) + ) + #f + ) + ((type? s5-0 clm) + (set! *clm* (the-as clm s5-0)) + #t + ) + ((type? s5-0 function) + ((the-as (function object symbol symbol) s5-0) (-> arg0 parm0) (-> arg0 parm1)) + ) + ) + ) + ) + +;; 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 + ((not gp-0) + ) + ((zero? gp-0) + ) + ((type? gp-0 function) + ((the-as (function string int basic none) gp-0) arg1 arg2 arg3) + ) + ) + ) + #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)) + (if (< 1.01 (-> *CAM_LAYOUT-bank* spline-t)) + (set! (-> *CAM_LAYOUT-bank* spline-t) -0.09) + ) + (+! (-> *CAM_LAYOUT-bank* intro-t) (-> *CAM_LAYOUT-bank* intro-step)) + (if (< 1.01 (-> *CAM_LAYOUT-bank* intro-t)) + (set! (-> *CAM_LAYOUT-bank* intro-t) -0.09) + ) + (let ((s5-0 30)) + (let ((s4-0 (cam-state-from-entity (-> self cam-entity)))) + (set-setting! 'master-options 'clear 0 32) + (let ((s3-0 (-> self cam-entity))) + (clear *temp-string*) + (if s3-0 + (format *temp-string* "\"~S\"~%" (res-lump-struct s3-0 'name structure)) + ) + ) + (if (not s4-0) + (format *temp-string* "no cameras in this level") + (format *temp-string* "~S" (-> s4-0 name)) + ) + ) + (cam-layout-print 320 s5-0 *temp-string*) + (let ((s5-1 (+ s5-0 28))) + (clear *temp-string*) + (format *temp-string* "~S~%" (-> arg0 title)) + (cam-layout-print 320 s5-1 *temp-string*) + (let ((s4-1 (+ s5-1 14))) + (dotimes (s5-2 (-> arg0 items length)) + (cond + ((type? (-> arg0 items s5-2) clm-list) + (clear *temp-string*) + (format *temp-string* "------------") + (cam-layout-print 320 s4-1 *temp-string*) + (let ((s4-2 (+ s4-1 14))) + (let ((s3-1 (the-as clm-list (-> arg0 items s5-2)))) + (dotimes (s2-1 (-> s3-1 items length)) + (clear *temp-string*) + (format + *temp-string* + "~S~S" + (if (= s2-1 (-> s3-1 cur-list-item)) + "> " + " " + ) + (-> s3-1 items s2-1 description) + ) + (cam-layout-function-call + (-> s3-1 items s2-1 val-func) + *temp-string* + (the-as int (-> 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*) + (+! s4-2 14) + ) + ) + (clear *temp-string*) + (format *temp-string* "------------") + (cam-layout-print 320 s4-2 *temp-string*) + (set! s4-1 (+ s4-2 14)) + ) + ) + ((and (not (-> self cam-entity)) (logtest? (-> (the-as clm-item (-> arg0 items s5-2)) action options) 2)) + ) + ((logtest? (-> (the-as clm-item (-> arg0 items s5-2)) action options) 4) + ) + (else + (let ((s3-2 (-> arg0 items s5-2))) + (clear *temp-string*) + (format + *temp-string* + "~S: ~A~%" + (-> (the-as clm-item s3-2) description) + (if (logtest? (-> (the-as clm-item (-> arg0 items s5-2)) action options) 8) + 'default + (-> (the-as clm-item s3-2) button-symbol) + ) + ) + ) + (cam-layout-print 320 s4-1 *temp-string*) + (+! s4-1 14) + ) + ) + ) + ) + ) + ) + (if (= *master-mode* 'menu) + (goto cfg-65) + ) + (dotimes (s5-3 (-> arg0 items length)) + (cond + ((type? (-> arg0 items s5-3) clm-list) + (let ((s4-3 (-> arg0 items s5-3)) + (s3-3 0) + ) + (if (-> (the-as clm-list s4-3) tracker) + (set! (-> (the-as clm-list s4-3) tracker value) + (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) track-val) + ) + ) + (dotimes (s2-2 (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions length)) + (if (cam-layout-do-action + (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions s2-2) + ) + (goto cfg-65) + ) + ) + (cond + ((cpad-pressed? 0 down) + (set! s3-3 1) + ) + ((cpad-pressed? 0 right) + (set! s3-3 1) + ) + ((cpad-pressed? 0 up) + (set! s3-3 -1) + ) + ((cpad-pressed? 0 left) + (set! s3-3 -1) + ) + ) + (when (nonzero? s3-3) + (set! (-> (the-as clm-list s4-3) cur-list-item) + (mod (+ (-> (the-as clm-list s4-3) cur-list-item) s3-3) (-> (the-as clm-list s4-3) items length)) + ) + (while (< (-> (the-as clm-list s4-3) cur-list-item) 0) + (+! (-> (the-as clm-list s4-3) cur-list-item) (-> (the-as clm-list s4-3) items length)) + ) + (goto cfg-65) + ) + ) + ) + ((cam-layout-do-action (-> (the-as clm-item (-> arg0 items s5-3)) action)) + (goto cfg-65) + ) + ) + ) + (label cfg-65) + #f + ) + +;; failed to figure out what this is: +(defstate cam-layout-active (cam-layout) + :code (behavior () + (until #f + (cam-layout-entity-info (the-as entity-actor (-> self cam-entity))) + (cam-layout-do-menu *clm*) + (suspend) + ) + #f + (none) + ) + ) + +;; definition for function cam-layout-init +(defbehavior cam-layout-init cam-layout () + (set! (-> self res-key) -1000000000.0) + (set! (-> self num-entities) 0) + (let ((v1-2 (-> *camera-engine* alive-list next0))) + *camera-engine* + (let ((a0-2 (-> v1-2 next0))) + (while (!= v1-2 (-> *camera-engine* alive-list-end)) + (-> (the-as connection v1-2) param1) + (+! (-> self num-entities) 1) + (set! v1-2 a0-2) + *camera-engine* + (set! a0-2 (-> a0-2 next0)) + ) + ) + ) + (set! (-> self cur-entity) *last-cur-entity*) + (clmf-next-entity 0) + (set! *clm* *clm-select*) + (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) + ) + (cond + ((not *cam-layout*) + (let ((v1-4 (process-spawn-function cam-layout cam-layout-init :from *camera-dead-pool*))) + (cond + (v1-4 + (logclear! (-> v1-4 0 mask) (process-mask freeze pause menu)) + (set! *cam-layout* #t) + (set! *camera-layout-blink* #f) + ) + (else + (format 0 "ERROR : no process available to start cam editing mode~%") + ) + ) + ) + ) + (else + (format 0 "ERROR : cam editing mode already started~%") + ) + ) + *cam-layout* + ) + +;; definition for function cam-layout-restart +(defun cam-layout-restart () + (cam-layout-stop) + (cam-layout-start) + ) + +) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc index d0ca9fd56c..2e81337eba 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc @@ -343,18 +343,18 @@ :max (new 'static 'vector :x 6144.0 :y 11059.2 :z 6144.0 :w 1.0) ) :local-player-spheres (new 'static 'inline-array sphere 12 - (new 'static 'sphere :x 1720.32 :y -819.2 :w 1433.6) - (new 'static 'sphere :x 2293.76 :y -3276.8 :w 1884.16) - (new 'static 'sphere :x 1966.08 :y -6144.0 :w 1556.48) - (new 'static 'sphere :x 1966.08 :y -8601.6 :w 1556.48) - (new 'static 'sphere :x 1761.28 :y -11059.2 :w 1351.68) - (new 'static 'sphere :x 1679.36 :y -13312.0 :w 1269.76) - (new 'static 'sphere :x -737.28 :y 4096.0 :w 3072.0) - (new 'static 'sphere :x -737.28 :y 6553.6 :w 3072.0) - (new 'static 'sphere :x -737.28 :y 9420.8 :w 3072.0) - (new 'static 'sphere :x 1720.32 :y 3686.4 :w 2949.12) - (new 'static 'sphere :x 1720.32 :y 5734.4 :w 2949.12) - (new 'static 'sphere :x 1720.32 :y 8601.6 :w 2949.12) + (new 'static 'sphere :x 1720.32 :y -819.2 :r 1433.6) + (new 'static 'sphere :x 2293.76 :y -3276.8 :r 1884.16) + (new 'static 'sphere :x 1966.08 :y -6144.0 :r 1556.48) + (new 'static 'sphere :x 1966.08 :y -8601.6 :r 1556.48) + (new 'static 'sphere :x 1761.28 :y -11059.2 :r 1351.68) + (new 'static 'sphere :x 1679.36 :y -13312.0 :r 1269.76) + (new 'static 'sphere :x -737.28 :y 4096.0 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 6553.6 :r 3072.0) + (new 'static 'sphere :x -737.28 :y 9420.8 :r 3072.0) + (new 'static 'sphere :x 1720.32 :y 3686.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 5734.4 :r 2949.12) + (new 'static 'sphere :x 1720.32 :y 8601.6 :r 2949.12) ) ) ) diff --git a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc index 02f04d3cdf..d693998b1a 100644 --- a/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -1284,9 +1284,9 @@ ;; definition of type collide-shape (deftype collide-shape (trsqv) ((actor-hash-index int16 :offset 12) - (process process :offset-assert 140) + (process process-drawable :offset-assert 140) (max-iteration-count uint8 :offset-assert 144) - (nav-flags uint8 :offset-assert 145) + (nav-flags nav-flags :offset-assert 145) (total-prims uint8 :offset-assert 146) (num-riders uint8 :offset-assert 147) (pat-ignore-mask pat-surface :offset-assert 148) @@ -1964,7 +1964,7 @@ (set! (-> s5-0 actor-hash-index) -1) (set! (-> s5-0 process) arg0) (set! (-> s5-0 max-iteration-count) (the-as uint 1)) - (set! (-> s5-0 nav-flags) (the-as uint 1)) + (set! (-> s5-0 nav-flags) (nav-flags nav-flags0)) (set! (-> s5-0 event-self) #f) (set! (-> s5-0 event-other) #f) (set! (-> s5-0 riders) (the-as pointer #f)) diff --git a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc index a07c45ea7e..25dd9ecbe0 100644 --- a/test/decompiler/reference/jak2/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/debug_REF.gc @@ -1085,7 +1085,7 @@ ;; definition (debug) for function add-debug-text-sphere (defun-debug add-debug-text-sphere ((enable symbol) (bucket bucket-id) (position vector) (radius meters) (text string) (color rgba)) (add-debug-sphere enable bucket position radius color) - (add-debug-text-3d enable bucket text position (font-color default) (the-as vector2h #f)) + (add-debug-text-3d enable bucket text position (font-color default-#cddbcd) (the-as vector2h #f)) #f ) @@ -1879,16 +1879,16 @@ (+ y -4) (cond ((= v1-7 1) - (font-color orange-red) + (font-color precursor-#ec3b00) ) ((= v1-7 2) - (font-color fc-5) + (font-color yellow-#f3f300) ) ((= v1-7 4) - (font-color fc-6) + (font-color green-#3df23d) ) (else - (font-color default) + (font-color default-#cddbcd) ) ) (font-flags shadow) diff --git a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc index 629ee08895..9cc4338bba 100644 --- a/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/default-menu_REF.gc @@ -176,7 +176,43 @@ ) ;; definition for function dm-cam-setting-float -;; ERROR: function has no type analysis. Cannot decompile. +(defun dm-cam-setting-float ((arg0 float) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (when (= arg1 (debug-menu-msg press)) + (case arg0 + (('fov) + (if (not (setting-control-method-14 *setting-control* 'fov)) + (set! arg2 64.0) + ) + (set-setting-by-param *setting-control* 'fov #f (* 182.04445 arg2) 0) + (if *camera-combiner* + (set! (-> *camera-combiner* fov) (* 182.04445 arg2)) + ) + (if (and *camera* (-> *camera* slave)) + (set! (-> *camera* slave 0 fov) (* 182.04445 arg2)) + ) + ) + ) + ) + (cond + ((= arg0 'fov) + (cond + ((setting-control-method-14 *setting-control* 'fov) + (empty) + arg2 + ) + (*math-camera* + (* 0.005493164 (-> *math-camera* fov)) + ) + (else + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) ;; definition for function dm-cam-render-float (defun dm-cam-render-float ((arg0 int) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) @@ -1037,16 +1073,16 @@ (when (and s5-0 s4-0) (dotimes (s3-0 (-> s5-0 length)) (when (and (-> s5-0 data s3-0) (nonzero? (-> s4-0 next s3-0))) - (let ((t9-1 (method-of-type debug-menu-item-flag new)) - (a0-8 'debug) - (a1-0 debug-menu-item-flag) + (let ((a1-1 (new + 'debug + 'debug-menu-item-flag + (-> s5-0 data s3-0 name) + (logior (shr (shl s3-0 52) 44) (shr (shl gp-0 52) 32)) + dm-shader-pick-func + ) + ) ) - (-> s5-0 data s3-0 name) - (logior (shr (shl s3-0 52) 44) (shr (shl gp-0 52) 32)) - dm-shader-pick-func - (let ((a1-1 (t9-1 a0-8 a1-0))) - (debug-menu-append-item *shader-pick-menu* a1-1) - ) + (debug-menu-append-item *shader-pick-menu* a1-1) ) ) ) @@ -1117,28 +1153,18 @@ ((drawable-tree-instance-shrub) (let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub))) (dotimes (s2-0 (-> s3-0 length)) - (let ((t9-4 (method-of-type debug-menu-item-flag new)) - (a0-9 'global) - (a1-3 debug-menu-item-flag) + (let ((a1-4 + (new 'global 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-instance-pick-func) + ) ) - (-> s3-0 data s2-0 name) - (-> s3-0 data s2-0 name) - dm-instance-pick-func - (let ((a1-4 (t9-4 a0-9 a1-3))) - (debug-menu-append-item *instance-shrub-menu* a1-4) - ) + (debug-menu-append-item *instance-shrub-menu* a1-4) ) - (let ((t9-6 (method-of-type debug-menu-item-flag new)) - (a0-11 'debug) - (a1-5 debug-menu-item-flag) + (let ((a1-6 + (new 'debug 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-enable-instance-func) + ) ) - (-> s3-0 data s2-0 name) - (-> s3-0 data s2-0 name) - dm-enable-instance-func - (let ((a1-6 (t9-6 a0-11 a1-5))) - (set! (-> a1-6 is-on) #t) - (debug-menu-append-item *enable-instance-shrub-menu* a1-6) - ) + (set! (-> a1-6 is-on) #t) + (debug-menu-append-item *enable-instance-shrub-menu* a1-6) ) ) ) @@ -1146,28 +1172,30 @@ ((drawable-tree-instance-tie) (let ((s3-1 (-> (the-as drawable-tree-instance-tie v1-7) prototypes prototype-array-tie))) (dotimes (s2-1 (-> s3-1 length)) - (let ((t9-8 (method-of-type debug-menu-item-flag new)) - (a0-15 'debug) - (a1-8 debug-menu-item-flag) + (let ((a1-9 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (-> s3-1 array-data s2-1 name) + dm-instance-pick-func + ) + ) ) - (-> s3-1 array-data s2-1 name) - (-> s3-1 array-data s2-1 name) - dm-instance-pick-func - (let ((a1-9 (t9-8 a0-15 a1-8))) - (debug-menu-append-item *instance-tie-menu* a1-9) - ) + (debug-menu-append-item *instance-tie-menu* a1-9) ) - (let ((t9-10 (method-of-type debug-menu-item-flag new)) - (a0-17 'debug) - (a1-10 debug-menu-item-flag) + (let ((a1-11 + (new + 'debug + 'debug-menu-item-flag + (-> s3-1 array-data s2-1 name) + (-> s3-1 array-data s2-1 name) + dm-enable-instance-func + ) + ) ) - (-> s3-1 array-data s2-1 name) - (-> s3-1 array-data s2-1 name) - dm-enable-instance-func - (let ((a1-11 (t9-10 a0-17 a1-10))) - (set! (-> a1-11 is-on) #t) - (debug-menu-append-item *enable-instance-tie-menu* a1-11) - ) + (set! (-> a1-11 is-on) #t) + (debug-menu-append-item *enable-instance-tie-menu* a1-11) ) ) ) @@ -1322,774 +1350,289 @@ ;; definition for function debug-menu-make-camera-mode-menu (defun debug-menu-make-camera-mode-menu ((arg0 debug-menu) (arg1 debug-menu)) - (let ((t9-0 (method-of-type debug-menu-item-submenu new)) - (a0-1 'debug) - (a1-1 debug-menu-item-submenu) - ) - "Camera" - (t9-0 a0-1 a1-1) + (new 'debug 'debug-menu-item-submenu "Camera" arg0) + (let ((a1-3 (new 'debug 'debug-menu-item-submenu "Mode" arg1))) + (debug-menu-append-item arg0 a1-3) ) - (let ((t9-1 (method-of-type debug-menu-item-submenu new)) - (a0-2 'debug) - (a1-2 debug-menu-item-submenu) - ) - "Mode" - (let ((a1-3 (t9-1 a0-2 a1-2))) - (debug-menu-append-item arg0 a1-3) - ) + (let ((a1-5 (new 'debug 'debug-menu-item-flag "Default" #f dm-cam-mode-default))) + (debug-menu-append-item arg1 a1-5) ) - (let ((t9-3 (method-of-type debug-menu-item-flag new)) - (a0-4 'debug) - (a1-4 debug-menu-item-flag) - ) - "Default" - dm-cam-mode-default - (let ((a1-5 (t9-3 a0-4 a1-4))) - (debug-menu-append-item arg1 a1-5) - ) + (let ((a1-7 (new 'debug 'debug-menu-item-flag "Free-floating" cam-free-floating dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-7) ) - (let ((t9-5 (method-of-type debug-menu-item-flag new)) - (a0-6 'debug) - (a1-6 debug-menu-item-flag) - ) - "Free-floating" - cam-free-floating - dm-cam-mode-func - (let ((a1-7 (t9-5 a0-6 a1-6))) - (debug-menu-append-item arg1 a1-7) - ) + (let ((a1-9 (new 'debug 'debug-menu-item-flag "Fixed" cam-fixed dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-9) ) - (let ((t9-7 (method-of-type debug-menu-item-flag new)) - (a0-8 'debug) - (a1-8 debug-menu-item-flag) - ) - "Fixed" - cam-fixed - dm-cam-mode-func - (let ((a1-9 (t9-7 a0-8 a1-8))) - (debug-menu-append-item arg1 a1-9) - ) + (let ((a1-11 (new 'debug 'debug-menu-item-flag "Pov" cam-pov dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-11) ) - (let ((t9-9 (method-of-type debug-menu-item-flag new)) - (a0-10 'debug) - (a1-10 debug-menu-item-flag) - ) - "Pov" - cam-pov - dm-cam-mode-func - (let ((a1-11 (t9-9 a0-10 a1-10))) - (debug-menu-append-item arg1 a1-11) - ) + (let ((a1-13 (new 'debug 'debug-menu-item-flag "Pov180" cam-pov180 dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-13) ) - (let ((t9-11 (method-of-type debug-menu-item-flag new)) - (a0-12 'debug) - (a1-12 debug-menu-item-flag) - ) - "Pov180" - cam-pov180 - dm-cam-mode-func - (let ((a1-13 (t9-11 a0-12 a1-12))) - (debug-menu-append-item arg1 a1-13) - ) + (let ((a1-15 (new 'debug 'debug-menu-item-flag "Pov-track" cam-pov-track dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-15) ) - (let ((t9-13 (method-of-type debug-menu-item-flag new)) - (a0-14 'debug) - (a1-14 debug-menu-item-flag) - ) - "Pov-track" - cam-pov-track - dm-cam-mode-func - (let ((a1-15 (t9-13 a0-14 a1-14))) - (debug-menu-append-item arg1 a1-15) - ) + (let ((a1-17 (new 'debug 'debug-menu-item-flag "Decel" cam-decel dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-17) ) - (let ((t9-15 (method-of-type debug-menu-item-flag new)) - (a0-16 'debug) - (a1-16 debug-menu-item-flag) - ) - "Decel" - cam-decel - dm-cam-mode-func - (let ((a1-17 (t9-15 a0-16 a1-16))) - (debug-menu-append-item arg1 a1-17) - ) + (let ((a1-19 (new 'debug 'debug-menu-item-flag "Endless fall" cam-endlessfall dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-19) ) - (let ((t9-17 (method-of-type debug-menu-item-flag new)) - (a0-18 'debug) - (a1-18 debug-menu-item-flag) - ) - "Endless fall" - cam-endlessfall - dm-cam-mode-func - (let ((a1-19 (t9-17 a0-18 a1-18))) - (debug-menu-append-item arg1 a1-19) - ) + (let ((a1-21 (new 'debug 'debug-menu-item-flag "Eye" cam-eye dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-21) ) - (let ((t9-19 (method-of-type debug-menu-item-flag new)) - (a0-20 'debug) - (a1-20 debug-menu-item-flag) - ) - "Eye" - cam-eye - dm-cam-mode-func - (let ((a1-21 (t9-19 a0-20 a1-20))) - (debug-menu-append-item arg1 a1-21) - ) + (let ((a1-23 (new 'debug 'debug-menu-item-flag "Stick" cam-stick dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-23) ) - (let ((t9-21 (method-of-type debug-menu-item-flag new)) - (a0-22 'debug) - (a1-22 debug-menu-item-flag) - ) - "Stick" - cam-stick - dm-cam-mode-func - (let ((a1-23 (t9-21 a0-22 a1-22))) - (debug-menu-append-item arg1 a1-23) - ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "String" cam-string dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-25) ) - (let ((t9-23 (method-of-type debug-menu-item-flag new)) - (a0-24 'debug) - (a1-24 debug-menu-item-flag) - ) - "String" - cam-string - dm-cam-mode-func - (let ((a1-25 (t9-23 a0-24 a1-24))) - (debug-menu-append-item arg1 a1-25) - ) + (let ((a1-27 (new 'debug 'debug-menu-item-flag "Standoff" cam-standoff dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-27) ) - (let ((t9-25 (method-of-type debug-menu-item-flag new)) - (a0-26 'debug) - (a1-26 debug-menu-item-flag) - ) - "Standoff" - cam-standoff - dm-cam-mode-func - (let ((a1-27 (t9-25 a0-26 a1-26))) - (debug-menu-append-item arg1 a1-27) - ) + (let ((a1-29 (new 'debug 'debug-menu-item-flag "Circular" cam-circular dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-29) ) - (let ((t9-27 (method-of-type debug-menu-item-flag new)) - (a0-28 'debug) - (a1-28 debug-menu-item-flag) - ) - "Circular" - cam-circular - dm-cam-mode-func - (let ((a1-29 (t9-27 a0-28 a1-28))) - (debug-menu-append-item arg1 a1-29) - ) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Look At" cam-lookat dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-31) ) - (let ((t9-29 (method-of-type debug-menu-item-flag new)) - (a0-30 'debug) - (a1-30 debug-menu-item-flag) - ) - "Look At" - cam-lookat - dm-cam-mode-func - (let ((a1-31 (t9-29 a0-30 a1-30))) - (debug-menu-append-item arg1 a1-31) - ) + (let ((a1-33 (new 'debug 'debug-menu-item-flag "Center of world" cam-point-watch dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-33) ) - (let ((t9-31 (method-of-type debug-menu-item-flag new)) - (a0-32 'debug) - (a1-32 debug-menu-item-flag) - ) - "Center of world" - cam-point-watch - dm-cam-mode-func - (let ((a1-33 (t9-31 a0-32 a1-32))) - (debug-menu-append-item arg1 a1-33) - ) + (let ((a1-35 (new 'debug 'debug-menu-item-flag "Spline" cam-spline dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-35) ) - (let ((t9-33 (method-of-type debug-menu-item-flag new)) - (a0-34 'debug) - (a1-34 debug-menu-item-flag) - ) - "Spline" - cam-spline - dm-cam-mode-func - (let ((a1-35 (t9-33 a0-34 a1-34))) - (debug-menu-append-item arg1 a1-35) - ) + (let ((a1-37 (new 'debug 'debug-menu-item-flag "Bike" cam-bike dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-37) ) - (let ((t9-35 (method-of-type debug-menu-item-flag new)) - (a0-36 'debug) - (a1-36 debug-menu-item-flag) - ) - "Bike" - cam-bike - dm-cam-mode-func - (let ((a1-37 (t9-35 a0-36 a1-36))) - (debug-menu-append-item arg1 a1-37) - ) - ) - (let ((t9-37 (method-of-type debug-menu-item-flag new)) - (a0-38 'debug) - (a1-38 debug-menu-item-flag) - ) - "Robotboss" - cam-robotboss - dm-cam-mode-func - (let ((a1-39 (t9-37 a0-38 a1-38))) - (debug-menu-append-item arg1 a1-39) - ) + (let ((a1-39 (new 'debug 'debug-menu-item-flag "Robotboss" cam-robotboss dm-cam-mode-func))) + (debug-menu-append-item arg1 a1-39) ) ) ;; definition for function debug-menu-make-camera-menu (defun debug-menu-make-camera-menu ((arg0 debug-menu-context)) - (let ((t9-0 (method-of-type debug-menu new)) - (a0-1 'debug) - (a1-0 debug-menu) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Camera menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Camera" gp-0)) + ) + (let ((a1-3 (new 'debug 'debug-menu arg0 "Camera mode menu"))) + (debug-menu-make-camera-mode-menu gp-0 a1-3) + ) + (let ((s3-0 (new 'debug 'debug-menu arg0 "Camera externalize menu"))) + (let ((a1-6 (new 'debug 'debug-menu-item-submenu "External" s3-0))) + (debug-menu-append-item gp-0 a1-6) ) - "Camera menu" - (let ((gp-0 (t9-0 a0-1 a1-0)) - (t9-1 (method-of-type debug-menu-item-submenu new)) - (a0-2 'debug) - (a1-1 debug-menu-item-submenu) - ) - "Camera" - (let ((s5-0 (t9-1 a0-2 a1-1))) - (let ((t9-2 (method-of-type debug-menu new)) - (a0-3 'debug) - (a1-2 debug-menu) - ) - "Camera mode menu" - (let ((a1-3 (t9-2 a0-3 a1-2))) - (debug-menu-make-camera-mode-menu gp-0 a1-3) - ) - ) - (let ((t9-4 (method-of-type debug-menu new)) - (a0-5 'debug) - (a1-4 debug-menu) - ) - "Camera externalize menu" - (let ((s3-0 (t9-4 a0-5 a1-4))) - (let ((t9-5 (method-of-type debug-menu-item-submenu new)) - (a0-6 'debug) - (a1-5 debug-menu-item-submenu) - ) - "External" - (let ((a1-6 (t9-5 a0-6 a1-5))) - (debug-menu-append-item gp-0 a1-6) - ) - ) - (let ((t9-7 (method-of-type debug-menu-item-flag new)) - (a0-8 'debug) - (a1-7 debug-menu-item-flag) - ) - "CPad 0" - 'pad-0 - dm-cam-externalize - (let ((a1-8 (t9-7 a0-8 a1-7))) - (debug-menu-append-item s3-0 a1-8) - ) - ) - (let ((t9-9 (method-of-type debug-menu-item-flag new)) - (a0-10 'debug) - (a1-9 debug-menu-item-flag) - ) - "CPad 1" - 'pad-1 - dm-cam-externalize - (let ((a1-10 (t9-9 a0-10 a1-9))) - (debug-menu-append-item s3-0 a1-10) - ) - ) - (let ((t9-11 (method-of-type debug-menu-item-flag new)) - (a0-12 'debug) - (a1-11 debug-menu-item-flag) - ) - "Lock" - 'locked - dm-cam-externalize - (let ((a1-12 (t9-11 a0-12 a1-11))) - (debug-menu-append-item s3-0 a1-12) - ) - ) - (let ((t9-13 (method-of-type debug-menu-item-flag new)) - (a0-14 'debug) - (a1-13 debug-menu-item-flag) - ) - "Reset" - 'reset - dm-cam-externalize - (let ((a1-14 (t9-13 a0-14 a1-13))) - (debug-menu-append-item s3-0 a1-14) - ) - ) - (let ((t9-15 (method-of-type debug-menu-item-flag new)) - (a0-16 'debug) - (a1-15 debug-menu-item-flag) - ) - "Allow z rot" - 'allow-z - dm-cam-externalize - (let ((a1-16 (t9-15 a0-16 a1-15))) - (debug-menu-append-item s3-0 a1-16) - ) - ) - (let ((t9-17 (method-of-type debug-menu-item-var new)) - (a0-18 'debug) - (a1-17 debug-menu-item-var) - ) - "Fov" - 0 - 80 - (let ((s2-0 (t9-17 a0-18 a1-17))) - (debug-menu-item-var-make-float s2-0 dm-cam-render-float 1.0 #t 15.0 180.0 1) - (debug-menu-append-item s3-0 s2-0) - ) - ) - ) - ) - (let ((t9-20 (method-of-type debug-menu new)) - (a0-21 'debug) - (a1-20 debug-menu) - ) - "Camera collision menu" - (let ((s3-1 (t9-20 a0-21 a1-20))) - (let ((t9-21 (method-of-type debug-menu-item-submenu new)) - (a0-22 'debug) - (a1-21 debug-menu-item-submenu) - ) - "Collision" - (let ((a1-22 (t9-21 a0-22 a1-21))) - (debug-menu-append-item gp-0 a1-22) - ) - ) - (let ((t9-23 (method-of-type debug-menu-item-flag new)) - (a0-24 'debug) - (a1-23 debug-menu-item-flag) - ) - "Record" - '*record-cam-collide-history* - dm-boolean-toggle-pick-func - (let ((a1-24 (t9-23 a0-24 a1-23))) - (debug-menu-append-item s3-1 a1-24) - ) - ) - (let ((t9-25 (method-of-type debug-menu-item-flag new)) - (a0-26 'debug) - (a1-25 debug-menu-item-flag) - ) - "Display" - '*display-cam-collide-history* - dm-boolean-toggle-pick-func - (let ((a1-26 (t9-25 a0-26 a1-25))) - (debug-menu-append-item s3-1 a1-26) - ) - ) - ) - ) - (let ((t9-27 (method-of-type debug-menu new)) - (a0-28 'debug) - (a1-27 debug-menu) - ) - "Camera settings menu" - (let ((s4-1 (t9-27 a0-28 a1-27))) - (let ((t9-28 (method-of-type debug-menu-item-submenu new)) - (a0-29 'debug) - (a1-28 debug-menu-item-submenu) - ) - "Settings" - (let ((a1-29 (t9-28 a0-29 a1-28))) - (debug-menu-append-item gp-0 a1-29) - ) - ) - (let ((t9-30 (method-of-type debug-menu-item-flag new)) - (a0-31 'debug) - (a1-30 debug-menu-item-flag) - ) - "Default" - dm-cam-settings-default - (let ((a1-31 (t9-30 a0-31 a1-30))) - (debug-menu-append-item s4-1 a1-31) - ) - ) - (let ((t9-32 (method-of-type debug-menu-item-var new)) - (a0-33 'debug) - (a1-32 debug-menu-item-var) - ) - "Fov" - 'fov - 80 - (let ((s3-2 (t9-32 a0-33 a1-32))) - (debug-menu-item-var-make-float - s3-2 - (the-as (function int debug-menu-msg float float float) dm-cam-setting-float) - 1.0 - #t - 15.0 - 180.0 - 1 - ) - (debug-menu-append-item s4-1 s3-2) - ) - ) - (let ((t9-35 (method-of-type debug-menu-item-flag new)) - (a0-36 'debug) - (a1-35 debug-menu-item-flag) - ) - "Butt cam" - 0 - dm-cam-settings-func - (let ((a1-36 (t9-35 a0-36 a1-35))) - (debug-menu-append-item s4-1 a1-36) - ) - ) - (let ((t9-37 (method-of-type debug-menu-item-flag new)) - (a0-38 'debug) - (a1-37 debug-menu-item-flag) - ) - "Same side" - 1 - dm-cam-settings-func - (let ((a1-38 (t9-37 a0-38 a1-37))) - (debug-menu-append-item s4-1 a1-38) - ) - ) - (let ((t9-39 (method-of-type debug-menu-item-flag new)) - (a0-40 'debug) - (a1-39 debug-menu-item-flag) - ) - "Move spherical" - 2 - dm-cam-settings-func - (let ((a1-40 (t9-39 a0-40 a1-39))) - (debug-menu-append-item s4-1 a1-40) - ) - ) - (let ((t9-41 (method-of-type debug-menu-item-flag new)) - (a0-42 'debug) - (a1-41 debug-menu-item-flag) - ) - "Drag" - 3 - dm-cam-settings-func - (let ((a1-42 (t9-41 a0-42 a1-41))) - (debug-menu-append-item s4-1 a1-42) - ) - ) - (let ((t9-43 (method-of-type debug-menu-item-flag new)) - (a0-44 'debug) - (a1-43 debug-menu-item-flag) - ) - "Allow Z rot" - 4 - dm-cam-settings-func - (let ((a1-44 (t9-43 a0-44 a1-43))) - (debug-menu-append-item s4-1 a1-44) - ) - ) - (let ((t9-45 (method-of-type debug-menu-item-flag new)) - (a0-46 'debug) - (a1-45 debug-menu-item-flag) - ) - "Pitch for jump" - 6 - dm-cam-settings-func - (let ((a1-46 (t9-45 a0-46 a1-45))) - (debug-menu-append-item s4-1 a1-46) - ) - ) - (let ((t9-47 (method-of-type debug-menu-item-flag new)) - (a0-48 'debug) - (a1-47 debug-menu-item-flag) - ) - "Find hidden target" - 7 - dm-cam-settings-func - (let ((a1-48 (t9-47 a0-48 a1-47))) - (debug-menu-append-item s4-1 a1-48) - ) - ) - (let ((t9-49 (method-of-type debug-menu-item-flag new)) - (a0-50 'debug) - (a1-49 debug-menu-item-flag) - ) - "Collide" - 8 - dm-cam-settings-func - (let ((a1-50 (t9-49 a0-50 a1-49))) - (debug-menu-append-item s4-1 a1-50) - ) - ) - (let ((t9-51 (method-of-type debug-menu-item-flag new)) - (a0-52 'debug) - (a1-51 debug-menu-item-flag) - ) - "Line of Sight" - 9 - dm-cam-settings-func - (let ((a1-52 (t9-51 a0-52 a1-51))) - (debug-menu-append-item s4-1 a1-52) - ) - ) - (let ((t9-53 (method-of-type debug-menu-item-flag new)) - (a0-54 'debug) - (a1-53 debug-menu-item-flag) - ) - "No Rotate" - 10 - dm-cam-settings-func - (let ((a1-54 (t9-53 a0-54 a1-53))) - (debug-menu-append-item s4-1 a1-54) - ) - ) - (let ((t9-55 (method-of-type debug-menu-item-flag new)) - (a0-56 'debug) - (a1-55 debug-menu-item-flag) - ) - "Sticky Angle" - 11 - dm-cam-settings-func - (let ((a1-56 (t9-55 a0-56 a1-55))) - (debug-menu-append-item s4-1 a1-56) - ) - ) - (let ((t9-57 (method-of-type debug-menu-item-var new)) - (a0-58 'debug) - (a1-57 debug-menu-item-var) - ) - "Interp Frms" - 40 - 80 - (let ((s3-3 (t9-57 a0-58 a1-57))) - (debug-menu-item-var-make-int s3-3 dm-cam-settings-func-int 1 #f 0 0 #f) - (debug-menu-append-item s4-1 s3-3) - ) - ) - (let ((t9-60 (method-of-type debug-menu-item-flag new)) - (a0-61 'debug) - (a1-60 debug-menu-item-flag) - ) - "no mip/lod correction" - '*camera-no-mip-correction* - dm-boolean-toggle-pick-func - (let ((a1-61 (t9-60 a0-61 a1-60))) - (debug-menu-append-item s4-1 a1-61) - ) - ) - (let ((t9-62 (method-of-type debug-menu-item-flag new)) - (a0-63 'debug) - (a1-62 debug-menu-item-flag) - ) - "last attacker" - '*display-camera-last-attacker* - dm-boolean-toggle-pick-func - (let ((a1-63 (t9-62 a0-63 a1-62))) - (debug-menu-append-item s4-1 a1-63) - ) - ) - (let ((t9-64 (method-of-type debug-menu-item-flag new)) - (a0-65 'debug) - (a1-64 debug-menu-item-flag) - ) - "old stats" - '*display-camera-old-stats* - dm-boolean-toggle-pick-func - (let ((a1-65 (t9-64 a0-65 a1-64))) - (debug-menu-append-item s4-1 a1-65) - ) - ) - (let ((t9-66 (method-of-type debug-menu-item-flag new)) - (a0-67 'debug) - (a1-66 debug-menu-item-flag) - ) - "xyz axes" - '*display-xyz-axes* - dm-boolean-toggle-pick-func - (let ((a1-67 (t9-66 a0-67 a1-66))) - (debug-menu-append-item s4-1 a1-67) - ) - ) - (let ((t9-68 (method-of-type debug-menu-item-flag new)) - (a0-69 'debug) - (a1-68 debug-menu-item-flag) - ) - "Master Marks" - '*display-cam-master-marks* - dm-boolean-toggle-pick-func - (let ((a1-69 (t9-68 a0-69 a1-68))) - (debug-menu-append-item s4-1 a1-69) - ) - ) - (let ((t9-70 (method-of-type debug-menu-item-flag new)) - (a0-71 'debug) - (a1-70 debug-menu-item-flag) - ) - "Other Marks" - '*display-cam-other* - dm-boolean-toggle-pick-func - (let ((a1-71 (t9-70 a0-71 a1-70))) - (debug-menu-append-item s4-1 a1-71) - ) - ) - (let ((t9-72 (method-of-type debug-menu-item-flag new)) - (a0-73 'debug) - (a1-72 debug-menu-item-flag) - ) - "los debug" - '*display-cam-los-debug* - dm-boolean-toggle-pick-func - (let ((a1-73 (t9-72 a0-73 a1-72))) - (debug-menu-append-item s4-1 a1-73) - ) - ) - (let ((t9-74 (method-of-type debug-menu-item-flag new)) - (a0-75 'debug) - (a1-74 debug-menu-item-flag) - ) - "los info" - '*display-cam-los-info* - dm-boolean-toggle-pick-func - (let ((a1-75 (t9-74 a0-75 a1-74))) - (debug-menu-append-item s4-1 a1-75) - ) - ) - (let ((t9-76 (method-of-type debug-menu-item-flag new)) - (a0-77 'debug) - (a1-76 debug-menu-item-flag) - ) - "los Marks" - '*display-cam-los-marks* - dm-boolean-toggle-pick-func - (let ((a1-77 (t9-76 a0-77 a1-76))) - (debug-menu-append-item s4-1 a1-77) - ) - ) - (let ((t9-78 (method-of-type debug-menu-item-flag new)) - (a0-79 'debug) - (a1-78 debug-menu-item-flag) - ) - "coll Marks" - '*display-cam-coll-marks* - dm-boolean-toggle-pick-func - (let ((a1-79 (t9-78 a0-79 a1-78))) - (debug-menu-append-item s4-1 a1-79) - ) - ) - (let ((t9-80 (method-of-type debug-menu-item-flag new)) - (a0-81 'debug) - (a1-80 debug-menu-item-flag) - ) - "Camera Marks" - '*display-camera-marks* - dm-boolean-toggle-pick-func - (let ((a1-81 (t9-80 a0-81 a1-80))) - (debug-menu-append-item s4-1 a1-81) - ) - ) - ) - ) - (let ((t9-82 (method-of-type debug-menu-item-flag new)) - (a0-83 'debug) - (a1-82 debug-menu-item-flag) - ) - "Edit" - '*cam-layout* - L753 - (let ((a1-83 (t9-82 a0-83 a1-82))) - (debug-menu-append-item gp-0 a1-83) - ) - ) - (let ((t9-84 (method-of-type debug-menu-item-function new)) - (a0-85 'debug) - (a1-84 debug-menu-item-function) - ) - "Save Pos" - debug-create-cam-restore - (let ((a1-85 (t9-84 a0-85 a1-84))) - (debug-menu-append-item gp-0 a1-85) - ) - ) - s5-0 + (let ((a1-8 (new 'debug 'debug-menu-item-flag "CPad 0" 'pad-0 dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-8) + ) + (let ((a1-10 (new 'debug 'debug-menu-item-flag "CPad 1" 'pad-1 dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-10) + ) + (let ((a1-12 (new 'debug 'debug-menu-item-flag "Lock" 'locked dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-12) + ) + (let ((a1-14 (new 'debug 'debug-menu-item-flag "Reset" 'reset dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-14) + ) + (let ((a1-16 (new 'debug 'debug-menu-item-flag "Allow z rot" 'allow-z dm-cam-externalize))) + (debug-menu-append-item s3-0 a1-16) + ) + (let ((s2-0 (new 'debug 'debug-menu-item-var "Fov" 0 80))) + (debug-menu-item-var-make-float s2-0 dm-cam-render-float 1.0 #t 15.0 180.0 1) + (debug-menu-append-item s3-0 s2-0) ) ) + (let ((s3-1 (new 'debug 'debug-menu arg0 "Camera collision menu"))) + (let ((a1-22 (new 'debug 'debug-menu-item-submenu "Collision" s3-1))) + (debug-menu-append-item gp-0 a1-22) + ) + (let ((a1-24 (new 'debug 'debug-menu-item-flag "Record" '*record-cam-collide-history* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s3-1 a1-24) + ) + (let ((a1-26 + (new 'debug 'debug-menu-item-flag "Display" '*display-cam-collide-history* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s3-1 a1-26) + ) + ) + (let ((s4-1 (new 'debug 'debug-menu arg0 "Camera settings menu"))) + (let ((a1-29 (new 'debug 'debug-menu-item-submenu "Settings" s4-1))) + (debug-menu-append-item gp-0 a1-29) + ) + (let ((a1-31 (new 'debug 'debug-menu-item-flag "Default" #f dm-cam-settings-default))) + (debug-menu-append-item s4-1 a1-31) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "Fov" (the-as int 'fov) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-cam-setting-float) + 1.0 + #t + 15.0 + 180.0 + 1 + ) + (debug-menu-append-item s4-1 s3-2) + ) + (let ((a1-36 (new 'debug 'debug-menu-item-flag "Butt cam" 0 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-36) + ) + (let ((a1-38 (new 'debug 'debug-menu-item-flag "Same side" 1 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-38) + ) + (let ((a1-40 (new 'debug 'debug-menu-item-flag "Move spherical" 2 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-40) + ) + (let ((a1-42 (new 'debug 'debug-menu-item-flag "Drag" 3 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-42) + ) + (let ((a1-44 (new 'debug 'debug-menu-item-flag "Allow Z rot" 4 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-44) + ) + (let ((a1-46 (new 'debug 'debug-menu-item-flag "Pitch for jump" 6 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-46) + ) + (let ((a1-48 (new 'debug 'debug-menu-item-flag "Find hidden target" 7 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-48) + ) + (let ((a1-50 (new 'debug 'debug-menu-item-flag "Collide" 8 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-50) + ) + (let ((a1-52 (new 'debug 'debug-menu-item-flag "Line of Sight" 9 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-52) + ) + (let ((a1-54 (new 'debug 'debug-menu-item-flag "No Rotate" 10 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-54) + ) + (let ((a1-56 (new 'debug 'debug-menu-item-flag "Sticky Angle" 11 dm-cam-settings-func))) + (debug-menu-append-item s4-1 a1-56) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "Interp Frms" 40 80))) + (debug-menu-item-var-make-int s3-3 dm-cam-settings-func-int 1 #f 0 0 #f) + (debug-menu-append-item s4-1 s3-3) + ) + (let ((a1-61 (new + 'debug + 'debug-menu-item-flag + "no mip/lod correction" + '*camera-no-mip-correction* + dm-boolean-toggle-pick-func + ) + ) + ) + (debug-menu-append-item s4-1 a1-61) + ) + (let ((a1-63 + (new 'debug 'debug-menu-item-flag "last attacker" '*display-camera-last-attacker* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-63) + ) + (let ((a1-65 (new 'debug 'debug-menu-item-flag "old stats" '*display-camera-old-stats* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s4-1 a1-65) + ) + (let ((a1-67 (new 'debug 'debug-menu-item-flag "xyz axes" '*display-xyz-axes* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-67) + ) + (let ((a1-69 + (new 'debug 'debug-menu-item-flag "Master Marks" '*display-cam-master-marks* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item s4-1 a1-69) + ) + (let ((a1-71 (new 'debug 'debug-menu-item-flag "Other Marks" '*display-cam-other* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-71) + ) + (let ((a1-73 (new 'debug 'debug-menu-item-flag "los debug" '*display-cam-los-debug* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-73) + ) + (let ((a1-75 (new 'debug 'debug-menu-item-flag "los info" '*display-cam-los-info* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-75) + ) + (let ((a1-77 (new 'debug 'debug-menu-item-flag "los Marks" '*display-cam-los-marks* dm-boolean-toggle-pick-func))) + (debug-menu-append-item s4-1 a1-77) + ) + (let ((a1-79 (new 'debug 'debug-menu-item-flag "coll Marks" '*display-cam-coll-marks* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s4-1 a1-79) + ) + (let ((a1-81 (new 'debug 'debug-menu-item-flag "Camera Marks" '*display-camera-marks* dm-boolean-toggle-pick-func)) + ) + (debug-menu-append-item s4-1 a1-81) + ) + ) + (let ((a1-83 (new 'debug 'debug-menu-item-flag "Edit" '*cam-layout* (lambda ((arg0 symbol) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if (-> arg0 value) + (cam-layout-stop) + (cam-layout-start) + ) + ) + (-> arg0 value) + ) + ) + ) + ) + (debug-menu-append-item gp-0 a1-83) + ) + (let ((a1-85 (new + 'debug + 'debug-menu-item-function + "Save Pos" + #f + (the-as (function object object) debug-create-cam-restore) + ) + ) + ) + (debug-menu-append-item gp-0 a1-85) + ) + s5-0 ) ) ;; definition for function debug-menu-make-shader-menu (defun debug-menu-make-shader-menu ((arg0 debug-menu-context)) - (let ((t9-0 (method-of-type debug-menu new)) - (a0-1 'debug) - (a1-0 debug-menu) + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Shader menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Shader" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Shader pick menu"))) + (set! *shader-pick-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shader" a3-3))) + (debug-menu-append-item gp-0 a1-4) ) - "Shader menu" - (let ((gp-0 (t9-0 a0-1 a1-0)) - (t9-1 (method-of-type debug-menu-item-submenu new)) - (a0-2 'debug) - (a1-1 debug-menu-item-submenu) + ) + (let ((a1-6 (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-shader-list))) ) - "Shader" - (let ((s5-0 (t9-1 a0-2 a1-1))) - (let ((t9-2 (method-of-type debug-menu new)) - (a0-3 'debug) - (a1-2 debug-menu) - ) - "Shader pick menu" - (set! *shader-pick-menu* (t9-2 a0-3 a1-2)) - ) - (let ((t9-3 (method-of-type debug-menu-item-submenu new)) - (a0-4 'debug) - (a1-3 debug-menu-item-submenu) - ) - "Pick Shader" - (let ((a1-4 (t9-3 a0-4 a1-3))) - (debug-menu-append-item gp-0 a1-4) - ) - ) - (let ((t9-5 (method-of-type debug-menu-item-function new)) - (a0-6 'debug) - (a1-5 debug-menu-item-function) - ) - "Refresh" - build-shader-list - (let ((a1-6 (t9-5 a0-6 a1-5))) - (debug-menu-append-item gp-0 a1-6) - ) - ) - (let ((t9-7 (method-of-type debug-menu-item-var new)) - (a0-8 'debug) - (a1-7 debug-menu-item-var) - ) - "tweak" - '*edit-shader* - 80 - (let ((s4-1 (t9-7 a0-8 a1-7))) - (debug-menu-item-var-make-float - s4-1 - (the-as - (function int debug-menu-msg float float float) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (debug-menu-append-item gp-0 a1-6) + ) + (let ((s4-1 (new 'debug 'debug-menu-item-var "tweak" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-float + s4-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (cond + (*texture-page-dir* + (let* ((s4-0 (the-as texture-id (-> arg0 value))) + (gp-0 (lookup-texture-by-id s4-0)) + (v1-3 (-> *texture-page-dir* entries (-> s4-0 page) link)) + ) (cond - (*texture-page-dir* - (let* ((s4-0 (the-as texture-id (-> arg0 value))) - (gp-0 (lookup-texture-by-id s4-0)) - (v1-3 (-> *texture-page-dir* entries (-> s4-0 page) link)) - ) - (cond - ((and gp-0 v1-3) - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 uv-dist) arg2) - (let ((s5-1 (the-as object (* (-> v1-3 next (-> s4-0 index) shader) 16)))) - (while (nonzero? (the-as uint s5-1)) - (adgif-shader-update! (the-as adgif-shader s5-1) gp-0) - (set! s5-1 (* (-> (the-as adgif-shader s5-1) next shader) 16)) - ) - ) - ) - (-> gp-0 uv-dist) + ((and gp-0 v1-3) + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 uv-dist) arg2) + (let ((s5-1 (the-as object (* (-> v1-3 next (-> s4-0 index) shader) 16)))) + (while (nonzero? (the-as uint s5-1)) + (adgif-shader-update! (the-as adgif-shader s5-1) gp-0) + (set! s5-1 (* (-> (the-as adgif-shader s5-1) next shader) 16)) ) - (else - (empty) - arg3 - ) - ) - ) - ) + ) + ) + (-> gp-0 uv-dist) + ) (else (empty) arg3 @@ -2097,1281 +1640,1049 @@ ) ) ) - 0.1 - #t - 0.1 - 30.0 - 1 - ) - (debug-menu-append-item gp-0 s4-1) - ) - ) - (let ((t9-10 (method-of-type debug-menu-item-function new)) - (a0-11 'debug) - (a1-10 debug-menu-item-function) - ) - "all tweak+" - L744 - (let ((a1-11 (t9-10 a0-11 a1-10))) - (debug-menu-append-item gp-0 a1-11) - ) - ) - (let ((t9-12 (method-of-type debug-menu-item-function new)) - (a0-13 'debug) - (a1-12 debug-menu-item-function) - ) - "all tweak-" - L743 - (let ((a1-13 (t9-12 a0-13 a1-12))) - (debug-menu-append-item gp-0 a1-13) - ) - ) - (let ((t9-14 (method-of-type debug-menu-item-var new)) - (a0-15 'debug) - (a1-14 debug-menu-item-var) - ) - "l" - '*edit-shader* - 80 - (let ((s4-2 (t9-14 a0-15 a1-14))) - (debug-menu-item-var-make-int - s4-2 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex1 l) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex1 l) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) + (else + (empty) + arg3 ) - 1 - #t - 0 - 3 - #f ) - (debug-menu-append-item gp-0 s4-2) ) ) - (let ((t9-17 (method-of-type debug-menu-item-var new)) - (a0-18 'debug) - (a1-17 debug-menu-item-var) - ) - "k" - '*edit-shader* - 80 - (let ((s4-3 (t9-17 a0-18 a1-17))) - (debug-menu-item-var-make-int - s4-3 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as - float - (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - (while (nonzero? (the-as int a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex1) - (logior (logand (-> (the-as adgif-shader a1-8) tex1) (-> (new 'static 'array uint64 1 #xfffff000ffffffff) 0)) - (shr (shl (the-as int arg2) 52) 20) - ) - ) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (sar (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex1))) 20) 52) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - -2048 - 2047 - #f - ) - (debug-menu-append-item gp-0 s4-3) - ) - ) - (let ((t9-20 (method-of-type debug-menu-item-var new)) - (a0-21 'debug) - (a1-20 debug-menu-item-var) - ) - "mmin" - '*edit-shader* - 80 - (let ((s4-4 (t9-20 a0-21 a1-20))) - (debug-menu-item-var-make-int - s4-4 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex1 mmin) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex1 mmin) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 5 - #t - ) - (debug-menu-append-item gp-0 s4-4) - ) - ) - (let ((t9-23 (method-of-type debug-menu-item-var new)) - (a0-24 'debug) - (a1-23 debug-menu-item-var) - ) - "mmag" - '*edit-shader* - 80 - (let ((s4-5 (t9-23 a0-24 a1-23))) - (debug-menu-item-var-make-int - s4-5 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex1 mmag) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex1 mmag) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 1 - #t - ) - (debug-menu-append-item gp-0 s4-5) - ) - ) - (let ((t9-26 (method-of-type debug-menu-item-var new)) - (a0-27 'debug) - (a1-26 debug-menu-item-var) - ) - "lcm" - '*edit-shader* - 80 - (let ((s4-6 (t9-26 a0-27 a1-26))) - (debug-menu-item-var-make-int - s4-6 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex1 lcm) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex1 lcm) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 1 - #t - ) - (debug-menu-append-item gp-0 s4-6) - ) - ) - (let ((t9-29 (method-of-type debug-menu-item-var new)) - (a0-30 'debug) - (a1-29 debug-menu-item-var) - ) - "tfx" - '*edit-shader* - 80 - (let ((s4-7 (t9-29 a0-30 a1-29))) - (debug-menu-item-var-make-int - s4-7 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as - float - (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - (while (nonzero? (the-as int a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex0) - (logior (logand (-> (the-as adgif-shader a1-8) tex0) (-> (new 'static 'array uint64 1 #xffffffe7ffffffff) 0)) - (shr (shl (the-as int arg2) 62) 27) - ) - ) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 27) 62) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 3 - #t - ) - (debug-menu-append-item gp-0 s4-7) - ) - ) - (let ((t9-32 (method-of-type debug-menu-item-var new)) - (a0-33 'debug) - (a1-32 debug-menu-item-var) - ) - "tbp" - '*edit-shader* - 80 - (let ((s4-8 (t9-32 a0-33 a1-32))) - (debug-menu-item-var-make-int - s4-8 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex0 tbp0) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex0 tbp0) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - #x4000 - #t - ) - (debug-menu-append-item gp-0 s4-8) - ) - ) - (let ((t9-35 (method-of-type debug-menu-item-var new)) - (a0-36 'debug) - (a1-35 debug-menu-item-var) - ) - "tbw" - '*edit-shader* - 80 - (let ((s4-9 (t9-35 a0-36 a1-35))) - (debug-menu-item-var-make-int - s4-9 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex0 tbw) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex0 tbw) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 15 - #t - ) - (debug-menu-append-item gp-0 s4-9) - ) - ) - (let ((t9-38 (method-of-type debug-menu-item-var new)) - (a0-39 'debug) - (a1-38 debug-menu-item-var) - ) - "tw" - '*edit-shader* - 80 - (let ((s4-10 (t9-38 a0-39 a1-38))) - (debug-menu-item-var-make-int - s4-10 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex0 tw) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex0 tw) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 10 - #t - ) - (debug-menu-append-item gp-0 s4-10) - ) - ) - (let ((t9-41 (method-of-type debug-menu-item-var new)) - (a0-42 'debug) - (a1-41 debug-menu-item-var) - ) - "th" - '*edit-shader* - 80 - (let ((s4-11 (t9-41 a0-42 a1-41))) - (debug-menu-item-var-make-int - s4-11 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as - float - (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - (while (nonzero? (the-as int a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex0) - (logior (logand (-> (the-as adgif-shader a1-8) tex0) (-> (new 'static 'array uint64 1 #xfffffffc3fffffff) 0)) - (shr (shl (the-as int arg2) 60) 30) - ) - ) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 30) 60) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 10 - #t - ) - (debug-menu-append-item gp-0 s4-11) - ) - ) - (let ((t9-44 (method-of-type debug-menu-item-var new)) - (a0-45 'debug) - (a1-44 debug-menu-item-var) - ) - "mxl" - '*edit-shader* - 80 - (let ((s4-12 (t9-44 a0-45 a1-44))) - (debug-menu-item-var-make-int - s4-12 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) tex1 mxl) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) tex1 mxl) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 6 - #t - ) - (debug-menu-append-item gp-0 s4-12) - ) - ) - (let ((t9-47 (method-of-type debug-menu-item-var new)) - (a0-48 'debug) - (a1-47 debug-menu-item-var) - ) - "wms" - '*edit-shader* - 80 - (let ((s4-13 (t9-47 a0-48 a1-47))) - (debug-menu-item-var-make-int - s4-13 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) clamp wms) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) clamp wms) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 3 - #t - ) - (debug-menu-append-item gp-0 s4-13) - ) - ) - (let ((t9-50 (method-of-type debug-menu-item-var new)) - (a0-51 'debug) - (a1-50 debug-menu-item-var) - ) - "wmt" - '*edit-shader* - 80 - (let ((s4-14 (t9-50 a0-51 a1-50))) - (debug-menu-item-var-make-int - s4-14 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) clamp wmt) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) clamp wmt) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 3 - #t - ) - (debug-menu-append-item gp-0 s4-14) - ) - ) - (let ((t9-53 (method-of-type debug-menu-item-var new)) - (a0-54 'debug) - (a1-53 debug-menu-item-var) - ) - "minu" - '*edit-shader* - 80 - (let ((s4-15 (t9-53 a0-54 a1-53))) - (debug-menu-item-var-make-int - s4-15 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) clamp minu) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) clamp minu) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 511 - #t - ) - (debug-menu-append-item gp-0 s4-15) - ) - ) - (let ((t9-56 (method-of-type debug-menu-item-var new)) - (a0-57 'debug) - (a1-56 debug-menu-item-var) - ) - "maxu" - '*edit-shader* - 80 - (let ((s4-16 (t9-56 a0-57 a1-56))) - (debug-menu-item-var-make-int - s4-16 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as float (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (while (nonzero? (the-as uint a1-8)) - (set! (-> (the-as adgif-shader a1-8) clamp maxu) (the-as int arg2)) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (-> (the-as adgif-shader v1-8) clamp maxu) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 511 - #t - ) - (debug-menu-append-item gp-0 s4-16) - ) - ) - (let ((t9-59 (method-of-type debug-menu-item-var new)) - (a0-60 'debug) - (a1-59 debug-menu-item-var) - ) - "minv" - '*edit-shader* - 80 - (let ((s4-17 (t9-59 a0-60 a1-59))) - (debug-menu-item-var-make-int - s4-17 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as - float - (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - (while (nonzero? (the-as int a1-8)) - (set! (-> (the-as adgif-shader a1-8) clamp) - (logior (logand (-> (the-as adgif-shader a1-8) clamp) (-> (new 'static 'array uint64 1 #xfffffffc00ffffff) 0)) - (shr (shl (the-as int arg2) 54) 30) - ) - ) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 30) 54) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 511 - #t - ) - (debug-menu-append-item gp-0 s4-17) - ) - ) - (let ((t9-62 (method-of-type debug-menu-item-var new)) - (a0-63 'debug) - (a1-62 debug-menu-item-var) - ) - "maxv" - '*edit-shader* - 80 - (let ((s4-18 (t9-62 a0-63 a1-62))) - (debug-menu-item-var-make-int - s4-18 - (the-as - (function int debug-menu-msg int int int) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (the-as - float - (cond - (*texture-page-dir* - (let* ((v1-1 (the-as texture-id (-> arg0 value))) - (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) - ) - (cond - (a0-3 - (when (= arg1 (debug-menu-msg press)) - (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) - (while (nonzero? (the-as int a1-8)) - (set! (-> (the-as adgif-shader a1-8) clamp) - (logior (logand (-> (the-as adgif-shader a1-8) clamp) (-> (new 'static 'array uint64 1 #xfffff003ffffffff) 0)) - (shr (shl (the-as int arg2) 54) 20) - ) - ) - (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) - ) - ) - ) - (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) - (if (nonzero? (the-as uint v1-8)) - (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 20) 54) - arg3 - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - (else - arg3 - ) - ) - ) - ) - ) - 1 - #t - 0 - 511 - #t - ) - (debug-menu-append-item gp-0 s4-18) - ) - ) - s5-0 + 0.1 + #t + 0.1 + 30.0 + 1 ) + (debug-menu-append-item gp-0 s4-1) ) + (let ((a1-11 + (new + 'debug + 'debug-menu-item-function + "all tweak+" + #f + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* 0.1) (none))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((a1-13 + (new + 'debug + 'debug-menu-item-function + "all tweak-" + #f + (the-as (function object object) (lambda () (all-texture-tweak-adjust *texture-page-dir* -0.1) (none))) + ) + ) + ) + (debug-menu-append-item gp-0 a1-13) + ) + (let ((s4-2 (new 'debug 'debug-menu-item-var "l" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-2 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 l) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 l) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #f + ) + (debug-menu-append-item gp-0 s4-2) + ) + (let ((s4-3 (new 'debug 'debug-menu-item-var "k" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-3 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1) + (logior (logand (-> (the-as adgif-shader a1-8) tex1) (-> (new 'static 'array uint64 1 #xfffff000ffffffff) 0)) + (shr (shl (the-as int arg2) 52) 20) + ) + ) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (sar (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex1))) 20) 52) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + -2048 + 2047 + #f + ) + (debug-menu-append-item gp-0 s4-3) + ) + (let ((s4-4 (new 'debug 'debug-menu-item-var "mmin" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-4 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmin) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmin) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 5 + #t + ) + (debug-menu-append-item gp-0 s4-4) + ) + (let ((s4-5 (new 'debug 'debug-menu-item-var "mmag" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-5 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mmag) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mmag) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-5) + ) + (let ((s4-6 (new 'debug 'debug-menu-item-var "lcm" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-6 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 lcm) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 lcm) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 1 + #t + ) + (debug-menu-append-item gp-0 s4-6) + ) + (let ((s4-7 (new 'debug 'debug-menu-item-var "tfx" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-7 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0) + (logior (logand (-> (the-as adgif-shader a1-8) tex0) (-> (new 'static 'array uint64 1 #xffffffe7ffffffff) 0)) + (shr (shl (the-as int arg2) 62) 27) + ) + ) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 27) 62) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-7) + ) + (let ((s4-8 (new 'debug 'debug-menu-item-var "tbp" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-8 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbp0) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbp0) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + #x4000 + #t + ) + (debug-menu-append-item gp-0 s4-8) + ) + (let ((s4-9 (new 'debug 'debug-menu-item-var "tbw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-9 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tbw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tbw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 15 + #t + ) + (debug-menu-append-item gp-0 s4-9) + ) + (let ((s4-10 (new 'debug 'debug-menu-item-var "tw" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-10 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0 tw) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex0 tw) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-10) + ) + (let ((s4-11 (new 'debug 'debug-menu-item-var "th" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-11 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex0) + (logior (logand (-> (the-as adgif-shader a1-8) tex0) (-> (new 'static 'array uint64 1 #xfffffffc3fffffff) 0)) + (shr (shl (the-as int arg2) 60) 30) + ) + ) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) tex0))) 30) 60) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 10 + #t + ) + (debug-menu-append-item gp-0 s4-11) + ) + (let ((s4-12 (new 'debug 'debug-menu-item-var "mxl" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-12 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) tex1 mxl) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) tex1 mxl) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 6 + #t + ) + (debug-menu-append-item gp-0 s4-12) + ) + (let ((s4-13 (new 'debug 'debug-menu-item-var "wms" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-13 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wms) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wms) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-13) + ) + (let ((s4-14 (new 'debug 'debug-menu-item-var "wmt" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-14 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp wmt) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp wmt) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 3 + #t + ) + (debug-menu-append-item gp-0 s4-14) + ) + (let ((s4-15 (new 'debug 'debug-menu-item-var "minu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-15 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp minu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp minu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-15) + ) + (let ((s4-16 (new 'debug 'debug-menu-item-var "maxu" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-16 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as float (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (while (nonzero? (the-as uint a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp maxu) (the-as int arg2)) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (-> (the-as adgif-shader v1-8) clamp maxu) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-16) + ) + (let ((s4-17 (new 'debug 'debug-menu-item-var "minv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-17 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp) + (logior (logand (-> (the-as adgif-shader a1-8) clamp) (-> (new 'static 'array uint64 1 #xfffffffc00ffffff) 0)) + (shr (shl (the-as int arg2) 54) 30) + ) + ) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 30) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-17) + ) + (let ((s4-18 (new 'debug 'debug-menu-item-var "maxv" (the-as int '*edit-shader*) 80))) + (debug-menu-item-var-make-int + s4-18 + (the-as + (function int debug-menu-msg int int int) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (the-as + float + (cond + (*texture-page-dir* + (let* ((v1-1 (the-as texture-id (-> arg0 value))) + (a0-3 (-> *texture-page-dir* entries (-> v1-1 page) link)) + ) + (cond + (a0-3 + (when (= arg1 (debug-menu-msg press)) + (let ((a1-8 (the-as object (* (the-as adgif-shader (-> a0-3 next (-> v1-1 index) shader)) 16)))) + (while (nonzero? (the-as int a1-8)) + (set! (-> (the-as adgif-shader a1-8) clamp) + (logior (logand (-> (the-as adgif-shader a1-8) clamp) (-> (new 'static 'array uint64 1 #xfffff003ffffffff) 0)) + (shr (shl (the-as int arg2) 54) 20) + ) + ) + (set! a1-8 (* (-> (the-as adgif-shader a1-8) next shader) 16)) + ) + ) + ) + (let ((v1-8 (the-as object (* (-> a0-3 next (-> v1-1 index) shader) 16)))) + (if (nonzero? (the-as uint v1-8)) + (shr (shl (the-as int (the-as adgif-shader (-> (the-as adgif-shader v1-8) clamp))) 20) 54) + arg3 + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + (else + arg3 + ) + ) + ) + ) + ) + 1 + #t + 0 + 511 + #t + ) + (debug-menu-append-item gp-0 s4-18) + ) + s5-0 ) ) ;; definition for function debug-menu-make-instance-menu (defun debug-menu-make-instance-menu ((arg0 debug-menu-context)) - (let ((t9-0 (method-of-type debug-menu new)) - (a0-1 'debug) - (a1-0 debug-menu) - ) - "Instance menu" - (let ((gp-0 (t9-0 a0-1 a1-0)) - (t9-1 (method-of-type debug-menu-item-submenu new)) - (a0-2 'debug) - (a1-1 debug-menu-item-submenu) - ) - "Instance" - (let ((s5-0 (t9-1 a0-2 a1-1))) - (let ((t9-2 (method-of-type debug-menu new)) - (a0-3 'debug) - (a1-2 debug-menu) - ) - "Instance shrub menu" - (set! *instance-shrub-menu* (t9-2 a0-3 a1-2)) - ) - (let ((t9-3 (method-of-type debug-menu-item-submenu new)) - (a0-4 'debug) - (a1-3 debug-menu-item-submenu) - ) - "Pick Shrub" - (let ((a1-4 (t9-3 a0-4 a1-3))) - (debug-menu-append-item gp-0 a1-4) - ) - ) - (let ((t9-5 (method-of-type debug-menu new)) - (a0-6 'debug) - (a1-5 debug-menu) - ) - "Instance tie menu" - (set! *instance-tie-menu* (t9-5 a0-6 a1-5)) - ) - (let ((t9-6 (method-of-type debug-menu-item-submenu new)) - (a0-7 'debug) - (a1-6 debug-menu-item-submenu) - ) - "Pick Tie" - (let ((a1-7 (t9-6 a0-7 a1-6))) - (debug-menu-append-item gp-0 a1-7) - ) - ) - (let ((t9-8 (method-of-type debug-menu-item-function new)) - (a0-9 'debug) - (a1-8 debug-menu-item-function) - ) - "Refresh" - build-instance-list - (let ((a1-9 (t9-8 a0-9 a1-8))) - (debug-menu-append-item gp-0 a1-9) - ) - ) - (let ((t9-10 (method-of-type debug-menu-item-function new)) - (a0-11 'debug) - (a1-10 debug-menu-item-function) - ) - "Print Info" - print-prototype-list - (let ((a1-11 (t9-10 a0-11 a1-10))) - (debug-menu-append-item gp-0 a1-11) - ) - ) - (let ((t9-12 (method-of-type debug-menu-item-var new)) - (a0-13 'debug) - (a1-12 debug-menu-item-var) - ) - "near" - '*edit-instance* - 80 - (let ((s3-0 (t9-12 a0-13 a1-12))) - (debug-menu-item-var-make-float - s3-0 - (the-as - (function int debug-menu-msg float float float) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) - (cond - (gp-0 - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 dists x) (* 4096.0 arg2)) - (prototype-bucket-recalc-fields gp-0) - ) - (* 0.00024414062 (-> gp-0 dists x)) - ) - (else - (empty) - arg3 - ) - ) - ) - ) - ) - 1.0 - #t - 10.0 - 250.0 - 1 - ) - (debug-menu-append-item gp-0 s3-0) - ) - ) - (let ((t9-15 (method-of-type debug-menu-item-var new)) - (a0-16 'debug) - (a1-15 debug-menu-item-var) - ) - "far" - '*edit-instance* - 80 - (let ((s3-1 (t9-15 a0-16 a1-15))) - (debug-menu-item-var-make-float - s3-1 - (the-as - (function int debug-menu-msg float float float) - (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) - (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) - (cond - (gp-0 - (when (= arg1 (debug-menu-msg press)) - (set! (-> gp-0 dists w) (* 4096.0 arg2)) - (prototype-bucket-recalc-fields gp-0) - ) - (* 0.00024414062 (-> gp-0 dists w)) - ) - (else - (empty) - arg3 - ) - ) - ) - ) - ) - 1.0 - #t - 10.0 - 250.0 - 1 - ) - (debug-menu-append-item gp-0 s3-1) - ) - ) - (let ((t9-18 (method-of-type debug-menu-item-var new)) - (a0-19 'debug) - (a1-18 debug-menu-item-var) - ) - "tie vanish near" - '*edit-instance* - 80 - (let ((s3-2 (t9-18 a0-19 a1-18))) - (debug-menu-item-var-make-float - s3-2 - (the-as (function int debug-menu-msg float float float) dm-float-field-tie-rvanish-func) - 1.0 - #t - 10.0 - 250.0 - 1 - ) - (debug-menu-append-item gp-0 s3-2) - ) - ) - (let ((t9-21 (method-of-type debug-menu-item-var new)) - (a0-22 'debug) - (a1-21 debug-menu-item-var) - ) - "tie vanish far" - '*edit-instance* - 80 - (let ((s3-3 (t9-21 a0-22 a1-21))) - (debug-menu-item-var-make-float - s3-3 - (the-as (function int debug-menu-msg float float float) dm-float-field-tie-vanish-far-func) - 1.0 - #t - 10.0 - 250.0 - 1 - ) - (debug-menu-append-item gp-0 s3-3) - ) - ) - (let ((t9-24 (method-of-type debug-menu-item-flag new)) - (a0-25 'debug) - (a1-24 debug-menu-item-flag) - ) - "invisible" - 1 - dm-edit-instance-toggle-pick-func - (let ((a1-25 (t9-24 a0-25 a1-24))) - (debug-menu-append-item gp-0 a1-25) - ) - ) - (let ((t9-26 (method-of-type debug-menu new)) - (a0-27 'debug) - (a1-26 debug-menu) - ) - "Enable Instance Shrub Menu" - (set! *enable-instance-shrub-menu* (t9-26 a0-27 a1-26)) - ) - (let ((t9-27 (method-of-type debug-menu-item-submenu new)) - (a0-28 'debug) - (a1-27 debug-menu-item-submenu) - ) - "Enable Shrub" - (let ((a1-28 (t9-27 a0-28 a1-27))) - (debug-menu-append-item gp-0 a1-28) - ) - ) - (let ((t9-29 (method-of-type debug-menu new)) - (a0-30 'debug) - (a1-29 debug-menu) - ) - "Enable Instance Tie Menu" - (set! *enable-instance-tie-menu* (t9-29 a0-30 a1-29)) - ) - (let ((t9-30 (method-of-type debug-menu-item-submenu new)) - (a0-31 'debug) - (a1-30 debug-menu-item-submenu) - ) - "Enable Tie" - (let ((a1-31 (t9-30 a0-31 a1-30))) - (debug-menu-append-item gp-0 a1-31) - ) - ) - (let ((t9-32 (method-of-type debug-menu-item-flag new)) - (a0-33 'debug) - (a1-32 debug-menu-item-flag) - ) - "Instance Info" - '*display-instance-info* - dm-boolean-toggle-pick-func - (let ((a1-33 (t9-32 a0-33 a1-32))) - (debug-menu-append-item gp-0 a1-33) - ) - ) - s5-0 + (let* ((gp-0 (new 'debug 'debug-menu arg0 "Instance menu")) + (s5-0 (new 'debug 'debug-menu-item-submenu "Instance" gp-0)) + ) + (let ((a3-3 (new 'debug 'debug-menu arg0 "Instance shrub menu"))) + (set! *instance-shrub-menu* a3-3) + (let ((a1-4 (new 'debug 'debug-menu-item-submenu "Pick Shrub" a3-3))) + (debug-menu-append-item gp-0 a1-4) ) ) + (let ((a3-5 (new 'debug 'debug-menu arg0 "Instance tie menu"))) + (set! *instance-tie-menu* a3-5) + (let ((a1-7 (new 'debug 'debug-menu-item-submenu "Pick Tie" a3-5))) + (debug-menu-append-item gp-0 a1-7) + ) + ) + (let ((a1-9 + (new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list)) + ) + ) + (debug-menu-append-item gp-0 a1-9) + ) + (let ((a1-11 + (new 'debug 'debug-menu-item-function "Print Info" #f (the-as (function object object) print-prototype-list)) + ) + ) + (debug-menu-append-item gp-0 a1-11) + ) + (let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-0 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists x) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists x)) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-0) + ) + (let ((s3-1 (new 'debug 'debug-menu-item-var "far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-1 + (the-as + (function int debug-menu-msg float float float) + (lambda ((arg0 symbol) (arg1 debug-menu-msg) (arg2 float) (arg3 float)) + (let ((gp-0 (find-instance-by-name (the-as string (-> arg0 value))))) + (cond + (gp-0 + (when (= arg1 (debug-menu-msg press)) + (set! (-> gp-0 dists w) (* 4096.0 arg2)) + (prototype-bucket-recalc-fields gp-0) + ) + (* 0.00024414062 (-> gp-0 dists w)) + ) + (else + (empty) + arg3 + ) + ) + ) + ) + ) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-1) + ) + (let ((s3-2 (new 'debug 'debug-menu-item-var "tie vanish near" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-2 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-rvanish-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-2) + ) + (let ((s3-3 (new 'debug 'debug-menu-item-var "tie vanish far" (the-as int '*edit-instance*) 80))) + (debug-menu-item-var-make-float + s3-3 + (the-as (function int debug-menu-msg float float float) dm-float-field-tie-vanish-far-func) + 1.0 + #t + 10.0 + 250.0 + 1 + ) + (debug-menu-append-item gp-0 s3-3) + ) + (let ((a1-25 (new 'debug 'debug-menu-item-flag "invisible" 1 dm-edit-instance-toggle-pick-func))) + (debug-menu-append-item gp-0 a1-25) + ) + (let ((a3-18 (new 'debug 'debug-menu arg0 "Enable Instance Shrub Menu"))) + (set! *enable-instance-shrub-menu* a3-18) + (let ((a1-28 (new 'debug 'debug-menu-item-submenu "Enable Shrub" a3-18))) + (debug-menu-append-item gp-0 a1-28) + ) + ) + (let ((a3-20 (new 'debug 'debug-menu arg0 "Enable Instance Tie Menu"))) + (set! *enable-instance-tie-menu* a3-20) + (let ((a1-31 (new 'debug 'debug-menu-item-submenu "Enable Tie" a3-20))) + (debug-menu-append-item gp-0 a1-31) + ) + ) + (let ((a1-33 + (new 'debug 'debug-menu-item-flag "Instance Info" '*display-instance-info* dm-boolean-toggle-pick-func) + ) + ) + (debug-menu-append-item gp-0 a1-33) + ) + s5-0 ) ) @@ -3470,255 +2781,107 @@ ;; definition for function debug-menu-make-task-sub-menu ;; INFO: Used lq/sq -;; ERROR: failed type prop at 11: Could not figure out load: (set! a0 (l.wu v1)) ;; WARN: Return type mismatch pair vs debug-menu-node. -(defun debug-menu-make-task-sub-menu ((a0-0 debug-menu-context)) +(defun debug-menu-make-task-sub-menu ((arg0 debug-menu-context)) (local-vars - (v0-0 none) - (v0-1 none) - (v0-2 none) - (v0-3 none) - (v0-4 none) - (v0-5 pair) - (v0-6 pair) - (v1-0 game-info) - (v1-2 int) - (v1-3 int) - (v1-4 uint) - (v1-5 none) - (v1-6 none) - (v1-7 none) - (v1-8 none) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-14 type) - (v1-15 type) - (v1-16 int) - (v1-17 int) - (a0-1 none) - (a0-3 none) - (a0-4 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-9 none) - (a0-10 none) - (a0-11 none) - (a0-12 none) - (a0-13 none) - (a0-14 none) - (a0-15 none) - (a0-16 none) - (a0-19 symbol) - (a0-20 symbol) - (a1-0 none) - (a1-1 none) - (a1-2 none) - (a1-3 none) - (a1-5 type) - (a1-6 type) - (a2-0 none) - (a2-1 none) - (a2-2 none) - (a2-3 none) - (a2-5 uint) - (a2-6 symbol) - (a3-0 none) - (a3-5 pair) - (a3-6 pair) - (s0-0 none) - (s1-0 none) - (s1-1 symbol) - (s2-0 none) - (s2-1 type) - (s3-0 int) - (s3-1 symbol) - (s4-0 array) - (s4-1 (function symbol type object object pair)) - (t9-0 none) - (t9-1 none) - (t9-2 none) - (t9-3 none) - (t9-4 none) - (t9-5 (function symbol type object object pair)) - (t9-6 (function symbol type object object pair)) - (gp-0 pair) - (sv-16 none) - (sv-32 none) - (sv-48 none) - (sv-64 none) - (sv-80 none) - (sv-96 none) - (sv-112 none) - (sv-128 none) - (sv-144 none) - (sv-160 none) - (sv-176 none) - (sv-192 none) + (sv-16 (function symbol type object object pair)) + (sv-32 symbol) + (sv-48 type) + (sv-64 symbol) + (sv-80 (function symbol type object object pair)) + (sv-96 symbol) + (sv-112 type) + (sv-128 string) + (sv-144 (function symbol type object object pair)) + (sv-160 symbol) + (sv-176 type) + (sv-192 int) ) "TODO - need to know more about game-info" - (set! gp-0 '()) - (set! v1-0 *game-info*) - (set! s4-0 (-> v1-0 unknown-pad4)) - (set! s3-0 (-> s4-0 length)) - (while (nonzero? s3-0) - (when (begin (set! s3-0 (+ s3-0 -1)) (nonzero? s3-0)) - (when (begin - (set! v1-2 (sll s3-0 2)) - (set! v1-3 (+ v1-2 s4-0)) - (set! v1-4 (l.wu (+ v1-3 12))) - (set! a0-1 (the-as none (l.wu v1-4))) - (= a0-1 a0-0) + (let ((gp-0 '())) + (let ((s4-0 (-> *game-info* sub-task-list))) + (countdown (s3-0 (-> s4-0 length)) + (when (nonzero? s3-0) + (let ((v1-4 (-> s4-0 s3-0))) + (when (= (-> v1-4 level) arg0) + (let ((s2-0 (method-of-type pair new)) + (s1-0 'global) + (s0-0 pair) + ) + (set! sv-16 (method-of-type pair new)) + (set! sv-32 'global) + (set! sv-48 pair) + (set! sv-64 'flag) + (set! sv-80 (method-of-type pair new)) + (set! sv-96 'global) + (set! sv-112 pair) + (set! sv-128 (-> v1-4 name)) + (set! sv-144 (method-of-type pair new)) + (set! sv-160 'global) + (set! sv-176 pair) + (set! sv-192 (* s3-0 8)) + (let* ((a3-1 (cons 'dm-task-menu-pick-func '())) + (a3-2 (sv-144 sv-160 sv-176 sv-192 a3-1)) + (a3-3 (sv-80 sv-96 sv-112 sv-128 a3-2)) + ) + (set! gp-0 (s2-0 s1-0 s0-0 (sv-16 sv-32 sv-48 sv-64 a3-3) gp-0)) + ) + ) ) - (set! a0-3 (the-as none pair)) - (set! s2-0 (the-as none (l.wu (+ a0-3 16)))) - (set! s1-0 (the-as none 'global)) - (set! s0-0 (the-as none pair)) - (set! a0-4 (the-as none pair)) - (set! a0-5 (the-as none (l.wu (+ a0-4 16)))) - (set! sv-16 a0-5) - (set! a0-6 (the-as none 'global)) - (set! sv-32 a0-6) - (set! a0-7 (the-as none pair)) - (set! sv-48 a0-7) - (set! a0-8 (the-as none 'flag)) - (set! sv-64 a0-8) - (set! a0-9 (the-as none pair)) - (set! a0-10 (the-as none (l.wu (+ a0-9 16)))) - (set! sv-80 a0-10) - (set! a0-11 (the-as none 'global)) - (set! sv-96 a0-11) - (set! a0-12 (the-as none pair)) - (set! sv-112 a0-12) - (set! v1-5 (the-as none (l.wu (+ v1-4 8)))) - (set! sv-128 v1-5) - (set! v1-6 (the-as none pair)) - (set! v1-7 (the-as none (l.wu (+ v1-6 16)))) - (set! sv-144 v1-7) - (set! v1-8 (the-as none 'global)) - (set! sv-160 v1-8) - (set! v1-9 (the-as none pair)) - (set! sv-176 v1-9) - (set! v1-10 (the-as none (sll s3-0 3))) - (set! sv-192 v1-10) - (set! v1-11 (the-as none pair)) - (set! t9-0 (the-as none (l.wu (+ v1-11 16)))) - (set! a0-13 (the-as none 'global)) - (set! a1-0 (the-as none pair)) - (set! a2-0 (the-as none 'dm-task-menu-pick-func)) - (set! a3-0 (the-as none '())) - (call!) - (set! a3-1 (the-as none v0-0)) - (set! t9-1 sv-144) - (set! a0-14 sv-160) - (set! a1-1 sv-176) - (set! a2-1 sv-192) - (call!) - (set! a3-2 (the-as none v0-1)) - (set! t9-2 sv-80) - (set! a0-15 sv-96) - (set! a1-2 sv-112) - (set! a2-2 sv-128) - (call!) - (set! a3-3 (the-as none v0-2)) - (set! t9-3 sv-16) - (set! a0-16 sv-32) - (set! a1-3 sv-48) - (set! a2-3 sv-64) - (call!) - (set! a2-4 (the-as none v0-3)) - (set! t9-4 (the-as none s2-0)) - (set! a0-17 (the-as none s1-0)) - (set! a1-4 (the-as none s0-0)) - (set! a3-4 (the-as none gp-0)) - (set! v0-4 (the-as none (call!))) - (set! gp-0 (the-as pair v0-4)) - (set! a0-18 (the-as none gp-0)) + ) + ) ) ) + (the-as debug-menu-node (cons 'menu (cons (-> (the-as (pointer uint32) (+ #xff37 (the-as int arg0)))) gp-0))) ) - (set! v1-14 pair) - (set! s4-1 (method-of-type v1-14 new)) - (set! s3-1 'global) - (set! s2-1 pair) - (set! s1-1 'menu) - (set! v1-15 pair) - (set! t9-5 (method-of-type v1-15 new)) - (set! a0-19 'global) - (set! a1-5 pair) - (set! v1-16 #xff37) - (set! v1-17 (+ v1-16 a0-0)) - (set! a2-5 (-> (the-as (pointer uint32) v1-17))) - (set! a3-5 gp-0) - (set! v0-5 (call! a0-19 a1-5 a2-5 a3-5)) - (set! a3-6 v0-5) - (set! t9-6 s4-1) - (set! a0-20 s3-1) - (set! a1-6 s2-1) - (set! a2-6 s1-1) - (set! v0-6 (call! a0-20 a1-6 a2-6 a3-6)) - (ret-value v0-6) ) ;; definition for function debug-menu-make-task-menu ;; INFO: Used lq/sq (defun debug-menu-make-task-menu ((arg0 debug-menu-context)) (local-vars (sv-16 debug-menu-context)) - (let ((t9-0 (method-of-type debug-menu new)) - (a0-1 'debug) - (a1-0 debug-menu) - ) - "Task menu" - (let ((s5-0 (t9-0 a0-1 a1-0)) - (t9-1 (method-of-type debug-menu-item-submenu new)) - (a0-2 'debug) - (a1-1 debug-menu-item-submenu) - ) - "Task" - (let ((s4-0 (t9-1 a0-2 a1-1))) - (let* ((s3-0 '(city - fortress - stadium - palace - castle - ruins - atoll - sewer - strip - mountain - forest - drill - tomb - dig - canyon - consite - under - nest - default - test - ) - ) - (a0-3 (car s3-0)) - ) - (while (not (null? s3-0)) - (let ((s2-0 debug-menu-append-item) - (s1-0 s5-0) - (s0-0 debug-menu-make-from-template) - ) - (set! sv-16 arg0) - (let ((a1-2 (debug-menu-make-task-sub-menu (the-as debug-menu-context a0-3)))) - (s2-0 s1-0 (s0-0 sv-16 (the-as pair a1-2))) - ) + (let* ((s5-0 (new 'debug 'debug-menu arg0 "Task menu")) + (s4-0 (new 'debug 'debug-menu-item-submenu "Task" s5-0)) + ) + (let* ((s3-0 '(city + fortress + stadium + palace + castle + ruins + atoll + sewer + strip + mountain + forest + drill + tomb + dig + canyon + consite + under + nest + default + test + ) + ) + (a0-3 (car s3-0)) + ) + (while (not (null? s3-0)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s5-0) + (s0-0 debug-menu-make-from-template) ) - (set! s3-0 (cdr s3-0)) - (set! a0-3 (car s3-0)) + (set! sv-16 arg0) + (let ((a1-2 (debug-menu-make-task-sub-menu (the-as debug-menu-context a0-3)))) + (s2-0 s1-0 (s0-0 sv-16 (the-as pair a1-2))) ) ) - s4-0 + (set! s3-0 (cdr s3-0)) + (set! a0-3 (car s3-0)) ) ) + s4-0 ) ) @@ -3822,202 +2985,54 @@ ;; definition for function debug-menu-make-play-menu ;; INFO: Used lq/sq -;; ERROR: failed type prop at 12: Could not figure out load: (set! a0 (l.wu (+ v1 20))) ;; WARN: Return type mismatch debug-menu-node vs none. -(defun debug-menu-make-play-menu ((a0-0 symbol)) +(defun debug-menu-make-play-menu ((arg0 symbol)) (local-vars - (v0-0 none) - (v0-1 none) - (v0-2 none) - (v0-3 none) - (v0-4 none) - (v0-5 pair) - (v0-6 pair) - (v0-7 debug-menu-node) - (v1-0 game-info) - (v1-1 array) - (v1-2 int) - (v1-3 int) - (v1-4 uint) - (v1-5 none) - (v1-6 none) - (v1-7 none) - (v1-8 none) - (v1-9 none) - (v1-10 none) - (v1-11 none) - (v1-14 type) - (v1-15 type) - (a0-1 game-info) - (a0-2 array) - (a0-3 none) - (a0-5 none) - (a0-6 none) - (a0-7 none) - (a0-8 none) - (a0-9 none) - (a0-10 none) - (a0-11 none) - (a0-12 none) - (a0-13 none) - (a0-14 none) - (a0-15 none) - (a0-16 none) - (a0-17 none) - (a0-20 symbol) - (a0-21 symbol) - (a0-22 symbol) - (a1-0 none) - (a1-1 none) - (a1-2 none) - (a1-3 none) - (a1-5 type) - (a1-6 type) - (a1-7 pair) - (a2-0 none) - (a2-1 none) - (a2-2 none) - (a2-3 none) - (a2-5 string) - (a2-6 symbol) - (a3-0 none) - (a3-5 pair) - (a3-6 pair) - (s0-0 none) - (s0-1 symbol) - (s1-0 none) - (s1-1 type) - (s2-0 none) - (s2-1 symbol) - (s3-0 none) - (s3-1 (function symbol type object object pair)) - (s4-0 int) - (s4-1 (function debug-menu-context pair debug-menu-node)) - (t9-0 none) - (t9-1 none) - (t9-2 none) - (t9-3 none) - (t9-4 none) - (t9-5 (function symbol type object object pair)) - (t9-6 (function symbol type object object pair)) - (t9-7 (function debug-menu-context pair debug-menu-node)) - (gp-0 pair) - (sv-16 none) - (sv-32 none) - (sv-48 none) - (sv-64 none) - (sv-80 none) - (sv-96 none) - (sv-112 none) - (sv-128 none) - (sv-144 none) - (sv-160 none) - (sv-176 none) + (sv-16 symbol) + (sv-32 type) + (sv-48 symbol) + (sv-64 (function symbol type object object pair)) + (sv-80 symbol) + (sv-96 type) + (sv-112 string) + (sv-128 (function symbol type object object pair)) + (sv-144 symbol) + (sv-160 type) + (sv-176 int) ) - (set! gp-0 '()) - (set! v1-0 *game-info*) - (set! v1-1 (-> v1-0 unknown-pad3)) - (set! s4-0 (-> v1-1 length)) - (while (nonzero? s4-0) - (when (begin - (set! s4-0 (+ s4-0 -1)) - (set! v1-2 (sll s4-0 2)) - (set! a0-1 *game-info*) - (set! a0-2 (-> a0-1 unknown-pad3)) - (set! v1-3 (+ v1-2 a0-2)) - (set! v1-4 (l.wu (+ v1-3 12))) - (set! a0-3 (the-as none (l.wu (+ v1-4 20)))) - a0-3 + (let ((gp-0 '())) + (countdown (s4-0 (-> *game-info* play-list length)) + (let ((v1-4 (-> *game-info* play-list s4-0))) + (when (-> v1-4 play-continue) + (let ((s3-0 (method-of-type pair new)) + (s2-0 'global) + (s1-0 pair) + (s0-0 (method-of-type pair new)) + ) + (set! sv-16 'global) + (set! sv-32 pair) + (set! sv-48 'function) + (set! sv-64 (method-of-type pair new)) + (set! sv-80 'global) + (set! sv-96 pair) + (set! sv-112 (-> v1-4 name)) + (set! sv-128 (method-of-type pair new)) + (set! sv-144 'global) + (set! sv-160 pair) + (set! sv-176 (* s4-0 8)) + (let* ((a3-1 (cons 'dm-play-task '())) + (a3-2 (sv-128 sv-144 sv-160 sv-176 a3-1)) + (a3-3 (sv-64 sv-80 sv-96 sv-112 a3-2)) + ) + (set! gp-0 (s3-0 s2-0 s1-0 (s0-0 sv-16 sv-32 sv-48 a3-3) gp-0)) + ) ) - (set! a0-5 (the-as none pair)) - (set! s3-0 (the-as none (l.wu (+ a0-5 16)))) - (set! s2-0 (the-as none 'global)) - (set! s1-0 (the-as none pair)) - (set! a0-6 (the-as none pair)) - (set! s0-0 (the-as none (l.wu (+ a0-6 16)))) - (set! a0-7 (the-as none 'global)) - (set! sv-16 a0-7) - (set! a0-8 (the-as none pair)) - (set! sv-32 a0-8) - (set! a0-9 (the-as none 'function)) - (set! sv-48 a0-9) - (set! a0-10 (the-as none pair)) - (set! a0-11 (the-as none (l.wu (+ a0-10 16)))) - (set! sv-64 a0-11) - (set! a0-12 (the-as none 'global)) - (set! sv-80 a0-12) - (set! a0-13 (the-as none pair)) - (set! sv-96 a0-13) - (set! v1-5 (the-as none (l.wu v1-4))) - (set! sv-112 v1-5) - (set! v1-6 (the-as none pair)) - (set! v1-7 (the-as none (l.wu (+ v1-6 16)))) - (set! sv-128 v1-7) - (set! v1-8 (the-as none 'global)) - (set! sv-144 v1-8) - (set! v1-9 (the-as none pair)) - (set! sv-160 v1-9) - (set! v1-10 (the-as none (sll s4-0 3))) - (set! sv-176 v1-10) - (set! v1-11 (the-as none pair)) - (set! t9-0 (the-as none (l.wu (+ v1-11 16)))) - (set! a0-14 (the-as none 'global)) - (set! a1-0 (the-as none pair)) - (set! a2-0 (the-as none 'dm-play-task)) - (set! a3-0 (the-as none '())) - (call!) - (set! a3-1 (the-as none v0-0)) - (set! t9-1 sv-128) - (set! a0-15 sv-144) - (set! a1-1 sv-160) - (set! a2-1 sv-176) - (call!) - (set! a3-2 (the-as none v0-1)) - (set! t9-2 sv-64) - (set! a0-16 sv-80) - (set! a1-2 sv-96) - (set! a2-2 sv-112) - (call!) - (set! a3-3 (the-as none v0-2)) - (set! t9-3 (the-as none s0-0)) - (set! a0-17 sv-16) - (set! a1-3 sv-32) - (set! a2-3 sv-48) - (call!) - (set! a2-4 (the-as none v0-3)) - (set! t9-4 (the-as none s3-0)) - (set! a0-18 (the-as none s2-0)) - (set! a1-4 (the-as none s1-0)) - (set! a3-4 (the-as none gp-0)) - (set! v0-4 (the-as none (call!))) - (set! gp-0 (the-as pair v0-4)) - (set! a0-19 (the-as none gp-0)) + ) + ) ) + (debug-menu-make-from-template (the-as debug-menu-context arg0) (cons 'menu (cons "Play" gp-0))) ) - (set! s4-1 debug-menu-make-from-template) - (set! v1-14 pair) - (set! s3-1 (method-of-type v1-14 new)) - (set! s2-1 'global) - (set! s1-1 pair) - (set! s0-1 'menu) - (set! v1-15 pair) - (set! t9-5 (method-of-type v1-15 new)) - (set! a0-20 'global) - (set! a1-5 pair) - (set! a2-5 L6130) - (set! a3-5 gp-0) - (set! v0-5 (call! a0-20 a1-5 a2-5 a3-5)) - (set! a3-6 v0-5) - (set! t9-6 s3-1) - (set! a0-21 s2-1) - (set! a1-6 s1-1) - (set! a2-6 s0-1) - (set! v0-6 (call! a0-21 a1-6 a2-6 a3-6)) - (set! a1-7 v0-6) - (set! t9-7 s4-1) - (set! a0-22 a0-0) - (call! a0-22 a1-7) - (ret-none) + (none) ) ;; definition for function dm-anim-tester-flag-func @@ -4099,1343 +3114,1450 @@ ;; INFO: Used lq/sq (defun debug-menu-context-make-default-menus ((arg0 debug-menu-context)) (local-vars (sv-16 debug-menu-context)) - (let ((t9-0 (method-of-type debug-menu new)) - (a0-1 'debug) - (a1-0 debug-menu) - ) - "Main menu" - (let ((s5-0 (t9-0 a0-1 a1-0))) - (debug-menu-context-set-root-menu arg0 s5-0) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Artist" - (flag "Poly Stats" *stats-poly* dm-boolean-toggle-pick-func) - (menu - "Memory Stats" - (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) - (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) - (flag "Level 0" 0 dm-stats-memory-func) - (flag "Level 1" 1 dm-stats-memory-func) - (flag "Level 2" 2 dm-stats-memory-func) - (flag "Level 3" 3 dm-stats-memory-func) - (flag "Level 4" 4 dm-stats-memory-func) - (flag "Level 5" 5 dm-stats-memory-func) - ) - (flag "All Visible" *artist-all-visible* dm-boolean-toggle-pick-func) - (flag "Flip Visible" *artist-flip-visible* dm-boolean-toggle-pick-func) - (flag "Fix Visible" *artist-fix-visible* dm-boolean-toggle-pick-func) - (flag "Fix Frustum" *artist-fix-frustum* dm-boolean-toggle-pick-func) - (flag "Manual Sample Point" *manual-sample-point* dm-boolean-toggle-pick-func) - (flag "Error Spheres" *artist-error-spheres* dm-boolean-toggle-pick-func) - (flag "Use menu subdiv" *artist-use-menu-subdiv* dm-boolean-toggle-pick-func) - (float-var "Subdiv Close" close dm-subdiv-float 10 1 #t 1 200 1) - (float-var "Subdiv Far" far dm-subdiv-float 10 1 #t 1 200 1) - (function "Target Start" #f (lambda () (start 'debug (get-current-continue-point *game-info*)))) - (function "Target Stop" #f (lambda () (stop 'debug))) - (menu - "Anim Tester" - (int-var "Speed" anim-speed dm-subdiv-int 10 10 #t -300 1000) - (flag "Apply Align" at-apply-align dm-anim-tester-flag-func) - (flag "Show Joint Inf" at-show-joint-info dm-anim-tester-flag-func) - (function "Pick Object" at-pick-object dm-anim-tester-func) - (function "Pick Joint Anim" at-pick-joint-anim dm-anim-tester-func) - (function "Pick Sequence" at-pick-sequence dm-anim-tester-func) - (function "Save Sequences" at-save-sequences dm-anim-tester-func) - ) - (flag "Show Entity Errors" *display-entity-errors* dm-boolean-toggle-pick-func) - (flag "Sprite Info" *display-sprite-info* dm-boolean-toggle-pick-func) - (flag "Sprite Marks" *display-sprite-marks* dm-boolean-toggle-pick-func) - (flag "Sprite Spheres" *display-sprite-spheres* dm-boolean-toggle-pick-func) - (flag "Time of Day" #f dm-time-of-day-pick-func) - (flag "Preload Anims" *preload-spool-anims* dm-boolean-toggle-pick-func) - (function - "Mike F" - #f - (lambda () (debug-actor "drill-crane-14") (send-event (the-as process-tree *debug-actor*) 'die)) - ) - (function - "Editor" - #f - (lambda () - (kill-by-type editable-player *active-pool*) - (process-spawn editable-player :init editable-player-init #f :to *entity-pool*) - (set-master-mode 'game) - (none) - ) - ) - (flag - "Screen shot highres enable" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *screen-shot-work* highres-enable) (not (-> *screen-shot-work* highres-enable))) - ) - (-> *screen-shot-work* highres-enable) - ) - ) - (flag - "Screen shot hud enable" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *screen-shot-work* hud-enable) (not (-> *screen-shot-work* hud-enable))) - ) - (-> *screen-shot-work* hud-enable) - ) + (let ((s5-0 (new 'debug 'debug-menu arg0 "Main menu"))) + (debug-menu-context-set-root-menu arg0 s5-0) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Artist" + (flag "Poly Stats" *stats-poly* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + ) + (flag "All Visible" *artist-all-visible* dm-boolean-toggle-pick-func) + (flag "Flip Visible" *artist-flip-visible* dm-boolean-toggle-pick-func) + (flag "Fix Visible" *artist-fix-visible* dm-boolean-toggle-pick-func) + (flag "Fix Frustum" *artist-fix-frustum* dm-boolean-toggle-pick-func) + (flag "Manual Sample Point" *manual-sample-point* dm-boolean-toggle-pick-func) + (flag "Error Spheres" *artist-error-spheres* dm-boolean-toggle-pick-func) + (flag "Use menu subdiv" *artist-use-menu-subdiv* dm-boolean-toggle-pick-func) + (float-var "Subdiv Close" close dm-subdiv-float 10 1 #t 1 200 1) + (float-var "Subdiv Far" far dm-subdiv-float 10 1 #t 1 200 1) + (function "Target Start" #f (lambda () (start 'debug (get-current-continue-point *game-info*)))) + (function "Target Stop" #f (lambda () (stop 'debug))) + (menu + "Anim Tester" + (int-var "Speed" anim-speed dm-subdiv-int 10 10 #t -300 1000) + (flag "Apply Align" at-apply-align dm-anim-tester-flag-func) + (flag "Show Joint Inf" at-show-joint-info dm-anim-tester-flag-func) + (function "Pick Object" at-pick-object dm-anim-tester-func) + (function "Pick Joint Anim" at-pick-joint-anim dm-anim-tester-func) + (function "Pick Sequence" at-pick-sequence dm-anim-tester-func) + (function "Save Sequences" at-save-sequences dm-anim-tester-func) + ) + (flag "Show Entity Errors" *display-entity-errors* dm-boolean-toggle-pick-func) + (flag "Sprite Info" *display-sprite-info* dm-boolean-toggle-pick-func) + (flag "Sprite Marks" *display-sprite-marks* dm-boolean-toggle-pick-func) + (flag "Sprite Spheres" *display-sprite-spheres* dm-boolean-toggle-pick-func) + (flag "Time of Day" #f dm-time-of-day-pick-func) + (flag "Preload Anims" *preload-spool-anims* dm-boolean-toggle-pick-func) + (function + "Mike F" + #f + (lambda () (debug-actor "drill-crane-14") (send-event (the-as process-tree *debug-actor*) 'die)) + ) + (function + "Editor" + #f + (lambda () + (kill-by-type editable-player *active-pool*) + (process-spawn editable-player :init editable-player-init #f :to *entity-pool*) + (set-master-mode 'game) + (none) ) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Game" - (function "New Game" #f (lambda () (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)))) - (function "New Life" #f (lambda () (initialize! *game-info* 'dead (the-as game-save #f) (the-as string #f)))) - (function - "Reset Game" - #f - (lambda () - (set! (-> *game-info* mode) 'debug) - (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)) - ) + (flag + "Screen shot highres enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* highres-enable) (not (-> *screen-shot-work* highres-enable))) + ) + (-> *screen-shot-work* highres-enable) ) - (function "Reset Actors" #f (lambda () (reset-actors 'debug) (none))) - (function "Save Game" #f (lambda () (auto-save-command 'save 0 0 *default-pool* #f) (none))) - (function "Load Game" #f (lambda () (auto-save-command 'restore 0 0 *default-pool* #f) (none))) - (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if *target* - (stop 'debug) - (start 'debug (get-current-continue-point *game-info*)) - ) - ) - *target* + ) + (flag + "Screen shot hud enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *screen-shot-work* hud-enable) (not (-> *screen-shot-work* hud-enable))) + ) + (-> *screen-shot-work* hud-enable) + ) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Game" + (function "New Game" #f (lambda () (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)))) + (function "New Life" #f (lambda () (initialize! *game-info* 'dead (the-as game-save #f) (the-as string #f)))) + (function + "Reset Game" + #f + (lambda () + (set! (-> *game-info* mode) 'debug) + (initialize! *game-info* 'game (the-as game-save #f) (the-as string #f)) + ) + ) + (function "Reset Actors" #f (lambda () (reset-actors 'debug) (none))) + (function "Save Game" #f (lambda () (auto-save-command 'save 0 0 *default-pool* #f) (none))) + (function "Load Game" #f (lambda () (auto-save-command 'restore 0 0 *default-pool* #f) (none))) + (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-point *game-info*)) + ) ) - ) - (flag "Game Mode" play dm-game-mode-pick-func) - (flag "Debug Mode" debug dm-game-mode-pick-func) - (function - "Stop Watch Start" - #f - (lambda () - (remove-by-param0 *debug-engine* stop-watch-display) - (add-connection *debug-engine* *dproc* stop-watch-display *dproc* *stdcon0* #f) - (set! (-> *game-info* stop-watch-start) (the-as uint (-> *display* base-clock frame-counter))) - (set! (-> *game-info* stop-watch-stop) (the-as uint 0)) - (format #t "Stop watch started!~%") - (none) + *target* + ) ) - ) - (function - "Stop Watch Stop" - #f - (lambda () - (remove-by-param0 *debug-engine* stop-watch-display) - (set! (-> *game-info* stop-watch-stop) (the-as uint (-> *display* base-clock frame-counter))) - (let ((v1-7 (- (-> *game-info* stop-watch-stop) (-> *game-info* stop-watch-start)))) - (format - #t - "Stop watch elasped time was ~D:~D:~D~%" - (/ (the-as int v1-7) #x4650) - (/ (mod (the-as int v1-7) #x4650) 300) - (/ (* 100 (mod (the-as int v1-7) 300)) 300) - ) - ) - (none) - ) - ) - (function "Continue Start" #f (lambda () (start 'play (-> *game-info* current-continue)))) - (function "Kiosk Reset" #f (lambda () (auto-save-command 'restore 0 0 *default-pool* #f) (none))) - (menu - "Secrets" - (flag "toggle-beard" 1 dm-game-secret-toggle-pick-func) - (flag "hflip-screen" 2 dm-game-secret-toggle-pick-func) - (flag "endless-ammo" 4 dm-game-secret-toggle-pick-func) - (flag "invulnerable" 8 dm-game-secret-toggle-pick-func) - (flag "endless-dark" 16 dm-game-secret-toggle-pick-func) - (flag "scene-player-1" 32 dm-game-secret-toggle-pick-func) - (flag "scene-player-2" 64 dm-game-secret-toggle-pick-func) - (flag "scene-player-3" 128 dm-game-secret-toggle-pick-func) - (flag "level-select" 256 dm-game-secret-toggle-pick-func) - (flag "scrap-book-1" 512 dm-game-secret-toggle-pick-func) - (flag "scrap-book-2" 1024 dm-game-secret-toggle-pick-func) - (flag "gungame-blue" 4096 dm-game-secret-toggle-pick-func) - (flag "gungame-dark" 8192 dm-game-secret-toggle-pick-func) - (flag "reverse-races" 16384 dm-game-secret-toggle-pick-func) - (flag "hero-mode" 32768 dm-game-secret-toggle-pick-func) - (flag "big-head" 65536 dm-game-secret-toggle-pick-func) - (flag "little-head" 131072 dm-game-secret-toggle-pick-func) - ) - (menu "Continue") - (menu - "Settings" - (float-var - "sfx-volume" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *setting-control* (nonzero? *setting-control*)) - (set! (-> *setting-control* user-default sfx-volume) arg2) - ) - ) - ((or (not *setting-control*) (zero? *setting-control*)) - 0.0 - ) - (else - (-> *setting-control* user-default sfx-volume) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.01) - #t - 0 - 1 - 0 - ) - (float-var - "ambient-volume" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *setting-control* (nonzero? *setting-control*)) - (set! (-> *setting-control* user-default ambient-volume) arg2) - ) - ) - ((or (not *setting-control*) (zero? *setting-control*)) - 0.0 - ) - (else - (-> *setting-control* user-default ambient-volume) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.01) - #t - 0 - 1 - 0 - ) - (float-var - "music-volume" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *setting-control* (nonzero? *setting-control*)) - (set! (-> *setting-control* user-default music-volume) arg2) - ) - ) - ((or (not *setting-control*) (zero? *setting-control*)) - 0.0 - ) - (else - (-> *setting-control* user-default music-volume) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.01) - #t - 0 - 1 - 0 - ) - (float-var - "dialog-volume" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *setting-control* (nonzero? *setting-control*)) - (set! (-> *setting-control* user-default dialog-volume) arg2) - ) - ) - ((or (not *setting-control*) (zero? *setting-control*)) - 0.0 - ) - (else - (-> *setting-control* user-default dialog-volume) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.01) - #t - 0 - 1 - 0 - ) - (menu - "Language" - (flag "english" 0 dm-setting-language) - (flag "french" 1 dm-setting-language) - (flag "german" 2 dm-setting-language) - (flag "spanish" 3 dm-setting-language) - (flag "italian" 4 dm-setting-language) - (flag "japanese" 5 dm-setting-language) - (flag "korean" 6 dm-setting-language) - (flag "uk-english" 7 dm-setting-language) - ) - (menu - "Subtitle Language" - (flag "english" 0 dm-setting-subtitle-language) - (flag "french" 1 dm-setting-subtitle-language) - (flag "german" 2 dm-setting-subtitle-language) - (flag "spanish" 3 dm-setting-subtitle-language) - (flag "italian" 4 dm-setting-subtitle-language) - (flag "japanese" 5 dm-setting-subtitle-language) - (flag "korean" 6 dm-setting-subtitle-language) - (flag "uk-english" 7 dm-setting-subtitle-language) - ) - (flag - "play-hints " - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *setting-control* user-default play-hints) (not (-> *setting-control* user-default play-hints))) - ) - (the-as uint (-> *setting-control* user-default play-hints)) - ) - ) - (flag - "subtitle " - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) - ) - (-> *setting-control* user-default subtitle) - ) - ) - (flag - "vibration" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *setting-control* user-default vibration) (not (-> *setting-control* user-default vibration))) - ) - (the-as uint (-> *setting-control* user-default vibration)) - ) - ) - (menu - "Stereo Mode" - (flag "mono" 0 dm-setting-stereo-mode) - (flag "stereo" 1 dm-setting-stereo-mode) - (flag "surround" 2 dm-setting-stereo-mode) - ) - (flag - "camera-stick-dir" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *setting-control* user-default unknowng-symbol-00) - (not (-> *setting-control* user-default unknowng-symbol-00)) - ) - ) - (the-as uint (-> *setting-control* user-default unknowng-symbol-00)) - ) - ) - (flag - "progressive-scan" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *setting-control* user-default unknown-uint32-00) - (the-as uint (not (-> *setting-control* user-default unknown-uint32-00))) - ) - ) - (-> *setting-control* user-default unknown-uint32-00) - ) - ) - (flag - "border-mode" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (set! (-> *setting-control* user-default border-mode) (not (-> *setting-control* user-default border-mode))) - (set! (-> *level* play?) (-> *setting-control* user-default border-mode)) - ) - (-> *setting-control* user-default border-mode) - ) - ) - ) - (menu - "Features" - (flag "board" 1024 dm-game-feature-toggle-pick-func) - (flag "board-training" 67108864 dm-game-feature-toggle-pick-func) - (flag "carry" 2048 dm-game-feature-toggle-pick-func) - (flag "sidekick" 4096 dm-game-feature-toggle-pick-func) - (flag "darkjak" 8192 dm-game-feature-toggle-pick-func) - (flag "darkjak-bomb0" 4194304 dm-game-feature-toggle-pick-func) - (flag "darkjak-bomb1" 8388608 dm-game-feature-toggle-pick-func) - (flag "darkjak-invinc" 16777216 dm-game-feature-toggle-pick-func) - (flag "darkjak-giant" 33554432 dm-game-feature-toggle-pick-func) - (flag "gun-yellow" 64 dm-game-feature-toggle-pick-func) - (flag "gun-red" 128 dm-game-feature-toggle-pick-func) - (flag "gun-blue" 256 dm-game-feature-toggle-pick-func) - (flag "gun-dark" 512 dm-game-feature-toggle-pick-func) - (flag "gun-upgrade-speed" 16384 dm-game-feature-toggle-pick-func) - (flag "gun-upgrade-ammo" 32768 dm-game-feature-toggle-pick-func) - (flag "gun-upgrade-damage" 65536 dm-game-feature-toggle-pick-func) - (flag "pass-red" 262144 dm-game-feature-toggle-pick-func) - (flag "pass-green" 524288 dm-game-feature-toggle-pick-func) - (flag "pass-yellow" 1048576 dm-game-feature-toggle-pick-func) + (flag "Game Mode" play dm-game-mode-pick-func) + (flag "Debug Mode" debug dm-game-mode-pick-func) + (function + "Stop Watch Start" + #f + (lambda () + (remove-by-param0 *debug-engine* stop-watch-display) + (add-connection *debug-engine* *dproc* stop-watch-display *dproc* *stdcon0* #f) + (set! (-> *game-info* stop-watch-start) (the-as uint (-> *display* base-clock frame-counter))) + (set! (-> *game-info* stop-watch-stop) (the-as uint 0)) + (format #t "Stop watch started!~%") + (none) ) ) - ) + (function + "Stop Watch Stop" + #f + (lambda () + (remove-by-param0 *debug-engine* stop-watch-display) + (set! (-> *game-info* stop-watch-stop) (the-as uint (-> *display* base-clock frame-counter))) + (let ((v1-7 (- (-> *game-info* stop-watch-stop) (-> *game-info* stop-watch-start)))) + (format + #t + "Stop watch elasped time was ~D:~D:~D~%" + (/ (the-as int v1-7) #x4650) + (/ (mod (the-as int v1-7) #x4650) 300) + (/ (* 100 (mod (the-as int v1-7) 300)) 300) + ) + ) + (none) + ) + ) + (function "Continue Start" #f (lambda () (start 'play (-> *game-info* current-continue)))) + (function "Kiosk Reset" #f (lambda () (auto-save-command 'restore 0 0 *default-pool* #f) (none))) + (menu + "Secrets" + (flag "toggle-beard" 1 dm-game-secret-toggle-pick-func) + (flag "hflip-screen" 2 dm-game-secret-toggle-pick-func) + (flag "endless-ammo" 4 dm-game-secret-toggle-pick-func) + (flag "invulnerable" 8 dm-game-secret-toggle-pick-func) + (flag "endless-dark" 16 dm-game-secret-toggle-pick-func) + (flag "scene-player-1" 32 dm-game-secret-toggle-pick-func) + (flag "scene-player-2" 64 dm-game-secret-toggle-pick-func) + (flag "scene-player-3" 128 dm-game-secret-toggle-pick-func) + (flag "level-select" 256 dm-game-secret-toggle-pick-func) + (flag "scrap-book-1" 512 dm-game-secret-toggle-pick-func) + (flag "scrap-book-2" 1024 dm-game-secret-toggle-pick-func) + (flag "gungame-blue" 4096 dm-game-secret-toggle-pick-func) + (flag "gungame-dark" 8192 dm-game-secret-toggle-pick-func) + (flag "reverse-races" 16384 dm-game-secret-toggle-pick-func) + (flag "hero-mode" 32768 dm-game-secret-toggle-pick-func) + (flag "big-head" 65536 dm-game-secret-toggle-pick-func) + (flag "little-head" 131072 dm-game-secret-toggle-pick-func) + ) + (menu "Continue") + (menu + "Settings" + (float-var + "sfx-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default sfx-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default sfx-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "ambient-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default ambient-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default ambient-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "music-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default music-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default music-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (float-var + "dialog-volume" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *setting-control* (nonzero? *setting-control*)) + (set! (-> *setting-control* user-default dialog-volume) arg2) + ) + ) + ((or (not *setting-control*) (zero? *setting-control*)) + 0.0 + ) + (else + (-> *setting-control* user-default dialog-volume) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.01) + #t + 0 + 1 + 0 + ) + (menu + "Language" + (flag "english" 0 dm-setting-language) + (flag "french" 1 dm-setting-language) + (flag "german" 2 dm-setting-language) + (flag "spanish" 3 dm-setting-language) + (flag "italian" 4 dm-setting-language) + (flag "japanese" 5 dm-setting-language) + (flag "korean" 6 dm-setting-language) + (flag "uk-english" 7 dm-setting-language) + ) + (menu + "Subtitle Language" + (flag "english" 0 dm-setting-subtitle-language) + (flag "french" 1 dm-setting-subtitle-language) + (flag "german" 2 dm-setting-subtitle-language) + (flag "spanish" 3 dm-setting-subtitle-language) + (flag "italian" 4 dm-setting-subtitle-language) + (flag "japanese" 5 dm-setting-subtitle-language) + (flag "korean" 6 dm-setting-subtitle-language) + (flag "uk-english" 7 dm-setting-subtitle-language) + ) + (flag + "play-hints " + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default play-hints) (not (-> *setting-control* user-default play-hints))) + ) + (the-as uint (-> *setting-control* user-default play-hints)) + ) + ) + (flag + "subtitle " + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default subtitle) (not (-> *setting-control* user-default subtitle))) + ) + (-> *setting-control* user-default subtitle) + ) + ) + (flag + "vibration" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default vibration) (not (-> *setting-control* user-default vibration))) + ) + (the-as uint (-> *setting-control* user-default vibration)) + ) + ) + (menu + "Stereo Mode" + (flag "mono" 0 dm-setting-stereo-mode) + (flag "stereo" 1 dm-setting-stereo-mode) + (flag "surround" 2 dm-setting-stereo-mode) + ) + (flag + "camera-stick-dir" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default unknowng-symbol-00) + (not (-> *setting-control* user-default unknowng-symbol-00)) + ) + ) + (the-as uint (-> *setting-control* user-default unknowng-symbol-00)) + ) + ) + (flag + "progressive-scan" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default unknown-uint32-00) + (the-as uint (not (-> *setting-control* user-default unknown-uint32-00))) + ) + ) + (-> *setting-control* user-default unknown-uint32-00) + ) + ) + (flag + "border-mode" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (set! (-> *setting-control* user-default border-mode) (not (-> *setting-control* user-default border-mode))) + (set! (-> *level* play?) (-> *setting-control* user-default border-mode)) + ) + (-> *setting-control* user-default border-mode) + ) + ) + ) + (menu + "Features" + (flag "board" 1024 dm-game-feature-toggle-pick-func) + (flag "board-training" 67108864 dm-game-feature-toggle-pick-func) + (flag "carry" 2048 dm-game-feature-toggle-pick-func) + (flag "sidekick" 4096 dm-game-feature-toggle-pick-func) + (flag "darkjak" 8192 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb0" 4194304 dm-game-feature-toggle-pick-func) + (flag "darkjak-bomb1" 8388608 dm-game-feature-toggle-pick-func) + (flag "darkjak-invinc" 16777216 dm-game-feature-toggle-pick-func) + (flag "darkjak-giant" 33554432 dm-game-feature-toggle-pick-func) + (flag "gun-yellow" 64 dm-game-feature-toggle-pick-func) + (flag "gun-red" 128 dm-game-feature-toggle-pick-func) + (flag "gun-blue" 256 dm-game-feature-toggle-pick-func) + (flag "gun-dark" 512 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-speed" 16384 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-ammo" 32768 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-damage" 65536 dm-game-feature-toggle-pick-func) + (flag "pass-red" 262144 dm-game-feature-toggle-pick-func) + (flag "pass-green" 524288 dm-game-feature-toggle-pick-func) + (flag "pass-yellow" 1048576 dm-game-feature-toggle-pick-func) + ) + ) ) - (let* ((s4-2 (debug-menu-find-from-template arg0 '("Game" "Continue"))) - (s3-2 - '(city - fortress - stadium - palace - castle - ruins - atoll - sewer - strip - mountain - forest - drill - tomb - dig - canyon - consite - under - nest - default - test - ) - ) - (a1-7 (car s3-2)) - ) - (while (not (null? s3-2)) - (let ((s2-0 debug-menu-append-item) - (s1-0 s4-2) - (s0-0 debug-menu-make-from-template) + ) + (let* ((s4-2 (debug-menu-find-from-template arg0 '("Game" "Continue"))) + (s3-2 + '(city + fortress + stadium + palace + castle + ruins + atoll + sewer + strip + mountain + forest + drill + tomb + dig + canyon + consite + under + nest + default + test ) - (set! sv-16 arg0) - (let ((a1-8 (debug-menu-make-continue-sub-menu (the-as debug-menu-context *game-info*) (the-as symbol a1-7)))) - (s2-0 s1-0 (s0-0 sv-16 a1-8)) + ) + (a1-7 (car s3-2)) + ) + (while (not (null? s3-2)) + (let ((s2-0 debug-menu-append-item) + (s1-0 s4-2) + (s0-0 debug-menu-make-from-template) ) + (set! sv-16 arg0) + (let ((a1-8 (debug-menu-make-continue-sub-menu (the-as debug-menu-context *game-info*) (the-as symbol a1-7)))) + (s2-0 s1-0 (s0-0 sv-16 a1-8)) ) - (set! s3-2 (cdr s3-2)) - (set! a1-7 (car s3-2)) ) + (set! s3-2 (cdr s3-2)) + (set! a1-7 (car s3-2)) ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Stats" - (flag "Poly" *stats-poly* dm-boolean-toggle-pick-func) - (flag "Collide" *stats-collide* dm-boolean-toggle-pick-func) - (flag "Bsp" *stats-bsp* dm-boolean-toggle-pick-func) - (flag "Buffer" *stats-buffer* dm-boolean-toggle-pick-func) - (flag "Target" *stats-target* dm-boolean-toggle-pick-func) - (flag "Blerc" *stats-blerc* dm-boolean-toggle-pick-func) - (flag "Profile bars" *stats-profile-bars* dm-boolean-toggle-pick-func) - (flag "Perf" *stats-perf* dm-boolean-toggle-pick-func) - (menu - "Memory Stats" - (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) - (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) - (flag "Level 0" 0 dm-stats-memory-func) - (flag "Level 1" 1 dm-stats-memory-func) - (flag "Level 2" 2 dm-stats-memory-func) - (flag "Level 3" 3 dm-stats-memory-func) - (flag "Level 4" 4 dm-stats-memory-func) - (flag "Level 5" 5 dm-stats-memory-func) - ) - (function - "Print Entity Memory" - #f - (lambda () - (format #t "~%~%========================= Entity Memory =========================~%~%") - (let ((gp-0 (-> *level* level0))) - (inspect (-> gp-0 art-group)) - (dotimes (s5-0 (-> gp-0 art-group art-group-array length)) - (inspect (-> gp-0 art-group art-group-array s5-0)) - ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Stats" + (flag "Poly" *stats-poly* dm-boolean-toggle-pick-func) + (flag "Collide" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Bsp" *stats-bsp* dm-boolean-toggle-pick-func) + (flag "Buffer" *stats-buffer* dm-boolean-toggle-pick-func) + (flag "Target" *stats-target* dm-boolean-toggle-pick-func) + (flag "Blerc" *stats-blerc* dm-boolean-toggle-pick-func) + (flag "Profile bars" *stats-profile-bars* dm-boolean-toggle-pick-func) + (flag "Perf" *stats-perf* dm-boolean-toggle-pick-func) + (menu + "Memory Stats" + (flag "Enable" *stats-memory* dm-boolean-toggle-pick-func) + (flag "Short" *stats-memory-short* dm-boolean-toggle-pick-func) + (flag "Level 0" 0 dm-stats-memory-func) + (flag "Level 1" 1 dm-stats-memory-func) + (flag "Level 2" 2 dm-stats-memory-func) + (flag "Level 3" 3 dm-stats-memory-func) + (flag "Level 4" 4 dm-stats-memory-func) + (flag "Level 5" 5 dm-stats-memory-func) + ) + (function + "Print Entity Memory" + #f + (lambda () + (format #t "~%~%========================= Entity Memory =========================~%~%") + (let ((gp-0 (-> *level* level0))) + (inspect (-> gp-0 art-group)) + (dotimes (s5-0 (-> gp-0 art-group art-group-array length)) + (inspect (-> gp-0 art-group art-group-array s5-0)) ) - #f ) - ) - (function - "Print Texture Info" #f - (lambda () - (format #t "~%~%========================= Texture Info =========================~%~%") - (inspect *texture-page-dir*) - ) - ) - (function - "Print Texture Verbose" - #f - (lambda () - (format #t "~%~%========================= Texture Info =========================~%~%") - (texture-page-dir-inspect *texture-page-dir* #t) - (none) - ) - ) - (function - "Print Merc Stats" - #f - (lambda () - (format #t "~%~%========================== Merc Stats ==========================~%~%") - (merc-stats) - (none) - ) ) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Render" - (menu - "Background" - (flag "Textured" 0 dm-subdiv-draw-func) - (flag "Outline" 1 dm-subdiv-draw-func) - (flag "Gouraud" 2 dm-subdiv-draw-func) - (flag "Hack" 3 dm-subdiv-draw-func) + (function + "Print Texture Info" + #f + (lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (inspect *texture-page-dir*) ) - (menu - "Background Scissor" - (flag "Textured" 0 dm-scissor-subdiv-draw-func) - (flag "Outline" 1 dm-scissor-subdiv-draw-func) - (flag "Gouraud" 2 dm-scissor-subdiv-draw-func) - (flag "Hack" 3 dm-scissor-subdiv-draw-func) - ) - (menu - "Foreground" - (flag "Textured" 0 dm-foreground-subdiv-draw-func) - (flag "Outline" 1 dm-foreground-subdiv-draw-func) - (flag "Gouraud" 2 dm-foreground-subdiv-draw-func) - (flag "Hack" 3 dm-foreground-subdiv-draw-func) - ) - (menu - "Ocean" - (flag "Textured" 0 dm-ocean-subdiv-draw-func) - (flag "Outline" 1 dm-ocean-subdiv-draw-func) - (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) - (flag "Hack" 3 dm-ocean-subdiv-draw-func) - ) - (flag "SKY TEXTURES" 32 dm-texture-user-toggle-pick-func) - (flag "sky" 3 dm-vu1-user-toggle-pick-func) - (flag "ocean" 4 dm-vu1-user-toggle-pick-func) - (flag "ocean-wave" 5 dm-vu1-user-toggle-pick-func) - (flag "TFRAG TIE TEXTURES" #x1 dm-texture-user-toggle-pick-func) - (flag "tfrag" 6 dm-vu1-user-toggle-pick-func) - (flag "tie" 8 dm-vu1-user-toggle-pick-func) - (flag "tie-envmap" 9 dm-vu1-user-toggle-pick-func) - (flag "tie-scissor" 7 dm-vu1-user-toggle-pick-func) - (flag "tie-envmap-scissor" 10 dm-vu1-user-toggle-pick-func) - (flag "tie-vanish" 11 dm-vu1-user-toggle-pick-func) - (flag "SHRUB TEXTURES" #x4 dm-texture-user-toggle-pick-func) - (flag "shrub-near" 16 dm-vu1-user-toggle-pick-func) - (flag "shrubbery" 15 dm-vu1-user-toggle-pick-func) - (flag "shrubbery-vanish" 18 dm-vu1-user-toggle-pick-func) - (flag "billboard" 17 dm-vu1-user-toggle-pick-func) - (flag "ALPHA TEXTURES" 1 dm-texture-user-toggle-pick-func) - (flag "tfrag-trans" 19 dm-vu1-user-toggle-pick-func) - (flag "tie-trans" 21 dm-vu1-user-toggle-pick-func) - (flag "tie-envmap-trans" 22 dm-vu1-user-toggle-pick-func) - (flag "tie-scissor-trans" 20 dm-vu1-user-toggle-pick-func) - (flag "tie-envmap-scissor-trans" 23 dm-vu1-user-toggle-pick-func) - (flag "PRIS TEXTURES" #x2 dm-texture-user-toggle-pick-func) - (flag "merc" 13 dm-vu1-user-toggle-pick-func) - (flag "emerc" 14 dm-vu1-user-toggle-pick-func) - (flag "generic" 12 dm-vu1-user-toggle-pick-func) - (flag "WATER TEXTURES" 2 dm-texture-user-toggle-pick-func) - (flag "tfrag-water" 24 dm-vu1-user-toggle-pick-func) - (flag "tie-water" 26 dm-vu1-user-toggle-pick-func) - (flag "tie-envmap-water" 27 dm-vu1-user-toggle-pick-func) - (flag "tie-scissor-water" 25 dm-vu1-user-toggle-pick-func) - (flag "tie-envmap-scissor-water" 28 dm-vu1-user-toggle-pick-func) - (flag "SPRITE TEXTURES" 8 dm-texture-user-toggle-pick-func) - (flag "sprite" 29 dm-vu1-user-toggle-pick-func) - (flag "shadow" 30 dm-vu1-user-toggle-pick-func) - (flag "shadow-debug" *shadow-debug* dm-boolean-toggle-pick-func) - (flag "depth-cue" 34 dm-vu1-user-toggle-pick-func) - (flag "WARP TEXTURES" 4 dm-texture-user-toggle-pick-func) - (flag "HUD TEXTURES" 16 dm-texture-user-toggle-pick-func) - (flag "all on" #f dm-vu1-user-all-pick-func) - (flag "all off" #f dm-vu1-user-none-pick-func) - (flag "all textures on" #x1ff dm-texture-user-set-pick-func) - (flag "all textures off" 0 dm-texture-user-set-pick-func) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Collision" - (menu - "Collision Renderer" - (flag "On" 0 dm-col-rend-on-func) - (flag "Track Player" 0 dm-col-rend-track-func) - (flag "Track Camera" 1 dm-col-rend-track-func) - (float-var " Dist" #f dm-col-rend-cam-dist 10 1 #t 0 80 1) - (flag "Fixed Pos" 2 dm-col-rend-track-func) - (float-var "Size" #f dm-col-rend-size 10 1 #t 1 20 1) - (flag "Outline" 0 dm-col-rend-outline-func) - (flag "Show Back-faces" 0 dm-col-rend-back-face-func) - (flag "Show Normals" 0 dm-col-rend-normals-func) - (flag "Ghost Hidden" 0 dm-col-rend-ghost-hidden-func) - (menu - "Show Only" - (flag "(board)" 1 dm-col-rend-show-only-set-func) - (flag "(grind)" 2 dm-col-rend-show-only-set-func) - (flag "(grindonly)" 4 dm-col-rend-show-only-set-func) - (flag "melt" 16384 dm-col-rend-show-only-toggle-func) - (flag "noboard" 8 dm-col-rend-show-only-toggle-func) - (flag "nocamera" 16 dm-col-rend-show-only-toggle-func) - (flag "noedge" 32 dm-col-rend-show-only-toggle-func) - (flag "noendlessfall" 64 dm-col-rend-show-only-toggle-func) - (flag "noentity" 128 dm-col-rend-show-only-toggle-func) - (flag "nogrind" 256 dm-col-rend-show-only-toggle-func) - (flag "nojak" 512 dm-col-rend-show-only-toggle-func) - (flag "nolineofsight" 1024 dm-col-rend-show-only-toggle-func) - (flag "nomech" 2048 dm-col-rend-show-only-toggle-func) - (flag "nopilot" 4096 dm-col-rend-show-only-toggle-func) - (flag "noproj" 8192 dm-col-rend-show-only-toggle-func) - (flag "probe" 32768 dm-col-rend-show-only-toggle-func) - (flag "Select All" 49144 dm-col-rend-show-only-set-func) - (flag "Unselect All" 0 dm-col-rend-show-only-set-func) - ) - (menu - "Find" - (flag "background" 1 dm-col-rend-cspec-toggle) - (flag "obstacles" 2 dm-col-rend-cspec-toggle) - (flag "pushers" 4 dm-col-rend-cspec-toggle) - (flag "Jak" 8 dm-col-rend-cspec-toggle) - (flag "other" 16 dm-col-rend-cspec-toggle) - ) + (function + "Print Texture Verbose" + #f + (lambda () + (format #t "~%~%========================= Texture Info =========================~%~%") + (texture-page-dir-inspect *texture-page-dir* #t) + (none) ) - (flag "Collision Cache" *display-collide-cache* dm-boolean-toggle-pick-func) - (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) - (flag "Ground Stats" *display-ground-stats* dm-boolean-toggle-pick-func) - (flag "Hipri Collision Marks" *display-hipri-collision-marks* dm-boolean-toggle-pick-func) - (flag "Edge Collision Marks" *display-edge-collision-marks* dm-boolean-toggle-pick-func) - (flag "Collide Stats" *stats-collide* dm-boolean-toggle-pick-func) - (flag "Render Collision" *display-render-collision* dm-boolean-toggle-pick-func) - (flag "Collide List Boxes" *collide-list-boxes* dm-boolean-toggle-pick-func) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Display" - (flag "Profile" *display-profile* dm-boolean-toggle-pick-func) - (flag "Ticks" *profile-ticks* dm-boolean-toggle-pick-func) - (flag "File Info" *display-file-info* dm-boolean-toggle-pick-func) - (flag "Level Spheres" *display-level-spheres* dm-boolean-toggle-pick-func) - (flag "Camera Marks" *display-camera-marks* dm-boolean-toggle-pick-func) - (flag "Camera Info" *display-camera-info* dm-boolean-toggle-pick-func) - (flag "Geometry Marks" *display-geo-marks* dm-boolean-toggle-pick-func) - (flag "Art Control" *display-art-control* dm-boolean-toggle-pick-func) - (flag "Gui Control" *display-gui-control* dm-boolean-toggle-pick-func) - (flag "Instance Info" *display-instance-info* dm-boolean-toggle-pick-func) - (menu - "strip lines" - (flag "strippable" 1 dm-strip-lines-toggle-pick-func) - (flag "convertible" 2 dm-strip-lines-toggle-pick-func) - (flag "edgeable" 4 dm-strip-lines-toggle-pick-func) - (flag "ordinary" 8 dm-strip-lines-toggle-pick-func) - (flag "color mismatch" 16 dm-strip-lines-toggle-pick-func) - (flag "shader mismatch" 32 dm-strip-lines-toggle-pick-func) - (flag "uv mismatch" 64 dm-strip-lines-toggle-pick-func) - (flag "too big" 128 dm-strip-lines-toggle-pick-func) - (flag "good" 3 dm-strip-lines-set-pick-func) - (flag "bad" 240 dm-strip-lines-set-pick-func) - (flag "all edges" 255 dm-strip-lines-set-pick-func) - (flag "strips" 256 dm-strip-lines-set-pick-func) - (flag "frags" 512 dm-strip-lines-set-pick-func) - (flag "none" 0 dm-strip-lines-set-pick-func) + (function + "Print Merc Stats" + #f + (lambda () + (format #t "~%~%========================== Merc Stats ==========================~%~%") + (merc-stats) + (none) ) - (menu - "collision mesh" - (flag "wall" 1024 dm-strip-lines-toggle-pick-func) - (flag "ground" 2048 dm-strip-lines-toggle-pick-func) - (flag "all" 3072 dm-strip-lines-set-pick-func) - (flag "none" 0 dm-strip-lines-set-pick-func) - ) - (flag "Texture Distances" *display-texture-distances* dm-boolean-toggle-pick-func) - (flag "Texture Download" *display-texture-download* dm-boolean-toggle-pick-func) - (flag "Level Border" *display-level-border* dm-boolean-toggle-pick-func) - (flag "Split Boxes" *display-split-boxes* dm-boolean-toggle-pick-func) - (flag "Split Box Info" *display-split-box-info* dm-boolean-toggle-pick-func) - (flag "Memcard Info" *display-memcard-info* dm-boolean-toggle-pick-func) - (flag "Trail Graph" *display-trail-graph* dm-boolean-toggle-pick-func) - (flag "Color Bars" *display-color-bars* dm-boolean-toggle-pick-func) ) - ) + ) ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Actor" - (flag "Spawn Actors" *spawn-actors* dm-boolean-toggle-pick-func) - (function "Reset Actors" #f (lambda () (reset-actors 'debug) (none))) - (function "Traffic Start" #f (lambda () - (let ((gp-0 traffic-start)) - (if (valid? gp-0 function (the-as symbol "") #t 0) - (gp-0) - ) - ) - (none) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Render" + (menu + "Background" + (flag "Textured" 0 dm-subdiv-draw-func) + (flag "Outline" 1 dm-subdiv-draw-func) + (flag "Gouraud" 2 dm-subdiv-draw-func) + (flag "Hack" 3 dm-subdiv-draw-func) + ) + (menu + "Background Scissor" + (flag "Textured" 0 dm-scissor-subdiv-draw-func) + (flag "Outline" 1 dm-scissor-subdiv-draw-func) + (flag "Gouraud" 2 dm-scissor-subdiv-draw-func) + (flag "Hack" 3 dm-scissor-subdiv-draw-func) + ) + (menu + "Foreground" + (flag "Textured" 0 dm-foreground-subdiv-draw-func) + (flag "Outline" 1 dm-foreground-subdiv-draw-func) + (flag "Gouraud" 2 dm-foreground-subdiv-draw-func) + (flag "Hack" 3 dm-foreground-subdiv-draw-func) + ) + (menu + "Ocean" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + (flag "Hack" 3 dm-ocean-subdiv-draw-func) + ) + (flag "SKY TEXTURES" 32 dm-texture-user-toggle-pick-func) + (flag "sky" 3 dm-vu1-user-toggle-pick-func) + (flag "ocean" 4 dm-vu1-user-toggle-pick-func) + (flag "ocean-wave" 5 dm-vu1-user-toggle-pick-func) + (flag "TFRAG TIE TEXTURES" #x1 dm-texture-user-toggle-pick-func) + (flag "tfrag" 6 dm-vu1-user-toggle-pick-func) + (flag "tie" 8 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap" 9 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor" 7 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor" 10 dm-vu1-user-toggle-pick-func) + (flag "tie-vanish" 11 dm-vu1-user-toggle-pick-func) + (flag "SHRUB TEXTURES" #x4 dm-texture-user-toggle-pick-func) + (flag "shrub-near" 16 dm-vu1-user-toggle-pick-func) + (flag "shrubbery" 15 dm-vu1-user-toggle-pick-func) + (flag "shrubbery-vanish" 18 dm-vu1-user-toggle-pick-func) + (flag "billboard" 17 dm-vu1-user-toggle-pick-func) + (flag "ALPHA TEXTURES" 1 dm-texture-user-toggle-pick-func) + (flag "tfrag-trans" 19 dm-vu1-user-toggle-pick-func) + (flag "tie-trans" 21 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-trans" 22 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-trans" 20 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-trans" 23 dm-vu1-user-toggle-pick-func) + (flag "PRIS TEXTURES" #x2 dm-texture-user-toggle-pick-func) + (flag "merc" 13 dm-vu1-user-toggle-pick-func) + (flag "emerc" 14 dm-vu1-user-toggle-pick-func) + (flag "generic" 12 dm-vu1-user-toggle-pick-func) + (flag "WATER TEXTURES" 2 dm-texture-user-toggle-pick-func) + (flag "tfrag-water" 24 dm-vu1-user-toggle-pick-func) + (flag "tie-water" 26 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-water" 27 dm-vu1-user-toggle-pick-func) + (flag "tie-scissor-water" 25 dm-vu1-user-toggle-pick-func) + (flag "tie-envmap-scissor-water" 28 dm-vu1-user-toggle-pick-func) + (flag "SPRITE TEXTURES" 8 dm-texture-user-toggle-pick-func) + (flag "sprite" 29 dm-vu1-user-toggle-pick-func) + (flag "shadow" 30 dm-vu1-user-toggle-pick-func) + (flag "shadow-debug" *shadow-debug* dm-boolean-toggle-pick-func) + (flag "depth-cue" 34 dm-vu1-user-toggle-pick-func) + (flag "WARP TEXTURES" 4 dm-texture-user-toggle-pick-func) + (flag "HUD TEXTURES" 16 dm-texture-user-toggle-pick-func) + (flag "all on" #f dm-vu1-user-all-pick-func) + (flag "all off" #f dm-vu1-user-none-pick-func) + (flag "all textures on" #x1ff dm-texture-user-set-pick-func) + (flag "all textures off" 0 dm-texture-user-set-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Collision" + (menu + "Collision Renderer" + (flag "On" 0 dm-col-rend-on-func) + (flag "Track Player" 0 dm-col-rend-track-func) + (flag "Track Camera" 1 dm-col-rend-track-func) + (float-var " Dist" #f dm-col-rend-cam-dist 10 1 #t 0 80 1) + (flag "Fixed Pos" 2 dm-col-rend-track-func) + (float-var "Size" #f dm-col-rend-size 10 1 #t 1 20 1) + (flag "Outline" 0 dm-col-rend-outline-func) + (flag "Show Back-faces" 0 dm-col-rend-back-face-func) + (flag "Show Normals" 0 dm-col-rend-normals-func) + (flag "Ghost Hidden" 0 dm-col-rend-ghost-hidden-func) + (menu + "Show Only" + (flag "(board)" 1 dm-col-rend-show-only-set-func) + (flag "(grind)" 2 dm-col-rend-show-only-set-func) + (flag "(grindonly)" 4 dm-col-rend-show-only-set-func) + (flag "melt" 16384 dm-col-rend-show-only-toggle-func) + (flag "noboard" 8 dm-col-rend-show-only-toggle-func) + (flag "nocamera" 16 dm-col-rend-show-only-toggle-func) + (flag "noedge" 32 dm-col-rend-show-only-toggle-func) + (flag "noendlessfall" 64 dm-col-rend-show-only-toggle-func) + (flag "noentity" 128 dm-col-rend-show-only-toggle-func) + (flag "nogrind" 256 dm-col-rend-show-only-toggle-func) + (flag "nojak" 512 dm-col-rend-show-only-toggle-func) + (flag "nolineofsight" 1024 dm-col-rend-show-only-toggle-func) + (flag "nomech" 2048 dm-col-rend-show-only-toggle-func) + (flag "nopilot" 4096 dm-col-rend-show-only-toggle-func) + (flag "noproj" 8192 dm-col-rend-show-only-toggle-func) + (flag "probe" 32768 dm-col-rend-show-only-toggle-func) + (flag "Select All" 49144 dm-col-rend-show-only-set-func) + (flag "Unselect All" 0 dm-col-rend-show-only-set-func) + ) + (menu + "Find" + (flag "background" 1 dm-col-rend-cspec-toggle) + (flag "obstacles" 2 dm-col-rend-cspec-toggle) + (flag "pushers" 4 dm-col-rend-cspec-toggle) + (flag "Jak" 8 dm-col-rend-cspec-toggle) + (flag "other" 16 dm-col-rend-cspec-toggle) + ) + ) + (flag "Collision Cache" *display-collide-cache* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (flag "Ground Stats" *display-ground-stats* dm-boolean-toggle-pick-func) + (flag "Hipri Collision Marks" *display-hipri-collision-marks* dm-boolean-toggle-pick-func) + (flag "Edge Collision Marks" *display-edge-collision-marks* dm-boolean-toggle-pick-func) + (flag "Collide Stats" *stats-collide* dm-boolean-toggle-pick-func) + (flag "Render Collision" *display-render-collision* dm-boolean-toggle-pick-func) + (flag "Collide List Boxes" *collide-list-boxes* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Display" + (flag "Profile" *display-profile* dm-boolean-toggle-pick-func) + (flag "Ticks" *profile-ticks* dm-boolean-toggle-pick-func) + (flag "File Info" *display-file-info* dm-boolean-toggle-pick-func) + (flag "Level Spheres" *display-level-spheres* dm-boolean-toggle-pick-func) + (flag "Camera Marks" *display-camera-marks* dm-boolean-toggle-pick-func) + (flag "Camera Info" *display-camera-info* dm-boolean-toggle-pick-func) + (flag "Geometry Marks" *display-geo-marks* dm-boolean-toggle-pick-func) + (flag "Art Control" *display-art-control* dm-boolean-toggle-pick-func) + (flag "Gui Control" *display-gui-control* dm-boolean-toggle-pick-func) + (flag "Instance Info" *display-instance-info* dm-boolean-toggle-pick-func) + (menu + "strip lines" + (flag "strippable" 1 dm-strip-lines-toggle-pick-func) + (flag "convertible" 2 dm-strip-lines-toggle-pick-func) + (flag "edgeable" 4 dm-strip-lines-toggle-pick-func) + (flag "ordinary" 8 dm-strip-lines-toggle-pick-func) + (flag "color mismatch" 16 dm-strip-lines-toggle-pick-func) + (flag "shader mismatch" 32 dm-strip-lines-toggle-pick-func) + (flag "uv mismatch" 64 dm-strip-lines-toggle-pick-func) + (flag "too big" 128 dm-strip-lines-toggle-pick-func) + (flag "good" 3 dm-strip-lines-set-pick-func) + (flag "bad" 240 dm-strip-lines-set-pick-func) + (flag "all edges" 255 dm-strip-lines-set-pick-func) + (flag "strips" 256 dm-strip-lines-set-pick-func) + (flag "frags" 512 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (menu + "collision mesh" + (flag "wall" 1024 dm-strip-lines-toggle-pick-func) + (flag "ground" 2048 dm-strip-lines-toggle-pick-func) + (flag "all" 3072 dm-strip-lines-set-pick-func) + (flag "none" 0 dm-strip-lines-set-pick-func) + ) + (flag "Texture Distances" *display-texture-distances* dm-boolean-toggle-pick-func) + (flag "Texture Download" *display-texture-download* dm-boolean-toggle-pick-func) + (flag "Level Border" *display-level-border* dm-boolean-toggle-pick-func) + (flag "Split Boxes" *display-split-boxes* dm-boolean-toggle-pick-func) + (flag "Split Box Info" *display-split-box-info* dm-boolean-toggle-pick-func) + (flag "Memcard Info" *display-memcard-info* dm-boolean-toggle-pick-func) + (flag "Trail Graph" *display-trail-graph* dm-boolean-toggle-pick-func) + (flag "Color Bars" *display-color-bars* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Actor" + (flag "Spawn Actors" *spawn-actors* dm-boolean-toggle-pick-func) + (function "Reset Actors" #f (lambda () (reset-actors 'debug) (none))) + (function "Traffic Start" #f (lambda () + (let ((gp-0 traffic-start)) + (if (valid? gp-0 function (the-as symbol "") #t 0) + (gp-0) + ) ) - ) - (function "Traffic Kill" #f (lambda () - (let ((gp-0 traffic-kill)) - (if (valid? gp-0 function (the-as symbol "") #t 0) - (gp-0) - ) - ) - (none) + (none) + ) + ) + (function "Traffic Kill" #f (lambda () + (let ((gp-0 traffic-kill)) + (if (valid? gp-0 function (the-as symbol "") #t 0) + (gp-0) + ) ) - ) - (menu - "Bot" - (function - "Bot Next" - #f - (lambda () - (send-event (process-by-name "sig-atoll-1" *active-pool*) 'skip) - (send-event (process-by-name "hal-sewer-1" *active-pool*) 'skip) - (send-event (process-by-name "hal-escort-1" *active-pool*) 'skip) - (send-event (process-by-name "squid-2" *active-pool*) 'skip) - (send-event (process-by-name "metalkor-1" *active-pool*) 'skip) - (send-event (process-by-name "sig-under-1" *active-pool*) 'skip) - ) - ) - (menu - "Bot Marks" - (flag "course spots" 1 display-bot-marks-toggle-pick-func) - (flag "task spots" 2 display-bot-marks-toggle-pick-func) - (flag "all on" 3 display-bot-marks-set-pick-func) - (flag "all off" 0 display-bot-marks-set-pick-func) - ) - (function - "Record sig5-cent1-path0" - #f - (lambda () - (set! *bot-record-path* 0) - (dm-play-task-with-continue (game-task under-sig) "cent1-path0-record-path") - (none) - ) - ) - (function - "Record sig5-cent2-path0" - #f - (lambda () - (set! *bot-record-path* 1) - (dm-play-task-with-continue (game-task under-sig) "cent2-path0-record-path") - (none) - ) + (none) + ) + ) + (menu + "Bot" + (function + "Bot Next" + #f + (lambda () + (send-event (process-by-name "sig-atoll-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-sewer-1" *active-pool*) 'skip) + (send-event (process-by-name "hal-escort-1" *active-pool*) 'skip) + (send-event (process-by-name "squid-2" *active-pool*) 'skip) + (send-event (process-by-name "metalkor-1" *active-pool*) 'skip) + (send-event (process-by-name "sig-under-1" *active-pool*) 'skip) ) ) (menu - "Actor Compaction" - (flag "off" #f dm-compact-actor-pick-func) - (flag "on" #t dm-compact-actor-pick-func) - (flag "debug" debug dm-compact-actor-pick-func) + "Bot Marks" + (flag "course spots" 1 display-bot-marks-toggle-pick-func) + (flag "task spots" 2 display-bot-marks-toggle-pick-func) + (flag "all on" 3 display-bot-marks-set-pick-func) + (flag "all off" 0 display-bot-marks-set-pick-func) ) - (flag "Traffic height map" *display-traffic-height-map* dm-boolean-toggle-pick-func) - (flag "View Anims" *debug-view-anims* dm-boolean-toggle-pick-func) - (flag "Unkillable" *debug-unkillable* dm-boolean-toggle-pick-func) - (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) - (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) - (flag "Actor Vis" *vis-actors* dm-boolean-toggle-pick-func) - (flag "Battle Marks" *display-battle-marks* dm-boolean-toggle-pick-func) - (menu - "Hover Marks" - (flag "Nav Network" *display-nav-network* dm-boolean-toggle-pick-func) - (flag "Debug Hover" *debug-hover* dm-boolean-toggle-pick-func) + (function + "Record sig5-cent1-path0" + #f + (lambda () + (set! *bot-record-path* 0) + (dm-play-task-with-continue (game-task under-sig) "cent1-path0-record-path") + (none) + ) ) - (flag "Joint Axes" *display-joint-axes* dm-boolean-toggle-pick-func) - (flag "Path Marks" *display-path-marks* dm-boolean-toggle-pick-func) - (flag "Nav Marks" *display-nav-marks* dm-boolean-toggle-pick-func) - (flag "Vol Marks" *display-vol-marks* dm-boolean-toggle-pick-func) - (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) - (menu - "Actor Vis" - (flag "off" #f dm-actor-vis-pick-func) - (flag "box" box dm-actor-vis-pick-func) - (flag "sphere" sphere dm-actor-vis-pick-func) - (flag "all" #t dm-actor-vis-pick-func) - ) - (menu - "Actor Marks" - (flag "off" #f dm-actor-marks-pick-func) - (flag "alive entities" #t dm-actor-marks-pick-func) - (flag "all entities" full dm-actor-marks-pick-func) - (flag "processes" process dm-actor-marks-pick-func) + (function + "Record sig5-cent2-path0" + #f + (lambda () + (set! *bot-record-path* 1) + (dm-play-task-with-continue (game-task under-sig) "cent2-path0-record-path") + (none) + ) ) ) - ) + (menu + "Actor Compaction" + (flag "off" #f dm-compact-actor-pick-func) + (flag "on" #t dm-compact-actor-pick-func) + (flag "debug" debug dm-compact-actor-pick-func) + ) + (flag "Traffic height map" *display-traffic-height-map* dm-boolean-toggle-pick-func) + (flag "View Anims" *debug-view-anims* dm-boolean-toggle-pick-func) + (flag "Unkillable" *debug-unkillable* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Actor Vis" *vis-actors* dm-boolean-toggle-pick-func) + (flag "Battle Marks" *display-battle-marks* dm-boolean-toggle-pick-func) + (menu + "Hover Marks" + (flag "Nav Network" *display-nav-network* dm-boolean-toggle-pick-func) + (flag "Debug Hover" *debug-hover* dm-boolean-toggle-pick-func) + ) + (flag "Joint Axes" *display-joint-axes* dm-boolean-toggle-pick-func) + (flag "Path Marks" *display-path-marks* dm-boolean-toggle-pick-func) + (flag "Nav Marks" *display-nav-marks* dm-boolean-toggle-pick-func) + (flag "Vol Marks" *display-vol-marks* dm-boolean-toggle-pick-func) + (flag "Collision Marks" *display-collision-marks* dm-boolean-toggle-pick-func) + (menu + "Actor Vis" + (flag "off" #f dm-actor-vis-pick-func) + (flag "box" box dm-actor-vis-pick-func) + (flag "sphere" sphere dm-actor-vis-pick-func) + (flag "all" #t dm-actor-vis-pick-func) + ) + (menu + "Actor Marks" + (flag "off" #f dm-actor-marks-pick-func) + (flag "alive entities" #t dm-actor-marks-pick-func) + (flag "all entities" full dm-actor-marks-pick-func) + (flag "processes" process dm-actor-marks-pick-func) + ) + ) ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Target" - (menu - "Mode" - (function "normal" #f (lambda () (send-event *target* 'end-mode))) - (function "racer" #f (lambda () - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'racer #f) - ) - ) - (function "flut" #f (lambda () - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'flut #f) - ) - ) - (function "board" #f (lambda () - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (logior! (-> *game-info* features) (game-feature board)) - (logior! (-> *game-info* debug-features) (game-feature board)) - (send-event *target* 'change-mode 'board #f) - ) - ) - (function "mech" #f (lambda () - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'mech #f) - ) - ) - (function "gun" #f (lambda () + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Target" + (menu + "Mode" + (function "normal" #f (lambda () (send-event *target* 'end-mode))) + (function "racer" #f (lambda () (if (not *target*) (start 'debug (get-current-continue-point *game-info*)) ) - (logior! (-> *game-info* features) (game-feature unk-game-feature-06)) - (logior! (-> *game-info* debug-features) (game-feature unk-game-feature-06)) - (send-event *target* 'change-mode 'gun #f 0) + (send-event *target* 'change-mode 'racer #f) ) - ) - (function "darkjak" #f (lambda () - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (logior! (-> *game-info* features) (game-feature darkjak)) - (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) - ) - ) - (function "indax" #f (lambda () - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'indax #f) - ) - ) - ) - (menu - "Pilot Mode" - (function "bikea" #f (lambda () (dm-pilot-mode 0) (none))) - (function "bikeb" #f (lambda () (dm-pilot-mode 1) (none))) - (function "bikec" #f (lambda () (dm-pilot-mode 2) (none))) - (function "crimson-bike" #f (lambda () (dm-pilot-mode 6) (none))) - (function "cara" #f (lambda () (dm-pilot-mode 3) (none))) - (function "carb" #f (lambda () (dm-pilot-mode 4) (none))) - (function "carc" #f (lambda () (dm-pilot-mode 5) (none))) - (function "hellcat" #f (lambda () (dm-pilot-mode 7) (none))) - (function "race-bike-a" #f (lambda () (dm-pilot-race-mode 0) (none))) - (function "race-bike-b" #f (lambda () (dm-pilot-race-mode 1) (none))) - (function "race-bike-c" #f (lambda () (dm-pilot-race-mode 2) (none))) - (function "evantestbike" #f (lambda () (dm-pilot-mode 8) (none))) - (function "test-bike" #f (lambda () (dm-pilot-mode 9) (none))) - (function "test-car" #f (lambda () (dm-pilot-mode 10) (none))) - ) - (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if *target* - (stop 'debug) + ) + (function "flut" #f (lambda () + (if (not *target*) (start 'debug (get-current-continue-point *game-info*)) ) + (send-event *target* 'change-mode 'flut #f) ) - *target* - ) - ) - (menu - "Darkjak" - (function - "get all" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (set! (-> *game-info* features) - (logior (game-feature darkjak darkjak-bomb0 darkjak-bomb1 darkjak-invinc darkjak-giant) - (-> *game-info* features) - ) - ) - (set! (-> *game-info* debug-features) - (logior (game-feature darkjak darkjak-bomb0 darkjak-bomb1 darkjak-invinc darkjak-giant) - (-> *game-info* debug-features) - ) - ) - (send-event *target* 'get-pickup 7 #x42c80000) - ) - ) - (function "manual" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (logior! (-> *game-info* features) (game-feature darkjak)) - (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 3) + ) + (function "board" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature board)) + (logior! (-> *game-info* debug-features) (game-feature board)) + (send-event *target* 'change-mode 'board #f) + ) + ) + (function "mech" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) ) - ) - (function "rapid" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (send-event *target* 'change-mode 'mech #f) + ) + ) + (function "gun" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature unk-game-feature-06)) + (logior! (-> *game-info* debug-features) (game-feature unk-game-feature-06)) + (send-event *target* 'change-mode 'gun #f 0) + ) + ) + (function "darkjak" #f (lambda () (if (not *target*) (start 'debug (get-current-continue-point *game-info*)) ) (logior! (-> *game-info* features) (game-feature darkjak)) (logior! (-> *game-info* debug-features) (game-feature darkjak)) - (send-event *target* 'change-mode 'darkjak #f 2) + (send-event *target* 'change-mode 'darkjak #f 3) ) - ) - (function "bomb0" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 7) - ) - ) - (function "bomb1" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 15) - ) - ) - (function "invinc" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 31) - ) - ) - (function "giant" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (not *target*) - (start 'debug (get-current-continue-point *game-info*)) - ) - (send-event *target* 'change-mode 'darkjak #f 63) - ) - ) - ) - (menu - "Gun" - (flag "yellow" 2 dm-game-inventory-toggle-pick-func) - (flag "red" 4 dm-game-inventory-toggle-pick-func) - (flag "blue" 8 dm-game-inventory-toggle-pick-func) - (flag "dark" 16 dm-game-inventory-toggle-pick-func) - (flag "gun-upgrade-speed" 16384 dm-game-feature-toggle-pick-func) - (flag "gun-upgrade-ammo" 32768 dm-game-feature-toggle-pick-func) - (flag "gun-upgrade-damage" 65536 dm-game-feature-toggle-pick-func) - ) - (flag "Target Marks" *display-target-marks* dm-boolean-toggle-pick-func) - (flag "Gun Marks" *gun-marks* dm-boolean-toggle-pick-func) - (flag "Target Stats" *stats-target* dm-boolean-toggle-pick-func) - (flag "Sidekick Stats" *display-sidekick-stats* dm-boolean-toggle-pick-func) - (flag "Invulnerable" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if *target* - (logxor! (-> *target* state-flags) (state-flags sf2)) - ) - ) - (and *target* (logtest? (-> *target* state-flags) (state-flags sf2))) - ) - ) - (flag - "Endless Ammo" + ) + (function "indax" #f (lambda () + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'indax #f) + ) + ) + ) + (menu + "Pilot Mode" + (function "bikea" #f (lambda () (dm-pilot-mode 0) (none))) + (function "bikeb" #f (lambda () (dm-pilot-mode 1) (none))) + (function "bikec" #f (lambda () (dm-pilot-mode 2) (none))) + (function "crimson-bike" #f (lambda () (dm-pilot-mode 6) (none))) + (function "cara" #f (lambda () (dm-pilot-mode 3) (none))) + (function "carb" #f (lambda () (dm-pilot-mode 4) (none))) + (function "carc" #f (lambda () (dm-pilot-mode 5) (none))) + (function "hellcat" #f (lambda () (dm-pilot-mode 7) (none))) + (function "race-bike-a" #f (lambda () (dm-pilot-race-mode 0) (none))) + (function "race-bike-b" #f (lambda () (dm-pilot-race-mode 1) (none))) + (function "race-bike-c" #f (lambda () (dm-pilot-race-mode 2) (none))) + (function "evantestbike" #f (lambda () (dm-pilot-mode 8) (none))) + (function "test-bike" #f (lambda () (dm-pilot-mode 9) (none))) + (function "test-car" #f (lambda () (dm-pilot-mode 10) (none))) + ) + (flag "Target" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (stop 'debug) + (start 'debug (get-current-continue-point *game-info*)) + ) + ) + *target* + ) + ) + (menu + "Darkjak" + (function + "get all" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (when (= arg1 (debug-menu-msg press)) - (if *target* - (set! (-> *target* state-flags) (logxor #x10000 (the-as int (-> *target* state-flags)))) + (set! (-> *game-info* features) + (logior (game-feature darkjak darkjak-bomb0 darkjak-bomb1 darkjak-invinc darkjak-giant) + (-> *game-info* features) + ) + ) + (set! (-> *game-info* debug-features) + (logior (game-feature darkjak darkjak-bomb0 darkjak-bomb1 darkjak-invinc darkjak-giant) + (-> *game-info* debug-features) + ) ) - ) - (and *target* (logtest? (state-flags sf16) (-> *target* state-flags))) - ) - ) - (function - "Full Stuff" - #f - (lambda () - (send-event *target* 'get-pickup 18 #x447a0000) - (send-event *target* 'get-pickup 17 #x447a0000) - (send-event *target* 'get-pickup 13 #x447a0000) - (send-event *target* 'get-pickup 14 #x447a0000) - (send-event *target* 'get-pickup 15 #x447a0000) - (send-event *target* 'get-pickup 16 #x447a0000) (send-event *target* 'get-pickup 7 #x42c80000) - (logior! - (-> *game-info* features) - (game-feature unk-game-feature-06 gun-yellow gun-red gun-blue gun-dark board darkjak) - ) - (let ((v0-7 - (logior (-> *game-info* debug-features) - (game-feature unk-game-feature-06 gun-yellow gun-red gun-blue gun-dark board darkjak) - ) - ) - ) - (set! (-> *game-info* debug-features) v0-7) - v0-7 - ) ) ) - (function - "Dump Stuff" - #f - (lambda () - (send-event *target* 'get-pickup 17 -998637568) - (send-event *target* 'get-pickup 13 -998637568) - (send-event *target* 'get-pickup 14 -998637568) - (send-event *target* 'get-pickup 15 -998637568) - (send-event *target* 'get-pickup 16 -998637568) - ) - ) - (function "Trick Mode" #f (lambda () (send-event *target* 'get-pickup 20 #x468ca000))) - (function "Reset Trans" #f (lambda () (when *target* - (position-in-front-of-camera! (target-pos 0) 40960.0 4096.0) - (set! (-> *target* control transv quad) (the-as uint128 0)) - (quaternion-identity! (-> *target* control quat)) - (quaternion-identity! (-> *target* control unknown-quaternion00)) - (quaternion-identity! (-> *target* control dir-targ)) - ) - ) + (function "manual" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (logior! (-> *game-info* features) (game-feature darkjak)) + (logior! (-> *game-info* debug-features) (game-feature darkjak)) + (send-event *target* 'change-mode 'darkjak #f 3) + ) ) - (function "Zero Trans" #f (lambda () (when *target* - (set-vector! (-> *target* control trans) 0.0 163840.0 0.0 1.0) - (set! (-> *target* control transv quad) (the-as uint128 0)) - (quaternion-identity! (-> *target* control quat)) - (quaternion-identity! (-> *target* control unknown-quaternion00)) - (quaternion-identity! (-> *target* control dir-targ)) - ) - ) - ) - (flag "Slow Frame Rate" *slow-frame-rate* dm-boolean-toggle-pick-func) - (function "Print Pos" #f (lambda () - (let ((v1-0 (target-pos 0))) - (format #t "~6,,2m ~6,,2m ~6,,2m~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) - ) - 0 + (function "rapid" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) ) + (logior! (-> *game-info* features) (game-feature darkjak)) + (logior! (-> *game-info* debug-features) (game-feature darkjak)) + (send-event *target* 'change-mode 'darkjak #f 2) + ) ) - (function "Save Continue" #f (lambda () (the-as symbol (if *target* - (trsq->continue-point (-> *target* control)) - ) - ) - ) + (function "bomb0" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 7) + ) + ) + (function "bomb1" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 15) + ) + ) + (function "invinc" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 31) + ) + ) + (function "giant" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (not *target*) + (start 'debug (get-current-continue-point *game-info*)) + ) + (send-event *target* 'change-mode 'darkjak #f 63) + ) ) - (flag "RC Board Controls" *target-rc-board-controls* dm-boolean-toggle-pick-func) ) - ) - ) - (debug-menu-append-item s5-0 (debug-menu-make-camera-menu arg0)) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Racing" - (flag "Kiera Class 3 (kierac)" 0 dm-select-race-pick-func) - (flag "Kiera Class 2 (kierab)" 1 dm-select-race-pick-func) - (flag "Kiera Class 1 (kieraa)" 2 dm-select-race-pick-func) - (flag "Errol (errol)" 3 dm-select-race-pick-func) - (flag "Bush Class 3" 4 dm-select-race-pick-func) - (flag "Bush Class 2" 5 dm-select-race-pick-func) - (flag "Bush Class 1" 6 dm-select-race-pick-func) - (flag "Bush Class 3R" 9 dm-select-race-pick-func) - (flag "Bush Class 2R" 10 dm-select-race-pick-func) - (flag "Bush Class 1R" 11 dm-select-race-pick-func) - (flag "Bush Errol" 7 dm-select-race-pick-func) - (flag "Bush Port" 8 dm-select-race-pick-func) - (int-var "Select Path" 0 dm-select-race-path 10 1 #t 0 7) - (menu - "Race Marks" - (flag "Path 0 (Red)" 1 display-race-marks-toggle-pick-func) - (flag "Path 1 (Green)" 2 display-race-marks-toggle-pick-func) - (flag "Path 2 (Blue)" 4 display-race-marks-toggle-pick-func) - (flag "Path 3 (Yellow)" 8 display-race-marks-toggle-pick-func) - (flag "Path 4 (Cyan)" 16 display-race-marks-toggle-pick-func) - (flag "Path 5 (Violet)" 32 display-race-marks-toggle-pick-func) - (flag "Path 6 (Orange)" 64 display-race-marks-toggle-pick-func) - (flag "Path 7 (Black)" 128 display-race-marks-toggle-pick-func) - (flag "All Paths On" 255 display-race-marks-set-pick-func) - (flag "All Off" 0 display-race-marks-set-pick-func) - ) - (function - "Record Selected Path" - #f - (lambda () (set! *race-record-path* #t) (dm-play-race *select-race* #t) (none)) - ) - (function "Play Race" #f (lambda () (set! *race-record-path* #f) (dm-play-race *select-race* #f) (none))) + (menu + "Gun" + (flag "yellow" 2 dm-game-inventory-toggle-pick-func) + (flag "red" 4 dm-game-inventory-toggle-pick-func) + (flag "blue" 8 dm-game-inventory-toggle-pick-func) + (flag "dark" 16 dm-game-inventory-toggle-pick-func) + (flag "gun-upgrade-speed" 16384 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-ammo" 32768 dm-game-feature-toggle-pick-func) + (flag "gun-upgrade-damage" 65536 dm-game-feature-toggle-pick-func) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Nav Graph" - (function "Start Editor" #f (lambda () - (if (not (get-nav-graph-editor)) - (run-nav-graph-editor 'test) - ) - (none) + (flag "Target Marks" *display-target-marks* dm-boolean-toggle-pick-func) + (flag "Gun Marks" *gun-marks* dm-boolean-toggle-pick-func) + (flag "Target Stats" *stats-target* dm-boolean-toggle-pick-func) + (flag "Sidekick Stats" *display-sidekick-stats* dm-boolean-toggle-pick-func) + (flag "Invulnerable" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (logxor! (-> *target* state-flags) (state-flags sf2)) ) + ) + (and *target* (logtest? (-> *target* state-flags) (state-flags sf2))) + ) + ) + (flag + "Endless Ammo" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (if *target* + (set! (-> *target* state-flags) (the-as state-flags (logxor #x10000 (the-as int (-> *target* state-flags))))) + ) + ) + (and *target* (logtest? (state-flags sf16) (-> *target* state-flags))) + ) + ) + (function + "Full Stuff" + #f + (lambda () + (send-event *target* 'get-pickup 18 #x447a0000) + (send-event *target* 'get-pickup 17 #x447a0000) + (send-event *target* 'get-pickup 13 #x447a0000) + (send-event *target* 'get-pickup 14 #x447a0000) + (send-event *target* 'get-pickup 15 #x447a0000) + (send-event *target* 'get-pickup 16 #x447a0000) + (send-event *target* 'get-pickup 7 #x42c80000) + (logior! + (-> *game-info* features) + (game-feature unk-game-feature-06 gun-yellow gun-red gun-blue gun-dark board darkjak) + ) + (let ((v0-7 + (logior (-> *game-info* debug-features) + (game-feature unk-game-feature-06 gun-yellow gun-red gun-blue gun-dark board darkjak) + ) ) - (function "Exit Editor" #f (lambda () - (if (get-nav-graph-editor) - (exit-nav-graph-editor) + ) + (set! (-> *game-info* debug-features) v0-7) + v0-7 + ) + ) + ) + (function + "Dump Stuff" + #f + (lambda () + (send-event *target* 'get-pickup 17 -998637568) + (send-event *target* 'get-pickup 13 -998637568) + (send-event *target* 'get-pickup 14 -998637568) + (send-event *target* 'get-pickup 15 -998637568) + (send-event *target* 'get-pickup 16 -998637568) + ) + ) + (function "Trick Mode" #f (lambda () (send-event *target* 'get-pickup 20 #x468ca000))) + (function "Reset Trans" #f (lambda () (when *target* + (position-in-front-of-camera! (target-pos 0) 40960.0 4096.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control unknown-quaternion00)) + (quaternion-identity! (-> *target* control dir-targ)) + ) ) - (none) - ) - ) - (function "Toggle Plane Mode" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (if a0-0 - ((method-of-object a0-0 nav-graph-editor-method-60)) - ) + ) + (function "Zero Trans" #f (lambda () (when *target* + (set-vector! (-> *target* control trans) 0.0 163840.0 0.0 1.0) + (set! (-> *target* control transv quad) (the-as uint128 0)) + (quaternion-identity! (-> *target* control quat)) + (quaternion-identity! (-> *target* control unknown-quaternion00)) + (quaternion-identity! (-> *target* control dir-targ)) ) - (none) + ) + ) + (flag "Slow Frame Rate" *slow-frame-rate* dm-boolean-toggle-pick-func) + (function "Print Pos" #f (lambda () + (let ((v1-0 (target-pos 0))) + (format #t "~6,,2m ~6,,2m ~6,,2m~%" (-> v1-0 x) (-> v1-0 y) (-> v1-0 z)) + ) + 0 + ) + ) + (function "Save Continue" #f (lambda () (the-as symbol (if *target* + (trsq->continue-point (-> *target* control)) + ) + ) ) - ) - (function "Toggle Hover Mode" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (if a0-0 - ((method-of-object a0-0 nav-graph-editor-method-61)) - ) - ) - (none) + ) + (flag "RC Board Controls" *target-rc-board-controls* dm-boolean-toggle-pick-func) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-camera-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Racing" + (flag "Kiera Class 3 (kierac)" 0 dm-select-race-pick-func) + (flag "Kiera Class 2 (kierab)" 1 dm-select-race-pick-func) + (flag "Kiera Class 1 (kieraa)" 2 dm-select-race-pick-func) + (flag "Errol (errol)" 3 dm-select-race-pick-func) + (flag "Bush Class 3" 4 dm-select-race-pick-func) + (flag "Bush Class 2" 5 dm-select-race-pick-func) + (flag "Bush Class 1" 6 dm-select-race-pick-func) + (flag "Bush Class 3R" 9 dm-select-race-pick-func) + (flag "Bush Class 2R" 10 dm-select-race-pick-func) + (flag "Bush Class 1R" 11 dm-select-race-pick-func) + (flag "Bush Errol" 7 dm-select-race-pick-func) + (flag "Bush Port" 8 dm-select-race-pick-func) + (int-var "Select Path" 0 dm-select-race-path 10 1 #t 0 7) + (menu + "Race Marks" + (flag "Path 0 (Red)" 1 display-race-marks-toggle-pick-func) + (flag "Path 1 (Green)" 2 display-race-marks-toggle-pick-func) + (flag "Path 2 (Blue)" 4 display-race-marks-toggle-pick-func) + (flag "Path 3 (Yellow)" 8 display-race-marks-toggle-pick-func) + (flag "Path 4 (Cyan)" 16 display-race-marks-toggle-pick-func) + (flag "Path 5 (Violet)" 32 display-race-marks-toggle-pick-func) + (flag "Path 6 (Orange)" 64 display-race-marks-toggle-pick-func) + (flag "Path 7 (Black)" 128 display-race-marks-toggle-pick-func) + (flag "All Paths On" 255 display-race-marks-set-pick-func) + (flag "All Off" 0 display-race-marks-set-pick-func) + ) + (function + "Record Selected Path" + #f + (lambda () (set! *race-record-path* #t) (dm-play-race *select-race* #t) (none)) + ) + (function "Play Race" #f (lambda () (set! *race-record-path* #f) (dm-play-race *select-race* #f) (none))) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Nav Graph" + (function "Start Editor" #f (lambda () + (if (not (get-nav-graph-editor)) + (run-nav-graph-editor 'test) + ) + (none) + ) + ) + (function "Exit Editor" #f (lambda () + (if (get-nav-graph-editor) + (exit-nav-graph-editor) + ) + (none) + ) + ) + (function "Toggle Plane Mode" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (if a0-0 + ((method-of-object a0-0 nav-graph-editor-method-60)) + ) ) - ) - (menu - "Load" - (function "Hover Drillmid" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (when a0-0 - (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) - 'hover - 'drillmid - (t9-1) - ) - ) - ) - (none) - ) - ) - (function "Hover Forresca" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (when a0-0 - (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) - 'hover - 'forresca - (t9-1) - ) - ) - ) - (none) - ) - ) - (function "Hover Forest" #f (lambda () + (none) + ) + ) + (function "Toggle Hover Mode" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (if a0-0 + ((method-of-object a0-0 nav-graph-editor-method-61)) + ) + ) + (none) + ) + ) + (menu + "Load" + (function "Hover Drillmid" #f (lambda () (let ((a0-0 (get-nav-graph-editor))) (when a0-0 (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) 'hover - 'forest + 'drillmid (t9-1) ) ) ) (none) ) - ) - (function "Hover Under" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (when a0-0 - (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) - 'hover - 'under - (t9-1) - ) + ) + (function "Hover Forresca" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'forresca + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Hover Forest" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'forest + (t9-1) + ) + ) + ) + (none) + ) + ) + (function "Hover Under" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'hover + 'under + (t9-1) ) ) - (none) ) - ) - (function "Traffic" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (when a0-0 - (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) - 'traffic - (t9-1) - ) + (none) + ) + ) + (function "Traffic" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'traffic + (t9-1) ) ) - (none) ) - ) - (function "Minimap" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (when a0-0 - (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) - 'minimap - (t9-1) - ) + (none) + ) + ) + (function "Minimap" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (when a0-0 + (let ((t9-1 (method-of-object a0-0 nav-graph-editor-method-62))) + 'minimap + (t9-1) ) ) - (none) ) - ) - ) - (function "Save" #f (lambda () - (let ((a0-0 (get-nav-graph-editor))) - (if a0-0 - ((method-of-object a0-0 nav-graph-editor-method-63)) - ) - ) - (none) - ) + (none) + ) ) ) - ) + (function "Save" #f (lambda () + (let ((a0-0 (get-nav-graph-editor))) + (if a0-0 + ((method-of-object a0-0 nav-graph-editor-method-63)) + ) + ) + (none) + ) + ) + ) ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Map" - (flag "Record Mode" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *bigmap* recording-flag) (not (-> *bigmap* recording-flag))) - ) - (-> *bigmap* recording-flag) - ) - ) - (function - "Clear map" - #f - (lambda () - (let ((v1-1 - (process-spawn-function - process - (lambda () (with-pp - (set-master-mode 'game) - (let ((gp-0 (-> pp clock frame-counter))) - (until (>= (- (-> pp clock frame-counter) gp-0) (seconds 0.3)) - (suspend) - ) - ) - (until #f - (format *stdcon* "press x clear map, press circle cancel~%") - (cond - ((cpad-pressed? 0 x) - (initialize *bigmap*) - (return #f) - ) - ((cpad-pressed? 0 circle) - (return #f) - ) - ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Map" + (flag "Record Mode" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *bigmap* recording-flag) (not (-> *bigmap* recording-flag))) + ) + (-> *bigmap* recording-flag) + ) + ) + (function + "Clear map" + #f + (lambda () + (let ((v1-1 + (process-spawn-function + process + (lambda () (with-pp + (set-master-mode 'game) + (let ((gp-0 (-> pp clock frame-counter))) + (until (>= (- (-> pp clock frame-counter) gp-0) (seconds 0.3)) (suspend) ) - #f ) - ) - ) + (until #f + (format *stdcon* "press x clear map, press circle cancel~%") + (cond + ((cpad-pressed? 0 x) + (initialize *bigmap*) + (return #f) + ) + ((cpad-pressed? 0 circle) + (return #f) + ) + ) + (suspend) + ) + #f + ) + ) ) ) - (when v1-1 - (let ((v0-3 (logclear (-> v1-1 0 mask) (process-mask menu)))) - (set! (-> v1-1 0 mask) v0-3) - v0-3 - ) + ) + (when v1-1 + (let ((v0-3 (logclear (-> v1-1 0 mask) (process-mask menu)))) + (set! (-> v1-1 0 mask) v0-3) + v0-3 ) ) ) ) - (flag "Fill in" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *bigmap* fill-flag) (not (-> *bigmap* fill-flag))) - ) - (-> *bigmap* fill-flag) - ) + ) + (flag "Fill in" #f (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *bigmap* fill-flag) (not (-> *bigmap* fill-flag))) + ) + (-> *bigmap* fill-flag) + ) + ) + (function + "Save" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) ((method-of-object *bigmap* bigmap-method-16)) (none)) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Ocean" + (menu + "Ocean Height" + (flag "zero" 1 dm-ocean-height-func) + (flag "far-below" 2 dm-ocean-height-func) + (flag "sewer-start" 3 dm-ocean-height-func) + (flag "sewer-hi" 4 dm-ocean-height-func) + (flag "sewer-med" 5 dm-ocean-height-func) + (flag "sewer-lo" 6 dm-ocean-height-func) + ) + (menu + "Ocean Subdiv" + (flag "Textured" 0 dm-ocean-subdiv-draw-func) + (flag "Outline" 1 dm-ocean-subdiv-draw-func) + (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) + ) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Time of day" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "palette 0" 16 dm-time-of-day-func) + (flag "palette 1" 32 dm-time-of-day-func) + (flag "palette 2" 64 dm-time-of-day-func) + (flag "palette 3" 128 dm-time-of-day-func) + (flag "palette 4" 256 dm-time-of-day-func) + (flag "palette 5" 512 dm-time-of-day-func) + (flag "palette 6" 1024 dm-time-of-day-func) + (flag "palette 7" 2048 dm-time-of-day-func) + (flag "on" #f dm-time-of-day-pick-func) + (flag "Fast" *time-of-day-fast* dm-time-of-day-func2) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Mood" + (flag + "Overide Enable" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *time-of-day-context* overide-enable) (not (-> *time-of-day-context* overide-enable))) ) - (function - "Save" + (-> *time-of-day-context* overide-enable) + ) + ) + (menu + "Weather" + (flag + "Overide Weather Enable" #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) ((method-of-object *bigmap* bigmap-method-16)) (none)) + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* overide-weather-flag) (not (-> *mood-control* overide-weather-flag))) + ) + (-> *mood-control* overide-weather-flag) + ) + ) + (flag + "Display Values" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg)) + (if (= arg1 (debug-menu-msg press)) + (set! (-> *mood-control* display-flag) (not (-> *mood-control* display-flag))) + ) + (-> *mood-control* display-flag) + ) + ) + (float-var + "Clouds" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide cloud) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0.0 + ) + (else + (-> *mood-control* overide cloud) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 + ) + (float-var + "Fog" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *mood-control* (nonzero? *mood-control*)) + (set! (-> *mood-control* overide fog) arg2) + ) + ) + ((or (not *mood-control*) (zero? *mood-control*)) + 0.0 + ) + (else + (-> *mood-control* overide fog) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.0) + 0 ) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Ocean" - (menu - "Ocean Height" - (flag "zero" 1 dm-ocean-height-func) - (flag "far-below" 2 dm-ocean-height-func) - (flag "sewer-start" 3 dm-ocean-height-func) - (flag "sewer-hi" 4 dm-ocean-height-func) - (flag "sewer-med" 5 dm-ocean-height-func) - (flag "sewer-lo" 6 dm-ocean-height-func) - ) - (menu - "Ocean Subdiv" - (flag "Textured" 0 dm-ocean-subdiv-draw-func) - (flag "Outline" 1 dm-ocean-subdiv-draw-func) - (flag "Gouraud" 2 dm-ocean-subdiv-draw-func) - ) - ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Time of day" + (menu + "Colors" (flag "7am sunrise" 0 dm-time-of-day-func) (flag "10am morning" 1 dm-time-of-day-func) (flag "12pm noon" 2 dm-time-of-day-func) @@ -5444,1583 +4566,1470 @@ (flag "7pm twilight" 5 dm-time-of-day-func) (flag "11pm evening" 6 dm-time-of-day-func) (flag "4am green sun" 7 dm-time-of-day-func) - (flag "palette 0" 16 dm-time-of-day-func) - (flag "palette 1" 32 dm-time-of-day-func) - (flag "palette 2" 64 dm-time-of-day-func) - (flag "palette 3" 128 dm-time-of-day-func) - (flag "palette 4" 256 dm-time-of-day-func) - (flag "palette 5" 512 dm-time-of-day-func) - (flag "palette 6" 1024 dm-time-of-day-func) - (flag "palette 7" 2048 dm-time-of-day-func) - (flag "on" #f dm-time-of-day-pick-func) - (flag "Fast" *time-of-day-fast* dm-time-of-day-func2) - ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Mood" - (flag - "Overide Enable" + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Ambient Red" #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *time-of-day-context* overide-enable) (not (-> *time-of-day-context* overide-enable))) - ) - (-> *time-of-day-context* overide-enable) - ) - ) - (menu - "Weather" - (flag - "Overide Weather Enable" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *mood-control* overide-weather-flag) (not (-> *mood-control* overide-weather-flag))) - ) - (-> *mood-control* overide-weather-flag) - ) - ) - (flag - "Display Values" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg)) - (if (= arg1 (debug-menu-msg press)) - (set! (-> *mood-control* display-flag) (not (-> *mood-control* display-flag))) - ) - (-> *mood-control* display-flag) - ) - ) - (float-var - "Clouds" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *mood-control* (nonzero? *mood-control*)) - (set! (-> *mood-control* overide cloud) arg2) - ) - ) - ((or (not *mood-control*) (zero? *mood-control*)) - 0.0 - ) - (else - (-> *mood-control* overide cloud) - ) - ) - ) - 1 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.0) - 0 - ) - (float-var - "Fog" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *mood-control* (nonzero? *mood-control*)) - (set! (-> *mood-control* overide fog) arg2) - ) - ) - ((or (not *mood-control*) (zero? *mood-control*)) - 0.0 - ) - (else - (-> *mood-control* overide fog) - ) - ) - ) - 1 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.0) - 0 - ) - ) - (menu - "Colors" - (flag "7am sunrise" 0 dm-time-of-day-func) - (flag "10am morning" 1 dm-time-of-day-func) - (flag "12pm noon" 2 dm-time-of-day-func) - (flag "2pm afternoon" 3 dm-time-of-day-func) - (flag "6pm sunset" 4 dm-time-of-day-func) - (flag "7pm twilight" 5 dm-time-of-day-func) - (flag "11pm evening" 6 dm-time-of-day-func) - (flag "4am green sun" 7 dm-time-of-day-func) - (flag "time of day on" #f dm-time-of-day-pick-func) - (float-var - "Ambient Red" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - x - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - x - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Ambient Green" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - y - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - y - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Ambient Blue" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - z - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - z - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Ambient Mult" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - w - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - w - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 2 - 0 - ) - (float-var - "Light Red" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - x - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - x - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Light Green" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - y - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - y - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Light Blue" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - z - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - z - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Light Mult" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - w - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) - 0.0 - ) - (else - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - w - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 2 - 0 - ) - (function - "reset selected time" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (mem-copy! - (the-as - pointer - (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - ) - ) - (the-as - pointer - (-> *mood-control* - mood-color-table - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - ) - ) - 32 - ) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - lgt-color - w - ) - 1.0 - ) - (set! (-> *overide-mood-color-table* - data - (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) - amb-color - w - ) - 1.0 - ) - ) - ) - (function - "reset all times" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (mem-copy! - (the-as pointer *overide-mood-color-table*) - (the-as pointer (-> *mood-control* mood-color-table)) - 256 - ) - (dotimes (v1-1 8) - (set! (-> *overide-mood-color-table* data v1-1 lgt-color w) 1.0) - (set! (-> *overide-mood-color-table* data v1-1 amb-color w) 1.0) - ) - (the-as float #f) - ) - ) - ) - (menu - "Fog" - (flag "7am sunrise" 0 dm-time-of-day-func) - (flag "10am morning" 1 dm-time-of-day-func) - (flag "12pm noon" 2 dm-time-of-day-func) - (flag "2pm afternoon" 3 dm-time-of-day-func) - (flag "6pm sunset" 4 dm-time-of-day-func) - (flag "7pm twilight" 5 dm-time-of-day-func) - (flag "11pm evening" 6 dm-time-of-day-func) - (flag "4am green sun" 7 dm-time-of-day-func) - (flag "time of day on" #f dm-time-of-day-pick-func) - (float-var - "Red" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - x - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - x - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 1.0) - #t - 0 - 255 - 0 - ) - (float-var - "Green" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - y - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - y - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 1.0) - #t - 0 - 255 - 0 - ) - (float-var - "Blue" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - z - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - z - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 1.0) - #t - 0 - 255 - 0 - ) - (float-var - "Mult" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - w - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - w - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 1 - 0 - ) - (float-var - "Start" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - x - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - x - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 1.0) - #t - -1000 - 10000 - 0 - ) - (float-var - "End" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - y - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - y - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 1.0) - #t - 0 - 10000 - 0 - ) - (float-var - "Max" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - w - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - w - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.5) - #t - 0 - 255 - 0 - ) - (float-var - "Min" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - z - ) - arg2 - ) - ) - ) - ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) - 0.0 - ) - (else - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - z - ) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.5) - #t - 0 - 255 - 0 - ) - (function - "reset selected time" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (mem-copy! - (the-as - pointer - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - ) - ) - (the-as - pointer - (-> *mood-control* - mood-fog-table - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - ) - ) - 48 - ) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-color - w - ) - 1.0 - ) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - x - ) - (* 0.00024414062 - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - x - ) - ) - ) - (set! (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - y - ) - (* 0.00024414062 - (-> *overide-mood-fog-table* - data - (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) - fog-dists - y - ) - ) - ) - ) - ) - (function - "reset all times" - #f - (lambda () - (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer (-> *mood-control* mood-fog-table)) 384) - (dotimes (v1-1 8) - (set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0) - (set! (-> *overide-mood-fog-table* data v1-1 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x)) - ) - (set! (-> *overide-mood-fog-table* data v1-1 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y)) - ) - ) - #f - ) - ) - ) - (menu - "Palette" - (flag "palette 0" 0 dm-time-of-day-palette-func) - (flag "palette 1" 1 dm-time-of-day-palette-func) - (flag "palette 2" 2 dm-time-of-day-palette-func) - (flag "palette 3" 3 dm-time-of-day-palette-func) - (flag "palette 4" 4 dm-time-of-day-palette-func) - (flag "palette 5" 5 dm-time-of-day-palette-func) - (flag "palette 6" 6 dm-time-of-day-palette-func) - (flag "palette 7" 7 dm-time-of-day-palette-func) - (flag "time of day on" #f dm-time-of-day-pick-func) - (float-var - "Red" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Green" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Blue" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Mult" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 2 - 0 - ) - (function - "reset selected time" - #f - (lambda () (let ((v0-0 (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette)))) - (set! (-> v0-0 x) 1.0) - (set! (-> v0-0 y) 1.0) - (set! (-> v0-0 z) 1.0) - (set! (-> v0-0 w) 1.0) - v0-0 + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x + ) + arg2 ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + x ) + ) + ) ) - (function "reset all times" #f (lambda () - (dotimes (v1-0 8) - (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) - ) - #f - ) - ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 ) - (menu - "Filter" - (float-var - "Red" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* filter-color x) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* filter-color x) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Green" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* filter-color y) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* filter-color y) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Blue" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* filter-color z) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* filter-color z) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - (new 'static 'bfloat :data 1.9921875) - 0 - ) - (float-var - "Mult" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* filter-color w) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* filter-color w) - ) - ) - ) - 2 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 2 - 0 - ) - (function "reset filter" #f (lambda () (let ((v0-0 (-> *time-of-day-context* filter-color))) - (set! (-> v0-0 x) 1.0) - (set! (-> v0-0 y) 1.0) - (set! (-> v0-0 z) 1.0) - (set! (-> v0-0 w) 1.0) - (the-as symbol v0-0) - ) - ) - ) - ) - (menu - "Sky" - (float-var - "Cloud Min" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* current-clouds cloud-min) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* current-clouds cloud-min) - ) - ) - ) - 1 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 1 - 0 - ) - (float-var - "Cloud Max" - #f - (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) - (cond - ((= arg1 (debug-menu-msg press)) - (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) - (set! (-> *time-of-day-context* current-clouds cloud-max) arg2) - ) - ) - ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) - 0.0 - ) - (else - (-> *time-of-day-context* current-clouds cloud-max) - ) - ) - ) - 1 - (new 'static 'bfloat :data 0.00390625) - #t - 0 - 1 - 0 - ) - (function - "reset sky" - #f - (lambda () - (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) - (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) - ) - ) - ) - (function "Print mood tables" #f (lambda () (print-mood-tables) (none))) - (function - "reset everything" + (float-var + "Ambient Green" #f - (lambda () + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Ambient Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (float-var + "Light Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Light Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-color-table* (nonzero? *overide-mood-color-table*)) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-color-table*) (zero? *overide-mood-color-table*)) + 0.0 + ) + (else + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (function + "reset selected time" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as + pointer + (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + (the-as + pointer + (-> *mood-control* + mood-color-table + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + ) + ) + 32 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + lgt-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-color-table* + data + (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)) + amb-color + w + ) + 1.0 + ) + ) + ) + (function + "reset all times" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) (mem-copy! (the-as pointer *overide-mood-color-table*) (the-as pointer (-> *mood-control* mood-color-table)) 256 ) - (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer (-> *mood-control* mood-fog-table)) 384) - (dotimes (v1-2 8) - (set! (-> *overide-mood-color-table* data v1-2 lgt-color w) 1.0) - (set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0) - (set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0) - (set! (-> *overide-mood-fog-table* data v1-2 fog-dists x) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x)) - ) - (set! (-> *overide-mood-fog-table* data v1-2 fog-dists y) - (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y)) - ) - (set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0) + (dotimes (v1-1 8) + (set! (-> *overide-mood-color-table* data v1-1 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-1 amb-color w) 1.0) ) - (set-vector! (-> *time-of-day-context* filter-color) 1.0 1.0 1.0 1.0) + (the-as float #f) + ) + ) + ) + (menu + "Fog" + (flag "7am sunrise" 0 dm-time-of-day-func) + (flag "10am morning" 1 dm-time-of-day-func) + (flag "12pm noon" 2 dm-time-of-day-func) + (flag "2pm afternoon" 3 dm-time-of-day-func) + (flag "6pm sunset" 4 dm-time-of-day-func) + (flag "7pm twilight" 5 dm-time-of-day-func) + (flag "11pm evening" 6 dm-time-of-day-func) + (flag "4am green sun" 7 dm-time-of-day-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 255 + 0 + ) + (float-var + "Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Start" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + -1000 + 10000 + 0 + ) + (float-var + "End" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 1.0) + #t + 0 + 10000 + 0 + ) + (float-var + "Max" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + w + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (float-var + "Min" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *overide-mood-fog-table* (nonzero? *overide-mood-fog-table*)) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + arg2 + ) + ) + ) + ((or (not *overide-mood-fog-table*) (zero? *overide-mood-fog-table*)) + 0.0 + ) + (else + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + z + ) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.5) + #t + 0 + 255 + 0 + ) + (function + "reset selected time" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (mem-copy! + (the-as + pointer + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + (the-as + pointer + (-> *mood-control* + mood-fog-table + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + ) + ) + 48 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-color + w + ) + 1.0 + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + x + ) + ) + ) + (set! (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + (* 0.00024414062 + (-> *overide-mood-fog-table* + data + (the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2))) + fog-dists + y + ) + ) + ) + ) + ) + (function + "reset all times" + #f + (lambda () + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer (-> *mood-control* mood-fog-table)) 384) + (dotimes (v1-1 8) + (set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-1 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-1 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y)) + ) + ) + #f + ) + ) + ) + (menu + "Palette" + (flag "palette 0" 0 dm-time-of-day-palette-func) + (flag "palette 1" 1 dm-time-of-day-palette-func) + (flag "palette 2" 2 dm-time-of-day-palette-func) + (flag "palette 3" 3 dm-time-of-day-palette-func) + (flag "palette 4" 4 dm-time-of-day-palette-func) + (flag "palette 5" 5 dm-time-of-day-palette-func) + (flag "palette 6" 6 dm-time-of-day-palette-func) + (flag "palette 7" 7 dm-time-of-day-palette-func) + (flag "time of day on" #f dm-time-of-day-pick-func) + (float-var + "Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette) w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (function + "reset selected time" + #f + (lambda () (let ((v0-0 (-> *time-of-day-context* times (-> *time-of-day-context* overide-palette)))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + v0-0 + ) + ) + ) + (function "reset all times" #f (lambda () + (dotimes (v1-0 8) + (set-vector! (-> *time-of-day-context* times v1-0) 1.0 1.0 1.0 1.0) + ) + #f + ) + ) + ) + (menu + "Filter" + (float-var + "Red" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color x) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color x) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Green" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color y) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color y) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Blue" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color z) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color z) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + (new 'static 'bfloat :data 1.9921875) + 0 + ) + (float-var + "Mult" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* filter-color w) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* filter-color w) + ) + ) + ) + 2 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 2 + 0 + ) + (function "reset filter" #f (lambda () (let ((v0-0 (-> *time-of-day-context* filter-color))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 1.0) + (set! (-> v0-0 w) 1.0) + (the-as symbol v0-0) + ) + ) + ) + ) + (menu + "Sky" + (float-var + "Cloud Min" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-min) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-min) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (float-var + "Cloud Max" + #f + (lambda ((arg0 object) (arg1 debug-menu-msg) (arg2 float)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (and *time-of-day-context* (nonzero? *time-of-day-context*)) + (set! (-> *time-of-day-context* current-clouds cloud-max) arg2) + ) + ) + ((or (not *time-of-day-context*) (zero? *time-of-day-context*)) + 0.0 + ) + (else + (-> *time-of-day-context* current-clouds cloud-max) + ) + ) + ) + 1 + (new 'static 'bfloat :data 0.00390625) + #t + 0 + 1 + 0 + ) + (function + "reset sky" + #f + (lambda () (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) ) ) ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Sound" - (flag "Effect Debug" *debug-effect-control* dm-boolean-toggle-pick-func) - (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) - (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) - (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) - (function "Reload Banks" #f sound-bank-reload) - (function "List Sounds" #f (lambda () (list-sounds) (none))) - (function "IOP Info" #f (lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) - ) - ) - ) - (debug-menu-append-item s5-0 (debug-menu-make-shader-menu arg0)) - (debug-menu-append-item s5-0 (debug-menu-make-instance-menu arg0)) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Bug Report" - (flag "display" *display-bug-report* dm-boolean-toggle-pick-func) - (flag "screen" *stdcon* dm-bug-report-output-pick-func) - (flag "listener" listener dm-bug-report-output-pick-func) - (flag "file" file-stream dm-bug-report-output-pick-func) - (function "visgood" "visgood" dm-bug-report-report-pick-func) - (function "visbad" "visbad" dm-bug-report-report-pick-func) - (function "collision" "collision" dm-bug-report-report-pick-func) - ) - ) - ) - (debug-menu-append-item - s5-0 - (debug-menu-make-from-template - arg0 - '(menu - "Scene" - (menu - "Scene Info" - (flag "channel" 1 display-scene-control-toggle-pick-func) - (flag "anim name" 2 display-scene-control-toggle-pick-func) - (flag "dma size" 4 display-scene-control-toggle-pick-func) - (flag "bounds spheres" 8 display-scene-control-toggle-pick-func) - (flag "actors" 16 display-scene-control-toggle-pick-func) - (flag "actor-marks" 32 display-scene-control-toggle-pick-func) - (flag "special fma spheres" 64 display-scene-control-toggle-pick-func) - (flag "all on" 95 display-scene-control-set-pick-func) - (flag "all off" 0 display-scene-control-set-pick-func) - ) - (menu - "city" - (function "city-help-kid-intro" ("ctyslumb-fort" "city-help-kid-intro") dm-scene-load-pick-func) - (function "city-help-kid-resolution" ("ctyslumb-fort" "city-help-kid-resolution") dm-scene-load-pick-func) - (function - "city-intercept-tanker-intro" - ("ctymarkb-tanker" "city-intercept-tanker-intro") - dm-scene-load-pick-func + (function "Print mood tables" #f (lambda () (print-mood-tables) (none))) + (function + "reset everything" + #f + (lambda () + (mem-copy! + (the-as pointer *overide-mood-color-table*) + (the-as pointer (-> *mood-control* mood-color-table)) + 256 ) - (function "city-intercept-tanker-res" ("ctymarkb-tanker" "city-intercept-tanker-res") dm-scene-load-pick-func) - (function "city-get-yellow-gun" ("gungame-movie" "city-get-yellow-gun") dm-scene-load-pick-func) - (function "city-get-hoverboard" ("ctyfarma-airlock-movie" "city-get-hoverboard") dm-scene-load-pick-func) - (function "city-get-dark-gun" ("gungame-movie" "city-get-dark-gun") dm-scene-load-pick-func) - (function "city-meet-brutter-res" ("kiosk-start" "city-meet-brutter-res") dm-scene-load-pick-func) - (function "city-save-lurkers-intro" ("kiosk-start" "city-save-lurkers-intro") dm-scene-load-pick-func) - (function - "city-errol-challenge-res" - ("garage-start-class3" "city-errol-challenge-res") - dm-scene-load-pick-func + (mem-copy! (the-as pointer *overide-mood-fog-table*) (the-as pointer (-> *mood-control* mood-fog-table)) 384) + (dotimes (v1-2 8) + (set! (-> *overide-mood-color-table* data v1-2 lgt-color w) 1.0) + (set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0) + (set! (-> *overide-mood-fog-table* data v1-2 fog-dists x) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x)) + ) + (set! (-> *overide-mood-fog-table* data v1-2 fog-dists y) + (* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y)) + ) + (set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0) ) - (function "city-air-train-in-caspad" ("ctyport-air-train" "city-air-train-in-caspad") dm-scene-load-pick-func) - (function "city-air-train-in-nest" ("ctyport-air-train" "city-air-train-in-nest") dm-scene-load-pick-func) - (function "city-air-train-out" ("ctyport-air-train" "city-air-train-out") dm-scene-load-pick-func) - (function - "city-ashelin-drop-off" - ("ctyport-air-train-ashelin" "city-ashelin-drop-off") - dm-scene-load-pick-func - ) - (function - "city-protect-slums-intro" - ("ctyslumc-seal-movie" "city-protect-slums-intro") - dm-scene-load-pick-func - ) - ) - (menu - "atoll" - (function "atoll-1-res" ("atoll-movie" "atoll-1-res") dm-scene-load-pick-func) - (function "atoll-save-ashelin-res-a" ("atoll-movie" "atoll-save-ashelin-res-a") dm-scene-load-pick-func) - (function "atoll-save-ashelin-res-b" ("atoll-movie" "atoll-save-ashelin-res-b") dm-scene-load-pick-func) - (function "atoll-sig-intro" ("atoll-movie" "atoll-sig-intro") dm-scene-load-pick-func) - (function "atoll-sig-tank" ("atoll-movie" "atoll-sig-tank") dm-scene-load-pick-func) - (function "atoll-sniper-a" ("atoll-movie" "atoll-sniper-a") dm-scene-load-pick-func) - (function "atoll-sniper-b" ("atoll-movie" "atoll-sniper-b") dm-scene-load-pick-func) - (function "atoll-sniper-c" ("atoll-movie" "atoll-sniper-c") dm-scene-load-pick-func) - (function "atoll-sniper-d" ("atoll-movie" "atoll-sniper-d") dm-scene-load-pick-func) - (function "atoll-sniper-e" ("atoll-movie" "atoll-sniper-e") dm-scene-load-pick-func) - ) - (menu - "canyon" - (function "canyon-insert-items-intro" ("mountain-movie" "canyon-insert-items-intro") dm-scene-load-pick-func) - (function "canyon-insert-items-res" ("mincan-city" "canyon-insert-items-res") dm-scene-load-pick-func) - ) - (menu - "caspad" - (function "caspad-air-train-in" ("caspad-warp" "caspad-air-train-in") dm-scene-load-pick-func) - (function "caspad-air-train-out" ("caspad-warp" "caspad-air-train-out") dm-scene-load-pick-func) - ) - (menu - "castle" - (function - "castle-krew-boss-fight-intro" - ("casboss-start" "castle-krew-boss-fight-intro") - dm-scene-load-pick-func - ) - (function "castle-krew-boss-fight-res" ("casboss-start" "castle-krew-boss-fight-res") dm-scene-load-pick-func) - ) - (menu - "consite" - (function "consite-find-baron-res" ("consite-start" "consite-find-baron-res") dm-scene-load-pick-func) - ) - (menu - "dig" - (function "dig-find-totem-res" ("dig-totem" "dig-find-totem-res") dm-scene-load-pick-func) - (function "dig-digger-explode" ("dig1-start" "dig-digger-explode") dm-scene-load-pick-func) - ) - (menu - "drill" - (function "drill-top-explode" ("drillmid-checkpoint" "drill-top-explode") dm-scene-load-pick-func) - ) - (menu - "forest" - (function - "forest-protect-samos-intro-b" - ("forest-tree" "forest-protect-samos-intro-b") - dm-scene-load-pick-func - ) - (function "forest-protect-samos-res" ("forest-tree" "forest-protect-samos-res") dm-scene-load-pick-func) - ) - (menu - "fortress" - (function - "fortress-blow-up-ammo-res-a" - ("fordumpc-start" "fortress-blow-up-ammo-res-a") - dm-scene-load-pick-func - ) - (function - "fortress-blow-up-ammo-res-b" - ("fordumpc-explode-movie" "fortress-blow-up-ammo-res-b") - dm-scene-load-pick-func - ) - (function "fortress-save-friends-res" ("prison-start" "fortress-save-friends-res") dm-scene-load-pick-func) - (function - "test-fortress-blow-up-ammo-res-b-a" - ("fordumpc-explode-movie" "test-fortress-blow-up-ammo-res-b-a") - dm-scene-load-pick-func - ) - (function "test-fortress-blast" ("fordumpc-explode-movie" "test-fortress-blast") dm-scene-load-pick-func) - ) - (menu - "hideout" - (function "city-krew-delivery-intro" ("hideout-start" "city-krew-delivery-intro") dm-scene-load-pick-func) - (function - "city-destroy-guard-vehicles-intro" - ("hideout-start" "city-destroy-guard-vehicles-intro") - dm-scene-load-pick-func - ) - (function "ruins-sacred-intro" ("hideout-start" "ruins-sacred-intro") dm-scene-load-pick-func) - (function "ruins-tower-intro" ("ctysluma-tower-intro" "ruins-tower-intro") dm-scene-load-pick-func) - (function "vin-rescue-intro" ("hideout-start" "vin-rescue-intro") dm-scene-load-pick-func) - (function "fortress-2-intro" ("hideout-start" "fortress-2-intro") dm-scene-load-pick-func) - (function "atoll-1-int" ("hideout-start" "atoll-1-int") dm-scene-load-pick-func) - (function "atoll-3-intro" ("hideout-start" "atoll-3-intro") dm-scene-load-pick-func) - (function - "city-shuttle-underground-intro" - ("hideout-start" "city-shuttle-underground-intro") - dm-scene-load-pick-func - ) - (function "city-escort-kid-intro" ("escort-kid-intro" "city-escort-kid-intro") dm-scene-load-pick-func) - (function "city-stop-bomb-bots-intro" ("hideout-start" "city-stop-bomb-bots-intro") dm-scene-load-pick-func) - (function - "forest-catch-metal-heads-intro" - ("hideout-start" "forest-catch-metal-heads-intro") - dm-scene-load-pick-func - ) - (function - "fortress-save-friends-intro-a" - ("hideout-start" "fortress-save-friends-intro-a") - dm-scene-load-pick-func - ) - ) - (menu - "hiphog" - (function "atoll-2-intro" ("hiphog-start" "atoll-2-intro") dm-scene-load-pick-func) - (function "sewer-1-intro" ("hiphog-start" "sewer-1-intro") dm-scene-load-pick-func) - (function "sewer-1-res" ("hiphog-start" "sewer-1-res") dm-scene-load-pick-func) - (function "sewer-2-intro" ("hiphog-start" "sewer-2-intro") dm-scene-load-pick-func) - (function "krew-delivery-res" ("hiphog-start" "krew-delivery-res") dm-scene-load-pick-func) - (function "city-meet-brutter-intro" ("hiphog-start" "city-meet-brutter-intro") dm-scene-load-pick-func) - (function "city-keira-delivery-intro" ("hiphog-start" "city-keira-delivery-intro") dm-scene-load-pick-func) - (function "city-krew-collection-intro" ("hiphog-start" "city-krew-collection-intro") dm-scene-load-pick-func) - (function "city-krew-collection-res" ("hiphog-start" "city-krew-collection-res") dm-scene-load-pick-func) - (function - "forest-hunt-camo-metal-heads-intro" - ("hiphog-start" "forest-hunt-camo-metal-heads-intro") - dm-scene-load-pick-func - ) - (function "sewer-blow-up-statue-intro" ("hiphog-start" "sewer-blow-up-statue-intro") dm-scene-load-pick-func) - (function "city-errol-challenge-intro" ("hiphog-start" "city-errol-challenge-intro") dm-scene-load-pick-func) - (function "city-whack-a-metal-intro" ("hiphog-start" "city-whack-a-metal-intro") dm-scene-load-pick-func) - (function "city-whack-a-metal-res" ("hiphog-start" "city-whack-a-metal-res") dm-scene-load-pick-func) - ) - (menu - "intro/outro" - (function - "intro" - ("village1-start" ("intro-samos-hut" "intro-vortex" "intro-city-square" "intro-prison")) - dm-scene-load-pick-func - ) - (function "intro-samos-hut" ("village1-start" "intro-samos-hut") dm-scene-load-pick-func) - (function "intro-vortex" ("village1-start" "intro-vortex") dm-scene-load-pick-func) - (function "intro-city-square" ("ctyindb-intro-start" "intro-city-square") dm-scene-load-pick-func) - (function "intro-prison" ("prison-intro-start" "intro-prison") dm-scene-load-pick-func) - (function - "outro" - ("nestb-outro" ("outro-nest" "outro-palace" "outro-hiphog" "outro-port")) - dm-scene-load-pick-func - ) - (function "outro-nest" ("nestb-outro" "outro-nest") dm-scene-load-pick-func) - (function "outro-palace" ("throne-outro" "outro-palace") dm-scene-load-pick-func) - (function "outro-hiphog" ("hiphog-outro" "outro-hiphog") dm-scene-load-pick-func) - (function "outro-port" ("ctyport-outro" "outro-port") dm-scene-load-pick-func) - ) - (menu - "mountain" - (function "mtn-step-plat-rocks-a" ("mountain-start" "mtn-step-plat-rocks-a") dm-scene-load-pick-func) - (function "mtn-step-plat-rocks-b" ("mountain-start" "mtn-step-plat-rocks-b") dm-scene-load-pick-func) - (function "mtn-step-plat-rocks-c" ("mountain-start" "mtn-step-plat-rocks-c") dm-scene-load-pick-func) - (function "mtn-plat-buried-rocks-a" ("mountain-start" "mtn-plat-buried-rocks-a") dm-scene-load-pick-func) - (function "mountain-lens-res" ("mountain-start" "mountain-lens-res") dm-scene-load-pick-func) - (function "mountain-shard-res" ("mountain-start" "mountain-shard-res") dm-scene-load-pick-func) - (function "mountain-gear-res" ("mountain-start" "mountain-gear-res") dm-scene-load-pick-func) - ) - (menu - "nest" - (function "nest-break-barrier-res" ("nest-gun" "nest-break-barrier-res") dm-scene-load-pick-func) - (function "nest-air-train-in" ("nest-warp" "nest-air-train-in") dm-scene-load-pick-func) - (function "nest-air-train-out" ("nest-warp" "nest-air-train-out") dm-scene-load-pick-func) - (function "nest-kor-boss-fight-intro-b" ("nestb-boss" "nest-kor-boss-fight-intro-b") dm-scene-load-pick-func) - (function "nest-kor-boss-fight-mid" ("nestb-boss" "nest-kor-boss-fight-mid") dm-scene-load-pick-func) - ) - (menu - "onintent" - (function "mountain-finditems-intro" ("onintent-start" "mountain-finditems-intro") dm-scene-load-pick-func) - (function "dig-find-totem-intro" ("onintent-start" "dig-find-totem-intro") dm-scene-load-pick-func) - (function - "forest-protect-samos-intro-a" - ("onintent-start" "forest-protect-samos-intro-a") - dm-scene-load-pick-func - ) - (function "city-play-onin-game-intro" ("onintent-start" "city-play-onin-game-intro") dm-scene-load-pick-func) - (function "city-play-onin-game-res" ("onintent-start" "city-play-onin-game-res") dm-scene-load-pick-func) - (function - "test-mountain-finditems-intro" - ("onintent-start" "test-mountain-finditems-intro") - dm-scene-load-pick-func - ) - ) - (menu - "oracle" - (function "city-oracle-intro" ("oracle-start" "city-oracle-intro") dm-scene-load-pick-func) - (function "city-oracle-level-0" ("oracle-start" "city-oracle-level-0") dm-scene-load-pick-func) - (function "city-oracle-level-1" ("oracle-start" "city-oracle-level-1") dm-scene-load-pick-func) - (function "city-oracle-level-2" ("oracle-start" "city-oracle-level-2") dm-scene-load-pick-func) - (function "city-oracle-level-3" ("oracle-start" "city-oracle-level-3") dm-scene-load-pick-func) - ) - (menu - "palace" - (function "palace-outside-window-res" ("palroof-throne" "palace-outside-window-res") dm-scene-load-pick-func) - (function - "palace-outside-window-res-b" - ("palroof-boss" "palace-outside-window-res-b") - dm-scene-load-pick-func - ) - (function "palace-boss-res" ("palroof-boss" "palace-boss-res") dm-scene-load-pick-func) - (function "palace-sneak-in-res" ("palroof-throne" "palace-sneak-in-res") dm-scene-load-pick-func) - ) - (menu - "ruins" - (function "ruins-tower-victory" ("ruins-hut" "ruins-tower-victory") dm-scene-load-pick-func) - (function "ruins-sacred-victory" ("ruins-hut" "ruins-sacred-victory") dm-scene-load-pick-func) - (function "ruins-get-to-hut-res" ("ruins-hut" "ruins-get-to-hut-res") dm-scene-load-pick-func) - (function "test-scene" ("ruins-hut" "test-scene") dm-scene-load-pick-func) - ) - (menu - "sewer" - (function "sewer-drain-res" ("sewer-start" "sewer-drain-res") dm-scene-load-pick-func) - (function "sewer-blow-up-statue-res" ("sewesc-start" "sewer-blow-up-statue-res") dm-scene-load-pick-func) - (function "sewer-hosehead" ("sewesc-start" "sewer-hosehead") dm-scene-load-pick-func) - ) - (menu - "stadium" - (function - "city-keira-hover-challenge-intro" - ("garage-start-skate" "city-keira-hover-challenge-intro") - dm-scene-load-pick-func - ) - (function - "city-keira-hover-challenge-res" - ("garage-start-skate" "city-keira-hover-challenge-res") - dm-scene-load-pick-func - ) - (function - "city-class-1-race-intro-a" - ("garage-class3-movie" "city-class-1-race-intro-a") - dm-scene-load-pick-func - ) - (function "city-class-1-race-intro-b" ("stadiumd-start" "city-class-1-race-intro-b") dm-scene-load-pick-func) - (function "city-class-1-race-res" ("stadiumd-start" "city-class-1-race-res") dm-scene-load-pick-func) - (function "city-class-3-race-intro" ("garage-class3-movie" "city-class-3-race-intro") dm-scene-load-pick-func) - (function "city-class-3-race-res" ("garage-class3-movie" "city-class-3-race-res") dm-scene-load-pick-func) - (function "city-put-hoverboard" ("skatea-start" "city-put-hoverboard") dm-scene-load-pick-func) - (function "city-class-2-race-intro" ("garage-class3-movie" "city-class-2-race-intro") dm-scene-load-pick-func) - (function "city-class-2-race-res" ("garage-class3-movie" "city-class-2-race-res") dm-scene-load-pick-func) - (function "city-defend-stadium-intro" ("stadium-blimp" "city-defend-stadium-intro") dm-scene-load-pick-func) - (function "city-defend-stadium-res" ("stadium-blimp" "city-defend-stadium-res") dm-scene-load-pick-func) - ) - (menu - "strip" - (function "crane-victory" ("strip-start" "crane-victory") dm-scene-load-pick-func) - (function "ecowells-victory" ("strip-start" "ecowells-victory") dm-scene-load-pick-func) - (function "vin-rescue" ("strip-start" "vin-rescue") dm-scene-load-pick-func) - (function "test-crane-victory" ("strip-start" "test-crane-victory") dm-scene-load-pick-func) - ) - (menu - "tomb" - (function "tomb-face-tests-intro" ("tombd-start" "tomb-face-tests-intro") dm-scene-load-pick-func) - (function "tomb-boulder-start" ("tomb-boulder" "tomb-boulder-start") dm-scene-load-pick-func) - (function "tomb-spider-scare" ("tomb-boulder-explode" "tomb-spider-scare") dm-scene-load-pick-func) - (function "tomb-unlock-start" ("tomb-water-switch" "tomb-unlock-start") dm-scene-load-pick-func) - (function "tomb-unlock-water" ("tomb-water-switch" "tomb-unlock-water") dm-scene-load-pick-func) - (function "tomb-unlock-poles" ("tomb-poles-switch" "tomb-unlock-poles") dm-scene-load-pick-func) - (function "tomb-boss-open" ("tombboss-start" "tomb-boss-open") dm-scene-load-pick-func) - (function "tomb-boss-intro" ("tombboss-start" "tomb-boss-intro") dm-scene-load-pick-func) - (function "tomb-boss-res" ("tombboss-start" "tomb-boss-res") dm-scene-load-pick-func) - ) - (menu - "under" - (function "under-find-sig-res" ("under-start" "under-find-sig-res") dm-scene-load-pick-func) - (function "under-centipede-one" ("under-start" "under-centipede-one") dm-scene-load-pick-func) - (function "under-centipede-two" ("under-start" "under-centipede-two") dm-scene-load-pick-func) - (function "under-centipede-three" ("under-start" "under-centipede-three") dm-scene-load-pick-func) - (function "under-get-sig-out-res" ("under-start" "under-get-sig-out-res") dm-scene-load-pick-func) - ) - (menu - "vinroom" - (function "crane-intro" ("vinroom-start" "crane-intro") dm-scene-load-pick-func) - (function - "drill-kill-metal-heads-intro" - ("vinroom-start" "drill-kill-metal-heads-intro") - dm-scene-load-pick-func - ) - (function "ecowells-intro" ("vinroom-start" "ecowells-intro") dm-scene-load-pick-func) - (function "city-switch-on-power-intro" ("vinroom-start" "city-switch-on-power-intro") dm-scene-load-pick-func) - (function - "dig-knock-down-scaffolding-intro" - ("vinroom-start" "dig-knock-down-scaffolding-intro") - dm-scene-load-pick-func - ) - (function "drill-destroy-ship-intro" ("vinroom-start" "drill-destroy-ship-intro") dm-scene-load-pick-func) - (function - "drill-destroy-control-tower-intro" - ("vinroom-start" "drill-destroy-control-tower-intro") - dm-scene-load-pick-func - ) - ) - (menu "demo" (function "demo-disk-intro" ("demo-movie" "demo-disk-intro") dm-scene-load-pick-func)) - (menu - "cover-test" - (function "cover-test-1" ("chartest-1" "cover-test-1") dm-scene-load-pick-func) - (function "cover-test-2" ("chartest-1" "cover-test-2") dm-scene-load-pick-func) + (set-vector! (-> *time-of-day-context* filter-color) 1.0 1.0 1.0 1.0) + (set! (-> *time-of-day-context* current-clouds cloud-min) (-> *mood-control* mood-clouds cloud-min)) + (set! (-> *time-of-day-context* current-clouds cloud-max) (-> *mood-control* mood-clouds cloud-max)) ) ) - ) + ) ) - (debug-menu-append-item s5-0 (debug-menu-make-task-menu arg0)) - (debug-menu-append-item s5-0 (the-as debug-menu-node (debug-menu-make-play-menu (the-as symbol arg0)))) ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Sound" + (flag "Effect Debug" *debug-effect-control* dm-boolean-toggle-pick-func) + (flag "Regions" *execute-regions* dm-boolean-toggle-pick-func) + (flag "Region Marks" *display-region-marks* dm-boolean-toggle-pick-func) + (flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func) + (function "Reload Banks" #f sound-bank-reload) + (function "List Sounds" #f (lambda () (list-sounds) (none))) + (function "IOP Info" #f (lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none))) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-shader-menu arg0)) + (debug-menu-append-item s5-0 (debug-menu-make-instance-menu arg0)) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Bug Report" + (flag "display" *display-bug-report* dm-boolean-toggle-pick-func) + (flag "screen" *stdcon* dm-bug-report-output-pick-func) + (flag "listener" listener dm-bug-report-output-pick-func) + (flag "file" file-stream dm-bug-report-output-pick-func) + (function "visgood" "visgood" dm-bug-report-report-pick-func) + (function "visbad" "visbad" dm-bug-report-report-pick-func) + (function "collision" "collision" dm-bug-report-report-pick-func) + ) + ) + ) + (debug-menu-append-item + s5-0 + (debug-menu-make-from-template + arg0 + '(menu + "Scene" + (menu + "Scene Info" + (flag "channel" 1 display-scene-control-toggle-pick-func) + (flag "anim name" 2 display-scene-control-toggle-pick-func) + (flag "dma size" 4 display-scene-control-toggle-pick-func) + (flag "bounds spheres" 8 display-scene-control-toggle-pick-func) + (flag "actors" 16 display-scene-control-toggle-pick-func) + (flag "actor-marks" 32 display-scene-control-toggle-pick-func) + (flag "special fma spheres" 64 display-scene-control-toggle-pick-func) + (flag "all on" 95 display-scene-control-set-pick-func) + (flag "all off" 0 display-scene-control-set-pick-func) + ) + (menu + "city" + (function "city-help-kid-intro" ("ctyslumb-fort" "city-help-kid-intro") dm-scene-load-pick-func) + (function "city-help-kid-resolution" ("ctyslumb-fort" "city-help-kid-resolution") dm-scene-load-pick-func) + (function + "city-intercept-tanker-intro" + ("ctymarkb-tanker" "city-intercept-tanker-intro") + dm-scene-load-pick-func + ) + (function "city-intercept-tanker-res" ("ctymarkb-tanker" "city-intercept-tanker-res") dm-scene-load-pick-func) + (function "city-get-yellow-gun" ("gungame-movie" "city-get-yellow-gun") dm-scene-load-pick-func) + (function "city-get-hoverboard" ("ctyfarma-airlock-movie" "city-get-hoverboard") dm-scene-load-pick-func) + (function "city-get-dark-gun" ("gungame-movie" "city-get-dark-gun") dm-scene-load-pick-func) + (function "city-meet-brutter-res" ("kiosk-start" "city-meet-brutter-res") dm-scene-load-pick-func) + (function "city-save-lurkers-intro" ("kiosk-start" "city-save-lurkers-intro") dm-scene-load-pick-func) + (function + "city-errol-challenge-res" + ("garage-start-class3" "city-errol-challenge-res") + dm-scene-load-pick-func + ) + (function "city-air-train-in-caspad" ("ctyport-air-train" "city-air-train-in-caspad") dm-scene-load-pick-func) + (function "city-air-train-in-nest" ("ctyport-air-train" "city-air-train-in-nest") dm-scene-load-pick-func) + (function "city-air-train-out" ("ctyport-air-train" "city-air-train-out") dm-scene-load-pick-func) + (function + "city-ashelin-drop-off" + ("ctyport-air-train-ashelin" "city-ashelin-drop-off") + dm-scene-load-pick-func + ) + (function + "city-protect-slums-intro" + ("ctyslumc-seal-movie" "city-protect-slums-intro") + dm-scene-load-pick-func + ) + ) + (menu + "atoll" + (function "atoll-1-res" ("atoll-movie" "atoll-1-res") dm-scene-load-pick-func) + (function "atoll-save-ashelin-res-a" ("atoll-movie" "atoll-save-ashelin-res-a") dm-scene-load-pick-func) + (function "atoll-save-ashelin-res-b" ("atoll-movie" "atoll-save-ashelin-res-b") dm-scene-load-pick-func) + (function "atoll-sig-intro" ("atoll-movie" "atoll-sig-intro") dm-scene-load-pick-func) + (function "atoll-sig-tank" ("atoll-movie" "atoll-sig-tank") dm-scene-load-pick-func) + (function "atoll-sniper-a" ("atoll-movie" "atoll-sniper-a") dm-scene-load-pick-func) + (function "atoll-sniper-b" ("atoll-movie" "atoll-sniper-b") dm-scene-load-pick-func) + (function "atoll-sniper-c" ("atoll-movie" "atoll-sniper-c") dm-scene-load-pick-func) + (function "atoll-sniper-d" ("atoll-movie" "atoll-sniper-d") dm-scene-load-pick-func) + (function "atoll-sniper-e" ("atoll-movie" "atoll-sniper-e") dm-scene-load-pick-func) + ) + (menu + "canyon" + (function "canyon-insert-items-intro" ("mountain-movie" "canyon-insert-items-intro") dm-scene-load-pick-func) + (function "canyon-insert-items-res" ("mincan-city" "canyon-insert-items-res") dm-scene-load-pick-func) + ) + (menu + "caspad" + (function "caspad-air-train-in" ("caspad-warp" "caspad-air-train-in") dm-scene-load-pick-func) + (function "caspad-air-train-out" ("caspad-warp" "caspad-air-train-out") dm-scene-load-pick-func) + ) + (menu + "castle" + (function + "castle-krew-boss-fight-intro" + ("casboss-start" "castle-krew-boss-fight-intro") + dm-scene-load-pick-func + ) + (function "castle-krew-boss-fight-res" ("casboss-start" "castle-krew-boss-fight-res") dm-scene-load-pick-func) + ) + (menu + "consite" + (function "consite-find-baron-res" ("consite-start" "consite-find-baron-res") dm-scene-load-pick-func) + ) + (menu + "dig" + (function "dig-find-totem-res" ("dig-totem" "dig-find-totem-res") dm-scene-load-pick-func) + (function "dig-digger-explode" ("dig1-start" "dig-digger-explode") dm-scene-load-pick-func) + ) + (menu + "drill" + (function "drill-top-explode" ("drillmid-checkpoint" "drill-top-explode") dm-scene-load-pick-func) + ) + (menu + "forest" + (function + "forest-protect-samos-intro-b" + ("forest-tree" "forest-protect-samos-intro-b") + dm-scene-load-pick-func + ) + (function "forest-protect-samos-res" ("forest-tree" "forest-protect-samos-res") dm-scene-load-pick-func) + ) + (menu + "fortress" + (function + "fortress-blow-up-ammo-res-a" + ("fordumpc-start" "fortress-blow-up-ammo-res-a") + dm-scene-load-pick-func + ) + (function + "fortress-blow-up-ammo-res-b" + ("fordumpc-explode-movie" "fortress-blow-up-ammo-res-b") + dm-scene-load-pick-func + ) + (function "fortress-save-friends-res" ("prison-start" "fortress-save-friends-res") dm-scene-load-pick-func) + (function + "test-fortress-blow-up-ammo-res-b-a" + ("fordumpc-explode-movie" "test-fortress-blow-up-ammo-res-b-a") + dm-scene-load-pick-func + ) + (function "test-fortress-blast" ("fordumpc-explode-movie" "test-fortress-blast") dm-scene-load-pick-func) + ) + (menu + "hideout" + (function "city-krew-delivery-intro" ("hideout-start" "city-krew-delivery-intro") dm-scene-load-pick-func) + (function + "city-destroy-guard-vehicles-intro" + ("hideout-start" "city-destroy-guard-vehicles-intro") + dm-scene-load-pick-func + ) + (function "ruins-sacred-intro" ("hideout-start" "ruins-sacred-intro") dm-scene-load-pick-func) + (function "ruins-tower-intro" ("ctysluma-tower-intro" "ruins-tower-intro") dm-scene-load-pick-func) + (function "vin-rescue-intro" ("hideout-start" "vin-rescue-intro") dm-scene-load-pick-func) + (function "fortress-2-intro" ("hideout-start" "fortress-2-intro") dm-scene-load-pick-func) + (function "atoll-1-int" ("hideout-start" "atoll-1-int") dm-scene-load-pick-func) + (function "atoll-3-intro" ("hideout-start" "atoll-3-intro") dm-scene-load-pick-func) + (function + "city-shuttle-underground-intro" + ("hideout-start" "city-shuttle-underground-intro") + dm-scene-load-pick-func + ) + (function "city-escort-kid-intro" ("escort-kid-intro" "city-escort-kid-intro") dm-scene-load-pick-func) + (function "city-stop-bomb-bots-intro" ("hideout-start" "city-stop-bomb-bots-intro") dm-scene-load-pick-func) + (function + "forest-catch-metal-heads-intro" + ("hideout-start" "forest-catch-metal-heads-intro") + dm-scene-load-pick-func + ) + (function + "fortress-save-friends-intro-a" + ("hideout-start" "fortress-save-friends-intro-a") + dm-scene-load-pick-func + ) + ) + (menu + "hiphog" + (function "atoll-2-intro" ("hiphog-start" "atoll-2-intro") dm-scene-load-pick-func) + (function "sewer-1-intro" ("hiphog-start" "sewer-1-intro") dm-scene-load-pick-func) + (function "sewer-1-res" ("hiphog-start" "sewer-1-res") dm-scene-load-pick-func) + (function "sewer-2-intro" ("hiphog-start" "sewer-2-intro") dm-scene-load-pick-func) + (function "krew-delivery-res" ("hiphog-start" "krew-delivery-res") dm-scene-load-pick-func) + (function "city-meet-brutter-intro" ("hiphog-start" "city-meet-brutter-intro") dm-scene-load-pick-func) + (function "city-keira-delivery-intro" ("hiphog-start" "city-keira-delivery-intro") dm-scene-load-pick-func) + (function "city-krew-collection-intro" ("hiphog-start" "city-krew-collection-intro") dm-scene-load-pick-func) + (function "city-krew-collection-res" ("hiphog-start" "city-krew-collection-res") dm-scene-load-pick-func) + (function + "forest-hunt-camo-metal-heads-intro" + ("hiphog-start" "forest-hunt-camo-metal-heads-intro") + dm-scene-load-pick-func + ) + (function "sewer-blow-up-statue-intro" ("hiphog-start" "sewer-blow-up-statue-intro") dm-scene-load-pick-func) + (function "city-errol-challenge-intro" ("hiphog-start" "city-errol-challenge-intro") dm-scene-load-pick-func) + (function "city-whack-a-metal-intro" ("hiphog-start" "city-whack-a-metal-intro") dm-scene-load-pick-func) + (function "city-whack-a-metal-res" ("hiphog-start" "city-whack-a-metal-res") dm-scene-load-pick-func) + ) + (menu + "intro/outro" + (function + "intro" + ("village1-start" ("intro-samos-hut" "intro-vortex" "intro-city-square" "intro-prison")) + dm-scene-load-pick-func + ) + (function "intro-samos-hut" ("village1-start" "intro-samos-hut") dm-scene-load-pick-func) + (function "intro-vortex" ("village1-start" "intro-vortex") dm-scene-load-pick-func) + (function "intro-city-square" ("ctyindb-intro-start" "intro-city-square") dm-scene-load-pick-func) + (function "intro-prison" ("prison-intro-start" "intro-prison") dm-scene-load-pick-func) + (function + "outro" + ("nestb-outro" ("outro-nest" "outro-palace" "outro-hiphog" "outro-port")) + dm-scene-load-pick-func + ) + (function "outro-nest" ("nestb-outro" "outro-nest") dm-scene-load-pick-func) + (function "outro-palace" ("throne-outro" "outro-palace") dm-scene-load-pick-func) + (function "outro-hiphog" ("hiphog-outro" "outro-hiphog") dm-scene-load-pick-func) + (function "outro-port" ("ctyport-outro" "outro-port") dm-scene-load-pick-func) + ) + (menu + "mountain" + (function "mtn-step-plat-rocks-a" ("mountain-start" "mtn-step-plat-rocks-a") dm-scene-load-pick-func) + (function "mtn-step-plat-rocks-b" ("mountain-start" "mtn-step-plat-rocks-b") dm-scene-load-pick-func) + (function "mtn-step-plat-rocks-c" ("mountain-start" "mtn-step-plat-rocks-c") dm-scene-load-pick-func) + (function "mtn-plat-buried-rocks-a" ("mountain-start" "mtn-plat-buried-rocks-a") dm-scene-load-pick-func) + (function "mountain-lens-res" ("mountain-start" "mountain-lens-res") dm-scene-load-pick-func) + (function "mountain-shard-res" ("mountain-start" "mountain-shard-res") dm-scene-load-pick-func) + (function "mountain-gear-res" ("mountain-start" "mountain-gear-res") dm-scene-load-pick-func) + ) + (menu + "nest" + (function "nest-break-barrier-res" ("nest-gun" "nest-break-barrier-res") dm-scene-load-pick-func) + (function "nest-air-train-in" ("nest-warp" "nest-air-train-in") dm-scene-load-pick-func) + (function "nest-air-train-out" ("nest-warp" "nest-air-train-out") dm-scene-load-pick-func) + (function "nest-kor-boss-fight-intro-b" ("nestb-boss" "nest-kor-boss-fight-intro-b") dm-scene-load-pick-func) + (function "nest-kor-boss-fight-mid" ("nestb-boss" "nest-kor-boss-fight-mid") dm-scene-load-pick-func) + ) + (menu + "onintent" + (function "mountain-finditems-intro" ("onintent-start" "mountain-finditems-intro") dm-scene-load-pick-func) + (function "dig-find-totem-intro" ("onintent-start" "dig-find-totem-intro") dm-scene-load-pick-func) + (function + "forest-protect-samos-intro-a" + ("onintent-start" "forest-protect-samos-intro-a") + dm-scene-load-pick-func + ) + (function "city-play-onin-game-intro" ("onintent-start" "city-play-onin-game-intro") dm-scene-load-pick-func) + (function "city-play-onin-game-res" ("onintent-start" "city-play-onin-game-res") dm-scene-load-pick-func) + (function + "test-mountain-finditems-intro" + ("onintent-start" "test-mountain-finditems-intro") + dm-scene-load-pick-func + ) + ) + (menu + "oracle" + (function "city-oracle-intro" ("oracle-start" "city-oracle-intro") dm-scene-load-pick-func) + (function "city-oracle-level-0" ("oracle-start" "city-oracle-level-0") dm-scene-load-pick-func) + (function "city-oracle-level-1" ("oracle-start" "city-oracle-level-1") dm-scene-load-pick-func) + (function "city-oracle-level-2" ("oracle-start" "city-oracle-level-2") dm-scene-load-pick-func) + (function "city-oracle-level-3" ("oracle-start" "city-oracle-level-3") dm-scene-load-pick-func) + ) + (menu + "palace" + (function "palace-outside-window-res" ("palroof-throne" "palace-outside-window-res") dm-scene-load-pick-func) + (function + "palace-outside-window-res-b" + ("palroof-boss" "palace-outside-window-res-b") + dm-scene-load-pick-func + ) + (function "palace-boss-res" ("palroof-boss" "palace-boss-res") dm-scene-load-pick-func) + (function "palace-sneak-in-res" ("palroof-throne" "palace-sneak-in-res") dm-scene-load-pick-func) + ) + (menu + "ruins" + (function "ruins-tower-victory" ("ruins-hut" "ruins-tower-victory") dm-scene-load-pick-func) + (function "ruins-sacred-victory" ("ruins-hut" "ruins-sacred-victory") dm-scene-load-pick-func) + (function "ruins-get-to-hut-res" ("ruins-hut" "ruins-get-to-hut-res") dm-scene-load-pick-func) + (function "test-scene" ("ruins-hut" "test-scene") dm-scene-load-pick-func) + ) + (menu + "sewer" + (function "sewer-drain-res" ("sewer-start" "sewer-drain-res") dm-scene-load-pick-func) + (function "sewer-blow-up-statue-res" ("sewesc-start" "sewer-blow-up-statue-res") dm-scene-load-pick-func) + (function "sewer-hosehead" ("sewesc-start" "sewer-hosehead") dm-scene-load-pick-func) + ) + (menu + "stadium" + (function + "city-keira-hover-challenge-intro" + ("garage-start-skate" "city-keira-hover-challenge-intro") + dm-scene-load-pick-func + ) + (function + "city-keira-hover-challenge-res" + ("garage-start-skate" "city-keira-hover-challenge-res") + dm-scene-load-pick-func + ) + (function + "city-class-1-race-intro-a" + ("garage-class3-movie" "city-class-1-race-intro-a") + dm-scene-load-pick-func + ) + (function "city-class-1-race-intro-b" ("stadiumd-start" "city-class-1-race-intro-b") dm-scene-load-pick-func) + (function "city-class-1-race-res" ("stadiumd-start" "city-class-1-race-res") dm-scene-load-pick-func) + (function "city-class-3-race-intro" ("garage-class3-movie" "city-class-3-race-intro") dm-scene-load-pick-func) + (function "city-class-3-race-res" ("garage-class3-movie" "city-class-3-race-res") dm-scene-load-pick-func) + (function "city-put-hoverboard" ("skatea-start" "city-put-hoverboard") dm-scene-load-pick-func) + (function "city-class-2-race-intro" ("garage-class3-movie" "city-class-2-race-intro") dm-scene-load-pick-func) + (function "city-class-2-race-res" ("garage-class3-movie" "city-class-2-race-res") dm-scene-load-pick-func) + (function "city-defend-stadium-intro" ("stadium-blimp" "city-defend-stadium-intro") dm-scene-load-pick-func) + (function "city-defend-stadium-res" ("stadium-blimp" "city-defend-stadium-res") dm-scene-load-pick-func) + ) + (menu + "strip" + (function "crane-victory" ("strip-start" "crane-victory") dm-scene-load-pick-func) + (function "ecowells-victory" ("strip-start" "ecowells-victory") dm-scene-load-pick-func) + (function "vin-rescue" ("strip-start" "vin-rescue") dm-scene-load-pick-func) + (function "test-crane-victory" ("strip-start" "test-crane-victory") dm-scene-load-pick-func) + ) + (menu + "tomb" + (function "tomb-face-tests-intro" ("tombd-start" "tomb-face-tests-intro") dm-scene-load-pick-func) + (function "tomb-boulder-start" ("tomb-boulder" "tomb-boulder-start") dm-scene-load-pick-func) + (function "tomb-spider-scare" ("tomb-boulder-explode" "tomb-spider-scare") dm-scene-load-pick-func) + (function "tomb-unlock-start" ("tomb-water-switch" "tomb-unlock-start") dm-scene-load-pick-func) + (function "tomb-unlock-water" ("tomb-water-switch" "tomb-unlock-water") dm-scene-load-pick-func) + (function "tomb-unlock-poles" ("tomb-poles-switch" "tomb-unlock-poles") dm-scene-load-pick-func) + (function "tomb-boss-open" ("tombboss-start" "tomb-boss-open") dm-scene-load-pick-func) + (function "tomb-boss-intro" ("tombboss-start" "tomb-boss-intro") dm-scene-load-pick-func) + (function "tomb-boss-res" ("tombboss-start" "tomb-boss-res") dm-scene-load-pick-func) + ) + (menu + "under" + (function "under-find-sig-res" ("under-start" "under-find-sig-res") dm-scene-load-pick-func) + (function "under-centipede-one" ("under-start" "under-centipede-one") dm-scene-load-pick-func) + (function "under-centipede-two" ("under-start" "under-centipede-two") dm-scene-load-pick-func) + (function "under-centipede-three" ("under-start" "under-centipede-three") dm-scene-load-pick-func) + (function "under-get-sig-out-res" ("under-start" "under-get-sig-out-res") dm-scene-load-pick-func) + ) + (menu + "vinroom" + (function "crane-intro" ("vinroom-start" "crane-intro") dm-scene-load-pick-func) + (function + "drill-kill-metal-heads-intro" + ("vinroom-start" "drill-kill-metal-heads-intro") + dm-scene-load-pick-func + ) + (function "ecowells-intro" ("vinroom-start" "ecowells-intro") dm-scene-load-pick-func) + (function "city-switch-on-power-intro" ("vinroom-start" "city-switch-on-power-intro") dm-scene-load-pick-func) + (function + "dig-knock-down-scaffolding-intro" + ("vinroom-start" "dig-knock-down-scaffolding-intro") + dm-scene-load-pick-func + ) + (function "drill-destroy-ship-intro" ("vinroom-start" "drill-destroy-ship-intro") dm-scene-load-pick-func) + (function + "drill-destroy-control-tower-intro" + ("vinroom-start" "drill-destroy-control-tower-intro") + dm-scene-load-pick-func + ) + ) + (menu "demo" (function "demo-disk-intro" ("demo-movie" "demo-disk-intro") dm-scene-load-pick-func)) + (menu + "cover-test" + (function "cover-test-1" ("chartest-1" "cover-test-1") dm-scene-load-pick-func) + (function "cover-test-2" ("chartest-1" "cover-test-2") dm-scene-load-pick-func) + ) + ) + ) + ) + (debug-menu-append-item s5-0 (debug-menu-make-task-menu arg0)) + (debug-menu-append-item s5-0 (the-as debug-menu-node (debug-menu-make-play-menu (the-as symbol arg0)))) ) arg0 ) diff --git a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc index e08d8769cb..c6cb0e5f5f 100644 --- a/test/decompiler/reference/jak2/engine/debug/editable_REF.gc +++ b/test/decompiler/reference/jak2/engine/debug/editable_REF.gc @@ -124,7 +124,7 @@ (s1-0 318) ) (format (clear *temp-string*) "region-~D~%" (-> obj id)) - (s3-0 s2-0 (the-as bucket-id s1-0) *temp-string* arg0 (font-color one) sv-32) + (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))) (when (>= arg1 1) @@ -135,7 +135,7 @@ (s1-1 318) ) (format (clear *temp-string*) "(on-enter ~S)" s4-1) - (s3-1 s2-1 (the-as bucket-id s1-1) *temp-string* arg0 (font-color one) sv-32) + (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))) ) @@ -147,7 +147,7 @@ (s1-2 318) ) (format (clear *temp-string*) "(on-inside ~S)" s4-2) - (s3-2 s2-2 (the-as bucket-id s1-2) *temp-string* arg0 (font-color one) sv-32) + (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))) ) @@ -159,7 +159,7 @@ (s2-3 318) ) (format (clear *temp-string*) "(on-exit ~S)" s5-1) - (s4-3 s3-3 (the-as bucket-id s2-3) *temp-string* arg0 (font-color one) sv-32) + (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))) ) @@ -708,7 +708,7 @@ (s5-0 (new 'stack-no-clear 'vector)) ) (set! (-> a0-1 quad) (-> obj trans quad)) - (set! (-> a0-1 w) (-> obj radius)) + (set! (-> a0-1 r) (-> obj radius)) (when (sphere-in-view-frustum? a0-1) (reverse-transform-point! s5-0 (-> obj trans) (-> *math-camera* inv-camera-rot vector 2) arg0) (let ((f0-1 (vector-vector-distance (edit-get-trans obj) s5-0))) @@ -1027,7 +1027,7 @@ (s3-1 318) ) (format (clear *temp-string*) "~S~%" (-> obj name)) - (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> obj trans) (font-color one) (the-as vector2h #f)) + (s5-1 s4-1 (the-as bucket-id s3-1) *temp-string* (-> obj trans) (font-color #dadada) (the-as vector2h #f)) ) ) ((method-of-type editable-sphere editable-method-10) obj) @@ -1648,8 +1648,8 @@ *temp-string* (-> gp-0 s4-1) (if (logtest? (-> obj flags) (editable-flag orient)) - (font-color fc-5) - (font-color one) + (font-color yellow-#f3f300) + (font-color #dadada) ) (the-as vector2h #f) ) diff --git a/test/decompiler/reference/jak2/engine/debug/menu_REF.gc b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc new file mode 100644 index 0000000000..96bce554b8 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/debug/menu_REF.gc @@ -0,0 +1,1760 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition of type debug-menu-context +(deftype debug-menu-context (basic) + ((is-active symbol :offset-assert 4) + (sel-length int32 :offset-assert 8) + (sel-menu debug-menu 8 :offset-assert 12) + (root-menu debug-menu :offset-assert 44) + (joypad-func (function basic none) :offset-assert 48) + (joypad-item basic :offset-assert 52) + (font font-context :offset-assert 56) + (is-hidden symbol :offset-assert 60) + (joypad-number int32 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type debug-menu-context +(defmethod inspect debug-menu-context ((obj debug-menu-context)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tis-active: ~A~%" (-> obj is-active)) + (format #t "~1Tsel-length: ~D~%" (-> obj sel-length)) + (format #t "~1Tsel-menu[8] @ #x~X~%" (-> obj sel-menu)) + (format #t "~1Troot-menu: ~A~%" (-> obj root-menu)) + (format #t "~1Tjoypad-func: ~A~%" (-> obj joypad-func)) + (format #t "~1Tjoypad-item: ~A~%" (-> obj joypad-item)) + (format #t "~1Tfont: ~A~%" (-> obj font)) + (format #t "~1Tis-hidden: ~A~%" (-> obj is-hidden)) + (format #t "~1Tjoypad-number: ~D~%" (-> obj joypad-number)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type debug-menu-context +(defmethod new debug-menu-context ((allocation symbol) (type-to-make type)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 is-active) #f) + (set! (-> gp-0 is-hidden) #f) + (set! (-> gp-0 sel-length) 0) + (set! (-> gp-0 root-menu) #f) + (set! (-> gp-0 joypad-func) #f) + (set! (-> gp-0 joypad-item) #f) + (set! (-> gp-0 font) (new + 'debug + 'font-context + *font-default-matrix* + 0 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) + (set! (-> gp-0 joypad-number) 0) + gp-0 + ) + ) + +;; definition of type debug-menu-node +(deftype debug-menu-node (basic) + ((name string :offset-assert 4) + (parent debug-menu :offset-assert 8) + (refresh-delay int32 :offset-assert 12) + (refresh-ctr int32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type debug-menu-node +(defmethod inspect debug-menu-node ((obj debug-menu-node)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (label cfg-4) + obj + ) + +;; definition for method 2 of type debug-menu-node +(defmethod print debug-menu-node ((obj debug-menu-node)) + (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) + obj + ) + +;; definition of type debug-menu +(deftype debug-menu (debug-menu-node) + ((context debug-menu-context :offset-assert 20) + (selected-item debug-menu-item :offset-assert 24) + (pix-width int32 :offset-assert 28) + (pix-height int32 :offset-assert 32) + (items pair :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type debug-menu-context string) _type_ 0) + ) + ) + +;; definition for method 3 of type debug-menu +(defmethod inspect debug-menu ((obj debug-menu)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tcontext: ~A~%" (-> obj context)) + (format #t "~1Tselected-item: ~A~%" (-> obj selected-item)) + (format #t "~1Tpix-width: ~D~%" (-> obj pix-width)) + (format #t "~1Tpix-height: ~D~%" (-> obj pix-height)) + (format #t "~1Titems: ~A~%" (-> obj items)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type debug-menu +(defmethod new debug-menu ((allocation symbol) (type-to-make type) (arg0 debug-menu-context) (arg1 string)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 context) arg0) + (set! (-> v0-0 name) arg1) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 selected-item) #f) + (set! (-> v0-0 items) '()) + v0-0 + ) + ) + +;; definition of type debug-menu-item +(deftype debug-menu-item (debug-menu-node) + ((id int32 :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type debug-menu-item +(defmethod inspect debug-menu-item ((obj debug-menu-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition of type debug-menu-item-submenu +(deftype debug-menu-item-submenu (debug-menu-item) + ((submenu debug-menu :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + (:methods + (new (symbol type string debug-menu) _type_ 0) + ) + ) + +;; definition for method 3 of type debug-menu-item-submenu +(defmethod inspect debug-menu-item-submenu ((obj debug-menu-item-submenu)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tsubmenu: ~A~%" (-> obj submenu)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type debug-menu-item-submenu +(defmethod new debug-menu-item-submenu ((allocation symbol) (type-to-make type) (arg0 string) (arg1 debug-menu)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 0) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 submenu) arg1) + (set! (-> v0-0 submenu parent) (the-as debug-menu v0-0)) + v0-0 + ) + ) + +;; definition of type debug-menu-item-function +(deftype debug-menu-item-function (debug-menu-item) + ((activate-func (function object object) :offset-assert 24) + (hilite-timer int8 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x1d + :flag-assert #x90000001d + (:methods + (new (symbol type string object (function object object)) _type_ 0) + ) + ) + +;; definition for method 3 of type debug-menu-item-function +(defmethod inspect debug-menu-item-function ((obj debug-menu-item-function)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) + (format #t "~1Thilite-timer: ~D~%" (-> obj hilite-timer)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type debug-menu-item-function +(defmethod new debug-menu-item-function ((allocation symbol) (type-to-make type) (arg0 string) (arg1 object) (arg2 (function object object))) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 0) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 id) (the-as int arg1)) + (set! (-> v0-0 activate-func) arg2) + (set! (-> v0-0 hilite-timer) 0) + v0-0 + ) + ) + +;; definition of type debug-menu-item-flag +(deftype debug-menu-item-flag (debug-menu-item) + ((activate-func (function object debug-menu-msg object) :offset-assert 24) + (is-on object :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + (:methods + (new (symbol type string object (function object debug-menu-msg object)) _type_ 0) + ) + ) + +;; definition for method 3 of type debug-menu-item-flag +(defmethod inspect debug-menu-item-flag ((obj debug-menu-item-flag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) + (format #t "~1Tis-on: ~A~%" (-> obj is-on)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type debug-menu-item-flag +(defmethod new debug-menu-item-flag ((allocation symbol) + (type-to-make type) + (arg0 string) + (arg1 object) + (arg2 (function object debug-menu-msg object)) + ) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 parent) #f) + (set! (-> v0-0 refresh-delay) 23) + (set! (-> v0-0 refresh-ctr) (-> v0-0 refresh-delay)) + (set! (-> v0-0 id) (the-as int arg1)) + (set! (-> v0-0 activate-func) arg2) + (set! (-> v0-0 is-on) (the-as object #f)) + v0-0 + ) + ) + +;; definition of type debug-menu-item-var +(deftype debug-menu-item-var (debug-menu-item) + ((display-str string :offset-assert 24) + (grabbed-joypad-p symbol :offset-assert 28) + (float-p symbol :offset-assert 32) + (range-p symbol :offset-assert 36) + (show-len int32 :offset-assert 40) + (inc-delay int32 :offset-assert 44) + (inc-delay-ctr int32 :offset-assert 48) + (step-delay-ctr int32 :offset-assert 52) + (inc-dir int32 :offset-assert 56) + (fval float :offset-assert 60) + (fundo-val float :offset-assert 64) + (frange-min float :offset-assert 68) + (frange-max float :offset-assert 72) + (fstart-inc float :offset-assert 76) + (fstep float :offset-assert 80) + (fprecision int32 :offset-assert 84) + (factivate-func (function int debug-menu-msg float float float) :offset-assert 88) + (ival int32 :offset 60) + (iundo-val int32 :offset 64) + (irange-min int32 :offset 68) + (irange-max int32 :offset 72) + (istart-inc int32 :offset 76) + (istep int32 :offset 80) + (ihex-p symbol :offset-assert 92) + (iactivate-func (function int debug-menu-msg int int int) :offset 88) + (ifloat-p symbol :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x64 + :flag-assert #x900000064 + (:methods + (new (symbol type string int int) _type_ 0) + ) + ) + +;; definition for method 3 of type debug-menu-item-var +(defmethod inspect debug-menu-item-var ((obj debug-menu-item-var)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Trefresh-delay: ~D~%" (-> obj refresh-delay)) + (format #t "~1Trefresh-ctr: ~D~%" (-> obj refresh-ctr)) + (format #t "~1Tid: #x~X~%" (-> obj id)) + (format #t "~1Tdisplay-str: ~A~%" (-> obj display-str)) + (format #t "~1Tgrabbed-joypad-p: ~A~%" (-> obj grabbed-joypad-p)) + (format #t "~1Tfloat-p: ~A~%" (-> obj float-p)) + (format #t "~1Trange-p: ~A~%" (-> obj range-p)) + (format #t "~1Tshow-len: ~D~%" (-> obj show-len)) + (format #t "~1Tinc-delay: ~D~%" (-> obj inc-delay)) + (format #t "~1Tinc-delay-ctr: ~D~%" (-> obj inc-delay-ctr)) + (format #t "~1Tstep-delay-ctr: ~D~%" (-> obj step-delay-ctr)) + (format #t "~1Tinc-dir: ~D~%" (-> obj inc-dir)) + (format #t "~1Tfval: ~f~%" (-> obj fval)) + (format #t "~1Tfundo-val: ~f~%" (-> obj fundo-val)) + (format #t "~1Tfrange-min: ~f~%" (-> obj frange-min)) + (format #t "~1Tfrange-max: ~f~%" (-> obj frange-max)) + (format #t "~1Tfstart-inc: ~f~%" (-> obj fstart-inc)) + (format #t "~1Tfstep: ~f~%" (-> obj fstep)) + (format #t "~1Tfprecision: ~D~%" (-> obj fprecision)) + (format #t "~1Tfactivate-func: ~A~%" (-> obj factivate-func)) + (format #t "~1Tival: ~D~%" (-> obj fval)) + (format #t "~1Tiundo-val: ~D~%" (-> obj fundo-val)) + (format #t "~1Tirange-min: ~D~%" (-> obj frange-min)) + (format #t "~1Tirange-max: ~D~%" (-> obj frange-max)) + (format #t "~1Tistart-inc: ~D~%" (-> obj fstart-inc)) + (format #t "~1Tistep: ~D~%" (-> obj fstep)) + (format #t "~1Tihex-p: ~A~%" (-> obj ihex-p)) + (format #t "~1Tiactivate-func: ~A~%" (-> obj factivate-func)) + (format #t "~1Tifloat-p: ~A~%" (-> obj ifloat-p)) + (label cfg-4) + obj + ) + +;; definition for function debug-menu-item-var-update-display-str +(defun debug-menu-item-var-update-display-str ((arg0 debug-menu-item-var)) + (cond + ((-> arg0 float-p) + (format (clear (-> arg0 display-str)) "~f" (-> arg0 fval)) + ) + ((-> arg0 ihex-p) + (format (clear (-> arg0 display-str)) "x~X" (-> arg0 fval)) + ) + ((-> arg0 ifloat-p) + (cond + ((and (< (the-as int (-> arg0 fval)) 0) (< -100 (the-as int (-> arg0 fval)))) + (let ((s5-2 format) + (a0-8 (clear (-> arg0 display-str))) + (a1-2 "-0.~1d") + (v1-8 (abs (the-as int (-> arg0 fval)))) + ) + (s5-2 a0-8 a1-2 (/ (mod v1-8 100) 10)) + ) + ) + (else + (let ((s5-3 format) + (a0-10 (clear (-> arg0 display-str))) + (a1-3 "~2d.~1d") + (a2-6 (/ (the-as int (-> arg0 fval)) 100)) + (v1-12 (abs (the-as int (-> arg0 fval)))) + ) + (s5-3 a0-10 a1-3 a2-6 (/ (mod v1-12 100) 10)) + ) + ) + ) + ) + (else + (format (clear (-> arg0 display-str)) "~D" (-> arg0 fval)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-var-make-int +(defun debug-menu-item-var-make-int ((arg0 debug-menu-item-var) + (arg1 (function int debug-menu-msg int int int)) + (arg2 int) + (arg3 symbol) + (arg4 int) + (arg5 int) + (arg6 symbol) + ) + (set! (-> arg0 float-p) #f) + (set! (-> arg0 range-p) arg3) + (set! (-> arg0 frange-min) (the-as float arg4)) + (set! (-> arg0 frange-max) (the-as float arg5)) + (set! (-> arg0 fstart-inc) (the-as float arg2)) + (set! (-> arg0 fstep) (the-as float arg2)) + (set! (-> arg0 ihex-p) arg6) + (set! (-> arg0 factivate-func) (the-as (function int debug-menu-msg float float float) arg1)) + (cond + (arg3 + (set! (-> arg0 fval) (the-as float arg4)) + ) + (else + (set! (-> arg0 fval) 0.0) + 0 + ) + ) + (if arg1 + (set! (-> arg0 fval) + (the-as + float + (arg1 (-> arg0 id) (debug-menu-msg update) (the-as int (-> arg0 fval)) (the-as int (-> arg0 fval))) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + arg0 + ) + +;; definition for function debug-menu-item-var-make-float +(defun debug-menu-item-var-make-float ((arg0 debug-menu-item-var) + (arg1 (function int debug-menu-msg float float float)) + (arg2 float) + (arg3 symbol) + (arg4 float) + (arg5 float) + (arg6 int) + ) + (set! (-> arg0 float-p) #t) + (set! (-> arg0 range-p) arg3) + (set! (-> arg0 frange-min) arg4) + (set! (-> arg0 frange-max) arg5) + (set! (-> arg0 fstart-inc) arg2) + (set! (-> arg0 fstep) arg2) + (set! (-> arg0 fprecision) arg6) + (set! (-> arg0 factivate-func) arg1) + (if arg3 + (set! (-> arg0 fval) arg4) + (set! (-> arg0 fval) 0.0) + ) + (if arg1 + (set! (-> arg0 fval) + (the float (the-as int (arg1 (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)))) + ) + ) + (debug-menu-item-var-update-display-str arg0) + arg0 + ) + +;; definition for method 0 of type debug-menu-item-var +(defmethod new debug-menu-item-var ((allocation symbol) (type-to-make type) (arg0 string) (arg1 int) (arg2 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((v1-2 (/ arg2 8))) + (set! (-> gp-0 name) arg0) + (set! (-> gp-0 parent) #f) + (set! (-> gp-0 refresh-delay) 31) + (set! (-> gp-0 refresh-ctr) (-> gp-0 refresh-delay)) + (set! (-> gp-0 id) arg1) + (set! v1-2 (cond + ((< 3 v1-2) + (empty) + v1-2 + ) + (else + 3 + ) + ) + ) + (set! (-> gp-0 show-len) v1-2) + ) + (set! (-> gp-0 grabbed-joypad-p) #f) + (set! (-> gp-0 ifloat-p) #f) + (set! (-> gp-0 display-str) (new 'debug 'string 64 (the-as string #f))) + (debug-menu-item-var-make-int gp-0 (the-as (function int debug-menu-msg int int int) #f) 1 #t 0 0 #f) + gp-0 + ) + ) + +;; definition for function debug-menu-context-grab-joypad +(defun debug-menu-context-grab-joypad ((arg0 debug-menu-context) (arg1 basic) (arg2 (function basic none))) + (cond + ((-> arg0 joypad-func) + #f + ) + (else + (set! (-> arg0 joypad-func) arg2) + (set! (-> arg0 joypad-item) arg1) + #t + ) + ) + ) + +;; definition for function debug-menu-context-release-joypad +(defun debug-menu-context-release-joypad ((arg0 debug-menu-context)) + (set! (-> arg0 joypad-func) #f) + (set! (-> arg0 joypad-item) #f) + #f + ) + +;; definition for function debug-menu-item-get-max-width +(defun debug-menu-item-get-max-width ((arg0 debug-menu-item) (arg1 debug-menu)) + (local-vars (v0-1 int)) + 0 + (cond + ((= (-> arg0 type) debug-menu-item-submenu) + (set! v0-1 (+ (the int (-> (get-string-length (-> arg0 name) (-> arg1 context font)) length)) 16)) + ) + ((= (-> arg0 type) debug-menu-item-var) + (set! v0-1 + (the int + (-> (get-string-length + (the-as string (the-as debug-menu-item-var (-> (the-as debug-menu-item-var arg0) display-str))) + (-> arg1 context font) + ) + length + ) + ) + ) + ) + (else + (set! v0-1 + (+ (the int (-> (get-string-length + (the-as string (the-as debug-menu-item-var (-> (the-as debug-menu-item-var arg0) name))) + (-> arg1 context font) + ) + length + ) + ) + 6 + ) + ) + ) + ) + v0-1 + ) + +;; definition for function debug-menu-context-default-selection +(defun debug-menu-context-default-selection ((arg0 debug-menu-context) (arg1 symbol)) + (when (or (zero? (-> arg0 sel-length)) (not arg1)) + (let ((s5-0 (-> arg0 root-menu))) + (when (and s5-0 (not (null? (-> s5-0 items)))) + (let ((s4-0 (-> arg0 is-active))) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg0 sel-length) 1) + (set! (-> arg0 sel-menu 0) s5-0) + (set! (-> s5-0 selected-item) (the-as debug-menu-item (-> s5-0 items car))) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-rebuild +(defun debug-menu-rebuild ((arg0 debug-menu)) + (let ((s4-0 0) + (s5-0 0) + ) + (let* ((s3-0 (-> arg0 items)) + (a0-1 (car s3-0)) + ) + (while (not (null? s3-0)) + (+! s5-0 1) + (set! (-> (the-as debug-menu-item a0-1) parent) arg0) + (set! s4-0 (max s4-0 (debug-menu-item-get-max-width (the-as debug-menu-item a0-1) arg0))) + (set! s3-0 (cdr s3-0)) + (set! a0-1 (car s3-0)) + ) + ) + (set! (-> arg0 pix-width) (+ s4-0 18)) + (set! (-> arg0 pix-height) (+ (* 15 s5-0) 10)) + ) + (let ((a0-2 (-> arg0 context))) + (debug-menu-context-default-selection a0-2 #t) + ) + arg0 + ) + +;; definition for function debug-menu-context-set-root-menu +(defun debug-menu-context-set-root-menu ((arg0 debug-menu-context) (arg1 debug-menu)) + (let ((s4-0 (-> arg0 is-active))) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg0 root-menu) arg1) + (debug-menu-context-default-selection arg0 #f) + (if s4-0 + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-append-item +(defun debug-menu-append-item ((arg0 debug-menu) (arg1 debug-menu-node)) + (let* ((gp-0 (-> arg0 context)) + (s4-0 (-> gp-0 is-active)) + ) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg1 parent) arg0) + (set! (-> arg0 items) (the-as pair (append! (-> arg0 items) (cons arg1 '())))) + (debug-menu-rebuild arg0) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + arg1 + ) + +;; definition for function debug-menu-remove-all-items +(defun debug-menu-remove-all-items ((arg0 debug-menu)) + (let* ((gp-0 (-> arg0 context)) + (s4-0 (-> gp-0 is-active)) + ) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg deactivate) (debug-menu-dest activation)) + ) + (set! (-> arg0 items) '()) + (set! (-> arg0 selected-item) #f) + (debug-menu-rebuild arg0) + (if s4-0 + (debug-menu-context-send-msg gp-0 (debug-menu-msg activate) (debug-menu-dest activation)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-func-decode +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function debug-menu-make-from-template +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 96 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 128 mismatch: defined as size 4, got size 16 +(defun debug-menu-make-from-template ((arg0 debug-menu-context) (arg1 pair)) + (local-vars + (s4-0 debug-menu-node) + (sv-16 object) + (sv-32 (function object int int)) + (sv-48 int) + (sv-64 (function object int int)) + (sv-80 (function object float float)) + (sv-96 float) + (sv-112 (function object float float)) + (sv-128 float) + (sv-144 (function object int int)) + ) + (when (or (not arg1) (null? arg1)) + (set! s4-0 (the-as debug-menu-node #f)) + (goto cfg-39) + ) + (let ((s5-0 (car arg1)) + (s4-1 (car (cdr arg1))) + ) + (cond + ((= s5-0 'menu) + (let ((s5-1 (new 'debug 'debug-menu arg0 (the-as string s4-1)))) + (set! s4-0 (new 'debug 'debug-menu-item-submenu (the-as string s4-1) s5-1)) + (let* ((gp-1 (cdr (cdr arg1))) + (a1-3 (car gp-1)) + ) + (while (not (null? gp-1)) + (let ((a1-4 (debug-menu-make-from-template arg0 (the-as pair a1-3)))) + (if a1-4 + (debug-menu-append-item s5-1 a1-4) + ) + ) + (set! gp-1 (cdr gp-1)) + (set! a1-3 (car gp-1)) + ) + ) + ) + ) + ((= s5-0 'main-menu) + (set! s4-0 (new 'debug 'debug-menu arg0 (the-as string s4-1))) + (let* ((gp-2 (cdr (cdr arg1))) + (a1-6 (car gp-2)) + ) + (while (not (null? gp-2)) + (let ((a1-7 (debug-menu-make-from-template arg0 (the-as pair a1-6)))) + (if a1-7 + (debug-menu-append-item (the-as debug-menu s4-0) a1-7) + ) + ) + (set! gp-2 (cdr gp-2)) + (set! a1-6 (car gp-2)) + ) + ) + (debug-menu-context-set-root-menu arg0 (the-as debug-menu s4-0)) + ) + (else + (set! s4-0 + (cond + ((= s5-0 'flag) + (new + 'debug + 'debug-menu-item-flag + (the-as string s4-1) + (car (cdr (cdr arg1))) + (the-as (function object debug-menu-msg object) (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + ) + ) + ((or (= s5-0 0) (= s5-0 'function)) + (new + 'debug + 'debug-menu-item-function + (the-as string s4-1) + (car (cdr (cdr arg1))) + (the-as (function object object) (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + ) + ) + ((= s5-0 'var) + (new + 'debug + 'debug-menu-item-var + (the-as string s4-1) + (the-as int (car (cdr (cdr arg1)))) + (the-as int (car (cdr (cdr (cdr arg1))))) + ) + ) + ((or (= s5-0 'int-var) (= s5-0 'int-var-gat1) (= s5-0 'hex-var)) + (set! s4-0 (new + 'debug + 'debug-menu-item-var + (the-as string s4-1) + (the-as int (car (cdr (cdr arg1)))) + (the-as int (ref arg1 4)) + ) + ) + (let ((s3-4 debug-menu-item-var-make-int) + (s2-3 (the-as debug-menu-item-var s4-0)) + (s1-3 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s0-2 (command-get-int (ref arg1 5) 0)) + ) + (set! sv-16 (ref arg1 6)) + (set! sv-32 command-get-int) + (let ((a0-24 (ref arg1 7)) + (a1-18 0) + ) + (set! sv-48 (sv-32 a0-24 a1-18)) + ) + (set! sv-64 command-get-int) + (let* ((a0-26 (ref arg1 8)) + (a1-20 0) + (t1-0 (sv-64 a0-26 a1-20)) + (t2-0 (= s5-0 'hex-var)) + ) + (s3-4 s2-3 (the-as (function int debug-menu-msg int int int) s1-3) s0-2 (the-as symbol sv-16) sv-48 t1-0 t2-0) + ) + ) + s4-0 + ) + ((= s5-0 'float-var) + (set! s4-0 (new + 'debug + 'debug-menu-item-var + (the-as string s4-1) + (the-as int (car (cdr (cdr arg1)))) + (the-as int (ref arg1 4)) + ) + ) + (let ((s5-5 debug-menu-item-var-make-float) + (s3-6 (the-as debug-menu-item-var s4-0)) + (s2-5 (debug-menu-func-decode (car (cdr (cdr (cdr arg1)))))) + (s1-6 (command-get-float (ref arg1 5) 0.0)) + (s0-3 (ref arg1 6)) + ) + (set! sv-80 command-get-float) + (let ((a0-35 (ref arg1 7)) + (a1-28 0.0) + ) + (set! sv-96 (sv-80 a0-35 a1-28)) + ) + (set! sv-112 command-get-float) + (let ((a0-37 (ref arg1 8)) + (a1-30 0.0) + ) + (set! sv-128 (sv-112 a0-37 a1-30)) + ) + (set! sv-144 command-get-int) + (let* ((a0-39 (ref arg1 9)) + (a1-32 0) + (t2-1 (sv-144 a0-39 a1-32)) + ) + (s5-5 + s3-6 + (the-as (function int debug-menu-msg float float float) s2-5) + s1-6 + (the-as symbol s0-3) + sv-96 + sv-128 + t2-1 + ) + ) + ) + s4-0 + ) + (else + (the-as debug-menu-node #f) + ) + ) + ) + ) + ) + ) + (label cfg-39) + s4-0 + ) + +;; definition for function debug-menu-find-from-template +;; WARN: Return type mismatch object vs debug-menu. +(defun debug-menu-find-from-template ((arg0 debug-menu-context) (arg1 pair)) + (let ((s5-0 (the-as object (-> arg0 root-menu)))) + (while (begin (label cfg-12) (and s5-0 (type? s5-0 debug-menu) (not (null? arg1)))) + (let ((s3-0 (-> (the-as debug-menu s5-0) items)) + (s5-1 (car arg1)) + ) + (set! arg1 (cdr arg1)) + (let ((s4-0 (car s3-0))) + (while (not (null? s3-0)) + (when (string= (the-as string s5-1) (-> (the-as debug-menu-item s4-0) name)) + (if (type? s4-0 debug-menu-item-submenu) + (set! s5-0 (-> (the-as debug-menu-item-submenu s4-0) submenu)) + (set! s5-0 s4-0) + ) + (goto cfg-12) + ) + (set! s3-0 (cdr s3-0)) + (set! s4-0 (car s3-0)) + ) + ) + ) + (set! s5-0 #f) + (goto cfg-19) + ) + (label cfg-19) + (the-as debug-menu s5-0) + ) + ) + +;; definition for function debug-menu-item-submenu-render +(defun debug-menu-item-submenu-render ((arg0 debug-menu-item-submenu) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((s5-0 (-> arg0 parent context font))) + (let ((v1-2 s5-0) + (a0-1 arg2) + ) + (set! (-> v1-2 origin x) (the float arg1)) + (set! (-> v1-2 origin y) (the float a0-1)) + ) + (set! (-> s5-0 color) (cond + ((zero? arg3) + (font-color white-#ffffff) + ) + (arg4 + (font-color #7cbaba) + ) + (else + (font-color #959595) + ) + ) + ) + (let* ((s3-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s4-0 (-> s3-0 base)) + ) + (draw-string-adv (-> arg0 name) s3-0 s5-0) + (draw-string-adv "..." s3-0 s5-0) + (let ((a3-1 (-> s3-0 base))) + (let ((v1-9 (the-as object (-> s3-0 base)))) + (set! (-> (the-as dma-packet v1-9) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-9) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-9) vif1) (new 'static 'vif-tag)) + (set! (-> s3-0 base) (&+ (the-as pointer v1-9) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s4-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-function-render +(defun debug-menu-item-function-render ((arg0 debug-menu-item-function) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((v1-2 (-> arg0 parent context font))) + (let ((a0-1 v1-2) + (a1-1 arg2) + ) + (set! (-> a0-1 origin x) (the float arg1)) + (set! (-> a0-1 origin y) (the float a1-1)) + ) + (set! (-> v1-2 color) (the-as font-color (cond + ((> (-> arg0 hilite-timer) 0) + (+! (-> arg0 hilite-timer) -1) + 10 + ) + ((< (-> arg0 hilite-timer) 0) + (+! (-> arg0 hilite-timer) 1) + 14 + ) + ((nonzero? arg3) + 13 + ) + (else + 12 + ) + ) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s5-0 (-> s4-0 base)) + ) + (draw-string (-> arg0 name) s4-0 v1-2) + (let ((a3-1 (-> s4-0 base))) + (let ((v1-3 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-3) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-3) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-3) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s5-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-flag-render +(defun debug-menu-item-flag-render ((arg0 debug-menu-item-flag) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((v1-2 (-> arg0 parent context font))) + (let ((a0-1 v1-2) + (a1-1 arg2) + ) + (set! (-> a0-1 origin x) (the float arg1)) + (set! (-> a0-1 origin y) (the float a1-1)) + ) + (set! (-> v1-2 color) (cond + ((= (-> arg0 is-on) 'invalid) + (font-color #5e3f5e) + ) + ((-> arg0 is-on) + (if (zero? arg3) + (font-color #daf95e) + (font-color #8aa81f) + ) + ) + ((zero? arg3) + (font-color #a6b5a6) + ) + (else + (font-color #757f75) + ) + ) + ) + (let* ((s4-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s5-0 (-> s4-0 base)) + ) + (draw-string (-> arg0 name) s4-0 v1-2) + (let ((a3-1 (-> s4-0 base))) + (let ((v1-3 (the-as object (-> s4-0 base)))) + (set! (-> (the-as dma-packet v1-3) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-3) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-3) vif1) (new 'static 'vif-tag)) + (set! (-> s4-0 base) (&+ (the-as pointer v1-3) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s5-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-var-render +(defun debug-menu-item-var-render ((arg0 debug-menu-item-var) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (let ((s5-0 (-> arg0 parent context font))) + (let ((v1-2 s5-0) + (a0-1 arg2) + ) + (set! (-> v1-2 origin x) (the float arg1)) + (set! (-> v1-2 origin y) (the float a0-1)) + ) + (set! (-> s5-0 color) (cond + ((zero? arg3) + (if (-> arg0 grabbed-joypad-p) + (font-color #a0d5d5) + (font-color white-#ffffff) + ) + ) + (arg4 + (font-color #7cbaba) + ) + (else + (font-color #959595) + ) + ) + ) + (let* ((s1-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s4-0 (-> s1-0 base)) + ) + (draw-string-adv (-> arg0 name) s1-0 s5-0) + (draw-string-adv ":" s1-0 s5-0) + (cond + ((>= (-> arg0 show-len) (length (-> arg0 display-str))) + (draw-string (-> arg0 display-str) s1-0 s5-0) + ) + (else + (draw-string "..." s1-0 s5-0) + (set! arg4 (and (zero? arg3) arg4)) + (when arg4 + (let ((v1-14 s5-0) + (a1-5 20) + (a0-8 379) + ) + (set! (-> v1-14 origin x) (the float a1-5)) + (set! (-> v1-14 origin y) (the float a0-8)) + ) + (draw-string-adv (-> arg0 name) s1-0 s5-0) + (draw-string-adv ":" s1-0 s5-0) + (draw-string (-> arg0 display-str) s1-0 s5-0) + ) + ) + ) + (let ((a3-1 (-> s1-0 base))) + (let ((v1-16 (the-as object (-> s1-0 base)))) + (set! (-> (the-as dma-packet v1-16) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-16) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-16) vif1) (new 'static 'vif-tag)) + (set! (-> s1-0 base) (the-as pointer (&+ (the-as dma-packet v1-16) 16))) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s4-0 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-render +(defun debug-menu-item-render ((arg0 debug-menu-item) (arg1 int) (arg2 int) (arg3 int) (arg4 symbol)) + (when (> (-> arg0 refresh-delay) 0) + (+! (-> arg0 refresh-ctr) -1) + (when (<= (-> arg0 refresh-ctr) 0) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) + (debug-menu-item-send-msg arg0 (debug-menu-msg update)) + ) + ) + (cond + ((= (-> arg0 type) debug-menu-item-submenu) + (debug-menu-item-submenu-render (the-as debug-menu-item-submenu arg0) arg1 arg2 arg3 arg4) + ) + ((= (-> arg0 type) debug-menu-item-function) + (debug-menu-item-function-render (the-as debug-menu-item-function arg0) arg1 arg2 arg3 arg4) + ) + ((= (-> arg0 type) debug-menu-item-flag) + (debug-menu-item-flag-render (the-as debug-menu-item-flag arg0) arg1 arg2 arg3 arg4) + ) + ((= (-> arg0 type) debug-menu-item-var) + (debug-menu-item-var-render (the-as debug-menu-item-var arg0) arg1 arg2 arg3 arg4) + ) + (else + (format 0 "ERROR: Found unknown item type!~%") + ) + ) + arg0 + ) + +;; definition for function debug-menu-render +;; INFO: Used lq/sq +(defun debug-menu-render ((arg0 debug-menu) (arg1 int) (arg2 int) (arg3 debug-menu-node) (arg4 int)) + (local-vars (sv-16 dma-buffer) (sv-32 pointer)) + (let ((v1-0 0)) + (let* ((a0-1 (-> arg0 items)) + (a1-1 (car a0-1)) + ) + (while (not (null? a0-1)) + (if (= a1-1 arg3) + (goto cfg-7) + ) + (+! v1-0 1) + (set! a0-1 (cdr a0-1)) + (set! a1-1 (car a0-1)) + ) + ) + (label cfg-7) + (if (< 16 v1-0) + (set! arg2 (- arg2 (* 15 (+ v1-0 -16)))) + ) + ) + (let* ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf)) + (s1-0 (-> s0-0 base)) + ) + (draw-sprite2d-xy s0-0 arg1 arg2 (-> arg0 pix-width) (-> arg0 pix-height) (new 'static 'rgba :a #x40)) + (let ((a3-2 (-> s0-0 base))) + (let ((v1-9 (the-as object (-> s0-0 base)))) + (set! (-> (the-as dma-packet v1-9) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-9) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-9) vif1) (new 'static 'vif-tag)) + (set! (-> s0-0 base) (&+ (the-as pointer v1-9) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + s1-0 + (the-as (pointer dma-tag) a3-2) + ) + ) + ) + (let* ((s3-1 (+ arg1 3)) + (s2-1 (+ arg2 5)) + (s1-1 (-> arg0 items)) + (s0-1 (car s1-1)) + ) + (while (not (null? s1-1)) + (when (= s0-1 arg3) + (set! (-> arg0 context font color) (if (nonzero? arg4) + (font-color #959595) + (font-color white-#ffffff) + ) + ) + (let ((v1-20 (-> arg0 context font)) + (a1-5 s3-1) + (a0-15 s2-1) + ) + (set! (-> v1-20 origin x) (the float a1-5)) + (set! (-> v1-20 origin y) (the float a0-15)) + ) + (set! sv-16 (-> *display* frames (-> *display* on-screen) debug-buf)) + (set! sv-32 (-> sv-16 base)) + (draw-string ">" sv-16 (-> arg0 context font)) + (let ((a3-3 (-> sv-16 base))) + (let ((v1-32 (the-as object (-> sv-16 base)))) + (set! (-> (the-as dma-packet v1-32) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-32) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-32) vif1) (new 'static 'vif-tag)) + (set! (-> sv-16 base) (&+ (the-as pointer v1-32) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) bucket-group) + (bucket-id debug-unknown-326) + sv-32 + (the-as (pointer dma-tag) a3-3) + ) + ) + ) + (debug-menu-item-render (the-as debug-menu-item s0-1) (+ s3-1 12) s2-1 arg4 (= s0-1 arg3)) + (+! s2-1 15) + (set! s1-1 (cdr s1-1)) + (set! s0-1 (car s1-1)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-context-render +(defun debug-menu-context-render ((arg0 debug-menu-context)) + (let ((s4-0 6)) + (dotimes (s5-0 (-> arg0 sel-length)) + (let ((s3-0 (-> arg0 sel-menu s5-0))) + (let ((a3-0 (-> s3-0 selected-item))) + (debug-menu-render s3-0 s4-0 52 a3-0 (+ (- -1 s5-0) (-> arg0 sel-length))) + ) + (set! s4-0 (+ s4-0 3 (-> s3-0 pix-width))) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-context-select-next-or-prev-item +(defun debug-menu-context-select-next-or-prev-item ((arg0 debug-menu-context) (arg1 int)) + (local-vars (v1-6 object)) + (let ((s5-0 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)))) + (let ((a2-0 (-> s5-0 selected-item)) + (a0-1 '()) + (v1-4 '()) + ) + (let ((a3-0 (-> s5-0 items))) + (while (not (null? a3-0)) + (when (= (car a3-0) a2-0) + (set! v1-4 a3-0) + (goto cfg-7) + ) + (set! a0-1 a3-0) + (set! a3-0 (cdr a3-0)) + ) + ) + (label cfg-7) + (when (null? v1-4) + (format 0 "ERROR: Couldn't find selected item in menu.~%") + (set! arg0 arg0) + (goto cfg-19) + ) + (cond + ((>= arg1 0) + (if (null? (cdr v1-4)) + (set! v1-6 (car (-> s5-0 items))) + (set! v1-6 (car (cdr v1-4))) + ) + ) + ((null? a0-1) + (set! v1-6 (car (last (-> s5-0 items)))) + ) + (else + (set! v1-6 (car a0-1)) + ) + ) + ) + (set! (-> s5-0 selected-item) (the-as debug-menu-item v1-6)) + ) + (label cfg-19) + arg0 + ) + +;; definition for function debug-menu-context-select-new-item +(defun debug-menu-context-select-new-item ((arg0 debug-menu-context) (arg1 int)) + (let* ((a2-0 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1))) + (a1-1 (-> a2-0 selected-item)) + (a0-1 0) + (v1-4 -1) + ) + (let ((a2-1 (-> a2-0 items))) + (while (not (null? a2-1)) + (if (= (car a2-1) a1-1) + (set! v1-4 a0-1) + ) + (set! a2-1 (cdr a2-1)) + (+! a0-1 1) + ) + ) + (when (= v1-4 -1) + (format 0 "ERROR: Couldn't find selected item in menu.~%") + (set! arg0 arg0) + (goto cfg-25) + ) + (cond + ((>= arg1 0) + (cond + ((= v1-4 (+ a0-1 -1)) + (set! arg1 1) + ) + ((>= (+ v1-4 arg1) a0-1) + (set! arg1 (+ (- -1 v1-4) a0-1)) + ) + ) + (dotimes (s4-0 arg1) + (debug-menu-context-select-next-or-prev-item arg0 1) + ) + ) + (else + (cond + ((zero? v1-4) + (set! arg1 -1) + ) + ((< (+ v1-4 arg1) 0) + (set! arg1 (- v1-4)) + ) + ) + (dotimes (s4-1 (- arg1)) + (debug-menu-context-select-next-or-prev-item arg0 -1) + ) + ) + ) + ) + (label cfg-25) + arg0 + ) + +;; definition for function debug-menu-context-open-submenu +(defun debug-menu-context-open-submenu ((arg0 debug-menu-context) (arg1 debug-menu)) + (let ((v1-0 (-> arg0 sel-length))) + (when (>= v1-0 8) + (format 0 "ERROR: Trying to exceed maximum menu depth!") + (return arg1) + ) + (when (null? (-> arg1 items)) + (format 0 "ERROR: Submenu has no items!") + (return arg1) + ) + (set! (-> arg0 sel-menu v1-0) arg1) + (if (not (-> arg1 selected-item)) + (set! (-> arg1 selected-item) (the-as debug-menu-item (-> arg1 items car))) + ) + (set! (-> arg0 sel-length) (+ v1-0 1)) + ) + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest current-selection)) + ) + +;; definition for function debug-menu-context-close-submenu +(defun debug-menu-context-close-submenu ((arg0 debug-menu-context)) + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest current-selection)) + (if (< 1 (-> arg0 sel-length)) + (+! (-> arg0 sel-length) -1) + ) + arg0 + ) + +;; definition for function debug-menu-item-submenu-msg +(defun debug-menu-item-submenu-msg ((arg0 debug-menu-item-submenu) (arg1 debug-menu-msg)) + (when (= arg1 (debug-menu-msg press)) + (let ((a0-1 (-> arg0 parent context))) + (debug-menu-context-open-submenu a0-1 (-> arg0 submenu)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-function-msg +(defun debug-menu-item-function-msg ((arg0 debug-menu-item-function) (arg1 debug-menu-msg)) + (cond + ((= arg1 (debug-menu-msg press)) + (cond + ((-> arg0 activate-func) + (if ((-> arg0 activate-func) (-> arg0 id)) + (set! (-> arg0 hilite-timer) 6) + (set! (-> arg0 hilite-timer) -6) + ) + ) + (else + (set! (-> arg0 hilite-timer) -6) + ) + ) + ) + ((= arg1 (debug-menu-msg deactivate)) + (set! (-> arg0 hilite-timer) 0) + 0 + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-flag-msg +(defun debug-menu-item-flag-msg ((arg0 debug-menu-item-flag) (arg1 debug-menu-msg)) + (cond + ((= arg1 (debug-menu-msg press)) + (if (-> arg0 activate-func) + (set! (-> arg0 is-on) ((-> arg0 activate-func) (-> arg0 id) (debug-menu-msg press))) + ) + (let ((a0-2 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-2 (debug-menu-msg update) (debug-menu-dest open-menus)) + ) + ) + ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) + (if (-> arg0 activate-func) + (set! (-> arg0 is-on) ((-> arg0 activate-func) (-> arg0 id) (debug-menu-msg update))) + ) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-var-joypad-handler +(defun debug-menu-item-var-joypad-handler ((arg0 debug-menu-item-var) (arg1 debug-menu-msg)) + (cond + ((zero? (logand (-> *cpad-list* cpads arg1 button0-abs 0) (pad-buttons x))) + (let ((a0-2 (-> arg0 parent context))) + (debug-menu-context-release-joypad a0-2) + ) + (set! (-> arg0 grabbed-joypad-p) #f) + (when (cpad-pressed? arg1 square) + (cond + ((-> arg0 float-p) + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 fundo-val) (-> arg0 fval)) + ) + ) + ) + (else + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (-> arg0 fundo-val) (-> arg0 fval)) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + ) + (let ((a0-7 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-7 (debug-menu-msg update) (debug-menu-dest open-menus)) + ) + ) + ((or (cpad-hold? arg1 right) (cpad-hold? arg1 left) (cpad-hold? arg1 down) (cpad-hold? arg1 up)) + (let ((v1-45 (cond + ((cpad-hold? arg1 right) + 10 + ) + ((cpad-hold? arg1 up) + 1 + ) + ((cpad-hold? arg1 down) + -1 + ) + (else + -10 + ) + ) + ) + ) + (when (!= v1-45 (-> arg0 inc-dir)) + (set! (-> arg0 inc-dir) v1-45) + (set! (-> arg0 inc-delay) 15) + (set! (-> arg0 inc-delay-ctr) 0) + (set! (-> arg0 step-delay-ctr) 30) + (set! (-> arg0 fstep) (-> arg0 fstart-inc)) + (set! (-> arg0 fstep) (-> arg0 fstart-inc)) + ) + ) + (cond + ((<= (-> arg0 inc-delay-ctr) 0) + (if (> (-> arg0 inc-delay) 0) + (+! (-> arg0 inc-delay) -1) + ) + (when (zero? (-> arg0 inc-delay)) + (cond + ((<= (-> arg0 step-delay-ctr) 0) + (set! (-> arg0 step-delay-ctr) 30) + (cond + ((-> arg0 float-p) + (if (< (-> arg0 fstep) 10000000.0) + (set! (-> arg0 fstep) (* 2.0 (-> arg0 fstep))) + ) + ) + (else + (if (< (the-as int (-> arg0 fstep)) #x989680) + (set! (-> arg0 fstep) (the-as float (* (-> arg0 fstep) 2))) + ) + ) + ) + ) + (else + (+! (-> arg0 step-delay-ctr) -1) + ) + ) + ) + (set! (-> arg0 inc-delay-ctr) (-> arg0 inc-delay)) + (cond + ((-> arg0 float-p) + (when (-> arg0 factivate-func) + (let ((f0-8 (+ (-> arg0 fval) (* (the float (-> arg0 inc-dir)) (-> arg0 fstep))))) + (if (-> arg0 range-p) + (set! f0-8 (fmin (fmax f0-8 (-> arg0 frange-min)) (-> arg0 frange-max))) + ) + (set! (-> arg0 fval) ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) f0-8 (-> arg0 fval))) + ) + ) + ) + (else + (when (-> arg0 factivate-func) + (let ((a2-4 (+ (the-as int (-> arg0 fval)) (* (-> arg0 inc-dir) (the-as int (-> arg0 fstep)))))) + (if (-> arg0 range-p) + (set! a2-4 (min (max a2-4 (the-as int (-> arg0 frange-min))) (the-as int (-> arg0 frange-max)))) + ) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg press) (the-as float a2-4) (-> arg0 fval)) + ) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + (let ((a0-29 (-> arg0 parent context))) + (debug-menu-context-send-msg a0-29 (debug-menu-msg update) (debug-menu-dest current-selection)) + ) + ) + (else + (+! (-> arg0 inc-delay-ctr) -1) + ) + ) + ) + (else + (set! (-> arg0 inc-dir) 0) + 0 + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-var-msg +(defun debug-menu-item-var-msg ((arg0 debug-menu-item-var) (arg1 debug-menu-msg)) + (cond + ((= arg1 (debug-menu-msg deactivate)) + (when (-> arg0 grabbed-joypad-p) + (let ((a0-1 (-> arg0 parent context))) + (debug-menu-context-release-joypad a0-1) + ) + (set! (-> arg0 grabbed-joypad-p) #f) + ) + ) + ((= arg1 (debug-menu-msg press)) + (when (not (-> arg0 grabbed-joypad-p)) + (let ((a0-2 (-> arg0 parent context))) + (when (debug-menu-context-grab-joypad a0-2 arg0 (the-as (function basic none) debug-menu-item-var-joypad-handler)) + (set! (-> arg0 grabbed-joypad-p) #t) + (set! (-> arg0 fundo-val) (-> arg0 fval)) + (set! (-> arg0 fundo-val) (-> arg0 fval)) + (set! (-> arg0 inc-dir) 0) + 0 + ) + ) + ) + ) + ((or (= arg1 (debug-menu-msg update)) (= arg1 (debug-menu-msg activate))) + (cond + ((-> arg0 float-p) + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)) + ) + ) + ) + (else + (if (-> arg0 factivate-func) + (set! (-> arg0 fval) + ((-> arg0 factivate-func) (-> arg0 id) (debug-menu-msg update) (-> arg0 fval) (-> arg0 fval)) + ) + ) + ) + ) + (debug-menu-item-var-update-display-str arg0) + (set! (-> arg0 refresh-ctr) (-> arg0 refresh-delay)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-item-send-msg +(defun debug-menu-item-send-msg ((arg0 debug-menu-item) (arg1 debug-menu-msg)) + (cond + ((= (-> arg0 type) debug-menu-item-submenu) + (debug-menu-item-submenu-msg (the-as debug-menu-item-submenu arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-function) + (debug-menu-item-function-msg (the-as debug-menu-item-function arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-flag) + (debug-menu-item-flag-msg (the-as debug-menu-item-flag arg0) arg1) + ) + ((= (-> arg0 type) debug-menu-item-var) + (debug-menu-item-var-msg (the-as debug-menu-item-var arg0) arg1) + ) + (else + (format 0 "ERROR: Found unknown item type!~%") + ) + ) + arg0 + ) + +;; definition for function debug-menu-send-msg +(defun debug-menu-send-msg ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 symbol)) + (let* ((s3-0 (-> arg0 items)) + (s2-0 (car s3-0)) + ) + (while (not (null? s3-0)) + (debug-menu-item-send-msg (the-as debug-menu-item s2-0) arg1) + (if (and arg2 (= (-> (the-as debug-menu-item s2-0) type) debug-menu-item-submenu)) + (debug-menu-send-msg (-> (the-as debug-menu-item-submenu s2-0) submenu) arg1 #t) + ) + (set! s3-0 (cdr s3-0)) + (set! s2-0 (car s3-0)) + ) + ) + arg0 + ) + +;; definition for function debug-menu-context-send-msg +(defun debug-menu-context-send-msg ((arg0 debug-menu-context) (arg1 debug-menu-msg) (arg2 debug-menu-dest)) + (cond + ((= arg2 (debug-menu-dest root)) + (debug-menu-send-msg (-> arg0 root-menu) arg1 #t) + ) + ((= arg2 (debug-menu-dest open-menus)) + (when (-> arg0 is-active) + (dotimes (s4-0 (-> arg0 sel-length)) + (let ((a0-2 (-> arg0 sel-menu s4-0))) + (debug-menu-send-msg a0-2 arg1 #f) + ) + ) + ) + ) + ((= arg2 (debug-menu-dest current-selection)) + (when (-> arg0 is-active) + (if (nonzero? (-> arg0 sel-length)) + (debug-menu-send-msg (-> arg0 sel-menu (+ (-> arg0 sel-length) -1)) arg1 #f) + ) + ) + ) + ((= arg2 (debug-menu-dest activation)) + (cond + ((= arg1 (debug-menu-msg activate)) + (when (not (-> arg0 is-active)) + (set! (-> arg0 is-active) #t) + (debug-menu-context-send-msg arg0 (debug-menu-msg activate) (debug-menu-dest open-menus)) + ) + ) + ((= arg1 (debug-menu-msg deactivate)) + (when (-> arg0 is-active) + (debug-menu-context-send-msg arg0 (debug-menu-msg deactivate) (debug-menu-dest open-menus)) + (set! (-> arg0 is-active) #f) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function debug-menu-context-activate-selection +(defun debug-menu-context-activate-selection ((arg0 debug-menu-context)) + (let ((a0-1 (-> arg0 sel-menu (+ (-> arg0 sel-length) -1) selected-item))) + (debug-menu-item-send-msg a0-1 (debug-menu-msg press)) + ) + arg0 + ) + +;; definition for function debug-menus-default-joypad-func +(defun debug-menus-default-joypad-func ((arg0 debug-menu-context)) + (cond + ((cpad-pressed? (-> arg0 joypad-number) square) + (cond + ((< 1 (-> arg0 sel-length)) + (debug-menu-context-close-submenu arg0) + ) + (else + ) + ) + ) + ((cpad-pressed? (-> arg0 joypad-number) x) + (debug-menu-context-activate-selection arg0) + ) + ((cpad-pressed? (-> arg0 joypad-number) up) + (debug-menu-context-select-new-item arg0 -1) + ) + ((cpad-pressed? (-> arg0 joypad-number) down) + (debug-menu-context-select-new-item arg0 1) + ) + ((cpad-pressed? (-> arg0 joypad-number) left) + (debug-menu-context-select-new-item arg0 -5) + ) + ((cpad-pressed? (-> arg0 joypad-number) right) + (debug-menu-context-select-new-item arg0 5) + ) + ) + arg0 + ) + +;; definition for function debug-menus-active +(defun debug-menus-active ((arg0 debug-menu-context)) + (when (not (-> arg0 is-hidden)) + (cond + ((-> arg0 joypad-func) + (let ((t9-0 (-> arg0 joypad-func)) + (a0-1 (-> arg0 joypad-item)) + ) + (-> arg0 joypad-number) + (t9-0 a0-1) + ) + ) + (else + (debug-menus-default-joypad-func arg0) + ) + ) + (debug-menu-context-render arg0) + ) + arg0 + ) + +;; definition for function debug-menus-handler +(defun debug-menus-handler ((arg0 debug-menu-context)) + (if (-> arg0 is-active) + (debug-menus-active arg0) + ) + arg0 + ) + +;; failed to figure out what this is: +0 + +) diff --git a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc index c70566d24b..a94e7777e3 100644 --- a/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc @@ -230,8 +230,8 @@ :size-assert #x34 :flag-assert #x1b00000034 (:methods - (entity-method-22 () none 22) - (entity-method-23 () none 23) + (entity-method-22 (_type_) _type_ 22) + (entity-method-23 (_type_) _type_ 23) (entity-method-24 () none 24) (entity-method-25 () none 25) (entity-method-26 () none 26) @@ -255,8 +255,8 @@ :size-assert #x38 :flag-assert #x1d00000038 (:methods - (entity-nav-mesh-method-27 () none 27) - (entity-nav-mesh-method-28 () none 28) + (entity-nav-mesh-method-27 (_type_) none 27) + (debug-draw (_type_) none 28) ) ) @@ -289,8 +289,8 @@ (prev-actor (_type_) entity-actor 28) (entity-actor-method-29 () none 29) (entity-actor-method-30 () none 30) - (entity-actor-method-31 () none 31) - (entity-actor-method-32 () none 32) + (entity-actor-method-31 (_type_ vector vector vector object float) nav-mesh 31) + (entity-actor-method-32 (_type_ vector vector nav-poly float) nav-poly 32) ) ) 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 72a300aecd..db57d9104d 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 @@ -222,102 +222,102 @@ ;; definition of type game-info (deftype game-info (basic) - ((mode symbol :offset-assert 4) - (save-name string :offset-assert 8) - (life float :offset-assert 12) - (life-max float :offset-assert 16) - (money float :offset-assert 20) - (money-total float :offset-assert 24) - (money-per-level uint8 32 :offset-assert 28) - (deaths-per-level uint8 32 :offset-assert 60) - (buzzer-total float :offset-assert 92) - (fuel float :offset-assert 96) - (gem float :offset-assert 100) - (gem-total float :offset-assert 104) - (skill float :offset-assert 108) - (skill-total float :offset-assert 112) - (karma float :offset-assert 116) - (eco-pill-dark float :offset-assert 120) - (eco-pill-dark-total float :offset-assert 124) - (features game-feature :offset-assert 128) - (debug-features game-feature :offset-assert 136) - (secrets game-secrets :offset-assert 144) - (unknown-pad1 uint32 :offset-assert 148) - (purchase-secrets uint32 :offset-assert 152) - (unknown-pad2 uint32 :offset-assert 156) - (gun-type int32 :offset-assert 160) - (gun-ammo float 4 :offset-assert 164) - (shield float :offset-assert 180) - (score float :offset-assert 184) - (score-owner uint64 :offset-assert 192) - (timer uint64 :offset-assert 200) - (timer-owner uint64 :offset-assert 208) - (timer-flash basic :offset-assert 216) - (counter float :offset-assert 220) - (counter-flash basic :offset-assert 224) - (attack-id uint32 :offset-assert 228) - (perm-list entity-perm-array :offset-assert 232) - (task-perm-list entity-perm-array :offset-assert 236) - (current-continue continue-point :offset-assert 240) - (last-continue continue-point :offset-assert 244) - (unknown-pad3 array :offset-assert 248) - (unknown-pad4 array :offset-assert 252) - (unknown-pad5 array :offset-assert 256) - (task-counter uint32 :offset-assert 260) - (unknown-pad6 uint32 :offset-assert 264) - (level-opened uint8 32 :offset-assert 268) - (total-deaths int32 :offset-assert 300) - (continue-deaths int32 :offset-assert 304) - (task-deaths int32 :offset-assert 308) - (total-trys int32 :offset-assert 312) - (game-start-time time-frame :offset-assert 320) - (continue-time time-frame :offset-assert 328) - (death-time time-frame :offset-assert 336) - (hit-time time-frame :offset-assert 344) - (task-pickup-time time-frame :offset-assert 352) - (unknown-array1 (array uint64) :offset-assert 360) - (unknown-array2 (array uint64) :offset-assert 364) - (unknown-array3 (array uint64) :offset-assert 368) - (death-pos vector-array :offset 372) - (stop-watch-start uint64 :offset-assert 376) - (stop-watch-stop uint64 :offset-assert 384) - (blackout-time time-frame :offset-assert 392) - (letterbox-time time-frame :offset-assert 400) - (hint-play-time time-frame :offset-assert 408) - (display-text-time time-frame :offset-assert 416) - (display-text-handle uint64 :offset-assert 424) - (death-movie-tick int32 :offset-assert 432) - (want-auto-save symbol :offset-assert 436) - (auto-save-proc handle :offset-assert 440) - (auto-save-status mc-status-code :offset-assert 448) - (auto-save-card int32 :offset-assert 452) - (auto-save-which int32 :offset-assert 456) - (auto-save-count int32 :offset-assert 460) - (pov-camera-handle uint64 :offset-assert 464) - (other-camera-handle uint64 :offset-assert 472) - (controller uint64 2 :offset-assert 480) - (race-timer uint64 :offset-assert 496) - (race-current-lap-count int32 :offset-assert 504) - (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) - (demo-state uint32 :offset-assert 532) - (wanted-flash basic :offset-assert 536) - (distance float :offset-assert 540) - (kiosk-timeout uint64 :offset-assert 544) - (pause-start-time time-frame :offset-assert 552) - (game-score (array highscore-info) :offset-assert 560) - (goal float :offset-assert 564) - (miss float :offset-assert 568) - (miss-max float :offset-assert 572) - (unknown-array4 (array uint64) :offset-assert 576) - (live-eco-pill-count int32 :offset-assert 580) - (live-gem-count int32 :offset-assert 584) - (air-supply float :offset-assert 588) - (homing-beacon int32 :offset-assert 592) - (dark-eco-pickup int32 :offset-assert 596) - (green-eco-pickup int32 :offset-assert 600) + ((mode symbol :offset-assert 4) + (save-name string :offset-assert 8) + (life float :offset-assert 12) + (life-max float :offset-assert 16) + (money float :offset-assert 20) + (money-total float :offset-assert 24) + (money-per-level uint8 32 :offset-assert 28) + (deaths-per-level uint8 32 :offset-assert 60) + (buzzer-total float :offset-assert 92) + (fuel float :offset-assert 96) + (gem float :offset-assert 100) + (gem-total float :offset-assert 104) + (skill float :offset-assert 108) + (skill-total float :offset-assert 112) + (karma float :offset-assert 116) + (eco-pill-dark float :offset-assert 120) + (eco-pill-dark-total float :offset-assert 124) + (features game-feature :offset-assert 128) + (debug-features game-feature :offset-assert 136) + (secrets game-secrets :offset-assert 144) + (unknown-pad1 uint32 :offset-assert 148) + (purchase-secrets uint32 :offset-assert 152) + (unknown-pad2 uint32 :offset-assert 156) + (gun-type int32 :offset-assert 160) + (gun-ammo float 4 :offset-assert 164) + (shield float :offset-assert 180) + (score float :offset-assert 184) + (score-owner uint64 :offset-assert 192) + (timer uint64 :offset-assert 200) + (timer-owner uint64 :offset-assert 208) + (timer-flash basic :offset-assert 216) + (counter float :offset-assert 220) + (counter-flash basic :offset-assert 224) + (attack-id uint32 :offset-assert 228) + (perm-list entity-perm-array :offset-assert 232) + (task-perm-list entity-perm-array :offset-assert 236) + (current-continue continue-point :offset-assert 240) + (last-continue continue-point :offset-assert 244) + (play-list (array game-task-info) :offset-assert 248) + (sub-task-list (array game-task-node-info) :offset-assert 252) + (unknown-pad5 array :offset-assert 256) + (task-counter uint32 :offset-assert 260) + (unknown-pad6 uint32 :offset-assert 264) + (level-opened uint8 32 :offset-assert 268) + (total-deaths int32 :offset-assert 300) + (continue-deaths int32 :offset-assert 304) + (task-deaths int32 :offset-assert 308) + (total-trys int32 :offset-assert 312) + (game-start-time time-frame :offset-assert 320) + (continue-time time-frame :offset-assert 328) + (death-time time-frame :offset-assert 336) + (hit-time time-frame :offset-assert 344) + (task-pickup-time time-frame :offset-assert 352) + (unknown-array1 (array uint64) :offset-assert 360) + (unknown-array2 (array uint64) :offset-assert 364) + (unknown-array3 (array uint64) :offset-assert 368) + (death-pos vector-array :offset 372) + (stop-watch-start uint64 :offset-assert 376) + (stop-watch-stop uint64 :offset-assert 384) + (blackout-time time-frame :offset-assert 392) + (letterbox-time time-frame :offset-assert 400) + (hint-play-time time-frame :offset-assert 408) + (display-text-time time-frame :offset-assert 416) + (display-text-handle uint64 :offset-assert 424) + (death-movie-tick int32 :offset-assert 432) + (want-auto-save symbol :offset-assert 436) + (auto-save-proc handle :offset-assert 440) + (auto-save-status mc-status-code :offset-assert 448) + (auto-save-card int32 :offset-assert 452) + (auto-save-which int32 :offset-assert 456) + (auto-save-count int32 :offset-assert 460) + (pov-camera-handle uint64 :offset-assert 464) + (other-camera-handle uint64 :offset-assert 472) + (controller uint64 2 :offset-assert 480) + (race-timer uint64 :offset-assert 496) + (race-current-lap-count int32 :offset-assert 504) + (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) + (demo-state uint32 :offset-assert 532) + (wanted-flash basic :offset-assert 536) + (distance float :offset-assert 540) + (kiosk-timeout uint64 :offset-assert 544) + (pause-start-time time-frame :offset-assert 552) + (game-score (array highscore-info) :offset-assert 560) + (goal float :offset-assert 564) + (miss float :offset-assert 568) + (miss-max float :offset-assert 572) + (unknown-array4 (array uint64) :offset-assert 576) + (live-eco-pill-count int32 :offset-assert 580) + (live-gem-count int32 :offset-assert 584) + (air-supply float :offset-assert 588) + (homing-beacon int32 :offset-assert 592) + (dark-eco-pickup int32 :offset-assert 596) + (green-eco-pickup int32 :offset-assert 600) ) :method-count-assert 31 :size-assert #x25c diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc index a4d102ba2c..0608929095 100644 --- a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc @@ -1052,10 +1052,10 @@ (local-vars (v0-0 uint) (f3-1 float) (f4-5 float) (f5-5 float) (f5-15 float) (f6-0 float) (f8-1 float)) (let ((f3-0 (-> arg0 x)) (f4-0 (-> arg0 z)) - (f5-0 (-> arg0 w)) + (f5-0 (-> arg0 r)) (f1-0 (-> arg1 x)) (f0-0 (-> arg1 z)) - (f2-0 (-> arg1 w)) + (f2-0 (-> arg1 r)) (v1-0 0.5) ) (.mula.s f5-0 f5-0) @@ -1248,8 +1248,18 @@ (s5-0 (new-stack-vector0)) (gp-0 (new-stack-vector0)) ) - (set-vector! s4-0 0.0 0.0 0.0 1.0) - (set-vector! a1-2 100.0 0.0 0.0 10000.0) + (let ((v1-3 s4-0)) + (set! (-> v1-3 x) 0.0) + (set! (-> v1-3 y) 0.0) + (set! (-> v1-3 z) 0.0) + (set! (-> v1-3 r) 1.0) + ) + (let ((v1-4 a1-2)) + (set! (-> v1-4 x) 100.0) + (set! (-> v1-4 y) 0.0) + (set! (-> v1-4 z) 0.0) + (set! (-> v1-4 r) 10000.0) + ) (let ((a2-1 (circle-circle-xz-intersect s4-0 a1-2 s5-0 gp-0))) (format #t "res = ~d~%" a2-1) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc index 05d399d8be..c60f386d13 100644 --- a/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/geometry/vol-h_REF.gc @@ -16,9 +16,9 @@ :size-assert #x18 :flag-assert #xc00000018 (:methods - (plane-volume-method-9 () none 9) - (plane-volume-method-10 () none 10) - (plane-volume-method-11 () none 11) + (plane-volume-method-9 (_type_ symbol vector-array vector-array) plane-volume 9) + (debug-draw (_type_) none 10) + (point-in-vol? (_type_ vector float) symbol 11) ) ) @@ -56,8 +56,8 @@ :flag-assert #xc0000061c (:methods (new (symbol type process-drawable) _type_ 0) - (vol-control-method-9 (_type_) symbol 9) - (vol-control-method-10 (_type_ vector) symbol 10) + (vol-control-method-9 (_type_) none 9) + (vol-control-method-10 (_type_ plane) symbol 10) (should-display? (_type_) symbol 11) ) ) diff --git a/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc b/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc new file mode 100644 index 0000000000..f5e0c99ba3 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/vol_REF.gc @@ -0,0 +1,355 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function plane-volume-intersect-dist +(defun plane-volume-intersect-dist ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((f0-1 (vector-dot arg1 arg0)) + (f1-1 (vector-dot arg2 arg0)) + ) + (if (< 0.00001 (fabs f1-1)) + (/ (- (-> arg0 w) f0-1) f1-1) + 409600000.0 + ) + ) + ) + +;; definition for method 9 of type plane-volume +;; INFO: Used lq/sq +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +;; WARN: Stack slot offset 148 signed mismatch +(defmethod plane-volume-method-9 plane-volume ((obj plane-volume) (arg0 symbol) (arg1 vector-array) (arg2 vector-array)) + (local-vars + (sv-144 vector) + (sv-148 number) + (sv-152 int) + (sv-160 vector) + (sv-176 vector) + (sv-192 vector) + (sv-208 vector) + (sv-224 vector) + (sv-240 int) + (sv-256 int) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (set! (-> obj volume-type) arg0) + (set! (-> obj point-count) 0) + (set! (-> obj first-point) (the-as (pointer vector) (-> arg1 data (-> arg1 length)))) + (set! (-> obj normal-count) 0) + (set! (-> obj first-normal) (the-as (pointer vector) (-> arg2 data (-> arg2 length)))) + (dotimes (s3-0 (-> obj num-planes)) + (set! sv-176 (new 'stack-no-clear 'vector)) + (set! (-> sv-176 quad) (the-as uint128 0)) + (set! sv-192 (new 'stack-no-clear 'vector)) + (set! (-> sv-192 quad) (the-as uint128 0)) + (set! sv-208 (new 'stack-no-clear 'vector)) + (set! (-> sv-208 quad) (the-as uint128 0)) + (set! sv-224 (new 'stack-no-clear 'vector)) + (set! (-> sv-224 quad) (the-as uint128 0)) + 0.0 + 0.0 + 0.0 + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((s1-0 (new-stack-vector0)) + (s0-0 0) + (s2-0 (-> obj plane)) + ) + (set! sv-240 0) + (while (< sv-240 (-> obj num-planes)) + (when (!= s3-0 sv-240) + (vector-float*! sv-176 (the-as vector (-> s2-0 sv-240)) (-> s2-0 sv-240 w)) + (vector-cross! sv-192 (the-as vector (-> s2-0 sv-240)) (the-as vector (-> s2-0 s3-0))) + (vector-normalize! sv-192 1.0) + (vector-cross! sv-208 sv-192 (the-as vector (-> s2-0 sv-240))) + (vector-normalize! sv-208 1.0) + (let ((f0-4 (plane-volume-intersect-dist (-> s2-0 s3-0) sv-176 sv-208))) + (when (!= f0-4 409600000.0) + (let ((v1-28 sv-224)) + (let ((a0-12 sv-176)) + (.lvf vf2 (&-> sv-208 quad)) + (.lvf vf1 (&-> a0-12 quad)) + ) + (let ((a0-13 f0-4)) + (.mov vf3 a0-13) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-28 quad) vf4) + ) + (set! sv-144 (new-stack-vector0)) + (set! sv-148 0.0) + (set! sv-152 0) + (set! sv-160 (new-stack-vector0)) + (set! (-> sv-144 quad) (-> sv-224 quad)) + (set! sv-256 0) + (while (< sv-256 (-> obj num-planes)) + (when (and (!= sv-256 s3-0) (!= sv-256 sv-240)) + (let ((f0-6 (plane-volume-intersect-dist (-> s2-0 sv-256) sv-144 sv-192))) + (cond + ((= f0-6 409600000.0) + ) + ((zero? sv-152) + (let ((v1-42 sv-144)) + (let ((a0-19 sv-144)) + (.lvf vf2 (&-> sv-192 quad)) + (.lvf vf1 (&-> a0-19 quad)) + ) + (let ((a0-20 f0-6)) + (.mov vf3 a0-20) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-42 quad) vf4) + ) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-148 8192000.0) + (set! sv-152 1) + ) + ((begin (vector-float*! sv-224 sv-192 f0-6) (>= (vector-dot sv-224 sv-160) 0.0)) + ) + ((>= (vector-dot sv-224 (the-as vector (-> s2-0 sv-256))) 0.0) + (when (< (fabs f0-6) (fabs (the-as float sv-148))) + (set! sv-148 f0-6) + (set! sv-152 (+ sv-152 1)) + ) + ) + (else + (let ((v1-59 sv-144)) + (let ((a0-28 sv-144) + (a1-15 sv-192) + (f1-8 f0-6) + ) + (.lvf vf2 (&-> a1-15 quad)) + (.lvf vf1 (&-> a0-28 quad)) + (let ((a0-29 f1-8)) + (.mov vf3 a0-29) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-59 quad) vf4) + ) + (set! (-> sv-160 quad) (-> s2-0 sv-256 quad)) + (set! sv-152 (+ sv-152 1)) + (if (< (fabs f0-6) (fabs (the-as float sv-148))) + (set! sv-148 (- (the-as float sv-148) f0-6)) + (set! sv-148 0.0) + ) + ) + ) + ) + ) + (set! sv-256 (+ sv-256 1)) + ) + (cond + ((zero? sv-152) + ) + ((= (the-as float sv-148) 0.0) + ) + (else + (dotimes (v1-76 (-> obj num-planes)) + (when (and (!= v1-76 s3-0) (!= v1-76 sv-240)) + (if (< 4096.0 (- (vector-dot sv-144 (the-as vector (-> s2-0 v1-76))) (-> s2-0 v1-76 w))) + (goto cfg-42) + ) + ) + ) + (let ((v1-80 sv-224)) + (let ((a0-46 sv-144) + (a1-18 sv-192) + (f0-12 sv-148) + ) + (.lvf vf2 (&-> a1-18 quad)) + (.lvf vf1 (&-> a0-46 quad)) + (let ((a0-47 (the-as float f0-12))) + (.mov vf3 a0-47) + ) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf2 vf3) + (.add.mul.w.vf vf4 vf1 vf0 acc :mask #b111) + (.svf (&-> v1-80 quad) vf4) + ) + (cond + ((< (-> arg1 allocated-length) (+ (-> arg1 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume points~%" obj) + ) + (else + (set! (-> arg1 data (-> arg1 length) quad) (-> sv-144 quad)) + (set! (-> arg1 data (+ (-> arg1 length) 1) quad) (-> sv-224 quad)) + (+! (-> arg1 length) 2) + (+! (-> obj point-count) 2) + ) + ) + (vector+! s1-0 s1-0 sv-144) + (vector+! s1-0 s1-0 sv-224) + (+! s0-0 2) + ) + ) + ) + ) + ) + (label cfg-42) + (set! sv-240 (+ sv-240 1)) + ) + (when (nonzero? s0-0) + (vector-float*! s1-0 s1-0 (/ 1.0 (the float s0-0))) + (cond + ((< (-> arg2 allocated-length) (+ (-> arg2 length) 2)) + (format 0 "ERROR : vol-control #x~X out of volume normals~%" obj) + ) + (else + (set! (-> arg2 data (-> arg2 length) quad) (-> s1-0 quad)) + (set! (-> arg2 data (+ (-> arg2 length) 1) quad) (-> s2-0 s3-0 quad)) + (+! (-> arg2 length) 2) + (set! (-> obj normal-count) (+ (-> obj normal-count) 2)) + ) + ) + ) + ) + ) + obj + ) + ) + +;; definition for method 10 of type plane-volume +;; WARN: Return type mismatch int vs none. +(defmethod debug-draw plane-volume ((obj plane-volume)) + (let* ((v1-0 (-> obj volume-type)) + (s5-0 (cond + ((= v1-0 'vol) + (the-as uint #x8000c000) + ) + ((= v1-0 'pvol) + (the-as uint #x80808080) + ) + (else + (the-as uint #x800000c0) + ) + ) + ) + (s4-0 (-> obj first-point)) + ) + (dotimes (s3-0 (/ (-> obj point-count) 2)) + (add-debug-line + #t + (bucket-id bucket-318) + (the-as vector s4-0) + (the-as vector (&-> s4-0 4)) + (the-as rgba s5-0) + #f + (the-as rgba -1) + ) + (set! s4-0 (&-> s4-0 8)) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type plane-volume +(defmethod point-in-vol? plane-volume ((obj plane-volume) (arg0 vector) (arg1 float)) + "TODO - Checks if the given [[vector]] point is inside the volume defined by 6 [[plane]]s by atleast the padding value provided" + (dotimes (v1-0 (-> obj num-planes)) + (if (< arg1 (- (vector-dot arg0 (the-as vector (-> obj plane v1-0))) (-> obj plane v1-0 w))) + (return #f) + ) + ) + #t + ) + +;; definition for method 9 of type vol-control +;; WARN: Return type mismatch int vs none. +(defmethod vol-control-method-9 vol-control ((obj vol-control)) + (with-pp + (let ((a0-1 obj)) + (when (and (and *display-vol-marks* (logtest? (-> a0-1 flags) (vol-flags display?))) + (logtest? (-> obj flags) (vol-flags vol-flags-1)) + ) + (when (zero? (-> obj debug-point)) + (let ((s5-0 pp)) + (set! pp (-> obj process)) + (let ((s4-0 0)) + (dotimes (v1-8 (-> obj pos-vol-count)) + (+! s4-0 (-> obj pos-vol v1-8 num-planes)) + ) + (dotimes (v1-11 (-> obj neg-vol-count)) + (+! s4-0 (-> obj neg-vol v1-11 num-planes)) + ) + (set! (-> obj debug-point) (new 'debug 'vector-array (* 10 s4-0))) + (set! (-> obj debug-normal) (new 'debug 'vector-array (* 10 s4-0))) + ) + (set! pp s5-0) + ) + (set! (-> obj debug-point length) 0) + (set! (-> obj debug-normal length) 0) + (dotimes (s5-1 (-> obj pos-vol-count)) + (plane-volume-method-9 (-> obj pos-vol s5-1) 'vol (-> obj debug-point) (-> obj debug-normal)) + ) + (dotimes (s5-2 (-> obj neg-vol-count)) + (plane-volume-method-9 (-> obj neg-vol s5-2) 'vol (-> obj debug-point) (-> obj debug-normal)) + ) + ) + (dotimes (s5-3 (-> obj pos-vol-count)) + (debug-draw (-> obj pos-vol s5-3)) + ) + (dotimes (s5-4 (-> obj neg-vol-count)) + (debug-draw (-> obj neg-vol s5-4)) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 10 of type vol-control +(defmethod vol-control-method-10 vol-control ((obj vol-control) (arg0 plane)) + (dotimes (s4-0 (-> obj neg-vol-count)) + (if (point-in-vol? (-> obj neg-vol s4-0) arg0 0.0) + (return #f) + ) + ) + (dotimes (s4-1 (-> obj pos-vol-count)) + (if (point-in-vol? (-> obj pos-vol s4-1) arg0 0.0) + (return #t) + ) + ) + #f + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc index f823a7cbd3..a47feaed7e 100644 --- a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc @@ -69,9 +69,17 @@ ) ;; definition for symbol *font-context*, type font-context -(define *font-context* - (new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) - ) +(define *font-context* (new + 'global + 'font-context + *font-default-matrix* + 0 + 0 + 0.0 + (font-color default-#cddbcd) + (font-flags shadow kerning) + ) + ) ;; definition for function draw-sprite2d-xy ;; WARN: Return type mismatch pointer vs none. diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc index 884ed5363c..fbb8e7ba25 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs2_REF.gc @@ -238,7 +238,12 @@ (let ((a0-10 (new 'stack-no-clear 'sphere)) (a1-4 (-> *math-camera* trans)) ) - (set-vector! a0-10 4898816.0 32768.0 245760.0 1.0) + (let ((v1-6 a0-10)) + (set! (-> v1-6 x) 4898816.0) + (set! (-> v1-6 y) 32768.0) + (set! (-> v1-6 z) 245760.0) + (set! (-> v1-6 r) 1.0) + ) (let ((f0-5 (get-sphere-interp a0-10 a1-4 61440.0 69632.0))) (set-vector! (-> arg0 times 0) 1.0 1.0 1.0 1.0) (vector-lerp! @@ -804,7 +809,12 @@ (let ((a0-121 (new 'stack-no-clear 'sphere)) (a1-40 (-> *math-camera* trans)) ) - (set-vector! a0-121 -364544.0 0.0 5324800.0 1.0) + (let ((v1-67 a0-121)) + (set! (-> v1-67 x) -364544.0) + (set! (-> v1-67 y) 0.0) + (set! (-> v1-67 z) 5324800.0) + (set! (-> v1-67 r) 1.0) + ) (let ((f0-76 (get-sphere-interp a0-121 a1-40 139264.0 24576.0))) (vector-lerp! (the-as vector (-> arg0 times)) diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc index e4c2751a20..b179f8b49b 100644 --- a/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-funcs_REF.gc @@ -747,7 +747,12 @@ (let ((a0-9 (new 'stack-no-clear 'sphere)) (a1-3 (-> *math-camera* trans)) ) - (set-vector! a0-9 786432.0 1818624.0 2498560.0 1.0) + (let ((v1-12 a0-9)) + (set! (-> v1-12 x) 786432.0) + (set! (-> v1-12 y) 1818624.0) + (set! (-> v1-12 z) 2498560.0) + (set! (-> v1-12 r) 1.0) + ) (let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0)))) (update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0) ) 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 6746f823d5..7e033d6ce5 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 @@ -1263,7 +1263,7 @@ ;; definition for method 10 of type sparticle-launch-control (defmethod sparticle-launch-control-method-10 sparticle-launch-control ((obj sparticle-launch-control) (arg0 vector)) (let* ((v1-0 (-> obj group)) - (f0-0 (-> v1-0 bounds w)) + (f0-0 (-> v1-0 bounds r)) ) (cond ((= f0-0 0.0) diff --git a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc index ae7a0f7bda..7e4f0d236d 100644 --- a/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -839,9 +839,9 @@ (format #t "~1Tx: ~f~%" (-> obj x)) (format #t "~1Ty: ~f~%" (-> obj y)) (format #t "~1Tz: ~f~%" (-> obj z)) - (format #t "~1Tw: ~f~%" (-> obj w)) + (format #t "~1Tw: ~f~%" (-> obj r)) (format #t "~1Tquad: ~D~%" (-> obj quad)) - (format #t "~1Tr: ~f~%" (-> obj w)) + (format #t "~1Tr: ~f~%" (-> obj r)) (label cfg-4) obj ) diff --git a/test/decompiler/reference/jak2/engine/math/vector_REF.gc b/test/decompiler/reference/jak2/engine/math/vector_REF.gc index c3755cc110..c42a6050cc 100644 --- a/test/decompiler/reference/jak2/engine/math/vector_REF.gc +++ b/test/decompiler/reference/jak2/engine/math/vector_REF.gc @@ -1583,9 +1583,9 @@ ;; definition for function sphere<-vector! ;; INFO: Used lq/sq (defun sphere<-vector! ((arg0 sphere) (arg1 vector)) - (let ((f0-0 (-> arg0 w))) + (let ((f0-0 (-> arg0 r))) (set! (-> arg0 quad) (-> arg1 quad)) - (set! (-> arg0 w) f0-0) + (set! (-> arg0 r) f0-0) ) arg0 ) @@ -1594,7 +1594,7 @@ ;; INFO: Used lq/sq (defun sphere<-vector+r! ((arg0 sphere) (arg1 vector) (arg2 float)) (set! (-> arg0 quad) (-> arg1 quad)) - (set! (-> arg0 w) arg2) + (set! (-> arg0 r) arg2) arg0 ) diff --git a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc index 0c57915d4e..51a8e44a15 100644 --- a/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc @@ -266,7 +266,7 @@ (callback-info nav-callback-info :offset-assert 4) (process process :offset-assert 8) (pad0 uint32 :offset-assert 12) - (shape basic :offset-assert 16) + (shape collide-shape :offset-assert 16) (nearest-y-threshold meters :offset-assert 20) (nav-cull-radius meters :offset-assert 24) (sec-per-frame float :offset-assert 28) @@ -281,8 +281,8 @@ (sphere-mask uint8 :offset-assert 61) (pad1 uint8 2 :offset-assert 62) (sphere-id-array uint8 16 :offset-assert 64) - (extra-nav-sphere vector :inline :offset-assert 80) - (root-nav-sphere vector :inline :offset-assert 96) + (extra-nav-sphere sphere :inline :offset-assert 80) + (root-nav-sphere sphere :inline :offset-assert 96) (state nav-state :inline :offset-assert 112) ) :method-count-assert 47 @@ -290,43 +290,43 @@ :flag-assert #x2f00000120 (:methods (nav-control-method-9 () none 9) - (nav-control-method-10 () none 10) + (point-in-bounds? (_type_ vector) symbol 10) (nav-control-method-11 (_type_ vector) vector 11) (nav-control-method-12 () none 12) - (nav-control-method-13 () none 13) - (nav-control-method-14 () none 14) - (nav-control-method-15 () none 15) - (nav-control-method-16 () none 16) - (nav-control-method-17 () none 17) + (find-poly (_type_ vector) nav-poly 13) + (nav-control-method-14 (_type_ nav-poly vector object vector) none 14) + (nav-control-method-15 (_type_ vector) none 15) + (nav-control-method-16 (_type_ vector float) symbol 16) + (is-in-mesh? (_type_ vector float) symbol 17) (nav-control-method-18 () none 18) (nav-control-method-19 () none 19) (nav-control-method-20 (_type_ vector vector vector int symbol symbol) none 20) (nav-control-method-21 () none 21) (nav-control-method-22 () none 22) - (nav-control-method-23 () none 23) + (nav-control-method-23 (_type_) none 23) (nav-control-method-24 () none 24) - (nav-control-method-25 () none 25) - (nav-control-method-26 () none 26) - (nav-control-method-27 () none 27) - (nav-control-method-28 () none 28) - (nav-control-method-29 () none 29) - (nav-control-method-30 () none 30) - (nav-control-method-31 () none 31) - (nav-control-method-32 () none 32) - (nav-control-method-33 () none 33) - (nav-control-method-34 () none 34) - (nav-control-method-35 () none 35) - (nav-control-method-36 () none 36) - (nav-control-method-37 () none 37) - (nav-control-method-38 () none 38) - (nav-control-method-39 () none 39) - (nav-control-method-40 () none 40) - (nav-control-method-41 () none 41) - (nav-control-method-42 () none 42) - (nav-control-method-43 () none 43) + (get-max-rotation-rate (_type_) float 25) + (get-sphere-mask (_type_) none 26) + (get-target-speed (_type_) meters 27) + (nav-control-method-28 (_type_) none 28) + (nav-control-method-29 (_type_) none 29) + (copy-extra-nav-sphere! (_type_ sphere) none 30) + (set-extra-nav-sphere! (_type_ sphere) none 31) + (set-extra-nav-sphere-radius! (_type_ float) none 32) + (set-nearest-y-thres! (_type_ float) none 33) + (set-nav-cull-radius! (_type_ meters) none 34) + (set-speed-scale! (_type_ float) none 35) + (set-target-speed! (_type_ meters) none 36) + (set-acceleration! (_type_ meters) none 37) + (set-turning-acceleration! (_type_ meters) none 38) + (set-max-rotation-rate! (_type_ float) none 39) + (set-sphere-mask! (_type_ uint) none 40) + (nav-control-method-41 (_type_) none 41) + (init! (_type_ collide-shape) none 42) + (display-marks? (_type_) symbol 43) (nav-control-method-44 () none 44) - (nav-control-method-45 () none 45) - (nav-control-method-46 () none 46) + (nav-control-method-45 (_type_ vector vector vector) sphere 45) + (find-sphere (_type_) none 46) ) ) 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 324876feb0..d81d50f721 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 @@ -61,10 +61,10 @@ (work-struct-in-scratch int8 :offset-assert 292) (mesh-struct-in-scratch int8 :offset-assert 293) (polys-in-scratch int8 :offset-assert 294) - (mesh basic :offset-assert 296) + (mesh nav-mesh :offset-assert 296) (nav basic :offset-assert 300) - (poly0 basic :offset-assert 304) - (poly1 basic :offset-assert 308) + (poly0 nav-poly :offset-assert 304) + (poly1 nav-poly :offset-assert 308) (poly-id int32 :offset-assert 312) ) :method-count-assert 9 @@ -166,9 +166,9 @@ (goto cfg-4) ) (format #t "[~8x] ~A~%" obj 'nav-poly) - (format #t "~1Tdata[64] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tvertex[4] @ #x~X~%" (-> obj vertex)) - (format #t "~1Tvertex0: ~`vector`P~%" (-> obj vertex)) + (format #t "~1Tdata[64] @ #x~X~%" (-> obj vertex0)) + (format #t "~1Tvertex[4] @ #x~X~%" (-> obj vertex0)) + (format #t "~1Tvertex0: ~`vector`P~%" (-> obj vertex0)) (format #t "~1Tvertex1: ~`vector`P~%" (-> obj vertex1)) (format #t "~1Tvertex2: ~`vector`P~%" (-> obj vertex2)) (format #t "~1Tvertex3: ~`vector`P~%" (-> obj vertex3)) @@ -189,6 +189,8 @@ ;; definition of type nav-vertex (deftype nav-vertex (vector) + "A typedef for `vector`, not used because our code looks nicer if everything is `vector`s anyway + and declared out of order (cannot use forward declared structures in inline arrays)" () :method-count-assert 9 :size-assert #x10 @@ -380,73 +382,73 @@ ;; definition of type nav-mesh (deftype nav-mesh (basic) - ((work nav-mesh-work :offset-assert 4) - (poly-array (inline-array nav-poly) :offset-assert 8) - (static-sphere-count uint8 :offset-assert 12) - (poly-count uint8 :offset-assert 13) - (nav-control-count uint8 :offset-assert 14) - (max-nav-control-count uint8 :offset-assert 15) - (route uint32 :offset-assert 16) - (poly-hash basic :offset-assert 20) - (nav-control-array uint32 :offset-assert 24) - (sphere-hash basic :offset-assert 28) - (static-sphere uint32 :offset-assert 32) - (user-list basic :offset-assert 36) - (next-nav-mesh basic :offset-assert 40) - (prev-nav-mesh basic :offset-assert 44) - (bounds sphere :inline :offset-assert 48) - (origin vector :inline :offset 48) - (entity entity :offset-assert 64) - (link-array uint32 :offset-assert 68) - (link-count uint8 :offset-assert 72) - (flags nav-mesh-flag :offset-assert 73) - (pad1 uint8 2 :offset-assert 74) - (nearest-y-threshold meters :offset-assert 76) - (water-max-height meters :offset-assert 80) - (pad2 uint32 7 :offset-assert 84) + ((work nav-mesh-work :offset-assert 4) + (poly-array (inline-array nav-poly) :offset-assert 8) + (static-sphere-count uint8 :offset-assert 12) + (poly-count uint8 :offset-assert 13) + (nav-control-count uint8 :offset-assert 14) + (max-nav-control-count uint8 :offset-assert 15) + (route uint32 :offset-assert 16) + (poly-hash grid-hash :offset-assert 20) + (nav-control-array (inline-array nav-control) :offset-assert 24) + (sphere-hash sphere-hash :offset-assert 28) + (static-sphere (inline-array sphere) :offset-assert 32) + (user-list engine :offset-assert 36) + (next-nav-mesh surface :offset-assert 40) + (prev-nav-mesh surface :offset-assert 44) + (bounds sphere :inline :offset-assert 48) + (origin vector :inline :offset 48) + (entity entity :offset-assert 64) + (link-array (array nav-mesh-link) :offset-assert 68) + (link-count uint8 :offset-assert 72) + (flags nav-mesh-flag :offset-assert 73) + (pad1 uint8 2 :offset-assert 74) + (nearest-y-threshold meters :offset-assert 76) + (water-max-height meters :offset-assert 80) + (pad2 uint32 7 :offset-assert 84) ) :method-count-assert 47 :size-assert #x70 :flag-assert #x2f00000070 (:methods - (nav-mesh-method-9 () none 9) - (nav-mesh-method-10 () none 10) - (nav-mesh-method-11 () none 11) - (nav-mesh-method-12 () none 12) - (nav-mesh-method-13 () none 13) - (nav-mesh-method-14 () none 14) - (nav-mesh-method-15 () none 15) + (nav-mesh-method-9 (_type_) none 9) + (nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly 10) + (nav-mesh-method-11 (_type_ nav-poly vector) vector 11) + (nav-mesh-method-12 (_type_ nav-poly vector) none 12) + (nav-mesh-method-13 (_type_ symbol symbol) none 13) + (get-route-portal (_type_ object object nav-find-poly-parms) none 14) + (initialize-mesh! (_type_) none 15) (move-along-nav-ray! (_type_ nav-ray) none 16) - (nav-mesh-method-17 () none 17) + (try-move-along-ray (_type_ nav-poly vector vector float) meters 17) (nav-mesh-method-18 () none 18) (nav-mesh-method-19 () none 19) (nav-mesh-method-20 () none 20) (nav-mesh-method-21 () none 21) - (nav-mesh-method-22 () none 22) - (nav-mesh-method-23 () none 23) - (nav-mesh-method-24 () none 24) - (nav-mesh-method-25 () none 25) - (nav-mesh-method-26 () none 26) - (nav-mesh-method-27 () none 27) - (nav-mesh-method-28 () none 28) - (nav-mesh-method-29 () none 29) - (nav-mesh-method-30 () none 30) - (nav-mesh-method-31 () none 31) - (nav-mesh-method-32 () none 32) - (nav-mesh-method-33 () none 33) - (nav-mesh-method-34 () none 34) + (nav-mesh-method-22 (_type_ vector vector) none 22) + (nav-mesh-method-23 (_type_ entity-nav-mesh) none 23) + (nav-mesh-method-24 (_type_) none 24) + (nav-mesh-method-25 (_type_) none 25) + (nav-mesh-method-26 (_type_) none 26) + (new-nav-control (_type_ vector int) nav-control 27) + (nav-mesh-method-28 (_type_ object) none 28) + (nav-mesh-method-29 (_type_ object symbol) nav-control 29) + (nav-mesh-method-30 (_type_ process-drawable) none 30) + (change-to (_type_ process-drawable) none 31) + (nav-mesh-method-32 (_type_ uint32) none 32) + (nav-mesh-method-33 (_type_ uint32) symbol 33) + (nav-mesh-method-34 (_type_ object vector float) none 34) (nav-mesh-method-35 () none 35) - (nav-mesh-method-36 () none 36) + (nav-mesh-method-36 (_type_ nav-poly rgba) none 36) (point-in-poly? (_type_ nav-poly vector) symbol 37) - (nav-mesh-method-38 () none 38) + (nav-mesh-method-38 (_type_ nav-poly vector vector vector object) vector 38) (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) - (nav-mesh-method-40 () none 40) + (nav-mesh-method-40 (_type_ nav-poly vector object vector) none 40) (project-point-into-poly-2d (_type_ nav-poly vector vector) none 41) - (nav-mesh-method-42 () none 42) - (nav-mesh-method-43 () none 43) - (nav-mesh-method-44 () none 44) - (nav-mesh-method-45 () none 45) - (nav-mesh-method-46 () none 46) + (nav-mesh-method-42 (_type_ nav-find-poly-parms) symbol 42) + (nav-mesh-method-43 (_type_ nav-find-poly-parms) none 43) + (nav-mesh-method-44 (_type_ vector float float) symbol 44) + (nav-mesh-method-45 (_type_ entity-perm) none 45) + (nav-mesh-method-46 (_type_ object) none 46) ) ) @@ -637,7 +639,7 @@ (let* ((a3-0 obj) (v1-0 arg1) (a0-1 (-> arg0 vertex-count)) - (a1-1 (-> arg0 vertex)) + (a1-1 (the-as (inline-array vector) (-> arg0 vertex0))) (a2-2 (-> a3-0 work vert0-table)) (a3-2 (-> a3-0 work vert1-table)) ) @@ -840,7 +842,7 @@ (+! (-> ray current-pos z) delta-z) (set! sv-68 (-> current-poly adj-poly next-poly-idx)) (if (!= sv-68 255) - (set! (-> ray next-poly) (-> obj poly-array sv-68)) + (set! (-> ray next-poly) (the-as nav-poly (-> obj poly-array sv-68 vertex0))) ) (cond ((and (-> ray next-poly) (zero? (logand (-> ray next-poly pat) (-> ray ignore)))) diff --git a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc index c9eaac6346..495c86ffd2 100644 --- a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc @@ -153,7 +153,7 @@ ) ) ) - (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color orange-red) (font-flags shadow)) + (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color precursor-#ec3b00) (font-flags shadow)) ) ) 0 diff --git a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc index 33e6385d75..988cb420f4 100644 --- a/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/jak2/engine/sound/gsound_REF.gc @@ -1150,7 +1150,7 @@ arg0 (+ (* s5-0 16) 16) 48 - (font-color default) + (font-color default-#cddbcd) (font-flags shadow) ) ) @@ -1163,7 +1163,7 @@ arg0 (+ (* s5-1 16) 16) 64 - (font-color default) + (font-color default-#cddbcd) (font-flags shadow) ) ) @@ -1175,7 +1175,7 @@ (-> *level* sound-bank 1) (-> *level* sound-bank 2) ) - (s5-2 *temp-string* arg0 16 88 (font-color default) (font-flags shadow)) + (s5-2 *temp-string* arg0 16 88 (font-color default-#cddbcd) (font-flags shadow)) ) (let ((s5-3 draw-string-xy)) (format @@ -1188,7 +1188,7 @@ (-> *setting-control* user-current sound-excitement) (-> *setting-control* user-current mode-sound-bank) ) - (s5-3 *temp-string* arg0 16 104 (font-color default) (font-flags shadow)) + (s5-3 *temp-string* arg0 16 104 (font-color default-#cddbcd) (font-flags shadow)) ) 0 ) @@ -1202,7 +1202,7 @@ (-> *sound-iop-info* freemem) (shr (-> *sound-iop-info* freemem) 10) ) - (s5-0 *temp-string* arg0 32 96 (font-color default) (font-flags shadow)) + (s5-0 *temp-string* arg0 32 96 (font-color default-#cddbcd) (font-flags shadow)) ) (let ((s5-1 draw-string-xy)) (format @@ -1211,7 +1211,7 @@ (-> *sound-iop-info* freemem2) (shr (-> *sound-iop-info* freemem2) 10) ) - (s5-1 *temp-string* arg0 32 64 (font-color default) (font-flags shadow)) + (s5-1 *temp-string* arg0 32 64 (font-color default-#cddbcd) (font-flags shadow)) ) 0 ) diff --git a/test/decompiler/reference/jak2/engine/spatial_hash/spatial-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial_hash/spatial-hash-h_REF.gc index 208d425383..3bdae68477 100644 --- a/test/decompiler/reference/jak2/engine/spatial_hash/spatial-hash-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/spatial_hash/spatial-hash-h_REF.gc @@ -137,11 +137,11 @@ ;; definition of type sphere-hash (deftype sphere-hash (grid-hash) - ((sphere-array uint32 :offset-assert 88) - (max-object-count int16 :offset-assert 92) - (pad int16 :offset-assert 94) - (mem-sphere-array uint32 :offset-assert 96) - (spr-sphere-array uint32 :offset-assert 100) + ((sphere-array (inline-array sphere) :offset-assert 88) + (max-object-count int16 :offset-assert 92) + (pad int16 :offset-assert 94) + (mem-sphere-array uint32 :offset-assert 96) + (spr-sphere-array uint32 :offset-assert 100) ) :method-count-assert 34 :size-assert #x68 @@ -152,7 +152,7 @@ (sphere-hash-method-27 () none 27) (sphere-hash-method-28 () none 28) (sphere-hash-method-29 () none 29) - (sphere-hash-method-30 () none 30) + (sphere-hash-method-30 (_type_ find-nav-sphere-ids-params) none 30) (sphere-hash-method-31 () none 31) (sphere-hash-method-32 () none 32) (sphere-hash-method-33 () none 33) @@ -271,7 +271,3 @@ ;; failed to figure out what this is: 0 - - - - diff --git a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc index b3b849f85b..f8570997ed 100644 --- a/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/target/board/board-h_REF.gc @@ -422,14 +422,14 @@ ) (set! (-> s5-0 0 quad) (-> v1-51 quad)) (set! (-> s5-0 0 y) (+ 8192.0 (-> s5-0 0 y))) - (set! (-> s5-0 0 w) 2867.2) + (set! (-> s5-0 0 r) 2867.2) (set! (-> s5-0 1 quad) (-> v1-51 quad)) (set! (-> s5-0 1 y) (+ 12288.0 (-> s5-0 1 y))) - (set! (-> s5-0 1 w) 2867.2) + (set! (-> s5-0 1 r) 2867.2) (set! (-> s5-0 2 quad) (-> v1-51 quad)) ) (set! (-> s5-0 2 y) (+ 16384.0 (-> s5-0 2 y))) - (set! (-> s5-0 2 w) 2867.2) + (set! (-> s5-0 2 r) 2867.2) (let ((v1-55 gp-0)) (set! (-> v1-55 spheres) s5-0) (set! (-> v1-55 num-spheres) (the-as uint 3)) diff --git a/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc b/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc index 8ff9020217..7a1e5fcec0 100644 --- a/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc +++ b/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc @@ -1206,8 +1206,8 @@ (deftype game-task-node-info (basic) ((level basic :offset-assert 4) (task game-task :offset-assert 8) - (name basic :offset-assert 12) - (when-open basic :offset-assert 16) + (name string :offset-assert 12) + (when-open array :offset-assert 16) (flags game-task-node-flag :offset-assert 20) (parent-node uint16 4 :offset-assert 24) (task-mask task-mask :offset-assert 32) @@ -1333,14 +1333,14 @@ ;; definition of type game-task-info (deftype game-task-info (basic) - ((name basic :offset-assert 4) + ((name string :offset-assert 4) (text-name uint32 :offset-assert 8) (pre-play-node uint16 :offset-assert 12) (kiosk-play-node uint16 :offset-assert 14) - (pre-play-continue basic :offset-assert 16) + (pre-play-continue string :offset-assert 16) (play-node uint16 :offset-assert 20) - (play-continue basic :offset-assert 24) - (kiosk-play-continue basic :offset-assert 28) + (play-continue string :offset-assert 24) + (kiosk-play-continue string :offset-assert 28) ) :method-count-assert 9 :size-assert #x20 diff --git a/test/decompiler/reference/jak2/engine/ui/text_REF.gc b/test/decompiler/reference/jak2/engine/ui/text_REF.gc index 30de3d258c..8ff1795e60 100644 --- a/test/decompiler/reference/jak2/engine/ui/text_REF.gc +++ b/test/decompiler/reference/jak2/engine/ui/text_REF.gc @@ -441,7 +441,7 @@ (sv-40 float) (sv-44 float) (sv-48 float) - (sv-52 int) + (sv-52 float) (sv-56 float) (sv-64 int) (sv-72 uint) @@ -471,7 +471,7 @@ (set! sv-40 (-> arg1 origin x)) (set! sv-44 (+ (-> arg1 origin x) (-> arg1 width))) (set! sv-48 (+ (-> arg1 origin y) (-> arg1 height))) - (set! sv-52 (gpr->fpr (.asm.sllv.r0 (get-string-length " " arg1)))) + (set! sv-52 (-> (get-string-length " " arg1) length)) (set! sv-56 (* (if (logtest? (-> arg1 flags) (font-flags large)) (the float arg3) 28.0 @@ -536,7 +536,7 @@ (when sv-108 (set! (-> *game-text-word* data sv-80) (the-as uint 0)) (let ((f30-1 sv-36)) - (set! sv-120 (the int (the-as float (.asm.sllv.r0 (get-string-length *game-text-word* arg1))))) + (set! sv-120 (the int (the-as float (-> (get-string-length *game-text-word* arg1) length)))) (let ((f0-26 (+ f30-1 (the float sv-120)))) (if (= (-> *game-text-word* data (+ sv-80 -1)) 32) (set! f0-26 (- f0-26 (the-as float sv-52))) diff --git a/test/decompiler/reference/jak2/engine/util/profile_REF.gc b/test/decompiler/reference/jak2/engine/util/profile_REF.gc index 6063ab739c..c9120d74d7 100644 --- a/test/decompiler/reference/jak2/engine/util/profile_REF.gc +++ b/test/decompiler/reference/jak2/engine/util/profile_REF.gc @@ -684,8 +684,8 @@ 488 arg1 (if (>= f30-0 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -700,8 +700,8 @@ 488 arg1 (if (>= f30-0 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -735,8 +735,8 @@ 488 arg1 (if (>= f30-1 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) @@ -751,8 +751,8 @@ 488 arg1 (if (>= f30-1 100.0) - (font-color orange-red) - (font-color default) + (font-color precursor-#ec3b00) + (font-color default-#cddbcd) ) (font-flags shadow right) ) diff --git a/test/offline/config/jak2/config.jsonc b/test/offline/config/jak2/config.jsonc index 5041c619e5..6d4a78421b 100644 --- a/test/offline/config/jak2/config.jsonc +++ b/test/offline/config/jak2/config.jsonc @@ -60,19 +60,10 @@ "ja-play-spooled-anim", // default menu - // - causes a decompiler hang - "dm-cam-setting-float", - "debug-menu-make-camera-menu", // requires the above, fine on it's own - // - delayed until game-info is better understood - "debug-menu-make-play-menu", - "debug-menu-make-task-sub-menu", // - weird array accessing pattern, we never fixed it in jak 1 "all-texture-tweak-adjust", "debug-menu-make-shader-menu", // requires the above, fine on it's own - // - process-spawn macro issues - "dm-scene-load-pick-func", - "popup-menu-context-make-default-menus", - "debug-menu-context-make-default-menus", + // camera // - vector-dot issue "slave-set-rotation!",