From f7bd0752f880f0bc60066f658b351af2718d9ba0 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Wed, 24 Aug 2022 00:29:51 -0400 Subject: [PATCH] [decomp] Decompile first batch of files in engine (#1787) * wip * getting stuff set up so we can actually run test cases * better handle block entry stuff * types2 working on gstring * comments * math ref working * up to first stack stuff * stack fixes * bounding box * math stuff is working * float fixes * temp debug for (method 9 profile-array) * stupid stupid bug * debugging * everything is broken * some amount of type stuff works * bitfield * texture bitfields not working * temp * types * more stuff * type check * temp * float related fixes for light and res problems * revisit broken files, fix bugs * more types * vector debug * bug fixes for decompiler crashes in harder functions * update goal_src --- decompiler/types2/types2.cpp | 2 +- decompiler/types2/types2.md | 66 + goal_src/jak1/engine/math/quaternion.gc | 3 +- goal_src/jak1/engine/math/vector.gc | 2 +- goal_src/jak2/engine/ai/traffic-h.gc | 62 + goal_src/jak2/engine/ambient/ambient-h.gc | 987 + goal_src/jak2/engine/anim/aligner-h.gc | 62 + goal_src/jak2/engine/anim/joint-h.gc | 148 + goal_src/jak2/engine/anim/joint-mod-h.gc | 602 + goal_src/jak2/engine/anim/mspace-h.gc | 86 + goal_src/jak2/engine/camera/cam-debug-h.gc | 103 + .../jak2/engine/camera/cam-interface-h.gc | 8 + goal_src/jak2/engine/camera/cam-update-h.gc | 23 + goal_src/jak2/engine/camera/camera-defs-h.gc | 57 + goal_src/jak2/engine/camera/camera-h.gc | 383 + goal_src/jak2/engine/camera/pov-camera-h.gc | 38 +- .../jak2/engine/collide/collide-cache-h.gc | 127 + .../engine/collide/collide-edge-grab-h.gc | 204 + .../jak2/engine/collide/collide-frag-h.gc | 48 + goal_src/jak2/engine/collide/collide-h.gc | 45 + .../jak2/engine/collide/collide-mesh-h.gc | 118 + .../jak2/engine/collide/collide-shape-h.gc | 594 + .../jak2/engine/collide/collide-target-h.gc | 8 + .../jak2/engine/collide/collide-touch-h.gc | 145 + goal_src/jak2/engine/collide/pat-h.gc | 292 + .../jak2/engine/common_objs/generic-obs-h.gc | 228 + .../jak2/engine/common_objs/projectile-h.gc | 107 + goal_src/jak2/engine/data/art-h.gc | 387 + goal_src/jak2/engine/debug/debug-h.gc | 57 + goal_src/jak2/engine/debug/memory-usage-h.gc | 37 + goal_src/jak2/engine/debug/stats-h.gc | 351 + goal_src/jak2/engine/dma/dma-bucket.gc | 85 + goal_src/jak2/engine/dma/dma-buffer.gc | 471 + goal_src/jak2/engine/dma/dma-disasm.gc | 579 + goal_src/jak2/engine/dma/dma-h.gc | 338 + goal_src/jak2/engine/dma/dma.gc | 153 + goal_src/jak2/engine/draw/draw-node-h.gc | 28 +- goal_src/jak2/engine/draw/drawable-actor-h.gc | 30 + goal_src/jak2/engine/draw/drawable-group-h.gc | 27 +- goal_src/jak2/engine/draw/drawable-h.gc | 26 + .../engine/draw/drawable-inline-array-h.gc | 10 +- goal_src/jak2/engine/draw/drawable-tree-h.gc | 14 +- goal_src/jak2/engine/engine/connect.gc | 786 + goal_src/jak2/engine/engine/engines.gc | 24 + goal_src/jak2/engine/entity/actor-link-h.gc | 356 + goal_src/jak2/engine/entity/entity-h.gc | 198 + goal_src/jak2/engine/entity/res-h.gc | 58 + goal_src/jak2/engine/entity/res.gc | 994 + goal_src/jak2/engine/game/effect-control-h.gc | 50 + goal_src/jak2/engine/game/fact-h.gc | 431 + goal_src/jak2/engine/game/game-h.gc | 304 + goal_src/jak2/engine/game/game-info-h.gc | 366 + goal_src/jak2/engine/game/main-h.gc | 206 + goal_src/jak2/engine/game/penetrate-h.gc | 149 + goal_src/jak2/engine/game/settings-h.gc | 439 + .../jak2/engine/game/task/task-control-h.gc | 1709 ++ .../jak2/engine/geometry/bounding-box-h.gc | 57 + goal_src/jak2/engine/geometry/bounding-box.gc | 327 + goal_src/jak2/engine/geometry/geometry-h.gc | 33 + goal_src/jak2/engine/geometry/geometry.gc | 1547 ++ goal_src/jak2/engine/geometry/path-h.gc | 194 + .../engine/gfx/background/background-h.gc | 24 + .../jak2/engine/gfx/background/prototype-h.gc | 178 + .../jak2/engine/gfx/background/subdivide-h.gc | 169 + goal_src/jak2/engine/gfx/background/wind-h.gc | 56 + goal_src/jak2/engine/gfx/blit-displays-h.gc | 25 + goal_src/jak2/engine/gfx/font-h.gc | 679 + .../jak2/engine/gfx/foreground/bones-h.gc | 106 + goal_src/jak2/engine/gfx/foreground/eye-h.gc | 90 + .../engine/gfx/foreground/foreground-h.gc | 153 + .../engine/gfx/foreground/shadow-cpu-h.gc | 239 + goal_src/jak2/engine/gfx/generic/generic-h.gc | 232 + .../jak2/engine/gfx/generic/generic-vu1-h.gc | 80 + .../jak2/engine/gfx/generic/generic-work-h.gc | 92 + goal_src/jak2/engine/gfx/hw/display-h.gc | 116 + goal_src/jak2/engine/gfx/hw/display.gc | 694 + goal_src/jak2/engine/gfx/hw/gs.gc | 1098 ++ goal_src/jak2/engine/gfx/hw/video-h.gc | 35 + goal_src/jak2/engine/gfx/lightning-h.gc | 236 + goal_src/jak2/engine/gfx/lights-h.gc | 114 + goal_src/jak2/engine/gfx/math-camera-h.gc | 112 + goal_src/jak2/engine/gfx/math-camera.gc | 680 + .../jak2/engine/gfx/merc/generic-merc-h.gc | 123 + goal_src/jak2/engine/gfx/merc/merc-h.gc | 394 + goal_src/jak2/engine/gfx/mood/mood-h.gc | 239 + .../jak2/engine/gfx/mood/time-of-day-h.gc | 107 + .../jak2/engine/gfx/ocean/ocean-frames.gc | 16391 ++++++++++++++++ goal_src/jak2/engine/gfx/ocean/ocean-h.gc | 901 + .../jak2/engine/gfx/ocean/ocean-tables.gc | 5878 ++++++ .../engine/gfx/ocean/ocean-trans-tables.gc | 1099 ++ goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc | 253 + goal_src/jak2/engine/gfx/sky/sky-h.gc | 247 + .../gfx/sprite/particles/sparticle-h.gc | 106 + .../sprite/particles/sparticle-launcher-h.gc | 270 + .../jak2/engine/gfx/sprite/simple-sprite-h.gc | 44 + goal_src/jak2/engine/gfx/sprite/sprite-h.gc | 77 + .../jak2/engine/gfx/texture/texture-anim-h.gc | 191 + goal_src/jak2/engine/gfx/texture/texture-h.gc | 701 + goal_src/jak2/engine/gfx/tfrag/tfrag-h.gc | 236 + goal_src/jak2/engine/gfx/tie/generic-tie-h.gc | 224 + goal_src/jak2/engine/gfx/tie/tie-h.gc | 321 + goal_src/jak2/engine/gfx/vu1-user-h.gc | 459 + goal_src/jak2/engine/level/bsp-h.gc | 160 + goal_src/jak2/engine/level/level-h.gc | 652 + goal_src/jak2/engine/level/region-h.gc | 126 + goal_src/jak2/engine/load/decomp-h.gc | 12 + goal_src/jak2/engine/load/file-io.gc | 226 + goal_src/jak2/engine/load/loader-h.gc | 224 + goal_src/jak2/engine/math/euler-h.gc | 15 + goal_src/jak2/engine/math/euler.gc | 210 + goal_src/jak2/engine/math/math.gc | 868 + goal_src/jak2/engine/math/matrix-h.gc | 71 + goal_src/jak2/engine/math/matrix.gc | 1886 ++ goal_src/jak2/engine/math/quaternion-h.gc | 32 + goal_src/jak2/engine/math/quaternion.gc | 1058 + goal_src/jak2/engine/math/transform-h.gc | 31 + goal_src/jak2/engine/math/transform.gc | 71 + goal_src/jak2/engine/math/transformq-h.gc | 81 + goal_src/jak2/engine/math/trigonometry-h.gc | 15 + goal_src/jak2/engine/math/trigonometry.gc | 1055 + goal_src/jak2/engine/math/vector-h.gc | 749 + goal_src/jak2/engine/math/vector.gc | 1732 ++ goal_src/jak2/engine/nav/nav-control-h.gc | 220 + goal_src/jak2/engine/nav/nav-mesh-h.gc | 554 + .../jak2/engine/physics/chain-physics-h.gc | 51 + goal_src/jak2/engine/physics/dynamics-h.gc | 51 + goal_src/jak2/engine/physics/gravity-h.gc | 1 + goal_src/jak2/engine/physics/trajectory-h.gc | 135 + .../jak2/engine/process-drawable/focus.gc | 16 + .../process-drawable/process-drawable-h.gc | 191 + .../process-drawable/process-focusable.gc | 86 + .../process-drawable/process-taskable-h.gc | 34 + goal_src/jak2/engine/ps2/memcard-h.gc | 105 + goal_src/jak2/engine/ps2/pad.gc | 613 +- goal_src/jak2/engine/ps2/rpc-h.gc | 183 + goal_src/jak2/engine/ps2/timer-h.gc | 116 + goal_src/jak2/engine/ps2/timer.gc | 276 + goal_src/jak2/engine/ps2/vif-h.gc | 79 + goal_src/jak2/engine/ps2/vu1-macros.gc | 237 + goal_src/jak2/engine/scene/scene-h.gc | 103 + goal_src/jak2/engine/sound/gsound-h.gc | 437 + goal_src/jak2/engine/sound/speech-h.gc | 84 + .../jak2/engine/spatial-hash/actor-hash-h.gc | 3 + .../engine/spatial-hash/collide-hash-h.gc | 113 + .../engine/spatial-hash/spatial-hash-h.gc | 121 + goal_src/jak2/engine/target/surface-h.gc | 1169 ++ goal_src/jak2/engine/target/target-h.gc | 104 + goal_src/jak2/engine/ui/bigmap-h.gc | 289 + goal_src/jak2/engine/ui/gui-h.gc | 113 + goal_src/jak2/engine/ui/hud-h.gc | 492 + goal_src/jak2/engine/ui/minimap-h.gc | 222 + .../jak2/engine/ui/progress/progress-h.gc | 497 + goal_src/jak2/engine/ui/text-h.gc | 27 + goal_src/jak2/engine/ui/text-id-h.gc | 7 + goal_src/jak2/engine/util/capture-h.gc | 47 + goal_src/jak2/engine/util/capture.gc | 55 + goal_src/jak2/engine/util/profile-h.gc | 134 + goal_src/jak2/engine/util/profile.gc | 854 + goal_src/jak2/engine/util/script-h.gc | 80 + goal_src/jak2/engine/util/smush-control-h.gc | 110 + goal_src/jak2/engine/util/sync-info-h.gc | 161 +- goal_src/jak2/engine/util/types-h.gc | 72 + goal_src/jak2/kernel-defs.gc | 35 +- goal_src/jak2/kernel/gstate.gc | 11 +- goal_src/jak2/kernel/pskernel.gc | 5 + goal_src/jak2/levels/city/common/trail-h.gc | 151 + scripts/decomp_progress.py | 2 +- .../reference/jak2/engine/ai/traffic-h_REF.gc | 135 + .../jak2/engine/ambient/ambient-h_REF.gc | 1038 + .../jak2/engine/anim/aligner-h_REF.gc | 64 + .../reference/jak2/engine/anim/joint-h_REF.gc | 345 + .../jak2/engine/anim/joint-mod-h_REF.gc | 848 + .../jak2/engine/anim/mspace-h_REF.gc | 192 + .../jak2/engine/camera/cam-debug-h_REF.gc | 141 + .../jak2/engine/camera/cam-interface-h_REF.gc | 18 + .../jak2/engine/camera/cam-update-h_REF.gc | 39 + .../jak2/engine/camera/camera-defs-h_REF.gc | 110 + .../jak2/engine/camera/camera-h_REF.gc | 670 + .../jak2/engine/camera/pov-camera-h_REF.gc | 59 + .../engine/collide/collide-cache-h_REF.gc | 257 + .../engine/collide/collide-edge-grab-h_REF.gc | 379 + .../jak2/engine/collide/collide-frag-h_REF.gc | 130 + .../jak2/engine/collide/collide-h_REF.gc | 105 + .../jak2/engine/collide/collide-mesh-h_REF.gc | 208 + .../engine/collide/collide-shape-h_REF.gc | 2053 ++ .../engine/collide/collide-target-h_REF.gc | 18 + .../engine/collide/collide-touch-h_REF.gc | 242 + .../jak2/engine/collide/pat-h_REF.gc | 294 + .../engine/common_objs/generic-obs-h_REF.gc | 605 + .../engine/common_objs/projectile-h_REF.gc | 191 + .../reference/jak2/engine/data/art-h_REF.gc | 755 + .../jak2/engine/debug/debug-h_REF.gc | 154 + .../jak2/engine/debug/memory-usage-h_REF.gc | 76 + .../jak2/engine/debug/stats-h_REF.gc | 375 + .../jak2/engine/dma/dma-bucket_REF.gc | 67 + .../jak2/engine/dma/dma-buffer_REF.gc | 225 + .../jak2/engine/dma/dma-disasm_REF.gc | 733 + .../reference/jak2/engine/dma/dma-h_REF.gc | 395 + .../jak2/engine/draw/draw-node-h_REF.gc | 71 + .../jak2/engine/draw/drawable-actor-h_REF.gc | 50 + .../jak2/engine/draw/drawable-group-h_REF.gc | 37 + .../jak2/engine/draw/drawable-h_REF.gc | 61 + .../draw/drawable-inline-array-h_REF.gc | 32 + .../jak2/engine/draw/drawable-tree-h_REF.gc | 26 + .../jak2/engine/engine/engines_REF.gc | 45 + .../jak2/engine/entity/actor-link-h_REF.gc | 402 + .../jak2/engine/entity/entity-h_REF.gc | 404 + .../reference/jak2/engine/entity/res-h_REF.gc | 72 + .../reference/jak2/engine/entity/res_REF.gc | 871 + .../jak2/engine/game/effect-control-h_REF.gc | 77 + .../reference/jak2/engine/game/fact-h_REF.gc | 1505 ++ .../reference/jak2/engine/game/game-h_REF.gc | 451 + .../jak2/engine/game/game-info-h_REF.gc | 464 + .../reference/jak2/engine/game/main-h_REF.gc | 471 + .../jak2/engine/game/penetrate-h_REF.gc | 122 + .../jak2/engine/game/settings-h_REF.gc | 601 + .../engine/geometry/bounding-box-h_REF.gc | 115 + .../jak2/engine/geometry/bounding-box_REF.gc | 270 + .../jak2/engine/geometry/geometry-h_REF.gc | 71 + .../jak2/engine/geometry/geometry_REF.gc | 1691 ++ .../jak2/engine/geometry/path-h_REF.gc | 242 + .../engine/gfx/background/background-h_REF.gc | 64 + .../engine/gfx/background/prototype-h_REF.gc | 434 + .../engine/gfx/background/subdivide-h_REF.gc | 377 + .../jak2/engine/gfx/background/wind-h_REF.gc | 156 + .../jak2/engine/gfx/blit-displays-h_REF.gc | 66 + .../jak2/engine/gfx/foreground/bones-h_REF.gc | 214 + .../jak2/engine/gfx/foreground/eye-h_REF.gc | 175 + .../engine/gfx/foreground/foreground-h_REF.gc | 366 + .../jak2/engine/gfx/generic/generic-h_REF.gc | 545 + .../engine/gfx/generic/generic-vu1-h_REF.gc | 202 + .../jak2/engine/gfx/hw/display-h_REF.gc | 224 + .../jak2/engine/gfx/hw/display_REF.gc | 497 + .../reference/jak2/engine/gfx/hw/gs_REF.gc | 1150 ++ .../jak2/engine/gfx/hw/video-h_REF.gc | 59 + .../jak2/engine/gfx/lightning-h_REF.gc | 327 + .../reference/jak2/engine/gfx/lights-h_REF.gc | 234 + .../jak2/engine/gfx/math-camera-h_REF.gc | 229 + .../jak2/engine/gfx/math-camera_REF.gc | 612 + .../engine/gfx/merc/generic-merc-h_REF.gc | 311 + .../jak2/engine/gfx/merc/merc-h_REF.gc | 902 + .../jak2/engine/gfx/mood/mood-h_REF.gc | 593 + .../jak2/engine/gfx/mood/time-of-day-h_REF.gc | 242 + .../jak2/engine/gfx/ocean/ocean-h_REF.gc | 1445 ++ .../gfx/ocean/ocean-trans-tables_REF.gc | 1102 ++ .../jak2/engine/gfx/shrub/shrubbery-h_REF.gc | 509 + .../jak2/engine/gfx/sky/sky-h_REF.gc | 537 + .../gfx/sprite/particles/sparticle-h_REF.gc | 183 + .../particles/sparticle-launcher-h_REF.gc | 316 + .../engine/gfx/sprite/simple-sprite-h_REF.gc | 95 + .../jak2/engine/gfx/sprite/sprite-h_REF.gc | 185 + .../engine/gfx/texture/texture-anim-h_REF.gc | 470 + .../jak2/engine/gfx/texture/texture-h_REF.gc | 1250 ++ .../jak2/engine/gfx/tfrag/tfrag-h_REF.gc | 496 + .../jak2/engine/gfx/tie/generic-tie-h_REF.gc | 534 + .../jak2/engine/gfx/tie/tie-h_REF.gc | 692 + .../jak2/engine/gfx/vu1-user-h_REF.gc | 85 + .../reference/jak2/engine/level/bsp-h_REF.gc | 226 + .../jak2/engine/level/level-h_REF.gc | 861 + .../jak2/engine/level/region-h_REF.gc | 278 + .../jak2/engine/load/decomp-h_REF.gc | 36 + .../reference/jak2/engine/load/file-io_REF.gc | 220 + .../jak2/engine/load/loader-h_REF.gc | 311 + .../reference/jak2/engine/math/euler-h_REF.gc | 41 + .../reference/jak2/engine/math/euler_REF.gc | 213 + .../reference/jak2/engine/math/math_REF.gc | 670 + .../jak2/engine/math/matrix-h_REF.gc | 103 + .../reference/jak2/engine/math/matrix_REF.gc | 1800 ++ .../jak2/engine/math/quaternion-h_REF.gc | 47 + .../jak2/engine/math/quaternion_REF.gc | 1010 + .../jak2/engine/math/transform-h_REF.gc | 58 + .../jak2/engine/math/transform_REF.gc | 70 + .../jak2/engine/math/transformq-h_REF.gc | 127 + .../jak2/engine/math/trigonometry-h_REF.gc | 9 + .../jak2/engine/math/trigonometry_REF.gc | 616 + .../jak2/engine/math/vector-h_REF.gc | 1181 ++ .../reference/jak2/engine/math/vector_REF.gc | 1640 ++ .../jak2/engine/nav/nav-control-h_REF.gc | 405 + .../jak2/engine/nav/nav-mesh-h_REF.gc | 872 + .../engine/physics/chain-physics-h_REF.gc | 117 + .../jak2/engine/physics/dynamics-h_REF.gc | 85 + .../jak2/engine/physics/gravity-h_REF.gc | 9 + .../jak2/engine/physics/trajectory-h_REF.gc | 270 + .../process-drawable-h_REF.gc | 213 + .../process-drawable/process-focusable_REF.gc | 98 + .../process-taskable-h_REF.gc | 72 + .../jak2/engine/ps2/memcard-h_REF.gc | 168 + .../reference/jak2/engine/ps2/pad_REF.gc | 663 + .../reference/jak2/engine/ps2/rpc-h_REF.gc | 236 + .../reference/jak2/engine/ps2/timer-h_REF.gc | 117 + .../reference/jak2/engine/ps2/timer_REF.gc | 232 + .../reference/jak2/engine/ps2/vif-h_REF.gc | 136 + .../jak2/engine/scene/scene-h_REF.gc | 218 + .../jak2/engine/sound/gsound-h_REF.gc | 943 + .../jak2/engine/sound/speech-h_REF.gc | 167 + .../engine/spatial_hash/actor-hash-h_REF.gc | 15 + .../engine/spatial_hash/collide-hash-h_REF.gc | 279 + .../engine/spatial_hash/spatial-hash-h_REF.gc | 277 + .../jak2/engine/target/surface-h_REF.gc | 1322 ++ .../jak2/engine/task/task-control-h_REF.gc | 1528 ++ .../reference/jak2/engine/ui/bigmap-h_REF.gc | 408 + .../reference/jak2/engine/ui/gui-h_REF.gc | 279 + .../reference/jak2/engine/ui/hud-h_REF.gc | 1275 ++ .../reference/jak2/engine/ui/minimap-h_REF.gc | 618 + .../jak2/engine/ui/progress/progress-h_REF.gc | 1466 ++ .../reference/jak2/engine/ui/text-h_REF.gc | 72 + .../jak2/engine/util/capture-h_REF.gc | 104 + .../reference/jak2/engine/util/capture_REF.gc | 61 + .../jak2/engine/util/profile-h_REF.gc | 255 + .../reference/jak2/engine/util/profile_REF.gc | 814 + .../jak2/engine/util/script-h_REF.gc | 107 + .../jak2/engine/util/smush-control-h_REF.gc | 138 + .../jak2/engine/util/sync-info-h_REF.gc | 345 + .../reference/jak2/engine/util/types-h_REF.gc | 14 + .../reference/jak2/kernel/gcommon_REF.gc | 1 + .../reference/jak2/levels/city/trail-h_REF.gc | 310 + 316 files changed, 125721 insertions(+), 13 deletions(-) create mode 100644 decompiler/types2/types2.md create mode 100644 test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/camera/cam-interface-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/camera/cam-update-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/data/art-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/engine/engines_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/entity/res-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/entity/res_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/fact-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/game-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/main-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/game/settings-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/lights-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/merc/generic-merc-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/ocean/ocean-trans-tables_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/tfrag/tfrag-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/tie/generic-tie-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/tie/tie-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/level/level-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/level/region-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/load/file-io_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/load/loader-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/euler-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/euler_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/math_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/matrix_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/quaternion_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/transform-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/transform_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/trigonometry-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/vector-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/math/vector_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/physics/gravity-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ps2/pad_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ps2/timer_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/spatial_hash/actor-hash-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/spatial_hash/collide-hash-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/spatial_hash/spatial-hash-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/target/surface-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/ui/text-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/capture-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/capture_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/profile-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/profile_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/script-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc create mode 100644 test/decompiler/reference/jak2/engine/util/types-h_REF.gc create mode 100644 test/decompiler/reference/jak2/levels/city/trail-h_REF.gc diff --git a/decompiler/types2/types2.cpp b/decompiler/types2/types2.cpp index b360a7b741..cecc83413f 100644 --- a/decompiler/types2/types2.cpp +++ b/decompiler/types2/types2.cpp @@ -757,4 +757,4 @@ end_type_pass: out.succeeded = !hit_error; } -} // namespace decompiler::types2 \ No newline at end of file +} // namespace decompiler::types2 diff --git a/decompiler/types2/types2.md b/decompiler/types2/types2.md new file mode 100644 index 0000000000..ce57cdaa5e --- /dev/null +++ b/decompiler/types2/types2.md @@ -0,0 +1,66 @@ +# Type Pass: Version 2 +Compared to the original type pass, the version 2 type pass should support: +- Automatic guessing of stack and label types +- Solution to ambiguous inline structure access uses casts problem + +- Better handling of result in `cond` as value +- Still support for `typecase`-like patterns +- Fewer useless casts in `cond` as value cases + + +The main idea of the type pass is similar to the previous one: iterate through blocks in a topological sort order, propagating types and finding lowest-common-ancestors whenever multiple paths give us different types for the same register. + +The new trick is the ability to handle "constraints" or hints about what certain types should be. Types can tag themselves as "ambiguous", and the type pass will greedily resolve these ambiguities based on signatures of functions and constraints on instructions. To propagate backward through blocks, blocks will internally propagate back info to their entry types. On a second entire pass, blocks that end with ambiguous types will look ahead to their successors and resolve based on hints there. + +## Automatic Guessing of Stack and Label Types + +```asm + lw t9, quaternion-vector-angle! + daddiu a0, sp, 16 + daddiu a1, fp, L80 + jalr ra, t9 +``` +From this code, the decompiler should be able to infer the types of `sp + 16` and `L80`. + +Of course, there are situations where this type of guessing will be wrong, so the decompiler should produce some type of warning/notification that this guess has occurred, and the usual methods to specify these types should override any guesses. + +This can be implemented by making the type of `sp + 16` an "ambiguous" type like `[unknown type (sp + 16)]`. Then, when the ambiguity can be resolved, the decompiler can fill in this information. + +## The Ambiguous Inline Structure Access Uses Casts Problem +There can be ambiguities when accessing inline members: +``` +(&-> mat vector 1) ;; a vector +(&-> mat data 4) ;; a (pointer float) +(&-> mat vector 1 data 0) +``` +all are the same GOAL code. The decompiler doesn't handle this very well: +``` +;; arg1 is a matrix here +(vector-dot (the-as vector (&-> arg1 data 8)) (the-as vector (&-> arg1 data 8))) +``` + +Solving this problem completely and efficiently is extremely hard (you could use a full implementation of this to solve boolean satisfiability problems), so we'll support a somewhat limited version of this. + +On the actual ambiguous deref, we'll create an "ambiguous deref" record, and propagate it along with the type. When we hit something that provides a constraint and takes an ambiguous input, we'll resolve the ambiguity, and cache this result for future type passes. Note that it's possible to have whole trees of ambiguous types, but for now we'll ignore this case and not build trees. We'll greedily pick the highest scoring option when branching would be required. This should handle the majority of these problems, and this simplification will be somewhat necessary for the next step to work. + +## Handle type of result in `cond` +Imagine this: +``` +(foo! (if (bar) A B)) +``` +we'd like `A` and `B` to get hints about what type they should be from the signature of `foo!`. This will be really important in Jak 2, in the case where these values are floats. + +Again, I think this should be done as a forward pass. The blocks look like this: +``` + [load foo!] + [check bar] + + [A] [B] + + [call foo] +``` + +On the forward pass, we'll get the type of `foo!` propagated to the `call foo` block. The `call foo` block will know that it has multiple predecessors, so it'll add "ambiguous pred" tags to all input types. When `foo` is called, it'll propagate the constraint back to the top of the `call foo` block, which will be cached for the next iteration. + +## What happens with typecase? +The challenge here is to handle two conflicting ambiguous resolutions. \ No newline at end of file diff --git a/goal_src/jak1/engine/math/quaternion.gc b/goal_src/jak1/engine/math/quaternion.gc index b178405049..6173104d9c 100644 --- a/goal_src/jak1/engine/math/quaternion.gc +++ b/goal_src/jak1/engine/math/quaternion.gc @@ -281,7 +281,8 @@ (init-vf0-vector) (.lvf vf1 (&-> arg1 vec quad)) (.mul.vf vf2 vf1 vf1) - (.sub.vf vf3 vf3 vf3) + ;; (.sub.vf vf3 vf3 vf3) + (.xor.vf vf3 vf3 vf3) (.add.z.vf acc vf2 vf2 :mask #b1000) (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) (.add.mul.x.vf vf2 vf0 vf2 acc :mask #b1000) diff --git a/goal_src/jak1/engine/math/vector.gc b/goal_src/jak1/engine/math/vector.gc index 82ae6ddb0d..751092106e 100644 --- a/goal_src/jak1/engine/math/vector.gc +++ b/goal_src/jak1/engine/math/vector.gc @@ -650,7 +650,7 @@ ) (defun vector-xz-length ((arg0 vector)) - "Get the length of the xz part, squared" + "Get the length of the xz part" (sqrtf (+ (* (-> arg0 data 0) (-> arg0 data 0)) (* (-> arg0 data 2) (-> arg0 data 2)) ) diff --git a/goal_src/jak2/engine/ai/traffic-h.gc b/goal_src/jak2/engine/ai/traffic-h.gc index bc837385da..ff15b5e555 100644 --- a/goal_src/jak2/engine/ai/traffic-h.gc +++ b/goal_src/jak2/engine/ai/traffic-h.gc @@ -5,5 +5,67 @@ ;; name in dgo: traffic-h ;; dgos: ENGINE, GAME +;; todo: some types, method names. + ;; DECOMP BEGINS +(define *traffic-manager* (the-as process #f)) +(define *ctywide-entity* (the-as object #f)) +(define *lwide-entity* (the-as object #f)) +(define *race-vehicle-entity* (the-as object #f)) + +(deftype traffic-danger-info (structure) + ((sphere sphere :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (handle uint64 :offset-assert 32) + (notify-radius float :offset-assert 40) + (danger-level float :offset-assert 44) + (decay-rate float :offset-assert 48) + (flags uint8 :offset-assert 52) + (danger-type uint8 :offset-assert 53) + ) + :method-count-assert 9 + :size-assert #x36 + :flag-assert #x900000036 + ) + +(deftype traffic-suppression-params (structure) + ((bbox bounding-box :inline :offset-assert 0) + (duration uint64 :offset-assert 32) + (id int8 :offset-assert 40) + ) + :method-count-assert 13 + :size-assert #x29 + :flag-assert #xd00000029 + (:methods + (traffic-suppression-params-method-9 () none 9) + (traffic-suppression-params-method-10 () none 10) + (has-valid-id? (_type_) none 11) + (traffic-suppression-params-method-12 () none 12) + ) + ) + +(defmethod has-valid-id? traffic-suppression-params ((obj traffic-suppression-params)) + (!= (-> obj id) -1) + (none) + ) + +(deftype traffic-object-spawn-params (structure) + ((object-type uint8 :offset-assert 0) + (behavior uint64 :offset-assert 8) + (id uint32 :offset-assert 16) + (nav-mesh basic :offset-assert 20) + (nav-branch basic :offset-assert 24) + (position vector :inline :offset-assert 32) + (rotation quaternion :inline :offset-assert 48) + (velocity vector :inline :offset-assert 64) + (handle uint64 :offset-assert 80) + (guard-type uint8 :offset-assert 88) + (user-data uint32 :offset-assert 92) + (flags uint32 :offset-assert 96) + (proc basic :offset-assert 100) + ) + :method-count-assert 9 + :size-assert #x68 + :flag-assert #x900000068 + ) diff --git a/goal_src/jak2/engine/ambient/ambient-h.gc b/goal_src/jak2/engine/ambient/ambient-h.gc index 2f51f0823d..754113b7bf 100644 --- a/goal_src/jak2/engine/ambient/ambient-h.gc +++ b/goal_src/jak2/engine/ambient/ambient-h.gc @@ -7,3 +7,990 @@ ;; DECOMP BEGINS +(deftype talker-speech-class (structure) + ((name string :offset-assert 0) + (channel uint8 :offset-assert 4) + (flags uint8 :offset-assert 5) + (speech uint16 :offset-assert 6) + (text-message uint32 :offset-assert 8) + (text-duration uint16 :offset-assert 12) + (delay uint16 :offset-assert 14) + (pos uint16 :offset-assert 16) + (neg uint16 :offset-assert 18) + (on-close basic :offset-assert 20) + ) + :pack-me + :method-count-assert 14 + :size-assert #x18 + :flag-assert #xe00000018 + (:methods + (talker-speech-class-method-9 () none 9) + (talker-speech-class-method-10 () none 10) + (talker-speech-class-method-11 () none 11) + (talker-speech-class-method-12 () none 12) + (talker-speech-class-method-13 () none 13) + ) + ) + +(deftype talker (process) + ((trans vector :inline :offset-assert 128) + (message talker-speech-class :offset-assert 144) + (total-time time-frame :offset-assert 152) + (total-off-time time-frame :offset-assert 160) + (start-time time-frame :offset-assert 168) + (state-time time-frame :offset-assert 176) + (voicebox uint64 :offset-assert 184) + (voice-id uint32 :offset-assert 192) + (message-id uint32 :offset-assert 196) + (region region :offset-assert 200) + (interp float :offset-assert 204) + (save? basic :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 18 + :size-assert #xd4 + :flag-assert #x12006000d4 + (:methods + (talker-method-14 () none 14) + (talker-method-15 () none 15) + (talker-method-16 () none 16) + (talker-method-17 () none 17) + ) + ) + + +(define *talker-speech* + (the-as talker-speech-class + (new 'static 'inline-array talker-speech-class 188 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class :name "hal001" :channel #x1d :flags #x3 :speech #x1 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "hal002" :channel #x1d :flags #x3 :speech #x2 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "DSbop002" + :channel #x14 + :flags #x3 + :speech #x3 + :text-message #x224 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop004" + :channel #x14 + :flags #x3 + :speech #x4 + :text-message #x226 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop008" + :channel #x14 + :flags #x3 + :speech #x5 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "DSbop009" :channel #x14 :flags #x3 :speech #x6 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "DSbop010" + :channel #x14 + :flags #x3 + :speech #x7 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "DSbop011" :channel #x14 :flags #x3 :speech #x8 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "DSbop016" + :channel #x14 + :flags #x3 + :speech #x9 + :text-message #x229 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "DSbop017" :channel #x14 :flags #x3 :speech #xa :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ds020" + :channel #x14 + :flags #x3 + :speech #xb + :text-message #x225 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043" + :channel #x14 + :flags #x11 + :speech #xc + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043m" + :channel #x43 + :flags #x10 + :speech #xd + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046" + :channel #x14 + :flags #x11 + :speech #xe + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046m" + :channel #x43 + :flags #x10 + :speech #xf + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds162" :channel #x14 :flags #x3 :speech #x10 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds165" :channel #x14 :flags #x3 :speech #x11 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv039" + :channel #x20 + :flags #x3 + :speech #x12 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv037" + :channel #x20 + :flags #x3 + :speech #x13 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv056" + :channel #x20 + :flags #x3 + :speech #x14 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv054" + :channel #x20 + :flags #x3 + :speech #x15 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv055" + :channel #x20 + :flags #x3 + :speech #x16 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv107" + :channel #x20 + :flags #x3 + :speech #x17 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "kg100a" :channel #x20 :flags #x3 :speech #x18 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg104a" :channel #x20 :flags #x3 :speech #x19 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg102a" :channel #x20 :flags #x3 :speech #x1a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg071a" :channel #x20 :flags #x3 :speech #x1b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg107a" :channel #x20 :flags #x3 :speech #x1c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg097a" :channel #x20 :flags #x3 :speech #x1d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg098a" :channel #x20 :flags #x3 :speech #x1e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv063" :channel #x20 :speech #x1f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv064" :channel #x20 :speech #x20 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv065" :channel #x20 :speech #x21 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv067" :channel #x20 :speech #x22 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv068" :channel #x20 :speech #x23 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv069" + :channel #x20 + :speech #x24 + :text-message #x246 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "cityv070" :channel #x20 :speech #x25 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv130" + :channel #x1d + :flags #x3 + :speech #x26 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv132" + :channel #x1d + :flags #x3 + :speech #x27 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "cityv071" :channel #x20 :speech #x28 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv072" :channel #x20 :speech #x29 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv073" :channel #x20 :speech #x2a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv074" :channel #x20 :speech #x2b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv075" :channel #x20 :speech #x2c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv076" :channel #x20 :speech #x2d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv077" :channel #x20 :speech #x2e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv078" :channel #x20 :speech #x2f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv036" :channel #x20 :speech #x30 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "tor007" :channel #x1d :flags #x3 :speech #x31 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "tor008" :channel #x1d :flags #x3 :speech #x32 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "mess004" + :channel #x43 + :flags #x7 + :speech #x33 + :text-message #x245 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew010" + :channel #x1d + :flags #x7 + :speech #x34 + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds129" :channel #x14 :flags #x2 :speech #x35 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "mess005" + :channel #x43 + :flags #x3 + :speech #x36 + :text-message #x247 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess006" + :channel #x43 + :speech #x37 + :text-message #x226 + :text-duration #x5dc + :pos #x8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds116" :channel #x14 :flags #x2 :speech #x38 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds117" :channel #x14 :flags #x3 :speech #x39 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds118" :channel #x14 :flags #x3 :speech #x3a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds119" :channel #x14 :flags #x3 :speech #x3b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds120" :channel #x14 :flags #x3 :speech #x3c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds121" :channel #x14 :flags #x3 :speech #x3d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm007" :channel #x14 :flags #x3 :speech #x3e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm008" :channel #x14 :flags #x3 :speech #x3f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm009" :channel #x14 :flags #x3 :speech #x40 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm010" :channel #x14 :flags #x3 :speech #x41 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "pek001" + :channel #x1d + :flags #x3 + :speech #x42 + :delay #x4b0 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds006" + :channel #x14 + :flags #x3 + :speech #x43 + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds029" :channel #x14 :flags #x2 :speech #x44 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds030" :channel #x14 :flags #x2 :speech #x45 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds031" :channel #x14 :flags #x2 :speech #x46 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds032" :channel #x14 :flags #x2 :speech #x47 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ds007" + :channel #x14 + :flags #x3 + :speech #x48 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds372" :channel #x14 :flags #x3 :speech #x49 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "vin011" + :channel #x1d + :flags #x3 + :speech #x4a + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds009" :channel #x14 :flags #x3 :speech #x4b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "demo001" + :channel #x43 + :flags #x3 + :speech #x4c + :text-message #x23d + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo002" + :channel #x43 + :flags #x3 + :speech #x4d + :text-message #x22b + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo003" + :channel #x43 + :flags #x3 + :speech #x4e + :text-message #x252 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo004" + :channel #x43 + :flags #x3 + :speech #x4f + :text-message #x253 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo005" + :channel #x43 + :flags #x3 + :speech #x50 + :text-message #x226 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei026" + :channel #x1d + :flags #x3 + :speech #x51 + :delay #x1770 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei018" + :channel #x1d + :flags #x3 + :speech #x52 + :text-message #x241 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSfor001" + :channel #x14 + :flags #x3 + :speech #x53 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds017" :channel #x14 :flags #x3 :speech #x54 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds018" :channel #x14 :flags #x3 :speech #x55 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds019" :channel #x14 :flags #x3 :speech #x56 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds350" :channel #x14 :flags #x2 :speech #x57 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds016" :channel #x14 :flags #x3 :speech #x58 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "sigf001" :channel #x1d :flags #x7 :speech #x59 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ys001" + :channel #x1d + :flags #x7 + :speech #x5a + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds151" + :channel #x14 + :flags #x7 + :speech #x5b + :text-message #x239 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "vin002" :channel #x1d :flags #x7 :speech #x5c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "krew001" :channel #x1d :flags #x3 :speech #x5d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "krew002" + :channel #x1d + :flags #x7 + :speech #x5e + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds005" :channel #x14 :flags #x3 :speech #x5f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bru001" :channel #x1d :flags #x3 :speech #x60 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "tor001" + :channel #x1d + :flags #x7 + :speech #x61 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor002" + :channel #x1d + :flags #x7 + :speech #x62 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin003" + :channel #x1d + :flags #x7 + :speech #x63 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin004" + :channel #x1d + :flags #x3 + :speech #x64 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor001" + :channel #x1d + :flags #x7 + :speech #x65 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor002" + :channel #x1d + :flags #x7 + :speech #x66 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "tess001" :channel #x1d :flags #x7 :speech #x67 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "whack01" + :channel #x43 + :speech #x68 + :text-message #x24e + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin015" + :channel #x1d + :flags #x7 + :speech #x69 + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "kei029" :channel #x1d :flags #x7 :speech #x6a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "tor005" :channel #x1d :flags #x7 :speech #x6b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "vin013" :channel #x1d :flags #x7 :speech #x6c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "asht006" :channel #x1d :flags #x7 :speech #x6d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "pek002" + :channel #x1d + :flags #x3 + :speech #x6e + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "test001" + :channel #x43 + :speech #x6f + :text-message #x23d + :text-duration #x2328 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "sam001" :channel #x1d :flags #x3 :speech #x70 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "asht001" + :channel #x1d + :flags #x3 + :speech #x71 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str001" + :channel #x43 + :flags #x3 + :speech #x72 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str002" + :channel #x43 + :speech #x73 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "note001" + :channel #x44 + :speech #x74 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ys002" :channel #x1d :flags #x3 :speech #x75 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "intro01" + :channel #x44 + :flags #x20 + :speech #x76 + :text-message #x254 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01e" + :channel #x44 + :flags #x20 + :speech #x77 + :text-message #x255 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01j" + :channel #x44 + :flags #x20 + :speech #x78 + :text-message #x257 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01k" + :channel #x44 + :flags #x20 + :speech #x79 + :text-message #x256 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro02" + :channel #x44 + :flags #xa0 + :speech #x7a + :text-message #x258 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro03" + :channel #x47 + :speech #x7b + :text-message #x30c + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro04" + :channel #x44 + :flags #x20 + :speech #x7c + :text-message #x25a + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss001" + :channel #x20 + :flags #x40 + :speech #x7d + :text-message #x25c + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss002" + :channel #x20 + :flags #x40 + :speech #x7e + :text-message #x261 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss003" + :channel #x20 + :flags #x40 + :speech #x7f + :text-message #x262 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss004" + :channel #x20 + :flags #x40 + :speech #x80 + :text-message #x263 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss005" + :channel #x20 + :flags #x40 + :speech #x81 + :text-message #x264 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss006" + :channel #x20 + :flags #x40 + :speech #x82 + :text-message #x265 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss007" + :channel #x20 + :flags #x40 + :speech #x83 + :text-message #x266 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss008" + :channel #x20 + :flags #x40 + :speech #x84 + :text-message #x267 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss009" + :channel #x20 + :flags #x40 + :speech #x85 + :text-message #x268 + :text-duration #x5dc + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss010" + :channel #x20 + :flags #x40 + :speech #x86 + :text-message #x269 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss011" + :channel #x20 + :flags #x40 + :speech #x87 + :text-message #x25d + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss012" + :channel #x20 + :flags #x40 + :speech #x88 + :text-message #x25e + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss013" + :channel #x20 + :flags #x40 + :speech #x89 + :text-message #x25f + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss014" + :channel #x20 + :flags #x40 + :speech #x8a + :text-message #x260 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew003" + :channel #x1d + :flags #x3 + :speech #x8b + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "pek010" :channel #x14 :flags #x1 :speech #x8c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek011" :channel #x14 :flags #x1 :speech #x8d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek012" :channel #x14 :flags #x1 :speech #x8e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek013" :channel #x14 :flags #x1 :speech #x8f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek014" :channel #x14 :flags #x1 :speech #x90 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek015" :channel #x14 :speech #x91 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek016" :channel #x14 :flags #x1 :speech #x92 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek017" :channel #x14 :flags #x1 :speech #x93 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek018" :channel #x14 :flags #x1 :speech #x94 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek019" :channel #x14 :flags #x1 :speech #x95 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek020" :channel #x14 :flags #x1 :speech #x96 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek021" :channel #x14 :flags #x1 :speech #x97 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek022" :channel #x14 :flags #x1 :speech #x98 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek023" :channel #x14 :flags #x1 :speech #x99 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek024" :channel #x14 :flags #x1 :speech #x9a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek026" :channel #x14 :flags #x1 :speech #x9b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek027" :channel #x14 :flags #x1 :speech #x9c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek028" :channel #x14 :flags #x1 :speech #x9d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek029" :channel #x14 :flags #x1 :speech #x9e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek030" :channel #x14 :flags #x1 :speech #x9f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek031" :channel #x14 :flags #x1 :speech #xa0 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek033" :channel #x14 :speech #xa1 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek034" :channel #x14 :speech #xa2 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek035" :channel #x14 :speech #xa3 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek036" :channel #x14 :speech #xa4 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek037" :channel #x14 :speech #xa5 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek038" :channel #x14 :speech #xa6 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek039" :channel #x14 :speech #xa7 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek040" :channel #x14 :speech #xa8 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek041" :channel #x14 :speech #xa9 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ora006" + :channel #x20 + :speech #xaa + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora007" + :channel #x20 + :speech #xab + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora008" + :channel #x20 + :speech #xac + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora009" + :channel #x20 + :speech #xad + :text-message #x26f + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora010" + :channel #x20 + :speech #xae + :text-message #x270 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora015" + :channel #x20 + :speech #xaf + :text-message #x271 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora016" + :channel #x20 + :speech #xb0 + :text-message #x272 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice01" + :channel #x47 + :speech #xb1 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice02" + :channel #x47 + :speech #xb2 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice03" + :channel #x47 + :speech #xb3 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice04" + :channel #x47 + :speech #xb4 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "kor004" :channel #x1d :flags #x3 :speech #xb5 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv080" + :channel #x20 + :flags #x2 + :speech #xb6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds395" :channel #x20 :flags #x2 :speech #xb7 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bru002" :channel #x1d :flags #x3 :speech #xb8 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bru004" :channel #x1d :flags #x7 :speech #xb9 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bb01int" :channel #x22 :flags #x2 :speech #xba :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "bb01fail" + :channel #x1d + :flags #x2 + :speech #xbb + :neg #x1 + :on-close #f + ) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/anim/aligner-h.gc b/goal_src/jak2/engine/anim/aligner-h.gc index a5b232fd81..0c6a2125fb 100644 --- a/goal_src/jak2/engine/anim/aligner-h.gc +++ b/goal_src/jak2/engine/anim/aligner-h.gc @@ -5,5 +5,67 @@ ;; name in dgo: aligner-h ;; dgos: ENGINE, GAME +(defenum align-flags + :bitfield #t + :type uint32 + (disabled) ;; keep object velocity + ) + +(defenum align-opts + :bitfield #t + :type uint32 + (adjust-x-vel) + (adjust-y-vel) + (adjust-xz-vel) + (keep-other-velocities) + (adjust-quat) ;; 16 + (alop0) + (alop1) + (alop2) + (alop3) + (alop4) + (alop5) + (no-gravity) + (ignore-y-if-zero) + ) + ;; DECOMP BEGINS +(deftype align-control (basic) + ((flags align-flags :offset-assert 4) + (process process-drawable :offset-assert 8) + (frame-group art-joint-anim :offset-assert 12) + (frame-num float :offset-assert 16) + (matrix matrix 2 :inline :offset-assert 32) + (transform transform 2 :inline :offset-assert 160) + (delta transformq :inline :offset-assert 256) + (last-speed meters :offset-assert 304) + (align transformq :inline :offset 160) + ) + :method-count-assert 14 + :size-assert #x134 + :flag-assert #xe00000134 + (:methods + (new (symbol type process) _type_ 0) + (align-control-method-9 () none 9) + (align-control-method-10 () none 10) + (align-control-method-11 () none 11) + (align-control-method-12 () none 12) + (align-control-method-13 () none 13) + ) + ) + +(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) + (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? obj) + (go process-drawable-art-error "memory") + (return (the-as align-control 0)) + ) + (set! (-> obj process) (the-as process-drawable arg0)) + (the-as align-control obj) + ) + ) + + + + diff --git a/goal_src/jak2/engine/anim/joint-h.gc b/goal_src/jak2/engine/anim/joint-h.gc index daeff892af..ac770b390d 100644 --- a/goal_src/jak2/engine/anim/joint-h.gc +++ b/goal_src/jak2/engine/anim/joint-h.gc @@ -5,5 +5,153 @@ ;; name in dgo: joint-h ;; dgos: ENGINE, GAME +(defenum joint-control-command + :type int64 + (push 1) + (blend 2) + (eight 8) + (push1 19) + (stack 36) + (float 42) + (stack1 52) + ) +(declare-type joint-control basic) + +(defenum joint-control-status + :type uint16 + :bitfield #t + + (sync-math 0) ;; 1 + (spooling 1) ;; 2 + (spooling-not-last-block 2) ;; 4 + (blend-shape 3) ;; 8 + (math-when-off-screen 4) ;; 16 + (valid-spooled-frame 5) ;; 32 + (blend-shape-valid 6) ;; 64 + (eye-anim-valid 7) ;; 128 + (eye-anim 8) ;; 256 + ) ;; DECOMP BEGINS +(deftype joint-control-channel (structure) + ((parent joint-control :offset-assert 0) + (frame-group art-joint-anim :offset-assert 4) + (frame-num float :offset-assert 8) + (dist meters :offset-assert 12) + (num-func (function joint-control-channel float float float) :offset-assert 16) + (param float 3 :offset-assert 20) + (frame-interp float 2 :offset-assert 32) + (inspector-amount uint8 :offset-assert 40) + (command joint-control-command :offset-assert 48) + (group-sub-index int8 :offset-assert 56) + (grou-size int8 :offset-assert 57) + (eval-time uint32 :offset-assert 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype top-anim-joint-control (basic) + ((process uint32 :offset-assert 4) + (interp-select uint64 2 :offset-assert 8) + (base-anim basic :offset-assert 24) + (base-anim-speed float :offset-assert 28) + (base-anim-blend float :offset-assert 32) + (interp float :offset-assert 36) + (frame-group basic :offset-assert 40) + (frame-group-push basic :offset-assert 44) + (frame-num float :offset-assert 48) + (frame-targ basic :offset-assert 52) + (frame-speed float :offset-assert 56) + (frame-blend float :offset-assert 60) + (frame-cur-blend float :offset-assert 64) + (frame-start float :offset-assert 68) + (frame-post-blend float :offset-assert 72) + (frame-post-end float :offset-assert 76) + (frame-push-time time-frame :offset-assert 80) + (frame-post-put-away basic :offset-assert 88) + (update-time time-frame :offset-assert 96) + ) + :method-count-assert 13 + :size-assert #x68 + :flag-assert #xd00000068 + (:methods + (top-anim-joint-control-method-9 () none 9) + (top-anim-joint-control-method-10 () none 10) + (top-anim-joint-control-method-11 () none 11) + (top-anim-joint-control-method-12 () none 12) + ) + ) + +(deftype joint-control (basic) + ((status joint-control-status :offset-assert 4) + (allocated-length uint8 :offset-assert 6) + (active-channels uint8 :offset-assert 7) + (root-channel uint32 :offset 16) + (blend-index uint8 :offset-assert 20) + (active-frame-interp uint8 :offset-assert 21) + (float-channels uint8 :offset-assert 22) + (generate-frame-function function :offset-assert 24) + (prebind-function function :offset-assert 28) + (postbind-function function :offset-assert 32) + (effect basic :offset-assert 36) + (interp-select int64 2 :offset-assert 40) + (top-anim basic :offset-assert 56) + (override basic :offset-assert 60) + (channel joint-control-channel :inline :dynamic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + (:methods + (joint-control-method-9 () none 9) + (joint-control-method-10 () none 10) + (joint-control-method-11 () none 11) + ) + ) + +(deftype matrix-stack (structure) + ((top matrix :offset-assert 0) + (data matrix 24 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x610 + :flag-assert #x900000610 + ) + + +(deftype channel-upload-info (structure) + ((fixed joint-anim-compressed-fixed :offset-assert 0) + (fixed-qwc int32 :offset-assert 4) + (frame joint-anim-compressed-frame :offset-assert 8) + (frame-qwc int32 :offset-assert 12) + (amount float :offset-assert 16) + (interp float :offset-assert 20) + ) + :pack-me + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(deftype joint-work (structure) + ((temp-mtx matrix :inline :offset-assert 0) + (joint-stack matrix-stack :inline :offset-assert 64) + (fix-jmp-table (function none) 16 :offset-assert 1616) + (frm-jmp-table (function none) 16 :offset-assert 1680) + (pair-jmp-table (function none) 16 :offset-assert 1744) + (uploads channel-upload-info 24 :inline :offset-assert 1808) + (num-uploads int32 :offset-assert 2384) + (mtx-acc matrix 2 :inline :offset-assert 2400) + (tq-acc transformq 100 :inline :offset-assert 2528) + (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) + (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) + (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) + (flatten-array float 576 :offset 2400) + (flattened vector 24 :offset 2400) + ) + :method-count-assert 9 + :size-assert #x3640 + :flag-assert #x900003640 + ) diff --git a/goal_src/jak2/engine/anim/joint-mod-h.gc b/goal_src/jak2/engine/anim/joint-mod-h.gc index df9f57bbf9..fedfaa7405 100644 --- a/goal_src/jak2/engine/anim/joint-mod-h.gc +++ b/goal_src/jak2/engine/anim/joint-mod-h.gc @@ -5,5 +5,607 @@ ;; name in dgo: joint-mod-h ;; dgos: ENGINE, GAME +(defenum joint-mod-mode + :bitfield #f + :type uint32 + + ) + +(defenum track-mode + :bitfield #t + :type uint16 + (track-on 0) ;; 1 + (track-x 1) ;; 2 + (track-y 2) ;; 4 + (lock-on 3) ;; 8 + (no-trans 4) ;; 16 + (no-rotate 5) ;; 32 + (no-scale 6) ;; 64 + ) + ;; DECOMP BEGINS +(deftype joint-mod (basic) + ((mode joint-mod-mode :offset-assert 4) + (process process :offset-assert 8) + (joint cspace :offset-assert 12) + (target vector :inline :offset 16) + (twist vector :inline :offset 32) + (twist-max float 4 :offset-assert 48) + (extra-twist degrees :offset 40) + (track-mode track-mode :offset 44) + (loock-at-count uint16 :offset 46) + (twist-range-x meters :offset 56) + (twist-range-y meters :offset 60) + (twist-speed-x float :offset 64) + (twist-speed-y float :offset 68) + (twist-min-x float :offset 72) + (twist-min-y float :offset 76) + (trans vector :inline :offset-assert 80) + (shmushy-old float :offset 80) + (smushy-off float :offset 84) + (smushyv float :offset 88) + (quat quaternion :inline :offset-assert 96) + (scale vector :inline :offset-assert 112) + (notice-time time-frame :offset-assert 128) + (flex-blend float :offset-assert 136) + (blend float :offset-assert 140) + (max-dist meters :offset-assert 144) + (ignore-angle degrees :offset-assert 148) + (up uint8 :offset-assert 152) + (nose uint8 :offset-assert 153) + (ear uint8 :offset-assert 154) + (base-joint uint8 :offset-assert 155) + (base-nose uint8 :offset-assert 156) + (shutting-down? symbol :offset-assert 160) + (parented-scale? symbol :offset-assert 164) + (polar-internal-tilt-max float :offset-assert 168) + (polar-internal-radius float :offset-assert 172) + (polar-external-tilt-max float :offset-assert 176) + (polar-external-radius float :offset-assert 180) + ) + :method-count-assert 16 + :size-assert #xb8 + :flag-assert #x10000000b8 + (:methods + (joint-mod-method-9 () none 9) + (joint-mod-method-10 () none 10) + (joint-mod-method-11 () none 11) + (reset-blend! (_type_) _type_ 12) + (joint-mod-method-13 () none 13) + (joint-mod-method-14 () none 14) + (joint-mod-method-15 () none 15) + ) + ) + +(deftype try-to-look-at-info (basic) + ((who uint64 :offset-assert 8) + (horz float :offset-assert 16) + (vert float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + + +(defun-debug joint-mod-debug-draw ((arg0 joint-mod)) + (add-debug-matrix #t (bucket-id bucket-318) (-> arg0 joint bone transform) 8192.0) + 0 + (none) + ) + +(defmethod reset-blend! joint-mod ((obj joint-mod)) + (set! (-> obj blend) 0.0) + obj + ) + +(define *joint-axis-vectors* (new 'static 'inline-array vector 6 + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y -1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + +(deftype joint-mod-wheel (basic) + ((last-position vector :inline :offset-assert 16) + (angle float :offset-assert 32) + (process process-drawable :offset-assert 36) + (wheel-radius float :offset-assert 40) + (wheel-axis int8 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x2d + :flag-assert #x90000002d + (:methods + (new (symbol type process-drawable int float int) _type_ 0) + ) + ) + +(defmethod inspect joint-mod-wheel ((obj joint-mod-wheel)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlast-position: #~%" (-> obj last-position)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Twheel-radius: ~f~%" (-> obj wheel-radius)) + (format #t "~1Twheel-axis: ~D~%" (-> obj wheel-axis)) + (label cfg-4) + obj + ) + +(defun joint-mod-wheel-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as joint-mod-wheel (-> arg0 param1)))) + (let ((v1-1 (-> s4-0 process root)) + (s1-0 (new-stack-vector0)) + (s3-0 (new-stack-vector0)) + (s2-0 (new-stack-vector0)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s2-0 (-> v1-1 quat)) + (vector<-cspace! s1-0 arg0) + (vector-! s3-0 s1-0 (-> s4-0 last-position)) + (set! (-> s4-0 last-position quad) (-> s1-0 quad)) + (let* ((f0-3 (vector-dot s2-0 s3-0)) + (f1-0 65536.0) + (f2-1 (* 6.28318 (-> s4-0 wheel-radius))) + (f0-4 (* f1-0 (/ 1.0 f2-1) f0-3)) + ) + (+! (-> s4-0 angle) f0-4) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) (-> *joint-axis-vectors* (-> s4-0 wheel-axis)) (-> s4-0 angle)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defmethod new joint-mod-wheel ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 int)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 process) arg0) + (set! (-> v0-0 wheel-radius) arg2) + (set! (-> v0-0 wheel-axis) arg3) + (set! (-> v0-0 angle) 0.0) + (set-vector! (-> v0-0 last-position) 0.0 0.0 0.0 1.0) + (let ((a0-3 (-> arg0 node-list data arg1))) + (set! (-> a0-3 param0) joint-mod-wheel-callback) + (set! (-> a0-3 param1) v0-0) + ) + v0-0 + ) + ) + +(deftype joint-mod-set-local (basic) + ((transform transformq :inline :offset-assert 16) + (set-rotation symbol :offset-assert 64) + (set-scale symbol :offset-assert 68) + (set-translation symbol :offset-assert 72) + (enable symbol :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + (:methods + (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + ) + ) + +(defun joint-mod-set-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as joint-mod-set-local (-> arg0 param1)))) + (cond + ((-> v1-0 enable) + (if (not (-> v1-0 set-translation)) + (set! (-> v1-0 transform trans quad) (-> arg1 trans quad)) + ) + (if (not (-> v1-0 set-rotation)) + (set! (-> v1-0 transform quat vec quad) (-> arg1 quat vec quad)) + ) + (if (not (-> v1-0 set-scale)) + (set! (-> v1-0 transform scale quad) (-> arg1 scale quad)) + ) + (cspace<-parented-transformq-joint! arg0 (-> v1-0 transform)) + ) + (else + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + ) + (none) + ) + +(defmethod new joint-mod-set-local ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 symbol) + (arg3 symbol) + (arg4 symbol) + ) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 set-translation) arg2) + (set! (-> v0-0 set-rotation) arg3) + (set! (-> v0-0 set-scale) arg4) + (set! (-> v0-0 enable) #t) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-set-local-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +(deftype joint-mod-add-local (basic) + ((transform transformq :inline :offset-assert 16) + (add-rotation symbol :offset-assert 64) + (add-scale symbol :offset-assert 68) + (add-translation symbol :offset-assert 72) + (enable symbol :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + (:methods + (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + ) + ) + +(defun joint-mod-add-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as joint-mod-add-local (-> arg0 param1)))) + (when (-> s4-0 enable) + (if (-> s4-0 add-translation) + (vector+! (-> arg1 trans) (-> arg1 trans) (the-as vector (-> s4-0 transform))) + ) + (if (-> s4-0 add-rotation) + (quaternion-normalize! (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> s4-0 transform quat))) + ) + (if (-> s4-0 add-scale) + (vector+! (-> arg1 scale) (-> arg1 scale) (-> s4-0 transform scale)) + ) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defmethod new joint-mod-add-local ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 symbol) + (arg3 symbol) + (arg4 symbol) + ) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 add-translation) arg2) + (set! (-> gp-0 add-rotation) arg3) + (set! (-> gp-0 add-scale) arg4) + (set! (-> gp-0 enable) #t) + (set! (-> gp-0 transform trans quad) (-> *null-vector* quad)) + (quaternion-copy! (-> gp-0 transform quat) *unity-quaternion*) + (set! (-> gp-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-7 (-> arg0 node-list data arg1))) + (set! (-> a0-7 param0) joint-mod-add-local-callback) + (set! (-> a0-7 param1) gp-0) + ) + gp-0 + ) + ) + +(deftype joint-mod-set-world (basic) + ((transform transformq :inline :offset-assert 16) + (node-index int32 :offset-assert 64) + (enable symbol :offset-assert 68) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + (:methods + (new (symbol type process-drawable int symbol) _type_ 0) + ) + ) + +(defun joint-mod-set-world-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as joint-mod-set-world (-> arg0 param1)))) + (if (-> v1-0 enable) + (cspace<-transformq! arg0 (-> v1-0 transform)) + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + (none) + ) + +(defmethod new joint-mod-set-world ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 node-index) arg1) + (set! (-> v0-0 enable) arg2) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-set-world-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +(deftype joint-mod-blend-local (basic) + ((transform transformq :inline :offset-assert 16) + (blend-transform transformq :inline :offset-assert 64) + (node-index int32 :offset-assert 112) + (blend float :offset-assert 116) + (enable symbol :offset-assert 120) + ) + :method-count-assert 9 + :size-assert #x7c + :flag-assert #x90000007c + (:methods + (new (symbol type process-drawable int symbol) _type_ 0) + ) + ) + +(defun joint-mod-blend-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((gp-0 (the-as joint-mod-blend-local (-> arg0 param1)))) + (cond + ((-> gp-0 enable) + (vector-lerp! + (the-as vector (-> gp-0 blend-transform)) + (-> arg1 trans) + (the-as vector (-> gp-0 transform)) + (-> gp-0 blend) + ) + (vector-lerp! (-> gp-0 blend-transform scale) (-> arg1 scale) (-> gp-0 transform scale) (-> gp-0 blend)) + (quaternion-slerp! (-> gp-0 blend-transform quat) (-> arg1 quat) (-> gp-0 transform quat) (-> gp-0 blend)) + (cspace<-parented-transformq-joint! arg0 (-> gp-0 blend-transform)) + ) + (else + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + ) + (none) + ) + +(defmethod new joint-mod-blend-local ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 node-index) arg1) + (set! (-> v0-0 enable) arg2) + (set! (-> v0-0 blend) 0.0) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-blend-local-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +(deftype joint-mod-spinner (basic) + ((spin-axis vector :inline :offset-assert 16) + (angle float :offset-assert 32) + (spin-rate float :offset-assert 36) + (enable symbol :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + (:methods + (new (symbol type process-drawable int vector float) _type_ 0) + ) + ) + +(defun joint-mod-spinner-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((gp-0 (the-as joint-mod-spinner (-> arg0 param1)))) + (when (-> gp-0 enable) + (let ((f30-0 + (the float + (sar (shl (the int (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (-> pp clock seconds-per-frame)))) 48) 48) + ) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) (-> gp-0 spin-axis) f30-0) + (set! (-> gp-0 angle) f30-0) + ) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + ) + +(defmethod new joint-mod-spinner ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 vector) (arg3 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 spin-axis quad) (-> arg2 quad)) + (set! (-> v0-0 spin-rate) arg3) + (set! (-> v0-0 enable) #t) + (set! (-> v0-0 angle) 0.0) + (let ((a0-3 (-> arg0 node-list data arg1))) + (set! (-> a0-3 param0) joint-mod-spinner-callback) + (set! (-> a0-3 param1) v0-0) + ) + v0-0 + ) + ) + +(deftype joint-mod-blend-world (basic) + ((transform transformq :inline :offset-assert 16) + (blend-transform transformq :inline :offset-assert 64) + (blend-flags uint32 :offset-assert 112) + (node-index int32 :offset-assert 116) + (blend float :offset-assert 120) + (enable symbol :offset-assert 124) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + (:methods + (new (symbol type process-drawable int symbol float) _type_ 0) + ) + ) + +(defun joint-mod-blend-world-callback ((arg0 cspace) (arg1 transformq)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as joint-mod-blend-world (-> arg0 param1)))) + (cond + ((-> gp-0 enable) + (let ((f30-0 (if (logtest? (-> gp-0 blend-flags) 1) + (-> gp-0 blend) + 0.0 + ) + ) + (f28-0 (if (logtest? (-> gp-0 blend-flags) 2) + (-> gp-0 blend) + 0.0 + ) + ) + (f26-0 (if (logtest? (-> gp-0 blend-flags) 4) + (-> gp-0 blend) + 0.0 + ) + ) + (s0-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (if (= (-> arg0 parent bone scale w) 0.0) + (matrix<-transformq! s0-0 arg1) + (matrix<-parented-transformq! s0-0 arg1 (-> arg0 parent bone scale)) + ) + (matrix*! s2-0 s0-0 (-> arg0 parent bone transform)) + (set-vector! + s1-0 + (vector-length (the-as vector (-> s2-0 data))) + (vector-length (the-as vector (&-> s2-0 data 4))) + (vector-length (the-as vector (&-> s2-0 data 8))) + 1.0 + ) + (let ((v1-19 (-> gp-0 blend-transform scale))) + (let ((a0-11 (-> arg1 scale))) + (.lvf vf4 (&-> s1-0 quad)) + (.lvf vf5 (&-> a0-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-19 quad) vf6) + ) + ) + (vector-lerp! + (the-as vector (-> gp-0 blend-transform)) + (-> s2-0 trans) + (the-as vector (-> gp-0 transform)) + f30-0 + ) + (vector-lerp! (-> gp-0 blend-transform scale) (-> gp-0 blend-transform scale) (-> gp-0 transform scale) f28-0) + (quaternion-slerp! + (-> gp-0 blend-transform quat) + (matrix->quaternion s3-0 s2-0) + (-> gp-0 transform quat) + f26-0 + ) + ) + (cspace<-transformq! arg0 (-> gp-0 blend-transform)) + ) + (else + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + ) + (none) + ) + ) + +(defmethod new joint-mod-blend-world ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 node-index) arg1) + (set! (-> v0-0 enable) arg2) + (set! (-> v0-0 blend) arg3) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-blend-world-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +(deftype joint-mod-rotate-local (basic) + ((enable symbol :offset-assert 4) + (rotation quaternion :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + (:methods + (new (symbol type process-drawable int symbol) _type_ 0) + ) + ) + +(defun joint-mod-rotate-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as joint-mod-rotate-local (-> arg0 param1)))) + (new 'stack-no-clear 'vector) + (if (-> v1-0 enable) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> v1-0 rotation)) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defmethod new joint-mod-rotate-local ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 enable) arg2) + (quaternion-set! (-> gp-0 rotation) 0.0 0.0 0.0 1.0) + (let ((a0-3 (-> arg0 node-list data arg1))) + (set! (-> a0-3 param0) joint-mod-rotate-local-callback) + (set! (-> a0-3 param1) gp-0) + ) + gp-0 + ) + ) + +(deftype joint-mod-ik (basic) + ((flags uint32 :offset-assert 4) + (process basic :offset-assert 8) + (hand-dist float :offset-assert 12) + (handle-pos vector :inline :offset-assert 16) + (elbow-pole-vector-axis uint32 :offset-assert 32) + (elbow-rotation-axis uint32 :offset-assert 36) + (user-position vector :inline :offset-assert 48) + (user-normal vector :inline :offset-assert 64) + (user-blend float :offset-assert 80) + (user-float float :offset-assert 84) + (callback basic :offset-assert 88) + (shoulder-matrix-no-ik matrix :inline :offset-assert 96) + (elbow-matrix-no-ik matrix :inline :offset-assert 160) + (blend float :offset-assert 224) + (blend-interp float :offset-assert 228) + ) + :method-count-assert 11 + :size-assert #xe8 + :flag-assert #xb000000e8 + (:methods + (joint-mod-ik-method-9 () none 9) + (joint-mod-ik-method-10 () none 10) + ) + ) diff --git a/goal_src/jak2/engine/anim/mspace-h.gc b/goal_src/jak2/engine/anim/mspace-h.gc index c11718ea14..ac99a2599f 100644 --- a/goal_src/jak2/engine/anim/mspace-h.gc +++ b/goal_src/jak2/engine/anim/mspace-h.gc @@ -6,4 +6,90 @@ ;; dgos: ENGINE, GAME ;; DECOMP BEGINS +(deftype joint (basic) + ((name basic :offset-assert 4) + (number int32 :offset-assert 8) + (parent joint :offset-assert 12) + (bind-pose matrix :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) +(deftype bone-cache (structure) + ((bone-matrix uint32 :offset-assert 0) + (parent-matrix uint32 :offset-assert 4) + (dummy uint32 :offset-assert 8) + (frame uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype bone (structure) + ((transform matrix :inline :offset-assert 0) + (position vector :inline :offset 48) + (scale vector :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype skeleton (inline-array-class) + ((bones bone :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> skeleton heap-base) (the-as uint 80)) + +(deftype cspace (structure) + ((parent cspace :offset-assert 0) + (joint joint :offset-assert 4) + (joint-num int16 :offset-assert 8) + (geo basic :offset-assert 12) + (bone bone :offset-assert 16) + (param0 function :offset-assert 20) + (param1 basic :offset-assert 24) + (param2 basic :offset-assert 28) + ) + :method-count-assert 10 + :size-assert #x20 + :flag-assert #xa00000020 + (:methods + (cspace-method-9 () none 9) + ) + ) + +(deftype cspace-array (inline-array-class) + ((data cspace :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> cspace-array heap-base) (the-as uint 32)) + +(defmethod print cspace ((obj cspace)) + (format + #t + "#" + (if (-> obj joint) + (-> obj joint name) + "nojoint" + ) + obj + ) + obj + ) + +;; DECOMP ENDS + +(define-extern cspace<-parented-transformq-joint! (function cspace transformq none)) +(define-extern cspace<-transformq! (function cspace transformq matrix)) +(define-extern matrix<-transformq! (function matrix transformq matrix)) +(define-extern matrix<-parented-transformq! (function matrix transformq vector matrix)) \ No newline at end of file diff --git a/goal_src/jak2/engine/camera/cam-debug-h.gc b/goal_src/jak2/engine/camera/cam-debug-h.gc index 1212b8643b..488162fb01 100644 --- a/goal_src/jak2/engine/camera/cam-debug-h.gc +++ b/goal_src/jak2/engine/camera/cam-debug-h.gc @@ -7,3 +7,106 @@ ;; DECOMP BEGINS +(declare-file (debug)) +(when *debug-segment* +(define *redline-table* (the-as (pointer float) (malloc 'debug 1600))) +(define *redline-index* 0) + +(defun float-save-redline ((arg0 float)) + (set! (-> *redline-table* *redline-index*) arg0) + (set! *redline-index* (+ *redline-index* 1)) + (when (>= *redline-index* 400) + (set! *redline-index* 0) + 0 + ) + (none) + ) + +(defun float-lookup-redline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *redline-index*) 400))) + (-> *redline-table* a0-3) + ) + ) + +(define *blueline-table* (the-as (pointer float) (malloc 'debug 1600))) +(define *blueline-index* 0) + +(defun float-save-blueline ((arg0 float)) + (set! (-> *blueline-table* *blueline-index*) arg0) + (set! *blueline-index* (+ *blueline-index* 1)) + (when (>= *blueline-index* 400) + (set! *blueline-index* 0) + 0 + ) + (none) + ) + +(defun float-lookup-blueline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *blueline-index*) 400))) + (-> *blueline-table* a0-3) + ) + ) + +(define *greenline-table* (the-as (pointer float) (malloc 'debug 1600))) +(define *greenline-index* 0) + +(defun float-save-greenline ((arg0 float)) + (set! (-> *greenline-table* *greenline-index*) arg0) + (set! *greenline-index* (+ *greenline-index* 1)) + (when (>= *greenline-index* 400) + (set! *greenline-index* 0) + 0 + ) + (none) + ) + +(defun float-lookup-greenline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *greenline-index*) 400))) + (-> *greenline-table* a0-3) + ) + ) + +(define *yellowline-table* (the-as (pointer float) (malloc 'debug 1600))) +(define *yellowline-index* 0) + +(defun float-save-yellowline ((arg0 float)) + (set! (-> *yellowline-table* *yellowline-index*) arg0) + (set! *yellowline-index* (+ *yellowline-index* 1)) + (when (>= *yellowline-index* 400) + (set! *yellowline-index* 0) + 0 + ) + (none) + ) + +(defun float-lookup-yellowline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *yellowline-index*) 400))) + (-> *yellowline-table* a0-3) + ) + ) + +(define *timeplot-table* (the-as (pointer float) (malloc 'debug 1600))) +(define *timeplot-index* 0) + +(defun float-save-timeplot ((arg0 float)) + (set! (-> *timeplot-table* *timeplot-index*) arg0) + (set! *timeplot-index* (+ *timeplot-index* 1)) + (when (>= *timeplot-index* 400) + (set! *timeplot-index* 0) + 0 + ) + (none) + ) + +(defun float-lookup-timeplot ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *timeplot-index*) 400))) + (-> *timeplot-table* a0-3) + ) + ) + +(define-perm *cam-layout* symbol #f) + +) + + + diff --git a/goal_src/jak2/engine/camera/cam-interface-h.gc b/goal_src/jak2/engine/camera/cam-interface-h.gc index 804947b99e..c80ced9d9a 100644 --- a/goal_src/jak2/engine/camera/cam-interface-h.gc +++ b/goal_src/jak2/engine/camera/cam-interface-h.gc @@ -5,5 +5,13 @@ ;; name in dgo: cam-interface-h ;; dgos: ENGINE, GAME +(define-extern camera-pos (function vector)) + ;; DECOMP BEGINS +(define-perm *camera-init-mat* matrix #f) + +(define-perm *camera* camera-master #f) + +(define-perm *camera-combiner* camera-combiner #f) + diff --git a/goal_src/jak2/engine/camera/cam-update-h.gc b/goal_src/jak2/engine/camera/cam-update-h.gc index 24fc0154a7..f7785ac26d 100644 --- a/goal_src/jak2/engine/camera/cam-update-h.gc +++ b/goal_src/jak2/engine/camera/cam-update-h.gc @@ -5,5 +5,28 @@ ;; name in dgo: cam-update-h ;; dgos: ENGINE, GAME +(defenum external-cam-option + :bitfield #t + (allow-z 0) + ) + + ;; DECOMP BEGINS +(define *external-cam-options* (the-as external-cam-option 0)) + +(define *external-cam-mode* #f) + +(define-extern *camera-look-through-other* int) +(when (or (not *camera-look-through-other*) (zero? *camera-look-through-other*)) + (set! *camera-look-through-other* 0) + 0 + ) + +(define-perm *camera-other-fov* bfloat (new 'static 'bfloat :data 11650.845)) +(define-perm *camera-other-trans* vector (vector-reset! (new 'global 'vector))) +(define-perm *camera-other-matrix* matrix (matrix-identity! (new 'global 'matrix))) +(define-perm *camera-smush-control* smush-control (set-zero! (new 'global 'smush-control))) +(define-perm *camera-other-root* vector (vector-reset! (new 'global 'vector))) +(define *fix-visible-level-mask* 6) +(define *manual-sample-point* #f) diff --git a/goal_src/jak2/engine/camera/camera-defs-h.gc b/goal_src/jak2/engine/camera/camera-defs-h.gc index c7ce771300..2dd206ad07 100644 --- a/goal_src/jak2/engine/camera/camera-defs-h.gc +++ b/goal_src/jak2/engine/camera/camera-defs-h.gc @@ -7,3 +7,60 @@ ;; DECOMP BEGINS +(deftype camera-bank (basic) + ((collide-move-rad float :offset-assert 4) + (joypad uint32 :offset-assert 8) + (min-detectable-velocity float :offset-assert 12) + (attack-timeout time-frame :offset-assert 16) + (default-string-max-y meters :offset-assert 24) + (default-string-min-y meters :offset-assert 28) + (default-string-max-z meters :offset-assert 32) + (default-string-min-z meters :offset-assert 36) + (default-string-push-z meters :offset-assert 40) + (default-tilt-adjust degrees :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(define *CAMERA-bank* (new 'static 'camera-bank + :collide-move-rad 1638.4 + :min-detectable-velocity 40.96 + :attack-timeout (seconds 0.25) + :default-string-max-y (meters 3) + :default-string-min-y (meters 1) + :default-string-max-z (meters 12.5) + :default-string-min-z (meters 5) + :default-string-push-z (meters 10) + :default-tilt-adjust (degrees -6.5000005) + ) + ) + +(deftype camera-master-bank (basic) + ((onscreen-head-height meters :offset-assert 4) + (onscreen-foot-height meters :offset-assert 8) + (target-height meters :offset-assert 12) + (up-move-to-pitch-ratio-in-air float :offset-assert 16) + (down-move-to-pitch-ratio-in-air float :offset-assert 20) + (up-move-to-pitch-on-ground float :offset-assert 24) + (down-move-to-pitch-on-ground float :offset-assert 28) + (pitch-off-blend float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(define *CAMERA_MASTER-bank* (new 'static 'camera-master-bank + :onscreen-head-height (meters 2.65) + :onscreen-foot-height (meters -0.5) + :target-height (meters 2.15) + :up-move-to-pitch-ratio-in-air 1.0 + :down-move-to-pitch-ratio-in-air 0.5 + :up-move-to-pitch-on-ground 0.9 + :down-move-to-pitch-on-ground 0.9 + :pitch-off-blend 0.5 + ) + ) + diff --git a/goal_src/jak2/engine/camera/camera-h.gc b/goal_src/jak2/engine/camera/camera-h.gc index b6929801a3..9f8182024e 100644 --- a/goal_src/jak2/engine/camera/camera-h.gc +++ b/goal_src/jak2/engine/camera/camera-h.gc @@ -5,5 +5,388 @@ ;; name in dgo: camera-h ;; dgos: ENGINE, GAME +(defenum cam-index-options + :type uint32 + :bitfield #t + (RADIAL) + (SPHERICAL) + ) + +(defenum slave-los-state + :type uint32 + (none 0) + (cw 1) + (ccw 2) + (between 3) + ) + ;; DECOMP BEGINS +(deftype cam-index (structure) + ((flags cam-index-options :offset-assert 0) + (vec vector 2 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x30 + :flag-assert #xb00000030 + (:methods + (cam-index-method-9 () none 9) + (cam-index-method-10 () none 10) + ) + ) + +(deftype tracking-point (structure) + ((position vector :inline :offset-assert 0) + (direction vector :inline :offset-assert 16) + (tp-length float :offset-assert 32) + (next int32 :offset-assert 36) + (incarnation int32 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype tracking-spline-sampler (structure) + ((cur-pt int32 :offset-assert 0) + (partial-pt float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype tracking-spline (structure) + ((point tracking-point 32 :inline :offset-assert 0) + (summed-len float :offset-assert 1536) + (free-point int32 :offset-assert 1540) + (used-point int32 :offset-assert 1544) + (partial-point float :offset-assert 1548) + (end-point int32 :offset-assert 1552) + (next-to-last-point int32 :offset-assert 1556) + (max-move float :offset-assert 1560) + (sample-len float :offset-assert 1564) + (used-count int32 :offset-assert 1568) + (old-position vector :inline :offset-assert 1584) + (debug-old-position vector :inline :offset-assert 1600) + (debug-out-position vector :inline :offset-assert 1616) + (debug-last-point int32 :offset-assert 1632) + ) + :method-count-assert 24 + :size-assert #x664 + :flag-assert #x1800000664 + (:methods + (tracking-spline-method-9 () none 9) + (tracking-spline-method-10 () none 10) + (tracking-spline-method-11 () none 11) + (tracking-spline-method-12 () none 12) + (tracking-spline-method-13 () none 13) + (tracking-spline-method-14 () none 14) + (tracking-spline-method-15 () none 15) + (tracking-spline-method-16 () none 16) + (tracking-spline-method-17 () none 17) + (tracking-spline-method-18 () none 18) + (tracking-spline-method-19 () none 19) + (tracking-spline-method-20 () none 20) + (tracking-spline-method-21 () none 21) + (tracking-spline-method-22 () none 22) + (tracking-spline-method-23 () none 23) + ) + ) + +(deftype cam-float-seeker (structure) + ((target float :offset-assert 0) + (value float :offset-assert 4) + (vel float :offset-assert 8) + (accel float :offset-assert 12) + (max-vel float :offset-assert 16) + (max-partial float :offset-assert 20) + ) + :pack-me + :method-count-assert 13 + :size-assert #x18 + :flag-assert #xd00000018 + (:methods + (init (_type_ float float float float) none 9) + (copy-to (_type_ _type_) none 10) + (update! (_type_ float) none 11) + (jump-to-target! (_type_ float) float 12) + ) + ) + +(defmethod init cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj target) arg0) + (set! (-> obj value) arg0) + (set! (-> obj vel) 0.0) + (set! (-> obj accel) arg1) + (set! (-> obj max-vel) arg2) + (set! (-> obj max-partial) arg3) + 0 + (none) + ) + +(defmethod copy-to cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) + (set! (-> obj target) (-> arg0 target)) + (set! (-> obj value) (-> arg0 value)) + (set! (-> obj vel) (-> arg0 vel)) + (set! (-> obj accel) (-> arg0 accel)) + (set! (-> obj max-vel) (-> arg0 max-vel)) + (set! (-> obj max-partial) (-> arg0 max-partial)) + 0 + (none) + ) + +(defmethod update! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) + (with-pp + 0.0 + 0.0 + (let* ((f1-2 (- (+ (-> obj target) arg0) (-> obj value))) + (f0-5 (* (-> obj max-partial) (fabs f1-2))) + ) + (let ((f1-3 (* f1-2 (* (-> obj accel) (-> pp clock time-adjust-ratio))))) + (+! (-> obj vel) f1-3) + ) + (let ((f1-6 (fabs (-> obj vel))) + (f0-6 (fmin f0-5 (-> obj max-vel))) + ) + (if (< f0-6 f1-6) + (set! (-> obj vel) (* (-> obj vel) (/ f0-6 f1-6))) + ) + ) + ) + (let ((f0-10 (* (-> obj vel) (-> pp clock time-adjust-ratio)))) + (+! (-> obj value) f0-10) + ) + 0 + (none) + ) + ) + +(defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) + (set! (-> obj value) (+ (-> obj target) arg0)) + (set! (-> obj vel) 0.0) + 0.0 + ) + +(deftype cam-vector-seeker (structure) + ((target vector :inline :offset-assert 0) + (value vector :inline :offset-assert 16) + (vel vector :inline :offset-assert 32) + (accel float :offset-assert 48) + (max-vel float :offset-assert 52) + (max-partial float :offset-assert 56) + ) + :method-count-assert 11 + :size-assert #x3c + :flag-assert #xb0000003c + (:methods + (init (_type_ vector float float float) none 9) + (update! (_type_ vector) none 10) + ) + ) + +(defmethod init cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) + (cond + (arg0 + (set! (-> obj target quad) (-> arg0 quad)) + (set! (-> obj value quad) (-> arg0 quad)) + ) + (else + (vector-reset! (-> obj target)) + (vector-reset! (-> obj value)) + ) + ) + (vector-reset! (-> obj vel)) + (set! (-> obj accel) arg1) + (set! (-> obj max-vel) arg2) + (set! (-> obj max-partial) arg3) + 0 + (none) + ) + +(defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) + (with-pp + (let ((v1-0 (new 'stack-no-clear 'vector))) + 0.0 + (cond + (arg0 + (vector+! v1-0 (-> obj target) arg0) + (vector-! v1-0 v1-0 (-> obj value)) + ) + (else + (vector-! v1-0 (-> obj target) (-> obj value)) + ) + ) + (let ((f0-2 (* (-> obj max-partial) (vector-length v1-0)))) + (vector-float*! v1-0 v1-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> obj vel) (-> obj vel) v1-0) + (let ((f1-3 (vector-length (-> obj vel))) + (f0-3 (fmin f0-2 (-> obj max-vel))) + ) + (if (< f0-3 f1-3) + (vector-float*! (-> obj vel) (-> obj vel) (/ f0-3 f1-3)) + ) + ) + ) + (vector-float*! v1-0 (-> obj vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> obj value) (-> obj value) v1-0) + ) + 0 + (none) + ) + ) + +(deftype cam-rotation-tracker (structure) + ((inv-mat matrix :inline :offset-assert 0) + (no-follow basic :offset-assert 64) + (follow-pt vector :inline :offset-assert 80) + (follow-off vector :inline :offset-assert 96) + (follow-blend float :offset-assert 112) + (tilt-adjust cam-float-seeker :inline :offset-assert 116) + (point-of-interest-blend cam-float-seeker :inline :offset-assert 140) + (underwater-blend cam-float-seeker :inline :offset-assert 164) + (looking-at vector :inline :offset-assert 192) + (looking-interesting vector :inline :offset-assert 208) + (old-cam-trans vector :inline :offset-assert 224) + (follow-height-extra cam-float-seeker :inline :offset-assert 240) + ) + :method-count-assert 9 + :size-assert #x108 + :flag-assert #x900000108 + ) + +(deftype camera-combiner (process) + ((trans vector :inline :offset-assert 128) + (inv-camera-rot matrix :inline :offset-assert 144) + (fov float :offset-assert 208) + (interp-val float :offset-assert 212) + (interp-step float :offset-assert 216) + (dist-from-src float :offset-assert 220) + (dist-from-dest float :offset-assert 224) + (flip-control-axis vector :inline :offset-assert 240) + (velocity vector :inline :offset-assert 256) + (tracking-status uint64 :offset-assert 272) + (tracking-options int32 :offset-assert 280) + (tracking cam-rotation-tracker :inline :offset-assert 288) + (fast-rot basic :offset-assert 552) + ) + :heap-base #x1b0 + :method-count-assert 14 + :size-assert #x22c + :flag-assert #xe01b0022c + ) + +(deftype camera-slave (process) + ((trans vector :inline :offset-assert 128) + (fov float :offset-assert 144) + (fov0 float :offset-assert 148) + (fov1 float :offset-assert 152) + (fov-index cam-index :inline :offset-assert 160) + (tracking cam-rotation-tracker :inline :offset-assert 208) + (view-off-param float :offset-assert 472) + (view-off vector :inline :offset-assert 480) + (joystick-saved-view-off vector :inline :offset-assert 496) + (min-z-override float :offset-assert 512) + (view-flat vector :inline :offset-assert 528) + (string-vel-dir uint32 :offset-assert 544) + (string-trans vector :inline :offset-assert 560) + (position-spline tracking-spline :inline :offset-assert 576) + (pivot-pt vector :inline :offset-assert 2224) + (pivot-rad float :offset-assert 2240) + (circular-follow vector :inline :offset-assert 2256) + (max-angle-offset float :offset-assert 2272) + (max-angle-curr float :offset-assert 2276) + (options uint32 :offset-assert 2280) + (cam-entity entity :offset-assert 2284) + (butt-timer uint64 :offset-assert 2288) + (butt-seek basic :offset-assert 2296) + (butt-vector vector :inline :offset-assert 2304) + (velocity vector :inline :offset-assert 2320) + (desired-pos vector :inline :offset-assert 2336) + (time-dist-too-far uint32 :offset-assert 2352) + (los-state slave-los-state :offset-assert 2356) + (good-point vector :inline :offset-assert 2368) + (los-tgt-spline-pt int32 :offset-assert 2384) + (los-tgt-spline-pt-incarnation int32 :offset-assert 2388) + (los-last-pos vector :inline :offset-assert 2400) + (intro-curve curve :inline :offset-assert 2416) + (intro-offset vector :inline :offset-assert 2448) + (intro-t float :offset-assert 2464) + (intro-t-step float :offset-assert 2468) + (outro-exit-value float :offset-assert 2472) + (spline-exists basic :offset-assert 2476) + (spline-curve curve :inline :offset-assert 2480) + (spline-offset vector :inline :offset-assert 2512) + (index cam-index :inline :offset-assert 2528) + (saved-pt vector :inline :offset-assert 2576) + (spline-tt float :offset-assert 2592) + (spline-follow-dist float :offset-assert 2596) + (enter-has-run symbol :offset-assert 2600) + (blend-from-type uint64 :offset-assert 2608) + (blend-to-type uint64 :offset-assert 2616) + (have-phony-joystick basic :offset-assert 2624) + (phony-joystick-x float :offset-assert 2628) + (phony-joystick-y float :offset-assert 2632) + (string-min-val vector :inline :offset-assert 2640) + (string-max-val vector :inline :offset-assert 2656) + (string-val-locked basic :offset-assert 2672) + (relative-position vector :inline :offset-assert 2688) + (string-relative basic :offset-assert 2704) + ) + :heap-base #xa20 + :method-count-assert 14 + :size-assert #xa94 + :flag-assert #xe0a200a94 + ) + +(deftype camera-master (process) + ((master-options uint32 :offset-assert 128) + (settings cam-setting-data :offset-assert 132) + (slave (pointer camera-slave) :offset-assert 136) + (decel uint32 :offset-assert 140) + (slave-options uint32 :offset-assert 144) + (view-off-param-save float :offset-assert 148) + (changer uint32 :offset-assert 152) + (string-min cam-vector-seeker :inline :offset-assert 160) + (string-max cam-vector-seeker :inline :offset-assert 224) + (string-push-z float :offset-assert 284) + (local-down vector :inline :offset-assert 288) + (focus focus :inline :offset-assert 304) + (being-attacked symbol :offset-assert 316) + (attack-start time-frame :offset-assert 320) + (on-ground symbol :offset-assert 328) + (under-water int32 :offset-assert 332) + (on-pole symbol :offset-assert 336) + (tgt-rot-mat matrix :inline :offset-assert 352) + (tgt-face-mat matrix :inline :offset-assert 416) + (tpos-old vector :inline :offset-assert 480) + (tpos-curr vector :inline :offset-assert 496) + (tpos-old-adj vector :inline :offset-assert 512) + (tpos-curr-adj vector :inline :offset-assert 528) + (tpos-tgt vector :inline :offset-assert 544) + (upspeed float :offset-assert 560) + (pitch-off vector :inline :offset-assert 576) + (target-spline tracking-spline :inline :offset-assert 592) + (ease-from vector :inline :offset-assert 2240) + (ease-t float :offset-assert 2256) + (ease-step float :offset-assert 2260) + (ease-to vector :inline :offset-assert 2272) + (outro-curve curve :inline :offset-assert 2288) + (outro-t float :offset-assert 2308) + (outro-t-step float :offset-assert 2312) + (outro-exit-value float :offset-assert 2316) + (water-drip-time time-frame :offset-assert 2320) + (water-drip sparticle-launch-control :offset-assert 2328) + (water-drip-mult float :offset-assert 2332) + (water-drip-speed float :offset-assert 2336) + ) + :heap-base #x8b0 + :method-count-assert 17 + :size-assert #x924 + :flag-assert #x1108b00924 + (:methods + (camera-master-method-14 () none 14) + (camera-master-method-15 () none 15) + (camera-master-method-16 () none 16) + ) + ) diff --git a/goal_src/jak2/engine/camera/pov-camera-h.gc b/goal_src/jak2/engine/camera/pov-camera-h.gc index e589872b9c..04b8f8afb0 100644 --- a/goal_src/jak2/engine/camera/pov-camera-h.gc +++ b/goal_src/jak2/engine/camera/pov-camera-h.gc @@ -5,5 +5,41 @@ ;; name in dgo: pov-camera-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(defenum pov-camera-flag + :bitfield #t + :type int32 + (notify-of-abort 0) + (allow-abort 1) + (inherit-orientation 2) + ) + + +;; DECOMP BEGINS +(deftype pov-camera (process-drawable) + ((flags pov-camera-flag :offset-assert 200) + (debounce-start-time time-frame :offset-assert 208) + (notify-handle uint64 :offset-assert 216) + (anim-name string :offset-assert 224) + (command-list pair :offset-assert 228) + (mask-to-clear process-mask :offset-assert 232) + (music-volume-movie float :offset-assert 236) + (sfx-volume-movie float :offset-assert 240) + ) + :heap-base #x80 + :method-count-assert 30 + :size-assert #xf4 + :flag-assert #x1e008000f4 + (:methods + (pov-camera-method-20 () none 20) + (pov-camera-method-21 () none 21) + (pov-camera-method-22 () none 22) + (pov-camera-method-23 () none 23) + (pov-camera-method-24 () none 24) + (pov-camera-method-25 () none 25) + (pov-camera-method-26 () none 26) + (pov-camera-method-27 () none 27) + (pov-camera-method-28 () none 28) + (pov-camera-method-29 () none 29) + ) + ) diff --git a/goal_src/jak2/engine/collide/collide-cache-h.gc b/goal_src/jak2/engine/collide/collide-cache-h.gc index de1f98b9b6..64358df878 100644 --- a/goal_src/jak2/engine/collide/collide-cache-h.gc +++ b/goal_src/jak2/engine/collide/collide-cache-h.gc @@ -7,3 +7,130 @@ ;; DECOMP BEGINS +(deftype collide-puss-sphere (structure) + ((bsphere sphere :inline :offset-assert 0) + (bbox4w bounding-box4w :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype collide-puss-work (structure) + ((closest-pt vector :inline :offset-assert 0) + (tri-normal vector :inline :offset-assert 16) + (tri-bbox4w bounding-box4w :inline :offset-assert 32) + (spheres-bbox4w bounding-box4w :inline :offset-assert 64) + (spheres collide-puss-sphere 64 :inline :offset-assert 96) + ) + :method-count-assert 11 + :size-assert #xc60 + :flag-assert #xb00000c60 + (:methods + (collide-puss-work-method-9 () none 9) + (collide-puss-work-method-10 () none 10) + ) + ) + +(deftype collide-cache-tri (structure) + ((vertex vector 3 :inline :offset-assert 0) + (extra-quad uint8 16 :offset-assert 48) + (pat pat-surface :offset 48) + (collide-ptr basic :offset 52) + (prim-index uint16 :offset 56) + (user16 uint16 :offset 58) + (user32 uint32 :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype collide-cache-prim (structure) + ((prim-core collide-prim-core :inline :offset-assert 0) + (extra-quad uint8 16 :offset-assert 32) + (ccache collide-cache :offset 32) + (prim collide-shape-prim :offset 36) + (first-tri uint16 :offset 40) + (num-tris uint16 :offset 42) + (unused uint8 4 :offset 44) + (world-sphere vector :inline :offset 0) + (collide-as collide-spec :offset 16) + (action collide-action :offset 24) + (prim-type prim-type :offset 28) + ) + :method-count-assert 11 + :size-assert #x30 + :flag-assert #xb00000030 + (:methods + (collide-cache-prim-method-9 () none 9) + (collide-cache-prim-method-10 () none 10) + ) + ) + +(deftype collide-cache (basic) + ((num-tris int32 :offset-assert 4) + (num-prims int32 :offset-assert 8) + (ignore-mask pat-surface :offset-assert 12) + (ignore-processes process 2 :offset-assert 16) + (collide-box bounding-box :inline :offset-assert 32) + (collide-box4w bounding-box4w :inline :offset-assert 64) + (collide-with collide-spec :offset-assert 96) + (unused uint32 :offset-assert 100) + (prims collide-cache-prim 100 :inline :offset-assert 112) + (tris collide-cache-tri 461 :inline :offset-assert 4912) + ) + :method-count-assert 26 + :size-assert #x8670 + :flag-assert #x1a00008670 + (:methods + (collide-cache-method-9 () none 9) + (collide-cache-method-10 () none 10) + (collide-cache-method-11 () none 11) + (collide-cache-method-12 () none 12) + (collide-cache-method-13 () none 13) + (collide-cache-method-14 () none 14) + (collide-cache-method-15 () none 15) + (collide-cache-method-16 () none 16) + (collide-cache-method-17 () none 17) + (collide-cache-method-18 () none 18) + (collide-cache-method-19 () none 19) + (collide-cache-method-20 () none 20) + (collide-cache-method-21 () none 21) + (collide-cache-method-22 () none 22) + (collide-cache-method-23 () none 23) + (collide-cache-method-24 () none 24) + (collide-cache-method-25 () none 25) + ) + ) + +(deftype collide-list-item (structure) + ((mesh collide-frag-mesh :offset-assert 0) + (inst basic :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype collide-list (structure) + ((num-items int32 :offset-assert 0) + (items collide-list-item 256 :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x810 + :flag-assert #x900000810 + ) + +(kmemopen global "collide-cache") + +(define-perm *collide-cache* collide-cache (new 'global 'collide-cache)) + +(define-perm *collide-list* collide-list (new 'global 'collide-list)) + +(kmemclose) + + + + diff --git a/goal_src/jak2/engine/collide/collide-edge-grab-h.gc b/goal_src/jak2/engine/collide/collide-edge-grab-h.gc index 2265b3a02b..e797030703 100644 --- a/goal_src/jak2/engine/collide/collide-edge-grab-h.gc +++ b/goal_src/jak2/engine/collide/collide-edge-grab-h.gc @@ -5,5 +5,209 @@ ;; name in dgo: collide-edge-grab-h ;; dgos: ENGINE, GAME +(declare-type collide-cache-tri structure) +(declare-type collide-cache basic) + ;; DECOMP BEGINS +(deftype pilot-edge-grab-info (structure) + ((local-pos vector :inline :offset-assert 0) + (local-dir vector :inline :offset-assert 16) + (handle handle :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +(deftype edge-grab-info (structure) + ((world-vertex vector 8 :inline :offset-assert 0) + (local-vertex vector 8 :inline :offset-assert 128) + (status uint64 :offset-assert 256) + (actor-cshape-prim-offset int32 :offset-assert 264) + (actor-handle uint64 :offset-assert 272) + (hanging-matrix matrix :inline :offset-assert 288) + (edge-vertex vector 2 :inline :offset 0) + (center-hold vector :inline :offset 32) + (tri-vertex vector 3 :inline :offset 48) + (adjacent-edge-left-vertex vector :inline :offset 96) + (adjacent-edge-right-vertex vector :inline :offset 112) + (left-hand-hold vector :inline :offset-assert 352) + (right-hand-hold vector :inline :offset-assert 368) + (center-hold-old vector :inline :offset-assert 384) + (edge-tri-pat uint32 :offset-assert 400) + (found-edge? symbol :offset-assert 404) + (pilot-edge-grab? symbol :offset-assert 408) + (pilot-edge-grab pilot-edge-grab-info :inline :offset-assert 416) + (pilot-start-grab-pos vector :inline :offset-assert 464) + (pilot-grab-interp float :offset-assert 480) + ) + :method-count-assert 11 + :size-assert #x1e4 + :flag-assert #xb000001e4 + (:methods + (edge-grab-info-method-9 () none 9) + (edge-grab-info-method-10 () none 10) + ) + ) + +(deftype collide-edge-tri (structure) + ((ctri collide-cache-tri :offset-assert 0) + (normal vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype collide-edge-edge (structure) + ((ignore basic :offset-assert 0) + (etri collide-edge-tri :offset-assert 4) + (vertex-ptr (inline-array vector) 2 :offset-assert 8) + (outward vector :inline :offset-assert 16) + (edge-vec-norm vector :inline :offset-assert 32) + ) + :method-count-assert 10 + :size-assert #x30 + :flag-assert #xa00000030 + (:methods + (collide-edge-edge-method-9 () none 9) + ) + ) + +(deftype collide-edge-hold-item (structure) + ((next collide-edge-hold-item :offset-assert 0) + (rating float :offset-assert 4) + (split int8 :offset-assert 8) + (edge collide-edge-edge :offset-assert 12) + (center-pt vector :inline :offset-assert 16) + (outward-pt vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype collide-edge-hold-list (structure) + ((num-allocs uint32 :offset-assert 0) + (num-attempts uint32 :offset-assert 4) + (head collide-edge-hold-item :offset-assert 8) + (items collide-edge-hold-item 32 :inline :offset-assert 16) + (attempts qword 32 :inline :offset-assert 1552) + ) + :method-count-assert 11 + :size-assert #x810 + :flag-assert #xb00000810 + (:methods + (collide-edge-hold-list-method-9 () none 9) + (collide-edge-hold-list-method-10 () none 10) + ) + ) + +(deftype collide-edge-spec (structure) + ((split-dists float 2 :offset-assert 0) + (outward-offset vector :inline :offset-assert 16) + (flags uint64 :offset-assert 32) + (ignore-pat pat-surface :offset-assert 40) + (max-dist-sqrd-to-outward-pt float :offset-assert 44) + (max-dir-cosa-delta float :offset-assert 48) + (max-dir-cosa-player float :offset-assert 52) + (touching-segment symbol :offset-assert 56) + (local-cache-fill-box bounding-box :inline :offset-assert 64) + (local-within-reach-box bounding-box :inline :offset-assert 96) + (local-player-spheres sphere 12 :inline :offset 128) + (local-player-hanging-spheres sphere 6 :inline :offset 128) + (local-player-leap-up-spheres sphere 6 :inline :offset 224) + ) + :method-count-assert 9 + :size-assert #x140 + :flag-assert #x900000140 + ) + +(deftype collide-edge-work (structure) + ((ccache collide-cache :offset-assert 0) + (cshape collide-shape :offset-assert 4) + (num-verts uint32 :offset-assert 8) + (num-edges uint32 :offset-assert 12) + (num-tris uint32 :offset-assert 16) + (cache-fill-box bounding-box :inline :offset-assert 32) + (within-reach-box bounding-box :inline :offset-assert 64) + (within-reach-box4w bounding-box4w :inline :offset-assert 96) + (search-pt vector :inline :offset-assert 128) + (search-dir-vec vector :inline :offset-assert 144) + (world-player-spheres sphere 12 :inline :offset-assert 160) + (world-player-hanging-spheres sphere 6 :inline :offset 160) + (world-player-leap-up-spheres sphere 6 :inline :offset 256) + (spec collide-edge-spec :inline :offset-assert 352) + (process uint32 :offset-assert 672) + (verts vector 64 :inline :offset-assert 688) + (edges collide-edge-edge 96 :inline :offset-assert 1712) + (tris collide-edge-tri 48 :inline :offset-assert 6320) + (hold-list collide-edge-hold-list :inline :offset-assert 7856) + ) + :method-count-assert 21 + :size-assert #x26c0 + :flag-assert #x15000026c0 + (:methods + (collide-edge-work-method-9 () none 9) + (collide-edge-work-method-10 () none 10) + (collide-edge-work-method-11 () none 11) + (collide-edge-work-method-12 () none 12) + (collide-edge-work-method-13 () none 13) + (collide-edge-work-method-14 () none 14) + (collide-edge-work-method-15 () none 15) + (collide-edge-work-method-16 () none 16) + (collide-edge-work-method-17 () none 17) + (collide-edge-work-method-18 () none 18) + (collide-edge-work-method-19 () none 19) + (collide-edge-work-method-20 () none 20) + ) + ) + +(define *collide-edge-spec* + (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags #x8 + :ignore-pat (new 'static 'pat-surface :noentity #x1 :noedge #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + :max-dist-sqrd-to-outward-pt 37748736.0 + :max-dir-cosa-delta 0.6 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0) + :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) + ) + ) + ) + +(kmemopen global "collide-edge-work") + +(define *collide-edge-work* (new 'global 'collide-edge-work)) + +(mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer *collide-edge-spec*) 320) + +(define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info)) + +(kmemclose) + + + + diff --git a/goal_src/jak2/engine/collide/collide-frag-h.gc b/goal_src/jak2/engine/collide/collide-frag-h.gc index 486b6b1d20..795a6b3483 100644 --- a/goal_src/jak2/engine/collide/collide-frag-h.gc +++ b/goal_src/jak2/engine/collide/collide-frag-h.gc @@ -7,3 +7,51 @@ ;; DECOMP BEGINS +(deftype collide-frag-vertex (vector) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype collide-frag-mesh (basic) + ((packed-data uint32 :offset-assert 4) + (pat-array uint32 :offset-assert 8) + (strip-data-len uint16 :offset-assert 12) + (poly-count uint16 :offset-assert 14) + (base-trans vector4w :inline :offset-assert 16) + (vertex-count uint8 :offset 28) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype collide-fragment (drawable) + ((mesh collide-frag-mesh :offset 8) + (collide-new basic :offset 12) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype drawable-inline-array-collide-fragment (drawable-inline-array) + ((data collide-fragment 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +(deftype drawable-tree-collide-fragment (drawable-tree) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + diff --git a/goal_src/jak2/engine/collide/collide-h.gc b/goal_src/jak2/engine/collide/collide-h.gc index 89276c76f3..3350f00687 100644 --- a/goal_src/jak2/engine/collide/collide-h.gc +++ b/goal_src/jak2/engine/collide/collide-h.gc @@ -7,3 +7,48 @@ ;; DECOMP BEGINS +(deftype collide-query (structure) + ((best-other-tri collide-tri-result :inline :offset-assert 0) + (best-my-tri collide-tri-result :inline :offset 0) + (ignore-processes process 2 :offset-assert 88) + (ignore-process0 process :offset 88) + (ignore-process1 process :offset 92) + (ignore-pat pat-surface :offset-assert 96) + (collide-with collide-spec :offset-assert 100) + (overlay-params uint32 3 :offset 112) + (bbox bounding-box :inline :offset-assert 128) + (bbox4w bounding-box4w :inline :offset-assert 160) + (bsphere sphere :inline :offset-assert 192) + (start-pos vector :inline :offset-assert 208) + (move-dist vector :inline :offset-assert 224) + (rlength vector :inline :offset-assert 240) + (exit-planes plane 2 :offset-assert 256) + (radius float :offset 268) + (inv-mat matrix :inline :offset 288) + (spheres uint32 :offset 112) + (num-spheres uint32 :offset 116) + (solid-only basic :offset 120) + (best-dist float :offset 112) + (best-other-prim basic :offset 116) + (best-my-prim basic :offset 120) + (move-vec vector :inline :offset 224) + (best-u float :offset 112) + (action-mask uint32 :offset-assert 352) + (local-box4w bounding-box4w :inline :offset-assert 368) + (search-box bounding-box4w :inline :offset-assert 400) + (search-vector vector4w :inline :offset-assert 432) + (instance-mat matrix :inline :offset-assert 448) + (instance-ptr basic :offset-assert 512) + (x-addr uint32 :offset-assert 516) + (x-step uint32 :offset-assert 520) + (y-addr uint32 :offset-assert 524) + (y-step uint32 :offset-assert 528) + (z-addr uint32 :offset-assert 532) + (z-step uint32 :offset-assert 536) + ) + :method-count-assert 9 + :size-assert #x21c + :flag-assert #x90000021c + ) + +(define *collide-test-flag* #f) diff --git a/goal_src/jak2/engine/collide/collide-mesh-h.gc b/goal_src/jak2/engine/collide/collide-mesh-h.gc index 8a5d9404e2..7833434396 100644 --- a/goal_src/jak2/engine/collide/collide-mesh-h.gc +++ b/goal_src/jak2/engine/collide/collide-mesh-h.gc @@ -7,3 +7,121 @@ ;; DECOMP BEGINS +(deftype collide-tri-result (structure) + ((vertex vector 3 :inline :offset-assert 0) + (intersect vector :inline :offset-assert 48) + (normal vector :inline :offset-assert 64) + (pat pat-surface :offset-assert 80) + (collide-ptr basic :offset-assert 84) + ) + :method-count-assert 9 + :size-assert #x58 + :flag-assert #x900000058 + ) + +(deftype collide-mesh-tri (structure) + ((vertex-index uint8 3 :offset-assert 0) + (unused uint8 :offset-assert 3) + (pat pat-surface :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype collide-mesh (basic) + ((joint-id int32 :offset-assert 4) + (num-tris uint32 :offset-assert 8) + (num-verts uint32 :offset-assert 12) + (vertex-data (inline-array vector) :offset-assert 16) + (tris collide-mesh-tri 1 :inline :offset 32) + ) + :method-count-assert 16 + :size-assert #x28 + :flag-assert #x1000000028 + (:methods + (collide-mesh-method-9 () none 9) + (collide-mesh-method-10 () none 10) + (collide-mesh-method-11 () none 11) + (collide-mesh-method-12 () none 12) + (collide-mesh-method-13 () none 13) + (collide-mesh-method-14 () none 14) + (collide-mesh-method-15 () none 15) + ) + ) + +(deftype collide-mesh-cache-tri (structure) + ((vertex vector 3 :inline :offset-assert 0) + (normal vector :inline :offset-assert 48) + (bbox4w bounding-box4w :inline :offset-assert 64) + (pat pat-surface :offset 60) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +(deftype collide-mesh-cache-entry (structure) + ((mat matrix :inline :offset-assert 0) + (tris collide-mesh-cache-tri :inline :dynamic :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype collide-mesh-cache (basic) + ((used-size uint32 :offset-assert 4) + (max-size uint32 :offset-assert 8) + (id uint32 :offset-assert 12) + (data uint8 48000 :offset-assert 16) + ) + :method-count-assert 13 + :size-assert #xbb90 + :flag-assert #xd0000bb90 + (:methods + (collide-mesh-cache-method-9 () none 9) + (is-id? (_type_ int) symbol 10) + (next-id! (_type_) uint 11) + (collide-mesh-cache-method-12 () none 12) + ) + ) + +(defmethod next-id! collide-mesh-cache ((obj collide-mesh-cache)) + "Reset all used entries in the cache and increment the id. + If the id is zero, set it to 1" + ;; ld v1, 12(a0) + (let ((v1 (-> obj id))) + ;; sw r0, 0(a0) + (set! (-> obj used-size) 0) + ;; daddiu v0, v1, 1 + (let ((v0 (+ v1 1))) + ;; beql v0, r0, L3 + ;; addiu v0, r0, 1 (only taken if v0 = 0) + (if (= v0 0) + (set! v0 (the uint 1)) + ) + ;; L3: + ;; sd v0, 12(a0) + (set! (-> obj id) v0) + v0 + ) + ) + ) + +(defmethod is-id? collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) + (= (-> obj id) arg0) + ) + +(kmemopen global "collide-mesh-cache") + +(define-perm *collide-mesh-cache* collide-mesh-cache (new 'global 'collide-mesh-cache)) +(set! (-> *collide-mesh-cache* id) (the-as uint 1)) +(set! (-> *collide-mesh-cache* used-size) (the-as uint 0)) +(set! (-> *collide-mesh-cache* max-size) (the-as uint #xbb80)) +(kmemclose) + + + + diff --git a/goal_src/jak2/engine/collide/collide-shape-h.gc b/goal_src/jak2/engine/collide/collide-shape-h.gc index 598653366c..2f9a59508b 100644 --- a/goal_src/jak2/engine/collide/collide-shape-h.gc +++ b/goal_src/jak2/engine/collide/collide-shape-h.gc @@ -5,5 +5,599 @@ ;; name in dgo: collide-shape-h ;; dgos: ENGINE, GAME +(declare-type collide-shape trsqv) +(declare-type collide-shape-moving collide-shape) +(declare-type touching-list structure) + +(defenum penetrate + :bitfield #t + :type uint64 + (touch 0) ;; 1 + (generic-attack 1) ;; 2 + (lunge 2) ;; 4 + (flop 3) ;; 8 + (punch 4) ;; 16 + (spin 5) ;; 32 + (roll 6) ;; 64 + (uppercut 7) ;; 128 + (bonk 8) ;; 256 + (tube 9) ;; 512 + (vehicle 10) ;; 1024 + (flut-attack 11) ;; 2048 + (board 12) ;; 4096 + (mech 13) ;; 8192 + (mech-punch 14) ;; 16384 + (mech-bonk 15) ;; 32768 + (dark-skin 16) ;; hi 1 + (dark-punch 17) ;; hi 2 + (dark-bomb 18) ;; hi 4 + (dark-giant 19) ;; hi 8 + (shield 20) ;; hi 16 + (explode 21) ;; hi 32 + (jak-yellow-shot 22) ;; hi 64 + (jak-red-shot 23) ;; hi 128 + (jak-blue-shot 24) ;; hi 256 + (jak-dark-shot 25) ;; hi 512 + (enemy-yellow-shot 26) ;; hi 1024 + (enemy-dark-shot 27) ;; hi 2048 + (eco-yellow 28) ;; hi 4096 + (eco-red 29) ;; hi 8192 + (eco-blue 30) ;; hi 16384 + (eco-green 31) ;; hi 32768 + (knocked 32) ;; hihi 1 + ) + +(defenum collide-spec + :bitfield #t + :type uint32 + + (backgnd 0) ;; 1 + (jak 1) ;; 2 + (bot 2) ;; 4 + (crate 3) ;; 8 + (civilian 4) ;; 16 + (enemy 5) ;; 32 + (obstacle 6) ;; 64 + (vehicle-sphere 7) ;; 128 + (hit-by-player-list 8) ;; 256 + (hit-by-others-list 9) ;; 512 + (player-list 10) ;; 1024 + (water 11) ;; 2048 + (collectable 12) ;; 4096 + (blocking-plane 13) ;; 8192 + (projectile 14) ;; 16384 + (jak-vulnerable 15) ;; 32768 + (camera-blocker 16) ;; hi 1 + (notice-blue-eco-powerup 17) ;; hi 2 + (tobot 18) ;; hi 4 + (pusher 19) ;; hi 8 + (vehicle-mesh 20) ;; hi 16 + (bot-targetable 21) ;; hi 32 + (jak-vehicle 22) ;; hi 64 + (special-obstacle 23) ;; hi 128 + (mech-punch 24) ;; hi 256 + (obstacle-for-jak 25) ;; hi 512 + (vehicle-mesh-probeable 26) ;; hi 1024 + ) + +(defenum collide-action + :bitfield #t + :type uint32 + + (solid 0) ;; 1 + (semi-solid 1) ;; 2 + (rideable 2) ;; 4 + (can-ride 3) ;; 8 + (dont-push-away 4) ;; 16 + (pull-rider-can-collide 5) ;; 32 + (deadly 6) ;; 64 + (persistent-attack 7) ;; 128 + (no-smack 8) ;; 256 + (no-standon 9) ;; 512 + (block-turn-around 10) ;; 1024 + (check-edge 11) ;; 2048 + (check-stuck 12) ;; 4096 + (stuck-wall-escape 13) ;; 8192 + (no-normal-reset 14) ;; 163884 + (edge-grabbed 15) ;; 32768 + (nav-sphere 16) ;; hi 1 + ) + +(defenum overlaps-others-options + :type uint32 + :bitfield #t + ) + +(defenum prim-type + :type int8 + (prim -2) + (sphere -1) + (group 0) + (mesh 1) + (fake-prim 2) + ) + +(defenum cshape-moving-flags + :bitfield #t + :type uint64 + (csmf00) + (csmf01) + (csmf02) + (csmf03) + (csmf04) + (csmf05) + (csmf06) + (csmf07) + (csmf08) + (csmf09) + (csmf10) + (csmf11) + (csmf12) + (csmf13) + (csmf14) + (csmf15) + (csmf16) + (csmf17) + (csmf18) + (csmf19) + (csmf20) + (csmf21) + (csmf22) + (csmf23) + (csmf24) + (csmf25) + (csmf26) + (csmf27) + (csmf28) + (csmf29) + ) + +(defenum cshape-reaction-flags + :bitfield #t + :type uint32 + (csrf00) + (csrf01) + (csrf02) + (csrf03) + (csrf04) + (csrf05) + (csrf06) + (csrf07) + (csrf08) + (csrf09) + (csrf10) + (csrf11) + (csrf12) + (csrf13) + (csrf14) + (csrf15) + (csrf16) + (csrf17) + (csrf18) + (csrf19) + (csrf20) + (csrf21) + (csrf22) + (csrf23) + (csrf24) + (csrf25) + (csrf26) + (csrf27) + (csrf28) + (csrf29) + (csrf30) + (csrf31) + ) + +(defenum collide-list-enum + (hit-by-player) + (usually-hit-by-player) + (hit-by-others) + (player) + ) ;; DECOMP BEGINS +(deftype collide-rider (structure) + ((rider-handle uint64 :offset-assert 0) + (sticky-prim basic :offset-assert 8) + (prim-ry float :offset-assert 12) + (rider-local-pos vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype collide-rider-pool (basic) + ((alloc-count int32 :offset-assert 4) + (riders collide-rider 20 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x290 + :flag-assert #xb00000290 + (:methods + (collide-rider-pool-method-9 () none 9) + (prepare (_type_) none 10) + ) + ) + +(defmethod prepare collide-rider-pool ((obj collide-rider-pool)) + "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." + (set! (-> obj alloc-count) 0) + 0 + (none) + ) + +(deftype pull-rider-info (structure) + ((rider collide-rider :offset-assert 0) + (rider-cshape collide-shape-moving :offset-assert 4) + (rider-delta-ry float :offset-assert 8) + (rider-dest vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(kmemopen global "collide-lists") +(define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list 640 connection)) +(define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list 768 connection)) +(define *collide-player-list* (new 'global 'engine 'collide-player-list 32 connection)) +(kmemclose) + +(deftype overlaps-others-params (structure) + ((options overlaps-others-options :offset-assert 0) + (collide-with-filter collide-spec :offset-assert 4) + (tlist touching-list :offset-assert 8) + (filtered-root-collide-with collide-spec :offset-assert 12) + (filtered-child-collide-with collide-spec :offset-assert 16) + (filtered-other-collide-as collide-spec :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(deftype move-above-ground-params (structure) + ((gnd-collide-with collide-spec :offset-assert 0) + (popup float :offset-assert 4) + (dont-move-if-overlaps? basic :offset-assert 8) + (hover-if-no-ground? basic :offset-assert 12) + (overlaps-params overlaps-others-params :inline :offset-assert 16) + (new-pos vector :inline :offset-assert 48) + (old-gspot-pos vector :inline :offset-assert 64) + (old-gspot-normal vector :inline :offset-assert 80) + (pat pat-surface :offset-assert 96) + (on-ground? basic :offset-assert 100) + (do-move? basic :offset-assert 104) + ) + :method-count-assert 9 + :size-assert #x6c + :flag-assert #x90000006c + ) + +(deftype collide-prim-core (structure) + ((world-sphere vector :inline :offset-assert 0) + (collide-as collide-spec :offset-assert 16) + (collide-with uint32 :offset-assert 20) + (action collide-action :offset-assert 24) + (prim-type prim-type :offset-assert 28) + (unused1 uint8 3 :offset-assert 29) + (quad uint128 2 :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype collide-shape-prim (basic) + ((cshape collide-shape :offset-assert 4) + (prim-id uint32 :offset-assert 8) + (transform-index int8 :offset-assert 12) + (unused2 int8 3 :offset-assert 13) + (prim-core collide-prim-core :inline :offset-assert 16) + (local-sphere vector :inline :offset-assert 48) + (world-sphere vector :inline :offset 16) + (collide-as collide-spec :offset 32) + (collide-with collide-spec :offset 36) + (action collide-action :offset 40) + (prim-type int8 :offset 44) + (radius float :offset 60) + (specific uint8 16 :offset-assert 64) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint int) _type_ 0) + (collide-shape-prim-method-9 () none 9) + (collide-shape-prim-method-10 () none 10) + (collide-shape-prim-method-11 () none 11) + (collide-shape-prim-method-12 () none 12) + (collide-shape-prim-method-13 () none 13) + (collide-shape-prim-method-14 () none 14) + (collide-shape-prim-method-15 () none 15) + (collide-shape-prim-method-16 () none 16) + (collide-shape-prim-method-17 () none 17) + (collide-shape-prim-method-18 () none 18) + (collide-shape-prim-method-19 () none 19) + ) + ) + +(deftype collide-shape-prim-sphere (collide-shape-prim) + ((pat pat-surface :offset 64) + (nav-radius float :offset 68) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint) _type_ 0) + ) + ) + + +(deftype collide-shape-prim-mesh (collide-shape-prim) + ((mesh collide-mesh :offset 64) + (mesh-id int32 :offset 68) + (mesh-cache-id uint32 :offset 72) + (mesh-cache-entry collide-mesh-cache-entry :offset 76) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint uint) _type_ 0) + ) + ) + +(deftype collide-shape-prim-group (collide-shape-prim) + ((num-children uint8 :offset 64) + (num-alloc-children uint8 :offset 65) + (child (inline-array collide-shape) :offset 68) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint int) _type_ 0) + ) + ) + +(deftype collide-shape (trsqv) + ((actor-hash-index int16 :offset 12) + (process process :offset-assert 140) + (max-iteration-count uint8 :offset-assert 144) + (nav-flags uint8 :offset-assert 145) + (total-prims uint8 :offset-assert 146) + (num-riders uint8 :offset-assert 147) + (pat-ignore-mask pat-surface :offset-assert 148) + (event-self symbol :offset-assert 152) + (event-other symbol :offset-assert 156) + (root-prim collide-shape-prim :offset-assert 160) + (riders pointer :offset-assert 164) + (penetrate-using penetrate :offset-assert 168) + (penetrated-by penetrate :offset-assert 176) + (backup-collide-as collide-spec :offset-assert 184) + (backup-collde-with collide-spec :offset-assert 188) + (event-priority uint8 :offset-assert 192) + (rider-max-momentum float :offset-assert 196) + ) + :method-count-assert 55 + :size-assert #xc8 + :flag-assert #x37000000c8 + (:methods + (new (symbol type process-drawable collide-list-enum) _type_ 0) + (collide-shape-method-28 () none 28) + (collide-shape-method-29 () none 29) + (collide-shape-method-30 () none 30) + (collide-shape-method-31 () none 31) + (collide-shape-method-32 () none 32) + (collide-shape-method-33 () none 33) + (collide-shape-method-34 () none 34) + (collide-shape-method-35 () none 35) + (collide-shape-method-36 () none 36) + (collide-shape-method-37 () none 37) + (collide-shape-method-38 () none 38) + (collide-shape-method-39 () none 39) + (collide-shape-method-40 () none 40) + (collide-shape-method-41 () none 41) + (collide-shape-method-42 () none 42) + (collide-shape-method-43 () none 43) + (collide-shape-method-44 () none 44) + (collide-shape-method-45 () none 45) + (collide-shape-method-46 () none 46) + (collide-shape-method-47 () none 47) + (collide-shape-method-48 () none 48) + (collide-shape-method-49 () none 49) + (collide-shape-method-50 () none 50) + (collide-shape-method-51 () none 51) + (collide-shape-method-52 () none 52) + (collide-shape-method-53 () none 53) + (collide-shape-method-54 () none 54) + ) + ) + +(deftype collide-shape-moving (collide-shape) + ((rider-time time-frame :offset-assert 200) + (rider-last-move vector :inline :offset-assert 208) + (trans-old vector :inline :offset-assert 224) + (poly-pat pat-surface :offset 272) + (cur-pat pat-surface :offset-assert 276) + (ground-pat pat-surface :offset-assert 280) + (status cshape-moving-flags :offset-assert 288) + (old-status cshape-moving-flags :offset-assert 296) + (prev-status cshape-moving-flags :offset-assert 304) + (reaction-flag cshape-reaction-flags :offset-assert 312) + (reaction function :offset-assert 316) + (no-reaction function :offset-assert 320) + (local-normal vector :inline :offset-assert 336) + (surface-normal vector :inline :offset-assert 352) + (poly-normal vector :inline :offset-assert 368) + (ground-poly-normal vector :inline :offset-assert 384) + (gspot-pos vector :inline :offset-assert 400) + (gspot-normal vector :inline :offset-assert 416) + (grount-touch-point vector :inline :offset-assert 432) + (ground-impact-vel meters :offset-assert 448) + (surface-angle float :offset-assert 452) + (poly-angle float :offset-assert 456) + (touch-angle float :offset-assert 460) + (coverage float :offset-assert 464) + (dynam dynamics :offset-assert 468) + (surf surface :offset-assert 472) + ) + :method-count-assert 68 + :size-assert #x1dc + :flag-assert #x44000001dc + (:methods + (collide-shape-moving-method-55 () none 55) + (collide-shape-moving-method-56 () none 56) + (collide-shape-moving-method-57 () none 57) + (collide-shape-moving-method-58 () none 58) + (collide-shape-moving-method-59 () none 59) + (collide-shape-moving-method-60 () none 60) + (collide-shape-moving-method-61 () none 61) + (collide-shape-moving-method-62 () none 62) + (collide-shape-moving-method-63 () none 63) + (collide-shape-moving-method-64 () none 64) + (collide-shape-moving-method-65 () none 65) + (collide-shape-moving-method-66 () none 66) + (collide-shape-moving-method-67 () none 67) + ) + ) + + +(defmethod new collide-shape-prim ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 int)) + (let ((v0-0 (object-new allocation type-to-make arg2))) + (set! (-> v0-0 cshape) arg0) + (set! (-> v0-0 prim-id) arg1) + (set! (-> v0-0 prim-core action) (collide-action)) + (set! (-> v0-0 prim-core collide-as) (collide-spec)) + (set! (-> v0-0 prim-core collide-with) (the-as uint 0)) + (set! (-> v0-0 transform-index) -2) + (set! (-> v0-0 prim-core prim-type) (prim-type prim)) + v0-0 + ) + ) + +(defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint)) + (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg1 80))) + (set! (-> (the-as collide-shape-prim-sphere v0-0) pat) + (new 'static 'pat-surface :mode (pat-mode obstacle) :material (pat-material stone)) + ) + (set! (-> (the-as collide-shape-prim-sphere v0-0) prim-core prim-type) (prim-type sphere)) + (the-as collide-shape-prim-sphere v0-0) + ) + ) + +(defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 uint)) + (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg2 80))) + (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh) #f) + (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh-id) (the-as int arg1)) + (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh-cache-id) (the-as uint 0)) + (set! (-> (the-as collide-shape-prim-mesh v0-0) prim-core prim-type) (prim-type mesh)) + (the-as collide-shape-prim-mesh v0-0) + ) + ) + +(defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 int)) + (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 (the-as uint arg2) 80))) + (set! (-> (the-as collide-shape-prim-group v0-0) num-children) arg1) + (set! (-> (the-as collide-shape-prim-group v0-0) num-alloc-children) arg1) + (set! (-> (the-as collide-shape-prim-group v0-0) prim-core prim-type) (prim-type group)) + (set! (-> (the-as collide-shape-prim-group v0-0) child) + (the-as (inline-array collide-shape) (&+ (the-as collide-shape-prim-group v0-0) 80)) + ) + (the-as collide-shape-prim-group v0-0) + ) + ) + +(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) + (the-as int (-> obj num-children)) + ) + +(defmethod new collide-shape ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (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 event-self) #f) + (set! (-> s5-0 event-other) #f) + (set! (-> s5-0 riders) (the-as pointer #f)) + (set! (-> s5-0 root-prim) #f) + (set! (-> s5-0 penetrate-using) (penetrate)) + (set! (-> s5-0 penetrated-by) (penetrate)) + (set! (-> s5-0 event-priority) (the-as uint 0)) + (set! (-> s5-0 rider-max-momentum) 409600.0) + (case (-> arg0 type symbol) + (('camera) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1 :probe #x1 :noendlessfall #x1)) + ) + (('target) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1)) + ) + (else + (set! (-> s5-0 pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + ) + ) + ) + (set! (-> s5-0 trans w) 1.0) + (quaternion-identity! (-> s5-0 quat)) + (vector-identity! (-> s5-0 scale)) + (cond + ((= arg1 (collide-list-enum hit-by-player)) + (add-connection *collide-hit-by-player-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum usually-hit-by-player)) + (add-connection *collide-hit-by-others-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum hit-by-others)) + (add-connection *collide-player-list* arg0 #f s5-0 #f #f) + ) + (else + (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") + ) + ) + s5-0 + ) + ) + +(defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) + (let ((v0-0 ((method-of-type collide-shape new) allocation type-to-make arg0 arg1))) + (set! (-> (the-as collide-shape-moving v0-0) gspot-pos y) -40959590.0) + (set! (-> (the-as collide-shape-moving v0-0) gspot-normal quad) (-> *y-vector* quad)) + (set! (-> (the-as collide-shape-moving v0-0) surf) *standard-ground-surface*) + (the-as collide-shape-moving v0-0) + ) + ) + +(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh + :cshape #f + :prim-core (new 'static 'collide-prim-core + :world-sphere (new 'static 'vector :w 204800000.0) + :collide-as (collide-spec backgnd) + :action (collide-action solid) + :prim-type (prim-type fake-prim) + ) + :local-sphere (new 'static 'vector :w 204800000.0) + :mesh #f + ) + ) + +(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh + :cshape #f + :prim-core (new 'static 'collide-prim-core + :world-sphere (new 'static 'vector :w 204800000.0) + :collide-as (collide-spec water) + :action (collide-action solid) + :prim-type (prim-type fake-prim) + ) + :local-sphere (new 'static 'vector :w 204800000.0) + :mesh #f + ) + ) + +(define-perm *collide-rider-pool* collide-rider-pool (new 'global 'collide-rider-pool)) + diff --git a/goal_src/jak2/engine/collide/collide-target-h.gc b/goal_src/jak2/engine/collide/collide-target-h.gc index 83d085301d..9986d63b7e 100644 --- a/goal_src/jak2/engine/collide/collide-target-h.gc +++ b/goal_src/jak2/engine/collide/collide-target-h.gc @@ -7,3 +7,11 @@ ;; DECOMP BEGINS +(deftype control-info (collide-shape-moving) + ((pad uint8 :offset 6415) + ) + :method-count-assert 68 + :size-assert #x1910 + :flag-assert #x4400001910 + ) + diff --git a/goal_src/jak2/engine/collide/collide-touch-h.gc b/goal_src/jak2/engine/collide/collide-touch-h.gc index 0b5e820b03..ffbb4a30cb 100644 --- a/goal_src/jak2/engine/collide/collide-touch-h.gc +++ b/goal_src/jak2/engine/collide/collide-touch-h.gc @@ -7,3 +7,148 @@ ;; DECOMP BEGINS +(deftype touching-prim (structure) + ((cprim collide-shape-prim :offset-assert 0) + (has-tri? symbol :offset-assert 4) + (tri collide-tri-result :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x68 + :flag-assert #x900000068 + ) + +(deftype touching-prims-entry (structure) + ((next touching-prims-entry :offset-assert 0) + (prev touching-prims-entry :offset-assert 4) + (allocated? symbol :offset-assert 8) + (u float :offset-assert 12) + (prim1 touching-prim :inline :offset-assert 16) + (prim2 touching-prim :inline :offset-assert 128) + ) + :method-count-assert 12 + :size-assert #xe8 + :flag-assert #xc000000e8 + (:methods + (touching-prims-entry-method-9 () none 9) + (touching-prims-entry-method-10 () none 10) + (touching-prims-entry-method-11 () none 11) + ) + ) + +(deftype touching-prims-entry-pool (structure) + ((head touching-prims-entry :offset-assert 0) + (nodes touching-prims-entry 64 :inline :offset-assert 16) + ) + :method-count-assert 13 + :size-assert #x3c10 + :flag-assert #xd00003c10 + (:methods + (touching-prims-entry-pool-method-9 () none 9) + (touching-prims-entry-pool-method-10 () none 10) + (init-list! (_type_) none 11) + (touching-prims-entry-pool-method-12 () none 12) + ) + ) + +(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) + (let ((v1-0 (the-as touching-prims-entry #f))) + (let ((a1-0 (the-as touching-prims-entry (-> obj nodes)))) + (set! (-> obj head) a1-0) + (countdown (a0-1 64) + (set! (-> a1-0 prev) v1-0) + (let ((a2-0 (&+ a1-0 240))) + (set! (-> a1-0 next) (the-as touching-prims-entry a2-0)) + (set! (-> a1-0 allocated?) #f) + (set! v1-0 a1-0) + (set! a1-0 (the-as touching-prims-entry a2-0)) + ) + ) + ) + (set! (-> v1-0 next) #f) + ) + 0 + (none) + ) + +(defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((gp-0 (t9-0 allocation v1-1))) + ((method-of-type touching-prims-entry-pool init-list!) (the-as touching-prims-entry-pool gp-0)) + (the-as touching-prims-entry-pool gp-0) + ) + ) + ) + +(deftype touching-shapes-entry (structure) + ((cshape1 collide-shape :offset-assert 0) + (cshape2 collide-shape :offset-assert 4) + (resolve-u int8 :offset-assert 8) + (head touching-prims-entry :offset-assert 12) + (handle1 uint64 :offset-assert 16) + (handle2 uint64 :offset-assert 24) + ) + :pack-me + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (get-head (_type_) touching-prims-entry 9) + (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) + (touching-shapes-entry-method-11 () none 11) + (touching-shapes-entry-method-12 () none 12) + (touching-shapes-entry-method-13 () none 13) + (touching-shapes-entry-method-14 () none 14) + ) + ) + +(deftype touching-list (structure) + ((num-touching-shapes int32 :offset-assert 0) + (resolve-u int8 :offset-assert 4) + (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8) + ) + :method-count-assert 14 + :size-assert #x408 + :flag-assert #xe00000408 + (:methods + (touching-list-method-9 () none 9) + (touching-list-method-10 () none 10) + (touching-list-method-11 () none 11) + (touching-list-method-12 () none 12) + (touching-list-method-13 () none 13) + ) + ) + +(defmethod new touching-list ((allocation symbol) (type-to-make type)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((v0-0 (the-as touching-list (t9-0 allocation v1-1)))) + (set! (-> v0-0 num-touching-shapes) 0) + (set! (-> v0-0 resolve-u) 0) + v0-0 + ) + ) + ) + +(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry)) + (-> obj head) + ) + +(defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-shapes-entry)) + (the-as touching-prims-entry (-> arg0 cshape1)) + ) + +(kmemopen global "collide-touching-lists") + +(define-perm *touching-prims-entry-pool* touching-prims-entry-pool (new 'global 'touching-prims-entry-pool)) +(define-perm *touching-list* touching-list (new 'global 'touching-list)) + +(kmemclose) + + + + diff --git a/goal_src/jak2/engine/collide/pat-h.gc b/goal_src/jak2/engine/collide/pat-h.gc index c7976814c8..a4179dd9c5 100644 --- a/goal_src/jak2/engine/collide/pat-h.gc +++ b/goal_src/jak2/engine/collide/pat-h.gc @@ -5,5 +5,297 @@ ;; name in dgo: pat-h ;; dgos: ENGINE, GAME +(defenum pat-mode + :type uint8 + (ground 0) + (wall 1) + (obstacle 2) + (halfpipe 3) + ) + +(defenum pat-material + :type uint8 + (unknown 0) + (ice 1) + (quicksand 2) + (waterbottom 3) + (tar 4) + (sand 5) + (wood 6) + (grass 7) + (pcmetal 8) + (snow 9) + (deepsnow 10) + (hotcoals 11) + (lava 12) + (crwood 13) + (gravel 14) + (dirt 15) + (metal 16) + (straw 17) + (tube 18) + (swamp 19) + (stopproj 20) + (rotate 21) + (neutral 22) + (stone 23) + (crmetal 24) + (carpet 25) + (grmetal 26) + (shmetal 27) + (hdwood 28) + ) + +(defenum pat-event + :type uint8 + (none 0) + (deadly 1) + (endlessfall 2) + (burn 3) + (deadlup 4) + (burnup 5) + (melt 6) + (slide 7) + (lip 8) + (lipramp 9) + (shock 10) + (shockup 11) + (hide 12) + (rail 13) + (slippery 14) + ) + ;; DECOMP BEGINS +(deftype pat-surface (uint32) + ((skip uint8 :offset 0 :size 7) + (mode pat-mode :offset 7 :size 3) + (material pat-material :offset 10 :size 6) + (camera uint8 :offset 16 :size 1) + (event pat-event :offset 18 :size 6) + (skip2 uint8 :offset 24 :size 5) + (noentity uint8 :offset 0 :size 1) + (nocamera uint8 :offset 1 :size 1) + (noedge uint8 :offset 2 :size 1) + (nogrind uint8 :offset 3 :size 1) + (nojak uint8 :offset 4 :size 1) + (noboard uint8 :offset 5 :size 1) + (nopilot uint8 :offset 6 :size 1) + (probe uint8 :offset 24 :size 1) + (nomech uint8 :offset 25 :size 1) + (noproj uint8 :offset 26 :size 1) + (noendlessfall uint8 :offset 27 :size 1) + (noprobe uint8 :offset 28 :size 1) + (nolineofsight uint8 :offset 16 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(defun-debug pat-material->string ((arg0 pat-surface)) + (case (-> arg0 material) + (((pat-material deepsnow)) + "deepsnow" + ) + (((pat-material neutral)) + "neutral" + ) + (((pat-material carpet)) + "carpet" + ) + (((pat-material shmetal)) + "shmetal" + ) + (((pat-material grmetal)) + "grmetal" + ) + (((pat-material lava)) + "lava" + ) + (((pat-material crmetal)) + "crmetal" + ) + (((pat-material pcmetal)) + "pcmetal" + ) + (((pat-material grass)) + "grass" + ) + (((pat-material snow)) + "snow" + ) + (((pat-material swamp)) + "swamp" + ) + (((pat-material stone)) + "stone" + ) + (((pat-material hotcoals)) + "hotcoals" + ) + (((pat-material unknown)) + "unknown" + ) + (((pat-material dirt)) + "dirt" + ) + (((pat-material tube)) + "tube" + ) + (((pat-material stopproj)) + "stopproj" + ) + (((pat-material tar)) + "tar" + ) + (((pat-material straw)) + "straw" + ) + (((pat-material wood)) + "wood" + ) + (((pat-material quicksand)) + "quicksand" + ) + (((pat-material ice)) + "ice" + ) + (((pat-material rotate)) + "rotate" + ) + (((pat-material crwood)) + "crwood" + ) + (((pat-material waterbottom)) + "waterbottom" + ) + (((pat-material hdwood)) + "hdwood" + ) + (((pat-material sand)) + "sand" + ) + (((pat-material gravel)) + "gravel" + ) + (((pat-material metal)) + "metal" + ) + (else + "*unknown*" + ) + ) + ) + +(defun-debug pat-mode->string ((arg0 pat-surface)) + (case (-> arg0 mode) + (((pat-mode wall)) + "wall" + ) + (((pat-mode halfpipe)) + "halfpipe" + ) + (((pat-mode obstacle)) + "obstacle" + ) + (((pat-mode ground)) + "ground" + ) + (else + "*unknown*" + ) + ) + ) + +(defun-debug pat-event->string ((arg0 pat-surface)) + (case (-> arg0 event) + (((pat-event burn)) + "burn" + ) + (((pat-event deadly)) + "deadly" + ) + (((pat-event slippery)) + "slippery" + ) + (((pat-event melt)) + "melt" + ) + (((pat-event endlessfall)) + "endlessfall" + ) + (((pat-event burnup)) + "burnup" + ) + (((pat-event hide)) + "hide" + ) + (((pat-event deadlup)) + "deadlyup" + ) + (((pat-event shockup)) + "shockup" + ) + (((pat-event slide)) + "slide" + ) + (((pat-event lipramp)) + "lipramp" + ) + (((pat-event rail)) + "rail" + ) + (((pat-event none)) + "none" + ) + (((pat-event lip)) + "lip" + ) + (((pat-event shock)) + "shock" + ) + (else + "*unknown*" + ) + ) + ) + +(deftype pat-mode-info (structure) + ((name string :offset-assert 0) + (wall-angle float :offset-assert 4) + (color rgba :offset-assert 8) + (hilite-color rgba :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4 + (new 'static 'pat-mode-info + :name "ground" + :wall-angle 0.2 + :color (new 'static 'rgba :r #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "wall" + :wall-angle 2.0 + :color (new 'static 'rgba :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :b #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "obstacle" + :wall-angle 0.82 + :color (new 'static 'rgba :r #x7f :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "halfpipe" + :wall-angle -2.0 + :color (new 'static 'rgba :r #x7f :g #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + ) + ) diff --git a/goal_src/jak2/engine/common_objs/generic-obs-h.gc b/goal_src/jak2/engine/common_objs/generic-obs-h.gc index cdc1107268..41053e8b46 100644 --- a/goal_src/jak2/engine/common_objs/generic-obs-h.gc +++ b/goal_src/jak2/engine/common_objs/generic-obs-h.gc @@ -5,5 +5,233 @@ ;; name in dgo: generic-obs-h ;; dgos: ENGINE, GAME +(defenum manipy-options + :bitfield #t + :type uint32 + ) + +(declare-type sparticle-launch-group basic) + ;; DECOMP BEGINS +(deftype manipy (process-drawable) + ((new-trans-hook (function none) :offset-assert 200) + (cur-trans-hook (function none) :offset-assert 204) + (cur-event-hook (function none) :offset-assert 208) + (new-joint-anim art-joint-anim :offset-assert 212) + (new-joint-anim-blend uint64 :offset-assert 216) + (anim-mode symbol :offset-assert 224) + (cur-grab-handle handle :offset-assert 232) + (cur-target-handle handle :offset-assert 240) + (old-grab-pos vector :inline :offset-assert 256) + (joint joint-mod 4 :offset-assert 272) + (new-post-hook (function none) :offset-assert 288) + (cur-post-hook (function none) :offset-assert 292) + (clone-copy-trans symbol :offset-assert 296) + (shadow-backup basic :offset-assert 300) + (draw? symbol :offset-assert 304) + (userdata uint64 :offset-assert 312) + (prefix basic :offset-assert 320) + (shadow-volume-joint int32 :offset-assert 324) + (speed float :offset-assert 328) + (user-uint64 uint64 4 :offset-assert 336) + (options manipy-options :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 21 + :size-assert #x174 + :flag-assert #x1501000174 + (:methods + (manipy-method-20 () none 20) + ) + ) + +(deftype part-spawner (process) + ((root trsqv :offset-assert 128) + (part sparticle-launch-control :offset-assert 132) + (sound ambient-sound :offset-assert 136) + (mode (pointer sparticle-launch-group) :offset-assert 140) + (enable symbol :offset-assert 144) + (radius meters :offset-assert 148) + (world-sphere sphere :inline :offset-assert 160) + ) + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + (:methods + (part-spawner-method-14 () none 14) + (part-spawner-method-15 () none 15) + ) + ) + +(deftype part-tracker (process) + ((root trsqv :offset-assert 128) + (mat matrix :inline :offset-assert 144) + (part sparticle-launch-control :offset-assert 208) + (callback (function part-tracker vector) :offset-assert 212) + (linger-callback (function part-tracker vector) :offset-assert 216) + (duration uint64 :offset-assert 224) + (linger-duration uint64 :offset-assert 232) + (start-time time-frame :offset-assert 240) + (target uint64 :offset-assert 248) + (target-joint int32 :offset-assert 256) + (offset vector :inline :offset-assert 272) + (userdata uint64 :offset-assert 288) + (user-time time-frame 2 :offset-assert 296) + (user-vector vector :inline :offset-assert 320) + (user-handle uint32 2 :offset 352) + ) + :heap-base #xf0 + :method-count-assert 16 + :size-assert #x168 + :flag-assert #x1000f00168 + (:methods + (part-tracker-method-14 () none 14) + (part-tracker-method-15 () none 15) + ) + ) + +(deftype lightning-tracker (process) + ((root basic :offset-assert 128) + (lightning basic :offset-assert 132) + (callback basic :offset-assert 136) + (duration uint64 :offset-assert 144) + (start-time time-frame :offset-assert 152) + (offset0 vector :inline :offset-assert 160) + (offset1 vector :inline :offset-assert 176) + (target0 uint64 :offset-assert 192) + (target1 uint64 :offset-assert 200) + (target-joint0 int32 :offset-assert 208) + (target-joint1 int32 :offset-assert 212) + (sound uint32 :offset-assert 216) + (userdata uint64 :offset-assert 224) + (user-time time-frame 2 :offset-assert 232) + (user-vector vector :inline :offset-assert 256) + (user-handle handle 2 :offset 288) + ) + :heap-base #xb0 + :method-count-assert 17 + :size-assert #x130 + :flag-assert #x1100b00130 + (:methods + (lightning-tracker-method-14 () none 14) + (lightning-tracker-method-15 () none 15) + (lightning-tracker-method-16 () none 16) + ) + ) + +(deftype touch-tracker (process-drawable) + ((duration time-frame :offset-assert 200) + (target handle :offset-assert 208) + (event symbol :offset-assert 216) + (run-function (function object) :offset-assert 220) + (callback (function touch-tracker none) :offset-assert 224) + (event-mode basic :offset-assert 228) + ) + :heap-base #x70 + :method-count-assert 21 + :size-assert #xe8 + :flag-assert #x15007000e8 + (:methods + (touch-tracker-method-20 () none 20) + ) + ) + +(deftype swingpole (process-drawable) + ((edge-length meters :offset-assert 200) + (path-pos float :offset-assert 204) + (joint-track int32 :offset-assert 208) + (speed meters :offset-assert 212) + (dir vector :inline :offset-assert 224) + (sync sync-eased :inline :offset-assert 240) + ) + :heap-base #xa0 + :method-count-assert 23 + :size-assert #x11c + :flag-assert #x1700a0011c + (:methods + (swingpole-method-20 () none 20) + (swingpole-method-21 () none 21) + (swingpole-method-22 () none 22) + ) + ) + +(deftype gui-query (structure) + ((x-position int32 :offset-assert 0) + (y-position int32 :offset-assert 4) + (message string :offset-assert 8) + (decision symbol :offset-assert 12) + (only-allow-cancel symbol :offset-assert 16) + (no-msg string :offset-assert 20) + (message-space int32 :offset-assert 24) + ) + :method-count-assert 11 + :size-assert #x1c + :flag-assert #xb0000001c + (:methods + (gui-query-method-9 () none 9) + (gui-query-method-10 () none 10) + ) + ) + +(deftype othercam (process) + ((hand handle :offset-assert 128) + (old-global-mask process-mask :offset-assert 136) + (mask-to-clear process-mask :offset-assert 140) + (cam-joint-index int32 :offset-assert 144) + (old-pos vector :inline :offset-assert 160) + (old-mat-z vector :inline :offset-assert 176) + (had-valid-frame basic :offset-assert 192) + (border-value basic :offset-assert 196) + (die? symbol :offset-assert 200) + (survive-anim-end? symbol :offset-assert 204) + (spooling? symbol :offset-assert 208) + (fov float :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 14 + :size-assert #xd8 + :flag-assert #xe006000d8 + ) + +(deftype explosion (process-drawable) + ((start-time time-frame :offset-assert 200) + (duration uint32 :offset-assert 208) + (linger-duration uint32 :offset-assert 212) + (attack-id uint32 :offset-assert 216) + ) + :heap-base #x60 + :method-count-assert 23 + :size-assert #xdc + :flag-assert #x17006000dc + (:methods + (explosion-method-20 () none 20) + (explosion-method-21 () none 21) + (explosion-method-22 () none 22) + ) + ) + +(deftype explosion-init-params (structure) + ((spawn-point vector :inline :offset-assert 0) + (spawn-quat quaternion :inline :offset-assert 16) + (radius float :offset-assert 32) + (group basic :offset-assert 36) + (collide-with collide-spec :offset-assert 40) + (penetrate-using penetrate :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +(deftype process-hidden (process) + () + :method-count-assert 15 + :size-assert #x80 + :flag-assert #xf00000080 + (:methods + (process-hidden-method-14 () none 14) + ) + ) + diff --git a/goal_src/jak2/engine/common_objs/projectile-h.gc b/goal_src/jak2/engine/common_objs/projectile-h.gc index 10c49d9b5f..1977d374ef 100644 --- a/goal_src/jak2/engine/common_objs/projectile-h.gc +++ b/goal_src/jak2/engine/common_objs/projectile-h.gc @@ -5,5 +5,112 @@ ;; name in dgo: projectile-h ;; dgos: ENGINE, GAME +(defenum projectile-options + :type uint64 + :bitfield #t + ) + ;; DECOMP BEGINS +(deftype projectile (process-drawable) + ((starting-pos vector :inline :offset-assert 208) + (starting-dir vector :inline :offset-assert 224) + (target-pos vector :inline :offset-assert 240) + (base-target-pos vector :inline :offset-assert 256) + (pre-move-transv vector :inline :offset-assert 272) + (timeout time-frame :offset-assert 288) + (spawn-time time-frame :offset-assert 296) + (options projectile-options :offset-assert 304) + (last-target handle :offset-assert 312) + (notify-handle handle :offset-assert 320) + (owner-handle handle :offset-assert 328) + (ignore-handle handle :offset-assert 336) + (update-velocity (function projectile none) :offset-assert 344) + (move basic :offset-assert 348) + (pick-target basic :offset-assert 352) + (max-speed float :offset-assert 356) + (old-dist float 16 :offset-assert 360) + (old-dist-count int32 :offset-assert 424) + (hits int32 :offset-assert 428) + (max-hits int32 :offset-assert 432) + (tween float :offset-assert 436) + (attack-mode symbol :offset-assert 440) + (attack-id uint32 :offset-assert 444) + (damage float :offset-assert 448) + (charge-level float :offset-assert 452) + (sound-id sound-id :offset-assert 456) + (stop-speed meters :offset-assert 460) + (invinc-time time-frame :offset-assert 464) + ) + :heap-base #x160 + :method-count-assert 40 + :size-assert #x1d8 + :flag-assert #x28016001d8 + (:methods + (projectile-method-20 () none 20) + (projectile-method-21 () none 21) + (projectile-method-22 () none 22) + (projectile-method-23 () none 23) + (projectile-method-24 () none 24) + (projectile-method-25 () none 25) + (projectile-method-26 () none 26) + (projectile-method-27 () none 27) + (projectile-method-28 () none 28) + (projectile-method-29 () none 29) + (projectile-method-30 () none 30) + (projectile-method-31 () none 31) + (projectile-method-32 () none 32) + (projectile-method-33 () none 33) + (projectile-method-34 () none 34) + (projectile-method-35 () none 35) + (projectile-method-36 () none 36) + (projectile-method-37 () none 37) + (projectile-method-38 () none 38) + (projectile-method-39 () none 39) + ) + ) + +(deftype projectile-init-by-other-params (structure) + ((ent basic :offset-assert 0) + (charge float :offset-assert 4) + (attack-id uint32 :offset-assert 8) + (options projectile-options :offset-assert 16) + (notify-handle handle :offset-assert 24) + (owner-handle handle :offset-assert 32) + (ignore-handle handle :offset-assert 40) + (pos vector :inline :offset-assert 48) + (vel vector :inline :offset-assert 64) + (timeout handle :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x58 + :flag-assert #x900000058 + ) + +(define-extern projectile-init-by-other (function projectile-init-by-other-params projectile)) + +(defun spawn-projectile ((arg0 type) (arg1 projectile-init-by-other-params) (arg2 process-tree) (arg3 dead-pool)) + (let ((s4-0 (get-process arg3 arg0 #x4000))) + (when s4-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s4-0 arg2 (symbol->string (-> arg0 symbol)) (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 projectile-init-by-other arg1) + (-> s4-0 ppointer) + ) + ) + ) + +(deftype projectile-bounce (projectile) + ((played-bounce-time time-frame :offset-assert 472) + (tumble-quat quaternion :inline :offset-assert 480) + ) + :heap-base #x170 + :method-count-assert 42 + :size-assert #x1f0 + :flag-assert #x2a017001f0 + (:methods + (projectile-bounce-method-40 () none 40) + (projectile-bounce-method-41 () none 41) + ) + ) diff --git a/goal_src/jak2/engine/data/art-h.gc b/goal_src/jak2/engine/data/art-h.gc index cef56fe807..ce6ac0e95a 100644 --- a/goal_src/jak2/engine/data/art-h.gc +++ b/goal_src/jak2/engine/data/art-h.gc @@ -5,5 +5,392 @@ ;; name in dgo: art-h ;; dgos: ENGINE, GAME +(declare-type res-lump basic) +(declare-type merc-ctrl art-element) +(declare-type ripple-control basic) +(declare-type shadow-control basic) + +(defenum draw-control-status + :type uint16 + :bitfield #t + (close-to-screen 0) ;; 1 + (no-draw 1) ;; 2 + (no-draw-temp 2) ;; 4 + (on-screen 3) ;; 8 + (uninited 4) ;; 16 + (no-draw-bounds 5) ;; 32 + (no-closest-distance 6) ;; 64 + (math-skel 7) ;; 128 + (force-vu1 8) ;; 256 + (no-draw-bounds2 9) ;; 512 + (force-fade 10) ;; 1024 + (warp-cross-fade 11) ;; 2048 + (lod-set 12) ;; 4096 + (disable-fog 13) ;; 8192 + (hud 14) ;; 16384 + ) + +(defenum draw-control-data-format + :type uint8 + :bitfield #f + (pris 0) + (merc 1) + ) + +(defenum draw-control-global-effect + :type uint8 + :bitfield #t + (bit-0 0) + (bit-1 1) ;; 2 + (title-light 2) ;; 4 + (disable-envmap 3) ;; 8 + ) + ;; DECOMP BEGINS +(deftype joint-anim (basic) + ((name string :offset-assert 4) + (number int16 :offset-assert 8) + (length int16 :offset-assert 10) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype joint-anim-matrix (joint-anim) + ((data matrix :inline :dynamic :offset 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype joint-anim-transformq (joint-anim) + ((data transformq :inline :dynamic :offset 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype joint-anim-drawable (joint-anim) + ((data drawable :dynamic :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype joint-anim-frame (structure) + ((matrices matrix 2 :inline :offset-assert 0) + (data matrix :dynamic :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + (:methods + (new (symbol type int) _type_ 0) + ) + ) + +(defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v1-1 (max 0 (+ arg0 -2)))) + (the-as + joint-anim-frame + (new-dynamic-structure allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 v1-1)))) + ) + ) + ) + +(deftype joint-anim-compressed-hdr (structure) + ((control-bits uint32 14 :offset-assert 0) + (num-joints uint32 :offset-assert 56) + (matrix-bits uint32 :offset-assert 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype joint-anim-compressed-fixed (structure) + ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) + (offset-64 uint32 :offset-assert 64) + (offset-32 uint32 :offset-assert 68) + (offset-16 uint32 :offset-assert 72) + (reserved uint32 :offset-assert 76) + (data vector 133 :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x8a0 + :flag-assert #x9000008a0 + ) + +(deftype joint-anim-compressed-frame (structure) + ((offset-64 uint32 :offset-assert 0) + (offset-32 uint32 :offset-assert 4) + (offset-16 uint32 :offset-assert 8) + (reserved uint32 :offset-assert 12) + (data vector 133 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x860 + :flag-assert #x900000860 + ) + +(deftype joint-anim-compressed-control (structure) + ((num-frames uint16 :offset-assert 0) + (flags uint16 :offset-assert 2) + (fixed-qwc uint32 :offset-assert 4) + (frame-qwc uint32 :offset-assert 8) + (fixed joint-anim-compressed-fixed :offset-assert 12) + (data joint-anim-compressed-frame :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype art (basic) + ((name string :offset 8) + (length int32 :offset-assert 12) + (extra res-lump :offset-assert 16) + ) + :method-count-assert 13 + :size-assert #x14 + :flag-assert #xd00000014 + (:methods + (art-method-9 () none 9) + (art-method-10 () none 10) + (art-method-11 () none 11) + (art-method-12 () none 12) + ) + ) + +(deftype art-element (art) + ((pad uint8 12 :offset-assert 20) + ) + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +(deftype art-mesh-anim (art-element) + () + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition of type art-joint-anim +(deftype art-joint-anim (art-element) + ((speed float :offset 20) + (artist-base float :offset 24) + (artist-step float :offset 28) + (eye-anim basic :offset 4) + (master-art-group-name string :offset-assert 32) + (master-art-group-index int32 :offset-assert 36) + (blend-shape-anim basic :offset-assert 40) + (frames joint-anim-compressed-control :offset-assert 44) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + ) + +(deftype art-group (art) + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (art-group-method-13 () none 13) + (art-group-method-14 () none 14) + ) + ) + +;; definition of type art-mesh-geo +(deftype art-mesh-geo (art-element) + () + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition of type art-joint-geo +(deftype art-joint-geo (art-element) + () + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition of type art-joint-anim-manager-slot +(deftype art-joint-anim-manager-slot (structure) + ((anim basic :offset-assert 0) + (comp-data uint32 :offset-assert 4) + (time-stamp uint64 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype art-joint-anim-manager (basic) + ((kheap kheap :inline :offset-assert 16) + (free-index int32 :offset-assert 32) + (slot art-joint-anim-manager-slot 64 :inline :offset-assert 48) + ) + :method-count-assert 14 + :size-assert #x430 + :flag-assert #xe00000430 + (:methods + (new (symbol type int) _type_ 0) + (art-joint-anim-manager-method-9 () none 9) + (art-joint-anim-manager-method-10 () none 10) + (unload-from-slot (_type_ int) none 11) + (art-joint-anim-manager-method-12 () none 12) + (unload-from-level (_type_ level) none 13) + ) + ) + +(defmethod inspect art-joint-anim-manager ((obj art-joint-anim-manager)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Theap: #~%" (-> obj kheap)) + (format #t "~1Tfree-index: ~D~%" (-> obj free-index)) + (format #t "~1Tslot[64] @ #x~X~%" (-> obj slot)) + (dotimes (s5-0 64) + (format #t "~T [~D]~1Tslot: ~`art-joint-anim-manager-slot`P~%" s5-0 (-> obj slot s5-0)) + ) + obj + ) + +(defmethod new art-joint-anim-manager ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((s4-0 (-> gp-0 kheap))) + (set! (-> s4-0 base) (kmalloc (the-as kheap (-> allocation value)) arg0 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) arg0)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (dotimes (v1-6 64) + (set! (-> gp-0 slot v1-6 anim) #f) + ) + (set! (-> gp-0 free-index) 0) + gp-0 + ) + ) + +(deftype skeleton-group (art-group) + ((art-group-name string :offset-assert 32) + (jgeo int32 :offset-assert 36) + (janim int32 :offset-assert 40) + (bounds vector :inline :offset-assert 48) + (radius meters :offset 60) + (mgeo int16 6 :offset-assert 64) + (max-lod int32 :offset-assert 76) + (lod-dist float 6 :offset-assert 80) + (longest-edge meters :offset-assert 104) + (texture-level int8 :offset-assert 108) + (version int8 :offset-assert 109) + (shadow int8 :offset-assert 110) + (sort int8 :offset-assert 111) + (origin-joint-index int8 :offset-assert 112) + (shadow-joint-index int8 :offset-assert 113) + (light-index uint8 :offset-assert 114) + (pad uint8 :offset-assert 115) + ) + :method-count-assert 16 + :size-assert #x74 + :flag-assert #x1000000074 + (:methods + (skeleton-group-method-15 () none 15) + ) + ) + +(deftype lod-group (structure) + ((geo merc-ctrl :offset-assert 0) + (dist meters :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype lod-set (structure) + ((lod lod-group 6 :inline :offset-assert 0) + (max-lod int8 :offset-assert 48) + ) + :method-count-assert 10 + :size-assert #x31 + :flag-assert #xa00000031 + (:methods + (lod-set-method-9 () none 9) + ) + ) + +(deftype draw-control (basic) + ((process process :offset-assert 4) + (status draw-control-status :offset-assert 8) + (data-format draw-control-data-format :offset-assert 10) + (global-effect draw-control-global-effect :offset-assert 11) + (art-group art-group :offset-assert 12) + (jgeo art-joint-geo :offset-assert 16) + (mgeo merc-ctrl :offset-assert 20) + (dma-add-func function :offset-assert 24) + (skeleton skeleton :offset-assert 28) + (lod-set lod-set :inline :offset-assert 32) + (max-lod int8 :offset 80) + (force-lod int8 :offset-assert 81) + (cur-lod int8 :offset-assert 82) + (desired-lod int8 :offset-assert 83) + (ripple ripple-control :offset-assert 84) + (longest-edge meters :offset-assert 88) + (longest-edge? uint32 :offset 88) + (light-index uint8 :offset-assert 92) + (shadow-mask uint8 :offset-assert 93) + (level-index uint8 :offset-assert 94) + (death-draw-overlap uint8 :offset-assert 95) + (death-timer uint8 :offset-assert 96) + (death-timer-org uint8 :offset-assert 97) + (death-vertex-skip uint16 :offset-assert 98) + (death-effect uint32 :offset-assert 100) + (shadow uint32 :offset-assert 104) + (shadow-ctrl shadow-control :offset-assert 108) + (distance meters :offset-assert 112) + (origin vector :inline :offset-assert 128) + (bounds vector :inline :offset-assert 144) + (radius meters :offset 156) + (color-mult rgbaf :inline :offset-assert 160) + (color-emissive rgbaf :inline :offset-assert 176) + (effect-mask uint64 :offset-assert 192) + (seg-mask uint64 :offset-assert 200) + (origin-joint-index uint8 :offset-assert 208) + (shadow-joint-index uint8 :offset-assert 209) + (force-fade uint8 :offset-assert 210) + (default-texture-page uint8 :offset-assert 211) + (shadow-values uint32 :offset-assert 212) + ) + :method-count-assert 15 + :size-assert #xd8 + :flag-assert #xf000000d8 + (:methods + (get-skeleton-origin (_type_) vector 9) + (draw-control-method-10 () none 10) + (draw-control-method-11 () none 11) + (draw-control-method-12 () none 12) + (draw-control-method-13 () none 13) + (draw-control-method-14 () none 14) + ) + ) + +(defmethod get-skeleton-origin draw-control ((obj draw-control)) + (-> obj skeleton bones 0 transform trans) + ) + diff --git a/goal_src/jak2/engine/debug/debug-h.gc b/goal_src/jak2/engine/debug/debug-h.gc index 53e5c99437..64fb986ddb 100644 --- a/goal_src/jak2/engine/debug/debug-h.gc +++ b/goal_src/jak2/engine/debug/debug-h.gc @@ -7,3 +7,60 @@ ;; DECOMP BEGINS +(deftype pos-history (structure) + ((points (inline-array vector) :offset-assert 0) + (num-points int32 :offset-assert 4) + (h-first int32 :offset-assert 8) + (h-last int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype debug-vertex (structure) + ((trans vector4w :inline :offset-assert 0) + (normal vector3h :inline :offset-assert 16) + (st vector2h :inline :offset-assert 22) + (color uint32 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(deftype debug-vertex-stats (basic) + ((length int32 :offset-assert 4) + (pos-count int32 :offset-assert 8) + (vertex debug-vertex 600 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x4b10 + :flag-assert #x900004b10 + ) + +(define *color-black* (new 'static 'rgba :a #x80)) +(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) +(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) +(define *color-red* (new 'static 'rgba :r #xff :a #x80)) +(define *color-green* (new 'static 'rgba :g #xff :a #x80)) +(define *color-blue* (new 'static 'rgba :b #xff :a #x80)) +(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80)) +(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80)) +(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80)) +(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80)) +(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80)) +(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)) +(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) +(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) +(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) +(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80)) +(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80)) +(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80)) +(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) +(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) +(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) +(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80)) + +(define-extern add-debug-matrix (function symbol bucket-id matrix float matrix)) diff --git a/goal_src/jak2/engine/debug/memory-usage-h.gc b/goal_src/jak2/engine/debug/memory-usage-h.gc index d3e92db53c..7333d6aec2 100644 --- a/goal_src/jak2/engine/debug/memory-usage-h.gc +++ b/goal_src/jak2/engine/debug/memory-usage-h.gc @@ -7,3 +7,40 @@ ;; DECOMP BEGINS +(declare-file (debug)) +(when *debug-segment* +(deftype memory-usage-info (structure) + ((name string :offset-assert 0) + (count int32 :offset-assert 4) + (used int32 :offset-assert 8) + (total int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype memory-usage-block (basic) + ((work-bsp basic :offset-assert 4) + (length int32 :offset-assert 8) + (data memory-usage-info 112 :inline :offset-assert 16) + ) + :method-count-assert 12 + :size-assert #x710 + :flag-assert #xc00000710 + (:methods + (memory-usage-block-method-9 () none 9) + (memory-usage-block-method-10 () none 10) + (memory-usage-block-method-11 () none 11) + ) + ) + + +(define *mem-usage* (new 'debug 'memory-usage-block)) +(define *dma-mem-usage* (new 'debug 'memory-usage-block)) +(define *temp-mem-usage* (the-as memory-usage-block #f)) + +) + + + diff --git a/goal_src/jak2/engine/debug/stats-h.gc b/goal_src/jak2/engine/debug/stats-h.gc index 6b1951083c..554c1cbdcd 100644 --- a/goal_src/jak2/engine/debug/stats-h.gc +++ b/goal_src/jak2/engine/debug/stats-h.gc @@ -5,5 +5,356 @@ ;; name in dgo: stats-h ;; dgos: ENGINE, GAME +(defenum perf-stat-bucket + :type uint32 ;; guess + + (all-code 0) + (spatial-hash-build 1) + (spatial-hash-search 2) + (collide 3) + (collide-list 4) + (collide-fill 5) + (actor-hash 6) + (nav 7) + (nav-dma-all 8) + (nav-dma-read 9) + (nav-dma-write 10) + (nav-dma-work 11) + (nav-part1 12) + (nav-part2 13) + (nav-part3 14) + (nav-part4 15) + (nav-part5 16) + (nav-part6 17) + (nav-part7 18) + (nav-part8 19) + (nav-part9 20) + (nav-part10 21) + (add-to-translation 22) + (update-current-poly 23) + (clamp-vector-to-mesh 24) + (ray-step 25) + (update-spheres 26) + (travel-around-spheres 27) + (avoid-spheres 28) + (check-vector-collision-with-nav-spheres 29) + (find-nearest-poly 30) + (find-containing-poly 31) + (generate-velocity 32) + (apply-rotation 33) + (apply-velocity 34) + (travel-post 35) + (common-post 36) + (misc 37) + (mercneric 38) + (tie-generic 39) + (background 40) + (drawable 41) + (tfrag 42) + (tfrag-scissor 43) + (inst-shrub 44) + (proto-shrub 45) + (inst-tie 46) + (proto-tie 47) + (bones 48) + (camera 49) + (foreground 50) + ) + + ;; DECOMP BEGINS +(deftype tr-stat (structure) + ((groups uint16 :offset-assert 0) + (fragments uint16 :offset-assert 2) + (tris uint32 :offset-assert 4) + (dverts uint32 :offset-assert 8) + (instances uint16 :offset-assert 12) + (pad uint16 :offset-assert 14) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype merc-global-stats (structure) + ((merc tr-stat :inline :offset-assert 0) + (emerc tr-stat :inline :offset-assert 16) + (mercneric tr-stat :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype perf-stat (structure) + ((frame-number uint32 :offset-assert 0) + (count uint32 :offset-assert 4) + (cycles uint32 :offset-assert 8) + (instructions uint32 :offset-assert 12) + (icache uint32 :offset-assert 16) + (dcache uint32 :offset-assert 20) + (select uint32 :offset-assert 24) + (ctrl uint32 :offset-assert 28) + (accum0 uint32 :offset-assert 32) + (accum1 uint32 :offset-assert 36) + (to-vu0-waits uint32 :offset-assert 40) + (to-spr-waits uint32 :offset-assert 44) + (from-spr-waits uint32 :offset-assert 48) + ) + :method-count-assert 14 + :size-assert #x34 + :flag-assert #xe00000034 + (:methods + (perf-stat-method-9 () none 9) + (print-to-stream (_type_ string basic) none 10) + (reset! (_type_) none 11) + (read! (_type_) none 12) + (update-wait-stats (_type_ uint uint uint) none 13) + ) + ) + +(defun-debug perf-stat-bucket->string ((arg0 perf-stat-bucket)) + (case arg0 + (((perf-stat-bucket collide-fill)) + "collide-fill" + ) + (((perf-stat-bucket nav)) + "nav" + ) + (((perf-stat-bucket bones)) + "bones" + ) + (((perf-stat-bucket foreground)) + "foreground" + ) + (((perf-stat-bucket inst-tie)) + "inst-tie" + ) + (((perf-stat-bucket common-post)) + "common-post" + ) + (((perf-stat-bucket nav-dma-write)) + "nav-dma-write" + ) + (((perf-stat-bucket collide-list)) + "collide-list" + ) + (((perf-stat-bucket clamp-vector-to-mesh)) + "clamp-vector-to-mesh" + ) + (((perf-stat-bucket nav-part3)) + "nav-part3" + ) + (((perf-stat-bucket mercneric)) + "mercneric" + ) + (((perf-stat-bucket apply-velocity)) + "apply-velocity" + ) + (((perf-stat-bucket tfrag-scissor)) + "tfrag-scissor" + ) + (((perf-stat-bucket misc)) + "misc" + ) + (((perf-stat-bucket find-nearest-poly)) + "find-nearest-poly" + ) + (((perf-stat-bucket nav-part6)) + "nav-part6" + ) + (((perf-stat-bucket nav-part2)) + "nav-part2" + ) + (((perf-stat-bucket generate-velocity)) + "generate-velocity" + ) + (((perf-stat-bucket inst-shrub)) + "inst-shrub" + ) + (((perf-stat-bucket avoid-spheres)) + "avoid-spheres" + ) + (((perf-stat-bucket proto-shrub)) + "proto-shrub" + ) + (((perf-stat-bucket drawable)) + "drawable" + ) + (((perf-stat-bucket nav-part9)) + "nav-part9" + ) + (((perf-stat-bucket all-code)) + "all-code" + ) + (((perf-stat-bucket actor-hash)) + "actor-hash" + ) + (((perf-stat-bucket nav-dma-all)) + "nav-dma-all" + ) + (((perf-stat-bucket travel-post)) + "travel-post" + ) + (((perf-stat-bucket travel-around-spheres)) + "travel-around-spheres" + ) + (((perf-stat-bucket nav-part10)) + "nav-part10" + ) + (((perf-stat-bucket nav-dma-work)) + "nav-dma-work" + ) + (((perf-stat-bucket proto-tie)) + "proto-tie" + ) + (((perf-stat-bucket nav-part4)) + "nav-part4" + ) + (((perf-stat-bucket ray-step)) + "ray-step" + ) + (((perf-stat-bucket spatial-hash-search)) + "spatial-hash-search" + ) + (((perf-stat-bucket apply-rotation)) + "apply-rotation" + ) + (((perf-stat-bucket find-containing-poly)) + "find-containing-poly" + ) + (((perf-stat-bucket update-spheres)) + "update-spheres" + ) + (((perf-stat-bucket nav-part7)) + "nav-part7" + ) + (((perf-stat-bucket tfrag)) + "tfrag" + ) + (((perf-stat-bucket collide)) + "collide" + ) + (((perf-stat-bucket update-current-poly)) + "update-current-poly" + ) + (((perf-stat-bucket nav-dma-read)) + "nav-dma-read" + ) + (((perf-stat-bucket spatial-hash-build)) + "spatial-hash-build" + ) + (((perf-stat-bucket tie-generic)) + "tie-generic" + ) + (((perf-stat-bucket camera)) + "camera" + ) + (((perf-stat-bucket background)) + "background" + ) + (((perf-stat-bucket nav-part5)) + "nav-part5" + ) + (((perf-stat-bucket nav-part1)) + "nav-part1" + ) + (((perf-stat-bucket check-vector-collision-with-nav-spheres)) + "check-vector-collision-with-nav-spheres" + ) + (((perf-stat-bucket add-to-translation)) + "add-to-translation" + ) + (((perf-stat-bucket nav-part8)) + "nav-part8" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type perf-stat-array +(deftype perf-stat-array (inline-array-class) + ((data perf-stat :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type perf-stat-array +(defmethod inspect perf-stat-array ((obj perf-stat-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! (-> perf-stat-array heap-base) (the-as uint 52)) + + +(defmethod reset! perf-stat ((obj perf-stat)) + ; (let ((v1-0 (-> obj ctrl))) + (+! (-> obj count) 1) + ; (b! (zero? v1-0) cfg-2 :delay (nop!)) + ; (.mtc0 Perf r0) + ; (.sync.l) + ; (.sync.p) + ; (.mtpc pcr0 r0) + ; (.mtpc pcr1 r0) + ; (.sync.l) + ; (.sync.p) + ; (.mtc0 Perf v1-0) + ; ) + ; (.sync.l) + ; (.sync.p) + ; (label cfg-2) + ; 0 + (none) + ) + + +(defmethod read! perf-stat ((obj perf-stat)) + ; (local-vars (v1-1 int) (v1-3 int)) + ; (b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!)) + ; (.mtc0 Perf r0) + ; (.sync.l) + ; (.sync.p) + ; (.mfpc v1-1 pcr0) + ; (+! (-> obj accum0) v1-1) + ; (.mfpc v1-3 pcr1) + ; (+! (-> obj accum1) v1-3) + ; (label cfg-2) + ; 0 + (none) + ) + +;; definition for method 13 of type perf-stat +;; INFO: Return type mismatch int vs none. +(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) + (when (nonzero? (-> obj ctrl)) + (+! (-> obj to-vu0-waits) arg0) + (+! (-> obj to-spr-waits) arg1) + (+! (-> obj from-spr-waits) arg2) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(when (not *debug-segment*) + (set! (-> perf-stat method-table 11) nothing) + (set! (-> perf-stat method-table 12) nothing) + (set! (-> perf-stat method-table 13) nothing) + ) + + + + diff --git a/goal_src/jak2/engine/dma/dma-bucket.gc b/goal_src/jak2/engine/dma/dma-bucket.gc index 6792ccfeb9..38d2e3682e 100644 --- a/goal_src/jak2/engine/dma/dma-bucket.gc +++ b/goal_src/jak2/engine/dma/dma-bucket.gc @@ -7,3 +7,88 @@ ;; DECOMP BEGINS +;; A dma-bucket is used to organize dma data into groups called buckets. +;; Each bucket is a linked list of DMA. At DMA time, the buckets are sent in order. + +;; A dma-bucket is a 16 byte thing that lives in the dma-buffer. +;; buckets live consecutively in the dma-buffer, and can mark the start of a DMA chain +;; location anywhere. + +;; The bucket doesn't own the data, but rather is a beginning of a linked list of DMA data associated with that bucket +;; that's stored somewhere else. + +;; At the end, all the buckets are spliced together. + +;; The typical process is: +;; - empty buckets are allocated with add-buckets +;; - tags are put somewhere and added to the appropriate bucket with insert-tag, updating last as needed. +;; - buckets are patched to link to each other with dma-buffer-patch-buckets. + +;; the idea here is that you can build the buckets in whatever order you want, but the buckets +;; will be DMAd in the bucket allocation order. + +;; Each bucket contains: +;; a tag, (64-bits), to point to the chain of the bucket +;; last, a pointer to the last tag of this bucket, so that the bucket can be patched to point to the next. + + +(defun dma-buffer-add-buckets ((arg0 dma-buffer) (arg1 int)) + "Add count buckets. Each bucket is initialized as empty and won't transfer anything." + (let ((v0-0 (-> arg0 base))) + (let ((v1-0 (the-as object v0-0))) + (dotimes (a2-0 arg1) + (set! (-> (the-as dma-bucket v1-0) tag) + (new 'static 'dma-tag :id (dma-tag-id next) :addr (the-as int (&+ (the-as pointer v1-0) 16))) + ) + (set! (-> (the-as dma-bucket v1-0) last) (the-as (pointer dma-tag) v1-0)) + (set! v1-0 (&+ (the-as pointer v1-0) 16)) + ) + (set! (-> arg0 base) (the-as pointer v1-0)) + ) + (the-as (inline-array dma-bucket) v0-0) + ) + ) + +(defun dma-buffer-patch-buckets ((arg0 (inline-array dma-bucket)) (arg1 int)) + "After adding all data to buckets, call this to stitch together the chains for + count consecutive buckets" + (when (nonzero? arg0) + (dotimes (v1-1 arg1) + (cond + ((= (the-as object arg0) (-> arg0 0 last)) + (set! (-> arg0 0 tag) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> arg0 0 clear) (the-as uint 0)) + 0 + ) + (else + (set! (-> arg0 0 last 0 addr) (the-as int (-> arg0 1))) + (cond + ((or *display-profile* *stats-profile-bars*) + ;; if we're VU profiling, trigger an interrupt after this bucket's DMA finishes. + ;; the profiler will record this. + (set! (-> (the-as dma-packet arg0) vif0) (new 'static 'vif-tag :cmd (vif-cmd mark) :imm v1-1)) + (set! (-> (the-as dma-packet arg0) vif1) (new 'static 'vif-tag :irq #x1)) + ) + (else + (set! (-> arg0 0 clear) (the-as uint 0)) + 0 + ) + ) + ) + ) + (set! arg0 (the-as (inline-array dma-bucket) (-> arg0 1))) + ) + ) + (the-as (inline-array dma-bucket) arg0) + ) + +(defun dma-bucket-insert-tag ((arg0 (inline-array dma-bucket)) (arg1 bucket-id) (arg2 pointer) (arg3 (pointer dma-tag))) + "Add a DMA chain to the bucket" + + (let ((v1-1 (-> arg0 arg1))) + (set! (-> (the-as dma-bucket (-> v1-1 last)) next) (the-as uint arg2)) + (set! (-> v1-1 last) arg3) + ) + arg2 + ) + diff --git a/goal_src/jak2/engine/dma/dma-buffer.gc b/goal_src/jak2/engine/dma/dma-buffer.gc index 3e13e0f23e..941d485f34 100644 --- a/goal_src/jak2/engine/dma/dma-buffer.gc +++ b/goal_src/jak2/engine/dma/dma-buffer.gc @@ -5,5 +5,476 @@ ;; name in dgo: dma-buffer ;; dgos: ENGINE, GAME + +;; DMA buffers store data to be sent over DMA. +;; They are a very simple wrapper around the data. +;; Typically a dma-buffer will store dma-buckets or other more complicated data structures. + +;; The main display list uses a "chain transfer". In this mode, the DMA system reads dma-tags which +;; tell it what to transfer next. This can be used to construct linked lists of DMA data. + +;; If the DMA is configured correctly, it is possible to make the first quadword contain +;; both a dma-tag and a tag for the peripheral. This allows you to have a single quadword +;; tag that controls both the DMA and peripheral. We call these a "dma-packet" for some reason. + +;; Ex: +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; 32-bit vifcode ;; 32-bit vifcode ;; 64-bit dma-tag ;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; in this case, the vifcodes will be sent to the vif, if +;; the dma transfer has tte set. +;; note that the second vifcode can also hold other stuff depending on the mode. + ;; DECOMP BEGINS +;; A dma-tag plus two vif-tags in a single quadword. +;; Most DMA stuff goes directly to the VIF, so this is the +;; most common. +(deftype dma-packet (structure) + ((dma dma-tag :offset-assert 0) + (vif0 vif-tag :offset-assert 8) + (vif1 vif-tag :offset-assert 12) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; seems to be unused? Also, it seems to be broken. Do not use this. +(deftype dma-packet-array (inline-array-class) + ((data dma-packet :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> dma-packet-array heap-base) (the-as uint 16)) + + +(deftype dma-gif (structure) + ((gif uint64 2 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; For doing a dma -> vif -> gif (path 2) transfer. +(deftype dma-gif-packet (structure) + ((dma-vif dma-packet :inline :offset-assert 0) + (gif uint64 2 :offset-assert 16) + (gif0 uint64 :offset 16) ;; added + (gif1 uint64 :offset 24) ;; added + (quad uint128 2 :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; dma-buffer is a dynamically sized container for storing DMA data. +;; It seems like this was not actually implemented as a proper dynamic type. +;; I added a data-buffer field that overlaps with data to get at the array of +;; bytes more easily. +(deftype dma-buffer (basic) + ((allocated-length int32 :offset-assert 4) + (base pointer :offset-assert 8) + (end pointer :offset-assert 12) + (data uint64 1 :offset-assert 16) + (data-buffer uint8 :dynamic :offset 16) ;; the actual dynamic array backing it. + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + (:methods + (new (symbol type int) _type_ 0) + ) + ) + +(defmethod new dma-buffer ((allocation symbol) (type-to-make type) (arg0 int)) + "Create a new dma-buffer with enough room to store arg0 bytes. + Note that this does not set the end field." + (let ((v0-0 (object-new allocation type-to-make (+ arg0 -4 (-> type-to-make size))))) + (set! (-> v0-0 base) (-> v0-0 data)) + (set! (-> v0-0 allocated-length) arg0) + v0-0 + ) + ) + +(defun dma-buffer-inplace-new ((arg0 dma-buffer) (arg1 int)) + "Create a dma-buffer in-place. Does not set the type of the dma-buffer object." + (set! (-> arg0 base) (-> arg0 data)) + (set! (-> arg0 allocated-length) arg1) + arg0 + ) + +(defmethod length dma-buffer ((obj dma-buffer)) + "Get the amount of data the buffer can hold, in bytes." + (-> obj allocated-length) + ) + +(defmethod asize-of dma-buffer ((obj dma-buffer)) + "Get the size in memory of the object" + (+ (-> obj allocated-length) -4 (-> dma-buffer size)) + ) + +(defun dma-buffer-length ((arg0 dma-buffer)) + "Get length used in quadwords, rounded down" + (shr (+ (&- (-> arg0 base) (the-as uint (-> arg0 data))) 15) 4) + ) + +(defun dma-buffer-free ((arg0 dma-buffer)) + "Get the number of free quadwords, rounded down, between base and end pointers." + (shr (+ (&- (-> arg0 end) (the-as uint (-> arg0 base))) 15) 4) + ) + +(defmacro dma-buffer-add-base-type (buf pkt dma-type &rest body) + "Base macro for adding stuff to a dma-buffer. Don't use this directly!" + + (with-gensyms (dma-buf) + `(let* ((,dma-buf ,buf) + (,pkt (the-as ,dma-type (-> ,dma-buf base)))) + + ,@body + + (set! (-> ,dma-buf base) (&+ (the-as pointer ,pkt) (size-of ,dma-type))) + + ) + ) + ) + +(defmacro dma-buffer-add-base-data (buf data-type forms) + "Base macro for adding data words to a dma-buffer. + Each form in forms is converted into data-type and added to the buffer. NO TYPE CHECKING is performed, so be careful!" + + (with-gensyms (dma-buf ptr) + `(let* ((,dma-buf ,buf) + (,ptr (the-as (pointer ,data-type) (-> ,dma-buf base)))) + + ,@(apply-i (lambda (x i) `(set! (-> ,ptr ,i) (the-as ,data-type ,x))) forms) + + (set! (-> ,dma-buf base) (&+ (the-as pointer ,ptr) (* ,(length forms) (size-of ,data-type)))) + + ) + ) + ) + + +(defmacro dma-buffer-add-cnt-vif2 (buf qwc vif0 vif1) + "Add a dma-packet to a dma-buffer. + The packet is made up of a 'cnt' DMAtag (transfer qwc qwords of data after the tag and continue from after that point) + and includes two vif-tags for vifcode, or something else if needed." + + (with-gensyms (pkt) + `(dma-buffer-add-base-type ,buf ,pkt dma-packet + + (set! (-> ,pkt dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc ,qwc)) + + (set! (-> ,pkt vif0) ,vif0) + (set! (-> ,pkt vif1) ,vif1) + + ) + ) + ) + +(defmacro dma-buffer-add-ref-vif2 (buf qwc addr vif0 vif1) + "Add a dma-packet to a dma-buffer. + The packet is made up of a 'cnt' DMAtag (transfer qwc qwords of data at addr and continue from after the tag) + and includes two vif-tags for vifcode, or something else if needed." + + (with-gensyms (pkt) + `(dma-buffer-add-base-type ,buf ,pkt dma-packet + + (set! (-> ,pkt dma) (new 'static 'dma-tag :id (dma-tag-id ref) :qwc ,qwc :addr (the-as int ,addr))) + + (set! (-> ,pkt vif0) ,vif0) + (set! (-> ,pkt vif1) ,vif1) + + ) + ) + ) + +(defmacro dma-buffer-add-ret (buf) + "Add a dma-packet to a dma-buffer. This packet simply does a DMA 'return' " + + (with-gensyms (pkt) + `(dma-buffer-add-base-type ,buf ,pkt dma-packet + + (set! (-> ,pkt dma) (new 'static 'dma-tag :id (dma-tag-id ret) :qwc 0)) + + (set! (-> ,pkt vif0) (new 'static 'vif-tag :cmd (vif-cmd nop))) + (set! (-> ,pkt vif1) (new 'static 'vif-tag :cmd (vif-cmd nop))) + + ) + ) + ) + +(defmacro dma-buffer-add-gif-tag (buf giftag gifregs) + "Add a giftag to a dma-buffer." + + (with-gensyms (pkt) + `(dma-buffer-add-base-type ,buf ,pkt gs-gif-tag + + (set! (-> ,pkt tag) ,giftag) + + (set! (-> ,pkt regs) ,gifregs) + + ) + ) + ) + +(defmacro dma-buffer-add-uint64 (buf &rest body) + "Add 64-bit words to a dma-buffer. See dma-buffer-add-base-data" + + `(dma-buffer-add-base-data ,buf uint64 ,body) + ) + +(defmacro dma-buffer-add-uint128 (buf &rest body) + "Add 128-bit words to a dma-buffer. See dma-buffer-add-base-data" + + `(dma-buffer-add-base-data ,buf uint128 ,body) + ) + +(defun dma-buffer-add-vu-function ((dma-buf dma-buffer) (vu-func vu-function) (flush-path-3 int)) + "Add DMA tags to load the given VU function. The destination in vu instruction memory + is specific inside the vu-function. This does NOT copy the vu-function into the buffer, + but creates a reference to the existing VU function." + + ;; The first 4 bytes of a vu-function object's data are discarded because they aren't aligned. + (let ((func-ptr (the-as pointer (&-> vu-func data 4))) + (qlen (-> vu-func qlength)) ;; number of quadwords + (origin (-> vu-func origin)) ;; destination address in VU instruction memory. + ) + ;; loop until whole program is transferred. + (while (> qlen 0) + ;; transfer up to 127 quadwords at a single time. + (let ((qwc-now (min 127 qlen))) + ;; Set up DMA to transfer the data from the vu-function + ;; ref id = reference to data outside of the buffer. + (dma-buffer-add-ref-vif2 dma-buf qwc-now func-ptr + ;; Set up first vifcode as a flush. + (new 'static 'vif-tag :cmd (if (zero? flush-path-3) (vif-cmd flushe) (vif-cmd flusha))) + ;; next vifcode, transfer microprogram. This is in 64-bit units (VU instructions) + (new 'static 'vif-tag :cmd (vif-cmd mpg) :num (shl qwc-now 1) :imm origin) + ) + ;; increment by qwc-now quadwords. + (&+! func-ptr (shl qwc-now 4)) + (set! qlen (- qlen qwc-now)) + (+! origin (shl qwc-now 1)) + ) + ) + ) + #f + ) + +(defun dma-buffer-send ((chan dma-bank) (buf dma-buffer)) + "Send the DMA buffer! DOES NOT TRANSFER TAG, you probably want dma-buffer-send-chain instead." + (when (< (-> buf allocated-length) + (&- (-> buf base) (-> buf data)) + ) + ;; oops. we overflowed the DMA buffer. die. + (segfault) + ) + (dma-send chan + (the-as uint (-> buf data)) + (the-as uint (dma-buffer-length buf)) + ) + ) + +(defun dma-buffer-send-chain ((chan dma-bank-source) (buf dma-buffer)) + "Send the DMA buffer! Sends the tags" + (when (< (-> buf allocated-length) + (&- (-> buf base) (-> buf data)) + ) + ;; oops. we overflowed the DMA buffer. die. + (segfault) + ) + (dma-send-chain chan + (the-as uint (-> buf data)) + ) + ) + +(defmacro dma-buffer-add-gs-set-flusha (buf &rest reg-list) + "Add a gif cnt dma packet to a dma-buffer for setting GS registers. Up to 16 can be set at once. + The packet runs the flusha command which waits for GIF transfer to end and VU1 microprogram to stop. + reg-list is a list of pairs where the car is the register name and the cadr is the value to be set for that register." + + (let ((reg-count (length reg-list)) + (qwc (+ (length reg-list) 1)) + (reg-names (apply first reg-list)) + (reg-datas (apply second reg-list)) + ) + `(begin + ;; dma tag + (dma-buffer-add-cnt-vif2 ,buf ,qwc + (new 'static 'vif-tag :cmd (vif-cmd flusha)) + (new 'static 'vif-tag :cmd (vif-cmd direct) :imm ,qwc) + ) + + ;; gif tag for editing gs regs + (dma-buffer-add-gif-tag ,buf (new 'static 'gif-tag64 :nloop 1 :eop 1 :nreg ,reg-count) + (gs-reg-list a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d) + ) + + ;; gs regs + (dma-buffer-add-uint64 ,buf + ,@(apply2 (lambda (x) x) (lambda (x) `(gs-reg64 ,x)) reg-datas reg-names) + ) + ) + ) + ) + +(defmacro dma-buffer-add-gs-set (buf &rest reg-list) + "Add a gif cnt dma packet to a dma-buffer for setting GS registers. Up to 16 can be set at once. + reg-list is a list of pairs where the car is the register name and the cadr is the value to be set for that register." + + (let ((reg-count (length reg-list)) + (qwc (+ (length reg-list) 1)) + (reg-names (apply first reg-list)) + (reg-datas (apply second reg-list)) + ) + `(begin + ;; dma tag + (dma-buffer-add-cnt-vif2 ,buf ,qwc + (new 'static 'vif-tag :cmd (vif-cmd nop)) + (new 'static 'vif-tag :cmd (vif-cmd direct) :imm ,qwc) + ) + + ;; gif tag for editing gs regs + (dma-buffer-add-gif-tag ,buf (new 'static 'gif-tag64 :nloop 1 :eop 1 :nreg ,reg-count) + (gs-reg-list a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d a+d) + ) + + ;; gs regs + (dma-buffer-add-uint64 ,buf + ,@(apply2 (lambda (x) x) (lambda (x) `(gs-reg64 ,x)) reg-datas reg-names) + ) + ) + ) + ) + +(defmacro with-cnt-vif-block (bindings &rest body) + "Start a cnt w/ vif direct to gif dma packet setup for the dma-buffer in bindings. + With this, you can transfer data through PATH2 without having to setup the tag yourself. + The qwc of the transfer is determined at runtime at the end of this block." + + (let ((buf (first bindings))) + + (with-gensyms (buf-start buf-qwc) + `(let ((,buf-start (-> ,buf base))) + + ;; setup the dmatag for PATH2 transfer, qwc is 0 (patched later) + (dma-buffer-add-cnt-vif2 ,buf 0 + (new 'static 'vif-tag :cmd (vif-cmd nop)) + (new 'static 'vif-tag :cmd (vif-cmd direct)) + ) + + ;; things with this buffer! + ,@body + + ;; patch qwc! just do the difference between the current ptr and the old one and turn it into qwords. + ;; we take one qword out because it's the initial dmatag which isnt part of the count. + ;; this rounds *down*, so make sure to fill the buffer in 128-bit boundaries. + (let ((,buf-qwc (/ (+ (&- -16 ,buf-start) (the int (-> ,buf base))) 16))) + (cond + ((nonzero? ,buf-qwc) ;; stuff was added to the buffer + ;; patch the DMA tag + (logior! (-> (the-as (pointer dma-tag) ,buf-start) 0) (the-as uint (new 'static 'dma-tag :qwc ,buf-qwc))) + ;; patch the 2nd vifcode's imm field (qwc) + (logior! (-> (the-as (pointer dma-tag) ,buf-start) 1) (the-as uint (shl (shr (shl ,buf-qwc 48) 48) 32))) + ) + (else ;; nothing was added to the buffer. delete the dmatag, you cannot transfer 0 qwords. + (set! (-> ,buf base) ,buf-start) + ) + ) + ) + ) + + )) + ) + +(defmacro with-cnt-vif-block-qwc (bindings &rest body) + "Start a cnt w/ vif direct to gif dma packet setup for the dma-buffer in bindings. + With this, you can transfer data through PATH2 without having to setup the tag yourself. + The qwc of the transfer is determined at runtime at the end of this block. + WARNING: You MUST guarantee that the resulting qwc is NOT zero!" + + (let ((buf (first bindings))) + + (with-gensyms (buf-start buf-qwc) + `(let ((,buf-start (the-as dma-packet (-> ,buf base)))) + ;; dmatag will be added at the end so we reserve + (&+! (-> ,buf base) 16) + + ;; setup the dmatag for PATH2 transfer, qwc is 0 (patched later) + (dma-buffer-add-cnt-vif2 ,buf 0 + (new 'static 'vif-tag :cmd (vif-cmd nop)) + (new 'static 'vif-tag :cmd (vif-cmd direct)) + ) + + ;; things with this buffer! + ,@body + + ;; we make the dmatag now! its at the start. + (let ((,buf-qwc (/ (+ (- -16 (the-as int ,buf-start)) (the-as int (-> ,buf base))) 16))) + (set! (-> ,buf-start dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc ,buf-qwc)) + (set! (-> ,buf-start vif0) (new 'static 'vif-tag)) + (set! (-> ,buf-start vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1 :imm ,buf-qwc)) + ) + ) + + )) + ) + +(defmacro with-dma-bucket (bindings &rest body) + "Start a new dma-bucket in body that will be finished at the end. + The bindings are the dma-buffer, dma-bucket and bucket-id respectively." + + (let ((buf (first bindings)) + (bucket (second bindings)) + (bucket-id (third bindings)) + ) + + (with-gensyms (buf-start bucket-edge pkt) + `(let ((,buf-start (-> ,buf base))) + + ,@body + + ;; we end the chain with a next. The bucket system will patch the next chain to this, + ;; and then patch all the buckets togehter before sending the DMA. + (let ((,bucket-edge (the (pointer dma-tag) (-> ,buf base)))) + (let ((,pkt (the-as dma-packet (-> ,buf base)))) + + (set! (-> ,pkt dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> ,pkt vif0) (new 'static 'vif-tag :cmd (vif-cmd nop))) + (set! (-> ,pkt vif1) (new 'static 'vif-tag :cmd (vif-cmd nop))) + + (set! (-> ,buf base) (&+ (the-as pointer ,pkt) (size-of dma-packet))) + + ) + (dma-bucket-insert-tag ,bucket ,bucket-id + ,buf-start ;; the first thing in this chain, bucket will patch previous to this + ,bucket-edge ;; end of this chain (ptr to next tag) + ) + ) + ) + ) + + ) + ) + +(defmacro with-dma-buffer-add-bucket (bindings &key (bucket-group (-> (current-frame) bucket-group)) &rest body) + "Bind a dma-buffer to a variable and use it on a block to allow adding things to a new bucket. + usage: (with-dma-buffer-add-bucket ((buffer-name buffer) bucket-id) &rest body) + example: (with-dma-buffer-add-bucket ((buf (-> (current-frame) debug-buf)) (bucket-id debug-no-zbuf)) ...)" + + `(let ((,(caar bindings) ,(cadar bindings))) + (with-dma-bucket (,(caar bindings) ,bucket-group ,(cadr bindings)) + ,@body + ) + ) + ) + + diff --git a/goal_src/jak2/engine/dma/dma-disasm.gc b/goal_src/jak2/engine/dma/dma-disasm.gc index 29b816640b..8936ca4993 100644 --- a/goal_src/jak2/engine/dma/dma-disasm.gc +++ b/goal_src/jak2/engine/dma/dma-disasm.gc @@ -7,3 +7,582 @@ ;; DECOMP BEGINS +;; Debug tool to print out a DMA list. + +(declare-file (debug)) +(when *debug-segment* + +(deftype vif-disasm-element (structure) + ((mask uint32 :offset-assert 0) + (tag vif-cmd-32 :offset-assert 4) + (val uint32 :offset-assert 8) + (print uint32 :offset-assert 12) + (string1 string :offset-assert 16) + (string2 string :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + + +(define *vif-disasm-table* + (the-as (array vif-disasm-element) + (new 'static 'boxed-array :type vif-disasm-element + (new 'static 'vif-disasm-element :mask #x7f :string1 "nop") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stcycl) :print #x2 :string1 "stcycl") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 offset) :print #x1 :string1 "offset" :string2 "offset") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 base) :print #x1 :string1 "base" :string2 "base") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 itop) :print #x1 :string1 "itop" :string2 "addr") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stmod) :print #x1 :string1 "stmod" :string2 "mode") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mskpath3) :print #x1 :string1 "mskpath3" :string2 "mask") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mark) :print #x1 :string1 "mark" :string2 "mark") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 flushe) :string1 "flushe") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 flush) :string1 "flush") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 flusha) :string1 "flusha") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mscal) :print #x1 :string1 "mscal" :string2 "addr") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mscnt) :string1 "mscnt") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mscalf) :print #x1 :string1 "mscalf" :string2 "addr") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stmask) :print #x3 :string1 "stmask" :string2 "mask") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 strow) :print #x4 :string1 "strow" :string2 "row") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stcol) :print #x4 :string1 "stcol" :string2 "col") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mpg) :print #x5 :string1 "mpg") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 direct) :print #x6 :string1 "direct") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 directhl) :print #x6 :string1 "directhl") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-s-32) :val #x10 :print #x7 :string1 "unpack-s-32") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-s-16) :val #x8 :print #x7 :string1 "unpack-s-16") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-s-8) :val #x4 :print #x7 :string1 "unpack-s-8") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v2-32) :val #x8 :print #x7 :string1 "unpack-v2-32") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v2-16) :val #x4 :print #x7 :string1 "unpack-v2-16") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v2-8) :val #x2 :print #x7 :string1 "unpack-v2-8") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v3-32) :val #xc :print #x7 :string1 "unpack-v3-32") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v3-16) :val #x6 :print #x7 :string1 "unpack-v3-16") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v3-8) :val #x3 :print #x7 :string1 "unpack-v3-8") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v4-32) :val #x10 :print #x7 :string1 "unpack-v4-32") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v4-16) :val #x8 :print #x7 :string1 "unpack-v4-16") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v4-8) :val #x4 :print #x7 :string1 "unpack-v4-8") + (new 'static 'vif-disasm-element :mask #x6f :tag (vif-cmd-32 unpack-v4-5) :val #x2 :print #x7 :string1 "unpack-v4-5") + (new 'static 'vif-disasm-element :print #x8) + ) + ) + ) + +(defun disasm-vif-details ((arg0 symbol) (arg1 (pointer uint8)) (arg2 vif-cmd) (arg3 int)) + (let ((s4-0 arg3)) + (cond + ((= arg2 (vif-cmd unpack-v4-8)) + (let ((s3-0 (&-> arg1 4))) + (dotimes (s2-0 s4-0) + (format + arg0 + " #x~X: #x~2X #x~2X #x~2X #x~2X~%" + (+ (+ (* s2-0 4) 4) (the-as int arg1)) + (-> s3-0 (* s2-0 4)) + (-> s3-0 (+ (* s2-0 4) 1)) + (-> s3-0 (+ (* s2-0 4) 2)) + (-> s3-0 (+ (* s2-0 4) 3)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-s-8)) + (let ((s3-1 (&-> arg1 4))) + (dotimes (s2-1 s4-0) + (format arg0 " #x~X: #x~2x~%" (+ (+ s2-1 4) (the-as int arg1)) arg3) + (-> s3-1 (* 3 s2-1)) + (-> s3-1 (+ (* 3 s2-1) 1)) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v4-32)) + (let ((s3-2 (the-as (pointer uint32) (&-> arg1 4)))) + (dotimes (s2-2 s4-0) + (format + arg0 + " #x~X: #x~8x #x~8x #x~8x #x~8x~%" + (+ (+ (* s2-2 16) 4) (the-as int arg1)) + (-> s3-2 (* s2-2 4)) + (-> s3-2 (+ (* s2-2 4) 1)) + (-> s3-2 (+ (* s2-2 4) 2)) + (-> s3-2 (+ (* s2-2 4) 3)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v4-16)) + (let ((s3-3 (the-as (pointer uint16) (&-> arg1 4)))) + (dotimes (s2-3 s4-0) + (format + arg0 + " #x~X: #x~4x #x~4x #x~4x #x~4x~%" + (+ (+ (* s2-3 8) 4) (the-as int arg1)) + (-> s3-3 (* s2-3 4)) + (-> s3-3 (+ (* s2-3 4) 1)) + (-> s3-3 (+ (* s2-3 4) 2)) + (-> s3-3 (+ (* s2-3 4) 3)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v3-32)) + (let ((s3-4 (the-as (pointer uint32) (&-> arg1 4)))) + (dotimes (s2-4 s4-0) + (format + arg0 + " #x~X: #x~8x #x~8x #x~8x~%" + (+ (+ (* 12 s2-4) 4) (the-as int arg1)) + (-> (&+ s3-4 (* 12 s2-4)) 0) + (-> s3-4 (+ (* 3 s2-4) 1)) + (-> s3-4 (+ (* 3 s2-4) 2)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v3-16)) + (let ((s3-5 (the-as (pointer uint16) (&-> arg1 4)))) + (dotimes (s2-5 s4-0) + (format + arg0 + " #x~X: #x~4x #x~4x #x~4x~%" + (+ (+ (* 6 s2-5) 4) (the-as int arg1)) + (-> (&+ s3-5 (* 6 s2-5)) 0) + (-> s3-5 (+ (* 3 s2-5) 1)) + (-> s3-5 (+ (* 3 s2-5) 2)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v2-16)) + (let ((s3-6 (the-as (pointer uint16) (&-> arg1 4)))) + (dotimes (s2-6 s4-0) + (format + arg0 + " #x~X: #x~4x #x~4x~%" + (+ (+ (* s2-6 4) 4) (the-as int arg1)) + (-> (&+ s3-6 (* 6 s2-6)) 0) + (-> s3-6 (+ (* 3 s2-6) 1)) + ) + ) + ) + ) + (else + (format arg0 " #x~X: Data format #b~b not yet supported, add it for yourself!~%" (&-> arg1 4) arg2) + ) + ) + ) + #f + ) + +(defun disasm-vif-tag ((arg0 (pointer vif-tag)) (arg1 int) (arg2 symbol) (arg3 symbol)) + (local-vars (sv-16 vif-cmd) (sv-32 (pointer vif-tag)) (sv-48 int) (sv-64 vif-unpack-imm)) + (let ((gp-0 0)) + (while (< gp-0 (* arg1 4)) + (let ((s0-0 4)) + (let ((s1-0 (-> arg0 0))) + (format arg2 " #x~X:" arg0) + (dotimes (v1-0 (-> *vif-disasm-table* length)) + (set! sv-16 (-> s1-0 cmd)) + (when (= (logand sv-16 (-> *vif-disasm-table* v1-0 mask)) (-> *vif-disasm-table* v1-0 tag)) + (let ((a0-12 (-> *vif-disasm-table* v1-0 print))) + (cond + ((zero? a0-12) + (format arg2 " (~s :irq ~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq)) + ) + ((= a0-12 1) + (format + arg2 + " (~s :irq ~D :~s #x~X)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> *vif-disasm-table* v1-0 string2) + (-> s1-0 imm) + ) + ) + ((= a0-12 2) + (let ((t1-1 (-> s1-0 imm))) + (format + arg2 + " (~s :irq ~D :wl ~D :cl ~D)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (shr (shl (the-as int t1-1) 48) 56) + (shr (shl (the-as int t1-1) 56) 56) + ) + ) + ) + ((= a0-12 3) + (set! s0-0 8) + (format + arg2 + " (~s :irq ~D :~s #x~X)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> *vif-disasm-table* v1-0 string2) + (-> arg0 1) + ) + ) + ((= a0-12 4) + (set! s0-0 20) + (format + arg2 + " (~s :irq ~D :~s " + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> *vif-disasm-table* v1-0 string2) + ) + (format arg2 "#x~X #x~X #x~X #x~X)~%" (-> arg0 1) (-> arg0 2) (-> arg0 3) (-> arg0 4)) + ) + ((= a0-12 5) + (format + arg2 + " (~s :irq ~D :instructions #x~D :addr #x~X)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> s1-0 num) + (-> s1-0 imm) + ) + ) + ((= a0-12 6) + (if (-> s1-0 imm) + (set! s0-0 #x100000) + (set! s0-0 (the-as int (* (-> s1-0 imm) 16))) + ) + (format arg2 " (~s :irq ~D :qwc #x~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq) (-> s1-0 imm)) + (set! sv-32 (&-> arg0 1)) + (set! sv-48 0) + (while (< sv-48 (the-as int (-> s1-0 imm))) + (format + arg2 + " #x~X: #x~8x #x~8x #x~8x #x~8x~%" + (+ (+ (* sv-48 16) 4) (the-as int arg0)) + (-> sv-32 (* sv-48 4)) + (-> sv-32 (+ (* sv-48 4) 1)) + (-> sv-32 (+ (* sv-48 4) 2)) + (-> sv-32 (+ (* sv-48 4) 3)) + ) + (set! sv-48 (+ sv-48 1)) + ) + #f + ) + ((= a0-12 7) + (set! s0-0 (the-as int (+ (logand -4 (+ (* (-> *vif-disasm-table* v1-0 val) (-> s1-0 num)) 3)) 4))) + (set! sv-64 (the-as vif-unpack-imm (-> s1-0 imm))) + (format + arg2 + " (~s :irq ~D :num ~D :addr #x~X " + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> s1-0 num) + (-> sv-64 addr) + ) + (format + arg2 + ":msk ~D :flg ~D :usn ~D [skip ~d])~%" + (-> s1-0 msk) + (-> sv-64 flg) + (-> sv-64 usn) + (the-as uint s0-0) + ) + (if arg3 + (disasm-vif-details + arg2 + (the-as (pointer uint8) arg0) + (logand sv-16 (vif-cmd cmd-mask)) + (the-as int (-> s1-0 num)) + ) + ) + ) + ((= a0-12 8) + (format arg2 " (*unknown* vif-tag #x~X)~%" (-> s1-0 cmd)) + ) + ) + ) + (set! v1-0 (-> *vif-disasm-table* length)) + ) + ) + ) + (+! gp-0 s0-0) + (&+! arg0 s0-0) + ) + ) + (- gp-0 (* arg1 4)) + ) + ) + +(defun disasm-dma-tag ((arg0 dma-tag) (arg1 symbol)) + (format arg1 "(dma-tag ") + (let ((t9-1 format) + (a0-2 arg1) + (a1-2 "~s") + (v1-1 (-> arg0 id)) + ) + (t9-1 a0-2 a1-2 (cond + ((= v1-1 (dma-tag-id refe)) + "refe" + ) + ((= v1-1 (dma-tag-id refs)) + "refs" + ) + ((= v1-1 (dma-tag-id ret)) + "ret" + ) + ((= v1-1 (dma-tag-id cnt)) + "cnt" + ) + ((= v1-1 (dma-tag-id next)) + "next" + ) + ((= v1-1 (dma-tag-id call)) + "call" + ) + ((= v1-1 (dma-tag-id ref)) + "ref" + ) + ((= v1-1 (dma-tag-id end)) + "end" + ) + (else + "*unknown*" + ) + ) + ) + ) + (if (> (-> arg0 addr) 0) + (format arg1 " :addr #x~8x" (-> arg0 addr)) + ) + (if (> (-> arg0 qwc) 0) + (format arg1 " :qwc ~d" (-> arg0 qwc)) + ) + (if (> (-> arg0 spr) 0) + (format arg1 " :spr ~d" (-> arg0 spr)) + ) + (if (> (-> arg0 irq) 0) + (format arg1 " :irq ~d" (-> arg0 irq)) + ) + (if (> (-> arg0 pce) 0) + (format arg1 " :pce ~d" (-> arg0 pce)) + ) + (format arg1 ")~%") + (none) + ) + +(define *dma-disasm* #t) + +(defun disasm-dma-list ((arg0 dma-packet) (arg1 symbol) (arg2 symbol) (arg3 symbol) (arg4 int)) + (local-vars + (sv-16 object) + (sv-32 dma-packet) + (sv-48 int) + (sv-64 object) + (sv-80 object) + (sv-96 int) + (sv-112 dma-tag) + ) + (set! sv-32 arg0) + (let ((s2-0 arg1) + (s3-0 arg2) + (gp-0 arg3) + (s1-0 arg4) + ) + (if s3-0 + (format gp-0 "~%--- ~X -----------------------------~%" sv-32) + ) + (let ((s0-0 #f)) + (let ((s4-0 0) + (s5-0 0) + ) + (set! sv-16 0) + (set! sv-48 0) + (set! sv-64 0) + (set! sv-80 1) + (set! sv-96 -1) + (set! sv-112 (new 'static 'dma-tag)) + (while (not s0-0) + (let ((t9-1 valid?) + (a0-2 sv-32) + (a1-2 #f) + (a2-2 "dma-list tag pointer") + ) + (cond + ((not (t9-1 a0-2 (the-as type a1-2) (the-as symbol a2-2) #t gp-0)) + (format gp-0 "ERROR: dma-list tag pointer invalid~%") + (set! s0-0 'error) + ) + (else + (set! sv-112 (-> sv-32 dma)) + (when (not (or (zero? s5-0) (let ((t9-3 valid?) + (a0-4 sv-16) + (a1-4 #f) + ) + (set! a2-2 "dma-list data pointer") + (t9-3 a0-4 (the-as type a1-4) (the-as symbol a2-2) #t gp-0) + ) + ) + ) + (format gp-0 "ERROR: dma-list data pointer invalid~%") + (set! s0-0 'error) + ) + (when (logtest? (the-as dma-tag #x3ff0000) sv-112) + (format gp-0 "ERROR: dma tag has data in reserved bits ~X~%" (the-as none a2-2)) + (set! s0-0 'error) + ) + ) + ) + ) + (when (or s3-0 (= s0-0 'error)) + (format gp-0 "#x~8x: " sv-32) + (cond + ((zero? sv-96) + (format gp-0 " ") + ) + ((= sv-96 1) + (format gp-0 " ") + ) + ) + (disasm-dma-tag sv-112 gp-0) + ) + (cond + (s0-0 + ) + ((or (= (-> sv-112 id) (dma-tag-id ref)) (= (-> sv-112 id) (dma-tag-id refs)) (zero? (-> sv-112 id))) + (set! sv-16 (-> sv-112 addr)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (when s2-0 + (let ((v0-10 (disasm-vif-tag (&-> sv-32 vif0) 2 gp-0 (= s2-0 'details)))) + (disasm-vif-tag + (the-as (pointer vif-tag) (+ (the-as uint sv-16) v0-10)) + (the-as int (- (* sv-48 4) (the-as uint (/ v0-10 4)))) + gp-0 + (= s2-0 'details) + ) + ) + ) + (set! sv-32 (the-as dma-packet (&-> (the-as (pointer uint64) sv-32) 2))) + (if (= (-> sv-112 id) (dma-tag-id refe)) + (set! s0-0 #t) + ) + ) + ((= (-> sv-112 id) (dma-tag-id cnt)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (set! sv-32 (the-as dma-packet (+ (the-as uint sv-32) (* (+ sv-48 1) 16)))) + sv-32 + ) + ((= (-> sv-112 id) (dma-tag-id next)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (when (= sv-32 (-> sv-112 addr)) + (format gp-0 "ERROR: next tag creates infinite loop.~%") + (set! s0-0 'error) + ) + (set! sv-32 (the-as dma-packet (-> sv-112 addr))) + sv-32 + ) + ((= (-> sv-112 id) (dma-tag-id call)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (set! sv-32 (the-as dma-packet (-> sv-112 addr))) + (set! sv-96 (+ sv-96 1)) + (cond + ((zero? sv-96) + (set! sv-64 (&+ (the-as pointer sv-16) sv-48)) + (the-as (pointer uint64) sv-64) + ) + (else + (set! sv-80 (&+ (the-as pointer sv-16) sv-48)) + (the-as (pointer uint64) sv-80) + ) + ) + ) + ((= (-> sv-112 id) (dma-tag-id ret)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (let ((v1-123 sv-96)) + (cond + ((zero? v1-123) + (set! sv-32 (the-as dma-packet sv-64)) + sv-32 + ) + ((= v1-123 1) + (set! sv-32 (the-as dma-packet sv-80)) + sv-32 + ) + (else + (set! s0-0 #t) + ) + ) + ) + (set! sv-96 (+ sv-96 -1)) + sv-96 + ) + ((= (-> sv-112 id) (dma-tag-id end)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (set! s0-0 #t) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + ) + (else + (format gp-0 "ERROR: Unknown DMA TAG command.~%") + (set! s0-0 'error) + ) + ) + (+! s4-0 sv-48) + (+! s5-0 1) + (if (and (>= s1-0 0) (>= s5-0 s1-0)) + (set! s0-0 #t) + ) + ) + (when (or s3-0 (= s0-0 'error)) + (format gp-0 "NOTICE: Total tags: ~d~%" s5-0) + (format gp-0 "NOTICE: Total QWC: ~d~%" s4-0) + (format gp-0 "--------------------------------~%~%") + ) + ) + (!= s0-0 'error) + ) + ) + ) + +) + + + diff --git a/goal_src/jak2/engine/dma/dma-h.gc b/goal_src/jak2/engine/dma/dma-h.gc index 27b3a1d145..cf3d49346c 100644 --- a/goal_src/jak2/engine/dma/dma-h.gc +++ b/goal_src/jak2/engine/dma/dma-h.gc @@ -7,3 +7,341 @@ ;; DECOMP BEGINS +;; Constants/type for the PS2 DMA hardware +;; There are a number of DMA channels. +;; The PS2 supports several types of DMA, including simple chunk transfer and more complicated +;; "chain" transfers, where the hardware can follow a linked data-structure. + +;; The code is organized into dma, dma-buffer, and dma-bucket +;; - dma interacts with the hardware and actually sends the DMA data. +;; - dma-buffer is memory management for the data to be sent +;; - dma-bucket is organization of all the frame's DMA data in the correct order + +;; DMA Channel Control Register. This starts the DMA and can be checked to see if it's done. +;; There is one CHCR per DMA channel. +(deftype dma-chcr (uint32) + ((dir uint8 :offset 0 :size 1) ;; 1 - from memory + (mod uint8 :offset 2 :size 2) ;; normal, chain, interleave + (asp uint8 :offset 4 :size 2) ;; none, 1, 2 + (tte uint8 :offset 6 :size 1) ;; transfer tag (sc only) + (tie uint8 :offset 7 :size 1) ;; tag interrupt + (str uint8 :offset 8 :size 1) ;; start! + (tag uint16 :offset 16) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; Each DMA Channel has a bank of registers with the following layout. +;; Some channels have more advanced features, but all support at least these three. +(deftype dma-bank (structure) + ((chcr dma-chcr :offset 0) ;; control register + (madr uint32 :offset 16) ;; memory address + (qwc uint32 :offset 32) ;; quadword count + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; DMA register layout for channels supporting source-chain +(deftype dma-bank-source (dma-bank) + ((tadr uint32 :offset 48) ;; tag address + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; The DMA source chain supports a two-entry "call stack" of tags. +;; The tag addresses are stored here. +(deftype dma-bank-vif (dma-bank-source) + ((as0 uint32 :offset 64) ;; pushed tag register + (as1 uint32 :offset 80) ;; pushed tag register + ) + :method-count-assert 9 + :size-assert #x54 + :flag-assert #x900000054 + ) + +;; The toSPR and fromSPR DMA channels require a second address in the scratchpad. +;; This is an offset from the start of SPR. +(deftype dma-bank-spr (dma-bank-source) + ((sadr uint32 :offset 128) ;; spad address. + ) + :method-count-assert 9 + :size-assert #x84 + :flag-assert #x900000084 + ) + +;; These addresses are the location of DMA banks for each channel. +;; These do not exist in OpenGOAL. +(defconstant VIF0_DMA_BANK (the dma-bank-vif (get-vm-ptr #x10008000))) +(defconstant VIF1_DMA_BANK (the dma-bank-vif (get-vm-ptr #x10009000))) +(defconstant GIF_DMA_BANK (the dma-bank (get-vm-ptr #x1000a000))) +;; ipuFrom, ipTop, sif0, sif1, sif2 believed unused. +(defconstant SPR_FROM_BANK (the dma-bank-spr (get-vm-ptr #x1000d000))) +(defconstant SPR_TO_BANK (the dma-bank-spr (get-vm-ptr #x1000d400))) + +(defconstant VU0_DATA_MEM_MAP (the (pointer uint32) #x11004000)) +(defconstant VU1_DATA_MEM_MAP (the (pointer uint32) #x1100c000)) + +;; D_CTRL, master DMA control register, shared for all channels. +(deftype dma-ctrl (uint32) + ((dmae uint8 :offset 0 :size 1) + (rele uint8 :offset 1 :size 1) + (mfd uint8 :offset 2 :size 2) + (sts uint8 :offset 4 :size 2) + (std uint8 :offset 6 :size 2) + (rcyc uint8 :offset 8 :size 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; D_ENABLEW, D_ENABLER? +(deftype dma-enable (uint32) + ((cpnd uint8 :offset 16 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; D_SQWC +(deftype dma-sqwc (uint32) + ((sqwc uint8 :offset 0 :size 8) + (tqwc uint8 :offset 16 :size 8) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; Shared DMA control registers. +(deftype dma-bank-control (structure) + ((ctrl dma-ctrl :offset 0) + (stat uint32 :offset 16) + (pcr uint32 :offset 32) + (sqwc dma-sqwc :offset 48) + (rbsr uint32 :offset 64) + (rbor uint32 :offset 80) + (stadr uint32 :offset 96) + (enabler uint32 :offset 5408) + (enablew uint32 :offset 5520) + ) + :method-count-assert 9 + :size-assert #x1594 + :flag-assert #x900001594 + ) + +;; Seems to be unused. The vu-function type is used instead. +(deftype vu-code-block (basic) + ((name basic :offset-assert 4) + (code uint32 :offset-assert 8) + (size int32 :offset-assert 12) + (dest-address uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; ?? not sure what this is. +(deftype vu-stat (uint64) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(defenum dma-tag-id + :bitfield #f + :type uint8 + (refe 0) ;; addr=ADDR, ends after this transfer + (cnt 1) ;; addr=after tag, next-tag=after data + (next 2) ;; addr=after tag, next-tag=ADDR + (ref 3) ;; addr=ADDR, next-tag=after tag + (refs 4) ;; ref, but stall controled + (call 5) ;; + (ret 6) ;; + (end 7) ;; next, but ends. + ) + +;; In source chain mode, the DMA controller reads "DMAtag"s to determine addresses +;; sizes, and the next thing to transfer. +;; A tag is 8 bytes. +(deftype dma-tag (uint64) + ((qwc uint16 :offset 0) ;; quadword count + (pce uint8 :offset 26 :size 2) ;; priority (source mode) + (id dma-tag-id :offset 28 :size 3) ;; ID (what the tag means) + (irq uint8 :offset 31 :size 1) ;; interrupt at the end? + (addr uint32 :offset 32 :size 31) ;; address (31 bits) + (spr uint8 :offset 63 :size 1) ;; spr or not flag. + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +;; DMA data is divided into buckets. +;; At the end of a frame, the buckets are all connected together in order and sent. +;; The order of these buckets should match the C++ buckets.h file, and determines the +;; order that textures are uploaded and things are drawn. + +;; A DMA bucket is a way of sorting data within a dma buffer. +;; The buckets themselves live inside in the dma buffer. +;; the addr field of their tag should point to the next bucket. +;; This is not a PS2 hardware thing +(deftype dma-bucket (structure) + ((tag dma-tag :offset-assert 0) ;; the DMA tag to transfer the bucket's data + (last (pointer dma-tag) :offset-assert 8) ;; the last tag of this bucket. + (dummy uint32 :offset-assert 12) ;; empty space. + (next uint32 :offset 4) + (clear uint64 :offset 8) + (vif0 uint32 :offset 8) + (vif1 uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; guess - VIF_MASK register? +(deftype vif-mask (uint32) + ((m0 uint8 :offset 0 :size 2) + (m1 uint8 :offset 2 :size 2) + (m2 uint8 :offset 4 :size 2) + (m3 uint8 :offset 6 :size 2) + (m4 uint8 :offset 8 :size 2) + (m5 uint8 :offset 10 :size 2) + (m6 uint8 :offset 12 :size 2) + (m7 uint8 :offset 14 :size 2) + (m8 uint8 :offset 16 :size 2) + (m9 uint8 :offset 18 :size 2) + (m10 uint8 :offset 20 :size 2) + (m11 uint8 :offset 22 :size 2) + (m12 uint8 :offset 24 :size 2) + (m13 uint8 :offset 26 :size 2) + (m14 uint8 :offset 28 :size 2) + (m15 uint8 :offset 30 :size 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; the IMM field of a VIF STCYCL instruction +(deftype vif-stcycl-imm (uint16) + ((cl uint8 :offset 0 :size 8) + (wl uint8 :offset 8 :size 8) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; the IMM field of a VIF UNPACK instruction +(deftype vif-unpack-imm (uint16) + ((addr uint16 :offset 0 :size 10) + (usn uint8 :offset 14 :size 1) + (flg uint8 :offset 15 :size 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; all these have mask (only applies to unpacks) and interrupt not set. +(defenum vif-cmd + :bitfield #f + :type uint8 + (nop 0) ;; no-op, can still have irq set. + (stcycl 1) ;; set write recycle register + (offset 2) ;; set offset register + (base 3) ;; set base register + (itop 4) ;; set data pointer register (itops) + (stmod 5) ;; set mode register + (mskpath3 6) ;; set path 3 mask + (mark 7) ;; set mark register + (pc-port 8) ;; special tag for PC Port data. + (flushe 16) ;; wait for end of microprogram + (flush 17) ;; wait for end of microprogram and transfer (path1/path2) + (flusha 19) ;; wait for end of microprogram and transfer (path1/path2/path3) + (mscal 20) ;; activate microprogram (call) + (mscalf 21) ;; flushe and activate (call) + (mscnt 23) ;; activate microprogram (continue) + (stmask 32) ;; set MASK register. + (strow 48) ;; set filling data + (stcol 49) ;; set filling data + (mpg 74) ;; transfer microprogram + (direct 80) ;; straight to GIF. + (directhl 81) + (unpack-s-32 96) + (unpack-s-16 97) + (unpack-s-8 98) + ;; 99 is invllid + (unpack-v2-32 100) + (unpack-v2-16 101) + (unpack-v2-8 102) + ;; 103 is invalid + (unpack-v3-32 104) + (unpack-v3-16 105) + (unpack-v3-8 106) + ;; 107 is invalid + (unpack-v4-32 108) + (unpack-v4-16 109) + (unpack-v4-8 110) + (unpack-v4-5 111) + (cmd-mask 239) ;; not sure what this is. + ) + +;; this makes a copy of the above type, but uses a uint32. +(defenum vif-cmd-32 + :bitfield #f + :type uint32 + :copy-entries vif-cmd + ) + +;; The VIF also has tags to control it. +;; Different VIF commands (called VIFcode) have different tag layouts. +(deftype vif-tag (uint32) + ((imm uint16 :offset 0 :size 16) + (num uint8 :offset 16 :size 8) + (cmd vif-cmd :offset 24 :size 7) + (irq uint8 :offset 31 :size 1) + (msk uint8 :offset 28 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; The dma send functions are disabled in OpenGOAL. + +(defun dma-sync-fast ((bank dma-bank)) + (/ 0 0) + (none) + ) + +(defun dma-send-no-scratch ((bank dma-bank) + (madr uint32) + (qwc uint32)) + (/ 0 0) + (none) + ) + +(defun dma-sync-with-count ((bank dma-bank) + (count (pointer int32))) + (/ 0 0) + 0 + ) + +(defun dma-count-until-done ((bank dma-bank) + (count (pointer int32))) + (/ 0 0) + 0 + ) diff --git a/goal_src/jak2/engine/dma/dma.gc b/goal_src/jak2/engine/dma/dma.gc index 9a84bc7fcb..b71ce25b42 100644 --- a/goal_src/jak2/engine/dma/dma.gc +++ b/goal_src/jak2/engine/dma/dma.gc @@ -7,3 +7,156 @@ ;; DECOMP BEGINS +(defun dma-sync-hang ((bank dma-bank)) + "Hang here until the dma transfer is completed. + This is worse than the dma-sync-fast because it ends + up spamming the DMA bank register more often, and reduces + the speed of the DMA transfer. + This function is unused." + (crash!) + (none) + ) + +(defun dma-sync-crash ((arg0 dma-bank)) + "Wait for DMA to finish for a while, then crash if we can't. + This function is unused." + (crash!) + (none) + ) + +(defun dma-send ((arg0 dma-bank) (madr uint) (qwc uint)) + "Send DMA given an address and a quadword count. + The madr can be in main memory or scratchpad. + This is appropriate for VIF0/GIF transfers. + It can be used for VIF1, but will do VIF -> madr, which is probably + not what you want." + (crash!) + (none) + ) + +(defun dma-send-chain ((arg0 dma-bank-source) (tadr uint)) + "Send DMA! tadr should be a tag address, possibly in spad ram. + This is useful for sending to VIF. + Tag transfer is enabled, and DIR is set so a VIF1 transfer + goes from tadr -> VIF." + (crash!) + (none) + ) + +(defun dma-send-chain-no-tte ((arg0 dma-bank-source) (arg1 uint)) + "Send DMA chain! TTE bit is not set, don't transfer tags. + This is never used." + (crash!) + (none) + ) + +(defun dma-send-chain-no-flush ((arg0 dma-bank-source) (arg1 uint)) + "Send DMA chain! But don't flush the cache, so be careful here. TTE enable." + (crash!) + (none) + ) + +(defun dma-send-to-spr ((sadr uint) (madr uint) (qwc uint) (sync symbol)) + "Transfer data to spr" + (crash!) + (none) + ) + +(defun dma-send-to-spr-no-flush ((sadr uint) (madr uint) (qwc uint) (sync symbol)) + "Transfer to spr. Doesn't flush the cache first, so be careful." + (crash!) + (none) + ) + +(defun dma-send-from-spr ((madr uint) (sadr uint) (qwc uint) (sync symbol)) + "Transfer from spr." + (crash!) + (none) + ) + +(defun dma-send-from-spr-no-flush ((madr uint) (sadr uint) (qwc uint) (sync symbol)) + "Transfer from spr, don't flush the cache." + (crash!) + (none) + ) + +(defun dma-initialize () + "Due to a bug in the PS2 hardware, you must always disable the DMAtag mismatch + error. This is done here." + + (#when PC_PORT + (return 0) + ) + + (set! (-> (the-as vif-bank #x10003800) err me0) 1) + (set! (-> (the-as vif-bank #x10003c00) err me0) 1) + (none) + ) + +(defun clear-vu0-mem () + "Set the vu0 data memory to 0xabadbeef. This uses the slow EE mapping of VU memory. + Will crash on PC Port." + (crash!) + (none) + ) + +(defun clear-vu1-mem () + "Set the vu1 data memory to 0xabadbeef. This uses the slow EE mapping of VU memory. + Will crash on PC Port." + (crash!) + (none) + ) + +(defun dump-vu1-mem () + "Print VU1 memory to runtime stdout. + Will crash on PC Port." + (crash!) + (none) + ) + +(defun dump-vu1-range ((start uint) (total-count uint)) + "Print part of VU1 memory to runtime stdout. + Will crash on PC Port." + (crash!) + #f + ) + +(defun reset-vif1-path () + "When things go wrong, totally reset vif1." + (#unless PC_PORT + ((method-of-type dma-bank-vif inspect) (the-as dma-bank-vif #x10009000)) + ((method-of-type vif-bank inspect) (the-as vif-bank #x10003c00)) + ) + (reset-path) + (set-graphics-mode) + (format 0 "gkernel: vif1 path reset!~%") + (none) + ) + +(defun ultimate-memcpy ((dst pointer) (src pointer) (size-bytes uint)) + "The Fastest Memory Copy, for larger transfers. + Memory is copied in ascending order, in 4 kB blocks. + The size should be a multiple of 16 bytes." + ;; on PC Port, just call C mem-move, it's the fastest. + (__mem-move dst src size-bytes) + (none) + ) + +(defun symlink2 () + "symlink2 is a handwritten assembly version of the v2 linking routine. + it is not ported because the OpenGOAL linker has its own implementation already." + (crash!) + (none) + ) + +(defun symlink3 () + "symlink3 is a handwritten assembly version of the v3 linking routine. + OpenGOAL uses a different format for v3, customized for x86-64, so this is not + needed. The C++ implementation is plenty fast enough" + (crash!) + (none) + ) + +;; configuration required to work around hardware bug on the PS2. +;; doesn't do anything important +(dma-initialize) \ No newline at end of file diff --git a/goal_src/jak2/engine/draw/draw-node-h.gc b/goal_src/jak2/engine/draw/draw-node-h.gc index b0b733db6a..9bae24ae5e 100644 --- a/goal_src/jak2/engine/draw/draw-node-h.gc +++ b/goal_src/jak2/engine/draw/draw-node-h.gc @@ -5,5 +5,31 @@ ;; name in dgo: draw-node-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(deftype draw-node (drawable) + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) +(deftype drawable-inline-array-node (drawable-inline-array) + ((data draw-node 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +(deftype draw-node-dma (structure) + ((banka draw-node 32 :inline :offset-assert 0) + (bankb draw-node 32 :inline :offset-assert 1024) + ) + :method-count-assert 9 + :size-assert #x800 + :flag-assert #x900000800 + ) diff --git a/goal_src/jak2/engine/draw/drawable-actor-h.gc b/goal_src/jak2/engine/draw/drawable-actor-h.gc index 3463e964ab..e157e7d890 100644 --- a/goal_src/jak2/engine/draw/drawable-actor-h.gc +++ b/goal_src/jak2/engine/draw/drawable-actor-h.gc @@ -7,3 +7,33 @@ ;; DECOMP BEGINS +(deftype drawable-actor (drawable) + ((actor entity-actor :offset 8) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype drawable-tree-actor (drawable-tree) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype drawable-inline-array-actor (drawable-inline-array) + ((data drawable-actor 1 :inline :offset-assert 32) + (pad uint8 4 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +(defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) + 0 + (none) + ) + + diff --git a/goal_src/jak2/engine/draw/drawable-group-h.gc b/goal_src/jak2/engine/draw/drawable-group-h.gc index 738248edf8..a18c847d60 100644 --- a/goal_src/jak2/engine/draw/drawable-group-h.gc +++ b/goal_src/jak2/engine/draw/drawable-group-h.gc @@ -5,5 +5,30 @@ ;; name in dgo: drawable-group-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(deftype drawable-group (drawable) + ((length int16 :offset 6) + (data drawable :dynamic :offset-assert 32) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(defmethod inspect drawable-group ((obj drawable-group)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + ) + obj + ) + + + diff --git a/goal_src/jak2/engine/draw/drawable-h.gc b/goal_src/jak2/engine/draw/drawable-h.gc index 1e9193f121..e4cd42c3f6 100644 --- a/goal_src/jak2/engine/draw/drawable-h.gc +++ b/goal_src/jak2/engine/draw/drawable-h.gc @@ -7,3 +7,29 @@ ;; DECOMP BEGINS +(deftype drawable (basic) + ((id int16 :offset-assert 4) + (bsphere vector :inline :offset-assert 16) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + (:methods + (login (_type_) _type_ 9) + (draw (_type_ _type_ display-frame) none 10) + (drawable-method-11 () none 11) + (drawable-method-12 () none 12) + (drawable-method-13 () none 13) + (debug-draw (_type_ drawable display-frame) none 14) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) + (drawable-method-16 () none 16) + ) + ) + +(deftype drawable-error (drawable) + ((name string :offset-assert 32) + ) + :method-count-assert 17 + :size-assert #x24 + :flag-assert #x1100000024 + ) diff --git a/goal_src/jak2/engine/draw/drawable-inline-array-h.gc b/goal_src/jak2/engine/draw/drawable-inline-array-h.gc index 897a087375..b73a7036b9 100644 --- a/goal_src/jak2/engine/draw/drawable-inline-array-h.gc +++ b/goal_src/jak2/engine/draw/drawable-inline-array-h.gc @@ -5,5 +5,13 @@ ;; name in dgo: drawable-inline-array-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(deftype drawable-inline-array (drawable) + ((length int16 :offset 6) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + + diff --git a/goal_src/jak2/engine/draw/drawable-tree-h.gc b/goal_src/jak2/engine/draw/drawable-tree-h.gc index f7d40f2e14..48bb5797a1 100644 --- a/goal_src/jak2/engine/draw/drawable-tree-h.gc +++ b/goal_src/jak2/engine/draw/drawable-tree-h.gc @@ -5,5 +5,17 @@ ;; name in dgo: drawable-tree-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(deftype drawable-tree (drawable-group) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) +(deftype drawable-tree-array (drawable-group) + ((trees drawable-tree :dynamic :offset 32) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) diff --git a/goal_src/jak2/engine/engine/connect.gc b/goal_src/jak2/engine/engine/connect.gc index 0a26e298a9..dece2c30fc 100644 --- a/goal_src/jak2/engine/engine/connect.gc +++ b/goal_src/jak2/engine/engine/connect.gc @@ -7,3 +7,789 @@ ;; DECOMP BEGINS +;; This extremely confusing "connection system" allows the connection between +;; "engines" and "processes". Basically, a process can "register" itself with any number of "engines". +;; The "engines" can then iterate through all the connected processes. If a process is destroyed, it will +;; be removed from all engines. It is okay to connect a process to multiple engines, or even to the same engine +;; multiple times. + +;; Some example uses: +;; - a "foreground-engine" has connections to all foreground objects that need to be drawn on each frame. +;; - when a process wants to change a game setting, it opens a connection to the settings engine to request a change. +;; when the process is killed (or it stops requesting the change), the setting change is reverted. + +;; A "connection" is really just a function that gets called when the engine runs, or a set of parameters that the engine can iterate through. + + +;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; connectable +;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; A connectable is the linked-list node part of a connection. +;; The connections themselves are owned by the engine. + +;; the next0/prev0 references are used for how this belongs in the connectable list +;; belonging to the _engine_. These terminate on special nodes stored in the engine: +;; alive-list/alive-list-end for the active connections, and dead-list/dead-list-end +;; for the inactive. + +;; the next1/prev1 references are used to build a linked list _per process_. +;; the head of this list is the inline connectable in process and it ends with #f. +;; This is a bit confusing at first, but these belong to two linked lists... +;; These terminate on both ends with #f. +(deftype connectable (structure) + ((next0 connectable :offset-assert 0) + (prev0 connectable :offset-assert 4) + (next1 connectable :offset-assert 8) + (prev1 connectable :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; connection +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this is the actual data for the connection. +;; it may be used in multiple ways, but the most common is to use param0 as a function +;; it receives param1, param2, param3, and the engine as the arugmetns. +;; in some cases, the return value is checked for 'dead. +(declare-type engine basic) + +(deftype connection (connectable) + ((param0 basic :offset-assert 16) + (param1 int32 :offset-assert 20) + (param2 int32 :offset-assert 24) + (param3 int32 :offset-assert 28) + (quad uint128 2 :offset 0) + ) + :method-count-assert 14 + :size-assert #x20 + :flag-assert #xe00000020 + (:methods + (get-engine (connection) engine 9) + (get-process (connection) process 10) + (belongs-to-engine? (connection engine) symbol 11) + (belongs-to-process? (connection process) symbol 12) + (move-to-dead (connection) connection 13) + ) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; engine +;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; an engine is a collection of connections. +;; you can iterate over the connections, or run them. +;; the engine is dynamically sized based on how many connections it can store. + +;; new for jak 2, you can use a child class of connection + +(deftype engine (basic) + ((name symbol :offset-assert 4) + (engine-time time-frame :offset 16) + (allocated-length int16 :offset 10) + (length int16 :offset 8) + (element-type type :offset 12) + (alive-list connectable :inline :offset-assert 32) + (alive-list-end connectable :inline :offset-assert 48) + (dead-list connectable :inline :offset-assert 64) + (dead-list-end connectable :inline :offset-assert 80) + (data connection :inline :dynamic :offset-assert 96) + ) + :method-count-assert 26 + :size-assert #x60 + :flag-assert #x1a00000060 + (:methods + (new (symbol type symbol int type) _type_ 0) + (inspect-all-connections (engine) engine 9) + (apply-to-connections (engine (function connectable none)) int 10) + (apply-to-connections-reverse (engine (function connectable none)) int 11) + (execute-connections (engine object) int 12) + (execute-connections-and-move-to-dead (engine object) int 13) + (execute-connections-if-needed (engine object) int 14) + (add-connection (engine process object object object object) connection 15) + (remove-from-process (engine process) int 16) + (remove-matching (engine (function connection engine symbol)) int 17) + (remove-all (engine) int 18) + (remove-by-param0 (engine object) int 19) + (remove-by-param1 (engine int) int 20) + (remove-by-param2 (engine int) int 21) + (get-first-connectable (engine) connectable 22) + (get-last-connectable (engine) connectable 23) + (get-next-connectable (_type_ connectable) connectable 24) + (get-prev-connectable (_type_ connectable) connectable 25) + ) + ) + +(defmethod belongs-to-process? connection ((obj connection) (arg0 process)) + "Does this connection belong to the given process?" + (= arg0 (get-process obj)) + ) + +(defmethod print connection ((obj connection)) + "Print a connection and its parameters" + (format #t "#" + (-> obj param0) + (-> obj param1) + (-> obj param2) + (-> obj param3) + obj + ) + obj + ) + +(defmethod get-engine connection ((obj connection)) + "Get the engine for this connection. This must be used on a live connection." + (while (-> (the-as connectable obj) prev0) + (nop!) + (nop!) + (set! obj (the-as connection (-> (the-as connectable obj) prev0))) + ) + (the-as engine (&+ (the-as pointer obj) -28)) + ) + +(defmethod get-process connection ((obj connection)) + "Get the process for this connection" + (while (-> (the-as connectable obj) prev1) + (nop!) + (nop!) + (set! obj (the-as connection (-> (the-as connectable obj) prev1))) + ) + (the-as process (&+ (the-as pointer obj) -108)) + ) + +(defmethod belongs-to-engine? connection ((obj connection) (arg0 engine)) + "Check to see if this connection is located in the data section of the engine. + This works on dead or alive connections." + (and (< (the-as int arg0) (the-as int obj)) + (< (the-as int obj) + (the-as int (&+ (&+ (the-as pointer arg0) (-> arg0 type size)) + (* (-> arg0 allocated-length) (the-as int (-> arg0 element-type size))) + ) + ) + ) + ) + ) + +(defmethod get-first-connectable engine ((obj engine)) + (-> obj alive-list next0) + ) + +(defmethod get-last-connectable engine ((obj engine)) + (-> obj alive-list-end) + ) + +(defmethod get-next-connectable engine ((obj engine) (arg0 connectable)) + (-> arg0 next0) + ) + +(defmethod get-prev-connectable engine ((obj engine) (arg0 connectable)) + (-> arg0 prev0) + ) + +(defmethod new engine ((allocation symbol) (type-to-make type) (arg0 symbol) (arg1 int) (arg2 type)) + (let ((v0-0 (object-new allocation type-to-make + (the-as int (+ (-> type-to-make size) (* (the-as uint arg1) (-> arg2 size)))) + ) + ) + ) + (set! (-> v0-0 allocated-length) arg1) + (set! (-> v0-0 length) 0) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 element-type) arg2) + (set! (-> v0-0 alive-list next0) (-> v0-0 alive-list-end)) + (set! (-> v0-0 alive-list prev0) #f) + (set! (-> v0-0 alive-list next1) #f) + (set! (-> v0-0 alive-list prev1) #f) + (set! (-> v0-0 alive-list-end next0) #f) + (set! (-> v0-0 alive-list-end prev0) (-> v0-0 alive-list)) + (set! (-> v0-0 alive-list-end next1) #f) + (set! (-> v0-0 alive-list-end prev1) #f) + (set! (-> v0-0 dead-list next0) (the-as connectable (-> v0-0 data))) + (set! (-> v0-0 dead-list prev0) #f) + (set! (-> v0-0 dead-list next1) #f) + (set! (-> v0-0 dead-list prev1) #f) + (set! (-> v0-0 dead-list-end next0) #f) + (set! (-> v0-0 dead-list-end prev0) + (the-as connectable (+ (+ (* (the-as uint (+ arg1 -1)) (-> arg2 size)) 92) (the-as uint v0-0))) + ) + (set! (-> v0-0 dead-list-end next1) #f) + (set! (-> v0-0 dead-list-end prev1) #f) + ;; this crazy logic is to lay out the linked list structure in the data. + ;; the object size is now determined from the specified type. + (let ((v1-9 (the-as object (-> v0-0 data)))) + (set! (-> v0-0 data 0 prev0) (-> v0-0 dead-list)) + (set! (-> v0-0 data 0 next0) (the-as connectable (&+ (the-as pointer v1-9) (-> arg2 size)))) + (let ((v1-10 (the-as object (&+ (the-as pointer v1-9) (-> arg2 size))))) + (let ((a0-6 1) + (a1-3 (+ arg1 -2)) + ) + (while (>= a1-3 a0-6) + (set! (-> (the-as connectable v1-10) prev0) + (the-as connectable (&- (the-as pointer v1-10) (the-as uint (-> arg2 size)))) + ) + (set! (-> (the-as (pointer pointer) v1-10)) (&+ (the-as pointer v1-10) (-> arg2 size))) + (set! v1-10 (&+ (the-as pointer v1-10) (-> arg2 size))) + (+! a0-6 1) + ) + ) + (set! (-> (the-as connectable v1-10) prev0) + (the-as connectable (&- (the-as pointer v1-10) (the-as uint (-> arg2 size)))) + ) + (set! (-> (the-as (pointer connectable) v1-10)) (-> v0-0 dead-list-end)) + ) + ) + v0-0 + ) + ) + +(defmethod print engine ((obj engine)) + "Print an engine and its name" + (format #t "#<~A ~A @ #x~X>" (-> obj type) (-> obj name) obj) + obj + ) + +(defmethod inspect engine ((obj engine)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tname: ~A~%" (-> obj name)) + (format #t "~Tengine-time: ~D~%" (-> obj engine-time)) + (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~Tlength: ~D~%" (-> obj length)) + (format #t "~Telement-type: ~A~%" (-> obj element-type)) + (format #t "~Talive-list:~%") + (let ((s5-0 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (inspect (-> obj alive-list)) + (set! *print-column* s5-0) + ) + (format #t "~Talive-list-end:~%") + (let ((s5-1 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (inspect (-> obj alive-list-end)) + (set! *print-column* s5-1) + ) + (format #t "~Tdead-list:~%") + (let ((s5-2 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (inspect (-> obj dead-list)) + (set! *print-column* s5-2) + ) + (format #t "~Tdead-list-end:~%") + (let ((s5-3 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (inspect (-> obj dead-list-end)) + (set! *print-column* s5-3) + ) + (format #t "~Tdata[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj data)) + obj + ) + +(defmethod length engine ((obj engine)) + "Get the in-use length of an engine" + (-> obj length) + ) + +(defmethod asize-of engine ((obj engine)) + "Get the size in memory of an engine" + (the-as int (+ (-> obj type size) (* (-> obj allocated-length) (the-as int (-> obj element-type size))))) + ) + +(defmethod apply-to-connections engine ((obj engine) (arg0 (function connectable none))) + "Apply f to all connections for the engine. It's okay to have f remove the connection." + (let* ((a0-1 (-> obj alive-list next0)) + (s4-0 (-> a0-1 next0))) + (while (!= a0-1 (-> obj alive-list-end)) + (arg0 a0-1) + (set! a0-1 s4-0) + (set! s4-0 (-> s4-0 next0)) + ) + ) + 0 + ) + +(defmethod apply-to-connections-reverse engine ((obj engine) (arg0 (function connectable none))) + "Apply f to all connections, reverse order. + Do not use f to remove yourself from the list." + (let ((s4-0 (-> obj alive-list-end prev0))) + (while (!= s4-0 (-> obj alive-list)) + (arg0 s4-0) + (set! s4-0 (-> s4-0 prev0)) + ) + ) + 0 + ) + +(defmethod execute-connections engine ((obj engine) (arg0 object)) + "Run the engine!" + (set! (-> obj engine-time) (-> *display* real-clock frame-counter)) + (let ((s4-0 (the-as connection (-> obj alive-list-end prev0)))) + (while (!= s4-0 (-> obj alive-list)) + ((the-as (function object object object object object) (-> s4-0 param0)) + (-> s4-0 param1) + (-> s4-0 param2) + (-> s4-0 param3) + arg0 + ) + (set! s4-0 (the-as connection (-> s4-0 prev0))) + ) + ) + 0 + ) + +(defmethod execute-connections-and-move-to-dead engine ((obj engine) (arg0 object)) + "Run the engine! If any objects return 'dead, then remove them" + (set! (-> obj engine-time) (-> *display* real-clock frame-counter)) + (let ((s4-0 (the-as connection (-> obj alive-list-end prev0)))) + (while (!= s4-0 (-> obj alive-list)) + (let ((v1-3 ((the-as (function object object object object object) (-> s4-0 param0)) + (-> s4-0 param1) + (-> s4-0 param2) + (-> s4-0 param3) + arg0 + ) + ) + ) + (set! s4-0 (the-as connection (-> s4-0 prev0))) + (if (= v1-3 'dead) + ((method-of-type connection move-to-dead) (the-as connection (-> s4-0 next0))) + ) + ) + ) + ) + 0 + ) + +(defmethod execute-connections-if-needed engine ((obj engine) (arg0 object)) + "Execute connections, but only if it hasn't been done on this frame." + (if (!= (-> *display* real-clock frame-counter) (-> obj engine-time)) + (execute-connections obj arg0) + ) + 0 + ) + +(defun connection-process-apply ((arg0 process) (arg1 (function object none))) + "Apply a function to all connectables of a process." + (when arg0 + (let ((s5-0 (-> arg0 connection-list next1))) + (while s5-0 + (arg1 s5-0) + (set! s5-0 (-> s5-0 next1)) + ) + ) + #f + ) + ) + +(defmethod inspect-all-connections engine ((obj engine)) + "inspect all of the connections." + (apply-to-connections obj (the-as (function connectable none) (method-of-type connection inspect))) + obj + ) + +(defmethod add-connection engine ((obj engine) (arg0 process) (arg1 object) (arg2 object) (arg3 object) (arg4 object)) + "Add a connection between this engine and a given process." + (let ((v1-0 (the-as connection (-> obj dead-list next0)))) + (when (not (or (not arg0) (= v1-0 (-> obj dead-list-end)))) + (set! (-> v1-0 param0) (the-as basic arg1)) + (set! (-> v1-0 param1) (the-as int arg2)) + (set! (-> v1-0 param2) (the-as int arg3)) + (set! (-> v1-0 param3) (the-as int arg4)) + (set! (-> obj dead-list next0) (-> v1-0 next0)) + (set! (-> v1-0 next0 prev0) (-> obj dead-list)) + (set! (-> v1-0 next0) (-> obj alive-list next0)) + (set! (-> v1-0 next0 prev0) v1-0) + (set! (-> v1-0 prev0) (-> obj alive-list)) + (set! (-> obj alive-list next0) v1-0) + (set! (-> v1-0 next1) (-> arg0 connection-list next1)) + (if (-> v1-0 next1) + (set! (-> v1-0 next1 prev1) v1-0) + ) + (set! (-> v1-0 prev1) (-> arg0 connection-list)) + (set! (-> arg0 connection-list next1) v1-0) + (+! (-> obj length) 1) + v1-0 + ) + ) + ) + +(defmethod move-to-dead connection ((obj connection)) + "Move this connection from the alive list to the dead list" + (let ((v1-1 (get-engine obj))) + (set! (-> obj prev0 next0) (-> obj next0)) + (set! (-> obj next0 prev0) (-> obj prev0)) + (set! (-> obj prev1 next1) (-> obj next1)) + (if (-> obj next1) + (set! (-> obj next1 prev1) (-> obj prev1)) + ) + (set! (-> obj next0) (-> v1-1 dead-list next0)) + (set! (-> obj next0 prev0) obj) + (set! (-> obj prev0) (-> v1-1 dead-list)) + (set! (-> v1-1 dead-list next0) obj) + (+! (-> v1-1 length) -1) + ) + obj + ) + +(defun process-disconnect ((arg0 process)) + "Disconnect all connections for the given process." + (when arg0 + (let ((gp-0 (-> arg0 connection-list next1))) + (while gp-0 + ((method-of-type connection move-to-dead) (the-as connection gp-0)) + (set! gp-0 (-> gp-0 next1)) + ) + ) + ) + 0 + ) + +(defmethod remove-from-process engine ((obj engine) (arg0 process)) + "Remove all connections from process for this engine" + (when arg0 + (let ((s5-0 (-> arg0 connection-list next1))) + (while s5-0 + (if ((method-of-type connection belongs-to-engine?) (the-as connection s5-0) obj) + ((method-of-type connection move-to-dead) (the-as connection s5-0)) + ) + (set! s5-0 (-> s5-0 next1)) + ) + ) + ) + 0 + ) + +(defmethod remove-matching engine ((obj engine) (arg0 (function connection engine symbol))) + "call the given function on each connection and the engine. + if it returns truthy, move to dead that connection." + (let* ((s4-0 (-> obj alive-list next0)) + (s3-0 (-> s4-0 next0)) + ) + (while (!= s4-0 (-> obj alive-list-end)) + (if (arg0 (the-as connection s4-0) obj) + ((method-of-type connection move-to-dead) (the-as connection s4-0)) + ) + (set! s4-0 s3-0) + (set! s3-0 (-> s3-0 next0)) + ) + ) + 0 + ) + +(defmethod remove-all engine ((obj engine)) + "Remove all connections from an engine" + (let* ((a0-1 (-> obj alive-list next0)) + (s5-0 (-> a0-1 next0)) + ) + (while (!= a0-1 (-> obj alive-list-end)) + ((method-of-type connection move-to-dead) (the-as connection a0-1)) + (set! a0-1 s5-0) + (set! s5-0 (-> s5-0 next0)) + ) + ) + 0 + ) + +(defmethod remove-by-param0 engine ((obj engine) (arg0 object)) + "Remove all connections with param0 matching arg0" + (let* ((a0-1 (-> obj alive-list next0)) + (s4-0 (-> a0-1 next0)) + ) + (while (!= a0-1 (-> obj alive-list-end)) + (if (= (-> (the-as connection a0-1) param0) arg0) + ((method-of-type connection move-to-dead) (the-as connection a0-1)) + ) + (set! a0-1 s4-0) + (set! s4-0 (-> s4-0 next0)) + ) + ) + 0 + ) + +(defmethod remove-by-param1 engine ((obj engine) (arg0 int)) + "Remove all connections with param1 matching arg0" + (let* ((a0-1 (-> obj alive-list next0)) + (s4-0 (-> a0-1 next0)) + ) + (while (!= a0-1 (-> obj alive-list-end)) + (if (= (-> (the-as connection a0-1) param1) arg0) + ((method-of-type connection move-to-dead) (the-as connection a0-1)) + ) + (set! a0-1 s4-0) + (set! s4-0 (-> s4-0 next0)) + ) + ) + 0 + ) + +(defmethod remove-by-param2 engine ((obj engine) (arg0 int)) + "Remove all connections with param2 matching arg0" + (let* ((a0-1 (-> obj alive-list next0)) + (s4-0 (-> a0-1 next0)) + ) + (while (!= a0-1 (-> obj alive-list-end)) + (if (= (-> (the-as connection a0-1) param2) arg0) + ((method-of-type connection move-to-dead) (the-as connection a0-1)) + ) + (set! a0-1 s4-0) + (set! s4-0 (-> s4-0 next0)) + ) + ) + 0 + ) + +;;;;;;;;;;;;;;;;;;; +;; PERS engine +;;;;;;;;;;;;;;;;;;; + +;; this is another engine system, very similar to the first, but not specific to a process. +;; each connection has a "key", which is like the process, but unlike normal engine, +;; the key's don't track which engine-pers they belong to. + +;; Unlike engine, users can use engine-pers as a parent class. + +(deftype connection-pers (structure) + ((next connection-pers :offset-assert 0) + (key object :offset-assert 4) + (update-time time-frame :offset-assert 8) + (param object 4 :offset 16) + (param-int32 int32 4 :offset 16) + (param-int64 int64 2 :offset 16) + (param-float float 4 :offset 16) + (param-quat int128 :offset 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(defmethod inspect connection-pers ((obj connection-pers)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj 'connection-pers) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tkey: ~A~%" (-> obj key)) + (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) + (format #t "~1Tparam[4] @ #x~X~%" (-> obj param)) + (dotimes (s5-0 4) + (format #t "~T [~D]~1Tparam: ~A~%" s5-0 (-> obj param s5-0)) + ) + (format #t "~1Tparam-int32[4] @ #x~X~%" (-> obj param)) + (dotimes (s5-1 4) + (format #t "~T [~D]~1Tparam-int32: ~D~%" s5-1 (-> obj param s5-1)) + ) + (format #t "~1Tparam-int64[2] @ #x~X~%" (-> obj param)) + (dotimes (s5-2 2) + (format #t "~T [~D]~1Tparam-int64: ~D~%" s5-2 (-> obj param-int64 s5-2)) + ) + (format #t "~1Tparam-float[4] @ #x~X~%" (-> obj param)) + (dotimes (s5-3 4) + (format #t "~T [~D]~1Tparam-float: ~f~%" s5-3 (the-as float (-> obj param s5-3))) + ) + ;(format #t "~1Tparam-quat: #x~X~%" (-> obj param-quat)) + obj + ) + +(deftype engine-pers (basic) + ((name symbol :offset-assert 4) + (length int16 :offset-assert 8) + (allocated-length int16 :offset-assert 10) + (element-type type :offset-assert 12) + (execute-time time-frame :offset-assert 16) + (alive-list connection-pers :offset-assert 24) + (dead-list connection-pers :offset-assert 28) + (data connection-pers :inline :dynamic :offset-assert 32) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (new (symbol type symbol int type) _type_ 0) + (schedule-callback (_type_ object time-frame) connection-pers 9) + (kill-callback (_type_) none 10) + (kill-by-key (_type_ object) none 11) + (kill-matching (_type_ (function engine-pers connection-pers object object symbol) object object) none 12) + (update-callback (_type_) none 13) + (run-pending-updates! (_type_ time-frame) none 14) + ) + ) + +(defmethod new engine-pers ((allocation symbol) (type-to-make type) (arg0 symbol) (arg1 int) (arg2 type)) + (let ((v0-0 (object-new + allocation + type-to-make + (the-as int (+ (-> type-to-make size) (* (the-as uint arg1) (-> arg2 size)))) + ) + ) + ) + (set! (-> v0-0 allocated-length) arg1) + (set! (-> v0-0 length) 0) + (set! (-> v0-0 name) arg0) + (set! (-> v0-0 element-type) arg2) + (set! (-> v0-0 alive-list) #f) + (set! (-> v0-0 dead-list) (the-as connection-pers (-> v0-0 data))) + (let ((v1-3 (the-as object (-> v0-0 data)))) + (dotimes (a0-1 arg1) + (set! (-> (the-as (pointer uint32) v1-3) 0) (the-as uint (&+ (the-as pointer v1-3) (-> arg2 size)))) + (set! v1-3 (&+ (the-as pointer v1-3) (-> arg2 size))) + ) + (set! (-> (the-as (pointer symbol) (&- (the-as pointer v1-3) (the-as uint (-> arg2 size))))) #f) + ) + v0-0 + ) + ) + +(defmethod length engine-pers ((obj engine-pers)) + "Get in use connection count." + (-> obj length) + ) + +(defmethod asize-of engine-pers ((obj engine-pers)) + "Get size in memory." + (the-as int (+ (-> obj type size) (* (-> obj allocated-length) (the-as int (-> obj element-type size))))) + ) + +(defmethod schedule-callback engine-pers ((obj engine-pers) (arg0 object) (arg1 time-frame)) + "Get a connection for this key. + If no connection exists, add it. + Schedule an update to happen in arg1 seconds." + (local-vars (v0-0 connection-pers)) + (let ((v1-0 (-> obj alive-list))) + (while v1-0 + (when (= arg0 (-> v1-0 key)) + (set! v0-0 v1-0) + (goto cfg-8) + ) + (set! v1-0 (-> v1-0 next)) + ) + ) + (set! v0-0 (-> obj dead-list)) + (when v0-0 + (set! (-> obj dead-list) (-> v0-0 next)) + (set! (-> v0-0 next) (-> obj alive-list)) + (set! (-> obj alive-list) v0-0) + (+! (-> obj length) 1) + (set! (-> v0-0 key) arg0) + (set! (-> v0-0 param-quat) (the-as int128 0)) + 0 + ) + (label cfg-8) + (if v0-0 + (set! (-> v0-0 update-time) (+ (-> obj execute-time) arg1)) + ) + v0-0 + ) + +(defmethod kill-callback engine-pers ((obj engine-pers)) + "Called when a connection is removed." + 0 + (none) + ) + +(defmethod update-callback engine-pers ((obj engine-pers)) + "Called when a connection is run. + Users can override this as needed." + 0 + (none) + ) + +(defmethod kill-by-key engine-pers ((obj engine-pers) (arg0 object)) + "Remove connections with this key, calling kill-callback." + (let ((s4-0 (&-> obj alive-list)) + (s2-0 (-> obj alive-list)) + ) + (while s2-0 + (let ((s3-0 (-> s2-0 next))) + (cond + ((!= arg0 (-> s2-0 key)) + (set! s4-0 (&-> s2-0 next)) + ) + (else + (kill-callback obj) + (set! (-> s4-0 0) (-> s2-0 next)) + (set! (-> s2-0 next) (-> obj dead-list)) + (set! (-> obj dead-list) s2-0) + (+! (-> obj length) -1) + ) + ) + (set! s2-0 s3-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod kill-matching engine-pers ((obj engine-pers) + (arg0 (function engine-pers connection-pers object object symbol)) + (arg1 object) + (arg2 object) + ) + "Call the given function on each connection. If it returns truthy, kill that connection." + (let ((s2-0 (&-> obj alive-list)) + (s0-0 (-> obj alive-list)) + ) + (while s0-0 + (let ((s1-0 (-> s0-0 next))) + (cond + ((not (arg0 obj s0-0 arg1 arg2)) + (set! s2-0 (&-> s0-0 next)) + ) + (else + (kill-callback obj) + (set! (-> s2-0 0) (-> s0-0 next)) + (set! (-> s0-0 next) (-> obj dead-list)) + (set! (-> obj dead-list) s0-0) + (+! (-> obj length) -1) + ) + ) + (set! s0-0 s1-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod run-pending-updates! engine-pers ((obj engine-pers) (arg0 time-frame)) + "Run updates if they scheduled. If something is found that has no pending update, kill it. + Note that we won't kill things on this call if they fail to update their update-time. + They will survive until the next call to run-pending-updates! + (or you can modify their update-time before that to prevent them from being killed)" + (let ((s4-0 (-> obj execute-time)) + (s2-0 (&-> obj alive-list)) + (s1-0 (-> obj alive-list)) + ) + (while s1-0 + (let ((s3-0 (-> s1-0 next))) + (cond + ((>= (-> s1-0 update-time) s4-0) + (update-callback obj) + (set! s2-0 (&-> s1-0 next)) + ) + (else + (kill-callback obj) + (set! (-> s2-0 0) (-> s1-0 next)) + (set! (-> s1-0 next) (-> obj dead-list)) + (set! (-> obj dead-list) s1-0) + (+! (-> obj length) -1) + ) + ) + (set! s1-0 s3-0) + ) + ) + ) + (set! (-> obj execute-time) arg0) + 0 + (none) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/goal_src/jak2/engine/engine/engines.gc b/goal_src/jak2/engine/engine/engines.gc index 2cb4386253..61141f07ca 100644 --- a/goal_src/jak2/engine/engine/engines.gc +++ b/goal_src/jak2/engine/engine/engines.gc @@ -7,3 +7,27 @@ ;; DECOMP BEGINS +(kmemopen global "engines") + +(define *background-draw-engine* (new 'global 'engine 'draw 10 connection)) + +(define *matrix-engine* (the-as (array handle) (new 'global 'boxed-array handle 1024))) +(set! (-> *matrix-engine* length) 0) + +(define *part-engine* (new 'global 'engine 'sparticle-launcher 256 connection)) + +(define *camera-engine* (new 'global 'engine 'camera-eng 128 connection)) + +(when *debug-segment* + (define *debug-engine* (new 'debug 'engine 'debug 64 connection)) + ) + +(define *pad-engine* (new 'global 'engine 'pad 4 connection)) + +(define *lightning-engine* (new 'global 'engine 'lightning-control 128 connection)) + +(define *hud-engine* (new 'global 'engine 'hud 16 connection)) + +(define *task-manager-engine* (new 'global 'engine 'task-manager 16 connection)) + +(kmemclose) diff --git a/goal_src/jak2/engine/entity/actor-link-h.gc b/goal_src/jak2/engine/entity/actor-link-h.gc index f4f0b4240c..b2211b7a9f 100644 --- a/goal_src/jak2/engine/entity/actor-link-h.gc +++ b/goal_src/jak2/engine/entity/actor-link-h.gc @@ -5,5 +5,361 @@ ;; name in dgo: actor-link-h ;; dgos: ENGINE, GAME +(define-extern entity-by-name (function string entity)) +(define-extern entity-by-type (function type entity-actor)) +(define-extern entity-by-aid (function uint entity)) + ;; DECOMP BEGINS +(defun entity-actor-lookup ((arg0 res-lump) (arg1 symbol) (arg2 int)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16)))) + (the-as + entity-actor + (when (and v1-1 (< arg2 (the-as int (-> sv-16 elt-count)))) + (if (= (-> sv-16 elt-type) string) + (entity-by-name (the-as string (-> (the-as (pointer uint32) (&+ v1-1 (* arg2 4)))))) + (entity-by-aid (-> (the-as (pointer uint32) (&+ v1-1 (* arg2 4))))) + ) + ) + ) + ) + ) + +(defun entity-actor-count ((arg0 res-lump) (arg1 symbol)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (if (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16)) + (the-as int (-> sv-16 elt-count)) + 0 + ) + ) + +(deftype actor-link-info (basic) + ((process process :offset-assert 4) + (next entity-actor :offset-assert 8) + (prev entity-actor :offset-assert 12) + ) + :method-count-assert 26 + :size-assert #x10 + :flag-assert #x1a00000010 + (:methods + (new (symbol type process symbol) _type_ 0) + (get-matching-actor-type-mask (_type_ type) int 9) + (actor-count-before (_type_) int 10) + (link-to-next-and-prev-actor (_type_) actor-link-info 11) + (get-next (_type_) entity-actor 12) + (get-prev (_type_) entity-actor 13) + (get-next-process (_type_) process 14) + (get-prev-process (_type_) process 15) + (apply-function-forward (_type_ (function entity-actor object object) object) int 16) + (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) + (apply-all (_type_ (function entity-actor object object) object) int 18) + (send-to-all (_type_ symbol) none 19) + (send-to-all-after (_type_ symbol) object 20) + (send-to-all-before (_type_ symbol) object 21) + (send-to-next-and-prev (_type_ symbol) none 22) + (send-to-next (_type_ symbol) none 23) + (send-to-prev (_type_ symbol) none 24) + (actor-count (_type_) int 25) + ) + ) + +(defmethod next-actor entity-actor ((obj entity-actor)) + (entity-actor-lookup obj 'next-actor 0) + ) + +(defmethod prev-actor entity-actor ((obj entity-actor)) + (entity-actor-lookup obj 'prev-actor 0) + ) + +(defmethod new actor-link-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol)) + (let* ((a0-1 (-> arg0 entity)) + (s4-0 (entity-actor-lookup a0-1 'next-actor 0)) + (a0-2 (-> arg0 entity)) + (s3-0 (entity-actor-lookup a0-2 'prev-actor 0)) + ) + (when (or (not arg1) s4-0 s3-0) + (let ((v0-2 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-2 process) arg0) + (set! (-> v0-2 next) s4-0) + (set! (-> v0-2 prev) s3-0) + v0-2 + ) + ) + ) + ) + +(defmethod get-next actor-link-info ((obj actor-link-info)) + (-> obj next) + ) + +(defmethod get-prev actor-link-info ((obj actor-link-info)) + (-> obj prev) + ) + +(defmethod get-next-process actor-link-info ((obj actor-link-info)) + (the-as process (and (-> obj next) (-> obj next extra process))) + ) + +(defmethod get-prev-process actor-link-info ((obj actor-link-info)) + (the-as process (and (-> obj prev) (-> obj prev extra process))) + ) + +(defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) + (let ((a0-1 (-> obj process entity))) + (set! (-> obj next) (entity-actor-lookup a0-1 'next-actor 0)) + ) + (let ((a0-2 (-> obj process entity))) + (set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0)) + ) + obj + ) + +(defmethod apply-function-forward actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> obj next))) + (while s3-0 + (if (arg0 s3-0 arg1) + (return (the-as int #f)) + ) + (set! s3-0 (entity-actor-lookup s3-0 'next-actor 0)) + ) + ) + 0 + ) + +(defmethod apply-function-reverse actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> obj prev))) + (while s3-0 + (if (arg0 s3-0 arg1) + (return (the-as int #f)) + ) + (set! s3-0 (entity-actor-lookup s3-0 'prev-actor 0)) + ) + ) + 0 + ) + +(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s4-0 (-> obj process entity))) + (while (let ((a0-2 s4-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) + ) + (while s4-0 + (if (arg0 (the-as entity-actor s4-0) arg1) + (return (the-as int #f)) + ) + (let ((a0-4 s4-0)) + (set! s4-0 (entity-actor-lookup a0-4 'next-actor 0)) + ) + ) + ) + 0 + ) + +(defmethod send-to-all-after actor-link-info ((obj actor-link-info) (arg0 symbol)) + (with-pp + (let ((s4-0 (-> obj next)) + (s5-0 (the-as object #f)) + ) + (while s4-0 + (let ((a0-1 (-> s4-0 extra process))) + (when a0-1 + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) arg0) + (set! s5-0 (or (send-event-function a0-1 a1-1) s5-0)) + ) + ) + ) + (set! s4-0 (entity-actor-lookup s4-0 'next-actor 0)) + ) + s5-0 + ) + ) + ) + +(defmethod send-to-all-before actor-link-info ((obj actor-link-info) (arg0 symbol)) + (with-pp + (let ((s4-0 (-> obj prev)) + (s5-0 (the-as object #f)) + ) + (while s4-0 + (let ((a0-1 (-> s4-0 extra process))) + (when a0-1 + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) arg0) + (set! s5-0 (or (send-event-function a0-1 a1-1) s5-0)) + ) + ) + ) + (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) + ) + s5-0 + ) + ) + ) + +(defmethod send-to-next actor-link-info ((obj actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> obj next))) + (when a0-1 + (let ((a0-2 (-> a0-1 extra process))) + (if a0-2 + (send-event a0-2 arg0) + ) + ) + ) + ) + (none) + ) + +(defmethod send-to-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> obj prev))) + (when a0-1 + (let ((a0-2 (-> a0-1 extra process))) + (if a0-2 + (send-event a0-2 arg0) + ) + ) + ) + ) + (none) + ) + +(defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) + (send-to-next obj arg0) + (send-to-prev obj arg0) + (none) + ) + +(defmethod send-to-all actor-link-info ((obj actor-link-info) (arg0 symbol)) + (send-to-all-after obj arg0) + (send-to-all-before obj arg0) + (none) + ) + +(defmethod actor-count actor-link-info ((obj actor-link-info)) + (let ((s5-0 (-> obj process entity)) + (gp-0 0) + ) + (while (let ((a0-2 s5-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s5-0 (entity-actor-lookup s5-0 'prev-actor 0)) + ) + (while s5-0 + (+! gp-0 1) + (let ((a0-3 s5-0)) + (set! s5-0 (entity-actor-lookup a0-3 'next-actor 0)) + ) + ) + gp-0 + ) + ) + +(defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (arg0 type)) + (let ((s3-0 (the-as entity-actor (-> obj process entity))) + (s5-0 0) + ) + (let ((s4-0 1)) + (while (let ((a0-2 s3-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s3-0 (entity-actor-lookup s3-0 'prev-actor 0)) + ) + (while s3-0 + (if (= (-> s3-0 etype) arg0) + (set! s5-0 (logior s5-0 s4-0)) + ) + (let ((a0-3 s3-0)) + (set! s3-0 (entity-actor-lookup a0-3 'next-actor 0)) + ) + (set! s4-0 (* s4-0 2)) + ) + ) + s5-0 + ) + ) + +(defmethod actor-count-before actor-link-info ((obj actor-link-info)) + (let* ((s5-0 (-> obj process entity)) + (s4-0 s5-0) + (gp-0 0) + ) + (while (let ((a0-2 s4-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) + ) + (while (!= s4-0 s5-0) + (+! gp-0 1) + (let ((a0-3 s4-0)) + (set! s4-0 (entity-actor-lookup a0-3 'next-actor 0)) + ) + ) + gp-0 + ) + ) + +(defun actor-link-subtask-complete-hook ((arg0 entity-actor) (arg1 (pointer symbol))) + (cond + ((logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete)) + (set! (-> arg1 0) #t) + #f + ) + (else + (set! (-> arg1 0) #f) + #t + ) + ) + ) + +(defun actor-link-subtask-incomplete-count-hook ((arg0 entity-actor) (arg1 (pointer uint64))) + (cond + ((logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete)) + #f + ) + (else + (+! (-> arg1 0) 1) + #f + ) + ) + ) + +(defun actor-link-dead-hook ((arg0 entity-actor) (arg1 (pointer symbol))) + (cond + ((logtest? (-> arg0 extra perm status) (entity-perm-status dead)) + (set! (-> arg1 0) #t) + #f + ) + (else + (set! (-> arg1 0) #f) + #t + ) + ) + ) + +(defun alt-actor-list-subtask-incomplete-count ((arg0 process-drawable)) + (let ((s4-0 (entity-actor-count (-> arg0 entity) 'alt-actor)) + (gp-0 0) + ) + (dotimes (s3-0 s4-0) + (let ((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor s3-0))) + (if (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status subtask-complete)))) + (+! gp-0 1) + ) + ) + ) + gp-0 + ) + ) + + + + diff --git a/goal_src/jak2/engine/entity/entity-h.gc b/goal_src/jak2/engine/entity/entity-h.gc index d35a574f1c..2ea91f8b09 100644 --- a/goal_src/jak2/engine/entity/entity-h.gc +++ b/goal_src/jak2/engine/entity/entity-h.gc @@ -5,5 +5,203 @@ ;; name in dgo: entity-h ;; dgos: ENGINE, GAME +(defenum entity-perm-status + :bitfield #t + :type uint16 + (bit-0 0) + (bit-1 1) + (dead 2) + (bit-3 3) + (bit-4 4) + (bit-5 5) + (subtask-complete 6) + (bit-7 7) + (bit-8 8) + (bit-9 9) + (bit-10 10) + ) + +(declare-type race-mesh basic) + ;; DECOMP BEGINS +(define *generate-actor-vis* #f) + +(define *generate-actor-vis-start* #f) + +(define *generate-actor-vis-output* #f) + +(deftype entity-perm (structure) + ((user-object object 2 :offset-assert 0) + (user-uint64 uint64 :offset 0) + (user-float float 2 :offset 0) + (user-int32 int32 2 :offset 0) + (user-uint32 uint32 2 :offset 0) + (user-int16 int16 4 :offset 0) + (user-uint16 uint16 4 :offset 0) + (user-int8 int8 8 :offset 0) + (user-uint8 uint8 8 :offset 0) + (status entity-perm-status :offset 8) + (dummy uint8 1 :offset 10) + (task uint8 :offset 11) + (aid actor-id :offset 12) + (quad uint128 :offset 0) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (entity-perm-method-9 () none 9) + ) + ) + +(deftype entity-links (structure) + ((prev-link entity-links :offset-assert 0) + (next-link entity-links :offset-assert 4) + (entity entity :offset-assert 8) + (process process :offset-assert 12) + (level level :offset-assert 16) + (vis-id int32 :offset-assert 20) + (kill-mask task-mask :offset-assert 24) + (vis-dist meters :offset-assert 28) + (trans vector :inline :offset-assert 32) + (perm entity-perm :inline :offset-assert 48) + (status uint16 :offset 56) + (aid uint32 :offset 60) + (task uint8 :offset 59) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (entity-links-method-9 () none 9) + ) + ) + +(deftype entity-perm-array (inline-array-class) + ((data entity-perm :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> entity-perm-array heap-base) (the-as uint 16)) + +(deftype entity-links-array (inline-array-class) + ((data entity-links :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> entity-links-array heap-base) (the-as uint 64)) + +(deftype entity (res-lump) + ((trans vector :inline :offset-assert 32) + (aid uint32 :offset-assert 48) + ) + :method-count-assert 27 + :size-assert #x34 + :flag-assert #x1b00000034 + (:methods + (entity-method-22 () none 22) + (entity-method-23 () none 23) + (entity-method-24 () none 24) + (entity-method-25 () none 25) + (entity-method-26 () none 26) + ) + ) + +(deftype entity-camera (entity) + ((connect connectable :inline :offset-assert 64) + ) + :method-count-assert 27 + :size-assert #x50 + :flag-assert #x1b00000050 + ) + +(deftype entity-nav-mesh (entity) + ((nav-mesh nav-mesh :offset-assert 52) + ) + :method-count-assert 29 + :size-assert #x38 + :flag-assert #x1d00000038 + (:methods + (entity-nav-mesh-method-27 () none 27) + (entity-nav-mesh-method-28 () none 28) + ) + ) + +(deftype entity-race-mesh (entity) + ((race-mesh race-mesh :offset-assert 52) + ) + :method-count-assert 29 + :size-assert #x38 + :flag-assert #x1d00000038 + (:methods + (entity-race-mesh-method-27 () none 27) + (entity-race-mesh-method-28 () none 28) + ) + ) + +(deftype entity-actor (entity) + ((etype type :offset 56) + (task game-task :offset-assert 60) + (kill-mask task-mask :offset 52) + (vis-id int16 :offset-assert 62) + (quat quaternion :inline :offset-assert 64) + ) + :method-count-assert 33 + :size-assert #x50 + :flag-assert #x2100000050 + (:methods + (next-actor (_type_) entity-actor 27) + (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) + ) + ) + +(deftype actor-reference (structure) + ((actor basic :offset-assert 0) + (id uint32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype actor-group (inline-array-class) + ((data actor-reference :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> actor-group heap-base) (the-as uint 8)) + +(deftype entity-info (basic) + ((ptype type :offset-assert 4) + (package basic :offset-assert 8) + (art-group pair :offset-assert 12) + (pool basic :offset-assert 16) + (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) + (birth-max int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(define *ACTOR-bank* (new 'static 'actor-bank :pause-dist (meters 50) :birth-dist (meters 220) :birth-max 10)) diff --git a/goal_src/jak2/engine/entity/res-h.gc b/goal_src/jak2/engine/entity/res-h.gc index 907c2c85da..23c895db3d 100644 --- a/goal_src/jak2/engine/entity/res-h.gc +++ b/goal_src/jak2/engine/entity/res-h.gc @@ -5,5 +5,63 @@ ;; name in dgo: res-h ;; dgos: ENGINE, GAME +;; the indices of two res tags. If the specific key-frame time is in between two +;; res-tags, this type is used to return the indices of the first res tag before and after +;; the specified time. +(deftype res-tag-pair (uint64) + ((lo int32 :offset 0) + (hi int32 :offset 32) + ) + ;; made-up type + ) + +(define-extern *res-static-buf* pointer) + + ;; DECOMP BEGINS +(deftype res-tag (uint128) + ((name symbol :offset 0 :size 32) + (key-frame float :offset 32 :size 32) + (elt-type type :offset 64 :size 32) + (data-offset uint16 :offset 96 :size 16) + (elt-count uint32 :offset 112 :size 15) + (inlined? uint8 :offset 127 :size 1) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype res-lump (basic) + ((length int32 :offset-assert 4) + (allocated-length int32 :offset-assert 8) + (data-base pointer :offset-assert 12) + (data-top pointer :offset-assert 16) + (data-size int32 :offset-assert 20) + (extra entity-links :offset-assert 24) + (tag (pointer res-tag) :offset-assert 28) + ) + :method-count-assert 22 + :size-assert #x20 + :flag-assert #x1600000020 + (:methods + (new (symbol type int int) _type_ 0) + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) + (get-tag-index-data (_type_ int) pointer 13) + (get-tag-data (_type_ res-tag) pointer 14) + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) + (sort! (_type_) _type_ 16) + (add-data! (_type_ res-tag pointer) res-lump 17) + (add-32bit-data! (_type_ res-tag object) res-lump 18) + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) + (make-property-data (_type_ float res-tag-pair pointer) pointer 20) + (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + ) + ) + +(define *res-key-string* (new 'global 'string 64 (the-as string #f))) + diff --git a/goal_src/jak2/engine/entity/res.gc b/goal_src/jak2/engine/entity/res.gc index c8c9e7563d..a62d960ff2 100644 --- a/goal_src/jak2/engine/entity/res.gc +++ b/goal_src/jak2/engine/entity/res.gc @@ -5,5 +5,999 @@ ;; name in dgo: res ;; dgos: ENGINE, GAME +#| +res is a generic storage system for not very large data, used mostly for the game entities. +These res files store collections of data, which can be as values (int8, int16, int32, int64, uint8, uint16, uint32, uint64, float, vector), or any structure (as references), which are tagged and identified with a res-tag. +The data is stored similar to an unboxed inline-array, the type of the data is stored in the res-tag. + +A res-lump stores and is used to access all of the data for a single "resource", a collection of varying data. +This is similar to a C++ map or C# dictionary. The key is a res-tag and the value is the corresponding binary data. + +A res-tag is a tag that contains information about a particular property of this resource, such as type, name, and amount of elements. +For example, information about an array of vectors that make up a path - for a moving platform - or an integer to store its entity ID. + +Keyframes are used to specify when/where the data is relevant. +For example (this is made-up), say you have a camera spline, and you want the FOV to change at three specific points: +when it starts, somewhere in the middle, and at the end. +You would store an array of three FOV values. The key-frame field could then be used to say at which point in the spline +the FOV should be at that value. If the camera is somewhere between those points, the result could then be interpolated. + +Properties are looked up from a res-lump using their name (a symbol). +You can look up the data of the property you want directly using the various get-property methods. +Curves can be quickly filled in using the get-curve-data! method. + + +This is updated from the entity system used in Crash 2, which had most of these features and worked very similarly! +|# + +(declare-type nav-mesh basic) +(declare-type collide-mesh basic) + ;; DECOMP BEGINS +(defmacro res-ref? (tag) + "Checks resource tag, and returns #t if resource data is a reference type, #f if it is inlined." + + `(zero? (-> ,tag inlined?)) + ) + +(defmethod print res-tag ((obj res-tag)) + "print a res-tag." + + (if (res-ref? obj) + + (format #t "#" + (-> obj name) + (-> obj key-frame) + (-> obj elt-type) + (-> obj elt-count) + ) + + (format #t "#" + (-> obj name) + (-> obj key-frame) + (-> obj elt-type) + (-> obj elt-count) + ) + ) + + obj + ) + +(defmethod length res-tag ((obj res-tag)) + "get the length in bytes of this tag's resource." + (the-as int (if (zero? (-> obj inlined?)) + (* (-> obj elt-count) 4) + (* (-> obj elt-count) (-> obj elt-type size)) + ) + ) + ) + +(defmethod get-tag-index-data res-lump ((obj res-lump) (arg0 int)) + "get the data address of the n'th tag." + (&+ (-> obj data-base) (-> obj tag arg0 data-offset)) + ) + +(defmethod get-tag-data res-lump ((obj res-lump) (arg0 res-tag)) + "get the data address of the specified tag." + (&+ (-> obj data-base) (-> arg0 data-offset)) + ) + +(defmethod new res-lump ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) + "Allocate a new res-lump." + (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 16) arg1))))) + (set! (-> v0-0 allocated-length) arg0) + (set! (-> v0-0 data-size) arg1) + (set! (-> v0-0 length) 0) + (set! (-> v0-0 data-base) (&-> (-> v0-0 tag) arg0)) + (set! (-> v0-0 data-top) (&-> (-> v0-0 tag) arg0)) + v0-0 + ) + ) + +(defmethod length res-lump ((obj res-lump)) + "get the amount of resources in a res-lump." + (-> obj length) + ) + +(defmethod asize-of res-lump ((obj res-lump)) + "get the allocated size of a res-lump." + (the-as int (+ (-> obj type psize) (* (-> obj allocated-length) 16) (-> obj data-size))) + ) + +(defmethod inspect res-lump ((obj res-lump)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Textra: ~A~%" (-> obj extra)) + (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~Tlength: ~D~%" (-> obj length)) + (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) + (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) + (format #t "~Tdata-size: #x~X~%" (-> obj data-size)) + (format #t "~Ttag[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj tag)) + (dotimes (i (-> obj length)) + (format #t "~T [~D] " i) + (print (-> (-> obj tag) i)) + (format #t " @ #x~X" (get-tag-index-data obj i)) + (cond + ((res-ref? (-> obj tag i)) + (format #t " = ~A~%" (deref basic (get-tag-index-data obj i))) + ) + (else + (format #t "~%") + ) + ) + ) + obj + ) + +(defmethod lookup-tag-idx res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) + "Look up the index of the tag containing with the given name and timestamp. + Correct lookups return a res-tag-pair, which contains one tag index in the lower 32 bits and one in the upper 32 bits. + Depending on the mode, they may be the same, or they may be two tags that you should interpolate + between, if the exact time was not found. + + name-sym should be the name of the thing you want. + time is for the timestamp you want. + If mode = 'base, then both the indices are the same and the timestamp is ignored. + If mode = 'interp, then it tries to get closest below/closest above (or both the same, if exact match found) + If mode = 'exact, then it requires an exact timestamp match and both indices are the same. + If things go wrong, returns a negative number" + (local-vars (t4-1 int)) + (when (or (= arg0 'id) + (= arg0 'aid) + (= arg0 'trans) + (= arg0 'rot) + (= arg0 'nav-mesh) + (= arg0 'process-type) + (= arg0 'task) + ) + (crash!) + 0 + ) + (if (or (not obj) (zero? obj) (<= (-> obj length) 0)) + (return (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) + ) + (let ((v1-14 -1) + (t0-6 -1) + ) + (let ((t1-0 -1) + (t2-4 (-> (the-as (pointer uint64) (-> (symbol->string arg0) data)) 0)) + ) + (let ((t3-1 (+ (-> obj length) -1)) + (t4-0 0) + ) + (while (>= t3-1 t4-0) + (let* ((t5-2 (+ t4-0 (/ (- t3-1 t4-0) 2))) + (t6-5 (- t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag t5-2 name)) data)) 0))) + ) + (cond + ((zero? t6-5) + (set! t4-1 t5-2) + (goto cfg-32) + ) + ((< (the-as int t6-5) 0) + (set! t3-1 (+ t5-2 -1)) + ) + (else + (set! t4-0 (+ t5-2 1)) + ) + ) + ) + ) + ) + (set! t4-1 -1) + (label cfg-32) + (if (< t4-1 0) + (return (the-as res-tag-pair t4-1)) + ) + (while (and (> t4-1 0) + (= t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ t4-1 -1) name)) data)) 0)) + ) + (+! t4-1 -1) + ) + (when (= arg1 'base) + (set! t0-6 t4-1) + (set! v1-14 t4-1) + (goto cfg-73) + ) + (let ((t3-13 t4-1) + (t4-4 (&-> (-> obj tag) t4-1)) + ) + (while (not (or (>= t3-13 (-> obj length)) + (< t2-4 (-> (&+ (the-as (pointer uint64) (symbol->string (-> t4-4 0 name))) 4) 0)) + ) + ) + (cond + ((!= arg0 (-> t4-4 0 name)) + ) + ((= (-> t4-4 0 key-frame) arg2) + (set! t0-6 t3-13) + (set! v1-14 t3-13) + (goto cfg-73) + ) + ((and (>= arg2 (-> t4-4 0 key-frame)) (!= arg1 'exact)) + (set! t0-6 t3-13) + (set! v1-14 t3-13) + (if (= (-> t4-4 0 key-frame) -1000000000.0) + (set! t1-0 t3-13) + ) + ) + ((< arg2 (-> t4-4 0 key-frame)) + (if (and (!= t0-6 t1-0) (= arg1 'interp)) + (set! v1-14 t3-13) + ) + (goto cfg-73) + ) + ) + (+! t3-13 1) + (set! t4-4 (&-> t4-4 1)) + ) + ) + ) + (label cfg-73) + (the-as res-tag-pair (logior (logand (the-as uint #xffffffff) t0-6) (shl v1-14 32))) + ) + ) + +(defmethod make-property-data res-lump ((obj res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) + "Returns (a pointer to) the value data of a property with the tag-pair. + If tag-pair does not represent an exact point in the timeline, then the data is interpolated based on time + with the result written into buf. buf must have enough space to copy all of the data. + Otherwise, simply returns an address to the resource binary." + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let* ((t0-2 (-> obj tag (-> arg1 lo))) + (t1-2 (-> obj tag (-> arg1 hi))) + (v1-6 (-> t0-2 elt-count)) + ) + (cond + ((zero? (-> t0-2 inlined?)) + (&+ (-> obj data-base) (-> t0-2 data-offset)) + ) + ((or (not arg2) + (= (-> arg1 lo) (-> arg1 hi)) + (!= v1-6 (-> t1-2 elt-count)) + (!= (-> t0-2 elt-type) (-> t1-2 elt-type)) + ) + (let ((a0-4 t0-2)) + (&+ (-> obj data-base) (-> a0-4 data-offset)) + ) + ) + (else + (let* ((f0-2 (/ (- arg0 (-> t0-2 key-frame)) (- (-> t1-2 key-frame) (-> t0-2 key-frame)))) + (a1-4 obj) + (a2-7 t0-2) + (a1-6 (&+ (-> a1-4 data-base) (-> a2-7 data-offset))) + (a2-13 (&+ (-> obj data-base) (-> t1-2 data-offset))) + ) + (case (-> t0-2 elt-type symbol) + (('float) + (dotimes (a0-8 (the-as int v1-6)) + (set! (-> (the-as (pointer float) (&+ arg2 (* a0-8 4)))) + (+ (* (-> (the-as (pointer float) (&+ a1-6 (* a0-8 4)))) (- 1.0 f0-2)) + (* (-> (the-as (pointer float) (&+ a2-13 (* a0-8 4)))) f0-2) + ) + ) + ) + arg2 + ) + (('integer 'sinteger 'uinteger 'int64 'uint64) + (let ((a0-10 (the int (* 4096.0 f0-2)))) + (dotimes (t0-10 (the-as int v1-6)) + (set! (-> (the-as (pointer int64) (&+ arg2 (* t0-10 8)))) + (sar + (+ (* (the-as int (-> (the-as (pointer uint64) (&+ a1-6 (* t0-10 8))))) (- 4096 a0-10)) + (* (the-as int (-> (the-as (pointer uint64) (&+ a2-13 (* t0-10 8))))) a0-10) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('int8) + (let ((a0-12 (the int (* 4096.0 f0-2)))) + (dotimes (t0-11 (the-as int v1-6)) + (set! (-> (the-as (pointer int8) (&+ arg2 t0-11))) + (sar + (+ (* (-> (the-as (pointer int8) (&+ a1-6 t0-11))) (- 4096 a0-12)) + (* (-> (the-as (pointer int8) (&+ a2-13 t0-11))) a0-12) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('uint8) + (let ((a0-14 (the int (* 4096.0 f0-2)))) + (dotimes (t0-12 (the-as int v1-6)) + (set! (-> (the-as (pointer uint8) (&+ arg2 t0-12))) + (shr + (+ (* (-> (the-as (pointer uint8) (&+ a1-6 t0-12))) (the-as uint (- 4096 a0-14))) + (* (-> (the-as (pointer uint8) (&+ a2-13 t0-12))) (the-as uint a0-14)) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('int16) + (let ((a0-16 (the int (* 4096.0 f0-2)))) + (dotimes (t0-13 (the-as int v1-6)) + (set! (-> (the-as (pointer int16) (&+ arg2 (* t0-13 2)))) + (sar + (+ (* (-> (the-as (pointer int16) (&+ a1-6 (* t0-13 2)))) (- 4096 a0-16)) + (* (-> (the-as (pointer int16) (&+ a2-13 (* t0-13 2)))) a0-16) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('uint16) + (let ((a0-18 (the int (* 4096.0 f0-2)))) + (dotimes (t0-14 (the-as int v1-6)) + (set! (-> (the-as (pointer uint16) (&+ arg2 (* t0-14 2)))) + (shr + (+ (* (-> (the-as (pointer uint16) (&+ a1-6 (* t0-14 2)))) (the-as uint (- 4096 a0-18))) + (* (-> (the-as (pointer uint16) (&+ a2-13 (* t0-14 2)))) (the-as uint a0-18)) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('int32) + (let ((a0-20 (the int (* 4096.0 f0-2)))) + (dotimes (t0-15 (the-as int v1-6)) + (set! (-> (the-as (pointer int32) (&+ arg2 (* t0-15 4)))) + (sar + (+ (* (-> (the-as (pointer int32) (&+ a1-6 (* t0-15 4)))) (- 4096 a0-20)) + (* (-> (the-as (pointer int32) (&+ a2-13 (* t0-15 4)))) a0-20) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('uint32) + (let ((a0-22 (the int (* 4096.0 f0-2)))) + (dotimes (t0-16 (the-as int v1-6)) + (set! (-> (the-as (pointer uint32) (&+ arg2 (* t0-16 4)))) + (shr + (+ (* (-> (the-as (pointer uint32) (&+ a1-6 (* t0-16 4)))) (the-as uint (- 4096 a0-22))) + (* (-> (the-as (pointer uint32) (&+ a2-13 (* t0-16 4)))) (the-as uint a0-22)) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('vector) + (let ((a0-23 f0-2)) + (.mov vf3 a0-23) + ) + (let ((a0-25 (- 1.0 f0-2))) + (.mov vf4 a0-25) + ) + (dotimes (a0-26 (the-as int v1-6)) + (let ((t0-18 (+ (* a0-26 16) (the-as int a1-6)))) + (.lvf vf1 (&-> (the-as (pointer int128) t0-18))) + ) + (let ((t0-20 (+ (* a0-26 16) (the-as int a2-13)))) + (.lvf vf2 (&-> (the-as (pointer int128) t0-20))) + ) + (.mul.x.vf vf1 vf1 vf4) + (.mul.x.vf vf2 vf2 vf3) + (.add.vf vf1 vf1 vf2) + (.svf (&-> (the-as (pointer uint128) (+ (* a0-26 16) (the-as int arg2))) 0) vf1) + ) + arg2 + ) + (else + (let ((a0-27 t0-2)) + (&+ (-> obj data-base) (-> a0-27 data-offset)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(defmethod get-property-data res-lump ((obj res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 pointer) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) + "Returns an address to a given property's data at a specific time stamp, or default on error. + name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. + default is the default result returned in the case of an error. + tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f + buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." + + (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int s3-0) 0) + (empty) + ) + (else + (set! arg3 (make-property-data obj arg2 s3-0 arg5)) + (if arg4 + (set! (-> arg4 0) (-> obj tag (-> s3-0 lo))) + ) + ) + ) + ) + arg3 + ) + +(defmethod get-property-struct res-lump ((obj res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 structure) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) + "Returns a given struct property's value at a specific time stamp, or default on error. + name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. + default is the default result returned in the case of an error. + tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f + buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." + (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int s3-0) 0) + (empty) + ) + (else + (set! arg3 (the-as structure (make-property-data obj arg2 s3-0 arg5))) + (let ((v1-4 (-> obj tag (-> s3-0 lo)))) + (if arg4 + (set! (-> arg4 0) v1-4) + ) + (if (zero? (-> v1-4 inlined?)) + (set! arg3 (the-as structure (-> (the-as (pointer uint32) arg3)))) + (empty) + ) + ) + ) + ) + ) + (the-as structure arg3) + ) + +(defmethod get-property-value res-lump ((obj res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 uint128) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) + "Returns a given value property's value at a specific time stamp, or default on error. + name is the name of the property you want, mode is its lookup mode ('interp 'base 'exact), time is the timestamp. + default is the default result returned in the case of an error. + tag-addr is an address to a res-tag. The current base tag is written to this. Ignored if tag-addr is #f + buf-addr is an address to the data buffer used to write interpolated data to. It must have enough space! Only necessary for 'interp mode." + (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int a2-1) 0) + (empty) + ) + (else + (let* ((a0-2 (-> a2-1 lo)) + (s1-0 (-> obj tag a0-2)) + (s0-0 (-> s1-0 elt-type)) + (gp-1 (make-property-data obj arg2 a2-1 arg5)) + ) + (if arg4 + (set! (-> arg4 0) s1-0) + ) + (cond + ((type-type? (the-as type s0-0) uinteger) + (case (-> s1-0 elt-type size) + ((1) + (set! arg3 (the-as uint128 (-> (the-as (pointer uint8) gp-1)))) + ) + ((2) + (set! arg3 (the-as uint128 (-> (the-as (pointer uint16) gp-1)))) + ) + ((4) + (set! arg3 (the-as uint128 (-> (the-as (pointer uint32) gp-1)))) + ) + ((16) + (set! arg3 (-> (the-as (pointer uint128) gp-1))) + ) + (else + (set! arg3 (the-as uint128 (-> (the-as (pointer uint64) gp-1)))) + ) + ) + ) + ((type-type? (the-as type s0-0) integer) + (case (-> s1-0 elt-type size) + ((1) + (set! arg3 (the-as uint128 (-> (the-as (pointer int8) gp-1)))) + ) + ((2) + (set! arg3 (the-as uint128 (-> (the-as (pointer int16) gp-1)))) + ) + ((4) + (set! arg3 (the-as uint128 (-> (the-as (pointer int32) gp-1)))) + ) + ((16) + (set! arg3 (-> (the-as (pointer uint128) gp-1))) + ) + (else + (set! arg3 (the-as uint128 (-> (the-as (pointer uint64) gp-1)))) + ) + ) + ) + ((type-type? (the-as type s0-0) float) + (set! arg3 (the-as uint128 (the int (-> (the-as (pointer float) gp-1))))) + ) + (else + (empty) + ) + ) + ) + ) + ) + ) + (the-as uint128 arg3) + ) + +(defmethod get-property-value-float res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) + "same as get-property-value but float type is checked first?" + (local-vars (v1-8 uint) (v1-11 int)) + (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int a2-1) 0) + (empty) + ) + (else + (let* ((a0-2 (-> a2-1 lo)) + (s1-0 (-> obj tag a0-2)) + (s0-0 (-> s1-0 elt-type)) + (gp-1 (make-property-data obj arg2 a2-1 arg5)) + ) + (if arg4 + (set! (-> arg4 0) s1-0) + ) + (cond + ((type-type? (the-as type s0-0) float) + (set! arg3 (-> (the-as (pointer float) gp-1))) + ) + ((type-type? (the-as type s0-0) uinteger) + (case (-> s1-0 elt-type size) + ((1) + (set! v1-8 (-> (the-as (pointer uint8) gp-1))) + ) + ((2) + (set! v1-8 (-> (the-as (pointer uint16) gp-1))) + ) + ((4) + (set! v1-8 (-> (the-as (pointer uint32) gp-1))) + ) + ((16) + (set! v1-8 (the-as uint (-> (the-as (pointer uint128) gp-1)))) + ) + (else + (set! v1-8 (-> (the-as (pointer uint64) gp-1))) + ) + ) + (set! arg3 (the float v1-8)) + ) + ((type-type? (the-as type s0-0) integer) + (case (-> s1-0 elt-type size) + ((1) + (set! v1-11 (-> (the-as (pointer int8) gp-1))) + ) + ((2) + (set! v1-11 (-> (the-as (pointer int16) gp-1))) + ) + ((4) + (set! v1-11 (-> (the-as (pointer int32) gp-1))) + ) + ((16) + (set! v1-11 (the-as int (-> (the-as (pointer uint128) gp-1)))) + ) + (else + (set! v1-11 (the-as int (-> (the-as (pointer uint64) gp-1)))) + ) + ) + (set! arg3 (the float v1-11)) + ) + (else + (empty) + ) + ) + ) + ) + ) + ) + arg3 + ) + +(defmethod sort! res-lump ((obj res-lump)) + "Sort all tags based on name, then key-frame." + (let ((v1-0 -1)) + (while (nonzero? v1-0) + (set! v1-0 0) + (let ((a1-0 0) + (a2-1 (+ (-> obj length) -2)) + ) + (while (>= a2-1 a1-0) + (let* ((a3-2 (-> obj tag a1-0)) + (t0-3 (-> obj tag (+ a1-0 1))) + (t1-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> a3-2 name)) data)) 0)) + (t2-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> t0-3 name)) data)) 0)) + ) + (when (or (< t2-6 t1-6) (and (= t1-6 t2-6) (< (-> t0-3 key-frame) (-> a3-2 key-frame)))) + (+! v1-0 1) + (set! (-> obj tag a1-0) t0-3) + (set! (-> obj tag (+ a1-0 1)) a3-2) + ) + ) + (+! a1-0 1) + ) + ) + ) + ) + obj + ) + +(defmethod allocate-data-memory-for-tag! res-lump ((obj res-lump) (arg0 res-tag)) + "Find space for the data described by arg0 in obj. + Returns a tag with data-offset set correctly for this res-lump. + If the lump already contains memory for the given tag, and it is big enough, + it will be reused. Alignment will be at least 8 bytes. + If the input tag has elt-count = 0, it will return a tag for elt-count = 1." + (local-vars (resource-mem pointer)) + (let* ((tag-pair (lookup-tag-idx obj (-> arg0 name) 'exact (-> arg0 key-frame))) + (existing-tag (-> obj tag (-> tag-pair lo))) + ) + 0 + (if (and (>= (the-as int tag-pair) 0) (!= (-> arg0 key-frame) (-> arg0 key-frame))) + (set! tag-pair (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) + ) + (if (zero? (-> arg0 elt-count)) + (set! arg0 (copy-and-set-field arg0 elt-count 1)) + ) + (let ((data-size (length arg0))) + (cond + ((and (>= (the-as int tag-pair) 0) (>= (length existing-tag) data-size)) + (set! resource-mem (&+ (-> obj data-base) (-> existing-tag data-offset))) + (when (logtest? (the-as int resource-mem) 7) + (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) + (set! (-> obj data-top) (&+ resource-mem data-size)) + ) + ) + (else + (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) + (set! (-> obj data-top) (&+ resource-mem data-size)) + ) + ) + (let* ((a0-22 arg0) + (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> obj data-base))))) + ) + (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> obj data-base) (-> obj data-size)))) + (format + 0 + "ERROR: attempting to a new tag ~`res-tag`P data of #x~X bytes to ~A, but data memory is full.~%" + s4-1 + data-size + obj + ) + (return (the-as res-tag #f)) + ) + (cond + ((< (the-as int tag-pair) 0) + (cond + ((>= (-> obj length) (-> obj allocated-length)) + (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 obj) + (return (the-as res-tag #f)) + ) + (else + (set! (-> obj tag (-> obj length)) s4-1) + (+! (-> obj length) 1) + (sort! obj) + ) + ) + ) + (else + (set! (-> obj tag (-> tag-pair lo)) s4-1) + ) + ) + s4-1 + ) + ) + ) + ) + +(defmethod add-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 pointer)) + "Given a tag and a pointer to its data, copy it to this res-lump. + This doesn't seem to do the right thing if the given tag is a non-inline tag + with > 1 element." + (let ((a0-2 (allocate-data-memory-for-tag! obj arg0))) + (when a0-2 + (let* ((v1-2 obj) + (a1-1 a0-2) + (s4-0 (&+ (-> v1-2 data-base) (-> a1-1 data-offset))) + ) + (cond + ((zero? (-> a0-2 inlined?)) + (length a0-2) + (set! (-> (the-as (pointer pointer) s4-0) 0) arg1) + ) + (else + (let ((a2-1 (length a0-2))) + (mem-copy! s4-0 arg1 a2-1) + ) + ) + ) + ) + ) + ) + obj + ) + +(defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) + "Add a single 32-bit value using add-data." + (set! (-> arg0 inlined?) 1) + (add-data! obj arg0 (& arg1)) ;; note, only 32-bits are spilled to the stack here. + #| + (local-vars (sv-16 object)) + (set! sv-16 arg1) + (let* ((v1-0 arg0) + (a1-4 (copy-and-set-bf v1-0 :inlined? 1)) + ) + (add-data! obj a1-4 (& sv-16)) + ) + |# + ) + +(defmethod get-curve-data! res-lump ((obj res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) + "Read curve data and write it to curve-target. Return #t if both control points and knots data was succesfully read, #f otherwise." + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (let ((s5-0 #f)) + (set! sv-16 (new 'static 'res-tag)) + (let ((a0-2 + ((method-of-object obj get-property-data) obj arg1 'exact arg3 (the-as pointer #f) (& sv-16) *res-static-buf*) + ) + ) + (when a0-2 + (set! (-> arg0 cverts) (the-as (inline-array vector) a0-2)) + (set! (-> arg0 num-cverts) (the-as int (-> sv-16 elt-count))) + (when (< 256 (-> arg0 num-cverts)) + (format + 0 + "ERROR: curve has ~D control points--only ~D are allowed. Increase MAX-CURVE-CONTROL-POINTS or shorten the curve.~%" + (-> arg0 num-cverts) + 256 + ) + (set! (-> arg0 num-cverts) 256) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((a0-6 + ((method-of-object obj get-property-data) obj arg2 'exact arg3 (the-as pointer #f) (& sv-32) *res-static-buf*) + ) + ) + (when a0-6 + (set! (-> arg0 knots) (the-as (pointer float) a0-6)) + (set! (-> arg0 num-knots) (the-as int (-> sv-32 elt-count))) + (set! s5-0 #t) + ) + ) + ) + ) + s5-0 + ) + ) + +(defmethod mem-usage res-lump ((obj res-lump) (arg0 memory-usage-block) (arg1 int)) + "Get the memory usage of this lump and its data" + (local-vars (sv-16 int)) + (let ((s3-0 48) + (s2-0 "res") + ) + (cond + ((logtest? arg1 256) + (set! s3-0 44) + (set! s2-0 "camera") + ) + ((logtest? arg1 64) + (set! s3-0 43) + (set! s2-0 "entity") + ) + ((logtest? arg1 512) + (set! s3-0 76) + (set! s2-0 "art-joint-geo") + ) + ) + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let ((v1-19 (asize-of obj))) + (+! (-> arg0 data s3-0 used) v1-19) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-19 15))) + ) + (dotimes (s1-0 (-> obj length)) + (when (zero? (-> obj tag s1-0 inlined?)) + (let* ((a1-4 obj) + (a0-15 s1-0) + (s0-0 (the-as object (-> (the-as (pointer int32) (&+ (-> a1-4 data-base) (-> a1-4 tag a0-15 data-offset)))))) + ) + (when (not (part-group-pointer? (the-as pointer s0-0))) + (let ((v1-34 (rtype-of (the-as int s0-0)))) + (cond + ((or (= v1-34 symbol) (or (= v1-34 type) (= v1-34 pair))) + ) + ((= v1-34 string) + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let ((v1-48 ((method-of-type (rtype-of (the-as int s0-0)) asize-of) (the-as int s0-0)))) + (+! (-> arg0 data s3-0 used) v1-48) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-48 15))) + ) + ) + ((or (= v1-34 nav-mesh) (= v1-34 collide-mesh)) + (let ((a0-48 (the-as (array object) s0-0))) + ((method-of-type (rtype-of a0-48) mem-usage) a0-48 arg0 arg1) + ) + ) + ((= v1-34 array) + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let* ((a0-53 (the-as (array object) s0-0)) + (v1-68 ((method-of-type (rtype-of a0-53) asize-of) a0-53)) + ) + (+! (-> arg0 data s3-0 used) v1-68) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-68 15))) + ) + (set! sv-16 0) + (while (< sv-16 (-> (the-as array s0-0) length)) + (let ((a0-63 (-> (the-as (array object) s0-0) sv-16))) + ((method-of-type (rtype-of a0-63) mem-usage) a0-63 arg0 arg1) + ) + (set! sv-16 (+ sv-16 1)) + ) + ) + (else + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let* ((a0-68 (the-as int s0-0)) + (v1-96 ((method-of-type (rtype-of a0-68) asize-of) a0-68)) + ) + (+! (-> arg0 data s3-0 used) v1-96) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-96 15))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (the-as res-lump 0) + ) + +;; definition for symbol *res-static-buf*, type pointer +(define *res-static-buf* (malloc 'global 128)) + + + + +;; There are four common types of lookup: +;; data. This is something like (pointer int32) or (inline-array vector), it should have a size. +;; struct. This will get a GOAL struct or basic. Like a string. +;; value. This will get a value. Possibly even a 128-bit value, though this does not appear to work properly. +;; float. This will get a float. If the value stored is an int, it will be converted to a float. + +(defmacro res-lump-data (lump name type &key (tag-ptr (the-as (pointer res-tag) #f)) &key (time -1000000000.0)) + "Helper macro to get data from a res-lump without interpolation." + `(the-as ,type ((method-of-type res-lump get-property-data) + ,lump + ,name + 'interp + ,time + (the-as pointer #f) + ,tag-ptr + *res-static-buf* + ) + ) + ) + +(defmacro res-lump-data-exact (lump name type &key (tag-ptr (the-as (pointer res-tag) #f)) &key (time 0.0)) + "Helper macro to get start of data from a res-lump." + `(the-as ,type ((method-of-type res-lump get-property-data) + ,lump + ,name + 'exact + ,time + (the-as pointer #f) + ,tag-ptr + *res-static-buf* + ) + ) + ) + +(defmacro res-lump-struct (lump name type &key (tag-ptr (the-as (pointer res-tag) #f)) &key (time -1000000000.0)) + `(the-as ,type ((method-of-type res-lump get-property-struct) + ,lump + ,name + 'interp + ,time + (the-as structure #f) + ,tag-ptr + *res-static-buf* + ) + ) + ) + +(defmacro res-lump-struct-exact (lump name type &key (tag-ptr (the-as (pointer res-tag) #f)) &key (time 0.0)) + `(the-as ,type ((method-of-type res-lump get-property-struct) + ,lump + ,name + 'exact + ,time + (the-as structure #f) + ,tag-ptr + *res-static-buf* + ) + ) + ) + +(defmacro res-lump-value (lump name type &key (tag-ptr (the-as (pointer res-tag) #f)) &key (default (the-as uint128 0)) &key (time -1000000000.0)) + "Helper macro to get a value from a res-lump with no interpolation." + `(the-as ,type ((method-of-type res-lump get-property-value) + ,lump + ,name + 'interp + ,time + ,default + ,tag-ptr + *res-static-buf* + ) + ) + ) + +(defmacro res-lump-float (lump name &key (tag-ptr (the-as (pointer res-tag) #f)) &key (default 0.0) &key (time -1000000000.0)) + "Helper macro to get a float from a res-lump with no interpolation." + `((method-of-type res-lump get-property-value-float) + ,lump + ,name + 'interp + ,time + ,default + ,tag-ptr + *res-static-buf* + ) + ) + + diff --git a/goal_src/jak2/engine/game/effect-control-h.gc b/goal_src/jak2/engine/game/effect-control-h.gc index 4ae53ca7e3..5b76597aa3 100644 --- a/goal_src/jak2/engine/game/effect-control-h.gc +++ b/goal_src/jak2/engine/game/effect-control-h.gc @@ -5,5 +5,55 @@ ;; name in dgo: effect-control-h ;; dgos: ENGINE, GAME +(defenum effect-control-flag + :type uint32 + :bitfield #t + ) + ;; DECOMP BEGINS +(deftype effect-control (basic) + ((process process-drawable :offset-assert 4) + (flags effect-control-flag :offset-assert 8) + (last-frame-group art-joint-anim :offset-assert 12) + (last-frame-num float :offset-assert 16) + (channel-offset int32 :offset-assert 20) + (res res-lump :offset-assert 24) + (name (pointer res-tag) :offset-assert 28) + (param uint32 :offset-assert 32) + ) + :method-count-assert 15 + :size-assert #x24 + :flag-assert #xf00000024 + (:methods + (new (symbol type process-drawable) _type_ 0) + (effect-control-method-9 () none 9) + (effect-control-method-10 () none 10) + (effect-control-method-11 () none 11) + (effect-control-method-12 () none 12) + (set-channel-offset! (_type_ int) none 13) + (effect-control-method-14 () none 14) + ) + ) + +(defmethod new effect-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) + (cond + ((res-lump-struct (-> arg0 draw jgeo extra) 'effect-name structure) + (let ((v0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-1 process) arg0) + (set! (-> v0-1 last-frame-group) #f) + v0-1 + ) + ) + (else + (the-as effect-control #f) + ) + ) + ) + +(defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) + (set! (-> obj channel-offset) arg0) + 0 + (none) + ) + diff --git a/goal_src/jak2/engine/game/fact-h.gc b/goal_src/jak2/engine/game/fact-h.gc index d87bf8e340..4192fc717d 100644 --- a/goal_src/jak2/engine/game/fact-h.gc +++ b/goal_src/jak2/engine/game/fact-h.gc @@ -5,5 +5,436 @@ ;; name in dgo: fact-h ;; dgos: ENGINE, GAME +(defenum pickup-type + :bitfield #f + :type int32 + (none 0) + (eco-yellow 1) + (eco-red 2) + (eco-blue 3) + (eco-dark 4) + (eco-green 5) + (eco-pill-green 6) + (eco-pill-dark 7) + (eco-pill-random 8) + (money 9) + (fuel-cell 10) + (buzzer 11) + (darkjak 12) + (ammo-yellow 13) + (ammo-red 14) + (ammo-blue 15) + (ammo-dark 16) + (shield 17) + (health 18) + (trick-point 19) + (trick-judge 20) + (gem 21) + (skill 22) + (karma 23) + (gun-red 24) + (gun-yellow 25) + (gun-blue 26) + (gun-dark 27) + (board 28) + (pass-red 29) + (pass-green 30) + (pass-yellow 31) + (pass-blue 32) + (ammo-random 33) + ) + +(defenum actor-option + :bitfield #t + :type uint64 + + (blocked 0) ;; 1 + (spawns-fuel-cell 1) ;; 2 + (draw-blocker 2) ;; 4 + (loop 3) ;; 8 + (reflect 4) ;; 16 + (wait-for-cue 5) ;; 32 + (auto-pickup 6) ;; 64 + (fuel-cell-no-jump 7) ;; 128 + (suck-in 8) ;; 256 + (fade-out 9) ;; 512 + (big-collision 10) ;; 1024 + (racer-only 11) ;; 2048 + (no-reaction 12) ;; 4096 + (no-shadow 13) ;; 8192 + (wait-for-task-complete 14) ;; 16384 + (respawn-delay 15) ;; 32768 + + (no-amb-sound 16) ;; hi 1 + (user17 17) ;; hi 2 + (user18 18) ;; hi 4 + (user19 19) ;; hi 8 + (user20 20) ;; hi 16 + (cond-hide 21) ;; hi 32 + (cond-respawn 22) ;; hi 64 + (fall 23) ;; hi 128 + (mirror 24) ;; hi 256 + (cond-low-ammo 25) ;; hi 512 + (no-distance-check-fadeout 26) ;; 1024 + (no-track 27) ;; hi 2048 + ) + +(defenum enemy-option + :bitfield #t + :type uint32 + (user0 0) ;; 1 + (user1 1) ;; 2 + (user2 2) ;; 4 + (user3 3) ;; 8 + (user4 4) ;; 16 + (user5 5) ;; 32 + (user6 6) ;; 64 + (user7 7) ;; 128 + (user8 8) ;; 256 + (user9 9) ;; 512 + (user10 10) ;; 1024 + (user11 11) ;; 2048 + (user12 12) ;; 4096 + (user13 13) ;; 8192 + (user14 14) ;; 16k + (user15 15) + + (dormant 16) ;; hi 1 + (dormant-aware 17) ;; hi 2 + (ambush 18) ;; hi 4 + (spawner 19) ;; hi 8 + (prespawned 20) ;; hi 16 + (multi-focus 21) ;; hi 32 + (has-trigger 22) + (idle-til-trigger 23) ;; hi 128 + (knocked-into-water 24) ;; hi 256 + (water 25) ;; hi 512 + ) + +(declare-type entity res-lump) +(define-extern process-task-mask (function process task-mask)) + ;; DECOMP BEGINS +(deftype fact-bank (basic) + ((eco-level-max float :offset-assert 4) + (eco-single-inc float :offset-assert 8) + (eco-full-inc float :offset-assert 12) + (eco-single-timeout seconds :offset-assert 16) + (eco-full-timeout seconds :offset-assert 24) + (dummy seconds :offset-assert 32) + (health-max-default float :offset-assert 40) + (health-single-inc float :offset-assert 44) + (health-default-inc float :offset-assert 48) + (health-darkjak-inc float :offset-assert 52) + (health-darkjak-min float :offset-assert 56) + (health-darkjak-error float :offset-assert 60) + (eco-pill-green-max-default float :offset-assert 64) + (eco-pill-dark-max-default float :offset-assert 68) + (health-small-inc float :offset-assert 72) + (buzzer-max-default float :offset-assert 76) + (buzzer-single-inc float :offset-assert 80) + (suck-bounce-dist meters :offset-assert 84) + (suck-suck-dist meters :offset-assert 88) + (default-eco-pill-green-inc float :offset-assert 92) + (default-eco-pill-dark-inc float :offset-assert 96) + (ammo-yellow-max float :offset-assert 100) + (ammo-red-max float :offset-assert 104) + (ammo-blue-max float :offset-assert 108) + (ammo-dark-max float :offset-assert 112) + (ammo-yellow-start float :offset-assert 116) + (ammo-red-start float :offset-assert 120) + (ammo-blue-start float :offset-assert 124) + (ammo-dark-start float :offset-assert 128) + (shield-max float :offset-assert 132) + (shield-use-speed float :offset-assert 136) + (shield-time-min seconds :offset-assert 144) + (trick-point-max float :offset-assert 152) + (super-skill-inc float :offset-assert 156) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +(define *FACT-bank* (new 'static 'fact-bank + :eco-level-max 2.0 + :eco-single-inc 1.0 + :eco-full-inc 5.0 + :eco-single-timeout (seconds 5) + :eco-full-timeout (seconds 20) + :dummy (seconds 15) + :health-max-default 8.0 + :health-single-inc 1.0 + :health-default-inc 2.0 + :health-darkjak-inc 0.1 + :health-darkjak-min 1.05 + :health-darkjak-error 0.05 + :eco-pill-green-max-default 50.0 + :eco-pill-dark-max-default 100.0 + :health-small-inc 1.0 + :buzzer-max-default 7.0 + :buzzer-single-inc 1.0 + :suck-bounce-dist (meters 18) + :suck-suck-dist (meters 7.5) + :ammo-yellow-max 100.0 + :ammo-red-max 50.0 + :ammo-blue-max 100.0 + :ammo-dark-max 5.0 + :ammo-yellow-start 100.0 + :ammo-red-start 50.0 + :ammo-blue-start 100.0 + :ammo-dark-start 5.0 + :shield-max 100.0 + :shield-use-speed 10.0 + :shield-time-min (seconds 1.5) + :trick-point-max 999999.0 + :super-skill-inc 3.0 + ) + ) + +(defun pickup-type->string ((arg0 pickup-type)) + (enum->string pickup-type arg0) + ) + +(deftype fact-info (basic) + ((process process :offset-assert 4) + (pickup-type pickup-type :offset-assert 8) + (pickup-amount float :offset-assert 12) + (pickup-spawn-amount float :offset-assert 16) + (options actor-option :offset-assert 24) + (fade-time time-frame :offset-assert 32) + ) + :method-count-assert 12 + :size-assert #x28 + :flag-assert #xc00000028 + (:methods + (new (symbol type process pickup-type float) _type_ 0) + (fact-info-method-9 () none 9) + (reset! (_type_ symbol) none 10) + (pickup-collectable! (_type_ pickup-type float handle) float 11) + ) + ) + +(deftype fact-info-target (fact-info) + ((eco-type int32 :offset-assert 40) + (eco-level float :offset-assert 44) + (eco-pickup-time time-frame :offset-assert 48) + (eco-timeout time-frame :offset-assert 56) + (eco-source uint64 :offset-assert 64) + (eco-source-time time-frame :offset-assert 72) + (health float :offset-assert 80) + (health-max float :offset-assert 84) + (health-pickup-time time-frame :offset-assert 88) + (buzzer float :offset-assert 96) + (buzzer-max float :offset-assert 100) + (eco-pill-green float :offset-assert 104) + (eco-pill-green-max float :offset-assert 108) + (eco-pill-green-pickup-time time-frame :offset-assert 112) + (eco-pill-dark-pickup-time time-frame :offset-assert 120) + (money-pickup-time time-frame :offset-assert 128) + (buzzer-pickup-time time-frame :offset-assert 136) + (task-pickup-time time-frame :offset-assert 144) + (stop-time-timeout time-frame :offset-assert 152) + (darkjak-start-time time-frame :offset-assert 160) + (darkjak-effect-time time-frame :offset-assert 168) + (ammo-pickup-time time-frame :offset-assert 176) + (shield-pickup-time time-frame :offset-assert 184) + (shield-start-time time-frame :offset-assert 192) + (shield-use-time time-frame :offset-assert 200) + (shield-level float :offset-assert 208) + (shield-attack-id uint32 :offset-assert 212) + (trick-point float :offset-assert 216) + (trick-point-pickup-time time-frame :offset-assert 224) + (trick-point-start-time time-frame :offset-assert 232) + (trick-point-duration time-frame :offset-assert 240) + (gem-pickup-time time-frame :offset-assert 248) + (skill-pickup-time time-frame :offset-assert 256) + (karma-pickup-time time-frame :offset-assert 264) + ) + :method-count-assert 13 + :size-assert #x110 + :flag-assert #xd00000110 + (:methods + (fact-info-target-method-12 () none 12) + ) + ) + +(deftype fact-info-enemy (fact-info) + ((speed float :offset-assert 40) + (idle-distance meters :offset-assert 44) + (notice-top meters :offset-assert 48) + (notice-bottom meters :offset-assert 52) + (cam-horz meters :offset-assert 56) + (cam-vert meters :offset-assert 60) + (cam-notice-dist meters :offset-assert 64) + (enemy-options enemy-option :offset-assert 68) + (trig-dist meters :offset-assert 72) + (trig-actor-group uint32 :offset-assert 76) + (trig-mask-count int8 :offset-assert 80) + (trig-mask uint8 2 :offset-assert 81) + ) + :method-count-assert 13 + :size-assert #x53 + :flag-assert #xd00000053 + (:methods + (new (symbol type process (pointer float) pickup-type float) _type_ 0) + (clear-mask-bits (_type_ int) none 12) + ) + ) + +(deftype fact-info-crate (fact-info) + ((suck-count int32 :offset-assert 40) + ) + :method-count-assert 12 + :size-assert #x2c + :flag-assert #xc0000002c + ) + +(defmethod new fact-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) + (local-vars (sv-16 fact-info) (sv-20 entity) (sv-24 task-mask)) + (set! sv-16 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + (set! sv-20 (-> arg0 entity)) + (set! sv-24 (process-task-mask arg0)) + (when (zero? sv-16) + (go process-drawable-art-error "memory") + (return (the-as fact-info 0)) + ) + (set! (-> sv-16 process) arg0) + (set! (-> sv-16 pickup-type) arg1) + (set! (-> sv-16 pickup-amount) arg2) + (let ((s4-1 (-> ((method-of-type res-lump lookup-tag-idx) sv-20 'eco-info 'base -1000000000.0) lo))) + (when (>= (the-as int s4-1) 0) + (let ((s3-0 (the-as int s4-1)) + (s2-0 (-> sv-20 tag s4-1)) + ) + 0 + (while (= (-> s2-0 name) (-> sv-20 tag s4-1 name)) + (let ((v1-17 (make-property-data sv-20 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f))) + (a0-7 (the int (-> s2-0 key-frame))) + ) + (when (or (< a0-7 0) (and (-> arg0 entity) (logtest? sv-24 (ash 1 a0-7)))) + (when v1-17 + (let ((a0-15 (-> s2-0 elt-count))) + (set! (-> sv-16 pickup-type) (the-as pickup-type (-> (the-as (pointer int32) v1-17)))) + (set! (-> sv-16 pickup-amount) (if (< (the-as uint 1) a0-15) + (the float (-> (the-as (pointer int32) v1-17) 1)) + arg2 + ) + ) + ) + ) + ) + ) + (+! s3-0 1) + (set! s2-0 (-> sv-20 tag s3-0)) + ) + ) + ) + ) + (set! (-> sv-16 options) (res-lump-value sv-20 'options actor-option :time -1000000000.0)) + (if (logtest? (-> sv-16 options) (actor-option fade-out respawn-delay)) + (set! (-> sv-16 fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float sv-20 'timeout))))) + ) + (the-as fact-info sv-16) + ) + +(defmethod pickup-collectable! fact-info ((obj fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) + 0.0 + ) + +(deftype fact-info-enemy-defaults (basic) + ((idle-distance meters :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(define *fact-info-enemy-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +(defmethod new fact-info-enemy ((allocation symbol) + (type-to-make type) + (arg0 process) + (arg1 (pointer float)) + (arg2 pickup-type) + (arg3 float) + ) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (let ((gp-0 (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make arg0 arg2 arg3)))) + (let ((s5-0 (the res-lump (-> gp-0 process entity)))) + (set! (-> gp-0 speed) (res-lump-float s5-0 'speed :default 1.0)) + (set! (-> gp-0 idle-distance) (res-lump-float s5-0 'idle-distance :default (-> arg1 0))) + (set! (-> gp-0 notice-top) (res-lump-float s5-0 'notice-top :default 4096000.0)) + (set! (-> gp-0 notice-bottom) (res-lump-float s5-0 'notice-bottom :default 4096000.0)) + (set! (-> gp-0 cam-horz) (res-lump-float s5-0 'cam-horz)) + (set! (-> gp-0 cam-vert) (res-lump-float s5-0 'cam-vert)) + (set! (-> gp-0 cam-notice-dist) (res-lump-float s5-0 'cam-notice-dist :default -4096.0)) + (set! (-> gp-0 enemy-options) (res-lump-value s5-0 'enemy-options enemy-option :time -1000000000.0)) + (let ((s4-1 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-11 (res-lump-data s5-0 'trigger pointer :tag-ptr (& sv-16) :time -1000000000.0))) + (when v1-11 + (set! (-> gp-0 enemy-options) (logior (enemy-option has-trigger) (-> gp-0 enemy-options))) + (let ((a0-13 0)) + (dotimes (a1-11 (the-as int (-> sv-16 elt-count))) + (let ((a2-12 (-> (the-as (pointer uint32) (&+ v1-11 (* a1-11 4)))))) + (when (and (nonzero? a2-12) (< a0-13 2)) + (set! (-> gp-0 trig-mask a0-13) a2-12) + (set! s4-1 (logior s4-1 a2-12)) + (+! a0-13 1) + ) + ) + ) + (set! (-> gp-0 trig-mask-count) a0-13) + ) + ) + ) + (set! (-> gp-0 trig-dist) (if (logtest? s4-1 1) + (res-lump-float s5-0 'trig-dist :default 327680.0) + 327680.0 + ) + ) + (when (logtest? s4-1 2) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-20 (res-lump-data s5-0 'trig-ag pointer :tag-ptr (& sv-32) :time -1000000000.0))) + (if (and v1-20 (nonzero? (-> sv-32 elt-count))) + (set! (-> gp-0 trig-actor-group) (the-as uint v1-20)) + (clear-mask-bits gp-0 2) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +(defmethod clear-mask-bits fact-info-enemy ((obj fact-info-enemy) (arg0 int)) + (let ((v1-0 (lognot arg0))) + (dotimes (a1-1 (-> obj trig-mask-count)) + (logand! (-> obj trig-mask a1-1) v1-0) + ) + ) + 0 + (none) + ) + +(defmethod new fact-info-crate ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) + (let ((gp-0 (the-as fact-info-crate ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (let ((a0-1 (the res-lump (-> gp-0 process entity)))) + (set! (-> gp-0 suck-count) (res-lump-value a0-1 'suck-count int :time -1000000000.0)) + ) + gp-0 + ) + ) + +(defmethod new fact-info-target ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) + (let ((gp-0 (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (set! (-> gp-0 eco-source) (the-as uint #f)) + (reset! gp-0 #f) + gp-0 + ) + ) + + diff --git a/goal_src/jak2/engine/game/game-h.gc b/goal_src/jak2/engine/game/game-h.gc index f1e3ccf2bb..e107848197 100644 --- a/goal_src/jak2/engine/game/game-h.gc +++ b/goal_src/jak2/engine/game/game-h.gc @@ -5,5 +5,309 @@ ;; name in dgo: game-h ;; dgos: ENGINE, GAME +(declare-type nav-control structure) +(declare-type path-control basic) +(declare-type vol-control basic) +(declare-type actor-link-info basic) +(declare-type water-control basic) +(declare-type align-control basic) +(declare-type fact-info basic) + +(define-extern vector<-cspace! (function vector cspace vector)) + +(defenum state-flags + :bitfield #t + :type uint32 + ) + +(defenum attack-info-mask + :bitfield #t + :type uint32 + (trans 0) ;; 1 + (vector 1) ;; 2 + (intersection 2) ;; 4 + (attacker 3) ;; 8 + (attack-time 4) ;; 16 + (invinc-time 5) ;; 32 + (mode 6) ;; 64 + (shove-back 7) ;; 128 + (shove-up 8) ;; 256 + (speed 9) ;; 512 + (dist 10) ;; 1024 + (control 11) ;; 2048 + (angle 12) ;; 4096 + (rotate-to 13) ;; 8192 + (prev-state 14) ;; 16384 + (id 15) ;; 32768 + (count 16) ;; hi 1 + (penetrate-using 17) ;; hi 2 + (attacker-velocity 18);; hi 4 + (damage 19) ;; hi 8 + (shield-damage 20) ;; hi16 + (knock 21) ;; hi 32 + (test 22) ;; hi 64 + ) + ;; DECOMP BEGINS +(deftype process-drawable (process) + ((root trsqv :offset-assert 128) + (node-list cspace-array :offset-assert 132) + (draw draw-control :offset-assert 136) + (skel joint-control :offset-assert 140) + (nav nav-control :offset-assert 144) + (align align-control :offset-assert 148) + (path path-control :offset-assert 152) + (vol vol-control :offset-assert 156) + (fact fact-info :offset-assert 160) + (link actor-link-info :offset-assert 164) + (part sparticle-launch-control :offset-assert 168) + (water water-control :offset-assert 172) + (sound ambient-sound :offset-assert 176) + (carry basic :offset-assert 180) + (rbody basic :offset-assert 184) + (state-flags state-flags :offset-assert 188) + (state-time time-frame :offset-assert 192) + ) + :heap-base #x50 + :method-count-assert 20 + :size-assert #xc8 + :flag-assert #x14005000c8 + (:methods + (process-drawable-method-14 () none 14) + (process-drawable-method-15 () none 15) + (process-drawable-method-16 () none 16) + (process-drawable-method-17 () none 17) + (process-drawable-method-18 () none 18) + (process-drawable-method-19 () none 19) + ) + ) + + +(deftype process-drawable-reserved (process-drawable) + () + :heap-base #x50 + :method-count-assert 178 + :size-assert #xc8 + :flag-assert #xb2005000c8 + (:methods + (process-drawable-reserved-method-20 () none 20) + (process-drawable-reserved-method-21 () none 21) + (process-drawable-reserved-method-22 () none 22) + (process-drawable-reserved-method-23 () none 23) + (process-drawable-reserved-method-24 () none 24) + (process-drawable-reserved-method-25 () none 25) + (process-drawable-reserved-method-26 () none 26) + (process-drawable-reserved-method-27 () none 27) + (process-drawable-reserved-method-28 () none 28) + (process-drawable-reserved-method-29 () none 29) + (process-drawable-reserved-method-30 () none 30) + (process-drawable-reserved-method-31 () none 31) + (process-drawable-reserved-method-32 () none 32) + (process-drawable-reserved-method-33 () none 33) + (process-drawable-reserved-method-34 () none 34) + (process-drawable-reserved-method-35 () none 35) + (process-drawable-reserved-method-36 () none 36) + (process-drawable-reserved-method-37 () none 37) + (process-drawable-reserved-method-38 () none 38) + (process-drawable-reserved-method-39 () none 39) + (process-drawable-reserved-method-40 () none 40) + (process-drawable-reserved-method-41 () none 41) + (process-drawable-reserved-method-42 () none 42) + (process-drawable-reserved-method-43 () none 43) + (process-drawable-reserved-method-44 () none 44) + (process-drawable-reserved-method-45 () none 45) + (process-drawable-reserved-method-46 () none 46) + (process-drawable-reserved-method-47 () none 47) + (process-drawable-reserved-method-48 () none 48) + (process-drawable-reserved-method-49 () none 49) + (process-drawable-reserved-method-50 () none 50) + (process-drawable-reserved-method-51 () none 51) + (process-drawable-reserved-method-52 () none 52) + (process-drawable-reserved-method-53 () none 53) + (process-drawable-reserved-method-54 () none 54) + (process-drawable-reserved-method-55 () none 55) + (process-drawable-reserved-method-56 () none 56) + (process-drawable-reserved-method-57 () none 57) + (process-drawable-reserved-method-58 () none 58) + (process-drawable-reserved-method-59 () none 59) + (process-drawable-reserved-method-60 () none 60) + (process-drawable-reserved-method-61 () none 61) + (process-drawable-reserved-method-62 () none 62) + (process-drawable-reserved-method-63 () none 63) + (process-drawable-reserved-method-64 () none 64) + (process-drawable-reserved-method-65 () none 65) + (process-drawable-reserved-method-66 () none 66) + (process-drawable-reserved-method-67 () none 67) + (process-drawable-reserved-method-68 () none 68) + (process-drawable-reserved-method-69 () none 69) + (process-drawable-reserved-method-70 () none 70) + (process-drawable-reserved-method-71 () none 71) + (process-drawable-reserved-method-72 () none 72) + (process-drawable-reserved-method-73 () none 73) + (process-drawable-reserved-method-74 () none 74) + (process-drawable-reserved-method-75 () none 75) + (process-drawable-reserved-method-76 () none 76) + (process-drawable-reserved-method-77 () none 77) + (process-drawable-reserved-method-78 () none 78) + (process-drawable-reserved-method-79 () none 79) + (process-drawable-reserved-method-80 () none 80) + (process-drawable-reserved-method-81 () none 81) + (process-drawable-reserved-method-82 () none 82) + (process-drawable-reserved-method-83 () none 83) + (process-drawable-reserved-method-84 () none 84) + (process-drawable-reserved-method-85 () none 85) + (process-drawable-reserved-method-86 () none 86) + (process-drawable-reserved-method-87 () none 87) + (process-drawable-reserved-method-88 () none 88) + (process-drawable-reserved-method-89 () none 89) + (process-drawable-reserved-method-90 () none 90) + (process-drawable-reserved-method-91 () none 91) + (process-drawable-reserved-method-92 () none 92) + (process-drawable-reserved-method-93 () none 93) + (process-drawable-reserved-method-94 () none 94) + (process-drawable-reserved-method-95 () none 95) + (process-drawable-reserved-method-96 () none 96) + (process-drawable-reserved-method-97 () none 97) + (process-drawable-reserved-method-98 () none 98) + (process-drawable-reserved-method-99 () none 99) + (process-drawable-reserved-method-100 () none 100) + (process-drawable-reserved-method-101 () none 101) + (process-drawable-reserved-method-102 () none 102) + (process-drawable-reserved-method-103 () none 103) + (process-drawable-reserved-method-104 () none 104) + (process-drawable-reserved-method-105 () none 105) + (process-drawable-reserved-method-106 () none 106) + (process-drawable-reserved-method-107 () none 107) + (process-drawable-reserved-method-108 () none 108) + (process-drawable-reserved-method-109 () none 109) + (process-drawable-reserved-method-110 () none 110) + (process-drawable-reserved-method-111 () none 111) + (process-drawable-reserved-method-112 () none 112) + (process-drawable-reserved-method-113 () none 113) + (process-drawable-reserved-method-114 () none 114) + (process-drawable-reserved-method-115 () none 115) + (process-drawable-reserved-method-116 () none 116) + (process-drawable-reserved-method-117 () none 117) + (process-drawable-reserved-method-118 () none 118) + (process-drawable-reserved-method-119 () none 119) + (process-drawable-reserved-method-120 () none 120) + (process-drawable-reserved-method-121 () none 121) + (process-drawable-reserved-method-122 () none 122) + (process-drawable-reserved-method-123 () none 123) + (process-drawable-reserved-method-124 () none 124) + (process-drawable-reserved-method-125 () none 125) + (process-drawable-reserved-method-126 () none 126) + (process-drawable-reserved-method-127 () none 127) + (process-drawable-reserved-method-128 () none 128) + (process-drawable-reserved-method-129 () none 129) + (process-drawable-reserved-method-130 () none 130) + (process-drawable-reserved-method-131 () none 131) + (process-drawable-reserved-method-132 () none 132) + (process-drawable-reserved-method-133 () none 133) + (process-drawable-reserved-method-134 () none 134) + (process-drawable-reserved-method-135 () none 135) + (process-drawable-reserved-method-136 () none 136) + (process-drawable-reserved-method-137 () none 137) + (process-drawable-reserved-method-138 () none 138) + (process-drawable-reserved-method-139 () none 139) + (process-drawable-reserved-method-140 () none 140) + (process-drawable-reserved-method-141 () none 141) + (process-drawable-reserved-method-142 () none 142) + (process-drawable-reserved-method-143 () none 143) + (process-drawable-reserved-method-144 () none 144) + (process-drawable-reserved-method-145 () none 145) + (process-drawable-reserved-method-146 () none 146) + (process-drawable-reserved-method-147 () none 147) + (process-drawable-reserved-method-148 () none 148) + (process-drawable-reserved-method-149 () none 149) + (process-drawable-reserved-method-150 () none 150) + (process-drawable-reserved-method-151 () none 151) + (process-drawable-reserved-method-152 () none 152) + (process-drawable-reserved-method-153 () none 153) + (process-drawable-reserved-method-154 () none 154) + (process-drawable-reserved-method-155 () none 155) + (process-drawable-reserved-method-156 () none 156) + (process-drawable-reserved-method-157 () none 157) + (process-drawable-reserved-method-158 () none 158) + (process-drawable-reserved-method-159 () none 159) + (process-drawable-reserved-method-160 () none 160) + (process-drawable-reserved-method-161 () none 161) + (process-drawable-reserved-method-162 () none 162) + (process-drawable-reserved-method-163 () none 163) + (process-drawable-reserved-method-164 () none 164) + (process-drawable-reserved-method-165 () none 165) + (process-drawable-reserved-method-166 () none 166) + (process-drawable-reserved-method-167 () none 167) + (process-drawable-reserved-method-168 () none 168) + (process-drawable-reserved-method-169 () none 169) + (process-drawable-reserved-method-170 () none 170) + (process-drawable-reserved-method-171 () none 171) + (process-drawable-reserved-method-172 () none 172) + (process-drawable-reserved-method-173 () none 173) + (process-drawable-reserved-method-174 () none 174) + (process-drawable-reserved-method-175 () none 175) + (process-drawable-reserved-method-176 () none 176) + (process-drawable-reserved-method-177 () none 177) + ) + ) + +(deftype attack-dir-info (structure) + ((dir vector :inline :offset-assert 0) + (xz-dir vector :inline :offset-assert 16) + (attacker-velocity vector :inline :offset-assert 32) + (pos vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype attack-info (structure) + ((trans vector :inline :offset-assert 0) + (vector vector :inline :offset-assert 16) + (attacker-velocity vector :inline :offset-assert 32) + (intersection vector :inline :offset-assert 48) + (attacker handle :offset-assert 64) + (attack-time time-frame :offset-assert 72) + (invinc-time time-frame :offset-assert 80) + (mask attack-info-mask :offset-assert 88) + (mode symbol :offset-assert 92) + (shove-back meters :offset-assert 96) + (shove-up meters :offset-assert 100) + (speed meters :offset-assert 104) + (dist meters :offset-assert 108) + (control float :offset-assert 112) + (angle symbol :offset-assert 116) + (rotate-to degrees :offset-assert 120) + (prev-state state :offset-assert 124) + (id uint32 :offset-assert 128) + (count uint32 :offset-assert 132) + (penetrate-using uint64 :offset-assert 136) + (damage float :offset-assert 144) + (shield-damage float :offset-assert 148) + (knock uint8 :offset-assert 152) + (test uint32 :offset-assert 156) + ) + :method-count-assert 12 + :size-assert #xa0 + :flag-assert #xc000000a0 + (:methods + (attack-info-method-9 () none 9) + (attack-info-method-10 () none 10) + (attack-info-method-11 () none 11) + ) + ) + + +(deftype ground-tween-info (structure) + ((chan uint8 3 :offset-assert 0) + (blend float 3 :offset-assert 4) + (group uint32 5 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(define-extern process-drawable-art-error (state string process-drawable)) diff --git a/goal_src/jak2/engine/game/game-info-h.gc b/goal_src/jak2/engine/game/game-info-h.gc index 10a33fdc37..d187d5f0f0 100644 --- a/goal_src/jak2/engine/game/game-info-h.gc +++ b/goal_src/jak2/engine/game/game-info-h.gc @@ -5,5 +5,371 @@ ;; name in dgo: game-info-h ;; dgos: ENGINE, GAME +(declare-type entity-perm-array inline-array-class) +(declare-type continue-point basic) +(declare-type game-save basic) + + +(defenum mc-status-code + :type uint32 + ; (busy 0) + ; (ok 1) + ; (bad-handle 2) + ; (format-failed 3) + ; (internal-error 4) + ; (write-error 5) + ; (read-error 6) + ; (new-game 7) + ; (no-memory 8) + ; (no-card 9) + ; (no-last 10) + ; (no-format 11) + ; (no-file 12) + ; (no-save 13) + ; (no-space 14) + ; (bad-version 15) + ; (no-process 16) + ; (no-auto-save 17) + ) + +(defenum continue-flags + :type uint32 + :bitfield #t + (cf0 0) + (cf1 1) + (cf2 2) + (cf3 3) + (cf4 4) + (cf5 5) + (cf6 6) + (cf7 7) + (cf8 8) + (cf9 9) + (cf10 10) + (cf11 11) + (cf12 12) + (cf13 13) + (cf14 14) + (cf15 15) + (cf16 16) + (cf17 17) + (cf18 18) + (cf19 19) + (cf20 20) + (cf21 21) + (cf22 22) + (cf23 23) + (cf24 24) + (cf25 25) + (cf26 26) + (cf27 27) + (cf28 28) + (cf29 29) + (cf30 30) + ) + ;; DECOMP BEGINS +(deftype game-bank (basic) + ((life-max-default float :offset-assert 4) + (life-start-default float :offset-assert 8) + (life-single-inc float :offset-assert 12) + (money-task-inc float :offset-assert 16) + (money-oracle-inc float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(define *GAME-bank* (new 'static 'game-bank + :life-max-default 99.0 + :life-start-default 5.0 + :life-single-inc 1.0 + :money-task-inc 90.0 + :money-oracle-inc 120.0 + ) + ) + +(deftype actor-id (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype highscore-info (structure) + ((flags uint8 :offset-assert 0) + (award-scores float 3 :offset-assert 4) + (bronze-score float :offset 4) + (silver-score float :offset 8) + (gold-score float :offset 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (highscore-info-method-9 () none 9) + ) + ) + +(deftype level-buffer-state (structure) + ((name symbol :offset-assert 0) + (display? symbol :offset-assert 4) + (force-vis? symbol :offset-assert 8) + (force-inside? symbol :offset-assert 12) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype load-state (basic) + ((want level-buffer-state 6 :inline :offset-assert 4) + (want-sound symbol 3 :offset-assert 100) + (vis-nick symbol :offset-assert 112) + (command-list pair :offset-assert 116) + (object-name string 256 :offset-assert 120) + (object-status basic 256 :offset-assert 1144) + ) + :method-count-assert 22 + :size-assert #x878 + :flag-assert #x1600000878 + (:methods + (new (symbol type) _type_ 0) + (reset! (_type_) _type_ 9) + (update! (_type_) int 10) + (want-levels (_type_ (pointer symbol)) int 11) + (load-state-method-12 () none 12) + (want-display-level (_type_ symbol symbol) int 13) + (want-vis-level (_type_ symbol) none 14) + (load-state-method-15 () none 15) + (load-state-method-16 () none 16) + (load-state-method-17 () none 17) + (load-state-method-18 () none 18) + (load-state-method-19 () none 19) + (load-state-method-20 () none 20) + (load-state-method-21 () none 21) + ) + ) + +(defmethod inspect load-state ((obj load-state)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twant[6] @ #x~X~%" (-> obj want)) + (dotimes (s5-0 6) + (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> obj want s5-0)) + ) + (format #t "~1Twant-sound[3] @ #x~X~%" (-> obj want-sound)) + (dotimes (s5-1 3) + (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> obj want-sound s5-1)) + ) + (format #t "~1Tvis-nick: ~A~%" (-> obj vis-nick)) + (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) + (format #t "~1Tobject-name[256] @ #x~X~%" (-> obj object-name)) + (format #t "~1Tobject-status[256] @ #x~X~%" (-> obj object-status)) + obj + ) + +(defmethod new load-state ((allocation symbol) (type-to-make type)) + (reset! (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + ) + +(deftype continue-point (basic) + ((name string :offset-assert 4) + (level symbol :offset-assert 8) + (flags continue-flags :offset-assert 12) + (trans vector :inline :offset-assert 16) + (quat vector :inline :offset-assert 32) + (camera-trans vector :inline :offset-assert 48) + (camera-rot float 9 :offset-assert 64) + (on-goto pair :offset-assert 100) + (vis-nick symbol :offset-assert 104) + (want level-buffer-state 6 :inline :offset-assert 108) + (want-sound symbol 3 :offset-assert 204) + ) + :method-count-assert 12 + :size-assert #xd8 + :flag-assert #xc000000d8 + (:methods + (continue-point-method-9 () none 9) + (continue-point-method-10 () none 10) + (continue-point-method-11 () none 11) + ) + ) + +(defmethod inspect continue-point ((obj continue-point)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tquat: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tcamera-trans: ~`vector`P~%" (-> obj camera-trans)) + (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> obj camera-rot)) + (format #t "~1Ton-goto: ~A~%" (-> obj on-goto)) + (format #t "~1Tvis-nick: ~A~%" (-> obj vis-nick)) + (format #t "~1Twant[6] @ #x~X~%" (-> obj want)) + (dotimes (s5-0 6) + (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> obj want s5-0)) + ) + (format #t "~1Twant-sound[3] @ #x~X~%" (-> obj want-sound)) + (dotimes (s5-1 3) + (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> obj want-sound s5-1)) + ) + obj + ) + +(deftype game-info (basic) + ((mode symbol :offset-assert 4) + (save-name basic :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 uint64 :offset-assert 128) + (debug-features uint64 :offset-assert 136) + (secrets uint32 :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 uint32 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 basic :offset-assert 244) + (unknown-pad3 uint32 3 :offset-assert 248) + (task-counter uint32 :offset-assert 260) + (unknown-pad4 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 basic :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 + :flag-assert #x1f0000025c + (:methods + (initialize! (_type_ symbol game-save string) _type_ 9) + (game-info-method-10 () none 10) + (game-info-method-11 () none 11) + (game-info-method-12 () none 12) + (game-info-method-13 () none 13) + (game-info-method-14 () none 14) + (game-info-method-15 () none 15) + (copy-perms-from-level! (_type_ level) none 16) + (copy-perms-to-level! (_type_ level) none 17) + (game-info-method-18 () none 18) + (game-info-method-19 () none 19) + (game-info-method-20 () none 20) + (set-continue! (_type_ basic) continue-point 21) + (game-info-method-22 () none 22) + (game-info-method-23 () none 23) + (game-info-method-24 () none 24) + (game-info-method-25 () none 25) + (game-info-method-26 () none 26) + (get-next-attack-id (_type_) uint 27) + (game-info-method-28 () none 28) + (game-info-method-29 () none 29) + (game-info-method-30 () none 30) + ) + ) + + +(defmethod get-next-attack-id game-info ((obj game-info)) + (let ((v0-0 (+ (-> obj attack-id) 1))) + (set! (-> obj attack-id) v0-0) + v0-0 + ) + ) + +(define-extern *game-info* game-info) +(when (or (not *game-info*) (zero? *game-info*)) + (let ((gp-0 (new 'static 'game-info :mode 'debug :current-continue #f :last-continue #f))) + (set! (-> gp-0 unknown-array1) (the-as (array uint64) (new 'global 'boxed-array uint64 110))) + (set! (-> gp-0 unknown-array4) (the-as (array uint64) (new 'global 'boxed-array uint64 110))) + (set! (-> gp-0 unknown-array2) (the-as (array uint64) (new 'global 'boxed-array uint64 32))) + (set! (-> gp-0 unknown-array3) (the-as (array uint64) (new 'global 'boxed-array uint64 32))) + (set! *game-info* gp-0) + ) + ) + +(declare-type process-drawable process) +(define-extern process-drawable-art-error (state string process-drawable)) +(define-extern part-group-pointer? (function pointer symbol)) diff --git a/goal_src/jak2/engine/game/main-h.gc b/goal_src/jak2/engine/game/main-h.gc index 7a9ab66716..be1d877a98 100644 --- a/goal_src/jak2/engine/game/main-h.gc +++ b/goal_src/jak2/engine/game/main-h.gc @@ -7,3 +7,209 @@ ;; DECOMP BEGINS +;; engine debug settings +(define *stats-poly* #f) +(define *stats-memory* #f) +(define *stats-memory-short* #f) +(define *stats-memory-level-index* 0) +(define *stats-collide* #f) +(define *stats-bsp* #f) +(define *stats-buffer* #f) +(define *stats-target* #f) +(define *stats-profile-bars* #f) +(define *stats-perf* #f) +(define *artist-all-visible* #f) +(define *artist-flip-visible* #f) +(define *artist-fix-visible* #f) +(define *artist-fix-frustum* #f) +(define *artist-error-spheres* #f) +(define *artist-use-menu-subdiv* #f) +(define *display-profile* #t) +(define *display-sidekick-stats* #f) +(define *display-quad-stats* #f) +(define *display-tri-stats* #f) +(define *display-ground-stats* #f) +(define *display-collision-marks* #f) +(define *display-collide-cache* #f) +(define *display-render-collision* #f) +(define *display-hipri-collision-marks* #f) +(define *display-edge-collision-marks* #f) +(define *display-geo-marks* #f) +(define *display-target-marks* #f) +(define *target-rc-board-controls* #f) +(define *display-collide-history* 0) +(define *display-xyz-axes* #f) +(define *display-cam-collide-history* #f) +(define *record-cam-collide-history* #f) +(define *display-cam-master-marks* #f) +(define *display-cam-other* #f) +(define *display-camera-marks* #f) +(define *camera-no-mip-correction* #f) +(define *display-cam-los-info* #f) +(define *display-cam-los-debug* #f) +(define *display-cam-los-marks* #f) +(define *display-cam-coll-marks* #f) +(define *display-camera-info* #f) +(define *display-camera-old-stats* #f) +(define *display-camera-last-attacker* #f) +(define *display-file-info* #f) +(define *display-actor-marks* #f) +(define *display-sprite-info* #f) +(define *display-sprite-marks* #f) +(define *display-sprite-spheres* #f) +(define *display-entity-errors* #t) +(define *display-instance-info* #f) +(define *display-deci-count* #f) +(define *sync-dma* #f) +(define *display-strip-lines* 0) +(define *display-battle-marks* #f) +(define *display-joint-axes* #f) +(define *display-nav-marks* #f) +(define *display-nav-network* #f) +(define *display-path-marks* #f) +(define *display-vol-marks* #f) +(define *display-water-marks* #f) +(define *display-nav-mesh* #f) +(define *display-actor-pointer* #f) +(define *display-actor-vis* #f) +(define *display-actor-graph* #f) +(define *display-traffic-height-map* #f) +(define *display-trail-graph* #f) +(define *display-color-bars* #f) +(define *display-bug-report* #f) +(define *display-level-border* #f) +(define *display-memcard-info* #f) +(define *display-split-boxes* #f) +(define *display-split-box-info* #f) +(define *display-texture-distances* #f) +(define *display-texture-download* #f) +(define *display-art-control* #f) +(define *display-gui-control* #f) +(define *display-level-spheres* #f) +(define *time-of-day-fast* #f) +(define *display-iop-info* #f) +(define *ambient-sound-class* #t) +(define *slow-frame-rate* #f) +(define *display-region-marks* #f) +(define *execute-regions* #t) +(define *debug-pause* #f) +(define *debug-view-anims* #f) +(define *debug-unkillable* #f) +(define *debug-actor* (the-as object #f)) +(define *gun-marks* #f) +(define *bug-report-output-mode* + (if *debug-segment* + 'file-stream + '*stdcon* + ) + ) +(define *display-scene-control* 0) +(define *display-bot-marks* 0) +(define *display-race-marks* 0) +(define *race-record-path* #f) +(define *select-race* 0) +(define *select-race-path* 0) +(define *bot-record-path* -1) +(define *subdivide-draw-mode* 0) +(define *subdivide-scissor-draw-mode* 0) +(define *subdivide-foreground-draw-mode* 0) +(define *subdivide-ocean-draw-mode* 0) +(define *ocean-height-hack* 0) + +;; Main Loop stuff +(define-perm *dproc* process #f) ;; the main display process +(define *run* #f) ;; should we run the main loop? +(define *teleport* #f) ;; did we just teleport locations? +;; set to a nonzero amount to apply the *teleport* for several frames. +(define *teleport-count* 0) + +;; main hooks to call from the main loop + +;; hook for rendering system +(define *draw-hook* nothing) + +;; hook for various debug functions that should run separately from everything else +(define *debug-hook* '()) + +;; hook to draw the debug menu +(declare-type debug-menu-context basic) +(define *menu-hook* (the-as (function debug-menu-context) nothing)) + +;; hook to run the progress menu +(define *progress-hook* nothing) + +;; function to call if main DMA times out, to try to recover +(define *dma-timeout-hook* nothing) + +;; unused? +(deftype frame-stats (structure) + ((field-time time-frame 2 :offset-assert 0) + (field int32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) +(define *frame-stats* (new 'static 'frame-stats)) + + +(deftype screen-filter (basic) + ((draw? symbol :offset-assert 4) + (bucket bucket-id :offset-assert 8) + (color vector :inline :offset-assert 16) + (color-src vector :inline :offset-assert 32) + (color-dest vector :inline :offset-assert 48) + (extra vector :inline :offset-assert 64) + (speed float :offset 64) + (current-interp float :offset 68) + ) + :method-count-assert 12 + :size-assert #x50 + :flag-assert #xc00000050 + (:methods + (draw (_type_) none 9) + (setup (_type_ vector vector float bucket-id) none 10) + (disable (_type_) none 11) + ) + ) + +;; collision renderer settings. +(deftype col-rend (basic) + ((draw? symbol :offset-assert 4) + (outline? symbol :offset-assert 8) + (show-back-faces? symbol :offset-assert 12) + (show-normals? symbol :offset-assert 16) + (ghost-hidden? symbol :offset-assert 20) + (show-only uint32 :offset-assert 24) + (cspec uint32 :offset-assert 28) + (track uint8 :offset-assert 32) + (bbox-radius float :offset-assert 36) + (bbox-center vector :inline :offset-assert 48) + (camera-to-bbox-dist float :offset-assert 64) + ) + :method-count-assert 10 + :size-assert #x44 + :flag-assert #xa00000044 + (:methods + (col-rend-method-9 () none 9) + ) + ) + +(define *col-rend* (new 'static 'col-rend + :draw? #f + :outline? #t + :show-back-faces? #t + :show-normals? #f + :ghost-hidden? #t + :cspec #x38 + :track #x1 + :bbox-radius 24576.0 + :camera-to-bbox-dist 65536.0 + ) + ) + + +(defun-debug debug-actor? ((arg0 object)) + (= arg0 *debug-actor*) + ) + diff --git a/goal_src/jak2/engine/game/penetrate-h.gc b/goal_src/jak2/engine/game/penetrate-h.gc index c999a935af..1e78c62228 100644 --- a/goal_src/jak2/engine/game/penetrate-h.gc +++ b/goal_src/jak2/engine/game/penetrate-h.gc @@ -5,5 +5,154 @@ ;; name in dgo: penetrate-h ;; dgos: ENGINE, GAME +(defenum penetrate + :bitfield #t + :type uint64 + (touch 0) ;; 1 + (generic-attack 1) ;; 2 + (lunge 2) ;; 4 + (flop 3) ;; 8 + (punch 4) ;; 16 + (spin 5) ;; 32 + (roll 6) ;; 64 + (uppercut 7) ;; 128 + (bonk 8) ;; 256 + (tube 9) ;; 512 + (vehicle 10) ;; 1024 + (flut-attack 11) ;; 2048 + (board 12) ;; 4096 + (mech 13) ;; 8192 + (mech-punch 14) ;; 16384 + (mech-bonk 15) ;; 32768 + (dark-skin 16) ;; hi 1 + (dark-punch 17) ;; hi 2 + (dark-bomb 18) ;; hi 4 + (dark-giant 19) ;; hi 8 + (shield 20) ;; hi 16 + (explode 21) ;; hi 32 + (jak-yellow-shot 22) ;; hi 64 + (jak-red-shot 23) ;; hi 128 + (jak-blue-shot 24) ;; hi 256 + (jak-dark-shot 25) ;; hi 512 + (enemy-yellow-shot 26) ;; hi 1024 + (enemy-dark-shot 27) ;; hi 2048 + (eco-yellow 28) ;; hi 4096 + (eco-red 29) ;; hi 8192 + (eco-blue 30) ;; hi 16384 + (eco-green 31) ;; hi 32768 + (knocked 32) ;; hihi 1 + ) + + ;; DECOMP BEGINS +(defun penetrate-using->damage ((arg0 penetrate)) + (cond + ((logtest? (penetrate dark-bomb dark-giant) arg0) + 15 + ) + ((logtest? arg0 (penetrate mech-punch mech-bonk)) + 5 + ) + ((logtest? (penetrate) arg0) + 4 + ) + ((logtest? (penetrate punch spin jak-dark-shot enemy-dark-shot) arg0) + 3 + ) + ((logtest? (penetrate + flop + uppercut + tube + flut-attack + dark-punch + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + enemy-yellow-shot + eco-yellow + ) + arg0 + ) + 2 + ) + ((logtest? arg0 (penetrate generic-attack roll bonk board)) + 1 + ) + (else + 0 + ) + ) + ) + +(defun penetrated-by-all&hit-points->penetrated-by ((arg0 penetrate) (arg1 int)) + (let ((a0-1 arg1)) + (the-as penetrate (logior (logclear arg0 (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + ) + (cond + ((or (zero? a0-1) (= a0-1 1)) + (the-as int (the-as uint #x11fffdffa)) + ) + ((= a0-1 2) + #x1feeceb8 + ) + ((= a0-1 3) + #xa0cc430 + ) + ((= a0-1 4) + #xcc400 + ) + ((= a0-1 5) + #xcc400 + ) + ((or (= a0-1 6) + (= a0-1 7) + (= a0-1 8) + (= a0-1 9) + (= a0-1 10) + (= a0-1 11) + (= a0-1 12) + (= a0-1 13) + (= a0-1 14) + (= a0-1 15) + ) + #xc0400 + ) + (else + 1024 + ) + ) + ) + ) + ) + ) + diff --git a/goal_src/jak2/engine/game/settings-h.gc b/goal_src/jak2/engine/game/settings-h.gc index 2ba8f6e913..c2fe7a9d35 100644 --- a/goal_src/jak2/engine/game/settings-h.gc +++ b/goal_src/jak2/engine/game/settings-h.gc @@ -7,3 +7,442 @@ ;; DECOMP BEGINS +(deftype user-setting-data (structure) + ((border-mode symbol :offset-assert 0) + (process-mask process-mask :offset-assert 4) + (language language-enum :offset 16) + (movie (pointer process) :offset 40) + (talking (pointer process) :offset-assert 44) + (spooling (pointer process) :offset-assert 48) + (hint (pointer process) :offset-assert 52) + (ambient (pointer process) :offset-assert 56) + (video-mode symbol :offset-assert 60) + (aspect-ratio symbol :offset-assert 64) + (auto-save symbol :offset 72) + (bg-r float :offset-assert 76) + (bg-g float :offset-assert 80) + (bg-b float :offset-assert 84) + (bg-a float :offset-assert 88) + (bg-a-speed float :offset-assert 92) + (bg-a-force float :offset-assert 96) + (allow-progress symbol :offset-assert 100) + (allow-pause symbol :offset-assert 104) + (movie-name symbol :offset 120) + (weather symbol :offset-assert 124) + (task-mask task-mask :offset 136) + (duck symbol :offset 144) + (attack symbol :offset-assert 148) + (gun symbol :offset-assert 152) + (board symbol :offset-assert 156) + (jump symbol :offset-assert 160) + (speed-mult float :offset-assert 164) + (features uint64 :offset-assert 168) + (sfx-volume float :offset-assert 176) + (sfx-movie-volume float :offset-assert 180) + (music-volume float :offset-assert 184) + (music-volume-movie float :offset-assert 188) + (dialog-volume float :offset-assert 192) + (dialog-volume-hint float :offset-assert 196) + (ambient-volume float :offset-assert 200) + (ambient-volume-move float :offset-assert 204) + (sound-flava uint8 :offset-assert 208) + (sound-flava-priority float :offset-assert 212) + (mode-sound-bank uint32 :offset-assert 216) + (sound-excitement float :offset-assert 220) + (sound-reverb float :offset-assert 224) + (stereo-mode int32 :offset-assert 228) + (music symbol :offset-assert 232) + (sound-stinger int32 :offset-assert 236) + (spool-anim symbol :offset-assert 240) + (sound-mode uint32 :offset-assert 244) + (task-manager (pointer process) :offset-assert 248) + (task symbol :offset-assert 252) + (airlock symbol :offset-assert 256) + (minimap uint16 :offset-assert 260) + (sound-tune uint32 :offset-assert 264) + (allow-continue symbol :offset-assert 268) + (spotlight-color rgba :offset-assert 272) + (subtitle symbol :offset-assert 276) + (borrow symbol :offset-assert 280) + (doorway symbol :offset-assert 284) + (gen symbol :offset-assert 288) + (half-speed symbol :offset-assert 292) + (gun-buoy symbol :offset-assert 296) + (double-jump symbol :offset-assert 300) + (pilot symbol :offset-assert 304) + (pilot-exit symbol :offset-assert 308) + (exclusive-task int32 :offset-assert 312) + (speech-control symbol :offset-assert 316) + (vehicle-hijacking symbol :offset-assert 320) + (darkjak symbol :offset-assert 324) + (endlessfall symbol :offset-assert 328) + (rain float :offset-assert 332) + (snow float :offset-assert 336) + (exclusive-load symbol :offset-assert 340) + (render symbol :offset-assert 344) + (allow-timeout symbol :offset-assert 348) + (mirror symbol :offset-assert 352) + (movie-skip-frame float :offset-assert 356) + (allow-blackout symbol :offset-assert 360) + (race-minimap int32 :offset-assert 364) + (extra-bank symbol :offset-assert 368) + (beard symbol :offset-assert 372) + (ignore-target symbol :offset-assert 376) + (subtitle-language language-enum :offset-assert 384) + (sound-bank-load symbol :offset-assert 392) + (allow-error symbol :offset-assert 396) + (under-water-pitch-mod float :offset-assert 400) + (dummy object 31 :offset-assert 404) + ) + :method-count-assert 11 + :size-assert #x210 + :flag-assert #xb00000210 + (:methods + (user-setting-data-method-9 () none 9) + (user-setting-data-method-10 () none 10) + ) + ) + +;; definition for method 3 of type user-setting-data +(defmethod inspect user-setting-data ((obj user-setting-data)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj 'user-setting-data) + (format #t "~1Tborder-mode: ~A~%" (-> obj border-mode)) + (format #t "~1Tprocess-mask: #x~X~%" (-> obj process-mask)) + (let ((t9-3 format) + (a0-4 #t) + (a1-3 "~1Tlanguage: #x~X : ~S~%") + (a2-3 (-> obj language)) + (v1-2 (-> obj language)) + ) + (t9-3 a0-4 a1-3 a2-3 (cond + ((= v1-2 (language-enum english)) + "english" + ) + ((= v1-2 (language-enum uk-english)) + "uk-english" + ) + ((= v1-2 (language-enum french)) + "french" + ) + ((= v1-2 (language-enum korean)) + "korean" + ) + ((= v1-2 (language-enum german)) + "german" + ) + ((= v1-2 (language-enum spanish)) + "spanish" + ) + ((= v1-2 (language-enum italian)) + "italian" + ) + ((= v1-2 (language-enum japanese)) + "japanese" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tmovie: ~A~%" (ppointer->process (-> obj movie))) + (format #t "~1Ttalking: ~A~%" (ppointer->process (-> obj talking))) + (format #t "~1Tspooling: ~A~%" (ppointer->process (-> obj spooling))) + (format #t "~1Thint: ~A~%" (ppointer->process (-> obj hint))) + (format #t "~1Tambient: ~A~%" (ppointer->process (-> obj ambient))) + (format #t "~1Tvideo-mode: ~A~%" (-> obj video-mode)) + (format #t "~1Taspect-ratio: ~A~%" (-> obj aspect-ratio)) + (format #t "~1Tauto-save: ~A~%" (-> obj auto-save)) + (format #t "~1Tbg-r: ~f~%" (-> obj bg-r)) + (format #t "~1Tbg-g: ~f~%" (-> obj bg-g)) + (format #t "~1Tbg-b: ~f~%" (-> obj bg-b)) + (format #t "~1Tbg-a: ~f~%" (-> obj bg-a)) + (format #t "~1Tbg-a-speed: ~f~%" (-> obj bg-a-speed)) + (format #t "~1Tbg-a-force: ~f~%" (-> obj bg-a-force)) + (format #t "~1Tallow-progress: ~A~%" (-> obj allow-progress)) + (format #t "~1Tallow-pause: ~A~%" (-> obj allow-pause)) + (format #t "~1Tmovie-name: ~A~%" (-> obj movie-name)) + (format #t "~1Tweather: ~A~%" (-> obj weather)) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) + (let ((s5-0 (-> obj task-mask))) + (if (= (logand s5-0 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-0 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-0 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-0 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-0 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-0 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-0) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-0 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-0 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-0 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-0 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-0 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-0 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-0) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-0 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-0 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-0 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-0) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-0 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Tduck: ~A~%" (-> obj duck)) + (format #t "~1Tattack: ~A~%" (-> obj attack)) + (format #t "~1Tgun: ~A~%" (-> obj gun)) + (format #t "~1Tboard: ~A~%" (-> obj board)) + (format #t "~1Tjump: ~A~%" (-> obj jump)) + (format #t "~1Tspeed-mult: ~f~%" (-> obj speed-mult)) + (format #t "~1Tfeatures: ~D~%" (-> obj features)) + (format #t "~1Tsfx-volume: ~f~%" (-> obj sfx-volume)) + (format #t "~1Tsfx-volume-movie: ~f~%" (-> obj sfx-movie-volume)) + (format #t "~1Tmusic-volume: ~f~%" (-> obj music-volume)) + (format #t "~1Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) + (format #t "~1Tdialog-volume: ~f~%" (-> obj dialog-volume)) + (format #t "~1Tdialog-volume-hint: ~f~%" (-> obj dialog-volume-hint)) + (format #t "~1Tambient-volume: ~f~%" (-> obj ambient-volume)) + (format #t "~1Tambient-volume-movie: ~f~%" (-> obj ambient-volume-move)) + (format #t "~1Tsound-flava: ~D~%" (-> obj sound-flava)) + (format #t "~1Tsound-flava-priority: ~f~%" (-> obj sound-flava-priority)) + (format #t "~1Tmode-sound-bank: ~A~%" (-> obj mode-sound-bank)) + (format #t "~1Tsound-excitement: ~f~%" (-> obj sound-excitement)) + (format #t "~1Tsound-reverb: ~f~%" (-> obj sound-reverb)) + (format #t "~1Tstereo-mode: ~D~%" (-> obj stereo-mode)) + (format #t "~1Tmusic: ~A~%" (-> obj music)) + (format #t "~1Tsound-stinger: ~D~%" (-> obj sound-stinger)) + (format #t "~1Tspool-anim: ~A~%" (-> obj spool-anim)) + (format #t "~1Tsound-mode: ~D~%" (-> obj sound-mode)) + (format #t "~1Ttask-manager: ~A~%" (ppointer->process (-> obj task-manager))) + (format #t "~1Ttask: ~A~%" (-> obj task)) + (format #t "~1Tairlock: ~A~%" (-> obj airlock)) + (format #t "~1Tminimap: ~D~%" (-> obj minimap)) + (format #t "~1Tsound-tune: ~D~%" (-> obj sound-tune)) + (format #t "~1Tallow-continue: ~A~%" (-> obj allow-continue)) + (format #t "~1Tspotlight-color: ~D~%" (-> obj spotlight-color)) + (format #t "~1Tsubtitle: ~A~%" (-> obj subtitle)) + (format #t "~1Tborrow: ~A~%" (-> obj borrow)) + (format #t "~1Tdoorway: ~A~%" (-> obj doorway)) + (format #t "~1Tgem: ~A~%" (-> obj gen)) + (format #t "~1Thalf-speed: ~A~%" (-> obj half-speed)) + (format #t "~1Tgun-buoy: ~A~%" (-> obj gun-buoy)) + (format #t "~1Tdouble-jump: ~A~%" (-> obj double-jump)) + (format #t "~1Tpilot: ~A~%" (-> obj pilot)) + (format #t "~1Tpilot-exit: ~A~%" (-> obj pilot-exit)) + (format #t "~1Texclusive-task: ~D~%" (-> obj exclusive-task)) + (format #t "~1Tspeech-control: ~A~%" (-> obj speech-control)) + (format #t "~1Tvehicle-hijacking: ~A~%" (-> obj vehicle-hijacking)) + (format #t "~1Tdarkjak: ~A~%" (-> obj darkjak)) + (format #t "~1Tendlessfall: ~A~%" (-> obj endlessfall)) + (format #t "~1Train: ~f~%" (-> obj rain)) + (format #t "~1Tsnow: ~f~%" (-> obj snow)) + (format #t "~1Texclusive-load: ~A~%" (-> obj exclusive-load)) + (format #t "~1Trender: ~A~%" (-> obj render)) + (format #t "~1Tallow-timeout: ~A~%" (-> obj allow-timeout)) + (format #t "~1Tmirror: ~A~%" (-> obj mirror)) + (format #t "~1Tmovie-skip-frame: ~f~%" (-> obj movie-skip-frame)) + (format #t "~1Tallow-blackout: ~A~%" (-> obj allow-blackout)) + (format #t "~1Trace-minimap: ~D~%" (-> obj race-minimap)) + (format #t "~1Textra-bank: ~A~%" (-> obj extra-bank)) + (format #t "~1Tbeard: ~A~%" (-> obj beard)) + (format #t "~1Tignore-target: ~A~%" (-> obj ignore-target)) + (format #t "~1Tsubtitle-language: ~D~%" (-> obj subtitle-language)) + (format #t "~1Tsound-bank-load: ~A~%" (-> obj sound-bank-load)) + (format #t "~1Tallow-error: ~A~%" (-> obj allow-error)) + (format #t "~1Tunder-water-pitch-mod: ~f~%" (-> obj under-water-pitch-mod)) + (format #t "~1Tdummy[31] @ #x~X~%" (-> obj dummy)) + obj + ) + +(defenum cam-slave-options + :type uint64 + :bitfield #t + (BUTT_CAM) + (SAME_SIDE) + (MOVE_SPHERICAL) + (ALLOW_Z_ROT) + (JUMP_PITCHES) + (COLLIDE) + (FIND_HIDDEN_TARGET) + (DRAG) + (PLAYER_MOVING_CAMERA) + (LINE_OF_SIGHT) + (MOVEMENT_BLOCKED) + (SHRINK_MAX_ANGLE) + (GOTO_GOOD_POINT) + (BIKE_MODE) + (NO_ROTATE) + (STICKY_ANGLE) + (BLOCK_RIGHT_STICK) + (ALLOW_SHIFT_BUTTONS) + (GUN_CAM) + (WIDE_FOV) + (RAPID_TRACKING) + (EASE_SPLINE_IDX) + (VERTICAL_FOLLOW_MATCHES_CAMERA) + (HAVE_BUTT_HANDLE) + ) + +(defenum cam-master-options + :type uint64 + :bitfield #t + (HAVE_TARGET) ;; 1 + (SET_COMBINER_AXIS) ;; 2 + (FLIP_COMBINER) ;; 4 + (HAVE_EASE_TO_POS) ;; 8 + (IN_BASE_REGION) ;; 10 + (IGNORE_ANALOG) ;; 20 + (READ_BUTTONS) ;; 40 + (IMMEDIATE_STRING_MIN_MAX) ;; 80 + ) + +(deftype cam-setting-data (structure) + ((fov degrees :offset-assert 0) + (pov-handle handle :offset 16) + (pov-bone int32 :offset-assert 24) + (pov-offset vector :inline :offset-assert 32) + (string-default symbol :offset-assert 48) + (string-max-length meters :offset-assert 52) + (string-min-length meters :offset-assert 56) + (string-max-height meters :offset-assert 60) + (string-min-height meters :offset-assert 64) + (string-cliff-height meters :offset-assert 68) + (string-camera-ceiling meters :offset-assert 72) + (gun-max-height meters :offset-assert 76) + (gun-min-height meters :offset-assert 80) + (string-local-down vector :inline :offset-assert 96) + (slave-options cam-slave-options :offset-assert 112) + (matrix-blend-max-angle degrees :offset-assert 120) + (matrix-blend-max-partial float :offset-assert 124) + (string-spline-max-move meters :offset-assert 128) + (string-spline-accel meters :offset-assert 132) + (string-spline-max-move-player meters :offset-assert 136) + (string-spline-accel-player meters :offset-assert 140) + (string-startup-vector vector :inline :offset-assert 144) + (string-use-startup-vector symbol :offset-assert 160) + (look-at-point vector :inline :offset-assert 176) + (use-look-at-point symbol :offset-assert 192) + (target-height meters :offset-assert 196) + (foot-offset meters :offset-assert 200) + (head-offset meters :offset-assert 204) + (teleport-on-entity-change symbol :offset-assert 208) + (entity-name string :offset-assert 212) + (entity-or-mode-changed symbol :offset-assert 216) + (master-options cam-master-options :offset-assert 224) + (entity-mask uint32 :offset-assert 232) + (mode-name symbol :offset-assert 236) + (real-entity-name string :offset-assert 240) + (cam-mode symbol :offset-assert 244) + (interp-time uint32 :offset-assert 248) + (no-intro symbol :offset-assert 252) + (use-point-of-interest symbol :offset-assert 256) + (point-of-interest vector :inline :offset-assert 272) + (handle-of-interest handle :offset-assert 288) + (mouse-tumble-point vector :inline :offset-assert 304) + (use-mouse-tumble-point symbol :offset-assert 320) + (mouse-input symbol :offset-assert 324) + (cpad1-skip-buttons symbol :offset-assert 328) + (butt-handle handle :offset-assert 336) + (butt-angle float :offset-assert 344) + (extra-follow-height float :offset-assert 348) + (1Tinterp-time-priority uint32 :offset-assert 352) + (string-max-length-default symbol :offset-assert 356) + (string-min-length-default symbol :offset-assert 360) + (string-max-height-default symbol :offset-assert 364) + (string-min-height-default symbol :offset-assert 368) + (dummy object 102 :offset-assert 372) + ) + :method-count-assert 11 + :size-assert #x30c + :flag-assert #xb0000030c + (:methods + (cam-setting-data-method-9 () none 9) + (cam-setting-data-method-10 () none 10) + ) + ) + +(deftype setting-control (basic) + ((user-current user-setting-data :inline :offset-assert 16) + (user-target user-setting-data :inline :offset-assert 544) + (user-default user-setting-data :inline :offset-assert 1072) + (cam-current cam-setting-data :inline :offset-assert 1600) + (cam-target cam-setting-data :inline :offset-assert 2384) + (cam-default cam-setting-data :inline :offset-assert 3168) + (engine engine :offset-assert 3948) + (engine-pers basic :offset-assert 3952) + (engine-hi basic :offset-assert 3956) + (sound-stinger-time time-frame :offset-assert 3960) + (sound-stinger-change-time time-frame 4 :offset-assert 3968) + (sound-excitement-change-time time-frame :offset-assert 4000) + (sound-excitement-targ float :offset-assert 4008) + (sound-excitement-level uint32 :offset-assert 4012) + ) + :method-count-assert 19 + :size-assert #xfb0 + :flag-assert #x1300000fb0 + (:methods + (new (symbol type int) _type_ 0) + (setting-control-method-9 () none 9) + (setting-control-method-10 () none 10) + (setting-control-method-11 () none 11) + (setting-control-method-12 () none 12) + (setting-control-method-13 () none 13) + (setting-control-method-14 () none 14) + (setting-control-method-15 () none 15) + (setting-control-method-16 () none 16) + (setting-control-method-17 () none 17) + (update (_type_) none 18) + ) + ) + + +(defmethod new setting-control ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s4-0 engine) ((method-of-type engine new) allocation engine 'setting-control arg0 connection)) + (set! (-> s4-0 engine-hi) ((method-of-type engine new) allocation engine 'setting-control arg0 connection)) + (set! (-> s4-0 engine-pers) + ((method-of-type engine-pers new) allocation engine-pers 'setting-control arg0 connection-pers) + ) + s4-0 + ) + ) + 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 bb181b67c6..2894f8c3c7 100644 --- a/goal_src/jak2/engine/game/task/task-control-h.gc +++ b/goal_src/jak2/engine/game/task/task-control-h.gc @@ -5,5 +5,1714 @@ ;; name in dgo: task-control-h ;; dgos: ENGINE, GAME + +(defenum game-task + :type uint8 + :bitfield #f + (none 0) + (complete 1) + (dummy0 2) + (eco-blue-button 3) + (eco-yellow-button 4) + (eco-red-button 5) + (fortress-escape 6) + (city-help-kid 7) + (city-vehicle-training 8) + (ruins-tower 9) + (atoll-water 10) + (fortress-dump 11) + (city-krew-delivery 12) + (city-red-gun-training 13) + (atoll-sig 14) + (sewer-enemy 15) + (strip-rescue 16) + (atoll-battle 17) + (mountain-lens 18) + (mountain-gear 19) + (mountain-shard 20) + (mountain-collection 21) + (city-keira-delivery 22) + (stadium-board1 23) + (city-krew-collection 24) + (city-yellow-gun-training 25) + (drill-eggs 26) + (city-power 27) + (palace-cable 28) + (palace-boss 29) + (city-shuttle 30) + (ruins-enemy 31) + (city-blue-gun-training 32) + (forest-scouts 33) + (city-escort-kid 34) + (dig-knock-down 35) + (strip-grenade 36) + (drill-ship 37) + (city-port-run 38) + (city-meet-brutter 39) + (sewer-board 40) + (forest-hunt 41) + (city-intercept-tanker 42) + (stadium-race-class3 43) + (city-protect-water-slums 44) + (dig-find-totem 45) + (city-destroy-guard-vehicles 46) + (city-play-onin-game 47) + (canyon-insert-items 48) + (tomb-poles 49) + (tomb-water 50) + (tomb-boss 51) + (fortress-save-friends 52) + (sewer-escort 53) + (city-dark-gun-training 54) + (stadium-race-class2 55) + (city-stop-bomb-bots 56) + (city-errol-challenge 57) + (strip-drop 58) + (ruins-mech 59) + (forest-protect 60) + (drill-mech 61) + (city-save-lurkers 62) + (stadium-race-class 63) + (palace-sneak-in 64) + (castle-break-in 65) + (castle-boss 66) + (city-whack 67) + (under-mech 68) + (under-sig 69) + (city-defend-stadium 70) + (consite-find-baron 71) + (nest-get-to-gun 72) + (nest-enter 73) + (nest-boss 74) + (city-win 75) + (city-oracle 76) + (city-burning-bush-ring-1 77) + (city-burning-bush-get-to-1 78) + (city-burning-bush-get-to-2 79) + (city-burning-bush-get-to-3 80) + (city-burning-bush-get-to-4 81) + (city-burning-bush-collection-1 82) + (city-burning-bush-racepoint-1 83) + (city-burning-bush-ring-2 84) + (city-burning-bush-get-to-5 85) + (city-burning-bush-get-to-6 86) + (city-burning-bush-shuttle-1 87) + (city-burning-bush-get-to-7 88) + (city-burning-bush-get-to-8 89) + (city-burning-bush-get-to-9 90) + (city-burning-bush-collection-2 91) + (city-burning-bush-get-to-10 92) + (city-burning-bush-get-to-11 93) + (city-burning-bush-ring-3 94) + (city-burning-bush-get-to-12 95) + (city-burning-bush-bombbot-1 96) + (city-burning-bush-get-to-13 97) + (city-burning-bush-get-to-14 98) + (city-burning-bush-get-to-15 99) + (city-burning-bush-collection-3 100) + (city-burning-bush-race-errol 101) + (city-burning-bush-race-port 102) + (stadium-burning-bush-race-board 103) + (stadium-burning-bush-race-class3 104) + (stadium-burning-bush-race-class2 105) + (stadium-burning-bush-race-class1 106) + (stadium-burning-bush-race-class3-r 107) + (stadium-burning-bush-race-class2-r 108) + (stadium-burning-bush-race-class1-r 109) + (max 110) + ) + +(defenum game-task-actor + :bitfield #f + :type uint8 + (none 0) + (minimap 1) + (torn-hideout 2) + (torn-alley 3) + (kor-alley 4) + (kor-vinroom 5) + (kor-tomb 6) + (krew-hiphog 7) + (sig-hiphog 8) + (sig-atoll 9) + (keira-garage 10) + (vin-vinroom 11) + (ashelin-atoll 12) + (ashelin-market 13) + (onin-onintent 14) + (pecker-onintent 15) + (baron-palace 16) + (baron-tomb 17) + (youngsamos-hideout 18) + (youngsamos-tomb 19) + (brutter-kiosk 20) + (kid-tomb 21) + (youngsamos-alley 22) + (kid-alley 23) + (crocadog-alley 24) + (crocadog-tomb 25) + (youngsamos-forest 26) + (ashelin-throne 27) + (baron-castle 28) + (tess-alley 29) + (youngsamos-onintent 30) + (samos-hideout 31) + (burning-bush-slumb 32) + (burning-bush-gena 33) + (burning-bush-genc 34) + (tess-hiphog 35) + (keira-stadium 36) + (kor-consite 37) + (kor-onintent 38) + (oracle-oracle 39) + (daxter-tomb 40) + (burning-bush-marka 41) + (burning-bush-sluma 42) + (burning-bush-slumb-2 43) + (burning-bush-slumc 44) + (burning-bush-farma 45) + (burning-bush-farmb 46) + (burning-bush-markb 47) + (burning-bush-markb-2 48) + (burning-bush-gena-2 49) + (burning-bush-genb 50) + (burning-bush-genc-2 51) + (burning-bush-inda 52) + (burning-bush-indb 53) + (burning-bush-port 54) + (burning-bush-port-2 55) + (burning-bush-port-3 56) + (burning-bush-pal 57) + (burning-bush-stadium 58) + (burning-bush-pal-2 59) + (burning-bush-genb-2 60) + (kor-hideout 61) + (kid-hideout 62) + (kid-vinroom 63) + (crocadog-vinroom 64) + (samos-garage 65) + (baron-consite 66) + (whack-a-metal-hiphog 67) + ) + +(defenum game-task-action + :bitfield #f + :type uint8 + (hide 0) + (idle 1) + (say 2) + (talk 3) + (show 4) + (shade 5) + (play 6) + (menu 7) + ) + +(defenum game-task-flags + :type uint8 + ) + +(defenum game-task-icon + :type uint16 + ) + +(defenum task-manager-mask + :type uint32 + :bitfield #t + (intro-scene 0) ;; 1 + (resolution-scene 1) ;; 2 + (begin-sphere 2) ;; 4 + (end-sphere 3) ;; 8 + (fail-message 4) ;; 16 + (retry-message 5) ;; 32 + ) + +(defenum game-task-node-flag + :type uint32 ;; guess + :bitfield #t + + (closed 0) ;; 1 + (auto-close 1) ;; 2 + (data 2) ;; 4 + (close-task 3) ;; 8 + (save-on-life 4) ;; 16 + (save-on-try 5) ;; 32 + (abs-task-mask 6) ;; 64 + (set-task-mask 7) ;; 128 + (clear-task-mask 8) ;; 256 + (task-retry 9) ;; 512 + (exclusive 10) ;; 1024 + (intro-wait 11) ;; 2048 + (city-wait 12) ;; 4096 + (reset-on-try 13) ;; 8192 + (task-manager 14) ;; 16384 + (no-fail-on-death 15) ;; 32768 + (no-restart 16) ;; 1 + (no-audio 17) ;; 2 + (no-slow-down 18) ;; #4 high + (utility-node 19) ;; #x8 high + ) + +(defenum game-task-node-command + :type uint8 ;; guess + :bitfield #f + (none 0) + (add-sidekick 1) + (sub-sidekick 2) + (add-board 3) + (sub-board 4) + (add-gun-red 5) + (add-gun-yellow 6) + (add-gun-blue 7) + (add-gun-dark 8) + (add-gun-up-1 9) + (add-gun-up-2 10) + (add-gun-up-3 11) + (add-gun-up-4 12) + (add-pass-red 13) + (add-pass-green 14) + (add-pass-yellow 15) + (add-pass-blue 16) + (add-darkjak 17) + (add-darkjak-0 18) + (add-darkjak-1 19) + (add-darkjak-2 20) + (add-darkjak-3 21) + (add-board-training 22) + ) + ;; DECOMP BEGINS +(defun-debug game-task->string ((arg0 game-task)) + (case arg0 + (((game-task forest-protect)) + "forest-protect" + ) + (((game-task strip-drop)) + "strip-drop" + ) + (((game-task fortress-dump)) + "fortress-dump" + ) + (((game-task ruins-tower)) + "ruins-tower" + ) + (((game-task city-burning-bush-race-errol)) + "city-burning-bush-race-errol" + ) + (((game-task canyon-insert-items)) + "canyon-insert-items" + ) + (((game-task city-win)) + "city-win" + ) + (((game-task city-burning-bush-get-to-5)) + "city-burning-bush-get-to-5" + ) + (((game-task tomb-water)) + "tomb-water" + ) + (((game-task stadium-race-class3)) + "stadium-race-class3" + ) + (((game-task city-burning-bush-ring-2)) + "city-burning-bush-ring-2" + ) + (((game-task eco-blue-button)) + "eco-blue-button" + ) + (((game-task stadium-burning-bush-race-class1-r)) + "stadium-burning-bush-race-class1-r" + ) + (((game-task ruins-enemy)) + "ruins-enemy" + ) + (((game-task city-burning-bush-shuttle-1)) + "city-burning-bush-shuttle-1" + ) + (((game-task eco-red-button)) + "eco-red-button" + ) + (((game-task city-burning-bush-ring-1)) + "city-burning-bush-ring-1" + ) + (((game-task city-krew-delivery)) + "city-krew-delivery" + ) + (((game-task stadium-burning-bush-race-class3-r)) + "stadium-burning-bush-race-class3-r" + ) + (((game-task stadium-burning-bush-race-class3)) + "stadium-burning-bush-race-class3" + ) + (((game-task city-burning-bush-get-to-15)) + "city-burning-bush-get-to-15" + ) + (((game-task city-help-kid)) + "city-help-kid" + ) + (((game-task under-mech)) + "under-mech" + ) + (((game-task city-escort-kid)) + "city-escort-kid" + ) + (((game-task mountain-gear)) + "mountain-gear" + ) + (((game-task max)) + "max" + ) + (((game-task city-defend-stadium)) + "city-defend-stadium" + ) + (((game-task city-burning-bush-get-to-12)) + "city-burning-bush-get-to-12" + ) + (((game-task city-burning-bush-bombbot-1)) + "city-burning-bush-bombbot-1" + ) + (((game-task drill-ship)) + "drill-ship" + ) + (((game-task city-yellow-gun-training)) + "city-yellow-gun-training" + ) + (((game-task sewer-enemy)) + "sewer-enemy" + ) + (((game-task palace-cable)) + "palace-cable" + ) + (((game-task city-burning-bush-get-to-10)) + "city-burning-bush-get-to-10" + ) + (((game-task castle-break-in)) + "castle-break-in" + ) + (((game-task tomb-poles)) + "tomb-poles" + ) + (((game-task city-vehicle-training)) + "city-vehicle-training" + ) + (((game-task sewer-escort)) + "sewer-escort" + ) + (((game-task city-errol-challenge)) + "city-errol-challenge" + ) + (((game-task strip-grenade)) + "strip-grenade" + ) + (((game-task atoll-sig)) + "atoll-sig" + ) + (((game-task stadium-burning-bush-race-class1)) + "stadium-burning-bush-race-class1" + ) + (((game-task nest-boss)) + "nest-boss" + ) + (((game-task forest-hunt)) + "forest-hunt" + ) + (((game-task stadium-race-class2)) + "stadium-race-class2" + ) + (((game-task city-play-onin-game)) + "city-play-onin-game" + ) + (((game-task city-burning-bush-collection-2)) + "city-burning-bush-collection-2" + ) + (((game-task none)) + "none" + ) + (((game-task eco-yellow-button)) + "eco-yellow-button" + ) + (((game-task drill-eggs)) + "drill-eggs" + ) + (((game-task city-burning-bush-get-to-2)) + "city-burning-bush-get-to-2" + ) + (((game-task city-burning-bush-racepoint-1)) + "city-burning-bush-racepoint-1" + ) + (((game-task city-burning-bush-get-to-11)) + "city-burning-bush-get-to-11" + ) + (((game-task under-sig)) + "under-sig" + ) + (((game-task stadium-burning-bush-race-class2)) + "stadium-burning-bush-race-class2" + ) + (((game-task stadium-burning-bush-race-board)) + "stadium-burning-bush-race-board" + ) + (((game-task city-burning-bush-race-port)) + "city-burning-bush-race-port" + ) + (((game-task city-burning-bush-get-to-7)) + "city-burning-bush-get-to-7" + ) + (((game-task atoll-battle)) + "atoll-battle" + ) + (((game-task drill-mech)) + "drill-mech" + ) + (((game-task ruins-mech)) + "ruins-mech" + ) + (((game-task city-burning-bush-get-to-13)) + "city-burning-bush-get-to-13" + ) + (((game-task city-destroy-guard-vehicles)) + "city-destroy-guard-vehicles" + ) + (((game-task tomb-boss)) + "tomb-boss" + ) + (((game-task dummy0)) + "dummy0" + ) + (((game-task dig-find-totem)) + "dig-find-totem" + ) + (((game-task dig-knock-down)) + "dig-knock-down" + ) + (((game-task city-protect-water-slums)) + "city-protect-water-slums" + ) + (((game-task city-whack)) + "city-whack" + ) + (((game-task city-burning-bush-ring-3)) + "city-burning-bush-ring-3" + ) + (((game-task city-shuttle)) + "city-shuttle" + ) + (((game-task fortress-save-friends)) + "fortress-save-friends" + ) + (((game-task city-intercept-tanker)) + "city-intercept-tanker" + ) + (((game-task forest-scouts)) + "forest-scouts" + ) + (((game-task nest-get-to-gun)) + "nest-get-to-gun" + ) + (((game-task stadium-race-class)) + "stadium-race-class1" + ) + (((game-task stadium-burning-bush-race-class2-r)) + "stadium-burning-bush-race-class2-r" + ) + (((game-task palace-sneak-in)) + "palace-sneak-in" + ) + (((game-task strip-rescue)) + "strip-rescue" + ) + (((game-task city-burning-bush-get-to-1)) + "city-burning-bush-get-to-1" + ) + (((game-task consite-find-baron)) + "consite-find-baron" + ) + (((game-task city-burning-bush-get-to-3)) + "city-burning-bush-get-to-3" + ) + (((game-task stadium-board1)) + "stadium-board1" + ) + (((game-task city-burning-bush-get-to-4)) + "city-burning-bush-get-to-4" + ) + (((game-task city-burning-bush-collection-3)) + "city-burning-bush-collection-3" + ) + (((game-task city-port-run)) + "city-port-run" + ) + (((game-task sewer-board)) + "sewer-board" + ) + (((game-task city-dark-gun-training)) + "city-dark-gun-training" + ) + (((game-task city-oracle)) + "city-oracle" + ) + (((game-task city-burning-bush-collection-1)) + "city-burning-bush-collection-1" + ) + (((game-task city-keira-delivery)) + "city-keira-delivery" + ) + (((game-task city-burning-bush-get-to-6)) + "city-burning-bush-get-to-6" + ) + (((game-task mountain-lens)) + "mountain-lens" + ) + (((game-task atoll-water)) + "atoll-water" + ) + (((game-task city-stop-bomb-bots)) + "city-stop-bomb-bots" + ) + (((game-task mountain-collection)) + "mountain-collection" + ) + (((game-task nest-enter)) + "nest-enter" + ) + (((game-task city-burning-bush-get-to-9)) + "city-burning-bush-get-to-9" + ) + (((game-task mountain-shard)) + "mountain-shard" + ) + (((game-task city-power)) + "city-power" + ) + (((game-task complete)) + "complete" + ) + (((game-task palace-boss)) + "palace-boss" + ) + (((game-task castle-boss)) + "castle-boss" + ) + (((game-task city-burning-bush-get-to-8)) + "city-burning-bush-get-to-8" + ) + (((game-task city-blue-gun-training)) + "city-blue-gun-training" + ) + (((game-task fortress-escape)) + "fortress-escape" + ) + (((game-task city-red-gun-training)) + "city-red-gun-training" + ) + (((game-task city-save-lurkers)) + "city-save-lurkers" + ) + (((game-task city-krew-collection)) + "city-krew-collection" + ) + (((game-task city-burning-bush-get-to-14)) + "city-burning-bush-get-to-14" + ) + (((game-task city-meet-brutter)) + "city-meet-brutter" + ) + (else + "*unknown*" + ) + ) + ) + +(defun c-string->game-task ((arg0 string)) + (the-as game-task (cond + ((string= arg0 "GAME_TASK_FOREST_PROTECT") + 60 + ) + ((string= arg0 "GAME_TASK_STRIP_DROP") + 58 + ) + ((string= arg0 "GAME_TASK_FORTRESS_DUMP") + 11 + ) + ((string= arg0 "GAME_TASK_RUINS_TOWER") + 9 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RACE_ERROL") + 101 + ) + ((string= arg0 "GAME_TASK_CANYON_INSERT_ITEMS") + 48 + ) + ((string= arg0 "GAME_TASK_CITY_WIN") + 75 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_5") + 85 + ) + ((string= arg0 "GAME_TASK_TOMB_WATER") + 50 + ) + ((string= arg0 "GAME_TASK_STADIUM_RACE_CLASS3") + 43 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RING_2") + 84 + ) + ((string= arg0 "GAME_TASK_ECO_BLUE_BUTTON") + 3 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS1_R") + 109 + ) + ((string= arg0 "GAME_TASK_RUINS_ENEMY") + 31 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_SHUTTLE_1") + 87 + ) + ((string= arg0 "GAME_TASK_ECO_RED_BUTTON") + 5 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RING_1") + 77 + ) + ((string= arg0 "GAME_TASK_CITY_KREW_DELIVERY") + 12 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS3_R") + 107 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS3") + 104 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_15") + 99 + ) + ((string= arg0 "GAME_TASK_CITY_HELP_KID") + 7 + ) + ((string= arg0 "GAME_TASK_UNDER_MECH") + 68 + ) + ((string= arg0 "GAME_TASK_CITY_ESCORT_KID") + 34 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_GEAR") + 19 + ) + ((string= arg0 "GAME_TASK_MAX") + 110 + ) + ((string= arg0 "GAME_TASK_CITY_DEFEND_STADIUM") + 70 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_12") + 95 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_BOMBBOT_1") + 96 + ) + ((string= arg0 "GAME_TASK_DRILL_SHIP") + 37 + ) + ((string= arg0 "GAME_TASK_CITY_YELLOW_GUN_TRAINING") + 25 + ) + ((string= arg0 "GAME_TASK_SEWER_ENEMY") + 15 + ) + ((string= arg0 "GAME_TASK_PALACE_CABLE") + 28 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_10") + 92 + ) + ((string= arg0 "GAME_TASK_CASTLE_BREAK_IN") + 65 + ) + ((string= arg0 "GAME_TASK_TOMB_POLES") + 49 + ) + ((string= arg0 "GAME_TASK_CITY_VEHICLE_TRAINING") + 8 + ) + ((string= arg0 "GAME_TASK_SEWER_ESCORT") + 53 + ) + ((string= arg0 "GAME_TASK_CITY_ERROL_CHALLENGE") + 57 + ) + ((string= arg0 "GAME_TASK_STRIP_GRENADE") + 36 + ) + ((string= arg0 "GAME_TASK_ATOLL_SIG") + 14 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS1") + 106 + ) + ((string= arg0 "GAME_TASK_NEST_BOSS") + 74 + ) + ((string= arg0 "GAME_TASK_FOREST_HUNT") + 41 + ) + ((string= arg0 "GAME_TASK_STADIUM_RACE_CLASS2") + 55 + ) + ((string= arg0 "GAME_TASK_CITY_PLAY_ONIN_GAME") + 47 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_COLLECTION_2") + 91 + ) + ((string= arg0 "GAME_TASK_NONE") + 0 + ) + ((string= arg0 "GAME_TASK_ECO_YELLOW_BUTTON") + 4 + ) + ((string= arg0 "GAME_TASK_DRILL_EGGS") + 26 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_2") + 79 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RACEPOINT_1") + 83 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_11") + 93 + ) + ((string= arg0 "GAME_TASK_UNDER_SIG") + 69 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS2") + 105 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_BOARD") + 103 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RACE_PORT") + 102 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_7") + 88 + ) + ((string= arg0 "GAME_TASK_ATOLL_BATTLE") + 17 + ) + ((string= arg0 "GAME_TASK_DRILL_MECH") + 61 + ) + ((string= arg0 "GAME_TASK_RUINS_MECH") + 59 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_13") + 97 + ) + ((string= arg0 "GAME_TASK_CITY_DESTROY_GUARD_VEHICLES") + 46 + ) + ((string= arg0 "GAME_TASK_TOMB_BOSS") + 51 + ) + ((string= arg0 "GAME_TASK_DUMMY0") + 2 + ) + ((string= arg0 "GAME_TASK_DIG_FIND_TOTEM") + 45 + ) + ((string= arg0 "GAME_TASK_DIG_KNOCK_DOWN") + 35 + ) + ((string= arg0 "GAME_TASK_CITY_PROTECT_WATER_SLUMS") + 44 + ) + ((string= arg0 "GAME_TASK_CITY_WHACK") + 67 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RING_3") + 94 + ) + ((string= arg0 "GAME_TASK_CITY_SHUTTLE") + 30 + ) + ((string= arg0 "GAME_TASK_FORTRESS_SAVE_FRIENDS") + 52 + ) + ((string= arg0 "GAME_TASK_CITY_INTERCEPT_TANKER") + 42 + ) + ((string= arg0 "GAME_TASK_FOREST_SCOUTS") + 33 + ) + ((string= arg0 "GAME_TASK_NEST_GET_TO_GUN") + 72 + ) + ((string= arg0 "GAME_TASK_STADIUM_RACE_CLASS1") + 63 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS2_R") + 108 + ) + ((string= arg0 "GAME_TASK_PALACE_SNEAK_IN") + 64 + ) + ((string= arg0 "GAME_TASK_STRIP_RESCUE") + 16 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_1") + 78 + ) + ((string= arg0 "GAME_TASK_CONSITE_FIND_BARON") + 71 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_3") + 80 + ) + ((string= arg0 "GAME_TASK_STADIUM_BOARD1") + 23 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_4") + 81 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_COLLECTION_3") + 100 + ) + ((string= arg0 "GAME_TASK_CITY_PORT_RUN") + 38 + ) + ((string= arg0 "GAME_TASK_SEWER_BOARD") + 40 + ) + ((string= arg0 "GAME_TASK_CITY_DARK_GUN_TRAINING") + 54 + ) + ((string= arg0 "GAME_TASK_CITY_ORACLE") + 76 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_COLLECTION_1") + 82 + ) + ((string= arg0 "GAME_TASK_CITY_KEIRA_DELIVERY") + 22 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_6") + 86 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_LENS") + 18 + ) + ((string= arg0 "GAME_TASK_ATOLL_WATER") + 10 + ) + ((string= arg0 "GAME_TASK_CITY_STOP_BOMB_BOTS") + 56 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_COLLECTION") + 21 + ) + ((string= arg0 "GAME_TASK_NEST_ENTER") + 73 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_9") + 90 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_SHARD") + 20 + ) + ((string= arg0 "GAME_TASK_CITY_POWER") + 27 + ) + ((string= arg0 "GAME_TASK_COMPLETE") + 1 + ) + ((string= arg0 "GAME_TASK_PALACE_BOSS") + 29 + ) + ((string= arg0 "GAME_TASK_CASTLE_BOSS") + 66 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_8") + 89 + ) + ((string= arg0 "GAME_TASK_CITY_BLUE_GUN_TRAINING") + 32 + ) + ((string= arg0 "GAME_TASK_FORTRESS_ESCAPE") + 6 + ) + ((string= arg0 "GAME_TASK_CITY_RED_GUN_TRAINING") + 13 + ) + ((string= arg0 "GAME_TASK_CITY_SAVE_LURKERS") + 62 + ) + ((string= arg0 "GAME_TASK_CITY_KREW_COLLECTION") + 24 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_14") + 98 + ) + ((string= arg0 "GAME_TASK_CITY_MEET_BRUTTER") + 39 + ) + (else + -1 + ) + ) + ) + ) + +(defun-debug game-task-actor->string ((arg0 game-task-actor)) + (case arg0 + (((game-task-actor burning-bush-genc)) + "burning-bush-genc" + ) + (((game-task-actor minimap)) + "minimap" + ) + (((game-task-actor youngsamos-tomb)) + "youngsamos-tomb" + ) + (((game-task-actor youngsamos-onintent)) + "youngsamos-onintent" + ) + (((game-task-actor baron-consite)) + "baron-consite" + ) + (((game-task-actor burning-bush-markb)) + "burning-bush-markb" + ) + (((game-task-actor keira-garage)) + "keira-garage" + ) + (((game-task-actor burning-bush-genc-2)) + "burning-bush-genc-2" + ) + (((game-task-actor samos-garage)) + "samos-garage" + ) + (((game-task-actor kid-hideout)) + "kid-hideout" + ) + (((game-task-actor krew-hiphog)) + "krew-hiphog" + ) + (((game-task-actor burning-bush-port-2)) + "burning-bush-port-2" + ) + (((game-task-actor none)) + "none" + ) + (((game-task-actor burning-bush-port-3)) + "burning-bush-port-3" + ) + (((game-task-actor brutter-kiosk)) + "brutter-kiosk" + ) + (((game-task-actor tess-alley)) + "tess-alley" + ) + (((game-task-actor whack-a-metal-hiphog)) + "whack-a-metal-hiphog" + ) + (((game-task-actor burning-bush-gena)) + "burning-bush-gena" + ) + (((game-task-actor vin-vinroom)) + "vin-vinroom" + ) + (((game-task-actor kor-hideout)) + "kor-hideout" + ) + (((game-task-actor burning-bush-pal-2)) + "burning-bush-pal-2" + ) + (((game-task-actor kid-alley)) + "kid-alley" + ) + (((game-task-actor burning-bush-stadium)) + "burning-bush-stadium" + ) + (((game-task-actor ashelin-market)) + "ashelin-market" + ) + (((game-task-actor kid-tomb)) + "kid-tomb" + ) + (((game-task-actor burning-bush-farma)) + "burning-bush-farma" + ) + (((game-task-actor baron-tomb)) + "baron-tomb" + ) + (((game-task-actor burning-bush-slumc)) + "burning-bush-slumc" + ) + (((game-task-actor burning-bush-slumb-2)) + "burning-bush-slumb-2" + ) + (((game-task-actor baron-palace)) + "baron-palace" + ) + (((game-task-actor crocadog-alley)) + "crocadog-alley" + ) + (((game-task-actor baron-castle)) + "baron-castle" + ) + (((game-task-actor crocadog-vinroom)) + "crocadog-vinroom" + ) + (((game-task-actor burning-bush-gena-2)) + "burning-bush-gena-2" + ) + (((game-task-actor daxter-tomb)) + "daxter-tomb" + ) + (((game-task-actor burning-bush-port)) + "burning-bush-port" + ) + (((game-task-actor burning-bush-marka)) + "burning-bush-marka" + ) + (((game-task-actor crocadog-tomb)) + "crocadog-tomb" + ) + (((game-task-actor keira-stadium)) + "keira-stadium" + ) + (((game-task-actor sig-hiphog)) + "sig-hiphog" + ) + (((game-task-actor youngsamos-hideout)) + "youngsamos-hideout" + ) + (((game-task-actor burning-bush-genb-2)) + "burning-bush-genb-2" + ) + (((game-task-actor burning-bush-inda)) + "burning-bush-inda" + ) + (((game-task-actor kor-tomb)) + "kor-tomb" + ) + (((game-task-actor kor-consite)) + "kor-consite" + ) + (((game-task-actor torn-hideout)) + "torn-hideout" + ) + (((game-task-actor onin-onintent)) + "onin-onintent" + ) + (((game-task-actor kor-alley)) + "kor-alley" + ) + (((game-task-actor kid-vinroom)) + "kid-vinroom" + ) + (((game-task-actor ashelin-atoll)) + "ashelin-atoll" + ) + (((game-task-actor burning-bush-sluma)) + "burning-bush-sluma" + ) + (((game-task-actor burning-bush-slumb)) + "burning-bush-slumb" + ) + (((game-task-actor youngsamos-alley)) + "youngsamos-alley" + ) + (((game-task-actor youngsamos-forest)) + "youngsamos-forest" + ) + (((game-task-actor samos-hideout)) + "samos-hideout" + ) + (((game-task-actor burning-bush-genb)) + "burning-bush-genb" + ) + (((game-task-actor oracle-oracle)) + "oracle-oracle" + ) + (((game-task-actor torn-alley)) + "torn-alley" + ) + (((game-task-actor kor-onintent)) + "kor-onintent" + ) + (((game-task-actor tess-hiphog)) + "tess-hiphog" + ) + (((game-task-actor burning-bush-markb-2)) + "burning-bush-markb-2" + ) + (((game-task-actor ashelin-throne)) + "ashelin-throne" + ) + (((game-task-actor burning-bush-indb)) + "burning-bush-indb" + ) + (((game-task-actor pecker-onintent)) + "pecker-onintent" + ) + (((game-task-actor kor-vinroom)) + "kor-vinroom" + ) + (((game-task-actor sig-atoll)) + "sig-atoll" + ) + (((game-task-actor burning-bush-pal)) + "burning-bush-pal" + ) + (((game-task-actor burning-bush-farmb)) + "burning-bush-farmb" + ) + (else + "*unknown*" + ) + ) + ) + +(defun-debug game-task-action->string ((arg0 game-task-action)) + (case arg0 + (((game-task-action idle)) + "idle" + ) + (((game-task-action play)) + "play" + ) + (((game-task-action show)) + "show" + ) + (((game-task-action talk)) + "talk" + ) + (((game-task-action hide)) + "hide" + ) + (((game-task-action say)) + "say" + ) + (((game-task-action shade)) + "trade" + ) + (((game-task-action menu)) + "menu" + ) + (else + "*unknown*" + ) + ) + ) + +(deftype game-task-event (basic) + ((actor game-task-actor :offset-assert 4) + (action game-task-action :offset-assert 5) + (icon game-task-icon :offset 6) + (flags game-task-flags :offset 7) + (scene basic :offset 8) + (distance meters :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defmethod inspect game-task-event ((obj game-task-event)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) + (format #t "~1Taction: #x~X : ~S~%" (-> obj action) (game-task-action->string (-> obj action))) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ticon: ~D~%" (-> obj icon)) + (format #t "~1Tscene: ~A~%" (-> obj scene)) + (format #t "~1Tdistance: (meters ~m)~%" (-> obj distance)) + (label cfg-4) + obj + ) + +(deftype task-manager-info (structure) + ((mask task-manager-mask :offset-assert 0) + (level basic :offset-assert 4) + (manager handle :offset-assert 8) + (fail-message uint32 :offset-assert 16) + (retry-message uint32 :offset-assert 20) + (intro-scene basic :offset-assert 24) + (resolution-scene basic :offset-assert 28) + (resolution-scene-continue basic :offset-assert 32) + (retry-continue basic :offset-assert 36) + (fail-continue basic :offset-assert 40) + (init-hook basic :offset-assert 44) + (cleanup-hook basic :offset-assert 48) + (update-hook basic :offset-assert 52) + (code-hook basic :offset-assert 56) + (complete-hook basic :offset-assert 60) + (fail-hook basic :offset-assert 64) + (event-hook basic :offset-assert 68) + (final-node uint16 :offset-assert 72) + (time-limit int32 :offset-assert 76) + (sphere-count int8 :offset-assert 80) + (index int8 :offset-assert 81) + (intro-delay uint16 :offset-assert 82) + (sphere-array uint32 :offset-assert 84) + (on-complete basic :offset-assert 88) + (on-fail basic :offset-assert 92) + (begin-sphere sphere :inline :offset-assert 96) + (end-sphere sphere :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(defmethod inspect task-manager-info ((obj task-manager-info)) + (when (not obj) + (set! obj obj) + (goto cfg-16) + ) + (format #t "[~8x] ~A~%" obj 'task-manager-info) + (format #t "~1Tmask: #x~X : (task-manager-mask " (-> obj mask)) + (let ((s5-0 (-> obj mask))) + (if (= (logand s5-0 (task-manager-mask intro-scene)) (task-manager-mask intro-scene)) + (format #t "intro-scene ") + ) + (if (= (logand s5-0 (task-manager-mask resolution-scene)) (task-manager-mask resolution-scene)) + (format #t "resolution-scene ") + ) + (if (= (logand s5-0 (task-manager-mask fail-message)) (task-manager-mask fail-message)) + (format #t "fail-message ") + ) + (if (= (logand s5-0 (task-manager-mask begin-sphere)) (task-manager-mask begin-sphere)) + (format #t "begin-sphere ") + ) + (if (= (logand s5-0 (task-manager-mask retry-message)) (task-manager-mask retry-message)) + (format #t "retry-message ") + ) + (if (= (logand s5-0 (task-manager-mask end-sphere)) (task-manager-mask end-sphere)) + (format #t "end-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tmanager: ~`handle`P~%" (-> obj manager)) + (format #t "~1Tfail-message: ~D~%" (-> obj fail-message)) + (format #t "~1Tretry-message: ~D~%" (-> obj retry-message)) + (format #t "~1Tintro-scene: ~A~%" (-> obj intro-scene)) + (format #t "~1Tresolution-scene: ~A~%" (-> obj resolution-scene)) + (format #t "~1Tresolution-scene-continue: ~A~%" (-> obj resolution-scene-continue)) + (format #t "~1Tretry-continue: ~A~%" (-> obj retry-continue)) + (format #t "~1Tfail-continue: ~A~%" (-> obj fail-continue)) + (format #t "~1Tinit-hook: ~A~%" (-> obj init-hook)) + (format #t "~1Tcleanup-hook: ~A~%" (-> obj cleanup-hook)) + (format #t "~1Tupdate-hook: ~A~%" (-> obj update-hook)) + (format #t "~1Tcode-hook: ~A~%" (-> obj code-hook)) + (format #t "~1Tcomplete-hook: ~A~%" (-> obj complete-hook)) + (format #t "~1Tfail-hook: ~A~%" (-> obj fail-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) + (format #t "~1Tfinal-node: ~D~%" (-> obj final-node)) + (format #t "~1Ttime-limit: ~D~%" (-> obj time-limit)) + (format #t "~1Tsphere-count: ~D~%" (-> obj sphere-count)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tintro-delay: ~D~%" (-> obj intro-delay)) + (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) + (format #t "~1Ton-complete: ~A~%" (-> obj on-complete)) + (format #t "~1Ton-fail: ~A~%" (-> obj on-fail)) + (format #t "~1Tbegin-sphere: #~%" (-> obj begin-sphere)) + (format #t "~1Tend-sphere: #~%" (-> obj end-sphere)) + (label cfg-16) + obj + ) + +(defun-debug game-task-node-flag->string ((arg0 game-task-node-flag)) + (if (= (logand arg0 (game-task-node-flag clear-task-mask)) (game-task-node-flag clear-task-mask)) + (format #t "clear-task-mask ") + ) + (if (= (logand arg0 (game-task-node-flag city-wait)) (game-task-node-flag city-wait)) + (format #t "city-wait ") + ) + (if (= (logand arg0 (game-task-node-flag intro-wait)) (game-task-node-flag intro-wait)) + (format #t "intro-wait ") + ) + (if (= (logand arg0 (game-task-node-flag task-manager)) (game-task-node-flag task-manager)) + (format #t "task-manager ") + ) + (if (= (logand arg0 (game-task-node-flag task-retry)) (game-task-node-flag task-retry)) + (format #t "task-retry ") + ) + (if (= (logand arg0 (game-task-node-flag reset-on-try)) (game-task-node-flag reset-on-try)) + (format #t "reset-on-try ") + ) + (if (= (logand arg0 (game-task-node-flag exclusive)) (game-task-node-flag exclusive)) + (format #t "exclusive ") + ) + (if (= (logand (game-task-node-flag utility-node) arg0) (game-task-node-flag utility-node)) + (format #t "utility-node ") + ) + (if (= (logand arg0 (game-task-node-flag set-task-mask)) (game-task-node-flag set-task-mask)) + (format #t "set-task-mask ") + ) + (if (= (logand arg0 (game-task-node-flag closed)) (game-task-node-flag closed)) + (format #t "closed ") + ) + (if (= (logand arg0 (game-task-node-flag no-fail-on-death)) (game-task-node-flag no-fail-on-death)) + (format #t "no-fail-on-death ") + ) + (if (= (logand arg0 (game-task-node-flag data)) (game-task-node-flag data)) + (format #t "data ") + ) + (if (= (logand arg0 (game-task-node-flag save-on-life)) (game-task-node-flag save-on-life)) + (format #t "save-on-life ") + ) + (if (= (logand arg0 (game-task-node-flag close-task)) (game-task-node-flag close-task)) + (format #t "close-task ") + ) + (if (= (logand arg0 (game-task-node-flag save-on-try)) (game-task-node-flag save-on-try)) + (format #t "save-on-try ") + ) + (if (= (logand arg0 (game-task-node-flag auto-close)) (game-task-node-flag auto-close)) + (format #t "auto-close ") + ) + (if (= (logand (game-task-node-flag no-slow-down) arg0) (game-task-node-flag no-slow-down)) + (format #t "no-slow-down ") + ) + (if (= (logand arg0 (game-task-node-flag abs-task-mask)) (game-task-node-flag abs-task-mask)) + (format #t "abs-task-mask ") + ) + (if (= (logand (game-task-node-flag no-restart) arg0) (game-task-node-flag no-restart)) + (format #t "no-restart ") + ) + (if (= (logand (game-task-node-flag no-audio) arg0) (game-task-node-flag no-audio)) + (format #t "no-audio ") + ) + (none) + ) + +(defun-debug game-task-node-command->string ((arg0 game-task-node-command)) + (case arg0 + (((game-task-node-command add-gun-up-1)) + "add-gun-up-1" + ) + (((game-task-node-command add-darkjak-1)) + "add-darkjak-1" + ) + (((game-task-node-command add-pass-yellow)) + "add-pass-yellow" + ) + (((game-task-node-command add-pass-red)) + "add-pass-red" + ) + (((game-task-node-command sub-board)) + "sub-board" + ) + (((game-task-node-command add-board)) + "add-board" + ) + (((game-task-node-command add-darkjak)) + "add-darkjak" + ) + (((game-task-node-command add-darkjak-2)) + "add-darkjak-2" + ) + (((game-task-node-command add-gun-up-3)) + "add-gun-up-3" + ) + (((game-task-node-command add-gun-up-2)) + "add-gun-up-2" + ) + (((game-task-node-command add-darkjak-3)) + "add-darkjak-3" + ) + (((game-task-node-command add-darkjak-0)) + "add-darkjak-0" + ) + (((game-task-node-command add-gun-blue)) + "add-gun-blue" + ) + (((game-task-node-command add-gun-yellow)) + "add-gun-yellow" + ) + (((game-task-node-command none)) + "none" + ) + (((game-task-node-command add-gun-dark)) + "add-gun-dark" + ) + (((game-task-node-command add-pass-green)) + "add-pass-green" + ) + (((game-task-node-command add-board-training)) + "add-board-training" + ) + (((game-task-node-command add-gun-up-4)) + "add-gun-up-4" + ) + (((game-task-node-command add-gun-red)) + "add-gun-red" + ) + (((game-task-node-command add-pass-blue)) + "add-pass-blue" + ) + (((game-task-node-command sub-sidekick)) + "sub-sidekick" + ) + (((game-task-node-command add-sidekick)) + "add-sidekick" + ) + (else + "*unknown*" + ) + ) + ) + +(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) + (flags game-task-node-flag :offset-assert 20) + (parent-node uint16 4 :offset-assert 24) + (task-mask task-mask :offset-assert 32) + (on-open basic :offset-assert 36) + (info task-manager-info :offset-assert 40) + (borrow basic :offset-assert 44) + (open? symbol :offset-assert 48) + (on-close basic :offset-assert 52) + (close-time time-frame :offset-assert 56) + (death-count uint16 :offset-assert 64) + (gem-count uint16 :offset-assert 66) + (skill-count uint16 :offset-assert 68) + (suck-death-count uint8 :offset-assert 70) + (add game-task-node-command :offset-assert 71) + (description uint32 :offset-assert 72) + ) + :method-count-assert 14 + :size-assert #x4c + :flag-assert #xe0000004c + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + (dummy-12 () none 12) + (dummy-13 () none 13) + ) + ) + +(defmethod inspect game-task-node-info ((obj game-task-node-info)) + (when (not obj) + (set! obj obj) + (goto cfg-45) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Ttask: #x~X : ~S~%" (-> obj task) (game-task->string (-> obj task))) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Twhen-open: ~A~%" (-> obj when-open)) + (format #t "~1Tflags: #x~X : (game-task-node-flag " (-> obj flags)) + (game-task-node-flag->string (-> obj flags)) + (format #t ")~%") + (format #t "~1Tparent-node[4] @ #x~X~%" (-> obj parent-node)) + (dotimes (s5-1 4) + (format #t "~T [~D]~1Tparent-node: ~D~%" s5-1 (-> obj parent-node s5-1)) + ) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) + (let ((s5-2 (-> obj task-mask))) + (if (= (logand s5-2 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-2 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-2 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-2 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-2 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-2 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-2) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-2 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-2 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-2 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-2 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-2 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-2 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-2) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-2 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-2 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-2 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-2) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-2 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Ton-open: ~A~%" (-> obj on-open)) + (format #t "~1Tinfo: #~%" (-> obj info)) + (format #t "~1Tborrow: ~A~%" (-> obj borrow)) + (format #t "~1Topen?: ~A~%" (-> obj open?)) + (format #t "~1Ton-close: ~A~%" (-> obj on-close)) + (format #t "~1Tclose-time: ~D~%" (-> obj close-time)) + (format #t "~1Tdeath-count: ~D~%" (-> obj death-count)) + (format #t "~1Tgem-count: ~D~%" (-> obj gem-count)) + (format #t "~1Tskill-count: ~D~%" (-> obj skill-count)) + (format #t "~1Tsuck-death-count: ~D~%" (-> obj suck-death-count)) + (format #t "~1Tadd: #x~X : ~S~%" (-> obj add) (game-task-node-command->string (-> obj add))) + (format #t "~1Tdescription: ~D~%" (-> obj description)) + (label cfg-45) + obj + ) + +(deftype game-task-info (basic) + ((name basic :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) + (play-node uint16 :offset-assert 20) + (play-continue basic :offset-assert 24) + (kiosk-play-continue basic :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype game-task-control (basic) + ((counter uint32 :offset-assert 4) + (actor game-task-actor :offset-assert 8) + (current-node uint16 :offset-assert 10) + (current-event uint32 :offset-assert 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (dummy-9 () none 9) + ) + ) + +(defmethod inspect game-task-control ((obj game-task-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcounter: ~D~%" (-> obj counter)) + (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) + (format #t "~1Tcurrent-node: ~D~%" (-> obj current-node)) + (format #t "~1Tcurrent-event: ~A~%" (-> obj current-event)) + (label cfg-4) + obj + ) + +;; definition of type task-manager +(deftype task-manager (process) + ((node-info basic :offset-assert 128) + (info task-manager-info :offset-assert 132) + (lev-name basic :offset-assert 136) + (fail-on-death? symbol :offset-assert 140) + (fail-now basic :offset-assert 144) + (retry-now basic :offset-assert 148) + (allow-fail basic :offset-assert 152) + (state-time time-frame :offset-assert 160) + (count int16 :offset-assert 168) + (max-count int16 :offset-assert 170) + (sub-state uint32 :offset-assert 172) + (slave uint64 32 :offset-assert 176) + (arrow uint64 :offset-assert 432) + (link uint32 :offset-assert 440) + (start-time time-frame :offset-assert 448) + (total-time time-frame :offset-assert 456) + (beep-time time-frame :offset-assert 464) + (time-limit time-frame :offset-assert 472) + (begin-pos vector :inline :offset-assert 480) + (end-pos vector :inline :offset-assert 496) + (data-int8 int8 32 :offset-assert 512) + (data-int32 int32 32 :offset-assert 544) + (data-float float 32 :offset-assert 672) + (data-vector vector 32 :inline :offset-assert 800) + (actor-group uint32 4 :offset-assert 1312) + (minimap uint32 8 :offset-assert 1328) + (hud uint64 4 :offset-assert 1360) + (hud-timer time-frame :offset 1360) + (hud-counter int64 :offset 1368) + (sound-id uint32 4 :offset-assert 1392) + (intro-time time-frame :offset-assert 1408) + ) + :heap-base #x510 + :method-count-assert 23 + :size-assert #x588 + :flag-assert #x1705100588 + (:methods + (dummy-14 () none 14) + (dummy-15 () none 15) + (dummy-16 () none 16) + (dummy-17 () none 17) + (dummy-18 () none 18) + (dummy-19 () none 19) + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + ) + ) + + +(deftype ambient-control (structure) + ((last-ambient-time time-frame :offset-assert 0) + (last-ambient string :offset-assert 8) + (last-ambient-id sound-id :offset-assert 12) + ) + :method-count-assert 12 + :size-assert #x10 + :flag-assert #xc00000010 + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + ) + ) + + +;; definition for symbol *traffic-engine*, type object +(define *traffic-engine* (the-as object #f)) + + + + diff --git a/goal_src/jak2/engine/geometry/bounding-box-h.gc b/goal_src/jak2/engine/geometry/bounding-box-h.gc index f8aa3ef2f2..337329c67a 100644 --- a/goal_src/jak2/engine/geometry/bounding-box-h.gc +++ b/goal_src/jak2/engine/geometry/bounding-box-h.gc @@ -7,3 +7,60 @@ ;; DECOMP BEGINS +;; axis-aligned bounding box, using floats. +(deftype bounding-box (structure) + ((min vector :inline :offset-assert 0) + (max vector :inline :offset-assert 16) + ) + :method-count-assert 21 + :size-assert #x20 + :flag-assert #x1500000020 + (:methods + (add-spheres! (_type_ (inline-array sphere) int) int 9) + (add-box! (_type_ bounding-box) int 10) + (add-point! (_type_ vector) none 11) + (intersects-line-segment? (_type_ vector vector) symbol 12) + (set-from-point-offset! (_type_ vector vector) none 13) + (set-from-point-offset-pad! (_type_ vector vector float) int 14) + (set-to-point! (_type_ vector) none 15) + (set-from-sphere! (_type_ sphere) none 16) + (set-from-spheres! (_type_ (inline-array sphere) int) int 17) + (get-bounding-sphere (_type_ vector) vector 18) + (inside-xyz? (bounding-box vector) symbol 19) + (inside-xz? (bounding-box vector) symbol 20) + ) + ) + +;; axis-aligned bounding box, using int32's +(deftype bounding-box4w (structure) + ((min vector4w :inline :offset-assert 0) + (max vector4w :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; axis-aligned bounding box, storing both float and int32's (for crazy collision assembly stuff) +(deftype bounding-box-both (structure) + ((box bounding-box :inline :offset-assert 0) + (box4w bounding-box4w :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + + +(deftype bounding-box-array (inline-array-class) + ((data bounding-box :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> bounding-box-array heap-base) (the-as uint 32)) + + + + diff --git a/goal_src/jak2/engine/geometry/bounding-box.gc b/goal_src/jak2/engine/geometry/bounding-box.gc index ab5df16c71..33c6849d88 100644 --- a/goal_src/jak2/engine/geometry/bounding-box.gc +++ b/goal_src/jak2/engine/geometry/bounding-box.gc @@ -5,5 +5,332 @@ ;; name in dgo: bounding-box ;; dgos: ENGINE, GAME +;; Implementation of bounding box functions. +;; These boxes are used as a primitive in the foreground collision system. + ;; DECOMP BEGINS +(defmethod inside-xyz? bounding-box ((obj bounding-box) (arg0 vector)) + "Is the point in the box?" + (and (< (-> obj min x) (-> arg0 x)) + (< (-> obj min y) (-> arg0 y)) + (< (-> obj min z) (-> arg0 z)) + (< (-> arg0 x) (-> obj max x)) + (< (-> arg0 y) (-> obj max y)) + (< (-> arg0 z) (-> obj max z)) + ) + ) + +(defmethod inside-xz? bounding-box ((obj bounding-box) (arg0 vector)) + "Is the point in the box? Check xz only." + (and (< (-> obj min x) (-> arg0 x)) + (< (-> obj min z) (-> arg0 z)) + (< (-> arg0 x) (-> obj max x)) + (< (-> arg0 z) (-> obj max z)) + ) + ) + +(defun box-vector-enside? ((arg0 bounding-box) (arg1 vector)) + "Is the point in the box? On the edge doesn't count." + (and (< (-> arg0 min x) (-> arg1 x)) + (< (-> arg0 min y) (-> arg1 y)) + (< (-> arg0 min z) (-> arg1 z)) + (< (-> arg1 x) (-> arg0 max x)) + (< (-> arg1 y) (-> arg0 max y)) + (< (-> arg1 z) (-> arg0 max z)) + ) + ) + +(defun box-vector-inside? ((arg0 bounding-box) (arg1 vector)) + "Is the point in the box? On the edge counts." + (and (>= (-> arg1 x) (-> arg0 min x)) + (>= (-> arg1 y) (-> arg0 min y)) + (>= (-> arg1 z) (-> arg0 min z)) + (>= (-> arg0 max x) (-> arg1 x)) + (>= (-> arg0 max y) (-> arg1 y)) + (>= (-> arg0 max z) (-> arg1 z)) + ) + ) + +(defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) + "Set to the smallest box containing arg0, (arg0 + arg1)" + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf3 (&-> arg1 quad)) + (.lvf vf4 (&-> arg0 quad)) + (.add.vf vf5 vf4 vf3) + (.min.vf vf1 vf4 vf5) + (.max.vf vf2 vf4 vf5) + (.mov.vf vf1 vf0 :mask #b1000) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> obj min quad) vf1) + (.svf (&-> obj max quad) vf2) + 0 + (none) + ) + ) + +(defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector)) + "Expand the box as needed to contain the given point." + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf1 (&-> obj min quad)) + (.lvf vf2 (&-> obj max quad)) + (.lvf vf3 (&-> arg0 quad)) + (.min.vf vf1 vf1 vf3) + (.max.vf vf2 vf2 vf3) + (.svf (&-> obj min quad) vf1) + (.svf (&-> obj max quad) vf2) + 0 + (none) + ) + ) + +(defmethod add-box! bounding-box ((obj bounding-box) (arg0 bounding-box)) + "Expand the box as needed to contain the given box." + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (.lvf vf1 (&-> obj min quad)) + (.lvf vf2 (&-> obj max quad)) + (.lvf vf3 (&-> arg0 min quad)) + (.lvf vf4 (&-> arg0 max quad)) + (.min.vf vf1 vf1 vf3) + (.max.vf vf2 vf2 vf4) + (.svf (&-> obj min quad) vf1) + (.svf (&-> obj max quad) vf2) + 0 + ) + ) + +(defmethod set-to-point! bounding-box ((obj bounding-box) (arg0 vector)) + "Set the box to be a single point." + (set! (-> obj min quad) (-> arg0 quad)) + (set! (-> obj max quad) (-> arg0 quad)) + 0 + (none) + ) + +(defmethod set-from-point-offset-pad! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) + "Set the box to contain arg0, arg0 + offset, with some padding." + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg0 quad)) + (.mov vf1 arg2) + (.add.vf vf6 vf5 vf4) + (.min.vf vf2 vf5 vf6) + (.max.vf vf3 vf5 vf6) + (.add.x.vf vf3 vf3 vf1 :mask #b111) + (.sub.x.vf vf2 vf2 vf1 :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mov.vf vf3 vf0 :mask #b1000) + (.svf (&-> obj min quad) vf2) + (.svf (&-> obj max quad) vf3) + 0 + ) + ) + +(defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) + "Set the box to contain a single sphere." + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.sub.w.vf vf2 vf1 vf1 :mask #b111) + (.add.w.vf vf3 vf1 vf1 :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mov.vf vf3 vf0 :mask #b1000) + (.svf (&-> obj min quad) vf2) + (.svf (&-> obj max quad) vf3) + 0 + (none) + ) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;; +;; multi-sphere methods +;;;;;;;;;;;;;;;;;;;;;;;;; + +;; these are used in the collision system to build bounding boxes around collision geometries, so they are quite optimized. + +(defmethod add-spheres! bounding-box ((obj bounding-box) (spheres (inline-array sphere)) (count int)) + "Add count spheres." + ;; the PS2 implementation is very optimized + ;; It is unrolled and 'software pipelined' to do 4 at a time. + ;; This is slightly less optimized. + (rlet ((current-min :class vf) + (current-max :class vf) + (sph-min :class vf) + (sph-max :class vf) + (sph :class vf)) + + (when (nonzero? count) + ;; load these outside the loop + (.lvf current-min (-> obj min)) + (.lvf current-max (-> obj max)) + + (dotimes (i count) + (.lvf sph (-> spheres i)) + (.sub.w.vf sph-min sph sph :mask #b111) + (.add.w.vf sph-max sph sph :mask #b111) + (.min.vf current-min current-min sph-min :mask #b111) + (.max.vf current-max current-max sph-max :mask #b111) + ) + + (.svf (-> obj min) current-min) + (.svf (-> obj max) current-max) + ) + ) + 0 + ) + +(defmethod set-from-spheres! bounding-box ((obj bounding-box) (spheres (inline-array sphere)) (count int)) + "Reset box to hold the given spheres. Note: this implementation could be optimized." + ;; This is also unrolled, but does 7 at a time. + (rlet ((vf0 :class vf) + (current-min :class vf) + (current-max :class vf) + (sph-min :class vf) + (sph-max :class vf) + (sph :class vf)) + ;; init constant + (init-vf0-vector) + ;; init min/max. in the case we don't have any spheres, we should return (0,0,0,1) for min/max. + (set! current-min vf0) + (set! current-max vf0) + + (dotimes (i count) + (.lvf sph (-> spheres i)) + (.sub.w.vf sph-min sph sph :mask #b111) + (.add.w.vf sph-max sph sph :mask #b111) + (cond + ((zero? i) + (set! current-min sph-min) + (set! current-max sph-max) + ) + (else + (.min.vf current-min current-min sph-min :mask #b111) + (.max.vf current-max current-max sph-max :mask #b111) + ) + ) + ) + + (.svf (-> obj min) current-min) + (.svf (-> obj max) current-max) + ) + 0 + ) + + +(defmethod get-bounding-sphere bounding-box ((obj bounding-box) (arg0 vector)) + "Get a bounding sphere for a bounding box." + (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> obj max) (-> obj min))) + (a0-3 (vector-float*! (new 'stack-no-clear 'vector) a1-2 0.5)) + ) + (vector+! arg0 (-> obj min) a0-3) + (set! (-> arg0 w) (vector-length a0-3)) + ) + arg0 + ) + +;;;;;;;;;;;;;; +;; line clip +;;;;;;;;;;;;;; + +;; The "liang-barsky" algorithm for line clipping is just using the parametric equation for a line. +;; this is used to implement a "line segment intersects square in xz plane" check. + +(deftype liang-barsky-line-clip-params (structure) + ((te float :offset-assert 0) + (tl float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(defun liang-barsky-line-clipt ((arg0 liang-barsky-line-clip-params) (arg1 float) (arg2 float)) + "Clip test in 1 dimension. Is arg1 in arg2?" + (cond + ((< 0.0 arg1) + (let ((f0-2 (/ arg2 arg1))) + (if (< (-> arg0 tl) f0-2) + (return #f) + ) + (if (< (-> arg0 te) f0-2) + (set! (-> arg0 te) f0-2) + ) + ) + ) + ((< arg1 0.0) + (let ((f0-5 (/ arg2 arg1))) + (if (< f0-5 (-> arg0 te)) + (return #f) + ) + (if (< f0-5 (-> arg0 tl)) + (set! (-> arg0 tl) f0-5) + ) + ) + ) + (else + (if (< 0.0 arg2) + (return #f) + ) + ) + ) + #t + ) + +(defmethod intersects-line-segment? bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) + "Check intersection in xz plane, using liang-barsky. Not sure if this actually + a useful check or not..." + (let ((f28-0 (- (-> arg1 x) (-> arg0 x))) + (f30-0 (- (-> arg1 z) (-> arg0 z))) + ) + (cond + ((and (= f28-0 0.0) (= f30-0 0.0)) + (let ((f1-2 (-> arg0 x)) + (f0-4 (-> arg0 z)) + ) + (and (>= f1-2 (-> obj min x)) (>= (-> obj max x) f1-2) (>= f0-4 (-> obj min z)) (>= (-> obj max z) f0-4)) + ) + ) + (else + (let ((s4-0 (new 'stack-no-clear 'liang-barsky-line-clip-params))) + (set! (-> s4-0 te) 0.0) + (set! (-> s4-0 tl) 1.0) + (and (liang-barsky-line-clipt s4-0 f28-0 (- (-> obj min x) (-> arg0 x))) + (liang-barsky-line-clipt s4-0 (- f28-0) (- (-> arg0 x) (-> obj max x))) + (liang-barsky-line-clipt s4-0 f30-0 (- (-> obj min z) (-> arg0 z))) + (liang-barsky-line-clipt s4-0 (- f30-0) (- (-> arg0 z) (-> obj max z))) + ) + ) + ) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/geometry/geometry-h.gc b/goal_src/jak2/engine/geometry/geometry-h.gc index 3050997bf9..7fa2fbf797 100644 --- a/goal_src/jak2/engine/geometry/geometry-h.gc +++ b/goal_src/jak2/engine/geometry/geometry-h.gc @@ -7,3 +7,36 @@ ;; DECOMP BEGINS +;; A 3 dimensional polynomial spline with arbitrarily placed knot points +;; It's used for camera paths and similar and can be generated by offline tools. +(deftype curve (structure) + ((cverts (inline-array vector) :offset-assert 0) + (num-cverts int32 :offset-assert 4) + (knots (pointer float) :offset-assert 8) + (num-knots int32 :offset-assert 12) + (length float :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; unused plane type that would likely trigger some action on crossing. +(deftype border-plane (basic) + ((name symbol :offset-assert 4) + (action basic :offset-assert 8) + (slot int8 :offset-assert 12) + (trans vector :inline :offset-assert 16) + (normal vector :inline :offset-assert 32) + ) + :method-count-assert 11 + :size-assert #x30 + :flag-assert #xb00000030 + (:methods + (debug-draw! (_type_) none 9) + (point-past-plane? (_type_ vector) symbol 10) + ) + ) + + +(define-extern quaternion-from-two-vectors-max-angle! (function quaternion vector vector float quaternion)) diff --git a/goal_src/jak2/engine/geometry/geometry.gc b/goal_src/jak2/engine/geometry/geometry.gc index 172ef7c08f..46f37729f8 100644 --- a/goal_src/jak2/engine/geometry/geometry.gc +++ b/goal_src/jak2/engine/geometry/geometry.gc @@ -7,3 +7,1550 @@ ;; DECOMP BEGINS +(defun vector-flatten! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Get the projection of src onto a plane with the given normal + The normal should have magnitude 1.0." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector-reflect! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Reflect a vector off of a plane." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.add.vf acc vf3 vf3 :mask #b111) + (.sub.mul.w.vf vf3 vf1 vf0 acc :mask #b111) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector-reflect-flat! ((arg0 vector) (arg1 vector) (arg2 vector)) + "This is a weird one. It doesn't care about the value of src dot normal + and it effectively replaces the component of src normal to the plane with + the plane's normal. I think this requires src/normal to both be unit vectors + in order to make sense. + NOTE: src should point from positive halfspace to negative otherwise it + doesn't work." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.add.vf vf3 vf3 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector-reflect-flat-above! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Not really a reflect. Same as flatten" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.svf (&-> arg0 quad) vf3) + (let* ((f0-0 (vector-length arg0)) + (f1-1 (vector-dot arg0 arg2)) + (f0-2 (- (* 0.02 f0-0) f1-1)) + ) + (vector+float*! arg0 arg0 arg2 (fmin 16384.0 (* 16.0 f0-2))) + ) + ) + ) + +(defun vector-reflect-flat-gravity! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg1 quad)) + (vector-reflect-flat! arg0 s4-0 arg2) + (let* ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0)) ;; src normalized + (f28-0 (vector-length s4-0)) ;; src original len + (f30-0 (vector-length arg0)) ;; dst original len + (f0-1 (vector-dot s2-0 arg2)) ;; original (normalized) dot normal + (f1-1 (vector-dot arg3 arg2)) + ) + (when (and (< 0.0001 f1-1) (< 8192.0 f28-0)) + (let ((f0-3 (- (/ f0-1 f1-1)))) + (vector+float*! arg0 s4-0 arg3 (* f28-0 f0-3)) + ) + (vector+! arg0 arg0 arg2) + (vector-normalize! arg0 f30-0) + ) + ) + ) + arg0 + ) + +(defun vector-segment-distance-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Compute the distance from a point to the closest point on the line segment. + arg0 is the point. arg1/arg2 are the endpoints of the line segment. + arg3 is an optional output closest point." + (local-vars (v0-0 float) (v1-0 float) (v1-1 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (init-vf0-vector) + (nop!) + (.lvf vf3 (&-> arg1 quad)) + (.lvf vf4 (&-> arg2 quad)) + (.lvf vf5 (&-> arg0 quad)) + (.sub.vf vf1 vf4 vf3) + (.sub.vf vf6 vf5 vf3) + (.mul.vf vf2 vf1 vf1) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.sqrt.vf Q vf2 :ftf #b11) + (.wait.vf) + (.add.vf vf2 vf0 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b0) + (.mov v1-0 vf2) + (let ((f2-0 v1-0)) + (.wait.vf) + (.mul.vf vf1 vf1 Q) + (.mul.vf vf7 vf1 vf6) + (let ((f1-0 (the-as float 0.0))) + (.add.y.vf vf7 vf7 vf7 :mask #b1) + (.add.z.vf vf7 vf7 vf7 :mask #b1) + (.mov v1-1 vf7) + (let ((f0-0 v1-1)) + (b! (< f0-0 f1-0) cfg-4 :likely-delay (set! f0-0 f1-0)) + (b! (< f2-0 f0-0) cfg-4 :likely-delay (set! f0-0 f2-0)) + (label cfg-4) + (let ((v1-2 f0-0)) + (.mov vf7 v1-2) + ) + ) + ) + ) + (.mul.x.vf vf1 vf1 vf7) + (b! (= arg3 #f) cfg-6 :delay (.mov.vf vf8 vf0 :mask #b1000)) + (.add.vf vf8 vf3 vf1 :mask #b111) + (.svf (&-> arg3 quad) vf8) + (label cfg-6) + (.sub.vf vf2 vf6 vf1) + (.mul.vf vf2 vf2 vf2) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.sqrt.vf Q vf2 :ftf #b11) + (.wait.vf) + (.add.vf vf2 vf0 Q :mask #b1) + (.nop.vf) + (.mov v0-0 vf2) + v0-0 + ) + ) + + +(defun vector-line-distance ((arg0 vector) (arg1 vector) (arg2 vector)) + "Weird function: given a point arg1, and an infinite line connecting arg2 and arg1, compute the distance + from arg0 to that line." + (let* ((a1-3 (vector-normalize! (vector-! (new-stack-vector0) arg2 arg1) 1.0)) + (gp-1 (vector-! (new-stack-vector0) arg0 arg1)) + (f0-1 (vector-dot a1-3 gp-1)) + (v1-3 (vector-float*! (new-stack-vector0) a1-3 f0-1)) + ) + (vector-length (vector-! (new-stack-vector0) gp-1 v1-3)) + ) + ) + +(defun vector-line-distance-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Same as above function, but returns the point on arg2/arg1 in arg3 (ignored if #f)" + (let* ((a1-3 (vector-normalize! (vector-! (new-stack-vector0) arg2 arg1) 1.0)) + (s4-1 (vector-! (new-stack-vector0) arg0 arg1)) + (f0-1 (vector-dot a1-3 s4-1)) + (v1-4 (vector-float*! (new-stack-vector0) a1-3 f0-1)) + ) + (if arg3 + (vector+! arg3 arg1 v1-4) + ) + (vector-length (vector-! (new-stack-vector0) s4-1 v1-4)) + ) + ) + +(defun vector-segment-overlap ((arg0 vector) (arg1 vector) (arg2 vector)) + "Seems to compute (v1 - v0).dot(v2 - v1), but in a weird way." + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg2)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) gp-1 1.0)) + ) + ;; this vector-line-distance-point! is totally unused. + (let ((a3-0 (new 'stack-no-clear 'vector))) + (vector-line-distance-point! arg0 arg1 arg2 a3-0) + ) + (/ (vector-dot s5-0 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (vector-length gp-1)) + ) + ) + +(defun line-sphere-intersection? ((arg0 vector) (arg1 vector) (arg2 vector)) + "Does [arg1, arg2] intersect sphere arg0?" + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (vector-! s3-0 arg2 arg1) + (let ((f0-0 (vector-length-squared s3-0))) + (if (< 0.0 f0-0) + (set! f30-0 (/ 1.0 f0-0)) + ) + ) + (let ((v1-6 (new 'stack-no-clear 'vector))) + (vector-! v1-6 arg0 arg1) + (let* ((f1-2 (* (vector-dot s3-0 v1-6) f30-0)) + (f0-5 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (vector+float*! s5-0 arg1 s3-0 f0-5) + ) + ) + ) + (let ((f0-6 (vector-vector-distance-squared s5-0 arg0)) + (f1-4 (-> arg0 w)) + ) + (< f0-6 (* f1-4 f1-4)) + ) + ) + ) + +(defun vector-orient-by-quat! ((arg0 vector) (arg1 vector) (arg2 quaternion)) + "Rotate a vector by a quaternion." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg2 vec quad)) + (.lvf vf6 (&-> arg1 quad)) + (.add.vf vf5 vf1 vf1) + (.add.w.vf vf2 vf0 vf1 :mask #b1) + (.add.z.vf vf2 vf0 vf1 :mask #b10) + (.sub.y.vf vf2 vf0 vf1 :mask #b100) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (.sub.z.vf vf3 vf0 vf1 :mask #b1) + (.add.w.vf vf3 vf0 vf1 :mask #b10) + (.add.x.vf vf3 vf0 vf1 :mask #b100) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.add.y.vf vf4 vf0 vf1 :mask #b1) + (.sub.x.vf vf4 vf0 vf1 :mask #b10) + (.add.w.vf vf4 vf0 vf1 :mask #b100) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (.outer.product.a.vf acc vf5 vf2) + (.outer.product.b.vf vf2 vf2 vf5 acc) + (.outer.product.a.vf acc vf5 vf3) + (.outer.product.b.vf vf3 vf3 vf5 acc) + (.outer.product.a.vf acc vf5 vf4) + (.outer.product.b.vf vf4 vf4 vf5 acc) + (.add.w.vf vf2 vf2 vf0 :mask #b1) + (.add.w.vf vf3 vf3 vf0 :mask #b10) + (.add.w.vf vf4 vf4 vf0 :mask #b100) + (.mul.w.vf acc vf0 vf6) + (.add.mul.x.vf acc vf2 vf6 acc) + (.add.mul.y.vf acc vf3 vf6 acc) + (.add.mul.z.vf vf6 vf4 vf6 acc) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +(defun vector-inv-orient-by-quat! ((arg0 vector) (arg1 vector) (arg2 quaternion)) + "Rotate a vector by the inverse rotation." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + ;; (.sub.vf vf7 vf7 vf7) + (.xor.vf vf7 vf7 vf7) + (.lvf vf1 (&-> arg2 vec quad)) + (.lvf vf6 (&-> arg1 quad)) + (.sub.vf vf1 vf7 vf1 :mask #b111) + (.add.vf vf5 vf1 vf1) + (.add.w.vf vf2 vf0 vf1 :mask #b1) + (.add.z.vf vf2 vf0 vf1 :mask #b10) + (.sub.y.vf vf2 vf0 vf1 :mask #b100) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (.sub.z.vf vf3 vf0 vf1 :mask #b1) + (.add.w.vf vf3 vf0 vf1 :mask #b10) + (.add.x.vf vf3 vf0 vf1 :mask #b100) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.add.y.vf vf4 vf0 vf1 :mask #b1) + (.sub.x.vf vf4 vf0 vf1 :mask #b10) + (.add.w.vf vf4 vf0 vf1 :mask #b100) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (.outer.product.a.vf acc vf5 vf2) + (.outer.product.b.vf vf2 vf2 vf5 acc) + (.outer.product.a.vf acc vf5 vf3) + (.outer.product.b.vf vf3 vf3 vf5 acc) + (.outer.product.a.vf acc vf5 vf4) + (.outer.product.b.vf vf4 vf4 vf5 acc) + (.add.w.vf vf2 vf2 vf0 :mask #b1) + (.add.w.vf vf3 vf3 vf0 :mask #b10) + (.add.w.vf vf4 vf4 vf0 :mask #b100) + (.mul.w.vf acc vf0 vf6) + (.add.mul.x.vf acc vf2 vf6 acc) + (.add.mul.y.vf acc vf3 vf6 acc) + (.add.mul.z.vf vf6 vf4 vf6 acc) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; The "forward down" function take a direction for forward (+z) and down (-y) +;; and convert to a transform. +;; Note that the normal functions take their pitch from the forward vector, but +;; the "nopitch" ones use the pitch from the up/down. Of course, if you are +;; consistent and provide orthogonal forward/down, they do the same thing. + +(defun forward-down->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + "Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is down (-y). Will have the pitch of forward" + (vector-normalize-copy! (the-as vector (&-> arg0 data 8)) arg1 1.0) + (vector-cross! (the-as vector (-> arg0 data)) (the-as vector (&-> arg0 data 8)) arg2) + (vector-normalize! (the-as vector (-> arg0 data)) 1.0) + (vector-cross! (the-as vector (&-> arg0 data 4)) arg1 (the-as vector (-> arg0 data))) + (vector-normalize! (the-as vector (&-> arg0 data 4)) 1.0) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 11) 0.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun forward-down-nopitch->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + "Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is down (-y). Will not use the pitch of forward" + (vector-normalize-copy! (the-as vector (&-> arg0 data 4)) arg2 1.0) + (vector-negate! (the-as vector (&-> arg0 data 4)) (the-as vector (&-> arg0 data 4))) + (vector-cross! (the-as vector (-> arg0 data)) (the-as vector (&-> arg0 data 4)) arg1) + (vector-normalize! (the-as vector (-> arg0 data)) 1.0) + (vector-cross! + (the-as vector (&-> arg0 data 8)) + (the-as vector (-> arg0 data)) + (the-as vector (&-> arg0 data 4)) + ) + (vector-normalize! (the-as vector (&-> arg0 data 8)) 1.0) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 11) 0.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun forward-up->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + "Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is up (+y). Will use the pitch of forward" + (forward-down->inv-matrix arg0 arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2)) + ) + +(defun forward-up-nopitch->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + "Create a matrix representing an inverse transform where arg1 is forward (+z) and arg2 is up (+y). Will not use the pitch of forward" + (forward-down-nopitch->inv-matrix arg0 arg1 (vector-negate! (new-stack-vector0) arg2)) + ) + +(defun forward-up-nopitch->quaternion ((arg0 quaternion) (arg1 vector) (arg2 vector)) + "Create a quaternion representing a transform where arg1 is forward (+z) and arg2 is up (+y). Will not use the pitch of forward" + (matrix->quaternion arg0 (forward-up-nopitch->inv-matrix (new-stack-matrix0) arg1 arg2)) + ) + +(defun forward-up->quaternion ((arg0 quaternion) (arg1 vector) (arg2 vector)) + "Create a quaternion representing a transform where arg1 is forward (+z) and arg2 is up (+y). Will use the pitch of forward" + (matrix->quaternion + arg0 + (forward-down->inv-matrix (new-stack-matrix0) arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2)) + ) + ) + +(defun quaternion-from-two-vectors! ((arg0 quaternion) (arg1 vector) (arg2 vector)) + "Create a quaternion representing the rotation between two vectors" + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f1-0 (vector-length s5-0)) + (f0-1 (vector-dot arg1 arg2)) + ) + (let ((f1-1 (/ (sqrtf (* 0.5 (- 1.0 f0-1))) f1-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f1-1)) + (set! (-> arg0 y) (* (-> s5-0 y) f1-1)) + (set! (-> arg0 z) (* (-> s5-0 z) f1-1)) + ) + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f0-1)))) + ) + arg0 + ) + +(defun quaternion-from-two-vectors-partial! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float)) + "Create a quaternion representing the rotation between two vectors, doing arg3 fraction of the total rotation." + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f0-0 (vector-length s5-0)) + (f1-1 (+ 1.0 (* arg3 (+ -1.0 (vector-dot arg1 arg2))))) + ) + (let ((f0-1 (/ (sqrtf (* 0.5 (- 1.0 f1-1))) f0-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f0-1)) + (set! (-> arg0 y) (* (-> s5-0 y) f0-1)) + (set! (-> arg0 z) (* (-> s5-0 z) f0-1)) + ) + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f1-1)))) + ) + arg0 + ) + +(defun quaternion-from-two-vectors-max-angle! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float)) + "Create a quaternion representing the rotation between two vectors, allowing at most a rotation of arg3 degrees" + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f30-0 (vector-length s5-0)) + (f26-0 (vector-dot arg1 arg2)) + (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) + ) + (let ((f0-5 (sin (* 0.5 arg3)))) + (cond + ((< f0-5 f28-0) + (set! f28-0 f0-5) + (set! (-> arg0 w) (cos (* 0.5 arg3))) + ) + (else + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) + ) + ) + ) + (let ((f0-12 (/ f28-0 f30-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f0-12)) + (set! (-> arg0 y) (* (-> s5-0 y) f0-12)) + (set! (-> arg0 z) (* (-> s5-0 z) f0-12)) + ) + ) + arg0 + ) + +(defun quaternion-from-two-vectors-max-angle-partial! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float) (arg4 float)) + "Create a quaternion representing the arg4 fraction of the rotation between two vectors, allowing at most a rotation of arg3 degrees" + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f30-0 (vector-length s5-0)) + (f26-0 (+ 1.0 (* arg4 (+ -1.0 (vector-dot arg1 arg2))))) + (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) + ) + (let ((f0-5 (sin (* 0.5 arg3)))) + (cond + ((< f0-5 f28-0) + (set! f28-0 f0-5) + (set! (-> arg0 w) (cos (* 0.5 arg3))) + ) + (else + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) + ) + ) + ) + (let ((f0-12 (/ f28-0 f30-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f0-12)) + (set! (-> arg0 y) (* (-> s5-0 y) f0-12)) + (set! (-> arg0 z) (* (-> s5-0 z) f0-12)) + ) + ) + arg0 + ) + +(defun matrix-from-two-vectors! ((arg0 matrix) (arg1 vector) (arg2 vector)) + "Create a rotation matrix representing the rotation between two vectors" + (let* ((a1-3 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + (f1-0 1.0) + (f2-0 f0-1) + (f1-2 (sqrtf (- f1-0 (* f2-0 f2-0)))) + ) + (matrix-axis-sin-cos! arg0 a1-3 f1-2 f0-1) + ) + ) + +(defun matrix-from-two-vectors-max-angle! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float)) + "Create a rotation matrix representing the rotation between two vectors, allowing at most a rotation of arg3 degrees" + (let ((s4-1 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0)) + (f30-0 (vector-dot arg1 arg2)) + (f28-0 (cos arg3)) + ) + (cond + ((< f30-0 f28-0) + (matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f28-0) + ) + (else + (let ((t9-5 matrix-axis-sin-cos!) + (a0-6 arg0) + (a1-4 s4-1) + (f0-1 1.0) + (f1-0 f30-0) + ) + (t9-5 a0-6 a1-4 (sqrtf (- f0-1 (* f1-0 f1-0))) f30-0) + ) + ) + ) + ) + ) + +(defun matrix-from-two-vectors-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) + "This function can help smoothly rotate from a current heading vector to a target one. + It returns a rotation to move arg1 closer to arg2, subject to two different speed limits. + arg3 is a rotations-per-frame rate. This limit takes frame rate into account (when lagging, the rotation is larger) + arg4 is a 'slow down when getting close to the end' limit. + This is used in rotate-toward-orientation, which is much improved from jak 1." + (with-pp + (let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + (f0-2 (acos f0-1)) + (f1-2 (fmin (* arg3 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-2)) (the float arg4)))) + (f30-0 (fmax (fmin f0-2 f1-2) (- f1-2))) + ) + (matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0)) + ) + arg0 + ) + ) + +(defun matrix-from-two-vectors-the-long-way-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) + "Same as above, but rotates you away from the target. + Note that the 'near the end' smoothing will apply when you're near the target." + (with-pp + (let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + (f0-3 (- (acos f0-1))) + (f1-2 (fmin (* arg3 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-3)) (the float arg4)))) + (f30-0 (fmax (fmin f0-3 f1-2) (- f1-2))) + ) + (matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0)) + ) + arg0 + ) + ) + +(defun quaternion-from-two-vectors-smooth! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) + "Same as above, but returns a quaternion." + (let ((a1-1 (matrix-from-two-vectors-smooth! (new 'stack-no-clear 'matrix) arg1 arg2 arg3 arg4))) + (matrix->quaternion arg0 a1-1) + ) + ) + +(defun matrix-from-two-vectors-max-angle-partial! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 float)) + "Create a rotation matrix representing the given fraction of the rotation between two heading vectors, + rotating by at most the given angle." + (let* ((s4-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0)) + (f28-0 (vector-dot arg1 arg2)) + (f30-0 (cos arg3)) + (f0-2 (+ 1.0 (* (+ -1.0 f28-0) arg4))) + ) + (cond + ((< f0-2 f30-0) + (matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f30-0) + ) + (else + (let ((t9-5 matrix-axis-sin-cos!) + (a0-6 arg0) + (a1-4 s4-1) + (f1-3 1.0) + (f2-1 f0-2) + ) + (t9-5 a0-6 a1-4 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-2) + ) + ) + ) + ) + ) + +(defun matrix-from-two-vectors-partial-linear! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float)) + "Create a rotation matrix representing doing arg3 fraction of the rotation between two vectors." + (let ((gp-1 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + ) + (cond + ((< 0.9999 (fabs f0-1)) + (matrix-identity! arg0) + ) + (else + (let* ((f0-4 (cos (* arg3 (acos f0-1)))) + (t9-5 matrix-axis-sin-cos!) + (a0-6 arg0) + (f1-1 1.0) + (f2-1 f0-4) + ) + (t9-5 a0-6 gp-1 (sqrtf (- f1-1 (* f2-1 f2-1))) f0-4) + ) + ) + ) + ) + ) + +(defun matrix-remove-z-rot ((arg0 matrix) (arg1 matrix)) + "Remove the z rotation component of a rotation." + (let ((s4-0 (new-stack-vector0))) + 0.0 + 0.0 + (let ((s5-0 (new-stack-matrix0))) + (vector-negate! s4-0 (the-as vector arg1)) + (vector-flatten! s4-0 s4-0 (the-as vector (&-> arg0 data 8))) + (vector-normalize! s4-0 1.0) + (let ((f30-0 (vector-dot (the-as vector (&-> arg0 data 4)) s4-0))) + (when (< f30-0 0.99999) + (vector-cross! s4-0 (the-as vector (&-> arg0 data 4)) s4-0) + (let ((f0-4 (vector-length s4-0))) + (if (< 0.0 (vector-dot s4-0 (the-as vector (&-> arg0 data 8)))) + (set! f0-4 (- f0-4)) + ) + (matrix-axis-sin-cos! s5-0 (the-as vector (&-> arg0 data 8)) f0-4 f30-0) + ) + (matrix*! arg0 arg0 s5-0) + ) + ) + ) + ) + arg0 + ) + +(defun matrix-rot-diff! ((arg0 vector) (arg1 matrix) (arg2 matrix)) + "Get the difference of rotation between two matrices, expressed as a quaternion." + (let ((s3-0 (new-stack-quaternion0)) + (s2-0 (new-stack-quaternion0)) + (s5-0 (new-stack-quaternion0)) + ) + 0.0 + (matrix->quaternion s3-0 arg1) + (matrix->quaternion s2-0 arg2) + (quaternion-conjugate! s5-0 s3-0) + (quaternion*! s5-0 s2-0 s5-0) + (quaternion-normalize! s5-0) + (if (< (-> s5-0 w) 0.0) + (quaternion-negate! s5-0 s5-0) + ) + (let ((f30-1 (* 2.0 (acos (-> s5-0 w))))) + (set! (-> arg0 quad) (-> s5-0 vec quad)) + (vector-negate! arg0 arg0) + (if (= (vector-normalize-ret-len! arg0 1.0) 0.0) + (set! (-> arg0 y) 1.0) + ) + f30-1 + ) + ) + ) + +(defun quaternion-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float) (arg4 float)) + "Strange quaternion rotate toward function. Arg3 is ignored. Arg4 is the max seek amount." + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-matrix0)) + ) + (quaternion->matrix s5-0 arg1) + (quaternion->matrix s4-0 arg2) + (let ((s2-1 (new-stack-quaternion0))) + (quaternion-from-two-vectors-max-angle! + s2-1 + (the-as vector (&-> s5-0 data 8)) + (the-as vector (&-> s4-0 data 8)) + arg4 + ) + (quaternion-normalize! (quaternion*! arg0 arg0 s2-1)) + ) + ) + ) + +(defun vector-deg-seek ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Make one vector closer to another, doing at most a rotation by arg3 degrees." + (let ((s4-0 (new-stack-matrix0))) + (matrix-from-two-vectors-max-angle! s4-0 arg1 arg2 arg3) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +(defun vector-deg-slerp ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Slerp for vectors. (imagine that they are the z axis of two frames)" + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + arg0 + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + arg0 + ) + (else + (let ((s1-0 (new-stack-matrix0))) + (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) + (a2-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0)) + ) + (matrix-from-two-vectors-partial-linear! s1-0 s2-0 a2-3 arg3) + ) + (vector-matrix*! arg0 arg1 s1-0) + ) + ) + ) + ) + +(defun vector-vector-deg-slerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + "unused. no clue what this does." + (local-vars (sv-112 (function float float float float))) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (let* ((s0-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) + (s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0)) + (s0-1 (forward-up->quaternion (new 'stack-no-clear 'quaternion) s0-0 arg4)) + (a2-5 (forward-up->quaternion (new 'stack-no-clear 'quaternion) s1-0 arg4)) + (a1-6 (quaternion-slerp! (new 'stack-no-clear 'quaternion) s0-1 a2-5 arg3)) + (s2-1 vector-normalize-copy!) + (s1-1 arg0) + (s0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-6)) + ) + (set! sv-112 lerp) + (let ((s3-1 (vector-length arg1)) + (a1-7 (vector-length arg2)) + ) + (s2-1 s1-1 s0-2 (sv-112 s3-1 a1-7 arg3)) + ) + ) + ) + ) + arg0 + ) + +(defun normal-of-plane ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Given three points on a plane, compute the plane's normal" + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf3 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg3 quad)) + (.sub.vf vf1 vf3 vf1) + (.sub.vf vf2 vf3 vf2) + (.outer.product.a.vf acc vf2 vf1) + (.outer.product.b.vf vf4 vf1 vf2 acc) + (.mul.vf vf5 vf4 vf4) + (.add.y.vf vf5 vf5 vf5 :mask #b1) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.isqrt.vf Q vf0 vf5 :fsf #b11 :ftf #b0) + (.mov.vf vf4 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf4 vf4 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun vector-3pt-cross! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Cross product of 2 - 1 and 3 - 1. (will give a normal to the plane, but not of magnitude 1)" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf3 (&-> arg3 quad)) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.sub.vf vf3 vf3 vf1) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf4 vf3 vf2 acc) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun closest-pt-in-triangle ((arg0 vector) (arg1 vector) (arg2 matrix) (arg3 vector)) + "arg2 is the vertices of the triangle, arg3 is the normal, arg1 is the input point, arg0 is the output." + ;; (declare (print-asm)) + (local-vars + (v1-0 uint) + (v1-4 uint) + (v1-5 uint) + (v1-6 uint) + (v1-7 uint) + (v1-10 uint) + (a0-1 uint) + (a1-1 uint) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (nop!) + (.lvf vf3 (&-> arg2 vector 1 quad)) + (nop!) + (.lvf vf4 (&-> arg2 vector 2 quad)) + (nop!) + (.lvf vf5 (&-> arg1 quad)) + (.sub.vf vf6 vf3 vf4) + (.lvf vf2 (&-> arg2 vector 0 quad)) + (.sub.vf vf7 vf3 vf5) + (.lvf vf1 (&-> arg3 quad)) + (.sub.vf vf8 vf3 vf2) + (.sub.vf vf9 vf5 vf4) + (.sub.vf vf10 vf5 vf2) + (.outer.product.a.vf acc vf7 vf8) + (.outer.product.b.vf vf14 vf8 vf7 acc) + (.outer.product.a.vf acc vf6 vf7) + (.outer.product.b.vf vf15 vf7 vf6 acc) + (.mul.vf vf11 vf14 vf1) + (.outer.product.a.vf acc vf9 vf10) + (.outer.product.b.vf vf16 vf10 vf9 acc) + (.mul.vf vf12 vf15 vf1) + (.add.x.vf vf11 vf11 vf11 :mask #b10) + (.mul.vf vf13 vf16 vf1) + (.add.x.vf vf12 vf12 vf12 :mask #b10) + (.add.x.vf vf13 vf13 vf13 :mask #b10) + (.add.z.vf vf11 vf11 vf11 :mask #b10) + (.add.z.vf vf12 vf12 vf12 :mask #b10) + (.add.z.vf vf13 vf13 vf13 :mask #b10) + ;; note: these types were changed to uint to make this copy 64 bits. + (.mov v1-0 vf11) + (.mov a1-1 vf12) + (.mov a0-1 vf13) + (let* ((v1-1 (shr (the-as int v1-0) 63)) + (a1-2 (shr (the-as int a1-1) 63)) + (a0-2 (shr (the-as int a0-1) 63)) + (a1-3 (* a1-2 2)) + (a0-3 (* a0-2 4)) + (v1-3 (logior (logior v1-1 a1-3) a0-3)) + ) + (b! (nonzero? v1-3) cfg-3 :delay (set! v1-4 (the-as uint (+ v1-3 -1)))) + ) + (.sub.vf vf17 vf5 vf2) + (.mov.vf vf18 vf0 :mask #b1000) + (.outer.product.a.vf acc vf17 vf1) + (.outer.product.b.vf vf18 vf1 vf17 acc) + (.outer.product.a.vf acc vf1 vf18) + (.outer.product.b.vf vf18 vf18 vf1 acc) + (.add.vf vf18 vf18 vf2 :mask #b111) + (b! #t cfg-24 :delay (.svf (&-> arg0 quad) vf18)) + (nop!) + (label cfg-3) + (b! (nonzero? v1-4) cfg-6 :delay (set! v1-5 (the-as uint (+ v1-4 -1)))) + (vector-segment-distance-point! + arg1 + (the-as vector (-> arg2 vector)) + (-> arg2 vector 1) + arg0 + ) + (goto cfg-24) + (label cfg-6) + (b! (nonzero? v1-5) cfg-9 :delay (set! v1-6 (the-as uint (+ v1-5 -1)))) + (vector-segment-distance-point! + arg1 + (-> arg2 vector 1) + (-> arg2 vector 2) + arg0 + ) + (goto cfg-24) + (label cfg-9) + (b! (nonzero? v1-6) cfg-14 :delay (set! v1-7 (the-as uint (+ v1-6 -1)))) + (let ((f30-0 (vector-segment-distance-point! + arg1 + (-> arg2 vector 1) + (the-as vector (-> arg2 vector)) + arg0 + ) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-segment-distance-point! + arg1 + (-> arg2 vector 1) + (-> arg2 vector 2) + s3-0 + ) + f30-0 + ) + (set! (-> arg0 quad) (-> s3-0 quad)) + ) + ) + (goto cfg-24) + (label cfg-14) + (b! (nonzero? v1-7) cfg-17 :delay (set! v1-10 (the-as uint (+ v1-7 -1)))) + (vector-segment-distance-point! + arg1 + (-> arg2 vector 2) + (the-as vector (-> arg2 vector)) + arg0 + ) + (goto cfg-24) + (label cfg-17) + (b! (nonzero? v1-10) cfg-22) + (let ((f30-1 (vector-segment-distance-point! + arg1 + (the-as vector (-> arg2 vector)) + (-> arg2 vector 1) + arg0 + ) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-segment-distance-point! + arg1 + (the-as vector (-> arg2 vector)) + (-> arg2 vector 2) + s3-1 + ) + f30-1 + ) + (set! (-> arg0 quad) (-> s3-1 quad)) + ) + ) + (goto cfg-24) + (label cfg-22) + (let ((f30-2 (vector-segment-distance-point! + arg1 + (-> arg2 vector 2) + (the-as vector (-> arg2 vector)) + arg0 + ) + ) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-segment-distance-point! + arg1 + (-> arg2 vector 2) + (-> arg2 vector 1) + s3-2 + ) + f30-2 + ) + (set! (-> arg0 quad) (-> s3-2 quad)) + ) + ) + (label cfg-24) + 0 + (none) + ) + ) + +(defun point-in-triangle-cross ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector)) + "Check if point is in the triangle using cross product check (so you have to get the order of points right)" + (local-vars (v1-0 int) (a0-1 int) (a1-1 int)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.lvf vf3 (&-> arg3 quad)) + (.lvf vf4 (&-> arg4 quad)) + (.lvf vf5 (&-> arg0 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.sub.vf vf6 vf3 vf4) + (.sub.vf vf7 vf3 vf5) + (.sub.vf vf8 vf3 vf2) + (.sub.vf vf9 vf5 vf4) + (.sub.vf vf10 vf5 vf2) + (.outer.product.a.vf acc vf6 vf7) + (.outer.product.b.vf vf2 vf7 vf6 acc) + (.outer.product.a.vf acc vf7 vf8) + (.outer.product.b.vf vf3 vf8 vf7 acc) + (.outer.product.a.vf acc vf9 vf10) + (.outer.product.b.vf vf4 vf10 vf9 acc) + (.mul.vf vf2 vf2 vf1) + (.mul.vf vf3 vf3 vf1) + (.nop.vf) + (.mul.vf vf4 vf4 vf1) + (.add.x.vf vf2 vf2 vf2 :mask #b10) + (.add.x.vf vf3 vf3 vf3 :mask #b10) + (.add.x.vf vf4 vf4 vf4 :mask #b10) + (.nop.vf) + (.add.z.vf vf2 vf2 vf2 :mask #b10) + (.add.z.vf vf3 vf3 vf3 :mask #b10) + (.add.z.vf vf4 vf4 vf4 :mask #b10) + (.nop.vf) + (.mov a0-1 vf2) + (.mov a1-1 vf3) + (.mov v1-0 vf4) + (>= (the-as int (logior (logior a0-1 a1-1) v1-0)) 0) + ) + ) + +(defun point-in-plane-<-point+normal! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Very strange function. Takes a plane, in point-normal form, then returns some other point on that plane. + It will move 1m in two of {x, y, z} directions. The direction not moved in is the one which is closest to point-in-triangle-cross + in the same direction of the normal (this prevent moving huge distances for nearly vertical planes for example)." + (let ((f0-3 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 y) (-> arg1 y)) (* (-> arg2 z) (-> arg1 z))))) + (set! (-> arg0 w) 1.0) + (let ((f1-7 (fabs (-> arg2 x))) + (f2-3 (fabs (-> arg2 y))) + (f3-1 (fabs (-> arg2 z))) + ) + (cond + ((and (< f2-3 f1-7) (< f3-1 f1-7)) + (set! (-> arg0 y) (+ 4096.0 (-> arg1 y))) + (set! (-> arg0 z) (+ 4096.0 (-> arg1 z))) + (set! (-> arg0 x) (/ (+ (- (- (* (-> arg2 y) (-> arg0 y))) (* (-> arg2 z) (-> arg0 z))) f0-3) (-> arg2 x))) + ) + ((and (< f1-7 f2-3) (< f3-1 f2-3)) + (set! (-> arg0 x) (+ 4096.0 (-> arg1 x))) + (set! (-> arg0 z) (+ 4096.0 (-> arg1 z))) + (set! (-> arg0 y) (/ (- (- f0-3 (* (-> arg2 x) (-> arg0 x))) (* (-> arg2 z) (-> arg0 z))) (-> arg2 y))) + ) + (else + (set! (-> arg0 x) (+ 4096.0 (-> arg1 x))) + (set! (-> arg0 y) (+ 4096.0 (-> arg1 y))) + (set! (-> arg0 z) (/ (+ (- (- (* (-> arg2 x) (-> arg0 x))) (* (-> arg2 y) (-> arg0 y))) f0-3) (-> arg2 z))) + ) + ) + ) + ) + arg0 + ) + +(defun circle-circle-xz-intersect ((arg0 sphere) (arg1 sphere) (arg2 vector) (arg3 vector)) + ;; this function is unused and really complicated, so not implementing it for now. + (format 0 "circle-circle-xz-intersect~%") + (crash!) + 0 + ) + +(defun circle-test () + "Test the circle-circle-xz-intersect function." + ;; doesn't work because circle-circle-xz-intersect hasn't been ported. + (let ((s4-0 (new 'stack 'sphere)) + (a1-2 (new 'stack 'sphere)) + (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 ((a2-1 (circle-circle-xz-intersect s4-0 a1-2 s5-0 gp-0))) + (format #t "res = ~d~%" a2-1) + ) + (format #t "(~f, ~f)~%" (-> s5-0 x) (-> s5-0 z)) + (format #t "(~f, ~f)~%" (-> gp-0 x) (-> gp-0 z)) + ) + (none) + ) + +(defun vector-circle-tangent-new ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Unused." + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((a1-2 (new 'stack 'sphere))) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((v1-3 #x3f000000)) + (.lvf vf3 (&-> arg1 quad)) + (.mov vf2 v1-3) + ) + (.lvf vf4 (&-> arg0 quad)) + (.add.vf vf1 vf3 vf4) + (.sub.vf vf5 vf4 vf3) + (.mul.x.vf vf1 vf1 vf2) + (.mul.x.vf vf5 vf5 vf2) + (.mul.vf vf5 vf5 vf5 :mask #b101) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.sqrt.vf Q vf5 :ftf #b0) + (.wait.vf) + (.mul.vf vf1 vf0 Q :mask #b1000) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-2 quad) vf1) + (circle-circle-xz-intersect (the-as sphere arg1) a1-2 arg2 arg3) + ) + 0 + (none) + ) + ) + +(defun vector-circle-tangent ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Also unused." + (let* ((s3-1 (vector-! (the-as vector (new 'stack-no-clear 'sphere)) arg1 arg0)) + (f0-0 (vector-xz-length s3-1)) + (f28-0 (acos (/ (-> arg1 w) f0-0))) + ) + (cond + ((>= 546.13336 f28-0) + (set! (-> arg2 x) (- (-> arg0 x) (-> s3-1 z))) + (set! (-> arg2 y) 0.0) + (set! (-> arg2 z) (+ (-> arg0 z) (-> s3-1 x))) + (set! (-> arg3 x) (+ (-> arg0 x) (-> s3-1 z))) + (set! (-> arg3 y) 0.0) + (set! (-> arg3 z) (- (-> arg0 z) (-> s3-1 x))) + ) + (else + (let ((f0-15 (atan (-> s3-1 z) (-> s3-1 x))) + (f30-0 (- (-> arg1 w))) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (let ((a2-1 (new 'stack-no-clear 'vector))) + (set! (-> a2-1 x) (- f0-15 f28-0)) + (set! (-> a2-1 y) (+ f0-15 f28-0)) + (vector-sincos! s3-2 s2-1 a2-1) + ) + (set! (-> arg2 x) (+ (-> arg1 x) (* f30-0 (-> s2-1 x)))) + (set! (-> arg2 z) (+ (-> arg1 z) (* f30-0 (-> s3-2 x)))) + (set! (-> arg3 x) (+ (-> arg1 x) (* f30-0 (-> s2-1 y)))) + ) + (set! (-> arg3 z) (+ (-> arg1 z) (* f30-0 (-> s3-2 y)))) + ) + ) + ) + ) + 0 + (none) + ) + +;;;;;;;;;;;;;;;;;;; +;; curve +;;;;;;;;;;;;;;;;;;; + +;; the curves take a floating point input and produce a floating point output. +;; the curve is a piecewise polynomial. The first step of evaluation is to figure out which +;; knots the input point lies in between. The second step is to evaluate the appropriate polynomial. + +(defun find-knot-span ((arg0 int) (arg1 int) (arg2 float) (arg3 (inline-array vector))) + "Binary serach over knots to find which contains the value float in (arg0 arg1). Unused." + (local-vars (v0-0 int)) + (b! (= arg2 (-> (&-> arg3 0 data (+ arg0 1)) 0)) cfg-11 :delay (set! v0-0 arg0)) + (let ((v1-3 (the int arg2))) + (let* ((a2-1 (+ v1-3 3)) + (t0-1 (&-> arg3 0 data a2-1)) + (f1-2 (-> t0-1 0)) + (f2-0 (-> t0-1 1)) + ) + (b! (> f1-2 arg2) cfg-4) + (b! (>= arg2 f2-0) cfg-4 :delay (set! v0-0 a2-1)) + ) + (b! #t cfg-11 :delay (nop!)) + (label cfg-4) + (let ((a1-1 arg1) + (a0-1 (+ arg0 1)) + ) + (label cfg-5) + (let ((a2-3 (/ (+ a1-1 a0-1) 2))) + (let ((t0-3 (&-> arg3 0 data a2-3))) + (b! (>= arg2 (-> t0-3 0)) cfg-7) + (b! #t cfg-5 :delay (set! a0-1 a2-3)) + (label cfg-7) + (b! (< arg2 (-> t0-3 1)) cfg-9) + ) + (b! #t cfg-5 :delay (set! a1-1 a2-3)) + (label cfg-9) + (set! v0-0 a2-3) + ) + ) + (b! (= v0-0 v1-3) cfg-11 :delay (nop!)) + ) + (nop!) + (nop!) + (label cfg-11) + v0-0 + ) + +(defun calculate-basis-functions-vector! ((arg0 vector) (arg1 int) (arg2 float) (arg3 (pointer float))) + "Calculate polynomial basis for a given control point." + (local-vars (v1-0 int) (v1-1 object)) + ;;(.sll v1-0 arg1 2) + (set! v1-0 (* 4 arg1)) ;; originally used 32-bit asm + (let ((a1-1 #x3f800000) + (f3-0 arg2) + ) + ;;(.addu v1-1 arg3 v1-0) + (set! v1-1 (&+ arg3 v1-0)) + (let* ((f1-0 (the-as float a1-1)) ;; trick to load float constant. + (f5-0 f1-0) + ) + 0.0 + 0.0 + (let* ((f0-2 (-> (the-as (pointer float) v1-1) 0)) + (f2-0 (-> (the-as (pointer float) v1-1) 1)) + (f0-3 (- f3-0 f0-2)) + (f4-0 (- f2-0 f3-0)) + (f10-0 (/ f1-0 (+ f4-0 f0-3))) + (f2-2 (-> (the-as (pointer float) v1-1) -1)) + (f8-0 (-> (the-as (pointer float) v1-1) 2)) + (f2-3 (- f3-0 f2-2)) + (f9-0 (+ f4-0 f2-3)) + (f6-0 (-> (the-as (pointer float) v1-1) -2)) + (f7-0 (-> (the-as (pointer float) v1-1) 3)) + (f9-1 (/ f1-0 f9-0)) + (f5-1 (* f5-0 f10-0)) + (f11-0 (* f4-0 f5-1)) + (f10-1 (* f0-3 f5-1)) + (f5-2 (- f8-0 f3-0)) + (f8-1 (* f11-0 f9-1)) + (f11-1 (/ f1-0 (+ f5-2 f0-3))) + (f9-3 (* f4-0 f8-1)) + (f8-2 (* f2-3 f8-1)) + (f11-2 (* f10-1 f11-1)) + (f10-3 (+ (* f5-2 f11-2) f8-2)) + (f8-3 (* f0-3 f11-2)) + (f6-1 (- f3-0 f6-0)) + (f3-1 (- f7-0 f3-0)) + (f7-3 (* f9-3 (/ f1-0 (+ f4-0 f6-1)))) + (f4-1 (* f4-0 f7-3)) + (f6-2 (* f6-1 f7-3)) + (f7-6 (* f10-3 (/ f1-0 (+ f5-2 f2-3)))) + (f5-4 (+ (* f5-2 f7-6) f6-2)) + (f2-4 (* f2-3 f7-6)) + (f1-2 (* f8-3 (the-as float (/ f1-0 (+ f3-1 f0-3))))) + (f2-5 (+ (* f3-1 f1-2) f2-4)) + (f0-4 (* f0-3 f1-2)) + ) + (set! (-> arg0 x) f4-1) + (set! (-> arg0 y) f5-4) + (set! (-> arg0 z) f2-5) + (set! (-> arg0 w) f0-4) + ) + ) + ) + arg0 + ) + +(defun curve-evaluate! ((arg0 vector) (arg1 float) (arg2 (inline-array vector)) (arg3 int) (arg4 (pointer float)) (arg5 int)) + "Evaluate a curve. + arg0 is the output + arg1 is the input. + arg2 is control vertices + arg3 is the number of control vertices + arg4 is the knot points + arg5 is the number of knots + " + (local-vars (v1-7 int) (v1-8 int) (v1-10 float) (s3-0 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'static 'vector))) + 0 + ;; lookup knot + (let* ((f0-0 (-> arg4 0)) + (f1-0 (-> (&-> arg4 (+ arg5 -1)) 0)) + (a2-1 (fmax (fmin (* arg1 f1-0) f1-0) f0-0)) + ) + (let* ((a1-1 (+ arg5 -5)) + (a3-1 3) + (f0-2 a2-1) + (v1-5 arg4) + (f0-3 f0-2) + ) + (b! (= f0-3 (-> (&-> v1-5 (+ a1-1 1)) 0)) + cfg-11 + :delay (set! s3-0 a1-1) + ) + (let ((a0-4 (the int f0-3))) + (let* ((t1-1 (+ a0-4 3)) + (t2-1 (&-> v1-5 t1-1)) + (f1-4 (-> t2-1 0)) + (f2-3 (-> t2-1 1)) + ) + (b! (> f1-4 f0-3) cfg-4) + (b! (>= f0-3 f2-3) cfg-4 :delay (set! s3-0 t1-1)) + ) + (b! #t cfg-11) + (label cfg-4) + (let ((a3-2 a3-1) + (a1-2 (+ a1-1 1)) + ) + (label cfg-5) + (let ((t1-3 (/ (+ a3-2 a1-2) 2))) + (let ((t2-3 (&-> v1-5 t1-3))) + (b! (>= f0-3 (-> t2-3 0)) cfg-7) + (b! #t cfg-5 :delay (set! a1-2 t1-3)) + (label cfg-7) + (b! (< f0-3 (-> t2-3 1)) cfg-9) + ) + (b! #t cfg-5 :delay (set! a3-2 t1-3)) + (label cfg-9) + (set! s3-0 t1-3) + ) + ) + (b! (= s3-0 a0-4) cfg-11) + ) + ) + (nop!) + (nop!) + (label cfg-11) + ;; calculate coefficients for this knot's polynomial, store in s4-0 + (calculate-basis-functions-vector! + s4-0 + s3-0 + a2-1 + (the-as (pointer float) arg4) + ) + ) + ;;(.addiu v1-7 s3-0 -3) + (set! v1-7 (- s3-0 3)) + (.lvf vf6 s4-0) + ) + ;; evaluate polynomial! + ;;(.sll v1-8 v1-7 4) + (set! v1-8 (* v1-7 16)) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (let ((v1-9 (+ v1-8 (the-as int arg2)))) + (nop!) + (nop!) + (.lvf vf2 (&-> (the-as (pointer int128) v1-9))) + (nop!) + (.lvf vf3 (+ v1-9 16)) + (nop!) + (.lvf vf4 (+ v1-9 32)) + (nop!) + (.lvf vf5 (+ v1-9 48)) + ) + (.mul.x.vf acc vf2 vf6) + (nop!) + (.add.mul.y.vf acc vf3 vf6 acc :mask #b111) + (nop!) + (.add.mul.z.vf acc vf4 vf6 acc :mask #b111) + (nop!) + (.add.mul.w.vf vf1 vf5 vf6 acc :mask #b111) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (.svf (&-> arg0 quad) vf1) + (.mov v1-10 vf1) + arg0 + ) + ) + +(defun curve-get-pos! ((arg0 vector) (arg1 float) (arg2 curve)) + "Get the position on the curve at the given input." + (curve-evaluate! arg0 arg1 (-> arg2 cverts) (-> arg2 num-cverts) (-> arg2 knots) (-> arg2 num-knots)) + ) + +(defun curve-length ((arg0 curve)) + "Compute the approximate curve length as the sum of distances between knots." + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (* 3 (-> arg0 num-cverts))) + (f30-0 0.0) + ) + (when (nonzero? s3-0) + (curve-evaluate! + s4-0 + (-> arg0 knots 0) + (-> arg0 cverts) + (-> arg0 num-cverts) + (-> arg0 knots) + (-> arg0 num-knots) + ) + (dotimes (s2-0 s3-0) + (set! (-> s5-0 quad) (-> s4-0 quad)) + (curve-evaluate! + s4-0 + (/ (the float (+ s2-0 1)) (the float s3-0)) + (-> arg0 cverts) + (-> arg0 num-cverts) + (-> arg0 knots) + (-> arg0 num-knots) + ) + (+! f30-0 (vector-vector-distance s5-0 s4-0)) + ) + ) + f30-0 + ) + ) + +(defun curve-copy! ((arg0 curve) (arg1 curve)) + "Shallow copy a curve." + (set! (-> arg0 cverts) (-> arg1 cverts)) + (set! (-> arg0 num-cverts) (-> arg1 num-cverts)) + (set! (-> arg0 knots) (-> arg1 knots)) + (set! (-> arg0 num-knots) (-> arg1 num-knots)) + (set! (-> arg0 length) (-> arg1 length)) + arg0 + ) + +(defun curve-closest-point ((arg0 curve) (arg1 vector) (arg2 float) (arg3 float) (arg4 int) (arg5 float)) + "Get the input value for the point on the curve. Approximate! And is O(n_knots)" + (local-vars (sv-48 float)) + (set! sv-48 arg3) + (let ((s3-0 arg4) + (gp-0 arg5) + (f30-0 (curve-length arg0)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + 0.0 + (let ((f28-0 0.5)) + 0.0 + (if (< 0.0 sv-48) + (set! f28-0 (/ sv-48 f30-0)) + ) + (let* ((s0-1 (- arg2 (/ gp-0 f30-0))) + (f26-0 (- s0-1 f28-0)) + (f24-0 (+ s0-1 f28-0)) + ) + (curve-get-pos! s2-0 f26-0 arg0) + (curve-get-pos! s1-0 f24-0 arg0) + (let ((f22-0 (vector-vector-distance-squared s2-0 arg1)) + (f20-0 (vector-vector-distance-squared s1-0 arg1)) + ) + (while (> s3-0 0) + (+! s3-0 -1) + (set! f28-0 (* 0.5 f28-0)) + (let ((v1-6 (cond + ((< f22-0 f20-0) + (curve-get-pos! s1-0 s0-1 arg0) + (set! f20-0 (vector-vector-distance-squared s1-0 arg1)) + (set! f24-0 s0-1) + (- s0-1 f28-0) + ) + (else + (curve-get-pos! s2-0 s0-1 arg0) + (set! f22-0 (vector-vector-distance-squared s2-0 arg1)) + (set! f26-0 s0-1) + (+ s0-1 f28-0) + ) + ) + ) + ) + (set! s0-1 (fmin 1.0 (fmax 0.0 v1-6))) + ) + ) + (+ (if (< f22-0 f20-0) + f26-0 + f24-0 + ) + (/ gp-0 f30-0) + ) + ) + ) + ) + ) + ) + +(defun vector-plane-distance ((arg0 vector) (arg1 plane) (arg2 vector)) + "Unused" + (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (the-as vector (&-> arg1 x))) arg2) + ) + +(defun intersect-ray-plane ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "arg1 is ray direction, arg3 is plane normal, others don't really make sense to me." + (let ((f0-1 (vector-dot arg3 arg1))) + (if (= f0-1 0.0) + -1.0 + (/ (- (vector-dot arg3 arg0) (vector-dot arg3 arg2)) (- f0-1)) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/geometry/path-h.gc b/goal_src/jak2/engine/geometry/path-h.gc index b54d839f27..269d4269e1 100644 --- a/goal_src/jak2/engine/geometry/path-h.gc +++ b/goal_src/jak2/engine/geometry/path-h.gc @@ -5,5 +5,199 @@ ;; name in dgo: path-h ;; dgos: ENGINE, GAME +(defenum path-control-flag + :bitfield #t + :type uint32 + (display 0) + (draw-line 1) ;; TODO - only seen it used to control debug drawing so far + (draw-point 2) ;; TODO - only seen it used to control debug drawing so far + (draw-text 3) ;; TODO - only seen it used to control debug drawing so far + (not-found 4) + ) + + ;; DECOMP BEGINS +(deftype path-control (basic) + ((flags path-control-flag :offset-assert 4) + (name symbol :offset-assert 8) + (process process-drawable :offset-assert 12) + (curve curve :inline :offset-assert 16) + (num-cverts int32 :offset 20) + (cverts (inline-array vector) :offset 16) + ) + :method-count-assert 27 + :size-assert #x24 + :flag-assert #x1b00000024 + (:methods + (new (symbol type process symbol float entity symbol) _type_ 0) + (path-control-method-9 () none 9) + (path-control-method-10 () none 10) + (path-control-method-11 () none 11) + (path-control-method-12 () none 12) + (path-control-method-13 () none 13) + (path-control-method-14 () none 14) + (path-control-method-15 () none 15) + (path-control-method-16 () none 16) + (get-num-segments (_type_) float 17) + (path-control-method-18 () none 18) + (get-num-verts (_type_) int 19) + (path-distance-equal-spacing (_type_ float) float 20) + (average-segment-length (_type_ float) float 21) + (path-control-method-22 () none 22) + (path-control-method-23 () none 23) + (path-control-method-24 () none 24) + (should-display-marks? (_type_) symbol 25) + (path-control-method-26 () none 26) + ) + ) +(set! (-> path-control method-table 9) nothing) + +(deftype curve-control (path-control) + () + :method-count-assert 27 + :size-assert #x24 + :flag-assert #x1b00000024 + (:methods + (new (symbol type process symbol float) _type_ 0) + ) + ) + +(defmethod new path-control ((allocation symbol) + (type-to-make type) + (arg0 process) + (arg1 symbol) + (arg2 float) + (arg3 entity) + (arg4 symbol) + ) + (local-vars (v0-3 object) (sv-16 res-tag) (sv-32 float)) + (set! sv-32 arg2) + (let ((s0-0 arg3) + (s1-0 arg4) + ) + (if (not s0-0) + (set! s0-0 (-> arg0 entity)) + ) + (when (= arg1 'path) + (let ((v0-0 (entity-actor-lookup s0-0 'path-actor 0))) + (if v0-0 + (set! s0-0 v0-0) + ) + ) + ) + (let ((s2-0 (the-as object 0))) + (set! sv-16 (new 'static 'res-tag)) + (let* ((t9-1 (method-of-type res-lump get-property-data)) + (a1-2 arg1) + (a2-2 'interp) + (t0-1 #f) + (t1-1 (the-as (pointer res-tag) (& sv-16))) + (t2-1 *res-static-buf*) + (s0-1 (t9-1 s0-0 a1-2 a2-2 sv-32 (the-as pointer t0-1) t1-1 t2-1)) + ) + (cond + (s0-1 + (set! s2-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + (set! v0-3 (cond + ((nonzero? (the-as path-control s2-0)) + (set! (-> (the-as path-control s2-0) process) (the-as process-drawable arg0)) + (set! (-> (the-as path-control s2-0) name) arg1) + (set! (-> (the-as path-control s2-0) curve cverts) (the-as (inline-array vector) s0-1)) + (set! v0-3 (-> sv-16 elt-count)) + (set! (-> (the-as path-control s2-0) curve num-cverts) (the-as int v0-3)) + v0-3 + ) + (else + (go process-drawable-art-error "memory") + ) + ) + ) + ) + (else + (when (not s1-0) + (set! s2-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + (cond + ((nonzero? (the-as path-control s2-0)) + (logior! (-> (the-as path-control s2-0) flags) (path-control-flag not-found)) + (set! (-> (the-as path-control s2-0) process) (the-as process-drawable arg0)) + (set! (-> (the-as path-control s2-0) name) arg1) + (set! (-> (the-as path-control s2-0) curve cverts) (the-as (inline-array vector) #f)) + (set! (-> (the-as path-control s2-0) curve num-cverts) 0) + 0 + ) + (else + (go process-drawable-art-error "memory") + ) + ) + ) + ) + ) + ) + (the-as path-control s2-0) + ) + ) + ) + +(defmethod should-display-marks? path-control ((obj path-control)) + (and *display-path-marks* (logtest? (-> obj flags) (path-control-flag display))) + ) + +(defmethod get-num-segments path-control ((obj path-control)) + (the float (+ (-> obj curve num-cverts) -1)) + ) + +(defmethod get-num-verts path-control ((obj path-control)) + (the-as int (-> obj curve num-cverts)) + ) + +(defmethod path-distance-equal-spacing path-control ((obj path-control) (arg0 float)) + (* arg0 (get-num-segments obj)) + ) + +(defmethod average-segment-length path-control ((obj path-control) (arg0 float)) + (/ arg0 (get-num-segments obj)) + ) + +(defmethod new curve-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol) (arg2 float)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 process) (the-as process-drawable arg0)) + (set! (-> gp-0 name) arg1) + (let* ((s3-1 (-> arg0 entity)) + (v1-2 arg1) + (s2-0 (cond + ((= v1-2 'path) + 'path-k + ) + (else + (let ((s2-1 string->symbol)) + (format (clear *temp-string*) "~A-k" arg1) + (s2-1 *temp-string*) + ) + ) + ) + ) + ) + (let ((v1-3 (entity-actor-lookup s3-1 'path-actor 0))) + (if v1-3 + (set! s3-1 v1-3) + ) + ) + (when (not (get-curve-data! s3-1 (-> gp-0 curve) arg1 s2-0 arg2)) + (cond + ((> (the-as int (-> gp-0 curve num-cverts)) 0) + (set! (-> gp-0 type) path-control) + ) + (else + (logior! (-> gp-0 flags) (path-control-flag not-found)) + (set! (-> gp-0 curve cverts) (the-as (inline-array vector) #f)) + (set! (-> gp-0 curve num-cverts) 0) + 0 + ) + ) + ) + ) + gp-0 + ) + ) + diff --git a/goal_src/jak2/engine/gfx/background/background-h.gc b/goal_src/jak2/engine/gfx/background/background-h.gc index ca332439d6..9faa3360c1 100644 --- a/goal_src/jak2/engine/gfx/background/background-h.gc +++ b/goal_src/jak2/engine/gfx/background/background-h.gc @@ -7,3 +7,27 @@ ;; DECOMP BEGINS +(deftype background-work (basic) + ((tfrag-tree-count int32 :offset-assert 4) + (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) + (tfrag-levels level 8 :offset-assert 40) + (tfrag-trans-tree-count int32 :offset-assert 72) + (tfrag-trans-trees drawable-tree-tfrag-trans 8 :offset-assert 76) + (tfrag-trans-levels level 8 :offset-assert 108) + (tfrag-water-tree-count int32 :offset-assert 140) + (tfrag-water-trees drawable-tree-tfrag-water 8 :offset-assert 144) + (tfrag-water-levels level 8 :offset-assert 176) + (shrub-tree-count int32 :offset-assert 208) + (shrub-trees drawable-tree-instance-shrub 8 :offset-assert 212) + (shrub-levels level 8 :offset-assert 244) + (tie-tree-count int32 :offset-assert 276) + (tie-trees drawable-tree-instance-tie 8 :offset-assert 280) + (tie-levels level 8 :offset-assert 312) + (tie-generic basic 8 :offset-assert 344) + (tie-generic-trans basic 8 :offset-assert 376) + (wait-to-vu0 uint32 :offset-assert 408) + ) + :method-count-assert 9 + :size-assert #x19c + :flag-assert #x90000019c + ) diff --git a/goal_src/jak2/engine/gfx/background/prototype-h.gc b/goal_src/jak2/engine/gfx/background/prototype-h.gc index cd2b14cb6f..8a1f0732b1 100644 --- a/goal_src/jak2/engine/gfx/background/prototype-h.gc +++ b/goal_src/jak2/engine/gfx/background/prototype-h.gc @@ -5,5 +5,183 @@ ;; name in dgo: prototype-h ;; dgos: ENGINE, GAME +(declare-type prototype-tie drawable) + ;; DECOMP BEGINS +(deftype prototype-bucket (basic) + ((name string :offset-assert 4) + (flags uint16 :offset-assert 8) + (texture-masks-index uint16 :offset-assert 10) + (in-level uint16 :offset-assert 12) + (utextures uint16 :offset-assert 14) + (geometry drawable 4 :offset-assert 16) + (dists vector :inline :offset-assert 32) + (rdists vector :inline :offset-assert 48) + (near-plane meters :offset 32) + (near-stiff meters :offset 36) + (mid-plane meters :offset 40) + (far-plane meters :offset 44) + (rlength-near float :offset 48) + (rlength-stiff float :offset 52) + (rlength-mid float :offset 56) + (stiffness float :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype prototype-bucket-shrub (prototype-bucket) + ((next uint32 4 :offset-assert 64) + (count uint16 4 :offset-assert 80) + (mod-count uint16 4 :offset-assert 88) + (last dma-packet 4 :offset-assert 96) + (next-clear uint128 :offset 64) + (count-clear uint64 :offset 80) + (last-clear uint128 :offset 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype prototype-inline-array-shrub (drawable) + ((length int16 :offset 6) + (data prototype-bucket-shrub 1 :inline :offset 32) + (_pad uint32 :offset-assert 144) + ) + :method-count-assert 17 + :size-assert #x94 + :flag-assert #x1100000094 + ) + +(deftype prototype-array-shrub-info (basic) + ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) + (wind-vectors uint32 :offset-assert 8) + (wind-count int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype prototype-bucket-tie (prototype-bucket) + ((next uint32 12 :offset-assert 64) + (count uint16 12 :offset-assert 112) + (frag-count uint8 4 :offset-assert 136) + (index-start uint8 4 :offset-assert 140) + (base-qw uint16 4 :offset-assert 144) + (tie-rvanish float :offset-assert 152) + (tie-vanish-far float :offset-assert 156) + (envmap-rfade float :offset-assert 160) + (envmap-fade-far float :offset-assert 164) + (envmap-shader adgif-shader :offset-assert 168) + (tint-color uint32 :offset-assert 172) + (collide-hash-fragment-array basic :offset-assert 176) + (tie-colors time-of-day-palette :offset-assert 180) + (data uint32 :dynamic :offset-assert 184) + (color-index-qwc uint32 :dynamic :offset-assert 184) + (scissor-frag-count uint8 :offset 136) + (near-frag-count uint8 :offset 137) + (mid-frag-count uint8 :offset 138) + (far-frag-count uint8 :offset 139) + (scissor-index-start uint8 :offset 140) + (near-index-start uint8 :offset 141) + (mid-index-start uint8 :offset 142) + (far-index-start uint8 :offset 143) + (scissor-base-qw uint16 :offset 144) + (near-base-qw uint16 :offset 146) + (mid-base-qw uint16 :offset 148) + (far-base-qw uint16 :offset 150) + (tie-next uint32 4 :offset 64) + (tie-scissor-next uint32 :offset 64) + (tie-near-next uint32 :offset 68) + (tie-mid-next uint32 :offset 72) + (tie-far-next uint32 :offset 76) + (trans-next uint32 4 :offset 64) + (trans-scissor-next uint32 4 :offset 64) + (trans-near-next uint32 :offset 68) + (trans-mid-next uint32 :offset 72) + (trans-far-next uint32 :offset 76) + (water-next uint32 4 :offset 64) + (water-scissor-next uint32 4 :offset 64) + (water-near-next uint32 :offset 68) + (water-mid-next uint32 :offset 72) + (water-far-next uint32 :offset 76) + (envmap-next uint32 4 :offset 80) + (envmap-scissor-next uint32 4 :offset 80) + (envmap-near-next uint32 :offset 84) + (envmap-mid-next uint32 :offset 88) + (envmap-far-next uint32 :offset 92) + (generic-next uint32 3 :offset 96) + (generic-near-next uint32 :offset 96) + (generic-mid-next uint32 :offset 100) + (generic-far-next uint32 :offset 104) + (vanish-next uint32 :offset 108) + (tie-count uint16 4 :offset 112) + (tie-scissor-count uint16 :offset 112) + (tie-near-count uint16 :offset 114) + (tie-mid-count uint16 :offset 116) + (tie-far-count uint16 :offset 118) + (trans-count uint16 4 :offset 112) + (trans-scissor-count uint16 :offset 112) + (trans-near-count uint16 :offset 114) + (trans-mid-count uint16 :offset 116) + (trans-far-count uint16 :offset 118) + (water-count uint16 4 :offset 112) + (water-scissor-count uint16 :offset 112) + (water-near-count uint16 :offset 114) + (water-mid-count uint16 :offset 116) + (water-far-count uint16 :offset 118) + (envmap-count uint16 4 :offset 120) + (envmap-scissor-count uint16 :offset 120) + (envmap-near-count uint16 :offset 122) + (envmap-mid-count uint16 :offset 124) + (envmap-far-count uint16 :offset 126) + (generic-count uint16 3 :offset 128) + (generic-near-count uint16 :offset 128) + (generic-mid-count uint16 :offset 130) + (generic-far-count uint16 :offset 132) + (vanish-count uint16 :offset 134) + (next-clear uint128 3 :offset 64) + (count-clear uint64 3 :offset 112) + (tie-geom prototype-tie 4 :offset 16) + ) + :method-count-assert 9 + :size-assert #xb8 + :flag-assert #x9000000b8 + ) + +(deftype prototype-array-tie (array) + ((array-data prototype-bucket-tie :dynamic :offset 16) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (login (_type_) none 9) + ) + ) + +(deftype proxy-prototype-array-tie (basic) + ((prototype-array-tie prototype-array-tie :offset-assert 4) + (wind-vectors uint32 :offset-assert 8) + (wind-count uint16 :offset-assert 12) + (prototype-max-qwc uint16 :offset-assert 14) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype instance (drawable) + ((bucket-index uint16 :offset 6) + (origin matrix4h :inline :offset-assert 32) + (flags uint16 :offset 46) + (wind-index uint16 :offset 62) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) diff --git a/goal_src/jak2/engine/gfx/background/subdivide-h.gc b/goal_src/jak2/engine/gfx/background/subdivide-h.gc index 850eea79ef..d70c25de6d 100644 --- a/goal_src/jak2/engine/gfx/background/subdivide-h.gc +++ b/goal_src/jak2/engine/gfx/background/subdivide-h.gc @@ -7,3 +7,172 @@ ;; DECOMP BEGINS +(deftype subdivide-settings (basic) + ((dist float 5 :offset-assert 4) + (meters float 5 :offset-assert 24) + (close float 8 :offset-assert 44) + (far float 8 :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x6c + :flag-assert #x90000006c + (:methods + (new (symbol type meters meters) _type_ 0) + ) + ) + +(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 meters) (arg1 meters)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (dotimes (v1-2 6) + (set! (-> v0-0 close v1-2) arg0) + (set! (-> v0-0 far v1-2) arg1) + ) + v0-0 + ) + ) + +(deftype subdivide-dists (structure) + ((data uint32 32 :offset-assert 0) + (vector vector 8 :inline :offset 0) + (k0s uint128 4 :offset 0) + (k1s uint128 4 :offset 64) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype terrain-stats (structure) + ((pris tr-stat :inline :offset-assert 0) + (tie-generic tr-stat :inline :offset-assert 16) + (tie-vanish tr-stat :inline :offset-assert 32) + (tie tr-stat :inline :offset-assert 48) + (tie-scissor tr-stat :inline :offset-assert 64) + (tie-envmap tr-stat :inline :offset-assert 80) + (tie-envmap-scissor tr-stat :inline :offset-assert 96) + (tie-trans tr-stat :inline :offset-assert 112) + (tie-scissor-trans tr-stat :inline :offset-assert 128) + (tie-envmap-trans tr-stat :inline :offset-assert 144) + (tie-envmap-scissor-trans tr-stat :inline :offset-assert 160) + (tie-water tr-stat :inline :offset-assert 176) + (tie-scissor-water tr-stat :inline :offset-assert 192) + (tie-envmap-water tr-stat :inline :offset-assert 208) + (tie-envmap-scissor-water tr-stat :inline :offset-assert 224) + (shrub-near tr-stat :inline :offset-assert 240) + (shrub tr-stat :inline :offset-assert 256) + (tfrag-scissor tr-stat :inline :offset-assert 272) + (tfrag tr-stat :inline :offset-assert 288) + (billboard tr-stat :inline :offset-assert 304) + (tfrag-trans tr-stat :inline :offset-assert 320) + (tfrag-scissor-trans tr-stat :inline :offset-assert 336) + (tfrag-water tr-stat :inline :offset-assert 352) + (tfrag-scissor-water tr-stat :inline :offset-assert 368) + (trans-pris tr-stat :inline :offset-assert 384) + (trans-shrub tr-stat :inline :offset-assert 400) + (ocean-mid tr-stat :inline :offset-assert 416) + (ocean-near tr-stat :inline :offset-assert 432) + (shadow tr-stat :inline :offset-assert 448) + (total tr-stat :inline :offset-assert 464) + ) + :method-count-assert 9 + :size-assert #x1e0 + :flag-assert #x9000001e0 + ) + +(deftype dma-area (structure) + ((instance-shrub-dma instance-shrub-dma :inline :offset 0) + (draw-node-dma draw-node-dma :inline :offset 0) + (tfrag-dma tfrag-dma :inline :offset 0) + (instance-tie-dma instance-tie-dma :inline :offset 0) + (prototype-tie-dma prototype-tie-dma :inline :offset 0) + (wind-dma wind-dma :inline :offset 0) + (time-of-day-dma time-of-day-dma :inline :offset 0) + (decomp-work decomp-work :inline :offset 0) + (ocean-vertex ocean-vertex 4 :offset 0) + ) + :method-count-assert 9 + :size-assert #x38a0 + :flag-assert #x9000038a0 + ) + +(deftype background-area (structure) + ((dma-area dma-area :inline :offset-assert 0) + (vis-list uint8 2048 :offset-assert 14496) + ) + :method-count-assert 9 + :size-assert #x40a0 + :flag-assert #x9000040a0 + ) + +(deftype foreground-area (structure) + ((generic-work generic-work :inline :offset-assert 0) + (foreground-work foreground-work :inline :offset 0) + (joint-work joint-work :inline :offset 0) + (bone-mem bone-memory :inline :offset 0) + (shadow-work shadow-work :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x3fe0 + :flag-assert #x900003fe0 + ) + +(deftype region-prim-area (structure) + ((region-prim-list region-prim-list :inline :offset-assert 0) + (pos vector :inline :offset-assert 1296) + (ray vector :inline :offset 1328) + (region-enter-count int32 :offset 1360) + (region-enter-list uint32 320 :offset-assert 1364) + (region-enter-prim-list uint32 320 :offset-assert 2644) + (region-exit-count int32 :offset-assert 3924) + (region-exit-list uint32 320 :offset-assert 3928) + (region-exit-prim-list uint32 320 :offset-assert 5208) + (region-inside-count int32 :offset-assert 6488) + (region-inside-list uint32 320 :offset-assert 6492) + (region-inside-prim-list uint32 320 :offset-assert 7772) + (region-start-count int32 :offset-assert 9052) + (region-start-list uint32 320 :offset-assert 9056) + (region-start-prim-list uint32 320 :offset-assert 10336) + ) + :method-count-assert 13 + :size-assert #x2d60 + :flag-assert #xd00002d60 + (:methods + (region-prim-area-method-9 () none 9) + (region-prim-area-method-10 () none 10) + (region-prim-area-method-11 () none 11) + (region-prim-area-method-12 () none 12) + ) + ) + +(deftype sprite-area (structure) + ((clock-data vector 13 :inline :offset-assert 0) + (buffer uint8 :dynamic :offset-assert 208) + ) + :method-count-assert 9 + :size-assert #xd0 + :flag-assert #x9000000d0 + ) + +(deftype work-area (structure) + ((background background-area :inline :offset-assert 0) + (foreground foreground-area :inline :offset 0) + (region-prim region-prim-area :inline :offset 0) + (sprite sprite-area :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x40a0 + :flag-assert #x9000040a0 + ) + +(deftype terrain-context (structure) + ((work work-area :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40a0 + :flag-assert #x9000040a0 + ) + +(define *terrain-stats* (new 'global 'terrain-stats)) + +(define *collide-stats* (new 'global 'collide-stats)) + diff --git a/goal_src/jak2/engine/gfx/background/wind-h.gc b/goal_src/jak2/engine/gfx/background/wind-h.gc index 09677926c4..344a148e2d 100644 --- a/goal_src/jak2/engine/gfx/background/wind-h.gc +++ b/goal_src/jak2/engine/gfx/background/wind-h.gc @@ -7,3 +7,59 @@ ;; DECOMP BEGINS +(deftype wind-vector (structure) + ((wind-pos vector4w :inline :offset-assert 0) + (wind-vel vector4w :inline :offset-assert 16) + (stiffness float :offset 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(define *wind-scales* + (new 'static 'boxed-array :type uint8 + #x2 #x5 #x2 #x3 #x2 #x2 #x3 #x10 #xa + #x2 #x4 #x2 #x8 #x2 #x2 #x10 #x2 #x2 + #x8 #x2 #x10 #x2 #x4 #x10 #xa #x2 #x4 + #x2 #x8 #x2 #x2 #x10 + ) + + ) + +(deftype wind-work (basic) + ((wind-array vector 64 :inline :offset-assert 16) + (wind-normal vector :inline :offset-assert 1040) + (wind-temp vector :inline :offset-assert 1056) + (wind-force float 64 :offset-assert 1072) + (wind-const vector :inline :offset-assert 1328) + (wind-time uint32 :offset-assert 1344) + (wait-to-vu0 uint32 :offset-assert 1348) + (wait-to-spr uint32 :offset-assert 1352) + (wait-from-spr uint32 :offset-assert 1356) + (spr-index uint32 :offset-assert 1360) + (count uint32 :offset-assert 1364) + (next-count uint32 :offset-assert 1368) + (last-count uint32 :offset-assert 1372) + (to-spr uint32 :offset-assert 1376) + (from-spr uint32 :offset-assert 1380) + (next-mem uint32 :offset-assert 1384) + (last-mem uint32 :offset-assert 1388) + (next-spr uint32 :offset-assert 1392) + (last-spr uint32 :offset-assert 1396) + (to-ptrs uint32 3 :offset-assert 1400) + ) + :method-count-assert 9 + :size-assert #x584 + :flag-assert #x900000584 + ) + +(deftype wind-dma (structure) + ((buffer0 wind-vector 128 :inline :offset-assert 0) + (buffer1 wind-vector 128 :inline :offset-assert 4096) + (buffer2 wind-vector 128 :inline :offset-assert 8192) + ) + :method-count-assert 9 + :size-assert #x3000 + :flag-assert #x900003000 + ) diff --git a/goal_src/jak2/engine/gfx/blit-displays-h.gc b/goal_src/jak2/engine/gfx/blit-displays-h.gc index c57a7eee35..16ad8d27d7 100644 --- a/goal_src/jak2/engine/gfx/blit-displays-h.gc +++ b/goal_src/jak2/engine/gfx/blit-displays-h.gc @@ -7,3 +7,28 @@ ;; DECOMP BEGINS +(deftype blit-displays-work (structure) + ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl dma-gif-packet :inline :offset-assert 32) + (sprite-slow-tmpl dma-gif-packet :inline :offset-assert 64) + (line-tmpl dma-gif-packet :inline :offset-assert 96) + (scan-tmpl dma-gif-packet :inline :offset-assert 128) + (color vector4w :inline :offset-assert 160) + (line-color uint64 :offset-assert 176) + (scan-colors vector4w 15 :inline :offset-assert 192) + (menu-mode basic :offset-assert 432) + (screen-copied basic :offset-assert 436) + (vu1-enable-user-menu uint64 :offset-assert 440) + (texture-enable-user-menu uint32 :offset-assert 448) + (count-down uint32 :offset-assert 452) + (horizontal-flip-flag basic :offset-assert 456) + (scan-alpha float :offset-assert 460) + (scanline uint32 :offset-assert 464) + (progress-interp float :offset-assert 468) + (progress-interp-dest float :offset-assert 472) + (progress-interp-speed float :offset-assert 476) + ) + :method-count-assert 9 + :size-assert #x1e0 + :flag-assert #x9000001e0 + ) diff --git a/goal_src/jak2/engine/gfx/font-h.gc b/goal_src/jak2/engine/gfx/font-h.gc index 7f9d0651ce..5e5d1a4e1c 100644 --- a/goal_src/jak2/engine/gfx/font-h.gc +++ b/goal_src/jak2/engine/gfx/font-h.gc @@ -5,5 +5,684 @@ ;; name in dgo: font-h ;; dgos: ENGINE, GAME + +;; TODO: figure out what's weird with set-font-color +;; The font system draws all of the strings. + +(defenum font-color + :type uint32 + (zero 0) + (one 1) + (orange-red 3) + ) + +;; copied from jak1, not completely confirmed. +(defenum font-flags + :type uint32 + :bitfield #t + (shadow 0) + (kerning 1) + (middle 2) + (left 3) + (right 4) + (large 5) + (pc-hack 6) + ) + +(define-extern draw-string-xy (function string dma-buffer int int font-color font-flags float)) + ;; DECOMP BEGINS +(deftype char-verts (structure) + ((pos vector 4 :inline :offset-assert 0) + (color vector 4 :inline :offset-assert 64) + (tex-st vector 4 :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +(deftype char-color (structure) + ((color rgba 4 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(define *font-default-matrix* + (new 'static 'matrix + :data (new 'static 'array float 16 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -256.0 -208.0 0.0 1.0) + ) + ) + +;; font settings that can be passed to draw-string +(deftype font-context (basic) + ((origin vector :inline :offset-assert 16) + (strip-gif vector :inline :offset-assert 32) + (width float :offset-assert 48) + (height float :offset-assert 52) + (projection float :offset-assert 56) + (scale float :offset-assert 60) + (color font-color :offset-assert 64) + (flags font-flags :offset-assert 68) + (mat matrix :offset-assert 72) + (start-line uint32 :offset-assert 76) + (alpha float :offset-assert 80) + ) + :method-count-assert 21 + :size-assert #x54 + :flag-assert #x1500000054 + (:methods + (new (symbol type matrix int int float font-color font-flags) _type_ 0) + (set-mat! (font-context matrix) font-context 9) + (set-origin! (font-context int int) font-context 10) + (set-depth! (font-context int) font-context 11) + (set-w! (font-context float) font-context 12) + (set-width! (font-context int) font-context 13) + (set-height! (font-context int) font-context 14) + (set-projection! (font-context float) font-context 15) + (set-color! (font-context font-color) font-context 16) + (set-flags! (font-context font-flags) font-context 17) + (set-start-line! (font-context uint) font-context 18) + (set-scale! (font-context float) font-context 19) + (set-alpha! (font-context float) font-context 20) + ) + ) + +(defmethod set-mat! font-context ((obj font-context) (arg0 matrix)) + (set! (-> obj mat) arg0) + obj + ) + +(defmethod set-origin! font-context ((obj font-context) (arg0 int) (arg1 int)) + (set! (-> obj origin x) (the float arg0)) + (set! (-> obj origin y) (the float arg1)) + obj + ) + +(defmethod set-depth! font-context ((obj font-context) (arg0 int)) + (set! (-> obj origin z) (the float arg0)) + obj + ) + +(defmethod set-w! font-context ((obj font-context) (arg0 float)) + (set! (-> obj origin w) arg0) + obj + ) + +(defmethod set-width! font-context ((obj font-context) (arg0 int)) + (set! (-> obj width) (the float arg0)) + obj + ) + +(defmethod set-height! font-context ((obj font-context) (arg0 int)) + (set! (-> obj height) (the float arg0)) + obj + ) + +(defmethod set-projection! font-context ((obj font-context) (arg0 float)) + (set! (-> obj projection) arg0) + obj + ) + +(defmethod set-color! font-context ((obj font-context) (arg0 font-color)) + (set! (-> obj color) arg0) + obj + ) + +(defmethod set-flags! font-context ((obj font-context) (arg0 font-flags)) + (set! (-> obj flags) arg0) + obj + ) + +(defmethod set-start-line! font-context ((obj font-context) (arg0 uint)) + (set! (-> obj start-line) arg0) + obj + ) + +(defmethod set-scale! font-context ((obj font-context) (arg0 float)) + (set! (-> obj scale) arg0) + obj + ) + +(defmethod set-alpha! font-context ((obj font-context) (arg0 float)) + (set! (-> obj alpha) arg0) + obj + ) + +(defmethod new font-context ((allocation symbol) + (type-to-make type) + (arg0 matrix) + (arg1 int) + (arg2 int) + (arg3 float) + (arg4 font-color) + (arg5 font-flags) + ) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 mat) arg0) + (let ((v1-3 v0-0)) + (set! (-> v1-3 origin x) (the float arg1)) + (set! (-> v1-3 origin y) (the float arg2)) + ) + (cond + ((= arg3 0.0) + (let ((v1-4 v0-0)) + (set! (-> v1-4 origin z) (-> *math-camera* isometric trans z)) + ) + ) + (else + (let ((v1-5 v0-0)) + (set! (-> v1-5 origin z) arg3) + ) + ) + ) + (let ((v1-6 v0-0)) + (set! (-> v1-6 origin w) 1.0) + ) + (let ((v1-7 v0-0)) + (set! (-> v1-7 width) (the float #x200)) + ) + (let ((v1-8 v0-0)) + (set! (-> v1-8 height) (the float #x1a0)) + ) + (let ((v1-9 v0-0)) + (set! (-> v1-9 projection) 1.0) + ) + (set! (-> v0-0 color) arg4) + (set! (-> v0-0 flags) arg5) + (let ((a0-6 v0-0)) + (set! (-> a0-6 start-line) (the-as uint 0)) + ) + (let ((v1-13 v0-0)) + (set! (-> v1-13 scale) 1.0) + ) + (let ((v1-14 v0-0)) + (set! (-> v1-14 alpha) 1.0) + ) + v0-0 + ) + ) + +(deftype font-work (structure) + ((font-tmpl dma-gif-packet :inline :offset-assert 0) + (char-tmpl dma-gif-packet :inline :offset-assert 32) + (tex1-tmpl uint64 2 :offset-assert 64) + (small-font-0-tmpl uint64 2 :offset-assert 80) + (small-font-1-tmpl uint64 2 :offset-assert 96) + (small-font-2-tmpl uint64 2 :offset-assert 112) + (small-font-3-tmpl uint64 2 :offset-assert 128) + (large-font-0-tmpl uint64 2 :offset-assert 144) + (large-font-1-tmpl uint64 2 :offset-assert 160) + (large-font-2-tmpl uint64 2 :offset-assert 176) + (large-font-3-tmpl uint64 2 :offset-assert 192) + (size1-small vector :inline :offset-assert 208) + (size2-small vector :inline :offset-assert 224) + (size3-small vector :inline :offset-assert 240) + (size1-large vector :inline :offset-assert 256) + (size2-large-0 vector :inline :offset-assert 272) + (size2-large-1 vector :inline :offset-assert 288) + (size2-large-2 vector :inline :offset-assert 304) + (size2-large-3 vector :inline :offset-assert 320) + (size3-large vector :inline :offset-assert 336) + (size2-0 vector :inline :offset-assert 352) + (size2-1 vector :inline :offset-assert 368) + (size2-2 vector :inline :offset-assert 384) + (size2-3 vector :inline :offset-assert 400) + (size-st1 vector :inline :offset-assert 416) + (size-st2 vector :inline :offset-assert 432) + (size-st3 vector :inline :offset-assert 448) + (save vector :inline :offset-assert 464) + (save-color vector 4 :inline :offset-assert 480) + (current-verts char-verts :inline :offset-assert 544) + (src-verts char-verts :inline :offset-assert 736) + (dest-verts char-verts :inline :offset-assert 928) + (justify vector 64 :inline :offset-assert 1120) + (color-shadow vector4w :inline :offset-assert 2144) + (color-table char-color 40 :inline :offset-assert 2160) + (current-font-0-tmpl uint64 2 :offset-assert 2800) + (current-font-1-tmpl uint64 2 :offset-assert 2816) + (current-font-2-tmpl uint64 2 :offset-assert 2832) + (current-font-3-tmpl uint64 2 :offset-assert 2848) + (last-color font-color :offset-assert 2864) + (save-last-color font-color :offset-assert 2868) + (buf basic :offset-assert 2872) + (str-ptr uint32 :offset-assert 2876) + (flags font-flags :offset-assert 2880) + (reg-save uint32 5 :offset-assert 2884) + ) + :method-count-assert 9 + :size-assert #xb58 + :flag-assert #x900000b58 + ) + +(define *font-work* + (new 'static 'font-work + :font-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x102e400000008001 #xe) + ) + :char-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #xe :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #xe :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #xd02e400000008001 #x412412412412e) + ) + :tex1-tmpl (new 'static 'array uint64 2 #x60 #x14) + :small-font-0-tmpl (new 'static 'array uint64 2 #x0 #x6) + :small-font-1-tmpl (new 'static 'array uint64 2 #x0 #x6) + :small-font-2-tmpl (new 'static 'array uint64 2 #x0 #x6) + :small-font-3-tmpl (new 'static 'array uint64 2 #x0 #x6) + :large-font-0-tmpl (new 'static 'array uint64 2 #x0 #x6) + :large-font-1-tmpl (new 'static 'array uint64 2 #x0 #x6) + :large-font-2-tmpl (new 'static 'array uint64 2 #x0 #x6) + :large-font-3-tmpl (new 'static 'array uint64 2 #x0 #x6) + :size1-small (new 'static 'vector :x 12.0 :w 0.5) + :size2-small (new 'static 'vector :y 14.857 :w 8.0) + :size3-small (new 'static 'vector :x 12.0 :y 14.857 :w 14.857) + :size1-large (new 'static 'vector :x 24.0 :w 1.0) + :size2-large-0 (new 'static 'vector :y 29.714 :w 24.0) + :size2-large-1 (new 'static 'vector :y 29.714 :w 24.0) + :size2-large-2 (new 'static 'vector :y 29.714 :w 24.0) + :size2-large-3 (new 'static 'vector :y 29.714 :w 24.0) + :size3-large (new 'static 'vector :x 24.0 :y 29.714 :w 29.714) + :size-st1 (new 'static 'vector :x 0.08985 :w 0.5) + :size-st2 (new 'static 'vector :y 0.031007752 :w 0.5) + :size-st3 (new 'static 'vector :x 0.08985 :y 0.031007752 :w 0.5) + :current-verts (new 'static 'char-verts + :pos (new 'static 'inline-array vector 4 + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + ) + :tex-st (new 'static 'inline-array vector 4 + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + ) + ) + :src-verts (new 'static 'char-verts + :pos (new 'static 'inline-array vector 4 + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + ) + :tex-st (new 'static 'inline-array vector 4 + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + ) + ) + :dest-verts (new 'static 'char-verts + :pos (new 'static 'inline-array vector 4 + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + (new 'static 'vector :w 1.0) + ) + :tex-st (new 'static 'inline-array vector 4 + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + (new 'static 'vector :z 1.0) + ) + ) + :color-shadow (new 'static 'vector4w :data (new 'static 'array uint32 4 #x0 #x0 #x0 #x80)) + :color-table (new 'static 'inline-array char-color 40 + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x20 :a #x80) + (new 'static 'rgba :r #x80 :g #x20 :a #x80) + (new 'static 'rgba :r #x80 :g #x20 :a #x80) + (new 'static 'rgba :r #x80 :g #x20 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x64 :a #x80) + (new 'static 'rgba :r #x80 :g #x64 :a #x80) + (new 'static 'rgba :r #x80 :g #x64 :a #x80) + (new 'static 'rgba :r #x80 :g #x64 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80) + (new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80) + (new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80) + (new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :g #x20 :b #x80 :a #x80) + (new 'static 'rgba :g #x20 :b #x80 :a #x80) + (new 'static 'rgba :g #x20 :b #x80 :a #x80) + (new 'static 'rgba :g #x20 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80) + (new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80) + (new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80) + (new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80) + (new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x54 :a #x80) + (new 'static 'rgba :r #x80 :g #x54 :a #x80) + (new 'static 'rgba :r #x80 :g #x54 :a #x80) + (new 'static 'rgba :r #x80 :g #x54 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80) + (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80) + (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80) + (new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80) + (new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80) + (new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80) + (new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80) + (new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80) + (new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80) + (new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80) + (new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80) + (new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80) + (new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80) + (new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80) + (new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80) + (new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80) + (new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80) + (new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80) + (new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80) + (new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80) + (new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80) + (new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80) + (new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80) + (new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80) + (new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + (new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80) + (new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80) + (new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80) + (new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80) + (new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80) + (new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80) + (new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80) + (new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80) + (new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80) + (new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80) + (new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80) + (new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80) + (new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80) + (new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80) + (new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80) + (new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80) + (new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80) + (new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80) + (new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80) + (new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80) + (new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80) + (new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80) + (new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80) + (new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80) + (new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60) + (new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60) + (new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60) + (new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + (new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x60 :a #x80) + (new 'static 'rgba :r #x60 :a #x80) + (new 'static 'rgba :r #x60 :a #x80) + (new 'static 'rgba :r #x60 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80) + (new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80) + (new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80) + (new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80) + ) + ) + (new 'static 'char-color :color (new 'static 'array rgba 4 + (new 'static 'rgba :b #x1 :a #x80) + (new 'static 'rgba :b #x1 :a #x80) + (new 'static 'rgba :b #x1 :a #x80) + (new 'static 'rgba :b #x1 :a #x80) + ) + ) + ) + ) + ) + +(defun font-set-tex0 ((arg0 (pointer gs-tex0)) (arg1 texture) (arg2 uint) (arg3 uint) (arg4 uint)) + "Write the TEX0 parameters for a font" + (set! (-> arg0 0) (new 'static 'gs-tex0 + :tcc #x1 + :cld #x1 + :cbp arg4 + :th (+ (log2 (+ (-> arg1 h) -1)) 1) + :tw (log2 (-> arg1 w)) + :tbw (-> arg1 width 0) + :tbp0 (/ (the-as int arg2) 64) + :psm arg3 + ) + ) + (none) + ) + +(defun set-font-color ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) + "I have no idea what is happening here." + (let ((v1-6 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -256) + (shr (shl arg2 56) 56) + ) + ) + (a2-6 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*))) + ) + (s.w! (+ a2-6 2160) v1-6) + ) + (let ((v1-13 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -65281) + (shr (shl arg3 56) 48) + ) + ) + (a2-15 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*))) + ) + (s.w! (+ a2-15 2160) v1-13) + ) + (let ((v1-20 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -16711681) + (shr (shl arg4 56) 40) + ) + ) + (a2-24 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*))) + ) + (s.w! (+ a2-24 2160) v1-20) + ) + (let ((v1-28 + (logior (logand (l.wu (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -65281) + (shr (shl arg3 56) 48) + ) + ) + (a2-34 (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*))) + ) + (s.w! (+ a2-34 2160) v1-28) + ) + (let ((v1-36 + (logior (logand (l.wu (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -16711681) + (shr (shl arg4 56) 40) + ) + ) + (a0-3 (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*))) + ) + (s.w! (+ a0-3 2160) v1-36) + ) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/gfx/foreground/bones-h.gc b/goal_src/jak2/engine/gfx/foreground/bones-h.gc index e4cfb0f9b4..c89e95ba25 100644 --- a/goal_src/jak2/engine/gfx/foreground/bones-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/bones-h.gc @@ -5,5 +5,111 @@ ;; name in dgo: bones-h ;; dgos: ENGINE, GAME + +(defenum bone-calc-flags + :type uint16 + :bitfield #t + (bncfl00 0) + (bncfl01 1) ;; use identity matrix in bone matrix calc instead of cam rot (effectively screen-space bones?) + (bncfl02 2) + (bncfl03 3) + (bncfl04 4) + (bncfl05 5) + (bncfl06 6) + (bncfl07 7) + (bncfl08 8) + (bncfl09 9) + (bncfl10 10) + (bncfl11 11) + (bncfl12 12) + (bncfl13 13) + (bncfl14 14) + (bncfl15 15) + ) + ;; DECOMP BEGINS +(deftype bone-buffer (structure) + ((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0) + (bone bone 16 :inline :offset-assert 1024) + (_pad uint8 2048 :offset-assert 2304) + ) + :method-count-assert 9 + :size-assert #x1100 + :flag-assert #x900001100 + ) + +(deftype bone-layout (structure) + ((data uint16 8 :offset-assert 0) + (joint joint 2 :offset 0) + (bone bone 2 :offset 8) + (output uint32 2 :offset 16) + (unused uint32 2 :offset 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype bone-regs (structure) + ((dma-buf basic :offset-assert 0) + (wait-count uint32 :offset-assert 4) + (in-count uint32 :offset-assert 8) + (sp-size uint32 :offset-assert 12) + (sp-bufnum uint32 :offset-assert 16) + (joint-ptr (inline-array joint) :offset-assert 20) + (bone-ptr (inline-array bone) :offset-assert 24) + (num-bones uint32 :offset-assert 28) + (mtxs uint32 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(deftype bone-work (structure) + ((layout bone-layout :inline :offset-assert 0) + (regs bone-regs :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +(deftype bone-debug (structure) + ((time-ctr uint32 :offset-assert 0) + (timing uint32 360 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x5a4 + :flag-assert #x9000005a4 + ) + +(deftype bone-memory (structure) + ((work bone-work :inline :offset-assert 0) + (buffer bone-buffer 2 :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x2250 + :flag-assert #x900002250 + ) + +(deftype bone-calculation (structure) + ((flags bone-calc-flags :offset-assert 0) + (num-bones uint16 :offset-assert 2) + (matrix-area (inline-array matrix) :offset-assert 4) + (joints (inline-array joint) :offset-assert 8) + (bones (inline-array bone) :offset-assert 12) + (ripple-scale float :offset-assert 16) + (ripple-y-scale float :offset-assert 20) + (ripple-normal-scale float :offset-assert 24) + (ripple-area (inline-array vector) :offset-assert 28) + (next bone-calculation :offset-assert 32) + (dummy-1 uint32 :offset-assert 36) + (dummy-2 uint32 :offset-assert 40) + (dummy-3 uint32 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) diff --git a/goal_src/jak2/engine/gfx/foreground/eye-h.gc b/goal_src/jak2/engine/gfx/foreground/eye-h.gc index 74d733c630..1ca6065afb 100644 --- a/goal_src/jak2/engine/gfx/foreground/eye-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/eye-h.gc @@ -7,3 +7,93 @@ ;; DECOMP BEGINS +(deftype eye (structure) + ((data vector 2 :inline :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (lid float :offset 8) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype eye-control (structure) + ((process handle :offset-assert 0) + (draw-flag symbol :offset-assert 8) + (different-eyes basic :offset-assert 12) + (random-time uint16 :offset-assert 16) + (bucket uint16 :offset-assert 18) + (blink float :offset-assert 20) + (shaders (inline-array adgif-shader) :offset-assert 24) + (left eye :inline :offset-assert 32) + (right eye :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +(deftype eye-control-array (basic) + ((data eye-control 16 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x610 + :flag-assert #x900000610 + ) + +(deftype eye-control-arrays (basic) + ((data eye-control-array 6 :inline :offset-assert 16) + (pad uint32 :offset-assert 9328) + ) + :method-count-assert 9 + :size-assert #x2474 + :flag-assert #x900002474 + ) + +(deftype eye-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) + (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + (blink-table float 10 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) + +(define *eye-control-arrays* + (new 'static 'eye-control-arrays :data (new 'static 'inline-array eye-control-array 6 + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + ) + ) + ) + +;; failed to figure out what this is: +(dotimes (v1-6 6) + (dotimes (a0-10 16) + ;(let ((a1-14 (the-as eye-control (+ (+ (* 96 a0-10) 28 (* 1552 v1-6)) (the-as int *eye-control-arrays*))))) + (let ((a1-14 (-> *eye-control-arrays* data v1-6 data a0-10))) + (set! (-> a1-14 process) (the-as handle #f)) + (set! (-> a1-14 draw-flag) #t) + (set! (-> a1-14 shaders) (the-as (inline-array adgif-shader) #f)) + (set! (-> a1-14 random-time) (the-as uint 60)) + (set! (-> a1-14 blink) 0.0) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/goal_src/jak2/engine/gfx/foreground/foreground-h.gc b/goal_src/jak2/engine/gfx/foreground/foreground-h.gc index b13325eebe..91b40cbe3a 100644 --- a/goal_src/jak2/engine/gfx/foreground/foreground-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/foreground-h.gc @@ -7,3 +7,156 @@ ;; DECOMP BEGINS +(deftype mercneric-chain (structure) + ((first uint32 :offset-assert 0) + (next uint32 :offset-assert 4) + (state generic-bucket-state :inline :offset-assert 8) + (vu1-bucket int32 :offset-assert 16) + ) + :pack-me + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype merc-chain (structure) + ((first dma-packet :offset-assert 0) + (patch dma-packet :offset-assert 4) + (vu1-bucket int32 :offset-assert 8) + ) + :pack-me + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype foreground-bucket (structure) + ((merc merc-chain :inline :offset-assert 0) + (emerc merc-chain :inline :offset-assert 12) + (mercneric mercneric-chain :inline :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype foreground-level-buckets (structure) + ((data foreground-bucket 7 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x150 + :flag-assert #x900000150 + ) + +(deftype foreground-bucket-grid (structure) + ((level-buckets foreground-level-buckets 7 :inline :offset-assert 0) + (warp-chain mercneric-chain :inline :offset-assert 2352) + ) + :method-count-assert 9 + :size-assert #x944 + :flag-assert #x900000944 + ) + +(deftype foreground-regs (structure) + ((dist float :offset-assert 0) + (merc-used uint32 :offset-assert 4) + (emerc-used uint32 :offset-assert 8) + (mercneric-used uint32 :offset-assert 12) + (use-isometric uint32 :offset-assert 16) + (base-start dma-packet :offset-assert 20) + (joint-ptr uint32 :offset-assert 24) + (bone-ptr uint32 :offset-assert 28) + (num-bones uint32 :offset-assert 32) + (mtxs uint32 :offset-assert 36) + (dma-buf basic :offset-assert 40) + (default-texture-index uint32 :offset-assert 44) + (mercneric-chain mercneric-chain :offset-assert 48) + (level-buckets foreground-level-buckets :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +(deftype foreground-work (structure) + ((regs foreground-regs :inline :offset-assert 0) + (draw-index-map uint16 7 :offset 64) + (grid foreground-bucket-grid :inline :offset-assert 80) + (bounds sphere :inline :offset-assert 2464) + (lights vu-lights :inline :offset-assert 2480) + (distance vector :inline :offset-assert 2592) + (next-tmpl dma-packet :inline :offset-assert 2608) + ) + :method-count-assert 9 + :size-assert #xa40 + :flag-assert #x900000a40 + ) + + +(defun invalidate-cache-line ((arg0 pointer)) + ; (.sync.l) + ; (.cache dxwbin arg0 0) + ; (.sync.l) + ; (.cache dxwbin arg0 1) + ; (.sync.l) + 0 + ) + +(deftype texscroll-globals (structure) + ((requests int32 :offset-assert 0) + (effects merc-effect 32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x84 + :flag-assert #x900000084 + ) + +(deftype merc-effect-bucket-info (structure) + ((color-fade rgba :offset-assert 0) + (merc-path uint8 :offset-assert 4) + (ignore-alpha uint8 :offset-assert 5) + (disable-draw uint8 :offset-assert 6) + (disable-envmap uint8 :offset-assert 7) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype merc-bucket-info (structure) + ((light vu-lights :inline :offset-assert 0) + (needs-clip int32 :offset-assert 112) + (need-mercprime-if-merc int32 :offset-assert 116) + (must-use-mercneric-for-clip int32 :offset-assert 120) + (effect merc-effect-bucket-info 64 :inline :offset-assert 124) + ) + :method-count-assert 9 + :size-assert #x27c + :flag-assert #x90000027c + ) + +(deftype foreground-globals (structure) + ((foreground-grid foreground-bucket-grid :inline :offset-assert 0) + (merc-bucket-info merc-bucket-info :inline :offset-assert 2384) + (texscroll texscroll-globals :inline :offset-assert 3024) + ) + :method-count-assert 9 + :size-assert #xc54 + :flag-assert #x900000c54 + ) + +(define *foreground* (new 'global 'foreground-globals)) + +;; definition of type shadow-dma-packet +(deftype shadow-dma-packet (structure) + ((tag generic-merc-tag :inline :offset-assert 0) + (settings shadow-settings :inline :offset-assert 16) + (geo-ref dma-packet :inline :offset-assert 96) + (mtx-ref dma-packet :inline :offset-assert 112) + (end-tag dma-packet :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) diff --git a/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc b/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc index 94925e6168..a476e3b4ad 100644 --- a/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc +++ b/goal_src/jak2/engine/gfx/foreground/shadow-cpu-h.gc @@ -5,5 +5,244 @@ ;; name in dgo: shadow-cpu-h ;; dgos: ENGINE, GAME +;; copied from jak 1 +(defenum shadow-flags + :bitfield #t + :type int32 + (shdf00) ;; unused + (disable-fade) + (shdf02) ;; only set, never used. + (shdf03) + (shdf04) ;; unused + (disable-draw) + ) + ;; DECOMP BEGINS +(deftype shadow-settings (structure) + ((center vector :inline :offset-assert 0) + (flags shadow-flags :offset 12) + (shadow-dir vector :inline :offset-assert 16) + (dist-to-locus float :offset 28) + (bot-plane plane :inline :offset-assert 32) + (top-plane plane :inline :offset-assert 48) + (fade-dist float :offset-assert 64) + (fade-start float :offset-assert 68) + (dummy-2 int32 :offset-assert 72) + (shadow-type int32 :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype shadow-control (basic) + ((settings shadow-settings :inline :offset-assert 16) + ) + :method-count-assert 15 + :size-assert #x60 + :flag-assert #xf00000060 + (:methods + (new (symbol type float float float float float) _type_ 0) + (clear-offset-bit (shadow-control) int 9) + (set-offset-bit (shadow-control) int 10) + (set-top-plane-offset (shadow-control float) int 11) + (set-bottom-plane-offset (shadow-control float) int 12) + (shadow-control-method-13 () none 13) + (shadow-control-method-14 () none 14) + ) + ) + +(defmethod clear-offset-bit shadow-control ((obj shadow-control)) + (logclear! (-> obj settings flags) (shadow-flags disable-draw)) + 0 + ) + +(defmethod set-offset-bit shadow-control ((obj shadow-control)) + (logior! (-> obj settings flags) (shadow-flags disable-draw)) + 0 + ) + +(defmethod set-bottom-plane-offset shadow-control ((obj shadow-control) (arg0 float)) + (set! (-> obj settings bot-plane w) (- arg0)) + 0 + ) + +(defmethod set-top-plane-offset shadow-control ((obj shadow-control) (arg0 float)) + (set! (-> obj settings top-plane w) (- arg0)) + 0 + ) + +(deftype shadow-data (structure) + ((dma-unpack-template dma-packet :inline :offset-assert 0) + (dma-cnt dma-tag :offset-assert 16) + (vif-nop vif-tag :offset-assert 24) + (vif-unpack-v4-8 vif-tag :offset-assert 28) + (pdc basic :offset-assert 32) + (dist float :offset-assert 36) + (waits uint32 :offset-assert 40) + (inside-volume? uint32 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype shadow-work (structure) + ((shadow-data shadow-data :inline :offset-assert 0) + (inbuf uint128 600 :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x25b0 + :flag-assert #x9000025b0 + ) + +(deftype shadow-bucket (structure) + ((first uint32 :offset-assert 0) + (next uint32 :offset-assert 4) + (bucket-id int32 :offset-assert 8) + (shadow-color uint32 :offset-assert 12) + (constants basic :offset-assert 16) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype shadow-globals (structure) + ((num-buckets uint32 :offset-assert 0) + (cur-bucket uint32 :offset-assert 4) + (bucket shadow-bucket 2 :inline :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + ) + +(define *shadow-globals* (new 'global 'shadow-globals)) + +(deftype shadow-vertex (structure) + ((x float :offset-assert 0) + (y float :offset-assert 4) + (z float :offset-assert 8) + (weight float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype shadow-matrix-ref (structure) + ((joint-0 uint8 :offset-assert 0) + (joint-1 uint8 :offset-assert 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +; (deftype shadow-edge (structure) +; ((ind-0 uint8 :offset-assert 0) +; (ind-1 uint8 :offset-assert 1) +; (tri-0 uint8 :offset-assert 2) +; (tri-1 uint8 :offset-assert 3) +; ) +; :method-count-assert 9 +; :size-assert #x4 +; :flag-assert #x900000004 +; ) + +(deftype shadow-tri (structure) + ((ind-0 uint8 :offset-assert 0) + (ind-1 uint8 :offset-assert 1) + (ind-2 uint8 :offset-assert 2) + (faces uint8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype shadow-edge (structure) + ((ind-0 uint8 :offset-assert 0) + (ind-1 uint8 :offset-assert 1) + (tri-0 uint8 :offset-assert 2) + (tri-1 uint8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype shadow-frag-header (structure) + ((qwc-data uint32 :offset-assert 0) + (num-joints uint32 :offset-assert 4) + (num-verts uint16 :offset-assert 8) + (num-twos uint16 :offset-assert 10) + (num-single-tris uint16 :offset-assert 12) + (num-single-edges uint16 :offset-assert 14) + (num-double-tris uint16 :offset-assert 16) + (num-double-edges uint16 :offset-assert 18) + (ofs-verts uint32 :offset-assert 20) + (ofs-refs uint32 :offset-assert 24) + (ofs-single-tris uint32 :offset-assert 28) + (ofs-single-edges uint32 :offset-assert 32) + (ofs-double-tris uint32 :offset-assert 36) + (ofs-double-edges uint32 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype shadow-frag-ref (structure) + ((header shadow-frag-header :offset-assert 0) + (qwc uint32 :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype shadow-geo-old (art-element) + ((version uint32 :offset 20) + (header shadow-frag-header :inline :offset-assert 32) + (total-qwc uint32 :offset 32) + (rest uint64 :dynamic :offset-assert 80) + ) + :method-count-assert 13 + :size-assert #x50 + :flag-assert #xd00000050 + ) + +(deftype shadow-geo (art-element) + ((version uint32 :offset 20) + (total-qwc uint32 :offset-assert 32) + (num-joints uint32 :offset-assert 36) + (num-fragments uint32 :offset-assert 40) + (frags shadow-frag-ref :inline :dynamic :offset-assert 44) + ) + :method-count-assert 13 + :size-assert #x2c + :flag-assert #xd0000002c + ) + + +(defmethod new shadow-control ((allocation symbol) (type-to-make type) (arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 settings flags) (the-as shadow-flags arg3)) + (set-vector! (-> v0-0 settings shadow-dir) 0.0 -1.0 0.0 arg2) + (set-vector! (-> v0-0 settings bot-plane) 0.0 1.0 0.0 (- arg0)) + (set-vector! (-> v0-0 settings top-plane) 0.0 1.0 0.0 (- arg1)) + (set! (-> v0-0 settings fade-dist) arg4) + (set! (-> v0-0 settings shadow-type) 0) + v0-0 + ) + ) + +(define *shadow* (the-as object #f)) +(define *shadow-object* (the-as object #f)) +(define *shadow-debug* (the-as object #f)) +(define *shadow-dma-buf* (new 'global 'dma-buffer 512)) diff --git a/goal_src/jak2/engine/gfx/generic/generic-h.gc b/goal_src/jak2/engine/gfx/generic/generic-h.gc index 907be6dcd0..4fd59e8f87 100644 --- a/goal_src/jak2/engine/gfx/generic/generic-h.gc +++ b/goal_src/jak2/engine/gfx/generic/generic-h.gc @@ -7,3 +7,235 @@ ;; DECOMP BEGINS +(deftype gsf-vertex (structure) + ((data uint32 8 :offset-assert 0) + (byte uint8 32 :offset 0) + (quad uint128 2 :offset 0) + (vt qword :inline :offset 0) + (pos vector3s :inline :offset 0) + (tex vector2uh :inline :offset 12) + (nrm vector3s :inline :offset 16) + (nc qword :inline :offset 16) + (clr vector4ub :inline :offset 28) + (dtex vector2uh :inline :offset 16) + (dclr vector4ub :inline :offset 20) + ) + :pack-me + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype gsf-vertex-array (structure) + ((vtx gsf-vertex :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +(deftype gsf-fx-vertex (structure) + ((clr vector4ub :inline :offset-assert 0) + (tex vector2uh :inline :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype gsf-fx-vertex-array (structure) + ((data gsf-fx-vertex :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +(deftype gsf-header (structure) + ((num-strips uint8 :offset-assert 0) + (num-new-vtxs uint8 :offset-assert 1) + (num-dps uint16 :offset-assert 2) + (num-vtxs uint16 :offset-assert 4) + (strip-table uint8 10 :offset-assert 6) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gsf-ik (structure) + ((index uint8 :offset-assert 0) + (no-kick uint8 :offset-assert 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +(deftype gsf-info (structure) + ((ptr-iks uint32 :offset-assert 0) + (ptr-verts uint32 :offset-assert 4) + (ptr-fx uint32 :offset-assert 8) + (dummy2 uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gsf-buffer (structure) + ((data uint8 8192 :offset-assert 0) + (info gsf-info :inline :offset 0) + (header gsf-header :inline :offset 16) + (work-area uint8 :dynamic :offset 32) + ) + :method-count-assert 9 + :size-assert #x2000 + :flag-assert #x900002000 + ) + +(deftype generic-frag (structure) + ((start-pos uint16 :offset-assert 0) + (end-pos uint16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype generic-strip (structure) + ((pos uint16 :offset-assert 0) + (len uint16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype generic-envmap-saves (structure) + ((index-mask vector4w :inline :offset-assert 0) + (verts uint128 12 :offset-assert 16) + (kicks uint128 4 :offset-assert 208) + ) + :method-count-assert 9 + :size-assert #x110 + :flag-assert #x900000110 + ) + +(deftype generic-interp-job (structure) + ((job-type uint16 :offset-assert 0) + (num uint16 :offset-assert 2) + (first uint16 :offset-assert 4) + (pad uint16 :offset-assert 6) + (ptr-data uint32 :offset-assert 8) + (morph-z uint16 :offset-assert 12) + (morph-w uint16 :offset-assert 14) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype generic-saves (structure) + ((ptr-dma uint32 :offset-assert 0) + (ptr-vtxs uint32 :offset-assert 4) + (ptr-clrs uint32 :offset-assert 8) + (ptr-texs uint32 :offset-assert 12) + (ptr-env-clrs uint32 :offset-assert 16) + (ptr-env-texs uint32 :offset-assert 20) + (cur-outbuf uint32 :offset-assert 24) + (ptr-fx-buf uint32 :offset-assert 28) + (xor-outbufs uint32 :offset-assert 32) + (num-dps uint32 :offset-assert 36) + (qwc uint32 :offset-assert 40) + (gsf-buf gsf-buffer :offset-assert 44) + (ptr-shaders uint32 :offset-assert 48) + (ptr-env-shader uint32 :offset-assert 52) + (is-envmap uint16 :offset-assert 56) + (is-translucent uint16 :offset-assert 58) + (basep uint32 :offset-assert 60) + (ptr-interp-job generic-interp-job :offset-assert 64) + (gifbuf-adr uint32 :offset-assert 68) + (inbuf-adr uint32 :offset-assert 72) + (fade-val uint32 :offset-assert 76) + (time-of-day-color rgba :offset-assert 80) + (to-vu0-waits uint32 :offset-assert 84) + (to-spr-waits uint32 :offset-assert 88) + (from-spr-waits uint32 :offset-assert 92) + (envmap generic-envmap-saves :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x170 + :flag-assert #x900000170 + ) + +(deftype generic-gif-tag (structure) + ((data uint32 4 :offset-assert 0) + (qword qword :inline :offset 0) + (fan-prim uint32 :offset 0) + (str-prim uint32 :offset 4) + (regs uint32 :offset 8) + (num-strips uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype generic-envmap-consts (structure) + ((consts vector :inline :offset-assert 0) + (strgif generic-gif-tag :inline :offset-assert 16) + (colors vector4w :inline :offset-assert 32) + (shader adgif-shader :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype generic-consts (structure) + ((dma-header dma-packet :inline :offset-assert 0) + (vif-header uint32 4 :offset-assert 16) + (dma-ref-vtxs dma-packet :inline :offset-assert 32) + (dma-cnt-call dma-packet :inline :offset-assert 48) + (matrix matrix :inline :offset-assert 64) + (base-strgif generic-gif-tag :inline :offset-assert 128) + (alpha-opaque gs-adcmd :inline :offset-assert 144) + (alpha-translucent gs-adcmd :inline :offset-assert 160) + (ztest-normal gs-adcmd :inline :offset-assert 176) + (ztest-opaque gs-adcmd :inline :offset-assert 192) + (adcmd-offsets uint8 16 :offset-assert 208) + (stcycle-tag uint32 :offset-assert 224) + (unpack-vtx-tag uint32 :offset-assert 228) + (unpack-clr-tag uint32 :offset-assert 232) + (unpack-tex-tag uint32 :offset-assert 236) + (mscal-tag uint32 :offset-assert 240) + (flush-tag uint32 :offset-assert 244) + (reset-cycle-tag uint32 :offset-assert 248) + (dummy0 uint32 :offset-assert 252) + (dma-tag-cnt uint64 :offset-assert 256) + (envmap generic-envmap-consts :inline :offset-assert 272) + (light-consts vector :inline :offset-assert 400) + (texture-offset uint16 8 :offset-assert 416) + ) + :method-count-assert 9 + :size-assert #x1b0 + :flag-assert #x9000001b0 + ) + +(deftype generic-storage (structure) + ((data uint128 16 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +(kmemopen global "gsf-buffer") +(define *gsf-buffer* (the-as gsf-buffer (kmalloc global 9216 (kmalloc-flags align-64) "malloc"))) +(kmemclose) + + + + diff --git a/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc b/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc index 7ba4ffa3c5..615a89420a 100644 --- a/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc +++ b/goal_src/jak2/engine/gfx/generic/generic-vu1-h.gc @@ -7,3 +7,83 @@ ;; DECOMP BEGINS +(deftype pris-mtx (structure) + ((data float 32 :offset-assert 0) + (vector vector 8 :offset 0) + (t-mtx matrix :inline :offset 0) + (n-mtx matrix3 :inline :offset 64) + (scale vector :inline :offset 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype generic-pris-mtx-save (structure) + ((loc-mtx pris-mtx :inline :offset-assert 0) + (par-mtx pris-mtx :inline :offset-assert 128) + (dif-mtx pris-mtx :inline :offset-assert 256) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +(deftype generic-constants (structure) + ((fog vector :inline :offset-assert 0) + (adgif gs-gif-tag :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (hmge-scale vector :inline :offset-assert 48) + (invh-scale vector :inline :offset-assert 64) + (guard vector :inline :offset-assert 80) + (flush qword :inline :offset-assert 96) + (stores qword :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype generic-shrub-constants (structure) + ((shrub-giftag generic-gif-tag :inline :offset-assert 0) + (shrub-adnop qword :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype gcf-shader (structure) + ((adgif uint128 5 :offset-assert 0) + (shader adgif-shader :inline :offset 0) + (pos uint32 :offset 12) + (num uint32 :offset 28) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype gcf-control (structure) + ((matrix matrix :inline :offset-assert 0) + (giftag generic-gif-tag :inline :offset-assert 64) + (adnops uint32 2 :offset-assert 80) + (num-strips uint32 :offset 76) + (num-dps uint32 :offset 92) + (kick-offset uint32 :offset 108) + (shader gcf-shader :inline :dynamic :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype gcf-vertex (structure) + ((tex vector4w :inline :offset-assert 0) + (clr gs-packed-rgba :inline :offset-assert 16) + (pos gs-packed-xyzw :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) diff --git a/goal_src/jak2/engine/gfx/generic/generic-work-h.gc b/goal_src/jak2/engine/gfx/generic/generic-work-h.gc index 7cc98fb439..3471d28567 100644 --- a/goal_src/jak2/engine/gfx/generic/generic-work-h.gc +++ b/goal_src/jak2/engine/gfx/generic/generic-work-h.gc @@ -7,3 +7,95 @@ ;; DECOMP BEGINS +(deftype generic-input-buffer (structure) + ((data uint128 473 :offset-assert 0) + (merc generic-merc-work :inline :offset 0) + (tie generic-tie-work :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x1d90 + :flag-assert #x900001d90 + ) + +(deftype generic-debug (structure) + ((locks uint32 4 :offset-assert 0) + (timer uint32 32 :offset-assert 16) + (count uint32 32 :offset-assert 144) + (vps uint32 32 :offset-assert 272) + (buffer int32 :offset-assert 400) + (start-addr int32 :offset-assert 404) + (lock int32 :offset-assert 408) + ) + :method-count-assert 9 + :size-assert #x19c + :flag-assert #x90000019c + ) + +(deftype generic-vu1-header (structure) + ((matrix matrix :inline :offset-assert 0) + (strgif generic-gif-tag :inline :offset-assert 64) + (adcmds gs-adcmd 2 :inline :offset-assert 80) + (adnop1 gs-adcmd :inline :offset 80) + (adnop2 gs-adcmd :inline :offset 96) + (dps uint16 :offset 92) + (kickoff uint16 :offset 108) + (strips uint16 :offset 76) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype generic-vu1-texbuf (structure) + ((header generic-vu1-header :inline :offset-assert 0) + (shader uint32 :dynamic :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype generic-texbuf (structure) + ((tag dma-packet :inline :offset-assert 0) + (header generic-vu1-header :inline :offset-assert 16) + (shader uint32 :dynamic :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype generic-effect-work (structure) + ((consts generic-consts :inline :offset-assert 0) + (storage generic-storage :inline :offset-assert 432) + (storage2 generic-storage :inline :offset-assert 688) + (lights vu-lights :inline :offset-assert 944) + ) + :method-count-assert 9 + :size-assert #x420 + :flag-assert #x900000420 + ) + +(deftype generic-effect-buffer (structure) + ((outbuf-0 uint8 3552 :offset-assert 0) + (work generic-effect-work :inline :offset-assert 3552) + (outbuf-1 uint8 3552 :offset-assert 4608) + ) + :method-count-assert 9 + :size-assert #x1fe0 + :flag-assert #x900001fe0 + ) + +(deftype generic-work (structure) + ((saves generic-saves :inline :offset-assert 0) + (storage generic-storage :inline :offset-assert 368) + (in-buf generic-input-buffer :inline :offset-assert 624) + (fx-buf generic-effect-buffer :inline :offset-assert 8192) + ) + :method-count-assert 9 + :size-assert #x3fe0 + :flag-assert #x900003fe0 + ) + + +(define *generic-debug* (new 'global 'generic-debug)) diff --git a/goal_src/jak2/engine/gfx/hw/display-h.gc b/goal_src/jak2/engine/gfx/hw/display-h.gc index b4c47f1002..a3bdbd15ce 100644 --- a/goal_src/jak2/engine/gfx/hw/display-h.gc +++ b/goal_src/jak2/engine/gfx/hw/display-h.gc @@ -7,3 +7,119 @@ ;; DECOMP BEGINS +;; At any point in time, there are 3 frames in progress: +;; - one frame is fully rendered and being drawn on the screen. +;; this frame just sits in the frame buffer, and isn't tracked by the display system. +;; - one frame is being rendered +;; (frame buffer is being written to by GS, VU1 sending tris to GS, VIF1 feeding VU1) +;; this frame needs a DMA buffer that is full, and being read by VIF1 +;; - one frame is being set up. The engine is running gameplay code and generating DMA data +;; this frame also needs a DMA buffer, which is being filled up. + +;; per-frame DMA buffers, timing, and profiling info. +(deftype display-frame (basic) + ((buffer dma-buffer 11 :offset-assert 4) + (calc-buf dma-buffer :offset 8) + (vu1-buf dma-buffer :offset 8) + (debug-buf dma-buffer :offset 36) + (global-buf dma-buffer :offset 40) + (bucket-group dma-bucket :offset 44) + (profile-array profile-array :inline :offset-assert 48) + (start-time time-frame :offset-assert 56) + (run-time time-frame :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +(defmethod new display-frame ((allocation symbol) (type-to-make type)) + "Allocate and initialize a display frame. Does not set up dma buffers." + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 calc-buf) (the-as dma-buffer 0)) + (set! (-> gp-0 global-buf) (the-as dma-buffer 0)) + (set! (-> gp-0 debug-buf) (the-as dma-buffer 0)) + ;; allocate profile buffers if debugging. + (when *debug-segment* + (set! (-> gp-0 profile-array data 0) (new 'debug 'profile-segment-array)) + (set! (-> gp-0 profile-array data 1) (new 'debug 'profile-segment-array)) + ) + gp-0 + ) + ) + +;; The display is the global state related to frame timing and double-buffering of frames. +;; it also holds the render enable mask. +(deftype display (basic) + ((on-screen int32 :offset-assert 4) ;; frame index (0 or 1) + (last-screen int32 :offset-assert 8) ;; frame index (0 or 1) + (frames display-frame 2 :offset-assert 12) ;; per-frame dma/timing + (bgcolor uint64 :offset-assert 24) ;; GS setting + (pmode gs-pmode :offset-assert 32) ;; GS setting + (clock clock 13 :offset-assert 40) + (session-clock clock :offset 40) + (game-clock clock :offset 44) + (base-clock clock :offset 48) + (real-clock clock :offset 52) + (frame-clock clock :offset 56) + (real-frame-clock clock :offset 60) + (target-clock clock :offset 64) + (entity-clock clock :offset 68) + (part-clock clock :offset 72) + (bg-clock clock :offset 76) + (camera-clock clock :offset 80) + (user0-clock clock :offset 84) + (total-game-clock clock :offset 88) + (time-factor float :offset-assert 92) + (dog-ratio float :offset-assert 96) + (vblank-start-time time-frame 2 :offset-assert 104) + (total-run-time time-frame :offset-assert 120) + (run-half-speed basic :offset-assert 128) + (dog-count float :offset-assert 132) + (vu1-enable-user vu1-renderer-mask :offset-assert 136) + (vu1-enable-user-menu vu1-renderer-mask :offset-assert 144) + (force-sync uint32 :offset-assert 152) + ) + :method-count-assert 10 + :size-assert #x9c + :flag-assert #xa0000009c + (:methods + (new (symbol type int int int int int) _type_ 0) + (set-time-ratios (_type_ float) float 9) + ) + ) + +(defconstant DEFAULT_ALL_RENDERERS + (vu1-renderer-mask + rn3 rn4 rn5 rn6 rn7 rn8 rn9 rn10 rn11 rn12 rn13 rn14 rn15 rn16 + rn17 rn18 rn19 rn20 rn21 rn22 rn23 rn24 rn25 rn26 rn27 rn28 rn29 + rn30 rn31 rn32 rn34 + ) + ) + +(define-extern set-display (function display display)) + +(defmethod new display ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set-display gp-0) + (set! (-> gp-0 frames 0) (new 'global 'display-frame)) + (set! (-> gp-0 frames 1) (new 'global 'display-frame)) + (set! (-> gp-0 pmode) (new 'static 'gs-pmode :en1 #x1 :crtmd #x1 :mmod #x1 :slbg #x1)) + (set! (-> gp-0 run-half-speed) #f) + (set! (-> gp-0 vu1-enable-user-menu) DEFAULT_ALL_RENDERERS) + (set! (-> gp-0 vu1-enable-user) DEFAULT_ALL_RENDERERS) + gp-0 + ) + ) + +;; optional functions to run before and after drawing. + +(define *pre-draw-hook* (the-as (function object none) nothing)) + +(define *post-draw-hook* (the-as (function dma-buffer none) nothing)) + + +(define-extern *display* display) diff --git a/goal_src/jak2/engine/gfx/hw/display.gc b/goal_src/jak2/engine/gfx/hw/display.gc index 0a03da9c3e..504a6c3b4d 100644 --- a/goal_src/jak2/engine/gfx/hw/display.gc +++ b/goal_src/jak2/engine/gfx/hw/display.gc @@ -7,3 +7,697 @@ ;; DECOMP BEGINS +(defun get-current-time () + "Get the base-clock time." + (-> *display* base-clock frame-counter) + ) + +(defun get-integral-current-time () + "Get the number of frames that have happened." + (-> *display* base-clock integral-frame-counter) + ) + +(defmethod set-time-ratios display ((obj display) (arg0 float)) + "Set the 'dog ratio'. This should be 1 when the game is running at full speed. + Larger dog ratio means slower." + + ;; cap ratio if we're slower than 4x + (set! (-> obj dog-ratio) (fmin 4.0 arg0)) + + ;; set the time per vsync. + (case (get-video-mode) + (('pal) + (set! (-> obj time-factor) 6.0) + ) + (else + (set! (-> obj time-factor) 5.0) + ) + ) + (-> obj dog-ratio) + ) + +(defun set-display ((arg0 display)) + "Allocate and initialize clocks for the display." + (dotimes (s5-0 13) + (set! (-> arg0 clock s5-0) (new 'global 'clock s5-0)) + ) + (set! (-> arg0 base-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 game-clock mask) (process-mask freeze pause menu progress movie)) + (set! (-> arg0 total-game-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 frame-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 target-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 camera-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 entity-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 part-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 bg-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 user0-clock mask) (process-mask freeze pause menu progress)) + (set! (-> *listener-process* clock) (-> arg0 real-clock)) + (set! (-> *active-pool* clock) (-> arg0 real-clock)) + (set! (-> *display-pool* clock) (-> arg0 real-clock)) + (set! (-> *camera-pool* clock) (-> arg0 camera-clock)) + (set! (-> *target-pool* clock) (-> arg0 target-clock)) + (set! (-> *mid-pool* clock) (-> arg0 real-clock)) + (set! (-> *pusher-pool* clock) (-> arg0 entity-clock)) + (set! (-> *entity-pool* clock) (-> arg0 entity-clock)) + (set! (-> *bg-pool* clock) (-> arg0 bg-clock)) + (set! (-> *default-pool* clock) (-> arg0 base-clock)) + arg0 + ) + +(defun allocate-dma-buffers ((arg0 display)) + "Allocate the main, debug, and calc dma buffers." + (when (zero? (-> arg0 frames 0 calc-buf)) + (set! (-> arg0 frames 0 calc-buf) (new 'global 'dma-buffer 10000)) + (set! (-> arg0 frames 1 calc-buf) (new 'global 'dma-buffer 10000)) + (set! (-> arg0 frames 0 global-buf) (new 'global 'dma-buffer #x140000)) + (set! (-> arg0 frames 1 global-buf) (new 'global 'dma-buffer #x140000)) + (when *debug-segment* + (set! (-> arg0 frames 0 debug-buf) (new 'debug 'dma-buffer #x800000)) + (set! (-> arg0 frames 1 debug-buf) (new 'debug 'dma-buffer #x800000)) + ) + ) + arg0 + ) + +(define *font-context* + (new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color zero) (font-flags shadow kerning)) + ) + +(defun draw-sprite2d-xy ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) + "Draw a sprite primitive with the given color and dimensions." + (let* ((t2-1 (new 'stack 'draw-context arg1 arg2 arg3 arg4 arg5)) + (a1-3 (max 1792 (min 2304 (+ (-> t2-1 orgx) 1792)))) + (a0-5 (max 1840 (min 2256 (+ (-> t2-1 orgy) 1840)))) + (t1-2 (-> t2-1 width)) + (a2-4 (-> t2-1 height)) + (v1-6 (-> arg0 base)) + ) + (let* ((a3-2 arg0) + (t0-2 (the-as object (-> a3-2 base))) + ) + (set! (-> (the-as dma-packet t0-2) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t0-2) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a3-2 base) (&+ (the-as pointer t0-2) 16)) + ) + (let* ((a3-3 arg0) + (t0-4 (the-as object (-> a3-3 base))) + ) + (set! (-> (the-as gs-gif-tag t0-4) tag) + (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :flg (gif-flag reg-list) :nreg #x4) + ) + (set! (-> (the-as gs-gif-tag t0-4) regs) + (new 'static 'gif-tag-regs :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2) :regs3 (gif-reg-id xyzf2)) + ) + (set! (-> a3-3 base) (&+ (the-as pointer t0-4) 16)) + ) + (let* ((a3-4 arg0) + (t0-6 (-> a3-4 base)) + ) + (set! (-> (the-as (pointer gs-prim) t0-6) 0) (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe #x1)) + (set! (-> (the-as (pointer gs-rgbaq) t0-6) 1) (the-as gs-rgbaq (-> t2-1 color 0))) + (set! (-> (the-as (pointer gs-xyzf) t0-6) 2) (new 'static 'gs-xyzf :z #x3fffff :y (* a0-5 16) :x (* a1-3 16))) + (set! (-> (the-as (pointer gs-xyzf) t0-6) 3) (new 'static 'gs-xyzf + :z #x3fffff + :y (* (max 1840 (min 2256 (+ a0-5 a2-4))) 16) + :x (* (max 1792 (min 2304 (+ a1-3 t1-2))) 16) + ) + ) + (set! (-> a3-4 base) (&+ t0-6 32)) + ) + (let ((a0-14 (/ (the-as int (+ (- -16 (the-as int v1-6)) (the-as int (-> arg0 base)))) 16))) + (cond + ((nonzero? a0-14) + (logior! (-> (the-as (pointer uint64) v1-6) 0) (shr (shl a0-14 48) 48)) + (logior! (-> (the-as (pointer uint64) v1-6) 1) (shl (shr (shl a0-14 48) 48) 32)) + ) + (else + (set! (-> arg0 base) v1-6) + ) + ) + ) + ) + (none) + ) + +(defun draw-sprite2d-xy-absolute ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) + "Draw a sprite primitive, setting the gs-xzyf register to exactly the values specified (no offset/clamp)" + (let ((t2-0 (+ arg1 1792)) + (a1-1 (+ arg2 1840)) + (v1-0 (-> arg0 base)) + ) + (let* ((a2-1 arg0) + (t3-0 (the-as object (-> a2-1 base))) + ) + (set! (-> (the-as dma-packet t3-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t3-0) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t3-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a2-1 base) (&+ (the-as pointer t3-0) 16)) + ) + (let* ((a2-2 arg0) + (t3-2 (the-as object (-> a2-2 base))) + ) + (set! (-> (the-as gs-gif-tag t3-2) tag) + (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :flg (gif-flag reg-list) :nreg #x4) + ) + (set! (-> (the-as gs-gif-tag t3-2) regs) + (new 'static 'gif-tag-regs :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2) :regs3 (gif-reg-id xyzf2)) + ) + (set! (-> a2-2 base) (&+ (the-as pointer t3-2) 16)) + ) + (let* ((a2-3 arg0) + (t3-4 (-> a2-3 base)) + ) + (set! (-> (the-as (pointer gs-prim) t3-4) 0) (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe #x1)) + (set! (-> (the-as (pointer gs-rgbaq) t3-4) 1) (the-as gs-rgbaq arg5)) + (set! (-> (the-as (pointer gs-xyzf) t3-4) 2) (new 'static 'gs-xyzf :z #x3fffff :y (* a1-1 16) :x (* t2-0 16))) + (set! (-> (the-as (pointer gs-xyzf) t3-4) 3) + (new 'static 'gs-xyzf :z #x3fffff :y (* (+ a1-1 arg4) 16) :x (* (+ t2-0 arg3) 16)) + ) + (set! (-> a2-3 base) (&+ t3-4 32)) + ) + (let ((a1-10 (/ (the-as int (+ (- -16 (the-as int v1-0)) (the-as int (-> arg0 base)))) 16))) + (cond + ((nonzero? a1-10) + (set! (-> (the-as (pointer uint64) v1-0) 0) + (logior (-> (the-as (pointer uint64) v1-0)) (shr (shl a1-10 48) 48)) + ) + (logior! (-> (the-as (pointer uint64) v1-0) 1) (shl (shr (shl a1-10 48) 48) 32)) + ) + (else + (set! (-> arg0 base) v1-0) + ) + ) + ) + ) + (none) + ) + +(defun draw-quad2d ((arg0 dma-buffer) (arg1 draw-context)) + "Draw a quad that fills the entire context" + (let ((a3-1 (max 1792 (min 2304 (+ (-> arg1 orgx) 1792)))) + (a2-3 (max 1840 (min 2256 (+ (-> arg1 orgy) 1840)))) + (t3-0 (-> arg1 width)) + (t0-2 (-> arg1 height)) + (v1-4 (-> arg0 base)) + ) + (let* ((t1-0 arg0) + (t2-0 (the-as object (-> t1-0 base))) + ) + (set! (-> (the-as dma-packet t2-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t2-0) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t2-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) + (set! (-> t1-0 base) (&+ (the-as pointer t2-0) 16)) + ) + (let* ((t1-1 arg0) + (t2-2 (the-as object (-> t1-1 base))) + ) + (set! (-> (the-as gs-gif-tag t2-2) tag) + (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :flg (gif-flag reg-list) :nreg #x9) + ) + (set! (-> (the-as gs-gif-tag t2-2) regs) (new 'static 'gif-tag-regs + :regs1 (gif-reg-id rgbaq) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id rgbaq) + :regs4 (gif-reg-id xyzf2) + :regs5 (gif-reg-id rgbaq) + :regs6 (gif-reg-id xyzf2) + :regs7 (gif-reg-id rgbaq) + :regs8 (gif-reg-id xyzf2) + ) + ) + (set! (-> t1-1 base) (&+ (the-as pointer t2-2) 16)) + ) + (let* ((t1-2 arg0) + (t2-4 (-> t1-2 base)) + ) + (set! (-> (the-as (pointer gs-prim) t2-4) 0) + (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + ) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 1) (the-as gs-rgbaq (-> arg1 color 0))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 2) (new 'static 'gs-xyzf :y (* a2-3 16) :x (* a3-1 16))) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 3) (the-as gs-rgbaq (-> arg1 color 1))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 4) + (new 'static 'gs-xyzf :y (* a2-3 16) :x (* (max 1792 (min 2304 (+ a3-1 t3-0))) 16)) + ) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 5) (the-as gs-rgbaq (-> arg1 color 2))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 6) + (new 'static 'gs-xyzf :y (* (max 1840 (min 2256 (+ a2-3 t0-2))) 16) :x (* a3-1 16)) + ) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 7) (the-as gs-rgbaq (-> arg1 color 3))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 8) (new 'static 'gs-xyzf + :y (* (max 1840 (min 2256 (+ a2-3 t0-2))) 16) + :x (* (max 1792 (min 2304 (+ a3-1 t3-0))) 16) + ) + ) + (set! (-> (the-as (pointer uint64) t2-4) 9) (the-as uint 0)) + (set! (-> t1-2 base) (&+ t2-4 80)) + ) + (let ((a1-11 (/ (the-as int (+ (- -16 (the-as int v1-4)) (the-as int (-> arg0 base)))) 16))) + (cond + ((nonzero? a1-11) + (set! (-> (the-as (pointer uint64) v1-4) 0) + (logior (-> (the-as (pointer uint64) v1-4)) (shr (shl a1-11 48) 48)) + ) + (logior! (-> (the-as (pointer uint64) v1-4) 1) (shl (shr (shl a1-11 48) 48) 32)) + ) + (else + (set! (-> arg0 base) v1-4) + ) + ) + ) + ) + (none) + ) + +(defun screen-gradient ((arg0 dma-buffer) (arg1 rgba) (arg2 rgba) (arg3 rgba) (arg4 rgba)) + "Fill the screen with a sprite with the given colors." + (let ((a1-2 (new 'stack 'draw-context 0 0 512 416 (new 'static 'rgba)))) + (set! (-> a1-2 color 0) arg1) + (set! (-> a1-2 color 1) arg2) + (set! (-> a1-2 color 2) arg3) + (set! (-> a1-2 color 3) arg4) + (draw-quad2d arg0 a1-2) + ) + (none) + ) + +(defun vif1-handler-debug () + "Handle the VIF1 interrupt. + The mark register of VIF will be set to the bucket that is now starting." + ; B0: + ; L42: + ; daddiu sp, sp, -32 + ; sd ra, 0(sp) + ; sd s7, 16(sp) + ; bgezal r0, L43 + ; sll r0, r0, 0 + + ; B1: + ; L43: + ; daddiu fp, ra, -20 + ; lw s7, L41(fp) + ; lw s7, 0(s7) + ; daddiu s7, s7, -8 + ; lw v1, *profile-interrupt-segment*(s7) + (let* ((prof *profile-interrupt-segment*) ;; v1 + ; lui a0, 4096 + ; ori a0, a0, 15360 + ; lwu a0, 48(a0) + (mark 0) ;; (-> VIF1_BANK mark) (TODO actually set mark somehow) + ; lw a1, *profile-work*(s7) + ; lw a2, 64(a1) + (last-index (-> *profile-work* last-index)) + + ; lh a3, 4(v1) + (base-time (-> prof base-time)) + ; lui a1, 4096 + ; ori a1, a1, 2048 + ; lwu a1, 0(a1) + ; sync.l + (current-time (timer-count TIMER1_BANK)) + ) + + (cond + ; sltu t0, a0, a2 t0 = (mark < last-index) + ; beq t0, r0, L46 + ; sll r0, r0, 0 + ((< mark last-index) + ;; the mark jumped backward, we must be starting a new frame + ;; clear all profile info. + + + ; B2: + ; addiu a2, r0, 0 + ; beq r0, r0, L45 + ; sll r0, r0, 0 + (dotimes (i 327) + ; B3: + ; L44: + ; dsll a3, a2, 4 + ; daddu a3, v1, a3 + ; sh r0, 48(a3) + (set! (-> prof data i start-time) 0) + ; dsll a3, a2, 4 + ; daddu a3, v1, a3 + ; sh r0, 50(a3) + (set! (-> prof data i end-time) 0) + ; dsll a3, a2, 4 + ; daddu a3, v1, a3 + ; sb r0, 53(a3) + (set! (-> prof data i count) 0) + ; daddiu a2, a2, 1 + ; B4: + ; L45: + ; slti a3, a2, 327 + ; bne a3, r0, L44 + ; sll r0, r0, 0 + ) + + ; B5: + ; or a2, s7, r0 + ; or a2, s7, r0 + ; sh a1, 4(v1) + (set! (-> prof base-time) (the int current-time)) + ; addiu a1, r0, 0 + ; sh r0, 48(v1) + (set! (-> prof data 0 start-time) 0) ;; why do it again... + ; addiu a2, r0, 327 + ; sh a2, 0(v1) + (set! (-> prof count) 327) + ; beq r0, r0, L47 + ; sll r0, r0, 0 + ) ;; end (>= mark last-index) + (else + + ; B6: + ; L46: + ; dsubu a1, a1, a3 + (let ((delta-time (- current-time base-time))) + ; dsll a2, a2, 4 + ; daddu a2, v1, a2 + ; sh a1, 50(a2) + (set! (-> prof data last-index end-time) (the int delta-time)) + ; sh a1, 50(v1) + (set! (-> prof data 0 end-time) (the int delta-time)) + ; or a2, a1, r0 + ) + ) ;; end else + ) ;; end cond + ; B7: + ; L47: + ; dsll a2, a0, 4 + ; daddu a2, v1, a2 + ; sb a0, 53(a2) + (set! (-> prof data mark count) mark) + ; dsll a2, a0, 4 + ; daddu v1, v1, a2 + ; sh a1, 48(v1) + (set! (-> prof data mark start-time) (the int current-time)) + ; lw v1, *profile-work*(s7) + ; sw a0, 64(v1) + (set! (-> *profile-work* last-index) mark) + ; lui v1, 4096 + ; ori v1, v1, 15360 + ; sw r0, 48(v1) + ;; CLEAR mark + ; addiu v1, r0, 8 + ; lui a0, 4096 + ; ori a0, a0, 15360 + ; sw v1, 16(a0) + ;; write STC to VIF FBRST (reset various things) + ; addiu v0, r0, 0 + ; ld ra, 0(sp) + ; ld s7, 16(sp) + ; sync.l + ; ei + ; jr ra + ; daddiu sp, sp, 32 + ) + + (none) + ;; .endfunction + ) + +;; definition for function vif1-handler +;; ERROR: function was not converted to expressions. Cannot decompile. +(defun vif1-handler () + ; B0: + ; L8: + ; daddiu sp, sp, -32 + ; sd ra, 0(sp) + ; sd s7, 16(sp) + ; bgezal r0, L9 + ; sll r0, r0, 0 + + ; B1: + ; L9: + ; daddiu fp, ra, -20 + ; lw s7, L7(fp) + ; lw s7, 0(s7) + ; daddiu s7, s7, -8 + + ; lui v1, 4096 + ; ori v1, v1, 15360 + ; sw r0, 48(v1) + ;; clear mark + + ; addiu v1, r0, 8 + ; lui a0, 4096 + ; ori a0, a0, 15360 + ; sw v1, 16(a0) + ;; write STC to VIF FBRST (reset various things) + + ; addiu v0, r0, 0 + ; ld ra, 0(sp) + ; ld s7, 16(sp) + ; sync.l + ; ei + ; jr ra + ; daddiu sp, sp, 32 + + ; sll r0, r0, 0 + ; sll r0, r0, 0 + ) + +(install-handler 5 (if *debug-segment* + vif1-handler-debug + vif1-handler + ) + ) + +(defun vblank-handler () + "Record the time of the last two vblanks." + ; L5: + ; daddiu sp, sp, -32 + ; sd ra, 0(sp) + ; sd s7, 16(sp) + ; bgezal r0, L6 + ; sll r0, r0, 0 + + ; B1: + ; L6: + ; daddiu fp, ra, -20 + ; lw s7, L4(fp) + ; lw s7, 0(s7) + ; daddiu s7, s7, -8 + ; lw v1, *display*(s7) + ; ld v1, 108(v1) + ; lw a0, *display*(s7) + ; sd v1, 100(a0) + (set! (-> *display* vblank-start-time 0) (-> *display* vblank-start-time 1)) + ; lw t9, timer-count(s7) + ; lui v1, 4096 + ; ori a0, v1, 2048 + ; jalr ra, t9 + ; sll v0, ra, 0 + + ; lw v1, *display*(s7) + ; sd v0, 108(v1) + (set! (-> *display* vblank-start-time 1) (the-as time-frame (timer-count TIMER1_BANK))) ;; not really a time-frame. + ; addiu v0, r0, 0 + 0 + ; ld ra, 0(sp) + ; ld s7, 16(sp) + ; sync.l + ; ei + ; jr ra + ; daddiu sp, sp, 32 + + ; sll r0, r0, 0 + ; sll r0, r0, 0 + ) + +(defun set-display-gs-state ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (let ((t2-0 (/ (+ arg2 63) 64))) + (let* ((v1-1 arg0) + (t3-0 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet t3-0) dma) (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t3-0) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet t3-0) vif1) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer t3-0) 16)) + ) + (let* ((v1-2 arg0) + (t3-2 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag t3-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) + (set! (-> (the-as gs-gif-tag t3-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-2 base) (&+ (the-as pointer t3-2) 16)) + ) + (let* ((v1-3 arg0) + (t3-4 (-> v1-3 base)) + ) + (set! (-> (the-as (pointer gs-scissor) t3-4) 0) + (new 'static 'gs-scissor :scax1 (+ arg2 -1) :scay1 (+ arg3 -1)) + ) + (set! (-> (the-as (pointer gs-reg64) t3-4) 1) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-xy-offset) t3-4) 2) (new 'static 'gs-xy-offset)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 3) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) t3-4) 4) + (new 'static 'gs-frame :fbp arg1 :fbw t2-0 :psm arg5 :fbmsk arg4) + ) + (set! (-> (the-as (pointer gs-reg64) t3-4) 5) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-test) t3-4) 6) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) + (set! (-> (the-as (pointer gs-reg64) t3-4) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-texa) t3-4) 8) (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-zbuf) t3-4) 10) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 11) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer uint64) t3-4) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 13) (gs-reg64 texflush)) + (set! (-> v1-3 base) (&+ t3-4 112)) + ) + ) + arg0 + ) + +(defun set-display-gs-state-offset ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int) (arg6 int) (arg7 int)) + (let ((t4-0 (/ (+ arg2 63) 64))) + (let* ((v1-1 arg0) + (t5-0 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet t5-0) dma) (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t5-0) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet t5-0) vif1) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer t5-0) 16)) + ) + (let* ((v1-2 arg0) + (t5-2 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag t5-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) + (set! (-> (the-as gs-gif-tag t5-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-2 base) (&+ (the-as pointer t5-2) 16)) + ) + (let* ((v1-3 arg0) + (t5-4 (-> v1-3 base)) + ) + (set! (-> (the-as (pointer gs-scissor) t5-4) 0) + (new 'static 'gs-scissor :scax1 (+ arg2 -1) :scay1 (+ arg3 -1)) + ) + (set! (-> (the-as (pointer gs-reg64) t5-4) 1) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-xy-offset) t5-4) 2) + (new 'static 'gs-xy-offset :ofx (* arg6 16) :ofy (* arg7 16)) + ) + (set! (-> (the-as (pointer gs-reg64) t5-4) 3) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) t5-4) 4) + (new 'static 'gs-frame :fbp arg1 :fbw t4-0 :psm arg5 :fbmsk arg4) + ) + (set! (-> (the-as (pointer gs-reg64) t5-4) 5) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-test) t5-4) 6) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) + (set! (-> (the-as (pointer gs-reg64) t5-4) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-texa) t5-4) 8) (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) t5-4) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-zbuf) t5-4) 10) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (set! (-> (the-as (pointer gs-reg64) t5-4) 11) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer uint64) t5-4) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) t5-4) 13) (gs-reg64 texflush)) + (set! (-> v1-3 base) (&+ t5-4 112)) + ) + ) + arg0 + ) + +(defun reset-display-gs-state ((arg0 display) (arg1 dma-buffer) (arg2 int)) + (let* ((v1-0 arg1) + (a2-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a2-1) dma) (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a2-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet a2-1) vif1) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a2-1) 16)) + ) + (let* ((v1-1 arg1) + (a2-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a2-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) + (set! (-> (the-as gs-gif-tag a2-3) regs) + (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-1 base) (&+ (the-as pointer a2-3) 16)) + ) + (let* ((v1-2 arg1) + (a1-1 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-scissor) a1-1) 0) (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 1) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-xy-offset) a1-1) 2) (new 'static 'gs-xy-offset :ofx #x7000 :ofy #x7300)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 3) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) a1-1) 4) (new 'static 'gs-frame :fbp #x198 :fbw #x8)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 5) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-test) a1-1) 6) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))) + (set! (-> (the-as (pointer gs-reg64) a1-1) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-texa) a1-1) 8) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-zbuf) a1-1) 10) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24))) + (set! (-> (the-as (pointer gs-reg64) a1-1) 11) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer uint64) a1-1) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 13) (gs-reg64 texflush)) + (set! (-> v1-2 base) (&+ a1-1 112)) + ) + arg0 + ) + +(kmemopen global "dma-buffers") + +(define *vu0-dma-list* (new 'global 'dma-buffer 4096)) +(define *display* (new 'global 'display 0 512 416 2 49)) +(allocate-dma-buffers *display*) +(kmemclose) + + + + diff --git a/goal_src/jak2/engine/gfx/hw/gs.gc b/goal_src/jak2/engine/gfx/hw/gs.gc index da9a248cfc..a67fde3924 100644 --- a/goal_src/jak2/engine/gfx/hw/gs.gc +++ b/goal_src/jak2/engine/gfx/hw/gs.gc @@ -5,5 +5,1103 @@ ;; name in dgo: gs ;; dgos: ENGINE, GAME +(defenum gs-psm + :bitfield #f + :type uint8 + (ct32 0) + (ct24 1) + (ct16 2) + (ct16s 10) + (mt8 19) + (mt4 20) + (mt8h 27) + (mt4hl 36) + (mt4hh 44) + (mz32 48) + (mz24 49) + (mz16 50) + (mz16s 58) + ) + +(defenum gs-reg + :type uint8 + (prim 0) + (rgbaq 1) + (st 2) + (uv 3) + (xyzf2 4) + (xyz2 5) + (tex0-1 6) + (tex0-2 7) + (clamp-1 8) + (clamp-2 9) + (fog 10) + (xyzf3 12) + (xyz3 13) + (tex1-1 20) + (tex1-2 21) + (tex2-1 22) + (tex2-2 23) + (xyoffset-1 24) + (xyoffset-2 25) + (prmodecont 26) + (prmode 27) + (texclut 28) + (scanmsk 34) + (miptbp1-1 52) + (miptbp1-2 53) + (miptbp2-1 54) + (miptbp2-2 55) + (texa 59) + (fogcol 61) + (texflush 63) + (scissor-1 64) + (scissor-2 65) + (alpha-1 66) + (alpha-2 67) + (dimx 68) + (dthe 69) + (colclamp 70) + (test-1 71) + (test-2 72) + (pabe 73) + (fba-1 74) + (fba-2 75) + (frame-1 76) + (frame-2 77) + (zbuf-1 78) + (zbuf-2 79) + (bitbltbuf 80) + (trxpos 81) + (trxreg 82) + (trxdir 83) + (hwreg 84) + (signal 96) + (finish 97) + (label 98) + ) + +(defenum gs-reg64 + :type uint64 + :copy-entries gs-reg + ) + +(defenum gs-prim-type + :type uint8 + (point 0) + (line 1) + (line-strip 2) + (tri 3) + (tri-strip 4) + (tri-fan 5) + (sprite 6) + ) + + ;; DECOMP BEGINS +;; the GS's PMODE register makes various settings for the PCRTC. +(deftype gs-pmode (uint64) + ((en1 uint8 :offset 0 :size 1) + (en2 uint8 :offset 1 :size 1) + (crtmd uint8 :offset 2 :size 3) + (mmod uint8 :offset 5 :size 1) + (amod uint8 :offset 6 :size 1) + (slbg uint8 :offset 7 :size 1) + (alp uint8 :offset 8 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's SMODE2 register makes settings related to PCRTC video synchronization. +(deftype gs-smode2 (uint64) + ((int uint8 :offset 0 :size 1) + (ffmd uint8 :offset 1 :size 1) + (dpms uint8 :offset 2 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(defun psm-size ((arg0 gs-psm)) + "Convert texture format to some type of size." + (cond + ((= arg0 (gs-psm mt8)) + 64 + ) + ((= arg0 (gs-psm mt4)) + 32 + ) + ((or (= arg0 (gs-psm ct16)) (= arg0 (gs-psm ct16s)) (= arg0 (gs-psm mz16)) (= arg0 (gs-psm mz16s))) + 128 + ) + (else + 256 + ) + ) + ) + +(defun psm-page-height ((arg0 gs-psm)) + "Convert texture format to some type of page height" + (cond + ((= arg0 (gs-psm mt8)) + 64 + ) + ((= arg0 (gs-psm mt4)) + 128 + ) + ((or (= arg0 (gs-psm ct16)) (= arg0 (gs-psm ct16s)) (= arg0 (gs-psm mz16)) (= arg0 (gs-psm mz16s))) + 64 + ) + (else + 32 + ) + ) + ) + +(defun psm->string ((arg0 gs-psm)) + "Get the name of a texture format." + (case arg0 + (((gs-psm ct24)) + "ct24" + ) + (((gs-psm mt4)) + "mt4" + ) + (((gs-psm ct32)) + "ct32" + ) + (((gs-psm mz16s)) + "mz16s" + ) + (((gs-psm ct16s)) + "ct16s" + ) + (((gs-psm mt8)) + "mt8" + ) + (((gs-psm mt8h)) + "mt8h" + ) + (((gs-psm mz16)) + "mz16" + ) + (((gs-psm mz24)) + "mz24" + ) + (((gs-psm mt4hh)) + "mt4hh" + ) + (((gs-psm ct16)) + "ct16" + ) + (((gs-psm mt4hl)) + "mt4hl" + ) + (((gs-psm mz32)) + "mz32" + ) + (else + "*unknown*" + ) + ) + ) + +;; the GS's DISPFB registers make settings for the frame buffer regarding information on +;; Rectangular Area Read Output Circuit n for the PCRTC. +;; write-only +(deftype gs-display-fb (uint64) + ((fbp uint16 :offset 0 :size 9) + (fbw uint8 :offset 9 :size 6) + (psm gs-psm :offset 15 :size 5) + (dbx uint16 :offset 32 :size 11) + (dby uint16 :offset 43 :size 11) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's DISPLAY registers make settings for the display position on the screen regarding +;; information on Rectangular Area Read Output Circuit n for the PCRTC. +;; write-only +(deftype gs-display (uint64) + ((dx uint16 :offset 0 :size 12) + (dy uint16 :offset 12 :size 11) + (magh uint8 :offset 23 :size 4) + (magv uint8 :offset 27 :size 2) + (dw uint16 :offset 32 :size 12) + (dh uint16 :offset 44 :size 11) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's BGCOLOR register sets the background color of the PCRTC with RGB value. +;; write-only +(deftype gs-bgcolor (uint64) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's CSR register sets and obtains various GS statuses. +;; read-write. the fields have different effects depending on whether they're being read from +;; or written to. +;; bits 5 and 6 (0x20 and 0x40) should be zero +(deftype gs-csr (uint64) + ((signal uint8 :offset 0 :size 1) + (finish uint8 :offset 1 :size 1) + (hsint uint8 :offset 2 :size 1) + (vsint uint8 :offset 3 :size 1) + (edwint uint8 :offset 4 :size 1) + (flush uint8 :offset 8 :size 1) + (reset uint8 :offset 9 :size 1) + (nfield uint8 :offset 12 :size 1) + (field uint8 :offset 13 :size 1) + (fifo uint8 :offset 14 :size 2) + (rev uint8 :offset 16 :size 8) + (id uint8 :offset 24 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; memory layout of the GS's privileged registers (mapped to EE memory) +;; it is missing the SIGLBLID/LABELID register at 4224 (useless anyway?) +(deftype gs-bank (structure) + ((pmode gs-pmode :offset-assert 0) + (smode2 gs-smode2 :offset 32) + (dspfb1 gs-display-fb :offset 112) + (display1 gs-display :offset 128) + (dspfb2 gs-display-fb :offset 144) + (display2 gs-display :offset 160) + (extbuf uint64 :offset 176) + (extdata uint64 :offset 192) + (extwrite uint64 :offset 208) + (bgcolor gs-bgcolor :offset 224) + (csr gs-csr :offset 4096) + (imr uint64 :offset 4112) + (busdir uint64 :offset 4160) + ) + :method-count-assert 9 + :size-assert #x1048 + :flag-assert #x900001048 + ) + +;; the GS's FRAME registers store various settings related to the frame buffer. +(deftype gs-frame (uint64) + ((fbp uint16 :offset 0 :size 9) + (fbw uint8 :offset 16 :size 6) + (psm gs-psm :offset 24 :size 6) + (fbmsk uint32 :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's ZBUF registers make various settings regarding Z buffer. +(deftype gs-zbuf (uint64) + ((zbp uint16 :offset 0 :size 9) + (psm gs-psm :offset 24 :size 4) + (zmsk uint8 :offset 32 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's XYOFFSET registers set the offset value for converting from the primitive coordinate +;; system to the window coordinate system. +(deftype gs-xy-offset (uint64) + ((ofx uint16 :offset 0 :size 16) + (ofy uint16 :offset 32 :size 16) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's SCISSOR registers specify the scissoring area. The coordinate values for +;; the upper-left/lower-right points of the enabled drawing area are specified by the window +;; coordinate system. +(deftype gs-scissor (uint64) + ((scax0 uint16 :offset 0 :size 11) + (scax1 uint16 :offset 16 :size 11) + (scay0 uint16 :offset 32 :size 11) + (scay1 uint16 :offset 48 :size 11) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's PRMODECONT register sets whether to use primitive attributes (IIP, TME, FGE, ABE, +;; AA1, FST, CTXT, FIX) specified by the PRMODE register or the PRIM register. +(deftype gs-prmode-cont (uint64) + ((ac uint8 :offset 0 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's COLCLAMP register stores settings as to whether clamping for the RGB value of the +;; pixel is performed. +(deftype gs-color-clamp (uint64) + ((clamp uint8 :offset 0 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's DTHE register stores settings for dithering (performed/not performed). +(deftype gs-dthe (uint64) + ((dthe uint8 :offset 0 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(defenum gs-atest + :type uint8 + (never 0) + (always 1) + (less 2) + (less-equal 3) + (equal 4) + (greater-equal 5) + (greater 6) + (not-equal 7) + ) +(defenum gs-ztest + :type uint8 + (never 0) + (always 1) + (greater-equal 2) + (greater 3) + ) + +(deftype gs-test (uint64) + ((ate uint8 :offset 0 :size 1) ;; alpha test enable + (atst gs-atest :offset 1 :size 3) ;; alpha test method + (aref uint8 :offset 4 :size 8) ;; alpha val reference + (afail uint8 :offset 12 :size 2) ;; processing method on alpha test fail + (date uint8 :offset 14 :size 1) ;; dest alpha test enable + (datm uint8 :offset 15 :size 1) ;; dest alpha test mode + (zte uint8 :offset 16 :size 1) ;; depth test enable + (ztst gs-ztest :offset 17 :size 2) ;; depth test method + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(defenum gs-prim-type + :type uint8 + (point 0) + (line 1) + (line-strip 2) + (tri 3) + (tri-strip 4) + (tri-fan 5) + (sprite 6) + ) + +;; the GS's PRIM register specifies the types of drawing primitives and various attributes, and +;; initializes the contents of the vertex queue. +(deftype gs-prim (uint64) + ((prim gs-prim-type :offset 0 :size 3) + (iip uint8 :offset 3 :size 1) + (tme uint8 :offset 4 :size 1) + (fge uint8 :offset 5 :size 1) + (abe uint8 :offset 6 :size 1) + (aa1 uint8 :offset 7 :size 1) + (fst uint8 :offset 8 :size 1) + (ctxt uint8 :offset 9 :size 1) + (fix uint8 :offset 10 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's RGBAQ register sets the RGBA value of the vertex and the Q value of the normalized +;; texture coordinates. +(deftype gs-rgbaq (uint64) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + (a uint8 :offset 24 :size 8) + (q float :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; GS XYZ registers +(deftype gs-xyz (uint64) + ((x uint16 :offset 0 :size 16) + (y uint16 :offset 16 :size 16) + (z uint32 :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's UV register specifies the texel coordinate (UV) values of the vertex. +(deftype gs-uv (uint64) + ((u uint16 :offset 0 :size 14) + (v uint16 :offset 16 :size 14) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's ST register sets the S and T values of the vertex texture coordinates. +;; The value Q is specified by the RGBAQ register. +(deftype gs-st (uint64) + ((s float :offset 0 :size 32) + (t float :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; GS XYZF registers +(deftype gs-xyzf (uint64) + ((x uint16 :offset 0 :size 16) + (y uint16 :offset 16 :size 16) + (z uint32 :offset 32 :size 24) + (f uint8 :offset 56 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; Adress + Data command +(deftype gs-adcmd (structure) + ((word uint32 4 :offset-assert 0) + (quad uint128 :offset 0) + (data uint64 :offset 0) + (cmds uint64 :offset 8) + (cmd uint8 :offset 8) + (x uint32 :offset 0) + (y uint32 :offset 4) + (z uint32 :offset 8) + (w uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; the GS's TRXPOS register specifies the position and scanning direction of the rectangular area +;; in each buffer where buffer transmission is performed. +(deftype gs-trxpos (uint64) + ((ssax uint16 :offset 0 :size 11) + (ssay uint16 :offset 16 :size 11) + (dsax uint16 :offset 32 :size 11) + (dsay uint16 :offset 48 :size 11) + (dir uint8 :offset 59 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's TRXREG register specifies the size of the rectangular area, where the transmission +;; between buffers is implemented, in units of pixels. +;; The pixel mode must be the one set by the BITBLTBUF register. +(deftype gs-trxreg (uint64) + ((rrw uint16 :offset 0 :size 12) + (rrh uint16 :offset 32 :size 12) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's TRXDIR register specifies the transmission direction in the transmission between +;; buffers, and activates transmission. +;; Appropriate settings must be made by the BITBLTBUF/TRXPOS/TRXREG before activating +;; the transmission. +(deftype gs-trxdir (uint64) + ((xdir uint8 :offset 0 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's BITBLTBUF register stores buffer-related settings for transmission source and +;; destination during transmission between buffers. +(deftype gs-bitbltbuf (uint64) + ((sbp uint16 :offset 0 :size 14) + (sbw uint8 :offset 16 :size 6) + (spsm uint8 :offset 24 :size 6) + (dbp uint16 :offset 32 :size 14) + (dbw uint8 :offset 48 :size 6) + (dpsm uint8 :offset 56 :size 6) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's TEX0 registers set various kinds of information regarding the textures to be used. +(deftype gs-tex0 (uint64) + ((tbp0 uint16 :offset 0 :size 14) + (tbw uint8 :offset 14 :size 6) + (psm uint8 :offset 20 :size 6) + (tw uint8 :offset 26 :size 4) + (th uint8 :offset 30 :size 4) + (tcc uint8 :offset 34 :size 1) + (tfx uint8 :offset 35 :size 2) + (cbp uint16 :offset 37 :size 14) + (cpsm uint8 :offset 51 :size 4) + (csm uint8 :offset 55 :size 1) + (csa uint8 :offset 56 :size 5) + (cld uint8 :offset 61 :size 3) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's TEX1 registers set information on the sampling method of the textures. +(deftype gs-tex1 (uint64) + ((lcm uint8 :offset 0 :size 1) + (mxl uint8 :offset 2 :size 3) + (mmag uint8 :offset 5 :size 1) + (mmin uint8 :offset 6 :size 3) + (mtba uint8 :offset 9 :size 1) + (l uint8 :offset 19 :size 2) + (k int16 :offset 32 :size 12) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's TEXA register sets the Alpha value to be referred to when the Alpha value of the +;; texture is not an 8-bit value. +(deftype gs-texa (uint64) + ((ta0 uint8 :offset 0 :size 8) + (aem uint8 :offset 15 :size 1) + (ta1 uint8 :offset 32 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's TEXCLUT register specifies the CLUT position in the buffer when the CLUT storage mode +;; is CSM=1 (CSM2 mode). +(deftype gs-texclut (uint64) + ((cbw uint8 :offset 0 :size 6) + (cou uint8 :offset 6 :size 6) + (cov uint16 :offset 12 :size 10) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's MIPTBP registers set the buffer pointer and buffer width of textures when performing +;; MIPMAP. +;; MIPTBP1 sets levels 1 to 3, MIPTBP2 sets levels 4 to 6. +(deftype gs-miptbp (uint64) + ((tbp1 uint16 :offset 0 :size 14) + (tbw1 uint8 :offset 14 :size 6) + (tbp2 uint16 :offset 20 :size 14) + (tbw2 uint8 :offset 34 :size 6) + (tbp3 uint16 :offset 40 :size 14) + (tbw3 uint8 :offset 54 :size 6) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's ALPHA registers define the blend function of alpha blending +(deftype gs-alpha (uint64) + ((a uint8 :offset 0 :size 2) + (b uint8 :offset 2 :size 2) + (c uint8 :offset 4 :size 2) + (d uint8 :offset 6 :size 2) + (fix uint8 :offset 32 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; the GS's CLAMP registers set the texture's wrap mode (repeating or clamping) for both S and T. +(defenum gs-tex-wrap-mode + :type uint8 + (repeat 0) + (clamp 1) + (region-clamp 2) + (region-repeat 3) + ) + +(deftype gs-clamp (uint64) + ((wms gs-tex-wrap-mode :offset 0 :size 2) + (wmt gs-tex-wrap-mode :offset 2 :size 2) + (minu uint16 :offset 4 :size 10) + (maxu uint16 :offset 14 :size 10) + (minv uint16 :offset 24 :size 10) + (maxv uint16 :offset 34 :size 10) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype gs-fog (uint64) + ((f uint8 :offset 56 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype gs-fogcol (uint64) + ((fcr uint8 :offset 0 :size 8) + (fcg uint8 :offset 8 :size 8) + (fcb uint8 :offset 16 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype gif-ctrl (uint32) + ((rst uint8 :offset 0 :size 1) + (pse uint8 :offset 3 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-mode (uint32) + ((m3r uint8 :offset 0 :size 1) + (imt uint8 :offset 2 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-stat (uint32) + ((m3r uint8 :offset 0 :size 1) + (m3p uint8 :offset 1 :size 1) + (imt uint8 :offset 2 :size 1) + (pse uint8 :offset 3 :size 1) + (ip3 uint8 :offset 5 :size 1) + (p3q uint8 :offset 6 :size 1) + (p2q uint8 :offset 7 :size 1) + (p1q uint8 :offset 8 :size 1) + (oph uint8 :offset 9 :size 1) + (apath uint8 :offset 10 :size 2) + (dir uint8 :offset 12 :size 1) + (fqc uint8 :offset 24 :size 5) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-cnt (uint32) + ((loopcnt uint16 :offset 0 :size 15) + (regcnt uint8 :offset 16 :size 4) + (vuaddr uint16 :offset 20 :size 10) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-p3cnt (uint32) + ((p3cnt uint16 :offset 0 :size 15) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-p3tag (uint32) + ((loopcnt uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-bank (structure) + ((ctrl gif-ctrl :offset 0) + (mode gif-mode :offset 16) + (stat gif-stat :offset 32) + (tag0 uint32 :offset 64) + (tag1 uint32 :offset 80) + (tag2 uint32 :offset 96) + (tag3 uint32 :offset 112) + (cnt gif-cnt :offset 128) + (p3cnt gif-p3cnt :offset 144) + (p3tag gif-p3tag :offset 160) + ) + :method-count-assert 9 + :size-assert #xa4 + :flag-assert #x9000000a4 + ) + +(deftype gif-tag-prim (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype gif-tag-count (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(defenum gif-reg-id + :type uint8 + (prim 0) + (rgbaq 1) + (st 2) + (uv 3) + (xyzf2 4) + (xyz2 5) + (tex0-1 6) + (tex0-2 7) + (clamp-1 8) + (clamp-2 9) + (fog 10) + (xyzf3 12) + (xyz3 13) + (a+d 14) + (nop 15) + ) + +(defenum gif-flag + :type uint8 + (packed 0) + (reg-list 1) + (image 2) + (disable 3) + ) + +(deftype gif-tag64 (uint64) + ((nloop uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + (id uint16 :offset 32 :size 14) + (pre uint8 :offset 46 :size 1) + (prim gs-prim :offset 47 :size 11) + (flg gif-flag :offset 58 :size 2) + (nreg uint8 :offset 60 :size 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype gif-tag (uint128) + ((nloop uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + (id uint16 :offset 32 :size 14) + (pre uint8 :offset 46 :size 1) + (prim uint16 :offset 47 :size 11) + (flg gif-flag :offset 58 :size 2) + (nreg uint8 :offset 60 :size 4) + (regs0 gif-reg-id :offset 64 :size 4) + (regs1 gif-reg-id :offset 68 :size 4) + (regs2 gif-reg-id :offset 72 :size 4) + (regs3 gif-reg-id :offset 76 :size 4) + (regs4 gif-reg-id :offset 80 :size 4) + (regs5 gif-reg-id :offset 84 :size 4) + (regs6 gif-reg-id :offset 88 :size 4) + (regs7 gif-reg-id :offset 92 :size 4) + (regs8 gif-reg-id :offset 96 :size 4) + (regs9 gif-reg-id :offset 100 :size 4) + (regs10 gif-reg-id :offset 104 :size 4) + (regs11 gif-reg-id :offset 108 :size 4) + (regs12 gif-reg-id :offset 112 :size 4) + (regs13 gif-reg-id :offset 116 :size 4) + (regs14 gif-reg-id :offset 120 :size 4) + (regs15 gif-reg-id :offset 124 :size 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gif-tag-regs (uint64) + ((regs0 gif-reg-id :offset 0 :size 4) + (regs1 gif-reg-id :offset 4 :size 4) + (regs2 gif-reg-id :offset 8 :size 4) + (regs3 gif-reg-id :offset 12 :size 4) + (regs4 gif-reg-id :offset 16 :size 4) + (regs5 gif-reg-id :offset 20 :size 4) + (regs6 gif-reg-id :offset 24 :size 4) + (regs7 gif-reg-id :offset 28 :size 4) + (regs8 gif-reg-id :offset 32 :size 4) + (regs9 gif-reg-id :offset 36 :size 4) + (regs10 gif-reg-id :offset 40 :size 4) + (regs11 gif-reg-id :offset 44 :size 4) + (regs12 gif-reg-id :offset 48 :size 4) + (regs13 gif-reg-id :offset 52 :size 4) + (regs14 gif-reg-id :offset 56 :size 4) + (regs15 gif-reg-id :offset 60 :size 4) + ) + ) + +;; we unfortunately kind of need this +(defmacro gif-tag->static-array (tag regs) + "Allocates a new static array of two uint64's making up the gif-tag and the tag registers" + + `(new 'static 'array uint64 2 ,tag ,regs) + ) + +(defmacro gif-prim (prim-type) + `(new 'static 'gs-prim :prim (gs-prim-type ,prim-type) :iip 1 :abe 1) + ) + +(defmacro gs-reg-list (&rest reg-ids) + "Generate a giftag register descriptor list from reg-ids." + + (let ((reg-count (length reg-ids))) + (when (> (length reg-ids) 16) + (ferror "too many regs passed to gs-reg-list") + ) + (let ((list-to-splice '()) + (cur-lst reg-ids) + (i -1)) + + ;; this is questionable. + (while (and (not (null? cur-lst)) (< i 15)) + (push! list-to-splice (cons 'gif-reg-id (cons (car cur-lst) '()))) + (push! list-to-splice (string->symbol-format ":regs{}" (inc! i))) + (pop! cur-lst) + ) + + `(new 'static 'gif-tag-regs + ,@list-to-splice + ) + ) + #| ;; the opengoal compiler does not have enough constant propagation for this for now + (let ((i -1)) + + `(the-as gif-tag-regs (logior ,@(apply (lambda (x) + `(shl (the-as uint (gif-reg-id ,x)) ,(* 4 (inc! i))) + ) reg-ids) + )) + + )|# + ) + ) + +(deftype gs-gif-tag (structure) + ((qword uint128 :offset-assert 0) + (tag gif-tag64 :offset 0) + (regs gif-tag-regs :offset 8) + (dword uint64 2 :offset 0) + (word uint32 4 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defmethod inspect gif-tag ((obj gif-tag)) + (format #t "[~8x] gif-tag~%" obj) + (format #t "~Tnloop: ~4d~%" (-> obj nloop)) + (format #t "~Teop : ~4d~%" (-> obj eop)) + (format #t "~Tid : ~4d~%" (-> obj id)) + (format #t "~Tpre : ~4d~%" (-> obj pre)) + (format #t "~Tprim : ~4d~%" (-> obj prim)) + (format #t "~Tflg : ~4d~%" (-> obj flg)) + (format #t "~Tnreg : ~4d~%" (-> obj nreg)) + (format #t "~Tregs0 : ~4d~%" (-> obj regs0)) + (format #t "~Tregs1 : ~4d~%" (-> obj regs1)) + (format #t "~Tregs2 : ~4d~%" (-> obj regs2)) + (format #t "~Tregs3 : ~4d~%" (-> obj regs3)) + (format #t "~Tregs4 : ~4d~%" (-> obj regs4)) + (format #t "~Tregs5 : ~4d~%" (-> obj regs5)) + (format #t "~Tregs6 : ~4d~%" (-> obj regs6)) + (format #t "~Tregs7 : ~4d~%" (-> obj regs7)) + (format #t "~Tregs8 : ~4d~%" (-> obj regs8)) + (format #t "~Tregs9 : ~4d~%" (-> obj regs9)) + (format #t "~Tregs10: ~4d~%" (-> obj regs10)) + (format #t "~Tregs11: ~4d~%" (-> obj regs11)) + (format #t "~Tregs12: ~4d~%" (-> obj regs12)) + (format #t "~Tregs13: ~4d~%" (-> obj regs13)) + (format #t "~Tregs14: ~4d~%" (-> obj regs14)) + (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> obj regs15))) + ) + +(define *fog-color* (new 'static 'rgba :r #x80)) + +;; Unused type for building a dynamically sized gif packet. +(deftype gif-packet (basic) + ((reg-count int32 :offset-assert 4) + (gif-tag gs-gif-tag :inline :offset-assert 16) + (gif-tag0 uint128 :offset 16) + (args uint64 1 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type int) _type_ 0) + ) + ) + +(defmethod new gif-packet ((allocation symbol) (type-to-make type) (arg0 int)) + "Allocate a gif packet with enough room for arg0 64-bit args." + (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 8)))) + ) + +(defun open-gif-packet ((arg0 gif-packet)) + "Initialize an existing gif-packet for 0 registers" + (set! (-> arg0 reg-count) 0) + (set! (-> arg0 gif-tag regs) (new 'static 'gif-tag-regs)) + arg0 + ) + +(defun add-reg-gif-packet ((arg0 gif-packet) (arg1 int) (arg2 int)) + "Add a register + value to the packet" + (let ((v1-0 (-> arg0 gif-tag))) + (logior! (-> v1-0 regs) (ash arg1 (* (-> arg0 reg-count) 4))) + ) + (set! (-> (&-> arg0 args (-> arg0 reg-count)) 0) (the-as uint arg2)) + (+! (-> arg0 reg-count) 1) + (none) + ) + +(defun close-gif-packet ((arg0 gif-packet) (arg1 int)) + "Finish adding registers." + (set! (-> arg0 gif-tag tag) + (new 'static 'gif-tag64 :nloop #x1 :flg (gif-flag reg-list) :eop arg1 :nreg (-> arg0 reg-count)) + ) + arg0 + ) + +;; simple drawing context (origin, size, color) used in very simple software renderers for debug quad rendering. +(deftype draw-context (basic) + ((orgx int32 :offset-assert 4) + (orgy int32 :offset-assert 8) + (orgz int32 :offset-assert 12) + (width int32 :offset-assert 16) + (height int32 :offset-assert 20) + (color rgba 4 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type int int int int rgba) _type_ 0) + ) + ) + +(defmethod new draw-context ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 rgba)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 orgx) arg0) + (set! (-> v0-0 orgy) arg1) + (set! (-> v0-0 orgz) #xffffff) + (set! (-> v0-0 width) arg2) + (set! (-> v0-0 height) arg3) + (set! (-> v0-0 color 0) arg4) + v0-0 + ) + ) + +(defun draw-context-set-xy ((arg0 draw-context) (arg1 int) (arg2 int)) + "Set the origin of the draw context." + (set! (-> arg0 orgx) arg1) + (set! (-> arg0 orgy) arg2) + (none) + ) + +(deftype gs-packed-rgba (vector4w) + ((r int32 :offset 0) + (g int32 :offset 4) + (b int32 :offset 8) + (a int32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gs-packed-xyzw (vector) + ((ix int32 :offset 0) + (iy int32 :offset 4) + (iz int32 :offset 8) + (iw int32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gs-packed-stq (vector) + ((tex-s float :offset 0) + (tex-t float :offset 4) + (tex-q float :offset 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gs-packed-uv (vector) + ((u int16 :offset 0) + (v int16 :offset 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype gs-packed-gt (structure) + ((stq gs-packed-stq :inline :offset 0) + (rgba gs-packed-rgba :inline :offset 16) + (xyzw gs-packed-xyzw :inline :offset 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype gs-packed-gt4 (structure) + ((data gs-packed-gt 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) diff --git a/goal_src/jak2/engine/gfx/hw/video-h.gc b/goal_src/jak2/engine/gfx/hw/video-h.gc index 3522786801..4810ccb0b3 100644 --- a/goal_src/jak2/engine/gfx/hw/video-h.gc +++ b/goal_src/jak2/engine/gfx/hw/video-h.gc @@ -7,3 +7,38 @@ ;; DECOMP BEGINS +;; very basic settings for video output. + +(deftype video-params (structure) + ((set-video-mode basic :offset-assert 0) + (reset-video-mode basic :offset-assert 4) + (display-fbp int32 :offset-assert 8) + (relative-x-scale float :offset 16) + (display-dx int32 :offset-assert 20) + (display-dy int32 :offset-assert 24) + (display-sy int32 :offset-assert 28) + (relative-x-scale-reciprical float :offset-assert 32) + (screen-pages-high int32 :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + + +(define *video-params* (new 'static 'video-params + :set-video-mode #f + :reset-video-mode #f + :display-fbp #xa4 + :relative-x-scale 1.0 + :display-dy 8 + :display-sy #xe0 + :relative-x-scale-reciprical 1.0 + :screen-pages-high 13 ;; full size framebuffer in jak 2. + ) + ) + + + +(define-extern set-graphics-mode (function none)) +(define-extern get-video-mode (function symbol)) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/lightning-h.gc b/goal_src/jak2/engine/gfx/lightning-h.gc index 4478b7a9b0..1463e11a0b 100644 --- a/goal_src/jak2/engine/gfx/lightning-h.gc +++ b/goal_src/jak2/engine/gfx/lightning-h.gc @@ -5,5 +5,241 @@ ;; name in dgo: lightning-h ;; dgos: ENGINE, GAME +(defenum lightning-spec-flags + :type uint16 + :bitfield #t + (lsf0 0) + (lsf1 1) + (lsf2 2) + (lsf3 3) + (size-from-adjust-dist 4) + ) + +(defenum lightning-mode + :type uint8 + (lm0 0) + (lm1 1) + (lm2 2) + (lm3 3) + ) + ;; DECOMP BEGINS +(deftype lightning-spec (basic) + ((name string :offset-assert 4) + (flags lightning-spec-flags :offset-assert 8) + (rand-func uint8 :offset-assert 10) + (adjust-distance uint8 :offset-assert 11) + (start-color uint32 :offset-assert 12) + (end-color uint32 :offset-assert 16) + (fade-to-color uint32 :offset-assert 20) + (fade-start-factor float :offset-assert 24) + (fade-time float :offset-assert 28) + (texture uint32 :offset-assert 32) + (reduction float :offset-assert 36) + (num-points int32 :offset-assert 40) + (box-size float :offset-assert 44) + (merge-factor float :offset-assert 48) + (merge-count int32 :offset-assert 52) + (radius float :offset-assert 56) + (duration float :offset-assert 60) + (duration-rand float :offset-assert 64) + (sound basic :offset-assert 68) + (delay float :offset-assert 72) + (delay-rand float :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(define-extern *lightning-spec-id-table* (array lightning-spec)) + +(defun lookup-lightning-spec-by-name ((arg0 string)) + (let* ((s5-0 *lightning-spec-id-table*) + (s4-0 (-> s5-0 length)) + ) + (dotimes (s3-0 s4-0) + (let ((s2-0 (-> s5-0 s3-0))) + (if (and (nonzero? s2-0) (string= arg0 (-> s2-0 name))) + (return s2-0) + ) + ) + ) + ) + (the-as lightning-spec #f) + ) + +(deftype lightning-state (structure) + ((mode lightning-mode :offset-assert 0) + (counter float :offset-assert 4) + (points-to-draw int32 :offset-assert 8) + (box-size float :offset-assert 12) + (gcf-control gcf-control :inline :offset-assert 16) + (line vector-array :offset-assert 128) + (meet vector-array :offset-assert 132) + (path vector-array :offset-assert 136) + (start-color uint32 :offset-assert 140) + (end-color uint32 :offset-assert 144) + ) + :method-count-assert 9 + :size-assert #x94 + :flag-assert #x900000094 + ) + +(deftype lightning-control (basic) + ((spec lightning-spec :offset-assert 4) + (process process :offset-assert 8) + (state lightning-state :inline :offset-assert 16) + ) + :method-count-assert 14 + :size-assert #xa4 + :flag-assert #xe000000a4 + (:methods + (new (symbol type lightning-spec process float) _type_ 0) + (change-mode (_type_ lightning-mode) lightning-mode 9) + (get-mode (_type_) lightning-mode 10) + (set-point (_type_ int vector) none 11) + (set-first-meet-point (_type_ vector) none 12) + (set-last-meet-point (_type_ vector) none 13) + ) + ) + +(defmethod change-mode lightning-control ((obj lightning-control) (arg0 lightning-mode)) + (let ((v1-1 (!= arg0 (-> obj state mode)))) + (case arg0 + (((lightning-mode lm3)) + (if v1-1 + (set! (-> obj state counter) 0.0) + ) + ) + (((lightning-mode lm1)) + (set! (-> obj state start-color) (-> obj spec start-color)) + (set! (-> obj state end-color) (-> obj spec end-color)) + ) + ) + ) + (set! (-> obj state mode) arg0) + arg0 + ) + +(defmethod get-mode lightning-control ((obj lightning-control)) + (-> obj state mode) + ) + +(defmethod set-point lightning-control ((obj lightning-control) (arg0 int) (arg1 vector)) + (let ((v1-0 (-> obj state))) + (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) + (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) + (when (and (< (+ (-> v1-0 points-to-draw) -1) arg0) (case (-> v1-0 mode) + (((lightning-mode lm2) (lightning-mode lm3)) + #t + ) + (else + #f + ) + ) + ) + (set! (-> v1-0 line data arg0 quad) (-> arg1 quad)) + (set! (-> v1-0 meet data arg0 quad) (-> arg1 quad)) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-first-meet-point lightning-control ((obj lightning-control) (arg0 vector)) + (set! (-> obj state meet data 0 quad) (-> arg0 quad)) + (none) + ) + +(defmethod set-last-meet-point lightning-control ((obj lightning-control) (arg0 vector)) + (set! (-> obj state meet data (+ (-> obj state points-to-draw) -1) quad) (-> arg0 quad)) + (none) + ) + +(defmethod relocate lightning-control ((obj lightning-control) (arg0 int)) + (&+! (-> obj state line) arg0) + (&+! (-> obj state meet) arg0) + (if (-> obj state path) + (&+! (-> obj state path) arg0) + ) + (let ((v1-8 (-> obj spec))) + (if (and (>= (the-as int v1-8) (-> *kernel-context* relocating-min)) + (< (the-as int v1-8) (-> *kernel-context* relocating-max)) + ) + (&+! (-> obj spec) arg0) + ) + ) + obj + ) + +(defmethod new lightning-control ((allocation symbol) (type-to-make type) (arg0 lightning-spec) (arg1 process) (arg2 float)) + (with-pp + (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? obj) + (go process-drawable-art-error "memory") + (set! obj (the-as lightning-control 0)) + (goto cfg-14) + ) + (let ((s3-0 (-> arg0 num-points))) + (let ((f0-0 (-> arg0 box-size))) + (when (logtest? (-> arg0 flags) (lightning-spec-flags size-from-adjust-dist)) + (let ((f1-1 (fmax 1.0 (fmin 5.0 (/ arg2 (* 4096.0 (the float (-> arg0 adjust-distance)))))))) + (set! s3-0 (* s3-0 (the int f1-1))) + (set! f0-0 (* f0-0 f1-1)) + ) + ) + (set! (-> obj state box-size) f0-0) + ) + (set! (-> obj process) (the-as process (process->ppointer arg1))) + (set! (-> obj state mode) (lightning-mode lm1)) + (set! (-> obj state line) ((method-of-type vector-array new) allocation vector-array s3-0)) + (set! (-> obj state meet) ((method-of-type vector-array new) allocation vector-array s3-0)) + (let ((v1-18 (-> arg0 rand-func))) + (set! (-> obj state path) (if (or (= v1-18 2) (= v1-18 3)) + ((method-of-type vector-array new) allocation vector-array s3-0) + (the-as vector-array #f) + ) + ) + ) + (set! (-> obj state counter) 0.0) + (set! (-> obj state points-to-draw) s3-0) + ) + (set! (-> obj spec) arg0) + (set! (-> obj state start-color) (-> arg0 start-color)) + (set! (-> obj state end-color) (-> arg0 end-color)) + (add-connection *lightning-engine* pp nothing obj #f #f) + (label cfg-14) + (the-as lightning-control obj) + ) + ) + ) + +(deftype lightning-probe-vars (basic) + ((src-joint-index uint32 :offset-assert 4) + (next-spawn-time time-frame :offset-assert 8) + (last-valid-time time-frame :offset-assert 16) + (point vector 2 :inline :offset-assert 32) + (start-pos vector :inline :offset 32) + (end-pos vector :inline :offset 48) + (probe-dirs (inline-array vector) :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + + +(define *lightning-probe-vars* + (new 'static 'lightning-probe-vars :probe-dirs (new 'static 'inline-array vector 6 + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + ) diff --git a/goal_src/jak2/engine/gfx/lights-h.gc b/goal_src/jak2/engine/gfx/lights-h.gc index c41d0578e5..bc82efdd27 100644 --- a/goal_src/jak2/engine/gfx/lights-h.gc +++ b/goal_src/jak2/engine/gfx/lights-h.gc @@ -5,5 +5,119 @@ ;; name in dgo: lights-h ;; dgos: ENGINE, GAME +;; It seems like some of these are unused. +;; The commonly used lights are vu-lights and light-group. + ;; DECOMP BEGINS +;; this type represents the lights that can be sent to the VU for merc (and maybe generic?) rendering. +;; it contains 3 directional lights and an ambient light. +;; Note that the data is transposed to be faster for use in the VU code. +;; the w components are unused for lighting information - you can put whatever you want in them... +(deftype vu-lights (structure) + ((direction vector 3 :inline :offset-assert 0) + (color vector 3 :inline :offset-assert 48) + (ambient vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; a single directional light. +(deftype light (structure) + ((direction vector :inline :offset-assert 0) + (color rgbaf :inline :offset-assert 16) + (extra vector :inline :offset-assert 32) + (level float :offset 32) + (luminance float :offset 40) + (priority float :offset 44) + (bytes uint8 4 :offset 36) + (mask uint16 :offset 36) + (palette-index int8 :offset 39) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; new jak 2 light, is applied to stuff in the sphere. +(deftype light-sphere (structure) + ((name string :offset-assert 0) + (bsphere vector :inline :offset-assert 16) + (direction vector :inline :offset-assert 32) + (color vector :inline :offset-assert 48) + (decay-start float :offset 4) + (ambient-point-ratio float :offset 8) + (brightness float :offset 12) + (bytes uint8 4 :offset 60) + (mask uint16 :offset 60) + (palette-index int8 :offset 63) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; hash bucket for fast "which light am I in?" checks. +(deftype light-hash-bucket (structure) + ((index uint16 :offset-assert 0) + (count uint16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype light-hash (basic) + ((num-lights uint16 :offset-assert 4) + (num-indices uint16 :offset-assert 6) + (num-buckets uint16 :offset-assert 8) + (bucket-step uint8 2 :offset-assert 10) + (base-trans vector :inline :offset-assert 16) + (axis-scale vector :inline :offset-assert 32) + (dimension-array vector4w :inline :offset-assert 48) + (bucket-array pointer :offset-assert 64) + (index-array pointer :offset-assert 68) + (light-sphere-array (inline-array light-sphere) :offset-assert 72) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +(deftype light-hash-work (structure) + ((ones vector4w :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(define *light-hash* (the-as light-hash #f)) + +(defmethod print light ((obj light)) + (format + #t + "# obj extra x) + (-> obj direction x) + (-> obj direction y) + (-> obj direction z) + ) + (format #t "~F ~F ~F @ #x~X>" (-> obj color x) (-> obj color y) (-> obj color z) obj) + obj + ) + +;; jak1-style 3x directional + ambient lighting. +(deftype light-group (structure) + ((dir0 light :inline :offset-assert 0) + (dir1 light :inline :offset-assert 48) + (dir2 light :inline :offset-assert 96) + (ambi light :inline :offset-assert 144) + (lights light 4 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) diff --git a/goal_src/jak2/engine/gfx/math-camera-h.gc b/goal_src/jak2/engine/gfx/math-camera-h.gc index d578b26615..b6eb2c2603 100644 --- a/goal_src/jak2/engine/gfx/math-camera-h.gc +++ b/goal_src/jak2/engine/gfx/math-camera-h.gc @@ -7,3 +7,115 @@ ;; DECOMP BEGINS +;; The "math-camera" is responsible for computing the projection matrix used in the renderer +;; from the position of the in-game camera. It also computes some other common camera info. +;; See cam-update.gc for how the game camera updates the math-camera. + +;; It also contains some GIF stuff, but these seem to be wrong/unused. +;; Some of the code here may be extremely old and unused, but this does compute the camera projection +;; matrix used almost everywhere. + +;; unused... +(deftype vis-gif-tag (structure) + ((fog0 uint32 :offset-assert 0) + (strip uint32 :offset-assert 4) + (regs uint32 :offset-assert 8) + (fan uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; also seems unused? +(deftype cull-info (structure) + ((x-fact float :offset-assert 0) + (y-fact float :offset-assert 4) + (z-fact float :offset-assert 8) + (cam-radius float :offset-assert 12) + (cam-x float :offset-assert 16) + (cam-y float :offset-assert 20) + (xz-dir-ax float :offset-assert 24) + (xz-dir-az float :offset-assert 28) + (xz-dir-bx float :offset-assert 32) + (xz-dir-bz float :offset-assert 36) + (xz-cross-ab float :offset-assert 40) + (yz-dir-ay float :offset-assert 44) + (yz-dir-az float :offset-assert 48) + (yz-dir-by float :offset-assert 52) + (yz-dir-bz float :offset-assert 56) + (yz-cross-ab float :offset-assert 60) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype math-camera (basic) + ((d meters :offset-assert 4) + (f meters :offset-assert 8) + (fov degrees :offset-assert 12) + (x-ratio float :offset-assert 16) + (y-ratio float :offset-assert 20) + (x-pix float :offset-assert 24) + (x-clip float :offset-assert 28) + (x-clip-ratio-in float :offset-assert 32) + (x-clip-ratio-over float :offset-assert 36) + (y-pix float :offset-assert 40) + (y-clip float :offset-assert 44) + (y-clip-ratio-in float :offset-assert 48) + (y-clip-ratio-over float :offset-assert 52) + (cull-info cull-info :inline :offset-assert 56) + (fog-start meters :offset-assert 120) + (fog-end meters :offset-assert 124) + (fog-max float :offset-assert 128) + (fog-min float :offset-assert 132) + (reset int32 :offset-assert 136) + (smooth-step float :offset-assert 140) + (smooth-t float :offset-assert 144) + (perspective matrix :inline :offset-assert 160) + (isometric matrix :inline :offset-assert 224) + (sprite-2d matrix :inline :offset-assert 288) + (sprite-2d-hvdf vector :inline :offset-assert 352) + (camera-rot matrix :inline :offset-assert 368) + (inv-camera-rot matrix :inline :offset-assert 432) + (inv-camera-rot-smooth matrix :inline :offset-assert 496) + (inv-camera-rot-smooth-from quaternion :inline :offset-assert 560) + (camera-temp matrix :inline :offset-assert 576) + (prev-camera-temp matrix :inline :offset-assert 640) + (prev-inv-camera-rot matrix :inline :offset-assert 704) + (prev-trans vector :inline :offset-assert 768) + (hmge-scale vector :inline :offset-assert 784) + (inv-hmge-scale vector :inline :offset-assert 800) + (hvdf-off vector :inline :offset-assert 816) + (guard vector :inline :offset-assert 832) + (vis-gifs vis-gif-tag 4 :inline :offset-assert 848) + (giftex uint128 :offset 848) + (gifgr uint128 :offset 864) + (giftex-trans uint128 :offset 880) + (gifgr-trans uint128 :offset 896) + (pfog0 float :offset-assert 912) + (pfog1 float :offset-assert 916) + (trans vector :inline :offset-assert 928) + (plane plane 4 :inline :offset-assert 944) + (guard-plane plane 4 :inline :offset-assert 1008) + (shrub-mat matrix :inline :offset-assert 1072) + (quat-other quaternion :inline :offset-assert 1136) + (trans-other vector :inline :offset-assert 1152) + (shrub-mat-other matrix :inline :offset-assert 1168) + (camera-temp-other matrix :inline :offset-assert 1232) + (camera-rot-other matrix :inline :offset-assert 1296) + (inv-camera-rot-other matrix :inline :offset-assert 1360) + (plane-other plane 4 :inline :offset-assert 1424) + (guard-plane-other plane 4 :inline :offset-assert 1488) + (mirror-trans vector :inline :offset-assert 1552) + (mirror-normal vector :inline :offset-assert 1568) + (fov-correction-factor float :offset-assert 1584) + ) + (:methods (new (symbol type) _type_ 0)) + + :method-count-assert 9 + :size-assert #x634 + :flag-assert #x900000634 + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/gfx/math-camera.gc b/goal_src/jak2/engine/gfx/math-camera.gc index 815ee437f8..c6d925e1cf 100644 --- a/goal_src/jak2/engine/gfx/math-camera.gc +++ b/goal_src/jak2/engine/gfx/math-camera.gc @@ -5,5 +5,685 @@ ;; name in dgo: math-camera ;; dgos: ENGINE, GAME +(define-extern sprite-distorter-generate-tables (function none)) + ;; DECOMP BEGINS +;;;;;;;;;;;;;;;;;;;;;; +;; math camera basics +;;;;;;;;;;;;;;;;;;;;;; + +;; the math camera computes the perspective matrix, hvdf offset, and hmge scale. + +;; multiplying a point by the perspective matrix, doing the persepctive divide, then adding hvdf offset gives you: +;; H : horizontal position (in GS coordinates) +;; V : vertical position (in GS coordinates) +;; D : depth (as a 24-bit integer for the z buffer) +;; F : fog + +;; Multiplying by hmge then checking the clipping flags can be used to see if a point is outside the view frustum. + +;; The "camera-temp" matrix is the perspective matrix multplied by the camera tranformation and is used +;; renderers that want a single matrix. + +;;;;;;;;;;;;;;;;;;; +;; fog correction +;;;;;;;;;;;;;;;;;;; + +;; The math-camera matrices are used to compute fogging values, which are a per-vertex uint8 that +;; tells the GS how "foggy" the color should be. This should be proportional to how far away the vertex +;; is. There is a scaling factor applied so the fog intensity isn't affected by the field of view angle. + +;; The fog-corrector stores a fog-end fog-start value that is corrected for the field of view. +;; the actual correction factor is computed in cam-update.gc +;; Without this corrector, the fogginess of the world would change as the fov changes +;; (for example, when jak gets on the zoomer, the fov changes slightly) +(deftype fog-corrector (structure) + ((fog-end float :offset-assert 0) + (fog-start float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(defun fog-corrector-setup ((arg0 fog-corrector) (arg1 math-camera)) + "Set the fog corrector based on the supplied math-camera" + (set! (-> arg0 fog-end) (* (-> arg1 fog-end) (-> arg1 fov-correction-factor))) + (set! (-> arg0 fog-start) (* (-> arg1 fog-start) (-> arg1 fov-correction-factor))) + (none) + ) + +(define *math-camera-fog-correction* (new 'global 'fog-corrector)) + + +(defun update-math-camera ((arg0 math-camera) (arg1 symbol) (arg2 symbol) (arg3 float)) + "Compute some one-time camera constants. These should only change when changing aspect ratio." + (local-vars (sv-16 float)) + + ;; compute frustum slopes. + (set! (-> arg0 x-ratio) (tan (* 0.5 arg3))) + (if (= arg2 'aspect4x3) + (set! (-> arg0 y-ratio) (* 0.75 (-> arg0 x-ratio))) + (set! (-> arg0 y-ratio) (* 0.5625 (-> arg0 x-ratio))) + ) + + ;; compute culling constants. these seem unused... + (let ((f1-3 (-> arg0 x-ratio)) + (f0-7 (-> arg0 y-ratio)) + (v1-6 (-> arg0 cull-info)) + ) + (/ (+ 1.0 (* 4.0 f1-3 f1-3)) (+ 1.0 (* f1-3 f1-3))) + (let ((f2-5 (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (+ 1.0 (* f0-7 f0-7))))) + (set! (-> v1-6 x-fact) (/ (+ 1.0 (* 4.0 f1-3 f1-3)) (* f1-3 (sqrtf (+ 1.0 (* 16.0 f1-3 f1-3)))))) + (set! (-> v1-6 y-fact) (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (* f0-7 (sqrtf (+ 1.0 (* 16.0 f0-7 f0-7)))))) + (set! (-> v1-6 z-fact) (sqrtf (+ (* (+ -4.0 f2-5) (+ -4.0 f2-5) f0-7 f0-7) (* (+ -1.0 f2-5) (+ -1.0 f2-5))))) + ) + (let* ((f2-11 (* f1-3 (-> arg0 d))) + (f1-5 (* f0-7 (-> arg0 d))) + (f0-10 (+ (* f2-11 f2-11) (* f1-5 f1-5))) + (f1-8 (-> arg0 d)) + ) + (set! (-> v1-6 cam-radius) (sqrtf (+ f0-10 (* f1-8 f1-8)))) + ) + (let* ((f1-12 (* (-> arg0 d) (-> arg0 x-ratio))) + (f0-14 (-> arg0 d)) + (f2-13 (* 4.0 f1-12)) + (f3-21 (-> arg0 d)) + ) + (let ((f4-21 (/ 1.0 (sqrtf (+ (* f1-12 f1-12) (* f0-14 f0-14))))) + (f5-11 (/ 1.0 (sqrtf (+ (* f2-13 f2-13) (* f3-21 f3-21))))) + ) + (set! (-> v1-6 xz-dir-ax) (* f1-12 f4-21)) + (set! (-> v1-6 xz-dir-az) (* f0-14 f4-21)) + (set! (-> v1-6 xz-dir-bx) (* f2-13 f5-11)) + (set! (-> v1-6 xz-dir-bz) (* f3-21 f5-11)) + ) + (set! (-> v1-6 xz-cross-ab) (- (* f1-12 f3-21) (* f0-14 f2-13))) + ) + (let* ((f1-15 (* (-> arg0 d) (-> arg0 y-ratio))) + (f0-18 (-> arg0 d)) + (f2-15 (* 4.0 f1-15)) + (f3-22 (-> arg0 d)) + ) + (let ((f4-26 (/ 1.0 (sqrtf (+ (* f1-15 f1-15) (* f0-18 f0-18))))) + (f5-16 (/ 1.0 (sqrtf (+ (* f2-15 f2-15) (* f3-22 f3-22))))) + ) + (set! (-> v1-6 yz-dir-ay) (* f1-15 f4-26)) + (set! (-> v1-6 yz-dir-az) (* f0-18 f4-26)) + (set! (-> v1-6 yz-dir-by) (* f2-15 f5-16)) + (set! (-> v1-6 yz-dir-bz) (* f3-22 f5-16)) + ) + (set! (-> v1-6 yz-cross-ab) (- (* f1-15 f3-22) (* f0-18 f2-15))) + ) + ) + + ;; apply fog correction. + (fog-corrector-setup *math-camera-fog-correction* arg0) + + ;; reset camera rotation + (matrix-identity! (-> arg0 camera-rot)) + + ;;;;;;;;;;;;;; Perspective matrix setup + + ;; these min/max depths are the values we'd want to write to the 24-bit integer depth buffer + (let ((f0-21 100.0) + (f2-16 16760631.0) + ) + 16777115.0 + (let ((f30-0 (/ (* (-> arg0 d) (- (-> arg0 fog-min) (-> arg0 fog-max))) + (- (-> *math-camera-fog-correction* fog-end) (-> *math-camera-fog-correction* fog-start)) + ) + ) + (f1-21 (* -0.5 (- f2-16 f0-21))) ;; half range of depth buffer + ) + (let ((f4-34 (/ f1-21 (* (-> arg0 d) (- (-> arg0 f) (-> arg0 d))))) + (f3-30 (-> arg0 fov-correction-factor)) + ) + (set! (-> arg0 perspective data 0) (* f3-30 (- (/ (-> arg0 x-pix) (* (-> arg0 x-ratio) (-> arg0 d)))))) + (set! (-> arg0 perspective data 5) (* f3-30 (- (/ (-> arg0 y-pix) (* (-> arg0 y-ratio) (-> arg0 d)))))) + (set! (-> arg0 perspective data 10) (* f3-30 (+ (-> arg0 f) (-> arg0 d)) f4-34)) + (set! (-> arg0 perspective data 11) (* (/ f3-30 (-> arg0 d)) f30-0)) + (set! (-> arg0 perspective trans z) (* -2.0 f4-34 (-> arg0 f) (-> arg0 d) f3-30)) + ) + (let ((f24-0 2048.0) + (f26-0 2048.0) + (f28-0 (/ (- (* (-> *math-camera-fog-correction* fog-end) (-> arg0 fog-max)) + (* (-> *math-camera-fog-correction* fog-start) (-> arg0 fog-min)) + ) + (- (-> *math-camera-fog-correction* fog-end) (-> *math-camera-fog-correction* fog-start)) + ) + ) + ) + (let ((f22-0 (* 0.5 (+ f2-16 f0-21)))) + (set! (-> arg0 hmge-scale x) (/ 1.0 (-> arg0 x-clip))) + (set! (-> arg0 hmge-scale y) (/ 1.0 (-> arg0 y-clip))) + (set! (-> arg0 hmge-scale z) (/ 1.0 f1-21)) + (set! (-> arg0 hmge-scale w) (/ 1.0 f30-0)) + (set! (-> arg0 inv-hmge-scale x) (-> arg0 x-clip)) + (set! (-> arg0 inv-hmge-scale y) (-> arg0 y-clip)) + (set! (-> arg0 inv-hmge-scale z) f1-21) + (set! (-> arg0 inv-hmge-scale w) f30-0) + (cond + ((or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1)) + (set! (-> arg0 hvdf-off x) f24-0) + (set! (-> arg0 hvdf-off y) f26-0) + ) + (else + (let* ((v1-32 (-> *screen-shot-work* count)) + (a0-36 (-> *screen-shot-work* size)) + (f0-34 (the float a0-36)) + (f20-0 (/ (the float (mod v1-32 a0-36)) f0-34)) + ) + (set! sv-16 (/ (the float (/ v1-32 a0-36)) f0-34)) + (format 0 "~f ~f~%" f20-0 sv-16) + (set! (-> arg0 hvdf-off x) (- f24-0 f20-0)) + ) + (set! (-> arg0 hvdf-off y) (- f26-0 sv-16)) + ) + ) + (set! (-> arg0 hvdf-off z) f22-0) + (set! (-> arg0 hvdf-off w) f28-0) + (set! (-> arg0 guard x) (/ (-> arg0 x-clip) (-> arg0 x-pix))) + (set! (-> arg0 guard y) (/ (-> arg0 y-clip) (-> arg0 y-pix))) + (set! (-> arg0 guard z) 1.0) + (set! (-> arg0 guard w) 1.0) + (set! (-> arg0 isometric trans z) (- 16777215.0 f22-0)) + ;; PC HACK! + ;; for whatever reason, the font render ends up computing a depth #x1000000 instead of + ;; #xffffffff, which overflows the 24-bit z buffer. + ;; cheating this by 1 bit seems to fix it. + (#when PC_PORT + ;; #x4b002032 -> #x4b002031 + (set! (-> arg0 isometric vector 3 z) (the-as float (- (the-as int (-> arg0 isometric vector 3 z)) 1))) + ) + ) + (set! (-> arg0 isometric trans w) f30-0) + (let ((f1-28 (-> arg0 perspective data 0)) + (f2-19 (-> arg0 perspective data 5)) + (f0-48 (* -1.9996 (-> arg0 perspective data 0))) + ) + (let ((v1-39 (-> arg0 sprite-2d))) + (set! (-> v1-39 data 0) f0-48) + (set! (-> v1-39 data 1) 0.0) + (set! (-> v1-39 data 2) 0.0) + (set! (-> v1-39 data 3) 0.0) + ) + (let ((v1-40 (&-> arg0 sprite-2d data 4))) + (set! (-> v1-40 0) 0.0) + (set! (-> v1-40 1) (- (* (/ f2-19 f1-28) f0-48))) + (set! (-> v1-40 2) 0.0) + (set! (-> v1-40 3) 0.0) + ) + (let ((v1-41 (&-> arg0 sprite-2d data 8))) + (set! (-> v1-41 0) 0.0) + (set! (-> v1-41 1) 0.0) + (set! (-> v1-41 2) (- f0-48)) + (set! (-> v1-41 3) 0.0) + ) + (set-vector! (-> arg0 sprite-2d trans) 0.0 0.0 (* 500000000.0 f0-48) (* 60.0 f0-48 (-> arg0 pfog0))) + ) + (set! (-> arg0 sprite-2d-hvdf quad) (-> arg0 hvdf-off quad)) + (set! (-> arg0 sprite-2d-hvdf x) 2048.0) + (set! (-> arg0 sprite-2d-hvdf y) 2048.0) + (set! (-> arg0 sprite-2d-hvdf z) (-> arg0 hvdf-off z)) + (set! (-> arg0 pfog0) f30-0) + (set! (-> arg0 pfog1) f28-0) + ) + ) + ) + 0 + + ;; garbage giftags + (make-u128 0 (shl #x301ec000 32)) + (make-u128 0 (shl #x303ec000 32)) + (let ((v1-54 (-> arg0 pfog0))) + (let ((a0-42 (-> arg0 vis-gifs))) + (set! (-> a0-42 0 fog0) (the-as uint v1-54)) + (set! (-> a0-42 0 strip) (the-as uint #x301e4000)) + (set! (-> a0-42 0 regs) (the-as uint 1042)) + (set! (-> a0-42 0 fan) (the-as uint #x301ec000)) + ) + #| + (let ((a0-43 (&-> arg0 gifgr))) + (s.w! a0-43 v1-54) + (let ((a1-9 (make-u128 0 (shl #x20164000 32)))) + (s.w! (+ a0-43 4) a1-9) + ) + (let ((a1-10 65)) + (s.w! (+ a0-43 8) a1-10) + ) + (let ((a1-11 #x301ec000)) + (s.w! (+ a0-43 12) a1-11) + ) + ) + |# + (let ((a0-44 (-> arg0 vis-gifs))) + (set! (-> a0-44 0 fog0) (the-as uint v1-54)) + (set! (-> a0-44 0 strip) (the-as uint #x303e4000)) + (set! (-> a0-44 0 regs) (the-as uint 1042)) + (set! (-> a0-44 0 fan) (the-as uint #x303ec000)) + ) + (let ((a0-45 (-> arg0 vis-gifs))) + (set! (-> a0-45 0 fog0) (the-as uint v1-54)) + (set! (-> a0-45 0 strip) (the-as uint #x303e4000)) + (set! (-> a0-45 0 regs) (the-as uint 1042)) + (set! (-> a0-45 0 fan) (the-as uint #x303ec000)) + ) + ) + + (if (nonzero? sprite-distorter-generate-tables) + (sprite-distorter-generate-tables) + ) + arg0 + ) + +(defmethod new math-camera ((allocation symbol) (type-to-make type)) + "Set up a new math-camera in NTSC mode." + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 d) 1024.0) + (set! (-> gp-0 f) 40960000.0) + (set! (-> gp-0 fov) 11650.845) + (set! (-> gp-0 x-pix) 256.0) + (set! (-> gp-0 x-clip) 1024.0) + (set! (-> gp-0 y-pix) 112.0) + (set! (-> gp-0 y-clip) 448.0) + (set! (-> gp-0 fog-start) 40960.0) + (set! (-> gp-0 fog-end) 819200.0) + (set! (-> gp-0 fog-max) 255.0) + (set! (-> gp-0 fog-min) 150.0) + (matrix-identity! (-> gp-0 inv-camera-rot)) + (matrix-identity! (-> gp-0 camera-rot)) + (vector-reset! (-> gp-0 trans)) + (quaternion-identity! (-> gp-0 quat-other)) + (set-vector! (-> gp-0 trans-other) 0.0 0.0 0.0 1.0) + (matrix-identity! (-> gp-0 inv-camera-rot-other)) + (matrix-identity! (-> gp-0 camera-rot-other)) + (matrix-identity! (-> gp-0 camera-temp-other)) + (set! (-> gp-0 isometric data 0) 1.0) + (set! (-> gp-0 isometric data 5) 0.5) + (set! (-> gp-0 isometric data 10) -1.0) + (set! (-> gp-0 reset) 1) + (set! (-> gp-0 smooth-step) 0.0) + (set! (-> gp-0 smooth-t) 0.0) + (update-math-camera gp-0 'ntsc 'aspect4x3 (-> gp-0 fov)) + ) + ) + +(define *math-camera* (new 'global 'math-camera)) + +(defun math-cam-start-smoothing ((arg0 float) (arg1 float)) + "Unused camera smoothing" + (set! (-> *math-camera* smooth-step) (/ 1.0 arg0)) + (set! (-> *math-camera* smooth-t) arg1) + (matrix->quaternion (-> *math-camera* inv-camera-rot-smooth-from) (-> *math-camera* inv-camera-rot-smooth)) + ) + +(defun move-target-from-pad ((arg0 transform) (arg1 int)) + "Unused function to adjust trans based on inputs from the pad. + This function must be extremely old because it takes a non-quaternion transform, + and all target stuff uses quaternions." + (let ((s4-0 (new-stack-vector0))) + (set! (-> s4-0 x) (cond + ((cpad-hold? arg1 circle) + -80.0 + ) + ((cpad-hold? arg1 square) + 80.0 + ) + (else + 0.0 + ) + ) + ) + (set! (-> s4-0 y) 0.0) + (set! (-> s4-0 z) (cond + ((cpad-hold? arg1 down) + -80.0 + ) + ((cpad-hold? arg1 up) + 80.0 + ) + (else + 0.0 + ) + ) + ) + (set! (-> s4-0 w) 1.0) + (let ((a0-5 (new-stack-vector0)) + (s3-0 (new-stack-matrix0)) + ) + (vector-negate! a0-5 (-> arg0 rot)) + (matrix-rotate-zyx! s3-0 (-> arg0 rot)) + (vector-matrix*! s4-0 s4-0 s3-0) + ) + (vector+! (-> arg0 trans) (-> arg0 trans) s4-0) + ) + (set! (-> arg0 trans w) 1.0) + (if (cpad-hold? arg1 r1) + (set! (-> arg0 trans y) (+ 80.0 (-> arg0 trans y))) + ) + (if (cpad-hold? arg1 r2) + (set! (-> arg0 trans y) (+ -80.0 (-> arg0 trans y))) + ) + (if (cpad-hold? arg1 x) + (set! (-> arg0 rot x) (+ 546.13336 (-> arg0 rot x))) + ) + (if (cpad-hold? arg1 triangle) + (set! (-> arg0 rot x) (+ -546.13336 (-> arg0 rot x))) + ) + (if (cpad-hold? arg1 left) + (set! (-> arg0 rot y) (+ 546.13336 (-> arg0 rot y))) + ) + (if (cpad-hold? arg1 right) + (set! (-> arg0 rot y) (+ -546.13336 (-> arg0 rot y))) + ) + arg0 + ) + +(defun transform-point-vector! ((arg0 vector) (arg1 vector)) + "Apply camera transformation to a point. Return true if it is visible or not. + This returns the point in GS coords, but as float instead of int, so it's + not really useful. See transform-point-qword! for more details" + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 0)) + ) + (.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad)) + (.lvf vf25 (&-> *math-camera* camera-temp vector 1 quad)) + (.lvf vf26 (&-> *math-camera* camera-temp vector 2 quad)) + (.lvf vf27 (&-> *math-camera* camera-temp vector 3 quad)) + (.lvf vf29 (&-> *math-camera* hmge-scale quad)) + (.lvf vf30 (&-> *math-camera* hvdf-off quad)) + (.lvf vf28 (&-> arg1 quad)) + (.mul.x.vf acc vf24 vf28) + (.add.mul.y.vf acc vf25 vf28 acc) + (.add.mul.z.vf acc vf26 vf28 acc) + (.add.mul.w.vf vf28 vf27 vf0 acc) + (.add.w.vf vf23 vf0 vf0) + (.mul.vf vf31 vf28 vf29) + ;;(TODO.VCLIP vf31 vf31) + (let ((clip (vu-clip vf31 0))) + (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) + (.wait.vf) + ;;(.cfc2.i v1-7 Clipping) + (.mul.vf vf28 vf28 Q :mask #b111) + (.mul.vf vf23 vf23 Q) + (.add.vf vf28 vf28 vf30) + (.max.x.vf vf28 vf28 vf0 :mask #b1000) + (.svf (&-> arg0 quad) vf28) + (zero? (logand clip 63)) + ) + ) + ) + +;; definition for function transform-point-qword! +(defun transform-point-qword! ((arg0 vector4w) (arg1 vector)) + "Apply camera transformation to point, returning fixed point 28.4 position + that can be given to the GS directly." + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 0)) + ) + + ;; this camera matrix has both the projection and camera translation/rotation + (.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad)) + (.lvf vf25 (&-> *math-camera* camera-temp vector 1 quad)) + (.lvf vf26 (&-> *math-camera* camera-temp vector 2 quad)) + (.lvf vf27 (&-> *math-camera* camera-temp vector 3 quad)) + + ;; scaling + (.lvf vf29 (&-> *math-camera* hmge-scale quad)) + + ;; offset + (.lvf vf30 (&-> *math-camera* hvdf-off quad)) + + ;; input point + (.lvf vf28 (&-> arg1 quad)) + + ;; matrix multiply, result in vf28 + (.mul.x.vf acc vf24 vf28) + (.add.mul.y.vf acc vf25 vf28 acc) + (.add.mul.z.vf acc vf26 vf28 acc) + (.add.mul.w.vf vf28 vf27 vf0 acc) + + + (.add.w.vf vf23 vf0 vf0) ;; set w = 1.0 + + ;; apply hmge scaling. the result of this multiply sets clipping flags appropriately + (.mul.vf vf31 vf28 vf29) ;; scale. + ;;(TODO.VCLIP vf31 vf31) + (let ((clip (vu-clip vf31 0))) ;; clip! + + ;; perspective divide + (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) + (.wait.vf) + ;;(.cfc2.i v1-7 Clipping) + ;; perspective + (.mul.vf vf28 vf28 Q :mask #b111) + ;; compute scale factor (w was 1.0) + (.mul.vf vf23 vf23 Q) + ;; apply hvdf offsets + (.add.vf vf28 vf28 vf30) + ;; saturate fog + (.max.x.vf vf28 vf28 vf0 :mask #b1000) + ;; convert to GS fixed point + (vftoi4.xyzw vf28 vf28) + ;; store result! + (.svf (&-> arg0 quad) vf28) + ;; return result of clipping. + (zero? (logand clip 63)) + ) + ) + ) + + +(defun transform-point-vector-scale! ((arg0 vector) (arg1 vector)) + "Similar to transform-point-qword! but returns the scale factor instead." + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 0)) + ) + (.lvf vf24 (&-> *math-camera* camera-temp vector 0 quad)) + (.lvf vf25 (&-> *math-camera* camera-temp vector 1 quad)) + (.lvf vf26 (&-> *math-camera* camera-temp vector 2 quad)) + (.lvf vf27 (&-> *math-camera* camera-temp vector 3 quad)) + (.lvf vf29 (&-> *math-camera* hmge-scale quad)) + (.lvf vf30 (&-> *math-camera* hvdf-off quad)) + (.lvf vf28 (&-> arg1 quad)) + (.mul.x.vf acc vf24 vf28) + (.add.mul.y.vf acc vf25 vf28 acc) + (.add.mul.z.vf acc vf26 vf28 acc) + (.add.mul.w.vf vf28 vf27 vf0 acc) + (.add.w.vf vf23 vf0 vf0) + (.mul.vf vf31 vf28 vf29) + ;;(TODO.VCLIP vf31 vf31) clip result was unused + (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) + (.wait.vf) + ;;(.cfc2.i v1-7 Clipping) + (.mul.vf vf28 vf28 Q :mask #b111) + (.mul.vf vf23 vf23 Q) + (.add.vf vf28 vf28 vf30) + (.max.x.vf vf28 vf28 vf0 :mask #b1000) + (.svf (&-> arg0 quad) vf28) + ;;(let ((a0-2 (zero? (logand v1-7 63)))) + ;; ) + (.mov v0-0 vf23) + v0-0 + ) + ) + +(defun reverse-transform-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + "Likely transform arg3 from screen space to world coords, using arg1/arg2 for... something." + (let* ((v1-1 (-> *math-camera* perspective)) + (s2-0 (-> *math-camera* camera-rot)) + (f30-0 (* (/ (-> v1-1 data 11) (-> v1-1 data 0)) (-> *math-camera* hmge-scale w))) + (f28-0 (* (/ (-> v1-1 data 11) (-> v1-1 data 5)) (-> *math-camera* hmge-scale w))) + (s4-0 (vector-rotate*! (new 'stack-no-clear 'vector) arg2 s2-0)) + (v1-3 (vector-matrix*! (new 'stack-no-clear 'vector) arg1 s2-0)) + (f0-8 (/ (+ (* (-> s4-0 x) (-> v1-3 x)) (* (-> s4-0 y) (-> v1-3 y)) (* (-> s4-0 z) (-> v1-3 z))) + (+ (* (-> s4-0 x) (-> arg3 x) f30-0) (* (-> s4-0 y) (-> arg3 y) f28-0) (-> s4-0 z)) + ) + ) + (f1-16 (* (-> arg3 x) f0-8 f30-0)) + (f2-9 (* (-> arg3 y) f0-8 f28-0)) + (t9-2 vector-matrix*!) + (a0-5 arg0) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 x) f1-16) + (set! (-> a1-3 y) f2-9) + (set! (-> a1-3 z) f0-8) + (set! (-> a1-3 w) 1.0) + (t9-2 a0-5 a1-3 (-> *math-camera* inv-camera-rot)) + ) + (none) + ) + + +(defun init-for-transform ((arg0 matrix)) + "Sets up VU0 registers with camera info. + This is probably a very old function and it's only used by camera debug. + It stashes some data in vector float registers that must be there before calling transform-float-point." + (rlet ((vf1 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf2 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + (s4-0 (new 'stack 'vector4s-3)) + (s3-0 (new-stack-vector0)) + (s2-0 (new 'stack 'vector4s-3)) + ) + (matrix*! s5-0 arg0 (-> *math-camera* camera-temp)) + (matrix-3x3-inverse-transpose! gp-0 arg0) + (let ((v1-3 s3-0)) + (set! (-> v1-3 x) 0.4) + (set! (-> v1-3 y) 0.4) + (set! (-> v1-3 z) 0.4) + (set! (-> v1-3 w) 1.0) + ) + (let ((v1-4 (-> s4-0 data))) + (set! (-> v1-4 0) 1.0) + (set! (-> v1-4 1) 1.0) + (set! (-> v1-4 2) 1.0) + (set! (-> v1-4 3) 1.0) + ) + (let ((v1-5 (&-> s4-0 data 4))) + (set! (-> v1-5 0) 0.0) + (set! (-> v1-5 1) 0.0) + (set! (-> v1-5 2) 0.0) + (set! (-> v1-5 3) 1.0) + ) + (let ((v1-6 (&-> s4-0 data 8))) + (set! (-> v1-6 0) 0.0) + (set! (-> v1-6 1) 0.0) + (set! (-> v1-6 2) 0.0) + (set! (-> v1-6 3) 1.0) + ) + (let ((v1-7 (-> s2-0 data))) + (set! (-> v1-7 0) 1.0) + (set! (-> v1-7 1) 0.0) + (set! (-> v1-7 2) 0.0) + (set! (-> v1-7 3) 1.0) + ) + (let ((v1-8 (&-> s2-0 data 4))) + (set! (-> v1-8 0) 0.0) + (set! (-> v1-8 1) 1.0) + (set! (-> v1-8 2) 0.0) + (set! (-> v1-8 3) 1.0) + ) + (let ((v1-9 (&-> s2-0 data 8))) + (set! (-> v1-9 0) 0.0) + (set! (-> v1-9 1) 0.0) + (set! (-> v1-9 2) 1.0) + (set! (-> v1-9 3) 1.0) + ) + (.lvf vf7 (&-> *math-camera* hmge-scale quad)) + (.lvf vf8 (&-> *math-camera* hvdf-off quad)) + (.lvf vf9 (&-> *math-camera* giftex)) + (let ((v1-13 255)) + (.mov vf6 v1-13) + ) + ;;(.mov v1-14 vf6) + (.itof.vf vf6 vf6) + (.svf (&-> *transform-regs* vf7) vf7) + (.svf (&-> *transform-regs* vf8) vf8) + (.svf (&-> *transform-regs* vf9) vf9) + (.svf (&-> *transform-regs* vf6) vf6) + (set! (-> *transform-regs* vf1) (-> s5-0 vector 0 quad)) + (set! (-> *transform-regs* vf2) (-> s5-0 vector 1 quad)) + (set! (-> *transform-regs* vf3) (-> s5-0 vector 2 quad)) + (set! (-> *transform-regs* vf4) (-> s5-0 vector 3 quad)) + (set! (-> *transform-regs* vf17) (-> gp-0 vector 0 quad)) + (set! (-> *transform-regs* vf18) (-> gp-0 vector 1 quad)) + (set! (-> *transform-regs* vf19) (-> gp-0 vector 2 quad)) + (set! (-> *transform-regs* vf23) (-> s2-0 quad 0)) + (set! (-> *transform-regs* vf24) (-> s2-0 quad 1)) + (set! (-> *transform-regs* vf25) (-> s2-0 quad 2)) + + (set! (-> *transform-regs* vf27) (-> s4-0 quad 0)) + (set! (-> *transform-regs* vf28) (-> s4-0 quad 1)) + (set! (-> *transform-regs* vf29) (-> s4-0 quad 2)) + (set! (-> *transform-regs* vf26) (-> s3-0 quad)) + + ) + (none) + ) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/merc/generic-merc-h.gc b/goal_src/jak2/engine/gfx/merc/generic-merc-h.gc index a00494fc36..bfed5f8237 100644 --- a/goal_src/jak2/engine/gfx/merc/generic-merc-h.gc +++ b/goal_src/jak2/engine/gfx/merc/generic-merc-h.gc @@ -7,3 +7,126 @@ ;; DECOMP BEGINS +(deftype merc-matrix (structure) + ((quad uint128 8 :offset-assert 0) + (vector vector 8 :offset 0) + (tag uint64 :offset 0) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype generic-merc-tag (dma-packet) + ((next-ptr uint32 :offset 12) + (size uint32 :offset 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype generic-merc-ctrl (structure) + ((tag generic-merc-tag :inline :offset-assert 0) + (lights vu-lights :inline :offset-assert 16) + (header merc-ctrl-header :inline :offset-assert 128) + (effect merc-effect :inline :offset-assert 256) + ) + :method-count-assert 9 + :size-assert #x120 + :flag-assert #x900000120 + ) + +(deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl) + ((sfx-data uint128 11 :offset-assert 288) + ) + :method-count-assert 9 + :size-assert #x1d0 + :flag-assert #x9000001d0 + ) + +(deftype generic-merc-input (structure) + ((geo-tag generic-merc-tag :inline :offset-assert 0) + (geo-block uint8 1296 :offset-assert 16) + (byte-header merc-byte-header :inline :offset 16) + (matrix merc-matrix 9 :inline :offset-assert 1312) + (control generic-merc-ctrl-with-sfx :inline :offset-assert 2464) + (end-tag generic-merc-tag :inline :offset-assert 2928) + (shader adgif-shader :inline :offset-assert 2944) + ) + :method-count-assert 9 + :size-assert #xbd0 + :flag-assert #x900000bd0 + ) + +(deftype generic-merc-output (structure) + ((info gsf-info :inline :offset-assert 0) + (header gsf-header :inline :offset-assert 16) + (index-kick-table uint16 80 :offset-assert 32) + (index-table uint8 160 :offset 32) + (inverse-table uint8 256 :offset-assert 192) + (vertex-table gsf-vertex 72 :inline :offset-assert 448) + ) + :method-count-assert 9 + :size-assert #xac0 + :flag-assert #x900000ac0 + ) + +(deftype generic-merc-dcache (structure) + ((output-a generic-merc-output :inline :offset-assert 0) + (output-b generic-merc-output :inline :offset-assert 2752) + (inv-table-1 uint8 544 :offset-assert 5504) + (inv-table-7 uint8 544 :offset-assert 6048) + (inv-safety uint8 16 :offset-assert 6592) + (effect-data uint8 1584 :offset-assert 6608) + ) + :method-count-assert 9 + :size-assert #x2000 + :flag-assert #x900002000 + ) + +(deftype gm-shadow (structure) + ((perspective matrix :inline :offset-assert 0) + (isometric matrix :inline :offset-assert 64) + (inv-camera-rot matrix :inline :offset-assert 128) + (envmap-shader adgif-shader :inline :offset-assert 192) + (current-chain uint32 :offset-assert 272) + (next-chain uint32 :offset-assert 276) + (buf-index uint32 :offset-assert 280) + (fragment-count uint32 :offset-assert 284) + (write-limit int32 :offset-assert 288) + (indexed-input-base generic-merc-input :offset-assert 292) + (other-input-base generic-merc-input :offset-assert 296) + (indexed-output-base generic-merc-output :offset-assert 300) + (other-output-base generic-merc-output :offset-assert 304) + (p-input uint32 :offset-assert 308) + (gsf-buf generic-merc-dcache :offset-assert 312) + (p-fheader merc-fp-header :offset-assert 316) + (curr-chain basic :offset-assert 320) + (mercneric-convert basic :offset-assert 324) + (generic-prepare-dma-single basic :offset-assert 328) + (generic-prepare-dma-double basic :offset-assert 332) + (generic-light-proc basic :offset-assert 336) + (generic-envmap-proc basic :offset-assert 340) + (high-speed-reject basic :offset-assert 344) + (dummy-0 uint32 :offset-assert 348) + (hsr-xmult vector :inline :offset-assert 352) + (hsr-ymult vector :inline :offset-assert 368) + (warp-consts vector :inline :offset-assert 384) + ) + :method-count-assert 9 + :size-assert #x190 + :flag-assert #x900000190 + ) + +(deftype generic-merc-work (structure) + ((input-a generic-merc-input :inline :offset-assert 0) + (input-b generic-merc-input :inline :offset-assert 3024) + (ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 6048) + (shadow gm-shadow :inline :offset-assert 6512) + (stack uint128 16 :offset-assert 6912) + ) + :method-count-assert 9 + :size-assert #x1c00 + :flag-assert #x900001c00 + ) diff --git a/goal_src/jak2/engine/gfx/merc/merc-h.gc b/goal_src/jak2/engine/gfx/merc/merc-h.gc index 8ebf460116..1d131ea311 100644 --- a/goal_src/jak2/engine/gfx/merc/merc-h.gc +++ b/goal_src/jak2/engine/gfx/merc/merc-h.gc @@ -7,3 +7,397 @@ ;; DECOMP BEGINS +(deftype ripple-merc-query (inline-array-class) + ((start-vertex int32 :offset-assert 16) + (vertex-skip int32 :offset-assert 20) + (vertex-count int32 :offset-assert 24) + (current-loc int32 :offset-assert 28) + (data vector :inline :dynamic :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) +(set! (-> ripple-merc-query heap-base) (the-as uint 16)) + +(deftype merc-byte-header (structure) + ((srcdest-off uint8 :offset-assert 0) + (rgba-off uint8 :offset-assert 1) + (lump-off uint8 :offset-assert 2) + (fp-off uint8 :offset-assert 3) + (mat1-cnt uint8 :offset-assert 4) + (mat2-cnt uint8 :offset-assert 5) + (mat3-cnt uint8 :offset-assert 6) + (samecopy-cnt uint8 :offset-assert 7) + (crosscopy-cnt uint8 :offset-assert 8) + (strip-len uint8 :offset-assert 9) + (mm-quadword-fp-off uint8 :offset-assert 10) + (mm-quadword-size uint8 :offset-assert 11) + (perc-off uint8 :offset-assert 12) + (mat-slot uint8 10 :offset-assert 13) + ) + :method-count-assert 9 + :size-assert #x17 + :flag-assert #x900000017 + ) + +(deftype merc-fragment (structure) + ((header merc-byte-header :inline :offset-assert 0) + (rest uint8 1 :offset-assert 23) + ) + :method-count-assert 10 + :size-assert #x18 + :flag-assert #xa00000018 + (:methods + (login-adgifs (_type_) none 9) + ) + ) + +(deftype merc-vtx (structure) + ((mat-0 uint8 :offset-assert 0) + (mat-1 uint8 :offset-assert 1) + (nrm-x uint8 :offset-assert 2) + (pos-x uint8 :offset-assert 3) + (dst-0 uint8 :offset-assert 4) + (dst-1 uint8 :offset-assert 5) + (nrm-y uint8 :offset-assert 6) + (pos-y uint8 :offset-assert 7) + (tex-s uint8 :offset-assert 8) + (tex-t uint8 :offset-assert 9) + (nrm-z uint8 :offset-assert 10) + (pos-z uint8 :offset-assert 11) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype merc-fp-header (structure) + ((x-add float :offset-assert 0) + (y-add float :offset-assert 4) + (z-add float :offset-assert 8) + (shader-cnt uint8 :offset-assert 12) + (kick-info-offset uint8 :offset-assert 13) + (kick-info-step uint8 :offset-assert 14) + (hword-cnt uint8 :offset-assert 15) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defun merc-fragment-fp-data ((arg0 merc-fragment)) + (the-as merc-fp-header (+ (the-as uint arg0) (* (-> arg0 header mm-quadword-fp-off) 16))) + ) + +(deftype merc-mat-dest (structure) + ((matrix-number uint8 :offset-assert 0) + (matrix-dest uint8 :offset-assert 1) + ) + :pack-me + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +(deftype merc-fragment-control (structure) + ((unsigned-four-count uint8 :offset-assert 0) + (lump-four-count uint8 :offset-assert 1) + (fp-qwc uint8 :offset-assert 2) + (mat-xfer-count uint8 :offset-assert 3) + (mat-dest-data merc-mat-dest :inline :dynamic :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype merc-blend-data (structure) + ((int8-data int8 :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +(deftype merc-blend-ctrl (structure) + ((blend-vtx-count uint8 :offset-assert 0) + (nonzero-index-count uint8 :offset-assert 1) + (bt-index uint8 :dynamic :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +(deftype mei-envmap-tint (structure) + ((fade0 float :offset-assert 0) + (fade1 float :offset-assert 4) + (tint uint32 :offset-assert 8) + (dummy int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype mei-texture-scroll (structure) + ((max-dist float :offset-assert 0) + (st-int-scale uint8 :offset-assert 4) + (time-factor uint8 :offset-assert 5) + (scroll-dir uint8 :offset-assert 6) + (cached-time uint8 :offset-assert 7) + (time-delta uint8 :offset-assert 8) + (dummy uint8 7 :offset-assert 9) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype mei-ripple (structure) + ((x-base float :offset-assert 0) + (z-base float :offset-assert 4) + (grid-size float :offset-assert 8) + (angle float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype merc-extra-info (structure) + ((envmap-tint-offset uint8 :offset-assert 0) + (shader-offset uint8 :offset-assert 1) + (texture-scroll-offset uint8 :offset-assert 2) + (ripple-offset uint8 :offset-assert 3) + (dummy uint8 12 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype merc-effect (structure) + ((frag-geo merc-fragment :offset-assert 0) + (frag-ctrl merc-fragment-control :offset-assert 4) + (blend-data merc-blend-data :offset-assert 8) + (blend-ctrl merc-blend-ctrl :offset-assert 12) + (merc-effect-version uint8 :offset-assert 16) + (effect-bits uint8 :offset-assert 17) + (frag-count uint16 :offset-assert 18) + (blend-frag-count uint16 :offset-assert 20) + (tri-count uint16 :offset-assert 22) + (dvert-count uint16 :offset-assert 24) + (texture-index uint8 :offset-assert 26) + (effect-usage uint8 :offset-assert 27) + (extra-info merc-extra-info :offset-assert 28) + ) + :method-count-assert 10 + :size-assert #x20 + :flag-assert #xa00000020 + (:methods + (login-adgifs (_type_) none 9) + ) + ) + +(deftype merc-eye-ctrl (structure) + ((eye-slot int8 :offset-assert 0) + (shader-offset int8 :offset-assert 1) + (shader-count int8 :offset-assert 2) + (shader adgif-shader 6 :inline :offset-assert 16) + (left-iris-shader adgif-shader :inline :offset 16) + (left-pupil-shader adgif-shader :inline :offset 96) + (left-lid-shader adgif-shader :inline :offset 176) + (right-iris-shader adgif-shader :inline :offset 256) + (right-pupil-shader adgif-shader :inline :offset 336) + (right-lid-shader adgif-shader :inline :offset 416) + ) + :method-count-assert 9 + :size-assert #x1f0 + :flag-assert #x9000001f0 + ) + +(deftype merc-eye-anim-frame (structure) + ((pupil-trans-x int8 :offset-assert 0) + (pupil-trans-y int8 :offset-assert 1) + (blink int8 :offset-assert 2) + (iris-scale int8 :offset 4) + (pupil-scale int8 :offset 5) + (lid-scale int8 :offset 6) + (dword uint64 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype merc-eye-anim-block (structure) + ((max-frame int16 :offset-assert 0) + (data merc-eye-anim-frame :inline :dynamic :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype texture-usage-group (structure) + ((data texture-masks 7 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x150 + :flag-assert #x900000150 + ) + +(deftype merc-ctrl-header (structure) + ((xyz-scale float :offset-assert 0) + (st-magic uint32 :offset-assert 4) + (st-out-a uint32 :offset-assert 8) + (st-out-b uint32 :offset-assert 12) + (st-vif-add uint32 :offset-assert 16) + (st-int-off uint16 :offset-assert 20) + (st-int-scale uint16 :offset-assert 22) + (effect-count uint32 :offset-assert 24) + (blend-target-count uint32 :offset-assert 28) + (fragment-count uint16 :offset-assert 32) + (tri-count uint16 :offset-assert 34) + (matrix-count uint8 :offset-assert 36) + (shader-count uint8 :offset-assert 37) + (transform-vertex-count uint16 :offset-assert 38) + (dvert-count uint16 :offset-assert 40) + (one-mat-count uint16 :offset-assert 42) + (two-mat-count uint16 :offset-assert 44) + (two-mat-reuse-count uint16 :offset-assert 46) + (three-mat-count uint16 :offset-assert 48) + (three-mat-reuse-count uint16 :offset-assert 50) + (shader-upload-count uint8 :offset-assert 52) + (matrix-upload-count uint8 :offset-assert 53) + (same-copy-count uint16 :offset-assert 54) + (cross-copy-count uint16 :offset-assert 56) + (num-verts uint16 :offset-assert 58) + (longest-edge float :offset-assert 60) + (eye-ctrl merc-eye-ctrl :offset-assert 64) + (pad uint32 3 :offset-assert 68) + (masks-padding texture-masks :inline :offset-assert 80) + (texture-usage-group texture-usage-group :offset 80) + (dummy-bytes uint8 :dynamic :offset 32) + (envmap-tint uint32 :offset 32) + (query basic :offset 36) + (needs-clip uint8 :offset 40) + (use-isometric uint8 :offset 41) + (use-attached-shader uint8 :offset 42) + (display-triangles uint8 :offset 43) + (death-vertex-skip uint16 :offset 44) + (death-start-vertex uint16 :offset 46) + (death-effect uint32 :offset 48) + (use-translucent uint8 :offset 52) + (display-this-fragment uint8 :offset 53) + (use-warp uint8 :offset 54) + (ignore-alpha uint8 :offset 55) + (force-fade uint8 :offset 56) + (disable-fog uint8 :offset 57) + (disable-envmap uint8 :offset 58) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype merc-ctrl (art-element) + ((num-joints int32 :offset 20) + (seg-table basic :offset 24) + (header merc-ctrl-header :inline :offset-assert 32) + (effect merc-effect :inline :dynamic :offset-assert 160) + ) + :method-count-assert 13 + :size-assert #xa0 + :flag-assert #xd000000a0 + ) + +(deftype merc-vu1-low-mem (structure) + ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) + (ad-gif gs-gif-tag :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (perspective uint128 4 :offset-assert 48) + (fog vector :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype emerc-vu1-low-mem (structure) + ((tri-strip-gif qword :inline :offset-assert 0) + (ad-gif qword :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (perspective vector 4 :inline :offset-assert 48) + (fog vector :inline :offset-assert 112) + (unperspect vector :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) + +(deftype ripple-wave (structure) + ((scale float :offset-assert 0) + (offs float :offset-assert 4) + (xdiv int16 :offset-assert 8) + (zdiv int16 :offset-assert 10) + (speed float :offset-assert 12) + (xmul float :offset-assert 16) + (zmul float :offset-assert 20) + (delta float :offset-assert 24) + ) + :pack-me + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(deftype ripple-wave-set (basic) + ((count int32 :offset-assert 4) + (converted basic :offset-assert 8) + (normal-scale float :offset-assert 12) + (wave ripple-wave 4 :inline :offset-assert 16) + (frame-save uint64 :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) + +(deftype ripple-control (basic) + ((global-scale float :offset-assert 4) + (last-frame-scale float :offset-assert 8) + (close-fade-dist float :offset-assert 12) + (far-fade-dist float :offset-assert 16) + (faded-scale float :offset-assert 20) + (individual-normal-scale float :offset-assert 24) + (waveform ripple-wave-set :offset-assert 28) + (send-query symbol :offset-assert 32) + (query ripple-merc-query :offset-assert 36) + ) + (:methods + (new (symbol type) _type_ 0) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +(defmethod new ripple-control ((allocation symbol) (type-to-make type)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 global-scale) 0.0) + (set! (-> v0-0 last-frame-scale) -0.001) + (set! (-> v0-0 close-fade-dist) 4096000000.0) + (set! (-> v0-0 far-fade-dist) 8192000000.0) + (set! (-> v0-0 faded-scale) -0.001) + (set! (-> v0-0 waveform) #f) + (set! (-> v0-0 individual-normal-scale) 1.0) + (set! (-> v0-0 send-query) #f) + (set! (-> v0-0 query) #f) + v0-0 + ) + ) diff --git a/goal_src/jak2/engine/gfx/mood/mood-h.gc b/goal_src/jak2/engine/gfx/mood/mood-h.gc index ea978adb76..86b9e55c4d 100644 --- a/goal_src/jak2/engine/gfx/mood/mood-h.gc +++ b/goal_src/jak2/engine/gfx/mood/mood-h.gc @@ -5,5 +5,244 @@ ;; name in dgo: mood-h ;; dgos: ENGINE, GAME +;; todo docs and method names. + ;; DECOMP BEGINS +(deftype mood-channel (structure) + ((data float 24 :offset-assert 0) + (vecs vector4 6 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +(deftype mood-channel-group (structure) + ((data mood-channel 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +(deftype mood-fog (structure) + ((fog-color vector :inline :offset-assert 0) + (fog-dists vector :inline :offset-assert 16) + (fog-start meters :offset 16) + (fog-end meters :offset 20) + (fog-max float :offset 24) + (fog-min float :offset 28) + (erase-color vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype mood-fog-table (structure) + ((data mood-fog 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +(deftype mood-color (structure) + ((lgt-color vector :inline :offset-assert 0) + (amb-color vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype mood-direction-table (structure) + ((data vector 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype mood-color-table (structure) + ((data mood-color 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +(deftype mood-sky-table (structure) + ((data vector 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype mood-clouds (structure) + ((cloud-min float :offset-assert 0) + (cloud-max float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype mood-weather (structure) + ((data float 2 :offset-assert 0) + (cloud float :offset 0) + (fog float :offset 4) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype mood-iweather (structure) + ((data int32 2 :offset-assert 0) + (cloud int32 :offset 0) + (fog int32 :offset 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype mood-range (structure) + ((data float 4 :offset-assert 0) + (min-cloud float :offset 0) + (max-cloud float :offset 4) + (min-fog float :offset 8) + (max-fog float :offset 12) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype mood-filters-table (structure) + ((data vector 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(deftype mood-table (basic) + ((mood-fog-table mood-fog-table :offset-assert 4) + (mood-color-table mood-color-table :offset-assert 8) + (mood-channel-group mood-channel-group :offset-assert 12) + (mood-direction-table mood-direction-table :offset-assert 16) + (mood-sky-table mood-sky-table :offset-assert 20) + (mood-interp-table basic :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(deftype mood-context-core (structure) + ((current-fog mood-fog :inline :offset-assert 0) + (current-sky-color vector :inline :offset-assert 48) + (current-env-color vector :inline :offset-assert 64) + (current-prt-color vector :inline :offset-assert 80) + (current-shadow-color vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype mood-context-core2 (mood-context-core) + ((light-group light-group 8 :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x670 + :flag-assert #x900000670 + ) + +(deftype mood-context-core3 (mood-context-core2) + ((times vector 8 :inline :offset-assert 1648) + ) + :method-count-assert 9 + :size-assert #x6f0 + :flag-assert #x9000006f0 + ) + +(deftype mood-context (mood-context-core3) + ((itimes vector4w 4 :inline :offset-assert 1776) + (state uint32 32 :offset-assert 1840) + ) + :method-count-assert 9 + :size-assert #x7b0 + :flag-assert #x9000007b0 + ) + +(deftype mood-control-work (structure) + ((weather mood-weather :inline :offset-assert 0) + (iweather mood-iweather :inline :offset-assert 8) + (interp mood-weather :inline :offset-assert 16) + (index int32 4 :offset-assert 24) + (color-interp float :offset-assert 40) + (color-index int32 2 :offset-assert 44) + (channel-interp float :offset-assert 52) + (channel-index int32 2 :offset-assert 56) + (cloud-interp float :offset-assert 64) + (cloud-index int32 2 :offset-assert 68) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +(deftype mood-control (mood-table) + ((mood-clouds mood-clouds :offset-assert 28) + (current-interp mood-weather :inline :offset-assert 32) + (target-interp mood-weather :inline :offset-assert 40) + (speed-interp mood-weather :inline :offset-assert 48) + (range mood-range :inline :offset-assert 64) + (time-until-random mood-weather :inline :offset-assert 80) + (time-until-random-min mood-weather :inline :offset-assert 88) + (time-until-random-max mood-weather :inline :offset-assert 96) + (display-flag basic :offset-assert 104) + (overide-weather-flag basic :offset-assert 108) + (overide mood-weather :inline :offset-assert 112) + (lightning-index int32 :offset-assert 120) + (lightning-val int32 :offset-assert 124) + (lightning-time int32 :offset-assert 128) + (lightning-time2 float :offset-assert 132) + (lightning-flash float :offset-assert 136) + (lightning-id uint32 :offset-assert 140) + (lightning-count0 uint32 :offset-assert 144) + (lightning-count1 uint32 :offset-assert 148) + (lightning-count2 uint32 :offset-assert 152) + (rain-id uint32 :offset-assert 156) + (sound-pitch float :offset-assert 160) + (fogs mood-fog 9 :offset-assert 164) + (colors mood-color 3 :offset-assert 200) + (channels mood-channel 3 :offset-assert 212) + (clouds mood-clouds 9 :offset-assert 224) + ) + :method-count-assert 19 + :size-assert #x104 + :flag-assert #x1300000104 + (:methods + (mood-control-method-9 () none 9) + (mood-control-method-10 () none 10) + (mood-control-method-11 () none 11) + (mood-control-method-12 () none 12) + (mood-control-method-13 () none 13) + (mood-control-method-14 () none 14) + (mood-control-method-15 () none 15) + (mood-control-method-16 () none 16) + (mood-control-method-17 () none 17) + (mood-control-method-18 () none 18) + ) + ) + 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 b483ccc6e8..63f5c1b550 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 @@ -5,5 +5,112 @@ ;; name in dgo: time-of-day-h ;; dgos: ENGINE, GAME +(declare-type sparticle-launch-control inline-array-class) + + ;; DECOMP BEGINS +(deftype palette-fade-control (structure) + ((trans vector :inline :offset-assert 0) + (fade float :offset-assert 16) + (actor-dist float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(deftype palette-fade-controls (basic) + ((control palette-fade-control 8 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x110 + :flag-assert #xb00000110 + (:methods + (palette-fade-controls-method-9 () none 9) + (palette-fade-controls-method-10 () none 10) + ) + ) + +(define-perm *palette-fade-controls* palette-fade-controls (new 'global 'palette-fade-controls)) + +(deftype time-of-day-proc (process) + ((hours int32 :offset-assert 128) + (minutes int32 :offset-assert 132) + (seconds int32 :offset-assert 136) + (old-frame uint64 :offset-assert 144) + (current-frame uint64 :offset-assert 152) + (frames uint64 :offset-assert 160) + (time-of-day float :offset-assert 168) + (time-ratio float :offset-assert 172) + (dest-time-ratio float :offset-assert 176) + (dest-time-delta float :offset-assert 180) + (sun-count int32 :offset-assert 184) + (sun sparticle-launch-control :offset-assert 188) + (green-sun-count int32 :offset-assert 192) + (green-sun sparticle-launch-control :offset-assert 196) + (moon-count int32 :offset-assert 200) + (moon sparticle-launch-control :offset-assert 204) + ) + :heap-base #x50 + :method-count-assert 14 + :size-assert #xd0 + :flag-assert #xe005000d0 + ) + +(deftype time-of-day-palette (basic) + ((width int32 :offset-assert 4) + (height int32 :offset-assert 8) + (pad int32 :offset-assert 12) + (data int32 1 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype time-of-day-context (basic) + ((interp float 6 :offset-assert 4) + (current-fog mood-fog :inline :offset-assert 32) + (current-sky-color vector :inline :offset-assert 80) + (current-env-color vector :inline :offset-assert 96) + (current-prt-color vector :inline :offset-assert 112) + (current-shadow-color vector :inline :offset-assert 128) + (light-group light-group 8 :inline :offset-assert 144) + (current-clouds mood-clouds :inline :offset-assert 1680) + (times vector 8 :inline :offset-assert 1696) + (title-light-group light-group :inline :offset-assert 1824) + (filter vector :inline :offset-assert 2016) + (filter-color vector :inline :offset-assert 2032) + (time float :offset-assert 2048) + (target-interp float :offset-assert 2052) + (erase-color rgba :offset-assert 2056) + (sky symbol :offset-assert 2060) + (use-camera-other basic :offset-assert 2064) + (title-updated symbol :offset-assert 2068) + (mode uint32 :offset-assert 2072) + (overide-enable basic :offset-assert 2076) + (overide-palette uint32 :offset-assert 2080) + (max-rain float :offset-assert 2084) + (fog-mult float :offset-assert 2088) + (exterior-level basic :offset-assert 2092) + (ocean-alpha float :offset-assert 2096) + ) + :method-count-assert 9 + :size-assert #x834 + :flag-assert #x900000834 + ) + +(deftype time-of-day-dma (structure) + ((outa uint32 256 :offset-assert 0) + (outb uint32 256 :offset-assert 1024) + (banka uint32 256 :offset-assert 2048) + (bankb uint32 256 :offset-assert 3072) + ) + :method-count-assert 9 + :size-assert #x1000 + :flag-assert #x900001000 + ) + +(define *time-of-day-context* (new 'static 'time-of-day-context)) + diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc b/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc index 94a728eded..e99e39e4f0 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-frames.gc @@ -7,3 +7,16394 @@ ;; DECOMP BEGINS +(define *ocean-wave-frames* (new 'static 'array uint32 16384 + #x5c1febd8 + #x1cfe1450 + #xb6b8e71f + #x32563ef2 + #x9f2e6fe + #x2e1b090d + #x9001024 + #xe4e70d1f + #x5410dfd1 + #x4ef1756 + #xb5d1041c + #x365128da + #xdede305 + #x21100c17 + #x80d232c + #xe2f5191d + #x3dfad5d4 + #xe2e31d54 + #xc5f91906 + #x373f09c7 + #x10eae70d + #x12091524 + #xa20342b + #xeb08241b + #x1ceddae4 + #xc9e41f3d + #xee1b11df + #x2a1cedcd + #x12eef214 + #xc11242e + #x112b3420 + #xfe1d2814 + #xcefeafa + #xbedf0d21 + #x1724f5c1 + #x10f9e4ee + #x18f6fa0e + #x12203236 + #xe272b18 + #x14302a0e + #xdf5f70d + #xadc8f718 + #x301cdbad + #xf2e2ef14 + #x1dfefb00 + #x21323f3b + #x1c251b + #x2f4124fe + #x11f50928 + #x8eaff925 + #x3b14c997 + #xdcde022c + #x2002f6ee + #x30475041 + #xf21b2823 + #x4a410de7 + #x9f62345 + #x80b41433 + #x4210ba80 + #xd5e30e37 + #x1c00f1e3 + #x43606342 + #xf31c2428 + #x4d24edd7 + #xfe053847 + #x84d52a2b + #x4708ab80 + #xd8ea1541 + #x10f9f2e6 + #x59776838 + #x1151b30 + #x27f7d7df + #x21c361f + #xaaf92818 + #x3ff19480 + #xdaeb1f4b + #x2f6faee + #x707f6128 + #xc09143e + #xeddae2f7 + #x122010e4 + #xcd091912 + #x20c8808c + #xdaee2b4d + #xfafd08f5 + #x7f7f5118 + #xd02184d + #xcce0fe0e + #x1504e2c2 + #xe306141b + #xf2a280a7 + #xdcf73237 + #xfd0d15f9 + #x7f7c3f0a + #xc041f58 + #xd5fd1919 + #xf9d5c8c9 + #xed061c1b + #xc99794c0 + #xe604270e + #x81d1bfa + #x7f712f02 + #x10061d58 + #xf5172a24 + #xcdbacfe3 + #xf91019fd + #xbcabb2d5 + #xf10208e3 + #x17281c01 + #x7f652806 + #x18011552 + #x8243b36 + #xaebde0f1 + #xd17fecd + #xc4c5cdeb + #xf6f1e3cb + #x232b200a + #x765d2711 + #x19f50a4b + #x82e544a + #xb1d1e7e8 + #x2005ccaa + #xcdd4e40a + #xeedacdc8 + #x282c2811 + #x6f582a1c + #xde6044a + #x63f684e + #xc5dbdfe0 + #x19d7a2a7 + #xc9df052a + #xe3d0cdc9 + #x2b302c0c + #x6f562b20 + #xfadc084d + #x12527041 + #xd5d4d7e6 + #xf6a597be + #xc4f52b34 + #xe4d8d0be + #x2b322404 + #x7052271f + #xebde1152 + #x27646b2f + #xd5c8dbf5 + #xc78ca9d5 + #xc917421f + #xfaeac7aa + #x2b281505 + #x6c4a231f + #xe3e7205a + #x38696423 + #xcdc1e3fe + #xa792c0df + #xe0343af6 + #x18efaf9a + #x21170e1b + #x603d2420 + #xe3f93360 + #x496c5d18 + #xc9c1ed05 + #xa2a6cfdf + #xfd3d1fd3 + #x2ce0979e + #xe051f3f + #x4b33251d + #xee11455c + #x5e6c520d + #xc7c5f519 + #xadb8d4dc + #xd3202c4 + #x27c58eb1 + #xf705425d + #x382f2710 + #x62e4a4b + #x76673d06 + #xc2cc093d + #xb5c0d7da + #xa1df1c2 + #x10b294c4 + #xee1b6467 + #x32331ffb + #x27414134 + #x7855240d + #xc1e22455 + #xb9c5dad3 + #x210eac4 + #xfbada3cd + #xf73a745a + #x34320deb + #x41432f25 + #x5836141f + #xd1023449 + #xc0cbd7cf + #x10ce7c4 + #xf5b8b4d3 + #xe4e6f49 + #x3427fdea + #x463a2121 + #x2012112f + #xf3213221 + #xc8cfd4da + #x80ae3c9 + #xf5c5c1dc + #x214d5a38 + #x2b17f9f9 + #x41301f20 + #xf1f91436 + #x1b301df9 + #xccccd7f6 + #xd05dfcd + #xf7d1d1ed + #x243a452f + #x1910020a + #x3a2e1d19 + #xd1ea1436 + #x363008de + #xc8cdea19 + #xdfad8c9 + #xf7e0e800 + #x19253625 + #x11181412 + #x362a180c + #xbce21433 + #x3f2af6cc + #xc9db0534 + #x8edcfc2 + #xfaf50510 + #xc172a1c + #x15251d10 + #x2f230e04 + #xafe0142f + #x4123edc1 + #xdcf51c3e + #xfbdac1c5 + #x20e2018 + #x20d190e + #x21301c06 + #x24180504 + #xb5e61528 + #x4620edc5 + #xfd0a2341 + #xe8c5bddc + #x122e3617 + #x40405 + #x2c331400 + #x190a010a + #xcce81020 + #x5021f2d0 + #x17152043 + #xd8b4c1f9 + #x20454211 + #x2fbf501 + #x32320efe + #x12010112 + #xe2eb0819 + #x4a02d0c5 + #xf52a61 + #xa9cb0920 + #x3f4f1ac9 + #xf7dfe40c + #x2006080f + #xfb01142a + #xcef91b10 + #x34f0c6c2 + #xe7f2365e + #xbaeb150a + #x4041febc + #xf9dcea15 + #x11051017 + #x1132023 + #xd6061c0a + #x13ddc7cb + #xd0f53c4a + #xdd0f13e7 + #x3a22e0bc + #xf9dff31f + #x80a1e1f + #xa262a18 + #xeb181f06 + #xf9d9d6e1 + #xc9f72b26 + #x918f5ca + #x22fed4d9 + #xfbe7fd1c + #xc182720 + #x132a250f + #x8271c05 + #xf5e1eaf9 + #xc3e70f10 + #x230cd5ba + #xe4e002 + #x4f5010a + #x18273125 + #xc231f11 + #x293217fe + #xf9e7fe18 + #xabcd0110 + #x2dfdc2a8 + #xe1e1fa20 + #xcfdfbf2 + #x25363d2b + #xfe1c1e1a + #x4b3506eb + #xf6ee1a3c + #x8ac30d1a + #x31f7b187 + #xd4eb1031 + #xffbf0dd + #x364c4e32 + #xfa1c1f23 + #x5b20e7d9 + #xef01364e + #x80d92014 + #x38f09a80 + #xd0f01c3f + #xcf6ead4 + #x4f645a32 + #x5181c31 + #x40f9cdd9 + #xf31c3a34 + #x99f92505 + #x35df8080 + #xd1f2274e + #x4f3ecd8 + #x6c75572a + #xc0d1a41 + #x2d5caea + #x92a1bf6 + #xbf091500 + #x1fbc8080 + #xd2f63656 + #xfaf7f7e0 + #x7f774718 + #x8041e55 + #xd1d2e3fd + #x1514ebc7 + #xd8040d0a + #xf696809a + #xd5024145 + #xfa0602e3 + #x7f703406 + #x1042964 + #xd0eafe05 + #x4e7cac2 + #xe3001413 + #xca8484b7 + #xdf113c1e + #x51708e4 + #x7f6423fe + #x1082f6a + #xef05100c + #xd8c0c9d9 + #xea091b01 + #xb392a1c9 + #xee171eef + #x142009ea + #x7f571b02 + #x8052a68 + #x9151f1a + #xb3bbd6ea + #xfb1306d5 + #xb8adbbda + #xf605f5d1 + #x20230ff6 + #x744b180f + #xaf91f5f + #xd23382b + #xa9c9e0e5 + #x1008daad + #xc6c3d2f6 + #xf0e7d4c9 + #x25251a01 + #x6c451c1a + #xea175a + #xc385236 + #xbad4dadc + #x11ddada2 + #xcad1f217 + #xe1d0c9ca + #x272d2200 + #x68431e1c + #xeee11759 + #x1b52612e + #xcaced4e0 + #xf0ab9ab3 + #xc7e81827 + #xd8d0cac3 + #x2a321ef5 + #x6a441f1c + #xdddf1c5b + #x38645e1e + #xcbc2d8f3 + #xc28ca5c7 + #xd00c3418 + #xe1dac3b1 + #x2e2f11ef + #x683d1c1e + #xd4e42662 + #x596d550d + #xc0bce406 + #x9d8ebbd1 + #xe82f35ef + #xf9dfaca4 + #x291e09fd + #x5d321c22 + #xd5f03568 + #x71704e02 + #xbbbeee15 + #x93a2cace + #x83f1bc7 + #xace93a9 + #x170c151f + #x4b2a1f22 + #xdf054465 + #x7f6f43f9 + #xb8c3f527 + #x9bb4d1ca + #x1c34fab3 + #x9b388be + #x83540 + #x3d2a2215 + #xf51f4b55 + #x7f682df3 + #xb5c90445 + #xa6bed4c7 + #x1c1ce5b3 + #xf79d90d5 + #xf21e5b4f + #x362d1bfd + #x1434433d + #x7f5514f9 + #xb4da1e5b + #xadc2d5c2 + #x1109dcb7 + #xe197a0e0 + #xf9407147 + #x382d06e7 + #x2f392f2d + #x6839080d + #xbff93252 + #xb3c6d1bb + #x9fed8ba + #xd6a0acdf + #x115b7134 + #x3a23f3e3 + #x3c2f1f29 + #x381c0d27 + #xdf183227 + #xbbc7c9c0 + #x9fbd5be + #xd8afb5e1 + #x2a5f5f25 + #x3110ecf2 + #x35221a2a + #x6081a34 + #x6291efa + #xbfc5c9dc + #xcf7d5c5 + #xdfbcc2eb + #x2f504e1e + #x1e04f306 + #x2d1e1b25 + #xe7fd1c31 + #x232702d9 + #xbcc2da02 + #xaf2d4c6 + #xe4cbd5fa + #x2539401a + #x11060411 + #x2b201715 + #xd2f3182b + #x2e1aebc2 + #xbacbfb23 + #x5e8cec0 + #xe8dcec06 + #x14293511 + #x1315100f + #x2d200d09 + #xc0ec152a + #x2f10dfb3 + #xc7e51834 + #xfbdac2be + #xf0f5050c + #x61e2306 + #x1f221104 + #x2a180105 + #xbceb172a + #x340cd9af + #xe3fe2539 + #xebc6b8cd + #x1141a0a + #x111000 + #x2b2609fa + #x1f0afa0c + #xcaee1725 + #x400cd9b8 + #x1092343 + #xd1b7c5ee + #x183427fd + #xfd01fbfe + #x2e1e02fa + #x11fefb15 + #xd6ef141e + #x4b0fd9c7 + #x13082050 + #xbcb0d90c + #x2a4a2bef + #xfdf3f0fe + #x2b150001 + #x9f7fe1c + #xdaef111c + #x29e5bbb3 + #xe3034f62 + #xb7ee210c + #x4d3bf2b7 + #xe9d9f326 + #x10071008 + #xf8071a23 + #xd6121e00 + #x11d6bbbc + #xdc0c5450 + #xd40516f2 + #x4823dcba + #xe7ddfb2d + #xc0c180b + #x4182019 + #xf01c19ff + #xf6cdc8d1 + #xd915472e + #xfc14fed6 + #x3601cbce + #xe9e5072e + #xb18220d + #x11251e0f + #x12271500 + #xe9d4def0 + #xdd0d260d + #x1807ddc9 + #x14e7d4f6 + #xeff20d1e + #x1423290f + #x1421160d + #x332d1103 + #xebddf412 + #xd0f40c03 + #x1ef3cbc1 + #xf2e3f018 + #xfbfc0804 + #x1e2d3115 + #xc1a1515 + #x4f2d05f8 + #xebe7103a + #xb2df0905 + #x1de7bca9 + #xe1f00f2a + #x5fffae7 + #x2a3a3c21 + #x719181e + #x5d1eede9 + #xe7fc2e56 + #x99e61601 + #x20dea280 + #xddfe2137 + #x7f7ead8 + #x3e4b4527 + #xc191a2a + #x48fcd0e2 + #xee1c3c4b + #xa1001af6 + #x22cd8080 + #xdd012e48 + #x3f0e2d2 + #x585c4423 + #x12161e3c + #xcd8c7ed + #x4312914 + #xbf1010f0 + #x18b28080 + #xdc043f55 + #xfef4e6d5 + #x72643e18 + #xf102753 + #xd4c9d4fb + #x1923fcdc + #xda0904fc + #xfb948095 + #xdd104d4f + #xff01f0d6 + #x7f622f09 + #x30d3467 + #xc8d9edff + #x11f8d6cb + #xe301090d + #xd18384b3 + #xe5224b2a + #x50ff6d6 + #x7f562000 + #xfe103f73 + #xe6f2feff + #xeed1cddd + #xe6071608 + #xaf889ec7 + #xf32a32fb + #x1116f6da + #x77471201 + #x1114075 + #x5040907 + #xc7c3d8f2 + #xf3140fe6 + #xab9db4d2 + #x1d08d9 + #x1d19fbe7 + #x6b3a100d + #x7093a6e + #xd111a16 + #xb6cce1f0 + #x710ebbc + #xbbb4c8e9 + #xfefee6d0 + #x221d07f6 + #x61331419 + #xfffc3165 + #xd233321 + #xbcd4dde7 + #xdefbfa9 + #xc7c5e208 + #xeedfd5d2 + #x252312fb + #x5c331c20 + #xeef22d61 + #x2042471e + #xc9ced8eb + #xf7c0a6b0 + #xc9dc081e + #xdcd5d2d0 + #x292e16f0 + #x5c341d1d + #xdded2e61 + #x475a4c0f + #xc9c3dc03 + #xcb9ea9c0 + #xd4002a15 + #xdadacdc3 + #x2e2f0de7 + #x5a321a1e + #xd4ed3365 + #x6d6744ff + #xc0bde920 + #xa39abcc9 + #xed2731ef + #xeadcbbba + #x2f2505ee + #x542a1a23 + #xd1f33b69 + #x7f6637f2 + #xb8c3f633 + #x94abcbc5 + #x103e1cc5 + #xf8cca2bf + #x21140b07 + #x47221d27 + #xd8034867 + #x7f642ae7 + #xb6c9ff44 + #x9abcd0c0 + #x2a36fcaf + #xf8af96d6 + #xc0c2525 + #x3a22201d + #xe91c5159 + #x7f5d19e2 + #xb6d00b59 + #xa6c5d1bd + #x2e20e2ac + #xe7989def + #xfc1e4734 + #x33261c05 + #x4324b44 + #x7f5007e9 + #xb4da216a + #xaec9d2ba + #x2105d5b2 + #xd192aefb + #x3405e2e + #x362909ee + #x1e373732 + #x6b36fcfe + #xbbf33362 + #xb4cdceb3 + #x14fad1b6 + #xc49bbaf7 + #x195d621a + #x3a20f3e6 + #x2b2a2531 + #x441c041a + #xd410363c + #xbbcdc3b3 + #xdf3d0b8 + #xc4a7bff3 + #x3469560b + #x360de7f3 + #x291a1e36 + #x1c0d182d + #xf822220f + #xc0c7bdc8 + #xcefd0bf + #xcbb2c5f7 + #x42614908 + #x22fcee0c + #x21152234 + #x40b222d + #x162107ed + #xbdc1cdee + #x8ebd4c5 + #xd2bcd2ff + #x3a4f4007 + #x11fbfe1a + #x211a2125 + #xf6081d25 + #x2314efd8 + #xb8c8ee11 + #x3e6d2c3 + #xdacde507 + #x273e3605 + #xd070c16 + #x261d1612 + #xe9ff1523 + #x2307dec4 + #xbcdf0f25 + #xfbdec8bb + #xe5e5fa09 + #x16322a00 + #x18150d09 + #x2a16070d + #xdef71529 + #x2600d4b6 + #xd4fc202d + #xf0cdbdc0 + #xf6010b08 + #xd2619fc + #x261c08fe + #x2309fe12 + #xddf6192a + #x2fffcdb4 + #xf00c2536 + #xdcbdc0da + #xc1d16ff + #x81509ff + #x2d1601fb + #x18fefe1e + #xe1fb1c25 + #x38fcc8b7 + #xc2b48 + #xc1bbdefc + #x273416ea + #xfffc08 + #x270c0000 + #x8f70426 + #xdd001c1a + #x3cfac1ba + #x3043659 + #xafc4fe14 + #x3b4012d5 + #xf7eef410 + #x20030105 + #xfef60929 + #xd4031e12 + #xec7b5c0 + #xe82f745d + #xd91320f1 + #x561fd3b7 + #xe4e40b41 + #xf181a01 + #x172a1e + #x172a18fe + #xf9c2c3d9 + #xf039663f + #xf81806e0 + #x4605caca + #xe3ed1544 + #x13202000 + #xe1f2317 + #x2f2a1203 + #xe7c7dbfd + #xfc3b4517 + #x160ee8d5 + #x27eaceee + #xe8f91f3b + #x1a2b2600 + #x1b241b13 + #x482b0e0a + #xe5d7f520 + #xfa221e01 + #x1bf8d5d5 + #x3e3ed13 + #xf4031c1f + #x23332b07 + #x1b1e1618 + #x562a0a0b + #xe9e70f45 + #xdf030dfe + #x15e9cec8 + #xeef10f2a + #x1070bfd + #x2b393115 + #x161a1820 + #x5c22fc00 + #xe9fc2f62 + #xc0f911fc + #x11e0bba6 + #xea052733 + #xa02f5e7 + #x39453c20 + #x171c1f2a + #x4507e3f6 + #xee1c455f + #xbb0715f2 + #x13cc9181 + #xf1113540 + #xdfae7df + #x4e544126 + #x1b1f2638 + #xbe1d3f9 + #x6383c2f + #xd0160aed + #xdad8080 + #xf4184850 + #x9f9e4df + #x675d401f + #x161c3150 + #xcecad802 + #x223513f0 + #xe912fefa + #xf98d8096 + #xf2275d54 + #x600e8dc + #x775e3512 + #xb1e436a + #xb9ceea06 + #x2611e9d1 + #xf1060212 + #xd08080b6 + #xf63c6339 + #xb0aecd7 + #x7c58280a + #x522527c + #xd3e4fa03 + #x7e5d8e1 + #xf0091217 + #xaa819cc8 + #x6484e0a + #x1812ecd9 + #x76481b0d + #x926597f + #xf6f80205 + #xddcfdffa + #xf61716fc + #x9e94b2d1 + #x163c24e0 + #x2313ede8 + #x6a381517 + #xd22567b + #x5060e0e + #xc3d1e900 + #x91bfcd1 + #xaeabc3e1 + #x171cfdd1 + #x2716f9fa + #x5e2f1722 + #x9185074 + #x7172318 + #xc4d8e8f8 + #x1502d0b6 + #xbfbed8fe + #x5f8e8d5 + #x281e0701 + #x5a2f1f27 + #xf90d4a6e + #x1a313718 + #xcfd4e3fe + #x5d7b1b6 + #xc8d4fd17 + #xece4e3d8 + #x2f2a0ff8 + #x58332627 + #xe906486b + #x4650400b + #xcfc8e71b + #xdcb1aec3 + #xd3fa2315 + #xe0e4dfd1 + #x38310be9 + #x5633262a + #xdd03496d + #x73623bfa + #xc4c3f640 + #xb2a7bcca + #xed2431f4 + #xe9e3cfca + #x3c2a02ea + #x522e2331 + #xd907506f + #x7f632eec + #xbbcb0a5d + #x9db3cbc6 + #x123d20c8 + #xf6d4b9d1 + #x351b03fd + #x49282738 + #xdb12596d + #x7f5f1ee0 + #xb9d5186d + #xa1c4cfbe + #x313bfcae + #xf6b7abec + #x2213181a + #x3d282c30 + #xe7275e5f + #x7f5c0fd9 + #xb9dc267b + #xaecccfbb + #x3c24e0aa + #xe59eb309 + #xf233b2a + #x372e2717 + #xfe3c5a4a + #x7f4e00df + #xb9e4377f + #xb7d0ceb9 + #x330dd3b1 + #xcc98c617 + #x11445524 + #x382f15fc + #x1b44493c + #x6e35f6f4 + #xbcf8487c + #xbfd4cbb3 + #x22fdcfb6 + #xbaa1d416 + #x27625a0e + #x3d26fdf1 + #x2c38353b + #x4a1b0013 + #xd112485a + #xc6d5c0b1 + #x16f4ceb9 + #xb7add90d + #x44724efc + #x3b12ecfe + #x28232e43 + #x2411172a + #xf224342c + #xcaceb7bf + #xff0ccbc + #xbeb5d90a + #x586f43f6 + #x2bfeee18 + #x1c173044 + #x12162a2c + #x1123160b + #xc6c3c0e1 + #xaecd0c4 + #xc6bae00d + #x58653dfa + #x17f8fe2b + #x181e3437 + #xf1b2823 + #x1f13fefa + #xbec6df06 + #x5e9d4c3 + #xcec7ed0f + #x485637fc + #xe030f2a + #x22262b23 + #xa131c22 + #x2005eeea + #xbcdc031e + #x1e5d0bc + #xd8dbfd11 + #x374a2efa + #x1613161c + #x2c201817 + #xfe05182b + #x22fee0d7 + #xcffc1c28 + #xf9dbc4ba + #xe9f50b0f + #x2c3f22f9 + #x241c0f0f + #x2b120d1b + #xf2011f33 + #x28fcd1c7 + #xec112430 + #xe8cbc2cc + #x10f160a + #x232c13fe + #x2c180609 + #x1f030b28 + #xee062733 + #x2ff5c3c0 + #xfe162e41 + #xcfc2d5ea + #x1c2418f8 + #x1716070a + #x2b0f020a + #x11fe1533 + #xed0f2b2a + #x2ee7b9bc + #xfd154456 + #xbed1fa02 + #x38310bdd + #x6fe021c + #x200a060a + #x2011e33 + #xf0182a18 + #x2adbb5b7 + #xf4165d65 + #xb9e9180d + #x4d35fdc4 + #xf6f0002e + #x15060b06 + #xf903222e + #xf520270a + #xe4a5bef6 + #x6627c3e + #x26fed5 + #x48f7b9c1 + #xd9ef2555 + #x122417ef + #x824250f + #x532908fb + #xd6afd510 + #x17615b1d + #x1214e7d7 + #x2ae1c3e0 + #xdef92d4d + #x1a2c18ed + #x16211d10 + #x55260808 + #xd0c4f231 + #x21492dfb + #x18fbd5de + #x5d5de08 + #xeb083036 + #x253118f2 + #x1e1d1414 + #x54220810 + #xd7db0d4c + #xb1e0df2 + #xbe7d2e1 + #xece40821 + #xfd0f1f10 + #x2c341dfe + #x1b18161d + #x4a1b020d + #xddf32c61 + #xe50405f0 + #x1e0c9c7 + #xec002528 + #x90b02f3 + #x363c280f + #x1a1b1d24 + #x3408ef04 + #xe513455f + #xd00406eb + #x1d2a8a0 + #xf614342d + #xcfde8e7 + #x4349341a + #x1b1f242d + #x4e7de01 + #xfd344633 + #xdd0ffbe5 + #xfdac808c + #xfe21453c + #x8f2dde4 + #x58583c1b + #x18212c3f + #xc5c8dd08 + #x1e3c24f2 + #xf30bedf2 + #xe280809c + #xfe315c42 + #x5f3dde1 + #x6c5e3b17 + #x10213e5b + #xa7c1e908 + #x2f21f6c9 + #xfafeef0d + #xb98080b6 + #x24a6a30 + #xbfbdeda + #x75582f10 + #x9285475 + #xb6d0f401 + #x18f3dbd2 + #xf4fd061e + #x92808ac8 + #x135c5f04 + #x1401dbd9 + #x73481f12 + #xd33657f + #xd9e5f9fe + #xecd5dded + #xf70f140c + #x8681a5ce + #x265838d9 + #x1e01dae7 + #x6737161b + #x14386a7f + #xe9f3fe06 + #xc9d0e8f7 + #x81a04e1 + #x959cb5d9 + #x2d380cc3 + #x2401e4fd + #x5a2c1826 + #x13366779 + #xed021010 + #xc4d9ebf3 + #x180bd9be + #xaaafc7f3 + #x1b0ff0c5 + #x2509f709 + #x512a222c + #x5296273 + #x11d2612 + #xcbd6e8fd + #xde1b5b6 + #xb7c4e80d + #xfbf2e8ce + #x2a170501 + #x4e2f292c + #xf41f5b6c + #x2f3c3105 + #xccc9ed22 + #xe8b7aac0 + #xc4e71213 + #xe4e9e5ce + #x362404ed + #x4e31282f + #xe81b586c + #x62542cf3 + #xc0c40253 + #xbaa7b5c5 + #xde1626f4 + #xe4e7d9c9 + #x4124f9e4 + #x4d2d2638 + #xe11b5c6c + #x7c5c1ee2 + #xb2cc1d74 + #xa1aec1be + #xb371ac8 + #xedd7c4d5 + #x3f18f4ef + #x46292a42 + #xde24636a + #x79580fd5 + #xaeda307f + #xa1bdc4b5 + #x333bf6a8 + #xecbab7f0 + #x2f100406 + #x3a28313e + #xe4366a5f + #x715000cc + #xb1e43e7f + #xaec5c0af + #x4525d3a1 + #xd7a0c013 + #x1b1d2516 + #x332f3128 + #xf949694e + #x6d42f0cf + #xb2ec4e7f + #xb9c8bdae + #x3c09c1a7 + #xba98d628 + #x1a3e4310 + #x3733220b + #x14505741 + #x6329e8e1 + #xb6fe5c7f + #xc0ccbaaa + #x29f6beac + #xa5a1e929 + #x2d5f4efb + #x3c2a04fb + #x2a43413e + #x4810ed01 + #xc7185e6a + #xc8cfb2a5 + #x17edbeb1 + #xa3aff01e + #x4d7142e8 + #x3b10eb05 + #x2c2c3646 + #x1f06081e + #xe72a483c + #xccc5a7b1 + #xde8c0b6 + #xaab7ef16 + #x667336e0 + #x2cf7e822 + #x1e1f3a4a + #x9122226 + #x628281a + #xc7b6aacf + #x6e4c3bd + #xb2baef13 + #x706a2de2 + #x14effb3b + #x1022413f + #xd21291b + #x16140c0d + #xbab3c5f6 + #xe2c8be + #xb9c1f713 + #x66612ae7 + #x8fb1241 + #x162c3a28 + #x161f1d13 + #x1601fd06 + #xb6c8ed10 + #xfee4c8b5 + #xc3d20212 + #x555525e8 + #xc0d1a33 + #x252a2617 + #xc0f161e + #x13f9eff3 + #xc4ec0c1d + #xfadec0af + #xd2e80c10 + #x484a1de9 + #x1b181322 + #x2a1b1618 + #xf6011d30 + #x18f4dad9 + #xe1081b26 + #xedcfb9ba + #xe8fe140b + #x3e3b12ef + #x2616061a + #x210b1325 + #xe5042a37 + #x21e9c3c7 + #xfa122536 + #xd5c1c5d9 + #x51317fe + #x312609fe + #x260c0017 + #xf041d31 + #xe7123430 + #x21d5b1c0 + #x143b4d + #xbec9e7f4 + #x24210ce2 + #x1d0f0414 + #x1e060112 + #x1062a36 + #xf71f331f + #x13bdaac7 + #xf7245f5c + #xc1ec06fa + #x3f22f2c5 + #x1fa092f + #x130b0906 + #xf90f312c + #x1429280c + #x6acacce + #xf03a7b63 + #xd00b17f2 + #x4e1dd9b2 + #xeced1045 + #xb1310fa + #xf6163422 + #x2d2f1dfe + #xc5adec3a + #x457f6d18 + #x271fe0e5 + #x2adcc5ec + #xe50d4c62 + #x282e0fe7 + #x23332318 + #x57250708 + #xc5c40046 + #x4c714602 + #x2306dcf7 + #xed7de08 + #xee184d4d + #x2f300dea + #x272b1f1c + #x48210d15 + #xcfde1953 + #x40441ff1 + #x13eede06 + #xf4e00421 + #x23412c + #x37320df4 + #x25231d24 + #x371c0e1a + #xdaf7305b + #x191c0df0 + #x2e6e3fc + #xf1002423 + #x1120230b + #x3d361504 + #x2323232a + #x27110716 + #xe5134857 + #xf90e08ed + #xffe2cfd7 + #x1d3321 + #x150f02fb + #x45422715 + #x24282830 + #x7f9f813 + #xfc375035 + #xf71200e9 + #xfdc9a4ba + #xf2f402a + #xffceef8 + #x5350351d + #x242a2c3b + #xd8def416 + #x204b37f8 + #x60ff0f4 + #xe69980bb + #x133e5633 + #x7f2eaf7 + #x635b3d1d + #x202b3b53 + #xb7d0fb18 + #x39390aca + #xaffee11 + #xb78080d0 + #x16536524 + #xbf5e7f0 + #x715d391d + #x1f35536e + #xbad80213 + #x2e0ee9c6 + #x2f80328 + #x8c8095df + #x256962fd + #x16f9e0ec + #x75532f21 + #x21446a7f + #xd1e7000d + #x6ece3df + #xfd071a23 + #x8080ade0 + #x407044d3 + #x21f8daf7 + #x6d41242a + #x284f777f + #xe2f2ff0d + #xe2e2eded + #xb1a16fd + #x8c9dbde5 + #x4d5b1dbd + #x24f7e20e + #x5e332430 + #x2a52797f + #xe5fc0a15 + #xd3e6f2ec + #x1f18f4d7 + #xa4afc8f9 + #x4133fdbd + #x23fcf720 + #x502f2e36 + #x214f7777 + #xf20f1d18 + #xd7e6f2f5 + #x20f5cac8 + #xb4bfe315 + #x1d0ff2c9 + #x270d0a1c + #x4c353537 + #x1546706e + #x1a2e2a0f + #xd7dcf919 + #xccbacc + #xc1df0b1f + #xfffff0cf + #x351d0e06 + #x4b39363a + #x8406969 + #x4b4827ff + #xc9d70f4c + #xd3b4bfd0 + #xdb0e2507 + #xf4fbe9cf + #x422403f4 + #x4d363344 + #xff3b6a6a + #x665219ed + #xbadf2e6e + #xb4b6c9c8 + #x7351ddc + #xf9eed8da + #x481af7f4 + #x4930364d + #xf840706a + #x664f0ade + #xb6f04679 + #xb0c1c9bb + #x333dfbba + #xf5d3cdf5 + #x3a12ff04 + #x4132404f + #xf94c7563 + #x6146fcd4 + #xbbfd567c + #xbdc9c2b4 + #x4c2ad5ad + #xe0bad51c + #x28191c11 + #x3739443e + #x75a7153 + #x6539eed1 + #xc108657f + #xc6c9bdb3 + #x480dc2b2 + #xc1b0f139 + #x23353a0b + #x3b413a24 + #x21626348 + #x6624e2df + #xc518737f + #xccccbbb0 + #x35f8bfb7 + #xa9ba083e + #x365846f5 + #x463a1f15 + #x37575048 + #x500de5fc + #xd1307574 + #xd1cdb4ac + #x20eec1bd + #xa5c91235 + #x57703edf + #x4821021d + #x3b40444f + #x2702fb1a + #xed426148 + #xd8c8a9b2 + #x13e9c2c4 + #xadd31128 + #x73732cd5 + #x3602f835 + #x2c2f4653 + #xa0e1a27 + #xb404024 + #xd4b9a9cc + #xbe3c5cd + #xb4d40d21 + #x7f6921d5 + #x1cf4074f + #x1c324d48 + #xf242a1f + #x1a2a251a + #xc6b0bef0 + #x4e2cccf + #xb9d70d1c + #x7c611fda + #xafd235d + #x1c3e4c32 + #x242c2012 + #x1813191f + #xbabee50d + #x3e7cfc4 + #xbee01119 + #x735e1fdc + #xb123058 + #x2a403a1f + #x231d1516 + #x11080e12 + #xc4e0061a + #x4e7c8b9 + #xccf11816 + #x68541adf + #x1a202b49 + #x3332251a + #x40d1c2b + #x1203f8f1 + #xdf031920 + #xfcdcbdbd + #xe2031c15 + #x5d4913e7 + #x281f1a3b + #x2c1f1f27 + #xe70b2f3a + #x19f5dad3 + #xfd12242e + #xe7ccc1d7 + #xfb131f0b + #x50370ef7 + #x2b120f35 + #x1a152835 + #xe61a3e37 + #x1adac2c9 + #x7183a45 + #xd1ccdaf4 + #x182118f4 + #x3a240d0d + #x230b0d2e + #xb19393b + #xff2c4228 + #xabbb9d8 + #x4275854 + #xcde6f8fc + #x332703d5 + #x1f111228 + #x190d1220 + #x4244133 + #x23363716 + #xeea7c1f8 + #xa49744d + #xe30a04f1 + #x4419e2c5 + #x2042346 + #x1619160b + #xa2e3d27 + #x42372508 + #xd7a0cd13 + #x166c7f41 + #xff2302e2 + #x4606c8c4 + #xedff3358 + #x192516fb + #x1133361a + #x56361503 + #xa0bf0f4d + #x757f47e1 + #x27f0cd10 + #xfdc1d10e + #xea256354 + #x3724f1d5 + #x2a27131f + #x2a15000e + #xafd51b4a + #x676227da + #x10e1db22 + #xecd0f11b + #xf9315732 + #x3a22f1e0 + #x27221625 + #x1e130815 + #xc4f02c46 + #x402e09da + #xfadaea24 + #xe3f0161c + #xe32380c + #x3d24faf1 + #x211e1c2c + #x120e0b16 + #xd50c4040 + #x101000dd + #xf3e0e600 + #xf4152712 + #x161f0ff6 + #x402c0c06 + #x1f222231 + #x3ff0315 + #xef2f4a2a + #xff0cf7dd + #xf6d1bfd8 + #xc2c2e13 + #xe02f6f6 + #x483b2215 + #x22242538 + #xe3e7fc16 + #x134a3af7 + #x508e9e6 + #xe7a695cb + #x193d401f + #x2efeffd + #x594b3118 + #x22242c48 + #xc4d7ff19 + #x37460fc5 + #x9f6e302 + #xb88089da + #x21535618 + #xfce9ecfa + #x67533218 + #x222b4160 + #xbcd80216 + #x381fe6b5 + #xfce9f622 + #x80809be9 + #x326d59f0 + #x3e9e1f6 + #x704e2c19 + #x2a415f76 + #xcbe4ff12 + #x16f6d7c5 + #xf0f31528 + #x8080b1e7 + #x4d7b3ebe + #xee6d4fd + #x6c432722 + #x3557767f + #xd7e9fa12 + #xece4ded5 + #xf90e1c08 + #x8087b9e3 + #x646d139f + #x12e0d716 + #x5d352a2e + #x3a637f7f + #xd8edff18 + #xd7e6e6d5 + #x1015ffde + #x8a9cbff1 + #x5d47f19f + #xfe3ed2e + #x4d2f3232 + #x34607e75 + #xe3fc0f1b + #xd7e6e6db + #x1cfad4c7 + #xa0abd70f + #x3d22e4b1 + #x10f3082f + #x46343832 + #x2b5a786a + #x5181b13 + #xd5ddeafc + #x5d0bbc7 + #xacc7ff21 + #x160be6bb + #x1c0b1219 + #x46383832 + #x1f547064 + #x34321903 + #xc7d5032e + #xd8b2bbc8 + #xc4f41e10 + #x303e1be + #x311806ff + #x4837353d + #x15506d63 + #x51400cf1 + #xb5e02757 + #xb4acc2bf + #xf3221ce7 + #xf7d4c8 + #x3d15f6f3 + #x47323a4d + #xc507064 + #x5a3dfce1 + #xb1f64766 + #xabb7c1ae + #x2832f9be + #xfadecbe9 + #x3708f3fc + #x3e314754 + #x9567560 + #x5d32ecd5 + #xb90b5c6d + #xb4bfb5a3 + #x4721d0ac + #xe3c4d515 + #x25090905 + #x373a504a + #x13627254 + #x6725dace + #xc4196c7c + #xbebeaca2 + #x4700b8ae + #xbfb9f43b + #x1e2228fd + #x38444832 + #x2b676347 + #x6c12cbd8 + #xca2b7b7f + #xc2bca9a0 + #x2fe7b4b5 + #xa5c41347 + #x324837e4 + #x43402c21 + #x44625144 + #x56facaf4 + #xd5437f7b + #xc7bea69d + #x19dbb7b9 + #x9fd5243d + #x54642eca + #x48280c25 + #x4a4d464b + #x27efe015 + #xed566d4d + #xcbb99da2 + #xbd7b8c1 + #xa6e1212e + #x706716bb + #x3a06fd38 + #x383b4853 + #xf90525 + #xe53481f + #xcaab99b9 + #x3d3bccd + #xb1e41b24 + #x7f5c06bb + #x18ef0b56 + #x2238514a + #x5151c1e + #x1e3a2c15 + #xbc9fa9de + #xfdd1c5d1 + #xb5e6181e + #x7f5402bf + #xfdf32a6f + #x1c434e2f + #x2527180b + #x181f2424 + #xaca6cefc + #xf9d7cbc5 + #xb8ec1616 + #x7f5105c1 + #xfc0c4176 + #x2a473e19 + #x341e0809 + #x9121f22 + #xacc7f308 + #xfadbc4b2 + #xc1f61813 + #x764e05c4 + #xf1f416a + #x373b2712 + #x1609081b + #x60e0bfc + #xc7ec090c + #xf9d4b7b1 + #xd4021912 + #x6d4803cd + #x1f1f2f5c + #x32251c1e + #xec031e2f + #xcfde4cd + #xea031518 + #xecc4b1c7 + #xed0f1c0c + #x603affdd + #x25122151 + #x1f19242e + #xe3153734 + #xedbc2bb + #xfd0e2a2f + #xd3bbc4e7 + #x81e18f9 + #x4b2800f4 + #x1c061c47 + #xc1b3535 + #x2e4124 + #xfab5b5ce + #xff1e4a41 + #xc8cee3f6 + #x212505da + #x2e150910 + #x12051c37 + #x6283e31 + #x283d3812 + #xd89cbef4 + #x540673d + #xd7f1f3ed + #x351be6c2 + #x100b1c31 + #xe0e1b1f + #xe353d24 + #x433d2503 + #xb599d81f + #x226c721f + #xfd0bece4 + #x34fac8ca + #xf709384e + #x16191202 + #x1b3b2f19 + #x483210ff + #xa0a2ef3e + #x467f6d03 + #x1b13dbe6 + #x28dbb8de + #xe60f505c + #x242106ec + #x253b2215 + #x442702ff + #x9add2236 + #x7f6b10b2 + #x5c2dc48 + #xd1bdee23 + #xfa435f20 + #x330cdacf + #x23130e26 + #x800fc14 + #xafec252e + #x6240ffb8 + #xefc9f347 + #xd2dc0517 + #x9434203 + #x3309dfdd + #x1a13142d + #x6030213 + #xc8032e26 + #x2b17f1c3 + #xe3d6fd29 + #xe2031606 + #x16311ae9 + #x310ceff3 + #x16141a31 + #x2ff0310 + #xdf1f371a + #x508ebc8 + #xe9d9e3f7 + #x2201700 + #x1110faeb + #x341a0809 + #x1a171c34 + #xf1effd11 + #x23c2df9 + #xddd1 + #xe5bab7dc + #x192e220b + #xfff1eff9 + #x422e1d11 + #x1d161f3c + #xd6e0fd16 + #x2b430ccc + #xeed4eb + #xc28b9fe0 + #x23403a0c + #xefe5ee00 + #x543f260c + #x1c192e50 + #xc5dd0016 + #x3d26e0b4 + #xf1dae313 + #x8980abee + #x345d45ec + #xefe2e6ff + #x62432309 + #x1f2b4864 + #xc9e3fd10 + #x23fac8b5 + #xdfdf0523 + #x8080bdeb + #x51712db2 + #xf6dcd706 + #x623d2010 + #x2b456470 + #xd2e5f610 + #xf7dfc6c2 + #xe2fc1910 + #x8080c2e0 + #x6d6afc86 + #xf9d1d41d + #x5633251c + #x3a5c7373 + #xd2e0f719 + #xdcdccfc3 + #xfa0e05e6 + #x8091bfe5 + #x7047d680 + #xf4cce637 + #x452e3023 + #x4065776b + #xd6e80320 + #xd9dfd4c8 + #xcffdcc9 + #x899bccff + #x5422c992 + #xf3dc0540 + #x3c333923 + #x3c627360 + #xefff101d + #xd7dad9e3 + #x2d6bcc3 + #x95afee16 + #x2e0bcea3 + #xfdf6142d + #x3c373925 + #x335d6b56 + #x1a191010 + #xcbd2ec11 + #xd9b2b7c5 + #xa9d91311 + #x1403d2a9 + #x140b0b0e + #x4037362b + #x28566556 + #x3d2802fd + #xb8da113c + #xb2a8bcb8 + #xd60917eb + #xcfac8b2 + #x260bf4f9 + #x4033393c + #x1d536759 + #x5025f1ee + #xb2f33756 + #xa2aeb7a5 + #xe22fcc0 + #x3e5bfd1 + #x28fdebf9 + #x3931474a + #x19576d59 + #x571ae0e0 + #xbc0e5164 + #xa9b4a694 + #x3416d2a9 + #xe9c9c903 + #x17f6f7fd + #x3039564a + #x1f5f6d50 + #x620bccd7 + #xcb236477 + #xb1b19892 + #x39f4b5a9 + #xc5bdee31 + #xe0610f3 + #x31455336 + #x33675f40 + #x64fab8da + #xd436737f + #xb4ab9494 + #x23d6aeaf + #xa8c81445 + #x1d2d1dd7 + #x3c453a23 + #x4a624d3a + #x4ae2b2f1 + #xdf4e7c7f + #xb4a99292 + #x9c8b1b4 + #xa2e02d3f + #x434e14b8 + #x452e1925 + #x53513f40 + #x13d1c511 + #xf6626d50 + #xb8a88c97 + #xfac3b2ba + #xabf32d30 + #x6857fca6 + #x370b0839 + #x403c4248 + #xe6d7e923 + #x14604a1a + #xba9b85ab + #xf4c0b5c5 + #xb8f92522 + #x7a4de8a5 + #x14ef1057 + #x26374b43 + #xe9f4091d + #x25452809 + #xaf8c91ce + #xecc0c2cc + #xbdf71d19 + #x7c3fe0a9 + #xf3ee2e73 + #x1a404e2b + #x13110b09 + #x1d251f1f + #x9b8fb2ec + #xe8c6c9c2 + #xbcf71911 + #x7a3ae2ab + #xeb064b7f + #x26473c10 + #x3313fa00 + #x9172330 + #x95abd9f7 + #xe9ccc3ac + #xbffa160c + #x7439e5ac + #xfd1f577f + #x363c2203 + #x2200f30e + #xff171a11 + #xabd1eff6 + #xecc9b1a2 + #xcc00140b + #x7037e3b2 + #x14254b74 + #x3425130e + #xf6f40525 + #x60cf6da + #xceecfcfc + #xe5b8a6b2 + #xe00b1609 + #x652ee2c0 + #x1c173a68 + #x20131922 + #xe503232d + #x9e8c9b8 + #xe8fc0e13 + #xcfacb2d2 + #xf61616fc + #x531fe5d6 + #x1308315d + #xc14292d + #x2223420 + #xf6b8b1c8 + #xef0c3129 + #xbfb7d1e8 + #xe1f06df + #x3a11f1f1 + #x502304e + #x8223628 + #x303a300c + #xcc98b7ef + #xf62e5326 + #xc5d7e6e5 + #x2319e8c3 + #x1d080613 + #xff062b37 + #x1031341c + #x4a3f1dff + #xa092d117 + #x10595f05 + #xe5efe0dc + #x29fcc6c3 + #x3092333 + #x60e1d17 + #x1f372811 + #x473309fc + #x88a5f431 + #x42794eda + #x8efceee + #x14d4bce3 + #xf1174543 + #x191103f3 + #x2b311711 + #x331ffa00 + #x83ba0c3d + #x6d7f39bf + #x1ae3c30c + #xfdb7c205 + #xe9285c4a + #x2610eed7 + #x2d260b16 + #x200ef403 + #xb5fa2520 + #x7f40e0a2 + #xdabf0c70 + #xc3d9111a + #x1d5d47f3 + #x23f1cfdd + #x190b1a33 + #x8fa051f + #xc603261d + #x5123ddae + #xd7d61a54 + #xd6f71305 + #x254a23e5 + #x1ff3dcef + #x160e1f34 + #x9ff0619 + #xdd192917 + #x1f0bdabc + #xdde91123 + #xf71410f6 + #x232600e3 + #x1ffcf306 + #x17132234 + #x2fa0514 + #xfc312605 + #x902d6c6 + #xe5dae5f7 + #x141f10fc + #xe03f3f7 + #x29130e13 + #x1c132236 + #xecef0317 + #x223c10e3 + #x3f1cee0 + #xcfaec2ee + #x252b2005 + #xf9eff409 + #x3d2b1d0c + #x19132942 + #xd6e90619 + #x3c29e9c6 + #xf6dad908 + #x9f89c0f6 + #x344731f1 + #xebebf40e + #x51391f02 + #x171d3c54 + #xd1ec0617 + #x3302cbbf + #xddd6f926 + #x8083d1f3 + #x4e6025bf + #xeee5e811 + #x593a1d02 + #x20365665 + #xd6eb0014 + #xee2c3c3 + #xd6ee1420 + #x8092d6e2 + #x685df788 + #xeed7e023 + #x54372610 + #x314e676b + #xd4e3fd1a + #xebd7c6c3 + #xeb090efc + #x809dcedd + #x773fc880 + #xe8c9ef42 + #x47373319 + #x405d6e67 + #xd1e00525 + #xe0d9c8c3 + #x608ebd9 + #x80a0cff1 + #x671cb580 + #xdfd10e57 + #x3c393a17 + #x48646e5a + #xddf1112d + #xdfd6ccd7 + #x5e5c8ce + #x8baceb0e + #x4705ba94 + #xe5ec234e + #x3a3d3a13 + #x47646850 + #x81325 + #xd7d1dd00 + #xe5bfbdce + #x98cf0e13 + #x28fcc39b + #xfc061f2d + #x3f3f3617 + #x3f5f604d + #x26160919 + #xc6d6002e + #xbcafbfc3 + #xbffd1df4 + #x19f9bfa2 + #x160b0510 + #x403a3929 + #x34595f50 + #x3f16f909 + #xbdee264e + #xa8b4b8ae + #xf61c06c9 + #x10e8b7bf + #x1dfdf106 + #x3937473f + #x2b596553 + #x4a0be6fa + #xc60e4764 + #xa9b7a69a + #x2317e0ae + #xfad1c3f1 + #x13f1f405 + #x2e3d5645 + #x2e60674b + #x4dfdd2ec + #xd9295a77 + #xafaf9295 + #x2ef7c2a9 + #xd7c3e826 + #x6fa06fc + #x304b5a37 + #x3f6a5d3c + #x47ebbfec + #xe63d6b7f + #xafa38c9a + #x1ad7b5af + #xbacf1440 + #x111910df + #x3d514825 + #x53674b33 + #x26d2b4fd + #xf354747a + #xac9f8b9d + #xffc5b5b5 + #xb2ec333f + #x333903bd + #x47402922 + #x5a573f39 + #xf1bfc21a + #x8686d4d + #xaf9d86a2 + #xefbfb7b8 + #xbd06392e + #x5c45e8a6 + #x3c1f1739 + #x4b433f45 + #xc5c0e52e + #x266b4e17 + #xb29480b2 + #xe8bdbac2 + #xcc10311f + #x743ad1a3 + #x1c02205c + #x31394842 + #xc8dc062b + #x3a542b00 + #xab8685d2 + #xe0bdc5c9 + #xd2102816 + #x7429c9a8 + #xf7fc3c79 + #x203f4b2b + #xf4fd0e14 + #x33311d17 + #x9883a2f1 + #xdac3d1c3 + #xd20c220c + #x6d1fc9ac + #xe60b5a7f + #x28483f0b + #x2008fd06 + #x191f2534 + #x8e9ac8fc + #xdcceceae + #xd40b1c05 + #x6a1dcbac + #xf3266b7f + #x394225fa + #x1dfaee0e + #x9202628 + #x9bbfe0f4 + #xe2ceba9b + #xda091703 + #x6a1fcbaf + #xe366b7f + #x3c2d1302 + #xf6e9f925 + #xc1d0bf3 + #xbddde8f1 + #xe0bda6a5 + #xe50c1706 + #x671cc9b8 + #x1a305f7d + #x29161317 + #xdff11731 + #x13ffddcc + #xdaeef602 + #xcfacacc2 + #xf31419ff + #x5a13cec9 + #x131d5374 + #x11102225 + #xfa132d26 + #xccbdd4 + #xe6ff141a + #xbcafc6dc + #x61d11e9 + #x4509dce0 + #x2114b65 + #xb1f3123 + #x2d312b11 + #xd2a2bcfd + #xec1f3d1c + #xbac8e0df + #x1c1af7ce + #x2d03f1ff + #xf9134350 + #x17333416 + #x4d3a1905 + #xa295d422 + #x5484efc + #xd2e2dfd9 + #x2502d4c6 + #x16081020 + #xff173631 + #x293c2809 + #x4d310603 + #x85a5f436 + #x316b3fcc + #xf4e5cee8 + #x17dcc2dd + #x5173034 + #xc171c0e + #x36361a09 + #x3d1ffc0e + #x86c61137 + #x677319a8 + #xd1cc19 + #xf3bfcf02 + #x334b30 + #x1c0efaeb + #x34261316 + #x280bfa17 + #x95e02333 + #x7f6bfc97 + #xfdbddc4a + #xd4b7e61d + #x5475622 + #x2305dfd4 + #x2d141023 + #x19fffa1c + #xd40c211b + #x6114bfa7 + #xbee13e76 + #xcbff21f6 + #x3d551ad4 + #xcdcd0f6 + #x12112934 + #x3fc111d + #xdf14231a + #x3d09c5b3 + #xcef6344c + #xea0c11ea + #x383702dc + #x8e4e208 + #x1514292e + #x3fd0c1a + #xf4232111 + #x1bfdc8c1 + #xe1fa1118 + #xb1405ea + #x2411f0f1 + #xef7fc15 + #x1715272b + #xf7f90b1a + #x173112f7 + #xef0c4d8 + #xded8e500 + #x1b150bf7 + #x8f9f60b + #x2314110f + #x15142931 + #xe1f30c1b + #x3527f4d9 + #xdccdff + #xb8afd600 + #x29291df1 + #xf4f4fd15 + #x3b2b15ff + #xf183543 + #xd8f30e18 + #x3808d6c8 + #xe5d0ea24 + #x8ca1e1fc + #x434a1eca + #xedf0fa1e + #x493212f4 + #x12294953 + #xdbf40c12 + #x1ae5c8c8 + #xd3e20e2e + #x80afe7e5 + #x6456fa94 + #xebe2f42f + #x4c3115fa + #x24435c5f + #xd9ed0617 + #xf9d4c5c7 + #xe1001715 + #x80b8dbd6 + #x773bc880 + #xdfd1fd4d + #x47352406 + #x3d566561 + #xd0e50b26 + #xe8d3c4c1 + #xfd09fcf3 + #x85b3d1e4 + #x6d12a980 + #xd3d11a68 + #x413e3408 + #x4a5f6756 + #xceed1532 + #xe4d0c2c8 + #x8f1d8df + #x89b3e202 + #x50f7a985 + #xd3ea356a + #x404435ff + #x4f625f4a + #xe5001d34 + #xdcc8ceea + #xf0cbc7db + #x94cb030c + #x34f0b38f + #xe806374d + #x43462efd + #x4c5f5944 + #x90e172c + #xcdcbee18 + #xcab8c5d1 + #xb0f71af9 + #x23f1b694 + #x30f202f + #x44402c0c + #x465c5849 + #x230e0921 + #xc2e2173e + #xb2b8bfbc + #xe41a0ed0 + #x1ae7b0aa + #x1403061d + #x3b3a3829 + #x3e5b5c4c + #x2b05f915 + #xcb053755 + #xafb9aaa7 + #x111bebb3 + #x6d0b8db + #xef1001a + #x31404d38 + #x3e625f46 + #x26f7e708 + #xe1264f67 + #xb5b095a3 + #x21ffc8ad + #xeac4db11 + #xf30b0f + #x324f5834 + #x46685937 + #x17e5d100 + #xf43e5f6e + #xb3a08ba9 + #x12dcbbb3 + #xcdd10c34 + #x3090ff3 + #x405b4d20 + #x566a492e + #xf9cdc40b + #x352675e + #xad9588b0 + #xf9c8b9b6 + #xc2f13237 + #x2126ffcd + #x4d52341a + #x5f5c3d32 + #xcab5cb23 + #x17646232 + #xaa9286b6 + #xe8c4bbb8 + #xcd123e26 + #x492fdfb2 + #x4735232f + #x564a3b3e + #xa1b0e838 + #x326d4700 + #xad8c80c5 + #xdfc1bcbb + #xdf213714 + #x6424c5ad + #x27142755 + #x3d3d4643 + #xa1c70938 + #x475b29eb + #xa78085e2 + #xd6bfc4c1 + #xea212e09 + #x6711bbb3 + #x2094177 + #x2c404a2f + #xcdeb1524 + #x443b1802 + #x98809d00 + #xd0c7d0bf + #xeb1e2702 + #x5f03bbb9 + #xed17627f + #x2c473d0c + #x611 + #x29242127 + #x8989bf09 + #xd3d3d3af + #xeb1a21fc + #x5800bcbb + #xf332797f + #x3a4421f1 + #xcf7f30f + #x12232b2b + #x91acd8ff + #xdcd8c19b + #xed171af9 + #x5602bbbb + #xb497d7f + #x3e310cf3 + #xebe4f623 + #x12261a00 + #xadcadcf3 + #xdfc8aa9a + #xf11417fc + #x5600b9c1 + #x1e4a797f + #x2f1b0b09 + #xcee40f31 + #x1b11f0d6 + #xcbdbdffc + #xd1b2a6b2 + #xf71518fa + #x52fabeca + #x1b3b6e7f + #x18121b1b + #xdf00272c + #xce1cbd9 + #xdbe8f912 + #xbcadbbcd + #x31b15eb + #x46f4c8dc + #x92e6776 + #xe1e2c1b + #x11232915 + #xe2b2c402 + #xe4062118 + #xb3c1d6d6 + #x151d03d4 + #x32f3dbf4 + #xfd275b62 + #x1531310e + #x3a321806 + #xac9ddb2c + #xfc353efc + #xc5dbdcd4 + #x210be4c7 + #x1efaf612 + #xfd294a44 + #x293d2700 + #x43290608 + #x89a7fa40 + #x275e32ca + #xe4dfcee1 + #x18e7cdd4 + #xf0c182b + #x8273421 + #x3a3a1afd + #x3a17fd17 + #x86c41540 + #x5965099e + #xf1cdc808 + #xfac8d1f4 + #xc27382c + #x111b1202 + #x3b291106 + #x2b060026 + #xa0e72334 + #x774dde8e + #xe4bee540 + #xd4c5f30c + #x17464412 + #x1706eeeb + #x2c17141b + #x1afc062b + #xb9fd2729 + #x7f34c291 + #xd1bb0b6b + #xbed41115 + #x245843f6 + #x18f4d6e4 + #x1e0b1d2b + #xef60b2b + #xe5131a11 + #x41f4b5b7 + #xc40e5a6a + #xe91910d0 + #x4e35efd0 + #xf2d0d917 + #x111d2f22 + #xf4011314 + #xef1a1c10 + #x2cf1bac0 + #xdc113941 + #x1300d9 + #x3919ebe6 + #xf7e0ee1f + #x141d2c1a + #xf1fd1017 + #x8251601 + #x19e9bdd2 + #xebfe0a1a + #x130dfde8 + #x1afdf104 + #x7fd051a + #x131a281c + #xe5fa101a + #x262300e5 + #xad7c3f4 + #xd5d5ee10 + #x1a140def + #xfef70117 + #x22190e05 + #xb172c2a + #xdafa1619 + #x320de5d2 + #xefcadd1c + #xaabeef08 + #x2c3014d5 + #xf2f8051d + #x382608f4 + #x7203b41 + #xdffd1410 + #x20ecd3cd + #xd7d50430 + #x8fc6f5f1 + #x5047fea5 + #xefef042f + #x422805f1 + #x14334d53 + #xe3fa0d0d + #xfed7cccc + #xd9f41923 + #x90d2e9d7 + #x6d38cd80 + #xe3df0a4e + #x41290ef8 + #x2d485a57 + #xdaf10b19 + #xe9d0c4c0 + #xf1050b04 + #x99ccd7d9 + #x670da480 + #xd2d92069 + #x3f331cf7 + #x45585e51 + #xcff4172d + #xe3cabdba + #x4f8ecee + #x98c1daf2 + #x48e89880 + #xcaeb3c72 + #x423f23ec + #x505e5847 + #xd901253b + #xdcc3c1d0 + #xf7d6d6e6 + #x98cdf808 + #x2ddda284 + #xda0a4d61 + #x48471fe6 + #x515d5041 + #xf5102538 + #xcdc1dcfa + #xd6c1d0dd + #xabf111fd + #x20e2a889 + #xf7193e47 + #x4a421af4 + #x4d574b44 + #xd101c30 + #xc1d50222 + #xbbbeccca + #xd6140eda + #x1adfa599 + #xa102333 + #x443b220d + #x47544e47 + #x11080d26 + #xc7f72536 + #xb7beb7b5 + #x51defbb + #xecdaac4 + #x8fb142c + #x393c3623 + #x445b5441 + #x5fbfd19 + #xdd1a3b3f + #xb8b19eaf + #x1a05cfb2 + #xf4c0c9fb + #xfbf41722 + #x384b4725 + #x4b665333 + #xf4e9e611 + #xf8384d42 + #xb79b8fb7 + #x11e5beb7 + #xd6ccfb20 + #xf8021605 + #x445b4716 + #x5869442a + #xd9d0d716 + #xa4a5733 + #xac8c8dc3 + #xf8d0bdbb + #xcaef2828 + #xd1704dd + #x535a330d + #x635b332f + #xb5b7da2c + #x1d5b510d + #xa5878cca + #xe6cabeb7 + #xd516391a + #x2d1de5c1 + #x5142221d + #x5d48323c + #x93aef241 + #x38663bdf + #xa48489d7 + #xdcc7bdb5 + #xec2d3808 + #x4a10c7bb + #x39262642 + #x45393944 + #x8fc01044 + #x515d1cc9 + #xa2808df2 + #xd3c6c3bb + #xfe302ffe + #x50f8b8c3 + #x1316416a + #x323b4233 + #xb2e31d30 + #x503f0bdd + #x9580a40e + #xcdcacdbb + #x12926f5 + #x48e8b7cc + #xfa20617f + #x32473b11 + #xe5fe131d + #x36251308 + #x8480c319 + #xcdd6d3af + #xfd231dee + #x3fe5b8cd + #xfb3c7f7f + #x3f4820f1 + #xfbfbfe17 + #x1a22251c + #x849cdc0e + #xd9dfc79b + #xfd1f16eb + #x3ce6b7cc + #x11587f7f + #x423504e9 + #xe6e6f823 + #x172c2200 + #x9ebbdffe + #xe0d5af93 + #x1c13f1 + #x3ee5b5cf + #x26637f7e + #x331afdfb + #xc6e00a2f + #x202301d5 + #xbdcad9fe + #xd9bda4a5 + #x11d16f5 + #x3ce2b8d5 + #x2c5b7f7c + #x1c100b13 + #xc7f5232a + #x1afad9cd + #xcfd0e611 + #xc1afb2c3 + #x72017ec + #x35ddc0df + #x204d7b79 + #xd1c2219 + #xef172816 + #xf2c6cdf2 + #xd7e80a19 + #xb4bdcdd3 + #x14230bd7 + #x28dfcfef + #x1145726a + #x1430290b + #x1c291705 + #xbaaae020 + #xee162a02 + #xbed5d7d3 + #x2016efc6 + #x1ae6e307 + #xb426351 + #x263c20fb + #x2f230505 + #x90ae023b + #x1c4829cf + #xd9ddcada + #x1cf7d5c9 + #xef7021f + #x103e4b32 + #x363611f5 + #x2c110117 + #x89c91c3f + #x4b57009f + #xe8cdc1fa + #xd6d3e3 + #xd132326 + #x16302a14 + #x392808fd + #x1f020729 + #x9ee82838 + #x6a3ccd87 + #xddbbd72c + #xd9cceefd + #x1a353813 + #x17170501 + #x2f17080b + #xefa1033 + #xbe012528 + #x6d17af90 + #xc4c41063 + #xc4e20efd + #x304a2fef + #xef8e6fd + #x1f10161a + #xfdf8172d + #xd50d1f1a + #x6701a7a1 + #xb2dd447f + #xc3fd22ef + #x41511ad2 + #x5dfd301 + #x13112525 + #xf2fa1a26 + #xf0161502 + #x1fdcb7c4 + #xe7335d53 + #xc1aeac3 + #x460fdae2 + #xddd2f538 + #x15262503 + #xea051212 + #xfd1d15fc + #x18dab9cd + #xf61f3539 + #x100cecd9 + #x29ffe9fa + #xece9062f + #x13201f05 + #xe5001315 + #x151f08ec + #xcd2bde6 + #xf0f90c23 + #x1208f7ec + #x9f5fd10 + #x6061018 + #xf1a1d10 + #xe0ff1815 + #x2510f0d7 + #xf5c4d30c + #xccda0218 + #x181a08e0 + #xf7fa0d18 + #x221809ff + #x61a2828 + #xe505180c + #x1cf5ddd2 + #xd9ccfa26 + #xacd90300 + #x3532fab9 + #xf5fa0f25 + #x331afdf3 + #xc263b40 + #xf0051005 + #x2dfd5d3 + #xd0e71a26 + #xa7e2f6e0 + #x582fd290 + #xeff01343 + #x3919fdf5 + #x1f3b4c4d + #xedff080a + #xe9d3ccc9 + #xe5031a0d + #xb2ddddd3 + #x5d09a483 + #xdce72663 + #x392209f2 + #x364c534b + #xe0fa0f1d + #xdfc9bdb9 + #xf90002f6 + #xb2d0d7e7 + #x43e09087 + #xccf54673 + #x3f3210e2 + #x46555043 + #xe2051f32 + #xd9bdb7bd + #xf7e5e9ec + #xaad0ed00 + #x26cd938a + #xd3125f69 + #x493d0dd5 + #x4f564840 + #xf7152a3c + #xccb9c9dd + #xdccce0e5 + #xafea0a00 + #x16d09a87 + #xed285b53 + #x503d06dc + #x4f504245 + #xc19293b + #xc0c9ec02 + #xc3c4d9d5 + #xd00c0fe5 + #x12d29791 + #x523423f + #x4c360cf7 + #x4b4c4548 + #xd121d35 + #xc3ea0d16 + #xbac3c7bf + #xfc19f6c7 + #xcc69ab4 + #x90f2c35 + #x42351f12 + #x484f4943 + #xff06102a + #xd70d2318 + #xbcb6adb4 + #x1809d6bc + #xf6b9b4e7 + #xfa02282c + #x3d433618 + #x4b5b4836 + #xedf6ff20 + #xf2293315 + #xb79f9cbd + #x13ecc3bf + #xdac3e510 + #xf3082613 + #x48593f0d + #x585d3c2d + #xdcdfed23 + #xc403f0c + #xaa8c97cc + #xfcd5c0c0 + #xcfe7151c + #xff1615ef + #x58603503 + #x62552c30 + #xc2c4ea32 + #x23553ff0 + #x9d8399d7 + #xe7cdc2b9 + #xda152f10 + #x1a18f3d0 + #x5d4d230f + #x5c3d263f + #xa4b7fa46 + #x3c6229c7 + #x998097e6 + #xdcccc0b4 + #xf5303002 + #x3208d3c9 + #x49322230 + #x4b2f2f48 + #x96c4164b + #x555908ac + #x96809afd + #xd6cac2b4 + #xc3628f6 + #x38ecbfd2 + #x29223b58 + #x36303b3d + #xace5263c + #x593ff3b9 + #x8a80af19 + #xcfcdcab7 + #x13321fef + #x30d9bcdf + #xd2c6070 + #x323d361c + #xd9001d25 + #x4223f9e3 + #x8080cf28 + #xcfd7d2ad + #x152c16e5 + #x25d3bfe3 + #x9487e73 + #x3b421ff9 + #xf603081a + #x231a0f02 + #x8094e61c + #xd9e2ca99 + #x10260ce2 + #x20d3bfe2 + #x19637f6f + #x4533ffea + #xedeffc23 + #x182819f6 + #x8cb3e908 + #xe6dcb48f + #xf2008e7 + #x20d2bce0 + #x32727f6c + #x3b19eff6 + #xcfe20932 + #x232a05d0 + #xaac2df02 + #xe2c6a49c + #xd1d0af0 + #x20cfbde2 + #x3c727f6f + #x2208fa0d + #xc3ef1d2f + #x2610e2bc + #xbfc3e210 + #xccb2a9b6 + #xf2210ef + #x1dccc2e6 + #x38697f70 + #xd0f1019 + #xdf0d2519 + #x8ddcfd6 + #xc4cffd1d + #xb9b4c2ca + #x19280cda + #x15cfcaf0 + #x2c627f68 + #x10251d10 + #xc201603 + #xd0badf06 + #xd6f61d0a + #xbccad0cd + #x2520f5c4 + #xad5da03 + #x235d7855 + #x23351902 + #x261d0303 + #xa0b90229 + #x2a20da + #xd3d9cad5 + #x2308d9c2 + #x2e3f518 + #x2358633c + #x363308f7 + #x260fff13 + #x90d21d32 + #x3845fda3 + #xe5d0c0f2 + #x9e5d0d7 + #x2fc1522 + #x25494623 + #x3b23faf9 + #x16020a29 + #x9ff0292c + #x5f32c987 + #xdabcd223 + #xe3d5e5ef + #xf1d2c12 + #x232f2212 + #x3212f905 + #x2fd1935 + #xbc06261d + #x6209a38a + #xbfbd0258 + #xcae303f0 + #x2a3b2af2 + #x190cff0d + #x220c0612 + #xed002332 + #xd6101c0d + #x4be79da2 + #xb3e33d75 + #xd2020fda + #x46420fd6 + #x3e9e919 + #x16131816 + #xe5052325 + #xe5131502 + #x36d7a7b4 + #xb70f697b + #xe5190cc4 + #x5539f0c9 + #xf2d0e026 + #x121d2515 + #xe6092019 + #xfb190eef + #x7ceb7cc + #xb3d4e3a + #x1700ccce + #x24eddbf7 + #xd1de1640 + #x1a210eea + #xec040f12 + #x91c07e6 + #x1cab9db + #x41c2f31 + #xefadee3 + #xceff104 + #xe8f41a2a + #x13190bf6 + #xe8041512 + #x1715f6da + #xf1c0c9f7 + #xeaf61720 + #x902f3ea + #xf8f7070c + #x509120c + #xb13100c + #xed08160b + #x16fde3d5 + #xd5c2ea13 + #xc7e9120b + #x1c1af6ce + #xf6010e12 + #x1d0c00f8 + #x81a2327 + #xfb0c0c00 + #x2e5dadb + #xc7da0e1c + #xbeef05e9 + #x3c1ed7aa + #xf4fd132c + #x2708f6f6 + #x152b3839 + #x501fe + #xecd7d3d8 + #xd3fa1c0c + #xc7ede9d3 + #x4e02aa96 + #xe6f72854 + #x2a0bfbf1 + #x283d463f + #xf6fd000c + #xdfcdc5c7 + #xec050cf8 + #xcadbd7db + #x3fd79199 + #xd5004b6e + #x2f1c02e2 + #x3947473c + #xef000f21 + #xd5beb7c0 + #xf4f4f7ea + #xbfd1e2f4 + #x1ebf8e9c + #xd51a696a + #x3f2b00ce + #x4147403c + #xfd0e2032 + #xc7b1bbd3 + #xe2dceae3 + #xb9e1fefd + #x9bc9195 + #xea366b54 + #x4b2ff3cc + #x46413a43 + #x121a2838 + #xb9b9d4f1 + #xc9d1e3d4 + #xcd000be9 + #x4c08e94 + #x53a563d + #x4b25f1e2 + #x443c3a4a + #x16192538 + #xbbd5f301 + #xbeced5c0 + #xf412f8cd + #x1b88dad + #xb284135 + #x412102fd + #x413f4047 + #x90f1c32 + #xcef80901 + #xbec3bcb7 + #x1309dbc0 + #xf1aba0db + #xfe15362c + #x392e1c08 + #x4347403c + #xfb010e2a + #xec1619fe + #xb9aba9be + #x16efc9c2 + #xdab4cd04 + #xf3153319 + #x40462e01 + #x4d4d3631 + #xf1edfe2a + #x82e23f8 + #xa994a2ce + #x1d8c5c2 + #xccd5fd13 + #xf71c23f6 + #x515228f7 + #x58432731 + #xdfd5f736 + #x204123e6 + #x9688a4de + #xead0c7b9 + #xd8041a0c + #xc1a04d8 + #x594719fe + #x58311e3c + #xc2c50147 + #x384e10c3 + #x8d84a7ed + #xdecec5ad + #xf62420fd + #x2008dfd1 + #x4e2f161a + #x48212548 + #xa9ca194f + #x4d48f0a6 + #x8780ab02 + #xd7cac2aa + #x123119f1 + #x23eac9dc + #x33232c3f + #x33233241 + #xb0e62843 + #x5631d8a6 + #x8080bc1d + #xd1cac6ad + #x202c0fe9 + #x17d3c3ec + #x1a2b5155 + #x2c2f3327 + #xd401252e + #x4716dbc9 + #x8080da31 + #xd0d1cda9 + #x212807e1 + #x8c9c7f4 + #x13477158 + #x33391e04 + #xf708101e + #x2c0ef3ec + #x809bf32a + #xd8dbc798 + #x2125fedb + #x1cacaf6 + #x23667f52 + #x3a2b00f3 + #xfaf60021 + #x191705f0 + #x80b5f712 + #xe5dbb587 + #x1e1ef7df + #x1c9caf3 + #x39777f4f + #x350fe9f8 + #xdfe5042c + #x1e23fdd1 + #x99c2e802 + #xe6c9a38d + #x1917f8ea + #x1c6c7f1 + #x48797f52 + #x20faec0e + #xccea172f + #x2713dfb8 + #xadc0e20b + #xd5b4a3a6 + #x161701ed + #xfec3c9f1 + #x4a757f55 + #xcfd001c + #xdc021e1d + #x16eacac6 + #xb4c2f41a + #xbeb0b7bb + #x1a2004df + #xf8c3cdf4 + #x41727f52 + #x910101c + #x7151007 + #xe5c5d4f0 + #xbbde1210 + #xb9c0c7c0 + #x2421f4c7 + #xf1c7d500 + #x3a717f47 + #x1924100f + #x2713fbfe + #xb4c0f417 + #xde0e17e3 + #xcad1c7c5 + #x270fdabf + #xedd1e812 + #x386b7035 + #x2c240204 + #x2805f40e + #x9dd81524 + #x1a31fbad + #xdccdc2e2 + #x15f0cccd + #xefe6051d + #x365d5623 + #x3617f301 + #x16fa0124 + #xa7f8211d + #x4e2bc78a + #xd7b9ce1a + #xf1dbdae5 + #xfb071e13 + #x32443615 + #x2f07ed07 + #xfdfd1532 + #xc00e1d0b + #x56029f88 + #xbeb5f64e + #xd5e1f4e9 + #x162723f6 + #x27231610 + #x20fef40f + #xec052432 + #xd81313fa + #x38d7949b + #xabd12b66 + #xd4fb00d3 + #x35360bd5 + #x10fdfd1a + #x15040512 + #xe50f2825 + #xe8120cf0 + #x19c3a0b2 + #xbe075660 + #xef10f1bb + #x4628e9cd + #xf1dff72e + #x12131208 + #xec122117 + #xed120bf0 + #x8c3aec0 + #xdb326d58 + #x819deb1 + #x4a12d3d4 + #xdad0fd3f + #x152017fd + #xf310170e + #xd1f07eb + #xfbc7b6d9 + #x233e4631 + #x11e4cbee + #x3e4f10e + #xd6f52e34 + #x1f15fce3 + #xfd0a161c + #x181bfce3 + #xefc0c1ed + #x91d372a + #x6efe4f6 + #xfbf2000a + #xee03231b + #x151002f5 + #x111814 + #x1b09ede2 + #xd9bfdd09 + #xe7042916 + #xa04f5ea + #xf9030b09 + #xa0a0e03 + #xd121412 + #xd151106 + #xbf1e3eb + #xc6d20216 + #xd6031bf4 + #x2714e3c7 + #xff0a1019 + #x1904fcfb + #x11222b2a + #x161102ff + #xf5e0e0ef + #xcdf5180e + #xdb00fcd6 + #x4003bcb1 + #xf6062240 + #x1c00f9f8 + #x22353f37 + #xd04fb06 + #xe6d8d6e3 + #xe60d15fc + #xe2eedfd2 + #x3bdb9db1 + #xe70d4662 + #x1f0afdeb + #x32434437 + #xfdfd0319 + #xddc8c6d6 + #xf60703ef + #xd6d9dce7 + #x19b998b6 + #xe2246a67 + #x2e1bfbd5 + #x3f464039 + #x7162d + #xceb5bfdf + #xedf2f6e7 + #xc7dcf2f5 + #xfdb198ad + #xf2467852 + #x4322ebcb + #x43403e46 + #x14182738 + #xbbb1cdf5 + #xd5e3efd9 + #xcef607eb + #xf5b291a3 + #xe556a3e + #x4d1ce2d8 + #x42394052 + #x20202d3c + #xb5c4e406 + #xc8dfe2c6 + #xef11ffd4 + #xf6ad8aaf + #x1c4a5534 + #x4312edf4 + #x3e394654 + #x1b1d2939 + #xc6e4f904 + #xc6d4cab9 + #x100de4c4 + #xeba198d5 + #x1235472e + #x381b0703 + #x3e404649 + #x12111f34 + #xe4020700 + #xc0bcb2bd + #x18f5cfc3 + #xd5a4bdff + #x32b441f + #x3c321cff + #x47443e3c + #xb001132 + #x41c1100 + #xafa3abcf + #x6dfcdc4 + #xc7c3ee14 + #x303700 + #x4e461df5 + #x54402e3b + #xfcea093e + #x1f3215f5 + #x9995afe3 + #xf2d6cfb9 + #xd2f11111 + #xe2b16e3 + #x594311f6 + #x57302443 + #xdbd80e4e + #x374207d5 + #x8a91b5f4 + #xe4d5cdaa + #xf2181902 + #x1d16f1d9 + #x55300b0e + #x491f2a50 + #xb8d82358 + #x4b3ee9b1 + #x838bbb09 + #xddd4c7a3 + #x152711f4 + #x1ff6d6e6 + #x3f221d2d + #x341f3850 + #xb1ee3550 + #x5724cda6 + #x8084ca24 + #xd8d1c6a3 + #x292907eb + #xedcd1fb + #x292a4340 + #x292b3c39 + #xcf093539 + #x4b07c7bf + #x808ae63c + #xd6d4cba0 + #x2e2602e4 + #xfbced809 + #x1f476542 + #x2e352a18 + #xf8112329 + #x32fbdde7 + #x80a3033e + #xdcddca92 + #x2d23f9dd + #xeecbdc09 + #x2e69773b + #x382b0a04 + #x403102a + #x2007f6f5 + #x80c00b27 + #xe9dfb880 + #x291cf1e0 + #xedcbdc07 + #x477f7b38 + #x3510f107 + #xeeee0d32 + #x2219f9e0 + #x94cffc12 + #xeed1a380 + #x2414f2ed + #xedc8db06 + #x5b7f7b3b + #x22f5ed19 + #xd5ed1935 + #x2e16e2c3 + #xa8cbed12 + #xe2bca096 + #x2012fcf5 + #xebc6db04 + #x5f7f7c3e + #xaeffc29 + #xdc002326 + #x26f5cbc7 + #xaec6f520 + #xcab4afae + #x201900e9 + #xe6c6db04 + #x5b7f7f3b + #x3020e2d + #x312190e + #xffcfceee + #xaed50e1d + #xbcbdc3b5 + #x291ff6d1 + #xe2c7dd0a + #x577f7f34 + #x12161427 + #x27110003 + #xcbc4ed19 + #xc7ff19f6 + #xc7cfc7b5 + #x2e14dfc3 + #xdfcbe916 + #x557f7729 + #x291d0a1d + #x2d00f410 + #xafdc0d29 + #xfd2300bf + #xd9cfc3cd + #x22f8cecd + #xdfdb0022 + #x5278631c + #x3512fb18 + #x15f5fd27 + #xb6fc1c1f + #x3524cf98 + #xd9c0cd04 + #x6e0d5e3 + #xebf8191f + #x4b624710 + #x3000f116 + #xfcf81437 + #xcf121809 + #x4affa18f + #xc1b8f442 + #xe9e0edea + #x41b2206 + #x3f40290b + #x20f6f419 + #xef072638 + #xe6160df6 + #x31cf8e9f + #xadce2962 + #xe0f6f9d5 + #x262e0ee4 + #x271b1115 + #x12f9001b + #xf4162e2d + #xf21206ee + #xbb596b4 + #xb6ff555c + #xf40dedb8 + #x3c27edd4 + #x6fb0a2a + #xe060b11 + #x21f2a1f + #xf91106ef + #xf9b8a8c4 + #xe2326749 + #x100dd1b4 + #x390ad8e2 + #xe6e7153f + #x15140eff + #xb1c2018 + #xfd150af5 + #xf5c4b4cd + #xa51663b + #x1f02bdc0 + #x2defd4f5 + #xd1e3234a + #x1d1c0bee + #xd161616 + #x1916fbef + #xeab8baeb + #x21343d24 + #xf9d5df06 + #xeeea0514 + #xe3102e15 + #x1401eedf + #xa111a1a + #x1c0af2ef + #xd9b8cefe + #x5243816 + #xfaeaeefa + #xf6fb0808 + #xf70e1805 + #xc04fdf3 + #x1516140e + #x12f7ebf9 + #xc6c7ee10 + #xee1928fa + #xd00eddf + #xa0809 + #x90602fa + #x8111611 + #x20150500 + #xfde7eb04 + #xc7e7090e + #xed150ad9 + #x26fdcec7 + #x4091025 + #xcfdf9fb + #x14252d21 + #x1806f600 + #xebdee6fb + #xde050dfe + #xf100e7cd + #x29ddb0c4 + #xf60d3149 + #xcfefaf3 + #x25373826 + #x2f7f90e + #xe1d3d7ea + #xf60c02f1 + #xe9e6d7da + #x10bba7cb + #xee255957 + #x1509f6e1 + #x343d3829 + #xf7f90921 + #xd2bfcae6 + #xf5fef9e9 + #xd5dbe5eb + #xefacaac6 + #xfb497048 + #x2a10e5d1 + #x3b393535 + #x2091c2e + #xbcb0cef7 + #xe3f1f3dd + #xcfebf6e6 + #xe1aaa2b6 + #x19636c31 + #x3b0ad6d7 + #x38343c48 + #x12192837 + #xafb7df09 + #xd5eae7c8 + #xe604f6d5 + #xe2a494b4 + #x2d605926 + #x3901d9ee + #x34344553 + #x191e2c37 + #xb8cff10c + #xd1e2d1b8 + #x60ae3c6 + #xdd9897d1 + #x2a4d4d25 + #x2d04f102 + #x3339494c + #x161a2833 + #xd3eafb0a + #xcdcdbaba + #x14f9d2c4 + #xca97b6f7 + #x193f481a + #x2c180902 + #x393f403d + #x110d1d31 + #xf200020a + #xbcb3afcb + #x6e3cec3 + #xbbb0e20e + #x103d3d01 + #x3c2e0df6 + #x45393138 + #x4fd1639 + #xa140502 + #xa3a0b4df + #xf1dbd1ba + #xc3db050e + #x193b22e5 + #x503402f2 + #x492c2640 + #xe1eb1a49 + #x2525fbe3 + #x909abcf5 + #xe5dacea8 + #xe3021101 + #x2428fedb + #x5125fa01 + #x3f1d2a4d + #xb8e62c53 + #x3f29e2ba + #x8797c60c + #xdfd9c49c + #xa160af3 + #x2106e2e9 + #x4118091a + #x2a1a3951 + #xabf53d4d + #x4c14c4a3 + #x8091d529 + #xddd3bf98 + #x241c01ea + #xde6db01 + #x2a202a2a + #x1d264141 + #xc40d4039 + #x44f3bab4 + #x8095ee41 + #xd9d5c093 + #x2d1afbe3 + #xf5d5e312 + #x223c4c2c + #x21303325 + #xef183028 + #x2ae2cadd + #x80a70945 + #xdbddc084 + #x2d19f5de + #xe5d2ed19 + #x2e5d5f22 + #x2c29150e + #x50e1c25 + #x14ebe6f5 + #x80c61531 + #xe7e2b480 + #x2911eddf + #xdfd3ef18 + #x4976611a + #x3010f910 + #xf5f91430 + #x1404f1e9 + #x94da0a1a + #xefd7a080 + #x2408ebea + #xdfd1ed15 + #x617f601a + #x1ef3f121 + #xd7f11d34 + #x240ce2cd + #xabd9f916 + #xe7c29588 + #x1d04f5f5 + #xdeceea11 + #x6c7f631d + #x5eafd34 + #xd3fb2628 + #x28f6cdc7 + #xb0cdf724 + #xd1b4a3a0 + #x1a0c00ef + #xdbcbe910 + #x6a7f671e + #xf6f30e3b + #xf30e1e10 + #xcd5cde9 + #xabd30a26 + #xc0bbb7aa + #x2215f9d9 + #xd7cae911 + #x667f6819 + #x1061437 + #x160e0801 + #xddc6e514 + #xb7f11909 + #xc3cbbfa6 + #x2a11e5c7 + #xd3caee1c + #x677f6412 + #x18110e2e + #x1afdf609 + #xbcd60428 + #xe11205d3 + #xd5d1bab2 + #x26fad1ca + #xd2d2fe29 + #x687f5909 + #x280d0229 + #x2edfa20 + #xbef5111a + #x1618d6a8 + #xd7c4c2e3 + #xedfd1db + #xdae91529 + #x61724500 + #x26fefa26 + #xe7ef1033 + #xd60c0e02 + #x35f7a69b + #xc4bbe626 + #xf2dae3e6 + #xef091e14 + #x55572dfb + #x16f1f928 + #xe2002537 + #xee1004f3 + #x29c88da8 + #xaecb2054 + #xe7eef3d5 + #x112010f3 + #x3f351804 + #x6ee0126 + #xf214302c + #xfa0afef2 + #x4aa90bc + #xb2f95154 + #xf304e9b6 + #x2c1ef1df + #x1d14101a + #x1f6091d + #xc202d1e + #xfd06fef9 + #xe7a79fcb + #xd630643b + #xc05cdaa + #x3106d9e6 + #xf9fe1a35 + #x6020a08 + #x1d212216 + #x20c02fe + #xe2b4abd3 + #x8505c26 + #x16efbbc2 + #x1debdbfe + #xdffa2d3f + #x120901ef + #x1d1a1a19 + #x81405fe + #xebbfb0d6 + #x29574f1e + #x12d9b8e2 + #x8ddea11 + #xd6003b3c + #x1a09f7df + #x1512181e + #x210cf9fe + #xd5afcb06 + #x20394016 + #xe7defa10 + #xf1fe120a + #xfe2621fd + #x5f9eee3 + #x1a202116 + #x19fef708 + #xc7bae211 + #xe353500 + #xfaf3f6f7 + #xfe080a08 + #x8190dfa + #x40502fa + #x251d120a + #x8f1f914 + #xc4d7fe15 + #x52d1ce1 + #x12fde3de + #xa0a0915 + #xa08fefe + #xc1a1c11 + #x210e0001 + #xf3eafa11 + #xd9f90a08 + #x81af5ce + #x1de6c6d6 + #x60c2135 + #x500fe01 + #x1e2e2e19 + #xafbf909 + #xe7e2effd + #xf50904f7 + #xfaddd6 + #x9c4bade + #x214b49 + #x904fbf3 + #x303b331c + #xf5f5041c + #xdbd1deed + #x5faee + #xe9e5dee9 + #xe9b2bede + #x9486a41 + #x1808ebe2 + #x393b3325 + #xf300162c + #xc6bed7f3 + #xf6fbf7e3 + #xdaeaefee + #xd5afbbce + #x296b6c29 + #x2a01d6e1 + #x38373838 + #x5122634 + #xb2b8e204 + #xe9f6efcf + #xe5fef2df + #xd2a8aac2 + #x44735c1a + #x2df5d2f6 + #x31374749 + #x12212e34 + #xafc7f20e + #xe2eedabb + #x108e5cf + #xce9aa2d1 + #x4864501a + #x25f3e50c + #x2e3d504d + #x19243030 + #xc2ddfd10 + #xdedbc2b6 + #x14fed5cb + #xbf91b4f5 + #x38554f15 + #x2004fd11 + #x34434c40 + #x161d292e + #xdff10211 + #xcfc0b4c7 + #xdebd1cd + #xafa4de10 + #x2c504701 + #x2d1c0505 + #x40413c37 + #x8102235 + #xf9020408 + #xb6acbadf + #xf9e1d3c4 + #xb4cb0414 + #x2e4d2ee5 + #x4528fdfe + #x4534303d + #xe6002544 + #x1011fbe9 + #x9fa4c6f5 + #xebe1cfb0 + #xd5f71206 + #x373d0ada + #x5021f306 + #x3b24314f + #xbef9354f + #x2a16e3bb + #x93a3d10d + #xe7dfc39f + #xfe110ef9 + #x311cf1e7 + #x4815fd18 + #x261e4059 + #xae02474b + #x3d08c69e + #x8ba2e12a + #xe6d9b794 + #x1a1605ef + #x1af7e904 + #x33181925 + #x19284b50 + #xc6184c39 + #x39e9b6aa + #x80a3f945 + #xe2d6b48c + #x2615feea + #xfde2f219 + #x29313924 + #x1c344337 + #xf3253f26 + #x20d2c2d3 + #x80b4164c + #xe2ddb480 + #x2914f9e5 + #xe7de0024 + #x34544b18 + #x29302521 + #x10202924 + #x6d6dbf3 + #x80d1283c + #xe9e1ab80 + #x290ef1e2 + #xdfe10628 + #x506f4d0c + #x2e1a091d + #x40d1e2c + #x2eeedee + #x9ae92124 + #xf2d99780 + #x2504edeb + #xdee10526 + #x6b7a4b08 + #x21fefd2c + #xe2002535 + #x12fee5d2 + #xb2e90a19 + #xeec48b80 + #x1dfdf5f7 + #xdddd0224 + #x787c4c09 + #x6ee0540 + #xd606302c + #x20f5d2c6 + #xbadb0122 + #xdbb49498 + #x160401f7 + #xdada001e + #x7a7e5109 + #xf3f2154c + #xeb152a14 + #x10d9cddf + #xb3d70e2e + #xc7b8aba6 + #x1a1002e5 + #xd6d7fb1a + #x787f5408 + #xf602204c + #xd161400 + #xe9c8e209 + #xb4ed1e1c + #xc6c8b7a2 + #x2611efcf + #xd3d6fd22 + #x7b7f5302 + #xa101d47 + #x1005fe01 + #xc6d5001e + #xd30a14ed + #xd5d2b3a6 + #x2a00dacd + #xcfd90930 + #x7f7f4bfb + #x1d0e1243 + #xf2f1fd16 + #xc3f21012 + #x412e6be + #xdbc7b2ca + #x19e6d3da + #xd2e71c37 + #x7f7f3df2 + #x1e020a41 + #xd2ed112c + #xda090df7 + #x25f6b3ac + #xcdbcd109 + #xfddbe2e5 + #xe2012625 + #x766c2dee + #x11f50840 + #xcffd2933 + #xf50d01ea + #x21c895b7 + #xb7cd0e40 + #xeaeaf2d7 + #x1191a05 + #x5f501df7 + #x1ef0a3c + #xea15382c + #x105fbf1 + #xfea494cd + #xb4fd4d50 + #xf302edb8 + #x211dfeeb + #x3f301510 + #xf7f21031 + #xd25371e + #x1010004 + #xde9ca0d9 + #xd2336739 + #xc05d1a7 + #x2d08e3ef + #x18161d2d + #xfafb111c + #x24292c15 + #x2050611 + #xd2a6acde + #x2575c1c + #x18eeb7b7 + #x20eae106 + #xf910313f + #x60408fe + #x28242215 + #xc0e0810 + #xd9afb3e5 + #x2a5b4b12 + #xad2bce2 + #x4dff319 + #xea183d35 + #x1002f7e6 + #x1e1c201d + #x18140508 + #xe2b3b7ed + #x3c544116 + #xf7c3d106 + #xf1e30920 + #xea203d20 + #x11fdebd9 + #x15192422 + #x18fcf90c + #xb7ace41a + #x22433afb + #xe3f00007 + #xfc0c0cf4 + #x13260cf3 + #xf7f7edef + #x22241a04 + #xaf4ff17 + #xb8c4f717 + #x1f3f23e3 + #xfcf8eff4 + #x6070603 + #xe1202fc + #xff0802ff + #x1f1708fd + #xf7f0041a + #xc8e5060c + #x1c2e00cd + #x10efd5e7 + #x804101e + #x3fffc06 + #x121f170a + #xc00f900 + #xebefff07 + #xe8fc03fb + #x140be0d1 + #x4cfc7ec + #x3133436 + #xfffdff02 + #x262e220b + #xf1f1fc10 + #xe1e3eff0 + #xfc00fbf0 + #xfcecd8e5 + #xe4b9ccef + #xb375632 + #x802f4f1 + #x32332410 + #xe8f50c23 + #xd0cfe0e9 + #xfcfbf7e5 + #xe4e4e4f1 + #xcbb7cfe1 + #x28605f1a + #x17fbddec + #x34332a20 + #xf4071e2e + #xb8c1e3f7 + #xf3f8f0d3 + #xe4f3edeb + #xc5b4c0cf + #x4c735207 + #x1be8d0fd + #x30343a36 + #x818282f + #xabc5ef04 + #xedf4dfbb + #xfbffe4dc + #xc1a4b0d1 + #x5b6c4603 + #x13dfdb17 + #x2c3c4a3f + #x16232c2b + #xb3d4fb0c + #xe9e4c5af + #xff9d4d4 + #xb494b5ed + #x525f4403 + #xeecf323 + #x2f444c3a + #x1b242a27 + #xc9e5000c + #xdcc9b5b8 + #xce8cdd4 + #xa19cd70b + #x435a43f3 + #x1804ff18 + #x3a44402f + #x101c242b + #xe0f40203 + #xc3b1b8cf + #xfbdfd0cf + #xa4bffb12 + #x405830d9 + #x2f14f90c + #x3f3a3333 + #xf40f2637 + #xf802fbe7 + #xaba8c5e8 + #xeddfcfbc + #xbfe90f07 + #x464b0fcc + #x3f10f00f + #x372a3044 + #xd1063344 + #x1007e5bb + #x9ba9d502 + #xecdfc0a5 + #xe8080cf9 + #x432cf3d8 + #x3c06f51f + #x231e3c54 + #xc30e4644 + #x26f9c79c + #x93abe71f + #xebd9b195 + #xa1204f1 + #x2c08ebf5 + #x2c070c2b + #x13234852 + #xd8204c33 + #x27ddb1a0 + #x89afff3c + #xe7d1a98c + #x1a10fcec + #xaedf712 + #x231c2826 + #x1630473f + #x6324220 + #x12c4b5c8 + #x80bd1f48 + #xe3d3a780 + #x1c0bf7e7 + #xede80822 + #x2e3e3713 + #x2434322a + #x23302c1b + #xf5c3cfeb + #x83d9343b + #xe8d59c80 + #x1e06f0e5 + #xe1ec1328 + #x4b5a3702 + #x2c231623 + #x181e1f23 + #xecd8e3ed + #x99f43222 + #xf0d08880 + #x1cfdebeb + #xdfef142b + #x686732f8 + #x22070733 + #xf70c222b + #xfbede1d3 + #xb5f81b13 + #xf1bc8080 + #x16f7f0f8 + #xdfec142b + #x786c30f7 + #x7f30c47 + #xe10e2c26 + #xbebd1c1 + #xc0e90b1a + #xe0a98191 + #xff9fcfb + #xdbe91324 + #x7f6f36f7 + #xf0f11b57 + #xf01a2c10 + #x8d7c9d1 + #xb9dd1027 + #xcca998a1 + #x100702ec + #xd8e70f1f + #x7f763bf5 + #xebfd275b + #xc1f1afb + #xe9c7d9f5 + #xb4e92220 + #xc7bcab9f + #x1b0ef4d5 + #xd3e10a1f + #x7f7b3af3 + #xfb0b2858 + #x120f00f4 + #xcbd0f408 + #xc8041ffb + #xd1c8a89d + #x2302dfcd + #xcde00f2b + #x7f7c36ec + #xf0f2357 + #xf3f7f806 + #xc3ec04f9 + #xf110f8cd + #xdcc3a1b5 + #x1aebd4d8 + #xcce81e34 + #x7f772be4 + #x16071b58 + #xcdeb0a1e + #xd80302dc + #x14f8c3b5 + #xd4b5b5ed + #xffdcdde4 + #xd5fd2b2b + #x7f6b1fdf + #xcf91758 + #xc5f7232a + #xf108f7d0 + #x13c9a0bd + #xbdc1f026 + #xebe5ecd9 + #xf014260f + #x775713e5 + #xfbf01754 + #xe1103423 + #xff00f3e0 + #xf3a19bd4 + #xb5f0343c + #xecf9e9bc + #x101b0bf3 + #x5a3b0bfc + #xf0f01a4a + #x7263616 + #xfdf9f9fb + #xcd93a8e1 + #xcf2b5a2b + #x302cda5 + #x2308eff0 + #x3422141f + #xf0f81833 + #x202e2c0b + #xfbfd0410 + #xbd99b4e5 + #xff54540c + #x13ecb1af + #x1aece706 + #x121a2a36 + #xf8ff0e13 + #x242a2208 + #x2070b17 + #xc0a1b9e7 + #x2f5f40fd + #xaccadd7 + #xdcf51b + #x233e33 + #xfcf3 + #x1c231f0e + #xf0c070f + #xc7a4bff4 + #x40563802 + #xecc0cb02 + #xede70c1a + #x2f3b18 + #x2f9ebe1 + #x14202314 + #x1a0a0006 + #xc9a4c703 + #x3c48380b + #xd7c7eb18 + #xe8fb1b0e + #x7362cfd + #xfdf1e1dc + #x14232716 + #xaf70519 + #xa4bc011e + #x344f2ad9 + #xf100fa06 + #x90efeeb + #x1c11fbfb + #xf6faf202 + #x29240af5 + #xfdf90c1c + #xb6d60914 + #x353d0dcb + #x2f5e601 + #x8050605 + #xc050008 + #x60c0206 + #x190efef9 + #xf2fa0c11 + #xd3f10902 + #x2c1ce9ca + #x5ddd500 + #x4082024 + #xfefd040c + #x1d201105 + #xfdf7f908 + #xebf6fdf6 + #xeffb00f3 + #x12f5d9df + #xeac6d602 + #x5284428 + #x100fefe + #x2d291505 + #xe9f3051c + #xdfe5eae6 + #xf9faf9eb + #xf3e3e1f2 + #xcec2ddf5 + #x21515111 + #xcfaebf6 + #x342d1c10 + #xee001629 + #xc8d2e5ed + #xf7faf3da + #xe7e9edf5 + #xc3c4d6e1 + #x496c47f7 + #x10e7da05 + #x33302924 + #x211222d + #xb4ceedfd + #xf6fae5c0 + #xf3f6eaeb + #xc3bbc2da + #x646c38f1 + #x5d7de22 + #x30393d31 + #x151e282a + #xb0d6fa0a + #xf5eecdac + #x8f5dde5 + #xb6a6bfed + #x666337ef + #xfadbf537 + #x34474930 + #x21252626 + #xbee3020e + #xe9d5b7ac + #xce7d3e2 + #xa0a0d509 + #x596039e6 + #x1f10635 + #x3d4c4426 + #x21242229 + #xd2ef0409 + #xd1bab6bf + #xfeddd5dd + #x9ab8f715 + #x54632cce + #x19060426 + #x43433728 + #x101a2233 + #xe6f9fdef + #xb6afc3d6 + #xf2dbd3ca + #xafe10c0a + #x57570ebe + #x2d06f722 + #x3b30313b + #xf6122e3f + #xfdfde9c8 + #xa3b2d5ee + #xefdec6b0 + #xd6000cfb + #x5439f2c6 + #x30fbf72c + #x29253c4f + #xe9164040 + #x12f3cbaa + #x9bb6e70d + #xf1d9b49c + #xf90c02f6 + #x4015eae3 + #x21f90a39 + #x1a294d53 + #xfa2a4b34 + #x19dab3ac + #x93bb012c + #xeecfaa91 + #xd0cfdf5 + #x1dfbf704 + #x180a2435 + #x19355044 + #x213c4120 + #x8bfb2d1 + #x8bcb243d + #xe7caa283 + #x1509f9f1 + #xfdf50d1a + #x2229301e + #x24393f2e + #x3f3f2c16 + #xe9b6c7f6 + #x8ce93f34 + #xe6c89580 + #x1804f2eb + #xebfa1c25 + #x3f442a04 + #x2e2e2429 + #x382d1d1d + #xdac7defb + #xa005401a + #xedc28180 + #x16fdebee + #xe9012129 + #x5f5321f3 + #x26151638 + #x161a1e28 + #xe3dfe2e3 + #xbe102a06 + #xefb08080 + #x11f5eef9 + #xe7022429 + #x73571cef + #xdfe1951 + #xfd152925 + #xfae6d3ca + #xce01150c + #xe29c8091 + #x9f7fb01 + #xe3002225 + #x7c5b1eee + #xf2f72664 + #x2202c11 + #xfed6c8d1 + #xc7ef151a + #xcd9a8ba6 + #x90404f6 + #xdffd1e1d + #x7f6122eb + #xeb01346b + #x19261cfa + #xe9c6d2ef + #xbcf2241d + #xc4aba0a4 + #x140cfae1 + #xddf7191c + #x7f6825ea + #xf60e396b + #x211902ef + #xcbcbeb05 + #xc4092801 + #xcfbca29c + #x1e05e5d3 + #xd6f21825 + #x7f6b22e6 + #x614376b + #x900f5f9 + #xc4e5fdf5 + #xe6150ad6 + #xdbbb9aab + #x1af1d7da + #xd1f62433 + #x7f681dde + #xe0d316e + #xe5effe0e + #xd7fef9d2 + #x601d6be + #xd6aca4d7 + #x5e1dae3 + #xd506342e + #x7f5f12d6 + #xa022e70 + #xd6f5181e + #xf305eac2 + #x9d3afc3 + #xc0b0d50d + #xede3e9de + #xe71a3416 + #x7f4d06d9 + #xfef92d6e + #xed0e2d20 + #x1fde5d2 + #xeaa7a7d9 + #xb7db1a29 + #xebf6e9c4 + #x5221efb + #x6b3800eb + #xf1f52a66 + #x10263312 + #xfef6eef2 + #xc294b4e9 + #xcf1d4b1d + #xfefed1ae + #x191400f3 + #x4d24060d + #xedfa2953 + #x28332904 + #xf6f9fe0d + #xab98c3ea + #x4514ffd + #xeeaafb0 + #x16f7f105 + #x2d1d1e29 + #xf2022134 + #x2c311dfd + #xf9040c16 + #xaba0c7e9 + #x38633bea + #x8c7a4d6 + #xfee3fd19 + #x1828392e + #xfa050d10 + #x252a1901 + #x60c0e12 + #xb2a2c7f1 + #x51592ceb + #xebb4bb05 + #xe9e9141c + #x14384019 + #xfdfdf5f5 + #x1d281d08 + #x110a080a + #xb0a2d204 + #x4b4d2df2 + #xd5c3e21d + #xe7fe1c06 + #x1d3c2cfe + #xf7f2e5ef + #x1d2a2106 + #x16040108 + #xaba4e215 + #x3d4734f2 + #xcedefe20 + #xf11018ef + #x253715ef + #xf2ede2f3 + #x24302201 + #xff1526 + #xa3da1316 + #x4d4e0ab7 + #xf8ee15 + #xc04f5f4 + #x13fdfb0a + #xfbfc12 + #x3316f7f1 + #xfc04151d + #xbdec0f07 + #x432feebb + #xe5e519 + #x3040c0c + #x3fc060c + #x120b0408 + #x1603f500 + #xf8060b04 + #xdef904f9 + #x2c04dace + #xf1d0e41a + #x172d1d + #xfc000b07 + #x251b0a00 + #xf5f4fd15 + #xf1f8f5ea + #xf0fbfbf0 + #x7e8dee8 + #xd5cbed0f + #x1540430c + #x400fcfc + #x2f210c06 + #xedfb0f26 + #xdee5e8e8 + #xf5fbf5e2 + #xeee6edf4 + #xc7d0e8f7 + #x3f613cf1 + #x8eee807 + #x31251915 + #xfc0b1e2d + #xc6d9eaf7 + #xf7fce9cb + #xedeef1f3 + #xc7ced7e5 + #x646829e2 + #xfcd7e626 + #x302f2c22 + #x111a252c + #xb9dbf507 + #xfcf5d0b1 + #xfdf0e8f0 + #xc0bbcbed + #x6d5e22e2 + #xecd3fc46 + #x343e3e22 + #x1e222429 + #xbde40013 + #xf5deb7a6 + #x3e5dff1 + #xaaadd706 + #x685d26da + #xeae5124d + #x3f4b4019 + #x2622202a + #xcbed0615 + #xdec1adae + #xfcdbdeec + #x9ab9f515 + #x656421c4 + #xfdf91642 + #x484a3719 + #x221d1e33 + #xdbf50307 + #xc0b2b8c3 + #xf0daddd9 + #xa5dd0c0f + #x696008b0 + #x16000a39 + #x43383029 + #x1516283f + #xf0f9f3e8 + #xaab4cada + #xedddd0bd + #xcafd0f02 + #x6644ecb4 + #x1df70642 + #x31293840 + #xa1b3942 + #x3f3d7cc + #xa1bcddf5 + #xf0d7bda5 + #xf00b06fb + #x531ee1d0 + #x13f0114b + #x20294b4b + #x162d4635 + #xbdabccb + #x9bc4f813 + #xedcbac97 + #x60afffb + #x3004eef4 + #x8fc2547 + #x1b385540 + #x34423f21 + #xfcbcb5e8 + #x94d51b29 + #xe5c1a18a + #xe06fcf9 + #xefd070e + #x1219312f + #x26434a2d + #x4e462a16 + #xdfaec70b + #x97f13b26 + #xe2bd9480 + #x1202f8f4 + #xfb071a1b + #x2f352c0f + #x303b3328 + #x4d371a1a + #xcab9df15 + #xaa12420e + #xe8b78080 + #x13fdf1f4 + #xf5112422 + #x4f431bf8 + #x2a242238 + #x2f221925 + #xd0d0e6ff + #xc8222ff8 + #xe9a38080 + #x11f7f1fc + #xf5132925 + #x66440fee + #x150b2553 + #x13192426 + #xe6dddbe2 + #xde1917f8 + #xdd8e8090 + #x7f5fc06 + #xf3152c21 + #x71440cec + #xfb02346b + #x12212915 + #xf5d3cce1 + #xda04130b + #xc68580a8 + #x30008fd + #xee122919 + #x774a11ea + #xed084375 + #x26291bfb + #xe8c3d0f9 + #xcbfd2215 + #xb89697ac + #xe0e04e9 + #xec0f2216 + #x7e5111e6 + #xf3154b7a + #x312003ed + #xccc3e60f + #xca0e2c03 + #xc1ac9fa1 + #x1b0cf1da + #xe5071e1e + #x7f5611e2 + #x31e4d7c + #x2007f0f3 + #xc1dbf804 + #xe42117dd + #xd5b196a5 + #x1df9dedd + #xde06262d + #x7f560edb + #xc1a4a7f + #xfcf0f404 + #xd3f4f5e2 + #x213e9c3 + #xd5a599c7 + #xae5dde8 + #xdb113730 + #x7f4f07d2 + #x811477f + #xe8f10a15 + #xf0fce2ca + #x6e6bfc4 + #xc0a1bdf7 + #xf1e2eae8 + #xe9243e1d + #x7e43f9cf + #xff07447f + #xf4072119 + #xf4d7d2 + #xe6b5b1d9 + #xb1c1fd15 + #xeaf3eed0 + #x3302c02 + #x6f31f1de + #xf404447a + #x1321280e + #xfdecdef0 + #xbc9dbdea + #xc403330e + #xfbfcd7b7 + #x1a260ff7 + #x5920f7fc + #xee06436c + #x2c312200 + #xf4f0f40e + #x9f9dceed + #xfb4243f0 + #xeeab4b5 + #x1a0afb03 + #x3f190e1a + #xee0b3b53 + #x353417f5 + #xf4fc071a + #x9da8d0e8 + #x375d30d6 + #x8c6a2d9 + #x3f10217 + #x29242d25 + #xf50c2833 + #x342d11f7 + #xff081119 + #xa2a9ceea + #x57561bd3 + #xe9acb40a + #xeaf1171b + #x25393e15 + #xf9040b15 + #x2f2912fc + #xc0c0e13 + #xa2a6d3fb + #x59481ad9 + #xccb1da2a + #xe4062506 + #x2c4331fc + #xf7f5f306 + #x2f2d17fd + #x11070a13 + #x9bace90f + #x4d4a22d6 + #xcbd3f92d + #xf41619ec + #x313515f0 + #xf1ece90a + #x373115f8 + #xeff0719 + #x96b8ff1b + #x465128cc + #xdbf30622 + #x41b06db + #x2f21fdf1 + #xeeecec0f + #x3f330ef0 + #x20c2336 + #xbbf9150a + #x5d38e1a5 + #xe4f334 + #x6fafa06 + #x1f9050f + #x5fb040f + #x2d01ecfb + #x40f171b + #xd1fd0a02 + #x4314d6b8 + #xf0d8f934 + #x9150f + #xfd020d06 + #x14060404 + #xaf7f70d + #x20801f9 + #xe8fefef9 + #x1bf0d6d5 + #xdad20129 + #xa2a2e09 + #x10809fe + #x22110400 + #xf0f60922 + #xf5f5ece8 + #xf0fbf6ef + #xf7e5e7ea + #xcddc010f + #x314e2eef + #x6fef704 + #x27170a0a + #xf5041b2b + #xdde4eaf2 + #xf7fdeedc + #xeeeef2f0 + #xcedfeff5 + #x5a5a1cdf + #xfde5f023 + #x2b1f1b15 + #x813232d + #xcbe0f304 + #xfef9d8c2 + #xf5f0f0f3 + #xced0dcef + #x6d520dda + #xe5d80248 + #x312f2d14 + #x171c252d + #xc7e7fe13 + #xfee5bcaf + #xfbe8eaf9 + #xbcbedf00 + #x6c4c0dd6 + #xdae11f5b + #x3a413208 + #x201e202d + #xceee081c + #xecc9a9ad + #xf5dfeaf9 + #xa6c0f60f + #x6c550cc2 + #xe5f62a57 + #x45452d02 + #x221a1e34 + #xd8f5091a + #xceb5abb7 + #xebddebea + #xa5dc0d0f + #x7359fbab + #xfe012252 + #x473c2911 + #x1c14233d + #xe7f90008 + #xb7b4bac9 + #xe8e1e0cb + #xc0fb1304 + #x7745dfa6 + #xcfa1a57 + #x392e2f2b + #x13183544 + #xf7f3e8f0 + #xabbecde1 + #xebddcab0 + #xe5090cfe + #x6622d2bf + #x6f32062 + #x272d4339 + #x172b413a + #xdfceea + #xa6c7e7fe + #xebd0b4a0 + #x90500 + #x4304dce4 + #xfbfa325d + #x1e395232 + #x2e3f3f25 + #xf3bfc300 + #xa2d80915 + #xe3c0a593 + #xa060400 + #x1efef702 + #x2133a41 + #x25484e23 + #x47452b14 + #xd6acd11e + #xa5f32a17 + #xdcb89784 + #xf0501f9 + #x9091013 + #x1c2d321e + #x31473c1f + #x4b391a17 + #xbfb1e82d + #xb8173802 + #xdcb08480 + #x1000faf5 + #x4171f1b + #x3d3a1f02 + #x31342b2e + #x36231723 + #xbfc9f51b + #xda2e2aeb + #xdf9e8080 + #xdfaf7fb + #x51f261f + #x53380df7 + #x1e1a2b4b + #x1b182027 + #xd4d6eafe + #xf22a13e5 + #xd2878097 + #x5f70104 + #x5222d1e + #x5e3205f3 + #x40d3c65 + #x141e2718 + #xe5d2d9f6 + #xf51508f6 + #xbb8080b0 + #xd00 + #x4252d15 + #x643204f2 + #xf3114e74 + #x23271e01 + #xe0c2d808 + #xe3081506 + #xa98593b7 + #x50c0deb + #x1222510 + #x6c3904ee + #xf51f5a7b + #x322205ee + #xcbbfe81c + #xd91426fe + #xaf9d9dac + #x1510fdd8 + #xfb1a1e15 + #x773f02e8 + #x295e7f + #x260aefec + #xbfd2fa1a + #xea261be1 + #xc3a895a8 + #x1c02ead8 + #xf2142326 + #x7e4100e1 + #xc2b5e7f + #x6f0ecfa + #xceecfbfb + #x522f5c6 + #xcda092be + #xfeee5e7 + #xec1a342e + #x7f40fbd8 + #xd255e7f + #xebebfe0c + #xeaf7e7df + #xcfacac6 + #xbe99ade8 + #xf6e5f0ec + #xf32a3f22 + #x7a36efd1 + #x61e5d7f + #xecfd1514 + #xfbecd4dc + #xf0c7bada + #xabade405 + #xebeff6da + #x8383408 + #x6d27e3d6 + #xfa1a5b7f + #x418230d + #xf9dfd5f3 + #xc2a9c3ee + #xb4e71800 + #xf9fbe3be + #x1e3518fa + #x5d18e4ef + #xf21a5a7c + #x1e2b1f01 + #xeedfe810 + #xa1a6d4f0 + #xe7272be1 + #xceec0b7 + #x221c0404 + #x4711fa0c + #xef1b566a + #x2f2e14f5 + #xecec0222 + #x9ab3d9e8 + #x294c1ec5 + #xacba8d5 + #xd010518 + #x341b1b1b + #xf31b474f + #x362a0af0 + #xf7fe1126 + #xa1b7d4e8 + #x554e09bc + #xeba9b30a + #xf2fb1b1e + #x2d343210 + #xf7112b31 + #x392508f3 + #x8091425 + #xa1b1d4f5 + #x5b4104c0 + #xc7a8da34 + #xea0d2909 + #x36452ef7 + #xf6000c1f + #x3a270af7 + #x10091125 + #x99b0e306 + #x523f09bf + #xbcc30140 + #xf6201fea + #x403f14ea + #xf0effb1f + #x432b0af6 + #xd04142d + #x96c2fd13 + #x50470ab4 + #xd1e40a36 + #xa1e02da + #x3622fef2 + #xefeafa23 + #x4c2a01ef + #x8011838 + #x9ad81117 + #x555005a8 + #xecf5042b + #x1510ecdd + #x2608f501 + #xf2ecfe22 + #x5023f6eb + #x8182b35 + #xd4070d05 + #x5912bba4 + #xedd80e54 + #xfafa0b11 + #xf5020f08 + #x40007fe + #x7ebf108 + #xd141211 + #xe3020404 + #x35fac4bd + #xdada1846 + #x2151e07 + #xfe0d0bfd + #xf0401fb + #xf0f00218 + #x504f7ee + #xeefdfbfe + #xae7d5d8 + #xcbe31b2a + #x213b25f0 + #x70dfefe + #x1a0a0101 + #xeafb1827 + #xf0edeaed + #xf4fbf2f0 + #xf2ebe8e7 + #xceeb0a07 + #x4e4c12db + #x1f7f51b + #x21120e0b + #xfd0e242b + #xdae3f0fe + #xfef8e0d4 + #xf1f1edf0 + #xd5e3f1f4 + #x694600d8 + #xeae30546 + #x28221f0a + #xf18272e + #xd0e5fb0e + #x2e8c1bb + #xf5eeedfb + #xcbd0e8f8 + #x6c3bfbd7 + #xd4e72765 + #x353527fa + #x181c2731 + #xd1ed0718 + #xf5cba7b1 + #xeee4f001 + #xb3caf704 + #x6b3ffbc7 + #xd7fe3f6b + #x444121ed + #x1a1a2538 + #xd7f40e1e + #xd8b19eb4 + #xe3e1f2f4 + #xa9dd0d05 + #x7546eeab + #xeb0d3f69 + #x493c1af5 + #x14142842 + #xe0fb0d17 + #xbda9a6be + #xe0e4ebd7 + #xbafa15fd + #x7e3cd39e + #xfd07346e + #x4131210e + #xa173446 + #xedf7fb04 + #xaeb0b7d0 + #xe7e5d5ba + #xdd0a11fa + #x751cbeae + #xfbfb3579 + #x2e2e3522 + #x828423e + #xf4e4e1f8 + #xabbdd0eb + #xe8d7bda7 + #xf80a0afd + #x55fec7d3 + #xf1004476 + #x243c481f + #x1b3c422b + #xeac6d407 + #xabcdf204 + #xe0c3a79a + #x50708fe + #x2ff5e3f4 + #xf2154f5c + #x274f4811 + #x3545311a + #xceaddd24 + #xaeeb180d + #xd5b4968c + #xa080af8 + #x17020008 + #xa2f4635 + #x3451390d + #x443b1c15 + #xb3adf437 + #xc3122bfa + #xd1aa8381 + #xd0804f1 + #xf141212 + #x2b392e15 + #x38412b1c + #x38271821 + #xabc1042c + #xe73122dd + #xd0998087 + #xb0100f5 + #x14211f18 + #x44341404 + #x2c2a2c3c + #x1e1a1f2a + #xbed5fd11 + #x73208d1 + #xc48080a0 + #x2fb07fd + #x17282818 + #x4e280501 + #x121b3e58 + #xf1c281f + #xd4d5eb01 + #xd1efbe0 + #xab8080bb + #xfb0014fb + #x182e2b12 + #x51220000 + #xfe1f546b + #x1a251f07 + #xd5c6e30d + #xfd0d04f4 + #x96808cc7 + #xe17e7 + #x172f250d + #x5624fdfa + #xfb2e6573 + #x28240af0 + #xc3bdf022 + #xeb1218f4 + #x978c9cbb + #xf1505d0 + #x14281c0f + #x622afbf5 + #x53c6c7c + #x240df0ea + #xb6ca0125 + #xf42718de + #xab9c94b0 + #x180af1ca + #xa1e1e1e + #x6e2ff8ee + #x113f6f7f + #x5f1e5f2 + #xc1e4040a + #xd2bfac6 + #xba978abb + #x11f5e8d8 + #x11e2c2a + #x7331f4e5 + #x143b727f + #xe4e4f201 + #xdef4f0e7 + #x1a0ad0c3 + #xb18c9ce1 + #xfbeaf2e5 + #x12e3c25 + #x732ce8db + #xf37737f + #xd7f10a0b + #xf2e8d8da + #x1d5bbd7 + #x9e9acb00 + #xedf1fbda + #x1241390e + #x6c1fdada + #x735757f + #xe50b1a0a + #xf1d5d1e8 + #xd0b0c4ee + #xa1cb00fd + #xf2fbeebd + #x2a4221fb + #x5e0fd5eb + #xfd35757f + #x1211c00 + #xe4cde105 + #xa7aad7f5 + #xd00e15da + #x5f4caae + #x322c0800 + #x4b05e80a + #xf735757f + #x1c2812f2 + #xdedafb1e + #x9ab7deed + #x143b0ab7 + #x7d1aeca + #x210f0715 + #x380e0a1b + #xf7346866 + #x2e2507eb + #xe8f0112c + #xa1bed7e7 + #x4b44f1a9 + #xebabb301 + #x2021b21 + #x31282514 + #xfb2b4e49 + #x351e00eb + #xfb011a32 + #xa4b9d3f0 + #x5b37e8ab + #xc19edb35 + #xf1112e0e + #x3b3f25fa + #xfb172c34 + #x381c00f0 + #x8081b37 + #x9cb4dd01 + #x5532eead + #xabb7074b + #xfd2725e8 + #x49410ee7 + #xf2001531 + #x3f2100f0 + #xb071e41 + #x93bef40f + #x5139f1a1 + #xbadb1b48 + #x122a07d3 + #x492bf7eb + #xebf20f38 + #x491ffaeb + #x707274e + #x9dda0a12 + #x5b3fe494 + #xdbed1541 + #x1b15f0db + #x2e0ef200 + #xedf11231 + #x4612eeeb + #x40b2e55 + #xaef4150f + #x683fd490 + #xf2eb0841 + #x17fde7f0 + #x12fbfa0e + #xf4f51224 + #x3902e5f1 + #xe1f1f0f + #xe7020407 + #x3ae7acb8 + #xd0e3305d + #xf40718fe + #xfa0e0bf7 + #x1fef1 + #xd2e6020c + #xb0e05f4 + #xeafb0107 + #x19e1c0c9 + #xcaee3041 + #xc2016ea + #x70efbf5 + #x700faf8 + #xdaf31115 + #xfef7eee6 + #xeef7fb00 + #xfbe4d6dc + #xcdfa2219 + #x35370ad7 + #x800f30a + #xe020001 + #xee051e1e + #xe9e6edf4 + #xf7f5edea + #xf3ede3e7 + #xdaf504fa + #x5733f4d3 + #xf4eb0036 + #x160f0e04 + #x5142222 + #xd9e4f502 + #xead2d0 + #xf3ede7f5 + #xd7e4f1f3 + #x5d26edd7 + #xdced235d + #x232215f4 + #xf182328 + #xd6ea000b + #xf8d0b5c0 + #xeee9f001 + #xc5d7f4f8 + #x5822eed0 + #xd502446a + #x332f0fe0 + #xf182630 + #xd9f1080f + #xe0b2a5bc + #xe3e9fafe + #xb5e104f8 + #x5f28e6b8 + #xe4184e6b + #x402f04dd + #xb152a3c + #xddfa0b0e + #xc2a2a2bf + #xddebf7e6 + #xbef80cf1 + #x6b23caa4 + #xf71b4a72 + #x3f2807f0 + #x163343 + #xe6fd0401 + #xb1a1aac8 + #xe3ebe1c6 + #xd90a0aed + #x6b0bb4a8 + #xf80f497f + #x30261b05 + #xfb233f3d + #xedeef1f4 + #xacacbedc + #xe7dfc5b1 + #xf30b05f1 + #x53eeb4c6 + #xed0c557f + #x23332f08 + #xb36402a + #xe3d2e3fb + #xaebedcf3 + #xe1c9aea5 + #x805f5 + #x32e6cde6 + #xea1c616e + #x264635fd + #x293f3218 + #xcab8e716 + #xb4d900fa + #xd3b89d9a + #x20a08f1 + #x19f1edfb + #xfd325a49 + #x354d2af7 + #x3f371c14 + #xacb4fd2f + #xc30015ea + #xccab8b8e + #x40a05ea + #x12070405 + #x1b3c3f26 + #x3d411e05 + #x3a25141f + #xa1c50e2d + #xe62011cd + #xc99d8093 + #x50701ea + #x1816120c + #x32322015 + #x362d1f23 + #x22161828 + #xacd90b16 + #xa2afabc + #xbc8480ac + #x10105f0 + #x1f221e11 + #x3a200b11 + #x20203040 + #xe162022 + #xc2ddf802 + #x1919e9c6 + #xa28080cc + #xfa020fed + #x222a230c + #x3a14010e + #xb264953 + #x111f1c0c + #xcacfed07 + #xe07eedc + #x89808edc + #xfa0e14da + #x252f1f05 + #x3c12fd0a + #x5365d5d + #x1f1f08f4 + #xbec3f419 + #xfa0701e3 + #x8680a1d5 + #x81908c2 + #x232a1605 + #x4314f805 + #xc446765 + #x200ff0e9 + #xaecc0520 + #xfa190ad3 + #x9895a0c3 + #x1614f1b8 + #x1b201514 + #x4e18f500 + #x194b6c71 + #x7f3e1ee + #xb4e30b0b + #xf23f4bc + #xac9594c6 + #x11fde4c6 + #xf1b2020 + #x5719f0f5 + #x1f4b747c + #xe0e0e7fb + #xcff4fae7 + #x1f0ed2b9 + #xaa8998e3 + #xfdebebd6 + #xb26321f + #x5e19e7ea + #x1b4a797f + #xcae6fa05 + #xe7eddfcd + #xfdfbecf + #x988dbe02 + #xebf1f8d3 + #x163a330e + #x5d11d7e4 + #x12497e7f + #xd3fb0a04 + #xead6d0d2 + #xe1b9c5e9 + #x95b4eb01 + #xf100f3b9 + #x2a4122fa + #x5300cfee + #xb497f7f + #xf0110ffb + #xdcc6d9ea + #xb5afd9f1 + #xb8f002e0 + #x1fdd5a7 + #x39320afa + #x3ff1da07 + #x74a7f7c + #xe1b0af1 + #xcfccf107 + #xa2bce3e9 + #xfa1ff7b6 + #x5dfb5b9 + #x2d16050c + #x2af7f81f + #x74b786a + #x221c00ea + #xd6e30a1e + #xa7c6dde0 + #x332cdfa2 + #xebb5b4f0 + #x1107181b + #x250f161c + #x8466451 + #x2c16f7e7 + #xe7f8182c + #xacc2d5e4 + #x4d20cda2 + #xc2a4d729 + #xfd112c0e + #x322d1c04 + #x733463d + #x2a12f3e9 + #xf8051f35 + #xa5b8d9f4 + #x4916d0a7 + #xa5b50847 + #x12828e7 + #x463708ed + #xfe192a37 + #x2911f3ea + #x107233f + #x98bbeb04 + #x461ed59d + #xabd9254a + #x192f0ac8 + #x4b26eeed + #xf107223f + #x2f11f0e6 + #x82c4d + #x9bd0000b + #x4e25ca8e + #xc8f12646 + #x261ceac8 + #x390ce900 + #xe900233f + #x2f08e9e3 + #x11354e + #xb4ee0b08 + #x5a1cb68b + #xdff01e4b + #x1900e7e1 + #x16fdf70f + #xed001f29 + #x18f5e4ea + #x21b3746 + #xcd020c05 + #x5d0ca894 + #xe6e41857 + #x5edf3fa + #xfefb0712 + #xf4011611 + #xfbe4e7f5 + #x151f09e2 + #xecfd090f + #x18ccb2cc + #xc6024c56 + #xff1c15dd + #xc13fded + #xfdfdf5f6 + #xc9f30d06 + #xa08f7df + #xecfa090c + #x5d5c4d6 + #xd00d3c33 + #x1f2905d2 + #xf05f2ff + #x2fcf700 + #xe502150c + #xf7f0efe9 + #xf0f9fdfd + #xf5e0d7e2 + #xe00d1c0a + #x422af0cc + #x2f2f726 + #x9030205 + #x121c13 + #xe3e9f3fa + #xf7efe6e5 + #xf5e7e0ef + #xe6fcfdf7 + #x4f19e5d6 + #xe7ed1d52 + #x151209f7 + #xc18201c + #xddecfa02 + #xf5d7c9d0 + #xf2e7ecff + #xd7e9f5f6 + #x490fe7d6 + #xda054668 + #x251f02df + #xc182526 + #xdcf20003 + #xe2bab4c9 + #xe9ecfd02 + #xc6e7fdf6 + #x4813e5c6 + #xe5205b69 + #x3320f3d2 + #x9192c33 + #xdff90502 + #xc4a3acc6 + #xe3f505f2 + #xc7f903ec + #x5512cdb0 + #xf92c5b70 + #x3919eddd + #x31c353f + #xe5ff03f7 + #xaf9aaac7 + #xe6f7f5d6 + #xdd0902e6 + #x59ffb2ac + #x285c7f + #x3018fdf2 + #x253f3f + #xeaf9f6ec + #xa69db2d2 + #xecead6bd + #xf60ffde9 + #x49e2a9bf + #xf622687f + #x262315fa + #xc334032 + #xe7e3eaf0 + #xa7a9c7e3 + #xe7d3bab0 + #x20cfff0 + #x29d5bddd + #xed2d7679 + #x28381ff2 + #x2d3f331f + #xd2caef0d + #xadc4e7ec + #xd9bda7a6 + #x50d05ef + #x13dfddf3 + #xfa407259 + #x364318ea + #x4b391d18 + #xb3c2032d + #xbded03e0 + #xcaad969c + #x61205e7 + #xcf5f7fd + #x16495938 + #x433b0cf5 + #x4c260f1f + #xa0d01635 + #xdf1205c3 + #xc39c819c + #x80f00e3 + #x13090805 + #x2c3d3523 + #x422a0c0f + #x3216122c + #xa6e51620 + #x622efac + #xb68380b3 + #x60800e6 + #x1d18130a + #x32261a1d + #x2f201f2c + #x18131a2a + #xbaea0608 + #x1d15daaf + #xa08080d7 + #x809e3 + #x25231c0a + #x2f130d1d + #x1a263b40 + #x131c1a18 + #xc4ddf603 + #x1800dac2 + #x83809af0 + #x130fd0 + #x2a2a1a03 + #x2a0c0819 + #x1238504b + #x221d0aff + #xbccff913 + #x3faeccd + #x8080b0ef + #xa1f03b6 + #x2c291200 + #x2d0a0216 + #x19495d52 + #x2810f3f2 + #xadd2081f + #xfd0cf7c6 + #x868fb2dd + #x191ceca7 + #x29200d0a + #x350afd15 + #x2553655b + #x13f6e2f3 + #xafe7100f + #xf1aecb2 + #x9c91a2d6 + #x1c09dcb0 + #x1c19181c + #x3d0cfa0d + #x2d566c66 + #xece2e2fd + #xc6f902e9 + #x200dcfac + #xa0849fec + #xaf6e0c4 + #x13222a20 + #x450af0ff + #x2c567673 + #xd0dfef08 + #xe0f5e5c7 + #x18e6bac0 + #x9183b908 + #xf5f3efc9 + #x19353210 + #x4905e0f3 + #x26597f7c + #xd2efff09 + #xe7ddcfc3 + #xefbfc2dd + #x89a2e50d + #xf202f0b3 + #x2d4223f9 + #x43f5d5f7 + #x205b7f7f + #xef050502 + #xd9c9d0d9 + #xc2b4d9ea + #xa4d7fded + #x206d7a0 + #x3d380df6 + #x33e3d90d + #x1c5b7f7b + #x131302f7 + #xc7c7e5f7 + #xa9c2e6e2 + #xdd05f2c0 + #xaefb9aa + #x381d0506 + #x1fe2ef25 + #x1d5f7f6e + #x2a16f9ef + #xc6d9ff12 + #xaacde0d3 + #x1912d2a3 + #xf6c3b0dc + #x1d0c1618 + #x16f60c28 + #x22637b58 + #x3012efec + #xd6f31223 + #xb2cad6d5 + #x3806bda2 + #xccaad019 + #x8132a0d + #x22161812 + #x22586043 + #x290ae7ec + #xea051d2c + #xadbfd7e3 + #x39fabca7 + #xa7b60342 + #x92a29e7 + #x3b2909f9 + #x183c423c + #x2006e6ec + #xf60a2533 + #x9fbde7f5 + #x36fdc0a0 + #xa3dc294b + #x1f350abf + #x4920f0f3 + #x5223346 + #x1d03e5e7 + #xf90f2f3d + #x9acdfaff + #x3f06b98f + #xbdfa3049 + #x2f23e7b4 + #x3d06e606 + #xf615334b + #x1cfde0e0 + #xfc193b42 + #xaae60602 + #x4d02a687 + #xd7002c50 + #x2603dac7 + #x1ff5f319 + #xf212303b + #xaefdce0 + #x3253930 + #xcaf90903 + #x4ced9996 + #xddf9325f + #x9f3ece3 + #x6fa0615 + #xf60f201c + #xe7e3e5ea + #xc2c3015 + #xe2020905 + #x42da97ac + #xd7f23b6b + #xf3f505f2 + #xfc050f08 + #xf90a0f02 + #xcaddf3f9 + #x1813f4d2 + #xea011114 + #xf5bfbcd4 + #xd829563d + #x1527fac2 + #x1505eef4 + #xfdf5f104 + #xeb040b00 + #x7fef1e1 + #xee020d08 + #xf1ccc8d9 + #xea263920 + #x2d21eac6 + #xaf2f214 + #xf8fa0a + #x10e1004 + #xf1eff1f5 + #xf4fbfbf4 + #xf1d9d8e7 + #xf5141304 + #x3f13ded1 + #xf2ea0e3d + #x8040202 + #x1015140d + #xe5eff7fe + #xf4e7dfdf + #xf1e1e8f7 + #xecfafbfb + #x3902e1db + #xe1fd3c59 + #x1710feeb + #xd171d1a + #xe4f2fafd + #xe2c8c8d4 + #xebeafd01 + #xdbeffaf8 + #x3302e4d2 + #xe8215a60 + #x2611ecd6 + #xa1b2729 + #xe4f7fbfa + #xc5afbccf + #xe7f70af5 + #xd5f7fbee + #x3a05d6c0 + #x3a6563 + #x2d08ded8 + #xd213136 + #xe7fbfdf7 + #xada0b5cc + #xec0002dc + #xe405f7e4 + #x43f8bbb6 + #xd3c666f + #x2702e5e8 + #x112a3c3c + #xecfbf7f1 + #xa09ab2ce + #xf2f8e8c2 + #xfa0bf2e5 + #x36dba9c2 + #x539707b + #x200af8f2 + #x1d344034 + #xececeef4 + #x9c9fbbd9 + #xf1e2cbb3 + #x70bf5ee + #x1bc8b3d9 + #xfb3f7f73 + #x211e07ec + #x393c3426 + #xdcd6ef10 + #xa0b2d4e1 + #xe1c9b8ab + #x80dfeef + #x4cccfee + #x1527f5a + #x302d04e4 + #x5639201d + #xbfce0434 + #xb0d8eed8 + #xcfb6a8a3 + #xa1100e8 + #xe2eaf8 + #x1a5d6f3f + #x412dfbec + #x5a2a1023 + #xa9d91843 + #xd1fef4bc + #xc3a395a3 + #xe11fde2 + #xafafb00 + #x33534d2d + #x4420fb04 + #x40181030 + #xabef1e31 + #xfa13e1a2 + #xb58984b8 + #x100dfbdf + #x150b0708 + #x37372e26 + #x34150b20 + #x1e111833 + #xbef81015 + #x150bc99f + #x9f808dde + #xb0d00db + #x2018110a + #x2b1e1e24 + #x211b2430 + #x13141a24 + #xcbef000a + #x18f5c3af + #x8380abfe + #x81504c9 + #x29231304 + #x21111824 + #x182e3d39 + #x2018100e + #xc5dcfd15 + #x5eed2bf + #x8080c502 + #x1323fbac + #x2e240bfe + #x1e0d1424 + #x20414d3d + #x2b10f8fe + #xb5d90823 + #xfdfbe2bb + #x8090c9f2 + #x2123e297 + #x2d1e0707 + #x200a0e26 + #x2d4f5643 + #x1df8e5fe + #xb0ea1118 + #x80ddea9 + #x8d99bce7 + #x270ece9c + #x26170e17 + #x26070b21 + #x39565d4d + #xfae1e108 + #xc3fe08f5 + #x1d08c5a0 + #x978db0f5 + #x18fad1b2 + #x1a1b2021 + #x2d070415 + #x3c5a6959 + #xd9d9ea11 + #xdffeecd1 + #x1be8b2b0 + #x8c83c010 + #x5f7e1bc + #x1a2e2d17 + #x3100f405 + #x375f7666 + #xd6e4f713 + #xebe7d1c3 + #xfbc5b6ce + #x8096e71a + #xfd04eaad + #x2b3f2602 + #x30f1e201 + #x33637f6f + #xeff7fe0e + #xdfccc9d5 + #xceb9cfe1 + #x90c60200 + #x70bd697 + #x3d390ef7 + #x23dede13 + #x31687f70 + #x1304fd05 + #xc9c5d9f7 + #xb0c5e2dc + #xc3f2f8cf + #x10f7b89d + #x3d210201 + #xed6ef2a + #x34707f66 + #x2b0bf500 + #xc0d2f214 + #xadd5e2cb + #xfd01d6ab + #x2cfacc8 + #x29100e14 + #x2e50b33 + #x39767f53 + #x330becfb + #xc9e80724 + #xb6d4d5c3 + #x1ef2b8a5 + #xd9b0c505 + #x11152610 + #xb02181e + #x3c72703f + #x2b04e4fa + #xdefd1429 + #xb5c8d1ce + #x24e2b3ab + #xb3b8f833 + #xe2b27eb + #x261a0d02 + #x335a5539 + #x1efddff8 + #xef0b202a + #xa8c0dce2 + #x21e1b8a8 + #xa8dc2644 + #x213a0dbf + #x3c18f7fa + #x203d4144 + #x17f8dff2 + #xf8142a30 + #x9fcceff1 + #x27eab396 + #xbc013746 + #x362be4a9 + #x3901eb0d + #xb29404f + #x13f2dbea + #xfb1e3633 + #xa9e2fdf5 + #x36e89f89 + #xd80e364c + #x300aceb5 + #x1eeff523 + #x1234047 + #x5e8d6e2 + #x42b3724 + #xc2f502f8 + #x3ad68f90 + #xe20a3c5d + #x14f1d6ce + #x5f10b26 + #x120332b + #xeadcd8e7 + #x11302701 + #xdbfe0501 + #x2ac292ab + #xd90a4c68 + #xfdf7efd6 + #x11110 + #x214170e + #xd2dfe8ef + #x1b2d14df + #xe800080a + #x15b59dc2 + #xcf105c66 + #xf20801d5 + #x50d0af7 + #x700fd + #xcceafaf8 + #x12ffe7e4 + #xf00e1310 + #xdebfc1d3 + #xfa414b1e + #x2815d1bc + #xbece708 + #xf6edf710 + #xf0bfff9 + #xfff6eff4 + #xf40b0800 + #xe4c8cadb + #x32c2c0e + #x2e06cecd + #xf6e6ff28 + #xfaf60009 + #x120e05ff + #xeff0f3ff + #xf6f9f1ec + #xe7d4dbea + #xf0b00 + #x2bf7d4de + #xe3f32a46 + #x60000f7 + #xe100e0b + #xeaf1f4fa + #xe9dbd8de + #xe4e0f3f7 + #xedf7fdf9 + #x1ff4dee0 + #xe71b504e + #x1505efe0 + #x9151b1b + #xe9f1f3f6 + #xcbbfcad8 + #xe4f306f3 + #xe1f4f9ef + #x21f9dad0 + #x3d604e + #x1cfcdbda + #xf1e282a + #xe9f1f3f9 + #xb1aec2d4 + #xec0508dd + #xe9fcf1e4 + #x2af3c5c4 + #x164a6657 + #x19f0d7e6 + #x1b2a3431 + #xecf1f3fc + #xa0a5b9d1 + #xf905f1c2 + #xfc00e9e6 + #x25dab2cb + #x18486f64 + #x12f1e6f4 + #x2a323a2f + #xefedef02 + #x989fb7d5 + #xf9f1d7b1 + #x800eced + #xec1b4de + #xe4d7c63 + #x1303f4f1 + #x3e3a3527 + #xe6def119 + #x95a6c4db + #xe9d8c4a6 + #xb03f4f1 + #xf4bcc7ef + #xf5c7f4e + #x2215f6e6 + #x5335241f + #xcdd5023d + #x9fc1dad5 + #xd4c2b59f + #xc0bfaea + #xedd0def9 + #x246c7635 + #x3518ece6 + #x51251224 + #xb5de184e + #xbce6e1bc + #xc4afa3a0 + #x100ef7e0 + #xf7e9efff + #x3a695c28 + #x3a0fe9f9 + #x35120e31 + #xb2f32240 + #xe6fdd1a0 + #xb59693b4 + #x150bf3da + #x8fcfa06 + #x40504124 + #x3108f612 + #x13091938 + #xc2ff1821 + #x8fab898 + #x9f8096d8 + #x1309f6d4 + #x1509050b + #x31323125 + #x1f0b0f24 + #x60e212e + #xd3f9060f + #x10e7aca5 + #x8180b1fd + #x1012f9c2 + #x1f150806 + #x21212828 + #x161c282a + #x1213181b + #xd3e90016 + #x3dbb8b7 + #x8080d10b + #x151cf0a5 + #x281b0500 + #x1616242b + #x1e32382b + #x210e030b + #xc1e10827 + #xf6e4cab7 + #x8098e0ff + #x251ed88a + #x2c18ff06 + #x15101f2e + #x2e44412c + #x19faef08 + #xb8ec1222 + #xfff7cba6 + #x80a5d5f0 + #x2e0cc189 + #x27100518 + #x160c1c2e + #x3b4e4a32 + #xfae1e610 + #xc5fd0b03 + #x12f9b89c + #x8f9cc5f7 + #x22f4bc9c + #x1b121524 + #x19091824 + #x4154543d + #xd8d4ec1b + #xe002f3dd + #x16e1a3a8 + #x898fcd0f + #xbedcdab + #x1924251c + #x1e050b13 + #x415c6348 + #xd0d8f71f + #xefefd7cb + #xfdc2a6c2 + #x8098ed1c + #xfcdba3 + #x28352209 + #x1ef9f90c + #x40637056 + #xe4e9ff1c + #xe6d3cad8 + #xd4b5beda + #x80be0909 + #xb09d38f + #x3b350ffd + #x13e6ed18 + #x3e6d7f5c + #x2f7fd15 + #xcec2d3f7 + #xb7c2d8d8 + #xa9e905dd + #x19fcb58d + #x4021ff05 + #xffd5f62f + #x43787f54 + #x16fdf60e + #xbec8e715 + #xb4d5dbc7 + #xe0f9e1b5 + #xfd7a5b2 + #x2f0f0616 + #xefdd0e3a + #x4a7f7f40 + #x1cfded0c + #xbfdbfc25 + #xbcd8ceb9 + #x6e9bba6 + #xeab5b9ed + #x19121c15 + #xf3f71f2c + #x517f722c + #x18f9e70c + #xd1ef0b28 + #xbecdc4be + #xcd1acac + #xbfb5ea1e + #x132a24f4 + #xc12190f + #x4d705927 + #x10f1e30c + #xe4ff1628 + #xb4c4cbd0 + #x6cab1ac + #xaed81b32 + #x243a0cc5 + #x25120002 + #x3b534835 + #xbeae006 + #xf30e2128 + #xa9cbdde1 + #x9d3b19f + #xbc023537 + #x382fe1a8 + #x2afdef0e + #x243b4747 + #x6e6dbfc + #xfc1c2b28 + #xacdeecea + #x16d59f8c + #xdb183a3e + #x380cc2ac + #x15e9f728 + #x15324a47 + #xfdddd4f1 + #x62b2f1e + #xbff0f4f0 + #x1fc78a8d + #xec184050 + #x1eedc2c4 + #xfdea0f31 + #x102e4331 + #xe9d4d1ed + #x15342502 + #xd5f9f9f7 + #x13b187a0 + #xe716515f + #x2ead7d1 + #xf6fc1c1f + #xf242a13 + #xd5d1d8f1 + #x212c0ce3 + #xe4ff0005 + #xf9a698bb + #xe0246257 + #xfdffe7cb + #x2080e02 + #x90f0b05 + #xdae1eaf7 + #x251ef7d1 + #xea030b10 + #xe4a6abca + #xde346946 + #x513eabe + #xe09f7ed + #xfaf702 + #xeff7f9f9 + #xaf6f309 + #x61b1512 + #xd7c4c6de + #x1f4b3e09 + #x33f6bdd7 + #xf6e0f82a + #xf5f30a15 + #x1907fcfc + #xfef6f80a + #x60f0401 + #xddcad2e9 + #x192f2704 + #x28ecc9e7 + #xe7ef1b3c + #xfbfc0a03 + #x10090403 + #xf5f5f906 + #xfbf5eff0 + #xe0dae9f5 + #x90f10fe + #x19e9dbf2 + #xe6124447 + #x703feec + #xc0f1210 + #xf2f2f5fe + #xe0d8dee9 + #xe3effef3 + #xf50106f5 + #x15f2e1e7 + #x13e593f + #x12fbe7e0 + #x131c221f + #xf0edf503 + #xc1c4d3e4 + #xef0706de + #xf300f9ea + #x1cf2d2da + #x21556144 + #x10eddbec + #x242a322a + #xefedf80d + #xaebacae0 + #x12f8c4 + #xfefeede9 + #x1ee0c1db + #x2f5e6b53 + #x7e6e1fc + #x3236392a + #xf0ecf816 + #xa3afc1de + #x907e1b2 + #x7f9eaf3 + #xac6beea + #x2a627d5b + #x6efef00 + #x3f3c3924 + #xeae3fb27 + #x9aa7c4e1 + #xfcefcda6 + #x9f9f3f9 + #xf0baccf9 + #x286e7f4a + #x1303f0f5 + #x4a3c2f21 + #xdade0942 + #x9ab4d0de + #xe6d8be9d + #xc01fbf5 + #xe3c4de00 + #x387f7d32 + #x280ce7ef + #x452f1f27 + #xc4e72155 + #xafd2dac9 + #xd2c4ae9b + #x130afbe7 + #xeadbec06 + #x507f6721 + #x3204e1fc + #x2a191933 + #xc0fb2d47 + #xd8ecccae + #xc0ab9eac + #x1b0cf5db + #xfbf0f60f + #x586e501c + #x2afced16 + #x70c213c + #xcd0a2725 + #xfeedb1a0 + #xa78f9ed2 + #x1b09f2d2 + #xa000316 + #x4a514121 + #x1c010427 + #xf60d2c38 + #xde071310 + #xdda9ea7 + #x8680b7fb + #x160ff3c0 + #x180d0a13 + #x333b3b2a + #x16121c2a + #x1132a28 + #xe0f60a15 + #x3c9a3b8 + #x808edd12 + #x1b18eca1 + #x2515090d + #x212d3630 + #x1c272c25 + #x13131819 + #xd2ed0f25 + #xf3cdb5bd + #x80abf50c + #x281bd585 + #x2d160410 + #x1b253336 + #x2d393322 + #x12040315 + #xc6f51927 + #xf6e1bdaf + #x80bdeffb + #x350ab880 + #x2c0f0721 + #x181f323b + #x3e473b24 + #xf6ecf61c + #xcd04160f + #xceaafa3 + #x91b8defc + #x2df0af8b + #x210f1632 + #x181c2f33 + #x4850442a + #xd5dbf928 + #xe60a01e7 + #x15da9ba9 + #x8fa7de13 + #x15e4bb9d + #x1c1c272f + #x18182424 + #x4b595033 + #xc4da0430 + #xf8fbe1d0 + #x3bb9ac3 + #x80a7f824 + #x4efcf9b + #x28322a19 + #x190c1019 + #x4d625f3f + #xd0e60c30 + #xf0ddcfd8 + #xddaeb1db + #x80c61315 + #xc01cc89 + #x3c361909 + #x13f80121 + #x5071704a + #xeaf50d2c + #xd8c7d2f2 + #xc0bacde0 + #x9ded15ed + #x1e00b580 + #x4527060d + #xe60336 + #x557f7f45 + #xfcfc0725 + #xc3c7e60d + #xbbd2dad0 + #xd201f2c3 + #x1ee0a09d + #x39120922 + #xe9e41844 + #x5c7f7f32 + #xfcfe21 + #xbed7fb1c + #xc7ddcfbd + #xf8f2c9b2 + #xfebdaed3 + #x24121c25 + #xe6f92c3b + #x677f711b + #xfef5f622 + #xc9e90c24 + #xcdd2beba + #xfed3b1b4 + #xd0b7dd07 + #x1c272a09 + #xfb132c22 + #x6b7f5c13 + #xfbedf228 + #xddf91625 + #xc3c6bec7 + #xf2c3afb5 + #xb7d7121f + #x2d3c16d8 + #x161b1513 + #x5f6e4b22 + #xf9e6f027 + #xef092125 + #xb7c6ccda + #xefc6b1a9 + #xc3043224 + #x4436ecb5 + #x2109001c + #x47554b3b + #xf6e1ec1c + #xfc1b2824 + #xb5d7dde6 + #xfccda698 + #xe3213e2c + #x4712c4b1 + #x13f00135 + #x32475544 + #xf0dae30c + #xc2a2d1e + #xc6e9e7ef + #x9c39194 + #xf827453f + #x30ecb8c6 + #xf9ef1942 + #x28455333 + #xe1d0db03 + #x1c362509 + #xdaf3edf9 + #x1ac86a1 + #xf9275850 + #xfe0c9d7 + #xf2032d35 + #x253e3e16 + #xd2cadb03 + #x2c3312ef + #xe7f9f507 + #xea9d8fb8 + #xf2356b4e + #x1efd8d5 + #xfc152515 + #x1e282106 + #xd0d3e606 + #x2c1ffce4 + #xf0040415 + #xd5a1a6ca + #xf94a6e38 + #xf03d7c9 + #xc0f0703 + #xd0c0a09 + #xeceaf303 + #x250defea + #xf810121b + #xcaaeb8d2 + #x75c6821 + #x220ccac1 + #x13feed01 + #xfcf80112 + #xa01fbfc + #x1f60114 + #x18180f0d + #xcfc0cbf3 + #x36492df9 + #x1fd1bef9 + #xdde4153f + #xf3001503 + #x4fcfcfc + #xfbf6fe0a + #xd060001 + #xd2cbdcfb + #x222d1ff8 + #x11d7d2fe + #xe206333e + #xfb0407ee + #x1010704 + #xf6f2f901 + #xf5ebeef8 + #xdae2f2f9 + #x7120ff2 + #x7e2e2f9 + #xf9334f36 + #x400f2e0 + #xa111712 + #xf2ebf604 + #xd6d7e5f2 + #xea00fee7 + #xfc0901ea + #xcebdfeb + #x20535330 + #x4eedfea + #x1f23261b + #xebe7f912 + #xc0cbdaea + #x112f5cb + #x1f2ea + #xfe0cfe7 + #x39605a3b + #xfce0df00 + #x3133311f + #xe8e80120 + #xb2becfe5 + #x110fe0b5 + #x3f6eaf5 + #x4cbcbf3 + #x416b6e47 + #xf5e2ea0d + #x3b3b3418 + #xe7e7042b + #xa4b2cbe5 + #xcfccea8 + #x3f0f200 + #xebbdd600 + #x417a7f41 + #xfceeee06 + #x3f3c2e14 + #xdae00d39 + #x9aafd1e4 + #xf8e7be9c + #x4f8f9fe + #xd9c0e407 + #x4a7f7929 + #xff9e5fe + #x3934251a + #xc9e82044 + #xa1c0d6d2 + #xe4d4af94 + #xc03fbee + #xd9cfee0a + #x5d7f6314 + #x1df6dd07 + #x22232028 + #xc3fc303b + #xc1d6c9b8 + #xcfbd9f9f + #x1707f5df + #xe8e4f612 + #x6c7f4f11 + #x1beee41f + #x3122834 + #xd20f2d1b + #xe8d9ada8 + #xb6a19ec3 + #x1a07f0d2 + #xfbf3031a + #x65694517 + #xfeef931 + #xf2113134 + #xe5111b03 + #xfec897ad + #x9390b5f0 + #x180af0be + #x9010d1d + #x4d533f20 + #xafe0f33 + #xf8173128 + #xeb030c04 + #xf8b397be + #x8097dd0d + #x1a11e8a1 + #x170c0f18 + #x36423c29 + #x14151d28 + #x918251b + #xddf60d15 + #xe8b2a7c4 + #x80b6fe0d + #x2614cf80 + #x230f0c1a + #x28373b33 + #x2529231f + #xa0f1218 + #xcff9171a + #xe5c3b2ba + #x83d10100 + #x3304af80 + #x260c0c29 + #x22313c3b + #x3637261a + #xf5f9041f + #xd2091a06 + #xf6d1a8aa + #x99d2f0fb + #x2eea9c80 + #x1f091a3c + #x1f2e3e37 + #x42412d1b + #xd2e5062d + #xe71107e4 + #x4c896ac + #x9cc1ea0d + #x17d7a58c + #x18152d3c + #x1d2b362b + #x4a4a3722 + #xc0e00f36 + #xfb06eac9 + #xfcad90c3 + #x8cbdfe22 + #x3ddba93 + #x22293328 + #x1d222320 + #x4d534429 + #xc3ea1839 + #xf9e8d2c8 + #xdc9ea5dd + #x83d11b1d + #x4f0be82 + #x37342314 + #x180c1123 + #x52635534 + #xd4f61a36 + #xdfcccfda + #xbea7c4e5 + #x99f51ff8 + #x17f5aa80 + #x44280d12 + #x6f60d37 + #x5b776834 + #xe4001734 + #xc4c6ddf2 + #xbac3d6d7 + #xc90901cf + #x20dd9488 + #x3b120723 + #xedf01f47 + #x687f6f25 + #xeafe0f33 + #xbbd1f301 + #xc9d4cfc3 + #xf0fcd4bd + #x7bd9cba + #x260c1d30 + #xe0003442 + #x767f630a + #xebf80634 + #xc1e20409 + #xd4cfbdb8 + #xf8dcb8bd + #xdcb3c8ed + #x1f202e1a + #xee17372e + #x7f7f4dfe + #xedee033b + #xd1f2110d + #xcec0b3be + #xe8c3b2c0 + #xbdcffe09 + #x2d3722eb + #xa202520 + #x7c7a3f0c + #xebe70341 + #xe4031a11 + #xbdbabdce + #xddc1b5b6 + #xc4fe250c + #x4536f6c1 + #x1a110d26 + #x68634125 + #xe5e2013b + #xf5152212 + #xb8c4ccdd + #xe4c6aca5 + #xe422330f + #x4d14c9b8 + #xff90c3f + #x4f574d34 + #xdcdcf82b + #x726230c + #xc4d7daea + #xf0be969c + #x1303c20 + #x39eab5c9 + #xf8f32050 + #x3f555228 + #xced1eb1a + #x1a3120fc + #xd7e5e2f8 + #xeda786a7 + #x7314f34 + #x15d2bedd + #xeb063744 + #x3952440d + #xbec8e714 + #x2b3311e8 + #xe7ebeb07 + #xd9948bbb + #x13e6539 + #xdccfdf + #xf61d3625 + #x314128fb + #xbac9eb14 + #x3125fedd + #xeef5f918 + #xc3949ecb + #x6536e26 + #x6edd1d6 + #x91f180c + #x202311fe + #xc9d9f511 + #x260ff5eb + #xfb070a1f + #xbda4b2d7 + #x1d65600c + #x1af2c3d4 + #xd06fe11 + #x9090c0c + #xe8edf907 + #x17fef303 + #xa18171d + #xc1b5bedf + #x33694dfc + #x29eab5dc + #x4edf322 + #xf8fb0d17 + #x3fbfbfc + #xfcfc0403 + #x180a0707 + #xc4bbd909 + #x3b3b18ea + #xf5bdd614 + #xd4fb3336 + #xf60c0ce5 + #xedf5fef8 + #xfbf6fcfb + #x6f9fe01 + #xcbcfe804 + #x222811e7 + #xf2cee209 + #xed203f29 + #xfc07f8df + #xf6010900 + #xf3edf6fc + #xe7e5f3fb + #xddedf6f2 + #x91503e2 + #xf6e0e7f8 + #x17454520 + #xfef6e4e4 + #xc151709 + #xe7e7f90d + #xccd9ebf2 + #xf804eed4 + #x307f2e4 + #xe0dcee + #x39554525 + #xf5e2dcfe + #x2326220c + #xdfe7031f + #xbecedfe7 + #xf07dabd + #xf6e8f3 + #xfbd1d6f3 + #x495e5230 + #xeadae712 + #x30312607 + #xdde80a28 + #xb3c0d4e0 + #x14f9c8b0 + #xf9eaed04 + #xe7c3ddfc + #x4d6f6630 + #xeae2f017 + #x34362303 + #xd9e81230 + #xa2b3d4e0 + #x6e8bda4 + #xf6edf807 + #xd2c4eb03 + #x557f681b + #xf5eaea11 + #x34331b03 + #xcfed1d31 + #x9cb6d7d7 + #xf3d9af96 + #xf9fbf9 + #xced1f507 + #x667f5304 + #x1e7e015 + #x26251811 + #xc9fc2926 + #xacc4ccc1 + #xe0c69e94 + #xd03f5e7 + #xd7ddfb0f + #x797d41fb + #x6dfe229 + #xf172020 + #xd612280d + #xcecbb2af + #xc9ac97af + #x1403ebd7 + #xe5e80418 + #x79713b03 + #xddf33f + #x142d26 + #xea181af8 + #xe4bb9ab0 + #xa799adda + #x1201e8c4 + #xf5f60f1b + #x665e390f + #xfbe80642 + #x11a301f + #xf50f0af5 + #xe2a496c1 + #x869ed6fe + #x1406dfa5 + #x403141b + #x4f50391b + #xfc1234 + #xc1f2614 + #xeafe0601 + #xd19ca4cc + #x80bbfb04 + #x1f09c880 + #x1109111d + #x3e453725 + #x11121526 + #xf17150f + #xdafc0d09 + #xcbaab0c3 + #x8cda06f9 + #x2dfba580 + #x1707122b + #x333e3b2e + #x2320171b + #x60a17 + #xd70712fb + #xd9baaab2 + #xa5e5fcf5 + #x29dd8b80 + #x14041d3e + #x2b3b3f30 + #x33291818 + #xe2f30a25 + #xe81206dc + #xebb596af + #xafd9f301 + #x12c68b85 + #xc0d313f + #x283b3e28 + #x3c301d18 + #xcbea1431 + #xfc0ceac0 + #xe79f8ec1 + #xa1ce0117 + #xfbc69f8e + #x1420392e + #x2633301d + #x4239261d + #xc6ee1d39 + #xfef2d1b8 + #xce8c9edc + #x93dc1b18 + #xf8d9aa83 + #x28302e17 + #x22201b1f + #x4a473425 + #xd1fb233b + #xe8d4c9c1 + #xb094beea + #x9ffc26fc + #xae49a80 + #x3b281712 + #x11071431 + #x525b4728 + #xe0042037 + #xccc6cfd4 + #xaaafd4df + #xc8110dd4 + #x17d48680 + #x36140d20 + #xf6fb2244 + #x6173521a + #xea041a37 + #xbbc9e2e2 + #xbbc8d1c6 + #xee07e2be + #x7b686a5 + #x22071b2e + #xe4043944 + #x747f4c01 + #xf0fe123e + #xbddaf3ed + #xcecbbeb6 + #xf8e5c1c1 + #xe0a8acd7 + #x15173123 + #xea1a3f31 + #x7f7f36ee + #xf2f50f49 + #xcbeb01f5 + #xcebdb2b6 + #xe7c6bac9 + #xc1c1e2f5 + #x23302df9 + #x3263023 + #x7f6f25f6 + #xf0ee0f52 + #xd7fc0af9 + #xbeb0b2c0 + #xd1bbbbc3 + #xc3f00cf8 + #x3f3606ce + #x151a1829 + #x7a5d260d + #xe7ea1253 + #xe80c11f9 + #xb3b5bece + #xcfbeb3b2 + #xe4181df3 + #x4d1ad6bd + #xf011444 + #x63533622 + #xd9e40c44 + #xfb1d14f3 + #xbac3ccdd + #xdabaa1a7 + #x42d25fe + #x3bebbacc + #xf6f62657 + #x5055421b + #xc9da0031 + #x112811e5 + #xcbd1d7ed + #xdca590ad + #x12343412 + #x14cbbde2 + #xe8063f4f + #x49573b04 + #xb8cff625 + #x232b06d2 + #xdad9e201 + #xcb908ebd + #x11414f1b + #xf5c9ccea + #xf320422e + #x444a22f2 + #xaccbf622 + #x2d23f6c8 + #xe2e2f215 + #xb5899ccb + #x14585d11 + #xf3d9cfe0 + #xa292911 + #x34300af3 + #xb0d2fc1f + #x2612edce + #xebf20420 + #xaa96add6 + #x286c55f9 + #x3ddc3dc + #x15170a0d + #x1b150404 + #xc6e20014 + #x1503f2e8 + #x106111d + #xb2a5bbe4 + #x416b3eea + #xdd2baeb + #x3f80420 + #x3060c0c + #xe0edfe03 + #x6f9fc00 + #x14141515 + #xbdb2c4f5 + #x4d602de5 + #xdc3b800 + #xebe40d34 + #xf503140a + #xeef3f9f8 + #x305ffee + #xe030806 + #xbcc6f216 + #x39320bdb + #xd3c7f421 + #xe61f431b + #x211f7d7 + #xebfd00f5 + #xfcfaf9f1 + #xfaf90303 + #xcdddf905 + #x252702da + #xe1d8f20e + #xa363e13 + #x303e8e3 + #xfd0b08fd + #xeceff902 + #xe0ecfcf9 + #xe9f7f5e9 + #x1314f2de + #xefe4ecfc + #x32493913 + #xfdeedefc + #x171c1102 + #xe0eb0319 + #xd0e4f1e9 + #x6ffe1cd + #x8ffe8ef + #xf5dde3f9 + #x494f3e1f + #xeee0e819 + #x2a2a17ff + #xdbef0e27 + #xc6d5e3e0 + #x13f4cdbf + #xfdecec06 + #xe8d2e8fd + #x525f4f22 + #xe4e0f527 + #x333017f9 + #xdaf2162c + #xb6c6dbdb + #xee6c1b6 + #xf2ebfa13 + #xd5d2f4ff + #x5f745813 + #xe8e6f928 + #x362f13f5 + #xd5f71f2f + #xa7c1dbd8 + #xdbb8a5 + #xf4f5000b + #xcddbfcfd + #x737f4ffc + #xf1e4f12d + #x362710ff + #xd302272a + #xa8c7d5ca + #xf2cda599 + #x200fcfa + #xd2e60005 + #x7f7f3ef1 + #xf2d8ef3d + #x2a1c140b + #xde112516 + #xbbc9bfbb + #xddb89aa2 + #x1003f2e9 + #xddec0813 + #x7f7133f4 + #xefd2fc51 + #x1b171f14 + #xf11c1700 + #xcfbba7b8 + #xbea2a8c7 + #x1100e9d7 + #xe9f5141c + #x7a6230ff + #xecda0d5a + #x141e2814 + #xff1608f9 + #xcfa29dc7 + #x9ca4cfec + #x1100deb8 + #xf5031b1e + #x6657300a + #xf2ee174e + #x1b24250e + #xfa080200 + #xbf96a8d3 + #x8ebef9fa + #x19ffc691 + #x50b1b1e + #x544f3316 + #xff00173b + #x1f21190a + #xeb000608 + #xb39db5cf + #x9ce30bef + #x25f2a080 + #x100b1928 + #x47493822 + #x100b132d + #x14130e10 + #xe3080d00 + #xbeadb1bf + #xb8f405e9 + #x25d78380 + #xe0a223b + #x3e474028 + #x1f131125 + #xff020e1e + #xee1305e6 + #xd0aea0b6 + #xc6eefcf2 + #x11b9808b + #x8103643 + #x38474125 + #x2c1b1121 + #xe8f9162d + #x210eec9 + #xd59c94c2 + #xbce30608 + #xf4b18e99 + #xb224433 + #x3844381b + #x35211621 + #xddfa2238 + #x8fcd3b9 + #xbf889fdd + #xaeeb1f0e + #xecc19a8f + #x1e333b1b + #x33352719 + #x3d2d2227 + #xe105283b + #xf9dec4be + #xa48bbcee + #xb3062dfa + #xfcd09480 + #x32322510 + #x251e1c28 + #x463e322a + #xf10e2a3d + #xdbcac9cc + #x9aa5d5e8 + #xd51e1bd5 + #xecc8080 + #x331e161e + #xa0b273e + #x54553e1f + #xff10253e + #xc6cad5dd + #xaac1d8d0 + #xf917f2be + #x6b180a2 + #x2210212f + #xf2103d46 + #x69683b08 + #x60a1e44 + #xc1d5e4e8 + #xc2ccc9be + #x3f5cfbe + #xe49f97cf + #x1316362a + #xf1224936 + #x7d6c28f1 + #x8001b51 + #xcae4eff1 + #xcac1b8b6 + #xefd2c6cc + #xc6b0c9ec + #x192f3806 + #x5303b24 + #x7f5f13ee + #xfa1e62 + #xd7f4faf4 + #xbfb3b1bb + #xd5c4cacf + #xc4dbf4ef + #x333819dd + #x17272525 + #x7f4e1000 + #xf4f72569 + #xe40500f1 + #xb1b0b8c4 + #xccc2c7c2 + #xe10806e8 + #x4724e8c9 + #x14111f40 + #x70461e13 + #xe4f52762 + #xf51303e8 + #xb1b8c2d2 + #xd2bfb6b3 + #x8220deb + #x3df7c7d5 + #xfd03335a + #x5f4a2f13 + #xd7ee1c4f + #xb1f02da + #xbec4cde3 + #xd3ada4b3 + #x1e2f1bfa + #x17d2c4ec + #xee114e57 + #x57522f02 + #xc9e30e3e + #x1e24f9c9 + #xcccddbfa + #xc6979dc1 + #x213d3205 + #xf2c7d3f7 + #xf52c5439 + #x544a19ee + #xb9d80836 + #x2a1febb8 + #xd3d7ee10 + #xad8ca8cd + #x255444fd + #xe4d0d8f2 + #xe383e17 + #x493302ee + #xb5da0a33 + #x2a13e1b8 + #xdde6021f + #xa093b6d7 + #x386b43e9 + #xf1d7cdec + #x1f2a1f0b + #x3219fc00 + #xc2e40b27 + #x1e05e3c9 + #xeefa1121 + #xa49fbfe1 + #x517030d8 + #xfacdc2f9 + #x160d1017 + #x160b0511 + #xd7ef0814 + #x1000f1e1 + #x60a1419 + #xaeabccf7 + #x5d601cd7 + #xf2bcc710 + #xf7fa1e28 + #x50b100a + #xe4f40002 + #x602fff1 + #x17111311 + #xb9b1d80b + #x5a4e13dd + #xe6b1d522 + #xdef73030 + #xfd1013f9 + #xe9f4fcf9 + #x601efe2 + #x1060e09 + #xb8da0910 + #x3a2dfbc8 + #xc8da0627 + #x83f3ef9 + #xb08e2da + #xfb08fef6 + #xf7f6f2f4 + #xf2010900 + #xd3ec01f9 + #x2d1fefd0 + #xdce4fb15 + #x254332fe + #x4f6e0f4 + #x111301fb + #xe7ef0011 + #xe4f900ee + #xf4f9eedd + #x1b08e5e5 + #xece5ef08 + #x43462f09 + #xf7e4e918 + #x2a2008fb + #xddf21028 + #xdaeeeedd + #xbf1d5cd + #x8f1e901 + #xe7ddef04 + #x50503e13 + #xe7dffb31 + #x35250bf6 + #xdcf91b32 + #xcbdce0d7 + #xbe0c6c3 + #xf6eafb16 + #xd8dcf600 + #x60664b09 + #xe0e40639 + #x3a2708ef + #xdcfe2335 + #xb6cddad2 + #x1d7beb4 + #xeff40918 + #xd0e5fef9 + #x777c47f6 + #xe5e50443 + #x3e2204f1 + #xda062a39 + #xaccdd5ca + #xf6ceae9f + #xf700080b + #xd3ef00f9 + #x7f7d35e5 + #xe9dd0351 + #x391a08fc + #xe2152a2f + #xb3cdc5bc + #xe7bb9d9a + #x401fcfc + #xdcf20606 + #x7f7228e7 + #xe5d30d65 + #x2c161306 + #xf61f1d1a + #xc0beaebc + #xcda69faf + #xdfcf1ea + #xe4fb1115 + #x7f6625f1 + #xddd71d74 + #x201d1f08 + #x61a0b0b + #xbea2a1ca + #xa9a1c0d3 + #xefbe5cd + #xef061f1d + #x7f5e27fb + #xdde72c6f + #x20252001 + #x60b000b + #xae90a7da + #x97bbece5 + #x16fbcda4 + #xfc112220 + #x6f562a03 + #xeaf72a5d + #x25251800 + #xf9010313 + #x9f94b6dc + #xa2e408df + #x22eea683 + #x8152028 + #x60512f10 + #xfc03224b + #x221a1006 + #xee040b10 + #xa4a4b6cb + #xc10008d3 + #x22ce8080 + #xb11283a + #x55513a1d + #xb061a3e + #x100b1013 + #xf41006fb + #xb6a9a6c0 + #xd700fcda + #xdab8090 + #x6163e44 + #x4c53431f + #x18091534 + #xfb011823 + #x410f1dd + #xc09a97c6 + #xd3f203ef + #xee9980a2 + #x82a4e39 + #x4b533e16 + #x220e1531 + #xee012332 + #x10fed5c8 + #xaf839ce0 + #xc3f61bfc + #xdda48f9f + #x1a3f491d + #x49472d13 + #x2a181b34 + #xef0b2d39 + #x3e0c1c6 + #x9280b8f2 + #xc3112fee + #xe7b88b8b + #x3143320e + #x3c312220 + #x34272a37 + #xfe15313c + #xe7c8c0d2 + #x8599d3f1 + #xdd2c25cb + #xfcb88085 + #x392f2016 + #x221d2a37 + #x433e352f + #xe1a2f3f + #xcdc1cae4 + #x95b9dcda + #x32afeb1 + #xfea180a1 + #x271a272d + #x41b3f43 + #x5b553716 + #x1a162a49 + #xc5cadaf2 + #xb1cbcdc3 + #x110bdcb3 + #xe28b82cd + #x151b3e2f + #xfc2c4e37 + #x775e25fb + #x180d285b + #xcadae5fb + #xc3c5bbb8 + #xfee4cdc3 + #xc094b1ee + #x18354613 + #xd3c4627 + #x7f550eef + #xb062d6f + #xd3e9eefc + #xbcb4afb8 + #xddcdd2cd + #xbbc0dff1 + #x31462ae7 + #x20392f23 + #x7f3f01fb + #xf9043a7c + #xe0f6f2f4 + #xaeabafbe + #xcbcad3c5 + #xdaf1f4e2 + #x4734f9d0 + #x20232739 + #x72350d0e + #xe904437c + #xf104f4e9 + #xa6acb4ca + #xcbc8c5b6 + #x410f7da + #x4308d3da + #x9153a56 + #x653c1f11 + #xdf013e6f + #x610f2da + #xaeb6beda + #xceb6afae + #x201dfee5 + #x1fdccdf4 + #xf41d5b5e + #x60492500 + #xd7f7315d + #x1a16ecca + #xbbc0cef2 + #xc09da6b8 + #x282c15f2 + #xf2c8d804 + #xf73a6844 + #x604713ec + #xcbea2251 + #x2815dfb8 + #xc5cbe20b + #xa78facc5 + #x31472cef + #xddcde003 + #x114c581f + #x5934fbe9 + #xc1e51d4c + #x2c0bd0ae + #xcddcfb1d + #x9592bbce + #x466332dc + #xe2d3d800 + #x2a443408 + #x4418f1fe + #xc8ec1d43 + #x2500d0b8 + #xddf10e25 + #x949dc3d7 + #x626f22c8 + #xeacbcd0b + #x28251d0d + #x2708fe15 + #xddf6182d + #x1afbdccd + #xf404161f + #x9da7cbe9 + #x74630ec1 + #xe4b9ce25 + #xd0d231b + #x11080d16 + #xecfb0d15 + #x10feeadd + #x80e1516 + #xa7b1df03 + #x6b4c03c6 + #xd0b4e437 + #xf10e371b + #x80e0dfe + #xeef90001 + #xe06f2e0 + #x130e1110 + #xacbbf416 + #x583a01cd + #xc0b9f93c + #xe41a4310 + #x61504e5 + #xecfbfbf9 + #x1f1e9f3 + #xfc0e130b + #xc7f60e00 + #x3b1de4bd + #xd2ec0c2d + #x2b471edf + #x8efd9f1 + #x1409f7fc + #xf1eef70b + #xf70b0bfb + #xe1f9fbee + #x2d0be1d1 + #xe1eb0121 + #x363e1bee + #xfbe4e70c + #x2510fbfc + #xe4f10c26 + #xf303f9e6 + #xfbf3e1de + #x16f6e6f1 + #xe7e7f916 + #x433e23fe + #xecdffc2b + #x301400f9 + #xe2fc1d33 + #xe9f3e4d9 + #xe1cfd6 + #xfcecf90e + #xdfe4fc09 + #x4f4f3300 + #xe1e6103b + #x331600f1 + #xe4042538 + #xd4dfd9d4 + #xf9d6c7c7 + #xeef31018 + #xd9ecfef9 + #x676535f1 + #xdfec1447 + #x3516fceb + #xe60b2b3d + #xc1d6d2cf + #xefd1bcb2 + #xf1011411 + #xdef6fcf1 + #x7f6c26e4 + #xe1e91658 + #x3211fbec + #xe9142d3b + #xbcd4c9c5 + #xebc4a8a2 + #xfe040c08 + #xe4f9fefb + #x7f6214e1 + #xdfe2206d + #x230c01f4 + #xf71e252d + #xc1c7b5c4 + #xd9b09fa8 + #x6fe01fc + #xe9fc090b + #x7f580ee4 + #xd7e4327f + #x14110cf7 + #x91d141b + #xbdada8d1 + #xbca5b0c1 + #x8f7f4e4 + #xee081816 + #x7f5513eb + #xd4ef427f + #x111d16f6 + #xc0c0613 + #xac97ade4 + #xa5b7d7d1 + #xcf6debd + #xfb16201b + #x7c5318f3 + #xdafc4377 + #x182114f1 + #x1fc0316 + #x9895baeb + #xacdff6cc + #x16ebb79a + #x61b2323 + #x6d4f2000 + #xe7033864 + #x1b1b0ef4 + #xf4fb0818 + #x97a2c1df + #xca01fcbd + #x16cc8f8f + #xb192b33 + #x624d280c + #xf6042b55 + #x13100b01 + #xf606090b + #xa7aab4d1 + #xe60bf3bf + #x3a480a0 + #x91d3e3e + #x5a4f3313 + #x304234a + #x3061310 + #x40bfbf3 + #xb29da4d4 + #xeb01f6d1 + #xe28d80b5 + #x92e5036 + #x5753330e + #xc041e42 + #xf3061e20 + #x10fcdfdc + #xa888a2e6 + #xde0009e2 + #xcc9093b8 + #x1945501e + #x574f290b + #x11091e40 + #xf10e2929 + #x6e1c9d6 + #x8d80b8f9 + #xd91620da + #xd1a497a7 + #x324d3a08 + #x4f3d1e14 + #x19132643 + #xfe19322d + #xeec7c4de + #x8093d4fb + #xee321dbc + #xe4a8839b + #x3b3d250b + #x3628212b + #x2626333d + #x10203232 + #xd4bccaef + #x88b4dfe7 + #xe36fea0 + #xeb9580ac + #x32252520 + #x1925383b + #x3e3b3326 + #x191e303d + #xc4c1d6fe + #xa7cad4cc + #x1e1bdaa0 + #xd78080d2 + #x1b213d2b + #xc334a35 + #x5b482306 + #x14163050 + #xc4cde203 + #xbfcac1bd + #x10f7cdb7 + #xba82a8f4 + #x16354b19 + #x14424320 + #x70450bf4 + #x4103868 + #xcfdce900 + #xc2bab2bc + #xefdfd6ca + #xafa7d4f9 + #x294a38f3 + #x26423018 + #x7433fbf9 + #xf310487c + #xdce9ecf6 + #xb5adb0c2 + #xd6d9dcc9 + #xc7d7ebe6 + #x454009d6 + #x2930252d + #x6425000b + #xe613557f + #xe9f1ebe7 + #xaaacb2cc + #xd1d7d2b8 + #xf3f9ebd6 + #x4518e2dc + #x1821364b + #x55250e10 + #xe1145875 + #xfbf9e9dc + #xaaafb7d9 + #xd1cabdad + #x1408e9d7 + #x28ebd7f7 + #x3295758 + #x52301401 + #xe1104f68 + #xc01e4d2 + #xb2b5c2ec + #xc4b2afaf + #x2110f7e1 + #xfbd4e60e + #x3456c45 + #x5a380bec + #xda044060 + #x1d03d9c4 + #xbabfd604 + #xada2b2ba + #x292610e1 + #xdfd4ef13 + #x195b5f1e + #x5a2bf6e7 + #xd1fb365d + #x23fbccb8 + #xc2cfef18 + #x9aa0bdc2 + #x3e471bd1 + #xdcdaeb11 + #x35583e01 + #x4811ebfb + #xd1fb3357 + #x20efc4b8 + #xcfe70823 + #x93a8c5ca + #x5f5a10ba + #xe2d2de1e + #x383d23fe + #x2b00f614 + #xe1012d43 + #x19ebcaca + #xe6fc1323 + #x9aafcad7 + #x7555feb2 + #xdcc1de36 + #x21212108 + #x14000b1e + #xf1031e29 + #x13eed7da + #xfb09141d + #xa0b5d7ee + #x7442f3b5 + #xcab5ef4d + #x41e3209 + #x909130b + #xf4000e11 + #xef6e1df + #x40c1316 + #xa5c4f103 + #x5f30efb8 + #xbcc1064f + #xfc2e38f9 + #x90e03f1 + #xf4fe0003 + #xefbe4de + #x80b1313 + #xa8d6080e + #x4b26f1ba + #xb7d41447 + #x33d35e6 + #xb0befdf + #xf901fbfb + #xf3e1f211 + #x4141205 + #xde02fff2 + #x3302ccbc + #xdef21134 + #x3c38fdd6 + #xfadee10a + #x22fff202 + #xe8ea0524 + #x40f02f2 + #xedf7eaeb + #x1ff3d6d6 + #xe1eb0a2b + #x3c340ae8 + #xeddef51e + #x2202f8fd + #xe3f81a33 + #x2eade + #xf5e5d6e5 + #x4eaeef8 + #xe1e80519 + #x413b1af3 + #xe0e50d31 + #x2104faf5 + #xe8052636 + #xeeead8d6 + #xeed6cedd + #xedf00c0c + #xdeed0402 + #x534d1fed + #xddf01c40 + #x1c05f8ea + #xeb0f2b38 + #xd8d9ced3 + #xe8d1c6c7 + #xeb021a0c + #xe3f5faf0 + #x6f5615e3 + #xdef32253 + #x1c05f3e5 + #xee152f39 + #xc9d3c7ce + #xe3c9b2b1 + #xf70a1705 + #xedf8f3f0 + #x7f5204e0 + #xdbf22e6d + #x1204f2e5 + #xf71c2b2e + #xc7c7b9cc + #xdbb79faa + #x2050d00 + #xeef8faff + #x7f46fbe3 + #xd4f23e7f + #x204fae5 + #x2191c19 + #xc1b1add4 + #xc4a7a2b6 + #x4ff04f0 + #xf0020c0d + #x7f40fbe3 + #xcefa507f + #xfd0c02e1 + #x80c0c0c + #xad98ade6 + #xadafbec1 + #x5faf0d0 + #xf8121a14 + #x794000e6 + #xd007567f + #x51507de + #xfb050d + #x9793bcf2 + #xadd3ddba + #xaf0ccaa + #x51c1f1a + #x724108f0 + #xd90d5079 + #x111504e0 + #xf3f70811 + #x909fc6eb + #xcbf8e6ac + #xad1a29c + #xd1e2727 + #x68411200 + #xe60c4168 + #xf0f02e8 + #xf0fb0a0c + #x9aa9bfdd + #xeb08dea5 + #xf8a786a9 + #xd213934 + #x60451e08 + #xf007345b + #x20805f7 + #xf80200fa + #xa9a0add8 + #xf802ddb6 + #xd68688c1 + #xc314e31 + #x5f4b2205 + #xf8052b50 + #xf3071104 + #x5faebe5 + #xa28ba9e6 + #xf002f0c9 + #xb9839acb + #x1a485217 + #x604b1c00 + #xfd05274d + #xee0d1e0f + #x2e1d4d9 + #x8b80b9fa + #xeb1408c9 + #xb493a0bf + #x33533efb + #x5b3e140c + #x20a2c4e + #xf8192715 + #xedc7c9e0 + #x808dd400 + #xfb310cad + #xc49c92b1 + #x454624f7 + #x462c1724 + #xc19364b + #xa212b19 + #xd1b7cef0 + #x80ade3f2 + #x1a3bf290 + #xd08d80bc + #x3c2f210a + #x2b242b38 + #x212c3836 + #x14222b22 + #xbeb7d8ff + #x98c6ded8 + #x2e26d08b + #xc38083de + #x2726331a + #x1a314038 + #x3e3b2917 + #xf1e2c38 + #xb9c1e102 + #xb6c9c9c3 + #x22ffbca0 + #xa780a5fd + #x1c36460f + #x1f464322 + #x56390dfd + #xfd173853 + #xbecbe5f7 + #xbfbab6ba + #xe3c4b9 + #x9a90d004 + #x2b4d3ced + #x2f482e14 + #x5b26f7fb + #xeb17496a + #xc9d6e5ea + #xb7aaafbf + #xe3ded3c4 + #xadc1e6ee + #x454d17d3 + #x34361c1f + #x5214f50c + #xe31e5f75 + #xd8dee5dd + #xaca5afc9 + #xd9e1d3ba + #xd8e3e5d8 + #x4b29eed4 + #x2422263e + #x43110014 + #xe6266872 + #xe8e8e1d4 + #xa7a7b4d4 + #xd9d9c3aa + #xfbf2ded3 + #x31f8e1f0 + #xf2b4b53 + #x40190705 + #xeb276367 + #xf8edddd0 + #xa9a9bae5 + #xd0c4b1a7 + #xdf7e5d8 + #x7dded0d + #xd496849 + #x4621fdf0 + #xea1f5660 + #x5eed4c7 + #xadadcbfa + #xb7b1afaf + #x1708f7d6 + #xe5dbfd1a + #x24676522 + #x4d1aeae6 + #xdd144e60 + #xfe8c7bc + #xb4bee50f + #xa0aab7b6 + #x2b2604c6 + #xdbe0fd1c + #x416a45ff + #x4107e0f7 + #xd80f4b5f + #x11debeb9 + #xc1d4fd1f + #x98b1bebc + #x493cfdb1 + #xdedbf326 + #x495224f3 + #x27f5eb12 + #xe00f454e + #xcd8bfc6 + #xd6ee0d22 + #x9cb6c1c6 + #x6840eba5 + #xd9c9f041 + #x36331af8 + #xdf50422 + #xee113634 + #x7d8c9d6 + #xedff1421 + #x9fb9ccd9 + #x6f31e0a5 + #xc7bc005b + #x1a2922f8 + #x2001217 + #xf20a1f1a + #x4e0d3de + #xfb05141c + #xa0c3e1f0 + #x6021dda9 + #xb6c31963 + #xd3329ea + #x40a0afd + #xf0000d0a + #x4e5d8e3 + #xff081519 + #xaad9fafd + #x4b17d9a9 + #xb7db2456 + #x17411fd3 + #x705f3ee + #xfaff0002 + #x2e5ddea + #xff0d1914 + #xb6ee0a00 + #x4012d6a7 + #xc3ed2448 + #x29460fc6 + #x7fae1eb + #xa02fafd + #xe8e90d2f + #x191e0ffc + #xf703f2fa + #x27e8bfcb + #xe6f92542 + #x4423f4e3 + #xf0dff727 + #x16f5f905 + #xe8f91b31 + #x1611faed + #xf7f0e6fc + #xde4dae6 + #xe3f5202f + #x402c06eb + #xe6e8082f + #xaf9fcfc + #xeb0b272d + #x8f7e1df + #xf0dedef7 + #xf4effe00 + #xe3f51612 + #x473b12ed + #xe1f71c39 + #x1fcfcef + #xf2172c2a + #xefdfd3dc + #xe4d5d8e6 + #xed051703 + #xe8fa05f7 + #x60470be6 + #xe403284c + #x300f4e3 + #xf720312c + #xdad3cbd8 + #xe3d2c6ce + #xf9141b00 + #xf2faf5ef + #x7744fce4 + #xe4063869 + #x3feeddf + #xfc273327 + #xd2c9c1d5 + #xdfc2aebd + #x51616fe + #xf7f7f2f9 + #x7f38f4e9 + #xdf084e7f + #xfafcedde + #x6272a14 + #xcbb6b5da + #xceaca2bd + #x60f12f9 + #xf7fc0106 + #x7c33f7eb + #xd812647f + #xf500f4da + #xa171705 + #xb5a0b5e9 + #xb5a5aebf + #x60a05de + #xfc0f1611 + #x7833faeb + #xd71c707f + #x10af7d3 + #x1030b03 + #x9a94c4f5 + #xaebfc6b6 + #xa01e4ba + #xa202217 + #x7536fcf0 + #xdc226c7f + #x1111f7d2 + #xf4f90b0b + #x8c9fd2f5 + #xc7e8d2a2 + #xae4b8a5 + #x16252a22 + #x703603fe + #xe620627f + #x170ff4d7 + #xef000f0b + #x93abd0e8 + #xeffecd98 + #xf7b698b3 + #x1728392d + #x69390f0a + #xef1b5575 + #xf0bf7e3 + #xf5060a00 + #xa0a7c1df + #x5fec6a2 + #xd28e94d0 + #x19384f2a + #x6640170a + #xf4164769 + #x10a00ef + #x101f7eb + #x9f94b6e9 + #x3fad5b6 + #xac80a5df + #x23515611 + #x6b471605 + #xf40f3d64 + #xfc110df9 + #x1ebe3de + #x8985c2fc + #xbefba + #x9d8eb0d8 + #x3d6044f0 + #x6b3e0d0b + #xf50f3d66 + #x31b1b00 + #xf0d0d5e1 + #x808cdc06 + #xd2af9a4 + #xa998a5cd + #x535828e3 + #x5a2d0f25 + #xfc194564 + #x14272203 + #xd3bdd5f2 + #x80a9effa + #x2c39e483 + #xb88e91d2 + #x513e1ef0 + #x3e252340 + #x112c4951 + #x202c220b + #xbcb8de00 + #x8cc6ebe1 + #x402ac280 + #xb1808fef + #x3b312d05 + #x2a313d44 + #x2d3b3b2f + #x1c282520 + #xb1bfe600 + #xacced8c7 + #x3905ac8e + #x9880ab0f + #x2a3d4401 + #x2c474431 + #x493b1e12 + #xb23313e + #xb6cbebf4 + #xbcc1c2bd + #x19e6b1ac + #x8583d317 + #x345642e4 + #x3e51341c + #x5328000b + #xfc23495d + #xbfd2e8e4 + #xb8aeb5bd + #xf9dec2bc + #x94b3ed03 + #x4e5d23c7 + #x49422222 + #x470ff519 + #xf92f646e + #xcbd5e3d7 + #xaba4b1c2 + #xe8e3cdb8 + #xbfdae9e6 + #x5a40fec7 + #x3b2d223e + #x38030023 + #x13d736c + #xd7daded3 + #xa4a4b5cd + #xe9e4c4ac + #xe8e8deda + #x440febe4 + #x22284056 + #x330b0819 + #xd447364 + #xe6e1dad3 + #xa4a4bcdc + #xe3d5b6a5 + #xfae8dcde + #x19eff506 + #x1b476251 + #x3b14fc00 + #xd426b5f + #xf4e3d5ce + #xa4a5c9ef + #xcebfaea9 + #x5f2e9dc + #xf4e90b17 + #x336e6b2f + #x420de8f2 + #x1396462 + #xfcdfcbc1 + #xa5b0df05 + #xb3b3b3ac + #x170ff5cb + #xe4f2121e + #x587c4e06 + #x39fad800 + #xf4316264 + #x1d7bfba + #xb0c7fa17 + #xa7b6b8b1 + #x3928f0b3 + #xe3f00b2c + #x66672af2 + #x22e8e11e + #xf42f5f58 + #xcebcc1 + #xc4e30f22 + #xa7bdbdba + #x5a2fdea2 + #xdedf0a47 + #x584716f2 + #xae9fe33 + #xfc2c513e + #xfacbc2d2 + #xdef71b23 + #xa9bdc4cd + #x6622cd9f + #xcbce1b66 + #x39341bf2 + #xfefc162d + #xfe233b22 + #xf7d0cbda + #xf0011e22 + #xa7c1d5e4 + #x5f14c9a0 + #xb6d23475 + #x283922e4 + #xb1416 + #xf716220f + #xf7d5d3de + #xfa08201e + #xabd3eff5 + #x4e0bc79f + #xb3e64470 + #x2c4519ce + #x80f0301 + #xf70b1106 + #xf5d7def0 + #x1112219 + #xbff000fc + #x4205c2a0 + #xc4fa405d + #x3d4501c2 + #x8feef03 + #x6050306 + #xf2d8eb08 + #x81c2314 + #xd70503fa + #x3d00bca7 + #xd703344f + #x493defc2 + #x3ede60d + #x1701fa03 + #xe5022128 + #x2a2007ed + #x2f6f215 + #xdd3c7e6 + #xe5073b41 + #x3a10f2e6 + #xeced0e3a + #xf1f402ff + #xef12231c + #x1c09f2e6 + #xf4e8f415 + #xf9e1e5f4 + #xe5072f25 + #x3f2100ea + #xecfb193a + #xe8f9fff4 + #xf9202712 + #x2eadee3 + #xe6def109 + #xf1fd06fb + #xec071904 + #x4e3306ea + #xec092744 + #xedfdf8e6 + #x272a15 + #xe6d7d5e1 + #xe1dae3ef + #xff1913f8 + #xf604fff1 + #x6334fbea + #xf112365c + #xfbffeddf + #x62c2f19 + #xd8ceccdf + #xe1cec9d7 + #xe2112f6 + #xfbf9f2f8 + #x6e2af4f1 + #xf1194e78 + #xfdf9e6de + #xe312c10 + #xd2c0c2e1 + #xd8b8b4ce + #x131c12f9 + #xf9f8f904 + #x6821f6f6 + #xec23677f + #xf9f6e6dc + #x172a1e00 + #xbeabc0ed + #xc2aab4cc + #xe1a10ec + #xfb060d0b + #x6523fbf4 + #xea317a7f + #xfbe8d5 + #x12171200 + #xa39fccf9 + #xb2b2c0bd + #xd13f9cc + #x9191a0e + #x6825fbf8 + #xed3a7f7f + #x1504e8d0 + #xff070d0b + #x8ea6dcf9 + #xc0d2c7a4 + #xefbd2b4 + #x1a272519 + #x6a27fb04 + #xf23a7c7f + #x2309e3d0 + #xf2041012 + #x8eb2deec + #xe8ecc093 + #xffceadbd + #x212d3425 + #x6728060e + #xf834737f + #x2007e3d7 + #xf4090e0b + #x9ab4d2e1 + #x6efb898 + #xd8a1a4da + #x233f4923 + #x632f0e10 + #xf92d657c + #x1506eae1 + #xff0902f9 + #x9da4c5e6 + #xbecbeaa + #xab8cb2f2 + #x2f595409 + #x6536120e + #xf9275975 + #xe09f8ea + #x4f9efed + #x8a93cbf8 + #x7f6d7af + #x9393c4f2 + #x476c46e3 + #x6a360b13 + #xf8205476 + #x151504f1 + #xf6dfe1ed + #x8095e104 + #x1215e69d + #x9aa1bde8 + #x606528ce + #x60280b2c + #xf8215776 + #x25230df2 + #xdcc9def9 + #x80adf6fd + #x312cda80 + #xab9cabea + #x624d17d5 + #x471e1c46 + #x62f5c6a + #x332c10f8 + #xbec0e507 + #x83c9f8e5 + #x4d23b880 + #xa882a406 + #x4d3a20ea + #x33283a50 + #x2041544b + #x332a1209 + #xb1c5ef09 + #xa4d7e6c9 + #x4d029d80 + #x8e80bb27 + #x384134ec + #x34424741 + #x3b42342c + #x27251e28 + #xb1ccf1fd + #xb9ced0b9 + #x2fdf9f9f + #x8083e133 + #x3b593bd3 + #x46503b28 + #x492d1320 + #x1a253649 + #xbbd3eced + #xb9bdbeb9 + #x9d5b6b8 + #x80aff920 + #x556725b6 + #x54472528 + #x4210022a + #x19335762 + #xc7d7e5e3 + #xadafb9be + #xf6dec7b9 + #xa8d5f8ff + #x685202b2 + #x4d332544 + #x31ff0638 + #x27476f63 + #xd0d8dee3 + #xa3aabbc7 + #xf4e5c5ad + #xd5e3e5ec + #x5927edd0 + #x342c3f60 + #x25ff0e2f + #x3659755b + #xd8d8dae5 + #x9faac0d0 + #xf2dcbba6 + #xede1dcea + #x2f02f8f6 + #x2741605e + #x28070613 + #x3a5c6f55 + #xe3dad7e3 + #x9da8c9df + #xe3c9b4a8 + #xf6e5e3ea + #x7fd0e0d + #x38676a3d + #x3104ef02 + #x31556a59 + #xecd8d0d8 + #x9caddaf1 + #xc9bbb4aa + #xf8ecda + #xf4061e15 + #x627f5513 + #x2df1de10 + #x234e6c5e + #xf1d3c5cc + #x9fbef202 + #xb9bbb8aa + #x1e10e6c0 + #xf2071c20 + #x7c7533fb + #x19dce12f + #x1e4d6e57 + #xf1c9c0cb + #xb2da0b12 + #xb6beb9af + #x421ad5ad + #xedfb1c3d + #x73541af6 + #xdaf947 + #x204b6341 + #xecc2c0d3 + #xccf21a19 + #xb6bebdbe + #x5712c2a4 + #xd8ec2d60 + #x553a13f1 + #xf6ef1747 + #x20424d25 + #xe6c4c7da + #xe5022319 + #xb2c0ccd8 + #x5402b9a4 + #xc0ec4975 + #x3f3817e1 + #xfd071e33 + #x15333310 + #xe5c7cedc + #xf10b2a17 + #xb2cee3ed + #x47fbb89f + #xb8fd5c76 + #x3f420ec9 + #x712101e + #xd211c07 + #xe5ccd8e6 + #xfb152d15 + #xc0e6f6f6 + #x3df8b29d + #xc2125e68 + #x4d3ff8b9 + #xd09ff1c + #x10130e06 + #xe5d7ed02 + #xb212a0e + #xdefdfdfd + #x34edadab + #xd717505b + #x502ce3c0 + #x7f8f827 + #x12070406 + #xe3e3021e + #x1c2c2506 + #xf809fb02 + #x2ce1aabe + #xe6124450 + #x4b19dcd0 + #xfdeaf831 + #x10fffd06 + #xf21a1c00 + #x2914f9e5 + #xf9eb0629 + #xf0cddcfa + #xea1e462b + #x290af2e0 + #xedfc1f39 + #xd9fa03f4 + #xfe2119f9 + #x14fcebe6 + #xeaea0a21 + #xf0eaf2f9 + #xef1c2d10 + #x3717f7e1 + #xf206233c + #xe6fefaeb + #xb2619fa + #xf5e3e0e8 + #xe1e6030b + #xfc0a05f2 + #xf9120bf7 + #x4923f9e8 + #xf9142e4b + #xfa00efe5 + #x10291f0a + #xe0d7d9ea + #xe1e0ebef + #x141e06f0 + #xfe01f5f7 + #x531cf5f4 + #xfc1c4362 + #x8fae5e5 + #x172e230b + #xd6cbd1eb + #xdecbd2de + #x1e1f08f4 + #xf9f5f405 + #x5014f9fa + #xfc285c75 + #x3f2e1e5 + #x1f2e1c03 + #xc8bbcaf2 + #xcdb7c8d7 + #x1a1e0df2 + #xf5fa030b + #x4b12fefa + #xfe35707d + #xefe1e1 + #x1e230f00 + #xafafd1fc + #xb9b6cbca + #x151e06de + #x10d0f0b + #x4d15fefa + #x1437c7f + #xbf5e0dc + #x10120a0b + #x99b2e0fe + #xbbc5cbb1 + #x150de6c5 + #x141e170f + #x5215fa03 + #x64b7f7f + #x19fad9d9 + #xfe0b0f1a + #x94c0e8f2 + #xd7d7be99 + #xbe8c5c5 + #x2129241a + #x55170010 + #x84d7f7f + #x1efad6d9 + #xf90b101c + #xa0c5dee5 + #xf7dbaf94 + #xebbbb6e0 + #x283a3a1c + #x521c0a15 + #x8487c7f + #x19f7d7de + #xb0a0f + #xa3b9d1e5 + #x3d7b1a3 + #xbea2c3fa + #x34534605 + #x55240d14 + #x53c6e78 + #x14f9e1e5 + #x501fa03 + #x97a8d1f2 + #x1e0c5ac + #x9da3d605 + #x49683cdc + #x5a260a1a + #x32667a + #x1703efea + #xfcebeb00 + #x80a5e3fe + #xafad79e + #x9bb2d9fc + #x64681ec0 + #x571c0a30 + #xfe2e687d + #x2410f5ea + #xe5d6e80a + #x80b7f5fa + #x2414cf82 + #xa8b1cafe + #x6b5206c0 + #x43141a4d + #x3396d73 + #x341af7ea + #xcacbed17 + #x85d1fae6 + #x4314b280 + #xac9bc014 + #x5a3a08d2 + #x301c375a + #x1746665a + #x3a1cf9f4 + #xb9cdf71e + #xa3e1edcb + #x49f59680 + #x9688d135 + #x433a1ed9 + #x2e34494d + #x32494d3e + #x34170110 + #xb7d4fa15 + #xbbded7b9 + #x34d69496 + #x8092f446 + #x3f5028c5 + #x3f484135 + #x4137292e + #x2b191c34 + #xbed9f406 + #xc0cdc5b4 + #x10c8a8af + #x80b40f39 + #x556219a8 + #x50442b2e + #x3c191437 + #x29263e4d + #xc5d9eafe + #xb6bebcb7 + #xfad2c1b9 + #x9bd90d19 + #x6b57f79e + #x4d2e2144 + #x29011243 + #x353f5a55 + #xcbd7e500 + #xacb7bcbe + #xf7e0cab4 + #xc3e5f700 + #x6630e1b4 + #x37233461 + #x1cfe1a3e + #x4657684e + #xd2d7e306 + #xa7b6c1c6 + #xf9dec1ad + #xdee0e6fa + #x430feadb + #x26345866 + #x1a051526 + #x50626648 + #xd9d6e106 + #xa3b4c8d2 + #xf0d1b9aa + #xe8dce6fa + #x1a0806f9 + #x34586849 + #x1e00fe10 + #x4e616248 + #xded4dcfe + #x9eb6d6e0 + #xdcc3b7a8 + #xf0e8edef + #x5121a05 + #x5875581f + #x19ebea19 + #x445c664d + #xe3cfd4f0 + #x9dc1e8ef + #xcac0b9a5 + #x5fce8d7 + #x31a1e0d + #x7c723503 + #x8d7ea3a + #x415c6b49 + #xe3c6caeb + #xa8d6fcfc + #xc3c1b7a3 + #x2406d7c1 + #x1121e24 + #x7c551afe + #xf4d10158 + #x445d6639 + #xe0bec8ed + #xbeed0f05 + #xc3c1b9af + #x3a00c5b7 + #xf0062e48 + #x643a12f9 + #xeae11c5d + #x4658521f + #xdbbccaf0 + #xd7001c08 + #xbec0c3c6 + #x3ff2b9b4 + #xd7054b64 + #x4b3010e8 + #xf0fc294d + #x3e48370d + #xd7becfef + #xe80f2406 + #xbbc8d7dc + #x37e8b4af + #xca15626b + #x463405cd + #x10f213a + #x30341f05 + #xd7c3d6f0 + #xf51a2905 + #xc1dcebea + #x30e6afa8 + #xd2286964 + #x4e34efb9 + #xd0d1234 + #x2b210f05 + #xd7cbe500 + #x3262901 + #xd7f2f5f2 + #x29e0a7ad + #xe332625a + #x5323dbbb + #xb010a3c + #x24120506 + #xdbe3fc10 + #x172e21f9 + #xf0faf900 + #x1cd2aac5 + #xed2b5750 + #x480bd7cb + #x1f50f44 + #xf050005 + #xe0fa1019 + #x292e17f0 + #x1fcfa10 + #xfc5b2e0 + #xef215049 + #x37fcdcdc + #xf7ef1244 + #xf5f90003 + #xa2208e0 + #x1f05ebe7 + #xe7f01b2e + #xe0d8f0fa + #xfc373e0d + #x200ae9d6 + #xf0082931 + #xe7fefcf0 + #x12200aeb + #x6f2e6ee + #xe2f5181d + #xf3f5f7f0 + #x1291d00 + #x310febdd + #xf90f2e3e + #x100f3ed + #x1b220f00 + #xebe2e0f5 + #xe2f30800 + #xc0ffce9 + #x611fcf9 + #x3e11eeed + #x11b3c52 + #x12fce7eb + #x1f27190f + #xdbd6daf7 + #xe4e4ede7 + #x1f18feed + #xfef9f206 + #x3c0cfafc + #x5255263 + #xdeee0ee + #x272c180c + #xcec7d1fa + #xd4ccdadb + #x221906f2 + #xf5f3fe12 + #x370d03fe + #x837676a + #xfce6e0ee + #x2b270d01 + #xb7b7d303 + #xc0c0d6cf + #x201d0ae4 + #xf9010a14 + #x381103fa + #xd46756e + #xf7e7dfe9 + #x1f180505 + #xa1b5df06 + #xb7c7d4b9 + #x2019f7ce + #xc140f12 + #x3e0dfc00 + #x12547f73 + #xfeebdae4 + #xc0c0816 + #x9ac3e7fc + #xc8cfc19c + #x1bfed6c7 + #x1f221819 + #x3f0afc0d + #x185e7f7a + #x5ebd1e0 + #xc1120 + #xa2cee2eb + #xe4cfa990 + #xfed3c5d8 + #x2931291b + #x3e0d0618 + #x18627f7a + #x6e6cee0 + #x10d121d + #xabc7d3e6 + #xf3c8a298 + #xcfb4cff9 + #x354a3808 + #x41180f19 + #x165b7f75 + #x3e4d1e4 + #x5060612 + #xa1b5cfee + #xf5ccb2a2 + #xa8b2e40a + #x4f6231dd + #x481d0d20 + #x114f7a75 + #x5ebdbe7 + #xf5f90f + #x8cafdbfa + #xf9e0c39a + #x9dbeee08 + #x6a6712b9 + #x48140c37 + #xa487a7a + #xff9e4e6 + #xebdff216 + #x80bbf0fa + #x11fcc380 + #xa8c1e406 + #x7852f3af + #x3a0c1956 + #xa4d7f78 + #x1f03e6e4 + #xd1d1f524 + #x87d3f7e9 + #x3101a880 + #xabb0db19 + #x6a37ebbb + #x29123869 + #x18597c63 + #x2b06e4e9 + #xbed1002e + #xa4e6eece + #x3feb8a80 + #x9a9de73c + #x502efcc5 + #x252c5060 + #x305d6346 + #x2b03e9fe + #xb9d8062c + #xbee7d6b9 + #x2ec88287 + #x809f0a54 + #x46410db7 + #x37464f46 + #x414a4137 + #x22030120 + #xbedd011f + #xc7d8c1af + #xdb795a2 + #x80be274d + #x5956059a + #x4b46373a + #x3e29273c + #x1d12253f + #xc3ddf714 + #xbec7b7b0 + #xf3c0b0b2 + #x90e0292e + #x7154e68a + #x5033274b + #x290d224b + #x242e484a + #xc7d8ee16 + #xb2bcb5b5 + #xf0d1c0af + #xb9ee1111 + #x7533ce9d + #x3c203169 + #x14052b4a + #x374b5b43 + #xc8d3ed1f + #xabb7b9bc + #xf7dabea9 + #xd4e7fa08 + #x5712d1c1 + #x252b5071 + #xd082731 + #x4a5e5e3a + #xccd1f024 + #xa9b5bec5 + #xf5d3b9a8 + #xdbddf308 + #x2e08eee2 + #x2b4b6959 + #x11051119 + #x52635e3a + #xd1cfee20 + #xa4b7c7cf + #xe6c7b5a8 + #xdfe0f700 + #x16160af0 + #x4f6f6030 + #xcf2f91d + #x5262623e + #xd4cae716 + #xa1bed6db + #xd3c1b49f + #xeef0f3e9 + #x142416f9 + #x76733f11 + #xf9d8f53e + #x5265673a + #xd4c1dd0f + #xa4cfe9e7 + #xcac1b098 + #x8f9e0d3 + #x1624190d + #x7f5b1f06 + #xe0ce0c63 + #x576a6529 + #xd3b9d611 + #xb5e4faf2 + #xc7c0ad9c + #x20f0cac5 + #xa192930 + #x6f3c1103 + #xd6db2b71 + #x5e675412 + #xccb4d614 + #xccfa0cf5 + #xc1bcb2af + #x27e0bec0 + #xf2184450 + #x572e0df3 + #xdff73a65 + #x59573a01 + #xcab4da12 + #xe20c19f7 + #xbcc0c3c7 + #x22d8b9bb + #xe027625e + #x4b3003d6 + #xf20d374f + #x4d4122fc + #xc8b9dd0d + #xf21d20f5 + #xc0d1d8d8 + #x1bd4b2b2 + #xe43e6f5d + #x4f2ce9be + #x3122b48 + #x432c1100 + #xc8c1e412 + #x12b22f2 + #xcfe7e7e2 + #x18cea6b0 + #xf74b6e56 + #x5219cfb9 + #xa0a224d + #x371b0503 + #xccd3f319 + #x16351de9 + #xe6f3edf0 + #xfc1a2c0 + #x34a6550 + #x4801c7c7 + #x6012556 + #x200afe06 + #xdaf20611 + #x27310fe4 + #xf5f3f70c + #xfeb7b4df + #x13f5e46 + #x31f5d1d4 + #xfafe2c50 + #xfefe01 + #xeb0d1201 + #x332701e0 + #xf9f20524 + #xedb5ccf7 + #xfa375938 + #x20f2ddda + #xf0fe2c44 + #xe7f701fc + #x1c13f8e6 + #xef4e5f9 + #xe5072723 + #xdeeaf6ea + #x194125f2 + #x1e02dcde + #xf8172f2d + #x9fff6ef + #x1e1300fb + #xfbece500 + #xec09170d + #xf8fbf4e5 + #x172309f8 + #x2702e3ec + #xff19383b + #x15fbedf1 + #x20190d12 + #xe8dfe304 + #xed0000f1 + #x1309f4e6 + #xb02f606 + #x2a02eff9 + #x723474d + #x10f1e6f4 + #x25211312 + #xdad2dc07 + #xe3e8eae1 + #x1c0bfbec + #xf8f1fd17 + #x2707ffff + #xe335b54 + #xf6e3e5f8 + #x2c230b02 + #xc5c0da0e + #xccd5e1d7 + #x1c1204e6 + #xf4f8091c + #x270e04f8 + #x13446855 + #xe3dfe5f6 + #x2a1900f8 + #xafb9e313 + #xbdd2dac2 + #x2119fdd3 + #x70d1a + #x2c0efdf8 + #x19547359 + #xe3e3e1f1 + #x170b0002 + #xa3c2ec0d + #xc4d3c7a6 + #x230be5c4 + #x13130e1e + #x2d07fb04 + #x21657f62 + #xece5d8ea + #x6060b10 + #xaacee6fb + #xd5ceab93 + #x10e8d0cc + #x23211c20 + #x2a070415 + #x276f7f65 + #xeddccee8 + #xff091213 + #xb4ccd7ec + #xe1c09a97 + #xe5c9d3e8 + #x33382c10 + #x2a0d0e20 + #x286f7f63 + #xe8d3cbe8 + #x209100e + #xb1beceed + #xdfbba19f + #xb9c2edfd + #x49522aea + #x33131027 + #x27677f65 + #xe5d5d0ec + #xfd060b + #x9db4d5f8 + #xe3cbb19a + #xaacefd02 + #x67590dbe + #x360e0e3b + #x1e5e7f6a + #xecdfd8ea + #xf1ecfd10 + #x8cbbe8fb + #xf9e3b283 + #xafd5f902 + #x7a47e6ab + #x2d071c5b + #x1a627f6a + #xf9ead8e5 + #xd8dcff1e + #x91d2f2ed + #x1af19d80 + #xb4c7ef13 + #x712ad5b2 + #x1c0d3b75 + #x216e7f5c + #x9efd5e3 + #xc4d8092c + #xa8e6edd5 + #x2dde8080 + #xa4b4f934 + #x591cdfb9 + #x1a285771 + #x36737344 + #xdecd7f4 + #xbddf122d + #xc4ead7bd + #x23bb8080 + #x89b41c54 + #x4928efaf + #x2c445c59 + #x47625231 + #x4eaea13 + #xc0e81023 + #xd0dcc0b1 + #x2a6809c + #x80d03f54 + #x553fed93 + #x444d4647 + #x46413334 + #xf8f80e33 + #xc5e80617 + #xcbcbb2af + #xe6ab9daf + #x91f24438 + #x6e42d382 + #x4d3a2f50 + #x31212d44 + #xfd15333f + #xc7dff913 + #xbebdadb2 + #xdfbeb1b2 + #xb6042f17 + #x7628b88c + #x3d25346a + #x1715364b + #x133a4d3a + #xc2d3f61a + #xb6b6afb6 + #xeaccb4ab + #xd3fb1209 + #x6009b9af + #x2527527a + #x915363a + #x3152522c + #xbeccf927 + #xb1b2b2b9 + #xefccafa8 + #xdaea0609 + #x3dffd5d0 + #x21426a68 + #x610211e + #x465c5225 + #xc0ccff2c + #xadb2b8c0 + #xe6c5afa6 + #xd7e80607 + #x250bf4e1 + #x3f636744 + #x2fb0419 + #x4e605427 + #xc4ccfd2a + #xaab9c5cc + #xd8c4b1a1 + #xdcf104f6 + #x211e04e5 + #x686f4725 + #xf1e1fd38 + #x55635b27 + #xc7c7f628 + #xaac5d5d7 + #xcec4ab98 + #xf1f6f2df + #x272509f4 + #x7f5c2719 + #xd8d31260 + #x5c6c5b17 + #xc4beef2a + #xb2d7e6df + #xccc2a395 + #x7eddcd2 + #x23211713 + #x733f1515 + #xc9df3376 + #x656e4dff + #xbeb4ec2d + #xc5ecf6e5 + #xc7b9a19f + #x10dccbcb + #x10213436 + #x5b2d1007 + #xccfb4971 + #x656233ed + #xb9b1ea2d + #xdaff06e6 + #xc2bbadb4 + #xbd0c4c4 + #xfd2f5449 + #x4d2a02ea + #xe112495c + #x5b491cea + #xb6b2ed2a + #xef130ee5 + #xc0c7c2c9 + #x2cbbbbb + #xff46684d + #x4b25eace + #xf6193f52 + #x49330df1 + #xb8bbf128 + #x22512e1 + #xcbdad3d7 + #xc5b1b6 + #xe596e47 + #x4d12ccc5 + #x2153654 + #x3a2004fb + #xbbc9fb2a + #x19310eda + #xdee8dae6 + #xfdb9a8be + #x1c5c6a47 + #x41f8bdce + #x4103b5b + #x250dff02 + #xc7df0421 + #x2c3104d5 + #xedece6fd + #xefadb1d7 + #x1e556541 + #x2ce6c0da + #xff104255 + #x6fbfd04 + #xe3fb0707 + #x3323f8da + #xf1effd1c + #xdaafcbed + #x17505c2d + #x19ead0de + #xf8124246 + #xf2f6ffff + #xff1006ec + #x3113ede3 + #xedf2132f + #xcebde5f9 + #x124d5219 + #x10f2dad8 + #xf2123d34 + #xeff902f8 + #x1d05f903 + #x8f0f00f + #xf9242b1b + #xe9f7f0e0 + #x32360cec + #x1bf2d7fc + #x8263630 + #x14fef3f5 + #x1b0a0613 + #xf9ebf213 + #x11b1605 + #xfaece5 + #x21160501 + #x1bf5e705 + #xc293e39 + #x8f5f2fa + #x1f161116 + #xe7def014 + #xfc06fcf0 + #x1300f0ec + #x6fa061a + #x1bfef906 + #x13344c40 + #xf0e7f001 + #x281f0d01 + #xd6cfee1a + #xe5eeece4 + #x1606fceb + #xf3f91324 + #x1f0c01fa + #x1a445a42 + #xd6e2f203 + #x2d1a01ec + #xbfc4f221 + #xd0e2e5d2 + #x1b13fedb + #xf9051622 + #x2811fef3 + #x21536347 + #xd2e5f000 + #x210dfcec + #xafc6f921 + #xcde0d4b8 + #x2614eec8 + #x80d1424 + #x290df9fc + #x29636e4c + #xdee7e9fa + #xf0603f9 + #xb1d0f713 + #xd7d9b8a1 + #x2100dbc9 + #x18141a29 + #x2408010f + #x36757c53 + #xe9e0dbf5 + #x60a0d03 + #xbad0e700 + #xddc6a19e + #xfee0d9db + #x29262821 + #x1f0c1122 + #x407d7f53 + #xe2d2d2f9 + #x50d1101 + #xbbc6d9f7 + #xd7b69ea6 + #xd2d4ecf0 + #x44422bfe + #x26131830 + #x427c7d55 + #xd7cbd0fa + #x30a0afa + #xafbad9fa + #xd4bdaaa6 + #xbbe003f7 + #x63500fcf + #x2b0f1844 + #x3d757d5a + #xd4d0d4f9 + #xf9fc03fc + #x9ebde7fe + #xe5d2ad95 + #xbdec06f9 + #x763ee5b4 + #x260a2461 + #x34767f5e + #xe0dbd6f2 + #xe5f00608 + #x9cd0f3f5 + #x5e09c80 + #xc6e70108 + #x731dcbb3 + #x160d427c + #x397f7f52 + #xf0ded0ee + #xd2eb111a + #xafe4f0e0 + #x1dd28080 + #xbbd60629 + #x5a08cfbb + #x1126637f + #x4b7f7c3d + #xf5dbcdf7 + #xc8f01a21 + #xcbecdec6 + #x18b38083 + #xa1d22649 + #x490dddb3 + #x21476e6f + #x5c7d5e2b + #xecd6db11 + #xc8f91a18 + #xdbe2c6b6 + #xfc9a80a1 + #x91e94b52 + #x4e22dd97 + #x3e575c5a + #x5c5e3e2f + #xdbe0fa30 + #xcdfa0f05 + #xd9cdb4b3 + #xde9a91b8 + #x9e0c5a3b + #x632bc280 + #x4e494259 + #x453b3440 + #xdbfe223e + #xcff203fe + #xcbbdadb6 + #xd4ada8bd + #xc121491b + #x6f18a885 + #x44303e6e + #x28293d4c + #xf5243e37 + #xc8e40006 + #xc1b4afba + #xddbfafb8 + #xde1d2d08 + #x61faa3a3 + #x2b2b577f + #x14284240 + #x1f454728 + #xc1d9061b + #xbab1b1ba + #xe9c6adb3 + #xe4081808 + #x42eebdc6 + #x2144757c + #xd243026 + #x4255471d + #xbfd90f2b + #xb4afb4bd + #xe7c4acad + #xdbfa1408 + #x2bfae0d6 + #x3763765c + #x80f141b + #x555c471b + #xbdd91334 + #xafb1bbc1 + #xddc2aca8 + #xd9fc1300 + #x2913f5d9 + #x60715a3d + #xf7f20632 + #x5e634b18 + #xbfd70f36 + #xadbbc8c8 + #xd6c4aca1 + #xe70106ee + #x341ffae2 + #x7a60362f + #xdde0165c + #x676e4b08 + #xbdd00a3b + #xb4cbd7d0 + #xd4c2a39c + #xf9faf2de + #x341d03fa + #x7644222d + #xc8e93978 + #x73713ef0 + #xb8c60842 + #xc4dee5d4 + #xd0ba9aa1 + #x1e7ded7 + #x28211f1a + #x5e301d22 + #xc805557a + #x756726db + #xb1c10845 + #xd6f2f3d6 + #xc8b49faf + #xfcd9d4d0 + #x1a304430 + #x4e2d130a + #xdb1d5a68 + #x685011d7 + #xadbf0840 + #xeb05fed6 + #xc4bdb3c2 + #xf3d0cbc8 + #x184b5e37 + #x4b26f9ee + #xf329525a + #x533906e2 + #xacc40639 + #x11a03d2 + #xcbcfc4d6 + #xf2c9bdbf + #x26616837 + #x4911d7e0 + #x3284959 + #x3d2401f0 + #xadcb0a36 + #x1a2803cd + #xdbddd0e7 + #xeebbb1c2 + #x376a6837 + #x3df3c1e7 + #x8264c5c + #x2613fefa + #xb8dd112d + #x2f2bfcc9 + #xe9e2d900 + #xe2acb3d4 + #x3d686836 + #x26dec1f2 + #x8285357 + #xa01fe01 + #xcff21116 + #x3922f0cd + #xf0e7f01b + #xcfaac6e7 + #x36656528 + #xfdbcbf3 + #x62b5345 + #xf0f50103 + #xf20306fa + #x3411e9e2 + #xeef70d2f + #xc6bfe2f0 + #x3260530d + #xae5d4f0 + #x52d4932 + #xf0f70100 + #xf0afaeb + #x2803e9f7 + #xee062634 + #xc8d9f5f0 + #x325a3ef7 + #xdf2d6ec + #x32b3e28 + #xfe0001f9 + #x7f6f909 + #xf8ebfd14 + #xd271e0d + #xf1eddbe1 + #x3015f6ed + #x6d8db15 + #x12272c29 + #xf9f2ebf4 + #xb020207 + #xede4fb12 + #xb150bfd + #xfbeddfeb + #x14020204 + #x6e6ed10 + #x142e3729 + #xe2eaedfb + #x140e04f4 + #xdad6f915 + #xf9fbf4eb + #x6f2eaef + #xf4f81019 + #xefbfbff + #x1739412c + #xcce1f200 + #x1d10f6d8 + #xc5ccf91d + #xe1e8e8da + #xd02f1e1 + #xebff191b + #x1b07f6eb + #x1d454a30 + #xc8e4f4ff + #x1b04ebd1 + #xb1c80022 + #xd6e4dac1 + #x1b0de8cc + #xf607151d + #x2206efeb + #x2753533a + #xdae8effb + #xefbeddf + #xaed10419 + #xd8dbc1aa + #x2204d6c3 + #x6091724 + #x1dfff4ff + #x35635e40 + #xebe4e1f9 + #x2fffbef + #xb5d4f807 + #xdac6a5a1 + #xeebd1cf + #x12102225 + #x12ff0614 + #x4773663e + #xe8d4d3ff + #x702ef + #xb8cae4f9 + #xcfaf9aa7 + #xe8dddfdf + #x2727270d + #x12061224 + #x557b683c + #xd4c5cd06 + #x20bffe4 + #xafbadbf6 + #xc3aaa1aa + #xcae1f2e2 + #x483a10df + #x19091739 + #x537a6c40 + #xc6c1cf09 + #xfb02f6df + #x9eb7e2f8 + #xccbaa89e + #xcaf2fbe2 + #x6332e4bc + #x15062458 + #x4a7a7345 + #xcac6cf02 + #xebf6f8e8 + #x9ac6edf1 + #xe8c89a87 + #xd3f6fbf1 + #x630ec3b5 + #x9094178 + #x4a7f783e + #xdacccaf9 + #xdaf204fb + #xa8daeddd + #x2bf8080 + #xcfeb0210 + #x4cf2beba + #x422667f + #x587f6f2b + #xe2c6c1fd + #xcdf91007 + #xc1e4dbc6 + #x4a38084 + #xb7e41e33 + #x35efcab5 + #x12457673 + #x6a7f571b + #xd8bec610 + #xcd0414fd + #xd3dbc3b5 + #xeb87809e + #xa5f84543 + #x3502ca9a + #x325a6a5c + #x6c6a391b + #xc1c1e22e + #xd30607e6 + #xd4c6afaf + #xcc8082b7 + #xae1d5c33 + #x4a0db580 + #x48515158 + #x57472c30 + #xbcdb0940 + #xd4fbf9d8 + #xcab5a7b1 + #xbe909cc1 + #xcc375112 + #x5aff9580 + #x41394768 + #x35303341 + #xda04293a + #xcfebf4e4 + #xbeaaa7b3 + #xc5a7a8be + #xea3535fb + #x4ee28c97 + #x292c587b + #x1e2b3c3c + #xe2b3527 + #xc3dffd02 + #xb5a7a8b1 + #xd3b3aab7 + #xf2221ef8 + #x33d1a1b8 + #x1b3e747b + #x15293224 + #x3e413317 + #xbcdd0b20 + #xafa7a8af + #xd8b5a8b1 + #xe80e17fd + #x1edbc3ca + #x2b5e7f65 + #x10171414 + #x584a3012 + #xbae21532 + #xa8a7aeaf + #xd3b7acac + #xdd0915f9 + #x1df6dacc + #x506c6647 + #xfffb0424 + #x6353330e + #xbae4173a + #xa5acb7b3 + #xcfbaa8a5 + #xe2070bed + #x2907e1cd + #x6c5f4339 + #xe1e6104a + #x6c5e32fd + #xb8df1743 + #xa8b8c1b7 + #xcfb8a19e + #xf202f8e1 + #x300de8df + #x6c432c39 + #xc8ea326c + #x7a6324e1 + #xb3d81b4e + #xb5c8cdbc + #xcdaf97a0 + #xf8f2e6da + #x2b10fffb + #x572e2735 + #xc3045173 + #x7f5a0dc6 + #xaad11d55 + #xc5dadaba + #xc5a595aa + #xf1e2dbd4 + #x2020200e + #x45272024 + #xd41e5e68 + #x7645f4c1 + #xa3cf1b4e + #xd8ede2b8 + #xbca7a1b8 + #xe6d6d3ca + #x203c4015 + #x41220909 + #xed2e585c + #x5c2eeaca + #xa0cf1540 + #xef00e8b5 + #xbfb5b3cc + #xe2cfc5c1 + #x2e575017 + #x400de6f9 + #xff325157 + #x401deadb + #xa1d41433 + #x910ebb1 + #xccc6c1e1 + #xe1bfb5be + #x4065551b + #x32edccf9 + #x7325158 + #x290eebe8 + #xa7dd1729 + #x2217e6af + #xdacdcdfb + #xd4aeafca + #x486a581b + #x17d1c604 + #xb335751 + #xeffeff2 + #xb8ed1514 + #x3014ddb3 + #xe1d3e115 + #xc1a7bedb + #x476a5810 + #xffc8cd09 + #xe39553e + #xf1f1f4f9 + #xd6fb09f8 + #x2c04d6c5 + #xe2e1fd2b + #xb3b3d3e4 + #x43684ef8 + #xf4cdd304 + #x103a4829 + #xe1edf9fd + #xf4fff8ea + #x1df6dde4 + #xeafd1b2c + #xbacfe2e2 + #x435c30e2 + #xfbd6d102 + #x1035371e + #xe8f4f9f9 + #x6fbedeb + #xeefeafd + #xf2192c27 + #xcce6e8df + #x454c15d6 + #x4dacf07 + #x10302c1d + #xf8fdf6f2 + #xfdf9fdfb + #xedf1090e + #x1b1d1202 + #xf4dfd6f8 + #x1e00f4f6 + #xedd3f625 + #x1b252719 + #xe4eaebff + #x604fbea + #xe2ea070e + #xd0902f8 + #xf6e2e1fb + #x2ff0704 + #xf9e8fd0e + #x192c2e1b + #xd4e6f100 + #x1209f1d1 + #xcfdf0715 + #xf8f2f2e4 + #xfdf1ebf4 + #xed02170e + #xbfffdf2 + #x1b373522 + #xcfeaf602 + #x1700e1c5 + #xbcdb0b1d + #xe4e8e2cc + #xd02e8dd + #xf10b1910 + #x1902efe6 + #x24413e2e + #xe2eff4ff + #xef4ddd3 + #xb3df101d + #xe1e1cdb3 + #x1d02d8cd + #xfb0b171d + #x19f9ebf1 + #x32514a37 + #xf8edeaff + #x2f2eaea + #xb5e20b0e + #xe1cfb3a5 + #x19f1ccd1 + #x40d2027 + #xef6fb06 + #x47615335 + #xf8dfda06 + #xfdfdf4ef + #xbadbf8ff + #xd4b7a3a8 + #xffe1d4db + #x121b291d + #x9000d15 + #x586d552c + #xe1cad312 + #x6f2e2 + #xb3cae8f6 + #xc1a8a7af + #xe6e6e4dd + #x2e2e1df9 + #xe071929 + #x6173572c + #xc6bed41e + #x204ebd4 + #xa5bfe4f4 + #xbeafafaa + #xdff4efd6 + #x4c2bf4d4 + #xe072548 + #x5e765e32 + #xbfbed81b + #xf8f9e8d6 + #x9cc6eaf1 + #xd1bca795 + #xe6fdefdb + #x530bcac1 + #x40b416c + #x5c7f662e + #xccbfd112 + #xeaf6f2e8 + #xa5d6eae2 + #xeab78c85 + #xe4f8f6f8 + #x40e8bcc3 + #xfd24687d + #x687f5f1e + #xd6bcc610 + #xddfd02f6 + #xbae1ddcd + #xef9c808b + #xd4f4101d + #x24dbc1c1 + #xb487f73 + #x7a7f4a0d + #xccb1c822 + #xdb0907ef + #xcddac5ba + #xda8080a0 + #xc1023930 + #x1be8c3aa + #x2c657b5a + #x7f6d300e + #xb5afdb3c + #xe110ffd6 + #xd3c8b1b1 + #xba8082ba + #xc5295525 + #x2cf6ae8e + #x48616150 + #x6c4c2425 + #xaac1ff4c + #xe607efc5 + #xc8b5a7b5 + #xa8809ac6 + #xe1475307 + #x40ed9085 + #x4a4a555f + #x4a332c3c + #xc6ea204a + #xe1f4e6cf + #xbaa8a5b8 + #xac93acc3 + #x24e39ef + #x3ccf809a + #x32396174 + #x2e2c393e + #x122e35 + #xd3e6eff4 + #xafa3a5b5 + #xbca5afbc + #xd3a20ea + #x20ba90ba + #x1e417878 + #x222c3329 + #x372e2b20 + #xc6e4021e + #xa8a3a5ae + #xc5aaafb5 + #x22415f1 + #x9bfafcd + #x255e7f65 + #x1d201b14 + #x55392217 + #xbfea1239 + #xa5a3a5a7 + #xc6aeb1b1 + #xf21915f4 + #x9dac8cd + #x4873784c + #xd06061b + #x5e402212 + #xbfef1d43 + #xa3a5a7a5 + #xc6b3b3ae + #xf21710ed + #x19f2cdcc + #x656a583e + #xeded0b3c + #x664c2200 + #xbfef2250 + #xa3aeafa8 + #xcab5aca7 + #xfb1000e2 + #x25f9d3d4 + #x684e3e3c + #xcfed2b5f + #x765315e2 + #xbceb2961 + #xaababaac + #xcaaea1a3 + #xff00efdd + #x25fde2ea + #x53353940 + #xc6064e6c + #x7f4af9c3 + #xb3e6306c + #xb8cac3ac + #xc3a19aa8 + #xf8f1e4da + #x200b02fb + #x402c3535 + #xd6225e63 + #x7b33ddb7 + #xaae63268 + #xc8dacca7 + #xb79ca0b3 + #xebe4ddd3 + #x24271e00 + #x3a272524 + #xed325c58 + #x651dd1bf + #xa5e62c55 + #xddedd1a1 + #xb3a3acc3 + #xe4dbd1c6 + #x32473000 + #x3a150414 + #x375757 + #x470dd3cf + #xa5e62440 + #xf8fdd39e + #xbcb1bad8 + #xe1cdbfc1 + #x455a3a02 + #x2cf4e812 + #xb395755 + #x3204d8df + #xa8ea1e30 + #x1206cf9a + #xcabcc8f4 + #xd6b8b5c6 + #x51634106 + #x10d4dd1b + #x143e584e + #x1ef9dfeb + #xb5f41d1b + #x2406c89c + #xd3c3db10 + #xbfacbcd6 + #x556847fd + #xf4c5df20 + #x1b43573a + #x2efe6f8 + #xca000efd + #x25fbc3aa + #xd6d1f827 + #xaeafcde1 + #x536d43ea + #xe4c5e21d + #x22454824 + #xe8ebf100 + #xe404fbe2 + #x19edcac5 + #xdbea152e + #xafc5dbdf + #x57682ed3 + #xe6cadf1b + #x25413715 + #xe1f1f804 + #xf6fdefe1 + #x6e8dfe8 + #xef0b2524 + #xc6dadbdf + #x55500ecd + #xedc8dd20 + #x24372914 + #xebf9f600 + #xfdf6ebef + #xf9eaf6ff + #x4222917 + #xdfe4d8e1 + #x4c33f6d3 + #xefc5df27 + #x202e2215 + #xf8fbeff9 + #xfffff9e9 + #xe9f90b04 + #x1d0f06f6 + #xe6cee00f + #x8fbfbf7 + #xdde20d1b + #x1d222204 + #xe2e4f40f + #x900edd6 + #xdff4090b + #x9fffbe9 + #xe9ddeb06 + #xf90408fb + #xf2f404ff + #x1b28240f + #xe0ebf90b + #x10f9dbc7 + #xcdef0d14 + #xf4f0ebd2 + #xf6f0eff6 + #xf40f1200 + #x9fdf2e6 + #x1f312d1f + #xeff4f904 + #xbebd4d6 + #xbeef1419 + #xe9e9d7b9 + #xdf9e0e0 + #xfd12120d + #x10f4e6e9 + #x2b3d392d + #x4f6ef02 + #xffe4ddef + #xbdf21412 + #xe6d9bda7 + #x18edd0d9 + #x2101b20 + #x8ededf9 + #x3f4f462f + #x6e7e008 + #xf7ebe9f9 + #xc0ef0802 + #xdbc0a9a5 + #x9ddcedf + #x6162824 + #xf60206 + #x545d4a24 + #xe9d0d919 + #xfbf9ebe9 + #xbde0f4f7 + #xc6aba7ad + #xf2dddbdd + #x1928260d + #x4061216 + #x6164461b + #xc4bedf2b + #xfbe2d2 + #xaecee7f4 + #xb7abada9 + #xedefe4d2 + #x382b08ed + #x80f2634 + #x6468481f + #xb0b9e632 + #xfff6d9c9 + #xa2c9e6f2 + #xbeb4ab9b + #xf6fde4cd + #x440fddd9 + #x214415a + #x64714f1f + #xb5b9e42b + #xf4f0dfd7 + #xa4d4e6e9 + #xd4b4978b + #xf9fbe6e0 + #x34e6c4d7 + #xfb266871 + #x6f7d5112 + #xc0b5d728 + #xe9f6ede6 + #xb5dddbd7 + #xdb9d8089 + #xebf60004 + #x16d2c2d4 + #x84b7f6b + #x7f7f3f02 + #xb7a9d234 + #xe704f7e0 + #xc9d7c7c6 + #xcb80809b + #xdb04281b + #x6d6c4c0 + #x296f7f54 + #x7f6d2402 + #x9ea0e04f + #xef0ff2c7 + #xcec7b0bb + #xab8082b5 + #xdb284a16 + #x10e2b0a4 + #x4d767344 + #x7b4a1618 + #x90ad0262 + #xf709e0b4 + #xc7b4a4be + #x94809bc4 + #xf64f4ff9 + #x24db9097 + #x52615f4f + #x582f1f36 + #xa9d2245f + #xf6f7d6bd + #xb9a5a0c2 + #x9489b0c6 + #x185b39df + #x26be80a7 + #x3f486264 + #x3b29323f + #xe0fd324a + #xe6e6dde7 + #xab9ea2c0 + #xa29db7bd + #x294b1fd6 + #xfa484c7 + #x2848786b + #x2d2d342d + #x191b2d31 + #xd6e2f219 + #xa49da0b5 + #xb0a5b7b4 + #x223210dd + #xf6a4a0dd + #x295f7f5b + #x28281f14 + #x39282224 + #xcbeb0b39 + #xa09d9da9 + #xb5abb7b0 + #x102410e4 + #xf2bdb9df + #x44787f44 + #x19100914 + #x412f1d1b + #xc9f41b4a + #x9d9b99a2 + #xb7aeb7ad + #x6200fe4 + #x4d9c0d4 + #x62786839 + #xfbf6082f + #x4a381d09 + #xcbf72856 + #x9d9e9ba4 + #xbdb2b2a7 + #x91d04df + #x16e6c0d6 + #x6a61523d + #xd9ef2252 + #x5f3f10e9 + #xc7f7346b + #xa2a7a2a5 + #xc2aea9a4 + #xf12f7db + #x1be7cde6 + #x56484b42 + #xcb024462 + #x7139f2c7 + #xc0f9447f + #xadb5aba5 + #xbea5a2a5 + #x6ffeddb + #x16f0e6f4 + #x3f394a3f + #xd7225a5b + #x6d1fd0b5 + #xb9fd4a7f + #xbdc6b0a0 + #xb29da2ad + #xf6efe4d4 + #x1b0b00f7 + #x36363d31 + #xf0385d51 + #x5204bebb + #xb4ff426b + #xcdd4b497 + #xa99da7b7 + #xe9e4dbc7 + #x2d2d12f4 + #x36282426 + #x43f5a4d + #x34f4becb + #xb2fb3652 + #xe4e2b292 + #xada5b2c9 + #xe4d7cbc0 + #x44461bf4 + #x2b090826 + #xf415a51 + #x24efc7d9 + #xb4f92b3f + #xfdedb08e + #xb7aec0e4 + #xd9c4bec0 + #x545224f6 + #xde6f92f + #x18465d4a + #x1de9cee7 + #xbbfd242f + #x12f2ad8e + #xc0b7d604 + #xc6b2becd + #x5d5d2df2 + #xedcef734 + #x264b5a34 + #x9e2d7f7 + #xcb081810 + #x1beba997 + #xc6c6f41f + #xaeaecbd9 + #x616631e0 + #xd7c9f936 + #x314d4b1b + #xeddfe606 + #xe00b00ed + #x12e0aeae + #xcbdf122b + #xa9bdd7db + #x686820cb + #xd4cbf432 + #x36483809 + #xdfe6f210 + #xf402ebdb + #x2d9c2cd + #xdbfd2626 + #xb9ced9d9 + #x685804c0 + #xd9c9ef36 + #x363d2906 + #xe7f2f912 + #xf9f6e9e2 + #xf6e2e2eb + #xfb162616 + #xd4d7d4e4 + #x5634edcb + #xd7c6f239 + #x2d2f2208 + #xf7f6f60f + #xf9f0eff2 + #xf0f0fdfd + #x16201d08 + #xe6d6d2f4 + #x4116e4df + #xd2c4fd39 + #x26261f06 + #xfdf4f009 + #xf8e8dc + #xeefe01fe + #xe07faea + #xcfcdf713 + #xf700feea + #xd8f71001 + #x171e11ec + #xe3e80113 + #x5efdad4 + #xe1fa0508 + #xfcefd8 + #xdadff805 + #xfa0801ea + #xeff8f8ee + #x19201900 + #xeff1fe0c + #x3e1cfdc + #xd3fa0c10 + #xf1f1dcc1 + #xefeceff1 + #x11105f7 + #x1efdfe3 + #x1e2b2919 + #x5f7f303 + #xf5d3d4f7 + #xcdfe130e + #xeae3c2af + #x5e8dce3 + #x7100e10 + #xfee5ddee + #x2e3d3922 + #xaeee507 + #xead8e303 + #xcffe0c01 + #xdfcaada8 + #x3d6d3e1 + #x5132020 + #xf5e8eff8 + #x444f3e19 + #xecd4dd17 + #xece5e8f1 + #xcff1fcf7 + #xcbb4a6ab + #xf1d3d8df + #xc202719 + #xf5fa0100 + #x5656370c + #xbfbfe52c + #xf5eeddcf + #xbfddeef5 + #xb8aba9ab + #xe6ddddd1 + #x232915fc + #xfe081115 + #x5d56320a + #xa2b8f53b + #xfae8cfb9 + #xadcfe6f5 + #xb2b0a99b + #xefecdac1 + #x3517f1e8 + #x15323d + #x605d3710 + #x9fbbfa3e + #xf5e3cdbf + #xa6cfe3f1 + #xbfb2998b + #xfcefd6c8 + #x2ceed3e6 + #xfe2b5d5f + #x6b693907 + #xa6b9f139 + #xeae6dacf + #xb2d6dae3 + #xcaa28487 + #xf7ece8e5 + #xccdcbe8 + #x54d7d5f + #x7f6f2bf5 + #x9dabe642 + #xe8f5e3ca + #xc4d4cad3 + #xbd878096 + #xe8f80efe + #xf5cacada + #x25717f44 + #x7f6213f3 + #x849fee59 + #xf301dfb0 + #xcbc4b4ca + #xa08080ad + #xe61c34fe + #xf5d1b9bf + #x4f7f7130 + #x7f44070a + #x80a40c71 + #x1cf97 + #xc4b0a4cb + #x848097bd + #xfe4740e5 + #x7ca99af + #x5f725f35 + #x62270e2c + #x80c22e72 + #x1f1c19f + #xb49fa0d1 + #x8084adbf + #x235d32ca + #xcaf80bb + #x4f59604d + #x4220233d + #xb0ec3e5d + #xf1ddc4c8 + #xa697a2d1 + #x8b99b8b8 + #x3e5417bd + #xf89082da + #x34547159 + #x32272e2e + #xe80c3940 + #xdcd6ddfe + #x9d96a2c6 + #x9ba6b9af + #x3b3905c2 + #xdd8b9bf3 + #x2e667f4d + #x2c2b2015 + #x81a292e + #xcddffc22 + #x99949db6 + #xa4abb8ab + #x272501cb + #xd6a0b4f5 + #x447d7d34 + #x2219080e + #x111e2225 + #xcbee1334 + #x979094ab + #xa9afb6a8 + #x192201cd + #xe3bbbdea + #x607f6825 + #x3fe0123 + #x1e251e13 + #xcdf72344 + #x968e8ea6 + #xb0b2b2a2 + #x151efccb + #xfacbb9e3 + #x6b6f562b + #xdff11746 + #x372e13f1 + #xcdfc355d + #x97928da6 + #xb6b2a99d + #x1515f3cb + #x5cdbde8 + #x5b595439 + #xcf003759 + #x5029f5cd + #xc8034b78 + #x9f9b94a4 + #xb6a9a29b + #xe07eccf + #x5d3cff3 + #x444d573e + #xd61c4d52 + #x4f10cdb6 + #xc40e577d + #xada999a0 + #xada2a0a2 + #x1f8eacf + #x5e8e8f8 + #x37475034 + #xf1345042 + #x2eeeb2b6 + #xc2135469 + #xbdb89b99 + #xa49fa4ad + #xf3eee1c4 + #x1708faf5 + #x353b3929 + #x540503e + #xcd8afc6 + #xc211464f + #xd1c29992 + #xa0a2a9bb + #xeadfd3b8 + #x322301ef + #x2e22222b + #x11465442 + #xfcd1b8d6 + #xc20c3940 + #xe8cd968d + #xa8a8b6d3 + #xddcdc2b6 + #x493408ef + #x13001537 + #x1c4b593e + #xfcd1c1e3 + #xc4082e35 + #xfcd3908b + #xb0b0cbef + #xcab8bfbd + #x574013ea + #xeee61142 + #x29525629 + #xf3cdcaf3 + #xcd0c221e + #x8cf8d8e + #xb4bfe80e + #xb2b0c8ca + #x604f19dc + #xd4da0e44 + #x3552470e + #xdacad807 + #xdf100af8 + #x8c8909f + #xb9d60a20 + #xa8b9d4cd + #x6d5910c4 + #xcbd80844 + #x3e4b32f7 + #xc8d1ec19 + #xf105efdd + #xfcc2a2bb + #xcaf52222 + #xafc8d6cb + #x7252f5b6 + #xcbd30147 + #x3d3e23f1 + #xd3e3fa20 + #xf7f3e1dd + #xefcabfd8 + #xe5102715 + #xc4cfd3d3 + #x6832dcbb + #xc8cb014b + #x35321cf1 + #xeeeefe20 + #xf7eae5ec + #xecdfdfec + #x5191903 + #xd3cdd6ec + #x4410dad1 + #xc2cf0e44 + #x29251aef + #xf8eefc1c + #xf5eaeef5 + #xeff3f5f8 + #x191508f7 + #xd6c8dd07 + #x22f8e5e3 + #xbdda1935 + #x201e19ea + #xf5e6fa1a + #xffeddddd + #xf9040404 + #x906f6eb + #xcce81012 + #x9fddf + #xef0702f4 + #x171d07ea + #xeafd1014 + #xfbdfd8e6 + #xef040b0d + #xffe8da + #xdff10404 + #x90efde8 + #xfbf8eaef + #x19241900 + #xffff040b + #xf1d3dbfd + #xe807140e + #xf8efcfc6 + #xf8f1f2f2 + #x101004ff + #xfde6daf2 + #x24332e14 + #x9f8f207 + #xe2d1eb0e + #xea0b1406 + #xeddab8be + #xfde1e2eb + #xe121719 + #xf2e1e6fb + #x37453912 + #xf4e1e814 + #xdfddf2ff + #xe80407f9 + #xdbc3acbc + #xf1d8e1e8 + #xe1e291d + #xf1f1f6fd + #x4c503307 + #xc6caef2b + #xeaeae8d4 + #xddf4f9f6 + #xc6b7acba + #xe6dde6db + #x1b2b270b + #xf9040406 + #x574c2500 + #xa3c30240 + #xf4e8d3b3 + #xcae2f1fb + #xbcbaaeaf + #xebe8ddc8 + #x2e240df9 + #x4101724 + #x5a4a2407 + #x9eca1047 + #xf2ddc6ac + #xbcd8edfb + #xc1bea59c + #xf6e8d3c1 + #x2c00eff6 + #x6254147 + #x65552704 + #xa5cf1048 + #xebddccb5 + #xbad6e8f2 + #xc8b19093 + #xf9e4dad3 + #xedde2fb + #xe4a6d53 + #x7a5f20f6 + #xa0c50650 + #xeae8d4b3 + #xc6d4d8e4 + #xc199849c + #xf1eff9eb + #xf1d1e1f6 + #x2c737d3c + #x7f5809f1 + #x85b30765 + #xf4f8d39c + #xcfc8c5db + #xa88489b1 + #xf1101eef + #xead3d6e1 + #x537f6c22 + #x7f3cfb07 + #x80b1207a + #x2f9c180 + #xcab5b5df + #x8b809cc1 + #x63c30da + #xf4cdb8cf + #x6f7f571e + #x6622022c + #x80cc417f + #x7ebaf80 + #xbca3afe8 + #x808cb1c6 + #x2c5725bc + #xfbb39ad6 + #x686a5333 + #x471b1b43 + #x99f2536c + #xfbd8b1a0 + #xaa9ab3eb + #x85a0bebf + #x4a550dac + #xeb9397f4 + #x4e616645 + #x37252c3c + #xca144e50 + #xe4cfc8d3 + #xa197b7e2 + #x95aebeb5 + #x5140f9ae + #xcf87aa10 + #x416d7a3e + #x302c2524 + #xeb1e3c3a + #xd3d4e8f9 + #x9e97b1cf + #xa1b7beaf + #x412cf4b7 + #xbe95c619 + #x4c7f7422 + #x29200e17 + #xf9203030 + #xcde6060e + #x9c93a5be + #xaababcae + #x3024f4bc + #xc8afd10d + #x657f6110 + #x12070225 + #x7242c20 + #xd3f61b22 + #x9a8e97b7 + #xb1bfbaa8 + #x2924f4be + #xdfbfcd02 + #x747b5315 + #xf1f60e43 + #x242b2002 + #xd8023240 + #x978b92b7 + #xbabfb3a1 + #x251defc3 + #xefc1ca00 + #x6c6a5127 + #xdbff2e57 + #x3e2900da + #xd80e4a61 + #x998e93b5 + #xbebcac9e + #x1d0eebc8 + #xf1c1d304 + #x555e5833 + #xe21d4553 + #x4010d8c3 + #xd6205e6d + #xa19797af + #xb8b3a7a1 + #xd00eaca + #xf2d1e404 + #x475c5c30 + #xf9354a43 + #x1eebb8bf + #xd82e615a + #xafa197a7 + #xaeaca7aa + #xf9e8c5 + #xedf200 + #x45574c27 + #xe40453a + #xf4cdafcc + #xdd30533c + #xc1aa93a1 + #xa8aaacb8 + #xf9f2ddba + #x1b07f9fb + #x40413929 + #x1945473c + #xdfc3b5da + #xdf29412b + #xd4b18e9e + #xa8aeb5cc + #xf1e4cfb3 + #x3517fff9 + #x29252c39 + #x244e503c + #xdfc5bee6 + #xdb203927 + #xe8b5899c + #xaeb3c8e6 + #xddcdc6b7 + #x472507f4 + #x60b2b48 + #x325a5129 + #xdbc3c6f4 + #xdd202e1b + #xf8b7859c + #xb1c1e404 + #xc3bfcabf + #x55350ee6 + #xe8fb2951 + #x415c450b + #xc5c1d409 + #xe81e19f9 + #xfbb187a5 + #xb7d6041b + #xb5c3d3c5 + #x654509cf + #xdaf42555 + #x47512ef1 + #xb1c6eb20 + #xf812fdda + #xf2aa90ba + #xc5f41e22 + #xb7cfd8c3 + #x7343f1bc + #xd4ed1d57 + #x45431be6 + #xbada022c + #xfdfbe8d4 + #xe8afa7d4 + #xdf102719 + #xc5d6d4c8 + #x6f2edaba + #xcfe21b5e + #x3c3514e4 + #xdbed0e2e + #xf9eae6e8 + #xe4c3c5e8 + #xfd1e200b + #xd1d4d6dd + #x570ed1ca + #xc5e2245e + #x322c12e1 + #xf2f4102c + #xf4e8ebf4 + #xede1e2f4 + #x101b10fd + #xcfd1e6fb + #x2efbdfda + #xc5ef2b45 + #x27240dda + #xeff11027 + #xf6efedef + #xf8f8f6fb + #x191402f6 + #xc8d1f915 + #xdf6f2e1 + #xccfb2727 + #x1e1e07d6 + #xe4ef1225 + #xf1dcd7e0 + #xfc030807 + #x7fef0f0 + #xd903150c + #xe07ead0 + #x103f1fa + #x1517fcf0 + #xf50c0e0a + #xe7d1e0f7 + #xf8081107 + #xf3dee1 + #xec000500 + #x1107f1e5 + #xfcece3fe + #x1a251501 + #x103fe05 + #xd9ceee0c + #xf70e1500 + #xf7e0c5d5 + #xf8f1f0f3 + #x11080303 + #xf0dce303 + #x2a3a2808 + #xf7ecee0a + #xd1daf801 + #xf70c0ef3 + #xe7c7b5d0 + #xf0e1e8ee + #xc131e11 + #xe7e3f003 + #x41462800 + #xced3f11f + #xd9e7eed7 + #xf00100ec + #xd1b9b0cc + #xe1e0e8e3 + #x15252a0a + #xf0f5f803 + #x4f431af8 + #xa9c90338 + #xe5e7d3ac + #xe0f0f7f0 + #xc2b7b0c2 + #xe3e7e3d0 + #x262c1efc + #x50513 + #x533a11fe + #xa0d31a48 + #xecdabe9c + #xcce3f5f8 + #xc3bcabb2 + #xf1e7d3c3 + #x2c1507fc + #x8152131 + #x563c1501 + #xaee1214a + #xe7d1b9a0 + #xc3def1f7 + #xcab799a2 + #xf5decec9 + #x13f3f803 + #x11384d3f + #x664613fa + #xb2e01a51 + #xe1d7bea0 + #xc5d9e7ea + #xc7a38ba2 + #xeedee0da + #xf3def701 + #x2c646a33 + #x7b4601f3 + #x9ecc1a64 + #xeae5bc89 + #xcaccd5e1 + #xae8b8bb0 + #xecfa01e1 + #xe1dceef1 + #x567f6317 + #x7d2ff005 + #x80c32f7f + #xfcecac80 + #xc7b9c3e5 + #x92829cc2 + #x32817d0 + #xe5d5d5e1 + #x7a7f4d0c + #x6413f52c + #x80d94f7f + #x7e19780 + #xb9a7c0f1 + #x808cb0c5 + #x2c4a13b3 + #xeabab7e7 + #x7d714317 + #x430a0e4c + #x93006676 + #xfeca9280 + #xa79bc5fa + #x84a0bec0 + #x514ffa9e + #xda99ac03 + #x66645128 + #x2f17264c + #xc5216158 + #xe5bca5a3 + #x9b99caf5 + #x92b0c2b7 + #x5d3de59b + #xbc87bc23 + #x586f6625 + #x2e252636 + #xea2c4d41 + #xd1c2c9ce + #x959bc7e1 + #xa0b9beae + #x532adca2 + #xa992d933 + #x587f6c0e + #x2c1f1125 + #x2a3d36 + #xccd9ece8 + #x9597b7cc + #xabbcbaa9 + #x4121dea9 + #xacabea2c + #x6d7f58f8 + #x1a07012c + #xf2a382c + #xd3ee0700 + #x9390a5c0 + #xb3c2b9a5 + #x361fe1b0 + #xc2bae71e + #x7f7f48fa + #xfcf30a46 + #x2a312c0f + #xda001f23 + #x8e879bbc + #xbac3b5a0 + #x311ce0b5 + #xd5bce017 + #x7d71460e + #xe5f7255d + #x432e0ce8 + #xe0113c4a + #x8b849bbc + #xc0c2b09c + #x2a0fe0be + #xdab9e018 + #x6868511f + #xe5113c5c + #x4315dec9 + #xe328555a + #x8e899bb9 + #xc0bcac9c + #x1c03e0c5 + #xd9c2ea17 + #x5a66561f + #xfa2c414a + #x21ecb9c3 + #xe83c5d48 + #x999099b2 + #xb9b5a9a3 + #xcfce0c2 + #xe3d7f50e + #x55645118 + #x113a3c3c + #xf0c7acd0 + #xf5465125 + #xa79592ac + #xb0aeabb0 + #x3f8d9b9 + #xfcf0f805 + #x535a411a + #x1e3d3a3d + #xd0b7b2e0 + #xfa41410e + #xb9998bac + #xacaeb3c2 + #xfceeceb2 + #x1700fc00 + #x43433a2c + #x2845413d + #xccb7baea + #xf838350c + #xc99b85ac + #xacb2c2d7 + #xeedec5b2 + #x2c0c01fc + #x232c3a41 + #x3853462f + #xccb9c0f7 + #xf1312f07 + #xd79982a9 + #xaebadcf3 + #xd7cec5b5 + #x3c1c08f0 + #x51c3d4d + #x485a3c11 + #xb9b5cc0a + #xf32e1eea + #xe09780ac + #xb2d0fc0e + #xc3cccab9 + #x4f2e03d9 + #xf3133c56 + #x515325f5 + #xa2bae321 + #x2103c7 + #xdc9285ba + #xc0ec171a + #xbed3ceb7 + #x6333eec0 + #xe80a365f + #x4c410ee5 + #xa5ce0333 + #x508e8bc + #xd19397d1 + #xd90a2513 + #xc7daccbc + #x6a23d5b7 + #xdcfe366d + #x412f03de + #xcaea1836 + #xfef0e0d1 + #xcea3b5e7 + #xf71e2307 + #xd0d9ccce + #x5807cac2 + #xcef73d73 + #x3626fed7 + #xe7fa1f33 + #xf1e5e5e7 + #xd3bed1f1 + #xc1f15fa + #xced3d9ea + #x38f1d3ce + #xc9fc4564 + #x2e21face + #xe8fe1e2e + #xece8e7e7 + #xe5deeaf7 + #x131507f5 + #xc7daf505 + #x18f1e3d3 + #xd308383d + #x261cf5ca + #xdefe1e26 + #xf1ece3da + #xf5f3fafa + #x110c00f7 + #xc3e70f17 + #x5fcf0d1 + #xe70f2117 + #x1e18f1d1 + #xda03211f + #xe0d0dbee + #xfc060dfe + #x3f3ebf3 + #xf00f0c05 + #x13fad6cd + #xeeee0c + #x140ffafa + #xf0f0103 + #xd2d0ec01 + #xfe0d11f5 + #xfae4dbec + #xf905fefe + #xdfae7e7 + #xecdef00f + #x1f220dfe + #x1faf505 + #xc9dbfa01 + #x110ce7 + #xeccdc9e5 + #xf7f2f0f7 + #x8030500 + #xded9f50d + #x363718f9 + #xe0def014 + #xd0ebf3dd + #xfc0a00dd + #xd7bbc1e2 + #xe7e5ecee + #xa1a1f01 + #xe2e7f906 + #x4b390df0 + #xb8d00030 + #xdeecd9af + #xeefaf5e0 + #xc8b4bdd7 + #xe0e7e7dd + #x1d2b1ff5 + #xf2f3fa0c + #x4e2f03f2 + #xaad91844 + #xe5debd9a + #xddf0f3e9 + #xc4b6b6c8 + #xe9e7d9cd + #x29260ff3 + #x1010a21 + #x4b2805fc + #xbaec2849 + #xe2cdb19e + #xd0e9f5ee + #xc9b4a8b8 + #xf2ddcbcb + #x1d0c05fe + #xc1f2f32 + #x4e2b06fe + #xcdf3264c + #xddc9b1a3 + #xc9e4f2e9 + #xc9a698af + #xecd7d0d6 + #xfef70603 + #x244c5029 + #x5e2bfaf9 + #xc2e7265a + #xe0d2af90 + #xc8d9e4e2 + #xba9395b3 + #xe7e7e9db + #xe7f005fa + #x5075550d + #x671beb06 + #xa5db3473 + #xf0d99e80 + #xc2c6d2e2 + #x9c879fbd + #xf70dfecf + #xe4e9f0e9 + #x7a7f40fe + #x5703ec2d + #x93e7537f + #xfed08380 + #xb4b1cdf2 + #x898eb3c4 + #x1f32feb4 + #xe2d0d2ec + #x7f6e3203 + #x3bf90652 + #xa50a6e78 + #xfaba8080 + #xa3a3d400 + #x879fbfbf + #x4b3eeb9c + #xd4adc40a + #x755e390d + #x2405245e + #xd22d6e5e + #xe5a6858a + #x95a1de00 + #x93afc1b3 + #x6032d293 + #xb397d22f + #x63674e0a + #x21162b4c + #x13d5a44 + #xcfa8a6ba + #x90a6deee + #xa1b8bda8 + #x5a1fc697 + #x9a9cf044 + #x677d59f3 + #x24181a39 + #x1d3b4939 + #xc6bdcdd9 + #x90a6cfd6 + #xadbdbaa3 + #x4713c69f + #x98b10342 + #x767f4ede + #x1d050637 + #x2d364034 + #xcbd9e9f3 + #x8e9ebac2 + #xb6c1b89f + #x3b0fc9a8 + #xacc10334 + #x7f7f39dd + #x3f0064b + #x3e39341d + #xd9f00316 + #x8790a8bf + #xbdc4b69c + #x360cc9af + #xbfc4fa2b + #x7f6e34f0 + #xebee1d60 + #x503616f7 + #xe206243e + #x8087a3bf + #xc4c4b397 + #x3003cbba + #xc6bff529 + #x76653e03 + #xe7053765 + #x501fe9d7 + #xeb244452 + #x8085a1bd + #xc6bfaf97 + #x26fcd0c2 + #xc6c4fa28 + #x686a4c06 + #xf9213d55 + #x2bf2c1cb + #xf9405242 + #x83899eba + #xc2b8ac9a + #x1afad6c4 + #xcbd40321 + #x656f4c01 + #xd2d3645 + #xf5c6add6 + #x850491a + #x908c97ba + #xbbb3ada3 + #x11f9d4bf + #xdee70514 + #x65673e01 + #x1b2f3044 + #xcdafb1e5 + #x144c32fa + #x9e8c90bd + #xb6b1b3b1 + #x8f2cbb6 + #xf7f3010a + #x59533611 + #x24343647 + #xc1adbbf2 + #x144226f3 + #xa88a8cc1 + #xb1b3bfc4 + #xfce4c1b3 + #xcfc0103 + #x40403b29 + #x34423d3b + #xc1afbffc + #xd3b1ff2 + #xb38789bf + #xafb8d4db + #xe9d6bfb4 + #x1b0a05f9 + #x2436453d + #x474c3421 + #xb4acc80d + #xa3716dd + #xba8585bb + #xb1c8eef2 + #xd6d0c2b4 + #x301a01e4 + #x11304b47 + #x52471d05 + #x9faddd26 + #xf2dfeba + #xbb8285c1 + #xbde40a01 + #xcdd6c6b3 + #x4724eec9 + #x3264957 + #x4e3606f2 + #xa1c2fe37 + #x1316e2a6 + #xb68091d2 + #xd4011f03 + #xcbd9c2b6 + #x551ad7ba + #xf3184968 + #x4222f7e7 + #xc2e41a3d + #xafad4ba + #xaf8aa8e5 + #xf21822f9 + #xd2d7c1c6 + #x5001c8bd + #xe00c5276 + #x3718f0db + #xe7002437 + #xf7e9d9d4 + #xb3a3c8ee + #x81f1aee + #xd2d0c9e0 + #x34ebc9c8 + #xd40d5a71 + #x3014e9cd + #xf20a2632 + #xe9e5dedd + #xc2c1e0f0 + #x13180de9 + #xcbd2defa + #x18e5d6cb + #xd9185555 + #x2b11e2c4 + #xe90d262d + #xe5e5ddd4 + #xdbe0f3f2 + #xf0c01ee + #xcbe5fa08 + #xcf2ddc6 + #xec1a362b + #x210cdecb + #xeb132421 + #xe9e0d7cf + #xeef500f5 + #xa01fcf7 + #xd2fe0f0d + #xafeddc1 + #xfe13130d + #x1808e0db + #xf71b1d13 + #xd8d6f30f + #xa140df2 + #x1f2f2fe + #xa110508 + #xfedd3e4 + #xf0e2011f + #x1b110505 + #x250afa0c + #xd1e2fe0d + #xc1808e4 + #xf5dfe6fa + #x5030005 + #xaf5eef5 + #xdfe0061b + #x30240dfa + #x3f2f718 + #xd3f2fef2 + #xc14fed6 + #xe2cadbf7 + #xf9f5fafe + #xa0d0d01 + #xdae60812 + #x46300aee + #xd4dd002e + #xe2f9e6c3 + #x50af2d4 + #xcfc1d6f2 + #xeef2f5ee + #x19291bfa + #xe9f3030d + #x4f2700ed + #xbce01846 + #xedebc7a8 + #xf500eedf + #xc8c0cfe6 + #xf0f0e7dd + #x2c3114f3 + #xfafa0619 + #x481f00f9 + #xc8f72c4f + #xe9d3b4ad + #xe7f9f3e9 + #xccbcc3d4 + #xf5e6d8d6 + #x2c220afa + #x50c1f2c + #x431f0501 + #xe206354f + #xddc7b4b9 + #xdff5f7e9 + #xceb0b0c5 + #xf2dbd6dd + #x140f0f03 + #x1b353f2b + #x4a200103 + #xe6033357 + #xddc8b2b0 + #xd8eeeee4 + #xc3a1a8c1 + #xe9e0e4e4 + #xfc0a1400 + #x46604a14 + #x5212f311 + #xcef73f6a + #xe9cea18c + #xcfdde2e6 + #xab95abc5 + #xf0faf3da + #xf30808f3 + #x75753a00 + #x4afcf333 + #xb4fc5b7d + #xf9c58380 + #xc1c7dbf3 + #x9698b9c7 + #x141df7c0 + #xf2f3eef3 + #x7f6a27fc + #x30f00c5e + #xbc1b787c + #xf9ad8080 + #xadb9e205 + #x91a6c5c1 + #x4130e6a6 + #xe0d1df0f + #x7f592903 + #x1bfc2e71 + #xe93e7d62 + #xe6958090 + #x9cb7f00a + #x9cb9c8b4 + #x5e29ce98 + #xc1b5eb38 + #x6f5d3afe + #x18123e69 + #x1d4f6a4a + #xcf9195c1 + #x95bef7fc + #xa9c3c5a6 + #x5e14bc9a + #xa2b40854 + #x6e7148e9 + #x221b3154 + #x3e4d563f + #xc3a6b9e7 + #x96c1e9e2 + #xb7c7be9f + #x4d06bba2 + #x9ac51f57 + #x7c7f3ecf + #x200d1d4d + #x48464f3e + #xc7c3da05 + #x98bbd1ce + #xbec8bc9d + #x3f00bcad + #xa8da254d + #x7f7c27c7 + #xdf71859 + #x4f464430 + #xd6dff322 + #x93a9bcc7 + #xc5ccbc9d + #x3afabeb5 + #xbbdf1d43 + #x7f691dd4 + #xf3f3296e + #x59442b0d + #xe4f91646 + #x899ab2c8 + #xcccebb9a + #x35f5c1be + #xc3da163f + #x7f6229e9 + #xeb063f73 + #x572e00eb + #xf018385b + #x8093afc8 + #xd1cab795 + #x2cf0c7c8 + #xc1d8163c + #x76693af0 + #xf91f4867 + #x3701d4db + #x13a4d4f + #x8093abc7 + #xcfc3b091 + #x20f0cfce + #xc3e01833 + #x757543ed + #xd2c3f59 + #xd1bee2 + #x1b544824 + #x8793a2cc + #xcabcaf96 + #x18f5d4ce + #xd1ee1625 + #x7a763cee + #x1b2b3857 + #xcfb2bef2 + #x305931fc + #x91919dd6 + #xc3b9b4a2 + #x16f5d1c8 + #xe7f7121d + #x756935fc + #x202b3a5d + #xbbadc7fc + #x354b1beb + #x9a8c9ce0 + #xbcbbc0b4 + #xfedcac1 + #xfafe0f16 + #x60543712 + #x2c374156 + #xb9b0cc05 + #x2c3f12e7 + #xa1899ce0 + #xb9c1d3c7 + #xfeddc3bc + #x8060f0d + #x464a4124 + #x41433c3e + #xb2adcf16 + #x253a0cda + #xa28398db + #xb9cfe9d8 + #xebd4c1b9 + #x19140cfa + #x334a4d33 + #x52432922 + #xa1a9e230 + #x2735fabc + #xa48091d8 + #xc1e401e6 + #xdbd6c1b7 + #x331ffadf + #x27445246 + #x5433110f + #x9fb90346 + #x2b22e0a9 + #xa18096e2 + #xd60118ed + #xdadac1bb + #x4618e2ce + #x1637575e + #x461d0001 + #xbcdf204b + #x2005ceb5 + #x9d83a9f2 + #xf21d24e9 + #xddd8bec8 + #x4803cfca + #x296073 + #x3811f5f2 + #xe7032e44 + #xaeecfd3 + #x9c96c7fa + #xa2922e0 + #xddcfc3df + #x35edccd1 + #xee296e76 + #x310deddf + #x16303c + #xf5e7dae2 + #xa9b4dff7 + #x182516db + #xd6cfd6f9 + #x1de6d3d3 + #xee357362 + #x2e0ce0cf + #x11d3037 + #xede6dddd + #xc1d3f0f0 + #x19190adf + #xd4dff00c + #xcedd8ce + #xf93a5d41 + #x2905d8ce + #x6243030 + #xebe0dddf + #xdff0fcf2 + #x120c00eb + #xe2fa0511 + #xcf5d4c8 + #x6253322 + #x1dfedbe0 + #x19292722 + #xe9dadded + #xf50305f5 + #xd01fcf5 + #xf3120f0f + #x14f9cec7 + #xa0f0f16 + #x14fce7f5 + #x2e2b1912 + #xd3e40723 + #x1316fddf + #xf6ecf504 + #xc040404 + #xfadadcfb + #xdae91319 + #x201107f5 + #x16f5f616 + #xd7f30409 + #x1413f1d3 + #xe7dff002 + #xfb02ff + #xfdf1f6ff + #xd7f01311 + #x341b02e6 + #xeee6ff2a + #xe2faf1dc + #x110ce6cd + #xd5d2e9ff + #xf5f5fff3 + #xc130afb + #xddf80c0a + #x411bf8df + #xc9e11341 + #xeef0d2b9 + #x702e1d7 + #xc9cde2f6 + #xf1f5f5e2 + #x25280af5 + #xeefa040f + #x3b11f3e9 + #xc9f32c4d + #xecd7bab5 + #xfbfbe6e2 + #xc9c8d7e9 + #xf5ece4d8 + #x312704f5 + #xf8ff0e22 + #x310cfbf6 + #xe209394b + #xdfc3b7c6 + #xf1f8ebe6 + #xc9bec6da + #xf0dfdcda + #x251907fd + #x418282a + #x310ffffd + #xf10f3b4a + #xd3bebac9 + #xe9f6ebe1 + #xc3adb7ce + #xe4dae2e1 + #xf1411fb + #x2a40391b + #x3909f609 + #xe2074057 + #xd8c1adad + #xe1e9e2df + #xb0a1b4cb + #xe6ebf0dc + #x5160ff3 + #x5c5c2d04 + #x34f6f62c + #xc90a5768 + #xe6b98f88 + #xd0d7ddeb + #x9ea1bac9 + #xff05f1c6 + #x20cfdf3 + #x7f5c19fa + #x1de90e5a + #xc923736b + #xe99e8080 + #xbcc8e4ff + #x97adc6c3 + #x2818e2ad + #xf5eeec09 + #x7f4b14fd + #x7f53278 + #xf1467f55 + #xda82809c + #xaac6f60a + #xa0bec9b4 + #x4514cb9c + #xd5d2f531 + #x6d4822f8 + #x50c4675 + #x285a703e + #xbf8088ce + #xa0d00200 + #xadc9c4a1 + #x4d02b79b + #xb4c91454 + #x68592ce1 + #x11194363 + #x4a5a5a34 + #xaf88adf8 + #xa3d8fae6 + #xb9cdbe99 + #x41f1b0a3 + #xa5d8315f + #x776b23c4 + #x1914315a + #x4b505036 + #xb2a6ce11 + #xa6d3e1ce + #xc1cdb997 + #x34e7b4ad + #xadee3c5a + #x7f6b0cb5 + #xe022761 + #x464b4a2f + #xc1c4e927 + #xa5c1c9c4 + #xc8ceb799 + #x2de4b5b7 + #xbffa3750 + #x7f5affbc + #xf5fb3172 + #x484a3614 + #xd2df0743 + #x99afbcc8 + #xced0b799 + #x2ae1b9bf + #xc9f62f4b + #x7f4f04cd + #xe7094678 + #x4a3711f1 + #xe2fd2a57 + #x8da1b9cd + #xd5ceb492 + #x22ddbfc9 + #xc8f12c46 + #x755518d7 + #xf11e5072 + #x310ee7e1 + #xf823434d + #x879cb4d2 + #xd7cbad8c + #x18e1cbd2 + #xc6f52d3c + #x756425d7 + #x5284863 + #xfddacde6 + #x14434125 + #x8799abd5 + #xd3c4aa8a + #xfe6d2d3 + #xcdfb282f + #x7f6d23d5 + #x13253c61 + #xc6b7cbf5 + #x32502cf6 + #x8c92a5e6 + #xcbc1ab91 + #xee9d5d0 + #xdcff1e23 + #x7f661ee1 + #x19233e69 + #xa8afd300 + #x414811dd + #x918ca8f6 + #xc3bfb4a0 + #xce6d0cb + #xec00181e + #x735720f5 + #x1e2c4668 + #xa5b2d805 + #x403702d8 + #x9288ad00 + #xbfc4c3af + #x2ddcbc4 + #xf8051819 + #x5c4f2c07 + #x2f374354 + #xa5b0da11 + #x362ffbd0 + #x9287adfb + #xbed0d7ba + #xf3d5c6be + #x70f140c + #x4b4f3914 + #x40393139 + #x97abe628 + #x322aeeb7 + #x9282a8f5 + #xc4e4ecc4 + #xe4d2c3b9 + #x1b1807f5 + #x43504127 + #x462a1b28 + #x8db40443 + #x341dd5a3 + #x9180a5f6 + #xd3fd02cd + #xddd2beb9 + #x3113eedf + #x36484a40 + #x3e180a1b + #xa0d3234d + #x2a02c3ad + #x8c80ad02 + #xec1811cd + #xdccdbcc4 + #x3900d8d7 + #x1e3e595a + #x2f0a000a + #xcdfb3446 + #x14e6c1cd + #x8a8cc407 + #x72a14c8 + #xddc8bfda + #x2cebced8 + #xa3c6b66 + #x2305f6f3 + #xf5163439 + #xfbdacee7 + #x92a5dd02 + #x182c0ec3 + #xd8c8cef3 + #x16dfd0da + #x24a775a + #x2002e7dd + #x71e2f34 + #xecdadaec + #xaac4e9f5 + #x1e2300c4 + #xd5d2e605 + #x7e2d3d5 + #x9526d40 + #x1df8d7d5 + #x11233132 + #xe9dadff0 + #xc8e2eeee + #x1916f6ce + #xddebfb0f + #x4e9d2d0 + #x11464d27 + #x16eed2dd + #x272a2d2a + #xe6d7e600 + #xebfaf5ec + #xf05f3e2 + #xf302070e + #x9e7cbd5 + #xc22281b + #xeeee1f1 + #x3b281e1d + #xdfd5ec18 + #x20afbec + #x7fdf5f3 + #x90e090c + #xae2c9df + #xff02111d + #xcf5f300 + #x411e0c11 + #xd8f7151f + #x1b0dead3 + #xeeeffc10 + #x9030901 + #xe7d8f210 + #xd5001b09 + #x2310fbda + #xf1e90325 + #xe5fe01f7 + #x1a06dfd2 + #xe0e7f90e + #xfe06f6 + #xf7f60008 + #xdf030e01 + #x2f10f1d3 + #xd3e5153a + #xf1f9e2cb + #x13fcd7d7 + #xd3dff208 + #xf6fbfee5 + #x151506fc + #xea030406 + #x3108e9da + #xc6f12f4b + #xf1e0c6bc + #x9f4d8e2 + #xced8e9fc + #xf6f7f1d8 + #x2f1f01f7 + #xf400081b + #x2301efea + #xda0b3f49 + #xe2c8c0ca + #xf4e2e7 + #xcdcedaef + #xf2eae7d8 + #x2f1801fb + #xf9091b2c + #x1f04f9f6 + #xf21a413f + #xd0bec5d7 + #xf9f4e5e2 + #xc8c1cbe4 + #xe7e0e9dd + #x22160bfc + #x10272d28 + #x2304fb00 + #xf2184143 + #xcdbec0c6 + #xf1eee2dc + #xb9b3c1dc + #xdfe5f2dd + #x1a1d0ef2 + #x3f442813 + #x22f7f91a + #xdd185050 + #xd3b6a4a2 + #xe2dfdde2 + #xabaec0d3 + #xeef9f6ce + #x161a03ef + #x6a4b1604 + #x10ea0d4b + #xda2d6b55 + #xd89a838f + #xced2e4f4 + #xa1b4c5ca + #x100be9b6 + #xd04f400 + #x773f0901 + #xfbf23274 + #xfb4e7d47 + #xca8080a7 + #xb9d0f703 + #xa6c1c6bb + #x2f09d0a4 + #xf2e9fb23 + #x683711fe + #xf70d517c + #x2f667231 + #xaf808bd8 + #xafdc08fe + #xb3cdc1a7 + #x3afbbb9f + #xd0dd184b + #x5e4318e9 + #x622536b + #x4e665d25 + #x9980ae03 + #xb1e908e7 + #xbed0b89a + #x35e7b3a7 + #xb9ea3c5e + #x6b530eca + #x13204360 + #x4e5d5027 + #x978fcb16 + #xb9e9f2cd + #xc6ceb199 + #x28dcb3b1 + #xbc034e60 + #x7f58f7b3 + #xb113768 + #x41564c27 + #xa6aee522 + #xbbd8d8c1 + #xcbcdaf9d + #x20d5b4b9 + #xcd135058 + #x7f4be7b1 + #xf6083e78 + #x3e533f11 + #xb9c80135 + #xb1c3c8c3 + #xd2ceaf9f + #x1ad2b8c0 + #xd8134751 + #x7f3ee9c0 + #xe711517f + #x434420f4 + #xcde7234b + #xa2b3c1cb + #xd8d0ae99 + #x11d0beca + #xd70d434b + #x723ffbcb + #xee235d7c + #x3720f7e0 + #xe50e3e47 + #x95a9bcd0 + #xddcea98d + #x6d2c8d3 + #xd2094141 + #x704e08cd + #x12d536f + #x9eedce4 + #x6344122 + #x90a1b4dc + #xdccba287 + #x1d8d3da + #xd50d3c34 + #x7c5909cb + #xe27466b + #xcdc6d5f2 + #x2a4728ef + #x8f99b1ee + #xd5c5a188 + #x1dfd8d8 + #xe010322a + #x7f5904d0 + #x11224472 + #xa6b9ddfe + #x414109cd + #x8f90b606 + #xcec3a690 + #x3e0d8d3 + #xec0e2823 + #x7f4e04df + #x15284e77 + #x9cbbe203 + #x462ff6c3 + #x8b8bc116 + #xcac6b39c + #xddd3cd + #xf40d2220 + #x6f4911ef + #x2235506b + #x9fbbe409 + #x3c23eebe + #x8a8bc81a + #xc6d0c5a6 + #xf4d8cec5 + #x132018 + #x5e4b20fe + #x34394353 + #x97b6ee1f + #x3720e4ac + #x888bc513 + #xcbe0d7ac + #xe7d3cac1 + #x111a1806 + #x56502c0e + #x3c2c2a41 + #x87b90639 + #x3716ce95 + #x8787be10 + #xdaf6e7af + #xe0d0c5c1 + #x251603f2 + #x51503527 + #x34181a35 + #x8ad32847 + #x32feb895 + #x8080c016 + #xee0ef6b3 + #xdfcbc0c8 + #x2d06ece9 + #x41494641 + #x220b1128 + #xaefb3a41 + #x1be0b6b6 + #x8087d01b + #x622fcaf + #xdfc6c0d8 + #x27f1dde5 + #x2d4c5e53 + #x18080810 + #xdf183a32 + #xcec6dd + #x839ce515 + #x1b2cfbac + #xdac3cdee + #x13e0dae5 + #x205b7251 + #x1503f6f6 + #x122342c + #xeccedaf4 + #x97bbef04 + #x2728f1ab + #xd3cde003 + #x1dddadf + #x2368723e + #x13f7e0e7 + #x1325342c + #xe4d2e5fc + #xb6d7eff6 + #x251de7b4 + #xd7e0f70e + #xfee0d5d7 + #x2c635b27 + #xbe9d5ea + #x252a342a + #xe2d5ec0e + #xd8eaecee + #x1b10e5ca + #xe7f60411 + #x1dfced8 + #x2a493a1d + #x3e0daf7 + #x372d2c22 + #xdcd8fb28 + #xf9fcefea + #xd03ece7 + #xfe030b0e + #xfed5cde9 + #x1020251b + #x3eaecfe + #x391f1818 + #xd7df0939 + #xe08f4e5 + #x3fef6fe + #xd060b09 + #xf6cdd2fb + #xf4031b1b + #xbf9fcf9 + #x2c0b0813 + #xe80d12fd + #x1afdddd3 + #xedf7081c + #x70a0cf8 + #xe2e8050f + #xeb1a18f8 + #x2208e3ca + #xcaed1d34 + #xf305f7da + #x17f5d7da + #xe5f20518 + #x20a05eb + #xfd000705 + #xf5100cfd + #x2400dfd3 + #xc3f83240 + #xf8f0d5bf + #xfebd5e5 + #xddebff12 + #xfd05f7dd + #x1f1404fd + #xf8070510 + #x1df8e0e2 + #xd30f4545 + #xe8d3c7c7 + #x5e8ddeb + #xd8e2f207 + #xf8f8ebd8 + #x2f1400fb + #xf804142c + #x14faedef + #xf5254a3a + #xd3c3cdda + #xffeae3e5 + #xd2d5e3fb + #xefedeadb + #x2a1207fd + #x2172834 + #x15fff5f5 + #x42a4434 + #xcac3d0d8 + #xfaeae3db + #xc5c7d8f3 + #xe3ebf0db + #x241a0cf5 + #x22302c27 + #x17fbf808 + #xfb27473a + #xcdc0bdbb + #xf2e3dfdb + #xb7bdd3eb + #xe8f8f5d0 + #x251f05ed + #x4d3c1c18 + #xcf20832 + #xf3345a40 + #xcfa69da5 + #xdfd8e3e8 + #xadbdcfdf + #xff07edbd + #x2214f8f5 + #x64340f15 + #xf8f72d62 + #xf526d37 + #xc0828ab3 + #xcad7f5f5 + #xafc3cac8 + #x1d08d8ad + #xdfbfd14 + #x612c0f10 + #xf00f527a + #x406f6c22 + #xa28095e2 + #xbde20af5 + #xbacdc3b3 + #x2cf8c2a8 + #xebef183c + #x553012fb + #xff2a6171 + #x62755915 + #x8880b30c + #xc0f30fe0 + #xc5d0b8a5 + #x28e3b5ad + #xd3fd3f55 + #x5d3d08db + #x12325564 + #x5d694818 + #x8086d31a + #xcbfaffc5 + #xcfcdaba3 + #x1cd5b2b7 + #xd217595a + #x7240efbf + #x12274869 + #x4a5d451f + #x8da3e81c + #xcfede7b7 + #xd3c8a6a6 + #x12cfb5bf + #xe02a5f55 + #x7d35d7b7 + #xff184a7c + #x485f4412 + #xa3bb0028 + #xc8d8d5ba + #xd8c8a8ab + #xccdbac5 + #xed2f5c4d + #x7725d3c0 + #xef1c5a7f + #x57552cf8 + #xb8d81f40 + #xb7c3cbc3 + #xddcbaaa6 + #x4cbbfcd + #xef2a5747 + #x6922dfcb + #xf32c657f + #x553705e3 + #xd2003c47 + #xa8b7c7cb + #xe3cda69a + #xf8cdcada + #xea27543d + #x652fedcf + #x5355f77 + #x2d05e5e3 + #xf52a4027 + #x9dafc0d5 + #xe3caa090 + #xf3d2d7e2 + #xeb274f32 + #x723ff2cf + #x12305272 + #xebddddf2 + #x1f442aef + #x98a5bfeb + #xdfc39a8d + #xf3dadfe3 + #xf0284427 + #x7f44efcf + #x14284f7c + #xb8cae3fd + #x3f4007c2 + #x939ac50a + #xd8c09b90 + #xfae0e0e0 + #xf8243724 + #x7f3dedd8 + #x102c597f + #xaacbeaff + #x452cebb2 + #x8b96d322 + #xd3c2a596 + #xfae2ddda + #xfb1f3222 + #x7738f8e3 + #x18375f7f + #xafcbea02 + #x3d18e0b0 + #x8698e22c + #xd2cab39a + #xf5ddd8d0 + #x21f2f1d + #x693d07f0 + #x2a3d556d + #xa8c3ed10 + #x3514d8a3 + #x859de728 + #xd5dac29d + #xeadad0cb + #xd222810 + #x624412fd + #x3735425c + #x93c3022c + #x350fc588 + #x859ae024 + #xdfebd0a0 + #xe3d5caca + #x1d2017ff + #x61471d12 + #x32223250 + #x8bd8243d + #x32fbaf80 + #x8092dd28 + #xf000dba2 + #xe0cfc5cf + #x281502f2 + #x5747302d + #x20152847 + #xa5003f3c + #x20dba695 + #x808ee72d + #x814e3a0 + #xe0cac5db + #x25fff0ed + #x484d4d44 + #x100f1f34 + #xda20422c + #x4c7bac5 + #x809df828 + #x1f22e59a + #xdbc8cdef + #x12eae7eb + #x3d5f6748 + #xc0a0c1a + #x72c3720 + #xebc5d7eb + #x88b80017 + #x2f25df98 + #xd3cddf04 + #xffdfe3e5 + #x3f72713a + #xdfff204 + #x1c2c3220 + #xe0d2eaff + #xa5d2fdff + #x341dd59e + #xd3dbf315 + #xf7dddfdd + #x4875622a + #x8ebdf00 + #x242d3424 + #xddd8f310 + #xc7e3f3f2 + #x2c10d2b3 + #xdfef041c + #xf8dbd8db + #x4864481f + #xffdfdb08 + #x3032321f + #xdadd0028 + #xe5edf0eb + #x1d04dbd2 + #xf2fd0c18 + #xf7d3d3e7 + #x3742341d + #xf8e2e70c + #x342d2715 + #xd7e81235 + #xf7efe3 + #xcfdeff5 + #x4050d0f + #xebcddffd + #x14272a17 + #x2f3f3fd + #x1d171714 + #xd7f51f32 + #x1200efdd + #xfbff0f + #xd080f08 + #xe0cbed10 + #xf818270d + #xf02f7e8 + #xff0d18 + #x1a03d6 + #x14f3dde0 + #xf8061b26 + #xd1709f6 + #xed04150d + #x112511f3 + #x1ff9d4df + #xc6093c3b + #x307eac4 + #xfebddeb + #xf3031823 + #xd14feed + #x90d0f07 + #xd150a07 + #x17f2daeb + #xdc1b4a3c + #xf9ebd4c4 + #x6e5e2f3 + #xebfb111d + #xa09f2e4 + #x23140904 + #x6071225 + #xff0e7f6 + #x335036 + #xe4d4d6dd + #xfee5eaee + #xe4ee0614 + #xfbebe2 + #x29140a03 + #x10f2839 + #xffbf5f9 + #x1d3e492d + #xd4d1ddea + #xfbe8eae2 + #xd9e0f90c + #xf3f6eee0 + #x281a0dfc + #x15263437 + #x1200f901 + #x1f3b442e + #xd2d2d9dd + #xf8e8e5da + #xccd6f004 + #xf200f5da + #x2b220af2 + #x36342d2d + #xdfb041f + #x183c4c31 + #xd6c1bec9 + #xede2e5e2 + #xc1cfeaf8 + #xcf2cc + #x301d00f2 + #x4f301d29 + #xfefe234c + #x28525b2d + #xc69ea8d1 + #xdae0f3ed + #xbecfe0e4 + #x140de2be + #x260dfe06 + #x52261a29 + #xf8154f6c + #x536e5e1b + #xa580aaf6 + #xceed09ed + #xc6d2d2cb + #x23feccb8 + #xc011428 + #x4c281d1b + #x4336871 + #x777a4f0f + #x8380c41f + #xcf0114d7 + #xd1d4c3ba + #x23eabebb + #xf00c3b45 + #x503314fb + #x18426566 + #x7a713f11 + #x8089e02b + #xdf0d09bb + #xdacfb5b5 + #x18dabbc4 + #xea285a50 + #x6134f9d9 + #x1d3c5a69 + #x6b653c1a + #x80a5f528 + #xea07eea8 + #xdfc9adbd + #xad1bdce + #xf841684d + #x6e26ddc9 + #x12305a7c + #x68613c17 + #x96bd0631 + #xe5f2d9a8 + #xe0c6afc3 + #xccc0d2 + #x74a6844 + #x6812d1cf + #x42e687f + #x795e2d03 + #xaad6204c + #xd4ddcfb2 + #xe5cbb3c0 + #xf9cbc6da + #xc49653e + #x5a0ad7dc + #x4376f7f + #x7f490dee + #xc3fb3c5b + #xc0cfcebd + #xeaceb3b3 + #xf2cecfe4 + #xa456136 + #x5515e4e0 + #x12416c7c + #x5d1feeeb + #xe7264741 + #xb2c4cbc8 + #xebccada5 + #xebd2dcee + #x9475b2b + #x6125e8df + #x203f6177 + #x17f5e4f9 + #x14443309 + #xa8b8c9e0 + #xeac6a49e + #xebdae7f3 + #xc475022 + #x742de5dc + #x1f375e7f + #xdddfea04 + #x3c450dd2 + #x9fadd104 + #xe4be9f9c + #xf3e4ebf2 + #x113f441d + #x7a29e4e0 + #x1736667f + #xc8ddf204 + #x4c30edbb + #x94a8e528 + #xddbda49c + #xf9eaebeb + #xf363e1f + #x7428ebe8 + #x1a41717f + #xcedff203 + #x451adfba + #x8eaffc39 + #xdcc3af9a + #xf8eae7e5 + #x11333b1d + #x6b2bf9f3 + #x28496f7f + #xcbd7f00c + #x370dd6af + #x8cb80739 + #xdfd1ba99 + #xf3e5dfdf + #x17333715 + #x663404fc + #x36446076 + #xb5d20023 + #x3307c391 + #x8ebb0633 + #xeae0c39a + #xeee0d7dc + #x22332909 + #x66370c0c + #x34344f6c + #xa4e22037 + #x31f6a880 + #x8bb30134 + #xf8f2cb9c + #xebdad1e0 + #x2b2817fe + #x613b1d22 + #x25254566 + #xb8063b39 + #x25d99c86 + #x82ac0439 + #xc01d19a + #xe7d4cfea + #x291506f6 + #x57423937 + #x15203f58 + #xee26412b + #xac1acb5 + #x80b21237 + #x2212d493 + #xdfcfd6fb + #x1a01fbf2 + #x4f585a42 + #x121d2e41 + #x2236371f + #xedc1cee8 + #x85c91b23 + #x361bd18c + #xd9d2e40f + #x7f2f5eb + #x52716b3c + #x1411112b + #x37342e1b + #xdcd1eb06 + #x9ee01407 + #x3e18c991 + #xd6ddf522 + #xfbebf0e4 + #x607f662d + #x11fbf822 + #x36332e20 + #xdae2fb14 + #xbeed06f5 + #x390cc6a5 + #xddeb062d + #xf8e8e8e0 + #x68745222 + #x6e8ed25 + #x3637311d + #xdcea0723 + #xd9f0fced + #x2bfeccc4 + #xeefb112b + #xf6e0e4e8 + #x5b5b3f1d + #xfbe5f228 + #x393b2d15 + #xdcf21733 + #xeef3f8e8 + #x1af8e0e7 + #x61422 + #xedd9e8f9 + #x3e423618 + #xfceef81b + #x2e2e230f + #xe0032329 + #x3f9f3e0 + #xafbfb07 + #xc0f1414 + #xe0ddfb0c + #x1f34300a + #x9fcf300 + #x9171f17 + #xe8142512 + #x11feeddd + #x4000f1d + #x1114120a + #xd9e70d17 + #xc3028fb + #x1504eae7 + #xe5042023 + #x608dfb6 + #xffe2d8e8 + #xf7091d1b + #xe0cf6ee + #xf60b0c05 + #x180ff7ea + #x3d4caf6 + #xe821412c + #xfff0d3bf + #xf9dedeee + #xf3051b18 + #xe05edea + #x80c0603 + #x9030206 + #xfcd8d8f9 + #x9344424 + #xedd8d1db + #xf0dbe4ee + #xebfc1412 + #x8fae5e4 + #x170c0302 + #xfc001724 + #xf9e2e8f9 + #x2c43401b + #xd9d1def4 + #xebdee4e1 + #xe1f00b0b + #xfaf3e5e1 + #x1a0e05fc + #x2142c2e + #xfff1f1f9 + #x353e3418 + #xd1d4e1f4 + #xebdfdcd4 + #xd4e50305 + #xf4f6e8d9 + #x1e1502f0 + #x1a262f2b + #x2f4f608 + #x2c3a351d + #xd3cdd1e5 + #xe5dcd9d4 + #xcadefafc + #xfa02e7cd + #x2715f7eb + #x32272429 + #xf9f40c2c + #x2f413e1a + #xcab0bce7 + #xdbdbe4de + #xc4d8f0eb + #xb05dcc2 + #x2609f3f6 + #x381b1d2e + #xf108354d + #x4d58410b + #xa98cb908 + #xd0e7f7dc + #xc5d4dfd6 + #x17fccdbc + #x14ffff0e + #x32171d26 + #xfd29565b + #x736535ff + #x8080cd2e + #xd3fd05c8 + #xcdd1cbc4 + #x17e8c1bf + #xfd062027 + #x351e180c + #x14435f56 + #x7f622703 + #x8088e73d + #xe20ffda7 + #xd4c8b8bc + #xcd6bbc7 + #xf4244438 + #x442302ea + #x20435858 + #x7456260f + #x80a1f93a + #xf10fe591 + #xd6beadc1 + #xffcabbcd + #x2415938 + #x4f15e4d8 + #x18355668 + #x74522b12 + #x85b80640 + #xf3fdcb8c + #xd4b8afcb + #xf1c5bed3 + #x12525e2f + #x4cffced9 + #xc326479 + #x7f522105 + #x98cd1a58 + #xe5e7bf94 + #xd6bcb6cd + #xe7c2c2d9 + #x1d555e29 + #x3df0cde5 + #xc3d7079 + #x7f4108f3 + #xaded346b + #xd0d4bb9e + #xdbc1b9c4 + #xdfc1cbe2 + #x1e535b21 + #x35f4d8eb + #x18476e6d + #x651eebee + #xce15415b + #xbecabcac + #xdfc2b3b3 + #xdec7d6eb + #x1d555518 + #x3e02deea + #x21446265 + #x27f7def9 + #xfc353221 + #xb2bfbcc4 + #xe1bba7a7 + #xdfd1e2f1 + #x20554a0f + #x520bd9e5 + #x1d3a5e70 + #xeadfe403 + #x293a0ee5 + #xa6b3c5eb + #xdeb5a1a1 + #xe5deeaf3 + #x214d3d09 + #x5c0bd8e7 + #x1437687f + #xd1dcee02 + #x4026eac5 + #x98addc17 + #xd8b0a19d + #xebe7edf1 + #x20433509 + #x5b08dbeb + #x113e767f + #xd8dfeefc + #x3d0bd6c2 + #x8eb6fa32 + #xd3b3a494 + #xf0eaebea + #x1a3b340c + #x530be5f1 + #x1e4a797f + #xd9d9e800 + #x2efccbbb + #x8cc50f37 + #xd4bca98c + #xf0e8e5e4 + #x1a3a3109 + #x5212edf6 + #x2e4a6e79 + #xc4d0f012 + #x26f4bba0 + #x91ce1432 + #xdecaac8b + #xede2dce1 + #x213a2702 + #x531af600 + #x313e5f71 + #xafd80927 + #x24e5a183 + #x92cb0f2f + #xebd8b28e + #xeadbd6e4 + #x293218f9 + #x521d0311 + #x212f566d + #xbef7272e + #x18c78e88 + #x8bc51134 + #xfce5b68c + #xe4d4d3eb + #x271e08f3 + #x4a261d26 + #x12275064 + #xf61b3221 + #xffac97b3 + #x82c71a31 + #xcf3bb85 + #xdcd0d6f7 + #x1b0bfded + #x473b3b31 + #xe244655 + #x2f2f2711 + #xe1a9b8ed + #x82d6211d + #x21ffb980 + #xd3cddf0b + #x9faf7e7 + #x4d55502f + #x151e2f41 + #x472e1a0f + #xcebedc0e + #x94e81a00 + #x3100b380 + #xd0d1ee20 + #xfaf3f1df + #x5b6a5221 + #x150b1235 + #x3d261815 + #xced6f115 + #xb0f409e8 + #x31f7ad8c + #xd6df002f + #xf3edeadb + #x686d4714 + #x6f1ff34 + #x2f291e15 + #xd4e4fd1b + #xcaf3fadf + #x26e8b3aa + #xe4f00f34 + #xeee5e2de + #x675e380e + #xf6e4fc38 + #x322f1e0c + #xd8ed0e27 + #xdbf0f3dc + #x17e2c5cb + #xf3fd152c + #xe5dce2ea + #x524a3108 + #xf0e5fd31 + #x352e1803 + #xdcfc1a26 + #xe8f0edd9 + #x9e7e2ea + #xff06141d + #xd9dbeef9 + #x353d2cff + #xf6edf91a + #x211e1405 + #xe80e1706 + #xf6f1e5d8 + #xfff4ff02 + #x60c0c0c + #xd4e80003 + #x23321eee + #xede5ff + #xfd111b12 + #xf71a0be1 + #xf1dfd9 + #xfc001411 + #xb0f0600 + #xd6f70e08 + #x1b2c0ee1 + #x8e7d3ee + #xe20c2720 + #x11f5d5d3 + #xf5dddffb + #x1162213 + #x1302f1f4 + #x710080d + #x1901f1f5 + #xe9c6e211 + #x2d41411d + #xe3d9ec + #xefdfe5f8 + #xfb112010 + #xefaecf1 + #xe0d070d + #x801080d + #xe9d5ee08 + #x454a3b13 + #xe9d7e50b + #xe9e0e8ef + #xf40a1c0a + #x5f2e9eb + #x160e0708 + #xe2523 + #xefe8f700 + #x514a300e + #xdddcf116 + #xe8e0e0df + #xe8011402 + #xfdf5ebe5 + #x1a1304fe + #xe253328 + #xfaf2f701 + #x443f2c11 + #xdddce90a + #xe5ddd9da + #xddf80dfd + #xfde9da + #x2513fbf4 + #x252c302a + #xfaf40219 + #x393e3213 + #xd7c9d902 + #xdfdcdddf + #xd5f104f2 + #xd01e0cf + #x290bf2f8 + #x2f252a33 + #xf5012238 + #x474a330a + #xbba8d31a + #xd7e5eedd + #xd2e9f4e2 + #x17fbd5c7 + #x1d01f80b + #x291d2d33 + #xfb204848 + #x665529fd + #x9292e33f + #xdcfbfbca + #xd3dfdcd0 + #x19eccac7 + #xb051120 + #x261f2922 + #x11415a48 + #x78531afe + #x8095fb57 + #xeb10f5a7 + #xd6d2c6c7 + #xddcc6cd + #x41f322d + #x30221602 + #x284d5848 + #x7548190d + #x80aa0d58 + #x16dc87 + #xd7c4b8cd + #xfdd2c7d6 + #x10414b2f + #x3c17f7ee + #x29445757 + #x73452219 + #x80be195d + #x707c080 + #xd3bbbada + #xeecaccdc + #x26575728 + #x3bfeddee + #x1f3f6167 + #x7c4b2211 + #x93d2256f + #xfdefaf83 + #xd0bac1e0 + #xe3c6d0e0 + #x36605720 + #x2ae9d5fa + #x19476f69 + #x7f440efe + #xa5eb3b7f + #xe8dcae8f + #xd0c0c9dc + #xddc4d6e5 + #x3c64551a + #x1de5d901 + #x2253705d + #x6426f2f7 + #xc1104b75 + #xd6d0ae9c + #xd6c3c6cd + #xd9c9ddec + #x3e675110 + #x22efdd00 + #x2c546753 + #x2900e501 + #xee304442 + #xc7c6afb2 + #xdac0b8be + #xd9d2e9f4 + #x3f664505 + #x33fadffb + #x294a635d + #xeee5e90b + #x1f3b2201 + #xbabbb8dc + #xdab7acb2 + #xdfe0f4f8 + #x3f5d36fe + #x42fddcfb + #x1c426c72 + #xd3dff50a + #x3b28f8dc + #xabb5d20b + #xd5b1a8a8 + #xe8ecfaf7 + #x3b512dfe + #x42f8dd00 + #x16487c7f + #xdce5f500 + #x3c0bdfd6 + #x9cbdf42f + #xcdb1a89c + #xeff2faf1 + #x35472c02 + #x3cf7e204 + #x1f557f7f + #xe2e2ec00 + #x2af7d3d3 + #x99d21439 + #xcdb7a58f + #xf2f2f4eb + #x30442c04 + #x3cfee905 + #x305b7f79 + #xcfd6ee0e + #x1decc4b8 + #xa1e32236 + #xd5c0a489 + #xf4eeece8 + #x32442802 + #x4105ef07 + #x36547673 + #xb7d70122 + #x1addab99 + #xa7e92032 + #xe2caa48a + #xf1e8e6e9 + #x353e1d00 + #x420af811 + #x2c476d72 + #xc0ef1f2c + #x13c39398 + #xa5e52036 + #xefd5aa8d + #xebe0e5f1 + #x362f10fa + #x3e130e23 + #x1d3f696c + #xf4162f23 + #xfba495c3 + #x99e52835 + #xe0ac86 + #xe2d9e6fe + #x2c1c05f2 + #x3c262a30 + #x193c605e + #x2f2d2813 + #xd999b2fe + #x95ef2f23 + #x11e9ab80 + #xd9d5ec0e + #x1c0b00ec + #x45444232 + #x1c364d50 + #x482f170d + #xc3aeda25 + #xa1002902 + #x20eca180 + #xd6d6fa23 + #xa02fae6 + #x585e4a25 + #x1d263345 + #x39221011 + #xc4ccf428 + #xba0814e8 + #x28e59980 + #xd7df0a35 + #xfefbf2e2 + #x6c6a4214 + #x130d1f47 + #x251f1416 + #xd2e20123 + #xd20500dc + #x22da9e9c + #xe0ee1a3e + #xf5f2e9e0 + #x7266390a + #xfef8174d + #x28251c11 + #xdaeb0d2a + #xe2fdf2dc + #x14d5b1bd + #xee00263b + #xece9e6e8 + #x66583204 + #xefef174d + #x36291905 + #xe0f81c32 + #xe9f7ebda + #x7dacfd7 + #xfb0b262c + #xe2e3eef4 + #x504b2cfb + #xeeee103c + #x33221301 + #xeb0a1f22 + #xeff4e3da + #xfdebecec + #x5101d19 + #xdaecfd00 + #x3e4120ee + #xf5eb0025 + #x1d19140a + #xfe140bfb + #xf8f1dfdf + #xfd0007fe + #xb100e0a + #xe2fe0a07 + #x33300be2 + #xfadde914 + #xd1c2317 + #xd13f5d9 + #xfeeedce6 + #x10e170b + #x100b0500 + #xef0e1008 + #x2f20f8dd + #xfad0da0d + #xb263520 + #x9dfe211 + #xf3dfeb0b + #xf24240e + #x11f9f4fd + #x15110f1b + #xefcf908 + #xd2d5061d + #x61543906 + #xf6dbf127 + #xede2ed00 + #xb232308 + #x9f4f3f9 + #x17111117 + #x60b1417 + #xdee5050c + #x614f2e02 + #xe5df0236 + #xe8e1e8f0 + #x21d2000 + #xf3f1f3 + #x1b120e0e + #xb242d23 + #xedf40002 + #x54452603 + #xe4e8052b + #xe5dedee5 + #xf61518fa + #xf9f0e8 + #x23140503 + #x2036342a + #xf6f6000c + #x423c2709 + #xe4dff91e + #xe1d9dee7 + #xeb0e0ff4 + #xbfde7db + #x2a0ef902 + #x2e333333 + #xf6fd1527 + #x45422a08 + #xd2c6f029 + #xdedfe8e7 + #xe50503ea + #x17fadcd2 + #x2402f90f + #x2b2d393c + #xfa173739 + #x5a4b24ff + #xaaaefa48 + #xe1f3f4d5 + #xe4f9f0dc + #x18eed2cf + #x15000920 + #x262e3c31 + #xf3c4f3a + #x6c4815fc + #x84ab1263 + #xf109eeae + #xe1e5d6d4 + #xee2cfd2 + #xe14262b + #x2a30301b + #x2a51543a + #x6a3c0f0b + #x80bc276c + #x914d487 + #xdbd1c5d8 + #xffd8d2d8 + #x1a34402d + #x34261108 + #x344f5446 + #x63391a1a + #x80cf3170 + #x1809b480 + #xd4c3c3ea + #xf0d2d6de + #x33524e26 + #x340bf303 + #x304c5d57 + #x6742211b + #x92df3a7f + #x15f0a180 + #xccbfcff7 + #xe4ccdbe2 + #x4863511d + #x24f1e40e + #x2d556d5a + #x6c43170f + #xa2f34c7f + #xd99c83 + #xccc5d8f6 + #xdcccdfe4 + #x526c4f14 + #x11e5e718 + #x3163724c + #x582e0006 + #xba115d7f + #xebce9e90 + #xd1c9d5e7 + #xd8d1e8e8 + #x58704908 + #xfebee1b + #x37636740 + #x2308f10b + #xe231584e + #xdcc39fa7 + #xd5c8c8d5 + #xd6d9f1ee + #x5b703dfd + #x1bf3ee1a + #x34576046 + #xeaebf415 + #x1440390f + #xcebaa7ce + #xd6bfbac6 + #xd9e7fcf4 + #x5e6931f6 + #x29f4eb1b + #x2a4f675d + #xd1e50015 + #x36310ee8 + #xbfb4c000 + #xd1b9b3ba + #xe2f305f6 + #x5b5b29f6 + #x2deee820 + #x23557e70 + #xd9ed0209 + #x3a14f0e1 + #xadbcea2b + #xccb6aea8 + #xedfc09f4 + #x525124fa + #x2aedeb21 + #x29647f76 + #xe4ebf602 + #x2af9e1e1 + #xa7d4143d + #xc9b9a898 + #xf6ff05ed + #x49492400 + #x29f1f01e + #x3a727f70 + #xd6dff00c + #x18ebd2cb + #xaeee2a3c + #xcfbc9f8d + #xf9fcfdea + #x48492403 + #x2df9f41d + #x46707f6c + #xbcd9fd21 + #x11dcb9aa + #xbcfd2d34 + #xd8bf998d + #xf7f4f7ea + #x49461e03 + #x31fdfc23 + #x3f647f6c + #xbceb1a2d + #xbc29fa1 + #xbfff2d36 + #xe4c59b92 + #xf3f0f4f1 + #x493a1700 + #x3005092e + #x2e5a7c6c + #xe50f2d27 + #xf4a19bc8 + #xb9ff3437 + #xf1cfa18f + #xeae8f6fd + #x40290efc + #x2d142039 + #x295a7861 + #x1e2b2917 + #xd192b405 + #xb3063c27 + #x2dba183 + #xe1e2fc0e + #x301b06f4 + #x3630363a + #x2e586952 + #x372e180f + #xb49fdc2d + #xb7143606 + #x14de9580 + #xdce10623 + #x201100ed + #x4c4f4331 + #x304b5149 + #x29210f15 + #xb3c0fa2e + #xcc1a1ee5 + #x1ed88980 + #xdce81736 + #x1208f7e7 + #x69664321 + #x232e3a4e + #x1117141b + #xc5db0823 + #xe21403d8 + #x1dcb8996 + #xe1f62942 + #x5ffeee5 + #x796a3a12 + #xc12305a + #x111b1d17 + #xd9eb1127 + #xf008f1db + #xfc399b4 + #xea063742 + #xfaf4ebe8 + #x76613106 + #xf9032e60 + #x27231d0c + #xe2f72037 + #xf4fdeae1 + #xffc9b6ce + #xf6173d37 + #xeeedeef0 + #x67572bff + #xf1ff2b58 + #x34231703 + #xeb092737 + #xf6f9e5df + #xf7dbd5df + #x31d3626 + #xe7f1fafc + #x574e21f3 + #xf3f71d45 + #x291d1405 + #xfc151e20 + #xf9f3dfe2 + #xf9f6f1ee + #xc1b2614 + #xeafd0506 + #x4c400fe7 + #xf3ea0934 + #x1d1b1d0e + #xf110505 + #xfcebdcf0 + #x30c08ff + #x12111108 + #xf90e0e0f + #x4027f7e4 + #xead8fc2b + #x272b2d15 + #x1800edf7 + #xfde7dffd + #xc1d180b + #x14080502 + #x9171115 + #x3311e8e8 + #xdfcbf72a + #x3c3f3a17 + #xefda0342 + #xe9dff509 + #x1b2b2106 + #x3f4f803 + #x150f191b + #xfefa0310 + #xc8f21913 + #x604f21e3 + #xe5e20f46 + #xe5ddeffa + #x162a1ffe + #xfbf1f5fe + #x16101813 + #x6131818 + #xdcfa0c06 + #x544218e9 + #xe0ec183f + #xdfd9e6ec + #xd2718f5 + #xfaf2f1f4 + #x1c120f09 + #x182e2a21 + #xeefb0003 + #x433616f5 + #xe5ee0f2e + #xdad4e2e9 + #x41e0fee + #x1f7e9e8 + #x220c0104 + #x2b372e2b + #xf1f80615 + #x40361bfd + #xdddc042d + #xd7d6e8ec + #xfd1504e8 + #xcf5dfdc + #x1f00fb0d + #x2e343636 + #xf4092128 + #x4e3c19f8 + #xbfc70943 + #xdae6f1e0 + #xf709f5df + #x10eed6d7 + #x12f8061c + #x27364034 + #x42a392d + #x5d390df7 + #x9ac11e5d + #xecfdecbb + #xf1f8e2d9 + #xae3d1d7 + #x9041c28 + #x283a3d24 + #x2548422a + #x5a2d0603 + #x83d03367 + #x709d08e + #xe6e0d0df + #xfbdad3d9 + #x13213328 + #x31362713 + #x3a514531 + #x4b280d18 + #x85e33f67 + #x1b00aa80 + #xd6cacaf2 + #xeed4d7dc + #x2d40401f + #x311c0710 + #x3c514e40 + #x48311b1f + #x92f14872 + #x1ce58f80 + #xc8bfd406 + #xe3d1dddc + #x49584516 + #x1ffdf41c + #x36575d45 + #x4e3a1816 + #xa0fd547e + #xccb8880 + #xc4c4e20c + #xdad1e2da + #x5b66430a + #x9e9f42a + #x3a646339 + #x462b060d + #xb2126172 + #xf5bc8882 + #xc8cee501 + #xd3d4e5da + #x666c3dfe + #xfde8fb30 + #x43695a2a + #x220af713 + #xd6336146 + #xe3b38994 + #xd1d0daec + #xcedcece0 + #x6d6d34f1 + #x3eefe34 + #x435d4f2b + #xf2effb1e + #x749480f + #xd6aa8fb8 + #xd4cacbda + #xd3e8f8e8 + #x706627e9 + #xfeefb37 + #x3651553f + #xd9e9071e + #x2d3f1fe6 + #xc5a4a9eb + #xd0c1c1cb + #xdcf703ee + #x6d5a1ce8 + #x13e8f73d + #x2b546a54 + #xdff20710 + #x361efbdf + #xb2acd71c + #xc7bbb8b9 + #xe8000aeb + #x644c16ee + #x12e5fa3f + #x31697f5b + #xebf4f803 + #x25fee9e2 + #xa9c50936 + #xc4b8aca4 + #xf20609e5 + #x5a4516f5 + #x10e8fe3a + #x437c7f58 + #xe0e6eb09 + #x10ecddd1 + #xb0e92836 + #xc7b89e95 + #xfa0601e0 + #x544218fd + #x13ecfe33 + #x517f7f55 + #xc4d9f21c + #x6dfc4ad + #xc403312e + #xcdb59292 + #xfb01fbe2 + #x52401801 + #x18f10031 + #x51797f58 + #xb9e20d2d + #xfec5a79d + #xd00c312d + #xd4b28f98 + #xf5f8f7e8 + #x52391500 + #x19f7093a + #x46727f5b + #xd704242b + #xe9a39db9 + #xd00c362d + #xddb8949b + #xeeeff7f2 + #x4b2b0ffb + #x19041c45 + #x3c707e54 + #xc24251c + #xc48eb2f2 + #xcb133f1f + #xebc19594 + #xe6ebfd00 + #x3c1e09f7 + #x1f1b3045 + #x3d6f7246 + #x2a2b1510 + #xa497da1c + #xce1f3c00 + #xfbc78b89 + #xe0eb0712 + #x2b1501ef + #x37393a3a + #x42665e40 + #x1e1c0713 + #x9db6fb1f + #xdd2522dc + #x9bf8088 + #xdcef1625 + #x1c0df8e6 + #x55523f2a + #x3c514c49 + #x30c0a1e + #xb2d60a10 + #xf11e03cb + #xab28098 + #xdcfa2836 + #x1203f1e0 + #x6d603a1c + #x2733425a + #xfe0d181f + #xcbe90f10 + #xfd0deed0 + #xa980b3 + #xe30c3d3c + #x6f8ebe0 + #x755d3112 + #xc1b3d66 + #x15181c13 + #xdcf51b25 + #xfbfbe5da + #xf1ad9dcb + #xef1f4836 + #xf8f1ece6 + #x6f542504 + #xfd0f3c66 + #x271e1606 + #xe5042733 + #xf7f2e2df + #xe8c1beda + #xfd2a4525 + #xf1f1f4f1 + #x644918f8 + #xf7093358 + #x21191000 + #xf215272a + #xf7ecdfe0 + #xebdcd9e6 + #x9283413 + #xf1fafdfd + #x5b4009ec + #xf1fd244b + #x13181503 + #x6151816 + #xf7e6dcec + #xf8f7eef2 + #xf1e1e06 + #xfa040609 + #x522df7e8 + #xe3eb1642 + #x19242103 + #xd030316 + #xf5e0e0fd + #x90f0400 + #x100d0c03 + #x90d0d13 + #x3a12ebee + #xd3e0153a + #x33392bfd + #xaeef722 + #xf4dde80a + #x161f1609 + #xf030104 + #x15121319 + #x22fde6fb + #xc5dd1933 + #x4c4b30f5 + #xe3f42c57 + #xe3e60502 + #x29302301 + #xfb0111 + #x161a2516 + #x1071119 + #xe0141f0d + #x574104d0 + #xe6fd2f50 + #xdfe2fbf7 + #x28321dfa + #xfefbfd0d + #x1a1c1d0e + #x141f1f1f + #xf10d0e08 + #x4e3505e2 + #xec022c42 + #xd9dcf1f2 + #x222d14f1 + #x1fbf401 + #x20161108 + #x2a332c29 + #xfa040410 + #x47300bf4 + #xecf8203b + #xd5daf1f4 + #x1a2308e8 + #xafae9f5 + #x1f0a080d + #x35383632 + #xf8051323 + #x4d3311fa + #xd6e61d47 + #xd6e5f8ec + #x1319fde0 + #xef2dfee + #x13fe0d1a + #x323c4436 + #x21d292c + #x57330bf7 + #xb5e02a5b + #xe5faf5cf + #xb08ecdd + #xae9daeb + #x8041f26 + #x3245482c + #x1d393529 + #x51290200 + #xa1ec3c61 + #x105dca4 + #xfdf2dfe6 + #xe2dae9 + #xd193228 + #x3945391d + #x3c4a352a + #x3e1f0716 + #x9efe475b + #x19fdb480 + #xe8dadafe + #xf5dddce8 + #x23353e22 + #x3c331f19 + #x484e3e36 + #x35261728 + #xa70a4d5b + #x1fe09080 + #xd6cce217 + #xebdce0e2 + #x3f4d3f16 + #x2c140b23 + #x48574e3c + #x3f331f29 + #xaf145b6a + #x10c18080 + #xcaccf222 + #xe2dde5dc + #x5a5e3c08 + #x10fd0a36 + #x4a645533 + #x48301423 + #xbe286c6c + #xfab18080 + #xccd6fd1a + #xdce3e8d7 + #x6a6738fb + #xfdf51145 + #x53664e23 + #x38160525 + #xda426d4d + #xe8aa808d + #xd3dff808 + #xd7e9ecd9 + #x75692def + #xfef7174e + #x555d441f + #x11fb052f + #x75a5519 + #xd9a283aa + #xdaddebf5 + #xd7f1f4e3 + #x7c6322e6 + #x5f71657 + #x4d51452c + #xf5f51032 + #x30542df2 + #xc79b99dc + #xd9d5dde5 + #xdffb00eb + #x7c5716e3 + #x8f1165e + #x3f54583c + #xf5001123 + #x3e3508e8 + #xb5a1c710 + #xd0cad2d2 + #xee0708ec + #x754b0ee8 + #x5ec1761 + #x3c676f45 + #x1040210 + #x2c10f5ec + #xaabd002f + #xc9c4c4bb + #xfd110ae5 + #x69410df2 + #x2ee1a5a + #x4d7f7c44 + #xfbf5f10e + #x14faebe0 + #xb2e62833 + #xcabeb1a8 + #x51605df + #x5e3e0efb + #x4f21a50 + #x607f7e42 + #xdfe2f222 + #x5ecd6c0 + #xc90a3629 + #xcfb59ea2 + #xa13fee0 + #x5a3b1302 + #x8f5174b + #x677f7b45 + #xcae20735 + #xfed5b7a7 + #xdf193626 + #xd0ac95aa + #x70bfde6 + #x58381407 + #xaf5194e + #x5e7f7c4a + #xd9fe2038 + #xebb2a5b5 + #xe81d3b25 + #xd2aa98b2 + #x2fbee + #x54301404 + #x8fd2354 + #x587f7e47 + #x51f262f + #xc798b2e5 + #xe623441a + #xdab19bb1 + #xf5fb00f8 + #x47280efd + #xe103554 + #x5a7f763b + #x292c1925 + #xa299d911 + #xeb3042fb + #xecb895a8 + #xeffb0807 + #x381f07f4 + #x232d444a + #x5d7e6335 + #x2c1d0a23 + #x96b8fd19 + #xf8392cd5 + #xfbb584a4 + #xec01171a + #x291600ee + #x4148473c + #x57675341 + #x190b0a2a + #xa8da0d08 + #x83007bd + #xfda780ae + #xe90b2a2c + #x1d0dfae8 + #x6055412d + #x4a4e4d58 + #xd07142f + #xc6f20e02 + #x101aebc0 + #xf19880c6 + #xeb193f36 + #x1104f5e3 + #x6f553622 + #x333b4e6a + #x17131d28 + #xdafe1614 + #xa02e2cf + #xe29899da + #xf22a4e33 + #x7fdf4e5 + #x70502a16 + #x1f2d4e72 + #x251d1a17 + #xe60b2228 + #xf4e3da + #xd9aab7e8 + #x43b5126 + #xfefbf5ec + #x6d481d07 + #xe234a6a + #x221d140a + #xf21a2a26 + #xf8eee5e0 + #xddc6d2ef + #x163f4214 + #xfafefbfa + #x673e0bf8 + #x1173f63 + #x141c1304 + #x420231a + #xf8e9e3e9 + #xeee2e5f7 + #x1d362c08 + #x50208 + #x602ffbf2 + #xf108355b + #x14221a00 + #xe161717 + #xf5e3e5fb + #x2fbf800 + #x1c251705 + #x80d0d11 + #x4d19f1f7 + #xddfb2f55 + #x283522f5 + #x7001129 + #xefdff108 + #x14110d07 + #x14110b0b + #x13131719 + #x2d04f204 + #xcffb3045 + #x414520e2 + #xf8ef133f + #xebdffd0e + #x22231d0a + #xb050511 + #x1916201c + #x13f5fa13 + #xc7023335 + #x534d19d3 + #xe90d4158 + #xd9ec03f2 + #x31311af2 + #xfd00061d + #x17242006 + #x6101917 + #xff1d1305 + #x5824e3d4 + #xf3133d4f + #xd5e6fcf2 + #x302d10e9 + #xffff16 + #x1c201603 + #x1c20201e + #x20f070d + #x4d21efe5 + #xf9103345 + #xcfe2f6f6 + #x2d2705df + #x5faf50d + #x1c130c05 + #x2e2d2d29 + #x5091d + #x4521fdf5 + #xec022a47 + #xcee8fcf5 + #x271dfad8 + #x7f3eb07 + #x12060d10 + #x33373e30 + #xf1a2a + #x472602f5 + #xd1f93054 + #xdbf8fcdf + #x1d0fefd5 + #x6e9e503 + #x6051c1c + #x3644482b + #x1326262a + #x421efcf9 + #xbb023e57 + #xf303e9b8 + #xffce3df + #xffe2e2ff + #x5142b20 + #x3d4b411e + #x3037292a + #x3114fd0d + #xb812454d + #xdfcbf94 + #xfae6e2f9 + #xf8dfe2f8 + #x162b361c + #x42422b17 + #x423d2b30 + #x23160d24 + #xbf1a4745 + #x16dc9480 + #xe2d5ed17 + #xf3e2e5ec + #x30423814 + #x38291c20 + #x45443836 + #x2e231a30 + #xc7204f51 + #x9ba8080 + #xd1d5022a + #xece6e5df + #x4a513609 + #x1c101a33 + #x4a4f4130 + #x45271a2e + #xd12e6261 + #xf2a48083 + #xcce11226 + #xe3e9e5d5 + #x5e5b30f9 + #x3032347 + #x55573d1d + #x47170d33 + #xe64a6b55 + #xdf9d808a + #xd4ec1214 + #xdfece5d5 + #x6f5e26ec + #xf9022a58 + #x5b4e3012 + #x2a020c3b + #x95e582d + #xd19680a0 + #xdced0702 + #xe1f2ebde + #x795a19e5 + #xfc002d68 + #x52412d16 + #x9fc163e + #x305c3105 + #xc18d89cb + #xdce5f9f2 + #xe8faf6e6 + #x7b4e0ce2 + #xfffc2e6f + #x41423b23 + #xff061a33 + #x44410ff6 + #xae90b200 + #xd5d9ede2 + #xf306ffe8 + #x734102e5 + #xfcf93372 + #x3d55542b + #xa0c0c1d + #x381dfcfa + #xa1abeb26 + #xced1dcc9 + #x21202e2 + #x6836ffed + #xf6fa376e + #x4a71642b + #xcfff816 + #x1d03f3f5 + #xa8d8192b + #xccc8c4b1 + #xf19fddc + #x5c3002f9 + #xf6fd3762 + #x617f6829 + #xf5e8f024 + #x9f5e2d8 + #xc2052d21 + #xccbbada7 + #x1619f8db + #x552d0703 + #xf9ff315b + #x6f7f672b + #xd8df023a + #xffe2c5b8 + #xe11d301a + #xcbad9eb0 + #x1612f6e1 + #x522b0d07 + #xfafd2e5a + #x6e7f6930 + #xd9f21944 + #xefc1adb8 + #xf2243319 + #xc7a3a0bf + #x100cf9e6 + #x4f2a1009 + #xfaff335c + #x687f6e30 + #xfd12233d + #xcca1b1de + #xf6293b10 + #xc8a5a4c5 + #xa09fdec + #x47270f05 + #xfc0a3e5b + #x687f6927 + #x27231a33 + #xa79bd20c + #xf9363df5 + #xd4ada3c1 + #x20703f5 + #x3a210afd + #xa204851 + #x6f7f5b21 + #x361a0d33 + #x96b5f91e + #x74129cc + #xe2ab96bd + #xfa090f06 + #x2d1a05f5 + #x273a4d44 + #x6f714a2b + #x2a06093e + #xa3d90c16 + #x173b03b0 + #xe69d8ac4 + #xf510231a + #x2312fded + #x454b4a3a + #x64584442 + #x1c001342 + #xbff30a09 + #x1d23e1ab + #xdc8d8cd5 + #xf6203a29 + #x1907f8e8 + #x5c4f3e2e + #x4e454a5b + #x1c0a1d3b + #xd8ff090f + #x1406d5bd + #xcb87a0eb + #xff334d29 + #xc02f3e8 + #x674a2e1d + #x383d526b + #x21171c2b + #xe506121c + #x5f3d9ce + #xbf94bbf5 + #x1047521c + #x500f2ec + #x68411e0d + #x2634546e + #x1d1a141c + #xf0141d1e + #xf9ede1d6 + #xc4aed1f6 + #x234f470a + #xf2f6 + #x64371202 + #x142a4f6c + #x1417120f + #x1e2014 + #xf5ece2e1 + #xd6cbe1f8 + #x2e4830ff + #x2f805 + #x5e2a03f9 + #x1d4869 + #x141d1302 + #xd1d1a10 + #xf2e8e3f0 + #xede2effc + #x2d371aff + #x5060510 + #x4e16f6f9 + #xec104467 + #x262a16f3 + #xc10171e + #xece2ed00 + #x2f90000 + #x23210f09 + #xc0f1214 + #x3602f303 + #xde0d425a + #x3e3a10df + #xfc05233a + #xe5e2fc05 + #x16121200 + #x120f0a13 + #x12171c14 + #x17f8fd0f + #xdc163e40 + #x523dffcc + #xef00314f + #xdfe60702 + #x23211cff + #x705091a + #x131d2313 + #x2f50917 + #xe3203626 + #x5b37edc1 + #x22d5467 + #xd9f6faed + #x3a310adf + #xff000c27 + #x212a14ff + #x10171c1a + #x14190907 + #x4f07d6eb + #x92a485a + #xd5f0f9f6 + #x3a2a02d8 + #x2fc0726 + #x21200d02 + #x20212423 + #xa0c0a17 + #x400ce8f5 + #x5203b4f + #xd1f0fdfc + #x3621f6cf + #x3f6ff23 + #x1a120d09 + #x2e2e332a + #x309142a + #x3613f6f8 + #xef133851 + #xd8fc03ef + #x2d14eccc + #x2ecf81e + #xc0c1714 + #x36404127 + #xd192431 + #x3313f8f9 + #xd9144252 + #xef07f5cf + #x1e05e3d6 + #xfce5f319 + #x616271a + #x414e411c + #x242b2730 + #x270cf809 + #xd4204747 + #x703d1ad + #xcf0e3f0 + #xf6e1f00f + #xf2a3117 + #x4b4e3312 + #x3a312734 + #x1a090523 + #xdc29443d + #x13e3a198 + #xf3e3f213 + #xf2e3efff + #x263d3412 + #x473b2417 + #x4236303b + #x21131934 + #xe52d4848 + #x6bb8091 + #xdce20c29 + #xf0e9eceb + #x404b310a + #x3127272e + #x473e3737 + #x3d1e203a + #xe9365a61 + #xec9d8091 + #xd1ed232a + #xefefe9d9 + #x58522d00 + #x161a3148 + #x51443324 + #x481a1a3d + #xf64e6967 + #xd4908094 + #xd5fd2a1a + #xebf0e5d4 + #x695421f5 + #x5143b5e + #x5b412410 + #x30091948 + #x16686147 + #xc58980a4 + #xdf032307 + #xe9f0e3d9 + #x764f12e9 + #x213416f + #x55371e0a + #x703244f + #x3b693e1a + #xb78080c8 + #xe5fd14f9 + #xeff5ece3 + #x794502e3 + #x12487c + #x42342712 + #xf80d2b44 + #x4e4d1705 + #xa4809efa + #xe1f206e8 + #xfa03f8e8 + #x7638f8e6 + #xfc104f7f + #x36423b17 + #x516202b + #x45260307 + #x9696d623 + #xd8e8f5cf + #x912fde3 + #x6b2df2ed + #xf612577f + #x415e4d17 + #x1009071e + #x2b0aff0a + #x9bc50931 + #xd5dedcb5 + #x161afadc + #x5e24f6f8 + #xf3165876 + #x5c735216 + #xeff929 + #x14fff3f3 + #xb8f92426 + #xd4cebfa7 + #x1e1af5db + #x5220fd06 + #xf817526c + #x737b5417 + #xdede0341 + #x7efd8ce + #xdf1a291a + #xccb8aab0 + #x2314f2df + #x4e210910 + #xf9134b68 + #x787c571c + #xd1e91a51 + #xf8d1bac1 + #xfa272914 + #xc2a7a5c4 + #x1e0ff5e2 + #x4b240f13 + #xf6104b65 + #x767f5c1c + #xec062a52 + #xd8abb4dc + #x32d310f + #xbba3aed2 + #x160af9e2 + #x47261010 + #xf5165164 + #x797f5c16 + #x1a1c264a + #xb19ecf0d + #x93a36f5 + #xbfa8b1d2 + #x100cffe3 + #x40240d0a + #xfc265a5e + #x7f7f4f0f + #x36171a4a + #x98b1f62d + #x164824cc + #xcbaaaad1 + #xc1209f2 + #x371e0903 + #x143a5b52 + #x7f733e14 + #x2d061352 + #xa1d80d2b + #x2a4700aa + #xd2a09ed8 + #x6161a07 + #x2d1402fa + #x33485547 + #x795e382a + #x16fc1c5a + #xbff60f1c + #x302bd9a3 + #xcb8e9eeb + #x3203119 + #x210dfaf3 + #x4d4f4a38 + #x674f4144 + #x7052757 + #xdb000616 + #x2407c7b2 + #xbb87b0fc + #xa33471c + #x1909f5ef + #x5b4e3b2a + #x51484f5a + #x9122b4a + #xe8020719 + #xdf0c9c7 + #xad90c803 + #x1c4e520f + #x1006eff0 + #x64482b19 + #x3b425868 + #xd172437 + #xf209101a + #xfde9d5d5 + #xada5db00 + #x315e4afc + #xa02ebf8 + #x643b1c0a + #x263a5b6e + #xf171d24 + #xff161914 + #xf6ecdbde + #xbdbee5fa + #x405a34ef + #x700ef06 + #x5b2d0d03 + #x13305b73 + #x161a1a13 + #xf1d1913 + #xf5ebdeec + #xd5d6effa + #x41471ef2 + #x702fa14 + #x4e1c0303 + #x265b72 + #x292414ff + #x13171920 + #xf0e6e8fc + #xecebfcfd + #x373014fd + #xa090a1d + #x3809ff09 + #xf0215b69 + #x423009e6 + #xa10243b + #xe8e5f503 + #x20afd + #x241d120d + #x1214161c + #x20fc0310 + #xec265554 + #x5830f3d2 + #xfd123857 + #xe1ed00fd + #x191913f6 + #x120d121a + #x17211c12 + #xafd0c14 + #xf92e4431 + #x6224dccb + #xf81a4b67 + #xdef605f6 + #x2a2716ed + #x5061221 + #x1c291e0a + #xff021414 + #x9303016 + #x6417cccc + #x18405762 + #xe3f9f4f9 + #x3f2bfbd6 + #x31832 + #x2d220903 + #x181b1b20 + #x19100910 + #x1beddf04 + #x15374952 + #xddf8fc02 + #x3c23f2cf + #xfffc1434 + #x26190b07 + #x22242626 + #xb0a141f + #x18f8ed02 + #x9294049 + #xe0ff04ff + #x3516e6ca + #xfdf41032 + #x18121210 + #x2e353424 + #x710222d + #x1903f6fd + #xf6234349 + #xef0b00e9 + #x2907dccf + #xf8ed0b2d + #xd182015 + #x3e493919 + #x16202a31 + #x1b03f504 + #xee2a4642 + #x90be2cb + #x18f6dce7 + #xf2ea0923 + #x10272a12 + #x4d50300d + #x2b2a2a37 + #x12ffff1b + #xf6314234 + #x15f1b8b8 + #xeded07 + #xefeb0412 + #x22382d0d + #x5044230e + #x382b2b3f + #x12041231 + #x323e38 + #x9c794b2 + #xeaee0a20 + #xeeeefcfb + #x37432d09 + #x40322020 + #x3e31323f + #x2412233e + #x3374a50 + #xeaa080b1 + #xddfd2724 + #xeeeef1e3 + #x4d492903 + #x2a292e3b + #x49393031 + #x30182643 + #x74b5f62 + #xce8a80ae + #xdd103516 + #xeeeee6d6 + #x604a1ffb + #x19273f58 + #x52382419 + #x1c11294e + #x1f66604d + #xbc8180b8 + #xe91b3106 + #xf1ede0d8 + #x6d4610f4 + #x11294a6b + #x4d2d160a + #xf50d3455 + #x426d461f + #xaf8080d8 + #xf11924f8 + #xf5eee4e0 + #x703b00ef + #xd275478 + #x3926190a + #xe4143f4d + #x59572302 + #x9f809a04 + #xf21016e9 + #xfbf8ede6 + #x6b2ef5ed + #x627607f + #x2d31270d + #xf51d3737 + #x52300e07 + #x8f84c82b + #xeb0707d1 + #x607f5e4 + #x6322eef1 + #xff2d6d7f + #x3549370d + #xd161c23 + #x37110a12 + #x91affb38 + #xe7fcefb5 + #x1412f6df + #x5818effc + #xfc32717f + #x505f3c09 + #x6fc0729 + #x1b060406 + #xade61b2e + #xe3ebd1a4 + #x2215f2dd + #x4b12fb0b + #xff346b75 + #x6a693b07 + #xe2e60940 + #xefdebdf + #xd80e221f + #xd9d1b6ad + #x2710f1e0 + #x4414071b + #x30626b + #x786d3e09 + #xc7e71f57 + #x3e3cbc6 + #xfc202218 + #xcab8aec4 + #x240af4e0 + #x421b1020 + #xff2a5f67 + #x7972430a + #xd6ff315e + #xe7bdbdd5 + #xe272410 + #xbbadb6dc + #x1f0bf8dc + #x3f1d141f + #xfb2b6063 + #x7c7b4606 + #x3153459 + #xbda6cf04 + #x153429f9 + #xb6afc0e6 + #x180df9d8 + #x3c1f1418 + #xfc34635e + #x7f7e3eff + #x24162759 + #xa0b2f52b + #x23431cd1 + #xbdb4c0e6 + #x110efddd + #x381c1011 + #xd436357 + #x7f722e00 + #x1f092362 + #xa0d61132 + #x3746fbad + #xc4adb6ee + #xe110aee + #x32160909 + #x27506050 + #x7f5f2911 + #x2ff2a6b + #xbcf6141d + #x422ed4a0 + #xc09db5ff + #xe1b2002 + #x2a100204 + #x40555444 + #x714e302a + #xe904386a + #xd9020a0d + #x3507bcaf + #xb292c111 + #x15313807 + #x1f0bfbff + #x52524431 + #x5c4a4043 + #xe6113e5f + #xeaff030a + #x1be9bcc6 + #xa196d514 + #x234b47fb + #x1809f4fc + #x5b4d3520 + #x4a4a5058 + #xf1183b50 + #xf1ff0a0e + #x2dfcad8 + #x9da8e40a + #x396243e7 + #x1503eb00 + #x5c432716 + #x38445965 + #xfd19343e + #xfc0a1210 + #xf8e4d4e3 + #xaac0ebfd + #x4d6331db + #x11fced10 + #x55321912 + #x243c5f6d + #xb1b2b29 + #xa141514 + #xf9e9d8ed + #xc1d5f1fb + #x52521ddd + #xdf9f923 + #x47200d0e + #x1437666e + #x20221f12 + #x14151823 + #xf8e7e0fb + #xd8e7f9fc + #x493912eb + #xb000a2e + #x3510070e + #x6386a67 + #x39270df8 + #x11122440 + #xefe6ee04 + #xedf904fc + #x352412fc + #x110e152b + #x20040912 + #x3c6755 + #x4e26f4e3 + #x916395e + #xe9edf802 + #x30e0bf6 + #x2018160b + #x191b1920 + #xe030e15 + #x740593b + #x5716dbd9 + #x7265070 + #xe6f6f9f9 + #x1d200deb + #xe10191b + #x22241811 + #x6091416 + #x153b3c1d + #x4b00cbdf + #xb375b74 + #xe7fdf8f4 + #x302b09e2 + #x30a1b27 + #x292a1506 + #x6111516 + #x1f30220a + #x3cefc6eb + #x284c5342 + #xe4f3fc0e + #x3f1de8d3 + #x9273f + #x2e140407 + #x181b1d2c + #x10070d16 + #xe2dff210 + #x1e3d493b + #xe5fc060d + #x3913decc + #xfc02243d + #x22110d0a + #x242b2828 + #x70d1b20 + #xf5ecf504 + #xe324639 + #xf10a07ff + #x2f03d0cc + #xf6fb223b + #x1414180e + #x3640311d + #xa1a282b + #x7f6f602 + #x4354939 + #x70ef1e5 + #x20f2cddd + #xeff82132 + #x1121220c + #x4a4d2b0d + #x1d252b35 + #x9f6f910 + #xa3b432e + #x17fbc9d1 + #x9e7dbfc + #xebf91d22 + #x1e312506 + #x56471d09 + #x2c272c40 + #x4f90c27 + #x133b3928 + #xed0a5cd + #xf3ebfc18 + #xe9f9110a + #x333c2703 + #x4f381717 + #x32283147 + #x9092238 + #x14363b36 + #xeca593ce + #xe7ff2120 + #xecf600f1 + #x46402402 + #x3b2c2131 + #x3b2e313c + #x13142e40 + #x13434d46 + #xc78687ca + #xe81a3613 + #xeff1ecdd + #x56401eff + #x282b3247 + #x452f2524 + #x417334a + #x215d5738 + #xaf8081ca + #xf52c36ff + #xf1e9ddd7 + #x613d11f9 + #x1e31465e + #x43271410 + #xe5144056 + #x406b470d + #xa28086e1 + #x2e2aef + #xf2e7dbdd + #x673503f5 + #x1a385a72 + #x311d100a + #xd71e4d50 + #x5a5a28ef + #x9580a10d + #x4281bdf + #xf8efe5e4 + #x6427f8f3 + #x143d6c7f + #x201e170c + #xf12a4736 + #x5b3813f8 + #x8680ca35 + #x200ec9 + #xfdece5 + #x5917f1f6 + #xe43797f + #x25322209 + #x14252c21 + #x421a110e + #x809bf845 + #xfc17f8ab + #xc06efe1 + #x4d0af1fd + #xc497f7f + #x42492702 + #x140c1022 + #x240e0e0c + #x95cc173b + #xf604d597 + #x1a09ecdf + #x4206f80d + #xd4d7f79 + #x605725fd + #xecef0a39 + #x1107fbe5 + #xc3fb2125 + #xece7b89e + #x2207ebe1 + #x3907041e + #x114c766f + #x715d25ff + #xc4e81e56 + #x7f1d7bf + #xf1141e1a + #xd7c6abbc + #x2204eedf + #x350d1128 + #x10476f65 + #x76612b00 + #xc6fc3664 + #xf1cac2c3 + #xc1e2014 + #xc0b3b5dd + #x1e06f2d7 + #x33161a2a + #xa436c60 + #x7c6c2efc + #xef144065 + #xc9aecaee + #x182a2400 + #xb3b2c4ee + #x1a0af3cd + #x351a1d25 + #x9496e5b + #x7f7128f3 + #x141d3b68 + #xa2afeb1a + #x27391ad8 + #xb5b9ccf3 + #x170cf2ca + #x351a1820 + #x11506b57 + #x7f6a1af2 + #x10113672 + #x9ace0a22 + #x3c3df8ae + #xbab6c9fc + #x140af6d5 + #x31141318 + #x2759634f + #x7f5913fc + #xee073d7e + #xb0f3130c + #x4a2acd9a + #xb9a8c411 + #x111007e7 + #x280e0a10 + #x3c5d5b45 + #x7b491813 + #xd0094c7f + #xd30309f1 + #x4300afa6 + #xa99ace27 + #x142421ee + #x200a030a + #x4f5e5038 + #x63432a2e + #xd0165371 + #xe80000e7 + #x27dbacc0 + #x989be22c + #x244333e4 + #x1807fb06 + #x5a594228 + #x51433c49 + #xe21e5160 + #xeffb00ec + #x7cdb9d5 + #x91aef21e + #x3c5e33ce + #x1700f10a + #x5e4a311e + #x4646505e + #xf8214a50 + #xf50209f8 + #xf6d3c9e1 + #x9ac4f609 + #x546722bf + #x14f8f11a + #x5738211d + #x3946606a + #x724423f + #x20c0e04 + #xf3dad1eb + #xafd5f5fd + #x605910bf + #xef2fb31 + #x4725171b + #x2a476a6b + #x172a3227 + #xc10131a + #xf5dbdaf8 + #xc6e4f6fc + #x5a4006ce + #x7f50c3f + #x35141017 + #x1a4a7163 + #x2c2b1a09 + #xd102139 + #xf1dde703 + #xdbf2ffff + #x452b07e2 + #xa031a3f + #x240c0d11 + #x13517254 + #x3d22fcef + #x916395a + #xe9e4f204 + #xf20406f9 + #x2e200ef5 + #x13112032 + #x14090d11 + #x1757673d + #x420edee2 + #xa28516c + #xe7eef6ff + #xa1406ee + #x1a1a1606 + #x201d1b20 + #x90d1116 + #x21534f22 + #x2ff3cce5 + #x1440606b + #xe8f3f2fc + #x2420fde1 + #xd141b1b + #x2b211310 + #x911131e + #x283d2e10 + #xdddccf6 + #x20506360 + #xebf5f1fd + #x3527f6da + #x610212c + #x33210c06 + #xd141424 + #x27271407 + #xf1d0d407 + #x354f4315 + #xe2f40b1d + #x3602d4d0 + #x103146 + #x21090501 + #x151c2732 + #x90b1513 + #xd3e1fe0e + #x2743411d + #xed040e12 + #x2ef7c9ce + #xfa0e3141 + #x170c0b02 + #x252e2c27 + #x9161d1c + #xeaeafa04 + #x193d4124 + #x41000fb + #x1ee6c2da + #xf00b313a + #x10161500 + #x3d3f2815 + #x12202328 + #xf8eff705 + #x19433f20 + #x1602dee8 + #xbdacdf6 + #xea092e2c + #x192419f8 + #x4f3f190c + #x21232439 + #xf1f00217 + #x20433215 + #x10dcbee2 + #xf6deed13 + #xea092317 + #x2b2f1af6 + #x4f310e13 + #x28212b46 + #xedfb172a + #x21392b15 + #xf0b1abe6 + #xeaf4131d + #xed0510fd + #x3c3519f7 + #x43251327 + #x2c243146 + #xf60f2a33 + #x1a39331e + #xc68fa3e3 + #xef152b0f + #xf1fbf7e6 + #x483616f8 + #x3327253d + #x32252832 + #xf619353d + #x204a3f16 + #xa78099df + #x2f2ef6 + #xf3efe1db + #x52360ff8 + #x2a2f3a51 + #x2f1c171c + #xe81d4146 + #x385b39f6 + #x958096e9 + #x123824e2 + #xf1e6d5de + #x562f07f7 + #x25394f60 + #x200e0913 + #xe6274f44 + #x555520dc + #x8d80a70c + #x193519d3 + #xf0e5dae6 + #x5421fdf4 + #x2444646e + #x10090b13 + #x7364e31 + #x5b380eea + #x8180d133 + #x172e0cbf + #xf3efe3ed + #x4a0ff4f3 + #x214f7577 + #x1317120f + #x31393519 + #x461d0f0c + #x8095fb46 + #x1327f8a4 + #xfae9ed + #x3c01f1fa + #x21597f77 + #x2a2b1507 + #x36231313 + #x27151313 + #x80bf1a3d + #xf16d88d + #xffee8ea + #x2ff8f609 + #x245f7f6e + #x4a3a1000 + #x9000528 + #x151204ef + #xa9ea242a + #x5f7b78e + #x19fbe5ec + #x25fa021a + #x28627c64 + #x5f4110fe + #xd4ed1547 + #xe01e2bf + #xda07201a + #xefd1a6ab + #x1cfae8e8 + #x20011028 + #x285f7759 + #x67471300 + #xc7f8315c + #xfbdbc3b4 + #xfb121c13 + #xd0b8b0d3 + #x17fdeadc + #x200b1d2c + #x215b7151 + #x6d4e15fd + #xe9124363 + #xd5b8c3d7 + #xe1c1d02 + #xb9b4c6ef + #x1602e9cc + #x24132328 + #x1a586d4e + #x7b550ff3 + #xe204369 + #xabb2df02 + #x1d2b17df + #xb4bbd4fa + #x1604e3c0 + #x28172324 + #x1e5c6a4e + #x7f5104ed + #xe1c4074 + #x99ccfe0e + #x3231f8b1 + #xb9bed405 + #x1701e2c5 + #x28161d21 + #x2e60644b + #x7f41f8f1 + #xed12487f + #xaaef09f4 + #x441ecd96 + #xb9b4d41c + #x1604edd1 + #x2112161c + #x3d625c41 + #x7231fb04 + #xd113597f + #xcc0101d5 + #x41f7a99c + #xada7de35 + #x161504d7 + #x1a0e0f15 + #x4b5f5133 + #x5f2b0b1d + #xd51e637b + #xe600f4cc + #x27d0a2b8 + #x99a7f43d + #x203217ce + #x1609050b + #x555b4628 + #x4f2e2039 + #xf32a626b + #xf0f8f1d5 + #x2beb0d1 + #x91b8052e + #x38511cbe + #x1501fb0e + #x5b4f3824 + #x4632364f + #xc2f595b + #xf0f8f6e3 + #xeabfc2de + #x98cd0813 + #x555d0eab + #x12f6f61e + #x583c2824 + #x3f394b60 + #x1733514a + #xf600fbf1 + #xe5c9cde3 + #xa9dc0201 + #x6752f7a7 + #x9ecfe38 + #x4a281d21 + #x33445f64 + #x20364033 + #x70507 + #xe8ced7ef + #xbee6fefe + #x643aecb4 + #xec0f4b + #x3619171a + #x2a526a5c + #x2b352717 + #x5091525 + #xe6d1e2fb + #xd0edfe00 + #x5227edc7 + #xfdf8214f + #x25101512 + #x255c6b4d + #x362808fe + #x2122f44 + #xe1d8ef00 + #xe3f802fb + #x391ef7db + #x5092a41 + #x170e120e + #x27626339 + #x320fe9f0 + #x4254a55 + #xdfe1f3fd + #xfb0802f1 + #x251c02ef + #x1215242e + #xe0e0f12 + #x2f5f4f24 + #x17efd3ef + #x10405951 + #xe2e8f1fd + #x1312fae6 + #x17190c05 + #x1e171919 + #xb0f101c + #x354f3512 + #xf0d4cdfa + #x24545939 + #xe3e9f305 + #x2712edde + #xf161920 + #x28150b0c + #xc101628 + #x2e331d0b + #xcec9db09 + #x33595224 + #xe3e9f80f + #x3310e3da + #x9152433 + #x2e120405 + #x10121c32 + #x21190e0c + #xbfcaed13 + #x405133fd + #xeb071823 + #x28eec9d2 + #x21e3b48 + #x110a07fb + #x1823342c + #xd181713 + #xe0ee0307 + #x344f390a + #xff130d14 + #x1eddc2da + #xfc1f3e42 + #x10100af6 + #x2c302f21 + #x17211a1f + #xe7eefb07 + #x2c51390e + #x150ef4fd + #x9cdc6f2 + #xf61f3e39 + #x171b0df1 + #x44361f14 + #x21251f32 + #xe4eefc10 + #x324e2c02 + #x17eed6f6 + #xf2cce313 + #xf51e3423 + #x26280eee + #x4e2c1015 + #x28222847 + #xdcf50e21 + #x33411ef9 + #xf8c2c6fc + #xe5e30921 + #xf6182109 + #x362f0dee + #x451e0e25 + #x2823334e + #xe407222c + #x29341cfd + #xcca0c2fd + #xee092613 + #xfb0b04f1 + #x40300bf2 + #x371c1c37 + #x29253442 + #xf41a3234 + #x233a26fd + #xa68db8f4 + #x62a2cf5 + #xfbfbeae5 + #x49300bf6 + #x2f293649 + #x281e2530 + #xfd25403d + #x364b26ee + #x8e80acf4 + #x1e3a21d9 + #xf5ead9e8 + #x4f2f09f8 + #x303a515d + #x1a0b1426 + #xa324e3d + #x534e17e0 + #x8380b00a + #x2a3b14c6 + #xeee1d6f4 + #x4f2304f6 + #x3249646a + #x9ff0d23 + #x2a424f2c + #x5f3706f1 + #x8080cf2f + #x2c370bb8 + #xece3ddfc + #x4213fdf5 + #x32537270 + #x404101f + #x52493714 + #x4b1f0918 + #x809cfc45 + #x2a33fba6 + #xf5ebe4ff + #x3402f8f8 + #x33607f6e + #x18181114 + #x5937150a + #x2f171429 + #x80c61f41 + #x2925dd8f + #x4f1e4ff + #x28f9f904 + #x3a707f68 + #x34260a0a + #x2d11021b + #x1b1b1007 + #x9beb2a2c + #x2204b784 + #x11f2e300 + #x1bf80317 + #x42797f5c + #x492c0409 + #xeff50d39 + #x1711efd0 + #xc403231b + #xadca098 + #x15f2e7fd + #x13ff1426 + #x45797f4f + #x532d060d + #xd5f62953 + #xbeecbb6 + #xe80e1c15 + #xe7bba7c1 + #x14f6eaf2 + #x1309232c + #x40747745 + #x5c34090b + #xea0e4160 + #xe8c5bdcc + #xff171e0a + #xc6b3c1e5 + #x11fce8dc + #x17142c29 + #x396e7042 + #x6b3b0403 + #x10234968 + #xbbb4d2f4 + #x11231bea + #xb8bbd7f8 + #x14fdddc6 + #x1e1c2c26 + #x376d6b44 + #x793af9f9 + #x17264b77 + #xa0c6ef02 + #x282d02bb + #xbbc5e109 + #x17f9d3be + #x221f2825 + #x406d6742 + #x7b2deefb + #x1f537f + #xaae8fdea + #x3e1ed398 + #xbfc1e421 + #x17f9d9c6 + #x211c2322 + #x496e633e + #x6a1bec06 + #xea1f647f + #xccfdf6cc + #x3ef8a997 + #xb4b7f13b + #x1507eccd + #x1b1b1f1e + #x556b5d37 + #x5511f61c + #xf42c717f + #xebffe8c4 + #x23cc99b0 + #xa0b60748 + #x1e2200c6 + #x17151817 + #x5d66512d + #x48130a34 + #x133a7174 + #xf6f6e3d5 + #xfcb4a7cd + #x94c61f3b + #x334004b3 + #x140b0b15 + #x61584026 + #x441c234c + #x2a416867 + #xf4f2e7ea + #xdeb4bedc + #x99dd231e + #x524cf6a0 + #x11fc0023 + #x5d443026 + #x40293e5c + #x32475f59 + #xf2f5ebf6 + #xd3bfcce0 + #xaaea1704 + #x6d47e099 + #x7ef0340 + #x4e322926 + #x373b5561 + #x344b5345 + #xf6f9f404 + #xd6c6d5e5 + #xbeee09fb + #x7132d0a3 + #xfbec175a + #x3a23251e + #x304e645a + #x3e493b29 + #xfbfd061c + #xd9cce0f1 + #xcfef06fd + #x611ed0b6 + #xf4f82d61 + #x2a1e2111 + #x325f674b + #x47391a11 + #xfd0a2239 + #xd7d3ebf9 + #xddf607fc + #x4815ddc9 + #xf80a3956 + #x1f1a1b09 + #x39665f3a + #x3d1cf902 + #x3224045 + #xd7ddf4f9 + #xef0006f2 + #x3415eadd + #x618363e + #x1515150d + #x42644e29 + #x1cf9e100 + #x10404f3a + #xdae3f2f9 + #x60a00e8 + #x2817f8f4 + #x151b2829 + #x10111518 + #x485a3a1b + #xf1d9d607 + #x28564e1f + #xdde4f202 + #x1a0bf4e3 + #x1e170610 + #x1c151718 + #x10101b26 + #x44442511 + #xccc8dc13 + #x3e5d4103 + #xdde8fd15 + #x2806e4dc + #x15171b2a + #x1e0d090b + #xe112530 + #x32291710 + #xc1ccef18 + #x495a39f2 + #xdeef0a26 + #x30fdd9d7 + #xd1a293d + #x1c070304 + #xe152d36 + #x1e151111 + #xc4d9ff1a + #x454d20f1 + #xfd1d1a21 + #xed4c0d5 + #x3284742 + #x607fff5 + #x1d2c3218 + #x141a0e13 + #xdef3fc02 + #x3f5325f5 + #x10170613 + #xfdc6c6eb + #x22b473b + #xd0effee + #x2e2c2211 + #x1e1b1422 + #xd8ecf809 + #x40511eee + #x18fdec09 + #xe7bdda0c + #x32e4028 + #x1b1bfde8 + #x3f251111 + #x241d213c + #xd1eb0016 + #x42420de1 + #xd5db0e + #xd7ce0020 + #x72a2f0d + #x2c21fbe9 + #x3d170c1d + #x221d334d + #xdafb1624 + #x382c04e2 + #xd5b6d811 + #xdef62016 + #x91e11f3 + #x3524fbee + #x3111162e + #x20213c4a + #xf210272b + #x2a2509ee + #xaea4d409 + #xfb202af5 + #x609f3e8 + #x3b24fff3 + #x271a2b3c + #x1e1e3239 + #xc223631 + #x2e2f0ef1 + #x9195c4fd + #x1e381dd1 + #xfbf1deef + #x422503f5 + #x2a2c424d + #x160e2131 + #x21324533 + #x473809f2 + #x8083b90a + #x323b0db8 + #xecddd8ff + #x452003f3 + #x3240595e + #x6001831 + #x3f464a27 + #x592eff07 + #x8080ca2a + #x393800ab + #xe7d7de0d + #x4013fdf1 + #x39516e6b + #xf9fd182e + #x6151360d + #x4c180431 + #x809bf645 + #x3b35f3a1 + #xebdde513 + #x3204f8f2 + #x3f637b6a + #xa1622 + #x684011fb + #x2f0e1445 + #x80c71d43 + #x3c2ada8d + #xf6e2e816 + #x20fbf5fb + #x46727f5e + #x1a170e18 + #x3d18f806 + #x1b161727 + #x93ec2c2f + #x380cb580 + #x2e5e817 + #x10f6fd0a + #x507f7f4d + #x311b0417 + #xfdf5ff25 + #x1b16fce8 + #xb303251d + #x21e19580 + #x6e5eb17 + #x6fb0e18 + #x597f7e40 + #x3c18021d + #xd8ef1e43 + #x16f9d4c2 + #xd70c1a16 + #xfbbc97a5 + #x6e9ef0a + #x4062021 + #x597f7535 + #x4318021e + #xe5063b54 + #xf9cebcca + #xf1111810 + #xd1aeb2ce + #x7f1eeef + #xa142b22 + #x537c6a31 + #x50200217 + #x7204760 + #xcab2c4ee + #x31b1af5 + #xbab8d1eb + #xcf3dfd1 + #x13212e20 + #x4f756131 + #x6021f60d + #x18284d6e + #xa8badf00 + #x1a2504c7 + #xbac6e400 + #x11efcebf + #x1b252c22 + #x50725e32 + #x6316e909 + #xc25577f + #xa8d7f1ef + #x311dd79c + #xbfcaec18 + #x10e9c7bd + #x1d252a22 + #x56715b31 + #x5604e411 + #xfd27677f + #xc6f1ebd4 + #x36f8a591 + #xb9c4fb36 + #xaeed3c4 + #x1a22281e + #x5e6f592e + #x40f9ec22 + #x735757f + #xe7f5ddce + #x1ec98ea6 + #xa6c61849 + #xc02e5bf + #x171e2116 + #x656b5028 + #x35f8fd39 + #x25467971 + #xf6ecd5e2 + #xf5a998c6 + #x97d53240 + #x2220ecac + #x16161414 + #x6a614224 + #x2f00144c + #x3b517265 + #xf3e5d8f9 + #xd0a5b3d8 + #x9aec3921 + #x4632df97 + #x13060722 + #x634c3122 + #x2c102e59 + #x3b546a59 + #xeee5df03 + #xc2b2c6de + #xacfc2b02 + #x652fc78e + #x7f60740 + #x51382a21 + #x2a28495d + #x3856604a + #xece5e80c + #xc2bdcedf + #xc2ff16f1 + #x6f1bb595 + #xf8ef1a61 + #x3c2c2c1a + #x2b435b56 + #x42534a35 + #xefe7f620 + #xc7c4d5e7 + #xd0f809ee + #x6106b2a6 + #xecf9366f + #x2b2a2c0d + #x32596047 + #x53462c20 + #xf1f31339 + #xcacde1ec + #xdaf807ec + #x49fdbdba + #xee0d4967 + #x21252402 + #x3f615738 + #x4f280a14 + #xf8102f43 + #xcdd7e9ef + #xe7ff07e8 + #x35ffcecd + #xfc1e474f + #x1a1d1700 + #x4a60472a + #x2c03ee11 + #xc334035 + #xd0dee9f1 + #xf80700e1 + #x2b04dfe2 + #xc243638 + #x1313110c + #x5357381e + #xfddfe118 + #x284f3f14 + #xd4dfebfb + #xa07f5dd + #x2507f1fc + #x141d2227 + #xe0e181a + #x51472816 + #xd7cae121 + #x425731f3 + #xd4dff210 + #x1800e8d8 + #x1e0d0718 + #x1410111a + #xc112525 + #x43321a10 + #xc4c6eb24 + #x505622e4 + #xd7ee0424 + #x1ef5d8d1 + #x13162231 + #xe07070c + #xa17312a + #x2c1e110d + #xc7d5f91e + #x53531be1 + #xdfff1431 + #x20e9cecc + #xa1e3540 + #x90203ff + #xa1e362a + #x1814100d + #xd3e70216 + #x4e4a10e1 + #x131f152a + #xedb9bee6 + #xf3a5335 + #x602f3f4 + #x27342209 + #x180e0613 + #xd7ecf408 + #x534b0cdd + #x190b0022 + #xd8b5d002 + #x123d4e27 + #x1209efef + #x3128130b + #x1b0e162a + #xd4e7fc13 + #x543e00d3 + #xce7ed24 + #xc5bef31b + #x183d3e0b + #x2210eaed + #x34180b15 + #x1b132c43 + #xdaef0b21 + #x4a25f1d1 + #xe3c8ea28 + #xc8e41816 + #x1c3421ed + #x2c10eaf1 + #x280e1325 + #x181c4048 + #xf0031f27 + #x3412f0e1 + #xb9b9ea21 + #xe61224f3 + #x181c00e0 + #x3110eff7 + #x1c122434 + #x1622403e + #xc192f2a + #x2813f9f6 + #x9cb1e010 + #xf2f18ca + #x8fce7ea + #x3513f6fa + #x1c213843 + #x12183132 + #x242e3b28 + #x341cfd05 + #x869ccd0e + #x2e3702ac + #xf1dede03 + #x3a13fcf6 + #x28344b53 + #x208242f + #x3b43401c + #x4418fc1c + #x808ad025 + #x3e34f39c + #xe0d0e419 + #x3b0ffaf0 + #x35485f5f + #xf0032431 + #x56533203 + #x410b0541 + #x8095f041 + #x4632e690 + #xdbceed25 + #x3108f4ec + #x405f7360 + #xef0c222b + #x604a12ed + #x28031b59 + #x80bb1847 + #x4a2ad180 + #xe6d7f32a + #x1ffdf1f0 + #x4a737c57 + #xff151924 + #x411ff3ef + #x160e2541 + #x8ce32b34 + #x470fb180 + #xf0dbf42c + #xcf7f9ff + #x577f7c44 + #x15120b24 + #x2f3f10b + #x16131003 + #xafff2521 + #x32e48f80 + #xf4def72e + #xfff9090e + #x697f7832 + #x2409052c + #xd3e40e2c + #x1902e3ce + #xd00b161b + #xbbb838d + #xf3e1ff25 + #xfa031c15 + #x727f6d25 + #x2b090834 + #xd3f72f43 + #x5d7c1c8 + #xe70c1518 + #xdba698b2 + #xf4e9ff09 + #x152a16 + #x6f7f601e + #x370f0831 + #xf316434e + #xd8b4bee6 + #xf9131805 + #xbeaebcd5 + #xfdeff1e3 + #xe242c18 + #x697f561e + #x4410ff27 + #xc274b5f + #xafafd5fd + #xe1f09d7 + #xb8c4d8ef + #x6ead7c5 + #x192c2c1c + #x66785121 + #x4a08f121 + #xc2a5972 + #xa5c5e7f7 + #x281cdda6 + #xbfd0e709 + #x6dec5bc + #x1f2c2c22 + #x66735024 + #x41f6e922 + #x32c6c7e + #xbbdee6e3 + #x31fca890 + #xbed0fa28 + #xffdac5bf + #x1f2b2e21 + #x69725027 + #x2ee6e92e + #xc3d7e79 + #xdde6d7e0 + #x1cc887a0 + #xaed31b40 + #xfae6d4bc + #x1f2a2b16 + #x6d6d4824 + #x1fe3f63d + #x24507f6c + #xedddd0f3 + #xf19f8cc1 + #x9fe73d3e + #xcffdaab + #x1e221c10 + #x72633a1f + #x18ec0c4d + #x35607e5d + #xecd4d306 + #xc793a6d8 + #xa0024a22 + #x2f13ce93 + #x19130c1c + #x6c512e1c + #x15fd2557 + #x35647653 + #xe4d1db09 + #xb2a0bee0 + #xb5153afc + #x5415b586 + #xe00093b + #x59402a1e + #x1215405c + #x32646d44 + #xe1d1e30e + #xb2b1c8e0 + #xcb151ce3 + #x63039f8c + #xfaf61f62 + #x43342e16 + #x16325356 + #x40605c32 + #xe0d1f121 + #xb9bbcde1 + #xda0b08da + #x5aec999c + #xeafc4179 + #x31322f08 + #x284e5c47 + #x57533d22 + #xe0db0b41 + #xbfc2d4e6 + #xde0300d8 + #x41dea3af + #xe7105a76 + #x273125f9 + #x415d5435 + #x5a371b1e + #xe7f9274e + #xc4cddbe6 + #xe40500d7 + #x2be0b7c1 + #xf4275d60 + #x212715f3 + #x515d4628 + #x3a0f0022 + #xfd21383e + #xcad7dee7 + #xf10bfcd3 + #x21e7c8d4 + #x9314d47 + #x1b190bfc + #x5653371f + #x6eaf128 + #x1f403519 + #xd0dadef3 + #x20bf1d1 + #x1fefdbea + #x162b3537 + #x12120f0c + #x53462b18 + #xddd0ed2e + #x414d25f6 + #xd0dae60c + #xe03e6ce + #x1bf9f405 + #x151b212a + #xb131e18 + #x4a371f10 + #xc8c7f332 + #x564d13e0 + #xcee3f727 + #x10f4d8c8 + #x1306121e + #xe0b131c + #x91e2e1e + #x3a27160b + #xbfcdfc2e + #x574809da + #xdbfa0f34 + #xee4cbc4 + #xc182f31 + #x603080c + #xe28341b + #x24180e08 + #xc5de001f + #x534808db + #xef101e35 + #x6d8c1c7 + #xb25463d + #x20200ff + #x122c3215 + #x15120906 + #xd0ec020f + #x5a3b00db + #x24100d39 + #xd0b0cd06 + #x224d501b + #xefdebf8 + #x31321307 + #x1402091a + #xe2e4fc1a + #x5e31f6d4 + #x16f8033d + #xc0bdeb18 + #x284f4603 + #x17ffe5f9 + #x2f210e10 + #x11071e2e + #xe2eb0c21 + #x561de8d3 + #xf8de0045 + #xbcdd101b + #x2b472be4 + #x20ffe4fc + #x25111120 + #x1016383c + #xecfb1d27 + #x3c06e2de + #xd0d1063d + #xd40921fc + #x28310ad4 + #x24fde803 + #x160e202e + #x11254236 + #x2112b24 + #x24fdebf3 + #xb6ceff28 + #xff2814d3 + #x1b10f1df + #x2800f207 + #x141b313b + #x1125392b + #x17273221 + #x2004f607 + #xa5c0ec18 + #x2531fbb3 + #x3efe9fd + #x2e06f904 + #x1e2c4046 + #x9182c27 + #x2a3c3817 + #x2b07fd1d + #x8da6e221 + #x392be59e + #xe9daf11d + #x320afbfb + #x2e40504f + #xf6102a2a + #x3f4d2f02 + #x2bff0a3c + #x809bf539 + #x4327d78b + #xded7fd2f + #x2e0af8ef + #x3c546151 + #xec132a2a + #x4f4713e8 + #x1afb2256 + #x80af1643 + #x4d22c980 + #xdddd0636 + #x2103f3ec + #x476a6e4a + #xf61b222a + #x4024f2df + #xc09364a + #x8ada2c36 + #x5013b380 + #xe1e1093d + #x10fbf5f2 + #x5a7f723d + #x917182e + #xef5e7f3 + #x101a2a16 + #xb2fd2a22 + #x3fef9780 + #xe5e20e43 + #x3f903fd + #x717f6e2e + #x140a103b + #xdadffb11 + #x1811ffdb + #xd40c1a1d + #x18c3808d + #xe5e5173d + #xfb021407 + #x7f7f611e + #x17021147 + #xcaee1b28 + #x10ebd1c6 + #xe80a1620 + #xe8a487a9 + #xe8ee1b24 + #xfd13220c + #x7f7f4f11 + #x1d06164c + #xe10d3333 + #xe9c2c3da + #xf30d1a14 + #xc4a6a6c7 + #xf1f30cf9 + #xa24280e + #x7f7e420d + #x2a0a1045 + #xfd224243 + #xbdb0d3f3 + #x41813ee + #xbcbdc7e1 + #xfbf1eed4 + #x1a2e2814 + #x78743d13 + #x3204043b + #x92a5159 + #xa9c0e5f9 + #x1e1beebc + #xc4d1ddf9 + #xfce2d3c3 + #x242f2b1b + #x726e3d1b + #x2ef3f839 + #x6326868 + #xb6d5e8ec + #x2c02b99f + #xc9d8f31a + #xf5d4c9c4 + #x272f311d + #x6f6a3d21 + #x1de2f53c + #x9427968 + #xd3dfdde7 + #x1ed093a6 + #xbfdf1436 + #xeed5d0c4 + #x272f2f16 + #x72673c22 + #xcddfc45 + #x18567e57 + #xe2d7d5f3 + #xf3a190c3 + #xb2f3383b + #xf9e8d5b5 + #x282e2510 + #x75613320 + #xffe20d4f + #x2b657846 + #xe1cdd802 + #xc78ea6db + #xb5134920 + #x18fdca9e + #x25211618 + #x71512a1e + #xf9f12259 + #x316b713b + #xdac7e107 + #xae97bfe4 + #xcc2c3ff9 + #x3b02b08e + #x1a0e1133 + #x5e42251b + #xfb07395e + #x356a6b31 + #xd5c7e909 + #xacabcae4 + #xe73122db + #x4cf19891 + #x6ff2459 + #x49382a18 + #x3254d59 + #x47685e25 + #xd4c9f61e + #xb5b9cee2 + #xf22406ce + #x43d791a2 + #xf2024775 + #x36382e0c + #x1a405149 + #x6361471a + #xd1d30d42 + #xbcc0d4e2 + #xf213f9cc + #x2ec698b5 + #xeb186779 + #x313925fb + #x364f4935 + #x674a2a1b + #xd4e92756 + #xc2c9d8df + #xef0ef6cc + #x1ac6a9c2 + #xf633726a + #x2f3213ee + #x4c513b28 + #x45251127 + #xe80e3547 + #xc9d1dadf + #xf610f3cc + #x11cebccd + #xc426453 + #x2a2403f2 + #x534a3122 + #xeff0632 + #xd2e3221 + #xd0d4d8eb + #x20eeccd + #xedacdde + #x1d3c4c42 + #x1e170402 + #x4f422a1d + #xe4e40338 + #x333d21fc + #xd0d4de06 + #xc07e2cd + #xee5e2f5 + #x1d2a3535 + #x13161311 + #x46382414 + #xc9d50439 + #x4c3f0de4 + #xcedaf125 + #xefcdac7 + #xaf5000d + #x1417252a + #xd202217 + #x3b2b1a0a + #xb9d30936 + #x5339ffd5 + #xd4ec0c3c + #x9ebcdc2 + #x7091d20 + #x90a181b + #x132e2b14 + #x2e211104 + #xb5db0e2f + #x5036fbd3 + #xee061d3f + #xfbd5c2ca + #xd21392a + #x404090c + #x1d36280c + #x20140a06 + #xc3e70a21 + #x4f36ffd7 + #x71b2439 + #xeec4badb + #x14364c2c + #x302fc04 + #x27392204 + #x160d0409 + #xd7ee0411 + ) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc index 3a0646683e..85918adbc7 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-h.gc @@ -7,3 +7,904 @@ ;; DECOMP BEGINS +(deftype ocean-corner (structure) + ((bsphere sphere :inline :offset-assert 0) + (start-corner vector :inline :offset-assert 16) + (y-scales vector :inline :offset-assert 32) + (alphas vector :inline :offset-assert 48) + (colors uint32 4 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype ocean-wave-info (structure) + ((frequency float :offset-assert 0) + (amplitude float :offset-assert 4) + (wave-speed float :offset-assert 8) + (angle float :offset-assert 12) + (kx float :offset-assert 16) + (ky float :offset-assert 20) + (w float :offset-assert 24) + (flags int32 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype ocean-vertex (structure) + ((pos vector :inline :offset-assert 0) + (stq vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype ocean-spheres (structure) + ((spheres sphere 36 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x240 + :flag-assert #x900000240 + ) + +(deftype ocean-colors (structure) + ((colors rgba 2548 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x27d0 + :flag-assert #x9000027d0 + ) + +(deftype ocean-colors-float (structure) + ((colors vector 2548 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x9f40 + :flag-assert #x900009f40 + ) + +(deftype ocean-mid-mask (structure) + ((mask uint8 8 :offset-assert 0) + (dword uint64 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype ocean-mid-indices (basic) + ((data uint16 36 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +(deftype ocean-mid-masks (basic) + ((data (inline-array ocean-mid-mask) :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype ocean-trans-mask (structure) + ((mask uint8 4 :offset-assert 0) + (word int32 :offset 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype ocean-trans-index (structure) + ((parent int16 :offset-assert 0) + (child int16 :offset-assert 2) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype ocean-trans-indices (basic) + ((data ocean-trans-index 2304 :inline :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x2404 + :flag-assert #x900002404 + ) + +(deftype ocean-near-index (structure) + ((data uint16 16 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype ocean-near-indices (basic) + ((data (inline-array ocean-near-index) :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype ocean-near-colors (structure) + ((color0 vector :inline :offset-assert 0) + (color1 vector :inline :offset-assert 16) + (color2 vector :inline :offset-assert 32) + (color3 vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype ocean-trans-strip (structure) + ((verts uint128 10 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +(deftype ocean-trans-strip-array (structure) + ((data ocean-trans-strip 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x280 + :flag-assert #x900000280 + ) + +(deftype ocean-wave-data (structure) + ((data uint8 1024 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x400 + :flag-assert #x900000400 + ) + +(deftype ocean-wave-frames (structure) + ((frame ocean-wave-data 64 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10000 + :flag-assert #x900000000 + ) + +(deftype ocean-texture-constants (structure) + ((giftag gs-gif-tag :inline :offset-assert 0) + (buffers vector4w :inline :offset-assert 16) + (dests vector4w :inline :offset-assert 32) + (start vector :inline :offset-assert 48) + (offsets vector :inline :offset-assert 64) + (constants vector :inline :offset-assert 80) + (cam-nrm vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype ocean-mid-vertex (structure) + ((stq vector :inline :offset-assert 0) + (col vector :inline :offset-assert 16) + (pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype ocean-mid-constants (structure) + ((hmge-scale vector :inline :offset-assert 0) + (inv-hmge-scale vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (fog vector :inline :offset-assert 48) + (constants vector :inline :offset-assert 64) + (constants2 vector :inline :offset-assert 80) + (drw-fan gs-gif-tag :inline :offset-assert 96) + (env-fan gs-gif-tag :inline :offset-assert 112) + (drw-adgif gs-gif-tag :inline :offset-assert 128) + (drw-texture adgif-shader :inline :offset-assert 144) + (drw-strip-0 gs-gif-tag :inline :offset-assert 224) + (drw-strip-1 gs-gif-tag :inline :offset-assert 240) + (env-adgif gs-gif-tag :inline :offset-assert 256) + (env-texture adgif-shader :inline :offset-assert 272) + (env-strip gs-gif-tag :inline :offset-assert 352) + (env-color vector :inline :offset-assert 368) + (index-table vector4w 8 :inline :offset-assert 384) + (pos0 vector :inline :offset-assert 512) + (pos1 vector :inline :offset-assert 528) + (pos2 vector :inline :offset-assert 544) + (pos3 vector :inline :offset-assert 560) + ) + :method-count-assert 9 + :size-assert #x240 + :flag-assert #x900000240 + ) + +(deftype ocean-mid-upload (structure) + ((rot matrix :inline :offset-assert 0) + (matrix matrix :inline :offset-assert 64) + (colors uint128 108 :offset-assert 128) + (masks uint128 2 :offset-assert 1856) + ) + :method-count-assert 9 + :size-assert #x760 + :flag-assert #x900000760 + ) + +(deftype ocean-mid-upload2 (structure) + ((rot matrix :inline :offset-assert 0) + (matrix matrix :inline :offset-assert 64) + (count vector4w :inline :offset-assert 128) + (tex0 vector :inline :offset-assert 144) + (tex1 vector :inline :offset-assert 160) + (tex2 vector :inline :offset-assert 176) + (tex3 vector :inline :offset-assert 192) + (clr0 vector :inline :offset-assert 208) + (clr1 vector :inline :offset-assert 224) + (clr2 vector :inline :offset-assert 240) + (clr3 vector :inline :offset-assert 256) + (verts uint128 18 :offset-assert 272) + ) + :method-count-assert 9 + :size-assert #x230 + :flag-assert #x900000230 + ) + +(deftype ocean-mid-work (structure) + ((env0 vector :inline :offset-assert 0) + (env1 vector :inline :offset-assert 16) + (env2 vector :inline :offset-assert 32) + (hmg0 vector :inline :offset-assert 48) + (hmg1 vector :inline :offset-assert 64) + (hmg2 vector :inline :offset-assert 80) + (indices uint128 16 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x160 + :flag-assert #x900000160 + ) + +(deftype ocean-near-constants (structure) + ((hmge-scale vector :inline :offset-assert 0) + (inv-hmge-scale vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (fog vector :inline :offset-assert 48) + (constants vector :inline :offset-assert 64) + (constants2 vector :inline :offset-assert 80) + (constants3 vector :inline :offset-assert 96) + (constants4 vector :inline :offset-assert 112) + (constants5 vector :inline :offset-assert 128) + (drw-fan gs-gif-tag :inline :offset-assert 144) + (drw2-fan gs-gif-tag :inline :offset-assert 160) + (env-fan gs-gif-tag :inline :offset-assert 176) + (drw-adgif gs-gif-tag :inline :offset-assert 192) + (drw-texture adgif-shader :inline :offset-assert 208) + (drw-strip gs-gif-tag :inline :offset-assert 288) + (env-adgif gs-gif-tag :inline :offset-assert 304) + (env-texture adgif-shader :inline :offset-assert 320) + (env-strip gs-gif-tag :inline :offset-assert 400) + (env-color vector :inline :offset-assert 416) + (drw2-adgif gs-gif-tag :inline :offset-assert 432) + (drw2-tex0 qword :inline :offset-assert 448) + (drw2-frame qword :inline :offset-assert 464) + (drw2-strip gs-gif-tag :inline :offset-assert 480) + (drw3-adgif gs-gif-tag :inline :offset-assert 496) + (drw3-frame qword :inline :offset-assert 512) + (index-table vector4w 4 :inline :offset-assert 528) + ) + :method-count-assert 9 + :size-assert #x250 + :flag-assert #x900000250 + ) + +(deftype ocean-near-upload (structure) + ((rot matrix :inline :offset-assert 0) + (matrix matrix :inline :offset-assert 64) + (masks uint128 2 :offset-assert 128) + (start-height vector4w :inline :offset-assert 160) + (start-st vector :inline :offset-assert 176) + (near-colors ocean-near-colors :inline :offset-assert 192) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +(deftype ocean-near-vertex (structure) + ((stq vector :inline :offset-assert 0) + (clr vector :inline :offset-assert 16) + (pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype ocean-near-work (structure) + ((verts-ptr vector :inline :offset-assert 0) + (indices uint128 16 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x110 + :flag-assert #x900000110 + ) + +(deftype ocean-height-array (structure) + ((data float 1024 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x1000 + :flag-assert #x900001000 + ) + +(deftype ocean-vert-array (structure) + ((data vector 2048 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8000 + :flag-assert #x900008000 + ) + +(deftype ocean-map (structure) + ((start-corner vector :inline :offset-assert 0) + (far-color vector :inline :offset-assert 16) + (ocean-spheres ocean-spheres :offset-assert 32) + (ocean-colors ocean-colors :offset-assert 36) + (ocean-mid-indices ocean-mid-indices :offset-assert 40) + (ocean-trans-indices ocean-trans-indices :offset-assert 44) + (ocean-near-indices ocean-near-indices :offset-assert 48) + (ocean-mid-masks ocean-mid-masks :offset-assert 52) + ) + :method-count-assert 11 + :size-assert #x38 + :flag-assert #xb00000038 + (:methods + (ocean-map-method-9 () none 9) + (ocean-map-method-10 () none 10) + ) + ) + +(deftype ocean (ocean-map) + ((off basic :offset-assert 56) + (near-off basic :offset-assert 60) + (mid-off basic :offset-assert 64) + (far-on basic :offset-assert 68) + (ocean-facing uint32 :offset-assert 72) + (heights ocean-height-array :offset-assert 76) + (heights2 ocean-height-array :offset-assert 80) + (verts ocean-vert-array :offset-assert 84) + (ocean-near-translucent? basic :offset-assert 88) + (deltas vector :inline :offset-assert 96) + (map-min vector :inline :offset-assert 112) + (map-max vector :inline :offset-assert 128) + (interp vector :inline :offset-assert 144) + (corner-array ocean-corner 25 :inline :offset-assert 160) + (corner-count int32 :offset-assert 2160) + (temp-vecs vector 4 :inline :offset-assert 2176) + (mid-mask-ptrs pointer 36 :offset-assert 2240) + (mid-camera-masks uint64 36 :offset-assert 2384) + (trans-mask-ptrs pointer 64 :offset-assert 2672) + (trans-camera-masks uint32 16 :offset-assert 2928) + (trans-temp-masks uint32 16 :offset-assert 2992) + (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) + (sprite-tmpl3 dma-gif-packet :inline :offset-assert 3120) + (adgif-tmpl dma-gif-packet :inline :offset-assert 3152) + (line-tmpl dma-gif-packet :inline :offset-assert 3184) + (sun-tmpl dma-gif-packet :inline :offset-assert 3216) + (erase-tmpl dma-gif-packet :inline :offset-assert 3248) + (haze-tmpl dma-gif-packet :inline :offset-assert 3280) + (cloud-tmpl dma-gif-packet :inline :offset-assert 3312) + (clut-tmpl dma-gif-packet :inline :offset-assert 3344) + (cloud-lights cloud-lights :inline :offset-assert 3376) + (haze-lights haze-lights :inline :offset-assert 3536) + (constant vector :inline :offset-assert 3664) + (sky-color vector :inline :offset-assert 3680) + (haze-verts vector4w 32 :inline :offset-assert 3696) + (cloud-verts vector4w 36 :inline :offset-assert 4208) + (cloud-nrms vector 36 :inline :offset-assert 4784) + (cloud-col0 vector 36 :inline :offset-assert 5360) + (cloud-col1 vector 36 :inline :offset-assert 5936) + (cloud-st0 vector 36 :inline :offset-assert 6512) + (cloud-st1 vector 36 :inline :offset-assert 7088) + (color80808080 vector4w :inline :offset-assert 7664) + (color80808040 vector4w :inline :offset-assert 7680) + (color80808000 vector4w :inline :offset-assert 7696) + (st0000 vector :inline :offset-assert 7712) + (st0505 vector :inline :offset-assert 7728) + (st1010 vector :inline :offset-assert 7744) + (uv00 vector4w :inline :offset-assert 7760) + (uv44 vector4w :inline :offset-assert 7776) + (uv88 vector4w :inline :offset-assert 7792) + (uv1010 vector4w :inline :offset-assert 7808) + (uv2020 vector4w :inline :offset-assert 7824) + (uv4040 vector4w :inline :offset-assert 7840) + (uv8080 vector4w :inline :offset-assert 7856) + (xy00 vector4w :inline :offset-assert 7872) + (xy88 vector4w :inline :offset-assert 7888) + (xy1010 vector4w :inline :offset-assert 7904) + (xy2020 vector4w :inline :offset-assert 7920) + (xy4040 vector4w :inline :offset-assert 7936) + (xy8080 vector4w :inline :offset-assert 7952) + (cloud-alpha uint8 36 :offset-assert 7968) + (near-mask-indices uint16 16 :offset-assert 8004) + (mid-minx uint8 :offset-assert 8036) + (mid-maxx uint8 :offset-assert 8037) + (mid-minz uint8 :offset-assert 8038) + (mid-maxz uint8 :offset-assert 8039) + (near-minx uint8 :offset-assert 8040) + (near-maxx uint8 :offset-assert 8041) + (near-minz uint8 :offset-assert 8042) + (near-maxz uint8 :offset-assert 8043) + (temp-minx uint8 :offset-assert 8044) + (temp-maxx uint8 :offset-assert 8045) + (temp-minz uint8 :offset-assert 8046) + (temp-maxz uint8 :offset-assert 8047) + (tex1 uint64 :offset-assert 8048) + (tex1-near uint64 :offset-assert 8056) + (corner00 float :offset-assert 8064) + (corner01 float :offset-assert 8068) + (corner10 float :offset-assert 8072) + (corner11 float :offset-assert 8076) + (frame-num float :offset-assert 8080) + (frame-speed float :offset-assert 8084) + (frame-num2 float :offset-assert 8088) + (frame-speed2 float :offset-assert 8092) + (cloud-interp float :offset 3676) + (scales vector :inline :offset-assert 8096) + (mask-hi vector4w :inline :offset-assert 8112) + (mask-lo vector4w :inline :offset-assert 8128) + (lights vu-lights :inline :offset-assert 8144) + (uv-scroll-0 vector4w :inline :offset-assert 8256) + (uv-scroll-1 vector4w :inline :offset-assert 8272) + (st-scroll vector2 :inline :offset-assert 8288) + (wait-to-vu0 uint32 :offset-assert 8296) + ) + :method-count-assert 92 + :size-assert #x206c + :flag-assert #x5c0000206c + (:methods + (ocean-method-11 () none 11) + (ocean-method-12 () none 12) + (ocean-method-13 () none 13) + (ocean-method-14 () none 14) + (ocean-method-15 () none 15) + (ocean-method-16 () none 16) + (ocean-method-17 () none 17) + (ocean-method-18 () none 18) + (ocean-method-19 () none 19) + (ocean-method-20 () none 20) + (ocean-method-21 () none 21) + (ocean-method-22 () none 22) + (ocean-method-23 () none 23) + (ocean-method-24 () none 24) + (ocean-method-25 () none 25) + (ocean-method-26 () none 26) + (ocean-method-27 () none 27) + (ocean-method-28 () none 28) + (ocean-method-29 () none 29) + (ocean-method-30 () none 30) + (ocean-method-31 () none 31) + (ocean-method-32 () none 32) + (ocean-method-33 () none 33) + (ocean-method-34 () none 34) + (ocean-method-35 () none 35) + (ocean-method-36 () none 36) + (ocean-method-37 () none 37) + (ocean-method-38 () none 38) + (ocean-method-39 () none 39) + (ocean-method-40 () none 40) + (ocean-method-41 () none 41) + (ocean-method-42 () none 42) + (ocean-method-43 () none 43) + (ocean-method-44 () none 44) + (ocean-method-45 () none 45) + (ocean-method-46 () none 46) + (ocean-method-47 () none 47) + (ocean-method-48 () none 48) + (ocean-method-49 () none 49) + (ocean-method-50 () none 50) + (ocean-method-51 () none 51) + (ocean-method-52 () none 52) + (ocean-method-53 () none 53) + (ocean-method-54 () none 54) + (ocean-method-55 () none 55) + (ocean-method-56 () none 56) + (ocean-method-57 () none 57) + (ocean-method-58 () none 58) + (ocean-method-59 () none 59) + (ocean-method-60 () none 60) + (ocean-method-61 () none 61) + (ocean-method-62 () none 62) + (ocean-method-63 () none 63) + (ocean-method-64 () none 64) + (ocean-method-65 () none 65) + (ocean-method-66 () none 66) + (ocean-method-67 () none 67) + (ocean-method-68 () none 68) + (ocean-method-69 () none 69) + (ocean-method-70 () none 70) + (ocean-method-71 () none 71) + (ocean-method-72 () none 72) + (ocean-method-73 () none 73) + (ocean-method-74 () none 74) + (ocean-method-75 () none 75) + (ocean-method-76 () none 76) + (ocean-method-77 () none 77) + (ocean-method-78 () none 78) + (ocean-method-79 () none 79) + (ocean-method-80 () none 80) + (ocean-method-81 () none 81) + (ocean-method-82 () none 82) + (ocean-method-83 () none 83) + (ocean-method-84 () none 84) + (ocean-method-85 () none 85) + (ocean-method-86 () none 86) + (ocean-method-87 () none 87) + (ocean-method-88 () none 88) + (ocean-method-89 () none 89) + (ocean-method-90 () none 90) + (ocean-method-91 () none 91) + ) + ) + +(define *ocean-map* (the-as ocean-map #f)) + +(define *ocean* + (new 'static 'ocean + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :fst #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id uv) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id uv) + :regs4 (gif-reg-id xyz2) + ) + ) + :sprite-tmpl2 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe #x1) + :nreg #x3 + ) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyz2) :regs2 (gif-reg-id xyz2)) + ) + :sprite-tmpl3 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id uv) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id uv) + :regs4 (gif-reg-id xyz2) + ) + ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)) + ) + :line-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x141 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x141 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x40 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :tme #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id xyz2) + ) + ) + :sun-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1) + :nreg #x5 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id st) + :regs4 (gif-reg-id xyz2) + ) + ) + :erase-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite)) + :nreg #x3 + ) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyz2) :regs2 (gif-reg-id xyz2)) + ) + :haze-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x45 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x45 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x11 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x4 + ) + :gif1 (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) + ) + ) + :cloud-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x25 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x25 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x6 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x6 + ) + :gif1 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id st) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id rgbaq) + :regs4 (gif-reg-id st) + :regs5 (gif-reg-id xyzf2) + ) + ) + :clut-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 :nloop #x40 :eop #x1 :flg (gif-flag image)) + ) + :constant (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :haze-verts (new 'static 'inline-array vector4w 32 + (new 'static 'vector4w :x #x400 :y #x5c0 :z #xffffff) + (new 'static 'vector4w :x #x400 :y #x600 :z #xffffff) + (new 'static 'vector4w :x #x4a0 :y #x590 :z #xffffff) + (new 'static 'vector4w :x #x4c0 :y #x5e0 :z #xffffff) + (new 'static 'vector4w :x #x530 :y #x530 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x560 :z #xffffff) + (new 'static 'vector4w :x #x590 :y #x4a0 :z #xffffff) + (new 'static 'vector4w :x #x5e0 :y #x4c0 :z #xffffff) + (new 'static 'vector4w :x #x5c0 :y #x3f0 :z #xffffff) + (new 'static 'vector4w :x #x600 :y #x3f0 :z #xffffff) + (new 'static 'vector4w :x #x590 :y #x350 :z #xffffff) + (new 'static 'vector4w :x #x5e0 :y #x330 :z #xffffff) + (new 'static 'vector4w :x #x530 :y #x2c0 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x4a0 :y #x260 :z #xffffff) + (new 'static 'vector4w :x #x4c0 :y #x210 :z #xffffff) + (new 'static 'vector4w :x #x3f0 :y #x240 :z #xffffff) + (new 'static 'vector4w :x #x3f0 :y #x1f0 :z #xffffff) + (new 'static 'vector4w :x #x350 :y #x260 :z #xffffff) + (new 'static 'vector4w :x #x330 :y #x210 :z #xffffff) + (new 'static 'vector4w :x #x2c0 :y #x2c0 :z #xffffff) + (new 'static 'vector4w :x #x290 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x260 :y #x350 :z #xffffff) + (new 'static 'vector4w :x #x210 :y #x330 :z #xffffff) + (new 'static 'vector4w :x #x240 :y #x400 :z #xffffff) + (new 'static 'vector4w :x #x1f0 :y #x400 :z #xffffff) + (new 'static 'vector4w :x #x260 :y #x4a0 :z #xffffff) + (new 'static 'vector4w :x #x210 :y #x4c0 :z #xffffff) + (new 'static 'vector4w :x #x2c0 :y #x530 :z #xffffff) + (new 'static 'vector4w :x #x290 :y #x560 :z #xffffff) + (new 'static 'vector4w :x #x350 :y #x590 :z #xffffff) + (new 'static 'vector4w :x #x330 :y #x5e0 :z #xffffff) + ) + :cloud-verts (new 'static 'inline-array vector4w 36 + (new 'static 'vector4w :x #x290 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x310 :y #x230 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x200 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x200 :z #xffffff) + (new 'static 'vector4w :x #x4e0 :y #x230 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x230 :y #x310 :z #xffffff) + (new 'static 'vector4w :x #x300 :y #x300 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x2b0 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x2b0 :z #xffffff) + (new 'static 'vector4w :x #x4f0 :y #x300 :z #xffffff) + (new 'static 'vector4w :x #x5c0 :y #x310 :z #xffffff) + (new 'static 'vector4w :x #x200 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x2b0 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x380 :y #x380 :z #xffffff) + (new 'static 'vector4w :x #x470 :y #x380 :z #xffffff) + (new 'static 'vector4w :x #x540 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x5f0 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x200 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x2b0 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x380 :y #x470 :z #xffffff) + (new 'static 'vector4w :x #x470 :y #x470 :z #xffffff) + (new 'static 'vector4w :x #x540 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x5f0 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x230 :y #x4e0 :z #xffffff) + (new 'static 'vector4w :x #x300 :y #x4f0 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x540 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x540 :z #xffffff) + (new 'static 'vector4w :x #x4f0 :y #x4f0 :z #xffffff) + (new 'static 'vector4w :x #x5c0 :y #x4e0 :z #xffffff) + (new 'static 'vector4w :x #x290 :y #x560 :z #xffffff) + (new 'static 'vector4w :x #x310 :y #x5c0 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x5f0 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x5f0 :z #xffffff) + (new 'static 'vector4w :x #x4e0 :y #x5c0 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x560 :z #xffffff) + ) + :cloud-nrms (new 'static 'inline-array vector 36 + (new 'static 'vector :x -0.4999 :y 0.7071 :z -0.5) + (new 'static 'vector :x -0.3209 :y 0.7071 :z -0.63) + (new 'static 'vector :x -0.1105 :y 0.7071 :z -0.6984) + (new 'static 'vector :x 0.1105 :y 0.7071 :z -0.6983) + (new 'static 'vector :x 0.321 :y 0.7071 :z -0.63) + (new 'static 'vector :x 0.5 :y 0.7071 :z -0.4999) + (new 'static 'vector :x -0.63 :y 0.7071 :z -0.321) + (new 'static 'vector :x -0.3921 :y 0.832 :z -0.3922) + (new 'static 'vector :x -0.1434 :y 0.832 :z -0.5358) + (new 'static 'vector :x 0.1435 :y 0.832 :z -0.5357) + (new 'static 'vector :x 0.3922 :y 0.832 :z -0.3921) + (new 'static 'vector :x 0.63 :y 0.7071 :z -0.3209) + (new 'static 'vector :x -0.6983 :y 0.7071 :z -0.1106) + (new 'static 'vector :x -0.5357 :y 0.832 :z -0.1435) + (new 'static 'vector :x -0.334 :y 0.8814 :z -0.334) + (new 'static 'vector :x 0.334 :y 0.8814 :z -0.334) + (new 'static 'vector :x 0.5358 :y 0.832 :z -0.1434) + (new 'static 'vector :x 0.6984 :y 0.7071 :z -0.1105) + (new 'static 'vector :x -0.6984 :y 0.7071 :z 0.1105) + (new 'static 'vector :x -0.5358 :y 0.832 :z 0.1435) + (new 'static 'vector :x -0.334 :y 0.8814 :z 0.334) + (new 'static 'vector :x 0.334 :y 0.8814 :z 0.334) + (new 'static 'vector :x 0.5357 :y 0.832 :z 0.1435) + (new 'static 'vector :x 0.6983 :y 0.7071 :z 0.1105) + (new 'static 'vector :x -0.63 :y 0.7071 :z 0.321) + (new 'static 'vector :x -0.3922 :y 0.832 :z 0.3921) + (new 'static 'vector :x -0.1435 :y 0.832 :z 0.5357) + (new 'static 'vector :x 0.1435 :y 0.832 :z 0.5358) + (new 'static 'vector :x 0.3922 :y 0.832 :z 0.3922) + (new 'static 'vector :x 0.63 :y 0.7071 :z 0.321) + (new 'static 'vector :x -0.5 :y 0.7071 :z 0.4999) + (new 'static 'vector :x -0.321 :y 0.7071 :z 0.63) + (new 'static 'vector :x -0.1106 :y 0.7071 :z 0.6983) + (new 'static 'vector :x 0.1105 :y 0.7071 :z 0.6984) + (new 'static 'vector :x 0.321 :y 0.7071 :z 0.63) + (new 'static 'vector :x 0.4999 :y 0.7071 :z 0.5) + ) + :color80808080 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :color80808040 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w 64) + :color80808000 (new 'static 'vector4w :x #x80 :y #x80 :z #x80) + :st0000 (new 'static 'vector :z 1.0) + :st0505 (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :st1010 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :uv44 (new 'static 'vector4w :x 64 :y 64) + :uv88 (new 'static 'vector4w :x #x80 :y #x80) + :uv1010 (new 'static 'vector4w :x #x100 :y #x100) + :uv2020 (new 'static 'vector4w :x #x200 :y #x200) + :uv4040 (new 'static 'vector4w :x #x400 :y #x400) + :uv8080 (new 'static 'vector4w :x #x800 :y #x800) + :xy00 (new 'static 'vector4w :z #xffffff) + :xy88 (new 'static 'vector4w :x #x80 :y #x80 :z #xffffff) + :xy1010 (new 'static 'vector4w :x #x100 :y #x100 :z #xffffff) + :xy2020 (new 'static 'vector4w :x #x200 :y #x200 :z #xffffff) + :xy4040 (new 'static 'vector4w :x #x400 :y #x400 :z #xffffff) + :xy8080 (new 'static 'vector4w :x #x800 :y #x800 :z #xffffff) + :cloud-alpha (new 'static 'array uint8 36 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + ) + :tex1 #xeed00080178 + :tex1-near #xeed0008016c + :scales (new 'static 'vector :x -0.00012207031 :y 255.0 :z -0.00012207031 :w 128.0) + :mask-hi (new 'static 'vector4w :x -65536 :y -65536 :z -65536 :w -65536) + :mask-lo (new 'static 'vector4w :x #xffff :y #xffff :z #xffff :w #xffff) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-tables.gc b/goal_src/jak2/engine/gfx/ocean/ocean-tables.gc index 5396d512d4..5cda5a1f86 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-tables.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-tables.gc @@ -7,3 +7,5881 @@ ;; DECOMP BEGINS +(define *ocean-spheres-city* + (new 'static 'ocean-spheres :spheres (new 'static 'inline-array sphere 36 + (new 'static 'sphere :x -1966080.0 :z -5505024.0 :w 2224365.5) + (new 'static 'sphere :x 1179648.0 :z -5505024.0 :w 2224365.5) + (new 'static 'sphere :x 4325376.0 :z -5505024.0 :w 2224365.5) + (new 'static 'sphere :x 7471104.0 :z -5505024.0 :w 2224365.5) + (new 'static 'sphere :x 10616832.0 :z -5505024.0 :w 2224365.5) + (new 'static 'sphere :x 13762560.0 :z -5505024.0 :w 2224365.5) + (new 'static 'sphere :x -1966080.0 :z -2359296.0 :w 2224365.5) + (new 'static 'sphere :x 1179648.0 :z -2359296.0 :w 2224365.5) + (new 'static 'sphere :x 4325376.0 :z -2359296.0 :w 2224365.5) + (new 'static 'sphere :x 7471104.0 :z -2359296.0 :w 2224365.5) + (new 'static 'sphere :x 10616832.0 :z -2359296.0 :w 2224365.5) + (new 'static 'sphere :x 13762560.0 :z -2359296.0 :w 2224365.5) + (new 'static 'sphere :x -1966080.0 :z 786432.0 :w 2224365.5) + (new 'static 'sphere :x 1179648.0 :z 786432.0 :w 2224365.5) + (new 'static 'sphere :x 4325376.0 :z 786432.0 :w 2224365.5) + (new 'static 'sphere :x 7471104.0 :z 786432.0 :w 2224365.5) + (new 'static 'sphere :x 10616832.0 :z 786432.0 :w 2224365.5) + (new 'static 'sphere :x 13762560.0 :z 786432.0 :w 2224365.5) + (new 'static 'sphere :x -1966080.0 :z 3932160.0 :w 2224365.5) + (new 'static 'sphere :x 1179648.0 :z 3932160.0 :w 2224365.5) + (new 'static 'sphere :x 4325376.0 :z 3932160.0 :w 2224365.5) + (new 'static 'sphere :x 7471104.0 :z 3932160.0 :w 2224365.5) + (new 'static 'sphere :x 10616832.0 :z 3932160.0 :w 2224365.5) + (new 'static 'sphere :x 13762560.0 :z 3932160.0 :w 2224365.5) + (new 'static 'sphere :x -1966080.0 :z 7077888.0 :w 2224365.5) + (new 'static 'sphere :x 1179648.0 :z 7077888.0 :w 2224365.5) + (new 'static 'sphere :x 4325376.0 :z 7077888.0 :w 2224365.5) + (new 'static 'sphere :x 7471104.0 :z 7077888.0 :w 2224365.5) + (new 'static 'sphere :x 10616832.0 :z 7077888.0 :w 2224365.5) + (new 'static 'sphere :x 13762560.0 :z 7077888.0 :w 2224365.5) + (new 'static 'sphere :x -1966080.0 :z 10223616.0 :w 2224365.5) + (new 'static 'sphere :x 1179648.0 :z 10223616.0 :w 2224365.5) + (new 'static 'sphere :x 4325376.0 :z 10223616.0 :w 2224365.5) + (new 'static 'sphere :x 7471104.0 :z 10223616.0 :w 2224365.5) + (new 'static 'sphere :x 10616832.0 :z 10223616.0 :w 2224365.5) + (new 'static 'sphere :x 13762560.0 :z 10223616.0 :w 2224365.5) + ) + ) + ) + +(define *ocean-colors-city* + (new 'static 'ocean-colors :colors (new 'static 'array rgba 2548 + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #xb :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2a :a #x80) + (new 'static 'rgba :r #xd :g #x25 :b #x29 :a #x80) + (new 'static 'rgba :r #xd :g #x25 :b #x29 :a #x80) + (new 'static 'rgba :r #xf :g #x26 :b #x2a :a #x80) + (new 'static 'rgba :r #xe :g #x25 :b #x29 :a #x80) + (new 'static 'rgba :r #x10 :g #x25 :b #x26 :a #x80) + (new 'static 'rgba :r #xf :g #x25 :b #x25 :a #x80) + (new 'static 'rgba :r #xf :g #x26 :b #x28 :a #x80) + (new 'static 'rgba :r #xe :g #x26 :b #x2a :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x26 :b #x2a :a #x80) + (new 'static 'rgba :r #x10 :g #x27 :b #x2a :a #x80) + (new 'static 'rgba :r #x10 :g #x27 :b #x2a :a #x80) + (new 'static 'rgba :r #x12 :g #x27 :b #x29 :a #x80) + (new 'static 'rgba :r #x14 :g #x28 :b #x29 :a #x80) + (new 'static 'rgba :r #x13 :g #x27 :b #x28 :a #x80) + (new 'static 'rgba :r #x19 :g #x27 :b #x23 :a #x80) + (new 'static 'rgba :r #x19 :g #x27 :b #x21 :a #x80) + (new 'static 'rgba :r #x19 :g #x28 :b #x23 :a #x80) + (new 'static 'rgba :r #x17 :g #x28 :b #x27 :a #x80) + (new 'static 'rgba :r #x12 :g #x27 :b #x29 :a #x80) + (new 'static 'rgba :r #xf :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #x11 :g #x27 :b #x2a :a #x80) + (new 'static 'rgba :r #x11 :g #x27 :b #x29 :a #x80) + (new 'static 'rgba :r #x12 :g #x27 :b #x29 :a #x80) + (new 'static 'rgba :r #x15 :g #x29 :b #x29 :a #x80) + (new 'static 'rgba :r #x16 :g #x28 :b #x28 :a #x80) + (new 'static 'rgba :r #x17 :g #x28 :b #x26 :a #x80) + (new 'static 'rgba :r #x20 :g #x28 :b #x1d :a #x80) + (new 'static 'rgba :r #x23 :g #x2a :b #x1f :a #x80) + (new 'static 'rgba :r #x23 :g #x2a :b #x1f :a #x80) + (new 'static 'rgba :r #x21 :g #x2a :b #x20 :a #x80) + (new 'static 'rgba :r #x1b :g #x2a :b #x26 :a #x80) + (new 'static 'rgba :r #x14 :g #x29 :b #x2a :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x12 :g #x28 :b #x2c :a #x80) + (new 'static 'rgba :r #x13 :g #x29 :b #x2c :a #x80) + (new 'static 'rgba :r #x11 :g #x27 :b #x29 :a #x80) + (new 'static 'rgba :r #x13 :g #x28 :b #x2a :a #x80) + (new 'static 'rgba :r #x16 :g #x29 :b #x2a :a #x80) + (new 'static 'rgba :r #x18 :g #x29 :b #x28 :a #x80) + (new 'static 'rgba :r #x19 :g #x2a :b #x27 :a #x80) + (new 'static 'rgba :r #x1a :g #x29 :b #x25 :a #x80) + (new 'static 'rgba :r #x27 :g #x29 :b #x19 :a #x80) + (new 'static 'rgba :r #x29 :g #x2b :b #x1b :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1b :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1b :a #x80) + (new 'static 'rgba :r #x24 :g #x2b :b #x20 :a #x80) + (new 'static 'rgba :r #x1b :g #x2b :b #x27 :a #x80) + (new 'static 'rgba :r #x12 :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #x14 :g #x2a :b #x2d :a #x80) + (new 'static 'rgba :r #x14 :g #x29 :b #x2b :a #x80) + (new 'static 'rgba :r #x13 :g #x27 :b #x29 :a #x80) + (new 'static 'rgba :r #x15 :g #x29 :b #x29 :a #x80) + (new 'static 'rgba :r #x18 :g #x2a :b #x29 :a #x80) + (new 'static 'rgba :r #x19 :g #x2a :b #x27 :a #x80) + (new 'static 'rgba :r #x1c :g #x2a :b #x26 :a #x80) + (new 'static 'rgba :r #x29 :g #x2b :b #x1b :a #x80) + (new 'static 'rgba :r #x2d :g #x2b :b #x16 :a #x80) + (new 'static 'rgba :r #x30 :g #x2c :b #x16 :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x17 :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x16 :a #x80) + (new 'static 'rgba :r #x2e :g #x2d :b #x1a :a #x80) + (new 'static 'rgba :r #x23 :g #x2c :b #x23 :a #x80) + (new 'static 'rgba :r #x17 :g #x2b :b #x2b :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2d :a #x80) + (new 'static 'rgba :r #x13 :g #x2a :b #x2c :a #x80) + (new 'static 'rgba :r #x14 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x16 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x15 :g #x29 :b #x2a :a #x80) + (new 'static 'rgba :r #x16 :g #x29 :b #x29 :a #x80) + (new 'static 'rgba :r #x19 :g #x2a :b #x29 :a #x80) + (new 'static 'rgba :r #x1a :g #x2a :b #x26 :a #x80) + (new 'static 'rgba :r #x1d :g #x2a :b #x24 :a #x80) + (new 'static 'rgba :r #x2a :g #x2b :b #x1a :a #x80) + (new 'static 'rgba :r #x31 :g #x2c :b #x14 :a #x80) + (new 'static 'rgba :r #x33 :g #x2c :b #x13 :a #x80) + (new 'static 'rgba :r #x35 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x34 :g #x2e :b #x16 :a #x80) + (new 'static 'rgba :r #x2a :g #x2c :b #x1d :a #x80) + (new 'static 'rgba :r #x1d :g #x2c :b #x27 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #x11 :g #x28 :b #x2a :a #x80) + (new 'static 'rgba :r #x12 :g #x28 :b #x2a :a #x80) + (new 'static 'rgba :r #x15 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x16 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x18 :g #x2a :b #x2a :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x2a :a #x80) + (new 'static 'rgba :r #x1b :g #x2a :b #x27 :a #x80) + (new 'static 'rgba :r #x1f :g #x2b :b #x25 :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1b :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x15 :a #x80) + (new 'static 'rgba :r #x34 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x2f :g #x2d :b #x19 :a #x80) + (new 'static 'rgba :r #x22 :g #x2c :b #x23 :a #x80) + (new 'static 'rgba :r #x16 :g #x2c :b #x2d :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x14 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x14 :g #x2a :b #x2d :a #x80) + (new 'static 'rgba :r #x11 :g #x27 :b #x28 :a #x80) + (new 'static 'rgba :r #x13 :g #x28 :b #x2a :a #x80) + (new 'static 'rgba :r #x16 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x18 :g #x2b :b #x2c :a #x80) + (new 'static 'rgba :r #x19 :g #x2b :b #x2b :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x2a :a #x80) + (new 'static 'rgba :r #x1c :g #x2b :b #x28 :a #x80) + (new 'static 'rgba :r #x1f :g #x2b :b #x26 :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1c :a #x80) + (new 'static 'rgba :r #x33 :g #x2d :b #x16 :a #x80) + (new 'static 'rgba :r #x34 :g #x2d :b #x15 :a #x80) + (new 'static 'rgba :r #x36 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x36 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x36 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x33 :g #x2d :b #x16 :a #x80) + (new 'static 'rgba :r #x28 :g #x2c :b #x1f :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x29 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x16 :g #x2c :b #x2e :a #x80) + (new 'static 'rgba :r #x15 :g #x2b :b #x2d :a #x80) + (new 'static 'rgba :r #x14 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x14 :g #x29 :b #x2b :a #x80) + (new 'static 'rgba :r #x15 :g #x2a :b #x2a :a #x80) + (new 'static 'rgba :r #x17 :g #x2a :b #x2b :a #x80) + (new 'static 'rgba :r #x18 :g #x2b :b #x2b :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x2a :a #x80) + (new 'static 'rgba :r #x1d :g #x2c :b #x28 :a #x80) + (new 'static 'rgba :r #x1f :g #x2c :b #x26 :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1c :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x16 :a #x80) + (new 'static 'rgba :r #x34 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x36 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x36 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x34 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x2c :g #x2c :b #x1c :a #x80) + (new 'static 'rgba :r #x1d :g #x2b :b #x26 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x15 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x18 :g #x2d :b #x2f :a #x80) + (new 'static 'rgba :r #x17 :g #x2d :b #x2f :a #x80) + (new 'static 'rgba :r #x17 :g #x2d :b #x2f :a #x80) + (new 'static 'rgba :r #x16 :g #x2d :b #x2e :a #x80) + (new 'static 'rgba :r #x16 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x17 :g #x2c :b #x2d :a #x80) + (new 'static 'rgba :r #x17 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x18 :g #x2b :b #x2c :a #x80) + (new 'static 'rgba :r #x18 :g #x2c :b #x2b :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x29 :a #x80) + (new 'static 'rgba :r #x1c :g #x2b :b #x27 :a #x80) + (new 'static 'rgba :r #x1e :g #x2b :b #x25 :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1b :a #x80) + (new 'static 'rgba :r #x32 :g #x2c :b #x15 :a #x80) + (new 'static 'rgba :r #x33 :g #x2c :b #x13 :a #x80) + (new 'static 'rgba :r #x35 :g #x2d :b #x13 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x34 :g #x2d :b #x13 :a #x80) + (new 'static 'rgba :r #x2e :g #x2d :b #x1a :a #x80) + (new 'static 'rgba :r #x1f :g #x2b :b #x25 :a #x80) + (new 'static 'rgba :r #x14 :g #x2a :b #x2d :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x14 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x15 :g #x2d :b #x2f :a #x80) + (new 'static 'rgba :r #x19 :g #x2e :b #x2e :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x17 :g #x2e :b #x2f :a #x80) + (new 'static 'rgba :r #x17 :g #x2d :b #x2d :a #x80) + (new 'static 'rgba :r #x18 :g #x2d :b #x2e :a #x80) + (new 'static 'rgba :r #x17 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x16 :g #x2a :b #x2a :a #x80) + (new 'static 'rgba :r #x18 :g #x2b :b #x2a :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x29 :a #x80) + (new 'static 'rgba :r #x1d :g #x2b :b #x27 :a #x80) + (new 'static 'rgba :r #x1f :g #x2b :b #x25 :a #x80) + (new 'static 'rgba :r #x2c :g #x2d :b #x1c :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x16 :a #x80) + (new 'static 'rgba :r #x34 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x36 :g #x2e :b #x14 :a #x80) + (new 'static 'rgba :r #x33 :g #x2d :b #x14 :a #x80) + (new 'static 'rgba :r #x2b :g #x2b :b #x1a :a #x80) + (new 'static 'rgba :r #x1d :g #x2a :b #x24 :a #x80) + (new 'static 'rgba :r #x13 :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x15 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x19 :g #x2f :b #x2f :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x19 :g #x2f :b #x30 :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x2f :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x2e :a #x80) + (new 'static 'rgba :r #x19 :g #x2e :b #x2e :a #x80) + (new 'static 'rgba :r #x17 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x16 :g #x2b :b #x2b :a #x80) + (new 'static 'rgba :r #x18 :g #x2b :b #x2a :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x29 :a #x80) + (new 'static 'rgba :r #x1c :g #x2b :b #x26 :a #x80) + (new 'static 'rgba :r #x1e :g #x2a :b #x24 :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1c :a #x80) + (new 'static 'rgba :r #x32 :g #x2e :b #x16 :a #x80) + (new 'static 'rgba :r #x34 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x35 :g #x2e :b #x15 :a #x80) + (new 'static 'rgba :r #x33 :g #x2e :b #x16 :a #x80) + (new 'static 'rgba :r #x2e :g #x2c :b #x18 :a #x80) + (new 'static 'rgba :r #x23 :g #x2a :b #x1e :a #x80) + (new 'static 'rgba :r #x16 :g #x28 :b #x27 :a #x80) + (new 'static 'rgba :r #x11 :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x17 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x17 :g #x2e :b #x2f :a #x80) + (new 'static 'rgba :r #x17 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x17 :g #x2e :b #x2f :a #x80) + (new 'static 'rgba :r #x17 :g #x2e :b #x2f :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x2e :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x2e :a #x80) + (new 'static 'rgba :r #x17 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x19 :g #x2d :b #x2c :a #x80) + (new 'static 'rgba :r #x1a :g #x2d :b #x2b :a #x80) + (new 'static 'rgba :r #x19 :g #x2b :b #x29 :a #x80) + (new 'static 'rgba :r #x1b :g #x2b :b #x27 :a #x80) + (new 'static 'rgba :r #x1d :g #x2b :b #x25 :a #x80) + (new 'static 'rgba :r #x2b :g #x2c :b #x1c :a #x80) + (new 'static 'rgba :r #x31 :g #x2d :b #x17 :a #x80) + (new 'static 'rgba :r #x34 :g #x2e :b #x16 :a #x80) + (new 'static 'rgba :r #x34 :g #x2e :b #x16 :a #x80) + (new 'static 'rgba :r #x32 :g #x2e :b #x18 :a #x80) + (new 'static 'rgba :r #x2c :g #x2d :b #x1c :a #x80) + (new 'static 'rgba :r #x24 :g #x2c :b #x22 :a #x80) + (new 'static 'rgba :r #x1b :g #x2b :b #x27 :a #x80) + (new 'static 'rgba :r #x14 :g #x2a :b #x2d :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x17 :g #x32 :b #x34 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x16 :g #x2d :b #x2f :a #x80) + (new 'static 'rgba :r #x16 :g #x2d :b #x2f :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x2f :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x2e :a #x80) + (new 'static 'rgba :r #x1a :g #x2f :b #x2f :a #x80) + (new 'static 'rgba :r #x1a :g #x2e :b #x2d :a #x80) + (new 'static 'rgba :r #x18 :g #x2b :b #x2b :a #x80) + (new 'static 'rgba :r #x19 :g #x2a :b #x28 :a #x80) + (new 'static 'rgba :r #x1c :g #x2b :b #x26 :a #x80) + (new 'static 'rgba :r #x2a :g #x2d :b #x1d :a #x80) + (new 'static 'rgba :r #x30 :g #x2e :b #x1a :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x17 :a #x80) + (new 'static 'rgba :r #x33 :g #x2e :b #x16 :a #x80) + (new 'static 'rgba :r #x2f :g #x2d :b #x1a :a #x80) + (new 'static 'rgba :r #x25 :g #x2d :b #x23 :a #x80) + (new 'static 'rgba :r #x1a :g #x2b :b #x2a :a #x80) + (new 'static 'rgba :r #x15 :g #x2a :b #x2d :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x17 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x17 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x11 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x16 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x16 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x17 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x18 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x16 :g #x2d :b #x2e :a #x80) + (new 'static 'rgba :r #x17 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x19 :g #x2c :b #x2a :a #x80) + (new 'static 'rgba :r #x1c :g #x2c :b #x28 :a #x80) + (new 'static 'rgba :r #x2c :g #x2d :b #x1c :a #x80) + (new 'static 'rgba :r #x2e :g #x2c :b #x19 :a #x80) + (new 'static 'rgba :r #x32 :g #x2d :b #x17 :a #x80) + (new 'static 'rgba :r #x2d :g #x2d :b #x1b :a #x80) + (new 'static 'rgba :r #x22 :g #x2c :b #x24 :a #x80) + (new 'static 'rgba :r #x16 :g #x2b :b #x2d :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x19 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x17 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x12 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x16 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x16 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x18 :g #x2c :b #x2d :a #x80) + (new 'static 'rgba :r #x23 :g #x2d :b #x24 :a #x80) + (new 'static 'rgba :r #x29 :g #x2d :b #x1d :a #x80) + (new 'static 'rgba :r #x2f :g #x2c :b #x18 :a #x80) + (new 'static 'rgba :r #x2d :g #x2c :b #x18 :a #x80) + (new 'static 'rgba :r #x22 :g #x2b :b #x21 :a #x80) + (new 'static 'rgba :r #x18 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x19 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x18 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x16 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x14 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x1a :g #x2c :b #x2b :a #x80) + (new 'static 'rgba :r #x21 :g #x2c :b #x25 :a #x80) + (new 'static 'rgba :r #x29 :g #x2c :b #x1d :a #x80) + (new 'static 'rgba :r #x2c :g #x2c :b #x19 :a #x80) + (new 'static 'rgba :r #x25 :g #x2c :b #x20 :a #x80) + (new 'static 'rgba :r #x1a :g #x2c :b #x2a :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x1a :g #x36 :b #x36 :a #x80) + (new 'static 'rgba :r #x18 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x17 :g #x33 :b #x34 :a #x80) + (new 'static 'rgba :r #x16 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x19 :g #x2c :b #x2b :a #x80) + (new 'static 'rgba :r #x20 :g #x2c :b #x25 :a #x80) + (new 'static 'rgba :r #x25 :g #x2c :b #x20 :a #x80) + (new 'static 'rgba :r #x22 :g #x2d :b #x24 :a #x80) + (new 'static 'rgba :r #x19 :g #x2c :b #x2c :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x27 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x8 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x1a :g #x35 :b #x35 :a #x80) + (new 'static 'rgba :r #x18 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x17 :g #x32 :b #x34 :a #x80) + (new 'static 'rgba :r #x17 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x31 :b #x32 :a #x80) + (new 'static 'rgba :r #x17 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x12 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x17 :g #x2b :b #x2b :a #x80) + (new 'static 'rgba :r #x1b :g #x2c :b #x29 :a #x80) + (new 'static 'rgba :r #x1a :g #x2c :b #x2a :a #x80) + (new 'static 'rgba :r #x16 :g #x2c :b #x2e :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x1a :g #x35 :b #x35 :a #x80) + (new 'static 'rgba :r #x19 :g #x35 :b #x36 :a #x80) + (new 'static 'rgba :r #x1a :g #x35 :b #x35 :a #x80) + (new 'static 'rgba :r #x18 :g #x33 :b #x35 :a #x80) + (new 'static 'rgba :r #x17 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x32 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x13 :g #x2e :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x15 :g #x2c :b #x2f :a #x80) + (new 'static 'rgba :r #x14 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x1a :g #x35 :b #x35 :a #x80) + (new 'static 'rgba :r #x19 :g #x35 :b #x36 :a #x80) + (new 'static 'rgba :r #x1a :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x18 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x12 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x18 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x19 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x18 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x19 :g #x33 :b #x35 :a #x80) + (new 'static 'rgba :r #x17 :g #x32 :b #x34 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x19 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x19 :g #x34 :b #x35 :a #x80) + (new 'static 'rgba :r #x18 :g #x33 :b #x34 :a #x80) + (new 'static 'rgba :r #x17 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x18 :g #x33 :b #x34 :a #x80) + (new 'static 'rgba :r #x18 :g #x33 :b #x34 :a #x80) + (new 'static 'rgba :r #x17 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x31 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x12 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x17 :g #x32 :b #x34 :a #x80) + (new 'static 'rgba :r #x17 :g #x32 :b #x34 :a #x80) + (new 'static 'rgba :r #x15 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x17 :g #x32 :b #x34 :a #x80) + (new 'static 'rgba :r #x16 :g #x31 :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x11 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x17 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x30 :b #x33 :a #x80) + (new 'static 'rgba :r #x16 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x16 :g #x2f :b #x33 :a #x80) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x15 :g #x2f :b #x32 :a #x80) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2c :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x15 :g #x2e :b #x32 :a #x80) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x14 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x13 :g #x2d :b #x31 :a #x80) + (new 'static 'rgba :r #x14 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #xb :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x14 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x31 :a #x80) + (new 'static 'rgba :r #x13 :g #x2c :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x29 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x13 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x12 :g #x2b :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x12 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x12 :g #x2b :b #x30 :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x29 :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xb :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2e :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x11 :g #x2a :b #x2f :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xf :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #x10 :g #x29 :b #x2e :a #x80) + (new 'static 'rgba :r #xf :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2d :a #x80) + (new 'static 'rgba :r #xe :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x26 :b #x2b :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x28 :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #xa :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xe :g #x28 :b #x2d :a #x80) + (new 'static 'rgba :r #xd :g #x27 :b #x2c :a #x80) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x8 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x8 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xd :g #x26 :b #x2c :a #x80) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #x9 :g #x23 :b #x29 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x27 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xc :g #x25 :b #x2b :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x6 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x29 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x27 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x5 :g #x21 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x26 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba :r #xb :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #xb :g #x25 :b #x2a :a #x80) + (new 'static 'rgba :r #xa :g #x24 :b #x2a :a #x80) + (new 'static 'rgba :r #x7 :g #x22 :b #x28 :a #x80) + (new 'static 'rgba :r #x4 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1e :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x2 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x24 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x1f :b #x25 :a #x80) + (new 'static 'rgba :r #x3 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba :r #x4 :g #x20 :b #x25 :a #x80) + (new 'static 'rgba) + (new 'static 'rgba) + (new 'static 'rgba) + ) + ) + ) + +;; definition for symbol *ocean-near-indices-city*, type ocean-near-indices +(define *ocean-near-indices-city* + (new 'static 'ocean-near-indices + :data (new 'static 'inline-array ocean-near-index 54 + (new 'static 'ocean-near-index) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x1 #x2 #x3 #x4) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x14) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x5 + #xffff + #xffff + #x6 + #xa + #xffff + #xffff + #xffff + #x0 + #xf + #x10 + #x11 + #x15 + #x0 + #x16 + #x0 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x7 #x8 #x9 #x0 #xb #xc #xd #xe #x12 #xffff #xffff #x13 #x17 #x12 #xffff #x18) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x1d #x0 #x25 #x26 #x5 #x0 #x29 #x2a #x5) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x19 + #x1a + #x0 + #x0 + #xffff + #x1e + #x1f + #x20 + #xffff + #xffff + #xffff + #x27 + #xffff + #xffff + #xffff + #x27 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x17 #x12 #x1b #x0 #x21 #x22 #x23 #x0 #x5 #xffff #x28 #x2b #x2c #x2d #x28) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x1c #x0 #x0 #x0 #x24 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x2e #x2f #x30 #x0 #x37 #x38 #xffff #x0 #x0 #x3c #xffff #x0 #x0 #x41 #x12) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #x31 + #x32 + #xffff + #xffff + #x39 + #x0 + #xffff + #xffff + #x0 + #x3d + #xffff + #x42 + #x0 + #x43 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x33 + #x12 + #xffff + #x34 + #x0 + #x3a + #xffff + #xffff + #x3e + #x3f + #xffff + #xffff + #x44 + #x45 + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x35 #x36 #x0 #x0 #xffff #x3b #x0 #x0 #xffff #x40 #x0 #x0 #x29 #x46 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x47 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x48 #x49 #x0 #x4a #x0 #x0 #x0 #x4c #x0 #x0 #x0 #x0 #x0 #x21 #x4f #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x4b + #xd + #xffff + #xffff + #x4d + #xffff + #xffff + #xffff + #x0 + #x0 + #x4e + #xffff + #x0 + #x50 + #x51 + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x4 #x0 #x0 #x0 #x27 #x0 #x0 #x0 #x27 #x0 #x0 #x0 #x27 #x0 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x52 #x53 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x54 #x0 #x55 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x32 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x59 + #x0 + #x0 + #x0 + #x59 + #x0 + #x5f + #x5f + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x0 + #x0 + #xffff + #xffff + #x60 + #x0 + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x56 #x56 #x56 #x56 #x0 #x0 #x0 #x0 #x4 #x5a #x3e #x3e #x61 #x62 #xffff #xffff) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x56 #x56 #x57 #xffff #x0 #x0 #x0 #x58 #x3e #x5b #x0 #x5c #xffff #x63 #x0 #x5c) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x5d + #x5e + #xffff + #xffff + #x59 + #x64 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x78 + #x5f + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x13 + #x0 + #xffff + #xffff + #x13 + #x0 + #xffff + #xffff + #x13 + #x0 + #xffff + #xffff + #x13 + #x0 + #x48 + #x48 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x48 + #x48 + #x48 + #x48 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x65 + #x4 + #x3c + #xffff + #xffff + #x61 + #x62 + #xffff + #xffff + #x28 + #x0 + #x70 + #x48 + #x79 + #x0 + #x5c + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #x66 + #x0 + #x5c + #xffff + #x66 + #x0 + #x6a + #xffff + #x71 + #x72 + #x73 + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #x6b + #x6b + #x6b + #x6b + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #x67 + #x56 + #x56 + #x6c + #x0 + #x0 + #x0 + #x74 + #x75 + #x76 + #x76 + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x68 + #xffff + #x69 + #x64 + #x6d + #x6b + #x6e + #x6f + #x77 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x0 + #x0 + #x0 + #x0 + #x4b + #x4b + #x4b + #x4b + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x7a + #x76 + #x76 + #x76 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x76 + #x76 + #x76 + #x76 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x76 + #x76 + #x76 + #x7b + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x0 + #x7c + #x7d + #x7d + #x0 + #x7f + #xffff + #xffff + #x0 + #x7f + #xffff + #xffff + #x0 + #x7f + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x7d + #x7d + #x7e + #x0 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x0 + #x7f + #xffff + #xffff + #x0 + #x7f + #xffff + #xffff + #x0 + #x7f + #xffff + #xffff + #x0 + #x7f + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + #xffff + #xffff + #x59 + #x0 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x7d #x7d #x4b #x4b #xffff #xffff) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x7d #x7d #x0 #x0 #xffff #xffff #x4b #x4b) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x0 + #x0 + #x0 + #xffff + #x0 + #x0 + #x0 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x0 + #x0 + #xffff + #xffff + #x0 + #x0 + #x0 + #x0 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #x0 + #xffff + #xffff + #x0 + #x0 + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #x0 + #x0 + #x0 + #xffff + #x0 + #x0 + #x0 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #x0 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index + :data (new 'static 'array uint16 16 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #xffff #xffff #xffff #x0) + ) + (new 'static 'ocean-near-index :data (new 'static 'array uint16 16 + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + ) + ) + (new 'static 'ocean-near-index :data (new 'static 'array uint16 16 + #x0 + #xffff + #xffff + #xffff + #x0 + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + #xffff + ) + ) + ) + ) + ) + +;; definition for symbol *ocean-trans-indices-city*, type ocean-trans-indices +(define *ocean-trans-indices-city* + (new 'static 'ocean-trans-indices :data (new 'static 'inline-array ocean-trans-index 2304 + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :child 1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :child 2) + (new 'static 'ocean-trans-index :parent #x80 :child 3) + (new 'static 'ocean-trans-index :parent #x81 :child 4) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :child 5) + (new 'static 'ocean-trans-index :parent #x82 :child 6) + (new 'static 'ocean-trans-index :parent #x83 :child 7) + (new 'static 'ocean-trans-index :child 8) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent #x84 :child 9) + (new 'static 'ocean-trans-index :parent #x85 :child 10) + (new 'static 'ocean-trans-index :parent #x86 :child 11) + (new 'static 'ocean-trans-index :parent #x87 :child 12) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :child 13) + (new 'static 'ocean-trans-index :child 14) + (new 'static 'ocean-trans-index :parent #x88 :child 15) + (new 'static 'ocean-trans-index :child 16) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :child 17) + (new 'static 'ocean-trans-index :child 18) + (new 'static 'ocean-trans-index :child 19) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x6b :child 20) + (new 'static 'ocean-trans-index :parent #x89 :child 21) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent 2 :child 22) + (new 'static 'ocean-trans-index :parent #x8a :child 23) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x8b :child 24) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent 92 :child 25) + (new 'static 'ocean-trans-index :parent #x8c :child 26) + (new 'static 'ocean-trans-index :parent 36 :child 27) + (new 'static 'ocean-trans-index :parent #x8d :child 28) + (new 'static 'ocean-trans-index :parent #x8e :child 29) + (new 'static 'ocean-trans-index :parent #x8f :child 30) + (new 'static 'ocean-trans-index :parent #x90 :child 31) + (new 'static 'ocean-trans-index :parent #x91 :child 32) + (new 'static 'ocean-trans-index :parent 75 :child 33) + (new 'static 'ocean-trans-index :parent 75 :child 33) + (new 'static 'ocean-trans-index :parent 75 :child 33) + (new 'static 'ocean-trans-index :parent 75 :child 33) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent 8 :child 34) + (new 'static 'ocean-trans-index :parent 8 :child 35) + (new 'static 'ocean-trans-index :parent 8 :child 36) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent 36 :child 27) + (new 'static 'ocean-trans-index :parent 36 :child 27) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x92 :child 37) + (new 'static 'ocean-trans-index :parent #x93 :child 38) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent 92 :child 39) + (new 'static 'ocean-trans-index :parent #x66 :child 40) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent 2 :child 41) + (new 'static 'ocean-trans-index :parent #x94 :child 42) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x95 :child 43) + (new 'static 'ocean-trans-index :parent #x96 :child 44) + (new 'static 'ocean-trans-index :parent #x97 :child 45) + (new 'static 'ocean-trans-index :parent 88 :child 46) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x98 :child 47) + (new 'static 'ocean-trans-index :parent #x99 :child 48) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent #x9a :child 49) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x9b :child 50) + (new 'static 'ocean-trans-index :parent #x9c :child 51) + (new 'static 'ocean-trans-index :parent 34 :child 52) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent #x9b :child 50) + (new 'static 'ocean-trans-index :parent 13 :child 53) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index :parent -1 :child -1) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + (new 'static 'ocean-trans-index) + ) + ) + ) + +;; definition for symbol *ocean-mid-indices-city*, type ocean-mid-indices +(define *ocean-mid-indices-city* (new 'static 'ocean-mid-indices :data (new 'static 'array uint16 36 + #x59 + #x0 + #x0 + #x0 + #x0 + #x0 + #x9d + #x9e + #x0 + #x0 + #x0 + #x0 + #x34 + #x9f + #xa0 + #x0 + #x0 + #x0 + #xa1 + #xa2 + #xa3 + #x0 + #x0 + #x0 + #x59 + #x0 + #x0 + #x0 + #x0 + #x0 + #x59 + #x0 + #x0 + #x0 + #x0 + #x0 + ) + ) + ) + +;; definition for symbol *ocean-mid-masks-city*, type ocean-mid-masks +(define *ocean-mid-masks-city* + (new 'static 'ocean-mid-masks + :data (new 'static 'inline-array ocean-mid-mask 164 + (new 'static 'ocean-mid-mask) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #xc0 #xc0 #xe0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #xfc #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x1f #x3f #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x0 #x1 #x1)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xe0 #xe0 #xe0 #xe0 #xe0 #xe0 #xe0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x1 #x1 #x1 #x3 #x3 #x3 #x3)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #xc0 #xc0 #xc0 #xc0 #xc0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x1f #x1f #x1f #x1f #x1f #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x10 #x38 #x7c #x7c #x7c)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xc0 #xc0 #xc0 #x80 #x80 #x80 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x7f #xff #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x3 #xf #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfe #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x3 #x7 #xf #xf #xf #xf #xf)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xfe #xfc #xf8 #xe0 #x80 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #x7f #x3e)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #x83 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #xff #xfe)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf #xf #xf #xf #xf #xf #xf #xf)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x80 #xc0 #x80 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x6 #xf #x1f #x3f #x7f #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1c #x0 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xf8 #xf0 #xe0 #xc0 #x80 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf #xf #xf #xf #x1f #x1f #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfc #xf8 #xe0 #xf0 #xf8 #xfc #xfe)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x3 #x7 #xf #xf #xf #x7 #x7)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x3f #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x7 #xf #x1f #x3f #x3f #x3f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x80 #xc0 #xc0 #xc0 #xc0 #xc0 #xe0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf #x1f #x3f #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #xf0 #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x1 #x1 #x1 #x1 #x1 #x1)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #xe0 #xe0 #xe0 #xe0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfe #xfe #xfe #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #x3f #x3f #x3f #x3f #x3f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3f #x1f #xf #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x0 #x0 #x80)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x0 #x7 #xf)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x1 #x1 #x1 #x1 #x1 #x1 #x1)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3f #x3f #x3f #x3f #x3f #x3f #x3f #x3f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xc0 #x80 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x1f #x1f #x1e #x1e #x1e #x1e #x1e)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #xc0 #xe0 #xe0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x1f #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfc #xf8 #xf0 #xf0 #xfc #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #xf8 #xf8 #xf0 #xf0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1e #x1e #x1e #x7 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xe0 #xe0 #xe0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #x7f #x3f #x1f #xf #x7)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x0 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xe0 #xe0 #xc0 #x80 #x80 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3f #xff #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #xf #x1f #x7f #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x1 #x3 #x3)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #x0 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xfe #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x7 #x7 #x3 #x3 #x3 #x1 #x1 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfc #xfc #xf8 #xf0 #xf0 #xe0 #xc0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x7 #x7 #x7 #xf #xf #xf #xf #xf)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfe #xfc #xfc #xf8 #xf8 #xf0 #xf0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #xc0 #xe0 #xf0 #xf0 #xf0 #xf0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #xff #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xc0 #xff #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf #xf #xf #xf #xf #x7 #x7 #x7)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xe0 #xe0 #xe0 #xc0 #xc0 #x80 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #xf1 #xf1)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #x80 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xfe #xc0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xfe #xfe #xfe)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x7 #x3 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf8 #xe0 #x80 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf9 #xf8 #xf8 #xf8 #xf8 #xf8 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #xf0 #xf0 #xf0 #xf0 #xe0 #xe0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xc0 #xc0 #x80 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xfe #xf0 #xc0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xf8 #xf0 #xe0 #xe0 #xc0 #x80 #x80)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x1 #x1 #x1 #x1)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x3c #x3c #x3c #x3c)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x80 #x80 #x80 #x80 #x80 #x80 #x80 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xe0 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x1 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3c #x3c #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xfe #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xe0 #xc0 #x80)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xfe #xfc #xfc #xfc #xfc #xfc #xfc)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x1f #x1f #x1f #x1f #x1f #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #xf8 #xf8 #xf8 #xf8 #xf8 #xf0 #xf0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x7 #xf #x1f #x3f #x7f #x7f #x7f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xfc #xfc #xfc #xfc #xfc #xfc #xfc)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #xf0 #xf0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #xf #xf #xf #xf #xf)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3 #x3 #x7 #x7 #xf #xf #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xe0 #xc0 #xc0 #x80 #x80 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x7f #x7f #x7f #x3f #x1f #xf #x7 #x3)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #xf0 #xf0 #xf0 #xf0 #xf0 #xf0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3f #x3f #x7f #x7f #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3 #x3 #x3 #x3 #x3 #x3 #x3 #x3)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #x3 #x1 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xfe #xfc #xf8)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x1f #x1f #x1f #x1f #xf #x7 #x3)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xfc #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x7f #x3f #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xe0 #x0 #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x0 #x0 #x0 #x0 #x0 #x80 #xc0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #xf8 #xfc #xfe #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xfe #xfc #xfc #xfc #xfc #xfc #xfc)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3 #x7 #xf #x1f #x3f #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x80 #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xfc #xfe #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf #x1f #x3f #x7f #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x1 #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x0 #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe0 #xf0 #xf8 #xfc #xfe #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x1f #x1f #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x3f #x3f #x3f #x0 #x0 #x0 #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf #xf #xf #xf #xf #xf #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xfc #xfc #xfc #xfc #xfc #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #xf8 #xf8 #xf8)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x0 #x0 #x0 #x1f #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf8 #xf8 #xf8 #xf8 #xf8 #xf8 #xf8 #xf8)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf6 #xfe #xf0 #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #xf6 #xf4 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf1 #xf7 #xf7 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #xf4 #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf8 #xf8 #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf3 #xf3 #xf3 #xf1 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf4 #xfc #xfc #xfc #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf1 #xf1 #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xfe #xf8 #xf8 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xfc #xfc #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf8 #xf0 #xf0 #xf1 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xf3 #xf3 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfc #xfc #xfc #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf8 #xf9 #xf1 #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf1 #xf1 #xf1 #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xf0 #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf1 #xf0 #xf0 #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf2 #xf0 #xfe #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xfc #xfc #xfc #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf3 #xf3 #xf3 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #xf0 #xf3 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xf1 #xf1 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xfc #xf0 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xf3 #xf0 #xf8 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf1 #xf1 #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xf7 #xf7 #xf7 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xfe #xfe #xfe #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf7 #xf7 #xff #xff #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xf0 #xf0 #xf0 #xf7 #xff #xff #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x1f #xff #xff #xff #xff #x9f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x0 #x0 #x1f #x1f #x1f #x1f #xc #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xfe #xff #xf3 #xf3 #xf3 #xf3 #xff #xff)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1 #x1 #x1f #x1f #x1f #x1f #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xe1 #xc3 #xc7 #xcf #xff #xff #x1f #x1f)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #xff #xff #xff #xff #xff #xff #x0 #x0)) + (new 'static 'ocean-mid-mask :mask (new 'static 'array uint8 8 #x1f #x1f #x1f #x1f #x1f #x1f #x0 #x0)) + ) + ) + ) + +(define *ocean-map-city* (new 'static 'ocean-map + :start-corner (new 'static 'vector :x -3538944.0 :z -7077888.0 :w 1.0) + :far-color (new 'static 'vector :x 2.509804 :y 30.619608 :z 36.64314 :w 128.0) + ) + ) + +(set! (-> *ocean-map-city* ocean-spheres) *ocean-spheres-city*) +(set! (-> *ocean-map-city* ocean-colors) *ocean-colors-city*) +(set! (-> *ocean-map-city* ocean-mid-masks) *ocean-mid-masks-city*) +(set! (-> *ocean-map-city* ocean-mid-indices) *ocean-mid-indices-city*) +(set! (-> *ocean-map-city* ocean-trans-indices) *ocean-trans-indices-city*) +(set! (-> *ocean-map-city* ocean-near-indices) *ocean-near-indices-city*) + diff --git a/goal_src/jak2/engine/gfx/ocean/ocean-trans-tables.gc b/goal_src/jak2/engine/gfx/ocean/ocean-trans-tables.gc index e5db3e48f3..be5e6dda85 100644 --- a/goal_src/jak2/engine/gfx/ocean/ocean-trans-tables.gc +++ b/goal_src/jak2/engine/gfx/ocean/ocean-trans-tables.gc @@ -7,3 +7,1102 @@ ;; DECOMP BEGINS +;; definition for symbol *ocean-left-table*, type (pointer float) +(define *ocean-left-table* (new 'static 'array float 28 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-right-table*, type (pointer float) +(define *ocean-right-table* (new 'static 'array float 28 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-up-table*, type (pointer float) +(define *ocean-up-table* (new 'static 'array float 28 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-down-table*, type (pointer float) +(define *ocean-down-table* (new 'static 'array float 28 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-down-left-table*, type (pointer float) +(define *ocean-down-left-table* (new 'static 'array float 40 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-down-right-table*, type (pointer float) +(define *ocean-down-right-table* (new 'static 'array float 40 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-up-right-table*, type (pointer float) +(define *ocean-up-right-table* (new 'static 'array float 40 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 1.0 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-up-left-table*, type (pointer float) +(define *ocean-up-left-table* (new 'static 'array float 40 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-left-table*, type (pointer float) +(define *ocean-trans-left-table* (new 'static 'array float 44 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-right-table*, type (pointer float) +(define *ocean-trans-right-table* (new 'static 'array float 44 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-up-table*, type (pointer float) +(define *ocean-trans-up-table* (new 'static 'array float 44 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-down-table*, type (pointer float) +(define *ocean-trans-down-table* (new 'static 'array float 44 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-down-left-table*, type (pointer float) +(define *ocean-trans-down-left-table* (new 'static 'array float 72 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-down-right-table*, type (pointer float) +(define *ocean-trans-down-right-table* (new 'static 'array float 72 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-up-right-table*, type (pointer float) +(define *ocean-trans-up-right-table* (new 'static 'array float 72 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 1.0 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-up-left-table*, type (pointer float) +(define *ocean-trans-up-left-table* (new 'static 'array float 72 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-corner-table*, type (inline-array vector4w-2) +(define *ocean-trans-corner-table* (the-as (inline-array vector4w-2) (new 'static 'array float 100 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5625 + 0.1875 + 0.1875 + 0.0625 + 0.375 + 0.375 + 0.125 + 0.125 + 0.1875 + 0.5625 + 0.0625 + 0.1875 + 0.0 + 0.75 + 0.0 + 0.25 + 0.5 + 0.0 + 0.5 + 0.0 + 0.375 + 0.125 + 0.375 + 0.125 + 0.25 + 0.25 + 0.25 + 0.25 + 0.125 + 0.375 + 0.125 + 0.375 + 0.0 + 0.5 + 0.0 + 0.5 + 0.25 + 0.0 + 0.75 + 0.0 + 0.1875 + 0.0625 + 0.5625 + 0.1875 + 0.125 + 0.125 + 0.375 + 0.375 + 0.0625 + 0.1875 + 0.1875 + 0.5625 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + ) + +;; definition for symbol *ocean-trans-strip-array*, type (pointer float) +(define *ocean-trans-strip-array* (new 'static 'array float 160 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5625 + 0.1875 + 0.1875 + 0.0625 + 0.5 + 0.5 + 0.0 + 0.0 + 0.375 + 0.375 + 0.125 + 0.125 + 0.25 + 0.75 + 0.0 + 0.0 + 0.1875 + 0.5625 + 0.0625 + 0.1875 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5625 + 0.1875 + 0.1875 + 0.0625 + 0.375 + 0.125 + 0.375 + 0.125 + 0.375 + 0.375 + 0.125 + 0.125 + 0.25 + 0.25 + 0.25 + 0.25 + 0.1875 + 0.5625 + 0.0625 + 0.1875 + 0.125 + 0.375 + 0.125 + 0.375 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.375 + 0.125 + 0.375 + 0.125 + 0.1875 + 0.0625 + 0.5625 + 0.1875 + 0.25 + 0.25 + 0.25 + 0.25 + 0.125 + 0.125 + 0.375 + 0.375 + 0.125 + 0.375 + 0.125 + 0.375 + 0.0625 + 0.1875 + 0.1875 + 0.5625 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.1875 + 0.0625 + 0.5625 + 0.1875 + 0.0 + 0.0 + 0.75 + 0.25 + 0.125 + 0.125 + 0.375 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0625 + 0.1875 + 0.1875 + 0.5625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-st-table*, type (inline-array vector) +(define *ocean-trans-st-table* (new 'static 'inline-array vector 4 + (new 'static 'vector :z 1.0) + (new 'static 'vector :x 1.0 :z 1.0) + (new 'static 'vector :y 1.0 :z 1.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + ) + ) + + + + diff --git a/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc b/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc index d71db9b8e5..5fa4c6726e 100644 --- a/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc +++ b/goal_src/jak2/engine/gfx/shrub/shrubbery-h.gc @@ -7,3 +7,256 @@ ;; DECOMP BEGINS +(deftype billboard (drawable) + ((flat adgif-shader :inline :offset-assert 32) + ) + :method-count-assert 17 + :size-assert #x70 + :flag-assert #x1100000070 + ) + +(deftype shrub-view-data (structure) + ((data uint128 3 :offset-assert 0) + (texture-giftag gs-gif-tag :inline :offset 0) + (consts vector :inline :offset 16) + (fog-clamp vector :inline :offset 32) + (tex-start-ptr int32 :offset 16) + (gifbufsum float :offset 16) + (mtx-buf-ptr int32 :offset 20) + (exp23 float :offset 20) + (fog-0 float :offset 24) + (fog-1 float :offset 28) + (fog-min float :offset 32) + (fog-max float :offset 36) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype shrubbery (drawable) + ((textures (inline-array adgif-shader) :offset 4) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :offset 16) + (vtx uint32 :offset 20) + (col uint32 :offset 24) + (stq uint32 :offset 28) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype instance-shrubbery (instance) + ((flat-normal vector :inline :offset-assert 64) + (flat-hwidth float :offset 76) + (color uint32 :offset 8) + ) + :method-count-assert 17 + :size-assert #x50 + :flag-assert #x1100000050 + ) + +(deftype drawable-inline-array-instance-shrub (drawable-inline-array) + ((data instance-shrubbery 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 112) + ) + :method-count-assert 17 + :size-assert #x74 + :flag-assert #x1100000074 + ) + +(deftype drawable-tree-instance-shrub (drawable-tree) + ((info prototype-array-shrub-info :offset 8) + (colors-added time-of-day-palette :offset 12) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype generic-shrub-fragment (drawable) + ((textures (inline-array adgif-shader) :offset 4) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :offset 16) + (vtx uint32 :offset 20) + (col uint32 :offset 24) + (stq uint32 :offset 28) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype prototype-shrubbery (drawable-inline-array) + ((data shrubbery 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +(deftype prototype-trans-shrubbery (prototype-shrubbery) + () + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +(deftype prototype-generic-shrub (drawable-group) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype shrubbery-matrix (structure) + ((mat matrix :inline :offset-assert 0) + (color qword :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(defun shrubbery-login-post-texture ((arg0 shrubbery)) + (let* ((v1-1 (-> arg0 header data 0)) + (a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16)))) + (a2-5 (the-as object (+ (the-as int a1-1) (* v1-1 64)))) + (a3-0 (the-as object (-> arg0 textures))) + ) + (dotimes (a0-1 (the-as int v1-1)) + (set! (-> (the-as qword a2-5) quad) (-> (the-as qword a3-0) quad)) + (let ((a2-6 (the-as object (+ (the-as int a2-5) 16))) + (a3-1 (the-as object (&+ (the-as pointer a3-0) 16))) + ) + (set! (-> (the-as qword a1-1) vector4w x) (the-as int (-> (the-as qword a3-1) data 0))) + (set! (-> (the-as qword a1-1) vector4w y) (the-as int (-> (the-as qword a3-1) data 1))) + (set! (-> (the-as qword a1-1) vector4w z) (the-as int (-> (the-as qword a3-1) data 2))) + (set! a1-1 (+ (the-as int a1-1) 16)) + (let ((a3-2 (the-as object (&+ (the-as pointer a3-1) 16)))) + (dotimes (t0-4 3) + (set! (-> (the-as qword a1-1) quad) (-> (the-as qword a3-2) quad)) + (set! a1-1 (+ (the-as int a1-1) 16)) + (set! a3-2 (&+ (the-as pointer a3-2) 16)) + ) + (set! (-> (the-as qword a2-6) quad) (-> (the-as qword a3-2) quad)) + (set! a2-5 (+ (the-as int a2-6) 16)) + (set! a3-0 (&+ (the-as pointer a3-2) 80)) + ) + ) + ) + ) + (none) + ) + +(define *shrub-state* 0) + +(deftype shrub-near-packet (structure) + ((matrix-tmpl dma-packet :inline :offset-assert 0) + (header-tmpl dma-packet :inline :offset-assert 16) + (stq-tmpl dma-packet :inline :offset-assert 32) + (color-tmpl dma-packet :inline :offset-assert 48) + (vertex-tmpl dma-packet :inline :offset-assert 64) + (mscal-tmpl dma-packet :inline :offset-assert 80) + (init-tmpl dma-packet :inline :offset-assert 96) + (init-data uint32 8 :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) + +(deftype instance-shrub-work (structure) + ((dummy qword 3 :inline :offset-assert 0) + (chaina qword 8 :inline :offset-assert 48) + (chainb qword 8 :inline :offset-assert 176) + (colors rgba 1024 :offset-assert 304) + (matrix-tmpl qword 20 :inline :offset-assert 4400) + (count-tmpl vector4w 20 :inline :offset-assert 4720) + (mscalf-tmpl dma-packet :inline :offset-assert 5040) + (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) + (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) + (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) + (billboard-const vector :inline :offset-assert 5136) + (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) + (dma-ref dma-packet :inline :offset-assert 6016) + (dma-end dma-packet :inline :offset-assert 6032) + (wind-const vector :inline :offset-assert 6048) + (constants vector :inline :offset-assert 6064) + (color-constant vector4w :inline :offset-assert 6080) + (hmge-d vector :inline :offset-assert 6096) + (hvdf-offset vector :inline :offset-assert 6112) + (wind-force vector :inline :offset-assert 6128) + (color vector :inline :offset-assert 6144) + (bb-color vector :inline :offset-assert 6160) + (min-dist vector :inline :offset-assert 6176) + (temp-vec vector :inline :offset-assert 6192) + (guard-plane plane 4 :inline :offset-assert 6208) + (plane plane 4 :inline :offset-assert 6272) + (last uint32 4 :offset-assert 6336) + (next uint32 4 :offset-assert 6352) + (count uint16 4 :offset-assert 6368) + (mod-count uint16 4 :offset-assert 6376) + (wind-vectors uint32 :offset-assert 6384) + (instance-ptr uint32 :offset-assert 6388) + (chain-ptr uint32 :offset-assert 6392) + (chain-ptr-next uint32 :offset-assert 6396) + (stack-ptr uint32 :offset-assert 6400) + (bucket-ptr uint32 :offset-assert 6404) + (src-ptr uint32 :offset-assert 6408) + (to-spr uint32 :offset-assert 6412) + (from-spr uint32 :offset-assert 6416) + (shrub-count uint32 :offset-assert 6420) + (pad uint32 :offset-assert 6424) + (node uint32 6 :offset-assert 6428) + (length uint32 6 :offset-assert 6452) + (prototypes uint32 :offset-assert 6476) + (pad2 uint32 :offset-assert 6480) + (start-bank uint8 20 :offset-assert 6484) + (buffer-index uint32 :offset-assert 6504) + (current-spr uint32 :offset-assert 6508) + (current-mem uint32 :offset-assert 6512) + (current-shrub-near-packet uint32 :offset-assert 6516) + (current-shrub-near-trans-packet uint32 :offset-assert 6520) + (pad3 uint32 :offset-assert 6524) + (dma-buffer basic :offset-assert 6528) + (near-last uint32 :offset-assert 6532) + (near-next uint32 :offset-assert 6536) + (near-count uint32 :offset-assert 6540) + (near-trans-last uint32 :offset-assert 6544) + (near-trans-next uint32 :offset-assert 6548) + (near-trans-count uint32 :offset-assert 6552) + (last-shrubs uint32 :offset-assert 6556) + (chains uint32 :offset-assert 6560) + (flags uint32 :offset-assert 6564) + (node-count uint32 :offset-assert 6568) + (inst-count uint32 :offset-assert 6572) + (wait-from-spr uint32 :offset-assert 6576) + (wait-to-spr uint32 :offset-assert 6580) + (texture-dists uint32 :offset-assert 6584) + ) + :method-count-assert 9 + :size-assert #x19bc + :flag-assert #x9000019bc + ) + +(deftype instance-shrub-dma (structure) + ((instancea uint128 325 :offset-assert 0) + (instanceb uint128 325 :offset-assert 5200) + (outa uint128 128 :offset-assert 10400) + (outb uint128 128 :offset-assert 12448) + ) + :method-count-assert 9 + :size-assert #x38a0 + :flag-assert #x9000038a0 + ) diff --git a/goal_src/jak2/engine/gfx/sky/sky-h.gc b/goal_src/jak2/engine/gfx/sky/sky-h.gc index cf50616774..6d7e0621a0 100644 --- a/goal_src/jak2/engine/gfx/sky/sky-h.gc +++ b/goal_src/jak2/engine/gfx/sky/sky-h.gc @@ -7,3 +7,250 @@ ;; DECOMP BEGINS +(deftype sky-color-hour (structure) + ((snapshot1 int32 :offset-assert 0) + (snapshot2 int32 :offset-assert 4) + (morph-start float :offset-assert 8) + (morph-end float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype sky-color-day (structure) + ((hour sky-color-hour 24 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +(deftype sky-sun-data (structure) + ((data uint128 4 :offset-assert 0) + (pos vector :inline :offset 0) + (r-sun float :offset 16) + (r-halo float :offset 20) + (r-aurora float :offset 24) + (c-sun-start rgba :offset 32) + (c-sun-end rgba :offset 48) + (c-halo-start rgba :offset 36) + (c-halo-end rgba :offset 52) + (c-aurora-start rgba :offset 40) + (c-aurora-end rgba :offset 56) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype sky-moon-data (structure) + ((data uint128 2 :offset-assert 0) + (pos vector :inline :offset 0) + (scale vector :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype sky-orbit (structure) + ((high-noon float :offset-assert 0) + (tilt float :offset-assert 4) + (rise float :offset-assert 8) + (dist float :offset-assert 12) + (min-halo float :offset-assert 16) + (max-halo float :offset-assert 20) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(deftype sky-upload-data (structure) + ((data uint128 10 :offset-assert 0) + (sun sky-sun-data 2 :inline :offset 0) + (moon sky-moon-data :inline :offset 128) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +(deftype sky-vertex (structure) + ((pos vector :inline :offset-assert 0) + (stq vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(defmethod inspect sky-vertex ((obj sky-vertex)) + (format #t "sky-vertex [~X]:~%" obj) + (format #t "~TPos: [~F ~F ~F ~F]~%" (-> obj pos x) (-> obj pos y) (-> obj pos z) (-> obj pos w)) + (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> obj stq x) (-> obj stq y) (-> obj stq z) (-> obj stq w)) + (format #t "~TCol: [~F ~F ~F ~F]~%" (-> obj col x) (-> obj col y) (-> obj col z) (-> obj col w)) + obj + ) + +;; definition of type cloud-vertex +(deftype cloud-vertex (structure) + ((pos vector :inline :offset-assert 0) + (stq vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + (nrm vector :inline :offset-assert 48) + (stq2 vector :inline :offset-assert 64) + (col2 vector :inline :offset-assert 80) + (nrm2 vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype cloud-vert-array (structure) + ((data cloud-vertex 100 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x2bc0 + :flag-assert #x900002bc0 + ) + +(deftype haze-vertex (structure) + ((pos vector :inline :offset-assert 0) + (nrm vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype haze-vert-array (structure) + ((data haze-vertex 36 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x6c0 + :flag-assert #x9000006c0 + ) + +(deftype cloud-lights (structure) + ((sun0-normal vector :inline :offset-assert 0) + (sun1-normal vector :inline :offset-assert 16) + (moon-normal vector :inline :offset-assert 32) + (ambi-color vector :inline :offset-assert 48) + (ambi-color-lower vector :inline :offset-assert 64) + (sun0-color vector :inline :offset-assert 80) + (sun1-color vector :inline :offset-assert 96) + (moon-color vector :inline :offset-assert 112) + (sun0-color-lower vector :inline :offset-assert 128) + (sun0-scale float :offset-assert 144) + (sun1-scale float :offset-assert 148) + (moon-scale float :offset-assert 152) + ) + :method-count-assert 9 + :size-assert #x9c + :flag-assert #x90000009c + ) + +(deftype haze-lights (structure) + ((sun0-normal vector :inline :offset-assert 0) + (sun1-normal vector :inline :offset-assert 16) + (moon-normal vector :inline :offset-assert 32) + (ambi-color vector :inline :offset-assert 48) + (sun0-color vector :inline :offset-assert 64) + (sun1-color vector :inline :offset-assert 80) + (moon-color vector :inline :offset-assert 96) + (sun0-scale float :offset-assert 112) + (sun1-scale float :offset-assert 116) + (moon-scale float :offset-assert 120) + ) + :method-count-assert 9 + :size-assert #x7c + :flag-assert #x90000007c + ) + +(deftype sky-work (structure) + ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) + (draw-tmpl dma-gif-packet :inline :offset-assert 32) + (draw-tmpl2 dma-gif-packet :inline :offset-assert 64) + (fog-tmpl dma-gif-packet :inline :offset-assert 96) + (blend-tmpl dma-gif-packet :inline :offset-assert 128) + (sprite-tmpl dma-gif-packet :inline :offset-assert 160) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 192) + (sun-coords vector 2 :inline :offset-assert 224) + (green-coords vector 2 :inline :offset-assert 256) + (moon0-coords vector 2 :inline :offset-assert 288) + (moon1-coords vector 2 :inline :offset-assert 320) + (moon2-coords vector 2 :inline :offset-assert 352) + (star-coords vector 2 :inline :offset-assert 384) + (sun-colors vector 2 :inline :offset-assert 416) + (green-colors vector 2 :inline :offset-assert 448) + (moon-colors vector 3 :inline :offset-assert 480) + (star-colors vector 16 :inline :offset-assert 528) + (st-coords vector 2 :inline :offset-assert 784) + (random vector 8 :inline :offset-assert 816) + (giftag-base dma-gif :inline :offset-assert 944) + (giftag-haze dma-gif :inline :offset-assert 960) + (giftag-roof dma-gif :inline :offset-assert 976) + (giftag-ocean dma-gif :inline :offset-assert 992) + (fog vector :inline :offset-assert 1008) + (sky float 8 :offset-assert 1024) + (time float :offset-assert 1056) + (off-s uint16 :offset-assert 1060) + (off-t uint16 :offset-assert 1062) + (orbit sky-orbit 3 :inline :offset-assert 1064) + (upload-data sky-upload-data :inline :offset-assert 1168) + (ambi-color vector :inline :offset-assert 1328) + (ambi-color-lower vector :inline :offset-assert 1344) + (sun0-color vector :inline :offset-assert 1360) + (sun1-color vector :inline :offset-assert 1376) + (moon-color vector :inline :offset-assert 1392) + (sun0-color-lower vector :inline :offset-assert 1408) + (cam-mat matrix :inline :offset-assert 1424) + (star-mat matrix :inline :offset-assert 1488) + (vec0 vector4w :inline :offset-assert 1552) + (vec1 vector4w :inline :offset-assert 1568) + (cloud-lights cloud-lights :inline :offset-assert 1584) + (haze-lights haze-lights :inline :offset-assert 1744) + (buf basic :offset-assert 1868) + (draw-vortex basic :offset-assert 1872) + (stars vector 512 :inline :offset-assert 1888) + ) + :method-count-assert 37 + :size-assert #x2760 + :flag-assert #x2500002760 + (:methods + (sky-work-method-9 () none 9) + (sky-work-method-10 () none 10) + (sky-work-method-11 () none 11) + (sky-work-method-12 () none 12) + (sky-work-method-13 () none 13) + (sky-work-method-14 () none 14) + (sky-work-method-15 () none 15) + (sky-work-method-16 () none 16) + (sky-work-method-17 () none 17) + (sky-work-method-18 () none 18) + (sky-work-method-19 () none 19) + (sky-work-method-20 () none 20) + (sky-work-method-21 () none 21) + (sky-work-method-22 () none 22) + (sky-work-method-23 () none 23) + (sky-work-method-24 () none 24) + (sky-work-method-25 () none 25) + (sky-work-method-26 () none 26) + (sky-work-method-27 () none 27) + (sky-work-method-28 () none 28) + (sky-work-method-29 () none 29) + (sky-work-method-30 () none 30) + (sky-work-method-31 () none 31) + (sky-work-method-32 () none 32) + (sky-work-method-33 () none 33) + (sky-work-method-34 () none 34) + (sky-work-method-35 () none 35) + (sky-work-method-36 () none 36) + ) + ) diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc index 41c5523e6c..3f27517b93 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-h.gc @@ -5,5 +5,111 @@ ;; name in dgo: sparticle-h ;; dgos: ENGINE, GAME +(defenum sp-cpuinfo-flag + :bitfield #t + :type uint32 + (bit0 0) + (bit1 1) + (bit2 2) ;; cleared after an aux has its func set to add-to-sprite-aux-lst + (bit3 3) + (bit4 4) + (ready-to-launch 6) ;; maybe just just death? + (bit7 7) + (aux-list 8) ;; prevents relaunch, adds to aux + (bit9 9) + (level0 10) + (level1 11) + (bit12 12) ;; required to relaunch + (bit13 13) + (bit14 14) + (use-global-acc 16) + (launch-along-z 17) + (left-multiply-quat 18) + (right-multiply-quat 19) + (set-conerot 20) + ) + + ;; DECOMP BEGINS +(define *sp-60-hz* #t) + +(deftype sparticle-cpuinfo (structure) + ((sprite sprite-vec-data-2d :offset-assert 0) + (adgif adgif-shader :offset-assert 4) + (radius float :offset-assert 8) + (omega float :offset-assert 12) + (vel-sxvel vector :inline :offset-assert 16) + (rot-syvel vector :inline :offset-assert 32) + (fade rgbaf :inline :offset-assert 48) + (acc vector :inline :offset-assert 64) + (rotvel3d quaternion :inline :offset-assert 80) + (vel vector3s :inline :offset 16) + (accel vector3s :inline :offset 64) + (scalevelx float :offset 28) + (scalevely float :offset 44) + (friction float :offset-assert 96) + (timer int32 :offset-assert 100) + (flags sp-cpuinfo-flag :offset-assert 104) + (user-int32 int32 :offset-assert 108) + (user-uint32 uint32 :offset 108) + (user-float float :offset 108) + (user-pntr uint32 :offset 108) + (user-object basic :offset 108) + (user-sprite sprite-vec-data-2d :offset 108) + (sp-func basic :offset-assert 112) + (next-time uint32 :offset-assert 116) + (next-launcher basic :offset-assert 120) + (cache-alpha float :offset-assert 124) + (valid uint8 :offset-assert 128) + (clock-index uint8 :offset-assert 129) + (user1-int16 uint16 :offset-assert 130) + (key sparticle-launch-control :offset-assert 132) + (binding sparticle-launch-state :offset-assert 136) + (data uint32 1 :offset 12) + (datab uint8 4 :offset 12) + (dataf float 1 :offset 12) + (datac uint8 1 :offset 12) + ) + :method-count-assert 9 + :size-assert #x8c + :flag-assert #x90000008c + ) + +(deftype sparticle-launchinfo (structure) + ((launchrot vector :inline :offset-assert 0) + (conerot vector :inline :offset-assert 16) + (rotate-x float :offset-assert 32) + (rotate-y float :offset-assert 36) + (rotate-z float :offset-assert 40) + (coneradius float :offset-assert 44) + (rotate vector :inline :offset 32) + (scale-x float :offset 48) + (scale-y float :offset 52) + (scale-z float :offset 56) + (dummy float :offset 60) + (scale vector :inline :offset 48) + (data uint8 1 :offset 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype sparticle-system (basic) + ((blocks int32 2 :offset-assert 4) + (length int32 2 :offset-assert 12) + (num-alloc int32 2 :offset-assert 20) + (is-3d basic :offset-assert 28) + (flags uint32 :offset-assert 32) + (alloc-table (pointer uint64) :offset-assert 36) + (cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40) + (vecdata-table pointer :offset-assert 44) + (adgifdata-table (inline-array adgif-shader) :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + + diff --git a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc index e7ec4c28c1..b3bbe76a9f 100644 --- a/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/particles/sparticle-launcher-h.gc @@ -5,5 +5,275 @@ ;; name in dgo: sparticle-launcher-h ;; dgos: ENGINE, GAME +;; note: changed from jak 1, slightly. +(defenum sp-field-id + :type uint16 + + (misc-fields-start 0) + (spt-texture 1) + (spt-anim 2) + (spt-anim-speed 3) + (spt-birth-func 4) + (spt-joint/refpoint 5) + (spt-num 6) + (spt-sound 7) + (misc-fields-end 8) + + (sprite-fields-start 9) + (spt-x 10) + (spt-y 11) + (spt-z 12) + (spt-scale-x 13) + (spt-rot-x 14) + (spt-rot-y 15) + (spt-rot-z 16) + (spt-scale-y 17) + (spt-r 18) + (spt-g 19) + (spt-b 20) + (spt-a 21) + (sprite-fields-end 22) + + (cpu-fields-start 23) + (spt-omega 24) + (spt-vel-x 25) + (spt-vel-y 26) + (spt-vel-z 27) + (spt-scalevel-x 28) + (spt-rotvel-x 29) + (spt-rotvel-y 30) + (spt-rotvel-z 31) + (spt-scalevel-y 32) + (spt-fade-r 33) + (spt-fade-g 34) + (spt-fade-b 35) + (spt-fade-a 36) + (spt-accel-x 37) + (spt-accel-y 38) + (spt-accel-z 39) + (spt-dummy 40) + (spt-quat-x 41) + (spt-quat-y 42) + (spt-quat-z 43) + (spt-quad-w 44) + (spt-friction 45) + (spt-timer 46) + (spt-flags 47) + (spt-userdata 48) + (spt-func 49) + (spt-next-time 50) + (spt-next-launcher 51) + (cpu-fields-end 52) + + (launch-fields-start 53) + (spt-launchrot-x 54) + (spt-launchrot-y 55) + (spt-launchrot-z 56) + (spt-launchrot-w 57) + (spt-conerot-x 58) + (spt-conerot-y 59) + (spt-conerot-z 60) + (spt-conerot-w 61) + (spt-rotate-x 62) + (spt-rotate-y 63) + (spt-rotate-z 64) + + (spt-conerot-radius 65) + (spt-mat-scale-x 66) + (spt-mat-scale-y 67) + (spt-mat-scale-z 68) + (launch-fields-end 69) + + (spt-scale 70) + (spt-scalevel 71) + (spt-end 72) + ) + +;; appears the same as jak 1 +(defenum sp-flag + :type uint16 + (plain-v1 0) ;; just a plain signed integer. No random crap. + (float-with-rand 1) + (int-with-rand 2) + (copy-from-other-field 3) + (plain-v2 4) + (from-pointer 5) + (part-by-id 6) + ) + +(defenum sp-group-item-flag + :bitfield #t + :type uint16 + (is-3d 0) + (bit1 1) + (start-dead 2) + (launch-asap 3) + (bit6 6) + ) + +(defenum sp-launch-state-flags + :bitfield #t + :type uint16 + (launcher-active 0) ;; active + (particles-active 1) ;; wants to launch + (bit2 2) + ) + +(defenum sp-group-flag + :bitfield #t + :type uint16 + (use-local-clock 0) + (always-draw 1) + (screen-space 2) + (unknown-bit-01 3) ;; beach-part + ) + +(declare-type sparticle-cpuinfo structure) + + ;; DECOMP BEGINS +(deftype sparticle-birthinfo (structure) + ((sprite uint32 :offset-assert 0) + (anim int32 :offset-assert 4) + (anim-speed float :offset-assert 8) + (birth-func basic :offset-assert 12) + (joint-ppoint int32 :offset-assert 16) + (num-to-birth float :offset-assert 20) + (sound basic :offset-assert 24) + (dataf float 1 :offset 0) + (data uint32 1 :offset 0) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(deftype sp-field-init-spec (structure) + ((field sp-field-id :offset-assert 0) + (flags sp-flag :offset-assert 2) + (initial-valuef float :offset-assert 4) + (random-rangef float :offset-assert 8) + (random-multf float :offset-assert 12) + (initial-value int32 :offset 4) + (random-range int32 :offset 8) + (random-mult int32 :offset 12) + (func symbol :offset 4) + (tex texture-id :offset 4) + (pntr pointer :offset 4) + (object basic :offset 4) + (sym symbol :offset 4) + (sound sound-spec :offset 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype sparticle-launcher (basic) + ((birthaccum float :offset-assert 4) + (soundaccum float :offset-assert 8) + (init-specs (inline-array sp-field-init-spec) :offset-assert 12) + ) + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (sparticle-launcher-method-9 () none 9) + (sparticle-launcher-method-10 () none 10) + ) + ) + +(deftype sparticle-group-item (structure) + ((launcher uint32 :offset-assert 0) + (fade-after meters :offset-assert 4) + (falloff-to meters :offset-assert 8) + (flags sp-group-item-flag :offset-assert 12) + (period uint16 :offset-assert 14) + (length uint16 :offset-assert 16) + (offset int16 :offset-assert 18) + (hour-mask uint32 :offset-assert 20) + (binding uint32 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(deftype sparticle-launch-state (structure) + ((group-item sparticle-group-item :offset-assert 0) + (flags sp-launch-state-flags :offset-assert 4) + (randomize uint16 :offset-assert 6) + (center vector :offset-assert 8) + (sprite3d sprite-vec-data-3d :offset-assert 12) + (sprite sparticle-cpuinfo :offset-assert 16) + (offset uint32 :offset-assert 20) + (accum float :offset-assert 24) + (spawn-time uint32 :offset-assert 28) + (control basic :offset-assert 32) + (swarm basic :offset 20) + (seed uint32 :offset 24) + (time uint32 :offset 28) + (spec basic :offset 16) + (id uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(deftype sparticle-launch-group (basic) + ((length int16 :offset-assert 4) + (duration uint16 :offset-assert 6) + (linger-duration uint16 :offset-assert 8) + (flags sp-group-flag :offset-assert 10) + (name string :offset-assert 12) + (launcher (inline-array sparticle-group-item) :offset-assert 16) + (rotate-x degrees :offset-assert 20) + (rotate-y degrees :offset-assert 24) + (rotate-z degrees :offset-assert 28) + (scale-x float :offset-assert 32) + (scale-y float :offset-assert 36) + (scale-z float :offset-assert 40) + (bounds sphere :inline :offset-assert 48) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (sparticle-launch-group-method-9 () none 9) + ) + ) + +(define *launch-matrix* (matrix-identity! (new 'global 'matrix))) + +(deftype sparticle-launch-control (inline-array-class) + ((group sparticle-launch-group :offset-assert 16) + (proc process :offset-assert 20) + (local-clock int32 :offset-assert 24) + (fade float :offset-assert 28) + (matrix int8 :offset-assert 32) + (state-mode uint8 3 :offset-assert 33) + (state-counter uint32 :offset-assert 36) + (last-spawn-frame int32 :offset-assert 40) + (last-spawn-time int32 :offset-assert 44) + (origin matrix :inline :offset-assert 48) + (center vector :inline :offset 96) + (data sparticle-launch-state :inline :dynamic :offset-assert 112) + ) + :method-count-assert 16 + :size-assert #x70 + :flag-assert #x1000000070 + (:methods + (sparticle-launch-control-method-9 () none 9) + (sparticle-launch-control-method-10 () none 10) + (sparticle-launch-control-method-11 () none 11) + (sparticle-launch-control-method-12 () none 12) + (sparticle-launch-control-method-13 () none 13) + (sparticle-launch-control-method-14 () none 14) + (sparticle-launch-control-method-15 () none 15) + ) + ) + +(set! (-> sparticle-launch-control heap-base) (the-as uint 48)) + diff --git a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc index d0acedfcfe..e857dda62f 100644 --- a/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/simple-sprite-h.gc @@ -7,3 +7,47 @@ ;; DECOMP BEGINS +(deftype sprite-glow-data (structure) + ((position vector :inline :offset-assert 0) + (size-x float :offset 12) + (size-probe float :offset-assert 16) + (z-offset float :offset-assert 20) + (rot-angle float :offset-assert 24) + (size-y float :offset-assert 28) + (color rgbaf :inline :offset-assert 32) + (fade-a float :offset-assert 48) + (fade-b float :offset-assert 52) + (tex-id uint32 :offset-assert 56) + (dummy uint32 :offset-assert 60) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (set-trans (_type_ vector) none 9) + ) + ) + +(defmethod set-trans sprite-glow-data ((obj sprite-glow-data) (arg0 vector)) + (let ((f0-0 (-> obj position w))) + (set! (-> obj position quad) (-> arg0 quad)) + (set! (-> obj position w) f0-0) + ) + 0 + (none) + ) + +(deftype simple-sprite-system (structure) + ((count int16 :offset-assert 0) + (max-count int16 :offset-assert 2) + (data uint32 :offset-assert 4) + ) + :method-count-assert 12 + :size-assert #x8 + :flag-assert #xc00000008 + (:methods + (simple-sprite-system-method-9 () none 9) + (simple-sprite-system-method-10 () none 10) + (simple-sprite-system-method-11 () none 11) + ) + ) diff --git a/goal_src/jak2/engine/gfx/sprite/sprite-h.gc b/goal_src/jak2/engine/gfx/sprite/sprite-h.gc index c2522c82fc..41c9c3f7d2 100644 --- a/goal_src/jak2/engine/gfx/sprite/sprite-h.gc +++ b/goal_src/jak2/engine/gfx/sprite/sprite-h.gc @@ -7,3 +7,80 @@ ;; DECOMP BEGINS +(deftype sprite-vec-data-2d (structure) + ((x-y-z-sx vector :inline :offset-assert 0) + (flag-rot-sy vector :inline :offset-assert 16) + (r-g-b-a vector :inline :offset-assert 32) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (sx float :offset 12) + (sy float :offset 28) + (rot float :offset 24) + (flag int32 :offset 16) + (matrix int32 :offset 20) + (warp-turns int32 :offset 16) + (r float :offset 32) + (g float :offset 36) + (b float :offset 40) + (a float :offset 44) + (trans vector3s :inline :offset 0) + (color rgbaf :inline :offset 32) + (data uint128 1 :offset 0) + (data64 uint64 6 :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype sprite-array-2d (basic) + ((num-sprites int32 2 :offset-assert 4) + (num-valid int32 2 :offset-assert 12) + (vec-data pointer :offset-assert 20) + (adgif-data (inline-array adgif-shader) :offset-assert 24) + (pad uint128 4 :offset-assert 32) + (data uint128 1 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype sprite-vec-data-3d (structure) + ((x-y-z-sx vector :inline :offset-assert 0) + (qx-qy-qz-sy vector :inline :offset-assert 16) + (r-g-b-a vector :inline :offset-assert 32) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (sx float :offset 12) + (sy float :offset 28) + (qx float :offset 16) + (qy float :offset 20) + (qz float :offset 24) + (r float :offset 32) + (g float :offset 36) + (b float :offset 40) + (a float :offset 44) + (trans vector3s :inline :offset 0) + (rot vector3s :inline :offset 16) + (color rgbaf :inline :offset 32) + (data uint128 1 :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype sprite-array-3d (basic) + ((num-sprites int32 2 :offset-assert 4) + (num-valid int32 2 :offset-assert 12) + (vec-data pointer :offset-assert 20) + (adgif-data (inline-array adgif-shader) :offset-assert 24) + (data uint128 1 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) diff --git a/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc b/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc index 889d93f86e..dbf4dc8314 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-anim-h.gc @@ -7,3 +7,194 @@ ;; DECOMP BEGINS +(deftype texture-anim-layer (structure) + ((extra vector :inline :offset 240) + (func basic :offset 256) + (func-id basic :offset 256) + (init-func basic :offset 260) + (init-func-id basic :offset 260) + (tex basic :offset 264) + (start-time float :offset 268) + (end-time float :offset 272) + (tex-name basic :offset 276) + (test uint64 :offset 280) + (alpha uint64 :offset 288) + (clamp uint64 :offset 296) + (start-color vector :inline :offset 80) + (start-scale vector2 :inline :offset 96) + (start-offset vector2 :inline :offset 104) + (start-st-scale vector2 :inline :offset 112) + (start-st-offset vector2 :inline :offset 120) + (start-qs vector :inline :offset 128) + (start-rot degrees :offset 144) + (start-st-rot degrees :offset 148) + (end-color vector :inline :offset 160) + (end-scale vector2 :inline :offset 176) + (end-offset vector2 :inline :offset 184) + (end-st-scale vector2 :inline :offset 192) + (end-st-offset vector2 :inline :offset 200) + (end-qs vector :inline :offset 208) + (end-rot degrees :offset 224) + (end-st-rot degrees :offset 228) + ) + :method-count-assert 11 + :size-assert #x130 + :flag-assert #xb00000130 + (:methods + (texture-anim-layer-method-9 () none 9) + (texture-anim-layer-method-10 () none 10) + ) + ) + +(deftype texture-anim (structure) + ((num-layers uint32 :offset-assert 0) + (func basic :offset-assert 4) + (func-id basic :offset 4) + (init-func basic :offset-assert 8) + (init-func-id basic :offset 8) + (tex basic :offset-assert 12) + (tex-name basic :offset-assert 16) + (extra vector :inline :offset-assert 32) + (color uint32 :offset-assert 48) + (frame-time float :offset-assert 52) + (frame-delta float :offset-assert 56) + (frame-mod float :offset-assert 60) + (test uint64 :offset-assert 64) + (alpha uint64 :offset-assert 72) + (clamp uint64 :offset-assert 80) + (data uint8 :dynamic :offset-assert 88) + ) + :method-count-assert 11 + :size-assert #x58 + :flag-assert #xb00000058 + (:methods + (texture-anim-method-9 () none 9) + (texture-anim-method-10 () none 10) + ) + ) + +(deftype texture-anim-array (array) + () + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (texture-anim-array-method-9 () none 9) + (texture-anim-array-method-10 () none 10) + ) + ) + +(deftype texture-anim-work (structure) + ((erase-tmpl dma-gif-packet :inline :offset-assert 0) + (draw-tmpl dma-gif-packet :inline :offset-assert 32) + (draw2-tmpl dma-gif-packet :inline :offset-assert 64) + (fill-tmpl dma-gif-packet :inline :offset-assert 96) + (adgif-tmpl dma-gif-packet :inline :offset-assert 128) + (corner0 vector :inline :offset-assert 160) + (corner1 vector :inline :offset-assert 176) + (corner2 vector :inline :offset-assert 192) + (corner3 vector :inline :offset-assert 208) + (const vector :inline :offset-assert 224) + (random vector 8 :inline :offset-assert 240) + (random-index uint8 :offset-assert 368) + ) + :method-count-assert 9 + :size-assert #x171 + :flag-assert #x900000171 + ) + +(deftype clut16x16 (structure) + ((clut rgba 256 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x400 + :flag-assert #x900000400 + ) + +(deftype noise8x8 (structure) + ((image uint8 64 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype noise16x16 (structure) + ((image uint8 256 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +(deftype noise32x32 (structure) + ((image uint8 1024 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x400 + :flag-assert #x900000400 + ) + +(deftype noise64x64 (structure) + ((image uint8 4096 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x1000 + :flag-assert #x900001000 + ) + +(deftype noise128x128 (structure) + ((image uint8 16384 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4000 + :flag-assert #x900004000 + ) + +(deftype fog8x256 (structure) + ((image uint8 256 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +(deftype fog-texture-work (structure) + ((corner vector 4 :inline :offset-assert 0) + (const vector :inline :offset-assert 64) + (min-corner vector :inline :offset-assert 80) + (max-corner vector :inline :offset-assert 96) + (fog-near float :offset-assert 112) + (fog-far float :offset-assert 116) + (fog-delta float :offset-assert 120) + (alpha-near float :offset-assert 124) + (alpha-far float :offset-assert 128) + (alpha-delta float :offset-assert 132) + (color uint32 :offset-assert 136) + ) + :method-count-assert 9 + :size-assert #x8c + :flag-assert #x90000008c + ) + +(define *clut-translate* + (new 'static 'array uint32 64 + #x3020100 #x7060504 #x13121110 #x17161514 + #xb0a0908 #xf0e0d0c #x1b1a1918 #x1f1e1d1c + #x23222120 #x27262524 #x33323130 #x37363534 + #x2b2a2928 #x2f2e2d2c #x3b3a3938 #x3f3e3d3c + #x43424140 #x47464544 #x53525150 #x57565554 + #x4b4a4948 #x4f4e4d4c #x5b5a5958 #x5f5e5d5c + #x63626160 #x67666564 #x73727170 #x77767574 + #x6b6a6968 #x6f6e6d6c #x7b7a7978 #x7f7e7d7c + #x83828180 #x87868584 #x93929190 #x97969594 + #x8b8a8988 #x8f8e8d8c #x9b9a9998 #x9f9e9d9c + #xa3a2a1a0 #xa7a6a5a4 #xb3b2b1b0 #xb7b6b5b4 + #xabaaa9a8 #xafaeadac #xbbbab9b8 #xbfbebdbc + #xc3c2c1c0 #xc7c6c5c4 #xd3d2d1d0 #xd7d6d5d4 + #xcbcac9c8 #xcfcecdcc #xdbdad9d8 #xdfdedddc + #xe3e2e1e0 #xe7e6e5e4 #xf3f2f1f0 #xf7f6f5f4 + #xebeae9e8 #xefeeedec #xfbfaf9f8 #xfffefdfc + ) + ) + diff --git a/goal_src/jak2/engine/gfx/texture/texture-h.gc b/goal_src/jak2/engine/gfx/texture/texture-h.gc index 950daa92dc..07ab0a3922 100644 --- a/goal_src/jak2/engine/gfx/texture/texture-h.gc +++ b/goal_src/jak2/engine/gfx/texture/texture-h.gc @@ -5,5 +5,706 @@ ;; name in dgo: texture-h ;; dgos: ENGINE, GAME +;; TODO document and method names with texture.gc + +(declare-type texture-page basic) + ;; DECOMP BEGINS +(deftype texture-id (uint32) + ((index uint16 :offset 8 :size 12) + (page uint16 :offset 20 :size 12) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype texture-pool-segment (structure) + ((dest uint32 :offset-assert 0) + (size uint32 :offset-assert 4) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype texture-pool (basic) + ((top int32 :offset-assert 4) + (cur int32 :offset-assert 8) + (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) + (font-palette int32 :offset-assert 16) + (segment texture-pool-segment 4 :inline :offset-assert 20) + (segment-near texture-pool-segment :inline :offset 20) + (segment-common texture-pool-segment :inline :offset 28) + (common-page texture-page 32 :offset-assert 52) + (common-page-mask int32 :offset-assert 180) + (update-sprites-flag symbol :offset-assert 184) + (update-flag symbol :offset-assert 188) + (texture-enable-user uint64 :offset-assert 192) + (texture-enable-user-menu uint64 :offset-assert 200) + (ids uint32 128 :offset-assert 208) + ) + :method-count-assert 26 + :size-assert #x2d0 + :flag-assert #x1a000002d0 + (:methods + (new (symbol type) _type_ 0) + (initialize! (_type_) _type_ 9) + (texture-pool-method-10 () none 10) ;; (print-usage (_type_) _type_ 10) + (texture-pool-method-11 () none 11) ;; (setup-font-texture! (_type_) none 11) + (allocate-defaults! (_type_) none 12) + (login-level-textures (_type_ level int (pointer texture-id)) none 13) + (texture-pool-method-14 () none 14) ;; (add-tex-to-dma! (_type_ level int) none 14) + (allocate-vram-words! (_type_ int) int 15) + (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) + (texture-pool-method-17 () none 17) ;; (unused-17 () none 17) + (texture-pool-method-18 (_type_ int) int 18) ;; (unused-18 () none 18) + (update-warp-and-hud (_type_) none 19) ;; (unused-19 () none 19) + (update-sprites (_type_) none 20) ;; (unload! (_type_ texture-page) int 20) + (flag-update-and-sprite (_type_) none 21) ;; (upload-one-common! (_type_ level) symbol 21) + (relocate-sprite-dests! (_type_) none 22) ;; (lookup-boot-common-id (_type_ int) int 22) + (relocate-hud-dests! (_type_) none 23) + (relocate-warp-dests! (_type_) none 24) + (clear-ids (_type_) none 25) + ) + ) + +(deftype texture-mask (structure) + ((mask vector4w :inline :offset-assert 0) + (dist float :offset 12) + (long uint64 2 :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype texture-masks (structure) + ((data texture-mask 3 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype texture-masks-array (inline-array-class) + ((data texture-masks :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> texture-masks-array heap-base) (the-as uint 48)) + +(define *texture-masks* (the-as texture-masks #f)) +(define *texture-masks-array* (the-as texture-masks-array #f)) + +(deftype texture (basic) + ((w int16 :offset-assert 4) + (h int16 :offset-assert 6) + (num-mips uint8 :offset-assert 8) + (tex1-control uint8 :offset-assert 9) + (psm gs-psm :offset-assert 10) + (mip-shift uint8 :offset-assert 11) + (clutpsm uint16 :offset-assert 12) + (dest uint16 7 :offset-assert 14) + (clutdest uint16 :offset-assert 28) + (width uint8 7 :offset-assert 30) + (name string :offset-assert 40) + (size uint32 :offset-assert 44) + (uv-dist float :offset-assert 48) + (pad uint32 3 :offset-assert 52) + (masks texture-masks :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +(deftype texture-page-segment (structure) + ((block-data pointer :offset-assert 0) + (size uint32 :offset-assert 4) + (dest uint32 :offset-assert 8) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(defun texture-mip->segment ((arg0 int) (arg1 int)) + (if (>= 2 arg1) + (+ (- -1 arg0) arg1) + (max 0 (- 2 arg0)) + ) + ) + +(deftype texture-page (basic) + ((info file-info :offset-assert 4) + (name basic :offset-assert 8) + (id uint32 :offset-assert 12) + (length int32 :offset-assert 16) + (mip0-size uint32 :offset-assert 20) + (size uint32 :offset-assert 24) + (segment texture-page-segment 3 :inline :offset-assert 28) + (dram-size uint32 :offset-assert 64) + (pad uint32 15 :offset-assert 68) + (data texture :dynamic :offset-assert 128) + ) + :method-count-assert 14 + :size-assert #x80 + :flag-assert #xe00000080 + (:methods + (remove-from-heap (_type_ kheap) _type_ 9) + (get-leftover-block-count (_type_ int int) int 10) + (relocate-dests! (_type_ int int) none 11) ;; (unused-11 () none 11) + (texture-page-method-12 () none 12) ;; + (upload-now! (_type_ int) none 13) ;; (add-to-dma-buffer (_type_ dma-buffer int) int 13) + ) + ) + +(deftype shader-ptr (uint32) + ((shader uint32 :offset 8 :size 24) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype texture-link (structure) + ((next shader-ptr :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype texture-page-dir-entry (structure) + ((length int16 :offset-assert 0) + (status uint16 :offset-assert 2) + (page texture-page :offset-assert 4) + (link texture-link :offset-assert 8) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype texture-page-dir (basic) + ((length int32 :offset-assert 4) + (entries texture-page-dir-entry 1 :inline :offset-assert 8) + ) + :method-count-assert 10 + :size-assert #x14 + :flag-assert #xa00000014 + (:methods + (relocate (_type_ kheap (pointer uint8)) none :replace 7) + (unlink-textures-in-heap! (_type_ kheap) int 9) + ) + ) + +(deftype texture-relocate-later (basic) + ((memcpy symbol :offset-assert 4) + (dest uint32 :offset-assert 8) + (source uint32 :offset-assert 12) + (move uint32 :offset-assert 16) + (entry texture-page-dir-entry :offset-assert 20) + (page texture-page :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +(define *texture-relocate-later* (new 'global 'texture-relocate-later)) +(set! (-> *texture-relocate-later* memcpy) #f) + +(define *texture-page-dir* (the-as texture-page-dir #f)) + +(defenum link-test-flags + :type uint32 + :bitfield #t + ; (needs-log-in 8) + ; (bit-9 9) + ) + +(deftype adgif-shader (structure) + ((quad qword 5 :inline :offset-assert 0) + (prims gs-reg64 10 :offset 0) + (reg-0 uint8 :offset 8) + (reg-1 uint8 :offset 24) + (reg-2 uint8 :offset 40) + (reg-3 uint8 :offset 56) + (reg-4 uint8 :offset 72) + (tex0 gs-tex0 :offset 0) + (tex1 gs-tex1 :offset 16) + (miptbp1 gs-miptbp :offset 32) + (clamp gs-clamp :offset 48) + (clamp-reg gs-reg64 :offset 56) + (alpha gs-alpha :offset 64) + (link-test link-test-flags :offset 8) + (texture-id texture-id :offset 24) + (next shader-ptr :offset 40) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype adgif-shader-array (inline-array-class) + ((data adgif-shader :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> adgif-shader-array heap-base) (the-as uint 80)) + +(deftype texture-base (structure) + ((vram-page uint32 :offset-assert 0) + (vram-block uint32 :offset-assert 4) + (vram-word uint32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + + +(define ct32-24-block-table + (new 'static 'boxed-array :type int32 + 0 1 4 5 16 17 20 21 2 3 6 7 18 19 22 23 + 8 9 12 13 24 25 28 29 10 11 14 15 26 27 + 30 31 ) + ) + +(define mz32-24-block-table + (new 'static 'boxed-array :type int32 + 16 17 20 21 0 1 4 5 18 19 22 23 2 3 6 7 + 24 25 28 29 8 9 12 13 26 27 30 31 10 11 + 14 15 ) + + ) + +(define ct16-block-table + (new 'static 'boxed-array :type int32 + 0 2 8 10 1 3 9 11 4 6 12 14 5 7 13 15 16 18 + 24 26 17 19 25 27 20 22 28 30 21 23 29 31 + ) + + ) + +(define ct16s-block-table + (new 'static 'boxed-array :type int32 + 0 2 16 18 1 3 17 19 8 10 24 26 9 11 25 27 + 4 6 20 22 5 7 21 23 12 14 28 30 13 15 29 31 + ) + + ) + +(define mz16-block-table + (new 'static 'boxed-array :type int32 + 16 18 24 26 17 19 25 27 20 22 28 30 21 23 29 + 31 0 2 8 10 1 3 9 11 4 6 12 14 5 7 13 15) + ) + +(define mz16s-block-table + (new 'static 'boxed-array :type int32 + 16 18 0 2 17 19 1 3 24 26 8 10 25 27 9 11 + 20 22 4 6 21 23 5 7 28 30 12 14 29 31 13 + 15 + ) + ) + +(define mt8-block-table + (new 'static 'boxed-array :type int32 + 0 1 4 5 16 17 20 21 2 3 6 7 18 19 22 23 8 9 + 12 13 24 25 28 29 10 11 14 15 26 27 30 31 + ) + ) + +(define mt4-block-table + (new 'static 'boxed-array :type int32 + 0 2 8 10 1 3 9 11 4 6 12 14 5 7 13 15 16 18 + 24 26 17 19 25 27 20 22 28 30 21 23 29 31 + ) + ) + +(deftype texture-page-translate-item (structure) + ((bucket bucket-id :offset-assert 0) + (level-index uint32 :offset-assert 4) + (level-texture-page uint32 :offset-assert 8) + (texture-user uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(define *texture-page-translate* + (new 'static 'boxed-array :type texture-page-translate-item + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-4) + :level-index #x6 + :level-texture-page #x9 + :texture-user #x100 + ) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-7) :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-18) :level-index #x1 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-29) :level-index #x2 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-40) :level-index #x3 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-51) :level-index #x4 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-62) :level-index #x5 :texture-user #x1) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-73) + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-82) + :level-index #x1 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-91) + :level-index #x2 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-100) + :level-index #x3 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-109) + :level-index #x4 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-118) + :level-index #x5 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-127) + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-137) + :level-index #x1 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-147) + :level-index #x2 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-157) + :level-index #x3 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-167) + :level-index #x4 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-177) + :level-index #x5 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-187) :level-index #x6 :texture-user #x1) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-191) + :level-index #x6 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-196) + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-200) + :level-index #x1 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-204) + :level-index #x2 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-208) + :level-index #x3 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-212) + :level-index #x4 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-216) + :level-index #x5 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-220) + :level-index #x6 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-224) + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-228) + :level-index #x1 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-232) + :level-index #x2 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-236) + :level-index #x3 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-240) + :level-index #x4 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-244) + :level-index #x5 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-248) + :level-index #x6 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-252) + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-261) + :level-index #x1 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-270) + :level-index #x2 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-279) + :level-index #x3 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-288) + :level-index #x4 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-297) + :level-index #x5 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-306) + :level-index #x6 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-309) + :level-index #x6 + :level-texture-page #x9 + :texture-user #x100 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x1 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x2 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x3 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x4 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x5 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x6 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x1 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x2 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x3 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x4 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x5 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x6 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x1 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x2 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x3 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x4 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x5 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x6 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x6 + :level-texture-page #x3 + :texture-user #x80 + ) + ) + ) + +(define *eyes-texture-base* (new 'static 'texture-base)) +(define *skull-gem-texture-base* (new 'static 'texture-base)) +(define *ocean-texture-base* (new 'static 'texture-base)) +(define *ocean-envmap-texture-base* (new 'static 'texture-base)) +(define *grey-scale-base* (new 'static 'texture-base)) +(define *map-texture-base* (new 'static 'texture-base)) + diff --git a/goal_src/jak2/engine/gfx/tfrag/tfrag-h.gc b/goal_src/jak2/engine/gfx/tfrag/tfrag-h.gc index 9637056788..a2e973abda 100644 --- a/goal_src/jak2/engine/gfx/tfrag/tfrag-h.gc +++ b/goal_src/jak2/engine/gfx/tfrag/tfrag-h.gc @@ -7,3 +7,239 @@ ;; DECOMP BEGINS +(deftype tfragment-stats (structure) + ((num-tris uint16 4 :offset-assert 0) + (num-dverts uint16 4 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype tfragment-debug-data (structure) + ((stats tfragment-stats :inline :offset-assert 0) + (debug-lines (array vector-array) :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype generic-tfragment (structure) + ((dummy int32 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype tfragment (drawable) + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :offset 12) + (dma-chain uint32 3 :offset 32) + (dma-common uint32 :offset 32) + (dma-level-0 uint32 :offset 32) + (dma-base uint32 :offset 36) + (dma-level-1 uint32 :offset 40) + (dma-qwc uint8 4 :offset 44) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +(deftype drawable-inline-array-tfrag (drawable-inline-array) + ((data tfragment 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 96) + ) + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ) + +(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline :offset-assert 112) + (pad2 uint32 :offset-assert 176) + ) + :method-count-assert 17 + :size-assert #xb4 + :flag-assert #x11000000b4 + ) + +(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline :offset-assert 112) + (pad2 uint32 :offset-assert 176) + ) + :method-count-assert 17 + :size-assert #xb4 + :flag-assert #x11000000b4 + ) + +(deftype drawable-tree-tfrag (drawable-tree) + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype tfrag-dists (structure) + ((data uint32 16 :offset-assert 0) + (vector vector 4 :inline :offset 0) + (k0s vector 2 :inline :offset 0) + (k1s vector 2 :inline :offset 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype tfrag-data (structure) + ((data uint32 56 :offset 0) + (vector vector 14 :inline :offset 0) + (fog vector :inline :offset 0) + (val vector :inline :offset 16) + (strgif gs-gif-tag :inline :offset 32) + (fangif gs-gif-tag :inline :offset 48) + (adgif gs-gif-tag :inline :offset 64) + (hvdf-offset vector :inline :offset 80) + (hmge-scale vector :inline :offset 96) + (invh-scale vector :inline :offset 112) + (ambient vector :inline :offset 128) + (guard vector :inline :offset 144) + (dists tfrag-dists :inline :offset 160) + (k0s uint128 2 :offset 160) + (k1s uint128 2 :offset 192) + ) + :method-count-assert 9 + :size-assert #xe0 + :flag-assert #x9000000e0 + ) + +(deftype tfrag-control (structure) + ((num-base-points uint32 :offset-assert 0) + (num-shared-base-points uint32 :offset-assert 4) + (num-level0-points uint32 :offset-assert 8) + (num-shared-level0-points uint32 :offset-assert 12) + (num-level1-points uint32 :offset-assert 16) + (num-shared-level1-points uint32 :offset-assert 20) + (ptr-vtxdata uint32 :offset-assert 24) + (ptr-base-points uint32 :offset-assert 28) + (ptr-shared-base-points uint32 :offset-assert 32) + (ptr-level0-points uint32 :offset-assert 36) + (ptr-shared-level0-points uint32 :offset-assert 40) + (ptr-level1-points uint32 :offset-assert 44) + (ptr-shared-level1-points uint32 :offset-assert 48) + (ptr-draw-points uint32 :offset-assert 52) + (ptr-interpolated-0 uint32 :offset-assert 56) + (ptr-shared-interpolated-0 uint32 :offset-assert 60) + (ptr-interpolated1 uint32 :offset-assert 64) + (ptr-shared-interpolated1 uint32 :offset-assert 68) + (ptr-strip-data uint32 :offset-assert 72) + (ptr-texture-data uint32 :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype tfrag-stats (structure) + ((from int32 :offset-assert 0) + (to int32 :offset-assert 4) + (cnt int32 :offset-assert 8) + (tris int32 :offset-assert 12) + (tfaces int32 :offset-assert 16) + (tfrags int32 :offset-assert 20) + (dtris int32 :offset-assert 24) + (base-verts int32 :offset-assert 28) + (level0-verts int32 :offset-assert 32) + (level1-verts int32 :offset-assert 36) + (dma-cnt int32 :offset-assert 40) + (dma-dta int32 :offset-assert 44) + (dma-tex int32 :offset-assert 48) + (strips int32 :offset-assert 52) + (drawpoints int32 :offset-assert 56) + (vif int32 :offset-assert 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype tfrag-packet (structure) + ((tag uint128 2 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype tfrag-work (structure) + ((base-tmpl dma-packet :inline :offset-assert 0) + (level-0-tmpl dma-packet :inline :offset-assert 16) + (common-tmpl dma-packet :inline :offset-assert 32) + (level-1-tmpl dma-packet :inline :offset-assert 48) + (color-tmpl dma-packet :inline :offset-assert 64) + (frag-dists vector :inline :offset-assert 80) + (min-dist vector :inline :offset-assert 96) + (color-ptr vector4w :inline :offset-assert 112) + (tr-stat-tfrag tr-stat :offset-assert 128) + (tr-stat-tfrag-scissor tr-stat :offset-assert 132) + (vu1-enable-tfrag int32 :offset-assert 136) + (vu1-enable-tfrag-scissor int32 :offset-assert 140) + (cur-vis-bits uint32 :offset-assert 144) + (end-vis-bits uint32 :offset-assert 148) + (src-ptr uint32 :offset-assert 152) + (last-call uint32 :offset-assert 156) + (dma-buffer basic :offset-assert 160) + (test-id uint32 :offset-assert 164) + (wait-from-spr uint32 :offset-assert 168) + (wait-to-spr uint32 :offset-assert 172) + (near-wait-from-spr uint32 :offset-assert 176) + (near-wait-to-spr uint32 :offset-assert 180) + (max-fragment uint16 :offset-assert 184) + (min-fragment uint16 :offset-assert 186) + (texture-dists uint32 :offset-assert 188) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +(deftype tfrag-dma (structure) + ((banka tfragment 16 :inline :offset-assert 0) + (bankb tfragment 16 :inline :offset-assert 1024) + (outa uint128 128 :offset-assert 2048) + (outb uint128 128 :offset-assert 4096) + (colors rgba 2047 :offset-assert 6144) + ) + :method-count-assert 9 + :size-assert #x37fc + :flag-assert #x9000037fc + ) diff --git a/goal_src/jak2/engine/gfx/tie/generic-tie-h.gc b/goal_src/jak2/engine/gfx/tie/generic-tie-h.gc index e629feff2f..1e19ee3c08 100644 --- a/goal_src/jak2/engine/gfx/tie/generic-tie-h.gc +++ b/goal_src/jak2/engine/gfx/tie/generic-tie-h.gc @@ -7,3 +7,227 @@ ;; DECOMP BEGINS +(deftype generic-tie-instance (structure) + ((matrix-tag dma-packet :inline :offset-assert 0) + (matrix-data vector 6 :inline :offset-assert 16) + (index-tag dma-packet :inline :offset-assert 112) + (indices uint8 224 :offset-assert 128) + (end-tag dma-packet :inline :offset-assert 352) + ) + :method-count-assert 9 + :size-assert #x170 + :flag-assert #x900000170 + ) + +(deftype generic-tie-input (structure) + ((palette-tag dma-packet :inline :offset-assert 0) + (palette rgba 128 :offset-assert 16) + (model-tag dma-packet :inline :offset-assert 528) + (model vector 146 :inline :offset-assert 544) + (matrix-tag dma-packet :inline :offset-assert 2880) + (matrix-data vector 6 :inline :offset-assert 2896) + (index-tag dma-packet :inline :offset-assert 2992) + (indices uint8 224 :offset-assert 3008) + (end-tag dma-packet :inline :offset-assert 3232) + ) + :method-count-assert 9 + :size-assert #xcb0 + :flag-assert #x900000cb0 + ) + +(deftype generic-tie-run-control (structure) + ((skip-bp2 uint8 :offset-assert 0) + (skip-ips uint8 :offset-assert 1) + (gifbuf-skip uint8 :offset-assert 2) + (strips uint8 :offset-assert 3) + (target-bp1 uint8 :offset-assert 4) + (target-bp2 uint8 :offset-assert 5) + (target-ip1 uint8 :offset-assert 6) + (target-ip2 uint8 :offset-assert 7) + (target-bps uint8 :offset-assert 8) + (target-ips uint8 :offset-assert 9) + (is-generic uint8 :offset-assert 10) + (reserved uint8 :offset-assert 11) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype generic-tie-base-point (structure) + ((data uint16 8 :offset-assert 0) + (quad uint128 :offset 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (d0 int16 :offset 6) + (vtx uint64 :offset 0) + (u int16 :offset 8) + (v int16 :offset 10) + (tex uint32 :offset 8) + (w int16 :offset 12) + (d1 int16 :offset 14) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype generic-tie-bps (structure) + ((bp generic-tie-base-point 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype generic-tie-interp-point (structure) + ((data uint16 12 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (d0 int16 :offset 6) + (vtx0 uint64 :offset 0) + (dx int16 :offset 8) + (dy int16 :offset 10) + (dz int16 :offset 12) + (unused int16 :offset 14) + (vtx1 uint64 :offset 8) + (u int16 :offset 16) + (v int16 :offset 18) + (tex uint32 :offset 16) + (w int16 :offset 20) + (d1 int16 :offset 22) + ) + :pack-me + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(deftype generic-tie-ips (structure) + ((ip generic-tie-interp-point 2 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype generic-tie-header (structure) + ((effect uint8 :offset-assert 0) + (interp-table-size uint8 :offset-assert 1) + (num-bps uint8 :offset-assert 2) + (num-ips uint8 :offset-assert 3) + (tint-color uint32 :offset-assert 4) + (index-table-offset uint16 :offset-assert 8) + (kick-table-offset uint16 :offset-assert 10) + (normal-table-offset uint16 :offset-assert 12) + (interp-table-offset uint16 :offset-assert 14) + (gsf-header gsf-header :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype generic-tie-matrix (structure) + ((matrix matrix :inline :offset-assert 0) + (morph vector :inline :offset-assert 64) + (fog qword :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +(deftype generic-tie-normal (structure) + ((x int8 :offset-assert 0) + (y int8 :offset-assert 1) + (z int8 :offset-assert 2) + (dummy int8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype generic-tie-control (structure) + ((ptr-palette uint32 :offset-assert 0) + (ptr-shaders uint32 :offset-assert 4) + (ptr-runctrl generic-tie-run-control :offset-assert 8) + (ptr-verts uint32 :offset-assert 12) + (ptr-generic generic-tie-header :offset-assert 16) + (ptr-dps uint32 :offset-assert 20) + (ptr-kicks uint32 :offset-assert 24) + (ptr-normals uint32 :offset-assert 28) + (ptr-interp uint32 :offset-assert 32) + (ptr-mtxs generic-tie-matrix :offset-assert 36) + (ptr-cinds uint32 :offset-assert 40) + (next-instance uint32 :offset-assert 44) + (next-model uint32 :offset-assert 48) + (next-is-model uint32 :offset-assert 52) + (tie-type uint32 :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + +(deftype generic-tie-stats (structure) + ((num-bps uint32 :offset-assert 0) + (num-ips uint32 :offset-assert 4) + (num-dps uint32 :offset-assert 8) + (num-shaders uint32 :offset-assert 12) + (num-models uint32 :offset-assert 16) + (num-instances uint32 :offset-assert 20) + (num-waits uint32 :offset-assert 24) + (num-qwc uint32 :offset-assert 28) + (max-qwc uint32 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(deftype generic-tie-calls (structure) + ((generic-prepare-dma-double basic :offset-assert 0) + (generic-envmap-dproc basic :offset-assert 4) + (generic-interp-dproc basic :offset-assert 8) + (generic-no-light-dproc basic :offset-assert 12) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype generic-tie-shadow (structure) + ((out-buf gsf-buffer :offset-assert 0) + (cur-buf uint32 :offset-assert 4) + (tie-type int32 :offset-assert 8) + (ptr-inst uint32 :offset-assert 12) + (ptr-buf uint32 :offset-assert 16) + (inst-xor int32 :offset-assert 20) + (end-of-chain uint32 :offset-assert 24) + (write-limit uint32 :offset-assert 28) + (calls generic-tie-calls :inline :offset-assert 32) + ) + :pack-me + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype generic-tie-work (structure) + ((control generic-tie-control :inline :offset-assert 0) + (interp-job generic-interp-job :inline :offset-assert 60) + (shadow generic-tie-shadow :inline :offset-assert 76) + (input-a generic-tie-input :inline :offset-assert 128) + (input-b generic-tie-input :inline :offset-assert 3376) + (inst-buf generic-tie-instance :inline :offset-assert 6624) + (palette-buf rgba 128 :offset-assert 6992) + ) + :method-count-assert 9 + :size-assert #x1d50 + :flag-assert #x900001d50 + ) diff --git a/goal_src/jak2/engine/gfx/tie/tie-h.gc b/goal_src/jak2/engine/gfx/tie/tie-h.gc index eaf2c8922e..3bbc7f8da6 100644 --- a/goal_src/jak2/engine/gfx/tie/tie-h.gc +++ b/goal_src/jak2/engine/gfx/tie/tie-h.gc @@ -7,3 +7,324 @@ ;; DECOMP BEGINS +(deftype tie-fragment-debug (structure) + ((num-tris uint16 :offset-assert 0) + (num-dverts uint16 :offset-assert 2) + (debug-lines (array vector-array) :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype tie-fragment (drawable) + ((gif-ref (inline-array adgif-shader) :offset 4) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) + (color-count uint16 :offset 38) + (dp-ref uint32 :offset 40) + (dp-qwc uint32 :offset 44) + (generic-ref uint32 :offset 48) + (generic-count uint16 :offset 52) + (normal-count uint16 :offset 54) + (normal-ref uint32 :offset 56) + (debug tie-fragment-debug :offset 60) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +(deftype instance-tie (instance) + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :offset 38) + (rmin-scale uint16 :offset 54) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +(deftype drawable-inline-array-instance-tie (drawable-inline-array) + ((data instance-tie 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 96) + ) + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ) + +(deftype drawable-tree-instance-tie (drawable-tree) + ((prototypes proxy-prototype-array-tie :offset 8) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +(deftype prototype-tie (drawable-inline-array) + ((data tie-fragment 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 96) + ) + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ) + +(deftype tie-matrix (structure) + ((mat matrix :inline :offset-assert 0) + (morph qword :inline :offset-assert 64) + (fog qword :inline :offset-assert 80) + (envmap-flag uint32 :offset 80) + (guard-flag uint32 :offset 84) + (vertex-alpha float :offset 88) + (fog-value float :offset 92) + (fixed-alpha float :offset 68) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +(deftype instance-tie-work (structure) + ((wind-const vector :inline :offset-assert 0) + (hmge-d vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (wind-force vector :inline :offset-assert 48) + (constant vector :inline :offset-assert 64) + (far-morph vector :inline :offset-assert 80) + (dist-test vector :inline :offset-assert 96) + (min-dist vector :inline :offset-assert 112) + (guard-plane plane 4 :inline :offset-assert 128) + (upload-color-0 dma-packet :inline :offset-assert 192) + (upload-color-1 dma-packet :inline :offset-assert 208) + (upload-color-2 dma-packet :inline :offset-assert 224) + (upload-color-ret dma-packet :inline :offset-assert 240) + (upload-color-temp dma-packet :inline :offset-assert 256) + (generic-color-0 dma-packet :inline :offset-assert 272) + (generic-color-1 dma-packet :inline :offset-assert 288) + (generic-color-end dma-packet :inline :offset-assert 304) + (envmap-color-0 dma-packet :inline :offset-assert 320) + (envmap-color-1 dma-packet :inline :offset-assert 336) + (tie-scissor-perspective-matrix matrix :inline :offset-assert 352) + (tod-env-color vector :inline :offset-assert 416) + (morph-temp vector :inline :offset-assert 432) + (fog-temp vector :inline :offset-assert 448) + (fade-temp float :offset-assert 464) + (wind-vectors uint32 :offset-assert 468) + (test-id uint32 :offset-assert 472) + (test-id2 uint32 :offset-assert 476) + (dma-buffer basic :offset-assert 480) + (to-spr uint32 :offset-assert 484) + (from-spr uint32 :offset-assert 488) + (wind-work uint32 :offset-assert 492) + (cur-vis-bits uint32 :offset-assert 496) + (end-vis-bits uint32 :offset-assert 500) + (refl-fade-fac float :offset-assert 504) + (refl-fade-end float :offset-assert 508) + (flags uint32 :offset-assert 512) + (vanish-flag uint32 :offset-assert 516) + (translucent-flag uint32 :offset-assert 520) + (wait-from-spr uint32 :offset-assert 524) + (wait-to-spr uint32 :offset-assert 528) + (use-etie basic :offset-assert 532) + (buffer-start uint32 :offset-assert 536) + (buffer-end uint32 :offset-assert 540) + (tfrag-dists uint32 :offset-assert 544) + (alpha-dists uint32 :offset-assert 548) + (water-dists uint32 :offset-assert 552) + ) + :method-count-assert 9 + :size-assert #x22c + :flag-assert #x90000022c + ) + +(deftype instance-tie-dma (structure) + ((banka instance-tie 32 :inline :offset-assert 0) + (bankb instance-tie 32 :inline :offset-assert 2048) + (outa uint128 256 :offset-assert 4096) + (outb uint128 256 :offset-assert 8192) + (work instance-tie-work :dynamic :offset-assert 12288) + ) + :method-count-assert 9 + :size-assert #x3000 + :flag-assert #x900003000 + ) + +(deftype prototype-tie-work (structure) + ((upload-flushe dma-packet :inline :offset-assert 0) + (upload-palette dma-packet :inline :offset-assert 16) + (upload-model-0 dma-packet :inline :offset-assert 32) + (upload-model-1 dma-packet :inline :offset-assert 48) + (upload-model-2 dma-packet :inline :offset-assert 64) + (upload-model-3 dma-packet :inline :offset-assert 80) + (upload-model-near-0 dma-packet :inline :offset-assert 96) + (upload-model-near-1 dma-packet :inline :offset-assert 112) + (upload-model-near-2 dma-packet :inline :offset-assert 128) + (upload-model-near-3 dma-packet :inline :offset-assert 144) + (upload-model-near-4 dma-packet :inline :offset-assert 160) + (envmap-palette dma-packet :inline :offset-assert 176) + (envmap-shader dma-packet :inline :offset-assert 192) + (upload-envmap-0 dma-packet :inline :offset-assert 208) + (upload-envmap-1 dma-packet :inline :offset-assert 224) + (upload-envmap-2 dma-packet :inline :offset-assert 240) + (upload-envmap-3 dma-packet :inline :offset-assert 256) + (upload-envmap-4 dma-packet :inline :offset-assert 272) + (upload-envmap-scissor-4 dma-packet :inline :offset-assert 288) + (generic-palette dma-packet :inline :offset-assert 304) + (generic-model-0 dma-packet :inline :offset-assert 320) + (generic-model-1 dma-packet :inline :offset-assert 336) + (generic-model-2 dma-packet :inline :offset-assert 352) + (model-next dma-packet :inline :offset-assert 368) + (clamp uint64 :offset-assert 384) + (prototype-array basic :offset-assert 392) + (wait-from-spr uint32 :offset-assert 396) + (wait-to-spr uint32 :offset-assert 400) + (mood mood-context :offset-assert 404) + (last uint32 16 :offset 416) + (next uint32 16 :offset-assert 480) + (count uint16 16 :offset-assert 544) + (tie-last uint32 :offset 416) + (tie-next uint32 :offset 480) + (tie-count uint16 :offset 544) + (trans-last uint32 :offset 420) + (trans-next uint32 :offset 484) + (trans-count uint16 :offset 546) + (water-last uint32 :offset 424) + (water-next uint32 :offset 488) + (water-count uint16 :offset 548) + (scissor-last uint32 :offset 428) + (scissor-next uint32 :offset 492) + (scissor-count uint16 :offset 550) + (scissor-trans-last uint32 :offset 432) + (scissor-trans-next uint32 :offset 496) + (scissor-trans-count uint16 :offset 552) + (scissor-water-last uint32 :offset 436) + (scissor-water-next uint32 :offset 500) + (scissor-water-count uint16 :offset 554) + (envmap-last uint32 :offset 440) + (envmap-next uint32 :offset 504) + (envmap-count uint16 :offset 556) + (envmap-trans-last uint32 :offset 444) + (envmap-trans-next uint32 :offset 508) + (envmap-trans-count uint16 :offset 558) + (envmap-water-last uint32 :offset 448) + (envmap-water-next uint32 :offset 512) + (envmap-water-count uint16 :offset 560) + (envmap-scissor-last uint32 :offset 452) + (envmap-scissor-next uint32 :offset 516) + (envmap-scissor-count uint16 :offset 562) + (envmap-scissor-trans-last uint32 :offset 456) + (envmap-scissor-trans-next uint32 :offset 520) + (envmap-scissor-trans-count uint16 :offset 564) + (envmap-scissor-water-last uint32 :offset 460) + (envmap-scissor-water-next uint32 :offset 524) + (envmap-scissor-water-count uint16 :offset 566) + (generic-last uint32 :offset 464) + (generic-next uint32 :offset 528) + (generic-count uint16 :offset 568) + (generic-trans-last uint32 :offset 468) + (generic-trans-next uint32 :offset 532) + (generic-trans-count uint16 :offset 570) + (generic-water-last uint32 :offset 472) + (generic-water-next uint32 :offset 536) + (generic-water-count uint16 :offset 572) + (vanish-last uint32 :offset 476) + (vanish-next uint32 :offset 540) + (vanish-count uint16 :offset 574) + ) + :method-count-assert 9 + :size-assert #x240 + :flag-assert #x900000240 + ) + +(deftype prototype-tie-dma (structure) + ((colora rgba 256 :offset-assert 0) + (colorb rgba 256 :offset-assert 1024) + (outa uint128 256 :offset-assert 2048) + (outb uint128 256 :offset-assert 6144) + (geometry uint32 4 :offset-assert 10240) + (next uint32 12 :offset 10256) + (count uint16 12 :offset 10304) + (counts uint32 4 :offset 10328) + (palette-ptr uint32 :offset 10336) + (model-ptr uint32 :offset 10340) + (ret-ptr uint32 :offset 10344) + (length uint32 :offset 10348) + (flags uint32 :offset 10352) + (dma-buffer basic :offset 10356) + (this-frag-count uint32 :offset 10360) + (frag-count uint8 4 :offset 10364) + (from-spr uint32 :offset 10368) + (to-spr uint32 :offset 10372) + (spr-out uint32 :offset 10376) + (this-count uint32 :offset 10380) + (scissor-geometry uint32 :offset 10240) + (near-geometry uint32 :offset 10244) + (mid-geometry uint32 :offset 10248) + (far-geometry uint32 :offset 10252) + (scissor-frag-count uint8 :offset 10364) + (near-frag-count uint8 :offset 10365) + (mid-frag-count uint8 :offset 10366) + (far-frag-count uint8 :offset 10367) + (tie-scissor-next uint32 :offset 10256) + (tie-near-next uint32 :offset 10260) + (tie-mid-next uint32 :offset 10264) + (tie-far-next uint32 :offset 10268) + (trans-scissor-next uint32 4 :offset 10256) + (trans-near-next uint32 :offset 10260) + (trans-mid-next uint32 :offset 10264) + (trans-far-next uint32 :offset 10268) + (water-scissor-next uint32 4 :offset 10256) + (water-near-next uint32 :offset 10260) + (water-mid-next uint32 :offset 10264) + (water-far-next uint32 :offset 10268) + (envmap-scissor-next uint32 4 :offset 10272) + (envmap-near-next uint32 :offset 10276) + (envmap-mid-next uint32 :offset 10280) + (envmap-far-next uint32 :offset 10284) + (generic-near-next uint32 :offset 10288) + (generic-mid-next uint32 :offset 10292) + (generic-far-next uint32 :offset 10296) + (vanish-next uint32 :offset 10300) + (tie-count uint16 :offset 10304) + (tie-scissor-count uint16 :offset 10304) + (tie-near-count uint16 :offset 10306) + (tie-mid-count uint16 :offset 10308) + (tie-far-count uint16 :offset 10310) + (trans-count uint16 :offset 10304) + (trans-scissor-count uint16 :offset 10304) + (trans-near-count uint16 :offset 10306) + (trans-mid-count uint16 :offset 10308) + (trans-far-count uint16 :offset 10310) + (water-count uint16 :offset 10304) + (water-scissor-count uint16 :offset 10304) + (water-near-count uint16 :offset 10306) + (water-mid-count uint16 :offset 10308) + (water-far-count uint16 :offset 10310) + (envmap-count uint16 :offset 10312) + (envmap-scissor-count uint16 :offset 10312) + (envmap-near-count uint16 :offset 10314) + (envmap-mid-count uint16 :offset 10316) + (envmap-far-count uint16 :offset 10318) + (generic-count uint16 :offset 10320) + (generic-near-count uint16 :offset 10320) + (generic-mid-count uint16 :offset 10322) + (generic-far-count uint16 :offset 10324) + (vanish-count uint16 :offset 10326) + (next-clear uint32 3 :offset 10256) + (count-clear uint16 3 :offset 10304) + ) + :method-count-assert 9 + :size-assert #x2890 + :flag-assert #x900002890 + ) + + +(define *instance-tie-work-copy* (the-as instance-tie-work #f)) + diff --git a/goal_src/jak2/engine/gfx/vu1-user-h.gc b/goal_src/jak2/engine/gfx/vu1-user-h.gc index 3e0f7828fb..686a6c8d43 100644 --- a/goal_src/jak2/engine/gfx/vu1-user-h.gc +++ b/goal_src/jak2/engine/gfx/vu1-user-h.gc @@ -5,5 +5,464 @@ ;; name in dgo: vu1-user-h ;; dgos: ENGINE, GAME +;; The DMA buckets +(defenum bucket-id + :type int32 + :bitfield #f + (bucket-0 0) + (bucket-1 1) + (bucket-2 2) + (bucket-3 3) ;; blit displays + (bucket-4 4) ;; tex + (bucket-5 5) ;; sky + (bucket-6 6) ;; ocean + + (bucket-7 7) ;; level 0 tex + (bucket-8 8) ;; tfrag + (bucket-9 9) ;; tie + (bucket-10 10) ;; tie + (bucket-11 11) ;; tfrag + (bucket-12 12) ;; tie + (bucket-13 13) ;; tie + (bucket-14 14) ;; merc + (bucket-15 15) ;; emerc + (bucket-16 16) ;; mercneric + (bucket-17 17) ;; tie + + (bucket-18 18) ;; tex + (bucket-19 19) ;; tfrag + (bucket-20 20) ;; tie + (bucket-21 21) ;; tie + (bucket-22 22) ;; tfrag + (bucket-23 23) ;; tie + (bucket-24 24) ;; tie + (bucket-25 25) ;; merc + (bucket-26 26) ;; emerc + (bucket-27 27) ;; mercneric + (bucket-28 28) ;; tie + + (bucket-29 29) ;; tex + (bucket-30 30) ;; tfrag + (bucket-31 31) ;; tie + (bucket-32 32) ;; tie + (bucket-33 33) ;; tfrag + (bucket-34 34) ;; tie + (bucket-35 35) ;; tie + (bucket-36 36) ;; merc + (bucket-37 37) ;; emerc + (bucket-38 38) ;; mercneric + (bucket-39 39) ;; tie + + (bucket-40 40) ;; tex + (bucket-41 41) ;; tfrag + (bucket-42 42) ;; tie + (bucket-43 43) ;; tie + (bucket-44 44) ;; tfrag + (bucket-45 45) ;; tie + (bucket-46 46) ;; tie + (bucket-47 47) ;; merc + (bucket-48 48) ;; emerc + (bucket-49 49) ;; mercneric + (bucket-50 50) ;; tie + + (bucket-51 51) ;; tex + (bucket-52 52) ;; tfrag + (bucket-53 53) ;; tie + (bucket-54 54) ;; tie + (bucket-55 55) ;; tfrag + (bucket-56 56) ;; tie + (bucket-57 57) ;; tie + (bucket-58 58) ;; merc + (bucket-59 59) ;; emerc + (bucket-60 60) ;; mercneric + (bucket-61 61) ;; tie + + (bucket-62 62) ;; tex + (bucket-63 63) ;; tfrag + (bucket-64 64) ;; tie + (bucket-65 65) ;; tie + (bucket-66 66) ;; tfrag + (bucket-67 67) ;; tie + (bucket-68 68) ;; tie + (bucket-69 69) ;; merc + (bucket-70 70) ;; emerc + (bucket-71 71) ;; mercneric + (bucket-72 72) ;; tie + + (bucket-73 73) ;; tex + (bucket-74 74) ;; shrub + (bucket-75 75) ;; shrub + (bucket-76 76) ;; shrub + (bucket-77 77) ;; shrub + (bucket-78 78) ;; shrub + (bucket-79 79) ;; merc + (bucket-80 80) ;; emerc + (bucket-81 81) ;; mercneric + + (bucket-82 82) ;; tex + (bucket-83 83) ;; shrub + (bucket-84 84) ;; shrub + (bucket-85 85) ;; shrub + (bucket-86 86) ;; shrub + (bucket-87 87) ;; shrub + (bucket-88 88) ;; merc + (bucket-89 89) ;; emerc + (bucket-90 90) ;; mercneric + + (bucket-91 91) ;; tex + (bucket-92 92) ;; shrub + (bucket-93 93) ;; shrub + (bucket-94 94) ;; shrub + (bucket-95 95) ;; shrub + (bucket-96 96) ;; shrub + (bucket-97 97) ;; merc + (bucket-98 98) ;; emerc + (bucket-99 99) ;; mercneric + + (bucket-100 100) ;; tex + (bucket-101 101) ;; shrub + (bucket-102 102) ;; shrub + (bucket-103 103) ;; shrub + (bucket-104 104) ;; shrub + (bucket-105 105) ;; shrub + (bucket-106 106) ;; merc + (bucket-107 107) ;; emerc + (bucket-108 108) ;; mercneric + + (bucket-109 109) ;; tex + (bucket-110 110) ;; shrub + (bucket-111 111) ;; shrub + (bucket-112 112) ;; shrub + (bucket-113 113) ;; shrub + (bucket-114 114) ;; shrub + (bucket-115 115) ;; merc + (bucket-116 116) ;; emerc + (bucket-117 117) ;; mercneric + + (bucket-118 118) ;; tex + (bucket-119 119) ;; shrub + (bucket-120 120) ;; shrub + (bucket-121 121) ;; shrub + (bucket-122 122) ;; shrub + (bucket-123 123) ;; shrub + (bucket-124 124) ;; merc + (bucket-125 125) ;; emerc + (bucket-126 126) ;; mercneric + + (bucket-127 127) ;; tex + (bucket-128 128) ;; tfrag + (bucket-129 129) ;; tie + (bucket-130 130) ;; tie + (bucket-131 131) ;; merc + (bucket-132 132) ;; emerc + (bucket-133 133) ;; mercneric + (bucket-134 134) ;; tfrag + (bucket-135 135) ;; tie + (bucket-136 136) ;; tie + + (bucket-137 137) ;; tex + (bucket-138 138) ;; tfrag + (bucket-139 139) ;; tie + (bucket-140 140) ;; tie + (bucket-141 141) ;; merc + (bucket-142 142) ;; emerc + (bucket-143 143) ;; mercneric + (bucket-144 144) ;; tfrag + (bucket-145 145) ;; tie + (bucket-146 146) ;; tie + + (bucket-147 147) ;; tex + (bucket-148 148) ;; tfrag + (bucket-149 149) ;; tie + (bucket-150 150) ;; tie + (bucket-151 151) ;; merc + (bucket-152 152) ;; emerc + (bucket-153 153) ;; mercneric + (bucket-154 154) ;; tfrag + (bucket-155 155) ;; tie + (bucket-156 156) ;; tie + + (bucket-157 157) ;; tex + (bucket-158 158) ;; tfrag + (bucket-159 159) ;; tie + (bucket-160 160) ;; tie + (bucket-161 161) ;; merc + (bucket-162 162) ;; emerc + (bucket-163 163) ;; mercneric + (bucket-164 164) ;; tfrag + (bucket-165 165) ;; tie + (bucket-166 166) ;; tie + + (bucket-167 167) ;; tex + (bucket-168 168) ;; tfrag + (bucket-169 169) ;; tie + (bucket-170 170) ;; tie + (bucket-171 171) ;; merc + (bucket-172 172) ;; emerc + (bucket-173 173) ;; mercneric + (bucket-174 174) ;; tfrag + (bucket-175 175) ;; tie + (bucket-176 176) ;; tie + + (bucket-177 177) ;; tex + (bucket-178 178) ;; tfrag + (bucket-179 179) ;; tie + (bucket-180 180) ;; tie + (bucket-181 181) ;; merc + (bucket-182 182) ;; emerc + (bucket-183 183) ;; mercneric + (bucket-184 184) ;; tfrag + (bucket-185 185) ;; tie + (bucket-186 186) ;; tie + + (bucket-187 187) ;; tex + (bucket-188 188) ;; merc + (bucket-189 189) ;; emerc + (bucket-190 190) ;; mercneric + (bucket-191 191) + (bucket-192 192) ;; merc + (bucket-193 193) ;; emerc + (bucket-194 194) ;; mercneric + + (bucket-195 195) ;; shadow + + (bucket-196 196) ;; tex + (bucket-197 197) ;; merc + (bucket-198 198) ;; emerc + (bucket-199 199) ;; mercneric + + (bucket-200 200) ;; tex + (bucket-201 201) ;; merc + (bucket-202 202) ;; emerc + (bucket-203 203) ;; mercneric + + (bucket-204 204) ;; tex + (bucket-205 205) ;; merc + (bucket-206 206) ;; emerc + (bucket-207 207) ;; mercneric + + (bucket-208 208) ;; tex + (bucket-209 209) ;; merc + (bucket-210 210) ;; emerc + (bucket-211 211) ;; mercneric + + (bucket-212 212) ;; tex + (bucket-213 213) ;; merc + (bucket-214 214) ;; emerc + (bucket-215 215) ;; mercneric + + (bucket-216 216) ;; tex + (bucket-217 217) ;; merc + (bucket-218 218) ;; emerc + (bucket-219 219) ;; mercneric + + (bucket-220 220) ;; tex + (bucket-221 221) ;; merc + (bucket-222 222) ;; emerc + (bucket-223 223) ;; mercneric + (bucket-224 224) + (bucket-225 225) ;; merc + (bucket-226 226) ;; emerc + (bucket-227 227) ;; mercneric + (bucket-228 228) + (bucket-229 229) ;; merc + (bucket-230 230) ;; emerc + (bucket-231 231) ;; mercneric + (bucket-232 232) + (bucket-233 233) ;; merc + (bucket-234 234) ;; emerc + (bucket-235 235) ;; mercneric + (bucket-236 236) + (bucket-237 237) ;; merc + (bucket-238 238) ;; emerc + (bucket-239 239) ;; mercneric + (bucket-240 240) + (bucket-241 241) ;; merc + (bucket-242 242) ;; emerc + (bucket-243 243) ;; mercneric + (bucket-244 244) + (bucket-245 245) ;; merc + (bucket-246 246) ;; emerc + (bucket-247 247) ;; mercneric + (bucket-248 248) + (bucket-249 249) ;; merc + (bucket-250 250) ;; emerc + (bucket-251 251) ;; mercneric + (bucket-252 252) ;; tex + (bucket-253 253) ;; merc + (bucket-254 254) ;; mercneric + (bucket-255 255) ;; tfrag + (bucket-256 256) + (bucket-257 257) + (bucket-258 258) + (bucket-259 259) ;; tfrag + (bucket-260 260) + (bucket-261 261) ;; tex + (bucket-262 262) ;; merc + (bucket-263 263) ;; mercneric + (bucket-264 264) ;; tfrag + (bucket-265 265) + (bucket-266 266) + (bucket-267 267) + (bucket-268 268) ;; tfrag + (bucket-269 269) + (bucket-270 270) ;; tex + (bucket-271 271) ;; merc + (bucket-272 272) ;; mercneric + (bucket-273 273) ;; tfrag + (bucket-274 274) + (bucket-275 275) + (bucket-276 276) + (bucket-277 277) ;; tfrag + (bucket-278 278) + (bucket-279 279) ;; tex + (bucket-280 280) ;; merc + (bucket-281 281) ;; mercneric + (bucket-282 282) ;; tfrag + (bucket-283 283) + (bucket-284 284) + (bucket-285 285) + (bucket-286 286) ;; tfrag + (bucket-287 287) + (bucket-288 288) ;; tex + (bucket-289 289) ;; merc + (bucket-290 290) ;; mercneric + (bucket-291 291) ;; tfrag + (bucket-292 292) + (bucket-293 293) + (bucket-294 294) + (bucket-295 295) ;; tfrag + (bucket-296 296) + (bucket-297 297) ;; tex + (bucket-298 298) ;; merc + (bucket-299 299) ;; mercneric + (bucket-300 300) ;; tfrag + (bucket-301 301) + (bucket-302 302) + (bucket-303 303) + (bucket-304 304) ;; tfrag + (bucket-305 305) + (bucket-306 306) ;; tex + (bucket-307 307) ;; merc + (bucket-308 308) ;; mercneric + (bucket-309 309) + + (bucket-310 310) ;; ocean + (bucket-311 311) ;; depth-cue + (bucket-312 312) + (bucket-313 313) ;; particles + (bucket-314 314) ;; shadow + (bucket-315 315) ;; effects + (bucket-316 316) ;; tex + (bucket-317 317) ;; mercneric + (bucket-318 318) ;; debug + (bucket-319 319) ;; tex + (bucket-320 320) ;; hud + (bucket-321 321) ;; hud letterbox + (bucket-322 322) ;; hud + (bucket-323 323) ;; hud + (bucket-324 324) ;; debug + (debug-no-zbuf 325) ;; debug + ;; (bucket-326 326) ;; debug + ) + +(defenum vu1-renderer-mask + :type uint64 + :bitfield #t + (rn0) + (rn1) + (rn2) + (rn3) + (rn4) + (rn5) + (rn6) + (rn7) + (rn8) + (rn9) + (rn10) + (rn11) + (rn12) + (rn13) + (rn14) + (rn15) + (rn16) + (rn17) + (rn18) + (rn19) + (rn20) + (rn21) + (rn22) + (rn23) + (rn24) + (rn25) + (rn26) + (rn27) + (rn28) + (rn29) + (rn30) + (rn31) + (rn32) + (rn33) + (rn34) + ) + +(defenum tpage-category + :type int8 + (tfrag 0) + (pris 1) + (shrub 2) + (alpha 3) + (water 4) + (warp 5) + (pris2 6) + (sprite 7) + (map 8) + (sky 9) + ) + ;; DECOMP BEGINS + +;; foreground renderers will output DMA data to one of these "sinks". +(deftype dma-foreground-sink (basic) + ;; which bucket to output to. determines draw order. + ((bucket bucket-id :offset-assert 4) + ;; what kind of textures will be uploaded at this time? + (foreground-texture-page tpage-category :offset-assert 8) + ;; which level do we belong to? + (foreground-texture-level int8 :offset-assert 9) + ;; if there are multiple buckets for the above categories, which bucket + ;; (for example, jak 1 had separate merc/gmerc buckets in some categories) + (foreground-output-bucket int8 :offset-assert 10) + ) + :method-count-assert 9 + :size-assert #xb + :flag-assert #x90000000b + ) + +;; the generic renderer is double buffered - while one fragment is uploading, another is rendering. +;; This double buffering even happens across models. So when preparing DMA for the next model, +;; the generic renderer must know the output (gifbuf) region of last fragment of the previous model, +;; and upload to the other buffer. +;; The generic renderer doesn't track this state internally, so we have some extra information +;; to add on to generic buckets. +(deftype generic-bucket-state (structure) + ((gifbuf-adr uint32 :offset-assert 0) + (inbuf-adr uint32 :offset-assert 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; as described above, the generic renderer needs a bit of extra state to double +;; buffer between models. +(deftype generic-dma-foreground-sink (dma-foreground-sink) + ((state generic-bucket-state :inline :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + diff --git a/goal_src/jak2/engine/level/bsp-h.gc b/goal_src/jak2/engine/level/bsp-h.gc index 3e44ead1d1..2eea355da1 100644 --- a/goal_src/jak2/engine/level/bsp-h.gc +++ b/goal_src/jak2/engine/level/bsp-h.gc @@ -5,5 +5,165 @@ ;; name in dgo: bsp-h ;; dgos: ENGINE, GAME +;; the bsp-node class seems broken - it has int16's that get used a pointers. + +(declare-type entity-camera entity) +(declare-type entity-race-mesh entity) +(declare-type entity-nav-mesh entity) +(declare-type actor-group basic) + ;; DECOMP BEGINS +(deftype bsp-node (structure) + ((front int16 :offset-assert 0) + (back int16 :offset-assert 2) + (front-box-min vector4b :inline :offset-assert 4) + (front-box-max vector4b :inline :offset-assert 8) + (back-box-min vector4b :inline :offset-assert 12) + (back-box-max vector4b :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(define-extern inspect-bsp-tree (function bsp-header bsp-node none)) +(define-extern map-bsp-tree (function (function bsp-node none) bsp-header bsp-node none)) + +(deftype bsp-header (drawable) + ((info file-info :offset 4) + (all-visible-list (pointer uint16) :offset-assert 32) + (visible-list-length int16 :offset-assert 36) + (drawable-trees drawable-tree-array :offset-assert 40) + (pat pointer :offset-assert 44) + (pat-length int32 :offset-assert 48) + (texture-ids (pointer texture-id) :offset 60) + (texture-page-count int32 :offset 64) + (name symbol :offset 72) + (nickname symbol :offset-assert 76) + (vis-info level-vis-info 8 :offset 80) + (actors drawable-inline-array-actor :offset-assert 112) + (cameras (array entity-camera) :offset-assert 116) + (nodes (inline-array bsp-node) :offset 120) + (level level :offset-assert 124) + (unk-data-2 uint16 9 :offset 130) + (unk-byte uint8 :offset 152) + (unk-data-4 float :offset 160) + (unk-data-5 float :offset-assert 164) + (race-meshes (array entity-race-mesh) :offset 168) + (light-hash light-hash :offset 176) + (nav-meshes (array entity-nav-mesh) :offset 180) + (actor-groups (array actor-group) :offset 184) + (collide-hash collide-hash :offset 196) + (region-tree drawable-tree-region-prim :offset 252) + (unk-data-8 uint32 55 :offset 180) + ) + :method-count-assert 19 + :size-assert #x190 + :flag-assert #x1300000190 + (:methods + (birth (_type_) none 17) + (deactivate-entities (_type_) none 18) + ) + ) + +;; unused +(deftype game-level (basic) + ((master-bsp basic :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(deftype view-frustum (structure) + ((hither-top-left vector :inline :offset-assert 0) + (hither-top-right vector :inline :offset-assert 16) + (hither-bottom-left vector :inline :offset-assert 32) + (hither-bottom-right vector :inline :offset-assert 48) + (yon-top-left vector :inline :offset-assert 64) + (yon-top-right vector :inline :offset-assert 80) + (yon-bottom-left vector :inline :offset-assert 96) + (yon-bottom-right vector :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +(defmethod inspect bsp-header ((obj bsp-header)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tall-visible-list: #x~X~%" (-> obj all-visible-list)) + (format #t "~Tvisible-list-length: ~D~%" (-> obj visible-list-length)) + (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) + (format #t "~Tpat: #x~X~%" (-> obj pat)) + (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) + (inspect-bsp-tree obj (-> obj nodes 0)) ;; this is probably broken.. + obj + ) + +(defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) + (cond + ((zero? arg1) + ) + (else + (format #t "_#x~X________________~%" arg1) + (inspect arg1) + (let ((s4-0 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (if (> (-> arg1 front) 0) + (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 front))) ;; also broken? + (format #t "_#x~X________________~%" arg1) + ) + (if (> (-> arg1 back) 0) + (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 back))) ;; also broken? + (format #t "_#x~X________________~%" arg1) + ) + (set! *print-column* s4-0) + ) + ) + ) + (none) + ) + +(defun map-bsp-tree ((arg0 (function bsp-node none)) (arg1 bsp-header) (arg2 bsp-node)) + (cond + ((zero? arg2) + ) + (else + (if (> (-> arg2 front) 0) + (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 front))) ;; also broken? + (arg0 arg2) + ) + (if (> (-> arg2 back) 0) + (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 back))) ;; also broken? + (arg0 arg2) + ) + ) + ) + (none) + ) + +;; more broken stuff: the stopwatches have wrong alignment? +;; just replaced with some arrays for now. I don't think this is +;; used anyway. +(deftype collide-stats (structure) + ((calls uint32 :offset-assert 0) + (spheres uint32 :offset-assert 4) + (nodes uint32 :offset-assert 8) + (frags uint32 :offset-assert 12) + (tris uint32 :offset-assert 16) + (output uint32 :offset-assert 20) + (pad0 uint32 2 :offset-assert 24) + (total-target uint32 8 :offset-assert 32) + (target-cache-fill uint32 8 :offset-assert 64) + (target-ray-poly uint32 6 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x78 + :flag-assert #x900000078 + ) + + + diff --git a/goal_src/jak2/engine/level/level-h.gc b/goal_src/jak2/engine/level/level-h.gc index 30d9525ff0..e965e36304 100644 --- a/goal_src/jak2/engine/level/level-h.gc +++ b/goal_src/jak2/engine/level/level-h.gc @@ -4,6 +4,658 @@ ;; name: level-h.gc ;; name in dgo: level-h ;; dgos: ENGINE, GAME +;; todo docs, methods + +(declare-type bsp-header basic) +(declare-type drawable basic) +(declare-type entity-links structure) +(declare-type level-group basic) +(declare-type entity-links-array inline-array-class) +(declare-type game-text-info basic) + +(define-extern *level* level-group) +(define-extern *draw-index* int) +(define-extern *level-index* int) + +(defenum load-buffer-mode + :type uint32 + (small-edge 0) + (small-center 1) + (medium 2) + (large 3) + (borrow 4) + (ten 10) + ) + +(defenum vis-info-flag + :type uint32 + :bitfield #t + (dummy0 0) + (dummy1 1) + (dummy2 2) + (dummy3 3) + (dummy4 4) + (dummy5 5) + (dummy6 6) + (dummy7 7) + (dummy8 8) + (dummy9 9) + (dummy10 10) + (dummy11 11) + (dummy12 12) + (dummy13 13) + (dummy14 14) + (dummy15 15) + (dummy16 16) + (dummy17 17) + (dummy18 18) + (dummy19 19) + (dummy20 20) + (dummy21 21) + (dummy22 22) + (dummy23 23) + (dummy24 24) + (dummy25 25) + (dummy26 26) + (dummy27 27) + (dummy28 28) + (in-iop 29) + (loading 30) + (vis-valid 31) + ) + +(defenum task-mask + :type uint32 + :bitfield #t + (task0 0) ;; 0x1 + (task1 1) ;; 0x2 + (task2 2) ;; 0x4 + (task3 3) ;; 0x8 + (task4 4) ;; 0x10 + (task5 5) ;; 0x20 + (task6 6) ;; 0x40 + (task7 7) ;; 0x80 + (done 8) ;; 0x100 + (dummy0 9) ;; 0x200 + (dummy1 10) ;; 0x400 + (dummy2 11) ;; 0x800 + (special 12) ;; 0x1000 + (primary0 13) ;; 0x2000 + (ctywide 14) ;; 0x4000 + (never 15) ;; 0x8000 + (movie0 16) ;; 0x10000 + (movie1 17) ;; 0x20000 + (movie2 18) ;; 0x40000 + ) ;; DECOMP BEGINS +(deftype level-vis-info (basic) + ((level level :offset-assert 4) + (from-level level :offset-assert 8) + (from-bsp bsp-header :offset-assert 12) + (flags vis-info-flag :offset-assert 16) + (length uint32 :offset-assert 20) + (allocated-length uint32 :offset-assert 24) + (dictionary-length uint32 :offset-assert 28) + (dictionary uint32 :offset-assert 32) + (string-block uint32 :offset-assert 36) + (ramdisk uint32 :offset-assert 40) + (vis-bits uint32 :offset-assert 44) + (current-vis-string uint32 :offset-assert 48) + (vis-string uint32 :dynamic :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +(defmethod asize-of level-vis-info ((obj level-vis-info)) + (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) + ) + +(deftype level-load-info (basic) + ((name-list symbol 6 :offset-assert 4) + (index int16 :offset-assert 28) + (task-level uint8 :offset-assert 30) + (name symbol :offset 4) + (visname symbol :offset 8) + (nickname symbol :offset 12) + (dbname symbol :offset 16) + (taskname symbol :offset 20) + (other-name-1 symbol :offset 24) + (packages pair :offset-assert 32) + (memory-mode uint32 :offset-assert 36) + (music-bank basic :offset-assert 40) + (ambient-sounds basic :offset-assert 44) + (sound-reverb float :offset-assert 48) + (mood-func symbol :offset-assert 52) + (mood-init symbol :offset-assert 56) + (ocean basic :offset-assert 60) + (sky basic :offset-assert 64) + (use-camera-other basic :offset-assert 68) + (part-engine-max int32 :offset-assert 72) + (city-map-bits uint64 :offset-assert 80) + (continues pair :offset-assert 88) + (tasks pair :offset-assert 92) + (priority int32 :offset-assert 96) + (load-commands pair :offset-assert 100) + (alt-load-commands pair :offset-assert 104) + (bsp-mask uint64 :offset-assert 112) + (buzzer int32 :offset-assert 120) + (buttom-height meters :offset-assert 124) + (run-packages pair :offset-assert 128) + (prev-level basic :offset-assert 132) + (next-level basic :offset-assert 136) + (wait-for-load symbol :offset-assert 140) + (login-func symbol :offset-assert 144) + (activate-func symbol :offset-assert 148) + (deactivate-func symbol :offset-assert 152) + (kill-func symbol :offset-assert 156) + (borrow-size uint16 2 :offset-assert 160) + (borrow-level symbol 2 :offset-assert 164) + (borrow-display? basic 2 :offset-assert 172) + (base-task-mask task-mask :offset-assert 180) + (texture-anim symbol 10 :offset-assert 184) + (texture-anim-tfrag symbol :offset 184) + (texture-anim-pris symbol :offset 188) + (texture-anim-shrub symbol :offset 192) + (texture-anim-alpha symbol :offset 196) + (texture-anim-water symbol :offset 200) + (texture-anim-twarp symbol :offset 204) + (texture-anim-pris2 symbol :offset 208) + (texture-anim-sprite symbol :offset 212) + (texture-anim-map symbol :offset 216) + (texture-anim-sky symbol :offset 220) + (draw-priority float :offset-assert 224) + (level-flags uint32 :offset-assert 228) + (fog-height float :offset-assert 232) + (bigmap-id uint32 :offset-assert 236) + (ocean-near-translucent? symbol :offset-assert 240) + (ocean-far? symbol :offset-assert 244) + (mood-range mood-range :inline :offset-assert 256) + (max-rain float :offset-assert 272) + (fog-mult float :offset-assert 276) + (ocean-alpha float :offset-assert 280) + (extra-sound-bank pair :offset-assert 284) + ) + :method-count-assert 9 + :size-assert #x120 + :flag-assert #x900000120 + ) + +(deftype login-state (basic) + ((state int32 :offset-assert 4) + (pos uint32 :offset-assert 8) + (elts uint32 :offset-assert 12) + (elt drawable 16 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype level (basic) + ((name symbol :offset-assert 4) + (load-name basic :offset-assert 8) + (nickname basic :offset-assert 12) + (index int32 :offset-assert 16) + (status symbol :offset-assert 20) + (borrow-level basic 2 :offset-assert 24) + (borrow-from-level basic :offset-assert 32) + (heap kheap :inline :offset-assert 48) + (borrow-heap kheap 2 :inline :offset-assert 64) + (bsp bsp-header :offset-assert 96) + (art-group load-dir-art-group :offset-assert 100) + (info level-load-info :offset-assert 104) + (texture-page texture-page 18 :offset-assert 108) + (loaded-texture-page texture-page 16 :offset-assert 180) + (loaded-texture-page-count int32 :offset-assert 244) + (entity entity-links-array :offset-assert 248) + (closest-object float :offset-assert 252) + (closest-object-array float 18 :offset 252) + (upload-size int32 18 :offset 324) + (inside-boxes symbol :offset-assert 396) + (display? symbol :offset-assert 400) + (render? symbol :offset-assert 404) + (meta-inside? symbol :offset-assert 408) + (force-inside? symbol :offset-assert 412) + (mood-context mood-context :inline :offset-assert 416) + (mood-func basic :offset-assert 2384) + (mood-init (function mood-context none) :offset-assert 2388) + (vis-bits pointer :offset-assert 2392) + (all-visible? symbol :offset-assert 2396) + (force-all-visible? symbol :offset-assert 2400) + (linking basic :offset-assert 2404) + (vis-info level-vis-info 8 :offset-assert 2408) + (vis-self-index int32 :offset-assert 2440) + (vis-adj-index int32 :offset-assert 2444) + (vis-buffer uint8 2048 :offset-assert 2448) + (mem-usage-block basic :offset-assert 4496) + (mem-usage int32 :offset-assert 4500) + (code-memory-start pointer :offset-assert 4504) + (code-memory-end pointer :offset-assert 4508) + (load-start-time time-frame :offset-assert 4512) + (load-stop-time time-frame :offset-assert 4520) + (load-buffer uint32 2 :offset-assert 4528) + (load-buffer-size uint32 :offset-assert 4536) + (load-buffer-last uint32 :offset-assert 4540) + (load-buffer-mode load-buffer-mode :offset-assert 4544) + (display-start-time time-frame :offset-assert 4552) + (memory-mask uint32 :offset-assert 4560) + (task-mask task-mask :offset-assert 4564) + (tfrag-gs-test uint64 :offset-assert 4568) + (texture-dirty-masks texture-mask 10 :inline :offset-assert 4576) + (texture-mask texture-mask 18 :inline :offset-assert 4736) + (sky-mask texture-mask :inline :offset-assert 5024) + (tfrag-masks basic :offset-assert 5040) + (tfrag-dists pointer :offset-assert 5044) + (shrub-masks basic :offset-assert 5048) + (shrub-dists pointer :offset-assert 5052) + (alpha-masks basic :offset-assert 5056) + (alpha-dists pointer :offset-assert 5060) + (water-masks basic :offset-assert 5064) + (water-dists pointer :offset-assert 5068) + (tfrag-last-calls int32 6 :offset-assert 5072) + (texture-anim-array texture-anim-array 10 :offset-assert 5096) + (light-hash basic :offset-assert 5136) + (draw-priority float :offset-assert 5140) + (draw-index int32 :offset-assert 5144) + (part-engine basic :offset-assert 5148) + (user-object basic 4 :offset-assert 5152) + (loaded-text-info-count int32 :offset-assert 5168) + (loaded-text-info game-text-info 8 :offset-assert 5172) + (level-type basic :offset-assert 5204) + (load-order int64 :offset-assert 5208) + (pad int8 12 :offset-assert 5216) + ) + :method-count-assert 30 + :size-assert #x146c + :flag-assert #x1e0000146c + (:methods + (deactivate (_type_) _type_ 9) + (level-method-10 () none 10) + (level-method-11 () none 11) + (unload! (_type_) _type_ 12) + (bsp-name (_type_) symbol 13) + (compute-memory-usage (_type_ object) memory-usage-block 14) + (point-in-boxes? (_type_ vector) symbol 15) + (level-method-16 () none 16) + (load-continue (_type_) _type_ 17) + (load-begin (_type_) _type_ 18) + (login-begin (_type_) _type_ 19) + (debug-print-region-splitbox (_type_ vector object) none 20) + (get-art-group-by-name (_type_ string) art-group 21) + (level-method-22 () none 22) + (level-method-23 () none 23) + (level-method-24 () none 24) + (birth (_type_) _type_ 25) + (level-status-update! (_type_ symbol) _type_ 26) + (load-required-packages (_type_) _type_ 27) + (init-vis-from-bsp (_type_) none 28) + (vis-clear (_type_) none 29) + ) + ) + +(defmethod inspect level ((obj level)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tload-name: ~A~%" (-> obj load-name)) + (format #t "~1Tnickname: ~A~%" (-> obj nickname)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tstatus: ~A~%" (-> obj status)) + (format #t "~1Tborrow-level[2] @ #x~X~%" (-> obj borrow-level)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Tborrow-level: ~A~%" s5-0 (-> obj borrow-level s5-0)) + ) + (format #t "~1Tborrow-from-level: ~A~%" (-> obj borrow-from-level)) + (format #t "~1Theap: #~%" (-> obj heap)) + (format #t "~1Tborrow-heap[2] @ #x~X~%" (-> obj borrow-heap)) + (format #t "~1Tbsp: ~A~%" (-> obj bsp)) + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tinfo: ~A~%" (-> obj info)) + (format #t "~1Ttexture-page[18] @ #x~X~%" (-> obj texture-page)) + (format #t "~1Tloaded-texture-page[16] @ #x~X~%" (-> obj loaded-texture-page)) + (format #t "~1Tloaded-texture-page-count: ~D~%" (-> obj loaded-texture-page-count)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tclosest-object: (meters ~m)~%" (&-> obj closest-object)) + (format #t "~1Tupload-size[18] @ #x~X~%" (-> obj upload-size)) + (format #t "~1Tinside-boxes?: ~A~%" (-> obj inside-boxes)) + (format #t "~1Tdisplay?: ~A~%" (-> obj display?)) + (format #t "~1Trender?: ~A~%" (-> obj render?)) + (format #t "~1Tmeta-inside?: ~A~%" (-> obj meta-inside?)) + (format #t "~1Tforce-inside?: ~A~%" (-> obj force-inside?)) + (format #t "~1Tmood-context: #~%" (-> obj mood-context)) + (format #t "~1Tmood-func: ~A~%" (-> obj mood-func)) + (format #t "~1Tmood-init: ~A~%" (-> obj mood-init)) + (format #t "~1Tvis-bits: #x~X~%" (-> obj vis-bits)) + (format #t "~1Tall-visible?: ~A~%" (-> obj all-visible?)) + (format #t "~1Tforce-all-visible?: ~A~%" (-> obj force-all-visible?)) + (format #t "~1Tlinking: ~A~%" (-> obj linking)) + (format #t "~1Tvis-info[8] @ #x~X~%" (-> obj vis-info)) + (format #t "~1Tvis-self-index: ~D~%" (-> obj vis-self-index)) + (format #t "~1Tvis-adj-index: ~D~%" (-> obj vis-adj-index)) + (format #t "~1Tvis-buffer[2048] @ #x~X~%" (-> obj vis-buffer)) + (format #t "~1Tmem-usage-block: ~A~%" (-> obj mem-usage-block)) + (format #t "~1Tmem-usage: ~D~%" (-> obj mem-usage)) + (format #t "~1Tcode-memory-start: #x~X~%" (-> obj code-memory-start)) + (format #t "~1Tcode-memory-end: #x~X~%" (-> obj code-memory-end)) + (format #t "~1Tload-start-time: ~D~%" (-> obj load-start-time)) + (format #t "~1Tload-stop-time: ~D~%" (-> obj load-stop-time)) + (format #t "~1Tload-buffer[2] @ #x~X~%" (-> obj load-buffer)) + (format #t "~1Tload-buffer-size: ~D~%" (-> obj load-buffer-size)) + (format #t "~1Tload-buffer-last: ~A~%" (-> obj load-buffer-last)) + (format #t "~1Tload-buffer-mode: ~D~%" (-> obj load-buffer-mode)) + (format #t "~1Tdisplay-start-time: ~D~%" (-> obj display-start-time)) + (format #t "~1Tmemory-mask: #b~B~%" (-> obj memory-mask)) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) + (let ((s5-1 (-> obj task-mask))) + (if (= (logand s5-1 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-1 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-1 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-1 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-1 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-1 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-1) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-1 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-1 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-1 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-1 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-1 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-1 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-1) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-1 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-1 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-1 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-1) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-1 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Ttfrag-gs-test: ~D~%" (-> obj tfrag-gs-test)) + (format #t "~1Ttexture-dirty-masks[10] @ #x~X~%" (-> obj texture-dirty-masks)) + (format #t "~1Ttexture-mask[18] @ #x~X~%" (-> obj texture-mask)) + (format #t "~1Tsky-mask: #~%" (-> obj sky-mask)) + (format #t "~1Ttfrag-masks: ~A~%" (-> obj tfrag-masks)) + (format #t "~1Ttfrag-dists: #x~X~%" (-> obj tfrag-dists)) + (format #t "~1Tshrub-masks: ~A~%" (-> obj shrub-masks)) + (format #t "~1Tshrub-dists: #x~X~%" (-> obj shrub-dists)) + (format #t "~1Talpha-masks: ~A~%" (-> obj alpha-masks)) + (format #t "~1Talpha-dists: #x~X~%" (-> obj alpha-dists)) + (format #t "~1Twater-masks: ~A~%" (-> obj water-masks)) + (format #t "~1Twater-dists: #x~X~%" (-> obj water-dists)) + (format #t "~1Ttfrag-last-calls[6] @ #x~X~%" (-> obj tfrag-last-calls)) + (format #t "~1Ttexture-anim-array[10] @ #x~X~%" (-> obj texture-anim-array)) + (format #t "~1Tlight-hash: ~A~%" (-> obj light-hash)) + (format #t "~1Tdraw-priority: ~f~%" (-> obj draw-priority)) + (format #t "~1Tdraw-index: ~D~%" (-> obj draw-index)) + (format #t "~1Tpart-engine: ~A~%" (-> obj part-engine)) + (format #t "~1Tuser-object[4] @ #x~X~%" (-> obj user-object)) + (dotimes (s5-2 4) + (format #t "~T [~D]~1Tuser-object: ~A~%" s5-2 (-> obj user-object s5-2)) + ) + (format #t "~1Tloaded-text-info-count: ~D~%" (-> obj loaded-text-info-count)) + (format #t "~1Tloaded-text-info[8] @ #x~X~%" (-> obj loaded-text-info)) + (format #t "~1Tlevel-type: ~A~%" (-> obj level-type)) + (format #t "~1Tload-order: ~D~%" (-> obj load-order)) + obj + ) + +(deftype level-group (basic) + ((length int32 :offset-assert 4) + (log-in-level-bsp bsp-header :offset-assert 8) + (loading-level level :offset-assert 12) + (entity-link entity-links :offset 16) + (border? symbol :offset-assert 20) + (vis? symbol :offset-assert 24) + (want-level basic :offset-assert 28) + (receiving-level basic :offset-assert 32) + (load-commands pair :offset-assert 36) + (play? symbol :offset-assert 40) + (target-pos vector 2 :inline :offset-assert 48) + (camera-pos vector 2 :inline :offset-assert 80) + (heap kheap :inline :offset-assert 112) + (sound-bank basic 4 :offset-assert 128) + (disk-load-timing? symbol :offset-assert 144) + (load-level basic :offset-assert 148) + (load-size uint32 :offset-assert 152) + (load-time float :offset-assert 156) + (load-login-time float :offset-assert 160) + (draw-level-count int32 :offset-assert 164) + (draw-level basic 7 :offset-assert 168) + (draw-index-map uint8 7 :offset-assert 196) + (load-order uint64 :offset-assert 208) + (pad uint8 30 :offset-assert 216) + (level level 7 :inline :offset-assert 256) + (level0 level :inline :offset 256) + (level1 level :inline :offset 5488) + (level2 level :inline :offset 10720) + (level3 level :inline :offset 15952) + (level4 level :inline :offset 21184) + (level5 level :inline :offset 26416) + (default-level level :inline :offset 31648) + (pad2 uint8 4 :offset-assert 36880) + ) + :method-count-assert 31 + :size-assert #x9014 + :flag-assert #x1f00009014 + (:methods + (level-get (_type_ symbol) level 9) + (level-get-with-status (_type_ symbol) level 10) + (get-level-by-heap-ptr-and-status (_type_ pointer uint) level 11) + (level-get-for-use (_type_ symbol symbol) level 12) + (activate-levels! (_type_) int 13) + (level-group-method-14 () none 14) + (level-group-method-15 () none 15) + (assign-draw-indices (_type_) none 16) + (level-group-method-17 () none 17) + (level-group-method-18 () none 18) + (level-update (_type_) none 19) + (level-get-target-inside (_type_) level 20) + (alloc-levels-if-needed (_type_ symbol) none 21) + (load-commands-set! (_type_ pair) pair 22) + (level-group-method-23 () none 23) + (load-command-get-index (_type_ symbol int) pair 24) + (level-group-method-25 () none 25) + (level-group-method-26 () none 26) + (level-group-method-27 () none 27) + (level-status (_type_ symbol) symbol 28) + (load-in-progress? (_type_) symbol 29) + (level-get-most-disposable (_type_) level 30) + ) + ) + +(defmethod inspect level-group ((obj level-group)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tentity-link: ~`entity-links`P~%" (-> obj entity-link)) + (format #t "~1Tborder?: ~A~%" (-> obj border?)) + (format #t "~1Tvis?: ~A~%" (-> obj vis?)) + (format #t "~1Twant-level: ~A~%" (-> obj want-level)) + (format #t "~1Treceiving-level: ~A~%" (-> obj receiving-level)) + (format #t "~1Tload-commands: ~A~%" (-> obj load-commands)) + (format #t "~1Tplay?: ~A~%" (-> obj play?)) + (format #t "~1Ttarget-pos[2] @ #x~X~%" (-> obj target-pos)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttarget-pos: ~`vector`P~%" s5-0 (-> obj target-pos s5-0)) + ) + (format #t "~1Tcamera-pos[2] @ #x~X~%" (-> obj camera-pos)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tcamera-pos: ~`vector`P~%" s5-1 (-> obj camera-pos s5-1)) + ) + (format #t "~1Theap: #~%" (-> obj heap)) + (format #t "~1Tsound-bank[4] @ #x~X~%" (-> obj sound-bank)) + (format #t "~1Tdisk-load-timing?: ~A~%" (-> obj disk-load-timing?)) + (format #t "~1Tload-level: ~A~%" (-> obj load-level)) + (format #t "~1Tload-size: ~D~%" (-> obj load-size)) + (format #t "~1Tload-time: ~f~%" (-> obj load-time)) + (format #t "~1Tload-login-time: ~f~%" (-> obj load-login-time)) + (format #t "~1Tdraw-level-count: ~D~%" (-> obj draw-level-count)) + (format #t "~1Tdraw-level[7] @ #x~X~%" (-> obj draw-level)) + (dotimes (s5-2 (-> obj draw-level-count)) + (format #t "~T [~D]~1Tdraw-level: ~`object`P~%" s5-2 (-> obj draw-level s5-2)) + ) + (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> obj draw-index-map)) + (format #t "~1Tload-order: ~D~%" (-> obj load-order)) + (format #t "~1Tlevel[7] @ #x~X~%" (-> obj level)) + (format #t "~1Tdata[7] @ #x~X~%" (-> obj level)) + (format #t "~1Tlevel0: ~`level`P~%" (-> obj level)) + (format #t "~1Tlevel1: ~`level`P~%" (-> obj level1)) + (format #t "~1Tlevel2: ~`level`P~%" (-> obj level2)) + (format #t "~1Tlevel3: ~`level`P~%" (-> obj level3)) + (format #t "~1Tlevel4: ~`level`P~%" (-> obj level4)) + (format #t "~1Tlevel5: ~`level`P~%" (-> obj level5)) + (format #t "~1Tlevel-default: ~`level`P~%" (-> obj default-level)) + obj + ) + +(when (zero? *level*) + (set! *level* + (new 'static 'level-group + :length 6 + :log-in-level-bsp #f + :loading-level #f + :entity-link #f + :border? #f + :vis? #f + :want-level #f + :load-commands '() + :play? #f + :sound-bank (new 'static 'array basic 4 #f #f #f #f) + :disk-load-timing? #f + :level (new 'static 'inline-array level 7 + (new 'static 'level + :name #f + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 1 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 2 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 3 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 4 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 5 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name 'default + :index 6 + :status 'reserved + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :bsp #f + :inside-boxes #f + :display? #f + :force-inside? #f + :linking #f + :level-type #f + ) + ) + ) + ) + (set! *draw-index* 0) + (set! *level-index* 0) + 0 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/goal_src/jak2/engine/level/region-h.gc b/goal_src/jak2/engine/level/region-h.gc index 11c50e984d..cbdba7f384 100644 --- a/goal_src/jak2/engine/level/region-h.gc +++ b/goal_src/jak2/engine/level/region-h.gc @@ -7,3 +7,129 @@ ;; DECOMP BEGINS +(deftype region (structure) + ((id uint32 :offset-assert 0) + (on-enter basic :offset-assert 4) + (on-inside basic :offset-assert 8) + (on-exit basic :offset-assert 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (region-method-9 () none 9) + ) + ) + +(deftype region-array (inline-array-class) + ((data region :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> region-array heap-base) (the-as uint 16)) + +(deftype drawable-region-prim (drawable) + ((region region :offset 8) + ) + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + (:methods + (drawable-region-prim-method-17 () none 17) + (drawable-region-prim-method-18 () none 18) + (drawable-region-prim-method-19 () none 19) + ) + ) + +(deftype drawable-tree-region-prim (drawable-tree) + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32) + ) + :method-count-assert 19 + :size-assert #x20 + :flag-assert #x1300000020 + (:methods + (drawable-tree-region-prim-method-17 () none 17) + (debug-print (_type_ vector object) none 18) + ) + ) + +(defmethod inspect drawable-tree-region-prim ((obj drawable-tree-region-prim)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + ) + (format #t "~1Tname: ~A~%" (-> obj name)) + obj + ) + + +(deftype drawable-inline-array-region-prim (drawable-inline-array) + ((data drawable-region-prim 1 :inline :offset-assert 32) + (pad uint8 4 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +(deftype drawable-region-sphere (drawable-region-prim) + () + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + ) + +(deftype region-face-data (structure) + ((normal vector :inline :offset-assert 0) + (normal-offset float :offset 12) + (num-points uint32 :offset-assert 16) + (points vector :inline :dynamic :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype drawable-region-face (drawable-region-prim) + ((data region-face-data :offset 12) + ) + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + ) + +(deftype region-face-array (inline-array-class) + ((data region-face-data :dynamic :offset 20) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) +(set! (-> region-face-array heap-base) (the-as uint 32)) + +(deftype drawable-region-volume (drawable-region-prim) + ((faces region-face-array :offset 12) + ) + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + ) + +(deftype region-prim-list (structure) + ((num-items int32 :offset-assert 0) + (items drawable-region-prim 320 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x504 + :flag-assert #x900000504 + ) diff --git a/goal_src/jak2/engine/load/decomp-h.gc b/goal_src/jak2/engine/load/decomp-h.gc index dffd114f30..c9d0de7dcd 100644 --- a/goal_src/jak2/engine/load/decomp-h.gc +++ b/goal_src/jak2/engine/load/decomp-h.gc @@ -7,3 +7,15 @@ ;; DECOMP BEGINS +;; temporary storage for visibility data decompression. +;; this is stored on the scratchpad. +(deftype decomp-work (structure) + ((buffer0 uint8 2048 :offset-assert 0) + (buffer1 uint8 2048 :offset-assert 2048) + (indices uint16 2048 :offset-assert 4096) + (temp-indices uint16 2048 :offset-assert 8192) + ) + :method-count-assert 9 + :size-assert #x3000 + :flag-assert #x900003000 + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/load/file-io.gc b/goal_src/jak2/engine/load/file-io.gc index d070869c36..a3b80b7494 100644 --- a/goal_src/jak2/engine/load/file-io.gc +++ b/goal_src/jak2/engine/load/file-io.gc @@ -5,5 +5,231 @@ ;; name in dgo: file-io ;; dgos: ENGINE, GAME +;; GOAL File I/O +;; This is mostly not used in the retail game and was more for loading stuff during development. +;; The file-stream is an inefficient way to load data, but is flexible and can load +;; from the CD, or over the network in development. +;; The file-info type is used in actual game data for checking versions. + +;; represents a file that can be read/written, similar to FILE* in C. +;; NOTE: this is a special type in three ways: +;; 1). It is used in the C runtime. This must be kept in sync with kmachine.h's FileStream +;; 2). This type is built-in to the compiler (see TypeSystem.cpp, add_builtin_types) +;; It must be kept up to date with that definition as well. +;; 3). The C runtime constructs this type before anything is loaded. The sizes +;; must be kept up to date there as well. + + ;; DECOMP BEGINS +(deftype file-stream (basic) + ((flags uint32 :offset-assert 4) + (mode symbol :offset-assert 8) + (name string :offset-assert 12) + (file uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + (:methods + (new (symbol type string symbol) _type_ 0) + ) + ) + +(defmethod new file-stream ((allocation symbol) (type-to-make type) (arg0 string) (arg1 symbol)) + "Allocate a file-stream and open it." + (let ((a0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (file-stream-open a0-1 arg0 arg1) + ) + ) + +;; we already have a length method for a file-stream defined in C. +;; just store that in the method table. +(set! (-> file-stream method-table 4) file-stream-length) + +(defun file-stream-read-string ((arg0 file-stream) (arg1 string)) + "Fill a string with data from a file stream. + Note: this function does not work." + (clear arg1) + (file-stream-read arg0 (-> arg1 data) (length arg0)) + arg1 + ) + +(deftype file-info (basic) + ((file-type (pointer string) :offset-assert 4) + (file-name basic :offset-assert 8) + (major-version uint32 :offset-assert 12) + (minor-version uint32 :offset-assert 16) + (maya-file-name basic :offset-assert 20) + (tool-debug basic :offset-assert 24) + (mdb-file-name basic :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(defmethod print file-info ((obj file-info)) + "Print information about a file" + (format + #t + "#<~A ~A :version ~D.~D @ #x~X>" + (-> obj type) + (-> obj file-name) + (-> obj major-version) + (-> obj minor-version) + obj + ) + obj + ) + +(define *file-temp-string* (new 'global 'string 128 (the-as string #f))) + +(defenum file-kind + :bitfield #f + (level-bt 0) ;; aka bsp-header. + (art-group 1) + (tpage 2) + (dir-tpage 3) + (level-vs 4) + (tx 5) + (vis 6) + (map 7) + ) + +(defconstant LEVEL_BT_FILE_VERSION 36) +(defconstant ART_GROUP_FILE_VERSION 7) +(defconstant TPAGE_FILE_VERSION 8) ;; also used for dir +(defconstant LEVEL_VS_FILE_VERSION 30) +(defconstant TX_FILE_VERSION 1) +(defconstant MAP_FILE_VERSION 1) + +(defun make-file-name ((arg0 file-kind) (arg1 string) (arg2 int) (arg3 symbol)) + "Get a file name to open a file with the given kind and name. + The art-group-version argument can be used to override the version + of the art-group. Set it to 0 or less to use the default version + Similar to MakeFileName in C. + Note: file type enum is different between C and GOAL. + File versions should match those in versions.h. + Uses a single *file-temp-string* buffer, shared with make-vfile-name. + arg3 is unused." + (clear *file-temp-string*) + (cond + ((= arg0 (file-kind dir-tpage)) + (format *file-temp-string* "texture-page~D/dir-tpages" TPAGE_FILE_VERSION) + ) + ((= arg0 (file-kind tpage)) + (format *file-temp-string* "texture-page~D/tpage-~S" TPAGE_FILE_VERSION arg1) + ) + ((= arg0 (file-kind level-bt)) + (format *file-temp-string* "level~D/~S-bt" LEVEL_BT_FILE_VERSION arg1) + ) + ((= arg0 (file-kind tx)) + (format *file-temp-string* "res~D/~S-tx" TX_FILE_VERSION arg1) + ) + ((= arg0 (file-kind level-vs)) + (format *file-temp-string* "level~D/~S-vs" LEVEL_BT_FILE_VERSION arg1) + ) + ((= arg0 (file-kind vis)) + (format *file-temp-string* "~S.VIS" arg1) + ) + ((= arg0 (file-kind map)) + (format *file-temp-string* "map~D/~S-mp" MAP_FILE_VERSION arg1) + ) + ((= arg0 (file-kind art-group)) + (format + *file-temp-string* + "art-group~D/~S-ag" + (cond + ((> arg2 0) + arg2 + ) + (else + ART_GROUP_FILE_VERSION + ) + ) + arg1 + ) + ) + ) + *file-temp-string* + ) + +(defun make-vfile-name ((arg0 file-kind) (arg1 string)) + "Make virtual? file name. This makes a name that the kernel knows how to + handle in a specific way. This function is not used." + (clear *file-temp-string*) + (cond + ((= arg0 (file-kind level-bt)) + (format *file-temp-string* "$LEVEL/~S" arg1) + ) + ((= arg0 (file-kind art-group)) + (format *file-temp-string* "$ART_GROUP/~S" arg1) + ) + ) + *file-temp-string* + ) + +(defun file-info-correct-version? ((arg0 file-info) (arg1 file-kind) (arg2 int)) + "Check if the version and kind in the info is valid. The version-override can specify a + non-default version, or set to 0 for the default version" + (let* ((s5-0 (cond + ((zero? arg2) + (case arg1 + (((file-kind tpage) (file-kind dir-tpage)) + TPAGE_FILE_VERSION + ) + (((file-kind level-bt)) + LEVEL_BT_FILE_VERSION + ) + (((file-kind art-group)) + ART_GROUP_FILE_VERSION + ) + ) + ) + (else + arg2 + ) + ) + ) + (v1-1 arg1) + (s4-0 (cond + ((= v1-1 (file-kind tpage)) + "texture-page" + ) + ((= v1-1 (file-kind level-bt)) + "bsp-header" + ) + ((= v1-1 (file-kind art-group)) + "art-group" + ) + ) + ) + ) + (cond + ((not (name= (-> arg0 file-type 0) s4-0)) + (format 0 "ERROR: file ~A is of type ~S but needs to be ~S.~%" (-> arg0 file-name) (-> arg0 file-type) s4-0) + #f + ) + ((!= s5-0 (-> arg0 major-version)) + (format + 0 + "ERROR: file ~A is version ~D.~D, but needs to be ~D.x~%" + (-> arg0 file-name) + (-> arg0 major-version) + (-> arg0 minor-version) + s5-0 + ) + #f + ) + (else + #t + ) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/load/loader-h.gc b/goal_src/jak2/engine/load/loader-h.gc index e5741cb3ee..e89dff591b 100644 --- a/goal_src/jak2/engine/load/loader-h.gc +++ b/goal_src/jak2/engine/load/loader-h.gc @@ -5,5 +5,229 @@ ;; name in dgo: loader-h ;; dgos: ENGINE, GAME +;; TODO: document this stuff when doing loader.gc + +;; todo: more specific +(define-extern external-art-buffer-init function) + ;; DECOMP BEGINS +(deftype load-dir (basic) + ((lev level :offset-assert 4) + (string-array (array string) :offset-assert 8) + (data-array (array basic) :offset-assert 12) + ) + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (new (symbol type int level) _type_ 0) + (load-dir-method-9 () none 9) + (load-dir-method-10 () none 10) + ) + ) + +(declare-type art-group basic) + +(deftype load-dir-art-group (load-dir) + ((art-group-array (array art-group) :offset 12) + ) + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (new (symbol type int level) _type_ 0) + ) + ) + +(defmethod new load-dir ((allocation symbol) (type-to-make type) (arg0 int) (arg1 level)) + (let ((s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s4-0 lev) arg1) + (set! (-> s4-0 string-array) + (the-as (array string) ((method-of-type array new) allocation array string arg0)) + ) + (set! (-> s4-0 string-array length) 0) + (set! (-> s4-0 data-array) (the-as (array basic) ((method-of-type array new) allocation array basic arg0))) + (set! (-> s4-0 data-array length) 0) + s4-0 + ) + ) + +(defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (arg0 int) (arg1 level)) + (let ((v0-0 ((method-of-type load-dir new) allocation type-to-make arg0 arg1))) + (set! (-> v0-0 data-array content-type) art-group) + (the-as load-dir-art-group v0-0) + ) + ) + +(deftype external-art-buffer (basic) + ((index int32 :offset-assert 4) + (other external-art-buffer :offset-assert 8) + (status symbol :offset-assert 12) + (locked? symbol :offset-assert 16) + (login? symbol :offset-assert 20) + (frame-lock symbol :offset-assert 24) + (init-heap function :offset-assert 28) + (heap kheap :inline :offset-assert 32) + (pending-load-file string :offset-assert 48) + (pending-load-file-part int32 :offset-assert 52) + (pending-load-file-owner handle :offset-assert 56) + (pending-load-file-priority float :offset-assert 64) + (load-file string :offset-assert 68) + (load-file-part int32 :offset-assert 72) + (load-file-owner handle :offset-assert 80) + (load-file-priority float :offset-assert 88) + (buf pointer :offset-assert 92) + (len int32 :offset-assert 96) + (art-group art-group :offset-assert 100) + (art-data uint32 :offset 100) + ) + :method-count-assert 16 + :size-assert #x68 + :flag-assert #x1000000068 + (:methods + (new (symbol type int function symbol) _type_ 0) + (external-art-buffer-method-9 () none 9) + (external-art-buffer-method-10 () none 10) + (external-art-buffer-method-11 () none 11) + (external-art-buffer-method-12 () none 12) + (external-art-buffer-method-13 () none 13) + (external-art-buffer-method-14 () none 14) + (external-art-buffer-method-15 () none 15) + ) + ) + +(defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (arg0 int) (arg1 function) (arg2 symbol)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 index) arg0) + (set! (-> v0-0 init-heap) arg1) + (set! (-> v0-0 login?) arg2) + (set! (-> v0-0 load-file) #f) + (set! (-> v0-0 load-file-part) -1) + (set! (-> v0-0 load-file-owner) (the-as handle #f)) + (set! (-> v0-0 load-file-priority) 100000000.0) + (set! (-> v0-0 pending-load-file) #f) + (set! (-> v0-0 pending-load-file-part) -1) + (set! (-> v0-0 pending-load-file-owner) (the-as handle #f)) + (set! (-> v0-0 pending-load-file-priority) 100000000.0) + (set! (-> v0-0 art-group) #f) + (set! (-> v0-0 status) 'initialize) + (set! (-> v0-0 locked?) #f) + (set! (-> v0-0 other) #f) + v0-0 + ) + ) + +(deftype spool-anim (basic) + ((name string :offset 16) + (anim-name basic :offset-assert 20) + (parts int32 :offset-assert 24) + (hint-id int32 :offset 24) + (priority float :offset-assert 28) + (owner uint64 :offset-assert 32) + (command-list pair :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype external-art-control (basic) + ((buffer external-art-buffer 2 :offset-assert 4) + (rec spool-anim 3 :inline :offset-assert 16) + (spool-lock handle :offset-assert 160) + (reserve-buffer external-art-buffer :offset-assert 168) + (reserve-buffer-count int16 :offset-assert 172) + (dma-reserve-buffer-count int16 :offset-assert 174) + (active-stream string :offset-assert 176) + (queue-stream (array spool-anim) :offset-assert 180) + (frame-mask uint32 :offset-assert 184) + (dma-reserve-heap kheap :inline :offset-assert 192) + ) + :method-count-assert 16 + :size-assert #xd0 + :flag-assert #x10000000d0 + (:methods + (new (symbol type) _type_ 0) + (update (_type_ symbol) int 9) + (clear-rec (_type_) int 10) + (external-art-control-method-11 () none 11) + (external-art-control-method-12 () none 12) + (external-art-control-method-13 () none 13) + (external-art-control-method-14 () none 14) + (external-art-control-method-15 () none 15) + ) + ) + +(defmethod new external-art-control ((allocation symbol) (type-to-make type)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (dotimes (s4-0 2) + (set! (-> gp-0 buffer s4-0) + ((method-of-type external-art-buffer new) allocation external-art-buffer s4-0 external-art-buffer-init #t) + ) + ) + (set! (-> gp-0 buffer 0 other) (-> gp-0 buffer 1)) + (set! (-> gp-0 buffer 1 other) (-> gp-0 buffer 0)) + (dotimes (v1-9 3) + (set! (-> gp-0 rec v1-9 name) #f) + (set! (-> gp-0 rec v1-9 priority) 100000000.0) + (set! (-> gp-0 rec v1-9 owner) (the-as uint #f)) + ) + (set! (-> gp-0 spool-lock) (the-as handle #f)) + (set! (-> gp-0 reserve-buffer) #f) + (set! (-> gp-0 active-stream) #f) + (set! (-> gp-0 queue-stream) (the-as (array spool-anim) (new 'global 'boxed-array spool-anim 4))) + (dotimes (s5-1 (-> gp-0 queue-stream allocated-length)) + (set! (-> gp-0 queue-stream s5-1) (new 'global 'spool-anim)) + ) + (set! (-> gp-0 queue-stream length) 0) + gp-0 + ) + ) + +(deftype subtitle-range (basic) + ((start-frame float :offset-assert 4) + (end-frame float :offset-assert 8) + (message object 8 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(defmethod inspect subtitle-range ((obj subtitle-range)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tstart-frame: ~f~%" (-> obj start-frame)) + (format #t "~1Tend-frame: ~f~%" (-> obj end-frame)) + (format #t "~1Tmessage[8] @ #x~X~%" (-> obj message)) + (dotimes (s5-0 8) + (format #t "~T [~D]~1Tmessage: ~`object`P~%" s5-0 (-> obj message s5-0)) + ) + obj + ) + +(deftype subtitle-image (basic) + ((width uint16 :offset-assert 4) + (height uint16 :offset-assert 6) + (palette rgba 16 :offset 16) + (data uint8 :dynamic :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(defmethod inspect subtitle-image ((obj subtitle-image)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twidth: ~D~%" (-> obj width)) + (format #t "~1Theight: ~D~%" (-> obj height)) + (format #t "~1Tpalette[16] @ #x~X~%" (-> obj palette)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + obj + ) diff --git a/goal_src/jak2/engine/math/euler-h.gc b/goal_src/jak2/engine/math/euler-h.gc index e283ceb568..d569e1239e 100644 --- a/goal_src/jak2/engine/math/euler-h.gc +++ b/goal_src/jak2/engine/math/euler-h.gc @@ -7,3 +7,18 @@ ;; DECOMP BEGINS +;; maybe euler angle storage orders? +;; what is this naming convention? +(define EulSafe (new 'static 'boxed-array :type int32 0 1 2 0)) +(define EulNext (new 'static 'boxed-array :type int32 1 2 0 1)) + +;; just uses the same xyzw and data array as vector. +;; the w stores an integer that seems to have +;; bitfields for... something? Like maybe the order? +;; Euler angles are mostly unused, and the code is a bit of disaster. +(deftype euler-angles (vector) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) diff --git a/goal_src/jak2/engine/math/euler.gc b/goal_src/jak2/engine/math/euler.gc index be44326407..b2b805dbca 100644 --- a/goal_src/jak2/engine/math/euler.gc +++ b/goal_src/jak2/engine/math/euler.gc @@ -7,3 +7,213 @@ ;; DECOMP BEGINS +(defun set-eul! ((arg0 euler-angles) (arg1 float) (arg2 float) (arg3 float) (arg4 int)) + "Set euler angles and the flag bits." + (set! (-> arg0 x) arg1) + (set! (-> arg0 y) arg2) + (set! (-> arg0 z) arg3) + (set! (-> arg0 w) (the float arg4)) + arg0 + ) + +(defun eul->matrix ((arg0 matrix) (arg1 euler-angles)) + "Convert from euler angles to 4x4 matrix." + (matrix-identity! arg0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 quad)) + (when (= (logand (the int (-> s5-0 w)) 1) 1) + (let ((f0-2 (-> s5-0 x))) + (set! (-> s5-0 x) (-> s5-0 z)) + (set! (-> s5-0 z) f0-2) + ) + ) + (when (= (logand (/ (the int (-> s5-0 w)) 4) 1) 1) + (set! (-> s5-0 x) (- (-> s5-0 x))) + (set! (-> s5-0 y) (- (-> s5-0 y))) + (set! (-> s5-0 z) (- (-> s5-0 z))) + ) + (let* ((f26-0 (cos (-> s5-0 x))) + (f30-0 (cos (-> s5-0 y))) + (f22-0 (cos (-> s5-0 z))) + (f24-0 (sin (-> s5-0 x))) + (f28-0 (sin (-> s5-0 y))) + (f4-0 (sin (-> s5-0 z))) + (f0-17 (* f26-0 f22-0)) + (f1-1 (* f26-0 f4-0)) + (f2-0 (* f24-0 f22-0)) + (f3-0 (* f24-0 f4-0)) + ) + 0 + 0 + 0 + (let* ((v1-12 (logand (/ (the int (-> s5-0 w)) 4) 1)) + (a1-2 (-> EulSafe (logand (/ (the int (-> s5-0 w)) 8) 3))) + (a0-21 (-> EulNext (+ a1-2 v1-12))) + (v1-17 (-> EulNext (+ (- 1 v1-12) a1-2))) + ) + (cond + ((= (logand (/ (the int (-> s5-0 w)) 2) 1) 1) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a1-2 4)) (the-as int arg0)))) f30-0) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a0-21 4)) (the-as int arg0)))) (* f28-0 f24-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* v1-17 4)) (the-as int arg0)))) (* f28-0 f26-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a1-2 4)) (the-as int arg0)))) (* f28-0 f4-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a0-21 4)) (the-as int arg0)))) + (- f0-17 (* f30-0 f3-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* v1-17 4)) (the-as int arg0)))) + (- (- f2-0) (* f30-0 f1-1)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a1-2 4)) (the-as int arg0)))) (- (* f28-0 f22-0))) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a0-21 4)) (the-as int arg0)))) + (+ f1-1 (* f30-0 f2-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* v1-17 4)) (the-as int arg0)))) + (+ (- f3-0) (* f30-0 f0-17)) + ) + ) + (else + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a1-2 4)) (the-as int arg0)))) (* f30-0 f22-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a0-21 4)) (the-as int arg0)))) + (+ (- f1-1) (* f28-0 f2-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* v1-17 4)) (the-as int arg0)))) + (+ f3-0 (* f28-0 f0-17)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a1-2 4)) (the-as int arg0)))) (* f30-0 f4-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a0-21 4)) (the-as int arg0)))) + (+ f0-17 (* f28-0 f3-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* v1-17 4)) (the-as int arg0)))) + (+ (- f2-0) (* f28-0 f1-1)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a1-2 4)) (the-as int arg0)))) (- f28-0)) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a0-21 4)) (the-as int arg0)))) (* f30-0 f24-0)) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* v1-17 4)) (the-as int arg0)))) (* f30-0 f26-0)) + ) + ) + ) + ) + ) + arg0 + ) + +(defun matrix->eul ((arg0 euler-angles) (arg1 matrix) (arg2 int)) + "Convert matrix to euler angles with given order flag. + Not clear how this works if the matrix has more than just a rotation." + 0 + 0 + 0 + (let* ((v1-4 (logand (/ arg2 4) 1)) + (s3-0 (-> EulSafe (logand (/ arg2 8) 3))) + (s2-0 (-> EulNext (+ s3-0 v1-4))) + (s1-0 (-> EulNext (+ (- 1 v1-4) s3-0))) + ) + (cond + ((= (logand (/ arg2 2) 1) 1) + (let* ((f0-0 (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1))))) + (f0-2 (* f0-0 f0-0)) + (f1-0 (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1))))) + (f30-0 (sqrtf (+ f0-2 (* f1-0 f1-0)))) + ) + (cond + ((< 0.00000000001 f30-0) + (set! (-> arg0 x) (atan + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) (atan f30-0 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))))) + (set! (-> arg0 z) (atan + (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1)))) + (- (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))))) + ) + ) + ) + (else + (set! (-> arg0 x) (atan + (- (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s2-0 16)) (the-as int arg1))))) + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s2-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) (atan f30-0 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))))) + (set! (-> arg0 z) 0.0) + ) + ) + ) + ) + (else + (let* ((f0-21 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1))))) + (f0-23 (* f0-21 f0-21)) + (f1-3 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1))))) + (f30-1 (sqrtf (+ f0-23 (* f1-3 f1-3)))) + ) + (cond + ((< 0.00000000001 f30-1) + (set! (-> arg0 x) + (atan + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s1-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s1-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) + (atan (- (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))))) f30-1) + ) + (set! (-> arg0 z) (atan + (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))) + ) + ) + ) + (else + (set! (-> arg0 x) + (atan + (- (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s2-0 16)) (the-as int arg1))))) + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s2-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) + (atan (- (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))))) f30-1) + ) + (set! (-> arg0 z) 0.0) + ) + ) + ) + ) + ) + ) + (when (= (logand (/ arg2 4) 1) 1) + (set! (-> arg0 x) (- (-> arg0 x))) + (set! (-> arg0 y) (- (-> arg0 y))) + (set! (-> arg0 z) (- (-> arg0 z))) + ) + (when (= (logand arg2 1) 1) + (let ((f0-49 (-> arg0 x))) + (set! (-> arg0 x) (-> arg0 z)) + (set! (-> arg0 z) f0-49) + ) + ) + (set! (-> arg0 w) (the float arg2)) + arg0 + ) + +(defun eul->quat ((arg0 quaternion) (arg1 euler-angles)) + "Convert euler angles to quaternion, not very efficient." + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (eul->matrix s5-0 arg1) + (matrix->quaternion arg0 s5-0) + ) + arg0 + ) + +(defun quat->eul ((arg0 euler-angles) (arg1 quaternion) (arg2 int)) + "Conver quaternion to euler angles with given order, not very efficient." + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (quaternion->matrix s5-0 arg1) + (matrix->eul arg0 s5-0 arg2) + ) + arg0 + ) + + + + diff --git a/goal_src/jak2/engine/math/math.gc b/goal_src/jak2/engine/math/math.gc index 28a0f47b11..a0e2748ea7 100644 --- a/goal_src/jak2/engine/math/math.gc +++ b/goal_src/jak2/engine/math/math.gc @@ -5,5 +5,873 @@ ;; name in dgo: math ;; dgos: ENGINE, GAME +;; Changes/fixup: +;; - lerp-scale rewritten to not use accumulator +;; - logf, log2f, cube-root manually fixed due to float hacks + + ;; DECOMP BEGINS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; float utility +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun truncate ((arg0 float)) + "Round (toward zero) to an integer." + (the float (the int arg0)) + ) + +(defun floor ((arg0 float)) + "Round (down) to an integer" + (let ((f0-3 (the float (the int arg0)))) + (if (or (>= arg0 0.0) (= arg0 f0-3)) + f0-3 + (+ -1.0 f0-3) + ) + ) + ) + +(defun ceil ((arg0 float)) + "Round (up) to an integer" + (let ((f0-3 (the float (the int arg0)))) + (if (or (>= 0.0 arg0) (= arg0 f0-3)) + f0-3 + (+ 1.0 f0-3) + ) + ) + ) + +(defun integral? ((arg0 float)) + "Is this number an integer?" + (= (the float (the int arg0)) arg0) + ) + +(defun fractional-part ((arg0 float)) + "Get the fractional part of a float." + (- arg0 (the float (the int arg0))) + ) + +(defun sawtooth-wave ((arg0 float)) + "Sample a sawtooth with period 1. In range (0, 1)" + (let ((f0-2 (- arg0 (the float (the int arg0))))) + (if (< f0-2 0.0) + (set! f0-2 (+ 1.0 f0-2)) + ) + f0-2 + ) + ) + +(defun triangle-wave ((arg0 float)) + "Sample a triangle wave. Period is 4, in range (-1, 1) (so slope is 1 or -1)." + (let* ((f0-1 (* 0.25 (+ -1.0 arg0))) + (f0-3 (- f0-1 (the float (the int f0-1)))) + ) + (if (< f0-3 0.0) + (set! f0-3 (+ 1.0 f0-3)) + ) + (+ -1.0 (fabs (+ -2.0 (* 4.0 f0-3)))) + ) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; logs and exponentials +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun log-x-plus-1-order9 ((arg0 float)) + "Fast approximation of ln(x + 1). Probably only accurate for x in [0, 1]." + (* arg0 + (+ 1.0 + (* arg0 + (+ -0.5 + (* arg0 + (+ 0.33333334 + (* arg0 + (+ -0.25 + (* arg0 (+ 0.2 (* arg0 (+ -0.16666666 (* arg0 (+ 0.14285715 (* arg0 (+ -0.125 (* 0.11111111 arg0))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + + + +(defun logf ((arg0 float)) + "Natural log." + (let ((v1-1 (the-as int (+ (shr (the-as int arg0) 23) -126))) + (a0-2 (the-as number (logior #x3f000000 (logand (the-as uint #x807fffff) (the-as uint arg0))))) + ) + (when (< (the-as float a0-2) 0.70710677) + (set! a0-2 (+ (the-as float a0-2) (the-as float a0-2))) + (set! v1-1 (the-as int (+ (the-as uint v1-1) -1))) + ) + (let ((f0-5 (+ -1.0 (the-as float a0-2)))) + (+ (* f0-5 + (+ 1.0 + (* f0-5 + (+ -0.5 + (* f0-5 + (+ 0.33333334 + (* f0-5 + (+ -0.25 + (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + (* 0.6931472 (the float v1-1)) + ) + ) + ) + ) + +(defun log2f ((arg0 float)) + "Log base 2." + (let ((v1-1 (the-as int (+ (shr (the-as int arg0) 23) -126))) + (a0-2 (the-as number (logior #x3f000000 (logand (the-as uint #x807fffff) (the-as uint arg0))))) + ) + (when (< (the-as float a0-2) 0.70710677) + (set! a0-2 (+ (the-as float a0-2) (the-as float a0-2))) + (set! v1-1 (the-as int (+ (the-as uint v1-1) -1))) + ) + (let* ((f0-5 (+ -1.0 (the-as float a0-2))) + (f0-7 + (* f0-5 + (+ 1.0 + (* f0-5 + (+ -0.5 + (* f0-5 + (+ 0.33333334 + (* f0-5 + (+ -0.25 + (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (+ (* 1.442695 f0-7) (the float v1-1)) + ) + ) + ) + + +(deftype float-type (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(define exp-slead (new 'static 'array float 32 + 1.0 + 1.0218964 + 1.0442734 + 1.0671387 + 1.0905075 + 1.1143799 + 1.1387863 + 1.1637192 + 1.1892014 + 1.2152405 + 1.2418518 + 1.2690506 + 1.2968369 + 1.3252335 + 1.354248 + 1.3839035 + 1.4142075 + 1.4451752 + 1.4768219 + 1.5091629 + 1.5422058 + 1.5759735 + 1.6104889 + 1.645752 + 1.6817856 + 1.7186127 + 1.7562485 + 1.7947083 + 1.8340073 + 1.8741608 + 1.9151993 + 1.9571381 + ) + ) + +(define exp-strail (new 'static 'array float 32 + 0.0 + 0.0000007863494 + 0.00000040596257 + 0.0000017288019 + 0.00000022534104 + 0.0000068597833 + 0.0000023188388 + 0.0000056815315 + 0.0000057600223 + 0.0000068814647 + 0.000006005433 + 0.0000003590472 + 0.0000027016238 + 0.000003183687 + 0.000007500062 + 0.000006378546 + 0.000006103877 + 0.0000056360786 + 0.0000042465254 + 0.0000015247614 + 0.000005014861 + 0.000007334366 + 0.0000014403477 + 0.000003525029 + 0.000007247011 + 0.000006627224 + 0.0000036862523 + 0.00000082304996 + 0.0000008232258 + 0.0000068675085 + 0.000007281612 + 0.000006062652 + ) + ) + +(defun exp ((arg float)) + "Compute e^x." + (local-vars + (f0 float) + (f1 float) + (f2 float) + (f3 float) + (f4 float) + (f5 float) + (f6 float) + (f7 float) + (f8 float) + (f10 float) + (f11 float) + (f12 float) + (f13 float) + (f14 float) + (f15 float) + (f16 float) + (f17 float) + (f18 float) + (a2 int) + (v0 float) + (v1 int) + (a1 int) + (a3 int) + (t0 int) + (a0-2 int) + ) + + (set! f0 arg) + (set! f0 (fabs f0)) + (set! f1 (the-as float #x435c6bba)) + ;;(b! (>=.s f1 f0) L44 (nop!)) + (when-goto (>= f1 f0) L44) + + (set! f0 0.0) + (set! f1 arg) + ;;(b! (>=.s f0 f1) L42 (nop!)) + (when-goto (>= f0 f1) L42) + + (set! v0 (the-as float #x7f7fffff)) + ;;(b! #t L43 (nop!)) + (goto L43) + + (label L42) + (set! v0 (the-as float #x0)) + + (label L43) + ;;(b! #t L49 (nop!)) + (goto L49) + + + (label L44) + (set! f1 (the-as float #x33000000)) + ;;(b! (>=.s f0 f1) L45 (nop!)) + (when-goto (>= f0 f1) L45) + + (set! f0 (the-as float #x3f800000)) + (set! f1 arg) + (set! f0 (+ f0 f1)) + (set! v0 f0) + ;;(b! #t L49 (nop!)) + (goto L49) + + (label L45) + (set! f16 (the-as float #x4238aa3b)) + (set! f12 (the-as float #x3cb17200)) + (set! f13 (the-as float #x333fbe8e)) + (set! f14 (the-as float #x3f000044)) + (set! f15 (the-as float #x3e2aaaec)) + (set! f0 arg) + (set! f0 (* f0 f16)) + ;;(set! f0 (f2i f0)) + ;;(set! a2 (fpr->gpr f0)) + (set! a2 (the int f0)) + (set! v1 (logand a2 31)) + (set! a1 (- a2 v1)) + (set! a3 512) + (set! t0 a2) + ;;(bl! (<0.si t0) L46 (no-delay!)) + ;;(set! t0 (- t0)) + (set! t0 (abs t0)) + + ;;(label L46) + ;;(b! (>=.si a3 t0) L47 (nop!)) + (when-goto (>= a3 t0) L47) + ;;(set! f17 a1) + ;;(set! f18 v1) + ;;(set! f17 (i2f f17)) + ;;(set! f18 (i2f f18)) + (set! f17 (the float a1)) + (set! f18 (the float v1)) + (set! f17 (* f17 f12)) + (set! f18 (* f18 f12)) + (set! f0 arg) + (set! f17 (- f0 f17)) + ;;(b! #t L48 (set! f2 (-.s f17 f18))) + (set! f2 (- f17 f18)) + (goto L48) + + (label L47) + ;;(set! f17 (gpr->fpr a2)) + ;;(set! f17 (i2f f17)) + (set! f17 (the float a2)) + (set! f17 (* f17 f12)) + (set! f0 arg) + (set! f2 (- f0 f17)) + + (label L48) + (set! a0-2 (- a2)) + ;;(set! f17 (gpr->fpr a0)) + ;;(set! f17 (i2f f17)) + (set! f17 (the float a0-2)) + (set! f3 (* f17 f13)) + (set! a0-2 (sar a1 5)) + (set! f4 (+ f2 f3)) + (set! f6 (* f4 f15)) + (set! f6 (+ f14 f6)) + (set! f6 (* f4 f6)) + (set! f6 (* f4 f6)) + (set! f5 (+ f3 f6)) + (set! f5 (+ f2 f5)) + ;;(set! a1 exp-slead) + ;;(set! a2 (sll v1 2)) + ;;(set! a1 (+ a1 a2)) + ;;(set! f10 (l.f a1)) + (set! f10 (-> exp-slead v1)) + ;;(set! a1 exp-strail) + ;;(set! v1 (sll v1 2)) + ;;(set! v1 (+ a1 v1)) + ;;(set! f11 (l.f v1)) + (set! f11 (-> exp-strail v1)) + (set! f7 (+ f10 f11)) + (set! f8 (* f7 f5)) + (set! f8 (+ f11 f8)) + (set! f8 (+ f8 f10)) + (set! v1 (the-as int f8)) + (set! a0-2 (logand a0-2 511)) + (set! a0-2 (shl a0-2 23)) + (set! v0 (the-as float (+ v1 a0-2))) + (label L49) + v0 + ) + + +(defun pow ((arg0 float) (arg1 float)) + "Compute arg0^arg1" + (exp (* arg1 (logf arg0))) + ) + + +(defun print-exp ((arg0 float)) + "Print in the format AeB where A is in the range (1, 10)" + (let* ((f30-1 (floor (/ (logf (fabs arg0)) (logf 10.0)))) + (f0-4 (pow 10.0 f30-1)) + ) + (format #t "~fe~d" (/ arg0 f0-4) (the int f30-1)) + ) + 0 + (none) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; bitfield types +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(deftype rgba (uint32) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + (a uint8 :offset 24 :size 8) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(defmacro static-rgba (r g b a) + "make a new static rgba" + + `(new 'static 'rgba :r ,r :g ,g :b ,b :a ,a) + ) + +(defmacro static-rgba-uint (col) + "make a new static rgba" + `(the-as rgba ,col) + ) + +(deftype xyzw (uint128) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype xyzwh (uint128) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defun print-time ((arg0 object) (arg1 time-frame)) + "Print a time-frame as minutes:seconds:milliseconds" + (let* ((f0-1 (* 0.0033333334 (the float arg1))) + (a2-0 (the int (* 0.016666668 f0-1))) + (f0-2 (- f0-1 (* 60.0 (the float a2-0)))) + (a3-0 (the int f0-2)) + (f0-3 (- f0-2 (the float a3-0))) + (t0-0 (the int (* 1000.0 f0-3))) + ) + (format arg0 "~d:~2,'0,d:~3,'0,d" a2-0 a3-0 t0-0) + ) + 0 + (none) + ) + +(defun log2 ((arg0 int)) + "Log base 2." + (the-as int (+ (sar (the-as int (the float arg0)) 23) -127)) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; seeks/lerps +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun seek ((arg0 float) (arg1 float) (arg2 float)) + "Move arg0 toward arg1 by at most arg2." + (let ((f2-0 (- arg1 arg0))) + (cond + ((>= arg2 (fabs f2-0)) + arg1 + ) + ((>= f2-0 0.0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) + ) + ) + ) + ) + +(defun seek-ease ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Move arg0 toward arg1, and slow down before reaching the end. + When farther than arg3 away, move by at most arg2. + When closer than arg3, linearly ramp down the movement amount from arg2 to 0. + When closer than arg4, just go all the way there." + (let ((f2-0 (- arg1 arg0))) + (when (>= arg3 (fabs f2-0)) + (set! arg2 (* arg2 (- 1.0 (/ (- arg3 (fabs f2-0)) arg3)))) + (if (< arg2 arg4) + (set! arg2 arg4) + ) + ) + (cond + ((>= arg2 (fabs f2-0)) + arg1 + ) + ((>= f2-0 0.0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) + ) + ) + ) + ) + +(defun seek-ease-in-out ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + "Move arg0 toward arg2, and slow down at the start and end. + When within arg4 of arg1 (at the beginning of movement), ramp up speed, with a minimum speed of arg6 + When within arg5 of arg2 (at the end of movement), ramp down speed, with a minimum speed of arg5 + Normally, move at most arg3" + (let ((f2-0 (- arg2 arg0))) + (let ((f4-1 (- arg0 arg1))) + (when (>= arg4 (fabs f4-1)) + (set! arg3 (* arg3 (- 1.0 (/ (- arg4 (fabs f4-1)) arg4)))) + (if (< arg3 arg6) + (set! arg3 arg6) + ) + ) + ) + (when (>= arg5 (fabs f2-0)) + (set! arg3 (* arg3 (- 1.0 (/ (- arg5 (fabs f2-0)) arg5)))) + (if (< arg3 arg6) + (set! arg3 arg6) + ) + ) + (cond + ((>= arg3 (fabs f2-0)) + arg2 + ) + ((>= f2-0 0.0) + (+ arg0 arg3) + ) + (else + (- arg0 arg3) + ) + ) + ) + ) + +(defun lerp ((arg0 float) (arg1 float) (arg2 float)) + "Linearly interpolate between arg0 and arg1." + (+ arg0 (* arg2 (- arg1 arg0))) + ) + +(defun-debug lerp-scale-old ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Linearly remap arg2 in [arg3, arg4] to [arg0, arg1]. + This is the jak 1 implementation, which I claimed was a bad implementation..." + (let ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- arg2 arg3) (- arg4 arg3)))))) + (+ (* (- 1.0 f0-1) arg0) (* f0-1 arg1)) + ) + ) + +(defun lerp-scale ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Linearly remap arg2 in [arg3, arg4] to [arg0, arg1]. + More efficient than the -old version." + (let* ((v1-0 1.0) + (f1-0 0.0) + (f0-0 v1-0) + (f4-0 arg2) + (f2-0 arg3) + (f3-0 arg4) + (f1-2 (fmin (fmax (/ (- f4-0 f2-0) (- f3-0 f2-0)) f1-0) f0-0)) + (f0-1 (- f0-0 f1-2)) + (f2-3 arg0) + (f3-1 arg1) + ) + (+ (* f0-1 f2-3) (* f1-2 f3-1)) + ; (.mula.s f0-1 f2-3) + ; (.madd.s f0-2 f1-2 f3-1) + ) + ) + +(defun lerp-clamp ((arg0 float) (arg1 float) (arg2 float)) + "Linearly interpolate between arg0 and arg1. arg2 is clamped to [0, 1]" + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (+ (* (- 1.0 arg2) arg0) (* arg2 arg1)) + ) + ) + ) + +(defun seekl ((arg0 int) (arg1 int) (arg2 int)) + "Move arg0 toward arg1, by at most arg2." + (let* ((v1-0 (- arg1 arg0)) (a3-0 (abs v1-0))) + (cond + ((>= arg2 a3-0) + arg1 + ) + ((>= v1-0 0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) + ) + ) + ) + ) + + +(defmacro seek! (place target rate) + "Macro to use seek in-place. place is the base, and where the result is stored." + `(set! ,place (seek ,place ,target ,rate)) + ) + +(defmacro seekl! (place target rate) + "Macro to use seekl in-place. place is the base, and where the result is stored." + `(set! ,place (seekl ,place ,target ,rate)) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; random vu hardware +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; in the PS2 there is a R register for generating random numbers +;; it is a "32-bit" register, but the upper bits are fixed so it always +;; represents a float in (1, 2). +;; we don't have this register on x86, so we add a special global: *_vu-reg-R_* +(define *_vu-reg-R_* 0) + +(defun rand-vu-init ((seed float)) + "Initialize the VU0 random generator" + ;; (.ctc2.i R arg0) + ;; (.cfc2.i v0 R) + (set! *_vu-reg-R_* + (logior #x3F800000 (logand (the-as int seed) #x007FFFFF)) + ) + (the-as float *_vu-reg-R_*) + ) + +(rand-vu-init 1.418091) + +(defun rand-vu () + "Get a random number in [0, 1) and advance the random generator." + ;; (.vrget.xyzw vf1) - get current random + (let ((current-random *_vu-reg-R_*)) + ;; here they update the random generate with some junk + ;; for now, we don't do this in OpenGOAL. + ;; (.vsqrty Q vf1) + ;; (.vaddq.x vf2 vf0 Q) ;; you're not allowed to do this! + ;; (.vrxorw vf2) + + ;; and advance + ;; (.vrnext.xyzw vf1) + (let ((x (logand 1 (shr current-random 4))) + (y (logand 1 (shr current-random 22))) + ) + (set! current-random (shl current-random 1)) + (set! current-random (logxor current-random (logxor x y))) + (set! *_vu-reg-R_* (logior #x3f800000 (logand current-random #x7fffff))) + ) + ) + + ;; (.vsubw.xyzw vf1 vf1 vf0) + ;; (.qmfc2.i v0 vf1) + (- (the-as float *_vu-reg-R_*) 1.0) + ) + +(defun rand-vu-nostep () + "Get the number currently in the random generator. + This will be equal to the last call of (rand-vu) + This will not update the random generator" + (- (the-as float *_vu-reg-R_*) 1.0) + ) + +(defun rand-vu-float-range ((arg0 float) (arg1 float)) + "Get a random float in between arg0 and arg1" + (+ arg0 (* (rand-vu) (- arg1 arg0))) + ) + +(defun rand-vu-percent? ((arg0 float)) + "Get a boolean that's true with the given probability (in 0, 1)" + (>= arg0 (rand-vu)) + ) + +(defun rand-vu-int-range ((arg0 int) (arg1 int)) + "Get an integer in the given range (inclusive)" + (if (< arg0 arg1) + (set! arg1 (+ arg1 1)) + (set! arg0 (+ arg0 1)) + ) + (let ((f0-4 (rand-vu-float-range (the float arg0) (the float arg1)))) + (if (< f0-4 0.0) + (set! f0-4 (+ -1.0 f0-4)) + ) + (the int f0-4) + ) + ) + +(defun rand-vu-int-count ((arg0 int)) + "Get an integer in the range [0, max)." + (the int (* (rand-vu) (the float arg0))) + ) + +(defun rand-vu-int-count-excluding ((arg0 int) (arg1 int)) + "Get an integer in the range [0, arg0). + If bit n is set in arg1, exclude this value from being returned." + (let ((s4-0 0) ;; number not excluded + (s5-0 0) ;; result. + ) + (let ((v1-0 1)) + (while (nonzero? arg0) + (+! arg0 -1) + (if (zero? (logand arg1 v1-0)) + (+! s4-0 1) + ) + (set! v1-0 (* v1-0 2)) + ) + ) + (when (> s4-0 0) + (let ((v1-4 (the int (* (rand-vu) (the float s4-0)))) + (a0-1 1) + ) + (until #f + (while (logtest? arg1 a0-1) + (nop!) + (nop!) + (+! s5-0 1) + (set! a0-1 (* a0-1 2)) + ) + (if (zero? v1-4) + (goto cfg-14) + ) + (+! v1-4 -1) + (+! s5-0 1) + (set! a0-1 (* a0-1 2)) + ) + ) + #f + ) + (label cfg-14) + s5-0 + ) + ) + +(defun rand-vu-int-range-exclude ((arg0 int) (arg1 int) (arg2 int)) + "Get an integer in the range [0, arg0), excluding arg2. + Note that this doesn't use bits like rand-vu-int-count-excluding." + (until #f + (let ((v1-0 (rand-vu-int-range arg0 arg1))) + (if (!= v1-0 arg2) + (return v1-0) + ) + ) + ) + (the-as int #f) + ) + +(deftype random-generator (basic) + ((seed uint32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +(define *random-generator* (new 'global 'random-generator)) +(set! (-> *random-generator* seed) (the-as uint #x666edd1e)) + +(defmacro sext32-64 (x) + "Sign extend a 32-bit value to 64-bits" + `(sar (shl ,x 32) 32) + ) + +(defun rand-uint31-gen ((gen random-generator)) + "Generate a supposedly random integer. + Note, this might not quite be right. + But the highest bit is always zero, like it says + and it looks kinda random to me." + (let* ((sd (-> gen seed)) + ;; addiu v1, r0, 16807 + ;; mult3 v0, v1, a1 + (prod (imul64 16807 sd)) + ;; mfhi v1 + (hi (shr prod 32)) ;; sign extend this? + (lo (sar (shl prod 32) 32)) + ;; daddu v1, v1, v1 + (v1 (+ hi hi)) + ;; srl a1, v0, 31 + (a1 (logand #xffffffff (shr lo 31))) + ;; or v1, v1, a1 + ;; daddu v0, v0 v1 + (result (+ lo (logior v1 a1))) + ) + (set! result (shr (logand #xffffffff (shl result 1)) 1)) + (set! (-> gen seed) result) + (the uint result) + ) + ) + +(defun cube-root ((arg0 float)) + "Cube root with cool trick that I don't understand." + (cond + ((!= arg0 0.0) + (let* ((v1-0 arg0) + (a1-2 (+ (logand (shr (the-as int v1-0) 23) 255) -127)) + (f0-1 (the-as float + (logior (logand (the-as uint #x807fffff) (the-as uint v1-0)) (shl (+ (/ (the-as int a1-2) 3) 127) 23)) + ) + ) + ) + ;; somehow f0-1 is a reasonable approximation of cube-root. + ;; then we do 6 iterations of newton's method to get a more accurate answer. + (dotimes (v1-3 6) + (set! f0-1 (- f0-1 + (/ (- (* (* f0-1 f0-1) f0-1) arg0) + (* 3.0 f0-1 f0-1) + ) + ) + ) + ) + f0-1 + ) + ) + (else + 0.0 + ) + ) + ) + + +(defun int-noise ((arg0 int)) + "Generate random-ish floats in range -1, 1." + (let ((v1-1 (logxor (shl arg0 13) arg0))) + (- 1.0 (* 0.0000000009313226 + (the float (logand #x7fffffff (+ #x5208dd0d (* v1-1 (+ #xc0ae5 (* (* #x3d73 v1-1) v1-1)))))) + ) + ) + ) + ) + +(defun smooth-step ((arg0 float)) + "Interpolate between 0, 1 with a cubic polynomial. + These are picked so f(0) = 0, f(1) = 1, f'(0) = f'(1) = 0." + (cond + ((>= 0.0 arg0) + 0.0 + ) + ((>= arg0 1.0) + 1.0 + ) + (else + (* arg0 arg0 (+ 3.0 (* -2.0 arg0))) + ) + ) + ) + +(defun smooth-interp ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Remap arg2 from (arg3, arg4) to (arg0, arg1), using cubic interpolation. + Satisfies: + - f(arg3) = arg0 + - f(arg4) = arg1 + - f'(arg3) = f'(arg4) = 0" + (+ arg0 (* (- arg1 arg0) (smooth-step (/ (- arg2 arg3) (- arg4 arg3))))) + ) + diff --git a/goal_src/jak2/engine/math/matrix-h.gc b/goal_src/jak2/engine/math/matrix-h.gc index 02e469697f..3eb3c48b93 100644 --- a/goal_src/jak2/engine/math/matrix-h.gc +++ b/goal_src/jak2/engine/math/matrix-h.gc @@ -7,3 +7,74 @@ ;; DECOMP BEGINS +;; A 4x4 matrix, stored in row-major order +;; some, but not all, functions assume that a matrix is an affine transform. +;; others assume that the rotation has no scale or shear (and that its inverse is its transpose) +(deftype matrix (structure) + ((data float 16 :offset-assert 0) + (vector vector 4 :inline :offset 0) + (quad uint128 4 :offset 0) + (trans vector :inline :offset 48) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + ) + ) + +;; A 3x3 matrix, stored in row-major order. +;; NOTE: the rows each have an extra 4-bytes of padding +;; so this is really a 3x4 matrix. +;; this type is rarely used +(deftype matrix3 (structure) + ((data float 12 :offset-assert 0) + (vector vector 3 :inline :offset 0) + (quad uint128 3 :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; a matrix stored using 16-bit integers. +;; note that these usually have different scaling for the 4th row which +;; contains the translation in an affine transform. +;; so you generally should not unpack these to floats without knowing where they came from +;; and how they were originally packed (for example, in tie/shrub) +(deftype matrix4h (structure) + ((data int16 16 :offset-assert 0) + (vector4h vector4h 4 :inline :offset 0) + (long int64 4 :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(defun matrix-copy! ((arg0 matrix) (arg1 matrix)) + "Copy arg1 to arg0" + (let ((v1-0 (-> arg1 vector 0 quad)) + (a2-0 (-> arg1 vector 1 quad)) + (a3-0 (-> arg1 vector 2 quad)) + (a1-1 (-> arg1 vector 3 quad)) + ) + (set! (-> arg0 vector 0 quad) v1-0) + (set! (-> arg0 vector 1 quad) a2-0) + (set! (-> arg0 vector 2 quad) a3-0) + (set! (-> arg0 vector 3 quad) a1-1) + ) + arg0 + ) + +(defmacro new-stack-matrix0 () + "Get a new matrix on the stack that's set to zero." + `(let ((mat (new 'stack-no-clear 'matrix))) + (set! (-> mat quad 0) (the-as uint128 0)) + (set! (-> mat quad 1) (the-as uint128 0)) + (set! (-> mat quad 2) (the-as uint128 0)) + (set! (-> mat quad 3) (the-as uint128 0)) + mat + ) + ) diff --git a/goal_src/jak2/engine/math/matrix.gc b/goal_src/jak2/engine/math/matrix.gc index b27680581b..ef56b203d4 100644 --- a/goal_src/jak2/engine/math/matrix.gc +++ b/goal_src/jak2/engine/math/matrix.gc @@ -5,5 +5,1891 @@ ;; name in dgo: matrix ;; dgos: ENGINE, GAME +;; This file implements the GOAL matrix library. + +;; In general, a vector is always treated as a row vector. +;; Chaining transformation is done like v_row * T1_goal * T2_goal, which means do T1 before T2. +;; This is the opposite of the usual convention: +;; T2_normal * T1_normal * v_col +;; However, there is good news: +;; T1_normal = T1_goal ^ T +;; T2_normal = T2_goal ^ T +;; This is due to the property +;; (A * B)^T = B^T * A^T + +;; So a homogeneous transformation is: +;; R_xx R_xy R_xz 0 +;; R_yx R_yy R_yz 0 +;; R_zx R_zy R_zz 0 +;; T_x T_y T_z 1 + +;; which is probably the transpose of what you're used to. + +;; note that they also used row-major storage, so the 3rd qword of a matrix is the translation +;; part of the affine transform. + +;; In general, be careful with using these functions as they often have strange +;; requirements for the form of the input matrix or if the input/output matrix are +;; allowed to be the same memory. + ;; DECOMP BEGINS +(defmethod inspect matrix ((obj matrix)) + (format #t "[~8x] matrix~%" obj) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2) (-> obj data 3)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6) (-> obj data 7)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10) (-> obj data 11)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) + obj + ) + +(defmethod inspect matrix3 ((obj matrix3)) + "Print out the values in a 3x3 matrix." + (format #t "[~8x] matrix3~%" obj) + (format #t "~T[~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2)) + (format #t "~T[~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6)) + (format #t "~T[~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10)) + obj + ) + +(defun matrix-identity! ((arg0 matrix)) + "Set dst to the identity matrix." + (set! (-> arg0 quad 0) (the-as uint128 0)) + (set! (-> arg0 quad 1) (the-as uint128 0)) + (set! (-> arg0 quad 2) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (let ((f0-0 1.0)) + (set! (-> arg0 trans w) f0-0) + (set! (-> arg0 data 10) f0-0) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 0) f0-0) + ) + arg0 + ) + +(define *identity-matrix* (matrix-identity! (new 'global 'matrix))) + +(define *hermite-matrix* + (new 'static 'matrix + :data (new 'static 'array float 16 2.0 -2.0 1.0 1.0 -3.0 3.0 -2.0 -1.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0) + ) + ) + +(defun matrix+! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + "Set dst = src1 + src2. It is okay for any arguments to be the same data. + This is not an efficient implementation." + (dotimes (v1-0 16) + (set! (-> arg0 data v1-0) (+ (-> arg1 data v1-0) (-> arg2 data v1-0))) + ) + arg0 + ) + +(defun matrix-! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + "Set dst = src1 - src1. It is okay for any arugments to be the same data. + This is not an efficient implementation." + (dotimes (v1-0 16) + (set! (-> arg0 data v1-0) (- (-> arg1 data v1-0) (-> arg2 data v1-0))) + ) + arg0 + ) + +(defun matrix*! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + "Set dst = src1 * src2. It is okay for any arguments to be the same data. + This is a moderately efficient implementation." + (rlet ((acc :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf20 :class vf) + (vf21 :class vf) + ) + (.lvf vf10 (&-> arg1 quad 0)) + (.lvf vf14 (&-> arg2 quad 0)) + (.lvf vf15 (&-> arg2 quad 1)) + (.lvf vf16 (&-> arg2 quad 2)) + (.lvf vf17 (&-> arg2 trans quad)) + (.lvf vf11 (&-> arg1 quad 1)) + (.lvf vf12 (&-> arg1 quad 2)) + (.lvf vf13 (&-> arg1 trans quad)) + (.mul.x.vf acc vf14 vf10) + (.add.mul.y.vf acc vf15 vf10 acc) + (.add.mul.z.vf acc vf16 vf10 acc) + (.add.mul.w.vf vf18 vf17 vf10 acc) + (.mul.x.vf acc vf14 vf11) + (.add.mul.y.vf acc vf15 vf11 acc) + (.add.mul.z.vf acc vf16 vf11 acc) + (.add.mul.w.vf vf19 vf17 vf11 acc) + (.mul.x.vf acc vf14 vf12) + (.add.mul.y.vf acc vf15 vf12 acc) + (.add.mul.z.vf acc vf16 vf12 acc) + (.add.mul.w.vf vf20 vf17 vf12 acc) + (.mul.x.vf acc vf14 vf13) + (.add.mul.y.vf acc vf15 vf13 acc) + (.add.mul.z.vf acc vf16 vf13 acc) + (.add.mul.w.vf vf21 vf17 vf13 acc) + (.svf (&-> arg0 quad 0) vf18) + (.svf (&-> arg0 quad 1) vf19) + (.svf (&-> arg0 quad 2) vf20) + (.svf (&-> arg0 trans quad) vf21) + arg0 + ) + ) + +(defun matrixp*! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + "Set dst = src1 * src2. NOTE: this function is a wrapper around matrix*! + that adds no additional functionality. It seems to be a leftover from + a time when matrix*! wasn't safe to use in place. This is unused." + (let ((s5-0 (new-stack-matrix0))) + (matrix*! s5-0 arg1 arg2) + (set! (-> arg0 quad 0) (-> s5-0 quad 0)) + (set! (-> arg0 quad 1) (-> s5-0 quad 1)) + (set! (-> arg0 quad 2) (-> s5-0 quad 2)) + (set! (-> arg0 trans quad) (-> s5-0 trans quad)) + ) + arg0 + ) + +(defun vector-matrix*! ((arg0 vector) (arg1 vector) (arg2 matrix)) + "Set dst = vec * mat. dst may be equal to src." + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (.lvf vf1 (&-> arg2 quad 0)) + (.lvf vf2 (&-> arg2 quad 1)) + (.lvf vf3 (&-> arg2 quad 2)) + (.lvf vf4 (&-> arg2 trans quad)) + (.lvf vf5 (&-> arg1 quad)) + (.mul.x.vf acc vf1 vf5) + (.add.mul.y.vf acc vf2 vf5 acc) + (.add.mul.z.vf acc vf3 vf5 acc) + (.add.mul.w.vf vf5 vf4 vf5 acc) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +(defun vector-rotate*! ((arg0 vector) (arg1 vector) (arg2 matrix)) + "Set dst to be the input vector rotated by the rotation part of mat. + The input matrix should be a homogeneous transform with a rotation matrix as its upper-left 3x3. + dst may be equal to src." + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (nop!) + (nop!) + (.lvf vf5 (&-> arg1 quad)) + (nop!) + (.lvf vf1 (&-> arg2 quad 0)) + (nop!) + (.lvf vf2 (&-> arg2 quad 1)) + (.mul.x.vf acc vf1 vf5) + (.lvf vf3 (&-> arg2 quad 2)) + (.add.mul.y.vf acc vf2 vf5 acc) + (.lvf vf4 (&-> arg2 trans quad)) + (.add.mul.z.vf vf5 vf3 vf5 acc) + (nop!) + (nop!) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +(defun vector3s-matrix*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix)) + "Set dst to be ([src 1.0] * mat).xyz. Doesn't touch the w of dst. + dst and vec can be the same memory" + (let ((s5-0 (new-stack-vector0))) + (set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0) + (vector-matrix*! s5-0 s5-0 arg2) + (set! (-> arg0 x) (-> s5-0 x)) + (set! (-> arg0 y) (-> s5-0 y)) + (set! (-> arg0 z) (-> s5-0 z)) + ) + arg0 + ) + +(defun vector3s-rotate*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix)) + "Set dst to vec rotated by the rotation in the homogeneous transform mat. + mat should not have a scale/shear (the upper 3x3 should be a pure rotation)." + (let ((s5-0 (new-stack-vector0))) + (set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0) + (vector-rotate*! s5-0 s5-0 arg2) + (set! (-> arg0 x) (-> s5-0 x)) + (set! (-> arg0 y) (-> s5-0 y)) + (set! (-> arg0 z) (-> s5-0 z)) + ) + arg0 + ) + +(defun matrix-transpose! ((arg0 matrix) (arg1 matrix)) + "Set dst = src^T. src and dst can be the same." + (local-vars + (v1-0 uint128) + (v1-1 uint128) + (v1-2 uint128) + (a1-1 uint128) + (a2-1 uint128) + (t0-1 uint128) + ) + (nop!) + (nop!) + (let ((t0-0 (-> arg1 quad 0))) + (nop!) + (let ((t1-0 (-> arg1 quad 1))) + (nop!) + (let ((a2-0 (-> arg1 quad 2))) + (.pextlw v1-0 t1-0 t0-0) + (let ((a3-0 (-> arg1 trans quad))) + (.pextuw a1-1 t1-0 t0-0) + ;; (.mov r0-0 f31-0) + (.pextlw t0-1 a3-0 a2-0) + ;; (.mov r0-1 f31-0) + (.pextuw a2-1 a3-0 a2-0) + ) + ) + ) + ) + ;; (.mov r0-2 f31-0) + (let ((a3-1 (make-u128 t0-1 v1-0))) + ;; (.mov r0-3 f31-0) + (.pcpyud v1-1 v1-0 t0-1) + (set! (-> arg0 quad 0) (the-as uint128 a3-1)) + ) + (let ((a3-2 (make-u128 a2-1 a1-1))) + (set! (-> arg0 quad 1) v1-1) + (.pcpyud v1-2 a1-1 a2-1) + (set! (-> arg0 quad 2) (the-as uint128 a3-2)) + ) + (nop!) + (set! (-> arg0 trans quad) v1-2) + arg0 + ) + +(defun matrix-inverse-of-rot-trans! ((arg0 matrix) (arg1 matrix)) + "Set dst = src^-1, assuming src is a homogeneous tranform with only rotation/translation. + NOTE: THIS FUNCTION REQUIRES dst != src" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf8 :class vf) + ) + (init-vf0-vector) + (matrix-transpose! arg0 arg1) + (.lvf vf1 (&-> arg0 quad 0)) + (.lvf vf2 (&-> arg0 quad 1)) + (.lvf vf3 (&-> arg0 quad 2)) + (.sub.vf vf1 vf1 vf1 :mask #b1000) + (.sub.vf vf2 vf2 vf2 :mask #b1000) + (.sub.vf vf3 vf3 vf3 :mask #b1000) + (.lvf vf8 (&-> arg1 trans quad)) + (.mul.x.vf acc vf1 vf8) + (.add.mul.y.vf acc vf2 vf8 acc) + (.add.mul.z.vf vf4 vf3 vf8 acc) + (.sub.vf vf4 vf0 vf4) + (.mov.vf vf4 vf0 :mask #b1000) + (.svf (&-> arg0 quad 0) vf1) + (.svf (&-> arg0 quad 1) vf2) + (.svf (&-> arg0 quad 2) vf3) + (.svf (&-> arg0 trans quad) vf4) + arg0 + ) + ) + +(defun matrix-4x4-inverse! ((arg0 matrix) (arg1 matrix)) + "Invert a 4x4 matrix. This assumes that the input is a homogeneous transform. + Src and dst can be the same." + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf2 :class vf) + (vf20 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf3 :class vf) + (vf30 :class vf) + (vf31 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + + ;; ADDED: the original implementation does math on vectors where some values are + ;; uninitialized. It doesn't use the result, so there's no problem, but this + ;; may cause strange slowdowns on x86 where doing math on NaNs can be extremely slow. + ;; ideally we should find a better solution. + (.xor.vf vf26 vf26 vf26) + (.xor.vf vf27 vf27 vf27) + (.xor.vf vf28 vf28 vf28) + (.xor.vf vf29 vf29 vf29) + (.xor.vf vf30 vf30 vf30) + (.xor.vf vf31 vf31 vf31) + (.xor.vf vf16 vf16 vf16) + (.xor.vf vf17 vf17 vf17) + (.xor.vf vf18 vf18 vf18) + (.xor.vf vf23 vf23 vf23) + (.xor.vf vf19 vf19 vf19) + (init-vf0-vector) + (nop!) + (nop!) + (.lvf vf23 (&-> arg1 quad 0)) + (nop!) + (.lvf vf24 (&-> arg1 quad 1)) + (nop!) + (.lvf vf25 (&-> arg1 quad 2)) + (nop!) + (.lvf vf1 (&-> arg1 trans quad)) + (.mul.x.vf vf7 vf24 vf23) + (nop!) + (.mul.y.vf vf8 vf24 vf23) + (nop!) + (.mul.z.vf vf9 vf24 vf23) + (nop!) + (.mul.x.vf vf10 vf25 vf23) + (nop!) + (.mul.y.vf vf11 vf25 vf23) + (nop!) + (.mul.z.vf vf12 vf25 vf23) + (nop!) + (.mul.x.vf vf13 vf25 vf24) + (nop!) + (.mul.y.vf vf14 vf25 vf24) + (nop!) + (.mul.z.vf vf15 vf25 vf24) + (nop!) + (.mul.z.vf vf26 vf7 vf25 :mask #b10) + (nop!) + (.mul.z.vf vf27 vf11 vf24 :mask #b1) + (nop!) + (.mul.y.vf vf28 vf9 vf25 :mask #b1) + (nop!) + (.mul.z.vf vf29 vf14 vf23 :mask #b1) + (nop!) + (.mul.z.vf vf30 vf8 vf25 :mask #b1) + (nop!) + (.mul.y.vf vf31 vf7 vf25 :mask #b100) + (nop!) + (.add.y.vf vf16 vf27 vf26 :mask #b1) + (nop!) + (.sub.vf vf1 vf0 vf1) + (nop!) + (.add.x.vf vf17 vf29 vf30 :mask #b1) + (nop!) + (.sub.z.vf vf18 vf28 vf31 :mask #b1) + (nop!) + (.sub.y.vf vf23 vf14 vf15 :mask #b100) + (nop!) + (.sub.z.vf vf26 vf15 vf13 :mask #b1) + (nop!) + (.sub.x.vf vf29 vf13 vf14 :mask #b10) + (nop!) + (.sub.vf vf19 vf16 vf17 :mask #b1) + (nop!) + (.sub.z.vf vf24 vf12 vf11 :mask #b10) + (nop!) + (.sub.x.vf vf27 vf10 vf12 :mask #b100) + (nop!) + (.sub.y.vf vf30 vf11 vf10 :mask #b1) + (nop!) + (.add.vf vf20 vf19 vf18 :mask #b1) + (nop!) + (.sub.y.vf vf25 vf8 vf9 :mask #b100) + (nop!) + (.sub.z.vf vf28 vf9 vf7 :mask #b1) + (nop!) + (.sub.x.vf vf31 vf7 vf8 :mask #b10) + (nop!) + (.div.vf Q vf0 vf20 :fsf #b11 :ftf #b0) + (nop!) + (.sub.w.vf vf3 vf3 vf3 :mask #b1000) + (nop!) + (.sub.w.vf vf4 vf4 vf4 :mask #b1000) + (nop!) + (.sub.w.vf vf5 vf5 vf5 :mask #b1000) + (nop!) + (.mov.vf vf6 vf0 :mask #b1000) + (nop!) + (.wait.vf) + (nop!) + (.add.vf vf2 vf0 Q :mask #b1) + (nop!) + (.add.x.vf vf2 vf0 vf2 :mask #b111) + (nop!) + (.mul.z.vf vf3 vf2 vf23 :mask #b1) + (nop!) + (.mul.x.vf vf4 vf2 vf26 :mask #b1) + (nop!) + (.mul.y.vf vf5 vf2 vf29 :mask #b1) + (nop!) + (.mul.y.vf vf3 vf2 vf24 :mask #b10) + (nop!) + (.mul.z.vf vf4 vf2 vf27 :mask #b10) + (nop!) + (.mul.x.vf vf5 vf2 vf30 :mask #b10) + (nop!) + (.mul.z.vf vf3 vf2 vf25 :mask #b100) + (nop!) + (.mul.x.vf vf4 vf2 vf28 :mask #b100) + (nop!) + (.mul.y.vf vf5 vf2 vf31 :mask #b100) + (nop!) + (.mul.x.vf acc vf3 vf1) + (.svf (&-> arg0 quad 0) vf3) + (.add.mul.y.vf acc vf4 vf1 acc) + (.svf (&-> arg0 quad 1) vf4) + (.add.mul.z.vf vf6 vf5 vf1 acc :mask #b111) + (.svf (&-> arg0 quad 2) vf5) + (nop!) + (.svf (&-> arg0 trans quad) vf6) + arg0 + ) + ) + +(defun matrix-translate! ((arg0 matrix) (arg1 vector)) + "Set dst to a homogeneous transform with only a translation of trans" + (matrix-identity! arg0) + (set! (-> arg0 trans x) (-> arg1 x)) + (set! (-> arg0 trans y) (-> arg1 y)) + (set! (-> arg0 trans z) (-> arg1 z)) + arg0 + ) + +(defun matrix-translate+! ((arg0 matrix) (arg1 matrix) (arg2 vector)) + "Add the given translation to the translation of homogenous transform mat src + and store in dst. It is okay for dst = src." + (set! (-> arg0 trans x) (+ (-> arg1 trans x) (-> arg2 x))) + (set! (-> arg0 trans y) (+ (-> arg1 trans y) (-> arg2 y))) + (set! (-> arg0 trans z) (+ (-> arg1 trans z) (-> arg2 z))) + (when (!= arg0 arg1) + (set! (-> arg0 quad 0) (-> arg1 quad 0)) + (set! (-> arg0 quad 1) (-> arg1 quad 1)) + (set! (-> arg0 quad 2) (-> arg1 quad 2)) + ) + arg0 + ) + +(defun matrix-scale! ((arg0 matrix) (arg1 vector)) + "Set dst to a homogenous transform with only a scale. The x,y,z components + of scale become the x,y,z scaling factors" + (set! (-> arg0 quad 0) (the-as uint128 0)) + (set! (-> arg0 quad 1) (the-as uint128 0)) + (set! (-> arg0 quad 2) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) (-> arg1 x)) + (set! (-> arg0 data 5) (-> arg1 y)) + (set! (-> arg0 data 10) (-> arg1 z)) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix)) + "Scale an existing matrix. Okay for dst = src. The scaling is applied per row. + This means the x component of scale is used to scale the first row of src. + The w component of scale is used." + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg2 quad 0)) + (.lvf vf6 (&-> arg2 quad 1)) + (.lvf vf7 (&-> arg2 quad 2)) + (.lvf vf8 (&-> arg2 trans quad)) + (.mul.x.vf vf5 vf5 vf4) + (.mul.y.vf vf6 vf6 vf4) + (.mul.z.vf vf7 vf7 vf4) + (.mul.w.vf vf8 vf8 vf4) + (.svf (&-> arg0 quad 0) vf5) + (.svf (&-> arg0 quad 1) vf6) + (.svf (&-> arg0 quad 2) vf7) + (.svf (&-> arg0 trans quad) vf8) + arg0 + ) + ) + +(defun matrix-inv-scale! ((arg0 matrix) (arg1 vector)) + "Set dst to a homogeneous transform with only a scale. + The x,y,z components of scale are inverted and used as the x,y,z scaling factors" + (set! (-> arg0 quad 0) (the-as uint128 0)) + (set! (-> arg0 quad 1) (the-as uint128 0)) + (set! (-> arg0 quad 2) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) (/ 1.0 (-> arg1 x))) + (set! (-> arg0 data 5) (/ 1.0 (-> arg1 y))) + (set! (-> arg0 data 10) (/ 1.0 (-> arg1 z))) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun column-scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix)) + "Scale an existing matrix. Okay for dst = src. The scaling is applied column-wise. + Meaning the x component of scale will scale the first column of src." + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg2 quad 0)) + (.lvf vf6 (&-> arg2 quad 1)) + (.lvf vf7 (&-> arg2 quad 2)) + (.lvf vf8 (&-> arg2 trans quad)) + (.mul.vf vf5 vf5 vf4) + (.mul.vf vf6 vf6 vf4) + (.mul.vf vf7 vf7 vf4) + (.mul.vf vf8 vf8 vf4) + (.svf (&-> arg0 quad 0) vf5) + (.svf (&-> arg0 quad 1) vf6) + (.svf (&-> arg0 quad 2) vf7) + (.svf (&-> arg0 trans quad) vf8) + arg0 + ) + ) + +(defun matrix-rotate-x! ((arg0 matrix) (arg1 float)) + "Set dst to a homogeneous transform matrix for a rotation around the x-axis (degrees)" + (let ((f30-0 (sin arg1)) + (f0-0 (cos arg1)) + ) + (set! (-> arg0 quad 0) (the-as uint128 0)) + (set! (-> arg0 quad 1) (the-as uint128 0)) + (set! (-> arg0 quad 2) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) (the-as float 1.0)) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 6) f30-0) + (set! (-> arg0 data 9) (- f30-0)) + (set! (-> arg0 data 10) f0-0) + ) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun matrix-rotate-y! ((arg0 matrix) (arg1 float)) + "Set dst to a homoegeneous transform matrix for a rotation around the y axis (degrees)" + (let ((f30-0 (sin arg1)) + (f0-0 (cos arg1)) + ) + (set! (-> arg0 quad 0) (the-as uint128 0)) + (set! (-> arg0 quad 1) (the-as uint128 0)) + (set! (-> arg0 quad 2) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) f0-0) + (set! (-> arg0 data 2) (- f30-0)) + (set! (-> arg0 data 5) 1.0) + (set! (-> arg0 data 8) f30-0) + (set! (-> arg0 data 10) f0-0) + ) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun matrix-rotate-z! ((arg0 matrix) (arg1 float)) + "Set dst to a homogeneous transform matrix for a rotation around the z-axis (degrees)" + (let ((f30-0 (sin arg1)) + (f0-0 (cos arg1)) + ) + (set! (-> arg0 quad 0) (the-as uint128 0)) + (set! (-> arg0 quad 1) (the-as uint128 0)) + (set! (-> arg0 quad 2) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) f0-0) + (set! (-> arg0 data 1) f30-0) + (set! (-> arg0 data 4) (- f30-0)) + (set! (-> arg0 data 5) f0-0) + ) + (set! (-> arg0 data 10) 1.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun matrix-rotate-zyx! ((arg0 matrix) (arg1 vector)) + "Rotate in z,y,x order." + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-x! arg0 (-> arg1 x)) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-z! gp-0 (-> arg1 z)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +(defun-debug matrix-rotate-xyz-2! ((arg0 matrix) (arg1 vector)) + "Jak 1 version of matrix-rotate-xyz. Slower than the one below" + (let ((gp-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (matrix-rotate-z! arg0 (-> arg1 z)) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +(defun matrix-rotate-xyz! ((arg0 matrix) (arg1 vector)) + "Rotate in x,y,z order" + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-sincos! s4-0 s5-0 arg1) + (let ((f2-0 (-> s4-0 x)) + (f5-0 (-> s4-0 y)) + (f3-0 (-> s4-0 z)) + (f0-0 (-> s5-0 x)) + (f1-0 (-> s5-0 y)) + ) + (let ((f4-0 (-> s5-0 z))) + (set! (-> arg0 data 0) (* f1-0 f4-0)) + (set! (-> arg0 data 1) (* f1-0 f3-0)) + (set! (-> arg0 data 2) (- f5-0)) + (set! (-> arg0 data 3) 0.0) + (let ((f6-4 (* f2-0 f5-0)) + (f5-1 (* f0-0 f5-0)) + ) + (set! (-> arg0 data 4) (- (* f6-4 f4-0) (* f0-0 f3-0))) + (set! (-> arg0 data 5) (+ (* f6-4 f3-0) (* f0-0 f4-0))) + (set! (-> arg0 data 6) (* f2-0 f1-0)) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 8) (+ (* f2-0 f3-0) (* f5-1 f4-0))) + (set! (-> arg0 data 9) (- (* f5-1 f3-0) (* f2-0 f4-0))) + ) + ) + (set! (-> arg0 data 10) (* f0-0 f1-0)) + ) + ) + (set! (-> arg0 data 11) 0.0) + (.svf (&-> arg0 trans quad) vf0) + arg0 + ) + ) + +(defun matrix-rotate-zxy! ((arg0 matrix) (arg1 vector)) + "Rotate in z,x,y order" + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-y! arg0 (-> arg1 y)) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-z! gp-0 (-> arg1 z)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +(defun matrix-rotate-yxz! ((arg0 matrix) (arg1 vector)) + "Rotate in y,x,z order." + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-z! arg0 (-> arg1 z)) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +(defun matrix-rotate-yzx! ((arg0 matrix) (arg1 vector)) + "Rotate in y,z,x order" + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-z! arg0 (-> arg1 x)) + (matrix-rotate-x! gp-0 (-> arg1 z)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +(defun matrix-rotate-yxy! ((arg0 matrix) (arg1 vector)) + "Rotate. I believe in yxy order? Compared to the other rotations, this one + is quite a bit more optimized and avoid repeated trig operations." + (let ((a2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! a2-0 (-> arg1 x) (- (-> arg1 y) (-> arg1 z)) (-> arg1 z) 1.0) + (vector-sincos! s5-0 s4-0 a2-0) + (let ((f1-1 (-> s4-0 y)) + (f0-5 (-> s5-0 y)) + (f2-0 (-> s4-0 x)) + (f5-0 (-> s5-0 x)) + (f3-0 (-> s4-0 z)) + (f4-0 (-> s5-0 z)) + ) + (set! (-> arg0 data 0) (- (* f1-1 f3-0) (* f0-5 f2-0 f4-0))) + (set! (-> arg0 data 1) (* f0-5 f5-0)) + (set! (-> arg0 data 2) (- (+ (* f1-1 f4-0) (* f0-5 f2-0 f3-0)))) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 4) (* f5-0 f4-0)) + (set! (-> arg0 data 5) f2-0) + (set! (-> arg0 data 6) (* f5-0 f3-0)) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 8) (+ (* f0-5 f3-0) (* f1-1 f2-0 f4-0))) + (set! (-> arg0 data 9) (- (* f1-1 f5-0))) + (set! (-> arg0 data 10) (- (* f1-1 f2-0 f3-0) (* f0-5 f4-0))) + ) + ) + (set! (-> arg0 data 11) 0.0) + (set! (-> arg0 trans x) 0.0) + (set! (-> arg0 trans y) 0.0) + (set! (-> arg0 trans z) 0.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +(defun matrix-rotate-yx! ((arg0 matrix) (arg1 float) (arg2 float)) + "Rotate by y then x." + (matrix-rotate-y! arg0 arg1) + (let ((a1-2 (matrix-rotate-x! (new-stack-matrix0) arg2))) + (matrix*! arg0 a1-2 arg0) + ) + arg0 + ) + +(defun matrix-axis-sin-cos-vu! ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float)) + "Create an axis-angle rotation matrix. But given the sin/cos of the angle." + ;; this is unused and basically identital to the non-VU version, so I'm leaving this out. + (/ 0 0) + (none) + ) + +(defun matrix-axis-sin-cos! ((dst matrix) (axis vector) (s float) (c float)) + "Create an axis-angle rotation matrix. But given the sin/cos of the angle." + ;;or v0, a0, r0 + ;;or v1, a1, r0 + ;;mtc1 f0, a2 + ;;mtc1 f1, a3 + ;;sll r0, r0, 0 + + ;; input scramble: + ;; - v0 = dst + ;; - v1 = axis + ;; - f0 = sine + ;; - f1 = cosine + (rlet ((vf5 :class vf) ;; vf5.x will be sine, vf5.w will be -cosine + (vf6 :class vf) ;; vf6.x will be cosine + (vf1 :class vf) ;; vector. + (vf0 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf11 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + (vf10 :class vf) + (a1 :class i128 :type uint128) + (r0 :class i128 :type uint128)) ;; will be used for zero check. + ;; initialize constant vectors + (init-vf0-vector) + (.xor.p r0 r0 r0) + + ;; this is an overly complicated check to see if xyz = 0. + + (let ((a0 65535) ;; ori a0, r0, 65535 + (v1 (-> axis quad))) ;; lq v1, 0(v1) + + ;; this a0 constant has ffff in the upper 16 bits to mask out w, later on. + ;; dsll32 a0, a0, 16 + (set! a0 (shl a0 48)) ;; a0 = ffff'0000'0000'0000 + + ;;mfc1 a1, f1 + ;;qmtc2.i vf6, a1 + (.mov vf6 c) ;; will set vf6.x to cosine. + + ;;pceqw a1, v1, r0 + ;; compare for equality with zero. + ;; this will set 32-bits for each component. + (.pceqw a1 v1 r0) + + ;; so we pack: [upper64, w0?16, z0?16, y0?16, x0?16] + (.ppach a1 r0 a1) + + ;;qmtc2.i vf1, v1 + (.mov vf1 v1) ;; should be quad move! + + ;;or v1, a1, a0 + ;; make it seem like w is zero. If x,y,z = 0, but w != 0, we want + ;; it to act like zero. + (let ((xyz-zero (logior a0 (the uint a1)))) + ;;mfc1 a0, f0 + ;;qmtc2.i vf5, a0 + (.mov vf5 s) + + ;;daddiu v1, v1, 1 + ;; if all is zero, this will overflow and give us 0. + (+! xyz-zero 1) + + ;;vsubx.w vf5, vf0, vf6 + (.sub.x.vf vf5 vf0 vf6 :mask #b1000) + + ;;beq v1, r0, L15 + ;;vaddx.y vf5, vf0, vf6 + (.add.x.vf vf5 vf0 vf6 :mask #b0010) + (when-goto (zero? xyz-zero) zero-case) + ) + ) + + ;; Nonzero case: + ;; vsubw.w vf2, vf0, vf0 + ;; vsubw.w vf3, vf0, vf0 + ;; vsubw.w vf4, vf0, vf0 + (.xor.vf vf2 vf2 vf2) + (.xor.vf vf3 vf3 vf3) + (.xor.vf vf4 vf4 vf4) + + ;;vmulx.xyz vf11, vf1, vf5 + (.mul.x.vf vf11 vf1 vf5 :mask #b0111) + + ;;vaddy.x vf7, vf0, vf5 + (.add.y.vf vf7 vf0 vf5 :mask #b0001) + + ;;vaddy.y vf8, vf0, vf5 + (.add.y.vf vf8 vf0 vf5 :mask #b0010) + + ;;vaddy.z vf9, vf0, vf5 + (.add.y.vf vf9 vf0 vf5 :mask #b0100) + + ;;vmulw.xyz vf10, vf1, vf5 + (.mul.w.vf vf10 vf1 vf5 :mask #b0111) + + ;;vsubz.y vf7, vf0, vf11 + (.sub.z.vf vf7 vf0 vf11 :mask #b0010) + + ;;vaddy.z vf7, vf0, vf11 + (.add.y.vf vf7 vf0 vf11 :mask #b0100) + + ;;vaddz.x vf8, vf0, vf11 + (.add.z.vf vf8 vf0 vf11 :mask #b0001) + + ;;vsubx.z vf8, vf0, vf11 + (.sub.x.vf vf8 vf0 vf11 :mask #b0100) + + ;;vmulx.xyz vf2, vf10, vf1 + (.mul.x.vf vf2 vf10 vf1 :mask #b0111) + + ;;vmuly.xyz vf3, vf10, vf1 + (.mul.y.vf vf3 vf10 vf1 :mask #b0111) + + ;;vmulz.xyz vf4, vf10, vf1 + (.mul.z.vf vf4 vf10 vf1 :mask #b0111) + + ;;vsuby.x vf9, vf0, vf11 + (.sub.y.vf vf9 vf0 vf11 :mask #b0001) + + ;;vaddx.y vf9, vf0, vf11 + (.add.x.vf vf9 vf0 vf11 :mask #b0010) + + ;;vadd.xyz vf2, vf2, vf7 + (.add.vf vf2 vf2 vf7 :mask #b0111) + + ;;vadd.xyz vf3, vf3, vf8 + (.add.vf vf3 vf3 vf8 :mask #b0111) + + ;;vadd.xyz vf4, vf4, vf9 + (.add.vf vf4 vf4 vf9 :mask #b0111) + + ;;sqc2 vf2, 0(v0) + ;;sqc2 vf3, 16(v0) + ;;sqc2 vf0, 48(v0) + ;;sqc2 vf4, 32(v0) + (.svf (-> dst vector 0) vf2) + (.svf (-> dst vector 1) vf3) + (.svf (-> dst vector 3) vf0) + (.svf (-> dst vector 2) vf4) + (goto end) + (label zero-case) + ;; overly clever way to set identity matrix + ;;lui v1, 16256 + ;;sqc2 vf0, 48(v0) + ;;pcpyld v1, r0, v1 + ;;mfc1 r0, f31 + ;;prot3w a0, v1 + ;;mfc1 r0, f31 + ;;prot3w a1, a0 + ;;sq v1, 0(v0) + ;;sll r0, r0, 0 + ;;sq a0, 32(v0) + ;;sll r0, r0, 0 + ;;sq a1, 16(v0) + (matrix-identity! dst) + (label end) + ) + dst + ) + +(defun matrix-axis-angle! ((arg0 matrix) (arg1 vector) (arg2 float)) + "Create an axis-angle rotation matrix." + (matrix-axis-sin-cos! arg0 arg1 (sin arg2) (cos arg2)) + (none) + ) + +(defun matrix-lerp! ((arg0 matrix) (arg1 matrix) (arg2 matrix) (arg3 float)) + "Lerp an entire matrix, coefficient-wise." + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.mov vf9 arg3) + (.lvf vf1 (&-> arg1 quad 0)) + (.lvf vf2 (&-> arg1 quad 1)) + (.lvf vf3 (&-> arg1 quad 2)) + (.lvf vf4 (&-> arg1 trans quad)) + (.lvf vf5 (&-> arg2 quad 0)) + (.lvf vf6 (&-> arg2 quad 1)) + (.lvf vf7 (&-> arg2 quad 2)) + (.lvf vf8 (&-> arg2 trans quad)) + (.sub.vf vf5 vf5 vf1) + (.sub.vf vf6 vf6 vf2) + (.sub.vf vf7 vf7 vf3) + (.sub.vf vf8 vf8 vf4) + (.mul.x.vf vf5 vf5 vf9) + (.mul.x.vf vf6 vf6 vf9) + (.mul.x.vf vf7 vf7 vf9) + (.mul.x.vf vf8 vf8 vf9) + (.add.vf vf1 vf1 vf5) + (.add.vf vf2 vf2 vf6) + (.add.vf vf3 vf3 vf7) + (.add.vf vf4 vf4 vf8) + (.svf (&-> arg0 quad 0) vf1) + (.svf (&-> arg0 quad 1) vf2) + (.svf (&-> arg0 quad 2) vf3) + (.svf (&-> arg0 trans quad) vf4) + arg0 + ) + ) + +(defun matrix-3x3-determinant ((arg0 matrix)) + "Compute the determinant of a 3x3 matrix" + (let ((f8-0 (-> arg0 data 0)) + (f1-0 (-> arg0 data 1)) + (f4-0 (-> arg0 data 2)) + (f2-0 (-> arg0 data 4)) + (f5-0 (-> arg0 data 5)) + (f9-0 (-> arg0 data 6)) + (f3-0 (-> arg0 data 8)) + (f6-0 (-> arg0 data 9)) + (f0-0 (-> arg0 data 10)) + ) + (- (+ (* f8-0 f5-0 f0-0) (* f1-0 f9-0 f3-0) (* f4-0 f2-0 f6-0)) + (+ (* f8-0 f9-0 f6-0) (* f4-0 f5-0 f3-0) (* f1-0 f2-0 f0-0)) + ) + ) + ) + +(defun matrix3-determinant ((arg0 matrix)) + "Unused. Not sure if this has limitations compared to the above version." + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + ) + (.lvf vf11 (&-> arg0 quad 1)) + (.lvf vf12 (&-> arg0 quad 2)) + (.lvf vf10 (&-> arg0 quad 0)) + (.outer.product.a.vf acc vf11 vf12) + (.outer.product.b.vf vf13 vf12 vf11 acc) + (.mul.vf vf13 vf13 vf10 :mask #b111) + (.add.y.vf vf13 vf13 vf13 :mask #b1) + (.add.z.vf vf13 vf13 vf13 :mask #b1) + (.mov v0-0 vf13) + v0-0 + ) + ) + +(defun matrix-3x3-inverse! ((arg0 matrix) (arg1 matrix)) + "Compute the inverse of a 3x3 matrix. Not very efficient. + Requires src != dst." + (let ((f0-0 (matrix-3x3-determinant arg1))) + (set! (-> arg0 data 0) + (/ (- (* (-> arg1 data 5) (-> arg1 data 10)) (* (-> arg1 data 6) (-> arg1 data 9))) f0-0) + ) + (set! (-> arg0 data 4) + (/ (- (* (-> arg1 data 6) (-> arg1 data 8)) (* (-> arg1 data 4) (-> arg1 data 10))) f0-0) + ) + (set! (-> arg0 data 8) + (/ (- (* (-> arg1 data 4) (-> arg1 data 9)) (* (-> arg1 data 5) (-> arg1 data 8))) f0-0) + ) + (set! (-> arg0 data 1) + (/ (- (* (-> arg1 data 9) (-> arg1 data 2)) (* (-> arg1 data 10) (-> arg1 data 1))) f0-0) + ) + (set! (-> arg0 data 5) + (/ (- (* (-> arg1 data 10) (-> arg1 data 0)) (* (-> arg1 data 8) (-> arg1 data 2))) f0-0) + ) + (set! (-> arg0 data 9) + (/ (- (* (-> arg1 data 8) (-> arg1 data 1)) (* (-> arg1 data 9) (-> arg1 data 0))) f0-0) + ) + (set! (-> arg0 data 2) + (/ (- (* (-> arg1 data 1) (-> arg1 data 6)) (* (-> arg1 data 2) (-> arg1 data 5))) f0-0) + ) + (set! (-> arg0 data 6) + (/ (- (* (-> arg1 data 2) (-> arg1 data 4)) (* (-> arg1 data 0) (-> arg1 data 6))) f0-0) + ) + (set! (-> arg0 data 10) + (/ (- (* (-> arg1 data 0) (-> arg1 data 5)) (* (-> arg1 data 1) (-> arg1 data 4))) f0-0) + ) + ) + arg0 + ) + +(defun matrix-3x3-inverse-transpose! ((arg0 matrix) (arg1 matrix)) + "Invert and transpose. + Requires dst != src." + (let ((f0-0 (matrix-3x3-determinant arg1))) + (set! (-> arg0 data 0) + (/ (- (* (-> arg1 data 5) (-> arg1 data 10)) (* (-> arg1 data 6) (-> arg1 data 9))) f0-0) + ) + (set! (-> arg0 data 1) + (/ (- (* (-> arg1 data 6) (-> arg1 data 8)) (* (-> arg1 data 4) (-> arg1 data 10))) f0-0) + ) + (set! (-> arg0 data 2) + (/ (- (* (-> arg1 data 4) (-> arg1 data 9)) (* (-> arg1 data 5) (-> arg1 data 8))) f0-0) + ) + (set! (-> arg0 data 4) + (/ (- (* (-> arg1 data 9) (-> arg1 data 2)) (* (-> arg1 data 10) (-> arg1 data 1))) f0-0) + ) + (set! (-> arg0 data 5) + (/ (- (* (-> arg1 data 10) (-> arg1 data 0)) (* (-> arg1 data 8) (-> arg1 data 2))) f0-0) + ) + (set! (-> arg0 data 6) + (/ (- (* (-> arg1 data 8) (-> arg1 data 1)) (* (-> arg1 data 9) (-> arg1 data 0))) f0-0) + ) + (set! (-> arg0 data 8) + (/ (- (* (-> arg1 data 1) (-> arg1 data 6)) (* (-> arg1 data 2) (-> arg1 data 5))) f0-0) + ) + (set! (-> arg0 data 9) + (/ (- (* (-> arg1 data 2) (-> arg1 data 4)) (* (-> arg1 data 0) (-> arg1 data 6))) f0-0) + ) + (set! (-> arg0 data 10) + (/ (- (* (-> arg1 data 0) (-> arg1 data 5)) (* (-> arg1 data 1) (-> arg1 data 4))) f0-0) + ) + ) + arg0 + ) + +(defun matrix3-inverse-transpose! ((arg0 matrix) (arg1 matrix)) + "Unused. Not sure if this has limitations compared to other version." + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + ) + (init-vf0-vector) + (.lvf vf10 (&-> arg1 quad 0)) + (.lvf vf11 (&-> arg1 quad 1)) + (.lvf vf12 (&-> arg1 quad 2)) + (.outer.product.a.vf acc vf11 vf12) + (.outer.product.b.vf vf13 vf12 vf11 acc) + (.outer.product.a.vf acc vf12 vf10) + (.outer.product.b.vf vf14 vf10 vf12 acc) + (.mul.vf vf1 vf10 vf13 :mask #b111) + (.outer.product.a.vf acc vf10 vf11) + (.outer.product.b.vf vf15 vf11 vf10 acc) + (.nop.vf) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.div.vf Q vf0 vf1 :fsf #b11 :ftf #b0) + (.wait.vf) + (.mul.vf vf13 vf13 Q) + (.mul.vf vf14 vf14 Q) + (.mul.vf vf15 vf15 Q) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad 0) vf13) + (.svf (&-> arg0 quad 1) vf14) + (.svf (&-> arg0 quad 2) vf15) + arg0 + ) + ) + +(defun matrix-3x3-normalize! ((arg0 matrix) (arg1 matrix)) + "Unused." + (/ 0 0) + arg0 + #| + (local-vars (f0-1 float) (f0-2 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + ) + (init-vf0-vector) + (let ((f2-0 (-> arg1 data 0)) + (f0-0 (-> arg1 data 1)) + (f1-0 (-> arg1 data 2)) + (v1-0 #x3f800000) + ) + (.lvf vf10 (&-> arg1 quad 0)) + (.mula.s f2-0 f2-0) + (.lvf vf11 (&-> arg1 quad 1)) + (let ((f2-1 (gpr->fpr v1-0))) + (.lvf vf12 (&-> arg1 quad 2)) + (.madda.s f0-0 f0-0) + (.sub.w.vf vf13 vf0 vf0 :mask #b1000) + (.madd.s f0-1 f1-0 f1-0) + (.sub.w.vf vf14 vf0 vf0 :mask #b1000) + (.rsqrt.s f0-2 f2-1 f0-1) + ) + ) + (.sub.w.vf vf15 vf0 vf0 :mask #b1000) + (let ((v1-1 f0-2)) + (.mov vf16 v1-1) + ) + (.mul.x.vf vf13 vf10 vf16 :mask #b111) + (.outer.product.a.vf acc vf11 vf13) + (.outer.product.b.vf vf14 vf13 vf11 acc) + (.outer.product.a.vf acc vf13 vf14) + (.outer.product.b.vf vf14 vf14 vf13 acc) + (.mul.vf vf16 vf14 vf14 :mask #b111) + (.mul.x.vf acc vf0 vf16 :mask #b1000) + (.add.mul.y.vf acc vf0 vf16 acc :mask #b1000) + (.add.mul.z.vf vf16 vf0 vf16 acc :mask #b1000) + (.isqrt.vf Q vf0 vf16 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf14 vf14 Q :mask #b111) + (.outer.product.a.vf acc vf13 vf14) + (.outer.product.b.vf vf15 vf14 vf13 acc) + (.svf (&-> arg0 quad 0) vf13) + (.svf (&-> arg0 quad 1) vf14) + (.svf (&-> arg0 quad 2) vf15) + arg0 + ) + |# + ) + +(defun matrix-4x4-determinant ((arg0 matrix)) + "Take the determinant of a 4x4 matrix, but this is wrong." + (let ((f15-0 (-> arg0 data 0)) + (f14-0 (-> arg0 data 1)) + (f10-0 (-> arg0 data 2)) + (f2-0 (-> arg0 data 3)) + (f9-0 (-> arg0 data 4)) + (f6-0 (-> arg0 data 5)) + (f3-0 (-> arg0 data 6)) + (f11-0 (-> arg0 data 7)) + (f5-0 (-> arg0 data 8)) + (f1-0 (-> arg0 data 9)) + (f8-0 (-> arg0 data 10)) + (f13-0 (-> arg0 data 11)) + (f0-0 (-> arg0 trans x)) + (f7-0 (-> arg0 trans y)) + (f4-0 (-> arg0 trans z)) + (f12-0 (-> arg0 trans w)) + ) + (- (+ (* f15-0 f6-0 f8-0 f12-0) + (* f15-0 f3-0 f13-0 f7-0) + (* f15-0 f11-0 f1-0 f4-0) + (* f14-0 f9-0 f13-0 f4-0) + (* f14-0 f3-0 f5-0 f4-0) + (* f14-0 f11-0 f8-0 f0-0) + (* f10-0 f9-0 f1-0 f12-0) + (* f10-0 f6-0 f13-0 f0-0) + (* f10-0 f11-0 f5-0 f7-0) + (* f2-0 f9-0 f1-0 f4-0) + (* f2-0 f6-0 f8-0 f0-0) + (* f2-0 f3-0 f5-0 f7-0) + ) + (+ (* f15-0 f6-0 f13-0 f4-0) + (* f15-0 f3-0 f1-0 f12-0) + (* f15-0 f11-0 f8-0 f7-0) + (* f14-0 f9-0 f8-0 f12-0) + (* f14-0 f3-0 f13-0 f0-0) + (* f14-0 f11-0 f5-0 f4-0) + (* f10-0 f9-0 f13-0 f7-0) + (* f10-0 f6-0 f5-0 f12-0) + (* f10-0 f11-0 f1-0 f0-0) + (* f2-0 f9-0 f8-0 f7-0) + (* f2-0 f6-0 f5-0 f4-0) + (* f2-0 f3-0 f1-0 f0-0) + ) + ) + ) + ) + +(defun matrix-4x4-inverse-transpose! ((arg0 matrix) (arg1 matrix)) + "Invert and transpose an entire 4x4. I think has no restrictions, other than dst != src. Unused. + The answer is wrong. The determinant function is wrong." + (let ((f0-0 (matrix-4x4-determinant arg1))) + (let ((f9-0 (-> arg1 data 5)) + (f2-0 (-> arg1 data 6)) + (f5-0 (-> arg1 data 7)) + (f3-0 (-> arg1 data 9)) + (f6-0 (-> arg1 data 10)) + (f10-0 (-> arg1 data 11)) + (f4-0 (-> arg1 trans y)) + (f7-0 (-> arg1 trans z)) + (f1-0 (-> arg1 trans w)) + ) + (set! (-> arg0 data 0) (/ (- (+ (* f9-0 f6-0 f1-0) (* f2-0 f10-0 f4-0) (* f5-0 f3-0 f7-0)) + (+ (* f9-0 f10-0 f7-0) (* f5-0 f6-0 f4-0) (* f2-0 f3-0 f1-0)) + ) + f0-0 + ) + ) + ) + (let ((f9-2 (-> arg1 data 4)) + (f2-2 (-> arg1 data 6)) + (f5-2 (-> arg1 data 7)) + (f3-1 (-> arg1 data 8)) + (f6-1 (-> arg1 data 10)) + (f10-1 (-> arg1 data 11)) + (f4-3 (-> arg1 trans x)) + (f7-2 (-> arg1 trans z)) + (f1-6 (-> arg1 trans w)) + ) + (set! (-> arg0 data 1) (- (/ (- (+ (* f9-2 f6-1 f1-6) (* f2-2 f10-1 f4-3) (* f5-2 f3-1 f7-2)) + (+ (* f9-2 f10-1 f7-2) (* f5-2 f6-1 f4-3) (* f2-2 f3-1 f1-6)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-4 (-> arg1 data 4)) + (f2-4 (-> arg1 data 5)) + (f5-4 (-> arg1 data 7)) + (f3-2 (-> arg1 data 8)) + (f6-2 (-> arg1 data 9)) + (f10-2 (-> arg1 data 11)) + (f4-6 (-> arg1 trans x)) + (f7-4 (-> arg1 trans y)) + (f1-13 (-> arg1 trans w)) + ) + (set! (-> arg0 data 2) (/ (- (+ (* f9-4 f6-2 f1-13) (* f2-4 f10-2 f4-6) (* f5-4 f3-2 f7-4)) + (+ (* f9-4 f10-2 f7-4) (* f5-4 f6-2 f4-6) (* f2-4 f3-2 f1-13)) + ) + f0-0 + ) + ) + ) + (let ((f9-6 (-> arg1 data 4)) + (f2-6 (-> arg1 data 5)) + (f5-6 (-> arg1 data 6)) + (f3-3 (-> arg1 data 8)) + (f6-3 (-> arg1 data 9)) + (f10-3 (-> arg1 data 10)) + (f4-9 (-> arg1 trans x)) + (f7-6 (-> arg1 trans y)) + (f1-19 (-> arg1 trans z)) + ) + (set! (-> arg0 data 3) (- (/ (- (+ (* f9-6 f6-3 f1-19) (* f2-6 f10-3 f4-9) (* f5-6 f3-3 f7-6)) + (+ (* f9-6 f10-3 f7-6) (* f5-6 f6-3 f4-9) (* f2-6 f3-3 f1-19)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-8 (-> arg1 data 1)) + (f2-8 (-> arg1 data 2)) + (f5-8 (-> arg1 data 3)) + (f3-4 (-> arg1 data 9)) + (f6-4 (-> arg1 data 10)) + (f10-4 (-> arg1 data 11)) + (f4-12 (-> arg1 trans y)) + (f7-8 (-> arg1 trans z)) + (f1-26 (-> arg1 trans w)) + ) + (set! (-> arg0 data 4) (- (/ (- (+ (* f9-8 f6-4 f1-26) (* f2-8 f10-4 f4-12) (* f5-8 f3-4 f7-8)) + (+ (* f9-8 f10-4 f7-8) (* f5-8 f6-4 f4-12) (* f2-8 f3-4 f1-26)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-10 (-> arg1 data 0)) + (f2-10 (-> arg1 data 2)) + (f5-10 (-> arg1 data 3)) + (f3-5 (-> arg1 data 8)) + (f6-5 (-> arg1 data 10)) + (f10-5 (-> arg1 data 11)) + (f4-15 (-> arg1 trans x)) + (f7-10 (-> arg1 trans z)) + (f1-33 (-> arg1 trans w)) + ) + (set! (-> arg0 data 5) (/ (- (+ (* f9-10 f6-5 f1-33) (* f2-10 f10-5 f4-15) (* f5-10 f3-5 f7-10)) + (+ (* f9-10 f10-5 f7-10) (* f5-10 f6-5 f4-15) (* f2-10 f3-5 f1-33)) + ) + f0-0 + ) + ) + ) + (let ((f9-12 (-> arg1 data 0)) + (f2-12 (-> arg1 data 1)) + (f5-12 (-> arg1 data 3)) + (f3-6 (-> arg1 data 8)) + (f6-6 (-> arg1 data 9)) + (f10-6 (-> arg1 data 11)) + (f4-18 (-> arg1 trans x)) + (f7-12 (-> arg1 trans y)) + (f1-39 (-> arg1 trans w)) + ) + (set! (-> arg0 data 6) (- (/ (- (+ (* f9-12 f6-6 f1-39) (* f2-12 f10-6 f4-18) (* f5-12 f3-6 f7-12)) + (+ (* f9-12 f10-6 f7-12) (* f5-12 f6-6 f4-18) (* f2-12 f3-6 f1-39)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-14 (-> arg1 data 0)) + (f2-14 (-> arg1 data 1)) + (f5-14 (-> arg1 data 2)) + (f3-7 (-> arg1 data 8)) + (f6-7 (-> arg1 data 9)) + (f10-7 (-> arg1 data 10)) + (f4-21 (-> arg1 trans x)) + (f7-14 (-> arg1 trans y)) + (f1-46 (-> arg1 trans z)) + ) + (set! (-> arg0 data 7) (/ (- (+ (* f9-14 f6-7 f1-46) (* f2-14 f10-7 f4-21) (* f5-14 f3-7 f7-14)) + (+ (* f9-14 f10-7 f7-14) (* f5-14 f6-7 f4-21) (* f2-14 f3-7 f1-46)) + ) + f0-0 + ) + ) + ) + (let ((f9-16 (-> arg1 data 1)) + (f2-16 (-> arg1 data 2)) + (f5-16 (-> arg1 data 3)) + (f3-8 (-> arg1 data 5)) + (f6-8 (-> arg1 data 6)) + (f10-8 (-> arg1 data 7)) + (f4-24 (-> arg1 trans y)) + (f7-16 (-> arg1 trans z)) + (f1-52 (-> arg1 trans w)) + ) + (set! (-> arg0 data 8) (/ (- (+ (* f9-16 f6-8 f1-52) (* f2-16 f10-8 f4-24) (* f5-16 f3-8 f7-16)) + (+ (* f9-16 f10-8 f7-16) (* f5-16 f6-8 f4-24) (* f2-16 f3-8 f1-52)) + ) + f0-0 + ) + ) + ) + (let ((f9-18 (-> arg1 data 0)) + (f2-18 (-> arg1 data 2)) + (f5-18 (-> arg1 data 3)) + (f3-9 (-> arg1 data 4)) + (f6-9 (-> arg1 data 6)) + (f10-9 (-> arg1 data 7)) + (f4-27 (-> arg1 trans x)) + (f7-18 (-> arg1 trans z)) + (f1-58 (-> arg1 trans w)) + ) + (set! (-> arg0 data 9) (- (/ (- (+ (* f9-18 f6-9 f1-58) (* f2-18 f10-9 f4-27) (* f5-18 f3-9 f7-18)) + (+ (* f9-18 f10-9 f7-18) (* f5-18 f6-9 f4-27) (* f2-18 f3-9 f1-58)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-20 (-> arg1 data 0)) + (f2-20 (-> arg1 data 1)) + (f5-20 (-> arg1 data 3)) + (f3-10 (-> arg1 data 4)) + (f6-10 (-> arg1 data 5)) + (f10-10 (-> arg1 data 7)) + (f4-30 (-> arg1 trans x)) + (f7-20 (-> arg1 trans y)) + (f1-65 (-> arg1 trans w)) + ) + (set! (-> arg0 data 10) (/ (- (+ (* f9-20 f6-10 f1-65) (* f2-20 f10-10 f4-30) (* f5-20 f3-10 f7-20)) + (+ (* f9-20 f10-10 f7-20) (* f5-20 f6-10 f4-30) (* f2-20 f3-10 f1-65)) + ) + f0-0 + ) + ) + ) + (let ((f9-22 (-> arg1 data 0)) + (f2-22 (-> arg1 data 1)) + (f5-22 (-> arg1 data 2)) + (f3-11 (-> arg1 data 4)) + (f6-11 (-> arg1 data 5)) + (f10-11 (-> arg1 data 6)) + (f4-33 (-> arg1 trans x)) + (f7-22 (-> arg1 trans y)) + (f1-71 (-> arg1 trans z)) + ) + (set! (-> arg0 data 11) (- (/ (- (+ (* f9-22 f6-11 f1-71) (* f2-22 f10-11 f4-33) (* f5-22 f3-11 f7-22)) + (+ (* f9-22 f10-11 f7-22) (* f5-22 f6-11 f4-33) (* f2-22 f3-11 f1-71)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-24 (-> arg1 data 1)) + (f2-24 (-> arg1 data 2)) + (f5-24 (-> arg1 data 3)) + (f3-12 (-> arg1 data 5)) + (f6-12 (-> arg1 data 6)) + (f10-12 (-> arg1 data 7)) + (f4-36 (-> arg1 data 9)) + (f7-24 (-> arg1 data 10)) + (f1-78 (-> arg1 data 11)) + ) + (set! (-> arg0 trans x) (- (/ (- (+ (* f9-24 f6-12 f1-78) (* f2-24 f10-12 f4-36) (* f5-24 f3-12 f7-24)) + (+ (* f9-24 f10-12 f7-24) (* f5-24 f6-12 f4-36) (* f2-24 f3-12 f1-78)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-26 (-> arg1 data 0)) + (f2-26 (-> arg1 data 2)) + (f5-26 (-> arg1 data 3)) + (f3-13 (-> arg1 data 4)) + (f6-13 (-> arg1 data 6)) + (f10-13 (-> arg1 data 7)) + (f4-39 (-> arg1 data 8)) + (f7-26 (-> arg1 data 10)) + (f1-85 (-> arg1 data 11)) + ) + (set! (-> arg0 trans y) (/ (- (+ (* f9-26 f6-13 f1-85) (* f2-26 f10-13 f4-39) (* f5-26 f3-13 f7-26)) + (+ (* f9-26 f10-13 f7-26) (* f5-26 f6-13 f4-39) (* f2-26 f3-13 f1-85)) + ) + f0-0 + ) + ) + ) + (let ((f9-28 (-> arg1 data 0)) + (f2-28 (-> arg1 data 1)) + (f5-28 (-> arg1 data 3)) + (f3-14 (-> arg1 data 4)) + (f6-14 (-> arg1 data 5)) + (f10-14 (-> arg1 data 7)) + (f4-42 (-> arg1 data 8)) + (f7-28 (-> arg1 data 9)) + (f1-91 (-> arg1 data 11)) + ) + (set! (-> arg0 trans z) (- (/ (- (+ (* f9-28 f6-14 f1-91) (* f2-28 f10-14 f4-42) (* f5-28 f3-14 f7-28)) + (+ (* f9-28 f10-14 f7-28) (* f5-28 f6-14 f4-42) (* f2-28 f3-14 f1-91)) + ) + f0-0 + ) + ) + ) + ) + (let ((f8-60 (-> arg1 data 0)) + (f1-98 (-> arg1 data 1)) + (f5-30 (-> arg1 data 2)) + (f2-30 (-> arg1 data 4)) + (f6-15 (-> arg1 data 5)) + (f9-30 (-> arg1 data 6)) + (f4-45 (-> arg1 data 8)) + (f7-30 (-> arg1 data 9)) + (f3-15 (-> arg1 data 10)) + ) + (set! (-> arg0 trans w) (/ (- (+ (* f8-60 f6-15 f3-15) (* f1-98 f9-30 f4-45) (* f5-30 f2-30 f7-30)) + (+ (* f8-60 f9-30 f7-30) (* f5-30 f6-15 f4-45) (* f1-98 f2-30 f3-15)) + ) + f0-0 + ) + ) + ) + ) + arg0 + ) + +(defun matrix-y-angle ((arg0 matrix)) + "If mat has its upper 3x3 as a rotation, gets the y axis rotation." + + (let ((v1-0 (&-> arg0 data 8))) + (atan (-> v1-0 0) (-> v1-0 2)) + ) + ) + +(defun matrix->trans ((arg0 matrix) (arg1 vector)) + "Multiply xyz by 1/w." + (rlet ((Q :class vf) + (vf0 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 trans quad)) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf2 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> arg1 quad) vf2) + arg1 + ) + ) + +(defun matrix<-trans ((arg0 matrix) (arg1 vector)) + "Set the translation." + (set! (-> arg0 trans quad) (-> arg1 quad)) + arg0 + ) + +(defun matrix->scale ((arg0 matrix) (arg1 vector)) + "Get the scale of a matrix." + (set! (-> arg1 x) (vector-length (the-as vector (-> arg0 data)))) + (set! (-> arg1 y) (vector-length (the-as vector (&-> arg0 data 4)))) + (set! (-> arg1 z) (vector-length (the-as vector (&-> arg0 data 8)))) + (set! (-> arg1 w) 1.0) + arg1 + ) + +(defun matrix<-scale ((arg0 matrix) (arg1 vector)) + "Set the scale of a matrix by rescaling." + (vector-normalize! (the-as vector (-> arg0 data)) (-> arg1 x)) + (vector-normalize! (the-as vector (&-> arg0 data 4)) (-> arg1 y)) + (vector-normalize! (the-as vector (&-> arg0 data 8)) (-> arg1 z)) + arg0 + ) + +(defun matrix->quat ((arg0 matrix) (arg1 quaternion)) + "Convert matrix to quaternion, works for matrix with scale. + unlike matrix->quaternion." + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 arg0) + (v1-0 (-> a2-0 quad 0)) + (a0-1 (-> a2-0 quad 1)) + (a1-1 (-> a2-0 quad 2)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 quad 0) v1-0) + (set! (-> s5-0 quad 1) a0-1) + (set! (-> s5-0 quad 2) a1-1) + (set! (-> s5-0 trans quad) a2-1) + ) + (vector-reset! (-> s5-0 trans)) + (vector-normalize! (the-as vector (-> s5-0 data)) 1.0) + (vector-normalize! (the-as vector (&-> s5-0 data 4)) 1.0) + (vector-normalize! (the-as vector (&-> s5-0 data 8)) 1.0) + (matrix->quaternion arg1 s5-0) + ) + ) + +(defun matrix<-quat ((arg0 matrix) (arg1 quaternion)) + "Modify the rotation part of a transform." + (let ((s5-0 (matrix->scale arg0 (new 'stack-no-clear 'vector))) + (s4-1 (quaternion->matrix (new 'stack-no-clear 'matrix) arg1)) + ) + (vector-normalize-copy! (the-as vector (-> arg0 data)) (the-as vector (-> s4-1 data)) (-> s5-0 x)) + (vector-normalize-copy! (the-as vector (&-> arg0 data 4)) (the-as vector (&-> s4-1 data 4)) (-> s5-0 y)) + (vector-normalize-copy! (the-as vector (&-> arg0 data 8)) (the-as vector (&-> s4-1 data 8)) (-> s5-0 z)) + ) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 11) 0.0) + arg0 + ) + +(defun matrix->transformq ((arg0 transformq) (arg1 matrix)) + "Create a transformq from a matrix. Allowing scale, etc." + (rlet ((Q :class vf) + (vf0 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg1 trans quad)) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf2 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> arg0 trans quad) vf2) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 arg1) + (v1-0 (-> a2-0 quad 0)) + (a0-1 (-> a2-0 quad 1)) + (a1-1 (-> a2-0 quad 2)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s4-0 quad 0) v1-0) + (set! (-> s4-0 quad 1) a0-1) + (set! (-> s4-0 quad 2) a1-1) + (set! (-> s4-0 trans quad) a2-1) + ) + (vector-normalize! (the-as vector (-> s4-0 data)) 1.0) + (vector-normalize! (the-as vector (&-> s4-0 data 4)) 1.0) + (vector-normalize! (the-as vector (&-> s4-0 data 8)) 1.0) + (vector-cross! + (the-as vector (&-> s4-0 data 8)) + (the-as vector (-> s4-0 data)) + (the-as vector (&-> s4-0 data 4)) + ) + (vector-cross! + (the-as vector (&-> s4-0 data 4)) + (the-as vector (&-> s4-0 data 8)) + (the-as vector (-> s4-0 data)) + ) + (matrix->quaternion (-> arg0 quat) s4-0) + ) + (set-vector! + (-> arg0 scale) + (vector-length (the-as vector (-> arg1 data))) + (vector-length (the-as vector (&-> arg1 data 4))) + (vector-length (the-as vector (&-> arg1 data 8))) + 1.0 + ) + arg0 + ) + ) + +(defmethod transform-vectors! matrix ((obj _type_) (dst (inline-array vector)) (src (inline-array vector)) (count int)) + "Transform many vectors. This acts like w = 1, even if it isn't. The value of w is copied." + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (acc :class vf) + (v1 :type int) + ) + (init-vf0-vector) + + ;; blez a3, L3 + (when-goto (<= count 0) end) + + ;; lqc2 vf1, 0(a0) + (.lvf vf1 (-> obj vector 0)) + + ;; lqc2 vf2, 16(a0) + (.lvf vf2 (-> obj vector 1)) + + ;; lqc2 vf3, 32(a0) + (.lvf vf3 (-> obj vector 2)) + + ;; lqc2 vf4, 48(a0) + (.lvf vf4 (-> obj vector 3)) + + ;; lqc2 vf5, 0(a2) + (.lvf vf5 (-> src 0)) + + ;; lqc2 vf6, 16(a2) + (.lvf vf6 (-> src 1)) + + (label loop-top) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;vmulaw.xyzw acc, vf4, vf0 + (.mul.w.vf acc vf4 vf0) + + ;; lqc2 vf7, 32(a2) + (.lvf vf7 (-> src 2)) + + ;;vmaddax.xyzw acc, vf1, vf5 + (.add.mul.x.vf acc vf1 vf5 acc) + + ;;lqc2 vf8, 48(a2) + (.lvf vf8 (-> src 3)) + + ;;vmadday.xyzw acc, vf2, vf5 + (.add.mul.y.vf acc vf2 vf5 acc) + + ;;daddiu a2, a2, 64 + ;;(&+! src 64) + (set! src (the (inline-array vector) (+ 64 (the int src)))) + + ;;vmaddz.xyz vf5, vf3, vf5 + (.add.mul.z.vf vf5 vf3 vf5 acc :mask #b0111) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;;daddiu v1, a3, -1 + (set! v1 (- count 1)) + + ;;vmulaw.xyzw acc, vf4, vf0 + (.mul.w.vf acc vf4 vf0) + + ;;vmaddax.xyzw acc, vf1, vf6 + (.add.mul.x.vf acc vf1 vf6 acc) + + ;; vmadday.xyzw acc, vf2, vf6 + (.add.mul.y.vf acc vf2 vf6 acc) + + ;; vmaddz.xyz vf6, vf3, vf6 + (.add.mul.z.vf vf6 vf3 vf6 acc :mask #b0111) + + ;;sqc2 vf5, 0(a1) + (.svf (-> dst 0) vf5) + + ;;beq v1, r0, L3 + ;;vmulaw.xyzw acc, vf4, vf0 + (.mul.w.vf acc vf4 vf0) + (when-goto (zero? v1) end) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + ;;vmaddax.xyzw acc, vf1, vf7 + (.add.mul.x.vf acc vf1 vf7 acc) + ;;daddiu v1, v1, -1 + (+! v1 -1) + ;;vmadday.xyzw acc, vf2, vf7 + (.add.mul.y.vf acc vf2 vf7 acc) + ;;lqc2 vf5, 0(a2) + (.lvf vf5 (-> src 0)) + ;;vmaddz.xyz vf7, vf3, vf7 + (.add.mul.z.vf vf7 vf3 vf7 acc :mask #b0111) + ;;sqc2 vf6, 16(a1) + (.svf (-> dst 1) vf6) + + ;;beq v1, r0, L3 + ;;vmulaw.xyzw acc, vf4, vf0 + (.mul.w.vf acc vf4 vf0) + (when-goto (zero? v1) end) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;;vmaddax.xyzw acc, vf1, vf8 + (.add.mul.x.vf acc vf1 vf8 acc) + ;;daddiu v1, v1, -1 + (+! v1 -1) + ;;vmadday.xyzw acc, vf2, vf8 + (.add.mul.y.vf acc vf2 vf8 acc) + ;;lqc2 vf6, 16(a2) + (.lvf vf6 (-> src 1)) + ;;vmaddz.xyz vf8, vf3, vf8 + (.add.mul.z.vf vf8 vf3 vf8 acc :mask #b0111) + ;;sqc2 vf7, 32(a1) + (.svf (-> dst 2) vf7) + + ;;beq v1, r0, L3 + ;;daddiu a1, a1, 64 + ;;(&!+ dst 64) + (set! dst (the (inline-array vector) (+ 64 (the int dst)))) + (when-goto (zero? v1) end) + + ;;daddiu a3, v1, -1 + (set! count (- v1 1)) + ;;sqc2 vf8, -16(a1) + (.svf dst vf8 :offset -16) + (when-goto (not (zero? count)) loop-top) + (label end) + (none) + ) + ) + + +(defun matrix-mirror! ((arg0 matrix) (arg1 vector) (arg2 vector)) + "Make a matrix that mirrors. Arguments are unclear." + (let ((f10-0 -2.0) + (f0-0 1.0) + ) + (let* ((f1-0 0.0) + (f9-0 (-> arg2 x)) + (f12-0 (-> arg2 y)) + (f11-0 (-> arg2 z)) + (f6-0 (-> arg1 x)) + (f5-0 (-> arg1 y)) + (f2-0 (-> arg1 z)) + (f3-2 (+ f0-0 (* f10-0 f9-0 f9-0))) + (f4-2 (+ f0-0 (* f10-0 f12-0 f12-0))) + (f7-2 (+ f0-0 (* f10-0 f11-0 f11-0))) + (f8-1 (* f10-0 f9-0 f12-0)) + (f9-2 (* f10-0 f9-0 f11-0)) + (f10-2 (* f10-0 f12-0 f11-0)) + (f11-4 (- f6-0 (+ (* f6-0 f3-2) (* f5-0 f8-1) (* f2-0 f9-2)))) + (f12-6 (- f5-0 (+ (* f6-0 f8-1) (* f5-0 f4-2) (* f2-0 f10-2)))) + (f2-1 (- f2-0 (+ (* f6-0 f9-2) (* f5-0 f10-2) (* f2-0 f7-2)))) + ) + (set! (-> arg0 data 0) f3-2) + (set! (-> arg0 data 1) f8-1) + (set! (-> arg0 data 2) f9-2) + (set! (-> arg0 data 3) f1-0) + (set! (-> arg0 data 4) f8-1) + (set! (-> arg0 data 5) f4-2) + (set! (-> arg0 data 6) f10-2) + (set! (-> arg0 data 7) f1-0) + (set! (-> arg0 data 8) f9-2) + (set! (-> arg0 data 9) f10-2) + (set! (-> arg0 data 10) f7-2) + (set! (-> arg0 data 11) f1-0) + (set! (-> arg0 trans x) f11-4) + (set! (-> arg0 trans y) f12-6) + (set! (-> arg0 trans z) f2-1) + ) + (set! (-> arg0 trans w) f0-0) + ) + arg0 + ) + + + + diff --git a/goal_src/jak2/engine/math/quaternion-h.gc b/goal_src/jak2/engine/math/quaternion-h.gc index f642c95452..2512b82764 100644 --- a/goal_src/jak2/engine/math/quaternion-h.gc +++ b/goal_src/jak2/engine/math/quaternion-h.gc @@ -7,3 +7,35 @@ ;; DECOMP BEGINS +;; quaternion, stored in xyzw order. +(deftype quaternion (structure) + ((data float 4 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (w float :offset 12) + (vec vector :inline :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(define *unity-quaternion* (new 'static 'quaternion :w 1.0)) + +(define-extern vector-y-angle (function vector float)) +(define-extern quaternion->matrix (function matrix quaternion matrix)) +(define-extern matrix->quaternion (function quaternion matrix quaternion)) +(define-extern quaternion-normalize! (function quaternion quaternion)) + + +(defmacro new-stack-quaternion0 () + "Get a stack quaternion that's set to 0. + This is more efficient than (new 'stack 'quaternion) because + this doesn't call the constructor." + `(let ((q (new 'stack-no-clear 'quaternion))) + (set! (-> q quad) (the-as uint128 0)) + q + ) + ) diff --git a/goal_src/jak2/engine/math/quaternion.gc b/goal_src/jak2/engine/math/quaternion.gc index d5626c3b36..3a097171f2 100644 --- a/goal_src/jak2/engine/math/quaternion.gc +++ b/goal_src/jak2/engine/math/quaternion.gc @@ -7,3 +7,1061 @@ ;; DECOMP BEGINS +(defmethod inspect quaternion ((obj quaternion)) + "Print a quaternion. Prints the values and axis-angle" + (format #t "[~8x] quaternion~%" obj) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) + (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> obj x) (-> obj x)) (* (-> obj y) (-> obj y)) (* (-> obj z) (-> obj z))))))) + (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> obj x)) (* f0-5 (-> obj y)) (* f0-5 (-> obj z))) + ) + (let ((f0-9 (* 2.0 (acos (-> obj w))))) + (format #t "~T~Tangle: (deg ~R)~%" f0-9) + ) + obj + ) + +(defun quaternion-axis-angle! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Construct a quaternion from an axis and angle. The axis should be normalized." + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos! (the-as (pointer float) s5-0) (* 0.5 arg4)) + (let ((f0-2 (-> s5-0 x))) + (set! (-> arg0 x) (* arg1 f0-2)) + (set! (-> arg0 y) (* arg2 f0-2)) + (set! (-> arg0 z) (* arg3 f0-2)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + arg0 + ) + +(defun quaternion-vector-angle! ((arg0 quaternion) (arg1 vector) (arg2 float)) + "Construct a quaternion from an axis and angle. The axis should be normalized." + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos! (the-as (pointer float) s5-0) (* 0.5 arg2)) + (let ((f0-2 (-> s5-0 x))) + (set! (-> arg0 x) (* (-> arg1 x) f0-2)) + (set! (-> arg0 y) (* (-> arg1 y) f0-2)) + (set! (-> arg0 z) (* (-> arg1 z) f0-2)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + arg0 + ) + +(defun vector-angle<-quaternion! ((arg0 vector) (arg1 quaternion)) + "Convert the quaternion arg1 to axis-angle form and store in arg0 (angle goes in w)" + (let* ((f0-0 1.0) + (f1-0 1.0) + (f2-0 (-> arg1 w)) + (f30-0 (/ f0-0 (sqrtf (- f1-0 (* f2-0 f2-0))))) + (f0-3 (* 2.0 (acos-rad (-> arg1 w)))) + ) + (set! (-> arg0 x) (* (-> arg1 x) f30-0)) + (set! (-> arg0 y) (* (-> arg1 y) f30-0)) + (set! (-> arg0 z) (* (-> arg1 z) f30-0)) + (set! (-> arg0 w) f0-3) + ) + arg0 + ) + +(defun quaternion-look-at! ((arg0 quaternion) (arg1 vector) (arg2 vector)) + "Look along arg1, with arg2 as up." + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (vector-cross! (the-as vector (-> s5-0 data)) arg2 arg1) + (vector-cross! (the-as vector (&-> s5-0 data 4)) arg1 (the-as vector (-> s5-0 data))) + (set! (-> (the-as vector (&-> s5-0 data 8)) quad) (-> arg1 quad)) + (quaternion-normalize! (matrix->quaternion arg0 s5-0)) + ) + ) + +(defun quaternion-zero! ((arg0 quaternion)) + "Set quaternion to all 0's" + (set! (-> arg0 vec quad) (the-as uint128 0)) + arg0 + ) + +(defun quaternion-identity! ((arg0 quaternion)) + "Set quaternion to 0,0,0,1 (identity)" + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 w) 1.0) + arg0 + ) + +(defun quaternion-i! ((arg0 quaternion)) + "Create unit i quaternion" + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 x) 1.0) + arg0 + ) + +(defun quaternion-j! ((arg0 quaternion)) + "Create unit j quaternion." + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 y) 1.0) + arg0 + ) + +(defun quaternion-k! ((arg0 quaternion)) + "Create unit k quaternion" + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 z) 1.0) + arg0 + ) + +(defun quaternion-copy! ((arg0 quaternion) (arg1 quaternion)) + "Set arg0 = arg1" + (set! (-> arg0 vec quad) (-> arg1 vec quad)) + arg0 + ) + +(defun quaternion-set! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Set arg0 = [arg1, arg2, arg3, arg4]" + (set! (-> arg0 x) arg1) + (set! (-> arg0 y) arg2) + (set! (-> arg0 z) arg3) + (set! (-> arg0 w) arg4) + arg0 + ) + +(defun quaternion+! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion)) + "Add quaternions as vectors." + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.lvf vf2 (&-> arg2 vec quad)) + (.add.vf vf1 vf1 vf2) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +(defun quaternion-! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion)) + "Subtract quaternions as vectors." + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.lvf vf2 (&-> arg2 vec quad)) + (.sub.vf vf1 vf1 vf2) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +(defun quaternion-negate! ((arg0 quaternion) (arg1 quaternion)) + "Set arg0 = -arg1." + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + ;;(.sub.vf vf2 vf2 vf2) + (.xor.vf vf2 vf2 vf2) + (.sub.vf vf1 vf2 vf1) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +(defun quaternion-conjugate! ((arg0 quaternion) (arg1 quaternion)) + "Set arg0 to the conjugate of arg1 (negate only ijk). + If arg1 is normalized, this is equivalent to the inverse + NOTE: this gives you the inverse rotation." + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + ;; (.sub.vf vf2 vf2 vf2) + (.xor.vf vf2 vf2 vf2) + (.sub.vf vf2 vf2 vf1 :mask #b111) + (.add.vf vf2 vf2 vf1 :mask #b1000) + (.svf (&-> arg0 vec quad) vf2) + arg0 + ) + ) + +(defun quaternion-float*! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Multiply each element" + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.mov vf2 arg2) + (.mul.x.vf vf1 vf1 vf2) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +(defun quaternion-float/! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Divide each element" + (let ((f0-1 (/ 1.0 arg2))) + (quaternion-float*! arg0 arg1 f0-1) + ) + arg0 + ) + +(defun quaternion-norm2 ((arg0 quaternion)) + "Get the squared norm of a quaternion" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf acc vf1 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.x.vf vf1 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf1 vf0 vf1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun quaternion-norm ((arg0 quaternion)) + "Get the norm of a quaternion." + (local-vars (v1-1 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf acc vf1 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.x.vf vf1 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf1 vf0 vf1) + (.mov v1-1 vf1) + (sqrtf v1-1) + ) + ) + +(defun quaternion-normalize! ((arg0 quaternion)) + "Normalize a quaternion" + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.mul.vf vf2 vf1 vf1) + (.add.z.vf acc vf2 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.x.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + ;; (.wait.vf) + (.mul.vf vf2 vf1 Q) + ;; (.nop.vf) + ;; (.nop.vf) + (.svf (&-> arg0 vec quad) vf2) + arg0 + ) + ) + +(defun quaternion-inverse! ((arg0 quaternion) (arg1 quaternion)) + "Invert a quaternion. The inverse will satisfy q * q^-1 = identity, even if q is not normalized. + If your quaternion is normalized, it is faster/more accurate to do quaternion-conjugate!" + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 vec quad)) + (.mul.vf vf2 vf1 vf1) + ;; (.sub.vf vf3 vf3 vf3) + (.xor.vf vf3 vf3 vf3) + (.add.z.vf acc vf2 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.x.vf vf2 vf0 vf2 acc :mask #b1000) + (.sub.vf vf3 vf3 vf1 :mask #b111) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.add.vf vf3 vf3 vf1 :mask #b1000) + (.wait.vf) + (.mul.vf vf3 vf3 Q) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 vec quad) vf3) + arg0 + ) + ) + +(defun quaternion-dot ((arg0 quaternion) (arg1 quaternion)) + "Treat quaternions as vectors and take the dot product." + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.lvf vf2 (&-> arg1 vec quad)) + (.mul.vf vf1 vf1 vf2) + (.add.z.vf acc vf1 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.x.vf vf1 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf1 vf0 vf1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun quaternion*! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion)) + "Real quaternion multiplication" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 vec quad)) + (.lvf vf2 (&-> arg2 vec quad)) + (.sub.vf vf4 vf0 vf0 :mask #b1000) + (.mul.vf vf3 vf1 vf2) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf4 vf2 vf1 acc) + (.mul.w.vf acc vf1 vf2) + (.add.mul.w.vf acc vf2 vf1 acc) + (.sub.mul.w.vf acc vf0 vf3 acc :mask #b1000) + (.sub.mul.z.vf acc vf0 vf3 acc :mask #b1000) + (.sub.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.sub.mul.x.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.w.vf vf1 vf4 vf0 acc) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +(defun quaternion-right-mult-matrix! ((arg0 matrix) (arg1 quaternion)) + "Place quaternion coefficients into a matrix. + You can convert a quaternion to a matrix by taking the product of this + right-mult and left-mult matrix, but this method is not used. + Instead, quaternion->matrix is a more efficient implementation." + (let ((f3-0 (-> arg1 x)) + (f2-0 (-> arg1 y)) + (f1-0 (-> arg1 z)) + (f0-0 (-> arg1 w)) + ) + (set! (-> arg0 data 0) f0-0) + (set! (-> arg0 data 1) f1-0) + (set! (-> arg0 data 2) (- f2-0)) + (set! (-> arg0 data 3) f3-0) + (set! (-> arg0 data 4) (- f1-0)) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 6) f3-0) + (set! (-> arg0 data 7) f2-0) + (set! (-> arg0 data 8) f2-0) + (set! (-> arg0 data 9) (- f3-0)) + (set! (-> arg0 data 10) f0-0) + (set! (-> arg0 data 11) f1-0) + (set! (-> arg0 trans x) (- f3-0)) + (set! (-> arg0 trans y) (- f2-0)) + (set! (-> arg0 trans z) (- f1-0)) + (set! (-> arg0 trans w) f0-0) + ) + arg0 + ) + +(defun quaternion-left-mult-matrix! ((arg0 matrix) (arg1 quaternion)) + "Place quaternion coefficients into a matrix. Unused." + (let ((f2-0 (-> arg1 x)) + (f1-0 (-> arg1 y)) + (f0-0 (-> arg1 z)) + ) + (let ((f3-0 (-> arg1 w))) + (set! (-> arg0 data 0) f2-0) + (set! (-> arg0 data 1) f3-0) + (set! (-> arg0 data 2) (- f0-0)) + (set! (-> arg0 data 3) f1-0) + (set! (-> arg0 data 4) f1-0) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 6) f3-0) + (set! (-> arg0 data 7) (- f3-0)) + (set! (-> arg0 data 8) f0-0) + (set! (-> arg0 data 9) (- f1-0)) + (set! (-> arg0 data 10) f2-0) + (set! (-> arg0 data 11) f3-0) + (set! (-> arg0 trans x) f3-0) + ) + (set! (-> arg0 trans y) (- f2-0)) + (set! (-> arg0 trans z) (- f1-0)) + (set! (-> arg0 trans w) (- f0-0)) + ) + arg0 + ) + +(defun quaternion->matrix ((arg0 matrix) (arg1 quaternion)) + "Convert quaternion to matrix." + + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 vec quad)) + (.add.vf vf5 vf1 vf1) + (.add.w.vf vf2 vf0 vf1 :mask #b1) + (.add.z.vf vf2 vf0 vf1 :mask #b10) + (.sub.y.vf vf2 vf0 vf1 :mask #b100) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (.sub.z.vf vf3 vf0 vf1 :mask #b1) + (.add.w.vf vf3 vf0 vf1 :mask #b10) + (.add.x.vf vf3 vf0 vf1 :mask #b100) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.add.y.vf vf4 vf0 vf1 :mask #b1) + (.sub.x.vf vf4 vf0 vf1 :mask #b10) + (.add.w.vf vf4 vf0 vf1 :mask #b100) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (.outer.product.a.vf acc vf5 vf2) + (.outer.product.b.vf vf2 vf2 vf5 acc) + (.outer.product.a.vf acc vf5 vf3) + (.outer.product.b.vf vf3 vf3 vf5 acc) + (.outer.product.a.vf acc vf5 vf4) + (.outer.product.b.vf vf4 vf4 vf5 acc) + (.add.w.vf vf2 vf2 vf0 :mask #b1) + (.add.w.vf vf3 vf3 vf0 :mask #b10) + (.add.w.vf vf4 vf4 vf0 :mask #b100) + (.svf (&-> arg0 trans quad) vf0) + (.svf (&-> arg0 quad 0) vf2) + (.svf (&-> arg0 quad 1) vf3) + (.svf (&-> arg0 quad 2) vf4) + arg0 + ) + ) + +(defun quaternion->matrix-2 ((arg0 matrix) (arg1 quaternion)) + "Unused alternate quaternion->matrix function." + (/ 0 0) + arg0 + ; (local-vars (v1-1 uint128) (a1-1 uint128) (a1-2 uint128) (a2-0 uint128) (a3-0 uint128)) + ; (rlet ((acc :class vf) + ; (vf0 :class vf) + ; (vf1 :class vf) + ; (vf2 :class vf) + ; (vf3 :class vf) + ; (vf4 :class vf) + ; (vf5 :class vf) + ; (vf6 :class vf) + ; (vf7 :class vf) + ; (vf8 :class vf) + ; ) + ; (init-vf0-vector) + ; (let ((v1-0 (-> arg1 vec quad))) + ; (.pexew a1-1 v1-0) + ; (.mov vf1 v1-0) + ; (.prot3w a2-0 a1-1) + ; (.pcpyud a1-2 v1-0 a1-1) + ; (.mov vf4 a2-0) + ; (let ((a2-1 #x3f800000)) + ; (.add.vf vf5 vf1 vf1) + ; (.sub.y.vf vf4 vf0 vf4 :mask #b10) + ; (.pextlw a3-0 v1-0 a1-2) + ; (.mov vf3 a1-2) + ; (.pextuw v1-1 v1-0 a3-0) + ; (.mov vf2 v1-1) + ; (set! (-> arg0 trans quad) (the-as uint128 0)) + ; (.sub.x.vf vf3 vf0 vf3 :mask #b1) + ; (set! (-> arg0 trans w) (the-as float a2-1)) + ; (.sub.z.vf vf2 vf0 vf2 :mask #b100) + ; (.outer.product.a.vf acc vf5 vf4) + ; (.outer.product.b.vf vf8 vf4 vf5 acc) + ; (.outer.product.a.vf acc vf5 vf3) + ; (.outer.product.b.vf vf7 vf3 vf5 acc) + ; (.outer.product.a.vf acc vf5 vf2) + ; (.outer.product.b.vf vf6 vf2 vf5 acc) + ; (.add.w.vf vf8 vf8 vf0 :mask #b100) + ; (.add.w.vf vf7 vf7 vf0 :mask #b10) + ; (.add.w.vf vf6 vf6 vf0 :mask #b1) + ; (.svf (&-> arg0 quad 2) vf8) + ; (set! (-> arg0 data 11) (the-as float a2-1)) + ; (.svf (&-> arg0 quad 1) vf7) + ; (set! (-> arg0 data 7) (the-as float a2-1)) + ; (.svf (&-> arg0 quad 0) vf6) + ; (set! (-> arg0 data 3) (the-as float a2-1)) + ; ) + ; ) + ; arg0 + ; ) + ) + +(defun matrix->quaternion ((arg0 quaternion) (arg1 matrix)) + "Convert a rotation matrix to a quaternion." + (let ((f0-2 (+ (-> arg1 data 0) (-> arg1 data 5) (-> arg1 data 10)))) + (cond + ((< 0.0 f0-2) + (let ((f0-4 (sqrtf (+ 1.0 f0-2)))) + (set! (-> arg0 w) (* 0.5 f0-4)) + (let ((f0-5 (/ 0.5 f0-4))) + (set! (-> arg0 x) (* f0-5 (- (-> arg1 data 6) (-> arg1 data 9)))) + (set! (-> arg0 y) (* f0-5 (- (-> arg1 data 8) (-> arg1 data 2)))) + (set! (-> arg0 z) (* f0-5 (- (-> arg1 data 1) (-> arg1 data 4)))) + ) + ) + ) + (else + (let ((a2-0 0) + (a3-0 1) + (v1-4 2) + ) + (when (< (-> arg1 data 0) (-> arg1 data 5)) + (set! a2-0 1) + (set! a3-0 2) + (set! v1-4 0) + ) + (when (< (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1)))) (-> arg1 data 10)) + (set! a2-0 2) + (set! a3-0 0) + (set! v1-4 1) + ) + (let ((f0-12 + (sqrtf + (+ (- 1.0 + (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* v1-4 4) (* v1-4 16)) (the-as int arg1)))) + ) + ) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1)))) + ) + ) + ) + ) + (set! (-> arg0 data a2-0) (* 0.5 f0-12)) + (if (!= f0-12 0.0) + (set! f0-12 (/ 0.5 f0-12)) + ) + (set! (-> arg0 w) + (* (- (-> (the-as (pointer float) (+ (+ (* v1-4 4) (* a3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* v1-4 16)) (the-as int arg1)))) + ) + f0-12 + ) + ) + (set! (-> arg0 data a3-0) + (* (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a2-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a3-0 16)) (the-as int arg1)))) + ) + f0-12 + ) + ) + (set! (-> arg0 data v1-4) + (* (+ (-> (the-as (pointer float) (+ (+ (* v1-4 4) (* a2-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* v1-4 16)) (the-as int arg1)))) + ) + f0-12 + ) + ) + ) + ) + ) + ) + ) + arg0 + ) + +(defun matrix-with-scale->quaternion ((arg0 quaternion) (arg1 matrix)) + "Convert a matrix with a rotation and scale into a quaternion (just the rotation)" + (local-vars (a1-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (let ((v1-0 (new-stack-matrix0))) + (let* ((f0-1 (vector-dot (the-as vector (-> arg1 data)) (the-as vector (-> arg1 data)))) + (f1-1 (vector-dot (the-as vector (&-> arg1 data 4)) (the-as vector (&-> arg1 data 4)))) + (f2-1 (vector-dot (the-as vector (&-> arg1 data 8)) (the-as vector (&-> arg1 data 8)))) + (f0-3 (/ 1.0 (sqrtf f0-1))) + (f1-3 (/ 1.0 (sqrtf f1-1))) + (f2-3 (/ 1.0 (sqrtf f2-1))) + ) + (.lvf vf1 (&-> arg1 quad 0)) + (.lvf vf2 (&-> arg1 quad 1)) + (.lvf vf3 (&-> arg1 quad 2)) + (.lvf vf4 (&-> arg1 trans quad)) + (let ((a1-1 f0-3)) + (.mov vf5 a1-1) + ) + (let ((a1-2 f1-3)) + (.mov vf6 a1-2) + ) + (let ((a1-3 f2-3)) + (.mov vf7 a1-3) + ) + ) + (.mul.x.vf vf1 vf1 vf5) + (.mul.x.vf vf2 vf2 vf6) + (.mul.x.vf vf3 vf3 vf7) + (.svf (&-> v1-0 quad 0) vf1) + (.svf (&-> v1-0 quad 1) vf2) + (.svf (&-> v1-0 quad 2) vf3) + (.svf (&-> v1-0 trans quad) vf4) + (.mov a1-4 vf4) + (matrix->quaternion arg0 v1-0) + ) + ) + ) + +(defun quaternion-vector-len ((arg0 quaternion)) + "Assuming quaternion is normalized, get the length of the xyz part." + (let ((f0-0 1.0) + (f1-0 (-> arg0 w)) + ) + (sqrtf (- f0-0 (* f1-0 f1-0))) + ) + ) + +(defun quaternion-log! ((arg0 quaternion) (arg1 quaternion)) + "Take the log of a quaternion. Unused." + (cond + ((= (-> arg1 w) 0.0) + (set! (-> arg0 x) (* 1.5707963 (-> arg1 x))) + (set! (-> arg0 y) (* 1.5707963 (-> arg1 y))) + (set! (-> arg0 z) (* 1.5707963 (-> arg1 z))) + ) + (else + (let* ((f30-0 (quaternion-vector-len arg1)) + (f0-9 (/ (atan2-rad (-> arg1 w) f30-0) f30-0)) + ) + (set! (-> arg0 x) (* (-> arg1 x) f0-9)) + (set! (-> arg0 y) (* (-> arg1 y) f0-9)) + (set! (-> arg0 z) (* (-> arg1 z) f0-9)) + ) + ) + ) + arg0 + ) + +(defun quaternion-exp! ((arg0 quaternion) (arg1 quaternion)) + "Quaternion exponentiation. Unused" + (let ((f30-0 (vector-length (the-as vector arg1)))) + (cond + ((= f30-0 0.0) + (set! (-> arg0 x) 0.0) + (set! (-> arg0 y) 0.0) + (set! (-> arg0 z) 0.0) + (set! (-> arg0 w) 1.0) + ) + (else + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos-rad! (the-as (pointer float) s5-0) f30-0) + (let ((f0-6 (/ (-> s5-0 x) f30-0))) + (set! (-> arg0 x) (* (-> arg1 x) f0-6)) + (set! (-> arg0 y) (* (-> arg1 y) f0-6)) + (set! (-> arg0 z) (* (-> arg1 z) f0-6)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + ) + ) + ) + arg0 + ) + +(defun quaternion-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + "Real quaternion slerp. Spherical-linear interpolation is a nice way to interpolate + between quaternions." + (local-vars (v1-15 float)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let ((f0-0 (quaternion-dot arg1 arg2)) + (f30-0 1.0) + ) + (when (< f0-0 0.0) + (set! f0-0 (- f0-0)) + (set! f30-0 -1.0) + ) + (cond + ((< (- 1.0 f0-0) 0.0001) + (let ((v1-7 (- 1.0 arg3))) + (.mov vf1 v1-7) + ) + (let ((v1-8 (* arg3 f30-0))) + (.mov vf2 v1-8) + ) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.x.vf vf3 vf4 vf2 acc) + (.svf (&-> arg0 vec quad) vf3) + (quaternion-normalize! arg0) + ) + (else + (let* ((f1-4 1.0) + (f2-1 f0-0) + (f1-6 (sqrtf (- f1-4 (* f2-1 f2-1)))) + (f0-6 (/ (- f1-6 f0-0) (+ f1-6 f0-0))) + (f28-0 (/ 1.0 f1-6)) + ) + (let ((f0-7 (atan-series-rad f0-6)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) (* (- 1.0 arg3) f0-7)) + (set! (-> s2-0 y) (* arg3 f0-7 f30-0)) + (vector-sin-rad! s2-0 s2-0) + (.lvf vf1 (&-> s2-0 quad)) + ) + (let ((v1-14 f28-0)) + (.mov vf2 v1-14) + ) + ) + (.mul.x.vf vf1 vf1 vf2) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.y.vf vf3 vf4 vf1 acc) + (.svf (&-> arg0 vec quad) vf3) + (.mov v1-15 vf3) + ) + ) + ) + arg0 + ) + ) + +(defun quaternion-pseudo-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + "This is a bad interpolation between quaternions. It lerps then normalizes. + It will behave extremely poorly for 180 rotations. + It is unused." + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let ((f1-0 (quaternion-dot arg1 arg2)) + (f0-0 1.0) + ) + (when (< f1-0 0.0) + (- f1-0) + (set! f0-0 -1.0) + ) + (let ((v1-5 (- 1.0 arg3))) + (.mov vf1 v1-5) + ) + (let ((v1-6 (* arg3 f0-0))) + (.mov vf2 v1-6) + ) + ) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.x.vf vf3 vf4 vf2 acc) + (.svf (&-> arg0 vec quad) vf3) + (quaternion-normalize! arg0) + arg0 + ) + ) + +(defun quaternion-pseudo-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + "Seek one quaternion toward another. Not using real slerp, so this is only good if the quaternions + are pretty similar." + (let ((s3-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (quaternion-copy! s3-0 arg2) + (if (< (quaternion-dot s3-0 arg1) 0.0) + (quaternion-negate! s3-0 s3-0) + ) + (quaternion-! s5-0 s3-0 arg1) + (let ((f0-1 (quaternion-norm2 s5-0)) + (f1-1 arg3) + ) + (if (< (* f1-1 f1-1) f0-1) + (quaternion-float*! s5-0 s5-0 (/ arg3 (sqrtf f0-1))) + ) + ) + (quaternion+! s3-0 arg1 s5-0) + ) + (quaternion-normalize! s3-0) + (quaternion-copy! arg0 s3-0) + ) + ) + +(defun quaternion-smooth-seek! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + "Another hacky rotation interpolation." + (let ((gp-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-copy! (-> gp-0 0) arg2) + (if (< (quaternion-dot (-> gp-0 0) arg1) 0.0) + (quaternion-negate! (-> gp-0 0) (-> gp-0 0)) + ) + (quaternion-! (-> gp-0 1) (-> gp-0 0) arg1) + (quaternion-float*! (-> gp-0 1) (-> gp-0 1) (fmin 1.0 arg3)) + (quaternion+! (-> gp-0 0) arg1 (-> gp-0 1)) + (quaternion-normalize! (-> gp-0 0)) + (quaternion-copy! arg0 (-> gp-0 0)) + ) + ) + +(defun quaternion-zxy! ((arg0 quaternion) (arg1 vector)) + "Make a quaternion from a sequence of z, x, y axis rotations." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-rad<-vector-deg/2! s4-0 arg1) + (vector-sincos-rad! gp-0 s5-0 s4-0) + (.lvf vf1 (&-> gp-0 quad)) + (.lvf vf2 (&-> s5-0 quad)) + ) + (.mul.x.vf vf4 vf0 vf1 :mask #b1000) + (.add.vf vf4 vf0 vf2 :mask #b111) + (.sub.vf vf4 vf0 vf4 :mask #b110) + (.add.vf vf3 vf0 vf1 :mask #b111) + (.mul.x.vf vf3 vf0 vf2 :mask #b1000) + (.outer.product.a.vf acc vf1 vf1) + (.outer.product.b.vf vf6 vf0 vf0 acc) + (.outer.product.a.vf acc vf2 vf2) + (.outer.product.b.vf vf5 vf0 vf0 acc) + (.mul.x.vf vf6 vf0 vf6 :mask #b1000) + (.mul.x.vf vf5 vf0 vf5 :mask #b1000) + (.mul.vf acc vf6 vf4) + (.add.mul.vf vf7 vf5 vf3 acc) + (.svf (&-> arg0 vec quad) vf7) + arg0 + ) + ) + +(defun vector-x-quaternion! ((arg0 vector) (arg1 quaternion)) + "Get the first row of the rotation matrix for this quaternion" + (let ((s5-0 (new-stack-matrix0))) + (quaternion->matrix s5-0 arg1) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (-> s5-0 data)) 0)) + ) + arg0 + ) + +(defun vector-y-quaternion! ((arg0 vector) (arg1 quaternion)) + "Get the second row of the rotation matrix for this quaternion" + (let ((s5-0 (new-stack-matrix0))) + (quaternion->matrix s5-0 arg1) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (&-> s5-0 data 4)) 0)) + ) + arg0 + ) + +(defun vector-z-quaternion! ((arg0 vector) (arg1 quaternion)) + "Get the third row of the rotation matrix for this quaternion" + (let ((s5-0 (new-stack-matrix0))) + (quaternion->matrix s5-0 arg1) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (&-> s5-0 data 8)) 0)) + ) + arg0 + ) + +(defun quaternion-x-angle ((arg0 quaternion)) + "Get the x rotation angle. Not very efficient" + (let ((v1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0))) + (atan (-> v1-1 z) (-> v1-1 y)) + ) + ) + +(defun quaternion-y-angle ((arg0 quaternion)) + "Get the y rotation angle. Not very efficient" + (let ((v1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))) + (atan (-> v1-1 x) (-> v1-1 z)) + ) + ) + +(defun quaternion-z-angle ((arg0 quaternion)) + "Get the z rotation angle. Not very efficient" + (let ((v1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0))) + (atan (-> v1-1 x) (-> v1-1 y)) + ) + ) + +(defun quaternion-vector-y-angle ((arg0 quaternion) (arg1 vector)) + "Not sure. Angle between quaternion and axis, projected in xz plane?" + (let ((f30-0 (quaternion-y-angle arg0)) + (f0-2 (atan (-> arg1 x) (-> arg1 z))) + ) + (deg-diff f30-0 f0-2) + ) + ) + +(defun quaternion-rotate-local-x! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Rotate existing quaternion along x axis." + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :x 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) + ) + ) + +(defun quaternion-rotate-local-y! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Rotate existing quaternion along y axis." + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :y 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) + ) + ) + +(defun quaternion-rotate-local-z! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Rotate existing quaternion along z axis." + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :z 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) + ) + ) + +(defun quaternion-rotate-y! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Rotate existing quaternion along y axis (right multiply)" + (let ((a1-2 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :y 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 a1-2 arg1)) + ) + ) + +(defun quaternion-rotate-x! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Rotate existing quaternion along x axis (right multiply)" + (let ((a1-3 (quaternion-vector-angle! (new-stack-quaternion0) (vector-x-quaternion! (new-stack-vector0) arg1) arg2)) + ) + (quaternion-normalize! (quaternion*! arg0 a1-3 arg1)) + ) + ) + +(defun quaternion-rotate-z! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + "Rotate existing quaternion along z axis (right multiply)" + (let ((a1-3 (quaternion-vector-angle! (new-stack-quaternion0) (vector-z-quaternion! (new-stack-vector0) arg1) arg2)) + ) + (quaternion-normalize! (quaternion*! arg0 a1-3 arg1)) + ) + ) + +(defun quaternion-delta-y ((arg0 quaternion) (arg1 quaternion)) + "Difference in yaw between two quaternions" + (acos (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) arg1) + ) + ) + ) + +(defun quaternion-rotate-y-to-vector! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + "Rotate along y so z-axis points to match another. Use arg3 as the max rotation amount." + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((t9-0 vector-xz-normalize!) + (a0-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-1 x) (-> arg2 x)) + (set! (-> a0-1 y) 0.0) + (set! (-> a0-1 z) (-> arg2 z)) + (set! (-> a0-1 w) 1.0) + (let ((s0-0 (t9-0 a0-1 1.0))) + (quaternion-from-two-vectors-max-angle! + s5-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) arg1) + s0-0 + arg3 + ) + ) + ) + (quaternion-normalize! (quaternion*! arg0 s5-0 arg1)) + ) + ) + +(defun vector-rotate-x! ((arg0 vector) (arg1 vector) (arg2 float)) + "Rotate vector along x axis." + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :x 1.0 :w 1.0) arg2)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (quaternion->matrix s4-0 a1-2) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +(defun vector-rotate-y! ((arg0 vector) (arg1 vector) (arg2 float)) + "Rotate vector along y axis." + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :y 1.0 :w 1.0) arg2)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (quaternion->matrix s4-0 a1-2) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +(defun vector-rotate-z! ((arg0 vector) (arg1 vector) (arg2 float)) + "Rotate vector along z axis." + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :z 1.0 :w 1.0) arg2)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (quaternion->matrix s4-0 a1-2) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +;; note that these kind of assume a rotation ordering where you can yaw as much as you want, +;; but if you pitch 180 degrees everything is bad. + +(defun vector-y-angle ((arg0 vector)) + "Get the yaw angle of a vector." + (atan (-> arg0 x) (-> arg0 z)) + ) + +(defun vector-x-angle ((arg0 vector)) + "Get the pitch angle of a vector." + (atan (-> arg0 y) (vector-xz-length arg0)) + ) + +(defun quaternion<-rotate-y-vector ((arg0 quaternion) (arg1 vector)) + "Create a quaternion representing only the yaw of the given vector" + (quaternion-vector-angle! arg0 (new 'static 'vector :y 1.0 :w 1.0) (vector-y-angle arg1)) + ) + +(defun-debug quaternion-validate ((arg0 quaternion)) + "Verify that a quaternion is valid, print an error if the length is off by more than 1%.." + (with-pp + (let ((f0-0 (quaternion-norm arg0))) + (when (or (< 1.01 f0-0) (< f0-0 0.99)) + (format #t "WARNING: bad quaternion (magnitude ~F) process is " f0-0) + (if (and pp (type? pp process-tree)) + (format #t "~A~%" (-> pp name)) + (format #t "#f~%") + ) + ) + ) + 0 + (none) + ) + ) + +(defun quaternion-xz-angle ((arg0 quaternion)) + "yet another function to compute the yaw of a quaternion. This is a particularly inefficient version." + (let ((gp-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (quaternion->matrix gp-0 arg0) + (set-vector! s5-0 0.0 0.0 1.0 1.0) + (vector-matrix*! s5-0 s5-0 gp-0) + (vector-y-angle s5-0) + ) + ) + + + + diff --git a/goal_src/jak2/engine/math/transform-h.gc b/goal_src/jak2/engine/math/transform-h.gc index 32d1cde34d..3e712413a2 100644 --- a/goal_src/jak2/engine/math/transform-h.gc +++ b/goal_src/jak2/engine/math/transform-h.gc @@ -7,3 +7,34 @@ ;; DECOMP BEGINS +;; Transformation. w components of vectors should be 1.0 +;; This can represent any rotation, translation, and scaling. +;; Note that the scaling is applied before rotation (meaning it scales along the axes of the pre-transformed frame). +(deftype transform (structure) + ((trans vector :inline :offset-assert 0) + (rot vector :inline :offset-assert 16) + (scale vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; Like transform, but it's a basic. +;; note that the trsq child type overrides this rotation with a quaternion. +;; usage of the plain trs is very limited, at least in jak 1. +(deftype trs (basic) + ((trans vector :inline :offset-assert 16) + (rot vector :inline :offset-assert 32) + (scale vector :inline :offset-assert 48) + ) + (:methods + (new (symbol type) _type_ 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + + + diff --git a/goal_src/jak2/engine/math/transform.gc b/goal_src/jak2/engine/math/transform.gc index a3de029a45..9c470b19bb 100644 --- a/goal_src/jak2/engine/math/transform.gc +++ b/goal_src/jak2/engine/math/transform.gc @@ -7,3 +7,74 @@ ;; DECOMP BEGINS +(defmethod print transform ((obj transform)) + "Print a transform." + (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) + (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> obj rot x) (-> obj rot y) (-> obj rot z) (-> obj rot w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) + obj + ) + +(defmethod new trs ((allocation symbol) (type-to-make type)) + "Allocate a new transform and set to identity." + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 trans w) 1.0) + (set! (-> gp-0 rot w) 1.0) + (vector-identity! (-> gp-0 scale)) + gp-0 + ) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;; +;; transform utilities +;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; these functions are unused and possibly extremely old. +;; they aren't very efficient, and have the destination as the 2nd argument, +;; which differens from almost all other GOAL code. + +(defun transform-matrix-calc! ((arg0 transform) (arg1 matrix)) + "Convert a transform to matrix. Not efficient, and the output is the second arg." + (let ((s4-0 (new-stack-matrix0)) + (s3-0 (new-stack-matrix0)) + ) + (matrix-identity! arg1) + (matrix-translate! arg1 (-> arg0 trans)) + (matrix-rotate-y! s4-0 (-> arg0 rot y)) + (matrix*! s3-0 s4-0 arg1) + (matrix-rotate-x! s4-0 (-> arg0 rot x)) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-z! s4-0 (-> arg0 rot z)) + (matrix*! s3-0 s4-0 arg1) + (matrix-scale! s4-0 (-> arg0 scale)) + (matrix*! arg1 s4-0 s3-0) + ) + ) + +(defun transform-matrix-parent-calc! ((arg0 transform) (arg1 matrix) (arg2 vector)) + "Convert a transform to a matrix, applying an inverse scaling." + (let ((s4-0 (new-stack-matrix0)) + (s3-0 (new-stack-matrix0)) + ) + (matrix-identity! s3-0) + (matrix-translate! s3-0 (-> arg0 trans)) + (matrix-inv-scale! s4-0 arg2) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-y! s4-0 (-> arg0 rot y)) + (matrix*! s3-0 s4-0 arg1) + (matrix-rotate-x! s4-0 (-> arg0 rot x)) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-z! s4-0 (-> arg0 rot z)) + (matrix*! s3-0 s4-0 arg1) + (matrix-scale! s4-0 (-> arg0 scale)) + (matrix*! arg1 s4-0 s3-0) + ) + ) + +(defun trs-matrix-calc! ((arg0 trs) (arg1 matrix)) + "Convert a trs to a matrix" + ;; this relies on the fact that trs and transform both have the same memory layout. + (transform-matrix-calc! (the-as transform (-> arg0 trans)) arg1) + ) + diff --git a/goal_src/jak2/engine/math/transformq-h.gc b/goal_src/jak2/engine/math/transformq-h.gc index 54b299a77c..0c3ecc7229 100644 --- a/goal_src/jak2/engine/math/transformq-h.gc +++ b/goal_src/jak2/engine/math/transformq-h.gc @@ -5,5 +5,86 @@ ;; name in dgo: transformq-h ;; dgos: ENGINE, GAME +;; the transformq is a transform, but _replaces_ the rotation field with a quaternion. +;; it is much more commonly used than transform. + ;; DECOMP BEGINS +(deftype transformq (transform) + ((quat quaternion :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype trsq (trs) + ((quat quaternion :inline :offset 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; a transform with: +;; - type information (child of basic) +;; - rotation stored as quaternion +;; - velocity information. +;; This is a very commonly used type to represent the position of an in-game object. +;; The "root" of a process-drawable (the parent "in-game object" type) is a trsqv. +;; Additionally, the collision system uses trsqv as the parent type for foreground +;; collision objects (collide-shape, collide-shape-moving) +;; As a result, this type has a lot of weird methods and extra stuff hidden in it. +(deftype trsqv (trsq) + (;; some extra info for game objects, hidden in the unused space. + (pause-adjust-distance meters :offset 4) + (nav-radius meters :offset 8) + + ;; velocities + (transv vector :inline :offset-assert 64) + (rotv vector :inline :offset-assert 80) + (scalev vector :inline :offset-assert 96) + + ;; trsqv also supports the ability to adjust its orientation + ;; to face a target. This has some logic to prevent chattering + ;; that requires some additional state here: + (dir-targ quaternion :inline :offset-assert 112) + (angle-change-time time-frame :offset-assert 128) + (old-y-angle-diff float :offset-assert 136) + ) + :method-count-assert 28 + :size-assert #x8c + :flag-assert #x1c0000008c + (:methods + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) + (set-heading-vec! (_type_ vector) quaternion 10) + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) + (point-toward-point! (_type_ vector) quaternion 12) + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) + (set-roll-to-grav! (_type_ float) quaternion 15) + (set-roll-to-grav-2! (_type_ float) quaternion 16) + (rotate-toward-orientation! (_type_ quaternion float float) quaternion 17) + (set-quaternion! (_type_ quaternion) quaternion 18) + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) + (rot->dir-targ! (_type_) quaternion 21) + (y-angle (_type_) float 22) + (global-y-angle-to-point (_type_ vector) float 23) + (relative-y-angle-to-point (_type_ vector) float 24) + (roll-relative-to-gravity (_type_) float 25) + (set-and-limit-velocity (_type_ int vector float) trsqv 26) + (get-quaternion (_type_) quaternion 27) + ) + ) + +(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) + "Get the angle in the xz plane from the position of this trsqv to the point arg0. + (ignores our current yaw)" + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) + ) + +(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) + "Get the y angle between the current orientation and arg0. (how much we'd have to yaw to point at arg0)" + (deg-diff (y-angle obj) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) + ) diff --git a/goal_src/jak2/engine/math/trigonometry-h.gc b/goal_src/jak2/engine/math/trigonometry-h.gc index 03f10db4a3..f04ef01727 100644 --- a/goal_src/jak2/engine/math/trigonometry-h.gc +++ b/goal_src/jak2/engine/math/trigonometry-h.gc @@ -7,3 +7,18 @@ ;; DECOMP BEGINS +;; no code! +(define-extern deg-diff (function float float float)) +(define-extern sin (function float float)) +(define-extern sincos! (function (pointer float) float int)) +(define-extern vector-sin-rad! (function vector vector vector)) +(define-extern vector-sincos! (function vector vector vector int)) +(define-extern vector-sincos-rad! (function vector vector vector int)) +(define-extern sincos-rad! (function (pointer float) float int)) +(define-extern vector-rad<-vector-deg/2! (function vector vector int)) +(define-extern cos (function float float)) +(define-extern atan-series-rad (function float float)) +(define-extern atan2-rad (function float float float)) +(define-extern atan (function float float float)) +(define-extern acos (function float float)) +(define-extern acos-rad (function float float)) diff --git a/goal_src/jak2/engine/math/trigonometry.gc b/goal_src/jak2/engine/math/trigonometry.gc index 559cf06ebf..d2a20cffe4 100644 --- a/goal_src/jak2/engine/math/trigonometry.gc +++ b/goal_src/jak2/engine/math/trigonometry.gc @@ -5,5 +5,1060 @@ ;; name in dgo: trigonometry ;; dgos: ENGINE, GAME +;; The "rotation" unit stores an angle in a float, where 1.0 = 1/65,536 (1/2^16) of a rotation. +;; Use the ~r format specifier to print rotations as degrees. +;; In general, functions which use these units will only be accurate to within 1/65,536th of a rotation, +;; as they often internally convert the float to an integer. These function also handle wrapping +;; correctly, and will output angles in the range -32768 to 32768 (+/- one half of a rotation) +;; Functions with these units have deg or nothing special in the name. + +;; Some functions use radians. These typically have rad in the name, and they don't handle wrapping. +;; The input must be in the range -pi to pi + +;; General note on floating point constants: to avoid ambiguity/rounding issues related to printing/parsing, weird +;; constants are stored as hex. Commonly used constants that are exactly represented (1, 0.5, etc) will appear +;; normally. + + +;; There is a bug in some of the cosine functions that can be fixed by toggling this flag. +(defglobalconstant FIX_COSINE_BUG #f) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Floating Point Constants +;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defconstant ROT_TO_RAD (the-as float #x38c90fda)) +(defconstant PI (the-as float #x40490fda)) +(defconstant MINUS_PI (the-as float #xc0490fda)) +(defconstant PI_OVER_2 (the-as float #x3fc90fda)) +(defconstant TWO_PI (the-as float #x40c90fda)) + ;; DECOMP BEGINS +(defun radmod ((arg0 float)) + "Wrap arg0 to be within (-pi, pi)." + (let ((f0-1 (+ 3.1415925 arg0))) + (if (< 0.0 f0-1) + (+ -3.1415925 (- f0-1 (* (the float (the int (/ f0-1 6.283185))) 6.283185))) + (+ 3.1415925 (- f0-1 (* (the float (the int (/ f0-1 6.283185))) 6.283185))) + ) + ) + ) + +(defun deg- ((arg0 float) (arg1 float)) + "Compute arg0-arg1, unwrapped, using rotation units. + Result should be in the range (-180, 180)" + (the float (sar (- (shl (the int arg0) 48) (shl (the int arg1) 48)) 48)) + ) + +(defun deg-diff ((arg0 float) (arg1 float)) + "Very similar to the function above, but computes arg1 - arg0 instead." + (the float (sar (- (shl (the int arg1) 48) (shl (the int arg0) 48)) 48)) + ) + +(defun deg-seek ((arg0 float) (arg1 float) (arg2 float)) + "Move in toward target by at most max-diff, using rotation units" + (let ((v1-1 (shl (the int arg0) 48)) + (a0-2 (shl (the int arg1) 48)) + ) + (let* ((a1-2 (shl (the int arg2) 48)) + (a2-1 (- a0-2 v1-1)) (a3-0 (abs a2-1))) + (set! a0-2 (cond + ((< a3-0 0) + (+ v1-1 a1-2) + ) + ((>= a1-2 a3-0) + a0-2 + ) + ((>= a2-1 0) + (+ v1-1 a1-2) + ) + (else + (- v1-1 a1-2) + ) + ) + ) + ) + (the float (sar a0-2 48)) + ) + ) + +(defun deg-seek-smooth ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + "Step amount of the way from in to target, by at most max-diff, using rotation units" + (let ((f0-1 (* (deg- arg1 arg0) arg3))) + (if (< arg2 (fabs f0-1)) + (set! f0-1 (if (>= f0-1 0.0) + arg2 + (- arg2) + ) + ) + ) + (+ arg0 f0-1) + ) + ) + +(defun deg-lerp-clamp ((arg0 float) (arg1 float) (arg2 float)) + "Map [0, 1] to min-val, max-val, handling wrapping and saturating, using rotation units." + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (the float (sar (shl (the int (+ arg0 (* arg2 (deg-diff arg0 arg1)))) 48) 48)) + ) + ) + ) + +(define binary-table (new 'static 'boxed-array :type float + 1.0 + 0.5 + 0.25 + 0.125 + 0.0625 + 0.03125 + 0.015625 + 0.0078125 + 0.00390625 + 0.001953125 + 0.0009765625 + 0.00048828125 + 0.00024414062 + 0.00012207031 + 0.000061035156 + 0.000030517578 + 0.000015258789 + 0.0000076293945 + 0.0000038146973 + 0.0000019073486 + 0.0000009536743 + 0.00000047683716 + 0.00000023841858 + 0.00000011920929 + 0.000000059604645 + 0.000000029802322 + 0.000000014901161 + 0.000000007450581 + 0.0000000037252903 + 0.0000000018626451 + 0.0000000009313226 + 0.0000000004656613 + ) + + ) + +(define sincos-table (new 'static 'boxed-array :type float + 0.7853982 + 0.4636476 + 0.24497867 + 0.124354996 + 0.06241881 + 0.031239834 + 0.015623729 + 0.007812341 + 0.0039062302 + 0.0019531226 + 0.0009765622 + 0.0004882812 + 0.00024414062 + 0.00012207031 + 0.000061035156 + 0.000030517578 + 0.000015258789 + 0.0000076293945 + 0.0000038146973 + 0.0000019073486 + 0.0000009536743 + 0.00000047683716 + 0.00000023841858 + 0.00000011920929 + 0.000000059604645 + 0.000000029802322 + 0.000000014901161 + 0.000000007450581 + 0.0000000037252903 + 0.0000000018626451 + 0.0000000009313226 + 0.0000000004656613 + ) + + ) + +(defun sin ((arg0 float)) + "Compute the sine of an angle in rotation units. Unwraps it." + (let ((f2-0 (* 0.000095873795 (the float (sar (shl (the int arg0) 48) 48))))) + f2-0 + (let* ((f1-4 (* 0.999998 f2-0)) + (f0-3 (* f2-0 f2-0)) + (f2-1 (* f2-0 f0-3)) + (f1-5 (+ f1-4 (* -0.16666014 f2-1))) + (f2-2 (* f2-1 f0-3)) + (f1-6 (+ f1-5 (* 0.008326521 f2-2))) + (f2-3 (* f2-2 f0-3)) + (f1-7 (+ f1-6 (* -0.0001956241 f2-3))) + (f0-4 (* f2-3 f0-3)) + ) + (+ f1-7 (* 0.0000023042373 f0-4)) + ) + ) + ) + +(defun sin-rad ((arg0 float)) + "Compute the sine of an angle in radians. + No unwrap is done, should be in -pi, pi" + (local-vars + (f1-0 float) + (f2-0 float) + (f3-0 float) + (f4-0 float) + (f5-0 float) + (f6-0 float) + (f7-0 float) + (f8-0 float) + (f9-0 float) + (f10-0 float) + (f11-0 float) + (acc float) + ) + (set! f1-0 (* arg0 arg0)) + (set! f7-0 (the-as float #x3f7fffde)) + (set! f8-0 (the-as float #xbe2aa8f5)) + (set! f2-0 (* arg0 f1-0)) + (set! f3-0 (* f1-0 f1-0)) + (set! f9-0 (the-as float #x3c086bf6)) + (set! f4-0 (* f2-0 f1-0)) + (set! f5-0 (* f3-0 f2-0)) + (set! f10-0 (the-as float #xb94d2072)) + (set! f6-0 (* f4-0 f3-0)) + (set! f11-0 (the-as float #x361aa27f)) + ;;(.mula.s arg0 f7-0) + (set! acc (* arg0 f7-0)) + ;;(.madda.s f2-0 f8-0) + (set! acc (+ acc (* f2-0 f8-0))) + ;;(.madda.s f4-0 f9-0) + (set! acc (+ acc (* f4-0 f9-0))) + ;;(.madda.s f5-0 f10-0) + (set! acc (+ acc (* f5-0 f10-0))) + ;;(.madd.s f12-0 f6-0 f11-0) + (+ acc (* f6-0 f11-0)) + ) + +(define *sin-poly-vec* + (new 'static 'vector :x -0.16666014 :y 0.008326521 :z -0.0001956241 :w 0.0000023042373) + ) + +(define *sin-poly-vec2* (new 'static 'vector :x 0.999998)) + +(defun vector-sin-rad! ((arg0 vector) (arg1 vector)) + "Taylor series approximation of sine on all 4 elements in a vector. + Inputs should be in radians, in -pi to pi. + Somehow their coefficients are a little bit off. + Like the first coefficient, which should obviously be 1, is not quite 1." + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.mul.vf vf3 vf1 vf1) + (.lvf vf10 (&-> *sin-poly-vec2* quad)) + (.lvf vf9 (&-> *sin-poly-vec* quad)) + (.mul.vf vf4 vf3 vf1) + (.mul.vf vf5 vf3 vf3) + (.mul.x.vf acc vf1 vf10) + (.mul.vf vf6 vf4 vf3) + (.mul.vf vf7 vf5 vf4) + (.add.mul.x.vf acc vf4 vf9 acc) + (.mul.vf vf8 vf6 vf5) + (.add.mul.y.vf acc vf6 vf9 acc) + (.add.mul.z.vf acc vf7 vf9 acc) + (.add.mul.w.vf vf2 vf8 vf9 acc) + (.svf (&-> arg0 quad) vf2) + arg0 + ) + ) + +(defun cos-rad ((arg0 float)) + "Cosine with taylor series. Input is in radians, in -pi, pi. + - TODO constants" + (local-vars + (f1-0 float) + (f3-0 float) + (f4-0 float) + (f5-0 float) + (f7-0 float) + (f8-0 float) + (f9-0 float) + (f10-0 float) + (f11-0 float) + (acc float) + ) + (set! f1-0 (* arg0 arg0)) + (set! f7-0 1.000000) + (set! f8-0 (the-as float #xbefffd62)) + (set! f3-0 (* f1-0 f1-0)) + (set! f9-0 (the-as float #x3d2a7a28)) + (set! f10-0 (the-as float #xbab2bc31)) + (set! f4-0 (* f3-0 f1-0)) + (set! f5-0 (* f3-0 f3-0)) + (set! f11-0 (the-as float #x37a933eb)) + ;;(.mula.s f7-0 f7-0) + (set! acc (* f7-0 f7-0)) + ;;(.madda.s f8-0 f1-0) + (set! acc (+ acc (* f8-0 f1-0))) + ;;(.madda.s f9-0 f3-0) + (set! acc (+ acc (* f9-0 f3-0))) + ;;(.madda.s f10-0 f4-0) + (set! acc (+ acc (* f10-0 f4-0))) + ;;(.madd.s f12-0 f11-0 f5-0) + (+ acc (* f11-0 f5-0)) + ;;(the-as float f12-0) + ) + + +(define *cos-poly-vec* (new 'static 'vector :x -0.49998003 :y 0.041620404 :z -0.0013636408 :w 0.000020170546)) + +(defun vector-cos-rad! ((arg0 vector) (arg1 vector)) + "Compute the cosine of all 4 vector elements. + Radians, with no wrapping. Uses taylor series with 4 coefficients." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + ;; (.sub.vf vf2 vf2 vf2) + (.xor.vf vf2 vf2 vf2) + (.lvf vf9 (&-> *cos-poly-vec* quad)) + (.mul.vf vf3 vf1 vf1) + (.add.w.vf acc vf2 vf0) + (.mul.vf vf4 vf3 vf3) + (.add.mul.x.vf acc vf3 vf9 acc) + (.mul.vf vf5 vf4 vf3) + (.add.mul.y.vf acc vf4 vf9 acc) + (.mul.vf vf6 vf4 vf4) + (.add.mul.z.vf acc vf5 vf9 acc) + (.add.mul.w.vf vf2 vf6 vf9 acc) + (.svf (&-> arg0 quad) vf2) + arg0 + ) + ) + +(defun vector-sincos-rad! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Compute the sine and cosine of each element of src, storing it in dst-sin and dst-cos. + This is more efficient than separate calls to sin and cos. + Inputs should be radians in -pi to pi." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg2 quad)) + ;; (.sub.vf vf14 vf14 vf14) + (.xor.vf vf14 vf14 vf14) + + (.lvf vf11 (&-> *sin-poly-vec2* quad)) + (.mul.vf vf2 vf1 vf1) + (.lvf vf10 (&-> *sin-poly-vec* quad)) + (.lvf vf13 (&-> *cos-poly-vec* quad)) + (.mul.x.vf acc vf1 vf11) + (.mul.vf vf3 vf2 vf1) + (.mul.vf vf4 vf2 vf2) + (.mul.vf vf5 vf3 vf2) + (.mul.vf vf6 vf3 vf3) + (.mul.vf vf7 vf4 vf3) + (.mul.vf vf8 vf4 vf4) + (.mul.vf vf9 vf5 vf4) + (.add.mul.x.vf acc vf3 vf10 acc) + (.add.mul.y.vf acc vf5 vf10 acc) + (.add.mul.z.vf acc vf7 vf10 acc) + (.add.mul.w.vf vf12 vf9 vf10 acc) + (.add.w.vf acc vf14 vf0) + (.add.mul.x.vf acc vf2 vf13 acc) + (.add.mul.y.vf acc vf4 vf13 acc) + (.add.mul.z.vf acc vf6 vf13 acc) + (.add.mul.w.vf vf14 vf8 vf13 acc) + (.svf (&-> arg0 quad) vf12) + (.svf (&-> arg1 quad) vf14) + 0 + ) + ) + +(defmacro sincos-rad-asm (out x) + ;; Compute the sine and cosine of x, store it in the output array + ;; this assembly is shared in two functions. + `(rlet ((f10 :class fpr :type float) ;; coeff 1.0 + (f11 :class fpr :type float) ;; coeff -1/3! + (f12 :class fpr :type float) ;; coeff 1/5! + (f14 :class fpr :type float) ;; coeff -1/7! + (f15 :class fpr :type float) ;; coeff 1/9! + (f1 :class fpr :type float) ;; x + (f2 :class fpr :type float) ;; x^2 + (f3 :class fpr :type float) ;; x^3 + (f4 :class fpr :type float) ;; x^4 + (f5 :class fpr :type float) ;; x^5 + (f6 :class fpr :type float) ;; x^6 + (f7 :class fpr :type float) ;; x^7 + (f8 :class fpr :type float) ;; x^8 + (f9 :class fpr :type float) ;; x^9 + (f21 :class fpr :type float) + (f22 :class fpr :type float) ;; 0 ? + (acc :class fpr :type float) ;; temp + (f16 :class fpr :type float) ;; 1.0 + (f17 :class fpr :type float) ;; cos coeff 1 + (f18 :class fpr :type float) ;; cos coeff 2 + (f19 :class fpr :type float) ;; cos coeff 3 + (f20 :class fpr :type float) ;; cos coeff 4 + ) + ;; lui v1, 16255 + ;; lui a2, -16854 + ;; ori v1, v1, 65502 + ;; mtc1 f1, a1 + (set! f1 ,x) + ;; ori a1, a2, 43253 + ;; sub.s f22, f22, f22 + (set! f22 (the-as float 0)) + ;; lui a2, 15368 + ;; mtc1 f10, v1 + (set! f10 (the-as float #x3F7FFFDE)) ;; almost 1.0 + ;; ori v1, a2, 27638 + ;; mtc1 f11, a1 + (set! f11 (the-as float #xBE2AA8F5)) ;; -0.166, 1/3! + ;; lui a1, -18099 + ;; mul.s f2, f1, f1 + (set! f2 (* f1 f1)) + ;; ori a1, a1, 8306 + ;; mtc1 f12, v1 + (set! f12 (the-as float #x3C086BF6)) ;; 1/5! + ;; lui v1, 13850 + ;; mtc1 f14, a1 + (set! f14 (the-as float #xB94D2072)) ;; 1/7! + ;; ori a1, v1, 41599 + ;; mula.s f1, f10 + (set! acc (* f1 f10)) ;; x * c_1 + ;; lui v1, 16256 + ;; mul.s f3, f2, f1 + (set! f3 (* f2 f1)) ;; x^3 + ;; or v1, v1, r0 + ;; mul.s f4, f2, f2 + (set! f4 (* f2 f2)) ;; x^4 + ;; lui a2, -16641 + ;; mtc1 f15, a1 + (set! f15 (the-as float #x361AA27F)) ;; 1/9! + ;; lui a1, -16641 ;; I think this is a typo... + ;; or a1, a2, a1 ;; this should set the lower 16 bits. + ;; mtc1 f16, v1 + (set! f16 (the-as float #x3f800000)) ;; 1.0 + ;; sll r0, r0, 0 + ;; mtc1 f17, a1 + + ;; it looks like they set the lower 16-bits of the x^2 + ;; coefficient for cosine incorrectly + (#cond + (FIX_COSINE_BUG + ;; the constant used in *cos-poly-vec* + (set! f17 (the-as float #xbefffd62)) + ) + (#t + ;; missing the lower 16 bits. + (set! f17 (the-as float #xBEFF0000)) + ) + ) + + ;; sll r0, r0, 0 + ;; mul.s f5, f3, f2 + (set! f5 (* f3 f2)) + ;; sll r0, r0, 0 + ;; mul.s f6, f3, f3 + (set! f6 (* f3 f3)) + ;; sll r0, r0, 0 + ;; mul.s f7, f4, f3 + (set! f7 (* f4 f3)) + ;; sll r0, r0, 0 + ;; mul.s f8, f4, f4 + (set! f8 (* f4 f4)) + ;; sll r0, r0, 0 + ;; mul.s f9, f5, f4 + (set! f9 (* f5 f4)) + ;; lui v1, 15658 + ;; madda.s f3, f11 + (set! acc (+ acc (* f3 f11))) ;; add x^3 sine term + ;; ori v1, v1, 31272 + ;; madda.s f5, f12 + (set! acc (+ acc (* f5 f12))) ;; add x^5 sine term + ;; lui a1, -17742 + ;; madda.s f7, f14 + (set! acc (+ acc (* f7 f14))) ;; add x^7 sine term + ;; ori a1, a1, 48177 + ;; madd.s f21, f9, f15 + (set! f21 (+ acc (* f9 f15))) ;; add x^9 sine term + ;; lui a2, 14249 + ;; mtc1 f18, v1 + (set! f18 (the-as float #x3D2A7A28)) ;; cos coeff + ;; ori v1, a2, 13291 + ;; mtc1 f19, a1 + (set! f19 (the-as float #xBAB2BC31)) ;; cos coeff + ;; sll r0, r0, 0 + ;; mtc1 f20, v1 + (set! f20 (the-as float #x37A933EB)) + ;; sll r0, r0, 0 + ;; mula.s f16, f16 + (set! acc (* f16 f16)) ;; acc = 1, constant cos term. + ;; sll r0, r0, 0 + ;; madda.s f2, f17 + (set! acc (+ acc (* f2 f17))) + ;; sll r0, r0, 0 + ;; madda.s f4, f18 + (set! acc (+ acc (* f4 f18))) + ;; sll r0, r0, 0 + ;; madda.s f6, f19 + (set! acc (+ acc (* f6 f19))) + ;; sll r0, r0, 0 + ;; madd.s f22, f8, f20 + (set! f22 (+ acc (* f8 f20))) + ;; sll r0, r0, 0 + ;; swc1 f21, 0(a0) + (set! (-> ,out 0) f21) + ;; sll r0, r0, 0 + ;; swc1 f22, 4(a0) + (set! (-> ,out 1) f22) + ;; or v0, r0, r0 + 0 + ) + ) + +(defun sincos-rad! ((out (pointer float)) (x float)) + "Compute the sine and cosine of x, store it in the output array. + Has the cosine bug." + (sincos-rad-asm out x) + ) + +(defun sincos! ((out (pointer float)) (x float)) + "Compute the sine and cosine of x, store it in the output array. + The input is in rotation units, and is unwrapped properly. + Also has the cosine bug" + (sincos-rad-asm out (* ROT_TO_RAD (the float (sar (shl (the int x) 48) 48)))) + ) + +(defun vector-rad<-vector-deg! ((out vector) (in vector)) + "Convert a vector in rotation units to radians, and unwrap. + Input can be anything, output will be -2pi to pi." + (rlet ((rot-to-rad :class vf) + (vf1 :class vf)) + (.mov rot-to-rad (the-as float ROT_TO_RAD)) + (.lvf vf1 in) + (.ftoi.vf vf1 vf1) ;; to int + (.pw.sll vf1 vf1 16) ;; shifts + (.pw.sra vf1 vf1 16) + (.itof.vf vf1 vf1) ;; to float + (.mul.x.vf vf1 vf1 rot-to-rad) + (.svf out vf1) + ) + ) + +(defun vector-rad<-vector-deg/2! ((out vector) (in vector)) + "Divide the input by two, and then convert from rotation units to radians, unwrapping. + Not sure why this really needs to be separate the from previous function..." + (rlet ((temp :class vf) + (vf1 :class vf)) + ;;(set! v1-0 952700890) + ;;(set! a2-0 1056964608) + ;;(.lqc2 vf1 0 a1-0) + (.lvf vf1 in) + + ;; multiply by 0.5. + ;;(.qmtc2.i vf2 a2-0) + (.mov temp (the-as float #x3f000000)) ;; 0.5 + ;;(.vmulx.xyzw vf1 vf1 vf2) + (.mul.x.vf vf1 vf1 temp) + + ;;(.vftoi0.xyzw vf1 vf1) + (.ftoi.vf vf1 vf1) + ;;(.qmtc2.i vf2 v1-0) + ;;(.qmfc2.i v1-1 vf1) + ;;(.psllw v1-2 v1-1 16) + (.pw.sll vf1 vf1 16) + ;;(.psraw v1-3 v1-2 16) + (.pw.sra vf1 vf1 16) + ;;(.qmtc2.i vf1 v1-3) + ;;(.vitof0.xyzw vf1 vf1) + (.itof.vf vf1 vf1) + ;;(.vmulx.xyzw vf1 vf1 vf2) + (.mov temp (the-as float ROT_TO_RAD)) + (.mul.x.vf vf1 vf1 temp) + ;;(.sqc2 vf1 0 arg0) + ;;(.qmfc2.i v0-0 vf1) + (.svf out vf1) + 0 + ) + ) + +(defun vector-sincos! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Compute sine and cosine of each element in a vector, in rotation units" + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-rad<-vector-deg! s4-0 arg2) + (vector-sincos-rad! arg0 arg1 s4-0) + ) + ) + +(defun tan-rad ((arg0 float)) + "This function appears to be named wrong and actually operates on rotation units." + (/ (sin arg0) (cos arg0)) + ) + +(defun cos ((arg0 float)) + "Cosine of rotation units" + (sin (+ 16384.0 arg0)) + ) + +(defun tan ((arg0 float)) + "Correctly named tangent of rotation units" + (/ (sin arg0) (cos arg0)) + ) + +(defun atan0 ((arg0 float) (arg1 float)) + "inverse tangent, to rotation units. y,x order. Does not handle signs correctly. + Do not use this function directly, instead use atan2" + (rlet ((f20 :class fpr :type float) + (f21 :class fpr :type float) + (f1 :class fpr :type float) + (f2 :class fpr :type float) + (f3 :class fpr :type float) + (f4 :class fpr :type float) + (f5 :class fpr :type float) + (f6 :class fpr :type float) + (f7 :class fpr :type float) + (f8 :class fpr :type float) + (f9 :class fpr :type float) + (f10 :class fpr :type float) + (f19 :class fpr :type float) + (f11 :class fpr :type float) + (f12 :class fpr :type float) + (f13 :class fpr :type float) + (f14 :class fpr :type float) + (f15 :class fpr :type float) + (f16 :class fpr :type float) + (f17 :class fpr :type float) + (f18 :class fpr :type float) + (acc :class fpr :type float) + ) + + ;;mtc1 f20, a1 + (set! f20 arg1) + ;;mtc1 f21, a0 + (set! f21 arg0) + ;;sub.s f1, f21, f20 + (set! f1 (- f21 f20)) + ;;add.s f2, f21, f20 + (set! f2 (+ f21 f20)) + ;;div.s f1, f1, f2 + (set! f1 (/ f1 f2)) + ;;lwc1 f19, L132(fp) + (set! f19 (the-as float #x46000000)) + ;;lwc1 f11, L140(fp) + (set! f11 (the-as float #x4622f97c)) + ;;lwc1 f12, L151(fp) + (set! f12 (the-as float #xc55946e1)) + ;;lwc1 f13, L120(fp) + (set! f13 (the-as float #x450207fd)) + ;;lwc1 f14, L126(fp) + (set! f14 (the-as float #xc4b556ce)) + ;;lwc1 f15, L113(fp) + (set! f15 (the-as float #x447b6ca4)) + ;;mul.s f2, f1, f1 + (set! f2 (* f1 f1)) + ;;lwc1 f16, L142(fp) + (set! f16 (the-as float #xc411ca52)) + ;;lwc1 f17, L118(fp) + (set! f17 (the-as float #x43640558)) + ;;mul.s f3, f1, f2 + (set! f3 (* f1 f2)) + ;;mul.s f1, f1, f11 + (set! f1 (* f1 f11)) + ;;mul.s f4, f2, f2 + (set! f4 (* f2 f2)) + ;;lwc1 f18, L141(fp) + (set! f18 (the-as float #xc2292434)) + ;;mul.s f5, f3, f2 + (set! f5 (* f3 f2)) + ;;mul.s f6, f4, f3 + (set! f6 (* f4 f3)) + ;;mul.s f7, f5, f4 + (set! f7 (* f5 f4)) + ;;mul.s f8, f6, f4 + (set! f8 (* f6 f4)) + ;;mul.s f9, f7, f4 + (set! f9 (* f7 f4)) + ;;mul.s f10, f8, f4 + (set! f10 (* f8 f4)) + ;;adda.s f1, f19 + (set! acc (+ f1 f19)) + ;;madda.s f3, f12 + (set! acc (+ acc (* f3 f12))) + + ;;madda.s f5, f13 + (set! acc (+ acc (* f5 f13))) + + ;;madda.s f6, f14 + (set! acc (+ acc (* f6 f14))) + + ;;madda.s f7, f15 + (set! acc (+ acc (* f7 f15))) + + ;;madda.s f8, f16 + (set! acc (+ acc (* f8 f16))) + + ;;madda.s f9, f17 + (set! acc (+ acc (* f9 f17))) + + ;;madd.s f19, f10, f18 + ;;mfc1 v0, f19 + (+ acc (* f10 f18)) + ) + ) + + +(defmacro .adda.s (a b) + `(set! acc (+ ,a ,b)) + ) + +(defmacro .madda.s (a b) + `(set! acc (+ acc (* ,a ,b))) + ) + +(defmacro .madd.s (a b c) + `(set! ,a (+ acc (* ,b ,c))) + ) + +(defun atan-series-rad ((arg0 float)) + "A helper function for atan" + (local-vars + (f0-1 float) + (f1-0 float) + (f2-0 float) + (f3-0 float) + (f4-0 float) + (f5-0 float) + (f6-0 float) + (f7-0 float) + (f8-0 float) + (f9-0 float) + (f10-0 float) + (f11-0 float) + (f12-0 float) + (f13-0 float) + (f14-0 float) + (f15-0 float) + (f16-0 float) + (f17-0 float) + (f18-0 float) + (acc float) + (f18-1 float) + ) + (set! f1-0 (* arg0 arg0)) + (set! f10-0 (the-as float #x3f7ffff5)) + (set! f11-0 (the-as float #xbeaaa61c)) + (set! f2-0 (* arg0 f1-0)) + (set! f3-0 (* f1-0 f1-0)) + (set! f12-0 (the-as float #x3e4c40a6)) + (set! f4-0 (* f2-0 f1-0)) + (set! f5-0 (* f3-0 f2-0)) + (set! f13-0 (the-as float #xbe0e6c63)) + (set! f6-0 (* f4-0 f3-0)) + (set! f7-0 (* f5-0 f3-0)) + (set! f14-0 (the-as float #x3dc577df)) + (set! f8-0 (* f6-0 f3-0)) + (set! f9-0 (* f7-0 f3-0)) + (set! f15-0 (the-as float #xbd6501c4)) + (set! f18-0 (the-as float #x3f490fdb)) + (set! f0-1 (* arg0 f10-0)) + (set! f16-0 (the-as float #x3cb31652)) + (set! f17-0 (the-as float #xbb84d7e7)) + (.adda.s f0-1 f18-0) + (.madda.s f2-0 f11-0) + (.madda.s f4-0 f12-0) + (.madda.s f5-0 f13-0) + (.madda.s f6-0 f14-0) + (.madda.s f7-0 f15-0) + (.madda.s f8-0 f16-0) + (.madd.s f18-1 f9-0 f17-0) + ;;(the-as float f18-1) + f18-1 + ) + +(defun atan-rad ((arg0 float)) + "inverse tangent in radians" + (atan-series-rad (/ (+ -1.0 arg0) (+ 1.0 arg0))) + ) + +(defun sign-bit ((arg0 int)) + "Return 1 if bit 31 is set, otherwise 0." + ;; originally used 32-bit shift, doesn't really matter. + (logand (shl arg0 31) 1) + + ;(local-vars (v1-1 int)) + ; (let ((v1-0 arg0)) + ; (shift-arith-right-32 v1-1 v1-0 31) + ; ) + ; (logand v1-1 1) + ) + +(defun sign-float ((arg0 float)) + "Return 1 if arg0 is positive or zero, -1 otherwise. + Fast (no branching)" + (let ((a1-0 #xffffffff80000000) + (v1-0 #x3f800000) + ) + (the-as float (logior (logand (the-as uint arg0) (the-as uint a1-0)) v1-0)) + ) + ) + +(defun sign ((arg0 float)) + "Similar to above, but returns 0 if input is 0. + But is more complicated." + (cond + ((< 0.0 arg0) + 1.0 + ) + ((< arg0 0.0) + -1.0 + ) + (else + 0.0 + ) + ) + ) + +(defun atan2-rad ((arg0 float) (arg1 float)) + "Atan for radians" + (cond + ((= arg1 0.0) + (* 1.5707963 (sign arg0)) + ) + ((and (< arg0 0.0) (< arg1 0.0)) + (let ((f30-1 -3.1415925) + (f0-6 (/ arg0 arg1)) + ) + (+ f30-1 (atan-series-rad (/ (+ -1.0 f0-6) (+ 1.0 f0-6)))) + ) + ) + ((< arg0 0.0) + (let ((f0-14 (- (/ arg0 arg1)))) + (- (atan-series-rad (/ (+ -1.0 f0-14) (+ 1.0 f0-14)))) + ) + ) + ((< arg1 0.0) + (let ((f30-2 3.1415925) + (f0-22 (- (/ arg0 arg1))) + ) + (- f30-2 (atan-series-rad (/ (+ -1.0 f0-22) (+ 1.0 f0-22)))) + ) + ) + (else + (let ((f0-28 (/ arg0 arg1))) + (atan-series-rad (/ (+ -1.0 f0-28) (+ 1.0 f0-28))) + ) + ) + ) + ) + +(defun atan ((arg0 float) (arg1 float)) + "Atan for rotation units. Signs behave like atan.." + (cond + ((and (= arg1 0.0) (= arg0 0.0)) + 0.0 + ) + ((and (< arg1 0.0) (< arg0 0.0)) + (+ -32768.0 (atan0 (- arg0) (- arg1))) + ) + ((< arg0 0.0) + (- (atan0 (- arg0) arg1)) + ) + ((< arg1 0.0) + (- 32768.0 (atan0 arg0 (- arg1))) + ) + (else + (atan0 arg0 arg1) + ) + ) + ) + +(defun asin ((arg0 float)) + "Inverse sine, rotation units." + (let ((gp-0 #f)) + 0.0 + (when (< arg0 0.0) + (set! arg0 (- arg0)) + (set! gp-0 #t) + ) + (let ((f0-5 (cond + ((< 1.0 arg0) + 16383.996 + ) + (else + (let* ((f0-6 1.0) (f1-2 arg0) (f0-8 (sqrtf (- f0-6 (* f1-2 f1-2))))) (atan0 arg0 f0-8)) + ) + ) + ) + ) + (if gp-0 + (- f0-5) + f0-5 + ) + ) + ) + ) + +(defun acos ((arg0 float)) + "Inverse cosine. Returns rotation units" + (let ((result (- 16384.000000 (asin arg0)))) + (#when PC_PORT + ;; to avoid punch glitch: + ;; (note: it might be a better fix to change the global rounding mode, + ;; but it's not super clear to me that the mode picked by PCSX2 is + ;; more accurate than normal in all cases. So, we'll do this for now.) + (when (= result 0.0) + (set! result 0.00000000001) + ) + ) + result + ) + ) + + +(defun acos-rad ((arg0 float)) + "Inverse cosine, radians." + (cond + ((>= arg0 0.0) + (let* ((f0-1 1.0) + (f1-1 arg0) + (f0-3 (sqrtf (- f0-1 (* f1-1 f1-1)))) + (f0-5 (/ (- f0-3 arg0) (+ f0-3 arg0))) + ) + (atan-series-rad f0-5) + ) + ) + (else + (let* ((f0-6 1.0) + (f1-6 arg0) + (f0-8 (sqrtf (- f0-6 (* f1-6 f1-6)))) + (f0-10 (/ (+ f0-8 arg0) (- f0-8 arg0))) + ) + (- 3.1415925 (atan-series-rad f0-10)) + ) + ) + ) + ) + +(defun sinerp ((arg0 float) (arg1 float) (arg2 float)) + "map amount to min,max using sine. Kinda weird, usually people use cosine." + (lerp arg0 arg1 (sin (* 16384.0 arg2))) + ) + +(defun sinerp-clamp ((arg0 float) (arg1 float) (arg2 float)) + "Like sinerp, but clamp to min,max" + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (sinerp arg0 arg1 arg2) + ) + ) + ) + +(defun coserp ((arg0 float) (arg1 float) (arg2 float)) + "Weird lerp with cosine (over 90 degrees?)" + (lerp arg0 arg1 (- 1.0 (cos (* 16384.0 arg2)))) + ) + +(defun coserp-clamp ((arg0 float) (arg1 float) (arg2 float)) + "Weird 90 degree lerp with cosine, clamped to min,max" + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (coserp arg0 arg1 arg2) + ) + ) + ) + +(defun coserp180 ((arg0 float) (arg1 float) (arg2 float)) + "Classic lerp with cosine" + (lerp arg0 arg1 (* 0.5 (- 1.0 (cos (* 32768.0 arg2))))) + ) + +(defun coserp180-clamp ((arg0 float) (arg1 float) (arg2 float)) + "Classic coserp with saturation" + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (coserp180 arg0 arg1 arg2) + ) + ) + ) + +(defun ease-in-out ((arg0 int) (arg1 int)) + "Weird coserp like mapping from 0 to 1 as progress goes from 0 to total" + (local-vars (v1-0 int)) + (cond + ((>= arg1 arg0) + 1.0 + ) + ((<= arg1 0) + 0.0 + ) + ((begin (set! v1-0 (/ arg0 2)) (< v1-0 arg1)) + (let ((a0-1 (- arg1 arg0))) + (+ 0.5 (* 0.5 (sin (- 16384.0 (/ (* 16384.0 (the float a0-1)) (the float v1-0)))))) + ) + ) + (else + (- 0.5 (* 0.5 (cos (/ (* 16384.0 (the float arg1)) (the float v1-0))))) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/math/vector-h.gc b/goal_src/jak2/engine/math/vector-h.gc index 27a7deee1e..0ed8557e2a 100644 --- a/goal_src/jak2/engine/math/vector-h.gc +++ b/goal_src/jak2/engine/math/vector-h.gc @@ -5,5 +5,754 @@ ;; name in dgo: vector-h ;; dgos: ENGINE, GAME +;; Changes: +;; - vector+!, vector-!, vector-dot, vector4-dot replaced with actual implementations. + ;; DECOMP BEGINS +;; Array of booleans, stored as bits. +(deftype bit-array (basic) + ((length int32 :offset-assert 4) + (allocated-length int32 :offset-assert 8) + (_pad uint8 :offset-assert 12) + (bytes uint8 :dynamic :offset 12) + ) + :method-count-assert 13 + :size-assert #xd + :flag-assert #xd0000000d + (:methods + (new (symbol type int) _type_ 0) + (get-bit (_type_ int) symbol 9) + (clear-bit (_type_ int) int 10) + (set-bit (_type_ int) int 11) + (clear-all! (_type_) _type_ 12) + ) + ) + +(defmethod new bit-array ((allocation symbol) (type-to-make type) (arg0 int)) + "Allocate a new bit-array with room arg0 bits." + (let ((v0-0 (object-new allocation type-to-make (+ (/ (logand -8 (+ arg0 7)) 8) -1 (-> type-to-make size))))) + (set! (-> v0-0 length) arg0) + (set! (-> v0-0 allocated-length) arg0) + v0-0 + ) + ) + +(defmethod length bit-array ((obj bit-array)) + "Get the number of bits." + (-> obj length) + ) + +(defmethod asize-of bit-array ((obj bit-array)) + "Get the size in memory." + (the-as int (+ (-> obj type size) (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))) + ) + +(defmethod get-bit bit-array ((obj bit-array) (arg0 int)) + "Get the nth bit as a boolean." + (let ((v1-2 (-> obj bytes (/ arg0 8)))) + (logtest? v1-2 (ash 1 (logand arg0 7))) + ) + ) + +(defmethod clear-bit bit-array ((obj bit-array) (arg0 int)) + "Set the nth bit to 0." + (logclear! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) + 0 + ) + +(defmethod set-bit bit-array ((obj bit-array) (arg0 int)) + "Set the nth bit to 1." + (logior! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) + 0 + ) + +(defmethod clear-all! bit-array ((obj bit-array)) + "Set all bits to 0." + (countdown (v1-2 (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) + (nop!) + (nop!) + (set! (-> obj bytes v1-2) (the-as uint 0)) + ) + obj + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; vector types +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defmacro init-vf0-vector () + "Initializes the VF0 vector which is a constant vector in the VU set to <0,0,0,1>" + `(.lvf vf0 (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 1.0)) + ) + +;; generally named after number of elements. +;; u is unsigned, b = byte, h = halfword (16-bit), w = word (32-bit), d = doubleword (64-bit) +;; s = float (single precision) + +;; BYTE vectors + +(deftype vector16ub (structure) + ((data uint8 16 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype vector4ub (structure) + ((data uint8 4 :offset-assert 0) + (x uint8 :offset 0) + (y uint8 :offset 1) + (z uint8 :offset 2) + (w uint8 :offset 3) + (clr uint32 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vector4b (structure) + ((data int8 4 :offset-assert 0) + (x int8 :offset 0) + (y int8 :offset 1) + (z int8 :offset 2) + (w int8 :offset 3) + (clr int32 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vector2ub (structure) + ((data uint8 2 :offset-assert 0) + (x uint8 :offset 0) + (y uint8 :offset 1) + (clr uint16 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +(deftype vector2b (structure) + ((data int8 2 :offset-assert 0) + (x int8 :offset 0) + (y int8 :offset 1) + (clr int16 :offset 0) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; HALFWORD vectors + +(deftype vector2h (structure) + ((data int16 2 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vector2uh (structure) + ((data uint16 2 :offset-assert 0) + (x uint16 :offset 0) + (y uint16 :offset 2) + (val uint32 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vector3h (structure) + ((data int16 3 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +(deftype vector3uh (structure) + ((data uint16 3 :offset-assert 0) + (x uint16 :offset 0) + (y uint16 :offset 2) + (z uint16 :offset 4) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; WORD vectors + +(deftype vector2w (structure) + ((data int32 2 :offset-assert 0) + (x int32 :offset 0) + (y int32 :offset 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype vector3w (structure) + ((data int32 3 :offset-assert 0) + (x int32 :offset 0) + (y int32 :offset 4) + (z int32 :offset 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype vector4w (structure) + ((data uint32 4 :offset-assert 0) + (x int32 :offset 0) + (y int32 :offset 4) + (z int32 :offset 8) + (w int32 :offset 12) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; FLOAT vectors + +(deftype vector2 (structure) + ((data float 2 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype vector3 (structure) + ((data float 3 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; Note: typically vector is used instead of vector4. +;; vector usually means "xyz only, with w = 1", and vector4 +;; is sometimes used when w is more meaningful. +(deftype vector4 (structure) + ((data float 4 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (w float :offset 12) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +;; SPECIAL vectors + +(defmethod print vector4w ((obj vector4w)) + "Print a vector4w" + (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) + obj + ) + +;; group of 2 vector4w's +(deftype vector4w-2 (structure) + ((data int32 8 :offset-assert 0) + (quad uint128 2 :offset 0) + (vector vector4w 2 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(deftype vector4w-3 (structure) + ((data int32 12 :offset-assert 0) + (quad uint128 3 :offset 0) + (vector vector4w 3 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype vector4w-4 (structure) + ((data int32 16 :offset-assert 0) + (quad uint128 4 :offset 0) + (vector vector4w 4 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype vector4h (structure) + ((data int16 4 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (w int16 :offset 6) + (long uint64 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype vector8h (structure) + ((data int16 8 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(deftype vector16b (structure) + ((data int8 16 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + + +(defmethod inspect vector ((obj vector)) + "Inspect a vector." + (format #t "[~8x] vector~%" obj) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) + obj + ) + +(defmethod print vector ((obj vector)) + "Print a vector." + (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) + obj + ) + +;; Constant Vectors + +(define *null-vector* (new 'static 'vector :w 1.0)) +(define *identity-vector* (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) +(define *x-vector* (new 'static 'vector :x 1.0 :w 1.0)) +(define *y-vector* (new 'static 'vector :y 1.0 :w 1.0)) +(define *z-vector* (new 'static 'vector :z 1.0 :w 1.0)) +(define *up-vector* (new 'static 'vector :y 1.0 :w 1.0)) + +;; SPECIAL vector (of floats) + +(deftype vector4s-3 (structure) + ((data float 12 :offset-assert 0) + (quad uint128 3 :offset 0) + (vector vector 3 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition of type vector-array +(deftype vector-array (inline-array-class) + ((data vector :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> vector-array heap-base) (the-as uint 16)) + +(deftype rgbaf (vector) + ((r float :offset 0) + (g float :offset 4) + (b float :offset 8) + (a float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; ax + by + cz = d form +(deftype plane (vector) + ((a float :offset 0) + (b float :offset 4) + (c float :offset 8) + (d float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype sphere (vector) + ((r float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype isphere (vec4s) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(defmacro static-vectorm (x y z w) + `(new 'static 'vector :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,w)) + ) +(defmacro static-spherem (x y z r) + "actually makes a vector. use bspherem for sphere." + `(new 'static 'vector :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,r)) + ) +(defmacro static-bspherem (x y z r) + `(new 'static 'sphere :x (meters ,x) :y (meters ,y) :z (meters ,z) :w (meters ,r)) + ) + +;; box, stored as 8 floats (min/max along each dim, unused w's) +(deftype box8s (structure) + ((data float 8 :offset-assert 0) + (quad uint128 2 :offset 0) + (vector vector 2 :offset 0) + (min vector :inline :offset 0) + (max vector :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype box8s-array (inline-array-class) + ((data box8s :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(set! (-> box8s-array heap-base) (the-as uint 32)) + +;; actually a capsule +(deftype cylinder (structure) + ((origin vector :inline :offset-assert 0) + (axis vector :inline :offset-assert 16) + (radius float :offset-assert 32) + (length float :offset-assert 36) + ) + :method-count-assert 11 + :size-assert #x28 + :flag-assert #xb00000028 + (:methods + (debug-draw (_type_ vector4w) none 9) + (ray-capsule-intersect (_type_ vector vector) float 10) + ) + ) + +;; a normal cylinder +(deftype cylinder-flat (structure) + ((origin vector :inline :offset-assert 0) + (axis vector :inline :offset-assert 16) + (radius float :offset-assert 32) + (length float :offset-assert 36) + ) + :method-count-assert 11 + :size-assert #x28 + :flag-assert #xb00000028 + (:methods + (debug-draw (_type_ vector4w) none 9) + (ray-flat-cyl-intersect (_type_ vector vector) float 10) + ) + ) + +(deftype vertical-planes (structure) + ((data uint128 4 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype vertical-planes-array (basic) + ((length uint32 :offset-assert 4) + (data vertical-planes :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype qword (structure) + ((data uint32 4 :offset-assert 0) + (byte uint8 16 :offset 0) + (hword uint16 8 :offset 0) + (word uint32 4 :offset 0) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) + (vector vector :inline :offset 0) + (vector4w vector4w :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype vector3s (structure) + ((data float 3 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(define-extern vector-cross! (function vector vector vector vector)) +(define-extern vector-float*! (function vector vector float vector)) +(define-extern vector-identity! (function vector vector)) +(define-extern vector-normalize! (function vector float vector)) +(define-extern vector-normalize-copy! (function vector vector float vector)) +(define-extern vector-length (function vector float)) +(define-extern vector-length-squared (function vector float)) +(define-extern vector-xz-normalize! (function vector float vector)) +(define-extern vector-xz-length (function vector float)) +(define-extern vector+float*! (function vector vector vector float vector)) +(define-extern vector-vector-distance-squared (function vector vector float)) +(define-extern vector-negate! (function vector vector vector)) +(define-extern vector-normalize-ret-len! (function vector float float)) +(define-extern vector-vector-distance (function vector vector float)) + +;; Macros and inline functions. +;; These are inlined for performance reasons + +(defmacro set-vector! (v xv yv zv wv) + "Set all fields in a vector" + (with-gensyms (vec) + `(let ((,vec ,v)) + (set! (-> ,vec x) ,xv) + (set! (-> ,vec y) ,yv) + (set! (-> ,vec z) ,zv) + (set! (-> ,vec w) ,wv) + ,vec + )) + ) + +(defun vector-dot ((a vector) (b vector)) + "Take the dot product of two vectors. + Only does the x, y, z compoments. + Originally handwritten assembly to space out loads and use FPU accumulator" + (declare (inline)) + (let ((result 0.)) + (+! result (* (-> a x) (-> b x))) + (+! result (* (-> a y) (-> b y))) + (+! result (* (-> a z) (-> b z))) + result + ) + ) + +(defun vector-dot-vu ((arg0 vector) (arg1 vector)) + "Take the dot product (xyz only). Using VU0." + (local-vars (v0-0 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector4-dot ((a vector) (b vector)) + "Take the dot product of two vectors. + Does the x, y, z, and w compoments" + (declare (inline)) + (let ((result 0.)) + (+! result (* (-> a x) (-> b x))) + (+! result (* (-> a y) (-> b y))) + (+! result (* (-> a z) (-> b z))) + (+! result (* (-> a w) (-> b w))) + result + ) + ) + +(defun vector4-dot-vu ((arg0 vector) (arg1 vector)) + "Take the dot product (xyzw). Using VU0." + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.w.vf vf3 vf0 vf0 :mask #b1) + (.mul.x.vf acc vf3 vf1 :mask #b1) + (.add.mul.y.vf acc vf3 vf1 acc :mask #b1) + (.add.mul.z.vf acc vf3 vf1 acc :mask #b1) + (.add.mul.w.vf vf1 vf3 vf1 acc :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defmacro print-vf (vf &key (name #f)) + "Print out a vf register as a vector." + `(let ((temp (new 'stack 'vector))) + (.svf temp ,vf) + ,(if name + `(format #t "~A: ~`vector`P~%" (quote ,name) temp) + `(format #t "~`vector`P~%" temp) + ) + ) + ) + +(defmacro print-vf-hex (vf) + "Print out a vf register as 4x 32-bit hexadecimal integers" + `(let ((temp (new 'stack 'vector4w))) + (.svf temp ,vf) + (format #t "~`vector4w`P~%" temp) + ) + ) + +(defmacro print-vf-dec (vf) + "Print out a vf register as 4x 32-bit base-10 integers" + `(let ((temp (new 'stack 'vector4w))) + (.svf temp ,vf) + (format #t " ~d ~d ~d ~d~%" (-> temp data 0) (-> temp data 1) (-> temp data 2) (-> temp data 3)) + ) + ) + +(defun vector+! ((dst vector) (a vector) (b vector)) + "Set dst = a + b. The w component of dst is set to 0." + (declare (inline)) + (rlet ((vf0 :class vf :reset-here #t) + (vf1 :class vf :reset-here #t) + (vf2 :class vf :reset-here #t) + (vf3 :class vf :reset-here #t)) + ;; load vectors + (.lvf vf2 a) + (.lvf vf3 b) + (init-vf0-vector) + ;; add + (.add.vf vf1 vf2 vf3) + ;; set w = 1 + (.blend.vf vf1 vf1 vf0 :mask #b1000) + ;; store + (.svf dst vf1) + ) + dst + ) + +(defun vector-! ((dst vector) (a vector) (b vector)) + "Set dst = a - b. The w componenent of dst is set to 0." + (declare (inline)) + (rlet ((vf0 :class vf :reset-here #t) + (vf1 :class vf :reset-here #t) + (vf2 :class vf :reset-here #t) + (vf3 :class vf :reset-here #t)) + ;; load vectors + (.lvf vf2 a) + (.lvf vf3 b) + (init-vf0-vector) + ;; subtract + (.sub.vf vf1 vf2 vf3) + ;; set w = 1 + (.blend.vf vf1 vf1 vf0 :mask #b1000) + ;; store + (.svf dst vf1) + ) + dst + ) + +(defun vector-zero! ((dest vector)) + "Set xyzw to 0." + (declare (inline)) + (rlet ((vf1 :class vf :reset-here #t)) + ;; set vf1 = 0 + (.xor.vf vf1 vf1 vf1) + ;; store the 0 + (.svf dest vf1) + ) + dest + ) + +(defun vector-reset! ((dst vector)) + "Set vector to 0,0,0,1." + (declare (inline)) + (vector-zero! dst) + (set! (-> dst w) 1.0) + dst + ) + +(defun vector-copy! ((arg0 vector) (arg1 vector)) + "Copy arg1 to arg0." + (declare (inline)) + (set! (-> arg0 quad) (-> arg1 quad)) + arg0 + ) + +(defun vector-length< ((arg0 vector) (arg1 float)) + (let ((f0-0 (vector-length-squared arg0)) + (f1-0 arg1) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + +(defun vector-length> ((arg0 vector) (arg1 float)) + (< (* arg1 arg1) (vector-length-squared arg0)) + ) + +(define *zero-vector* (new 'static 'vector)) + +(defmacro new-stack-vector0 () + "Get a stack vector that's set to 0. + This is more efficient than (new 'stack 'vector) because + this doesn't call the constructor." + `(let ((vec (new 'stack-no-clear 'vector))) + (set! (-> vec quad) (the-as uint128 0)) + vec + ) + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/math/vector.gc b/goal_src/jak2/engine/math/vector.gc index c1f42a4915..5faea9332c 100644 --- a/goal_src/jak2/engine/math/vector.gc +++ b/goal_src/jak2/engine/math/vector.gc @@ -7,3 +7,1735 @@ ;; DECOMP BEGINS +(defun vector-cross! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Compute the cross product. The w component is set to junk." + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector-xz-cross! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Compute the cross product of the xz components of inputs." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.add.x.vf vf1 vf0 vf0 :mask #b10) + (.add.x.vf vf2 vf0 vf0 :mask #b10) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector+float! ((arg0 vector) (arg1 vector) (arg2 float)) + "Add float to each component of vector. The w component is set to 1" + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.mov vf6 arg2) + (.lvf vf4 (&-> arg1 quad)) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +(defun vector*! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Elementwise product. Set w = 1" + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg2 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +(defun vector+*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "set arg0 = arg1 + (arg3 * arg2). The w component will be set to 1" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg2 quad)) + (.lvf vf4 (&-> arg1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +(defun vector-*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Set arg0 = arg1 - (arg3 * arg2). The w component will be set to 1." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg2 quad)) + (.lvf vf4 (&-> arg1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.w.vf acc vf4 vf0 :mask #b111) + (.sub.mul.x.vf vf6 vf5 vf7 acc :mask #b111) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +(defun vector/! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Set arg0 = arg1 / arg2. The w component will be set to 1. + The implementation is kind of crazy." + (rlet ((Q :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.lvf vf5 (&-> arg2 quad)) + (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b1) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.lvf vf4 (&-> arg1 quad)) + (let ((v1-0 (/ (-> arg1 x) (-> arg2 x)))) + (.wait.vf) + (.mul.vf vf6 vf4 Q :mask #b10) + (.nop.vf) + (.nop.vf) + (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b10) + (.mov vf7 v1-0) + ) + (.add.x.vf vf6 vf0 vf7 :mask #b1) + (.wait.vf) + (.mul.vf vf6 vf4 Q :mask #b100) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +(defun vector-float*! ((arg0 vector) (arg1 vector) (arg2 float)) + "Multiply all values in a vector by arg2. Set w to 1." + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf2 arg2) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun vector-average! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Set arg0 to the average of arg1 and arg2. Set w to 1." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 #x3f000000)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov vf3 v1-0) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf1 vf3) + (.add.mul.x.vf vf4 vf2 vf3 acc :mask #b111) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun vector+float*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "arg0 = arg1 + arg2 * arg3." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf3 arg3) + (.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 (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun vector--float*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Set arg0 = arg1 - (arg2 * arg3). The w component will be set to 1 + Is this different from vector-*!" + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf3 arg3) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.w.vf acc vf1 vf0) + (.sub.mul.x.vf vf4 vf2 vf3 acc :mask #b111) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun vector-float/! ((arg0 vector) (arg1 vector) (arg2 float)) + "Divide all components by arg2. The w component will be set to 1." + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.mov vf3 arg2) + (.div.vf Q vf0 vf3 :fsf #b11 :ftf #b0) + (.lvf vf1 (&-> arg1 quad)) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf4 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun vector-negate! ((arg0 vector) (arg1 vector)) + "Negate xyz, set w to 1" + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.sub.vf vf4 vf0 vf1 :mask #b111) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +(defun vector-negate-in-place! ((arg0 vector)) + "Negate xyz. Doesn't touch w." + (rlet ((vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.sub.vf vf1 vf0 vf1 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun vector= ((arg0 vector) (arg1 vector)) + "Are the two vectors equal? Does not compare the w component. + The implementation is cool." + + ;; (label L91) + ;; (set! v0-0 #t) + ;; (set! v1-0 #xffff) + (let* ((v1-0 #xffff) + ;; (set! a0-1 (l.q a0-0)) + (a0-1 (-> arg0 quad)) + ;; (set! v1-1 (sll v1-0 48)) + (v1-1 (shl v1-0 48)) + ;; (set! a1-1 (l.q a1-0)) + (a1-1 (-> arg1 quad)) + (a0-2 (the uint128 0)) + (r0 (the uint128 0)) + ) + ;; (.pceqw a0-2 a0-1 a1-1) + (.pceqw a0-2 a0-1 a1-1) + ;; (.ppach a0-3 r0-0 a0-2) + (.ppach a0-2 r0 a0-2) + ;; (set! v1-2 (logior a0-3 v1-1)) + (set! v1-1 (logior (the int a0-2) v1-1)) + ;; (set! v1-3 (+ v1-2 1)) + ;; will overflow the 64-bit integer if xyz is equal. + (set! v1-1 (+ v1-1 1)) + (zero? v1-1) + ) + + ;; (b! (zero? v1-3) L92 (nop!)) + ;; (set! v0-0 #f) + ;; (label L92) + ;; (ret-value v0-0) + + ) + +(defun vector-delta ((arg0 vector) (arg1 vector)) + "Sum of the elementwise absolute value of differences" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.sub.vf vf1 vf2 vf1) + (.abs.vf vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov v0-0 vf3) + v0-0 + ) + ) + +(defun vector-seek! ((arg0 vector) (arg1 vector) (arg2 float)) + "Seek arg0 toward arg1. The arg0 is both read and written. + arg2 is saturated to (0, 1)" + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.mov vf4 arg2) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg0 quad)) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.sub.x.vf vf5 vf0 vf4 :mask #b1) + (.sub.vf vf3 vf1 vf2 :mask #b111) + (.min.x.vf vf3 vf3 vf4 :mask #b111) + (.max.x.vf vf3 vf3 vf5 :mask #b111) + (.add.vf vf1 vf2 vf3 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun vector-smooth-seek! ((arg0 vector) (arg1 vector) (arg2 float)) + "Smoothly seek vec toward target. + The step always points toward the target and has length (dist * alpha) + If the step is longer than max-step, the step is projected onto a _square_ with side length arg2. + Note that this doesn't project to a circle like the function below..." + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg1 arg0) + (let ((v0-0 arg0)) + (let ((a1-2 (fmin 1.0 arg2))) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> v1-0 quad)) + (.lvf vf4 (&-> arg0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +(defun vector-seek-2d-xz-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + "Smoothly seek vec's x and z components toward target. + The step always points toward the target and has length (dist * alpha) + If the step is longer than max-step, the step is projected onto a circle of radius max-step. + Doesn't touch y or w." + (let ((f0-1 (- (-> arg1 x) (-> arg0 x))) + (f2-1 (- (-> arg1 z) (-> arg0 z))) + ) + (when (or (!= f0-1 0.0) (!= f2-1 0.0)) + (let* ((f1-5 (* f0-1 arg3)) + (f0-3 (* f2-1 arg3)) + (f2-4 (sqrtf (+ (* f1-5 f1-5) (* f0-3 f0-3)))) + ) + (cond + ((>= arg2 f2-4) + (+! (-> arg0 x) f1-5) + (+! (-> arg0 z) f0-3) + ) + (else + (let ((f2-6 (/ arg2 f2-4))) + (+! (-> arg0 x) (* f2-6 f1-5)) + (+! (-> arg0 z) (* f2-6 f0-3)) + ) + ) + ) + ) + ) + ) + arg0 + ) + +(defun vector-seek-2d-yz-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + "Smoothly seek vec's y and z components toward target. + The step always points toward the target and has length (dist * alpha) + If the step is longer than max-step, the step is projected onto a circle of radius max-step. + Doesn't touch x or w." + (let ((f0-1 (- (-> arg1 y) (-> arg0 y))) + (f2-1 (- (-> arg1 z) (-> arg0 z))) + ) + (when (or (!= f0-1 0.0) (!= f2-1 0.0)) + (let* ((f1-5 (* f0-1 arg3)) + (f0-3 (* f2-1 arg3)) + (f2-4 (sqrtf (+ (* f1-5 f1-5) (* f0-3 f0-3)))) + ) + (cond + ((>= arg2 f2-4) + (+! (-> arg0 y) f1-5) + (+! (-> arg0 z) f0-3) + ) + (else + (let ((f2-6 (/ arg2 f2-4))) + (+! (-> arg0 y) (* f2-6 f1-5)) + (+! (-> arg0 z) (* f2-6 f0-3)) + ) + ) + ) + ) + ) + ) + arg0 + ) + +(defun vector-seek-3d-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + "Smoothly seek vec's x, y, and z components toward target. + The step always points toward the target and has length (dist * alpha) + If the step is longer than max-step, the step is projected onto a circle of radius max-step. + Doesn't touch w." + (let ((f0-1 (- (-> arg1 x) (-> arg0 x))) + (f1-2 (- (-> arg1 y) (-> arg0 y))) + (f3-1 (- (-> arg1 z) (-> arg0 z))) + ) + (when (or (!= f0-1 0.0) (!= f1-2 0.0) (!= f3-1 0.0)) + (let* ((f2-6 (* f0-1 arg3)) + (f1-3 (* f1-2 arg3)) + (f0-4 (* f3-1 arg3)) + (f3-5 (sqrtf (+ (* f2-6 f2-6) (* f1-3 f1-3) (* f0-4 f0-4)))) + ) + (cond + ((>= arg2 f3-5) + (+! (-> arg0 x) f2-6) + (+! (-> arg0 y) f1-3) + (+! (-> arg0 z) f0-4) + ) + (else + (let ((f3-7 (/ arg2 f3-5))) + (+! (-> arg0 x) (* f3-7 f2-6)) + (+! (-> arg0 y) (* f3-7 f1-3)) + (+! (-> arg0 z) (* f3-7 f0-4)) + ) + ) + ) + ) + ) + ) + arg0 + ) + +(defun seek-with-smooth ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Move value closer to target. + If we are within deadband, just go straight to target. + If not, try to go alpha*err. If that is a larger step than max-step, limit to max-step" + (let ((f0-1 (- arg1 arg0))) + (cond + ((>= arg4 (fabs f0-1)) + arg1 + ) + (else + (let ((f0-2 (* f0-1 arg3))) + (let ((f1-4 (- arg2))) + (cond + ((< f0-2 f1-4) + (set! f0-2 f1-4) + ) + ((< arg2 f0-2) + (set! f0-2 arg2) + ) + ) + ) + (+ f0-2 arg0) + ) + ) + ) + ) + ) + +(defun vector-identity! ((arg0 vector)) + "Set arg0 to 1, 1, 1, 1" + (set! (-> arg0 x) 1.0) + (set! (-> arg0 y) 1.0) + (set! (-> arg0 z) 1.0) + (set! (-> arg0 w) 1.0) + arg0 + ) + +(defun vector-seconds ((arg0 vector) (arg1 vector)) + "Convert from actual seconds to the seconds unit." + (set! (-> arg0 x) (* 300.0 (-> arg1 x))) + (set! (-> arg0 y) (* 300.0 (-> arg1 y))) + (set! (-> arg0 z) (* 300.0 (-> arg1 z))) + arg0 + ) + +(defun vector-seconds! ((arg0 vector)) + "Convert from actual seconds to seconds, in place" + (set! (-> arg0 x) (* 300.0 (-> arg0 x))) + (set! (-> arg0 y) (* 300.0 (-> arg0 y))) + (set! (-> arg0 z) (* 300.0 (-> arg0 z))) + arg0 + ) + +(defun vector-v! ((arg0 vector)) + "Convert a velocity to a displacement per frame. The velocity should be in X/actual_second. + Uses the current process clock." + (with-pp + (vector-float*! arg0 arg0 (-> pp clock seconds-per-frame)) + arg0 + ) + ) + +(defun vector-v+! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Euler forward step, using the current display time settings" + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((f0-0 (-> pp clock seconds-per-frame))) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (let ((a1-1 f0-0)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +(defun vector-v*float+! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Euler forward step, scaling velocity by velocity-scale" + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((f0-1 (* arg3 (-> pp clock seconds-per-frame)))) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (let ((a1-1 f0-1)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +(defun vector-v++! ((arg0 vector) (arg1 vector)) + "Update position in place, using display's current timing" + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((a2-0 arg0) + (f0-0 (-> pp clock seconds-per-frame)) + ) + (.lvf vf2 (&-> arg1 quad)) + (.lvf vf1 (&-> a2-0 quad)) + (let ((a1-1 f0-0)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +(defun vector-v*float! ((arg0 vector) (arg1 vector) (arg2 float)) + "Go from velocity to delta-p per frame, scaling by scale" + (with-pp + (the-as vector (vector-float*! arg0 arg1 (* arg2 (-> pp clock seconds-per-frame)))) + ) + ) + +(defun vector-v*float++! ((arg0 vector) (arg1 vector) (arg2 float)) + "update position with given velocity, scaled by scale." + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((a3-0 arg0) + (f0-1 (* arg2 (-> pp clock seconds-per-frame))) + ) + (.lvf vf2 (&-> arg1 quad)) + (.lvf vf1 (&-> a3-0 quad)) + (let ((a1-1 f0-1)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +(defun vector-to-ups! ((arg0 vector) (arg1 vector)) + "Go from units per frame to units per second?" + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (let ((f0-0 (-> pp clock frames-per-second))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + ) + +(defun vector-from-ups! ((arg0 vector) (arg1 vector)) + "Go from units per second to units per frame?" + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (let ((f0-0 (-> pp clock seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + ) + +(defun vector-length ((arg0 vector)) + "Get the length of the xyz part." + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.z.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-length-squared ((arg0 vector)) + "Get the squared length of the xyz part." + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-xz-length-squared ((arg0 vector)) + "Get the length of the xz part, squared." + (+ (* (-> arg0 x) (-> arg0 x)) (* (-> arg0 z) (-> arg0 z))) + ) + +(defun vector-xz-length ((arg0 vector)) + "Get the length of the xz part" + (sqrtf (+ (* (-> arg0 x) (-> arg0 x)) (* (-> arg0 z) (-> arg0 z)))) + ) + +(defun vector-vector-distance ((arg0 vector) (arg1 vector)) + "Subtract the xyz parts and get the norm" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.z.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-vector-distance-squared ((arg0 vector) (arg1 vector)) + "Squared norm of the difference of the xyz parts" + (local-vars (v0-0 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-vector-xz-distance ((arg0 vector) (arg1 vector)) + "Distance on the xz plane" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.z.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-vector-xy-distance ((arg0 vector) (arg1 vector)) + "distance on the xy plane" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-vector-xz-distance-squared ((arg0 vector) (arg1 vector)) + "Distance on the xz plane squared" + (local-vars (v0-0 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +(defun vector-normalize! ((arg0 vector) (arg1 float)) + "Modify arg0 in place to have length arg1 for its xyz components. The w part is not changed." + (let ((f0-0 (vector-length arg0))) + (let ((v1-1 (/ arg1 f0-0))) + (set! (-> arg0 data 0) (* (-> arg0 data 0) v1-1)) + (set! (-> arg0 data 1) (* (-> arg0 data 1) v1-1)) + (set! (-> arg0 data 2) (* (-> arg0 data 2) v1-1)) + ) + ) + arg0 + ; (rlet ((acc :class vf) + ; (Q :class vf) + ; (vf0 :class vf) + ; (vf1 :class vf) + ; (vf2 :class vf) + ; (vf3 :class vf) + ; ) + ; (init-vf0-vector) + ; (.lvf vf1 (&-> arg0 quad)) + ; (.mul.vf vf2 vf1 vf1 :mask #b111) + ; (let ((v1-0 arg1)) + ; (.mov vf3 v1-0) + ; ) + ; (.mul.x.vf acc vf0 vf2 :mask #b1000) + ; (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + ; (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + ; (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + ; (.wait.vf) + ; (.mul.vf vf1 vf1 Q :mask #b111) + ; (.nop.vf) + ; (.nop.vf) + ; (.nop.vf) + ; (.svf (&-> arg0 quad) vf1) + ; arg0 + ; ) + ) + +(defun vector-normalize-ret-len! ((arg0 vector) (arg1 float)) + "Modify arg0 in place to have length arg1 for its xyz components. + The w part isn't changed and the _original_ length is returned." + (let ((f0-0 (vector-length arg0))) + (let ((v1-1 (/ arg1 f0-0))) + (set! (-> arg0 data 0) (* (-> arg0 data 0) v1-1)) + (set! (-> arg0 data 1) (* (-> arg0 data 1) v1-1)) + (set! (-> arg0 data 2) (* (-> arg0 data 2) v1-1)) + ) + f0-0 + ) + + ; (local-vars (v1-1 float)) + ; (rlet ((acc :class vf) + ; (Q :class vf) + ; (vf0 :class vf) + ; (vf1 :class vf) + ; (vf2 :class vf) + ; (vf3 :class vf) + ; ) + ; (init-vf0-vector) + ; (.lvf vf1 (&-> arg0 quad)) + ; (.mul.vf vf2 vf1 vf1 :mask #b111) + ; (let ((v1-0 arg1)) + ; (.mov vf3 v1-0) + ; ) + ; (.mul.x.vf acc vf0 vf2 :mask #b1000) + ; (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + ; (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + ; (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + ; (.add.w.vf vf2 vf0 vf2 :mask #b1) + ; (.mov v1-1 vf2) + ; (let ((v0-0 (sqrtf v1-1))) + ; (.wait.vf) + ; (.mul.vf vf1 vf1 Q :mask #b111) + ; (.nop.vf) + ; (.nop.vf) + ; (.nop.vf) + ; (.svf (&-> arg0 quad) vf1) + ; v0-0 + ; ) + ; ) + ) + +(defun vector-normalize-copy! ((arg0 vector) (arg1 vector) (arg2 float)) + "Normalize, but not in place. + This implementation is very good compared to the vector-normalize! one. + The w component is set to 1." + (let ((f0-0 (vector-length arg1))) + (cond + ((= f0-0 0.0) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + (else + (let ((v1-3 (/ arg2 f0-0))) + (set! (-> arg0 x) (* (-> arg1 x) v1-3)) + (set! (-> arg0 y) (* (-> arg1 y) v1-3)) + (set! (-> arg0 z) (* (-> arg1 z) v1-3)) + ) + ) + ) + ) + (set! (-> arg0 w) 1.0) + arg0 + ) + +(defun vector-xz-normalize! ((arg0 vector) (arg1 float)) + "Normalize, xz components only" + (let* ((v1-0 arg0) + (f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z))))) + ) + (when (!= f0-4 0.0) + (let ((v1-3 (/ arg1 f0-4))) + (set! (-> arg0 x) (* (-> arg0 x) v1-3)) + (set! (-> arg0 z) (* (-> arg0 z) v1-3)) + ) + ) + ) + arg0 + ) + +(defun vector-xz-normalize-copy! ((arg0 vector) (arg1 vector) (arg2 float)) + "Normalize, xz components only" + (let* ((v1-0 arg1) + (f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z))))) + ) + (cond + ((= f0-4 0.0) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + (else + (let ((v1-3 (/ arg2 f0-4))) + (set! (-> arg0 x) (* (-> arg1 x) v1-3)) + (set! (-> arg0 y) 0.0) + (set! (-> arg0 z) (* (-> arg1 z) v1-3)) + ) + ) + ) + ) + (set! (-> arg0 w) 1.0) + arg0 + ) + +(defun vector-length-max! ((arg0 vector) (arg1 float)) + "Make vector at most arg1 length (xyz only). + If it is larger, project onto sphere. + Doesn't touch w" + ;; note: converted to asm in jak 2 + (let ((f0-0 (vector-length arg0))) + (when (not (or (= f0-0 0.0) (< f0-0 arg1))) + (let ((f0-1 (/ f0-0 arg1))) + (when (!= f0-1 0.0) + (set! (-> arg0 x) (/ (-> arg0 x) f0-1)) + (set! (-> arg0 y) (/ (-> arg0 y) f0-1)) + (set! (-> arg0 z) (/ (-> arg0 z) f0-1)) + ) + ) + ) + ) + arg0 + ) + +(defun vector-xz-length-max! ((arg0 vector) (arg1 float)) + "Make vector at most arg1 length (xz only). + It it is larger, project onto circle. + Doesn't touch w or y" + (let* ((v1-0 arg0) + (f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z))))) + ) + (when (not (or (= f0-4 0.0) (< f0-4 arg1))) + (let ((f0-5 (/ f0-4 arg1))) + (when (!= f0-5 0.0) + (set! (-> arg0 x) (/ (-> arg0 x) f0-5)) + (set! (-> arg0 z) (/ (-> arg0 z) f0-5)) + ) + ) + ) + ) + arg0 + ) + +(defun vector-rotate-around-x! ((arg0 vector) (arg1 vector) (arg2 float)) + "Rotate a vector around the x axis" + (let* ((f28-0 (- arg2)) + (f30-0 (cos f28-0)) + (f1-0 (sin f28-0)) + (f2-0 (-> arg1 z)) + (f0-1 (-> arg1 y)) + ) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 z) (- (* f2-0 f30-0) (* f0-1 f1-0))) + (set! (-> arg0 y) (+ (* f2-0 f1-0) (* f0-1 f30-0))) + ) + arg0 + ) + +(defun vector-rotate-around-y! ((arg0 vector) (arg1 vector) (arg2 float)) + "Rotate a vector around the y axis" + (let ((f26-0 (-> arg1 z)) + (f30-0 (-> arg1 x)) + (f28-0 (cos arg2)) + (f0-0 (sin arg2)) + ) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 z) (- (* f26-0 f28-0) (* f30-0 f0-0))) + (set! (-> arg0 x) (+ (* f26-0 f0-0) (* f30-0 f28-0))) + ) + arg0 + ) + +(defun vector-rotate90-around-y! ((arg0 vector) (arg1 vector)) + "Rotate a vector 90 degrees around y." + (set! (-> arg0 quad) (-> arg1 quad)) + (let ((f0-0 (-> arg0 x))) + (set! (-> arg0 x) (- (-> arg1 z))) + (set! (-> arg0 z) f0-0) + ) + arg0 + ) + +(defun vector-rotate-around-z! ((arg0 vector) (arg1 vector) (arg2 float)) + "Rotate a vector around the z axis" + (let ((f26-0 (-> arg1 x)) + (f30-0 (-> arg1 y)) + (f28-0 (cos arg2)) + (f0-0 (sin arg2)) + ) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 x) (- (* f26-0 f28-0) (* f30-0 f0-0))) + (set! (-> arg0 y) (+ (* f26-0 f0-0) (* f30-0 f28-0))) + ) + arg0 + ) + +(defun rotate-y<-vector+vector ((arg0 vector) (arg1 vector)) + "Get the y rotation between vectors. These should have the same length." + (atan (- (-> arg1 x) (-> arg0 x)) (- (-> arg1 z) (-> arg0 z))) + ) + +(defun rotate-x<-vector+vector ((arg0 vector) (arg1 vector)) + "Get the x rotation between vectors. These should have the same length." + (atan (- (-> arg1 y) (-> arg0 y)) (- (-> arg1 z) (-> arg0 z))) + ) + +(defun rotate-z<-vector+vector ((arg0 vector) (arg1 vector)) + "Get the z rotation between vectors. These should have the same length." + (atan (- (-> arg1 x) (-> arg0 x)) (- (-> arg1 y) (-> arg0 y))) + ) + +(defun vector-cvt.w.s! ((arg0 vector) (arg1 vector)) + "Convert float to int32. Truncate." + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun vector-cvt.s.w! ((arg0 vector) (arg1 vector)) + "Convert float to int32." + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun rot-zxy-from-vector! ((arg0 vector) (arg1 vector)) + "I think this gives you a vector of euler angles to rotate some unit vector + to arg1." + (let* ((f28-0 (-> arg1 z)) + (f30-0 (-> arg1 x)) + (f0-0 (atan f30-0 f28-0)) + ) + (set! (-> arg0 y) f0-0) + (let* ((f26-0 (- f0-0)) + (f0-4 (- (* f28-0 (cos f26-0)) (* f30-0 (sin f26-0)))) + ) + (set! (-> arg0 x) (atan (- (-> arg1 y)) f0-4)) + ) + ) + (set! (-> arg0 z) 0.0) + arg0 + ) + +(defun rot-zyx-from-vector! ((arg0 vector) (arg1 vector)) + "I think this gives you a vector of euler angles to rotate some unit vector + to arg1." + (let* ((f28-0 (-> arg1 z)) + (f30-0 (- (-> arg1 y))) + (f0-1 (atan f30-0 f28-0)) + ) + (set! (-> arg0 x) f0-1) + (let* ((f26-0 (- f0-1)) + (f0-5 (- (* f28-0 (cos f26-0)) (* f30-0 (sin f26-0)))) + ) + (set! (-> arg0 y) (atan (-> arg1 x) f0-5)) + ) + ) + (set! (-> arg0 z) 0.0) + arg0 + ) + +(defun vector-lerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Linearly interpolate between two vectors. Alpha isn't clamped. + w will be set to 1." + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov vf4 arg3) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Linearly interpolate between two vectors, clamping alpha to 0, 1 + w will be set to 1." + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (let ((v1-3 arg0)) + (let ((f0-2 arg3)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (let ((a1-1 f0-2)) + (.mov vf4 a1-1) + ) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-3 quad) vf3) + ) + ) + ) + arg0 + ) + ) + +(defun vector4-lerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Interpolate all 4 elements of a vector. Alpha is not clamped" + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov vf4 arg3) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +(defun vector4-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Interpolate all 4 elements of a vector. Alpha is clamped to [0, 1]" + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (let ((v1-3 arg0)) + (let ((f0-2 arg3)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (let ((a1-1 f0-2)) + (.mov vf4 a1-1) + ) + ) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2) + (.svf (&-> v1-3 quad) vf3) + ) + ) + ) + arg0 + ) + ) + +(defun vector-degi ((arg0 vector) (arg1 vector)) + "Convert a vector (in _rotations_) to degrees units, stored in an int. + Truncates to the nearest _rotation_. + Neither the input or output is a commonly used form. + Unsurprisingly, this strange function is never used." + (local-vars (v1-0 uint128) (v1-1 uint128)) + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.mov v1-0 vf1) + (.pw.sll v1-1 v1-0 16) + (set! (-> arg0 quad) v1-1) + arg0 + ) + ) + +(defun vector-degf ((arg0 vector) (arg1 vector)) + "Convert a vector (in integer degree units) to floating point rotations. + Truncates to the nearest _rotation_. + Like the previous function, this is stupid and unused" + (local-vars (v1-1 uint128)) + (rlet ((vf1 :class vf)) + (let ((v1-0 (-> arg1 quad))) + (.pw.sra v1-1 v1-0 16) + ) + (.mov vf1 v1-1) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun vector-degmod ((arg0 vector) (arg1 vector)) + "This one is actually right. Wraps degrees units (in floats, like they should be) + to +/- half a rotation." + (local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128)) + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.mov v1-0 vf1) + (.pw.sll v1-1 v1-0 16) + (.pw.sra v1-2 v1-1 16) + (.mov vf1 v1-2) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +(defun vector-deg-diff ((arg0 vector) (arg1 vector) (arg2 vector)) + "Wrapped difference, degrees units. Will have the usual 16-bit accuracy issue" + (local-vars + (v0-0 float) + (v1-0 uint128) + (v1-1 uint128) + (v1-2 uint128) + (v1-3 uint128) + (a1-1 uint128) + (a1-2 uint128) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.ftoi.vf vf1 vf1) + (.ftoi.vf vf2 vf2) + (.mov a1-1 vf1) + (.mov v1-0 vf2) + (.pw.sll a1-2 a1-1 16) + (.pw.sll v1-1 v1-0 16) + (.psubw v1-2 a1-2 v1-1) + (.pw.sra v1-3 v1-2 16) + (.mov vf1 v1-3) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + (.mov v0-0 vf1) + (none) + ) + ) + +(defun vector-deg-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + "Apply deg-lerp-clamp to the xyz components of a vector. Sets w = 1." + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (set! (-> arg0 x) (deg-lerp-clamp (-> arg1 x) (-> arg2 x) arg3)) + (set! (-> arg0 y) (deg-lerp-clamp (-> arg1 y) (-> arg2 y) arg3)) + (set! (-> arg0 z) (deg-lerp-clamp (-> arg1 z) (-> arg2 z) arg3)) + (set! (-> arg0 w) 1.0) + ) + ) + arg0 + ) + +;; The docstrings for the next 4 functions were left behind in the game. +;; We suspect they accidentally put something before the docstring, turning it +;; into a string constant. GOAL doesn't eliminate dead code and +;; loads into registers greedily, so it decompiles into a variable assignment. + +(defun vector3s-copy! ((arg0 vector) (arg1 vector)) + "Copy a vector3s" + (set! (-> arg0 x) (-> arg1 x)) + (set! (-> arg0 y) (-> arg1 y)) + (set! (-> arg0 z) (-> arg1 z)) + arg0 + ) + +(defun vector3s+! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Add 2 vectors3." + (set! (-> arg0 x) (+ (-> arg1 x) (-> arg2 x))) + (set! (-> arg0 y) (+ (-> arg1 y) (-> arg2 y))) + (set! (-> arg0 z) (+ (-> arg1 z) (-> arg2 z))) + arg0 + ) + +(defun vector3s*float! ((arg0 vector) (arg1 vector) (arg2 float)) + "mult vectors3 by float" + (set! (-> arg0 x) (* (-> arg1 x) arg2)) + (set! (-> arg0 y) (* (-> arg1 y) arg2)) + (set! (-> arg0 z) (* (-> arg1 z) arg2)) + arg0 + ) + +(defun vector3s-! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Subtract 2 vectors3: c = (a - b)." + (set! (-> arg0 x) (- (-> arg1 x) (-> arg2 x))) + (set! (-> arg0 y) (- (-> arg1 y) (-> arg2 y))) + (set! (-> arg0 z) (- (-> arg1 z) (-> arg2 z))) + arg0 + ) + +(defun vector4-add! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) + "Add 2 vector4s" + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.add.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +(defun vector4-sub! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) + "Subtract 2 vector4s" + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.sub.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +(defun vector4-mul! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) + "Multiple 2 vector4s" + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.mul.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +(defun vector4-scale! ((arg0 vector4) (arg1 vector4) (arg2 float)) + "arg0 = arg1 * arg2" + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.mov vf6 arg2) + (.lvf vf5 (&-> arg1 quad)) + (.mul.x.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +(defun vector4-madd! ((arg0 vector4) (arg1 vector4) (arg2 vector4) (arg3 float)) + "arg0 = arg1 + arg2 * arg3" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.mul.w.vf acc vf5 vf0) + (.add.mul.x.vf vf4 vf6 vf7 acc) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +(defun vector4-msub! ((arg0 vector4) (arg1 vector4) (arg2 vector4) (arg3 float)) + "arg0 = arg1 - arg2 * arg3" + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.mul.w.vf acc vf5 vf0) + (.sub.mul.x.vf vf4 vf6 vf7 acc) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +(defun vector4-array-add! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) + "Apply vector4-add! to all arrays." + (dotimes (s2-0 arg3) + (vector4-add! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun vector4-array-sub! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) + "Apply vector4-sub! to all arrays." + (dotimes (s2-0 arg3) + (vector4-sub! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun vector4-array-mul! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) + "Apply vector4-mul! to all arrays." + (dotimes (s2-0 arg3) + (vector4-mul! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun vector4-array-scale! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 float) (arg3 int)) + "Apply vector4-scale! to all arrays." + (dotimes (s2-0 arg3) + (vector4-scale! (the-as vector4 arg0) (the-as vector4 arg1) arg2) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun vector4-array-madd! ((arg0 (inline-array vector4)) + (arg1 (inline-array vector4)) + (arg2 (inline-array vector4)) + (arg3 float) + (arg4 int) + ) + "Apply vector4-madd! to all arrays." + (dotimes (s1-0 arg4) + (vector4-madd! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2) arg3) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun vector4-array-msub! ((arg0 (inline-array vector4)) + (arg1 (inline-array vector4)) + (arg2 (inline-array vector4)) + (arg3 float) + (arg4 int) + ) + "Apply vector4-msub! to all arrays." + (dotimes (s1-0 arg4) + (vector4-msub! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2) arg3) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun vector4-array-lerp! ((arg0 (inline-array vector4)) + (arg1 (inline-array vector4)) + (arg2 (inline-array vector4)) + (arg3 float) + (arg4 int) + ) + "Apply vector4-lerp! to all arrays." + (dotimes (s1-0 arg4) + (vector4-lerp! (the-as vector arg0) (the-as vector arg1) (the-as vector arg2) arg3) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +(defun spheres-overlap? ((arg0 sphere) (arg1 sphere)) + "Do the spheres overlap?" + (local-vars (v1-0 float) (a0-1 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.sub.vf vf3 vf1 vf2 :mask #b111) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.add.y.vf vf3 vf3 vf3 :mask #b1) + (.add.z.vf vf3 vf3 vf3 :mask #b1) + (.add.w.vf vf4 vf0 vf4 :mask #b1) + (.mov a0-1 vf4) + (.mov v1-0 vf3) + (>= a0-1 v1-0) + ) + ) + +(defun sphere<-vector! ((arg0 sphere) (arg1 vector)) + "Set the position of the sphere to arg1. Does not change the radius" + (let ((f0-0 (-> arg0 w))) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 w) f0-0) + ) + arg0 + ) + +(defun sphere<-vector+r! ((arg0 sphere) (arg1 vector) (arg2 float)) + "Set the position of the sphere from arg1 and the radius from arg2" + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 w) arg2) + arg0 + ) + +(defun rand-vu-sphere-point! ((arg0 vector) (arg1 float)) + "Get a random point on the sphere at the origin with radius arg1. + The point is on the surface of the sphere." + (set-vector! + arg0 + (rand-vu-float-range -1.0 1.0) + (rand-vu-float-range -1.0 1.0) + (rand-vu-float-range -1.0 1.0) + 1.0 + ) + (vector-normalize! arg0 (rand-vu-float-range 0.0 arg1)) + ) + +(defmethod print vector2 ((obj vector2)) + "Print a vector2." + (format #t "#" (-> obj x) (-> obj y) obj) + obj + ) + +(defun vector-vector-angle-safe ((arg0 vector) (arg1 vector)) + "Get the angle between two vectors, with some 'safety' applied..." + (let ((f0-1 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0) + ) + ) + ) + (cond + ((>= f0-1 1.0) + 0.0 + ) + ((>= -1.0 f0-1) + 0.017257283 ;; what is this value?? this should be 180 degrees. + ) + (else + (acos f0-1) + ) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/nav/nav-control-h.gc b/goal_src/jak2/engine/nav/nav-control-h.gc index 78d73e797e..6c718a0914 100644 --- a/goal_src/jak2/engine/nav/nav-control-h.gc +++ b/goal_src/jak2/engine/nav/nav-control-h.gc @@ -5,5 +5,225 @@ ;; name in dgo: nav-control-h ;; dgos: ENGINE, GAME +(defenum nav-state-flag + :type uint32 + :bitfield #t + + (display-marks 0) ;; 1 + (recovery-mode 1) ;; 2 + (initialized 2) ;; 4 + (debug 3) ;; 8 + (directional-mode 4) ;; 16 + (trapped-by-sphere 5) ;; 32 + (target-poly-dirty 6) ;; 64 + (blocked 7) ;; 128 + (in-target-poly 8) ;; 256 + (at-target 9) ;; 512 + (target-inside 10) ;; 1024 + (in-mesh 11) ;; 2048 + (avoiding-sphere 12) ;; 4096 + (touching-sphere 13) ;; 8192 + (at-gap 14) ;; 16384 + ) + +(defenum nav-control-flag + :type uint32 + :bitfield #t + (display-marks 0) ;; 1 + (debug 1) ;; 2 + (no-redirect-in-clamp 2) ;; 4 + (limit-rotation-rate 3) ;; 8 + (update-heading-from-facing 4) ;; 16 + (use-momentum 5) ;; 32 + (momentum-ignore-heading 6) ;; 64 + (output-sphere-hash 7) ;; 128 + (kernel-run 8) ;; 256 + ) + ;; DECOMP BEGINS +(deftype check-vector-collision-with-nav-spheres-info (structure) + ((u float :offset-assert 0) + (intersect vector :inline :offset-assert 16) + (normal vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype nav-gap-info (structure) + ((dest vector :inline :offset-assert 0) + (poly nav-poly :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype nav-avoid-spheres-params (structure) + ((current-pos vector :inline :offset-assert 0) + (travel vector :inline :offset-assert 16) + (pref-dir vector :inline :offset-assert 32) + (out-travel vector 2 :inline :offset-assert 48) + (closest-sphere-dist2 float :offset-assert 80) + (avoiding-sphere? basic :offset-assert 84) + ) + :method-count-assert 9 + :size-assert #x58 + :flag-assert #x900000058 + ) + +(deftype nav-callback-info (structure) + ((callback-count int32 :offset-assert 0) + (callback-array uint32 10 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype nav-state (structure) + ((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) + (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 + :flag-assert #x37000000b0 + (:methods + (nav-state-method-9 () none 9) + (nav-state-method-10 () none 10) + (nav-state-method-11 () none 11) + (nav-state-method-12 () none 12) + (nav-state-method-13 () none 13) + (nav-state-method-14 () none 14) + (nav-state-method-15 () none 15) + (nav-state-method-16 () none 16) + (nav-state-method-17 () none 17) + (nav-state-method-18 () none 18) + (nav-state-method-19 () none 19) + (nav-state-method-20 () none 20) + (nav-state-method-21 () none 21) + (nav-state-method-22 () none 22) + (nav-state-method-23 () none 23) + (nav-state-method-24 () none 24) + (nav-state-method-25 () none 25) + (nav-state-method-26 () none 26) + (nav-state-method-27 () none 27) + (nav-state-method-28 () none 28) + (nav-state-method-29 () none 29) + (nav-state-method-30 () none 30) + (nav-state-method-31 () none 31) + (nav-state-method-32 () none 32) + (nav-state-method-33 () none 33) + (nav-state-method-34 () none 34) + (nav-state-method-35 () none 35) + (nav-state-method-36 () none 36) + (nav-state-method-37 () none 37) + (nav-state-method-38 () none 38) + (nav-state-method-39 () none 39) + (nav-state-method-40 () none 40) + (nav-state-method-41 () none 41) + (nav-state-method-42 () none 42) + (nav-state-method-43 () none 43) + (nav-state-method-44 () none 44) + (nav-state-method-45 () none 45) + (nav-state-method-46 () none 46) + (nav-state-method-47 () none 47) + (nav-state-method-48 () none 48) + (nav-state-method-49 () none 49) + (nav-state-method-50 () none 50) + (nav-state-method-51 () none 51) + (nav-state-method-52 () none 52) + (nav-state-method-53 () none 53) + (nav-state-method-54 () none 54) + ) + ) + +(deftype nav-control (structure) + ((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 basic :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 vector :inline :offset-assert 80) + (root-nav-sphere vector :inline :offset-assert 96) + (state nav-state :inline :offset-assert 112) + ) + :method-count-assert 47 + :size-assert #x120 + :flag-assert #x2f00000120 + (:methods + (nav-control-method-9 () none 9) + (nav-control-method-10 () none 10) + (nav-control-method-11 () none 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) + (nav-control-method-18 () none 18) + (nav-control-method-19 () none 19) + (nav-control-method-20 () none 20) + (nav-control-method-21 () none 21) + (nav-control-method-22 () none 22) + (nav-control-method-23 () 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) + (nav-control-method-44 () none 44) + (nav-control-method-45 () none 45) + (nav-control-method-46 () 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 61fb3a9bd7..776f7baead 100644 --- a/goal_src/jak2/engine/nav/nav-mesh-h.gc +++ b/goal_src/jak2/engine/nav/nav-mesh-h.gc @@ -5,5 +5,559 @@ ;; name in dgo: nav-mesh-h ;; dgos: ENGINE, GAME +(defenum nav-mesh-flag + :type uint8 + :bitfield #t + (dummy 0) + ) + ;; DECOMP BEGINS +(deftype nav-mesh-work-debug (structure) + ((debug-vec1 vector :inline :offset-assert 0) + (debug-vec2 vector :inline :offset-assert 16) + (debug-vec3 vector :inline :offset-assert 32) + (debug-vec4 vector :inline :offset-assert 48) + (debug-vec5 vector :inline :offset-assert 64) + (debug-vec6 vector :inline :offset-assert 80) + (debug-vec7 vector :inline :offset-assert 96) + (debug-vec8 vector :inline :offset-assert 112) + (debug-vec9 vector :inline :offset-assert 128) + (debug-vec10 vector :inline :offset-assert 144) + (debug-vec11 vector :inline :offset-assert 160) + (debug-vec12 vector :inline :offset-assert 176) + (sphere-array sphere 16 :inline :offset-assert 192) + ) + :method-count-assert 9 + :size-assert #x1c0 + :flag-assert #x9000001c0 + ) + +(deftype nav-mesh-work (structure) + ((vert0-table int8 4 :offset-assert 0) + (vert1-table int8 4 :offset-assert 4) + (edge-mask-table uint8 3 :offset-assert 8) + (pad0 uint32 :offset-assert 12) + (deg-to-rad float :offset-assert 16) + (rad-to-deg float :offset-assert 20) + (nav-poly-min-dist float :offset-assert 24) + (nav-poly-epsilon float :offset-assert 28) + (sphere-array sphere 16 :inline :offset-assert 32) + (debug nav-mesh-work-debug :offset-assert 288) + (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) + (nav basic :offset-assert 300) + (poly0 basic :offset-assert 304) + (poly1 basic :offset-assert 308) + (poly-id int32 :offset-assert 312) + ) + :method-count-assert 9 + :size-assert #x13c + :flag-assert #x90000013c + ) + +(deftype nav-mesh-link (structure) + ((id uint32 :offset-assert 0) + (dest-mesh-id uint32 :offset-assert 4) + (src-link-poly-id uint8 :offset-assert 8) + (src-switch-poly-id uint8 :offset-assert 9) + (dest-link-poly-id uint8 :offset-assert 10) + (dest-switch-poly-id uint8 :offset-assert 11) + (dest-mesh basic :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype nav-poly (structure) + ((data uint8 64 :offset-assert 0) + (vertex vector 4 :inline :offset 0) + (vertex0 vector :inline :offset 0) + (vertex1 vector :inline :offset 16) + (vertex2 vector :inline :offset 32) + (vertex3 vector :inline :offset 48) + (id uint8 :offset 12) + (pat uint8 :offset 13) + (vertex-count uint8 :offset 14) + (link uint8 :offset 15) + (adj-poly uint8 4 :offset 28) + (adj-poly0 uint8 :offset 28) + (adj-poly1 uint8 :offset 29) + (adj-poly2 uint8 :offset 30) + (adj-poly3 uint8 :offset 31) + (min-y float :offset 44) + (max-y float :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype nav-vertex (vector) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype nav-sphere (structure) + ((trans sphere :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype nav-ray (structure) + ((current-pos vector :inline :offset-assert 0) + (dir vector :inline :offset-assert 16) + (dest-pos vector :inline :offset-assert 32) + (current-poly nav-poly :offset-assert 48) + (next-poly nav-poly :offset-assert 52) + (len meters :offset-assert 56) + (last-edge int8 :offset-assert 60) + (ignore uint8 :offset-assert 61) + (terminated symbol :offset-assert 64) + (reached-dest symbol :offset-assert 68) + (hit-boundary symbol :offset-assert 72) + (hit-gap symbol :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype nav-route-portal (structure) + ((vertex nav-vertex 2 :inline :offset-assert 0) + (next-poly nav-poly :offset-assert 32) + (edge-index int8 :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x25 + :flag-assert #x900000025 + ) + +(deftype nav-find-poly-parms (structure) + ((point vector :inline :offset-assert 0) + (y-threshold float :offset-assert 16) + (ignore uint8 :offset-assert 20) + (poly nav-poly :offset-assert 24) + (dist float :offset-assert 28) + (point-inside? symbol :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(deftype clamp-travel-vector-to-mesh-return-info (structure) + ((found-boundary basic :offset-assert 0) + (intersection vector :inline :offset-assert 16) + (boundary-normal vector :inline :offset-assert 32) + (prev-normal vector :inline :offset-assert 48) + (next-normal vector :inline :offset-assert 64) + (poly nav-poly :offset-assert 80) + (gap-poly nav-poly :offset-assert 84) + (edge int8 :offset-assert 88) + (ignore uint8 :offset-assert 89) + (vert-prev vector :inline :offset-assert 96) + (vert-0 vector :inline :offset-assert 112) + (vert-1 vector :inline :offset-assert 128) + (vert-next vector :inline :offset-assert 144) + ) + :method-count-assert 9 + :size-assert #xa0 + :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) + ) + :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) + (move-along-nav-ray! (_type_ nav-ray) none 16) + (nav-mesh-method-17 () none 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-35 () none 35) + (nav-mesh-method-36 () none 36) + (point-in-poly? (_type_ nav-poly vector) symbol 37) + (nav-mesh-method-38 () none 38) + (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) + (nav-mesh-method-40 () 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) + ) + ) + +(defun vector-normalize-unity! ((arg0 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 arg0)) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v0-0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-1 f0-0)) + (.mov vf3 v1-1) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v0-0 quad) vf1) + v0-0 + ) + ) + ) + +(defun vector-normalize-unity-copy! ((arg0 vector) (arg1 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 quad) (-> arg1 quad)) + (let ((v0-0 arg0)) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v0-0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-2 f0-0)) + (.mov vf3 v1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v0-0 quad) vf1) + v0-0 + ) + ) + ) + +(defun-debug debug-validate-current-poly () + #f + ) + +(defun init-ray ((arg0 nav-ray)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (vector-! (-> arg0 dir) (-> arg0 dest-pos) (-> arg0 current-pos)) + (set! (-> arg0 dir y) 0.0) + (let ((v1-1 (-> arg0 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-2 f0-1)) + (.mov vf3 a1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> arg0 next-poly) #f) + (set! (-> arg0 len) 0.0) + (set! (-> arg0 last-edge) -1) + (set! (-> arg0 terminated) #f) + (set! (-> arg0 reached-dest) #f) + (set! (-> arg0 hit-boundary) #f) + (set! (-> arg0 hit-gap) #f) + (set! (-> arg0 ignore) (the-as uint 3)) + 0 + (none) + ) + ) + +(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)) + ) + (dotimes (t0-0 arg2) + (let* ((t1-3 (-> arg3 (-> v1-1 t0-0))) + (t2-3 (-> arg3 (-> a0-2 t0-0))) + (f0-1 (- (-> t1-3 z) (-> t2-3 z))) + (f1-2 (- (-> t2-3 x) (-> t1-3 x))) + (f2-2 (- (-> arg1 x) (-> t1-3 x))) + (f3-2 (- (-> arg1 z) (-> t1-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (if (< 0.0 f0-3) + (return #f) + ) + ) + ) + ) + #t + ) + +(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)) + (a2-2 (-> a3-0 work vert0-table)) + (a3-2 (-> a3-0 work vert1-table)) + ) + (dotimes (t0-0 (the-as int a0-1)) + (let* ((t1-3 (-> a1-1 (-> a2-2 t0-0))) + (t2-3 (-> a1-1 (-> a3-2 t0-0))) + (f0-1 (- (-> t1-3 z) (-> t2-3 z))) + (f1-2 (- (-> t2-3 x) (-> t1-3 x))) + (f2-2 (- (-> v1-0 x) (-> t1-3 x))) + (f3-2 (- (-> v1-0 z) (-> t1-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (if (< 0.0 f0-3) + (return #f) + ) + ) + ) + ) + #t + ) + +(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)) + (set! sv-56 (the-as float 10000000000000000000000000000000000000.0)) + (let* ((s3-0 (-> arg0 vertex-count)) + (v1-3 (the-as int (+ s3-0 -1))) + ) + (dotimes (s2-0 (the-as int s3-0)) + (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-3) (-> arg0 vertex s2-0) sv-48))) + (when (< f0-1 sv-56) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-3 s2-0) + ) + ) + (set! (-> arg1 quad) (-> sv-52 quad)) + (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) + (set! (-> arg1 quad) (-> arg2 quad)) + ) + (else + (let ((s5-1 arg1)) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (the-as float 10000000000000000000000000000000000000.0)) + (let* ((s2-0 (-> arg0 vertex-count)) + (v1-6 (the-as int (+ s2-0 -1))) + ) + (dotimes (s1-0 (the-as int s2-0)) + (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-6) (-> arg0 vertex s1-0) sv-48))) + (when (< f0-1 sv-56) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-6 s1-0) + ) + ) + (set! (-> s5-1 quad) (-> sv-52 quad)) + ) + ) + ) + (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) + (current-poly nav-poly) + (current-poly-vtx-count uint8) + (v0-table (pointer int8)) + (v1-table (pointer int8)) + (delta-x float) + (delta-z float) + (adj-vtx-0 vector) + (adj-vtx-1 vector) + (adj-edge-dz float) + (adj-edge-minus-dx float) + (sv-68 uint) + ) + (set! next-poly-idx -1) + (set! work (-> obj work)) + (set! current-poly (-> ray current-poly)) + (set! current-poly-vtx-count (-> ray current-poly vertex-count)) + (set! v0-table (-> obj work vert0-table)) + (set! v1-table (-> obj work vert1-table)) + (set! delta-x (- (-> ray dest-pos x) (-> ray current-pos x))) + (set! delta-z (- (-> ray dest-pos z) (-> ray current-pos z))) + (dotimes (i (the-as int current-poly-vtx-count)) + (set! adj-vtx-0 (-> current-poly vertex (-> v0-table i))) + (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 ((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) + (set! next-poly-idx i) + (let ((f0-12 (fmax 0.0 (/ f1-10 f0-10)))) + (set! delta-x (* delta-x f0-12)) + (set! delta-z (* delta-z f0-12)) + ) + ) + ) + ) + ) + ) + (let ((f0-16 (+ (* delta-x (-> ray dir x)) (* delta-z (-> ray dir z))))) + (+! (-> ray len) f0-16) + ) + 0 + (set! (-> ray next-poly) #f) + (cond + ((= next-poly-idx -1) + (set! (-> ray current-pos quad) (-> ray dest-pos quad)) + (set! (-> ray reached-dest) #t) + (set! (-> ray terminated) #t) + ) + (else + (+! (-> ray current-pos x) delta-x) + (+! (-> 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)) + ) + (cond + ((and (-> ray next-poly) (zero? (logand (-> ray next-poly pat) (-> ray ignore)))) + (set! (-> ray current-poly) (-> ray next-poly)) + ) + (else + (set! (-> ray last-edge) next-poly-idx) + (if (-> ray next-poly) + (set! (-> ray hit-gap) #t) + (set! (-> ray hit-boundary) #t) + ) + (set! (-> ray terminated) #t) + ) + ) + ) + ) + 0 + (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)) + ) + 0 + (none) + ) + + + + diff --git a/goal_src/jak2/engine/physics/chain-physics-h.gc b/goal_src/jak2/engine/physics/chain-physics-h.gc index 9813585b2b..53ad1c417b 100644 --- a/goal_src/jak2/engine/physics/chain-physics-h.gc +++ b/goal_src/jak2/engine/physics/chain-physics-h.gc @@ -7,3 +7,54 @@ ;; DECOMP BEGINS +(deftype chain-physics-setup (structure) + ((joint-index int32 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype chain-physics-joint (structure) + ((position vector :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (old-x vector :inline :offset-assert 32) + (joint-mod basic :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +(deftype chain-physics (basic) + ((chain-joints chain-physics-joint 20 :inline :offset-assert 16) + (num-joints uint8 :offset-assert 1296) + (root-joint-index uint8 :offset-assert 1297) + (joint-length float :offset-assert 1300) + (gravity vector :inline :offset-assert 1312) + (gravity-target vector :inline :offset-assert 1328) + (stretch-vel float :offset-assert 1344) + (stretch-vel-parallel float :offset-assert 1348) + (compress-vel float :offset-assert 1352) + (compress-vel-parallel float :offset-assert 1356) + (negate-y basic :offset-assert 1360) + (axial-slop float :offset-assert 1364) + (maximum-stretch float :offset-assert 1368) + (turn-off-start uint64 :offset-assert 1376) + (turn-off-duration uint64 :offset-assert 1384) + ) + :method-count-assert 18 + :size-assert #x570 + :flag-assert #x1200000570 + (:methods + (chain-physics-method-9 () none 9) + (chain-physics-method-10 () none 10) + (chain-physics-method-11 () none 11) + (chain-physics-method-12 () none 12) + (chain-physics-method-13 () none 13) + (chain-physics-method-14 () none 14) + (chain-physics-method-15 () none 15) + (chain-physics-method-16 () none 16) + (chain-physics-method-17 () none 17) + ) + ) diff --git a/goal_src/jak2/engine/physics/dynamics-h.gc b/goal_src/jak2/engine/physics/dynamics-h.gc index 6735cc37d5..048cec7d7e 100644 --- a/goal_src/jak2/engine/physics/dynamics-h.gc +++ b/goal_src/jak2/engine/physics/dynamics-h.gc @@ -7,3 +7,54 @@ ;; DECOMP BEGINS +(deftype dynamics (basic) + ((name symbol :offset-assert 4) + (gravity-max meters :offset-assert 8) + (gravity-length meters :offset-assert 12) + (gravity vector :inline :offset-assert 16) + (gravity-normal vector :inline :offset-assert 32) + (walk-distance meters :offset-assert 48) + (run-distance meters :offset-assert 52) + ) + :method-count-assert 10 + :size-assert #x38 + :flag-assert #xa00000038 + (:methods + (set-gravity-length (_type_ float) none 9) + ) + ) + +(defmethod set-gravity-length dynamics ((obj dynamics) (arg0 float)) + (set! (-> obj gravity-length) arg0) + (vector-float*! (-> obj gravity) (-> obj gravity-normal) arg0) + 0 + (none) + ) + +(defun time-to-apex ((arg0 float) (arg1 float)) + (the int (/ arg0 (- (* 0.0033333334 arg1)))) + ) + +(defun time-to-ground ((arg0 float) (arg1 float) (arg2 float)) + (let ((f0-0 0.0) + (v0-0 0) + ) + (while (< (- arg2) f0-0) + (set! arg0 (- arg0 (* 0.0033333334 arg1))) + (+! f0-0 (* 0.0033333334 arg0)) + (+! v0-0 1) + ) + v0-0 + ) + ) + +(define *standard-dynamics* (new 'static 'dynamics + :name 'standard + :gravity-max (meters 40) + :gravity-length (meters 60) + :gravity (new 'static 'vector :y 245760.0 :w 1.0) + :gravity-normal (new 'static 'vector :y 1.0 :w 1.0) + :walk-distance (meters 2) + :run-distance (meters 5) + ) + ) diff --git a/goal_src/jak2/engine/physics/gravity-h.gc b/goal_src/jak2/engine/physics/gravity-h.gc index ad530cc684..d55f3f2274 100644 --- a/goal_src/jak2/engine/physics/gravity-h.gc +++ b/goal_src/jak2/engine/physics/gravity-h.gc @@ -7,3 +7,4 @@ ;; DECOMP BEGINS +;; Nothing here! \ No newline at end of file diff --git a/goal_src/jak2/engine/physics/trajectory-h.gc b/goal_src/jak2/engine/physics/trajectory-h.gc index bd23e3f11a..6fa9b9dac7 100644 --- a/goal_src/jak2/engine/physics/trajectory-h.gc +++ b/goal_src/jak2/engine/physics/trajectory-h.gc @@ -7,3 +7,138 @@ ;; DECOMP BEGINS +(deftype trajectory (structure) + ((initial-position vector :inline :offset-assert 0) + (initial-velocity vector :inline :offset-assert 16) + (time float :offset-assert 32) + (gravity meters :offset-assert 36) + ) + :method-count-assert 18 + :size-assert #x28 + :flag-assert #x1200000028 + (:methods + (compute-trans-at-time (_type_ float vector) vector 9) + (compute-transv-at-time (_type_ float vector) vector 10) + (compute-time-until-apex (_type_) float 11) + (setup-from-to-duration! (_type_ vector vector float float) none 12) + (setup-from-to-xz-vel! (_type_ vector vector float float) none 13) + (setup-from-to-y-vel! (_type_ vector vector float float) none 14) + (setup-from-to-height! (_type_ vector vector float float) none 15) + (setup-from-to-duration-and-height! (_type_ vector vector float float) none 16) + (debug-draw (_type_) none 17) + ) + ) + +(deftype impact-control (structure) + ((process (pointer process-drawable) :offset-assert 0) + (radius float :offset-assert 4) + (joint int32 :offset-assert 8) + (collide-with collide-spec :offset-assert 12) + (start-time time-frame :offset-assert 16) + (trans vector 2 :inline :offset-assert 32) + (dir vector :inline :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x50 + :flag-assert #xc00000050 + (:methods + (new (symbol type process-drawable int float collide-spec) _type_ 0) + (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process 9) + (update-from-cspace (_type_) none 10) + (impact-control-method-11 () none 11) + ) + ) + +(defmethod new impact-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type impact-control initialize) + (the-as impact-control (t9-0 allocation v1-1)) + arg0 + arg1 + arg2 + arg3 + ) + ) + ) + +(deftype point-tracker (structure) + ((trans vector 2 :inline :offset-assert 0) + ) + :method-count-assert 12 + :size-assert #x20 + :flag-assert #xc00000020 + (:methods + (new (symbol type vector vector) _type_ 0) + (initialize (_type_ vector vector) point-tracker 9) + (point-tracker-method-10 () none 10) + (point-tracker-method-11 () none 11) + ) + ) + +(defmethod new point-tracker ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type point-tracker initialize) (the-as point-tracker (t9-0 allocation v1-1)) arg0 arg1) + ) + ) + +(deftype combo-tracker (point-tracker) + ((target handle :offset-assert 32) + (move-start-time time-frame :offset-assert 40) + ) + :method-count-assert 14 + :size-assert #x30 + :flag-assert #xe00000030 + (:methods + (combo-tracker-method-12 () none 12) + (combo-tracker-method-13 () none 13) + ) + ) + +(deftype traj2d-params (structure) + ((x float :offset-assert 0) + (y float :offset-assert 4) + (gravity float :offset-assert 8) + (initial-tilt float :offset-assert 12) + (initial-speed float :offset-assert 16) + (time float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +(deftype traj3d-params (structure) + ((gravity float :offset-assert 0) + (initial-tilt float :offset-assert 4) + (initial-speed float :offset-assert 8) + (time float :offset-assert 12) + (src vector :inline :offset-assert 16) + (dest vector :inline :offset-assert 32) + (diff vector :inline :offset-assert 48) + (initial-velocity vector :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype cubic-curve (structure) + ((mat matrix :inline :offset-assert 0) + ) + :method-count-assert 14 + :size-assert #x40 + :flag-assert #xe00000040 + (:methods + (cubic-curve-method-9 () none 9) + (cubic-curve-method-10 () none 10) + (cubic-curve-method-11 () none 11) + (cubic-curve-method-12 () none 12) + (cubic-curve-method-13 () none 13) + ) + ) diff --git a/goal_src/jak2/engine/process-drawable/focus.gc b/goal_src/jak2/engine/process-drawable/focus.gc index a34bb7c9aa..935d7e650c 100644 --- a/goal_src/jak2/engine/process-drawable/focus.gc +++ b/goal_src/jak2/engine/process-drawable/focus.gc @@ -5,5 +5,21 @@ ;; name in dgo: focus ;; dgos: ENGINE, GAME +;; TODO: not done + ;; DECOMP BEGINS +(deftype focus (structure) + ((handle handle :offset-assert 0) + (collide-with collide-spec :offset-assert 8) + ) + :method-count-assert 13 + :size-assert #xc + :flag-assert #xd0000000c + (:methods + (clear-focused (_type_) none 9) + (collide-check? (_type_ process-focusable) object 10) + (reset-to-collide-spec (_type_ collide-spec) none 11) + (try-update-focus (_type_ process-focusable) symbol 12) + ) + ) diff --git a/goal_src/jak2/engine/process-drawable/process-drawable-h.gc b/goal_src/jak2/engine/process-drawable/process-drawable-h.gc index ce8e4e75c3..ec68cc4758 100644 --- a/goal_src/jak2/engine/process-drawable/process-drawable-h.gc +++ b/goal_src/jak2/engine/process-drawable/process-drawable-h.gc @@ -5,5 +5,196 @@ ;; name in dgo: process-drawable-h ;; dgos: ENGINE, GAME +(define-extern cspace-by-name (function process-drawable string cspace)) +(define-extern cspace-index-by-name (function process-drawable string int)) +(define-extern joint-control-reset! (function joint-control joint-control-channel none :behavior process-drawable)) + ;; DECOMP BEGINS +(defun cspace-by-name-no-fail ((arg0 process-drawable) (arg1 string)) + (let ((v0-0 (the-as object (cspace-by-name arg0 arg1)))) + (the-as cspace (cond + ((the-as cspace v0-0) + (empty) + v0-0 + ) + (else + (format 0 "no cspace (~A)~%" arg1) + (-> arg0 node-list data) + ) + ) + ) + ) + ) + +(defun cspace-index-by-name-no-fail ((arg0 process-drawable) (arg1 string)) + (let ((v0-0 (cspace-index-by-name arg0 arg1))) + (cond + ((< v0-0 0) + (format 0 "no cspace[ndx] (~A)~%" arg1) + 0 + ) + (else + (empty) + v0-0 + ) + ) + ) + ) + +(defun num-func-none ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (-> arg0 frame-num) + ) + +(defun num-func-+! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))))) + (set! (-> arg0 frame-num) f0-1) + f0-1 + ) + ) + ) + +(defun num-func--! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))))) + (set! (-> arg0 frame-num) f0-1) + f0-1 + ) + ) + ) + +(defun num-func-loop! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f1-2 (+ (-> arg0 frame-num) f0-1 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))) + (f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + (set! (-> arg0 frame-num) f0-3) + f0-3 + ) + ) + ) + +(defun num-func-loop-speedless! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f1-2 (+ (-> arg0 frame-num) f0-1 arg1)) + (f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + (set! (-> arg0 frame-num) f0-3) + f0-3 + ) + ) + +(defun num-func-seek! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f0-3 + (seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))) + ) + ) + (set! (-> arg0 frame-num) f0-3) + f0-3 + ) + ) + ) + +(defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> pp clock time-adjust-ratio))))) + (set! (-> arg0 frame-interp 0) f30-0) + (set! (-> arg0 frame-interp 1) f30-0) + (if (= f30-0 1.0) + (joint-control-reset! (-> arg0 parent) arg0) + ) + f30-0 + ) + ) + ) + +(defun joint-channel-float-delete! ((arg0 joint-control-channel)) + (let ((v1-0 (-> arg0 parent))) + (+! (-> v1-0 float-channels) -1) + (when (nonzero? (-> v1-0 float-channels)) + (let ((a1-5 (/ (&- (the-as pointer arg0) (the-as uint (the-as pointer (-> v1-0 channel)))) 64))) + (if (< a1-5 (the-as int (+ (-> v1-0 active-channels) (-> v1-0 float-channels)))) + (qmem-copy<-! + (the-as pointer (-> v1-0 channel a1-5)) + (the-as pointer (-> v1-0 channel (+ a1-5 1))) + (the-as int (* (-> v1-0 float-channels) 64)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defun num-func-interp-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (with-pp + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 0) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 0) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 0) arg2) + ) + ) + ) + (set! (-> arg0 frame-interp 1) (-> arg0 frame-interp 0)) + (-> arg0 frame-num) + ) + ) + +(defun num-func-interp1-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (with-pp + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 1) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 1) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 1) arg2) + ) + ) + ) + (-> arg0 frame-num) + ) + ) + +(defun num-func-chan ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (let ((f0-2 + (-> (the-as joint-control-channel (+ (the-as uint arg0) (* (- (the int arg1) (-> arg0 group-sub-index)) 64))) + frame-num + ) + ) + ) + (set! (-> arg0 frame-num) f0-2) + f0-2 + ) + ) + +(defun num-func-identity ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (-> arg0 frame-num) + ) diff --git a/goal_src/jak2/engine/process-drawable/process-focusable.gc b/goal_src/jak2/engine/process-drawable/process-focusable.gc index e1ed9dd2b1..97b4a9f1ca 100644 --- a/goal_src/jak2/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak2/engine/process-drawable/process-focusable.gc @@ -5,5 +5,91 @@ ;; name in dgo: process-focusable ;; dgos: ENGINE, GAME +(defenum focus-status + :bitfield #t + :type uint32 + (fs0 0) ;; if set, all collide checks fail + (fs1 1) ;; if set, all collide checks fail + (fs2 2) + ) + ;; DECOMP BEGINS +(deftype process-focusable (process-drawable) + ((focus-status focus-status :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 27 + :size-assert #xcc + :flag-assert #x1b005000cc + (:methods + (get-trans (_type_ int) vector 20) + (get-quat (_type_) quaternion 21) + (get-transv (_type_) vector 22) + (process-focusable-method-23 (_type_) none 23) + (process-focusable-method-24 (_type_) none 24) + (process-focusable-method-25 (_type_) none 25) + (process-focusable-method-26 (_type_) none 26) + ) + ) + +(defmethod inspect process-focusable ((obj process-focusable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tfocus-status: ~D~%" (-> obj focus-status)) + (label cfg-4) + obj + ) + +(defmethod get-trans process-focusable ((obj process-focusable) (arg0 int)) + (let ((gp-0 (-> obj root))) + (the-as vector (cond + ((zero? arg0) + (-> gp-0 trans) + ) + ((and (= arg0 1) (type? gp-0 collide-shape-moving)) + (-> (the-as collide-shape-moving gp-0) gspot-pos) + ) + ((and (or (= arg0 2) (= arg0 3)) (type? gp-0 collide-shape)) + (-> (the-as collide-shape gp-0) root-prim prim-core) + ) + (else + (-> gp-0 trans) + ) + ) + ) + ) + ) + +(defmethod get-transv process-focusable ((obj process-focusable)) + (-> obj root transv) + ) + +(defmethod get-quat process-focusable ((obj process-focusable)) + (-> obj root quat) + ) + +(defmethod process-focusable-method-23 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +(defmethod process-focusable-method-24 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +(defmethod process-focusable-method-26 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +(defmethod process-focusable-method-25 process-focusable ((obj process-focusable)) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/process-drawable/process-taskable-h.gc b/goal_src/jak2/engine/process-drawable/process-taskable-h.gc index b7ca00067f..1a4ab4e0b5 100644 --- a/goal_src/jak2/engine/process-drawable/process-taskable-h.gc +++ b/goal_src/jak2/engine/process-drawable/process-taskable-h.gc @@ -7,3 +7,37 @@ ;; DECOMP BEGINS +(deftype process-taskable (process-focusable) + ((task basic :offset-assert 204) + (ambient ambient-control :inline :offset-assert 208) + (neck-joint-index int32 :offset-assert 224) + (talk-message game-text-id :offset-assert 228) + (bounce-away symbol :offset-assert 232) + (will-talk symbol :offset-assert 236) + (look-at-me symbol :offset-assert 240) + (hide-during-movie symbol :offset-assert 244) + (talk-distance meters :offset-assert 248) + (talk-height meters :offset-assert 252) + (last-talk time-frame :offset-assert 256) + (want-to-say uint64 :offset-assert 264) + (birth-time time-frame :offset-assert 272) + (slave handle :offset-assert 280) + ) + :heap-base #xa0 + :method-count-assert 38 + :size-assert #x120 + :flag-assert #x2600a00120 + (:methods + (process-taskable-method-27 () none 27) + (process-taskable-method-28 () none 28) + (process-taskable-method-29 () none 29) + (process-taskable-method-30 () none 30) + (process-taskable-method-31 () none 31) + (process-taskable-method-32 () none 32) + (process-taskable-method-33 () none 33) + (process-taskable-method-34 () none 34) + (process-taskable-method-35 () none 35) + (process-taskable-method-36 () none 36) + (process-taskable-method-37 () none 37) + ) + ) diff --git a/goal_src/jak2/engine/ps2/memcard-h.gc b/goal_src/jak2/engine/ps2/memcard-h.gc index 6b9c775422..e36786e07d 100644 --- a/goal_src/jak2/engine/ps2/memcard-h.gc +++ b/goal_src/jak2/engine/ps2/memcard-h.gc @@ -7,3 +7,108 @@ ;; DECOMP BEGINS +(deftype mc-handle (int32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype mc-file-info (structure) + ((present int32 :offset-assert 0) + (blind-data float 16 :offset 4) + (blind-data-int8 int8 64 :offset 4) + (level-index int32 :offset 4) + (gem-count float :offset 8) + (skill-count float :offset 12) + (completion-percentage float :offset 16) + (minute uint8 :offset 24) + (hour uint8 :offset 25) + (week uint8 :offset 26) + (day uint8 :offset 27) + (month uint8 :offset 28) + (year uint8 :offset 29) + (game-time0 uint32 :offset 36) + (game-time1 uint32 :offset 40) + (secrets uint32 :offset 44) + (features uint32 :offset 48) + ) + :pack-me + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +(deftype mc-slot-info (structure) + ((handle int32 :offset-assert 0) + (known int32 :offset-assert 4) + (formatted int32 :offset-assert 8) + (inited int32 :offset-assert 12) + (last-file int32 :offset-assert 16) + (mem-required int32 :offset-assert 20) + (mem-actual int32 :offset-assert 24) + (file mc-file-info 4 :inline :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x12c + :flag-assert #x90000012c + ) + +(defun mc-sync () + (let ((v0-0 0)) + (while (zero? v0-0) + (mc-run) + (set! v0-0 (mc-check-result)) + ) + v0-0 + ) + ) + +(defun show-mc-info ((arg0 dma-buffer)) + (let ((s5-0 (new 'stack-no-clear 'mc-slot-info))) + (dotimes (s4-0 2) + (mc-get-slot-info s4-0 s5-0) + (cond + ((zero? (-> s5-0 known)) + (format (clear *temp-string*) "SLOT ~D: EXAMINING SLOT~%" s4-0) + *temp-string* + ) + ((zero? (-> s5-0 handle)) + (format (clear *temp-string*) "SLOT ~D: NO CARD~%" s4-0) + *temp-string* + ) + ((zero? (-> s5-0 formatted)) + (format (clear *temp-string*) "SLOT ~D: CARD [~D] : NOT FORMATTED~%" s4-0 (-> s5-0 handle)) + *temp-string* + ) + ((zero? (-> s5-0 inited)) + (format + (clear *temp-string*) + "SLOT ~D: CARD [~D] : NO FILE [~D/~D]~%" + s4-0 + (-> s5-0 handle) + (-> s5-0 mem-required) + (-> s5-0 mem-actual) + ) + *temp-string* + ) + (else + (format (clear *temp-string*) "SLOT ~D: CARD [~D] : " s4-0 (-> s5-0 handle)) + *temp-string* + (format + *temp-string* + "SAVES ~D ~D ~D ~D : LAST ~D~%" + (-> s5-0 file 0 present) + (-> s5-0 file 1 present) + (-> s5-0 file 2 present) + (-> s5-0 file 3 present) + (-> s5-0 last-file) + ) + ) + ) + (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color orange-red) (font-flags shadow)) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak2/engine/ps2/pad.gc b/goal_src/jak2/engine/ps2/pad.gc index adf7c1cda4..9db46b28a9 100644 --- a/goal_src/jak2/engine/ps2/pad.gc +++ b/goal_src/jak2/engine/ps2/pad.gc @@ -5,5 +5,616 @@ ;; name in dgo: pad ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +;; Interface for game controllers. +;; the *cpad-list* contains both game controllers. +;; Use the service-cpads functions once per frame to update the data and vibration control +;; The cpad-set-buzz! function can be used for vibration. + +(define-extern get-current-time (function time-frame)) +(define-extern get-integral-current-time (function uint)) +(define-extern get-current-language (function language-enum)) +(define-extern add-debug-cursor (function symbol bucket-id int int int none)) + + +(defenum pad-buttons + :bitfield #t + :type uint32 + (select 0) + (l3 1) + (r3 2) + (start 3) + (up 4) + (right 5) + (down 6) + (left 7) + (l2 8) + (r2 9) + (l1 10) + (r1 11) + (triangle 12) + (circle 13) + (x 14) + (square 15) + ) + +(defenum pad-type + (normal 4) + (analog 5) + (dualshock 7) + (negcon 2) + (namco-gun 6) + ) + + +(deftype scf-time (structure) + ((stat uint8 :offset-assert 0) + (second uint8 :offset-assert 1) + (minute uint8 :offset-assert 2) + (hour uint8 :offset-assert 3) + (week uint8 :offset-assert 4) + (day uint8 :offset-assert 5) + (month uint8 :offset-assert 6) + (year uint8 :offset-assert 7) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + + +;; this gets set to #f later on. +(define *cheat-mode* #t) + +;; data that comes directly from hardware. it's 32 bytes + type tag (ignored in C kernel). +(deftype hw-cpad (basic) + (;; BASIC CONTROLLER data + ;; status = 0x40 | (data length / 2) + (valid uint8 :offset-assert 4) ;; 0 if success, 255 if fail + (status uint8 :offset-assert 5) ;; depends on controller + (button0 uint16 :offset-assert 6) ;; binary button states! + ;; DUALSHOCK or JOYSTICK data + ;; status (dualshock) = 0x70 | (data length / 2) + ;; status (joystick) = 0x50 | (data length / 2) + (rightx uint8 :offset-assert 8) ;; right stick xdir + (righty uint8 :offset-assert 9) ;; right stick ydir + (leftx uint8 :offset-assert 10) ;; left stick xdir + (lefty uint8 :offset-assert 11) ;; left stick ydir + ;; DUALSHOCK 2 data + ;; status = 0x70 | (data length / 2) + (abutton uint8 12 :offset-assert 12) ;; pressure sensitivity information + + ;; pad buffer needs to be 32 bytes large. + (dummy uint8 12 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; data from hardware + additional info calculated here. +(deftype cpad-info (hw-cpad) + ((number int32 :offset-assert 36) + (cpad-file int32 :offset-assert 40) + (button0-abs pad-buttons 3 :offset-assert 44) + (button0-shadow-abs pad-buttons 1 :offset-assert 56) + (button0-rel pad-buttons 3 :offset-assert 60) + (stick0-dir float :offset-assert 72) + (stick0-speed float :offset-assert 76) + (new-pad int32 :offset-assert 80) + (state int32 :offset-assert 84) + (align uint8 6 :offset-assert 88) + (direct uint8 6 :offset-assert 94) + (buzz-val uint8 2 :offset-assert 100) + (buzz-pause-val uint8 1 :offset-assert 102) + (buzz-pause-time uint8 :offset-assert 103) + (buzz-time time-frame 2 :offset-assert 104) + (buzz basic :offset-assert 120) + (buzz-act int32 :offset-assert 124) + (change-time time-frame :offset-assert 128) + (old-rightx uint8 2 :offset-assert 136) + (old-righty uint8 2 :offset-assert 138) + (old-leftx uint8 2 :offset-assert 140) + (old-lefty uint8 2 :offset-assert 142) + ) + :method-count-assert 10 + :size-assert #x90 + :flag-assert #xa00000090 + (:methods + (new (symbol type int) _type_ 0) + (invert-analog-if-needed (_type_) none 9) + ) + ) + + +(defmacro cpad-type? (type) + `(= (shr (-> pad status) 4) (cpad-type ,type)) + ) + +(defun cpad-invalid! ((arg0 cpad-info)) + "Reset all data in a cpad-info" + (logior! (-> arg0 valid) 128) + (set! (-> arg0 button0) (the-as uint 0)) + (set! (-> arg0 button0-abs 0) (pad-buttons)) + (set! (-> arg0 button0-shadow-abs 0) (pad-buttons)) + (set! (-> arg0 button0-rel 0) (pad-buttons)) + (dotimes (v1-2 12) + (nop!) + (set! (-> arg0 abutton v1-2) (the-as uint 0)) + ) + (set! (-> arg0 stick0-dir) 0.0) + (set! (-> arg0 stick0-speed) 0.0) + (set! (-> arg0 rightx) (the-as uint 128)) + (set! (-> arg0 righty) (the-as uint 128)) + (set! (-> arg0 leftx) (the-as uint 128)) + (set! (-> arg0 lefty) (the-as uint 128)) + (set! (-> arg0 align 0) (the-as uint 0)) + (set! (-> arg0 align 1) (the-as uint 1)) + (set! (-> arg0 align 2) (the-as uint 255)) + (set! (-> arg0 align 3) (the-as uint 255)) + (set! (-> arg0 align 4) (the-as uint 255)) + (set! (-> arg0 align 5) (the-as uint 255)) + (dotimes (v1-14 6) + (nop!) + (set! (-> arg0 direct v1-14) (the-as uint 0)) + ) + ;; hey, this was fixed from jak 1! + (dotimes (v1-17 2) + (nop!) + (set! (-> arg0 buzz-val v1-17) (the-as uint 0)) + (set! (-> arg0 buzz-time v1-17) 0) + ) + (set! (-> arg0 buzz-pause-val 0) (the-as uint 0)) + (set! (-> arg0 buzz-time 0) 0) + arg0 + ) + +(defmethod new cpad-info ((allocation symbol) (type-to-make type) (arg0 int)) + "Allocate a new cpad-info and open the pad itself through the kernel" + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 number) arg0) + (set! (-> s5-0 buzz) #f) + (cpad-open s5-0 arg0) + (cpad-invalid! s5-0) + ) + ) + +;; List of controllers. It always has 2 controllers. +(deftype cpad-list (basic) + ((num-cpads int32 :offset-assert 4) + (cpads cpad-info 2 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +(defmethod new cpad-list ((allocation symbol) (type-to-make type)) + "Create a cpad-list for 2 controllers. It's fine to do this even if one or both controllers + aren't connected yet." + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 num-cpads) 2) + (set! (-> gp-0 cpads 0) (new 'global 'cpad-info 0)) + (set! (-> gp-0 cpads 1) (new 'global 'cpad-info 1)) + gp-0 + ) + ) + +(defun analog-input ((arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + "Convert integer input from pad into a float between -out-range and +out-range. + The offset is applied directly to the input. + The center val is the expected value for 0, after applying offset. + The max val is the expected value with the stick pushed all the way" + (let* ((f1-1 (- (the float arg0) arg1)) + (f0-3 (- (fabs f1-1) arg2)) + (v1-0 (- arg3 arg2)) + ) + (if (< f1-1 0.0) + (set! arg4 (- arg4)) + ) + (cond + ((>= 0.0 f0-3) + 0.0 + ) + ((>= f0-3 v1-0) + arg4 + ) + (else + (/ (* f0-3 arg4) v1-0) + ) + ) + ) + ) + +(defun cpad-set-buzz! ((arg0 cpad-info) (arg1 int) (arg2 int) (arg3 time-frame)) + "Turn on vibration motor 'buzz-idx' for duration, at magnitude buzz-amount." + (cond + ((zero? arg2) + (set! (-> arg0 buzz-val arg1) (the-as uint 0)) + 0 + ) + ((= arg2 (-> arg0 buzz-val arg1)) + (set! (-> arg0 buzz-time arg1) (the-as time-frame (max (-> arg0 buzz-time arg1) (+ (get-current-time) arg3)))) + ) + ((< (-> arg0 buzz-val arg1) (the-as uint arg2)) + (set! (-> arg0 buzz-val arg1) (the-as uint arg2)) + (set! (-> arg0 buzz-time arg1) (+ (get-current-time) arg3)) + ) + ) + 0 + (none) + ) + +;; the two controllers +(define *cpad-list* (new 'global 'cpad-list)) + +;; weird leftover debug thing, enabling overrides the x position of both sticks on both controllers. +(define *cpad-debug* #f) + +(defun service-cpads () + "Read from cpads and update vibration" + (let ((gp-0 *cpad-list*)) + (dotimes (s5-0 (-> gp-0 num-cpads)) + (let ((s4-0 (-> *cpad-list* cpads s5-0))) + (set! (-> s4-0 old-leftx 1) (-> s4-0 old-leftx 0)) + (set! (-> s4-0 old-leftx 0) (-> s4-0 leftx)) + (set! (-> s4-0 old-lefty 1) (-> s4-0 old-lefty 0)) + (set! (-> s4-0 old-lefty 0) (-> s4-0 lefty)) + (set! (-> s4-0 old-rightx 1) (-> s4-0 old-rightx 0)) + (set! (-> s4-0 old-rightx 0) (-> s4-0 rightx)) + (set! (-> s4-0 old-righty 1) (-> s4-0 old-righty 0)) + (set! (-> s4-0 old-righty 0) (-> s4-0 righty)) + (cpad-get-data s4-0) + (invert-analog-if-needed s4-0) + (cond + ((zero? (logand (-> s4-0 valid) 128)) + (dotimes (s3-0 2) + (cond + ((and (-> s4-0 buzz) (< (get-current-time) (-> s4-0 buzz-time s3-0)) (= *master-mode* 'game)) + (let ((v1-20 s3-0)) + (cond + ((zero? v1-20) + (set! (-> s4-0 direct s3-0) + (logand (ash (-> s4-0 buzz-val s3-0) (- (the-as int (logand (get-integral-current-time) 7)))) 1) + ) + ) + ((= v1-20 1) + (set! (-> s4-0 direct s3-0) (-> s4-0 buzz-val s3-0)) + ) + ) + ) + ) + ((and (zero? s3-0) (> (-> s4-0 buzz-pause-time) 0)) + (set! (-> s4-0 direct s3-0) + (logand (ash (-> s4-0 buzz-pause-val s3-0) (- (the-as int (logand (get-integral-current-time) 7)))) 1) + ) + (+! (-> s4-0 buzz-pause-time) -1) + ) + (else + (set! (-> s4-0 buzz-val s3-0) (the-as uint 0)) + (set! (-> s4-0 direct s3-0) (the-as uint 0)) + (when (zero? s3-0) + (set! (-> s4-0 buzz-pause-time) (the-as uint 0)) + 0 + ) + ) + ) + ) + (when (< (the-as uint 192) (-> s4-0 direct 1)) + (set! (-> s4-0 direct 0) (the-as uint 0)) + 0 + ) + (set! (-> s4-0 button0-abs 2) (-> s4-0 button0-abs 1)) + (set! (-> s4-0 button0-abs 1) (-> s4-0 button0-shadow-abs 0)) + (set! (-> s4-0 button0-rel 2) (-> s4-0 button0-rel 1)) + (set! (-> s4-0 button0-rel 1) (-> s4-0 button0-rel 0)) + (when (= (-> s4-0 status) 115) + (set! (-> s4-0 abutton 0) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons right)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 1) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons left)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 2) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons up)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 3) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons down)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 6) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons x)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 5) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons circle)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 4) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons triangle)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 7) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons square)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 8) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons l1)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 10) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons l2)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 9) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons r1)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 11) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons r2)) + 255 + 0 + ) + ) + ) + ) + (let ((s3-1 (-> s4-0 button0))) + (cond + ((< (-> s4-0 lefty) (the-as uint 30)) + (set! s3-1 (logior s3-1 #x10000)) + ) + ((< (the-as uint 225) (-> s4-0 lefty)) + (set! s3-1 (logior s3-1 #x40000)) + ) + ) + (cond + ((< (-> s4-0 leftx) (the-as uint 30)) + (set! s3-1 (logior s3-1 #x80000)) + ) + ((< (the-as uint 225) (-> s4-0 leftx)) + (set! s3-1 (logior s3-1 #x20000)) + ) + ) + (cond + ((< (-> s4-0 righty) (the-as uint 30)) + (set! s3-1 (logior s3-1 #x100000)) + ) + ((< (the-as uint 225) (-> s4-0 righty)) + (set! s3-1 (logior s3-1 #x400000)) + ) + ) + (cond + ((< (-> s4-0 rightx) (the-as uint 30)) + (set! s3-1 (logior s3-1 #x800000)) + ) + ((< (the-as uint 225) (-> s4-0 rightx)) + (set! s3-1 (logior s3-1 #x200000)) + ) + ) + (let ((v1-123 (get-current-language))) + (cond + ((or (= v1-123 (language-enum japanese)) (= v1-123 (language-enum korean))) + (case (scf-get-territory) + ((2 3) + (if (logtest? s3-1 8192) + (set! s3-1 (logior s3-1 #x1000000)) + ) + ) + (else + (if (logtest? s3-1 #x6000) + (set! s3-1 (logior s3-1 #x1000000)) + ) + ) + ) + ) + ((let ((v1-135 (scf-get-territory))) + (or (= v1-135 2) (= v1-135 3)) + ) + (if (logtest? s3-1 #x6000) + (set! s3-1 (logior s3-1 #x1000000)) + ) + ) + (else + (if (logtest? s3-1 #x4000) + (set! s3-1 (logior s3-1 #x1000000)) + ) + ) + ) + ) + (set! (-> s4-0 button0-shadow-abs 0) (the-as pad-buttons s3-1)) + (set! (-> s4-0 button0-abs 0) (the-as pad-buttons s3-1)) + ) + (set! (-> s4-0 button0-rel 0) (logclear (-> s4-0 button0-abs 0) (-> s4-0 button0-abs 1))) + (when *cpad-debug* + (set! (-> s4-0 leftx) (the-as uint 255)) + (set! (-> s4-0 rightx) (the-as uint 255)) + ) + (set! (-> s4-0 stick0-speed) 1.0) + (cond + ((= (shr (-> s4-0 status) 4) 7) + (let ((f30-0 (* 0.0078125 (the float (+ (-> s4-0 leftx) -128)))) + (f28-0 (* 0.0078125 (the float (- 127 (the-as int (-> s4-0 lefty)))))) + ) + (set! (-> s4-0 stick0-dir) (atan (- f30-0) f28-0)) + (set! (-> s4-0 stick0-speed) (fmin 1.0 (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0))))) + ) + (if (< (-> s4-0 stick0-speed) 0.3) + (set! (-> s4-0 stick0-speed) 0.0) + ) + ) + (else + (set! (-> s4-0 leftx) (the-as uint 128)) + (set! (-> s4-0 lefty) (the-as uint 128)) + (set! (-> s4-0 rightx) (the-as uint 128)) + (set! (-> s4-0 righty) (the-as uint 128)) + (set! (-> s4-0 stick0-dir) 0.0) + (set! (-> s4-0 stick0-speed) 0.0) + ) + ) + (if (or (!= (-> s4-0 button0-abs 0) (-> s4-0 button0-abs 1)) + (or (< 0.3 (-> s4-0 stick0-speed)) (zero? (-> s4-0 change-time))) + ) + (set! (-> s4-0 change-time) (get-current-time)) + ) + ) + (else + (cpad-invalid! s4-0) + ) + ) + ) + ) + ) + *cpad-list* + ) + +(defun buzz-stop! ((arg0 int)) + "Set the buzz to 0 on both vibration motors of the given cpad." + (cpad-set-buzz! (-> *cpad-list* cpads arg0) 0 0 0) + (cpad-set-buzz! (-> *cpad-list* cpads arg0) 1 0 0) + 0 + (none) + ) + +(defmacro cpad-pressed (pad-idx) + `(-> *cpad-list* cpads ,pad-idx button0-rel 0) + ) + +(defmacro cpad-hold (pad-idx) + `(-> *cpad-list* cpads ,pad-idx button0-abs 0) + ) + +(defmacro cpad-pressed? (pad-idx &rest buttons) + `(logtest? (cpad-pressed ,pad-idx) (pad-buttons ,@buttons)) + ) + +(defmacro cpad-hold? (pad-idx &rest buttons) + `(logtest? (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) + ) + +(defmacro cpad-clear! (pad-idx &rest buttons) + `(begin + (logclear! (cpad-pressed ,pad-idx) (pad-buttons ,@buttons)) + (logclear! (cpad-hold ,pad-idx) (pad-buttons ,@buttons)) + ) + ) + +(defmacro cpad-change-time (pad-idx) + `(-> *cpad-list* cpads ,pad-idx change-time) + ) + +(deftype mouse-info (basic) + ((active symbol :offset-assert 4) + (cursor basic :offset-assert 8) + (valid symbol :offset-assert 12) + (id uint8 :offset-assert 16) + (status uint16 :offset-assert 18) + (button0 uint16 :offset-assert 20) + (deltax int8 :offset-assert 22) + (deltay int8 :offset-assert 23) + (wheel uint8 :offset-assert 24) + (change-time time-frame :offset-assert 32) + (button0-abs uint32 3 :offset-assert 40) + (button0-shadow-abs uint32 1 :offset-assert 52) + (button0-rel uint32 3 :offset-assert 56) + (pos vector 2 :inline :offset-assert 80) + (posx float :offset 80) + (posy float :offset 84) + (oldposx float :offset 96) + (oldposy float :offset 100) + (speedx float :offset 92) + (speedy float :offset 108) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +(defmethod new mouse-info ((allocation symbol) (type-to-make type)) + "Allocate a new mouse." + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 active) #f) + (set! (-> v0-0 valid) #f) + (set! (-> v0-0 cursor) #f) + v0-0 + ) + ) + +(define *mouse* (new 'global 'mouse-info)) + +(defun service-mouse () + "Update the mouse, and draw the cursor." + (let ((gp-0 *mouse*)) + (mouse-get-data gp-0) + (set! (-> gp-0 pos 1 quad) (-> gp-0 pos 0 quad)) + (set! (-> gp-0 button0-abs 2) (-> gp-0 button0-abs 1)) + (set! (-> gp-0 button0-abs 1) (-> gp-0 button0-shadow-abs 0)) + (set! (-> gp-0 button0-rel 2) (-> gp-0 button0-rel 1)) + (set! (-> gp-0 button0-rel 1) (-> gp-0 button0-rel 0)) + (set! (-> gp-0 button0-rel 0) (the-as uint 0)) + (set! (-> gp-0 speedx) 0.0) + (set! (-> gp-0 speedy) 0.0) + (cond + ((or (not (-> gp-0 valid)) (not (-> gp-0 active))) + (set! (-> gp-0 valid) #f) + (set! (-> gp-0 status) (the-as uint 0)) + (set! (-> gp-0 pos 0 quad) (the-as uint128 0)) + (set! (-> gp-0 pos 1 quad) (the-as uint128 0)) + ) + ((logtest? (-> gp-0 status) 1) + (set! (-> gp-0 change-time) (get-current-time)) + (set! (-> gp-0 speedx) (* (sign (the float (-> gp-0 deltax))) (pow (fabs (the float (-> gp-0 deltax))) 1.3))) + (set! (-> gp-0 speedy) (* (sign (the float (-> gp-0 deltay))) (pow (fabs (the float (-> gp-0 deltay))) 1.3))) + (set! (-> gp-0 posx) (fmax -256.0 (fmin 256.0 (+ (-> gp-0 posx) (-> gp-0 speedx))))) + (set! (-> gp-0 posy) (fmax -208.0 (fmin 208.0 (+ (-> gp-0 posy) (-> gp-0 speedy))))) + (let ((v1-22 (-> gp-0 button0))) + (set! (-> gp-0 button0-shadow-abs 0) v1-22) + (set! (-> gp-0 button0-abs 0) v1-22) + ) + (set! (-> gp-0 button0-rel 0) (logclear (-> gp-0 button0-abs 0) (-> gp-0 button0-abs 1))) + ) + ) + (if (and (-> gp-0 active) (-> gp-0 valid) (-> gp-0 cursor)) + (add-debug-cursor + #t + (bucket-id debug-no-zbuf) + (+ (the int (-> gp-0 posx)) 256) + (+ (the int (-> gp-0 posy)) 208) + (the-as int (-> gp-0 button0-abs 0)) + ) + ) + ) + (none) + ) + + + diff --git a/goal_src/jak2/engine/ps2/rpc-h.gc b/goal_src/jak2/engine/ps2/rpc-h.gc index 4e14c60d37..d8fea49d3f 100644 --- a/goal_src/jak2/engine/ps2/rpc-h.gc +++ b/goal_src/jak2/engine/ps2/rpc-h.gc @@ -7,3 +7,186 @@ ;; DECOMP BEGINS +(deftype rpc-buffer (basic) + ((elt-size uint32 :offset-assert 4) + (elt-count uint32 :offset-assert 8) + (elt-used uint32 :offset-assert 12) + (busy basic :offset-assert 16) + (base pointer :offset-assert 20) + (data uint8 :dynamic :offset 32) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + (:methods + (new (symbol type uint uint) rpc-buffer 0) + ) + ) + +(defmethod new rpc-buffer ((allocation symbol) (type-to-make type) (arg0 uint) (arg1 uint)) + (let* ((a2-2 (+ (-> type-to-make size) 63 (* (the-as int arg0) (the-as int arg1)))) + (v0-0 (object-new allocation type-to-make (the-as int a2-2))) + ) + (set! (-> v0-0 elt-size) arg0) + (set! (-> v0-0 elt-count) arg1) + (set! (-> v0-0 elt-used) (the-as uint 0)) + (set! (-> v0-0 busy) #f) + (set! (-> v0-0 base) (logand -64 (&-> (-> v0-0 data) 63))) + v0-0 + ) + ) +(deftype rpc-buffer-pair (basic) + ((buffer rpc-buffer 2 :offset-assert 4) + (current rpc-buffer :offset-assert 12) + (last-recv-buffer pointer :offset-assert 16) + (rpc-port int32 :offset-assert 20) + ) + :method-count-assert 15 + :size-assert #x18 + :flag-assert #xf00000018 + (:methods + (new (symbol type uint uint int) rpc-buffer-pair 0) + (call (rpc-buffer-pair uint pointer uint) int 9) + (add-element (rpc-buffer-pair) pointer 10) + (decrement-elt-used (rpc-buffer-pair) int 11) + (sync (rpc-buffer-pair symbol) int 12) + (check-busy (rpc-buffer-pair) symbol 13) + (pop-last-received (rpc-buffer-pair) pointer 14) + ) + ) + +(defmethod new rpc-buffer-pair ((allocation symbol) (type-to-make type) (arg0 uint) (arg1 uint) (arg2 int)) + (let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s3-0 buffer 0) (new 'global 'rpc-buffer arg0 arg1)) + (set! (-> s3-0 buffer 1) (new 'global 'rpc-buffer arg0 arg1)) + (set! (-> s3-0 current) (-> s3-0 buffer 0)) + (set! (-> s3-0 last-recv-buffer) (the-as pointer #f)) + (set! (-> s3-0 rpc-port) arg2) + s3-0 + ) + ) + +(defmethod sync rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 symbol)) + (let ((s5-0 (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) + (when (-> s5-0 busy) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (if arg0 + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + ) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + ) + ) + (set! (-> s5-0 busy) #f) + (set! (-> s5-0 elt-used) (the-as uint 0)) + 0 + ) + ) + 0 + ) + +(defmethod check-busy rpc-buffer-pair ((obj rpc-buffer-pair)) + (let ((gp-0 (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) + (when (-> gp-0 busy) + (if (nonzero? (rpc-busy? (-> obj rpc-port))) + (return #t) + ) + (set! (-> gp-0 busy) #f) + (set! (-> gp-0 elt-used) (the-as uint 0)) + 0 + ) + ) + #f + ) + +(defmethod call rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) + (when (nonzero? (-> obj current elt-used)) + (let ((s2-0 (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) + (when (-> s2-0 busy) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + ) + ) + (set! (-> s2-0 busy) #f) + (set! (-> s2-0 elt-used) (the-as uint 0)) + 0 + ) + (let ((s1-0 (-> obj current))) + (rpc-call + (-> obj rpc-port) + arg0 + (the-as uint 1) + (the-as uint (-> s1-0 base)) + (the-as int (* (-> s1-0 elt-size) (-> s1-0 elt-used))) + (the-as uint arg1) + (the-as int arg2) + ) + (set! (-> s1-0 busy) (the-as basic #t)) + ) + (set! (-> obj last-recv-buffer) arg1) + (set! (-> obj current) s2-0) + ) + ) + 0 + ) + +(defmethod pop-last-received rpc-buffer-pair ((obj rpc-buffer-pair)) + (let ((v0-0 (-> obj last-recv-buffer))) + (set! (-> obj last-recv-buffer) (the-as pointer #f)) + v0-0 + ) + ) + +(defmethod add-element rpc-buffer-pair ((obj rpc-buffer-pair)) + (let ((v1-0 (-> obj current))) + (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) + (if (zero? (-> obj rpc-port)) + (format 0 "WARNING: too many sound commands queued~%") + ) + (call obj (the-as uint 0) (the-as pointer 0) (the-as uint 0)) + (set! v1-0 (-> obj current)) + ) + (let ((v0-2 (&+ (-> v1-0 base) (* (-> v1-0 elt-used) (-> v1-0 elt-size))))) + (+! (-> v1-0 elt-used) 1) + v0-2 + ) + ) + ) + +(defmethod decrement-elt-used rpc-buffer-pair ((obj rpc-buffer-pair)) + (if (> (-> obj current elt-used) 0) + (+! (-> obj current elt-used) -1) + ) + 0 + ) diff --git a/goal_src/jak2/engine/ps2/timer-h.gc b/goal_src/jak2/engine/ps2/timer-h.gc index 02617058cd..1990ceeaf6 100644 --- a/goal_src/jak2/engine/ps2/timer-h.gc +++ b/goal_src/jak2/engine/ps2/timer-h.gc @@ -7,3 +7,119 @@ ;; DECOMP BEGINS +;; There are two sources for timing: +;; - EE TIMER1, used for the frame profiler. There are 9765 counts of this per frame. It gets reset in drawable. +;; - The "stopwatch" system, used for reading the CPU clock cycle counter, at 300 MHz (32-bit) + +;; The Emotion Engine has 4 hardware timers, timer1 is used as the +(defconstant TIMER0_BANK (the timer-bank #x10000000)) ;; has HOLD register! +(defconstant TIMER1_BANK (the timer-bank #x10000800)) ;; has HOLD register! +(defconstant TIMER2_BANK (the timer-bank #x10001000)) ;; does NOT have HOLD register! +(defconstant TIMER3_BANK (the timer-bank #x10001800)) ;; does NOT have HOLD register! + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; PC Port Timer +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defmacro get-cpu-clock () + "Read the 300 MHz clock." + ;; __read-ee-timer is a 300 MHz timer from the C Kernel. + ;; it's a real timer. + `(the uint (logand #xffffffff (__read-ee-timer))) + ) + +(defmacro get-bus-clock/256 () + "Read the 150 MHz / 256 clock." + ;; 300 MHz / (2^9) + `(the uint (logand #xffffffff (shr (__read-ee-timer) 9))) + ) + +(#when PC_PORT + ;; the bus clock can be reset, which just stores the current count here. + (define *timer-reset-value* (the uint 0)) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Timer HW +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(defenum timer-clock-selection + :type uint8 + (busclk 0) + (busclk/16 1) + (busclk/256 2) + (hblank 3) + ) + +;; this matches the Tn_MODE register structure of the ps2 EE timers. +;; Only the lower 32 bits of these registers are usable, and the upper 16 hardwired to zero +(deftype timer-mode (uint32) + ((clks timer-clock-selection :offset 0 :size 2) + (gate uint8 :offset 2 :size 1) ;; gate function enable + (gats uint8 :offset 3 :size 1) ;; gate selection: 0 = hblank, 1 = vblank + ;; gate mode: + ;; 0: count while gate signal is low + ;; 1: start when gate signal rises + ;; 2: start when gate signal falls + ;; 3: start when gate signal rises/falls + (gatm uint8 :offset 4 :size 2) + (zret uint8 :offset 6 :size 1) ;; zero return: clear counter when equal to reference value + (cue uint8 :offset 7 :size 1) ;; count-up enable + (cmpe uint8 :offset 8 :size 1) ;; compare-interrupt enable + (ovfe uint8 :offset 9 :size 1) ;; overflow-interrupt enable + (equf uint8 :offset 10 :size 1) ;; equal-flag + (ovff uint8 :offset 11 :size 1) ;; overflow-flag + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; this matches an EE timer (without a HOLD register, timers 2 and 3) +;; Each register is 128-bits wide, but only the lower 32-bits are usable, and the upper +;; 16-bits of that are hardwired to zero. +(deftype timer-bank (structure) + ((count uint32 :offset 0) + (mode timer-mode :offset 16) + (comp uint32 :offset 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; this matches an EE timer (with a HOLD register, timers 0 and 1) +(deftype timer-hold-bank (timer-bank) + ((hold uint32 :offset 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; stopwatches are used to measure CPU clock cycles +;; they don't use the timer above, but instead the Count COP0 register +;; which counts CPU clock cycles directly +(deftype stopwatch (basic) + ((prev-time-elapsed time-frame :offset-assert 8) + (start-time time-frame :offset-assert 16) + (begin-level int32 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; Confusing! What IS this measuring exactly? Hmm... +;; this is set by default for NTSC, it will later be changed if PAL. +(define *ticks-per-frame* (/ 2500000 256)) ;; 2 500 000 / 256 = 9765 + +(defun timer-init ((timer timer-bank) (mode timer-mode)) + "Initiate a timer, start counting at a rate of 1 every 256 bus clocks (BUSCLK: ~147.456MHz)." + (set! (-> timer mode) mode) + (set! (-> timer count) 0) + ) + +;; needs PS2 TIMER porting +(#unless PC_PORT + (timer-init (the-as timer-bank TIMER1_BANK) (new 'static 'timer-mode :clks (timer-clock-selection busclk/16) :cue 1)) + ) diff --git a/goal_src/jak2/engine/ps2/timer.gc b/goal_src/jak2/engine/ps2/timer.gc index c40c47b78a..1ce3feb453 100644 --- a/goal_src/jak2/engine/ps2/timer.gc +++ b/goal_src/jak2/engine/ps2/timer.gc @@ -7,3 +7,279 @@ ;; DECOMP BEGINS +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Timer (EE timers) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun timer-count ((arg0 timer-bank)) + "Return a timer's counter value" + + (#when PC_PORT + (when (= arg0 TIMER1_BANK) + (return (- (get-bus-clock/256) *timer-reset-value*)) + ) + (format 0 "Unknown timer #x~X requested.~%" arg0) + ) + (.sync.l) + (let ((v0-0 (-> arg0 count))) + (.sync.l) + v0-0 + ) + ) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Interrupt Control +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;; cop0 status register "interrupt enable" flag +;; if cop0 status is needed anywhere else, move this elsewhere +(defconstant COP0_STATUS_IE (the-as uint #x1)) + +(defun disable-irq () + "Disable all interrupts. Has no effect on PC Port" + (rlet ((status :class gpr :type uint)) + (let ((status-mask (lognot COP0_STATUS_IE))) + (.mfc0 status Status) + (logand! status status-mask) ;; should status-mask be replaced directly? + (.mtc0 Status status) + (.sync.p) + ) + ) + ) + +(defun enable-irq () + "Enable all interrupts. Has no effect on PC Port." + (rlet ((status :class gpr :type uint)) + (.mfc0 status Status) + (logior! status COP0_STATUS_IE) + (.mtc0 Status status) + (.sync.p) + ) + ) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Stopwatch (CPU clock cycle counting) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defun stopwatch-init ((obj stopwatch)) + "Init a stopwatch" + (set! (-> obj begin-level) 0) + (set! (-> obj prev-time-elapsed) 0) + ) + + +(defun stopwatch-reset ((obj stopwatch)) + "Restart a stopwatch's times" + (set! (-> obj prev-time-elapsed) 0) + (when (> (-> obj begin-level) 0) + (let ((count 0)) + (.mfc0 count Count) + (#when PC_PORT + (set! count (the int (get-cpu-clock))) + ) + (set! (-> obj start-time) count) + ) + ) + ) + +(defun stopwatch-start ((obj stopwatch)) + "Start a stopwatch from scratch" + (when (zero? (-> obj begin-level)) + (set! (-> obj begin-level) 1) + (let ((count 0)) + (.mfc0 count Count) + (#when PC_PORT + (set! count (the int (get-cpu-clock))) + ) + (set! (-> obj start-time) count) + ) + ) + ) + +(defun stopwatch-stop ((obj stopwatch)) + "Fully stop a stopwatch and save its elapsed time" + (when (> (-> obj begin-level) 0) + (set! (-> obj begin-level) 0) + (let ((count 0)) + (let ((count 0)) + (.mfc0 count Count) ;; wrong register? a typo in a rlet? who knows. + (#when PC_PORT + (set! count (the int (get-cpu-clock))) + ) + (+! (-> obj prev-time-elapsed) (- count (-> obj start-time))) + ) + ) + ) + (none) + ) + +(defun stopwatch-begin ((obj stopwatch)) + "Begin a stopwatch level, and starts it if it hasn't yet" + (when (zero? (-> obj begin-level)) + (let ((count 0)) + (.mfc0 count Count) + (#when PC_PORT + (set! count (the int (get-cpu-clock))) + ) + (set! (-> obj start-time) count) + ) + ) + (+! (-> obj begin-level) 1) + ) + + +(defun stopwatch-end ((obj stopwatch)) + "End a stopwatch level. Stops the stopwatch if it's back to level zero. + There is no guard against ending a stopwatch too many times, and a negative level + will cause errors!" + (+! (-> obj begin-level) -1) + (when (zero? (-> obj begin-level)) + (set! (-> obj begin-level) 0) + (let ((count 0)) + (.mfc0 count Count) + (#when PC_PORT + (set! count (the int (get-cpu-clock))) + ) + + (+! (-> obj prev-time-elapsed) (- count (-> obj start-time))) + ) + ) + (none) + ) + +(defun stopwatch-elapsed-ticks ((obj stopwatch)) + "Returns the elapsed time so far (in clock cycles) of a stopwatch" + (let ((elapsed (-> obj prev-time-elapsed))) + (when (> (-> obj begin-level) 0) + (let ((count 0)) + (.mfc0 count Count) + (#when PC_PORT + (set! count (the int (get-cpu-clock))) + ) + + (+! elapsed (- count (-> obj start-time))) + (set! count elapsed) ;; ?? + ) + ) + elapsed + ) + ) + +(defglobalconstant EE_SECONDS_PER_TICK (/ 1.0 3000000)) ;; 300MHz is a "decent enough" estimate +(defmacro cpu-ticks-to-seconds (ticks) + `(* ,EE_SECONDS_PER_TICK ,ticks) + ) +(defun stopwatch-elapsed-seconds ((obj stopwatch)) + "Returns the elapsed time so far (in seconds) of a stopwatch" + (cpu-ticks-to-seconds (stopwatch-elapsed-ticks obj)) + ) + +(defmethod update-rates! clock ((obj clock) (arg0 float)) + "Recompute all clock values for the given clock ratio (arg0)." + + ;; remember our ratio + (set! (-> obj clock-ratio) arg0) + + ;; next, compute the time adjust ratio. This will be 1.0 for NTSC 60 fps. + ;; It will be adjusted for PAL (1.2), and also for lag (dog-ratio). + ;; The time ratio (and derived quantities) should be used for most per-frame calculations. + (let ((f0-6 (if (nonzero? *display*) + (* (-> *display* time-factor) (-> *display* dog-ratio) arg0) + (* 5.0 arg0) + ) + ) + ) + (set! (-> obj time-adjust-ratio) (* 0.2 f0-6)) ;; will be 5 for no-lag 60fps. + ) + + ;; real seconds per frame (of game logic, not vsycns) + (set! (-> obj seconds-per-frame) (* 0.016666668 (-> obj time-adjust-ratio))) + ;; inverse of the above. + (set! (-> obj frames-per-second) (if (= (-> obj time-adjust-ratio) 0.0) + 0.0 + (* 60.0 (/ 1.0 (-> obj time-adjust-ratio))) + ) + ) + + ;; convert to sparticle format. + (let* ((v1-12 (- (-> obj frame-counter) (-> obj old-frame-counter))) + (f0-14 v1-12) + (f1-9 (* 0.2 (the float v1-12))) + ) + (set-vector! (-> obj sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9) + ) + arg0 + ) + +(defmethod advance-by! clock ((obj clock) (arg0 float)) + "Advance the clock by arg0 timeframes (as a float). + Both counters keep a separate fractional and integer counter." + (the int (+ arg0 (-> obj accum))) ;; unused + + ;; add to accumulated time + (+! (-> obj integral-accum) arg0) + + ;; remember the old frame-count from last time + (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) + + ;; time-factor tells us how much time per vsync, if we've accumulated at least that much, increment integral + ;; frame counter as needed. + (while (>= (-> obj integral-accum) (-> *display* time-factor)) + (+! (-> obj integral-frame-counter) 1) + (set! (-> obj integral-accum) (- (-> obj integral-accum) (-> *display* time-factor))) + ) + + ;; now the same for timeframe counter. + (let ((v1-7 (the int (+ arg0 (-> obj accum))))) + (set! (-> obj accum) (- (+ arg0 (-> obj accum)) (the float v1-7))) + (set! (-> obj old-frame-counter) (-> obj frame-counter)) + (+! (-> obj frame-counter) v1-7) + ) + + ;; recompute rates. + (update-rates! obj (-> obj clock-ratio)) + obj + ) + +(defmethod tick! clock ((obj clock)) + "Per-game-frame clock tick forward." + (if (zero? (logand (-> obj mask) (-> *kernel-context* prevent-from-run))) + ;; include: ntsc/pal scale, lag, and clock ratio. + (advance-by! obj (* (-> *display* time-factor) (-> *display* dog-ratio) (-> obj clock-ratio))) + (set! (-> obj sparticle-data x) 0.0) + ) + obj + ) + +(defmethod reset! clock ((obj clock)) + "Reset a clock to 1000s, rate of 1." + (set! (-> obj frame-counter) (seconds 1000)) + (set! (-> obj integral-frame-counter) (the-as uint #x493e0)) + (set! (-> obj accum) 0.0) + (set! (-> obj old-frame-counter) (+ (-> obj frame-counter) -1)) + (set! (-> obj old-integral-frame-counter) (+ (-> obj integral-frame-counter) -1)) + (update-rates! obj 1.0) + 0 + (none) + ) + +(defmethod save! clock ((obj clock) (arg0 (pointer uint64))) + "Save a clock's state to a buffer, return bytes used." + (set! (-> arg0 0) (the-as uint (-> obj frame-counter))) + (set! (-> arg0 1) (-> obj integral-frame-counter)) + 16 + ) + +(defmethod load! clock ((obj clock) (arg0 (pointer uint64))) + "Load a clock's state from a buffer, return bytes used." + (set! (-> obj frame-counter) (the-as time-frame (-> arg0 0))) + (set! (-> obj integral-frame-counter) (-> arg0 1)) + (set! (-> obj accum) 0.0) + (set! (-> obj integral-accum) 0.0) + (set! (-> obj old-frame-counter) (-> obj frame-counter)) + (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) + 16 + ) + diff --git a/goal_src/jak2/engine/ps2/vif-h.gc b/goal_src/jak2/engine/ps2/vif-h.gc index 725d6a411b..102d345c69 100644 --- a/goal_src/jak2/engine/ps2/vif-h.gc +++ b/goal_src/jak2/engine/ps2/vif-h.gc @@ -7,3 +7,82 @@ ;; DECOMP BEGINS +;; Types related to VIF: the PS2's Vector Interface. +;; Each of VU0 and VU1 has a VIF which is used to sent/receive data. +;; The VIFs are controller by registers and fed data using DMA +;; the vif registers defined here are used extremely rarely, usually they are sent DMA +;; (during gameplay, everything is synchronized by DMA, so code generally does not know when +;; it is safe to mess with VIF registers.) + +;;VIF0_STAT or VIF1_STAT bitfields +(deftype vif-stat (uint32) + ((vps uint8 :offset 0 :size 2) + (vew uint8 :offset 2 :size 1) + (mrk uint8 :offset 6 :size 1) + (vss uint8 :offset 8 :size 1) + (vfs uint8 :offset 9 :size 1) + (vis uint8 :offset 10 :size 1) + (int uint8 :offset 11 :size 1) + (er0 uint8 :offset 12 :size 1) + (er1 uint8 :offset 13 :size 1) + (fqc uint8 :offset 24 :size 4) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vif-fbrst (uint32) + ((rst uint8 :offset 0 :size 1) + (fbk uint8 :offset 1 :size 1) + (stp uint8 :offset 2 :size 1) + (stc uint8 :offset 3 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vif-err (uint32) + ((mii uint8 :offset 0 :size 1) + (me0 uint8 :offset 1 :size 1) ;; PS2 hardware bug, must set this to 1 for correct operation. + (me1 uint8 :offset 2 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype vif-bank (structure) + ((stat uint32 :offset-assert 0) + (fbrst uint32 :offset 16) + (err vif-err :offset 32) + (mark uint32 :offset 48) + (cycle uint32 :offset 64) + (mode uint32 :offset 80) + (num uint32 :offset 96) + (mask uint32 :offset 112) + (code uint32 :offset 128) + (itops uint32 :offset 144) + (base uint32 :offset 160) + (offset uint32 :offset 176) + (tops uint32 :offset 192) + (itop uint32 :offset 208) + (top uint32 :offset 224) + (r0 uint32 :offset 256) + (r1 uint32 :offset 272) + (r2 uint32 :offset 288) + (r3 uint32 :offset 304) + (c0 uint32 :offset 320) + (c1 uint32 :offset 336) + (c2 uint32 :offset 352) + (c3 uint32 :offset 368) + ) + :method-count-assert 9 + :size-assert #x174 + :flag-assert #x900000174 + ) + +;; PS2 VIF map. There are no VIFs in OpenGOAL. +(defconstant VIF0_BANK (the vif-bank #x10003800)) +(defconstant VIF1_BANK (the vif-bank #x10003c00)) diff --git a/goal_src/jak2/engine/ps2/vu1-macros.gc b/goal_src/jak2/engine/ps2/vu1-macros.gc index a77c2dcdc0..f526926ccd 100644 --- a/goal_src/jak2/engine/ps2/vu1-macros.gc +++ b/goal_src/jak2/engine/ps2/vu1-macros.gc @@ -7,3 +7,240 @@ ;; DECOMP BEGINS + +;; this file has no code, just macros for vector-unit stuff. + +;; in OpenGOAL we're also using this for VU0 macros to help with VU0 operations that are not +;; directly implemented by the OpenGOAL compiler + +(defmacro vu-clip (vfr cf) + "Returns the result of VCLIP. + NOTE: this implementation is pretty inefficient. + If this ends up used a lot, it's probably worth rewriting. + " + `(let ((vec (new 'stack 'vector)) + (flag ,cf) + ) + (.svf vec ,vfr) + (let* ((w-plus (fabs (-> vec w))) + (w-minus (- 0.0 w-plus)) + ) + ;; CF = CF << 6 + (set! flag (logand #xffffff (shl flag 6))) + + (when (> (-> vec x) w-plus) + (logior! flag 1) + ) + (when (< (-> vec x) w-minus) + (logior! flag 2) + ) + (when (> (-> vec y) w-plus) + (logior! flag 4) + ) + (when (< (-> vec y) w-minus) + (logior! flag 8) + ) + (when (> (-> vec z) w-plus) + (logior! flag 16) + ) + (when (< (-> vec z) w-minus) + (logior! flag 32) + ) + ) + flag + ) + ) + + +(defmacro vftoi4.xyzw (dst src) + "convert to 28.4 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + + `(begin + (rlet ((temp :class vf)) + (set! temp 16.0) + (.mul.x.vf temp ,src temp) + (.ftoi.vf ,dst temp) + ) + ) + ) + +(defmacro vftoi12.xyzw (dst src) + "convert to 20.12 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + + `(begin + (rlet ((temp :class vf)) + (set! temp 4096.0) + (.mul.x.vf temp ,src temp) + (.ftoi.vf ,dst temp) + ) + ) + ) + +(defmacro vftoi15.xyzw (dst src) + "convert to 17.15 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + + `(begin + (rlet ((temp :class vf)) + (set! temp 32768.0) + (.mul.x.vf temp ,src temp) + (.ftoi.vf ,dst temp) + ) + ) + ) + +(defmacro vitof4.xyzw (dst src) + "convert from a 28.4 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + + `(begin + (rlet ((temp :class vf)) + (.itof.vf ,dst ,src) + (set! temp 0.0625) + (.mul.x.vf ,dst ,dst temp) + ) + ) + ) + +(defmacro vitof12.xyzw (dst src) + "convert from a 20.12 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + +`(begin + (rlet ((temp :class vf)) + (.itof.vf ,dst ,src) + (set! temp 0.000244140625) + (.mul.x.vf ,dst ,dst temp) + ) + ) +) + +(defmacro vitof15.xyzw (dst src) + "convert from a 17.15 integer. This does the multiply while the number is still + a float. This will have issues for very large floats, but it seems like this + is how PCSX2 does it as well, so maybe it's right? + NOTE: this is the only version of the instruction used in Jak 1, so we + don't need to worry about masks." + +`(begin + (rlet ((temp :class vf)) + (.itof.vf ,dst ,src) + (set! temp 0.000030517578125) + (.mul.x.vf ,dst ,dst temp) + ) + ) +) + +;; In the original game, init-for-transform stashed a bunch of stuff in registers, to be used by other functions. +;; In OpenGOAL, this seems risky so we're going to back up this manually. +;; This does mean this file now has code, but it's not a big deal. +;; This seems like it is very old GOAL code and is really only used for debug and a few weird leftovers. +;; In Jak 2, it's only used for the camera debug drawing code. +(deftype transform-regs (structure) + ;; Eventually we might want to actually name some of these fields to be more comprehensible? + (;; vf0 not included! + (vf1 uint128) + (vf2 uint128) + (vf3 uint128) + (vf4 uint128) + (vf5 uint128) + (vf6 uint128) + (vf7 uint128) + (vf8 uint128) + (vf9 uint128) + (vf10 uint128) + (vf11 uint128) + (vf12 uint128) + (vf13 uint128) + (vf14 uint128) + (vf15 uint128) + (vf16 uint128) + (vf17 uint128) + (vf18 uint128) + (vf19 uint128) + (vf20 uint128) + (vf21 uint128) + (vf22 uint128) + (vf23 uint128) + (vf24 uint128) + (vf25 uint128) + (vf26 uint128) + (vf27 uint128) + (vf28 uint128) + (vf29 uint128) + (vf30 uint128) + (vf31 uint128) + ) + ) + +(define *transform-regs* (new 'static 'transform-regs)) + + +(defmacro with-vf0 (&rest body) + "Macro for using the ps2-style vf0 register." + + `(rlet ((vf0 :class vf)) + (init-vf0-vector) + ,@body + ) + ) + +(defmacro load-vf (reg) + "Load a vf from the preserved vf registers" + `(.lvf ,reg (&-> *transform-regs* ,reg)) + ) + +(defmacro save-vf (reg) + "Save a vf to the preserved vf registers" + `(.svf (&-> *transform-regs* ,reg) ,reg) + ) + +(defmacro with-vf (regs &key (rw 'read) &rest body) + "Macro for using the specified ps2-style vf registers. These are preserved in *transform-regs* + Each register name in regs must be a valid vf register name. vf0 CANNOT be used! Use with-vf0 for that instead. + rw specifies the read/write mode: + 'read means the registers will be read from the preserved registers. This is the default + 'write means the registers will be written to the preserved registers at the end + 'readwrite (or 'rw) means both + #f means neither, turning this into a fancy macro around rlet." + + `(rlet (,@(apply (lambda (x) `(,x :class vf)) regs)) + + ,@(if (or (eq? rw ''read) (eq? rw ''readwrite) (eq? rw ''rw)) + (apply (lambda (y) + `(load-vf ,y) + ) regs) + '() + ) + + ,@body + + ;; this will mess up the return value! + ,@(if (or (eq? rw ''write) (eq? rw ''readwrite) (eq? rw ''rw)) + (apply (lambda (y) + `(save-vf ,y) + ) regs) + '() + ) + + ) + ) + + diff --git a/goal_src/jak2/engine/scene/scene-h.gc b/goal_src/jak2/engine/scene/scene-h.gc index 53a4844000..2bfeb7f911 100644 --- a/goal_src/jak2/engine/scene/scene-h.gc +++ b/goal_src/jak2/engine/scene/scene-h.gc @@ -7,3 +7,106 @@ ;; DECOMP BEGINS +(deftype scene-actor (basic) + ((name basic :offset-assert 4) + (level basic :offset-assert 8) + (art-group basic :offset-assert 12) + (prefix basic :offset-assert 16) + (draw-frames basic :offset-assert 20) + (scissor-frames basic :offset-assert 24) + (camera int16 :offset-assert 28) + (light-index uint8 :offset-assert 30) + (shadow-mask uint8 :offset-assert 31) + (shadow-values uint32 :offset-assert 32) + (flags uint32 :offset-assert 36) + (command-list basic :offset-assert 40) + (shadow-flags int32 :offset-assert 44) + (shadow-volume-joint basic :offset-assert 48) + (draw-seg uint64 :offset-assert 56) + (no-draw-seg uint64 :offset-assert 64) + (process uint64 :offset-assert 72) + ) + :method-count-assert 10 + :size-assert #x50 + :flag-assert #xa00000050 + (:methods + (scene-actor-method-9 () none 9) + ) + ) + + +(deftype scene (art-group) + ((mask-to-clear uint32 :offset-assert 32) + (entity basic :offset-assert 36) + (art-group basic :offset-assert 40) + (anim basic :offset-assert 44) + (parts int32 :offset-assert 48) + (command-list basic :offset-assert 52) + (cut-list basic :offset-assert 56) + (wait-max-time time-frame :offset-assert 64) + (wait-air-time time-frame :offset-assert 72) + (wait-ground-time time-frame :offset-assert 80) + (draw-target basic :offset-assert 88) + (abort basic :offset-assert 92) + (actor basic :offset-assert 96) + (load-point basic :offset-assert 100) + (end-point basic :offset-assert 104) + (borrow basic :offset-assert 108) + (sfx-volume float :offset-assert 112) + (ambient-volume float :offset-assert 116) + (music-volume float :offset-assert 120) + (blackout-end basic :offset-assert 124) + (peaceful basic :offset-assert 128) + (music-delay float :offset-assert 132) + (save basic :offset-assert 136) + (scene-task uint16 :offset-assert 140) + ) + :method-count-assert 17 + :size-assert #x8e + :flag-assert #x110000008e + (:methods + (scene-method-15 () none 15) + (scene-method-16 () none 16) + ) + ) + +(deftype scene-player (process-drawable) + ((scene-list basic :offset-assert 200) + (scene basic :offset-assert 204) + (scene-index int32 :offset-assert 208) + (anim basic :offset-assert 212) + (next-anim basic :offset-assert 216) + (camera uint64 :offset-assert 224) + (main-entity basic :offset-assert 232) + (wait basic :offset-assert 236) + (old-target-pos transformq :inline :offset-assert 240) + (pre-cut-frame basic :offset-assert 288) + (preload-continue basic :offset-assert 292) + (dma-max uint32 :offset-assert 296) + (gui-id uint32 :offset-assert 300) + (aborted? basic :offset-assert 304) + (scene-start-time time-frame :offset-assert 312) + (targ-speed float :offset-assert 320) + (cur-speed float :offset-assert 324) + (speed-change-time time-frame :offset-assert 328) + (speed-press-time time-frame :offset-assert 336) + (speed-change-speed float :offset-assert 344) + (subtitle-change-time time-frame :offset-assert 352) + (user-sound uint32 4 :offset-assert 360) + ) + :heap-base #x100 + :method-count-assert 26 + :size-assert #x178 + :flag-assert #x1a01000178 + (:methods + (scene-player-method-20 () none 20) + (scene-player-method-21 () none 21) + (scene-player-method-22 () none 22) + (scene-player-method-23 () none 23) + (scene-player-method-24 () none 24) + (scene-player-method-25 () none 25) + ) + ) + +(define *scene-player* (the-as scene-player #f)) + diff --git a/goal_src/jak2/engine/sound/gsound-h.gc b/goal_src/jak2/engine/sound/gsound-h.gc index df46781150..42bfbc0b5b 100644 --- a/goal_src/jak2/engine/sound/gsound-h.gc +++ b/goal_src/jak2/engine/sound/gsound-h.gc @@ -5,5 +5,442 @@ ;; name in dgo: gsound-h ;; dgos: ENGINE, GAME +;; TODO: methods for ambient-sound. + +(defenum sound-command + :type uint16 + ; (load-bank) + ; (load-music) + ; (unload-bank) + ; (play) + ; (pause-sound) + ; (stop-sound) + ; (continue-sound) + ; (set-param) + ; (set-master-volume) + ; (pause-group) + ; (stop-group) + ; (continue-group) + ; (get-irx-version) + ; (set-falloff-curve) + ; (set-sound-falloff) + ; (reload-info) + ; (set-language) + ; (set-flava) + ; (set-reverb) + ; (set-ear-trans) + ; (shutdown) + ; (list-sounds) + ; (unload-music) + ; (set-fps) + ) + +(defenum sound-group + :bitfield #t + :type uint8 + (sfx) + (sog1) + (sog2) + (sog3) + (sog4) + (sog5) + (sog6) + (sog7) + ; (sfx) + ; (music) + ; (dialog) + ; (sog3) + ; (ambient) + ; (sog5) + ; (sog6) + ; (sog7) + ) + +(defenum sound-mask + :bitfield #t + :type uint16 + (volume) + (pitch) + (bend) + (unused) + (time) + (trans) + (fo-min) + (fo-max) + (fo-curve) + ) + + ;; DECOMP BEGINS +(deftype sound-stream-name (structure) + ((name uint8 48 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype sound-id (uint32) + () + :method-count-assert 10 + :size-assert #x4 + :flag-assert #xa00000004 + (:methods + (unused-9 () none 9) + ) + ) + +(deftype sound-bank-id (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype sound-name (uint128) + ((lo uint64 :offset 0 :size 64) + (hi uint64 :offset 64 :size 64) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype sound-rpc-cmd (structure) + ((rsvd1 uint16 :offset-assert 0) + (command sound-command :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype sound-play-params (structure) + ((mask uint16 :offset-assert 0) + (pitch-mod int16 :offset-assert 2) + (bend int16 :offset-assert 4) + (fo-min int16 :offset-assert 6) + (fo-max int16 :offset-assert 8) + (fo-curve int8 :offset-assert 10) + (priority int8 :offset-assert 11) + (volume int32 :offset-assert 12) + (trans int32 3 :offset-assert 16) + (group uint8 :offset-assert 28) + (reg uint8 3 :offset-assert 29) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + + +(deftype sound-rpc-bank-cmd (sound-rpc-cmd) + ((bank-name sound-name :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype sound-rpc-test-cmd (sound-rpc-cmd) + ((ee-addr uint32 :offset-assert 4) + (param0 uint16 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xa + :flag-assert #x90000000a + ) + +(deftype sound-rpc-sound-cmd (sound-rpc-cmd) + ((id sound-id :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype sound-rpc-group-cmd (sound-rpc-cmd) + ((group sound-group :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +(deftype sound-rpc-load-bank (sound-rpc-bank-cmd) + ((ee-addr uint32 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(deftype sound-rpc-load-music (sound-rpc-bank-cmd) + () + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype sound-rpc-unload-bank (sound-rpc-bank-cmd) + () + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +(deftype sound-rpc-play (sound-rpc-sound-cmd) + ((name sound-name :offset-assert 16) + (params sound-play-params :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +(deftype sound-rpc-pause-sound (sound-rpc-sound-cmd) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype sound-rpc-stop-sound (sound-rpc-sound-cmd) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype sound-rpc-continue-sound (sound-rpc-sound-cmd) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype sound-rpc-set-param (sound-rpc-sound-cmd) + ((params sound-play-params :inline :offset-assert 8) + (auto-time int32 :offset-assert 40) + (auto-from int32 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype sound-rpc-set-master-volume (sound-rpc-group-cmd) + ((volume int32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +(deftype sound-rpc-pause-group (sound-rpc-group-cmd) + () + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +(deftype sound-rpc-stop-group (sound-rpc-group-cmd) + () + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +(deftype sound-rpc-continue-group (sound-rpc-group-cmd) + () + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +(deftype sound-rpc-get-irx-version (sound-rpc-cmd) + ((major uint32 :offset-assert 4) + (minor uint32 :offset-assert 8) + (ee-addr pointer :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype sound-rpc-set-language (sound-rpc-cmd) + ((lang uint32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype sound-rpc-set-stereo-mode (sound-rpc-cmd) + ((mode int32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype sound-rpc-set-reverb (sound-rpc-cmd) + ((core uint8 :offset-assert 4) + (reverb int32 :offset-assert 8) + (left uint32 :offset-assert 12) + (right uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype sound-rpc-set-ear-trans (sound-rpc-cmd) + ((ear-trans1 int32 3 :offset-assert 4) + (ear-trans0 int32 3 :offset-assert 16) + (cam-trans int32 3 :offset-assert 28) + (cam-angle int32 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype sound-rpc-set-flava (sound-rpc-cmd) + ((flava uint8 :offset-assert 4) + (excitement uint8 :offset-assert 5) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +(deftype sound-rpc-set-midi-reg (sound-rpc-cmd) + ((reg int32 :offset-assert 4) + (value int16 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xa + :flag-assert #x90000000a + ) + +(deftype sound-rpc-shutdown (sound-rpc-cmd) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype sound-rpc-set-fps (sound-rpc-cmd) + ((fps uint8 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +(deftype sound-rpc-list-sounds (sound-rpc-cmd) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype sound-rpc-unload-music (sound-rpc-cmd) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype sound-rpc-union (structure) + ((data uint32 20 :offset-assert 0) + (load-bank sound-rpc-load-bank :offset 0) + (unload-bank sound-rpc-unload-bank :offset 0) + (play sound-rpc-play :offset 0) + (pause-sound sound-rpc-pause-sound :offset 0) + (stop-sound sound-rpc-stop-sound :offset 0) + (continue-sound sound-rpc-continue-sound :offset 0) + (set-param sound-rpc-set-param :offset 0) + (set-master-volume sound-rpc-set-master-volume :offset 0) + (pause-group sound-rpc-pause-group :offset 0) + (stop-group sound-rpc-stop-group :offset 0) + (continue-group sound-rpc-continue-group :offset 0) + (get-irx-version sound-rpc-get-irx-version :offset 0) + (set-language sound-rpc-set-language :offset 0) + (set-reverb sound-rpc-set-reverb :offset 0) + (set-ear-trans sound-rpc-set-ear-trans :offset 0) + (set-flava sound-rpc-set-flava :offset 0) + (set-midi-reg sound-rpc-set-midi-reg :offset 0) + (set-fps sound-rpc-set-fps :offset 0) + (shutdown sound-rpc-shutdown :offset 0) + (list-sounds sound-rpc-list-sounds :offset 0) + (unload-music sound-rpc-unload-music :offset 0) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype sound-spec (basic) + ((mask sound-mask :offset-assert 4) + (num float :offset-assert 8) + (group sound-group :offset-assert 12) + (reg uint8 3 :offset-assert 13) + (sound-name-char uint8 16 :offset-assert 16) + (sound-name sound-name :offset 16) + (trans int32 4 :offset-assert 32) + (volume int32 :offset-assert 48) + (pitch-mod int32 :offset-assert 52) + (bend int32 :offset-assert 56) + (fo-min int16 :offset-assert 60) + (fo-max int16 :offset-assert 62) + (fo-curve int8 :offset-assert 64) + (priority int8 :offset-assert 65) + (auto-time int32 :offset-assert 68) + (auto-from int32 :offset-assert 72) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +(define *current-sound-id* (the-as sound-id #x10000)) + +(deftype ambient-sound (basic) + ((spec sound-spec :offset-assert 4) + (playing-id sound-id :offset-assert 8) + (trans vector :inline :offset-assert 16) + (name sound-name :offset-assert 32) + (play-time time-frame :offset-assert 48) + (time-base time-frame :offset-assert 56) + (time-random time-frame :offset-assert 64) + (volume int32 :offset-assert 72) + (pitch int32 :offset-assert 76) + (falloff-near int32 :offset-assert 80) + (falloff-far int32 :offset-assert 84) + (falloff-mode int32 :offset-assert 88) + (params (pointer float) :offset-assert 92) + (param-count int32 :offset-assert 96) + (entity entity :offset-assert 100) + (sound-count int32 :offset-assert 104) + ) + :method-count-assert 16 + :size-assert #x6c + :flag-assert #x100000006c + (:methods + (ambient-sound-method-9 () none 9) + (ambient-sound-method-10 () none 10) + (ambient-sound-method-11 () none 11) + (ambient-sound-method-12 () none 12) + (ambient-sound-method-13 () none 13) + (ambient-sound-method-14 () none 14) + (ambient-sound-method-15 () none 15) + ) + ) + + + + diff --git a/goal_src/jak2/engine/sound/speech-h.gc b/goal_src/jak2/engine/sound/speech-h.gc index 4df19af789..379d89e857 100644 --- a/goal_src/jak2/engine/sound/speech-h.gc +++ b/goal_src/jak2/engine/sound/speech-h.gc @@ -5,5 +5,89 @@ ;; name in dgo: speech-h ;; dgos: ENGINE, GAME + +(defenum speech-type-flag + :type uint8 + :bitfield #t + (random-order 0) + ) + +(defenum speech-channel-flag + :type uint8 + :bitfield #t + (disable 0) + ) + ;; DECOMP BEGINS +(deftype speech-type-info (structure) + ((channel uint8 :offset-assert 0) + (flags speech-type-flag :offset-assert 1) + (priority int8 :offset-assert 2) + (request-timeout uint16 :offset-assert 4) + (min-delay uint16 :offset-assert 6) + (max-delay uint16 :offset-assert 8) + (delay uint16 :offset-assert 10) + (play-index int16 :offset-assert 12) + (list basic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype speech-request (structure) + ((handle uint64 :offset-assert 0) + (time time-frame :offset-assert 8) + (priority float :offset-assert 16) + (speech-type int8 :offset-assert 20) + ) + :pack-me + :method-count-assert 9 + :size-assert #x15 + :flag-assert #x900000015 + ) + +(deftype speech-channel (structure) + ((flags speech-channel-flag :offset-assert 0) + (gui-channel gui-channel :offset-assert 1) + (delay uint16 :offset-assert 2) + (id uint32 :offset-assert 4) + (update-time time-frame :offset-assert 8) + (start-time time-frame :offset-assert 16) + (end-time time-frame :offset-assert 24) + (request speech-request :inline :offset-assert 32) + (last-request speech-request :inline :offset-assert 56) + (target-pos vector :inline :offset-assert 80) + (speech-table uint32 :offset-assert 96) + ) + :method-count-assert 14 + :size-assert #x64 + :flag-assert #xe00000064 + (:methods + (speech-channel-method-9 () none 9) + (speech-channel-method-10 () none 10) + (speech-channel-method-11 () none 11) + (speech-channel-method-12 () none 12) + (speech-channel-method-13 () none 13) + ) + ) + +(deftype speech-control (structure) + ((channel-array speech-channel 2 :inline :offset-assert 0) + (speech-table uint32 57 :offset-assert 224) + ) + :method-count-assert 17 + :size-assert #x1c4 + :flag-assert #x11000001c4 + (:methods + (speech-control-method-9 () none 9) + (speech-control-method-10 () none 10) + (speech-control-method-11 () none 11) + (speech-control-method-12 () none 12) + (speech-control-method-13 () none 13) + (speech-control-method-14 () none 14) + (speech-control-method-15 () none 15) + (speech-control-method-16 () none 16) + ) + ) diff --git a/goal_src/jak2/engine/spatial-hash/actor-hash-h.gc b/goal_src/jak2/engine/spatial-hash/actor-hash-h.gc index 99229e1a49..a09a3eb5b9 100644 --- a/goal_src/jak2/engine/spatial-hash/actor-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/actor-hash-h.gc @@ -7,3 +7,6 @@ ;; DECOMP BEGINS +(define *actor-list* (malloc 'global 1024)) +(define *actor-list-length* 0) + diff --git a/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc b/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc index 5ef93e7876..d03570df85 100644 --- a/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/collide-hash-h.gc @@ -7,3 +7,116 @@ ;; DECOMP BEGINS +(define *collide-list-boxes* (the-as object #f)) + +(define *collide-hash-fragments* (the-as object 0)) + +(define *collide-hash-fragments-tfrag* (the-as object 0)) + +(define *collide-hash-fragments-instance* (the-as object 0)) + +(define *already-printed-exeeded-max-cache-tris* #f) + +(deftype collide-hash-scratch (structure) + ((collidable-bits uint128 128 :offset-assert 0) + (poly-bits uint64 2 :offset 0) + (id-bits uint32 512 :offset 0) + (tris uint32 :offset-assert 2048) + ) + :method-count-assert 9 + :size-assert #x804 + :flag-assert #x900000804 + ) + +(deftype collide-hash-bucket (structure) + ((index int16 :offset-assert 0) + (count int16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype collide-hash-item (structure) + ((id uint32 :offset-assert 0) + (collidable basic :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype collide-hash-poly (structure) + ((data uint8 4 :offset-assert 0) + (vert-index0 uint8 :offset 0) + (vert-index1 uint8 :offset 1) + (vert-index2 uint8 :offset 2) + (pat-index uint8 :offset 3) + (word uint32 :offset 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype collide-hash-fragment-stats (structure) + ((num-verts uint16 :offset-assert 0) + (num-polys uint8 :offset-assert 2) + (poly-count uint8 :offset-assert 3) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype collide-hash-fragment (drawable) + ((num-buckets uint16 :offset 4) + (num-indices uint16 :offset 6) + (pat-array uint32 :offset 8) + (bucket-array uint32 :offset 12) + (grid-step vector :inline :offset-assert 32) + (bbox bounding-box :inline :offset-assert 48) + (bbox4w bounding-box4w :inline :offset-assert 80) + (axis-scale vector :inline :offset 64) + (avg-extents vector :inline :offset 80) + (dimension-array uint32 4 :offset 44) + (stats collide-hash-fragment-stats :inline :offset 60) + (num-verts uint16 :offset 60) + (num-polys uint8 :offset 62) + (poly-count uint8 :offset 63) + (poly-array uint32 :offset 76) + (vert-array uint32 :offset 92) + (index-array uint32 :offset 108) + ) + :method-count-assert 17 + :size-assert #x70 + :flag-assert #x1100000070 + ) + +(deftype collide-hash-fragment-array (array) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype collide-hash (drawable) + ((num-ids uint16 :offset 4) + (id-count uint16 :offset 6) + (num-buckets uint32 :offset 8) + (qwc-id-bits uint32 :offset 12) + (grid-step vector :inline :offset 16) + (bbox bounding-box :inline :offset-assert 32) + (bbox4w bounding-box4w :inline :offset-assert 64) + (axis-scale vector :inline :offset 48) + (avg-extents vector :inline :offset 64) + (bucket-array uint32 :offset 44) + (item-array uint32 :offset 60) + (dimension-array uint32 3 :offset 76) + (num-items uint32 :offset 92) + ) + :method-count-assert 17 + :size-assert #x60 + :flag-assert #x1100000060 + ) 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 549f9d9c9d..700d512c01 100644 --- a/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc +++ b/goal_src/jak2/engine/spatial-hash/spatial-hash-h.gc @@ -7,3 +7,124 @@ ;; DECOMP BEGINS +(deftype grid-hash-word (uint8) + () + :method-count-assert 9 + :size-assert #x1 + :flag-assert #x900000001 + ) + +(deftype grid-hash-box (structure) + ((min uint8 3 :offset-assert 0) + (max uint8 3 :offset-assert 3) + ) + :pack-me + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +(deftype grid-hash (basic) + ((work basic :offset-assert 4) + (search-box grid-hash-box :inline :offset-assert 8) + (bucket-size int16 :offset-assert 14) + (axis-scale uint32 3 :offset-assert 16) + (dimension-array uint8 3 :offset-assert 28) + (vertical-cell-count int8 :offset-assert 31) + (bucket-array uint32 :offset-assert 32) + (box-min uint32 3 :offset-assert 36) + (box-max uint32 3 :offset-assert 48) + (object-count int16 :offset-assert 60) + (bucket-count int16 :offset-assert 62) + (min-cell-size float :offset-assert 64) + (bucket-memory-size int32 :offset-assert 68) + (mem-bucket-array uint32 :offset-assert 72) + (spr-bucket-array uint32 :offset-assert 76) + (debug-draw basic :offset-assert 80) + (use-scratch-ram basic :offset-assert 84) + ) + :method-count-assert 25 + :size-assert #x58 + :flag-assert #x1900000058 + (:methods + (grid-hash-method-9 () none 9) + (grid-hash-method-10 () none 10) + (grid-hash-method-11 () none 11) + (grid-hash-method-12 () none 12) + (grid-hash-method-13 () none 13) + (grid-hash-method-14 () none 14) + (grid-hash-method-15 () none 15) + (grid-hash-method-16 () none 16) + (grid-hash-method-17 () none 17) + (grid-hash-method-18 () none 18) + (grid-hash-method-19 () none 19) + (grid-hash-method-20 () none 20) + (grid-hash-method-21 () none 21) + (grid-hash-method-22 () none 22) + (grid-hash-method-23 () none 23) + (grid-hash-method-24 () none 24) + ) + ) + +(deftype find-nav-sphere-ids-params (structure) + ((bsphere sphere :inline :offset-assert 0) + (y-threshold float :offset-assert 16) + (len int16 :offset-assert 20) + (max-len int16 :offset-assert 22) + (mask uint8 :offset-assert 24) + (array uint32 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :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) + ) + :method-count-assert 34 + :size-assert #x68 + :flag-assert #x2200000068 + (:methods + (sphere-hash-method-25 () none 25) + (sphere-hash-method-26 () none 26) + (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-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) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype spatial-hash (sphere-hash) + ((object-array uint32 :offset-assert 104) + (mem-object-array uint32 :offset-assert 108) + (spr-object-array uint32 :offset-assert 112) + ) + :method-count-assert 41 + :size-assert #x74 + :flag-assert #x2900000074 + (:methods + (spatial-hash-method-34 () none 34) + (spatial-hash-method-35 () none 35) + (spatial-hash-method-36 () none 36) + (spatial-hash-method-37 () none 37) + (spatial-hash-method-38 () none 38) + (spatial-hash-method-39 () none 39) + (spatial-hash-method-40 () none 40) + ) + ) diff --git a/goal_src/jak2/engine/target/surface-h.gc b/goal_src/jak2/engine/target/surface-h.gc index 31ffe0ef54..e96972247a 100644 --- a/goal_src/jak2/engine/target/surface-h.gc +++ b/goal_src/jak2/engine/target/surface-h.gc @@ -5,5 +5,1174 @@ ;; name in dgo: surface-h ;; dgos: ENGINE, GAME +(define-extern rail-surface-touch (function none)) +(define-extern gravel-surface-touch (function none)) + +(defenum surface-flag + :bitfield #t + :type uint32 + + (look-around 0) ;; 1 + (xz-local 1) ;; 2 + (smooth-collision 2) ;; 4 + (no-turn-around 3) ;; 8 + (turn-to-pad 4) ;; 16 + (turn-to-vel 5) ;; 32 + (no-jump 6) ;; 64 + (no-attack 7) ;; 128 + (no-hands 8) ;; 256 + (no-feet 9) ;; 512 + (check-edge 10) ;; 1024 + (air 11) ;; 2048 + (attack 12) ;; 4096 + (duck 13) ;; 8192 + (momentum 14) ;; 16384 + (turn-when-centered 15) ;; 32768 + + (turn-to-alt 16) ;; hi 1 + (spin 17) ;; hi 2 + (super 18) ;; hi 4 + (gun-inactive 19) ;; hi 8 + (gun-hide 20) ;; hi 16 + (gun-off 21) ;; hi 32 + (gun-fast-exit 22) ;; hi 64 + (gun-direct 23) ;; hi 128 + (gun-strafe 24) ;; hi 256 + (gun-no-twist 25) ;; hi 512 + (laser-hide 26) ;; hi 1024 + (no-board 27) ;; hi 2048 + (gun-turn-fast 28) ;; hi 4096 + ) + + ;; DECOMP BEGINS +(deftype surface (basic) + ((name symbol :offset-assert 4) + (turnv float :offset-assert 8) + (turnvv float :offset-assert 12) + (tiltv float :offset-assert 16) + (tiltvv float :offset-assert 20) + (transv-max float :offset-assert 24) + (target-speed float :offset-assert 28) + (seek0 float :offset-assert 32) + (seek90 float :offset-assert 36) + (seek180 float :offset-assert 40) + (fric float :offset-assert 44) + (nonlin-fric-dist float :offset-assert 48) + (slip-factor float :offset-assert 52) + (slide-factor float :offset-assert 56) + (slope-up-factor float :offset-assert 60) + (slope-down-factor float :offset-assert 64) + (slope-slip-angle float :offset-assert 68) + (impact-fric float :offset-assert 72) + (bend-factor float :offset-assert 76) + (bend-speed float :offset-assert 80) + (alignv float :offset-assert 84) + (slope-up-traction float :offset-assert 88) + (align-speed float :offset-assert 92) + (slope-change-preserve float :offset-assert 96) + (turnvf float :offset-assert 100) + (turnvvf float :offset-assert 104) + (tiltvf float :offset-assert 108) + (tiltvvf float :offset-assert 112) + (vel-turn float :offset-assert 116) + (active-hook (function none) :offset 128) + (touch-hook (function none) :offset-assert 132) + (impact-hook function :offset-assert 136) + (mult-hook (function surface surface surface int none) :offset-assert 140) + (exit-hook function :offset-assert 144) + (mode symbol :offset-assert 148) + (flags surface-flag :offset-assert 152) + (data float 30 :offset 8) + (hook function 4 :offset 128) + (dataw uint32 2 :offset 148) + ) + :method-count-assert 9 + :size-assert #x9c + :flag-assert #x90000009c + ) + +(defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) + (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + ) + +(defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) + ) + ) + +(defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) + (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) + ) + ) + +;; definition for method 2 of type surface +;; ERROR: Function may read a register that is not set: t3 +(defmethod print surface ((obj surface)) + (local-vars (t3-0 none)) + (format + #t + "# obj turnv) + (-> obj turnvv) + (-> obj tiltv) + (-> obj tiltvv) + (-> obj transv-max) + t3-0 + ) + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) + obj + ) + +(defun surface-interp! ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 float)) + (dotimes (v1-0 30) + (set! (-> arg0 data v1-0) (+ (* (-> arg2 data v1-0) arg3) (* (-> arg1 data v1-0) (- 1.0 arg3)))) + ) + (dotimes (v1-3 5) + (set! (-> arg0 hook v1-3) (cond + ((and (nonzero? (-> arg2 hook v1-3)) (!= (-> arg2 hook v1-3) nothing)) + (-> arg2 hook v1-3) + ) + ((and (nonzero? (-> arg1 hook v1-3)) (!= (-> arg1 hook v1-3) nothing)) + (-> arg1 hook v1-3) + ) + (else + nothing + ) + ) + ) + ) + (dotimes (v1-6 2) + (set! (-> arg0 dataw v1-6) (-> arg2 dataw v1-6)) + ) + arg0 + ) + +(defun surface-mult! ((arg0 surface) (arg1 surface) (arg2 surface)) + (dotimes (v1-0 30) + (set! (-> arg0 data v1-0) (* (-> arg2 data v1-0) (-> arg1 data v1-0))) + ) + (dotimes (v1-3 5) + (set! (-> arg0 hook v1-3) (cond + ((and (nonzero? (-> arg2 hook v1-3)) (!= (-> arg2 hook v1-3) nothing)) + (-> arg2 hook v1-3) + ) + ((and (nonzero? (-> arg1 hook v1-3)) (!= (-> arg1 hook v1-3) nothing)) + (-> arg1 hook v1-3) + ) + (else + nothing + ) + ) + ) + ) + (dotimes (v1-6 2) + (set! (-> arg0 dataw v1-6) (-> arg2 dataw v1-6)) + ) + (set! (-> arg0 flags) (logior (-> arg1 flags) (-> arg2 flags))) + ((-> arg0 mult-hook) arg0 arg1 arg2 1) + arg0 + ) + +(defun surface-clamp-speed ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> arg1 transv-max))) + (set! (-> arg0 target-speed) (fmin (-> arg0 target-speed) (-> arg1 target-speed))) + ) + (none) + ) + +(define *walk-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :flags (surface-flag look-around) + ) + ) + +(define *walk-no-turn-mods* (new 'static 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + ) + ) + +(define *turn-around-mods* (new 'static 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + ) + ) + +(define *jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(define *double-jump-mods* (new 'static 'surface + :name 'jump-double + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(define *smack-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air gun-inactive) + ) + ) + +(define *high-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 26624.0 + :target-speed 26624.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(define *launch-jump-mods* (new 'static 'surface + :name 'launch-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 61440.0 + :target-speed 61440.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag no-attack check-edge air) + ) + ) + +(define *forward-high-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 45056.0 + :target-speed 45056.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(define *flip-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 80281.6 + :target-speed 51200.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(define *forward-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +(define *forward-pole-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 53248.0 + :target-speed 53248.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air gun-hide gun-fast-exit) + ) + ) + +(let ((v1-20 (copy *jump-mods* 'global))) + (set! (-> v1-20 flags) (surface-flag check-edge air super)) + (set! (-> v1-20 name) 'high-jump) + (set! (-> v1-20 target-speed) 245760.0) + (set! (-> v1-20 transv-max) 245760.0) + (set! (-> v1-20 seek0) 0.9) + (define *dark-jump-mods* v1-20) + ) + +(define *roll-mods* (new 'static 'surface + :name 'roll + :turnv 131072.0 + :turnvv 5461.3335 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 91750.4 + :target-speed 11468.8 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag no-turn-around attack gun-inactive gun-no-twist no-board) + ) + ) + +(define *roll-flip-mods* + (new 'static 'surface + :name 'roll-flip + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 91750.4 + :target-speed 103219.195 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag no-turn-around check-edge air attack gun-inactive gun-no-twist no-board) + ) + ) + +(define *flop-mods* (new 'static 'surface + :name 'flop + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.3 + :seek180 1.5 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag air attack gun-inactive gun-no-twist) + ) + ) + +(let ((a0-9 (new 'static 'surface + :name 'flop + :turnv 9102.223 + :turnvv 9102.223 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.1 + :seek180 0.15 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag air gun-inactive gun-no-twist) + ) + ) + ) + (set! (-> a0-9 mult-hook) surface-clamp-speed) + (define *flop-land-mods* a0-9) + ) + +(define *wade-mods* (new 'static 'surface + :name 'wade + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.5 + :seek180 0.5 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'wade + :flags (surface-flag look-around) + ) + ) + +(define *swim-mods* (new 'static 'surface + :name 'swim + :turnv 49152.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 28672.0 + :target-speed 28672.0 + :seek0 0.75 + :seek90 0.2 + :seek180 0.2 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'swim + :flags (surface-flag gun-off) + ) + ) + +(define *dive-mods* (new 'static 'surface + :name 'swim + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'dive + :flags (surface-flag xz-local gun-off gun-fast-exit) + ) + ) + +(define *dive-bottom-mods* (new 'static 'surface + :name 'swim-bottom + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.1 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'dive + :flags (surface-flag xz-local gun-off gun-fast-exit) + ) + ) + +(let ((v1-30 (copy *walk-mods* 'global))) + (set! (-> v1-30 name) 'pole) + (set! (-> v1-30 flags) (surface-flag gun-hide gun-fast-exit)) + (define *pole-mods* v1-30) + ) + +(let ((a0-14 (copy *walk-mods* 'global))) + (set! (-> a0-14 name) 'grab) + (set! (-> a0-14 flags) (surface-flag)) + (define *grab-mods* a0-14) + ) + +(let ((v1-34 (copy *walk-mods* 'global))) + (set! (-> v1-34 name) 'edge-grab) + (set! (-> v1-34 flags) (surface-flag gun-inactive gun-no-twist)) + (define *edge-grab-mods* v1-34) + ) + +(define *empty-mods* (new 'static 'surface + :name 'empty + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :flags (surface-flag gun-off) + ) + ) + +(define *neutral-mods* (new 'static 'surface + :name 'walk + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + ) + ) + +(let ((v1-37 (new 'static 'surface + :name '*stone-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (define *stone-surface* v1-37) + (set! (-> v1-37 exit-hook) nothing) + (set! (-> v1-37 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-37 touch-hook) nothing) + (set! (-> v1-37 active-hook) nothing) + ) + +(let ((v1-38 (new 'static 'surface + :name '*gravel-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-down-factor 32768.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (define *gravel-surface* v1-38) + (set! (-> v1-38 exit-hook) nothing) + (set! (-> v1-38 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-38 touch-hook) (lambda () (gravel-surface-touch) (none))) + (set! (-> v1-38 active-hook) nothing) + ) + +(let ((v1-39 (new 'static 'surface + :name '*edge-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 30720.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 18432.0 + :slope-slip-angle 8192.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :align-speed 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (define *edge-surface* v1-39) + (set! (-> v1-39 exit-hook) nothing) + (set! (-> v1-39 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-39 touch-hook) nothing) + (set! (-> v1-39 active-hook) nothing) + ) + +(let ((v1-40 (new 'static 'surface + :name '*wade-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.6 + :slope-up-traction 1.0 + :align-speed 0.6 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (define *wade-surface* v1-40) + (set! (-> v1-40 exit-hook) nothing) + (set! (-> v1-40 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-40 touch-hook) nothing) + (set! (-> v1-40 active-hook) nothing) + ) + +(let ((v1-41 (new 'static 'surface + :name '*quicksand-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.5 + :target-speed 0.5 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (define *quicksand-surface* v1-41) + (set! (-> v1-41 exit-hook) nothing) + (set! (-> v1-41 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-41 touch-hook) nothing) + (set! (-> v1-41 active-hook) nothing) + ) + +(let ((v1-42 (new 'static 'surface + :name '*tar-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.4 + :target-speed 0.4 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (define *tar-surface* v1-42) + (set! (-> v1-42 exit-hook) nothing) + (set! (-> v1-42 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-42 touch-hook) nothing) + (set! (-> v1-42 active-hook) nothing) + ) + +(let ((v1-43 (new 'static 'surface + :name '*ice-surface* + :turnv 0.5 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.5 + :target-speed 1.5 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slip-factor 0.7 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + :flags (surface-flag no-turn-around turn-to-pad) + ) + ) + ) + (define *ice-surface* v1-43) + (set! (-> v1-43 exit-hook) nothing) + (set! (-> v1-43 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-43 touch-hook) nothing) + (set! (-> v1-43 active-hook) nothing) + ) + +(let ((v1-44 (new 'static 'surface + :name '*rail-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + :flags (surface-flag no-attack) + ) + ) + ) + (define *rail-surface* v1-44) + (set! (-> v1-44 exit-hook) nothing) + (set! (-> v1-44 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-44 touch-hook) (lambda () (rail-surface-touch) (none))) + (set! (-> v1-44 active-hook) nothing) + ) + +(define *standard-ground-surface* *stone-surface*) + +(define *swim-surface* *stone-surface*) + diff --git a/goal_src/jak2/engine/target/target-h.gc b/goal_src/jak2/engine/target/target-h.gc index a2ebfd68c1..e801545aa7 100644 --- a/goal_src/jak2/engine/target/target-h.gc +++ b/goal_src/jak2/engine/target/target-h.gc @@ -5,5 +5,109 @@ ;; name in dgo: target-h ;; dgos: ENGINE, GAME +(declare-type sidekick process-drawable) +(declare-type racer-info basic) +(declare-type tube-info basic) +(declare-type flut-info basic) + ;; DECOMP BEGINS +(deftype target (process-focusable) + ((control control-info :offset 128) + (skel2 basic :offset-assert 204) + (shadow-backup basic :offset-assert 208) + (target-flags uint32 :offset 188) + (game game-info :offset-assert 212) + (neck joint-mod :offset-assert 216) + (head basic :offset-assert 220) + (upper-body basic :offset-assert 224) + (horns basic :offset-assert 228) + (hair basic 2 :offset-assert 232) + (darkjak-interp float :offset-assert 240) + (darkjak-giant-interp float :offset-assert 244) + (arm-ik basic 2 :offset-assert 248) + (leg-ik basic 2 :offset-assert 256) + (foot basic 2 :offset-assert 264) + (init-time time-frame :offset-assert 272) + (teleport-time time-frame :offset-assert 280) + (state-hook-time time-frame :offset-assert 288) + (state-hook (function none :behavior target) :offset-assert 296) + (cam-user-mode symbol :offset-assert 300) + (sidekick (pointer sidekick) :offset-assert 304) + (manipy (pointer manipy) :offset-assert 308) + (mirror uint32 :offset-assert 312) + (attack-info attack-info :inline :offset-assert 320) + (attack-info-rec attack-info :inline :offset-assert 480) + (attack-info-old attack-info 8 :inline :offset-assert 640) + (anim-seed uint64 :offset-assert 1920) + (alt-cam-pos vector :inline :offset-assert 1936) + (current-level level :offset-assert 1952) + (saved-pos transformq :inline :offset-assert 1968) + (saved-owner uint64 :offset-assert 2016) + (alt-neck-pos vector :inline :offset-assert 2032) + (focus-search basic :offset-assert 2048) + (excitement float :offset-assert 2052) + (shock-effect-time time-frame :offset-assert 2056) + (beard? basic :offset-assert 2064) + (spool-anim basic :offset-assert 2068) + (ambient-time time-frame :offset-assert 2072) + (fp-hud uint64 :offset-assert 2080) + (no-load-wait uint64 :offset-assert 2088) + (no-look-around-wait uint64 :offset-assert 2096) + (burn-proc uint64 :offset-assert 2104) + (pre-joint-hook basic :offset-assert 2112) + (notify uint64 :offset-assert 2120) + (mode-cache basic :offset-assert 2128) + (mode-param1 uint64 :offset-assert 2136) + (mode-param2 uint64 :offset-assert 2144) + (mode-param3 uint64 :offset-assert 2152) + (tobot-state basic :offset-assert 2160) + (tobot? basic :offset-assert 2164) + (tobot-recorder basic :offset-assert 2168) + (color-effect basic :offset-assert 2172) + (color-effect-start-time time-frame :offset-assert 2176) + (color-effect-duration uint64 :offset-assert 2184) + (racer racer-info :offset-assert 2192) + (tube tube-info :offset-assert 2196) + (flut flut-info :offset-assert 2200) + (board basic :offset-assert 2204) + (pilot basic :offset-assert 2208) + (gun basic :offset-assert 2212) + (mech basic :offset-assert 2216) + (turret basic :offset-assert 2220) + (darkjak basic :offset-assert 2224) + (indax basic :offset-assert 2228) + ) + :heap-base #x840 + :method-count-assert 29 + :size-assert #x8b8 + :flag-assert #x1d084008b8 + (:methods + (target-method-27 () none 27) + (target-method-28 () none 28) + ) + ) + +(define-perm *target* target #f) + +(deftype sidekick (process-drawable) + ((control control-info :offset 128) + (anim-seed uint64 :offset 208) + (shadow-in-movie? symbol :offset-assert 216) + (special-anim-time time-frame :offset-assert 224) + (special-anim-interp float :offset-assert 232) + (special-anim-frame float :offset-assert 236) + (offset transformq :inline :offset-assert 240) + (mirror uint32 :offset-assert 288) + ) + :heap-base #xb0 + :method-count-assert 20 + :size-assert #x124 + :flag-assert #x1400b00124 + ) + +(define-perm *sidekick* sidekick #f) + +; what is this. +;(new 'static 'boxed-array :type type pilot-info mech-info turret-info indax-info tube-info) + diff --git a/goal_src/jak2/engine/ui/bigmap-h.gc b/goal_src/jak2/engine/ui/bigmap-h.gc index 157627824e..9414577eb8 100644 --- a/goal_src/jak2/engine/ui/bigmap-h.gc +++ b/goal_src/jak2/engine/ui/bigmap-h.gc @@ -7,3 +7,292 @@ ;; DECOMP BEGINS + +(deftype bigmap-bit-mask (structure) + ((data uint8 6656 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x1a00 + :flag-assert #x900001a00 + ) + +(deftype bigmap-layer-mask (structure) + ((data uint8 26624 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x6800 + :flag-assert #x900006800 + ) + +(deftype bigmap-image (structure) + ((clut-offset uint32 :offset-assert 0) + (image-offset uint32 :offset-assert 4) + (pad uint32 2 :offset-assert 8) + (data uint8 1 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x11 + :flag-assert #x900000011 + ) + +(deftype bigmap-info (vector) + ((scale float :offset 8) + (inv-scale float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype bigmap-info-array (structure) + ((data bigmap-info 21 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x150 + :flag-assert #x900000150 + ) + +(deftype bigmap-compressed-layers (structure) + ((data uint32 20 :offset-assert 0) + (layer0 uint32 :offset 0) + (layer1 uint32 :offset 4) + (layer2 uint32 :offset 8) + (layer3 uint32 :offset 12) + (layer4 uint32 :offset 16) + (layer5 uint32 :offset 20) + (layer6 uint32 :offset 24) + (layer7 uint32 :offset 28) + (layer8 uint32 :offset 32) + (layer9 uint32 :offset 36) + (layer10 uint32 :offset 40) + (layer11 uint32 :offset 44) + (layer12 uint32 :offset 48) + (layer13 uint32 :offset 52) + (layer14 uint32 :offset 56) + (layer15 uint32 :offset 60) + (layer16 uint32 :offset 64) + (layer17 uint32 :offset 68) + (layer18 uint32 :offset 72) + (layer19 uint32 :offset 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) +(define-extern *bigmap-compressed-layers* bigmap-compressed-layers) + + +(deftype bigmap (basic) + ((drawing-flag symbol :offset-assert 4) + (loading-flag symbol :offset-assert 8) + (recording-flag symbol :offset-assert 12) + (fill-flag symbol :offset-assert 16) + (bigmap-index uint32 :offset-assert 20) + (bigmap-image external-art-buffer :offset-assert 24) + (tpage basic :offset-assert 28) + (progress-minimap basic :offset-assert 32) + (mask-index uint32 :offset-assert 36) + (bit-mask bigmap-bit-mask :offset-assert 40) + (compressed-next-index uint32 :offset-assert 44) + (max-next-index uint32 :offset-assert 48) + (compressed-masks uint32 20 :offset-assert 52) + (compressed-data uint32 :offset-assert 132) + (layer-index uint32 :offset-assert 136) + (layer-mask bigmap-layer-mask :offset-assert 140) + (compressed-layers bigmap-compressed-layers :offset-assert 144) + (layer-mask-enable uint32 :offset-assert 148) + (load-index uint32 :offset-assert 152) + (x0 int32 :offset-assert 156) + (y0 int32 :offset-assert 160) + (x1 int32 :offset-assert 164) + (y1 int32 :offset-assert 168) + (y2 int32 :offset-assert 172) + (goal-time float :offset-assert 176) + (sprite-tmpl dma-gif-packet :inline :offset-assert 192) + (draw-tmpl dma-gif-packet :inline :offset-assert 224) + (adgif-tmpl dma-gif-packet :inline :offset-assert 256) + (offset vector :inline :offset-assert 288) + (size float :offset 296) + (scale float :offset 300) + (draw-offset vector :inline :offset-assert 304) + (draw-size float :offset 312) + (draw-scale float :offset 316) + (scroll vector :inline :offset-assert 320) + (pos vector4w :inline :offset-assert 336) + (color vector4w :inline :offset-assert 352) + (corner vector4w 4 :inline :offset-assert 368) + (auto-save-icon-flag basic :offset-assert 432) + ) + :method-count-assert 28 + :size-assert #x1b4 + :flag-assert #x1c000001b4 + (:methods + (new (symbol type) _type_ 0) + (initialize (_type_) none 9) + (update (_type_) none 10) + (bigmap-method-11 () none 11) + (bigmap-method-12 () none 12) + (bigmap-method-13 () none 13) + (bigmap-method-14 () none 14) + (bigmap-method-15 () none 15) + (bigmap-method-16 () none 16) + (bigmap-method-17 () none 17) + (bigmap-method-18 () none 18) + (bigmap-method-19 () none 19) + (bigmap-method-20 () none 20) + (bigmap-method-21 () none 21) + (bigmap-method-22 () none 22) + (bigmap-method-23 () none 23) + (bigmap-method-24 () none 24) + (bigmap-method-25 () none 25) + (bigmap-method-26 () none 26) + (bigmap-method-27 () none 27) + ) + ) + +(defmethod new bigmap ((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 bigmap-image) + ((method-of-type external-art-buffer new) + allocation + external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((a1-3 (logand -64 (&+ (&+ (-> *display* frames 0 global-buf end) -430144) 63))) + (v1-1 (-> arg0 heap)) + ) + (set! (-> v1-1 base) a1-3) + (set! (-> v1-1 current) (-> v1-1 base)) + (set! (-> v1-1 top-base) (&+ (-> v1-1 base) #x69000)) + (set! (-> v1-1 top) (-> v1-1 top-base)) + ) + 0 + (none) + ) + #f + ) + ) + (set! (-> gp-0 tpage) + ((method-of-type external-art-buffer new) + allocation + external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((a1-3 (logand -64 (&+ (&+ (-> *display* frames 0 global-buf end) -774208) 63))) + (v1-1 (-> arg0 heap)) + ) + (set! (-> v1-1 base) a1-3) + (set! (-> v1-1 current) (-> v1-1 base)) + (set! (-> v1-1 top-base) (&+ (-> v1-1 base) #xbd000)) + (set! (-> v1-1 top) (-> v1-1 top-base)) + ) + 0 + (none) + ) + #f + ) + ) + (set! (-> gp-0 bit-mask) (new 'global 'bigmap-bit-mask)) + (set! (-> gp-0 compressed-data) (the-as uint (malloc 'global #x8000))) + (set! (-> gp-0 layer-mask) (new 'global 'bigmap-layer-mask)) + (set! (-> gp-0 compressed-layers) *bigmap-compressed-layers*) + (set! (-> gp-0 sprite-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> gp-0 sprite-tmpl dma-vif vif0) (new 'static 'vif-tag)) + (set! (-> gp-0 sprite-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> gp-0 sprite-tmpl gif0) + (the uint64 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1) + :nreg #x5 + ) + ) + ) + (set! (-> gp-0 sprite-tmpl gif1) + (the uint64 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id uv) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id uv) + :regs4 (gif-reg-id xyz2) + ) + ) + ) + (set! (-> gp-0 draw-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) + (set! (-> gp-0 draw-tmpl dma-vif vif0) (new 'static 'vif-tag)) + (set! (-> gp-0 draw-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) + (set! (-> gp-0 draw-tmpl gif0) + (the uint64 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1 :abe #x1 :fst #x1) + :nreg #x9 + ) + ) + ) + (set! (-> gp-0 draw-tmpl gif1) (the uint64 (new 'static 'gif-tag-regs + :regs0 (gif-reg-id rgbaq) + :regs1 (gif-reg-id uv) + :regs2 (gif-reg-id xyz2) + :regs3 (gif-reg-id uv) + :regs4 (gif-reg-id xyz2) + :regs5 (gif-reg-id uv) + :regs6 (gif-reg-id xyz2) + :regs7 (gif-reg-id uv) + :regs8 (gif-reg-id xyz2) + ) + ) + ) + (set! (-> gp-0 adgif-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> gp-0 adgif-tmpl dma-vif vif0) (new 'static 'vif-tag)) + (set! (-> gp-0 adgif-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> gp-0 adgif-tmpl gif0) (the uint64 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1))) + (set! (-> gp-0 adgif-tmpl gif1) (the uint64 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))) + (set-vector! (-> gp-0 offset) 0.0 0.0 0.0 0.0) + (set-vector! (-> gp-0 scroll) 0.0 0.0 0.0 0.0) + (set-vector! (-> gp-0 pos) 0 0 0 0) + (set-vector! (-> gp-0 color) 128 128 128 128) + (set! (-> gp-0 drawing-flag) #f) + (set! (-> gp-0 loading-flag) #f) + (set! (-> gp-0 recording-flag) #f) + (set! (-> gp-0 fill-flag) #t) + (set! (-> gp-0 progress-minimap) #f) + (set! (-> gp-0 auto-save-icon-flag) #f) + (initialize gp-0) + gp-0 + ) + ) + +(define *bigmap-info-array* + (new 'static 'bigmap-info-array + :data (new 'static 'inline-array bigmap-info 21 + (new 'static 'bigmap-info :x -251215.88 :y -6390620.0 :scale 7477.334 :inv-scale 0.00006686875) + (new 'static 'bigmap-info :x -68266.805 :y -7629693.0 :scale 4266.668 :inv-scale 0.00011718746) + (new 'static 'bigmap-info :x -1612460.0 :y -7806484.5 :scale 3498.668 :inv-scale 0.00014291154) + (new 'static 'bigmap-info :x 339968.0 :y -8220672.0 :scale 3200.0 :inv-scale 0.00015625) + (new 'static 'bigmap-info :x -602935.3 :y -9531720.0 :scale 6933.332 :inv-scale 0.0000721154) + (new 'static 'bigmap-info :x -1565331.5 :y -1109332.0 :scale 5337.4277 :inv-scale 0.000093678085) + (new 'static 'bigmap-info :x -3681067.0 :y 2179413.2 :scale 4586.668 :inv-scale 0.0001090116) + (new 'static 'bigmap-info :x 1110016.0 :y -20480.0 :scale 4096.0 :inv-scale 0.00012207031) + (new 'static 'bigmap-info :x -4358144.0 :y -581632.0 :scale 5469.09 :inv-scale 0.00009142289) + (new 'static 'bigmap-info :x -1646719.0 :y -1395200.0 :scale 4000.002 :inv-scale 0.00012499993) + (new 'static 'bigmap-info :x -1292161.0 :y -935251.94 :scale 7253.332 :inv-scale 0.000068933834) + (new 'static 'bigmap-info :x -87520.055 :y 1879040.0 :scale 2880.0 :inv-scale 0.00017361112) + (new 'static 'bigmap-info :x -87520.055 :y 1879040.0 :scale 2880.0 :inv-scale 0.00017361112) + (new 'static 'bigmap-info :x 3053472.2 :y -2397868.0 :scale 3946.668 :inv-scale 0.00012668915) + (new 'static 'bigmap-info :x 4027306.8 :y 1112746.8 :scale 4693.332 :inv-scale 0.00010653412) + (new 'static 'bigmap-info :x 4027306.8 :y 1112746.8 :scale 4693.332 :inv-scale 0.00010653412) + (new 'static 'bigmap-info :x 4027306.8 :y 1112746.8 :scale 4693.332 :inv-scale 0.00010653412) + (new 'static 'bigmap-info :x 8574157.0 :y -1033420.8 :scale 5430.231 :inv-scale 0.00009207711) + (new 'static 'bigmap-info :x -787795.94 :y 4102697.0 :scale 5717.332 :inv-scale 0.00008745338) + (new 'static 'bigmap-info :x -1558401.0 :y 6746452.0 :scale 5866.668 :inv-scale 0.00008522726) + (new 'static 'bigmap-info) + ) + ) + ) + + + + diff --git a/goal_src/jak2/engine/ui/gui-h.gc b/goal_src/jak2/engine/ui/gui-h.gc index 0ed924847c..7ab41d94fe 100644 --- a/goal_src/jak2/engine/ui/gui-h.gc +++ b/goal_src/jak2/engine/ui/gui-h.gc @@ -5,5 +5,118 @@ ;; name in dgo: gui-h ;; dgos: ENGINE, GAME +(defenum gui-action + :type uint8 + :bitfield #f + (none 0) + (queue 1) + (play 2) + (playing 3) + (stop 4) + (stopping 5) + (abort 6) + (hide 7) + (hidden 8) + (fade 9) + ) + +(defenum gui-channel + :type uint8 + :bitfield #f + (none 0) + (art-load 16) + (art-load-next 17) + (background 18) + (jak 19) + (daxter 20) + (sig 21) + (ashelin 22) + (mog 23) + (jinx 24) + (grim 25) + (kid 26) + (kor 27) + (hal 28) + (voicebox 29) + (guard 30) + (crocadog 31) + (alert 32) + (citizen 33) + (bbush 34) + (krew 35) + (voice 47) + (movie 64) + (blackout 65) + (query 66) + (message 67) + (notice 68) + (subtitle 69) + (supertitle 70) + (notice-low 71) + (screen 79) + (hud-upper-right 80) + (hud-upper-left 81) + (hud-lower-right 82) + (hud-lower-left 83) + (hud-lower-left-1 84) + (hud-lower-left-2 85) + (hud-center-right 86) + (hud-center-left 87) + (hud-middle-right 88) + (hud-middle-left 89) + (hud-upper-center 90) + (hud-upper-center-2 91) + (hud 95) + (max 96) + ) + ;; DECOMP BEGINS +(deftype gui-connection (connection) + ((priority float :offset 16) + (action gui-action :offset 20) + (channel gui-channel :offset 21) + (anim-part uint8 :offset 22) + (flags uint8 :offset 23) + (name object :offset 24) + (id uint32 :offset 28) + (handle handle :offset 0) + (time-stamp time-frame :offset 8) + (hold-time time-frame :offset-assert 32) + (fo-min int16 :offset-assert 40) + (fo-max int16 :offset-assert 42) + (fo-curve int8 :offset-assert 44) + (fade uint8 :offset-assert 45) + (pad uint8 2 :offset-assert 46) + ) + :method-count-assert 14 + :size-assert #x30 + :flag-assert #xe00000030 + ) + +(deftype gui-control (basic) + ((engine engine :offset-assert 4) + (data uint8 3272 :offset-assert 8) + ) + :method-count-assert 25 + :size-assert #xcd0 + :flag-assert #x1900000cd0 + (:methods + (gui-control-method-9 () none 9) + (gui-control-method-10 () none 10) + (gui-control-method-11 () none 11) + (gui-control-method-12 () none 12) + (update (_type_ symbol) none 13) + (gui-control-method-14 () none 14) + (gui-control-method-15 () none 15) + (gui-control-method-16 () none 16) + (gui-control-method-17 () none 17) + (gui-control-method-18 () none 18) + (gui-control-method-19 () none 19) + (gui-control-method-20 () none 20) + (gui-control-method-21 () none 21) + (gui-control-method-22 () none 22) + (gui-control-method-23 () none 23) + (gui-control-method-24 () none 24) + ) + ) \ No newline at end of file diff --git a/goal_src/jak2/engine/ui/hud-h.gc b/goal_src/jak2/engine/ui/hud-h.gc index d08a9e2f08..0d61ab818c 100644 --- a/goal_src/jak2/engine/ui/hud-h.gc +++ b/goal_src/jak2/engine/ui/hud-h.gc @@ -5,5 +5,497 @@ ;; name in dgo: hud-h ;; dgos: ENGINE, GAME +(defenum hud-flags + :type uint32 + :bitfield #t + ) + ;; DECOMP BEGINS +(deftype hud-string (basic) + ((text string :offset-assert 4) + (scale float :offset-assert 8) + (color uint32 :offset-assert 12) + (flags uint32 :offset-assert 16) + (pos vector4w :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype hud-sprite (structure) + ((pos vector4w :inline :offset-assert 0) + (color vector4w :inline :offset-assert 16) + (flags uint32 :offset-assert 32) + (scale-x float :offset-assert 36) + (scale-y float :offset-assert 40) + (angle float :offset-assert 44) + (tex basic :offset-assert 48) + ) + :method-count-assert 11 + :size-assert #x34 + :flag-assert #xb00000034 + (:methods + (hud-sprite-method-9 () none 9) + (hud-sprite-method-10 () none 10) + ) + ) + +(deftype hud-box (structure) + ((min vector2 :inline :offset-assert 0) + (max vector2 :inline :offset-assert 8) + (color vector4w :inline :offset-assert 16) + ) + :method-count-assert 16 + :size-assert #x20 + :flag-assert #x1000000020 + (:methods + (hud-box-method-9 () none 9) + (hud-box-method-10 () none 10) + (hud-box-method-11 () none 11) + (hud-box-method-12 () none 12) + (hud-box-method-13 () none 13) + (hud-box-method-14 () none 14) + (hud-box-method-15 () none 15) + ) + ) + +(deftype hud-icon (basic) + ((icon (pointer manipy) :offset-assert 4) + (pos vector4w :inline :offset-assert 16) + (scale-x float :offset-assert 32) + (scale-y float :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +(deftype hud-value (basic) + ((current int32 :offset-assert 4) + (target int32 :offset-assert 8) + (flags uint16 :offset-assert 12) + (counter uint16 :offset-assert 14) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +(deftype hud (process) + ((trigger-time time-frame :offset-assert 128) + (last-hide-time time-frame :offset-assert 136) + (offset float :offset-assert 144) + (flags hud-flags :offset-assert 148) + (values hud-value 8 :inline :offset-assert 152) + (strings hud-string 14 :inline :offset-assert 288) + (sprites hud-sprite 30 :inline :offset-assert 960) + (icons hud-icon 2 :inline :offset-assert 2880) + (gui-id uint32 :offset-assert 2976) + ) + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + (:methods + (hud-method-14 () none 14) + (hud-method-15 () none 15) + (hud-method-16 () none 16) + (hud-method-17 () none 17) + (hud-method-18 () none 18) + (hud-method-19 () none 19) + (hud-method-20 () none 20) + (hud-method-21 () none 21) + (hud-method-22 () none 22) + (hud-method-23 () none 23) + (hud-method-24 () none 24) + (hud-method-25 () none 25) + (hud-method-26 () none 26) + ) + ) + +(deftype hud-ashelin (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-cargo (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-citizen (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-cpanel (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-dig-clasp (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-gun (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-health (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-dark-eco-symbol (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-helldog (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-lurker (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-map (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-moneybag (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-pegasus (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-plasmite (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-dig-button (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-predator (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-heatmeter (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-progress (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-rocketsensor (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-ruffians (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-score (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-sig (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-skill (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-skullgem (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-timer (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-turret (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-squid (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-gunturret (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-gruntegg (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-crimsonhover (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-metalkor (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-big-score (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-goal (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-miss (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-race-timer (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-race-lap-counter (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-race-turbo-counter (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-race-position (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-race-map (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-samos-old (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-samos-young (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-lurker-button (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-widow (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-race-final-stats (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-mech-air-tank (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-homing-beacon (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-dark-eco-pickup (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +(deftype hud-green-eco-pickup (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) diff --git a/goal_src/jak2/engine/ui/minimap-h.gc b/goal_src/jak2/engine/ui/minimap-h.gc index 553098be3a..afb8c9e3e9 100644 --- a/goal_src/jak2/engine/ui/minimap-h.gc +++ b/goal_src/jak2/engine/ui/minimap-h.gc @@ -4,6 +4,228 @@ ;; name: minimap-h.gc ;; name in dgo: minimap-h ;; dgos: ENGINE, GAME +(defenum minimap-flag + :bitfield #t + :type uint16 + (active 0) ;; 1 + (fade-in 1) ;; 2 + (fade-out 2) ;; 4 + (clamp 3) ;; 8 + (trail 4) ;; 16 + (task-graph 5) ;; 32 + (flash 6) ;; 64 + (minimap 7) ;; 128 + (background 8) ;; 256 + (task 9) ;; 512 + (enemy 10) ;; 1024 + (frustum 11) ;; 2048 + (racer 12) ;; 4096 + (bigmap 13) ;; 8192 + (goal 14) ;; 16384 + (city-only 15) ;; 32768 + ) + +(defenum minimap-class + :type uint16 + :bitfield #f + (none 0) + (onintent 1) + (ruins 2) + (vinroom 3) + (mountain 4) + (hideout 5) + (sewer 6) + (atoll 7) + (hiphog 8) + (fortress 9) + (gungame 10) + (gun-yellow 11) + (garage 12) + (palace-cable 13) + (guard 14) + (goal 15) + (goal-no-trail 16) + (parking-spot 17) + (forest 18) + (kiosk 19) + (dig 20) + (canyon 21) + (tomb 22) + (tanker 23) + (kid 24) + (consite 25) + (palace 26) + (castle 27) + (underport 28) + (stadium 29) + (port-turret 30) + (oracle 31) + (guard-frustum 32) + (burning-bush 33) + (gun-dark 34) + (slumc-seal 35) + (racer 36) + (racer-target 37) + (racer-errol 38) + (flag 39) + (bbush-gena 40) + (bbush-gena-2 41) + (bbush-genb 42) + (bbush-genb-2 43) + (bbush-genc 44) + (bbush-genc-2 45) + (bbush-sluma 46) + (bbush-slumb 47) + (bbush-slumb-2 48) + (bbush-slumc 49) + (bbush-port-3 50) + (bbush-port-2 51) + (bbush-port 52) + (bbush-farma 53) + (bbush-farmb 54) + (bbush-inda 55) + (bbush-indb 56) + (bbush-marka 57) + (bbush-markb 58) + (bbush-markb-2 59) + (bbush-pal 60) + (bbush-pal-2 61) + (bbush-stadium 62) + (atoll-valve 63) + (atoll-ashelin 64) + (mountain-lens 65) + (mountain-shard 66) + (mountain-gear 67) + (ruins-hut 68) + (forest-samos 69) + (metalhead 70) + + ) ;; DECOMP BEGINS +(deftype minimap-class-node (structure) + ((default-position vector :inline :offset-assert 0) + (flags minimap-flag :offset-assert 16) + (class minimap-class :offset-assert 18) + (name basic :offset-assert 20) + (icon-xy vector2ub :inline :offset-assert 24) + (scale float :offset-assert 28) + (color rgba :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +(deftype connection-minimap (connection-pers) + ((handle handle :offset 8) + (position vector :offset 16) + (alpha float :offset 20) + (class minimap-class-node :offset 24) + (flags minimap-flag :offset 28) + (node uint16 :offset 30) + (edge-ry float :offset-assert 32) + (last-world-pos vector :inline :offset-assert 48) + (last-relative-pos vector :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +(deftype engine-minimap (engine-pers) + ((alive-list-override connection-minimap :offset 24) + (dead-list-override connection-minimap :offset 28) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + ) + +(deftype minimap-trail (structure) + ((used-by connection-minimap :offset-assert 0) + (search-id uint32 :offset-assert 4) + (node-count int16 :offset-assert 8) + (goal-node-id int32 :offset-assert 12) + (node-path-dist float :offset-assert 16) + (last-updated uint64 :offset-assert 24) + (cached-info trail-cached-search-info :inline :offset-assert 32) + (node-id uint16 64 :offset-assert 80) + ) + :method-count-assert 11 + :size-assert #xd0 + :flag-assert #xb000000d0 + (:methods + (minimap-trail-method-9 () none 9) + (minimap-trail-method-10 () none 10) + ) + ) + +(deftype minimap-draw-work (structure) + ((buf basic :offset-assert 0) + (justify-right basic :offset-assert 4) + (draw-pos vector4w :inline :offset-assert 16) + (mat matrix :inline :offset-assert 32) + (corner vector4w 4 :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +(deftype minimap (structure) + ((draw-tmpl dma-gif-packet :inline :offset-assert 0) + (draw2-tmpl dma-gif-packet :inline :offset-assert 32) + (draw3-tmpl dma-gif-packet :inline :offset-assert 64) + (draw4-tmpl dma-gif-packet :inline :offset-assert 96) + (sprite-tmpl dma-gif-packet :inline :offset-assert 128) + (adgif-tmpl dma-gif-packet :inline :offset-assert 160) + (color vector4w :inline :offset-assert 192) + (offset vector :inline :offset-assert 208) + (minimap-corner vector :inline :offset-assert 224) + (last-name basic :offset-assert 240) + (last-tex basic :offset-assert 244) + (target-inv-scale float :offset-assert 248) + (map-bits uint64 :offset-assert 256) + (level basic :offset-assert 264) + (ctywide basic :offset-assert 268) + (inv-scale float :offset 212) + (fade float :offset 220) + (engine basic :offset-assert 272) + (engine-key uint32 :offset-assert 276) + (trail minimap-trail 6 :inline :offset-assert 288) + (race-tex basic :offset-assert 1536) + (race-scale float :offset-assert 1540) + (race-level basic :offset-assert 1544) + (sprite2-tmpl dma-gif-packet :inline :offset-assert 1552) + (race-corner vector :inline :offset-assert 1584) + (goal-time float :offset-assert 1600) + (frustum-alpha float :offset-assert 1604) + ) + :method-count-assert 28 + :size-assert #x648 + :flag-assert #x1c00000648 + (:methods + (minimap-method-9 () none 9) + (minimap-method-10 () none 10) + (minimap-method-11 () none 11) + (minimap-method-12 () none 12) + (minimap-method-13 () none 13) + (minimap-method-14 () none 14) + (minimap-method-15 () none 15) + (minimap-method-16 () none 16) + (minimap-method-17 () none 17) + (minimap-method-18 () none 18) + (minimap-method-19 () none 19) + (minimap-method-20 () none 20) + (minimap-method-21 () none 21) + (minimap-method-22 () none 22) + (minimap-method-23 () none 23) + (minimap-method-24 () none 24) + (minimap-method-25 () none 25) + (minimap-method-26 () none 26) + (minimap-method-27 () none 27) + ) + ) + diff --git a/goal_src/jak2/engine/ui/progress/progress-h.gc b/goal_src/jak2/engine/ui/progress/progress-h.gc index 10ad099107..d2a160a942 100644 --- a/goal_src/jak2/engine/ui/progress/progress-h.gc +++ b/goal_src/jak2/engine/ui/progress/progress-h.gc @@ -7,3 +7,500 @@ ;; DECOMP BEGINS +(deftype progress (process-drawable) + ((current-options basic :offset-assert 200) + (menu-transition float :offset-assert 204) + (option-index int32 :offset-assert 208) + (want-option-index int32 :offset-assert 212) + (next-option-index int32 :offset-assert 216) + (graphic-index int32 :offset-assert 220) + (selected-option basic :offset-assert 224) + (current basic :offset-assert 228) + (next basic :offset-assert 232) + (ring-angle float :offset-assert 236) + (ring-want-angle float :offset-assert 240) + (init-quat quaternion :inline :offset-assert 256) + (pos-transition float :offset-assert 272) + (anim-frame float :offset-assert 276) + (swing float :offset-assert 280) + (main-menu basic :offset-assert 284) + (state-stack int32 5 :offset-assert 288) + (option-index-stack int32 5 :offset-assert 308) + (state-pos int32 :offset-assert 328) + (secret-buying basic :offset-assert 332) + (secret-buy-choice basic :offset-assert 336) + (sliding float :offset-assert 340) + (sliding-off float :offset-assert 344) + (scanlines-alpha float :offset-assert 348) + (sliding-height float :offset-assert 352) + ) + :heap-base #xf0 + :method-count-assert 33 + :size-assert #x164 + :flag-assert #x2100f00164 + (:methods + (progress-method-20 () none 20) + (progress-method-21 () none 21) + (progress-method-22 () none 22) + (progress-method-23 () none 23) + (progress-method-24 () none 24) + (progress-method-25 () none 25) + (progress-method-26 () none 26) + (progress-method-27 () none 27) + (progress-method-28 () none 28) + (progress-method-29 () none 29) + (progress-method-30 () none 30) + (progress-method-31 () none 31) + (progress-method-32 () none 32) + ) + ) + +(deftype menu-option (basic) + ((name uint32 :offset-assert 4) + (scale basic :offset-assert 8) + (box bounding-box 1 :inline :offset-assert 16) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + (:methods + (menu-option-method-9 () none 9) + (menu-option-method-10 () none 10) + (menu-option-method-11 () none 11) + ) + ) + +(deftype menu-on-off-option (menu-option) + ((value-to-modify uint32 :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +(deftype menu-yes-no-option (menu-option) + ((value-to-modify uint32 :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +(deftype menu-language-option (menu-option) + ((language-selection uint64 :offset-assert 48) + (language-direction basic :offset-assert 56) + (language-transition basic :offset-assert 60) + (language-x-offset int32 :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +(deftype menu-quit-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-slider-option (menu-option) + ((value-to-modify uint32 :offset-assert 48) + (sprites hud-sprite 5 :inline :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x180 + :flag-assert #xc00000180 + ) + +(deftype menu-sub-menu-option (menu-option) + ((next-state basic :offset-assert 48) + (pad uint8 44 :offset-assert 52) + ) + :method-count-assert 12 + :size-assert #x60 + :flag-assert #xc00000060 + ) + +(deftype menu-sub-menu-sound-option (menu-option) + ((next-state basic :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +(deftype menu-stereo-mode-sound-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-sub-menu-graphic-option (menu-option) + ((next-state basic :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +(deftype menu-unlocked-menu-option (menu-sub-menu-option) + () + :method-count-assert 12 + :size-assert #x60 + :flag-assert #xc00000060 + ) + +(deftype menu-main-menu-option (menu-option) + ((next-state basic :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +(deftype menu-memcard-slot-option (menu-option) + ((sprites hud-sprite 5 :inline :offset-assert 48) + (pad uint8 32 :offset-assert 368) + ) + :method-count-assert 12 + :size-assert #x190 + :flag-assert #xc00000190 + ) + +(deftype menu-loading-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-insufficient-space-option (menu-option) + ((last-move uint64 :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x38 + :flag-assert #xc00000038 + ) + +(deftype menu-secrets-insufficient-space-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-insert-card-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-error-loading-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-error-auto-saving-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-card-removed-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-error-disc-removed-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-error-reading-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-icon-info-option (menu-option) + ((sprites hud-sprite 2 :inline :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #xb0 + :flag-assert #xc000000b0 + ) + +(deftype menu-format-card-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-already-exists-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-create-game-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-video-mode-warning-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-video-mode-ok-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-progressive-mode-warning-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-progressive-mode-ok-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype menu-select-start-option (menu-option) + ((task-index int32 :offset-assert 48) + (real-task-index int32 :offset-assert 52) + (last-move uint64 :offset-assert 56) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-select-scene-option (menu-option) + ((task-index int32 :offset-assert 48) + (last-move uint64 :offset-assert 56) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-bigmap-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +(deftype paged-menu-option (menu-option) + ((page-index int32 :offset-assert 48) + (prev-page-index int32 :offset-assert 52) + (num-pages int32 :offset-assert 56) + (slide-dir float :offset-assert 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-missions-option (paged-menu-option) + ((task-line-index int32 :offset-assert 64) + (last-move uint64 :offset-assert 72) + ) + :method-count-assert 12 + :size-assert #x50 + :flag-assert #xc00000050 + ) + +(deftype menu-highscores-option (paged-menu-option) + ((last-move uint64 :offset-assert 64) + (sprites hud-sprite 2 :inline :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #xd0 + :flag-assert #xc000000d0 + ) + +(deftype secret-item-option (menu-option) + ((cost int32 :offset-assert 48) + (can-toggle basic :offset-assert 52) + (flag uint32 :offset-assert 56) + (avail-after uint16 :offset-assert 60) + ) + :method-count-assert 12 + :size-assert #x3e + :flag-assert #xc0000003e + ) + +(deftype menu-secret-option (menu-option) + ((item-index int32 :offset-assert 48) + (prev-item-index int32 :offset-assert 52) + (num-items int32 :offset-assert 56) + (num-hero-items int32 :offset-assert 60) + (secret-items basic :offset-assert 64) + (last-move uint64 :offset-assert 72) + (sprites hud-sprite 2 :inline :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #xd0 + :flag-assert #xc000000d0 + ) + +(deftype menu-option-list (basic) + ((y-center int32 :offset-assert 4) + (y-space int32 :offset-assert 8) + (scale float :offset-assert 12) + (options basic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +(deftype menu-qr-option (menu-option) + ((last-move uint64 :offset-assert 48) + (value-to-modify uint32 :offset 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-restart-mission-qr-option (menu-qr-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +(deftype menu-quit-qr-option (menu-qr-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +(deftype menu-sub-menu-qr-option (menu-qr-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +(deftype menu-graphic-option (menu-option) + ((last-move uint64 :offset-assert 48) + (value-to-modify uint32 :offset 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-aspect-ratio-option (menu-graphic-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-center-screen-graphic-option (menu-graphic-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +(deftype menu-video-mode-option (menu-graphic-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-game-option (menu-option) + ((last-move uint64 :offset-assert 48) + (value-to-modify uint32 :offset 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-on-off-game-vibrations-option (menu-game-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-on-off-game-subtitles-option (menu-game-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +(deftype menu-sub-menu-game-option (menu-game-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +(deftype menu-language-game-option (menu-game-option) + ((language-selection uint64 :offset-assert 64) + (language-direction basic :offset-assert 72) + (language-transition basic :offset-assert 76) + (language-x-offset int32 :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #x54 + :flag-assert #xc00000054 + ) + +(deftype menu-subtitle-language-game-option (menu-game-option) + ((language-selection uint64 :offset-assert 64) + (language-direction basic :offset-assert 72) + (language-transition basic :offset-assert 76) + (language-x-offset int32 :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #x54 + :flag-assert #xc00000054 + ) diff --git a/goal_src/jak2/engine/ui/text-h.gc b/goal_src/jak2/engine/ui/text-h.gc index 54a9187fa0..ae3ef9559d 100644 --- a/goal_src/jak2/engine/ui/text-h.gc +++ b/goal_src/jak2/engine/ui/text-h.gc @@ -7,3 +7,30 @@ ;; DECOMP BEGINS +(deftype game-text (structure) + ((id game-text-id :offset-assert 0) + (text string :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +(deftype game-text-info (basic) + ((length int32 :offset-assert 4) + (language-id int32 :offset-assert 8) + (group-name string :offset-assert 12) + (data game-text :dynamic :offset-assert 16) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (lookup-text! (_type_ game-text-id symbol) string 9) + ) + ) + +(define *text-group-names* (the-as (array string) (new 'static 'boxed-array :type string "common"))) +(define *common-text-heap* (new 'global 'kheap)) +(define *common-text* (the-as game-text-info #f)) diff --git a/goal_src/jak2/engine/ui/text-id-h.gc b/goal_src/jak2/engine/ui/text-id-h.gc index a59cbae2d3..f4b5e2a09d 100644 --- a/goal_src/jak2/engine/ui/text-id-h.gc +++ b/goal_src/jak2/engine/ui/text-id-h.gc @@ -7,3 +7,10 @@ ;; DECOMP BEGINS +(defenum game-text-id + :type uint32 + :bitfield #f +;; GAME-TEXT-ID ENUM BEGINS + (pause 257) +;; GAME-TEXT-ID ENUM ENDS +) diff --git a/goal_src/jak2/engine/util/capture-h.gc b/goal_src/jak2/engine/util/capture-h.gc index c9c7ff8ce0..97e7df37b6 100644 --- a/goal_src/jak2/engine/util/capture-h.gc +++ b/goal_src/jak2/engine/util/capture-h.gc @@ -7,3 +7,50 @@ ;; DECOMP BEGINS +(declare-file (debug)) +(when *debug-segment* + +;; GS packet to download the framebuffer. +(deftype gs-store-image-packet (structure) + ((vifcode vif-tag 4 :offset-assert 0) + (giftag gif-tag :offset-assert 16) + (bitbltbuf gs-bitbltbuf :offset-assert 32) + (bitbltbuf-addr gs-reg64 :offset-assert 40) + (trxpos gs-trxpos :offset-assert 48) + (trxpos-addr gs-reg64 :offset-assert 56) + (trxreg gs-trxreg :offset-assert 64) + (trxreg-addr gs-reg64 :offset-assert 72) + (finish int64 :offset-assert 80) + (finish-addr gs-reg64 :offset-assert 88) + (trxdir gs-trxdir :offset-assert 96) + (trxdir-addr gs-reg64 :offset-assert 104) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; screen shot settings. +(deftype screen-shot-work (structure) + ((count int16 :offset-assert 0) + (size int16 :offset-assert 2) + (name basic :offset-assert 4) + (highres-enable basic :offset-assert 8) + (hud-enable basic :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) +(define *screen-shot-work* (new 'global 'screen-shot-work)) + +(set! (-> *screen-shot-work* count) -1) +(set! (-> *screen-shot-work* size) -1) +(set! (-> *screen-shot-work* highres-enable) #f) +(set! (-> *screen-shot-work* hud-enable) #f) +(define *image-name* (new 'global 'string 32 (the-as string #f))) + +) + + + diff --git a/goal_src/jak2/engine/util/capture.gc b/goal_src/jak2/engine/util/capture.gc index 5c4fa7130c..0ff5a614d6 100644 --- a/goal_src/jak2/engine/util/capture.gc +++ b/goal_src/jak2/engine/util/capture.gc @@ -7,3 +7,58 @@ ;; DECOMP BEGINS +(declare-file (debug)) +(when *debug-segment* + + +(defun gs-set-default-store-image ((arg0 gs-store-image-packet) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int) (arg6 int) (arg7 int)) + (set! (-> arg0 vifcode 0) (new 'static 'vif-tag)) + (set! (-> arg0 vifcode 1) (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd mskpath3))) + (set! (-> arg0 vifcode 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> arg0 vifcode 3) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> arg0 giftag) (new 'static 'gif-tag :nloop #x5 :eop #x1 :nreg #x1 :regs0 (gif-reg-id a+d))) + (set! (-> arg0 bitbltbuf) (new 'static 'gs-bitbltbuf :sbp arg1 :sbw arg2 :spsm arg3)) + (set! (-> arg0 bitbltbuf-addr) (gs-reg64 bitbltbuf)) + (set! (-> arg0 trxpos) (new 'static 'gs-trxpos :ssax arg4 :ssay arg5)) + (set! (-> arg0 trxpos-addr) (gs-reg64 trxpos)) + (set! (-> arg0 trxreg) (new 'static 'gs-trxreg :rrw arg6 :rrh arg7)) + (set! (-> arg0 trxreg-addr) (gs-reg64 trxreg)) + (set! (-> arg0 finish) 0) + (set! (-> arg0 finish-addr) (gs-reg64 finish)) + (set! (-> arg0 trxdir) (new 'static 'gs-trxdir :xdir #x1)) + (set! (-> arg0 trxdir-addr) (gs-reg64 trxdir)) + ;; (.sync.l) + 7 + ) + +(defun store-image ((arg0 screen-shot-work)) + (let ((gp-0 512) + (s5-0 416) + ) + (let ((a3-0 (-> arg0 count)) + (a2-0 (-> arg0 name)) + ) + (set! (-> *image-name* data 0) (the-as uint 0)) + (format *image-name* "final/rawshots/~s-~d.raw" a2-0 a3-0) + ) + (format 0 "writing ~s~%" *image-name*) + (let ((s4-0 (new 'stack 'file-stream *image-name* 'write))) + (let ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf data))) + (let ((s2-0 (new 'static 'gs-store-image-packet))) + (gs-set-default-store-image s2-0 #x3300 (/ gp-0 64) 0 0 0 gp-0 s5-0) + (flush-cache 0) + (gs-store-image s2-0 s3-0) + ) + (sync-path 0 0) + (file-stream-write s4-0 s3-0 (the-as uint (* (* s5-0 gp-0) 4))) + ) + (file-stream-close s4-0) + ) + ) + 0 + ) + +) + + + diff --git a/goal_src/jak2/engine/util/profile-h.gc b/goal_src/jak2/engine/util/profile-h.gc index 1681e3b342..47c9f09118 100644 --- a/goal_src/jak2/engine/util/profile-h.gc +++ b/goal_src/jak2/engine/util/profile-h.gc @@ -5,5 +5,139 @@ ;; name in dgo: profile-h ;; dgos: ENGINE, GAME +;; The Jak 2 profiler is a significant improvement over Jak 1's. +;; VU segments are categorized by renderer, and the EE profiler allows nesting of events. +;; The EE profiler also allows events with the same name to be "collapsed" into a single +;; category. +;; The profiler can display results as bars, or as a text display by category. + +;; Each "event" is called a "segment". It stores a time and also a "count". +;; The "count" can be used for whatever you want (ex: fragments, VU calls, etc) + ;; DECOMP BEGINS +;; A single "event". +;; annoyingly, this type is used both to record events, and +;; to summarize all events in a category (both EE and VU), so there's +;; some overlap +(deftype profile-segment (structure) + ((name symbol :offset-assert 0) ;; used for categorization. + (start-time int16 :offset-assert 4) ;; timestamp of start + (end-time int16 :offset-assert 6) ;; timestamp of end + (count uint8 :offset-assert 8) ;; how many on EE + (vu-count uint8 :offset-assert 9) ;; how many on VU + (depth uint16 :offset-assert 10) ;; depth in the profile stack + (color rgba :offset-assert 12) ;; color for bar/text + (code-time uint16 :offset 4) ;; total time, EE + (vu-time uint16 :offset 6) ;; total time, VU + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; segments with the same name are combined together. Each "collapse" entry +;; has a summary of all the events with the same name. +(deftype profile-collapse (structure) + ((count int32 :offset-assert 0) + (data profile-segment 48 :inline :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x304 + :flag-assert #x900000304 + ) + +;; Profiling data. For either EE or VU (each has one) +(deftype profile-segment-array (basic) + ((count int16 :offset-assert 4) ;; number of used segments + (depth int8 :offset-assert 6) ;; current stack depth + (max-depth int8 :offset-assert 7) ;; max depth ever seen + (base-time int16 :offset-assert 8) ;; time at profile start + (segment profile-segment 9 :offset-assert 12) ;; stack of open segments + (data profile-segment 512 :inline :offset-assert 48) ;; segment buffer + ) + :method-count-assert 13 + :size-assert #x2030 + :flag-assert #xd00002030 + (:methods + (get-total-time (_type_) int 9) + (start-frame! (_type_) none 10) + (start-segment! (_type_ symbol rgba) none 11) + (end-segment! (_type_) none 12) + ) + ) + +(declare-type dma-buffer structure) + +;; Pair of profilers (EE, VU) +(deftype profile-array (structure) + ((data profile-segment-array 2 :offset-assert 0) + ) + :method-count-assert 12 + :size-assert #x8 + :flag-assert #xc00000008 + (:methods + (setup-categories! (_type_) none 9) + (draw-bars! (_type_ dma-buffer int) none 10) + (draw-text! (_type_) none 11) + ) + ) + + +(defmethod get-total-time profile-segment-array ((obj profile-segment-array)) + "Get the total time spent." + ;; assuming 0 is "all" here. + (- (-> obj data 0 end-time) (-> obj data 0 start-time)) + ) + +(define *profile-gap-color* (new 'static 'rgba :r #x30 :g #x30 :b #x30 :a #x80)) +(define *profile-all-color* (new 'static 'rgba :r #x55 :g #x55 :b #x55 :a #x80)) +(define *profile-particles-color* (new 'static 'rgba :r #x80 :g #x40 :b #x40 :a #x80)) +(define *profile-target-color* (new 'static 'rgba :r #x40 :g #x80 :b #x40 :a #x80)) +(define *profile-target-post-color* (new 'static 'rgba :r #x40 :g #x40 :b #x80 :a #x80)) +(define *profile-joints-color* (new 'static 'rgba :r #x70 :g #x70 :b #x20 :a #x80)) +(define *profile-debug-color* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) +(define *profile-draw-hook-color* (new 'static 'rgba :r #x20 :g #x70 :b #x70 :a #x80)) +(define *profile-sky-color* (new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)) +(define *profile-ocean-color* (new 'static 'rgba :r #x60 :g #x80 :b #x20 :a #x80)) +(define *profile-background-color* (new 'static 'rgba :r #x60 :g #x60 :b #x40 :a #x80)) +(define *profile-bsp-color* (new 'static 'rgba :r #x60 :g #x40 :b #x60 :a #x80)) +(define *profile-foreground-color* (new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)) +(define *profile-tfrag-color* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) +(define *profile-instance-tie-color* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) +(define *profile-instance-shrubbery-color* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) +(define *profile-generic-tie-color* (new 'static 'rgba :r #x80 :g #x20 :b #x60 :a #x80)) +(define *profile-bones-color* (new 'static 'rgba :r #x20 :g #x80 :b #x60 :a #x80)) +(define *profile-generic-merc-color* (new 'static 'rgba :r #x20 :g #x60 :b #x80 :a #x80)) +(define *profile-shadow-color* (new 'static 'rgba :r #x48 :g #x48 :b #x70 :a #x80)) +(define *profile-update-actors-color* (new 'static 'rgba :r #x48 :g #x70 :b #x48 :a #x80)) +(define *profile-menu-hook-color* (new 'static 'rgba :r #x70 :g #x48 :b #x48 :a #x80)) +(define *profile-texture-color* (new 'static 'rgba :r #x80 :g #x70 :b #x10 :a #x80)) +(define *profile-effects-color* (new 'static 'rgba :r #x70 :g #x80 :b #x10 :a #x80)) +(define *profile-sprite-color* (new 'static 'rgba :r #x70 :g #x10 :b #x80 :a #x80)) +(define *profile-merc-color* (new 'static 'rgba :r #x10 :g #x70 :b #x80 :a #x80)) +(define *profile-actors-color* (new 'static 'rgba :r #x80 :g #x10 :b #x70 :a #x80)) +(define *profile-collide-color* (new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)) +(define *profile-nav-color* (new 'static 'rgba :r #x38 :g #x48 :b #x80 :a #x80)) +(define *profile-camera-color* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) +(define *profile-blit-color* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) +(define *profile-hud-color* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) +(define *profile-emerc-color* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) + +;; allocate profile arrays +(when *debug-segment* + (define *profile-array* (new 'debug 'profile-array)) + + (set! (-> *profile-array* data 0) (new 'debug 'profile-segment-array)) + (set! (-> *profile-array* data 1) (new 'debug 'profile-segment-array)) + + (define *profile-collapse* (new 'debug 'profile-collapse)) + + (define *profile-interrupt-segment* (-> *profile-array* data 1)) + + (define *profile-interrupt-start* #f) + ) + +(define-extern *stats-profile-bars* symbol) +(define-extern *display-profile* symbol) diff --git a/goal_src/jak2/engine/util/profile.gc b/goal_src/jak2/engine/util/profile.gc index 84166e0da8..e88e7b09a5 100644 --- a/goal_src/jak2/engine/util/profile.gc +++ b/goal_src/jak2/engine/util/profile.gc @@ -4,6 +4,860 @@ ;; name: profile.gc ;; name in dgo: profile ;; dgos: ENGINE, GAME +(define-extern *dproc* process) ;; DECOMP BEGINS +;; DMA templates for profile drawing +(deftype profile-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (line-tmpl dma-gif-packet :inline :offset-assert 32) + (last-index int32 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +;; dma templates +(define *profile-work* + (new 'static 'profile-work + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe #x1) + :nreg #x3 + ) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyz2) :regs2 (gif-reg-id xyz2)) + ) + :line-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif0 (new 'static 'gif-tag64 + :nloop #x1 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line) :abe #x1) + :nreg #x3 + ) + :gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id rgbaq) :regs1 (gif-reg-id xyz2) :regs2 (gif-reg-id xyz2)) + ) + ) + ) + +;; profile setting +(define *profile-x* 1808) +(define *profile-y* 1848) +(define *profile-w* 416) +(define *profile-h* 8) +(define *profile-ticks* #f) + +(defmethod start-frame! profile-segment-array ((obj profile-segment-array)) + "Start a frame." + (set! (-> obj count) 0) + (set! (-> obj depth) 0) + (set! (-> obj max-depth) 0) + (set! (-> obj base-time) (the-as int (timer-count (the-as timer-bank #x10000800)))) + (start-segment! obj 'all *profile-all-color*) + 0 + (none) + ) + +(defmethod start-segment! profile-segment-array ((obj profile-segment-array) (arg0 symbol) (arg1 rgba)) + "Push a new segment onto the profiling stack." + (when (and *dproc* *debug-segment*) + (let ((s4-0 (-> obj data (-> obj count)))) + (let ((s3-0 (-> obj base-time))) + (set! (-> s4-0 name) arg0) + (set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0)))) + ) + (set! (-> s4-0 depth) (the-as uint (-> obj depth))) + (set! (-> s4-0 color) arg1) + (set! (-> obj segment (-> obj depth)) s4-0) + ) + (+! (-> obj count) 1) + (+! (-> obj depth) 1) + (set! (-> obj max-depth) (max (-> obj max-depth) (-> obj depth))) + ) + 0 + (none) + ) + +(defmethod end-segment! profile-segment-array ((obj profile-segment-array)) + "Pop the last pushed segment." + (when (and *dproc* *debug-segment*) + (let* ((v1-4 (+ (-> obj depth) -1)) + (s5-0 (-> obj segment v1-4)) + (s4-0 (-> obj base-time)) + ) + (when (>= v1-4 0) + (set! (-> s5-0 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-0)))) + (+! (-> obj depth) -1) + ) + ) + ) + 0 + (none) + ) + +(defun profile-texture-test ((arg0 bucket-id)) + "Is this a texture bucket?" + (or (= arg0 (bucket-id bucket-4)) + (= arg0 (bucket-id bucket-7)) + (= arg0 (bucket-id bucket-18)) + (= arg0 (bucket-id bucket-29)) + (= arg0 (bucket-id bucket-40)) + (= arg0 (bucket-id bucket-51)) + (= arg0 (bucket-id bucket-62)) + (= arg0 (bucket-id bucket-73)) + (= arg0 (bucket-id bucket-82)) + (= arg0 (bucket-id bucket-91)) + (= arg0 (bucket-id bucket-100)) + (= arg0 (bucket-id bucket-109)) + (= arg0 (bucket-id bucket-118)) + (= arg0 (bucket-id bucket-127)) + (= arg0 (bucket-id bucket-137)) + (= arg0 (bucket-id bucket-147)) + (= arg0 (bucket-id bucket-157)) + (= arg0 (bucket-id bucket-167)) + (= arg0 (bucket-id bucket-177)) + (= arg0 (bucket-id bucket-187)) + (= arg0 (bucket-id bucket-196)) + (= arg0 (bucket-id bucket-200)) + (= arg0 (bucket-id bucket-204)) + (= arg0 (bucket-id bucket-208)) + (= arg0 (bucket-id bucket-212)) + (= arg0 (bucket-id bucket-216)) + (= arg0 (bucket-id bucket-220)) + (= arg0 (bucket-id bucket-252)) + (= arg0 (bucket-id bucket-261)) + (= arg0 (bucket-id bucket-270)) + (= arg0 (bucket-id bucket-279)) + (= arg0 (bucket-id bucket-288)) + (= arg0 (bucket-id bucket-297)) + (= arg0 (bucket-id bucket-306)) + (= arg0 (bucket-id bucket-312)) + (= arg0 (bucket-id bucket-316)) + (= arg0 (bucket-id bucket-319)) + ) + ) + +(defun profile-tfrag-test ((arg0 bucket-id)) + "Is this a tfrag bucket?" + (or (= arg0 (bucket-id bucket-8)) + (= arg0 (bucket-id bucket-19)) + (= arg0 (bucket-id bucket-30)) + (= arg0 (bucket-id bucket-41)) + (= arg0 (bucket-id bucket-52)) + (= arg0 (bucket-id bucket-63)) + (= arg0 (bucket-id bucket-11)) + (= arg0 (bucket-id bucket-22)) + (= arg0 (bucket-id bucket-33)) + (= arg0 (bucket-id bucket-44)) + (= arg0 (bucket-id bucket-55)) + (= arg0 (bucket-id bucket-66)) + (= arg0 (bucket-id bucket-128)) + (= arg0 (bucket-id bucket-138)) + (= arg0 (bucket-id bucket-148)) + (= arg0 (bucket-id bucket-158)) + (= arg0 (bucket-id bucket-168)) + (= arg0 (bucket-id bucket-178)) + (= arg0 (bucket-id bucket-255)) + (= arg0 (bucket-id bucket-264)) + (= arg0 (bucket-id bucket-273)) + (= arg0 (bucket-id bucket-282)) + (= arg0 (bucket-id bucket-291)) + (= arg0 (bucket-id bucket-300)) + (= arg0 (bucket-id bucket-134)) + (= arg0 (bucket-id bucket-144)) + (= arg0 (bucket-id bucket-154)) + (= arg0 (bucket-id bucket-164)) + (= arg0 (bucket-id bucket-174)) + (= arg0 (bucket-id bucket-184)) + (= arg0 (bucket-id bucket-259)) + (= arg0 (bucket-id bucket-268)) + (= arg0 (bucket-id bucket-277)) + (= arg0 (bucket-id bucket-286)) + (= arg0 (bucket-id bucket-295)) + (= arg0 (bucket-id bucket-304)) + ) + ) + +(defun profile-tie-test ((arg0 bucket-id)) + "Is this a tie bucket?" + (or (= arg0 (bucket-id bucket-9)) + (= arg0 (bucket-id bucket-20)) + (= arg0 (bucket-id bucket-31)) + (= arg0 (bucket-id bucket-42)) + (= arg0 (bucket-id bucket-53)) + (= arg0 (bucket-id bucket-64)) + (= arg0 (bucket-id bucket-10)) + (= arg0 (bucket-id bucket-21)) + (= arg0 (bucket-id bucket-32)) + (= arg0 (bucket-id bucket-43)) + (= arg0 (bucket-id bucket-54)) + (= arg0 (bucket-id bucket-65)) + (= arg0 (bucket-id bucket-12)) + (= arg0 (bucket-id bucket-23)) + (= arg0 (bucket-id bucket-34)) + (= arg0 (bucket-id bucket-45)) + (= arg0 (bucket-id bucket-56)) + (= arg0 (bucket-id bucket-67)) + (= arg0 (bucket-id bucket-13)) + (= arg0 (bucket-id bucket-24)) + (= arg0 (bucket-id bucket-35)) + (= arg0 (bucket-id bucket-46)) + (= arg0 (bucket-id bucket-57)) + (= arg0 (bucket-id bucket-68)) + (= arg0 (bucket-id bucket-17)) + (= arg0 (bucket-id bucket-28)) + (= arg0 (bucket-id bucket-39)) + (= arg0 (bucket-id bucket-50)) + (= arg0 (bucket-id bucket-61)) + (= arg0 (bucket-id bucket-72)) + (= arg0 (bucket-id bucket-129)) + (= arg0 (bucket-id bucket-139)) + (= arg0 (bucket-id bucket-149)) + (= arg0 (bucket-id bucket-159)) + (= arg0 (bucket-id bucket-169)) + (= arg0 (bucket-id bucket-179)) + (= arg0 (bucket-id bucket-130)) + (= arg0 (bucket-id bucket-140)) + (= arg0 (bucket-id bucket-150)) + (= arg0 (bucket-id bucket-160)) + (= arg0 (bucket-id bucket-170)) + (= arg0 (bucket-id bucket-180)) + (= arg0 (bucket-id bucket-135)) + (= arg0 (bucket-id bucket-145)) + (= arg0 (bucket-id bucket-155)) + (= arg0 (bucket-id bucket-165)) + (= arg0 (bucket-id bucket-175)) + (= arg0 (bucket-id bucket-185)) + (= arg0 (bucket-id bucket-136)) + (= arg0 (bucket-id bucket-146)) + (= arg0 (bucket-id bucket-156)) + (= arg0 (bucket-id bucket-166)) + (= arg0 (bucket-id bucket-176)) + (= arg0 (bucket-id bucket-186)) + ) + ) + +(defun profile-merc-test ((arg0 bucket-id)) + "Is this a merc bucket?" + (or (= arg0 (bucket-id bucket-14)) + (= arg0 (bucket-id bucket-25)) + (= arg0 (bucket-id bucket-36)) + (= arg0 (bucket-id bucket-47)) + (= arg0 (bucket-id bucket-58)) + (= arg0 (bucket-id bucket-69)) + (= arg0 (bucket-id bucket-79)) + (= arg0 (bucket-id bucket-88)) + (= arg0 (bucket-id bucket-97)) + (= arg0 (bucket-id bucket-106)) + (= arg0 (bucket-id bucket-115)) + (= arg0 (bucket-id bucket-124)) + (= arg0 (bucket-id bucket-131)) + (= arg0 (bucket-id bucket-141)) + (= arg0 (bucket-id bucket-151)) + (= arg0 (bucket-id bucket-161)) + (= arg0 (bucket-id bucket-171)) + (= arg0 (bucket-id bucket-181)) + (= arg0 (bucket-id bucket-188)) + (= arg0 (bucket-id bucket-192)) + (= arg0 (bucket-id bucket-197)) + (= arg0 (bucket-id bucket-201)) + (= arg0 (bucket-id bucket-205)) + (= arg0 (bucket-id bucket-209)) + (= arg0 (bucket-id bucket-213)) + (= arg0 (bucket-id bucket-217)) + (= arg0 (bucket-id bucket-221)) + (= arg0 (bucket-id bucket-225)) + (= arg0 (bucket-id bucket-229)) + (= arg0 (bucket-id bucket-233)) + (= arg0 (bucket-id bucket-237)) + (= arg0 (bucket-id bucket-241)) + (= arg0 (bucket-id bucket-245)) + (= arg0 (bucket-id bucket-249)) + (= arg0 (bucket-id bucket-253)) + (= arg0 (bucket-id bucket-262)) + (= arg0 (bucket-id bucket-271)) + (= arg0 (bucket-id bucket-280)) + (= arg0 (bucket-id bucket-289)) + (= arg0 (bucket-id bucket-298)) + (= arg0 (bucket-id bucket-307)) + ) + ) + +(defun profile-emerc-test ((arg0 bucket-id)) + "Is this an emerc bucket?" + (or (= arg0 (bucket-id bucket-15)) + (= arg0 (bucket-id bucket-26)) + (= arg0 (bucket-id bucket-37)) + (= arg0 (bucket-id bucket-48)) + (= arg0 (bucket-id bucket-59)) + (= arg0 (bucket-id bucket-70)) + (= arg0 (bucket-id bucket-80)) + (= arg0 (bucket-id bucket-89)) + (= arg0 (bucket-id bucket-98)) + (= arg0 (bucket-id bucket-107)) + (= arg0 (bucket-id bucket-116)) + (= arg0 (bucket-id bucket-125)) + (= arg0 (bucket-id bucket-132)) + (= arg0 (bucket-id bucket-142)) + (= arg0 (bucket-id bucket-152)) + (= arg0 (bucket-id bucket-162)) + (= arg0 (bucket-id bucket-172)) + (= arg0 (bucket-id bucket-182)) + (= arg0 (bucket-id bucket-189)) + (= arg0 (bucket-id bucket-193)) + (= arg0 (bucket-id bucket-198)) + (= arg0 (bucket-id bucket-202)) + (= arg0 (bucket-id bucket-206)) + (= arg0 (bucket-id bucket-210)) + (= arg0 (bucket-id bucket-214)) + (= arg0 (bucket-id bucket-218)) + (= arg0 (bucket-id bucket-222)) + (= arg0 (bucket-id bucket-226)) + (= arg0 (bucket-id bucket-230)) + (= arg0 (bucket-id bucket-234)) + (= arg0 (bucket-id bucket-238)) + (= arg0 (bucket-id bucket-242)) + (= arg0 (bucket-id bucket-246)) + (= arg0 (bucket-id bucket-250)) + ) + ) + +(defun profile-mercneric-test ((arg0 bucket-id)) + "Is this a mercneric bucket?" + (or (= arg0 (bucket-id bucket-16)) + (= arg0 (bucket-id bucket-27)) + (= arg0 (bucket-id bucket-38)) + (= arg0 (bucket-id bucket-49)) + (= arg0 (bucket-id bucket-60)) + (= arg0 (bucket-id bucket-71)) + (= arg0 (bucket-id bucket-81)) + (= arg0 (bucket-id bucket-90)) + (= arg0 (bucket-id bucket-99)) + (= arg0 (bucket-id bucket-108)) + (= arg0 (bucket-id bucket-117)) + (= arg0 (bucket-id bucket-126)) + (= arg0 (bucket-id bucket-133)) + (= arg0 (bucket-id bucket-143)) + (= arg0 (bucket-id bucket-153)) + (= arg0 (bucket-id bucket-163)) + (= arg0 (bucket-id bucket-173)) + (= arg0 (bucket-id bucket-183)) + (= arg0 (bucket-id bucket-190)) + (= arg0 (bucket-id bucket-194)) + (= arg0 (bucket-id bucket-199)) + (= arg0 (bucket-id bucket-203)) + (= arg0 (bucket-id bucket-207)) + (= arg0 (bucket-id bucket-211)) + (= arg0 (bucket-id bucket-215)) + (= arg0 (bucket-id bucket-219)) + (= arg0 (bucket-id bucket-223)) + (= arg0 (bucket-id bucket-227)) + (= arg0 (bucket-id bucket-231)) + (= arg0 (bucket-id bucket-235)) + (= arg0 (bucket-id bucket-239)) + (= arg0 (bucket-id bucket-243)) + (= arg0 (bucket-id bucket-247)) + (= arg0 (bucket-id bucket-251)) + (= arg0 (bucket-id bucket-254)) + (= arg0 (bucket-id bucket-263)) + (= arg0 (bucket-id bucket-272)) + (= arg0 (bucket-id bucket-281)) + (= arg0 (bucket-id bucket-290)) + (= arg0 (bucket-id bucket-299)) + (= arg0 (bucket-id bucket-308)) + (= arg0 (bucket-id bucket-317)) + ) + ) + +(defmethod setup-categories! profile-array ((obj profile-array)) + "Summarize data collected." + + ;; loop over both EE and VU profilers + (dotimes (s5-0 2) + ;; each of the two display-frames has its own profile-array + ;; assume this is called on a display-frame's profile-array and copy us to the + ;; global one. + (let ((s3-0 (-> *profile-array* data s5-0)) + (s4-0 *profile-collapse*) + ) + (mem-copy! (&-> s3-0 type) (&-> (-> obj data s5-0) type) 8240) + + (cond + ((zero? s5-0) + ;; we're the EE profiler. + ((lambda ((arg0 profile-segment-array) (arg1 profile-collapse)) + (let ((v0-0 0)) + ;; loop over categories in summary and set to defaults + (dotimes (v1-0 48) + (set! (-> arg1 data v1-0 name) #f) + (set! (-> arg1 data v1-0 count) (the-as uint 0)) + (set! (-> arg1 data v1-0 vu-count) (the-as uint 0)) + (set! (-> arg1 data v1-0 depth) (the-as uint 0)) + (set! (-> arg1 data v1-0 start-time) 0) + (set! (-> arg1 data v1-0 end-time) 0) + ) + ;; loop over events we got + (dotimes (v1-3 (-> arg0 count)) + (let ((a2-15 (- (-> arg0 data v1-3 end-time) (-> arg0 data v1-3 start-time)))) + (let ((t0-0 (-> arg0 data v1-3 name))) + ;; search for category that matches + (dotimes (a3-5 v0-0) + (when (= (-> arg1 data a3-5 name) t0-0) ;; got it! + (+! (-> arg1 data a3-5 count) 1) + (set! (-> arg1 data a3-5 start-time) (the-as int (+ (-> arg1 data a3-5 code-time) a2-15))) + (goto cfg-11) + ) + ) + (set! (-> arg1 data v0-0 name) t0-0) + ) + (set! (-> arg1 data v0-0 count) (the-as uint 1)) + (set! (-> arg1 data v0-0 depth) (-> arg0 data v1-3 depth)) + (set! (-> arg1 data v0-0 start-time) a2-15) + ) + (set! (-> arg1 data v0-0 color) (-> arg0 data v1-3 color)) + (set! v0-0 (min 47 (+ v0-0 1))) + (label cfg-11) + ) + (set! (-> arg1 count) v0-0) + ) + (none) + ) + s3-0 + s4-0 + ) + ) + (else + ;; VU + (let ((s2-0 3) + (s1-0 (+ (-> s3-0 count) -1)) + ) + (while (>= s1-0 s2-0) + (let ((s0-0 (-> s3-0 data s2-0))) + (cond + ((= s2-0 3) + (set! (-> s0-0 name) 'blit-displays) + (set! (-> s0-0 color) *profile-blit-color*) + ) + ((= s2-0 5) + (set! (-> s0-0 name) 'sky) + (set! (-> s0-0 color) *profile-sky-color*) + ) + ((or (= s2-0 6) (= s2-0 310)) + (set! (-> s0-0 name) 'ocean) + (set! (-> s0-0 color) *profile-ocean-color*) + ) + ((profile-texture-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'texture) + (set! (-> s0-0 color) *profile-texture-color*) + ) + ((profile-tfrag-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'tfrag) + (set! (-> s0-0 color) *profile-tfrag-color*) + ) + ((profile-tie-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'instance-tie) + (set! (-> s0-0 color) *profile-instance-tie-color*) + ) + ((profile-merc-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'merc) + (set! (-> s0-0 color) *profile-merc-color*) + ) + ((profile-emerc-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'emerc) + (set! (-> s0-0 color) *profile-emerc-color*) + ) + ((profile-mercneric-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'generic-merc) + (set! (-> s0-0 color) *profile-generic-merc-color*) + ) + ((or (and (>= s2-0 74) (>= 78 s2-0)) + (and (>= s2-0 83) (>= 87 s2-0)) + (and (>= s2-0 92) (>= 96 s2-0)) + (and (>= s2-0 101) (>= 105 s2-0)) + (and (>= s2-0 110) (>= 114 s2-0)) + (and (>= s2-0 119) (>= 123 s2-0)) + ) + (set! (-> s0-0 name) 'instance-shrubbery) + (set! (-> s0-0 color) *profile-instance-shrubbery-color*) + ) + ((or (= s2-0 195) (= s2-0 314)) + (set! (-> s0-0 name) 'shadow) + (set! (-> s0-0 color) *profile-shadow-color*) + ) + ((= s2-0 313) + (set! (-> s0-0 name) 'particles) + (set! (-> s0-0 color) *profile-particles-color*) + ) + ((or (= s2-0 324) (= s2-0 325) (= s2-0 318) (= s2-0 326)) + (set! (-> s0-0 name) 'debug) + (set! (-> s0-0 color) *profile-debug-color*) + ) + ((= s2-0 311) + (set! (-> s0-0 name) 'depth-cue) + (set! (-> s0-0 color) *profile-blit-color*) + ) + ((= s2-0 315) + (set! (-> s0-0 name) 'effects) + (set! (-> s0-0 color) *profile-effects-color*) + ) + ((or (= s2-0 320) (= s2-0 321) (= s2-0 322) (= s2-0 323)) + (set! (-> s0-0 name) 'hud) + (set! (-> s0-0 color) *profile-hud-color*) + ) + ) + (let ((v1-87 (- (-> s0-0 end-time) (-> s0-0 start-time))) + (a1-2 (-> s0-0 name)) + ) + (dotimes (a0-29 (-> s4-0 count)) + (when (= (-> s4-0 data a0-29 name) a1-2) + (+! (-> s4-0 data a0-29 vu-count) 1) + (set! (-> s4-0 data a0-29 end-time) (the-as int (+ (-> s4-0 data a0-29 vu-time) v1-87))) + (goto cfg-91) + ) + ) + ) + ) + (label cfg-91) + (+! s2-0 1) + ) + ) + (countdown (v1-94 (-> s3-0 count)) + (when (nonzero? (-> s3-0 data v1-94 end-time)) + (set! (-> s4-0 data 0 vu-count) (the-as uint 1)) + (set! (-> s4-0 data 0 end-time) (- (-> s3-0 data v1-94 end-time) (-> s3-0 data 0 start-time))) + (goto cfg-99) + ) + ) + ) + ) + ) + (label cfg-99) + ) + 0 + (none) + ) + +(defmethod draw-bars! profile-array ((obj profile-array) (arg0 dma-buffer) (arg1 int)) + "Draw the two bars at the top." + (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) + (set! (-> (the-as gs-gif-tag a0-3) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-5) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-zbuf) a0-5) 2) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 3) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer gs-test) a0-5) 4) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) + (set! (-> (the-as (pointer gs-reg64) a0-5) 5) (gs-reg64 test-1)) + (set! (-> (the-as (pointer uint64) a0-5) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 7) (gs-reg64 pabe)) + (set! (-> (the-as (pointer gs-clamp) a0-5) 8) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-5) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-tex1) a0-5) 10) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 11) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-texa) a0-5) 12) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 13) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-texclut) a0-5) 14) (new 'static 'gs-texclut :cbw #x4)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 15) (gs-reg64 texclut)) + (set! (-> (the-as (pointer uint64) a0-5) 16) (the-as uint *fog-color*)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 17) (gs-reg64 fogcol)) + (set! (-> v1-2 base) (&+ a0-5 144)) + ) + (let ((v1-5 (* (+ *profile-x* (/ *profile-w* 2)) 16)) + (a0-9 (-> arg0 base)) + ) + (set! (-> (the-as (pointer uint128) a0-9) 0) (-> *profile-work* line-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) a0-9) 1) (-> *profile-work* line-tmpl quad 1)) + (set-vector! (the-as vector4w (&+ a0-9 32)) 64 64 64 64) + (set-vector! (the-as vector4w (&+ a0-9 48)) v1-5 #x7340 #xffffff 0) + (set-vector! (the-as vector4w (&+ a0-9 64)) v1-5 #x7580 #xffffff 0) + ) + (&+! (-> arg0 base) 80) + (dotimes (s3-0 2) + (let* ((v1-12 (-> obj data s3-0)) + (a0-11 (-> v1-12 max-depth)) + (s2-1 (max 14 (* a0-11 2))) + ) + (set! *profile-y* (+ arg1 1840)) + (let ((a1-32 (-> arg0 base))) + (set! (-> (the-as (pointer uint128) a1-32) 0) (-> *profile-work* sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) a1-32) 1) (-> *profile-work* sprite-tmpl quad 1)) + (set-vector! (the-as vector4w (&+ a1-32 32)) 64 64 64 64) + (set-vector! (the-as vector4w (&+ a1-32 48)) (* *profile-x* 16) (* *profile-y* 16) #xffffff 0) + (set-vector! + (the-as vector4w (&+ a1-32 64)) + (* (+ *profile-x* *profile-w*) 16) + (* (+ *profile-y* s2-1) 16) + #xffffff + 0 + ) + ) + (&+! (-> arg0 base) 80) + (let ((a0-12 (/ s2-1 a0-11))) + (dotimes (a1-36 (+ (-> v1-12 count) -1)) + (let ((a2-22 (-> v1-12 data a1-36))) + (when (< (-> a2-22 start-time) (-> a2-22 end-time)) + (let* ((t0-1 (* *ticks-per-frame* 2)) + (a3-15 (* (+ *profile-x* (/ (* (-> a2-22 start-time) *profile-w*) t0-1)) 16)) + (t0-4 (* (+ *profile-x* (/ (* (-> a2-22 end-time) *profile-w*) t0-1)) 16)) + (t3-1 (* (+ arg1 1840 (* (-> a2-22 depth) (the-as uint a0-12))) 16)) + (t1-7 (+ t3-1 (* a0-12 16))) + (t2-5 (-> arg0 base)) + ) + (set! (-> (the-as (pointer int128) t2-5) 0) (the-as int128 (-> *profile-work* sprite-tmpl dma-vif quad))) + (set! (-> (the-as (pointer int128) t2-5) 1) (the-as int128 (-> *profile-work* sprite-tmpl quad 1))) + (set-vector! + (the-as vector4w (&+ t2-5 32)) + (the int (* 1.9921875 (the float (-> a2-22 color r)))) + (the int (* 1.9921875 (the float (-> a2-22 color g)))) + (the int (* 1.9921875 (the float (-> a2-22 color b)))) + (the-as int (-> a2-22 color a)) + ) + (set-vector! (the-as vector4w (&+ t2-5 48)) a3-15 t3-1 #xffffff 0) + (set-vector! (the-as vector4w (&+ t2-5 64)) t0-4 t1-7 #xffffff 0) + ) + (&+! (-> arg0 base) 80) + ) + ) + ) + ) + (cond + ((zero? s3-0) + (let* ((s1-0 (-> v1-12 data 0 end-time)) + (f30-0 (* 100.0 (/ (the float s1-0) (the float *ticks-per-frame*)))) + ) + (cond + (*profile-ticks* + (let ((s0-0 draw-string-xy)) + (set! sv-16 format) + (let ((a0-16 (clear *temp-string*)) + (a1-37 "~5D") + ) + (sv-16 a0-16 a1-37 s1-0) + ) + (s0-0 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-0 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + (else + (let ((s1-1 draw-string-xy)) + (format (clear *temp-string*) "~5,,2f" f30-0) + (s1-1 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-0 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + ) + ) + ) + (else + (let ((s1-2 0)) + (countdown (a0-21 (-> v1-12 count)) + (when (nonzero? (-> v1-12 data a0-21 end-time)) + (set! s1-2 (- (-> v1-12 data a0-21 end-time) (-> v1-12 data 0 start-time))) + (goto cfg-23) + ) + ) + (label cfg-23) + (let ((f30-1 (* 100.0 (/ (the float s1-2) (the float *ticks-per-frame*))))) + (cond + (*profile-ticks* + (let ((s0-2 draw-string-xy)) + (set! sv-32 format) + (let ((a0-26 (clear *temp-string*)) + (a1-45 "~5D") + ) + (sv-32 a0-26 a1-45 s1-2) + ) + (s0-2 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-1 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + (else + (let ((s1-3 draw-string-xy)) + (format (clear *temp-string*) "~5,,2f" f30-1) + (s1-3 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-1 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + ) + ) + ) + ) + ) + (set! arg1 (+ s2-1 2 arg1)) + ) + ) + (none) + ) + +(defmethod draw-text! profile-array ((obj profile-array)) + "Draw the table of times." + (let ((gp-0 *profile-collapse*)) + (dotimes (s5-0 (-> gp-0 count)) + (when (or (nonzero? (-> gp-0 data s5-0 count)) (nonzero? (-> gp-0 data s5-0 vu-count))) + (dotimes (s4-0 (the-as int (-> gp-0 data s5-0 depth))) + (format *stdcon* " ") + ) + (format *stdcon* "~o~s~0k" (-> gp-0 data s5-0 color) (symbol->string (-> gp-0 data s5-0 name))) + (if (nonzero? (-> gp-0 data s5-0 count)) + (format + *stdcon* + "~170h~5d~220h~5d~280h~5,,2f" + (-> gp-0 data s5-0 count) + (-> gp-0 data s5-0 code-time) + (* 100.0 (/ (the float (-> gp-0 data s5-0 code-time)) (the float *ticks-per-frame*))) + ) + ) + (if (nonzero? (-> gp-0 data s5-0 vu-count)) + (format + *stdcon* + "~338h~5d~388h~5d~448h~5,,2f" + (-> gp-0 data s5-0 vu-count) + (-> gp-0 data s5-0 vu-time) + (* 100.0 (/ (the float (-> gp-0 data s5-0 vu-time)) (the float *ticks-per-frame*))) + ) + ) + (format *stdcon* "~1k~%") + ) + ) + ) + 0 + (none) + ) + + + + +;; DECOMP ENDS + +(defmacro with-profiler (category profile-color &rest body) + `(begin + (when *debug-segment* + (let ((prof (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (name ,category) + (color ,profile-color) + ) + (when (and *dproc* *debug-segment*) + (let ((segment (-> prof data (-> prof count)))) + (let ((base-time (-> prof base-time))) + (set! (-> segment name) name) + (set! (-> segment start-time) (- (timer-count TIMER1_BANK) start-time)) + ) + (set! (-> segment depth) (-> prof depth)) + (set! (-> segment color) color) + (set! (-> prof segment (-> prof depth)) segment) + ) + (+! (-> prof count) 1) + (+! (-> prof depth) 1) + (set! (-> prof max-depth) (max (-> prof max-depth) (-> segment depth))) + ) + ) + ) + + ,@body + + (when *debug-segment* + (let ((prof (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((after-depth (+ (-> prof depth) -1)) + (segment (-> prof segment after-depth)) + (base-time (-> prof base-time)) + ) + (when (>= after-depth 0) + (set! (-> segment end-time) (- (timer-count TIMER1_BANK) base-time)) + (+! (-> prof depth) -1) + ) + ) + ) + ) + ) + ) + ) \ 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 7a2f26bb8a..0c968da783 100644 --- a/goal_src/jak2/engine/util/script-h.gc +++ b/goal_src/jak2/engine/util/script-h.gc @@ -5,5 +5,85 @@ ;; name in dgo: script-h ;; dgos: ENGINE, GAME +(define-extern *load-state* load-state) + + ;; DECOMP BEGINS +(deftype script-form (structure) + ((name basic :offset-assert 0) + (spec basic :offset-assert 4) + (func basic :offset-assert 8) + ) + :method-count-assert 10 + :size-assert #xc + :flag-assert #xa0000000c + (:methods + (script-form-method-9 () none 9) + ) + ) + +(deftype script-context (structure) + ((load-state load-state :offset-assert 0) + (key basic :offset-assert 4) + (process process :offset-assert 8) + (trans vector :offset-assert 12) + (side-effect? symbol :offset-assert 16) + (got-error? symbol :offset-assert 20) + (expr basic :offset-assert 24) + (param-count int32 :offset-assert 28) + (param object 16 :offset-assert 32) + (param-type object 16 :offset-assert 96) + ) + :method-count-assert 12 + :size-assert #xa0 + :flag-assert #xc000000a0 + (:methods + (new (symbol type basic process vector) _type_ 0) + (script-context-method-9 () none 9) + (script-context-method-10 () none 10) + (script-context-method-11 () none 11) + ) + ) + +(defmethod inspect script-context ((obj script-context)) + (when (not obj) + (return obj) + ) + (format #t "[~8x] ~A~%" obj 'script-context) + (format #t "~1Tload-state: ~A~%" (-> obj load-state)) + (format #t "~1Tkey: ~A~%" (-> obj key)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Ttrans: #~%" (-> obj trans)) + (format #t "~1Tside-effect?: ~A~%" (-> obj side-effect?)) + (format #t "~1Tgot-error?: ~A~%" (-> obj got-error?)) + (format #t "~1Texpr: ~A~%" (-> obj expr)) + (format #t "~1Tparam-count: ~D~%" (-> obj param-count)) + (format #t "~1Tparam[16] @ #x~X~%" (-> obj param)) + (dotimes (s5-0 (-> obj param-count)) + (format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> obj param s5-0)) + ) + (format #t "~1Tparam-type[16] @ #x~X~%" (-> obj param-type)) + (dotimes (s5-1 (-> obj param-count)) + (format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> obj param-type s5-1)) + ) + obj + ) + +(defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 process) (arg2 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((v0-0 (t9-0 allocation v1-1))) + (set! (-> (the-as script-context v0-0) key) arg0) + (set! (-> (the-as script-context v0-0) process) arg1) + (set! (-> (the-as script-context v0-0) load-state) *load-state*) + (set! (-> (the-as script-context v0-0) side-effect?) #t) + (set! (-> (the-as script-context v0-0) got-error?) #f) + (set! (-> (the-as script-context v0-0) trans) arg2) + (the-as script-context v0-0) + ) + ) + ) + diff --git a/goal_src/jak2/engine/util/smush-control-h.gc b/goal_src/jak2/engine/util/smush-control-h.gc index 4703ad4bd7..3d54252380 100644 --- a/goal_src/jak2/engine/util/smush-control-h.gc +++ b/goal_src/jak2/engine/util/smush-control-h.gc @@ -7,3 +7,113 @@ ;; DECOMP BEGINS +(deftype smush-control (structure) + ((start-time time-frame :offset-assert 0) + (period float :offset-assert 8) + (duration float :offset-assert 12) + (amp float :offset-assert 16) + (damp-amp float :offset-assert 20) + (damp-period float :offset-assert 24) + (ticks float :offset-assert 28) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (set-zero! (_type_) _type_ 9) + (update! (_type_) float 10) + (get-no-update (_type_) float 11) + (activate! (_type_ float int int float float clock) _type_ 12) + (nonzero-amplitude? (_type_) symbol 13) + (die-on-next-update! (_type_) _type_ 14) + ) + ) + +(defmethod nonzero-amplitude? smush-control ((obj smush-control)) + (!= (-> obj amp) 0.0) + ) + +(defmethod set-zero! smush-control ((obj smush-control)) + (set! (-> obj period) 0.0) + (set! (-> obj duration) 0.0) + (set! (-> obj amp) 0.0) + (set! (-> obj damp-amp) 0.0) + (set! (-> obj damp-period) 0.0) + (set! (-> obj ticks) 0.0) + obj + ) + +(defmethod update! smush-control ((obj smush-control)) + (with-pp + (cond + ((!= (-> obj amp) 0.0) + (let* ((f30-0 (the float (- (-> pp clock frame-counter) (-> obj start-time)))) + (f0-2 (-> obj period)) + (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + ) + (when (>= (- f30-0 (-> obj ticks)) (-> obj period)) + (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) + (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) + (set! (-> obj ticks) f30-0) + (if (< (-> obj damp-period) 0.0) + (set-zero! obj) + ) + ) + (if (>= f30-0 (-> obj duration)) + (set-zero! obj) + ) + (* (sin (/ (* 65536.0 f28-0) (-> obj period))) + (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + ) + ) + ) + (else + 0.0 + ) + ) + ) + ) + +(defmethod get-no-update smush-control ((obj smush-control)) + (with-pp + (cond + ((!= (-> obj amp) 0.0) + (let* ((f30-0 (the float (- (-> pp clock frame-counter) (-> obj start-time)))) + (f0-2 (-> obj period)) + (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + ) + (* (sin (/ (* 65536.0 f0-4) (-> obj period))) + (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + ) + ) + ) + (else + 0.0 + ) + ) + ) + ) + +(defmethod die-on-next-update! smush-control ((obj smush-control)) + (if (!= (-> obj amp) 0.0) + (set! (-> obj damp-period) -1.0) + ) + obj + ) + +(defmethod activate! smush-control ((obj smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) + (when (>= (fabs (* 0.2 (-> obj amp))) (fabs (get-no-update obj))) + (set! (-> obj amp) arg0) + (set! (-> obj period) (the float arg1)) + (set! (-> obj duration) (the float arg2)) + (set! (-> obj damp-amp) arg3) + (set! (-> obj damp-period) arg4) + (set! (-> obj ticks) 0.0) + (set! (-> obj start-time) (-> arg5 frame-counter)) + ) + obj + ) + + + + diff --git a/goal_src/jak2/engine/util/sync-info-h.gc b/goal_src/jak2/engine/util/sync-info-h.gc index 99fbe4c546..099b3c8668 100644 --- a/goal_src/jak2/engine/util/sync-info-h.gc +++ b/goal_src/jak2/engine/util/sync-info-h.gc @@ -5,5 +5,164 @@ ;; name in dgo: sync-info-h ;; dgos: ENGINE, GAME -;; DECOMP BEGINS +(defenum sync-flags + :type uint64 + :bitfield #t + ) +;; DECOMP BEGINS +(deftype sync-info-params (structure) + ((sync-type basic :offset-assert 0) + (sync-flags sync-flags :offset-assert 8) + (entity basic :offset-assert 16) + (period uint32 :offset-assert 20) + (percent float :offset-assert 24) + (ease-in float :offset-assert 28) + (ease-out float :offset-assert 32) + (pause-in float :offset-assert 36) + (pause-out float :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +(deftype sync-info (structure) + ((sync-flags sync-flags :offset-assert 0) + (offset float :offset-assert 8) + (period uint32 :offset-assert 12) + ) + :method-count-assert 16 + :size-assert #x10 + :flag-assert #x1000000010 + (:methods + (sync-info-method-9 () none 9) + (sync-info-method-10 () none 10) + (sync-info-method-11 () none 11) + (sync-info-method-12 () none 12) + (sync-info-method-13 () none 13) + (sync-info-method-14 () none 14) + (sync-info-method-15 () none 15) + ) + ) + +(deftype sync-linear (sync-info) + () + :method-count-assert 16 + :size-assert #x10 + :flag-assert #x1000000010 + ) + +(deftype sync-eased (sync-info) + ((tlo float :offset-assert 16) + (thi float :offset-assert 20) + (ylo float :offset-assert 24) + (m2 float :offset-assert 28) + (yend float :offset-assert 32) + (pause-in float :offset-assert 36) + (pause-out float :offset-assert 40) + ) + :method-count-assert 16 + :size-assert #x2c + :flag-assert #x100000002c + ) + +(deftype sync-paused (sync-info) + ((pause-in float :offset-assert 16) + (pause-out float :offset-assert 20) + ) + :method-count-assert 16 + :size-assert #x18 + :flag-assert #x1000000018 + ) + +(deftype delayed-rand-float (structure) + ((min-time int32 :offset-assert 0) + (max-time int32 :offset-assert 4) + (max-val float :offset-assert 8) + (timer int32 :offset-assert 12) + (start-time time-frame :offset-assert 16) + (value float :offset-assert 24) + ) + :method-count-assert 13 + :size-assert #x1c + :flag-assert #xd0000001c + (:methods + (delayed-rand-float-method-9 () none 9) + (delayed-rand-float-method-10 () none 10) + (delayed-rand-float-method-11 () none 11) + (delayed-rand-float-method-12 () none 12) + ) + ) + +(deftype oscillating-float (structure) + ((value float :offset-assert 0) + (target float :offset-assert 4) + (vel float :offset-assert 8) + (max-vel float :offset-assert 12) + (damping float :offset-assert 16) + (accel float :offset-assert 20) + ) + :method-count-assert 11 + :size-assert #x18 + :flag-assert #xb00000018 + (:methods + (oscillating-float-method-9 () none 9) + (oscillating-float-method-10 () none 10) + ) + ) + +(deftype bouncing-float (structure) + ((osc oscillating-float :inline :offset-assert 0) + (max-value float :offset-assert 24) + (min-value float :offset-assert 28) + (elasticity float :offset-assert 32) + (state int32 :offset-assert 36) + ) + :method-count-assert 13 + :size-assert #x28 + :flag-assert #xd00000028 + (:methods + (bouncing-float-method-9 () none 9) + (bouncing-float-method-10 () none 10) + (bouncing-float-method-11 () none 11) + (bouncing-float-method-12 () none 12) + ) + ) + +(deftype delayed-rand-vector (structure) + ((min-time int32 :offset-assert 0) + (max-time int32 :offset-assert 4) + (xz-max float :offset-assert 8) + (y-max float :offset-assert 12) + (timer int32 :offset-assert 16) + (start-time time-frame :offset-assert 24) + (value vector :inline :offset-assert 32) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + (:methods + (delayed-rand-vector-method-9 () none 9) + (delayed-rand-vector-method-10 () none 10) + (delayed-rand-vector-method-11 () none 11) + (delayed-rand-vector-method-12 () none 12) + ) + ) + +(deftype oscillating-vector (structure) + ((value vector :inline :offset-assert 0) + (target vector :inline :offset-assert 16) + (vel vector :inline :offset-assert 32) + (max-vel float :offset-assert 48) + (damping float :offset-assert 52) + (accel float :offset-assert 56) + ) + :method-count-assert 11 + :size-assert #x3c + :flag-assert #xb0000003c + (:methods + (oscillating-vector-method-9 () none 9) + (oscillating-vector-method-10 () none 10) + ) + ) diff --git a/goal_src/jak2/engine/util/types-h.gc b/goal_src/jak2/engine/util/types-h.gc index 2705c8f5e0..9dc89f91c2 100644 --- a/goal_src/jak2/engine/util/types-h.gc +++ b/goal_src/jak2/engine/util/types-h.gc @@ -7,3 +7,75 @@ ;; DECOMP BEGINS +;; Appears to be unused. Possibly a particle ID? +(deftype part-id (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(defmacro s.w! (location value) + "Utility macro to store a 32-bit value at a given address. Performs _no_ type checking." + `(set! (-> (the-as (pointer uint32) ,location) 0) (the-as uint32 ,value)) + ) + +(defmacro l.wu (location) + "Load an unsigned 32-bit value from a given address. Performsn _no_ type checking." + `(-> (the-as (pointer uint32) ,location) 0) + ) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; Common Units +;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; in-game durations, distances, and rotations are stored in special formats. +;; these macros/constants convert from literals to the correct format. +;; for example, (meters 4.0) will give you a distance representing 4 in-game meters. + +;; meters are stored as (usually) a float, scaled by 4096. +;; this gives you reasonable accuracy as an integer. +(defglobalconstant METER_LENGTH 4096.0) + +(defmacro meters (x) + "Convert number to meters. + If the input is a constant float or integer, the result will be a + compile time constant float. Otherwise, it will not be constant. + Returns float." + + ;; we don't have enough constant propagation for the compiler to figure this out. + (cond + ((float? x) + (* METER_LENGTH x) + ) + ((integer? x) + (* METER_LENGTH x) + ) + (#t + `(* METER_LENGTH ,x) + ) + ) + ) + +;; rotations are stored in 65,536ths of a full rotation. +;; like with meters, you get a reasonable accuracy as an integer. +;; additionally, it is a power-of-two, so wrapping rotations can be done +;; quickly by converting to an int, masking, and back to float +(defglobalconstant DEGREES_PER_ROT 65536.0) + +;; this was deg in GOAL +(defmacro degrees (x) + "Convert number to degrees unit. + Will keep a constant float/int constant." + (cond + ((or (float? x) (integer? x)) + (* DEGREES_PER_ROT (/ (+ 0.0 x) 360.0)) + ) + (#t + `(* (/ (the float ,x) 360.0) + DEGREES_PER_ROT + ) + ) + ) + ) diff --git a/goal_src/jak2/kernel-defs.gc b/goal_src/jak2/kernel-defs.gc index ca43b8de88..876c723fa4 100644 --- a/goal_src/jak2/kernel-defs.gc +++ b/goal_src/jak2/kernel-defs.gc @@ -25,6 +25,19 @@ (fast-link 5) ) + +(defenum language-enum + :type int64 + (english) + (french) + (german) + (spanish) + (italian) + (japanese) + (korean) + (uk-english) + ) + ;; fixed symbols (define-extern #f symbol) (define-extern #t symbol) @@ -102,10 +115,30 @@ (define-extern __read-ee-timer (function uint)) (define-extern __mem-move (function pointer pointer uint none)) -(define-extern file-stream-read (function file-stream pointer int int)) (define-extern file-stream-open (function file-stream string symbol file-stream)) +(define-extern file-stream-close (function file-stream file-stream)) (define-extern file-stream-length (function file-stream int)) +(define-extern file-stream-seek (function file-stream int int int)) +(define-extern file-stream-read (function file-stream pointer int int)) +(define-extern file-stream-write (function file-stream pointer uint uint)) +(define-extern reset-path (function none)) + +(define-extern install-handler (function int function int)) +(define-extern flush-cache (function int none)) +(define-extern gs-store-image (function object object object)) +(define-extern sync-path (function int int int)) + +(define-extern kmalloc (function kheap int kmalloc-flags string pointer)) +(define-extern new-dynamic-structure (function symbol type int structure)) + +(define-extern mc-run (function none)) +(define-extern mc-check-result (function int)) +(declare-type mc-slot-info structure) +(define-extern mc-get-slot-info (function int mc-slot-info none)) +(define-extern rpc-busy? (function int uint)) +(define-extern rpc-call (function int uint uint uint int uint int uint)) +(define-extern string->symbol (function string symbol)) ;; PC stuff (defenum pc-prof-event diff --git a/goal_src/jak2/kernel/gstate.gc b/goal_src/jak2/kernel/gstate.gc index c43e646dc8..0c06b6d160 100644 --- a/goal_src/jak2/kernel/gstate.gc +++ b/goal_src/jak2/kernel/gstate.gc @@ -509,5 +509,14 @@ It type checks the arguments for the entry function. ) - +(defmacro send-event (proc msg &key (from (with-pp pp)) &rest params) + "Send an event to a process. This should be used over send-event-function" + `(let ((event-data (new 'stack-no-clear 'event-message-block))) + (set! (-> event-data from) (process->ppointer ,from)) + (set! (-> event-data num-params) ,(length params)) + (set! (-> event-data message) ,msg) + ,@(apply-i (lambda (x i) `(set! (-> event-data param ,i) (the-as uint ,x))) params) + (send-event-function ,proc event-data) + ) + ) diff --git a/goal_src/jak2/kernel/pskernel.gc b/goal_src/jak2/kernel/pskernel.gc index dff343339f..7b30e20d27 100644 --- a/goal_src/jak2/kernel/pskernel.gc +++ b/goal_src/jak2/kernel/pskernel.gc @@ -5,3 +5,8 @@ ;; name in dgo: pskernel ;; dgos: KERNEL +;; in the original game, they had ways to hook into the PS2's kernel and install +;; debug handlers. This file had utilities to read/write kernel memory deal with +;; R5900 exceptions. +;; This file contained an error string referencing an additional +;; debug-handlers.gc, which probably contained the actual interesting handlers. diff --git a/goal_src/jak2/levels/city/common/trail-h.gc b/goal_src/jak2/levels/city/common/trail-h.gc index fa1fba3fdc..ef69e4f684 100644 --- a/goal_src/jak2/levels/city/common/trail-h.gc +++ b/goal_src/jak2/levels/city/common/trail-h.gc @@ -7,3 +7,154 @@ ;; DECOMP BEGINS +(deftype trail-node (structure) + ((next-id int16 :offset-assert 0) + (prev-id int16 :offset-assert 2) + (parent-id int16 :offset-assert 4) + (x int16 :offset-assert 6) + (z int16 :offset-assert 8) + (first-conn uint16 :offset-assert 10) + (cost-from-start uint16 :offset-assert 12) + (cost-to-goal uint16 :offset-assert 14) + (flags uint8 :offset-assert 16) + (conn-count uint8 :offset-assert 17) + ) + :method-count-assert 12 + :size-assert #x12 + :flag-assert #xc00000012 + (:methods + (trail-node-method-9 () none 9) + (trail-node-method-10 () none 10) + (trail-node-method-11 () none 11) + ) + ) + + +(deftype trail-visgroup (structure) + ((first-node uint16 :offset-assert 0) + (node-count uint8 :offset-assert 2) + (pad uint8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + + +(deftype trail-conn (structure) + ((head-id uint16 :offset-assert 0) + (tail-id uint16 :offset-assert 2) + (flags uint8 :offset-assert 4) + (visgroup-id uint8 :offset-assert 5) + (cost uint16 :offset-assert 6) + ) + :method-count-assert 10 + :size-assert #x8 + :flag-assert #xa00000008 + (:methods + (trail-conn-method-9 () none 9) + ) + ) + +(deftype trail-conn-hash-cell (structure) + ((first-conn uint16 :offset-assert 0) + (conn-count uint8 :offset-assert 2) + (pad uint8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +(deftype trail-conn-search (structure) + ((best-conn-id int32 :offset-assert 0) + (best-dist float :offset-assert 4) + (src-pos vector :offset-assert 8) + (conn-pos vector :offset-assert 12) + (debug-cells-searched int32 :offset-assert 16) + (debug-conns-searched int32 :offset-assert 20) + (bounds bounding-box4w :inline :offset-assert 32) + (cell-quads qword 2 :inline :offset-assert 64) + (conn-quads qword 7 :inline :offset-assert 96) + (cell-bits vector16ub 2 :inline :offset 64) + ) + :method-count-assert 9 + :size-assert #xd0 + :flag-assert #x9000000d0 + ) + +(deftype trail-conn-hash (basic) + ((cell-width meters :offset-assert 4) + (origin vector :inline :offset-assert 16) + (cell uint32 :offset-assert 32) + (conn-ids uint32 :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +(deftype trail-cached-search-info (structure) + ((goal-conn-id int16 :offset-assert 0) + (orig-goal-pos vector :inline :offset-assert 16) + (conn-goal-pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +(deftype trail-graph (basic) + ((mode uint8 :offset-assert 4) + (search-id uint32 :offset-assert 8) + (open-head-id int16 :offset-assert 12) + (goal-conn-id int16 :offset-assert 14) + (goal-node-id int16 :offset-assert 16) + (node-count uint16 :offset-assert 18) + (conn-count uint16 :offset-assert 20) + (conn-mask uint8 :offset-assert 22) + (node uint32 :offset-assert 24) + (conn uint32 :offset-assert 28) + (conn-ids uint32 :offset-assert 32) + (visgroup uint32 :offset-assert 36) + (visnode-ids uint32 :offset-assert 40) + (conn-hash basic :offset-assert 44) + (orig-start-pos vector :inline :offset-assert 48) + (orig-goal-pos vector :inline :offset-assert 64) + (conn-start-pos vector :inline :offset-assert 80) + (conn-goal-pos vector :inline :offset-assert 96) + (open-quads qword 6 :inline :offset-assert 112) + (closed-quads qword 6 :inline :offset-assert 208) + ) + :method-count-assert 29 + :size-assert #x130 + :flag-assert #x1d00000130 + (:methods + (trail-graph-method-9 () none 9) + (trail-graph-method-10 () none 10) + (trail-graph-method-11 () none 11) + (trail-graph-method-12 () none 12) + (trail-graph-method-13 () none 13) + (trail-graph-method-14 () none 14) + (trail-graph-method-15 () none 15) + (trail-graph-method-16 () none 16) + (trail-graph-method-17 () none 17) + (trail-graph-method-18 () none 18) + (trail-graph-method-19 () none 19) + (trail-graph-method-20 () none 20) + (trail-graph-method-21 () none 21) + (trail-graph-method-22 () none 22) + (trail-graph-method-23 () none 23) + (trail-graph-method-24 () none 24) + (trail-graph-method-25 () none 25) + (trail-graph-method-26 () none 26) + (trail-graph-method-27 () none 27) + (trail-graph-method-28 () none 28) + ) + ) + +(define *trail-graph* (the-as trail-graph #f)) + + + + diff --git a/scripts/decomp_progress.py b/scripts/decomp_progress.py index c63dde71e7..755f2b9757 100644 --- a/scripts/decomp_progress.py +++ b/scripts/decomp_progress.py @@ -62,7 +62,7 @@ def main(): total_gc_files += 1 - if line_count == 7 or short_name in excluded_files: + if line_count < 10 or short_name in excluded_files: # the template has 7 lines, just skip it. continue diff --git a/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc new file mode 100644 index 0000000000..885f764838 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ai/traffic-h_REF.gc @@ -0,0 +1,135 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *traffic-manager*, type process +(define *traffic-manager* (the-as process #f)) + +;; definition for symbol *ctywide-entity*, type object +(define *ctywide-entity* (the-as object #f)) + +;; definition for symbol *lwide-entity*, type object +(define *lwide-entity* (the-as object #f)) + +;; definition for symbol *race-vehicle-entity*, type object +(define *race-vehicle-entity* (the-as object #f)) + +;; definition of type traffic-danger-info +(deftype traffic-danger-info (structure) + ((sphere sphere :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (handle uint64 :offset-assert 32) + (notify-radius float :offset-assert 40) + (danger-level float :offset-assert 44) + (decay-rate float :offset-assert 48) + (flags uint8 :offset-assert 52) + (danger-type uint8 :offset-assert 53) + ) + :method-count-assert 9 + :size-assert #x36 + :flag-assert #x900000036 + ) + +;; definition for method 3 of type traffic-danger-info +(defmethod inspect traffic-danger-info ((obj traffic-danger-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'traffic-danger-info) + (format #t "~1Tsphere: #~%" (-> obj sphere)) + (format #t "~1Tvelocity: #~%" (-> obj velocity)) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Tnotify-radius: ~f~%" (-> obj notify-radius)) + (format #t "~1Tdanger-level: ~f~%" (-> obj danger-level)) + (format #t "~1Tdecay-rate: ~f~%" (-> obj decay-rate)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tdanger-type: ~D~%" (-> obj danger-type)) + (label cfg-4) + obj + ) + +;; definition of type traffic-suppression-params +(deftype traffic-suppression-params (structure) + ((bbox bounding-box :inline :offset-assert 0) + (duration uint64 :offset-assert 32) + (id int8 :offset-assert 40) + ) + :method-count-assert 13 + :size-assert #x29 + :flag-assert #xd00000029 + (:methods + (traffic-suppression-params-method-9 () none 9) + (traffic-suppression-params-method-10 () none 10) + (has-valid-id? (_type_) none 11) + (traffic-suppression-params-method-12 () none 12) + ) + ) + +;; definition for method 3 of type traffic-suppression-params +(defmethod inspect traffic-suppression-params ((obj traffic-suppression-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'traffic-suppression-params) + (format #t "~1Tbbox: #~%" (-> obj bbox)) + (format #t "~1Tduration: ~D~%" (-> obj duration)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition for method 11 of type traffic-suppression-params +;; INFO: Return type mismatch symbol vs none. +(defmethod has-valid-id? traffic-suppression-params ((obj traffic-suppression-params)) + (!= (-> obj id) -1) + (none) + ) + +;; definition of type traffic-object-spawn-params +(deftype traffic-object-spawn-params (structure) + ((object-type uint8 :offset-assert 0) + (behavior uint64 :offset-assert 8) + (id uint32 :offset-assert 16) + (nav-mesh basic :offset-assert 20) + (nav-branch basic :offset-assert 24) + (position vector :inline :offset-assert 32) + (rotation quaternion :inline :offset-assert 48) + (velocity vector :inline :offset-assert 64) + (handle uint64 :offset-assert 80) + (guard-type uint8 :offset-assert 88) + (user-data uint32 :offset-assert 92) + (flags uint32 :offset-assert 96) + (proc basic :offset-assert 100) + ) + :method-count-assert 9 + :size-assert #x68 + :flag-assert #x900000068 + ) + +;; definition for method 3 of type traffic-object-spawn-params +(defmethod inspect traffic-object-spawn-params ((obj traffic-object-spawn-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'traffic-object-spawn-params) + (format #t "~1Tobject-type: ~D~%" (-> obj object-type)) + (format #t "~1Tbehavior: ~D~%" (-> obj behavior)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tnav-mesh: ~A~%" (-> obj nav-mesh)) + (format #t "~1Tnav-branch: ~A~%" (-> obj nav-branch)) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Trotation: #~%" (-> obj rotation)) + (format #t "~1Tvelocity: #~%" (-> obj velocity)) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Tguard-type: ~D~%" (-> obj guard-type)) + (format #t "~1Tuser-data: ~D~%" (-> obj user-data)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tproc: ~A~%" (-> obj proc)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc new file mode 100644 index 0000000000..20569dabde --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ambient/ambient-h_REF.gc @@ -0,0 +1,1038 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type talker-speech-class +(deftype talker-speech-class (structure) + ((name string :offset-assert 0) + (channel uint8 :offset-assert 4) + (flags uint8 :offset-assert 5) + (speech uint16 :offset-assert 6) + (text-message uint32 :offset-assert 8) + (text-duration uint16 :offset-assert 12) + (delay uint16 :offset-assert 14) + (pos uint16 :offset-assert 16) + (neg uint16 :offset-assert 18) + (on-close basic :offset-assert 20) + ) + :pack-me + :method-count-assert 14 + :size-assert #x18 + :flag-assert #xe00000018 + (:methods + (talker-speech-class-method-9 () none 9) + (talker-speech-class-method-10 () none 10) + (talker-speech-class-method-11 () none 11) + (talker-speech-class-method-12 () none 12) + (talker-speech-class-method-13 () none 13) + ) + ) + +;; definition for method 3 of type talker-speech-class +(defmethod inspect talker-speech-class ((obj talker-speech-class)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'talker-speech-class) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tchannel: ~D~%" (-> obj channel)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tspeech: ~D~%" (-> obj speech)) + (format #t "~1Ttext-message: ~D~%" (-> obj text-message)) + (format #t "~1Ttext-duration: ~D~%" (-> obj text-duration)) + (format #t "~1Tdelay: ~D~%" (-> obj delay)) + (format #t "~1Tpos: ~D~%" (-> obj pos)) + (format #t "~1Tneg: ~D~%" (-> obj neg)) + (format #t "~1Ton-close: ~A~%" (-> obj on-close)) + (label cfg-4) + obj + ) + +;; definition of type talker +(deftype talker (process) + ((trans vector :inline :offset-assert 128) + (message talker-speech-class :offset-assert 144) + (total-time time-frame :offset-assert 152) + (total-off-time time-frame :offset-assert 160) + (start-time time-frame :offset-assert 168) + (state-time time-frame :offset-assert 176) + (voicebox uint64 :offset-assert 184) + (voice-id uint32 :offset-assert 192) + (message-id uint32 :offset-assert 196) + (region region :offset-assert 200) + (interp float :offset-assert 204) + (save? basic :offset-assert 208) + ) + :heap-base #x60 + :method-count-assert 18 + :size-assert #xd4 + :flag-assert #x12006000d4 + (:methods + (talker-method-14 () none 14) + (talker-method-15 () none 15) + (talker-method-16 () none 16) + (talker-method-17 () none 17) + ) + ) + +;; definition for method 3 of type talker +(defmethod inspect talker ((obj talker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Ttrans: ~`vector`P~%" (-> obj stack)) + (format #t "~2Tmessage: #~%" (-> obj message)) + (format #t "~2Ttotal-time: ~D~%" (-> obj total-time)) + (format #t "~2Ttotal-off-time: ~D~%" (-> obj total-off-time)) + (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tvoicebox: ~D~%" (-> obj voicebox)) + (format #t "~2Tvoice-id: ~D~%" (-> obj voice-id)) + (format #t "~2Tmessage-id: ~D~%" (-> obj message-id)) + (format #t "~2Tregion: #~%" (-> obj region)) + (format #t "~2Tinterp: ~f~%" (-> obj interp)) + (format #t "~2Tsave?: ~A~%" (-> obj save?)) + (label cfg-4) + obj + ) + +;; definition for symbol *talker-speech*, type talker-speech-class +(define *talker-speech* + (the-as talker-speech-class + (new 'static 'inline-array talker-speech-class 188 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class :name "hal001" :channel #x1d :flags #x3 :speech #x1 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "hal002" :channel #x1d :flags #x3 :speech #x2 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "DSbop002" + :channel #x14 + :flags #x3 + :speech #x3 + :text-message #x224 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop004" + :channel #x14 + :flags #x3 + :speech #x4 + :text-message #x226 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSbop008" + :channel #x14 + :flags #x3 + :speech #x5 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "DSbop009" :channel #x14 :flags #x3 :speech #x6 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "DSbop010" + :channel #x14 + :flags #x3 + :speech #x7 + :text-message #x227 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "DSbop011" :channel #x14 :flags #x3 :speech #x8 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "DSbop016" + :channel #x14 + :flags #x3 + :speech #x9 + :text-message #x229 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "DSbop017" :channel #x14 :flags #x3 :speech #xa :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ds020" + :channel #x14 + :flags #x3 + :speech #xb + :text-message #x225 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043" + :channel #x14 + :flags #x11 + :speech #xc + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds043m" + :channel #x43 + :flags #x10 + :speech #xd + :text-message #x228 + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046" + :channel #x14 + :flags #x11 + :speech #xe + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds046m" + :channel #x43 + :flags #x10 + :speech #xf + :text-message #x22a + :text-duration #x12c + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds162" :channel #x14 :flags #x3 :speech #x10 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds165" :channel #x14 :flags #x3 :speech #x11 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv039" + :channel #x20 + :flags #x3 + :speech #x12 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv037" + :channel #x20 + :flags #x3 + :speech #x13 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv056" + :channel #x20 + :flags #x3 + :speech #x14 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv054" + :channel #x20 + :flags #x3 + :speech #x15 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv055" + :channel #x20 + :flags #x3 + :speech #x16 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv107" + :channel #x20 + :flags #x3 + :speech #x17 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "kg100a" :channel #x20 :flags #x3 :speech #x18 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg104a" :channel #x20 :flags #x3 :speech #x19 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg102a" :channel #x20 :flags #x3 :speech #x1a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg071a" :channel #x20 :flags #x3 :speech #x1b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg107a" :channel #x20 :flags #x3 :speech #x1c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg097a" :channel #x20 :flags #x3 :speech #x1d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "kg098a" :channel #x20 :flags #x3 :speech #x1e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv063" :channel #x20 :speech #x1f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv064" :channel #x20 :speech #x20 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv065" :channel #x20 :speech #x21 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv067" :channel #x20 :speech #x22 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv068" :channel #x20 :speech #x23 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv069" + :channel #x20 + :speech #x24 + :text-message #x246 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "cityv070" :channel #x20 :speech #x25 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv130" + :channel #x1d + :flags #x3 + :speech #x26 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "cityv132" + :channel #x1d + :flags #x3 + :speech #x27 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "cityv071" :channel #x20 :speech #x28 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv072" :channel #x20 :speech #x29 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv073" :channel #x20 :speech #x2a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv074" :channel #x20 :speech #x2b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv075" :channel #x20 :speech #x2c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv076" :channel #x20 :speech #x2d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv077" :channel #x20 :speech #x2e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv078" :channel #x20 :speech #x2f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "cityv036" :channel #x20 :speech #x30 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "tor007" :channel #x1d :flags #x3 :speech #x31 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "tor008" :channel #x1d :flags #x3 :speech #x32 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "mess004" + :channel #x43 + :flags #x7 + :speech #x33 + :text-message #x245 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew010" + :channel #x1d + :flags #x7 + :speech #x34 + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds129" :channel #x14 :flags #x2 :speech #x35 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "mess005" + :channel #x43 + :flags #x3 + :speech #x36 + :text-message #x247 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "mess006" + :channel #x43 + :speech #x37 + :text-message #x226 + :text-duration #x5dc + :pos #x8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds116" :channel #x14 :flags #x2 :speech #x38 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds117" :channel #x14 :flags #x3 :speech #x39 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds118" :channel #x14 :flags #x3 :speech #x3a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds119" :channel #x14 :flags #x3 :speech #x3b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds120" :channel #x14 :flags #x3 :speech #x3c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds121" :channel #x14 :flags #x3 :speech #x3d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm007" :channel #x14 :flags #x3 :speech #x3e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm008" :channel #x14 :flags #x3 :speech #x3f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm009" :channel #x14 :flags #x3 :speech #x40 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "daxm010" :channel #x14 :flags #x3 :speech #x41 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "pek001" + :channel #x1d + :flags #x3 + :speech #x42 + :delay #x4b0 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds006" + :channel #x14 + :flags #x3 + :speech #x43 + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds029" :channel #x14 :flags #x2 :speech #x44 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds030" :channel #x14 :flags #x2 :speech #x45 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds031" :channel #x14 :flags #x2 :speech #x46 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds032" :channel #x14 :flags #x2 :speech #x47 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ds007" + :channel #x14 + :flags #x3 + :speech #x48 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds372" :channel #x14 :flags #x3 :speech #x49 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "vin011" + :channel #x1d + :flags #x3 + :speech #x4a + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds009" :channel #x14 :flags #x3 :speech #x4b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "demo001" + :channel #x43 + :flags #x3 + :speech #x4c + :text-message #x23d + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo002" + :channel #x43 + :flags #x3 + :speech #x4d + :text-message #x22b + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo003" + :channel #x43 + :flags #x3 + :speech #x4e + :text-message #x252 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo004" + :channel #x43 + :flags #x3 + :speech #x4f + :text-message #x253 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "demo005" + :channel #x43 + :flags #x3 + :speech #x50 + :text-message #x226 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei026" + :channel #x1d + :flags #x3 + :speech #x51 + :delay #x1770 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kei018" + :channel #x1d + :flags #x3 + :speech #x52 + :text-message #x241 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "DSfor001" + :channel #x14 + :flags #x3 + :speech #x53 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds017" :channel #x14 :flags #x3 :speech #x54 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds018" :channel #x14 :flags #x3 :speech #x55 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds019" :channel #x14 :flags #x3 :speech #x56 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds350" :channel #x14 :flags #x2 :speech #x57 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "ds016" :channel #x14 :flags #x3 :speech #x58 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "sigf001" :channel #x1d :flags #x7 :speech #x59 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ys001" + :channel #x1d + :flags #x7 + :speech #x5a + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ds151" + :channel #x14 + :flags #x7 + :speech #x5b + :text-message #x239 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "vin002" :channel #x1d :flags #x7 :speech #x5c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "krew001" :channel #x1d :flags #x3 :speech #x5d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "krew002" + :channel #x1d + :flags #x7 + :speech #x5e + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds005" :channel #x14 :flags #x3 :speech #x5f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bru001" :channel #x1d :flags #x3 :speech #x60 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "tor001" + :channel #x1d + :flags #x7 + :speech #x61 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "tor002" + :channel #x1d + :flags #x7 + :speech #x62 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin003" + :channel #x1d + :flags #x7 + :speech #x63 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin004" + :channel #x1d + :flags #x3 + :speech #x64 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor001" + :channel #x1d + :flags #x7 + :speech #x65 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "kor002" + :channel #x1d + :flags #x7 + :speech #x66 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "tess001" :channel #x1d :flags #x7 :speech #x67 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "whack01" + :channel #x43 + :speech #x68 + :text-message #x24e + :text-duration #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "vin015" + :channel #x1d + :flags #x7 + :speech #x69 + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "kei029" :channel #x1d :flags #x7 :speech #x6a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "tor005" :channel #x1d :flags #x7 :speech #x6b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "vin013" :channel #x1d :flags #x7 :speech #x6c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "asht006" :channel #x1d :flags #x7 :speech #x6d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "pek002" + :channel #x1d + :flags #x3 + :speech #x6e + :delay #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "test001" + :channel #x43 + :speech #x6f + :text-message #x23d + :text-duration #x2328 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "sam001" :channel #x1d :flags #x3 :speech #x70 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "asht001" + :channel #x1d + :flags #x3 + :speech #x71 + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str001" + :channel #x43 + :flags #x3 + :speech #x72 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "str002" + :channel #x43 + :speech #x73 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "note001" + :channel #x44 + :speech #x74 + :text-message #x239 + :text-duration #x960 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ys002" :channel #x1d :flags #x3 :speech #x75 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "intro01" + :channel #x44 + :flags #x20 + :speech #x76 + :text-message #x254 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01e" + :channel #x44 + :flags #x20 + :speech #x77 + :text-message #x255 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01j" + :channel #x44 + :flags #x20 + :speech #x78 + :text-message #x257 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro01k" + :channel #x44 + :flags #x20 + :speech #x79 + :text-message #x256 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro02" + :channel #x44 + :flags #xa0 + :speech #x7a + :text-message #x258 + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro03" + :channel #x47 + :speech #x7b + :text-message #x30c + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "intro04" + :channel #x44 + :flags #x20 + :speech #x7c + :text-message #x25a + :text-duration #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss001" + :channel #x20 + :flags #x40 + :speech #x7d + :text-message #x25c + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss002" + :channel #x20 + :flags #x40 + :speech #x7e + :text-message #x261 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss003" + :channel #x20 + :flags #x40 + :speech #x7f + :text-message #x262 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss004" + :channel #x20 + :flags #x40 + :speech #x80 + :text-message #x263 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss005" + :channel #x20 + :flags #x40 + :speech #x81 + :text-message #x264 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss006" + :channel #x20 + :flags #x40 + :speech #x82 + :text-message #x265 + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss007" + :channel #x20 + :flags #x40 + :speech #x83 + :text-message #x266 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss008" + :channel #x20 + :flags #x40 + :speech #x84 + :text-message #x267 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss009" + :channel #x20 + :flags #x40 + :speech #x85 + :text-message #x268 + :text-duration #x5dc + :delay #xbb8 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss010" + :channel #x20 + :flags #x40 + :speech #x86 + :text-message #x269 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss011" + :channel #x20 + :flags #x40 + :speech #x87 + :text-message #x25d + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss012" + :channel #x20 + :flags #x40 + :speech #x88 + :text-message #x25e + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss013" + :channel #x20 + :flags #x40 + :speech #x89 + :text-message #x25f + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "miss014" + :channel #x20 + :flags #x40 + :speech #x8a + :text-message #x260 + :text-duration #x5dc + :delay #x384 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "krew003" + :channel #x1d + :flags #x3 + :speech #x8b + :delay #x708 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "pek010" :channel #x14 :flags #x1 :speech #x8c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek011" :channel #x14 :flags #x1 :speech #x8d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek012" :channel #x14 :flags #x1 :speech #x8e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek013" :channel #x14 :flags #x1 :speech #x8f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek014" :channel #x14 :flags #x1 :speech #x90 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek015" :channel #x14 :speech #x91 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek016" :channel #x14 :flags #x1 :speech #x92 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek017" :channel #x14 :flags #x1 :speech #x93 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek018" :channel #x14 :flags #x1 :speech #x94 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek019" :channel #x14 :flags #x1 :speech #x95 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek020" :channel #x14 :flags #x1 :speech #x96 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek021" :channel #x14 :flags #x1 :speech #x97 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek022" :channel #x14 :flags #x1 :speech #x98 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek023" :channel #x14 :flags #x1 :speech #x99 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek024" :channel #x14 :flags #x1 :speech #x9a :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek026" :channel #x14 :flags #x1 :speech #x9b :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek027" :channel #x14 :flags #x1 :speech #x9c :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek028" :channel #x14 :flags #x1 :speech #x9d :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek029" :channel #x14 :flags #x1 :speech #x9e :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek030" :channel #x14 :flags #x1 :speech #x9f :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek031" :channel #x14 :flags #x1 :speech #xa0 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek033" :channel #x14 :speech #xa1 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek034" :channel #x14 :speech #xa2 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek035" :channel #x14 :speech #xa3 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek036" :channel #x14 :speech #xa4 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek037" :channel #x14 :speech #xa5 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek038" :channel #x14 :speech #xa6 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek039" :channel #x14 :speech #xa7 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek040" :channel #x14 :speech #xa8 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "pek041" :channel #x14 :speech #xa9 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "ora006" + :channel #x20 + :speech #xaa + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora007" + :channel #x20 + :speech #xab + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora008" + :channel #x20 + :speech #xac + :text-message #x26e + :text-duration #x5dc + :delay #x258 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora009" + :channel #x20 + :speech #xad + :text-message #x26f + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora010" + :channel #x20 + :speech #xae + :text-message #x270 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora015" + :channel #x20 + :speech #xaf + :text-message #x271 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "ora016" + :channel #x20 + :speech #xb0 + :text-message #x272 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice01" + :channel #x47 + :speech #xb1 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice02" + :channel #x47 + :speech #xb2 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice03" + :channel #x47 + :speech #xb3 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class + :name "notice04" + :channel #x47 + :speech #xb4 + :text-duration #x5dc + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "kor004" :channel #x1d :flags #x3 :speech #xb5 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "cityv080" + :channel #x20 + :flags #x2 + :speech #xb6 + :neg #x1 + :on-close #f + ) + (new 'static 'talker-speech-class :name "ds395" :channel #x20 :flags #x2 :speech #xb7 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bru002" :channel #x1d :flags #x3 :speech #xb8 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bru004" :channel #x1d :flags #x7 :speech #xb9 :neg #x1 :on-close #f) + (new 'static 'talker-speech-class :name "bb01int" :channel #x22 :flags #x2 :speech #xba :neg #x1 :on-close #f) + (new 'static 'talker-speech-class + :name "bb01fail" + :channel #x1d + :flags #x2 + :speech #xbb + :neg #x1 + :on-close #f + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc new file mode 100644 index 0000000000..a99afd1433 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/anim/aligner-h_REF.gc @@ -0,0 +1,64 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type align-control +(deftype align-control (basic) + ((flags align-flags :offset-assert 4) + (process process-drawable :offset-assert 8) + (frame-group art-joint-anim :offset-assert 12) + (frame-num float :offset-assert 16) + (matrix matrix 2 :inline :offset-assert 32) + (transform transform 2 :inline :offset-assert 160) + (delta transformq :inline :offset-assert 256) + (last-speed meters :offset-assert 304) + (align transformq :inline :offset 160) + ) + :method-count-assert 14 + :size-assert #x134 + :flag-assert #xe00000134 + (:methods + (new (symbol type process) _type_ 0) + (align-control-method-9 () none 9) + (align-control-method-10 () none 10) + (align-control-method-11 () none 11) + (align-control-method-12 () none 12) + (align-control-method-13 () none 13) + ) + ) + +;; definition for method 3 of type align-control +(defmethod inspect align-control ((obj align-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: #x~X~%" (-> obj flags)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tframe-group: ~A~%" (-> obj frame-group)) + (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) + (format #t "~1Tmatrix[2] @ #x~X~%" (-> obj matrix)) + (format #t "~1Ttransform[2] @ #x~X~%" (-> obj transform)) + (format #t "~1Tdelta: #~%" (-> obj delta)) + (format #t "~1Tlast-speed: (meters ~m)~%" (-> obj last-speed)) + (format #t "~1Talign: #~%" (-> obj transform)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type align-control +;; INFO: Return type mismatch object vs align-control. +(defmethod new align-control ((allocation symbol) (type-to-make type) (arg0 process)) + (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? obj) + (go process-drawable-art-error "memory") + (return (the-as align-control 0)) + ) + (set! (-> obj process) (the-as process-drawable arg0)) + (the-as align-control obj) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc new file mode 100644 index 0000000000..bbb21f055a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/anim/joint-h_REF.gc @@ -0,0 +1,345 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint-control-channel +(deftype joint-control-channel (structure) + ((parent joint-control :offset-assert 0) + (frame-group art-joint-anim :offset-assert 4) + (frame-num float :offset-assert 8) + (dist meters :offset-assert 12) + (num-func (function joint-control-channel float float float) :offset-assert 16) + (param float 3 :offset-assert 20) + (frame-interp float 2 :offset-assert 32) + (inspector-amount uint8 :offset-assert 40) + (command joint-control-command :offset-assert 48) + (group-sub-index int8 :offset-assert 56) + (grou-size int8 :offset-assert 57) + (eval-time uint32 :offset-assert 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type joint-control-channel +(defmethod inspect joint-control-channel ((obj joint-control-channel)) + (when (not obj) + (set! obj obj) + (goto cfg-23) + ) + (format #t "[~8x] ~A~%" obj 'joint-control-channel) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Tframe-group: ~A~%" (-> obj frame-group)) + (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) + (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) + (format #t "~1Tnum-func: ~A~%" (-> obj num-func)) + (format #t "~1Tparam[3] @ #x~X~%" (-> obj param)) + (dotimes (s5-0 3) + (format #t "~T [~D]~1Tparam: ~`float`P~%" s5-0 (-> obj param s5-0)) + ) + (format #t "~1Tframe-interp[2] @ #x~X~%" (-> obj frame-interp)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tframe-interp: ~`float`P~%" s5-1 (-> obj frame-interp s5-1)) + ) + (format #t "~1Tinspector-amount: ~D~%" (-> obj inspector-amount)) + (let ((t9-11 format) + (a0-12 #t) + (a1-11 "~1Tcommand: #x~X : ~S~%") + (a2-11 (-> obj command)) + (v1-10 (-> obj command)) + ) + (t9-11 a0-12 a1-11 a2-11 (cond + ((= v1-10 (joint-control-command stack1)) + "stack1" + ) + ((= v1-10 (joint-control-command push)) + "push" + ) + ((= v1-10 (joint-control-command blend)) + "blend" + ) + ((= v1-10 (joint-control-command push1)) + "push1" + ) + ((= v1-10 (joint-control-command float)) + "float" + ) + ((= v1-10 (joint-control-command stack)) + "stack" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tgroup-sub-index: ~D~%" (-> obj group-sub-index)) + (format #t "~1Tgroup-size: ~D~%" (-> obj grou-size)) + (format #t "~1Teval-time: ~D~%" (-> obj eval-time)) + (label cfg-23) + obj + ) + +;; definition of type top-anim-joint-control +(deftype top-anim-joint-control (basic) + ((process uint32 :offset-assert 4) + (interp-select uint64 2 :offset-assert 8) + (base-anim basic :offset-assert 24) + (base-anim-speed float :offset-assert 28) + (base-anim-blend float :offset-assert 32) + (interp float :offset-assert 36) + (frame-group basic :offset-assert 40) + (frame-group-push basic :offset-assert 44) + (frame-num float :offset-assert 48) + (frame-targ basic :offset-assert 52) + (frame-speed float :offset-assert 56) + (frame-blend float :offset-assert 60) + (frame-cur-blend float :offset-assert 64) + (frame-start float :offset-assert 68) + (frame-post-blend float :offset-assert 72) + (frame-post-end float :offset-assert 76) + (frame-push-time time-frame :offset-assert 80) + (frame-post-put-away basic :offset-assert 88) + (update-time time-frame :offset-assert 96) + ) + :method-count-assert 13 + :size-assert #x68 + :flag-assert #xd00000068 + (:methods + (top-anim-joint-control-method-9 () none 9) + (top-anim-joint-control-method-10 () none 10) + (top-anim-joint-control-method-11 () none 11) + (top-anim-joint-control-method-12 () none 12) + ) + ) + +;; definition for method 3 of type top-anim-joint-control +(defmethod inspect top-anim-joint-control ((obj top-anim-joint-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: #x~X~%" (-> obj process)) + (format #t "~1Tinterp-select[2] @ #x~X~%" (-> obj interp-select)) + (format #t "~1Tbase-anim: ~A~%" (-> obj base-anim)) + (format #t "~1Tbase-anim-speed: ~f~%" (-> obj base-anim-speed)) + (format #t "~1Tbase-anim-blend: ~f~%" (-> obj base-anim-blend)) + (format #t "~1Tinterp: ~f~%" (-> obj interp)) + (format #t "~1Tframe-group: ~A~%" (-> obj frame-group)) + (format #t "~1Tframe-group-push: ~A~%" (-> obj frame-group-push)) + (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) + (format #t "~1Tframe-targ: ~A~%" (-> obj frame-targ)) + (format #t "~1Tframe-speed: ~f~%" (-> obj frame-speed)) + (format #t "~1Tframe-blend: ~f~%" (-> obj frame-blend)) + (format #t "~1Tframe-cur-blend: ~f~%" (-> obj frame-cur-blend)) + (format #t "~1Tframe-start: ~f~%" (-> obj frame-start)) + (format #t "~1Tframe-post-blend: ~f~%" (-> obj frame-post-blend)) + (format #t "~1Tframe-post-end: ~f~%" (-> obj frame-post-end)) + (format #t "~1Tframe-push-time: ~D~%" (-> obj frame-push-time)) + (format #t "~1Tframe-post-put-away: ~A~%" (-> obj frame-post-put-away)) + (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) + (label cfg-4) + obj + ) + +;; definition of type joint-control +(deftype joint-control (basic) + ((status joint-control-status :offset-assert 4) + (allocated-length uint8 :offset-assert 6) + (active-channels uint8 :offset-assert 7) + (root-channel uint32 :offset 16) + (blend-index uint8 :offset-assert 20) + (active-frame-interp uint8 :offset-assert 21) + (float-channels uint8 :offset-assert 22) + (generate-frame-function function :offset-assert 24) + (prebind-function function :offset-assert 28) + (postbind-function function :offset-assert 32) + (effect basic :offset-assert 36) + (interp-select int64 2 :offset-assert 40) + (top-anim basic :offset-assert 56) + (override basic :offset-assert 60) + (channel joint-control-channel :inline :dynamic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + (:methods + (joint-control-method-9 () none 9) + (joint-control-method-10 () none 10) + (joint-control-method-11 () none 11) + ) + ) + +;; definition for method 3 of type joint-control +(defmethod inspect joint-control ((obj joint-control)) + (when (not obj) + (set! obj obj) + (goto cfg-28) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tstatus: #x~X : (joint-control-status " (-> obj status)) + (let ((s5-0 (-> obj status))) + (if (= (logand s5-0 (joint-control-status blend-shape)) (joint-control-status blend-shape)) + (format #t "blend-shape ") + ) + (if (= (logand s5-0 (joint-control-status valid-spooled-frame)) (joint-control-status valid-spooled-frame)) + (format #t "valid-spooled-frame ") + ) + (if (= (logand s5-0 (joint-control-status spooling-not-last-block)) + (joint-control-status spooling-not-last-block) + ) + (format #t "spooling-not-last-block ") + ) + (if (= (logand s5-0 (joint-control-status eye-anim)) (joint-control-status eye-anim)) + (format #t "eye-anim ") + ) + (if (= (logand s5-0 (joint-control-status math-when-off-screen)) (joint-control-status math-when-off-screen)) + (format #t "math-when-off-screen ") + ) + (if (= (logand s5-0 (joint-control-status sync-math)) (joint-control-status sync-math)) + (format #t "sync-math ") + ) + (if (= (logand s5-0 (joint-control-status eye-anim-valid)) (joint-control-status eye-anim-valid)) + (format #t "eye-anim-valid ") + ) + (if (= (logand s5-0 (joint-control-status blend-shape-valid)) (joint-control-status blend-shape-valid)) + (format #t "blend-shape-valid ") + ) + (if (= (logand s5-0 (joint-control-status spooling)) (joint-control-status spooling)) + (format #t "spooling ") + ) + ) + (format #t ")~%") + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tactive-channels: ~D~%" (-> obj active-channels)) + (format #t "~1Troot-channel: #x~X~%" (-> obj root-channel)) + (format #t "~1Tblend-index: ~D~%" (-> obj blend-index)) + (format #t "~1Tactive-frame-interp: ~D~%" (-> obj active-frame-interp)) + (format #t "~1Tfloat-channels: ~D~%" (-> obj float-channels)) + (format #t "~1Tgenerate-frame-function: ~A~%" (-> obj generate-frame-function)) + (format #t "~1Tprebind-function: ~A~%" (-> obj prebind-function)) + (format #t "~1Tpostbind-function: ~A~%" (-> obj postbind-function)) + (format #t "~1Teffect: ~A~%" (-> obj effect)) + (format #t "~1Tinterp-select[2] @ #x~X~%" (-> obj interp-select)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tinterp-select: ~D~%" s5-1 (-> obj interp-select s5-1)) + ) + (format #t "~1Ttop-anim: ~A~%" (-> obj top-anim)) + (format #t "~1Toverride: ~A~%" (-> obj override)) + (format #t "~1Tchannel[0] @ #x~X~%" (-> obj channel)) + (dotimes (s5-2 (the-as int (-> obj active-channels))) + (format #t "~T [~D]~1Tchannel: ~`joint-control-channel`P~%" s5-2 (-> obj channel s5-2)) + ) + (label cfg-28) + obj + ) + +;; definition of type matrix-stack +(deftype matrix-stack (structure) + ((top matrix :offset-assert 0) + (data matrix 24 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x610 + :flag-assert #x900000610 + ) + +;; definition for method 3 of type matrix-stack +(defmethod inspect matrix-stack ((obj matrix-stack)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'matrix-stack) + (format #t "~1Ttop: #~%" (-> obj top)) + (format #t "~1Tdata[24] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type channel-upload-info +(deftype channel-upload-info (structure) + ((fixed joint-anim-compressed-fixed :offset-assert 0) + (fixed-qwc int32 :offset-assert 4) + (frame joint-anim-compressed-frame :offset-assert 8) + (frame-qwc int32 :offset-assert 12) + (amount float :offset-assert 16) + (interp float :offset-assert 20) + ) + :pack-me + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type channel-upload-info +(defmethod inspect channel-upload-info ((obj channel-upload-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'channel-upload-info) + (format #t "~1Tfixed: #~%" (-> obj fixed)) + (format #t "~1Tfixed-qwc: ~D~%" (-> obj fixed-qwc)) + (format #t "~1Tframe: #~%" (-> obj frame)) + (format #t "~1Tframe-qwc: ~D~%" (-> obj frame-qwc)) + (format #t "~1Tamount: ~f~%" (-> obj amount)) + (format #t "~1Tinterp: ~f~%" (-> obj interp)) + (label cfg-4) + obj + ) + +;; definition of type joint-work +(deftype joint-work (structure) + ((temp-mtx matrix :inline :offset-assert 0) + (joint-stack matrix-stack :inline :offset-assert 64) + (fix-jmp-table (function none) 16 :offset-assert 1616) + (frm-jmp-table (function none) 16 :offset-assert 1680) + (pair-jmp-table (function none) 16 :offset-assert 1744) + (uploads channel-upload-info 24 :inline :offset-assert 1808) + (num-uploads int32 :offset-assert 2384) + (mtx-acc matrix 2 :inline :offset-assert 2400) + (tq-acc transformq 100 :inline :offset-assert 2528) + (jacp-hdr joint-anim-compressed-hdr :inline :offset-assert 7328) + (fixed-data joint-anim-compressed-fixed :inline :offset-assert 7392) + (frame-data joint-anim-compressed-frame 2 :inline :offset-assert 9600) + (flatten-array float 576 :offset 2400) + (flattened vector 24 :offset 2400) + ) + :method-count-assert 9 + :size-assert #x3640 + :flag-assert #x900003640 + ) + +;; definition for method 3 of type joint-work +(defmethod inspect joint-work ((obj joint-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'joint-work) + (format #t "~1Ttemp-mtx: #~%" (-> obj temp-mtx)) + (format #t "~1Tjoint-stack: #~%" (-> obj joint-stack)) + (format #t "~1Tfix-jmp-table[16] @ #x~X~%" (-> obj fix-jmp-table)) + (format #t "~1Tfrm-jmp-table[16] @ #x~X~%" (-> obj frm-jmp-table)) + (format #t "~1Tpair-jmp-table[16] @ #x~X~%" (-> obj pair-jmp-table)) + (format #t "~1Tuploads[24] @ #x~X~%" (-> obj uploads)) + (format #t "~1Tnum-uploads: ~D~%" (-> obj num-uploads)) + (format #t "~1Tmtx-acc[2] @ #x~X~%" (-> obj mtx-acc)) + (format #t "~1Ttq-acc[100] @ #x~X~%" (-> obj tq-acc)) + (format #t "~1Tjacp-hdr: #~%" (-> obj jacp-hdr)) + (format #t "~1Tfixed-data: #~%" (-> obj fixed-data)) + (format #t "~1Tframe-data[2] @ #x~X~%" (-> obj frame-data)) + (format #t "~1Tflatten-array[576] @ #x~X~%" (-> obj mtx-acc)) + (format #t "~1Tflattened[24] @ #x~X~%" (-> obj mtx-acc)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc new file mode 100644 index 0000000000..cf26692ae0 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/anim/joint-mod-h_REF.gc @@ -0,0 +1,848 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint-mod +(deftype joint-mod (basic) + ((mode joint-mod-mode :offset-assert 4) + (process process :offset-assert 8) + (joint cspace :offset-assert 12) + (target vector :inline :offset 16) + (twist vector :inline :offset 32) + (twist-max float 4 :offset-assert 48) + (extra-twist degrees :offset 40) + (track-mode track-mode :offset 44) + (loock-at-count uint16 :offset 46) + (twist-range-x meters :offset 56) + (twist-range-y meters :offset 60) + (twist-speed-x float :offset 64) + (twist-speed-y float :offset 68) + (twist-min-x float :offset 72) + (twist-min-y float :offset 76) + (trans vector :inline :offset-assert 80) + (shmushy-old float :offset 80) + (smushy-off float :offset 84) + (smushyv float :offset 88) + (quat quaternion :inline :offset-assert 96) + (scale vector :inline :offset-assert 112) + (notice-time time-frame :offset-assert 128) + (flex-blend float :offset-assert 136) + (blend float :offset-assert 140) + (max-dist meters :offset-assert 144) + (ignore-angle degrees :offset-assert 148) + (up uint8 :offset-assert 152) + (nose uint8 :offset-assert 153) + (ear uint8 :offset-assert 154) + (base-joint uint8 :offset-assert 155) + (base-nose uint8 :offset-assert 156) + (shutting-down? symbol :offset-assert 160) + (parented-scale? symbol :offset-assert 164) + (polar-internal-tilt-max float :offset-assert 168) + (polar-internal-radius float :offset-assert 172) + (polar-external-tilt-max float :offset-assert 176) + (polar-external-radius float :offset-assert 180) + ) + :method-count-assert 16 + :size-assert #xb8 + :flag-assert #x10000000b8 + (:methods + (joint-mod-method-9 () none 9) + (joint-mod-method-10 () none 10) + (joint-mod-method-11 () none 11) + (reset-blend! (_type_) _type_ 12) + (joint-mod-method-13 () none 13) + (joint-mod-method-14 () none 14) + (joint-mod-method-15 () none 15) + ) + ) + +;; definition for method 3 of type joint-mod +(defmethod inspect joint-mod ((obj joint-mod)) + (when (not obj) + (set! obj obj) + (goto cfg-18) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tjoint: #~%" (-> obj joint)) + (format #t "~1Ttarget: ~`vector`P~%" (-> obj target)) + (format #t "~1Ttwist: ~`vector`P~%" (-> obj twist)) + (format #t "~1Ttwist-max: ~`vector`P~%" (-> obj twist-max)) + (format #t "~1Textra-twist: (deg ~r)~%" (-> obj twist z)) + (format #t "~1Ttrack-mode: #x~X : (track-mode " (-> obj track-mode)) + (let ((s5-0 (-> obj track-mode))) + (if (= (logand s5-0 (track-mode track-on)) (track-mode track-on)) + (format #t "track-on ") + ) + (if (= (logand s5-0 (track-mode no-rotate)) (track-mode no-rotate)) + (format #t "no-rotate ") + ) + (if (= (logand s5-0 (track-mode lock-on)) (track-mode lock-on)) + (format #t "lock-on ") + ) + (if (= (logand s5-0 (track-mode no-scale)) (track-mode no-scale)) + (format #t "no-scale ") + ) + (if (= (logand s5-0 (track-mode track-x)) (track-mode track-x)) + (format #t "track-x ") + ) + (if (= (logand s5-0 (track-mode track-y)) (track-mode track-y)) + (format #t "track-y ") + ) + (if (= (logand s5-0 (track-mode no-trans)) (track-mode no-trans)) + (format #t "no-trans ") + ) + ) + (format #t ")~%") + (format #t "~1Tlook-at-count: ~D~%" (-> obj loock-at-count)) + (format #t "~1Ttwist-range-x: (meters ~m)~%" (-> obj twist-range-x)) + (format #t "~1Ttwist-range-y: (meters ~m)~%" (-> obj twist-range-y)) + (format #t "~1Ttwist-speed-x: ~f~%" (-> obj twist-speed-x)) + (format #t "~1Ttwist-speed-y: ~f~%" (-> obj twist-speed-y)) + (format #t "~1Ttwist-min-x: ~f~%" (-> obj twist-min-x)) + (format #t "~1Ttwist-min-y: ~f~%" (-> obj twist-min-y)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tsmushy-old: ~f~%" (-> obj trans x)) + (format #t "~1Tsmushy-off: ~f~%" (-> obj trans y)) + (format #t "~1Tsmushyv: ~f~%" (-> obj trans z)) + (format #t "~1Tquat: ~`quaternion`P~%" (-> obj quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "~1Tnotice-time: ~D~%" (-> obj notice-time)) + (format #t "~1Tflex-blend: ~f~%" (-> obj flex-blend)) + (format #t "~1Tblend: ~f~%" (-> obj blend)) + (format #t "~1Tmax-dist: (meters ~m)~%" (-> obj max-dist)) + (format #t "~1Tignore-angle: (deg ~r)~%" (-> obj ignore-angle)) + (format #t "~1Tup: ~D~%" (-> obj up)) + (format #t "~1Tnose: ~D~%" (-> obj nose)) + (format #t "~1Tear: ~D~%" (-> obj ear)) + (format #t "~1Tbase-joint: ~D~%" (-> obj base-joint)) + (format #t "~1Tbase-nose: ~D~%" (-> obj base-nose)) + (format #t "~1Tshutting-down?: ~A~%" (-> obj shutting-down?)) + (format #t "~1Tparented-scale?: ~A~%" (-> obj parented-scale?)) + (format #t "~1Tpolar-internal-tilt-max: ~f~%" (-> obj polar-internal-tilt-max)) + (format #t "~1Tpolar-internal-radius: ~f~%" (-> obj polar-internal-radius)) + (format #t "~1Tpolar-external-tilt-max: ~f~%" (-> obj polar-external-tilt-max)) + (format #t "~1Tpolar-external-radius: ~f~%" (-> obj polar-external-radius)) + (label cfg-18) + obj + ) + +;; definition of type try-to-look-at-info +(deftype try-to-look-at-info (basic) + ((who uint64 :offset-assert 8) + (horz float :offset-assert 16) + (vert float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type try-to-look-at-info +(defmethod inspect try-to-look-at-info ((obj try-to-look-at-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twho: ~D~%" (-> obj who)) + (format #t "~1Thorz: ~f~%" (-> obj horz)) + (format #t "~1Tvert: ~f~%" (-> obj vert)) + (label cfg-4) + obj + ) + +;; definition (debug) for function joint-mod-debug-draw +;; INFO: Return type mismatch int vs none. +(defun-debug joint-mod-debug-draw ((arg0 joint-mod)) + (add-debug-matrix #t (bucket-id bucket-318) (-> arg0 joint bone transform) 8192.0) + 0 + (none) + ) + +;; definition for method 12 of type joint-mod +(defmethod reset-blend! joint-mod ((obj joint-mod)) + (set! (-> obj blend) 0.0) + obj + ) + +;; definition for symbol *joint-axis-vectors*, type (inline-array vector) +(define *joint-axis-vectors* (new 'static 'inline-array vector 6 + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y -1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + +;; definition of type joint-mod-wheel +(deftype joint-mod-wheel (basic) + ((last-position vector :inline :offset-assert 16) + (angle float :offset-assert 32) + (process process-drawable :offset-assert 36) + (wheel-radius float :offset-assert 40) + (wheel-axis int8 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x2d + :flag-assert #x90000002d + (:methods + (new (symbol type process-drawable int float int) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-wheel +(defmethod inspect joint-mod-wheel ((obj joint-mod-wheel)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlast-position: #~%" (-> obj last-position)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Twheel-radius: ~f~%" (-> obj wheel-radius)) + (format #t "~1Twheel-axis: ~D~%" (-> obj wheel-axis)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-wheel-callback +;; INFO: Used lq/sq +(defun joint-mod-wheel-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as joint-mod-wheel (-> arg0 param1)))) + (let ((v1-1 (-> s4-0 process root)) + (s1-0 (new-stack-vector0)) + (s3-0 (new-stack-vector0)) + (s2-0 (new-stack-vector0)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s2-0 (-> v1-1 quat)) + (vector<-cspace! s1-0 arg0) + (vector-! s3-0 s1-0 (-> s4-0 last-position)) + (set! (-> s4-0 last-position quad) (-> s1-0 quad)) + (let* ((f0-3 (vector-dot s2-0 s3-0)) + (f1-0 65536.0) + (f2-1 (* 6.28318 (-> s4-0 wheel-radius))) + (f0-4 (* f1-0 (/ 1.0 f2-1) f0-3)) + ) + (+! (-> s4-0 angle) f0-4) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) (-> *joint-axis-vectors* (-> s4-0 wheel-axis)) (-> s4-0 angle)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition for method 0 of type joint-mod-wheel +(defmethod new joint-mod-wheel ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 int)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 process) arg0) + (set! (-> v0-0 wheel-radius) arg2) + (set! (-> v0-0 wheel-axis) arg3) + (set! (-> v0-0 angle) 0.0) + (set-vector! (-> v0-0 last-position) 0.0 0.0 0.0 1.0) + (let ((a0-3 (-> arg0 node-list data arg1))) + (set! (-> a0-3 param0) joint-mod-wheel-callback) + (set! (-> a0-3 param1) v0-0) + ) + v0-0 + ) + ) + +;; definition of type joint-mod-set-local +(deftype joint-mod-set-local (basic) + ((transform transformq :inline :offset-assert 16) + (set-rotation symbol :offset-assert 64) + (set-scale symbol :offset-assert 68) + (set-translation symbol :offset-assert 72) + (enable symbol :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + (:methods + (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-set-local +(defmethod inspect joint-mod-set-local ((obj joint-mod-set-local)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttransform: #~%" (-> obj transform)) + (format #t "~1Tset-rotation: ~A~%" (-> obj set-rotation)) + (format #t "~1Tset-scale: ~A~%" (-> obj set-scale)) + (format #t "~1Tset-translation: ~A~%" (-> obj set-translation)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-set-local-callback +;; INFO: Used lq/sq +(defun joint-mod-set-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as joint-mod-set-local (-> arg0 param1)))) + (cond + ((-> v1-0 enable) + (if (not (-> v1-0 set-translation)) + (set! (-> v1-0 transform trans quad) (-> arg1 trans quad)) + ) + (if (not (-> v1-0 set-rotation)) + (set! (-> v1-0 transform quat vec quad) (-> arg1 quat vec quad)) + ) + (if (not (-> v1-0 set-scale)) + (set! (-> v1-0 transform scale quad) (-> arg1 scale quad)) + ) + (cspace<-parented-transformq-joint! arg0 (-> v1-0 transform)) + ) + (else + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + ) + (none) + ) + +;; definition for method 0 of type joint-mod-set-local +;; INFO: Used lq/sq +(defmethod new joint-mod-set-local ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 symbol) + (arg3 symbol) + (arg4 symbol) + ) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 set-translation) arg2) + (set! (-> v0-0 set-rotation) arg3) + (set! (-> v0-0 set-scale) arg4) + (set! (-> v0-0 enable) #t) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-set-local-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +;; definition of type joint-mod-add-local +(deftype joint-mod-add-local (basic) + ((transform transformq :inline :offset-assert 16) + (add-rotation symbol :offset-assert 64) + (add-scale symbol :offset-assert 68) + (add-translation symbol :offset-assert 72) + (enable symbol :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + (:methods + (new (symbol type process-drawable int symbol symbol symbol) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-add-local +(defmethod inspect joint-mod-add-local ((obj joint-mod-add-local)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttransform: #~%" (-> obj transform)) + (format #t "~1Tadd-rotation: ~A~%" (-> obj add-rotation)) + (format #t "~1Tadd-scale: ~A~%" (-> obj add-scale)) + (format #t "~1Tadd-translation: ~A~%" (-> obj add-translation)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-add-local-callback +(defun joint-mod-add-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((s4-0 (the-as joint-mod-add-local (-> arg0 param1)))) + (when (-> s4-0 enable) + (if (-> s4-0 add-translation) + (vector+! (-> arg1 trans) (-> arg1 trans) (the-as vector (-> s4-0 transform))) + ) + (if (-> s4-0 add-rotation) + (quaternion-normalize! (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> s4-0 transform quat))) + ) + (if (-> s4-0 add-scale) + (vector+! (-> arg1 scale) (-> arg1 scale) (-> s4-0 transform scale)) + ) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition for method 0 of type joint-mod-add-local +;; INFO: Used lq/sq +(defmethod new joint-mod-add-local ((allocation symbol) + (type-to-make type) + (arg0 process-drawable) + (arg1 int) + (arg2 symbol) + (arg3 symbol) + (arg4 symbol) + ) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 add-translation) arg2) + (set! (-> gp-0 add-rotation) arg3) + (set! (-> gp-0 add-scale) arg4) + (set! (-> gp-0 enable) #t) + (set! (-> gp-0 transform trans quad) (-> *null-vector* quad)) + (quaternion-copy! (-> gp-0 transform quat) *unity-quaternion*) + (set! (-> gp-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-7 (-> arg0 node-list data arg1))) + (set! (-> a0-7 param0) joint-mod-add-local-callback) + (set! (-> a0-7 param1) gp-0) + ) + gp-0 + ) + ) + +;; definition of type joint-mod-set-world +(deftype joint-mod-set-world (basic) + ((transform transformq :inline :offset-assert 16) + (node-index int32 :offset-assert 64) + (enable symbol :offset-assert 68) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + (:methods + (new (symbol type process-drawable int symbol) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-set-world +(defmethod inspect joint-mod-set-world ((obj joint-mod-set-world)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttransform: #~%" (-> obj transform)) + (format #t "~1Tnode-index: ~D~%" (-> obj node-index)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-set-world-callback +(defun joint-mod-set-world-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as joint-mod-set-world (-> arg0 param1)))) + (if (-> v1-0 enable) + (cspace<-transformq! arg0 (-> v1-0 transform)) + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + (none) + ) + +;; definition for method 0 of type joint-mod-set-world +;; INFO: Used lq/sq +(defmethod new joint-mod-set-world ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 node-index) arg1) + (set! (-> v0-0 enable) arg2) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-set-world-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +;; definition of type joint-mod-blend-local +(deftype joint-mod-blend-local (basic) + ((transform transformq :inline :offset-assert 16) + (blend-transform transformq :inline :offset-assert 64) + (node-index int32 :offset-assert 112) + (blend float :offset-assert 116) + (enable symbol :offset-assert 120) + ) + :method-count-assert 9 + :size-assert #x7c + :flag-assert #x90000007c + (:methods + (new (symbol type process-drawable int symbol) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-blend-local +(defmethod inspect joint-mod-blend-local ((obj joint-mod-blend-local)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttransform: #~%" (-> obj transform)) + (format #t "~1Tblend-transform: #~%" (-> obj blend-transform)) + (format #t "~1Tnode-index: ~D~%" (-> obj node-index)) + (format #t "~1Tblend: ~f~%" (-> obj blend)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-blend-local-callback +(defun joint-mod-blend-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((gp-0 (the-as joint-mod-blend-local (-> arg0 param1)))) + (cond + ((-> gp-0 enable) + (vector-lerp! + (the-as vector (-> gp-0 blend-transform)) + (-> arg1 trans) + (the-as vector (-> gp-0 transform)) + (-> gp-0 blend) + ) + (vector-lerp! (-> gp-0 blend-transform scale) (-> arg1 scale) (-> gp-0 transform scale) (-> gp-0 blend)) + (quaternion-slerp! (-> gp-0 blend-transform quat) (-> arg1 quat) (-> gp-0 transform quat) (-> gp-0 blend)) + (cspace<-parented-transformq-joint! arg0 (-> gp-0 blend-transform)) + ) + (else + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + ) + (none) + ) + +;; definition for method 0 of type joint-mod-blend-local +;; INFO: Used lq/sq +(defmethod new joint-mod-blend-local ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 node-index) arg1) + (set! (-> v0-0 enable) arg2) + (set! (-> v0-0 blend) 0.0) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-blend-local-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +;; definition of type joint-mod-spinner +(deftype joint-mod-spinner (basic) + ((spin-axis vector :inline :offset-assert 16) + (angle float :offset-assert 32) + (spin-rate float :offset-assert 36) + (enable symbol :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + (:methods + (new (symbol type process-drawable int vector float) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-spinner +(defmethod inspect joint-mod-spinner ((obj joint-mod-spinner)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tspin-axis: #~%" (-> obj spin-axis)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "~1Tspin-rate: ~f~%" (-> obj spin-rate)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-spinner-callback +(defun joint-mod-spinner-callback ((arg0 cspace) (arg1 transformq)) + (with-pp + (let ((gp-0 (the-as joint-mod-spinner (-> arg0 param1)))) + (when (-> gp-0 enable) + (let ((f30-0 + (the float + (sar (shl (the int (+ (-> gp-0 angle) (* (-> gp-0 spin-rate) (-> pp clock seconds-per-frame)))) 48) 48) + ) + ) + ) + (quaternion-vector-angle! (-> arg1 quat) (-> gp-0 spin-axis) f30-0) + (set! (-> gp-0 angle) f30-0) + ) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + ) + +;; definition for method 0 of type joint-mod-spinner +;; INFO: Used lq/sq +(defmethod new joint-mod-spinner ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 vector) (arg3 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 spin-axis quad) (-> arg2 quad)) + (set! (-> v0-0 spin-rate) arg3) + (set! (-> v0-0 enable) #t) + (set! (-> v0-0 angle) 0.0) + (let ((a0-3 (-> arg0 node-list data arg1))) + (set! (-> a0-3 param0) joint-mod-spinner-callback) + (set! (-> a0-3 param1) v0-0) + ) + v0-0 + ) + ) + +;; definition of type joint-mod-blend-world +(deftype joint-mod-blend-world (basic) + ((transform transformq :inline :offset-assert 16) + (blend-transform transformq :inline :offset-assert 64) + (blend-flags uint32 :offset-assert 112) + (node-index int32 :offset-assert 116) + (blend float :offset-assert 120) + (enable symbol :offset-assert 124) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + (:methods + (new (symbol type process-drawable int symbol float) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-blend-world +(defmethod inspect joint-mod-blend-world ((obj joint-mod-blend-world)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttransform: #~%" (-> obj transform)) + (format #t "~1Tblend-transform: #~%" (-> obj blend-transform)) + (format #t "~1Tblend-flags: ~D~%" (-> obj blend-flags)) + (format #t "~1Tnode-index: ~D~%" (-> obj node-index)) + (format #t "~1Tblend: ~f~%" (-> obj blend)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-blend-world-callback +(defun joint-mod-blend-world-callback ((arg0 cspace) (arg1 transformq)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (the-as joint-mod-blend-world (-> arg0 param1)))) + (cond + ((-> gp-0 enable) + (let ((f30-0 (if (logtest? (-> gp-0 blend-flags) 1) + (-> gp-0 blend) + 0.0 + ) + ) + (f28-0 (if (logtest? (-> gp-0 blend-flags) 2) + (-> gp-0 blend) + 0.0 + ) + ) + (f26-0 (if (logtest? (-> gp-0 blend-flags) 4) + (-> gp-0 blend) + 0.0 + ) + ) + (s0-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'matrix)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((s1-0 (new 'stack-no-clear 'vector))) + (if (= (-> arg0 parent bone scale w) 0.0) + (matrix<-transformq! s0-0 arg1) + (matrix<-parented-transformq! s0-0 arg1 (-> arg0 parent bone scale)) + ) + (matrix*! s2-0 s0-0 (-> arg0 parent bone transform)) + (set-vector! + s1-0 + (vector-length (the-as vector (-> s2-0 data))) + (vector-length (the-as vector (&-> s2-0 data 4))) + (vector-length (the-as vector (&-> s2-0 data 8))) + 1.0 + ) + (let ((v1-19 (-> gp-0 blend-transform scale))) + (let ((a0-11 (-> arg1 scale))) + (.lvf vf4 (&-> s1-0 quad)) + (.lvf vf5 (&-> a0-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> v1-19 quad) vf6) + ) + ) + (vector-lerp! + (the-as vector (-> gp-0 blend-transform)) + (-> s2-0 trans) + (the-as vector (-> gp-0 transform)) + f30-0 + ) + (vector-lerp! (-> gp-0 blend-transform scale) (-> gp-0 blend-transform scale) (-> gp-0 transform scale) f28-0) + (quaternion-slerp! + (-> gp-0 blend-transform quat) + (matrix->quaternion s3-0 s2-0) + (-> gp-0 transform quat) + f26-0 + ) + ) + (cspace<-transformq! arg0 (-> gp-0 blend-transform)) + ) + (else + (cspace<-parented-transformq-joint! arg0 arg1) + ) + ) + ) + (none) + ) + ) + +;; definition for method 0 of type joint-mod-blend-world +;; INFO: Used lq/sq +(defmethod new joint-mod-blend-world ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol) (arg3 float)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 node-index) arg1) + (set! (-> v0-0 enable) arg2) + (set! (-> v0-0 blend) arg3) + (set! (-> v0-0 transform trans quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform quat vec quad) (-> *null-vector* quad)) + (set! (-> v0-0 transform scale quad) (-> *identity-vector* quad)) + (let ((a0-8 (-> arg0 node-list data arg1))) + (set! (-> a0-8 param0) joint-mod-blend-world-callback) + (set! (-> a0-8 param1) v0-0) + ) + v0-0 + ) + ) + +;; definition of type joint-mod-rotate-local +(deftype joint-mod-rotate-local (basic) + ((enable symbol :offset-assert 4) + (rotation quaternion :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + (:methods + (new (symbol type process-drawable int symbol) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-mod-rotate-local +(defmethod inspect joint-mod-rotate-local ((obj joint-mod-rotate-local)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tenable: ~A~%" (-> obj enable)) + (format #t "~1Trotation: #~%" (-> obj rotation)) + (label cfg-4) + obj + ) + +;; definition for function joint-mod-rotate-local-callback +(defun joint-mod-rotate-local-callback ((arg0 cspace) (arg1 transformq)) + (let ((v1-0 (the-as joint-mod-rotate-local (-> arg0 param1)))) + (new 'stack-no-clear 'vector) + (if (-> v1-0 enable) + (quaternion*! (-> arg1 quat) (-> arg1 quat) (-> v1-0 rotation)) + ) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; definition for method 0 of type joint-mod-rotate-local +(defmethod new joint-mod-rotate-local ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 symbol)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 enable) arg2) + (quaternion-set! (-> gp-0 rotation) 0.0 0.0 0.0 1.0) + (let ((a0-3 (-> arg0 node-list data arg1))) + (set! (-> a0-3 param0) joint-mod-rotate-local-callback) + (set! (-> a0-3 param1) gp-0) + ) + gp-0 + ) + ) + +;; definition of type joint-mod-ik +(deftype joint-mod-ik (basic) + ((flags uint32 :offset-assert 4) + (process basic :offset-assert 8) + (hand-dist float :offset-assert 12) + (handle-pos vector :inline :offset-assert 16) + (elbow-pole-vector-axis uint32 :offset-assert 32) + (elbow-rotation-axis uint32 :offset-assert 36) + (user-position vector :inline :offset-assert 48) + (user-normal vector :inline :offset-assert 64) + (user-blend float :offset-assert 80) + (user-float float :offset-assert 84) + (callback basic :offset-assert 88) + (shoulder-matrix-no-ik matrix :inline :offset-assert 96) + (elbow-matrix-no-ik matrix :inline :offset-assert 160) + (blend float :offset-assert 224) + (blend-interp float :offset-assert 228) + ) + :method-count-assert 11 + :size-assert #xe8 + :flag-assert #xb000000e8 + (:methods + (joint-mod-ik-method-9 () none 9) + (joint-mod-ik-method-10 () none 10) + ) + ) + +;; definition for method 3 of type joint-mod-ik +(defmethod inspect joint-mod-ik ((obj joint-mod-ik)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Thand-dist: ~f~%" (-> obj hand-dist)) + (format #t "~1Thandle-pos: #~%" (-> obj handle-pos)) + (format #t "~1Telbow-pole-vector-axis: ~D~%" (-> obj elbow-pole-vector-axis)) + (format #t "~1Telbow-rotation-axis: ~D~%" (-> obj elbow-rotation-axis)) + (format #t "~1Tuser-position: #~%" (-> obj user-position)) + (format #t "~1Tuser-normal: #~%" (-> obj user-normal)) + (format #t "~1Tuser-blend: ~f~%" (-> obj user-blend)) + (format #t "~1Tuser-float: ~f~%" (-> obj user-float)) + (format #t "~1Tcallback: ~A~%" (-> obj callback)) + (format #t "~1Tshoulder-matrix-no-ik: #~%" (-> obj shoulder-matrix-no-ik)) + (format #t "~1Telbow-matrix-no-ik: #~%" (-> obj elbow-matrix-no-ik)) + (format #t "~1Tblend: ~f~%" (-> obj blend)) + (format #t "~1Tblend-interp: ~f~%" (-> obj blend-interp)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc b/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc new file mode 100644 index 0000000000..6c40eb9aed --- /dev/null +++ b/test/decompiler/reference/jak2/engine/anim/mspace-h_REF.gc @@ -0,0 +1,192 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint +(deftype joint (basic) + ((name basic :offset-assert 4) + (number int32 :offset-assert 8) + (parent joint :offset-assert 12) + (bind-pose matrix :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type joint +(defmethod inspect joint ((obj joint)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tnumber: ~D~%" (-> obj number)) + (format #t "~1Tparent: ~A~%" (-> obj parent)) + (format #t "~1Tbind-pose: #~%" (-> obj bind-pose)) + (label cfg-4) + obj + ) + +;; definition of type bone-cache +(deftype bone-cache (structure) + ((bone-matrix uint32 :offset-assert 0) + (parent-matrix uint32 :offset-assert 4) + (dummy uint32 :offset-assert 8) + (frame uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type bone-cache +(defmethod inspect bone-cache ((obj bone-cache)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-cache) + (format #t "~1Tbone-matrix: ~D~%" (-> obj bone-matrix)) + (format #t "~1Tparent-matrix: ~D~%" (-> obj parent-matrix)) + (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (format #t "~1Tframe: ~D~%" (-> obj frame)) + (label cfg-4) + obj + ) + +;; definition of type bone +(deftype bone (structure) + ((transform matrix :inline :offset-assert 0) + (position vector :inline :offset 48) + (scale vector :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type bone +(defmethod inspect bone ((obj bone)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone) + (format #t "~1Ttransform: #~%" (-> obj transform)) + (format #t "~1Tposition: #~%" (-> obj transform trans)) + (format #t "~1Tscale: #~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; definition of type skeleton +(deftype skeleton (inline-array-class) + ((bones bone :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type skeleton +(defmethod inspect skeleton ((obj skeleton)) + (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 bones)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> skeleton heap-base) (the-as uint 80)) + +;; definition of type cspace +(deftype cspace (structure) + ((parent cspace :offset-assert 0) + (joint joint :offset-assert 4) + (joint-num int16 :offset-assert 8) + (geo basic :offset-assert 12) + (bone bone :offset-assert 16) + (param0 function :offset-assert 20) + (param1 basic :offset-assert 24) + (param2 basic :offset-assert 28) + ) + :method-count-assert 10 + :size-assert #x20 + :flag-assert #xa00000020 + (:methods + (cspace-method-9 () none 9) + ) + ) + +;; definition for method 3 of type cspace +(defmethod inspect cspace ((obj cspace)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cspace) + (format #t "~1Tparent: #~%" (-> obj parent)) + (format #t "~1Tjoint: ~A~%" (-> obj joint)) + (format #t "~1Tjoint-num: ~D~%" (-> obj joint-num)) + (format #t "~1Tgeo: ~A~%" (-> obj geo)) + (format #t "~1Tbone: #~%" (-> obj bone)) + (format #t "~1Tparam0: ~A~%" (-> obj param0)) + (format #t "~1Tparam1: ~A~%" (-> obj param1)) + (format #t "~1Tparam2: ~A~%" (-> obj param2)) + (label cfg-4) + obj + ) + +;; definition of type cspace-array +(deftype cspace-array (inline-array-class) + ((data cspace :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type cspace-array +(defmethod inspect cspace-array ((obj cspace-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! (-> cspace-array heap-base) (the-as uint 32)) + +;; definition for method 2 of type cspace +(defmethod print cspace ((obj cspace)) + (format + #t + "#" + (if (-> obj joint) + (-> obj joint name) + "nojoint" + ) + obj + ) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc new file mode 100644 index 0000000000..e87200dbce --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/cam-debug-h_REF.gc @@ -0,0 +1,141 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition for symbol *redline-table*, type (pointer float) +(define *redline-table* (the-as (pointer float) (malloc 'debug 1600))) + +;; definition for symbol *redline-index*, type int +(define *redline-index* 0) + +;; definition for function float-save-redline +;; INFO: Return type mismatch int vs none. +(defun float-save-redline ((arg0 float)) + (set! (-> *redline-table* *redline-index*) arg0) + (set! *redline-index* (+ *redline-index* 1)) + (when (>= *redline-index* 400) + (set! *redline-index* 0) + 0 + ) + (none) + ) + +;; definition for function float-lookup-redline +(defun float-lookup-redline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *redline-index*) 400))) + (-> *redline-table* a0-3) + ) + ) + +;; definition for symbol *blueline-table*, type (pointer float) +(define *blueline-table* (the-as (pointer float) (malloc 'debug 1600))) + +;; definition for symbol *blueline-index*, type int +(define *blueline-index* 0) + +;; definition for function float-save-blueline +;; INFO: Return type mismatch int vs none. +(defun float-save-blueline ((arg0 float)) + (set! (-> *blueline-table* *blueline-index*) arg0) + (set! *blueline-index* (+ *blueline-index* 1)) + (when (>= *blueline-index* 400) + (set! *blueline-index* 0) + 0 + ) + (none) + ) + +;; definition for function float-lookup-blueline +(defun float-lookup-blueline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *blueline-index*) 400))) + (-> *blueline-table* a0-3) + ) + ) + +;; definition for symbol *greenline-table*, type (pointer float) +(define *greenline-table* (the-as (pointer float) (malloc 'debug 1600))) + +;; definition for symbol *greenline-index*, type int +(define *greenline-index* 0) + +;; definition for function float-save-greenline +;; INFO: Return type mismatch int vs none. +(defun float-save-greenline ((arg0 float)) + (set! (-> *greenline-table* *greenline-index*) arg0) + (set! *greenline-index* (+ *greenline-index* 1)) + (when (>= *greenline-index* 400) + (set! *greenline-index* 0) + 0 + ) + (none) + ) + +;; definition for function float-lookup-greenline +(defun float-lookup-greenline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *greenline-index*) 400))) + (-> *greenline-table* a0-3) + ) + ) + +;; definition for symbol *yellowline-table*, type (pointer float) +(define *yellowline-table* (the-as (pointer float) (malloc 'debug 1600))) + +;; definition for symbol *yellowline-index*, type int +(define *yellowline-index* 0) + +;; definition for function float-save-yellowline +;; INFO: Return type mismatch int vs none. +(defun float-save-yellowline ((arg0 float)) + (set! (-> *yellowline-table* *yellowline-index*) arg0) + (set! *yellowline-index* (+ *yellowline-index* 1)) + (when (>= *yellowline-index* 400) + (set! *yellowline-index* 0) + 0 + ) + (none) + ) + +;; definition for function float-lookup-yellowline +(defun float-lookup-yellowline ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *yellowline-index*) 400))) + (-> *yellowline-table* a0-3) + ) + ) + +;; definition for symbol *timeplot-table*, type (pointer float) +(define *timeplot-table* (the-as (pointer float) (malloc 'debug 1600))) + +;; definition for symbol *timeplot-index*, type int +(define *timeplot-index* 0) + +;; definition for function float-save-timeplot +;; INFO: Return type mismatch int vs none. +(defun float-save-timeplot ((arg0 float)) + (set! (-> *timeplot-table* *timeplot-index*) arg0) + (set! *timeplot-index* (+ *timeplot-index* 1)) + (when (>= *timeplot-index* 400) + (set! *timeplot-index* 0) + 0 + ) + (none) + ) + +;; definition for function float-lookup-timeplot +(defun float-lookup-timeplot ((arg0 float)) + (let ((a0-3 (mod (+ (the int arg0) -1 *timeplot-index*) 400))) + (-> *timeplot-table* a0-3) + ) + ) + +;; definition (perm) for symbol *cam-layout*, type symbol +(define-perm *cam-layout* symbol #f) + +;; failed to figure out what this is: +0 + +) + + + diff --git a/test/decompiler/reference/jak2/engine/camera/cam-interface-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-interface-h_REF.gc new file mode 100644 index 0000000000..86aef78c63 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/cam-interface-h_REF.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition (perm) for symbol *camera-init-mat*, type matrix +(define-perm *camera-init-mat* matrix #f) + +;; definition (perm) for symbol *camera*, type camera-master +(define-perm *camera* camera-master #f) + +;; definition (perm) for symbol *camera-combiner*, type camera-combiner +(define-perm *camera-combiner* camera-combiner #f) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/camera/cam-update-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/cam-update-h_REF.gc new file mode 100644 index 0000000000..b1190b849a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/cam-update-h_REF.gc @@ -0,0 +1,39 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *external-cam-options*, type external-cam-option +(define *external-cam-options* (the-as external-cam-option 0)) + +;; definition for symbol *external-cam-mode*, type symbol +(define *external-cam-mode* #f) + +;; failed to figure out what this is: +(when (or (not *camera-look-through-other*) (zero? *camera-look-through-other*)) + (set! *camera-look-through-other* 0) + 0 + ) + +;; definition (perm) for symbol *camera-other-fov*, type bfloat +(define-perm *camera-other-fov* bfloat (new 'static 'bfloat :data 11650.845)) + +;; definition (perm) for symbol *camera-other-trans*, type vector +(define-perm *camera-other-trans* vector (vector-reset! (new 'global 'vector))) + +;; definition (perm) for symbol *camera-other-matrix*, type matrix +(define-perm *camera-other-matrix* matrix (matrix-identity! (new 'global 'matrix))) + +;; definition (perm) for symbol *camera-smush-control*, type smush-control +(define-perm *camera-smush-control* smush-control (set-zero! (new 'global 'smush-control))) + +;; definition (perm) for symbol *camera-other-root*, type vector +(define-perm *camera-other-root* vector (vector-reset! (new 'global 'vector))) + +;; definition for symbol *fix-visible-level-mask*, type int +(define *fix-visible-level-mask* 6) + +;; definition for symbol *manual-sample-point*, type symbol +(define *manual-sample-point* #f) + + + + diff --git a/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc new file mode 100644 index 0000000000..b12a655cd6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/camera-defs-h_REF.gc @@ -0,0 +1,110 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type camera-bank +(deftype camera-bank (basic) + ((collide-move-rad float :offset-assert 4) + (joypad uint32 :offset-assert 8) + (min-detectable-velocity float :offset-assert 12) + (attack-timeout time-frame :offset-assert 16) + (default-string-max-y meters :offset-assert 24) + (default-string-min-y meters :offset-assert 28) + (default-string-max-z meters :offset-assert 32) + (default-string-min-z meters :offset-assert 36) + (default-string-push-z meters :offset-assert 40) + (default-tilt-adjust degrees :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type camera-bank +(defmethod inspect camera-bank ((obj camera-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcollide-move-rad: ~f~%" (-> obj collide-move-rad)) + (format #t "~1Tjoypad: ~D~%" (-> obj joypad)) + (format #t "~1Tmin-detectable-velocity: ~f~%" (-> obj min-detectable-velocity)) + (format #t "~1Tattack-timeout: ~D~%" (-> obj attack-timeout)) + (format #t "~1Tdefault-string-max-y: (meters ~m)~%" (-> obj default-string-max-y)) + (format #t "~1Tdefault-string-min-y: (meters ~m)~%" (-> obj default-string-min-y)) + (format #t "~1Tdefault-string-max-z: (meters ~m)~%" (-> obj default-string-max-z)) + (format #t "~1Tdefault-string-min-z: (meters ~m)~%" (-> obj default-string-min-z)) + (format #t "~1Tdefault-string-push-z: (meters ~m)~%" (-> obj default-string-push-z)) + (format #t "~1Tdefault-tilt-adjust: (deg ~r)~%" (-> obj default-tilt-adjust)) + (label cfg-4) + obj + ) + +;; definition for symbol *CAMERA-bank*, type camera-bank +(define *CAMERA-bank* (new 'static 'camera-bank + :collide-move-rad 1638.4 + :min-detectable-velocity 40.96 + :attack-timeout (seconds 0.25) + :default-string-max-y (meters 3) + :default-string-min-y (meters 1) + :default-string-max-z (meters 12.5) + :default-string-min-z (meters 5) + :default-string-push-z (meters 10) + :default-tilt-adjust (degrees -6.5000005) + ) + ) + +;; definition of type camera-master-bank +(deftype camera-master-bank (basic) + ((onscreen-head-height meters :offset-assert 4) + (onscreen-foot-height meters :offset-assert 8) + (target-height meters :offset-assert 12) + (up-move-to-pitch-ratio-in-air float :offset-assert 16) + (down-move-to-pitch-ratio-in-air float :offset-assert 20) + (up-move-to-pitch-on-ground float :offset-assert 24) + (down-move-to-pitch-on-ground float :offset-assert 28) + (pitch-off-blend float :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type camera-master-bank +(defmethod inspect camera-master-bank ((obj camera-master-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tonscreen-head-height: (meters ~m)~%" (-> obj onscreen-head-height)) + (format #t "~1Tonscreen-foot-height: (meters ~m)~%" (-> obj onscreen-foot-height)) + (format #t "~1Ttarget-height: (meters ~m)~%" (-> obj target-height)) + (format #t "~1Tup-move-to-pitch-ratio-in-air: ~f~%" (-> obj up-move-to-pitch-ratio-in-air)) + (format #t "~1Tdown-move-to-pitch-ratio-in-air: ~f~%" (-> obj down-move-to-pitch-ratio-in-air)) + (format #t "~1Tup-move-to-pitch-on-ground: ~f~%" (-> obj up-move-to-pitch-on-ground)) + (format #t "~1Tdown-move-to-pitch-on-ground: ~f~%" (-> obj down-move-to-pitch-on-ground)) + (format #t "~1Tpitch-off-blend: ~f~%" (-> obj pitch-off-blend)) + (label cfg-4) + obj + ) + +;; definition for symbol *CAMERA_MASTER-bank*, type camera-master-bank +(define *CAMERA_MASTER-bank* (new 'static 'camera-master-bank + :onscreen-head-height (meters 2.65) + :onscreen-foot-height (meters -0.5) + :target-height (meters 2.15) + :up-move-to-pitch-ratio-in-air 1.0 + :down-move-to-pitch-ratio-in-air 0.5 + :up-move-to-pitch-on-ground 0.9 + :down-move-to-pitch-on-ground 0.9 + :pitch-off-blend 0.5 + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc new file mode 100644 index 0000000000..957daf942f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/camera-h_REF.gc @@ -0,0 +1,670 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type cam-index +(deftype cam-index (structure) + ((flags cam-index-options :offset-assert 0) + (vec vector 2 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x30 + :flag-assert #xb00000030 + (:methods + (cam-index-method-9 () none 9) + (cam-index-method-10 () none 10) + ) + ) + +;; definition for method 3 of type cam-index +(defmethod inspect cam-index ((obj cam-index)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cam-index) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tvec[2] @ #x~X~%" (-> obj vec)) + (label cfg-4) + obj + ) + +;; definition of type tracking-point +(deftype tracking-point (structure) + ((position vector :inline :offset-assert 0) + (direction vector :inline :offset-assert 16) + (tp-length float :offset-assert 32) + (next int32 :offset-assert 36) + (incarnation int32 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type tracking-point +(defmethod inspect tracking-point ((obj tracking-point)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tracking-point) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Tdirection: #~%" (-> obj direction)) + (format #t "~1Ttp-length: ~f~%" (-> obj tp-length)) + (format #t "~1Tnext: ~D~%" (-> obj next)) + (format #t "~1Tincarnation: ~D~%" (-> obj incarnation)) + (label cfg-4) + obj + ) + +;; definition of type tracking-spline-sampler +(deftype tracking-spline-sampler (structure) + ((cur-pt int32 :offset-assert 0) + (partial-pt float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type tracking-spline-sampler +(defmethod inspect tracking-spline-sampler ((obj tracking-spline-sampler)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tracking-spline-sampler) + (format #t "~1Tcur-pt: ~D~%" (-> obj cur-pt)) + (format #t "~1Tpartial-pt: ~f~%" (-> obj partial-pt)) + (label cfg-4) + obj + ) + +;; definition of type tracking-spline +(deftype tracking-spline (structure) + ((point tracking-point 32 :inline :offset-assert 0) + (summed-len float :offset-assert 1536) + (free-point int32 :offset-assert 1540) + (used-point int32 :offset-assert 1544) + (partial-point float :offset-assert 1548) + (end-point int32 :offset-assert 1552) + (next-to-last-point int32 :offset-assert 1556) + (max-move float :offset-assert 1560) + (sample-len float :offset-assert 1564) + (used-count int32 :offset-assert 1568) + (old-position vector :inline :offset-assert 1584) + (debug-old-position vector :inline :offset-assert 1600) + (debug-out-position vector :inline :offset-assert 1616) + (debug-last-point int32 :offset-assert 1632) + ) + :method-count-assert 24 + :size-assert #x664 + :flag-assert #x1800000664 + (:methods + (tracking-spline-method-9 () none 9) + (tracking-spline-method-10 () none 10) + (tracking-spline-method-11 () none 11) + (tracking-spline-method-12 () none 12) + (tracking-spline-method-13 () none 13) + (tracking-spline-method-14 () none 14) + (tracking-spline-method-15 () none 15) + (tracking-spline-method-16 () none 16) + (tracking-spline-method-17 () none 17) + (tracking-spline-method-18 () none 18) + (tracking-spline-method-19 () none 19) + (tracking-spline-method-20 () none 20) + (tracking-spline-method-21 () none 21) + (tracking-spline-method-22 () none 22) + (tracking-spline-method-23 () none 23) + ) + ) + +;; definition for method 3 of type tracking-spline +(defmethod inspect tracking-spline ((obj tracking-spline)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tracking-spline) + (format #t "~1Tpoint[32] @ #x~X~%" (-> obj point)) + (format #t "~1Tsummed-len: ~f~%" (-> obj summed-len)) + (format #t "~1Tfree-point: ~D~%" (-> obj free-point)) + (format #t "~1Tused-point: ~D~%" (-> obj used-point)) + (format #t "~1Tpartial-point: ~f~%" (-> obj partial-point)) + (format #t "~1Tend-point: ~D~%" (-> obj end-point)) + (format #t "~1Tnext-to-last-point: ~D~%" (-> obj next-to-last-point)) + (format #t "~1Tmax-move: ~f~%" (-> obj max-move)) + (format #t "~1Tsample-len: ~f~%" (-> obj sample-len)) + (format #t "~1Tused-count: ~D~%" (-> obj used-count)) + (format #t "~1Told-position: #~%" (-> obj old-position)) + (format #t "~1Tdebug-old-position: #~%" (-> obj debug-old-position)) + (format #t "~1Tdebug-out-position: #~%" (-> obj debug-out-position)) + (format #t "~1Tdebug-last-point: ~D~%" (-> obj debug-last-point)) + (label cfg-4) + obj + ) + +;; definition of type cam-float-seeker +(deftype cam-float-seeker (structure) + ((target float :offset-assert 0) + (value float :offset-assert 4) + (vel float :offset-assert 8) + (accel float :offset-assert 12) + (max-vel float :offset-assert 16) + (max-partial float :offset-assert 20) + ) + :pack-me + :method-count-assert 13 + :size-assert #x18 + :flag-assert #xd00000018 + (:methods + (init (_type_ float float float float) none 9) + (copy-to (_type_ _type_) none 10) + (update! (_type_ float) none 11) + (jump-to-target! (_type_ float) float 12) + ) + ) + +;; definition for method 3 of type cam-float-seeker +(defmethod inspect cam-float-seeker ((obj cam-float-seeker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cam-float-seeker) + (format #t "~1Ttarget: ~f~%" (-> obj target)) + (format #t "~1Tvalue: ~f~%" (-> obj value)) + (format #t "~1Tvel: ~f~%" (-> obj vel)) + (format #t "~1Taccel: ~f~%" (-> obj accel)) + (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) + (format #t "~1Tmax-partial: ~f~%" (-> obj max-partial)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type cam-float-seeker +;; INFO: Return type mismatch int vs none. +(defmethod init cam-float-seeker ((obj cam-float-seeker) (arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (set! (-> obj target) arg0) + (set! (-> obj value) arg0) + (set! (-> obj vel) 0.0) + (set! (-> obj accel) arg1) + (set! (-> obj max-vel) arg2) + (set! (-> obj max-partial) arg3) + 0 + (none) + ) + +;; definition for method 10 of type cam-float-seeker +;; INFO: Return type mismatch int vs none. +(defmethod copy-to cam-float-seeker ((obj cam-float-seeker) (arg0 cam-float-seeker)) + (set! (-> obj target) (-> arg0 target)) + (set! (-> obj value) (-> arg0 value)) + (set! (-> obj vel) (-> arg0 vel)) + (set! (-> obj accel) (-> arg0 accel)) + (set! (-> obj max-vel) (-> arg0 max-vel)) + (set! (-> obj max-partial) (-> arg0 max-partial)) + 0 + (none) + ) + +;; definition for method 11 of type cam-float-seeker +;; INFO: Return type mismatch int vs none. +(defmethod update! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) + (with-pp + 0.0 + 0.0 + (let* ((f1-2 (- (+ (-> obj target) arg0) (-> obj value))) + (f0-5 (* (-> obj max-partial) (fabs f1-2))) + ) + (let ((f1-3 (* f1-2 (* (-> obj accel) (-> pp clock time-adjust-ratio))))) + (+! (-> obj vel) f1-3) + ) + (let ((f1-6 (fabs (-> obj vel))) + (f0-6 (fmin f0-5 (-> obj max-vel))) + ) + (if (< f0-6 f1-6) + (set! (-> obj vel) (* (-> obj vel) (/ f0-6 f1-6))) + ) + ) + ) + (let ((f0-10 (* (-> obj vel) (-> pp clock time-adjust-ratio)))) + (+! (-> obj value) f0-10) + ) + 0 + (none) + ) + ) + +;; definition for method 12 of type cam-float-seeker +(defmethod jump-to-target! cam-float-seeker ((obj cam-float-seeker) (arg0 float)) + (set! (-> obj value) (+ (-> obj target) arg0)) + (set! (-> obj vel) 0.0) + 0.0 + ) + +;; definition of type cam-vector-seeker +(deftype cam-vector-seeker (structure) + ((target vector :inline :offset-assert 0) + (value vector :inline :offset-assert 16) + (vel vector :inline :offset-assert 32) + (accel float :offset-assert 48) + (max-vel float :offset-assert 52) + (max-partial float :offset-assert 56) + ) + :method-count-assert 11 + :size-assert #x3c + :flag-assert #xb0000003c + (:methods + (init (_type_ vector float float float) none 9) + (update! (_type_ vector) none 10) + ) + ) + +;; definition for method 3 of type cam-vector-seeker +(defmethod inspect cam-vector-seeker ((obj cam-vector-seeker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cam-vector-seeker) + (format #t "~1Ttarget: #~%" (-> obj target)) + (format #t "~1Tvalue: #~%" (-> obj value)) + (format #t "~1Tvel: #~%" (-> obj vel)) + (format #t "~1Taccel: ~f~%" (-> obj accel)) + (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) + (format #t "~1Tmax-partial: ~f~%" (-> obj max-partial)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type cam-vector-seeker +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defmethod init cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector) (arg1 float) (arg2 float) (arg3 float)) + (cond + (arg0 + (set! (-> obj target quad) (-> arg0 quad)) + (set! (-> obj value quad) (-> arg0 quad)) + ) + (else + (vector-reset! (-> obj target)) + (vector-reset! (-> obj value)) + ) + ) + (vector-reset! (-> obj vel)) + (set! (-> obj accel) arg1) + (set! (-> obj max-vel) arg2) + (set! (-> obj max-partial) arg3) + 0 + (none) + ) + +;; definition for method 10 of type cam-vector-seeker +;; INFO: Return type mismatch int vs none. +(defmethod update! cam-vector-seeker ((obj cam-vector-seeker) (arg0 vector)) + (with-pp + (let ((v1-0 (new 'stack-no-clear 'vector))) + 0.0 + (cond + (arg0 + (vector+! v1-0 (-> obj target) arg0) + (vector-! v1-0 v1-0 (-> obj value)) + ) + (else + (vector-! v1-0 (-> obj target) (-> obj value)) + ) + ) + (let ((f0-2 (* (-> obj max-partial) (vector-length v1-0)))) + (vector-float*! v1-0 v1-0 (* (-> obj accel) (-> pp clock time-adjust-ratio))) + (vector+! (-> obj vel) (-> obj vel) v1-0) + (let ((f1-3 (vector-length (-> obj vel))) + (f0-3 (fmin f0-2 (-> obj max-vel))) + ) + (if (< f0-3 f1-3) + (vector-float*! (-> obj vel) (-> obj vel) (/ f0-3 f1-3)) + ) + ) + ) + (vector-float*! v1-0 (-> obj vel) (-> pp clock time-adjust-ratio)) + (vector+! (-> obj value) (-> obj value) v1-0) + ) + 0 + (none) + ) + ) + +;; definition of type cam-rotation-tracker +(deftype cam-rotation-tracker (structure) + ((inv-mat matrix :inline :offset-assert 0) + (no-follow basic :offset-assert 64) + (follow-pt vector :inline :offset-assert 80) + (follow-off vector :inline :offset-assert 96) + (follow-blend float :offset-assert 112) + (tilt-adjust cam-float-seeker :inline :offset-assert 116) + (point-of-interest-blend cam-float-seeker :inline :offset-assert 140) + (underwater-blend cam-float-seeker :inline :offset-assert 164) + (looking-at vector :inline :offset-assert 192) + (looking-interesting vector :inline :offset-assert 208) + (old-cam-trans vector :inline :offset-assert 224) + (follow-height-extra cam-float-seeker :inline :offset-assert 240) + ) + :method-count-assert 9 + :size-assert #x108 + :flag-assert #x900000108 + ) + +;; definition for method 3 of type cam-rotation-tracker +(defmethod inspect cam-rotation-tracker ((obj cam-rotation-tracker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cam-rotation-tracker) + (format #t "~1Tinv-mat: ~`matrix`P~%" (-> obj inv-mat)) + (format #t "~1Tno-follow: ~A~%" (-> obj no-follow)) + (format #t "~1Tfollow-pt: ~`vector`P~%" (-> obj follow-pt)) + (format #t "~1Tfollow-off: ~`vector`P~%" (-> obj follow-off)) + (format #t "~1Tfollow-blend: ~f~%" (-> obj follow-blend)) + (format #t "~1Ttilt-adjust: #~%" (-> obj tilt-adjust)) + (format #t "~1Tpoint-of-interest-blend: #~%" (-> obj point-of-interest-blend)) + (format #t "~1Tunderwater-blend: #~%" (-> obj underwater-blend)) + (format #t "~1Tlooking-at: ~`vector`P~%" (-> obj looking-at)) + (format #t "~1Tlooking-interesting: ~`vector`P~%" (-> obj looking-interesting)) + (format #t "~1Told-cam-trans: ~`vector`P~%" (-> obj old-cam-trans)) + (format #t "~1Tfollow-height-extra: #~%" (-> obj follow-height-extra)) + (label cfg-4) + obj + ) + +;; definition of type camera-combiner +(deftype camera-combiner (process) + ((trans vector :inline :offset-assert 128) + (inv-camera-rot matrix :inline :offset-assert 144) + (fov float :offset-assert 208) + (interp-val float :offset-assert 212) + (interp-step float :offset-assert 216) + (dist-from-src float :offset-assert 220) + (dist-from-dest float :offset-assert 224) + (flip-control-axis vector :inline :offset-assert 240) + (velocity vector :inline :offset-assert 256) + (tracking-status uint64 :offset-assert 272) + (tracking-options int32 :offset-assert 280) + (tracking cam-rotation-tracker :inline :offset-assert 288) + (fast-rot basic :offset-assert 552) + ) + :heap-base #x1b0 + :method-count-assert 14 + :size-assert #x22c + :flag-assert #xe01b0022c + ) + +;; definition for method 3 of type camera-combiner +(defmethod inspect camera-combiner ((obj camera-combiner)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Ttrans: ~`vector`P~%" (-> obj stack)) + (format #t "~2Tinv-camera-rot: ~`matrix`P~%" (-> obj inv-camera-rot)) + (format #t "~2Tfov: ~f~%" (-> obj fov)) + (format #t "~2Tinterp-val: ~f~%" (-> obj interp-val)) + (format #t "~2Tinterp-step: ~f~%" (-> obj interp-step)) + (format #t "~2Tdist-from-src: ~f~%" (-> obj dist-from-src)) + (format #t "~2Tdist-from-dest: ~f~%" (-> obj dist-from-dest)) + (format #t "~2Tflip-control-axis: #~%" (-> obj flip-control-axis)) + (format #t "~2Tvelocity: #~%" (-> obj velocity)) + (format #t "~2Ttracking-status: ~D~%" (-> obj tracking-status)) + (format #t "~2Ttracking-options: ~D~%" (-> obj tracking-options)) + (format #t "~2Ttracking: #~%" (-> obj tracking)) + (format #t "~2Tfast-rot: ~A~%" (-> obj fast-rot)) + (label cfg-4) + obj + ) + +;; definition of type camera-slave +(deftype camera-slave (process) + ((trans vector :inline :offset-assert 128) + (fov float :offset-assert 144) + (fov0 float :offset-assert 148) + (fov1 float :offset-assert 152) + (fov-index cam-index :inline :offset-assert 160) + (tracking cam-rotation-tracker :inline :offset-assert 208) + (view-off-param float :offset-assert 472) + (view-off vector :inline :offset-assert 480) + (joystick-saved-view-off vector :inline :offset-assert 496) + (min-z-override float :offset-assert 512) + (view-flat vector :inline :offset-assert 528) + (string-vel-dir uint32 :offset-assert 544) + (string-trans vector :inline :offset-assert 560) + (position-spline tracking-spline :inline :offset-assert 576) + (pivot-pt vector :inline :offset-assert 2224) + (pivot-rad float :offset-assert 2240) + (circular-follow vector :inline :offset-assert 2256) + (max-angle-offset float :offset-assert 2272) + (max-angle-curr float :offset-assert 2276) + (options uint32 :offset-assert 2280) + (cam-entity entity :offset-assert 2284) + (butt-timer uint64 :offset-assert 2288) + (butt-seek basic :offset-assert 2296) + (butt-vector vector :inline :offset-assert 2304) + (velocity vector :inline :offset-assert 2320) + (desired-pos vector :inline :offset-assert 2336) + (time-dist-too-far uint32 :offset-assert 2352) + (los-state slave-los-state :offset-assert 2356) + (good-point vector :inline :offset-assert 2368) + (los-tgt-spline-pt int32 :offset-assert 2384) + (los-tgt-spline-pt-incarnation int32 :offset-assert 2388) + (los-last-pos vector :inline :offset-assert 2400) + (intro-curve curve :inline :offset-assert 2416) + (intro-offset vector :inline :offset-assert 2448) + (intro-t float :offset-assert 2464) + (intro-t-step float :offset-assert 2468) + (outro-exit-value float :offset-assert 2472) + (spline-exists basic :offset-assert 2476) + (spline-curve curve :inline :offset-assert 2480) + (spline-offset vector :inline :offset-assert 2512) + (index cam-index :inline :offset-assert 2528) + (saved-pt vector :inline :offset-assert 2576) + (spline-tt float :offset-assert 2592) + (spline-follow-dist float :offset-assert 2596) + (enter-has-run symbol :offset-assert 2600) + (blend-from-type uint64 :offset-assert 2608) + (blend-to-type uint64 :offset-assert 2616) + (have-phony-joystick basic :offset-assert 2624) + (phony-joystick-x float :offset-assert 2628) + (phony-joystick-y float :offset-assert 2632) + (string-min-val vector :inline :offset-assert 2640) + (string-max-val vector :inline :offset-assert 2656) + (string-val-locked basic :offset-assert 2672) + (relative-position vector :inline :offset-assert 2688) + (string-relative basic :offset-assert 2704) + ) + :heap-base #xa20 + :method-count-assert 14 + :size-assert #xa94 + :flag-assert #xe0a200a94 + ) + +;; definition for method 3 of type camera-slave +(defmethod inspect camera-slave ((obj camera-slave)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Ttrans: ~`vector`P~%" (-> obj stack)) + (format #t "~2Tfov: ~f~%" (-> obj fov)) + (format #t "~2Tfov0: ~f~%" (-> obj fov0)) + (format #t "~2Tfov1: ~f~%" (-> obj fov1)) + (format #t "~2Tfov-index: #~%" (-> obj fov-index)) + (format #t "~2Ttracking: #~%" (-> obj tracking)) + (format #t "~2Tview-off-param: ~f~%" (-> obj view-off-param)) + (format #t "~2Tview-off: ~`vector`P~%" (-> obj view-off)) + (format #t "~2Tjoystick-saved-view-off: ~`vector`P~%" (-> obj joystick-saved-view-off)) + (format #t "~2Tmin-z-override: ~f~%" (-> obj min-z-override)) + (format #t "~2Tview-flat: ~`vector`P~%" (-> obj view-flat)) + (format #t "~2Tstring-vel-dir: ~D~%" (-> obj string-vel-dir)) + (format #t "~2Tstring-trans: ~`vector`P~%" (-> obj string-trans)) + (format #t "~2Tposition-spline: #~%" (-> obj position-spline)) + (format #t "~2Tpivot-pt: ~`vector`P~%" (-> obj pivot-pt)) + (format #t "~2Tpivot-rad: ~f~%" (-> obj pivot-rad)) + (format #t "~2Tcircular-follow: #~%" (-> obj circular-follow)) + (format #t "~2Tmax-angle-offset: ~f~%" (-> obj max-angle-offset)) + (format #t "~2Tmax-angle-curr: ~f~%" (-> obj max-angle-curr)) + (format #t "~2Toptions: ~D~%" (-> obj options)) + (format #t "~2Tcam-entity: ~A~%" (-> obj cam-entity)) + (format #t "~2Tbutt-timer: ~D~%" (-> obj butt-timer)) + (format #t "~2Tbutt-seek: ~A~%" (-> obj butt-seek)) + (format #t "~2Tbutt-vector: ~`vector`P~%" (-> obj butt-vector)) + (format #t "~2Tvelocity: ~`vector`P~%" (-> obj velocity)) + (format #t "~2Tdesired-pos: ~`vector`P~%" (-> obj desired-pos)) + (format #t "~2Ttime-dist-too-far: ~D~%" (-> obj time-dist-too-far)) + (format #t "~2Tlos-state: ~D~%" (-> obj los-state)) + (format #t "~2Tgood-point: ~`vector`P~%" (-> obj good-point)) + (format #t "~2Tlos-tgt-spline-pt: ~D~%" (-> obj los-tgt-spline-pt)) + (format #t "~2Tlos-tgt-spline-pt-incarnation: ~D~%" (-> obj los-tgt-spline-pt-incarnation)) + (format #t "~2Tlos-last-pos: ~`vector`P~%" (-> obj los-last-pos)) + (format #t "~2Tintro-curve: #~%" (-> obj intro-curve)) + (format #t "~2Tintro-offset: #~%" (-> obj intro-offset)) + (format #t "~2Tintro-t: ~f~%" (-> obj intro-t)) + (format #t "~2Tintro-t-step: ~f~%" (-> obj intro-t-step)) + (format #t "~2Toutro-exit-value: ~f~%" (-> obj outro-exit-value)) + (format #t "~2Tspline-exists: ~A~%" (-> obj spline-exists)) + (format #t "~2Tspline-curve: #~%" (-> obj spline-curve)) + (format #t "~2Tspline-offset: #~%" (-> obj spline-offset)) + (format #t "~2Tindex: #~%" (-> obj index)) + (format #t "~2Tsaved-pt: #~%" (-> obj saved-pt)) + (format #t "~2Tspline-tt: ~f~%" (-> obj spline-tt)) + (format #t "~2Tspline-follow-dist: ~f~%" (-> obj spline-follow-dist)) + (format #t "~2Tenter-has-run: ~A~%" (-> obj enter-has-run)) + (format #t "~2Tblend-from-type: ~D~%" (-> obj blend-from-type)) + (format #t "~2Tblend-to-type: ~D~%" (-> obj blend-to-type)) + (format #t "~2Thave-phony-joystick: ~A~%" (-> obj have-phony-joystick)) + (format #t "~2Tphony-joystick-x: ~f~%" (-> obj phony-joystick-x)) + (format #t "~2Tphony-joystick-y: ~f~%" (-> obj phony-joystick-y)) + (format #t "~2Tstring-min-val: #~%" (-> obj string-min-val)) + (format #t "~2Tstring-max-val: #~%" (-> obj string-max-val)) + (format #t "~2Tstring-val-locked: ~A~%" (-> obj string-val-locked)) + (format #t "~2Trelative-position: #~%" (-> obj relative-position)) + (format #t "~2Tstring-relative: ~A~%" (-> obj string-relative)) + (label cfg-4) + obj + ) + +;; definition of type camera-master +(deftype camera-master (process) + ((master-options uint32 :offset-assert 128) + (settings cam-setting-data :offset-assert 132) + (slave (pointer camera-slave) :offset-assert 136) + (decel uint32 :offset-assert 140) + (slave-options uint32 :offset-assert 144) + (view-off-param-save float :offset-assert 148) + (changer uint32 :offset-assert 152) + (string-min cam-vector-seeker :inline :offset-assert 160) + (string-max cam-vector-seeker :inline :offset-assert 224) + (string-push-z float :offset-assert 284) + (local-down vector :inline :offset-assert 288) + (focus focus :inline :offset-assert 304) + (being-attacked symbol :offset-assert 316) + (attack-start time-frame :offset-assert 320) + (on-ground symbol :offset-assert 328) + (under-water int32 :offset-assert 332) + (on-pole symbol :offset-assert 336) + (tgt-rot-mat matrix :inline :offset-assert 352) + (tgt-face-mat matrix :inline :offset-assert 416) + (tpos-old vector :inline :offset-assert 480) + (tpos-curr vector :inline :offset-assert 496) + (tpos-old-adj vector :inline :offset-assert 512) + (tpos-curr-adj vector :inline :offset-assert 528) + (tpos-tgt vector :inline :offset-assert 544) + (upspeed float :offset-assert 560) + (pitch-off vector :inline :offset-assert 576) + (target-spline tracking-spline :inline :offset-assert 592) + (ease-from vector :inline :offset-assert 2240) + (ease-t float :offset-assert 2256) + (ease-step float :offset-assert 2260) + (ease-to vector :inline :offset-assert 2272) + (outro-curve curve :inline :offset-assert 2288) + (outro-t float :offset-assert 2308) + (outro-t-step float :offset-assert 2312) + (outro-exit-value float :offset-assert 2316) + (water-drip-time time-frame :offset-assert 2320) + (water-drip sparticle-launch-control :offset-assert 2328) + (water-drip-mult float :offset-assert 2332) + (water-drip-speed float :offset-assert 2336) + ) + :heap-base #x8b0 + :method-count-assert 17 + :size-assert #x924 + :flag-assert #x1108b00924 + (:methods + (camera-master-method-14 () none 14) + (camera-master-method-15 () none 15) + (camera-master-method-16 () none 16) + ) + ) + +;; definition for method 3 of type camera-master +(defmethod inspect camera-master ((obj camera-master)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tmaster-options: ~D~%" (-> obj master-options)) + (format #t "~2Tsettings: #~%" (-> obj settings)) + (format #t "~2Tslave: #x~X~%" (-> obj slave)) + (format #t "~2Tdecel: #x~X~%" (-> obj decel)) + (format #t "~2Tslave-options: ~D~%" (-> obj slave-options)) + (format #t "~2Tview-off-param-save: ~f~%" (-> obj view-off-param-save)) + (format #t "~2Tchanger: #x~X~%" (-> obj changer)) + (format #t "~2Tstring-min: #~%" (-> obj string-min)) + (format #t "~2Tstring-max: #~%" (-> obj string-max)) + (format #t "~2Tstring-push-z: ~f~%" (-> obj string-push-z)) + (format #t "~2Tlocal-down: ~`vector`P~%" (-> obj local-down)) + (format #t "~2Tfocus: #~%" (-> obj focus)) + (format #t "~2Tbeing-attacked: ~A~%" (-> obj being-attacked)) + (format #t "~2Tattack-start: ~D~%" (-> obj attack-start)) + (format #t "~2Ton-ground: ~A~%" (-> obj on-ground)) + (format #t "~2Tunder-water: ~D~%" (-> obj under-water)) + (format #t "~2Ton-pole: ~A~%" (-> obj on-pole)) + (format #t "~2Ttgt-rot-mat: ~`matrix`P~%" (-> obj tgt-rot-mat)) + (format #t "~2Ttgt-face-mat: ~`matrix`P~%" (-> obj tgt-face-mat)) + (format #t "~2Ttpos-old: ~`vector`P~%" (-> obj tpos-old)) + (format #t "~2Ttpos-curr: ~`vector`P~%" (-> obj tpos-curr)) + (format #t "~2Ttpos-old-adj: ~`vector`P~%" (-> obj tpos-old-adj)) + (format #t "~2Ttpos-curr-adj: ~`vector`P~%" (-> obj tpos-curr-adj)) + (format #t "~2Ttpos-tgt: ~`vector`P~%" (-> obj tpos-tgt)) + (format #t "~2Tupspeed: ~f~%" (-> obj upspeed)) + (format #t "~2Tpitch-off: ~`vector`P~%" (-> obj pitch-off)) + (format #t "~2Ttarget-spline: #~%" (-> obj target-spline)) + (format #t "~2Tease-from: #~%" (-> obj ease-from)) + (format #t "~2Tease-t: ~f~%" (-> obj ease-t)) + (format #t "~2Tease-step: ~f~%" (-> obj ease-step)) + (format #t "~2Tease-to: #~%" (-> obj ease-to)) + (format #t "~2Toutro-curve: #~%" (-> obj outro-curve)) + (format #t "~2Toutro-t: ~f~%" (-> obj outro-t)) + (format #t "~2Toutro-t-step: ~f~%" (-> obj outro-t-step)) + (format #t "~2Toutro-exit-value: ~f~%" (-> obj outro-exit-value)) + (format #t "~2Twater-drip-time: ~D~%" (-> obj water-drip-time)) + (format #t "~2Twater-drip: ~A~%" (-> obj water-drip)) + (format #t "~2Twater-drip-mult: ~f~%" (-> obj water-drip-mult)) + (format #t "~2Twater-drip-speed: ~f~%" (-> obj water-drip-speed)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc b/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc new file mode 100644 index 0000000000..24c63d05aa --- /dev/null +++ b/test/decompiler/reference/jak2/engine/camera/pov-camera-h_REF.gc @@ -0,0 +1,59 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pov-camera +(deftype pov-camera (process-drawable) + ((flags pov-camera-flag :offset-assert 200) + (debounce-start-time time-frame :offset-assert 208) + (notify-handle uint64 :offset-assert 216) + (anim-name string :offset-assert 224) + (command-list pair :offset-assert 228) + (mask-to-clear process-mask :offset-assert 232) + (music-volume-movie float :offset-assert 236) + (sfx-volume-movie float :offset-assert 240) + ) + :heap-base #x80 + :method-count-assert 30 + :size-assert #xf4 + :flag-assert #x1e008000f4 + (:methods + (pov-camera-method-20 () none 20) + (pov-camera-method-21 () none 21) + (pov-camera-method-22 () none 22) + (pov-camera-method-23 () none 23) + (pov-camera-method-24 () none 24) + (pov-camera-method-25 () none 25) + (pov-camera-method-26 () none 26) + (pov-camera-method-27 () none 27) + (pov-camera-method-28 () none 28) + (pov-camera-method-29 () none 29) + ) + ) + +;; definition for method 3 of type pov-camera +(defmethod inspect pov-camera ((obj pov-camera)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tdebounce-start-time: ~D~%" (-> obj debounce-start-time)) + (format #t "~2Tnotify-handle: ~D~%" (-> obj notify-handle)) + (format #t "~2Tanim-name: ~A~%" (-> obj anim-name)) + (format #t "~2Tcommand-list: ~A~%" (-> obj command-list)) + (format #t "~2Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) + (format #t "~2Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) + (format #t "~2Tsfx-volume-movie: ~f~%" (-> obj sfx-volume-movie)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc new file mode 100644 index 0000000000..69879690f5 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-cache-h_REF.gc @@ -0,0 +1,257 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-puss-sphere +(deftype collide-puss-sphere (structure) + ((bsphere sphere :inline :offset-assert 0) + (bbox4w bounding-box4w :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type collide-puss-sphere +(defmethod inspect collide-puss-sphere ((obj collide-puss-sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-puss-sphere) + (format #t "~1Tbsphere: #~%" (-> obj bsphere)) + (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) + (label cfg-4) + obj + ) + +;; definition of type collide-puss-work +(deftype collide-puss-work (structure) + ((closest-pt vector :inline :offset-assert 0) + (tri-normal vector :inline :offset-assert 16) + (tri-bbox4w bounding-box4w :inline :offset-assert 32) + (spheres-bbox4w bounding-box4w :inline :offset-assert 64) + (spheres collide-puss-sphere 64 :inline :offset-assert 96) + ) + :method-count-assert 11 + :size-assert #xc60 + :flag-assert #xb00000c60 + (:methods + (collide-puss-work-method-9 () none 9) + (collide-puss-work-method-10 () none 10) + ) + ) + +;; definition for method 3 of type collide-puss-work +(defmethod inspect collide-puss-work ((obj collide-puss-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-puss-work) + (format #t "~1Tclosest-pt: #~%" (-> obj closest-pt)) + (format #t "~1Ttri-normal: #~%" (-> obj tri-normal)) + (format #t "~1Ttri-bbox4w: #~%" (-> obj tri-bbox4w)) + (format #t "~1Tspheres-bbox4w: #~%" (-> obj spheres-bbox4w)) + (format #t "~1Tspheres[64] @ #x~X~%" (-> obj spheres)) + (label cfg-4) + obj + ) + +;; definition of type collide-cache-tri +(deftype collide-cache-tri (structure) + ((vertex vector 3 :inline :offset-assert 0) + (extra-quad uint8 16 :offset-assert 48) + (pat pat-surface :offset 48) + (collide-ptr basic :offset 52) + (prim-index uint16 :offset 56) + (user16 uint16 :offset 58) + (user32 uint32 :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type collide-cache-tri +(defmethod inspect collide-cache-tri ((obj collide-cache-tri)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-cache-tri) + (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) + (format #t "~1Textra-quad[16] @ #x~X~%" (-> obj extra-quad)) + (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "~1Tcollide-ptr: ~A~%" (-> obj collide-ptr)) + (format #t "~1Tprim-index: ~D~%" (-> obj prim-index)) + (format #t "~1Tuser16: ~D~%" (-> obj user16)) + (format #t "~1Tuser32: ~D~%" (-> obj user32)) + (label cfg-4) + obj + ) + +;; definition of type collide-cache-prim +(deftype collide-cache-prim (structure) + ((prim-core collide-prim-core :inline :offset-assert 0) + (extra-quad uint8 16 :offset-assert 32) + (ccache collide-cache :offset 32) + (prim collide-shape-prim :offset 36) + (first-tri uint16 :offset 40) + (num-tris uint16 :offset 42) + (unused uint8 4 :offset 44) + (world-sphere vector :inline :offset 0) + (collide-as collide-spec :offset 16) + (action collide-action :offset 24) + (prim-type prim-type :offset 28) + ) + :method-count-assert 11 + :size-assert #x30 + :flag-assert #xb00000030 + (:methods + (collide-cache-prim-method-9 () none 9) + (collide-cache-prim-method-10 () none 10) + ) + ) + +;; definition for method 3 of type collide-cache-prim +(defmethod inspect collide-cache-prim ((obj collide-cache-prim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-cache-prim) + (format #t "~1Tprim-core: #~%" (-> obj prim-core)) + (format #t "~1Textra-quad[16] @ #x~X~%" (-> obj extra-quad)) + (format #t "~1Tccache: ~A~%" (-> obj ccache)) + (format #t "~1Tprim: ~A~%" (-> obj prim)) + (format #t "~1Tfirst-tri: ~D~%" (-> obj first-tri)) + (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) + (format #t "~1Tunused[4] @ #x~X~%" (-> obj unused)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) + (format #t "~1Tcollide-as: ~D~%" (-> obj prim-core collide-as)) + (format #t "~1Taction: ~D~%" (-> obj prim-core action)) + (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) + (label cfg-4) + obj + ) + +;; definition of type collide-cache +(deftype collide-cache (basic) + ((num-tris int32 :offset-assert 4) + (num-prims int32 :offset-assert 8) + (ignore-mask pat-surface :offset-assert 12) + (ignore-processes process 2 :offset-assert 16) + (collide-box bounding-box :inline :offset-assert 32) + (collide-box4w bounding-box4w :inline :offset-assert 64) + (collide-with collide-spec :offset-assert 96) + (unused uint32 :offset-assert 100) + (prims collide-cache-prim 100 :inline :offset-assert 112) + (tris collide-cache-tri 461 :inline :offset-assert 4912) + ) + :method-count-assert 26 + :size-assert #x8670 + :flag-assert #x1a00008670 + (:methods + (collide-cache-method-9 () none 9) + (collide-cache-method-10 () none 10) + (collide-cache-method-11 () none 11) + (collide-cache-method-12 () none 12) + (collide-cache-method-13 () none 13) + (collide-cache-method-14 () none 14) + (collide-cache-method-15 () none 15) + (collide-cache-method-16 () none 16) + (collide-cache-method-17 () none 17) + (collide-cache-method-18 () none 18) + (collide-cache-method-19 () none 19) + (collide-cache-method-20 () none 20) + (collide-cache-method-21 () none 21) + (collide-cache-method-22 () none 22) + (collide-cache-method-23 () none 23) + (collide-cache-method-24 () none 24) + (collide-cache-method-25 () none 25) + ) + ) + +;; definition for method 3 of type collide-cache +(defmethod inspect collide-cache ((obj collide-cache)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) + (format #t "~1Tnum-prims: ~D~%" (-> obj num-prims)) + (format #t "~1Tignore-mask: ~D~%" (-> obj ignore-mask)) + (format #t "~1Tignore-processes[2] @ #x~X~%" (-> obj ignore-processes)) + (format #t "~1Tcollide-box: #~%" (-> obj collide-box)) + (format #t "~1Tcollide-box4w: #~%" (-> obj collide-box4w)) + (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "~1Tunused: ~D~%" (-> obj unused)) + (format #t "~1Tprims[100] @ #x~X~%" (-> obj prims)) + (format #t "~1Ttris[461] @ #x~X~%" (-> obj tris)) + (label cfg-4) + obj + ) + +;; definition of type collide-list-item +(deftype collide-list-item (structure) + ((mesh collide-frag-mesh :offset-assert 0) + (inst basic :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type collide-list-item +(defmethod inspect collide-list-item ((obj collide-list-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-list-item) + (format #t "~1Tmesh: ~A~%" (-> obj mesh)) + (format #t "~1Tinst: ~A~%" (-> obj inst)) + (label cfg-4) + obj + ) + +;; definition of type collide-list +(deftype collide-list (structure) + ((num-items int32 :offset-assert 0) + (items collide-list-item 256 :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x810 + :flag-assert #x900000810 + ) + +;; definition for method 3 of type collide-list +(defmethod inspect collide-list ((obj collide-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-list) + (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) + (format #t "~1Titems[256] @ #x~X~%" (-> obj items)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(kmemopen global "collide-cache") + +;; definition (perm) for symbol *collide-cache*, type collide-cache +(define-perm *collide-cache* collide-cache (new 'global 'collide-cache)) + +;; definition (perm) for symbol *collide-list*, type collide-list +(define-perm *collide-list* collide-list (new 'global 'collide-list)) + +;; failed to figure out what this is: +(kmemclose) + + + + 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 new file mode 100644 index 0000000000..c4baa6e8f5 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-edge-grab-h_REF.gc @@ -0,0 +1,379 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pilot-edge-grab-info +(deftype pilot-edge-grab-info (structure) + ((local-pos vector :inline :offset-assert 0) + (local-dir vector :inline :offset-assert 16) + (handle handle :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type pilot-edge-grab-info +(defmethod inspect pilot-edge-grab-info ((obj pilot-edge-grab-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pilot-edge-grab-info) + (format #t "~1Tlocal-pos: #~%" (-> obj local-pos)) + (format #t "~1Tlocal-dir: #~%" (-> obj local-dir)) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (label cfg-4) + obj + ) + +;; definition of type edge-grab-info +(deftype edge-grab-info (structure) + ((world-vertex vector 8 :inline :offset-assert 0) + (local-vertex vector 8 :inline :offset-assert 128) + (status uint64 :offset-assert 256) + (actor-cshape-prim-offset int32 :offset-assert 264) + (actor-handle uint64 :offset-assert 272) + (hanging-matrix matrix :inline :offset-assert 288) + (edge-vertex vector 2 :inline :offset 0) + (center-hold vector :inline :offset 32) + (tri-vertex vector 3 :inline :offset 48) + (adjacent-edge-left-vertex vector :inline :offset 96) + (adjacent-edge-right-vertex vector :inline :offset 112) + (left-hand-hold vector :inline :offset-assert 352) + (right-hand-hold vector :inline :offset-assert 368) + (center-hold-old vector :inline :offset-assert 384) + (edge-tri-pat uint32 :offset-assert 400) + (found-edge? symbol :offset-assert 404) + (pilot-edge-grab? symbol :offset-assert 408) + (pilot-edge-grab pilot-edge-grab-info :inline :offset-assert 416) + (pilot-start-grab-pos vector :inline :offset-assert 464) + (pilot-grab-interp float :offset-assert 480) + ) + :method-count-assert 11 + :size-assert #x1e4 + :flag-assert #xb000001e4 + (:methods + (edge-grab-info-method-9 () none 9) + (edge-grab-info-method-10 () none 10) + ) + ) + +;; definition for method 3 of type edge-grab-info +(defmethod inspect edge-grab-info ((obj edge-grab-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'edge-grab-info) + (format #t "~1Tworld-vertex[8] @ #x~X~%" (-> obj world-vertex)) + (format #t "~1Tlocal-vertex[8] @ #x~X~%" (-> obj local-vertex)) + (format #t "~1Tstatus: ~D~%" (-> obj status)) + (format #t "~1Tactor-cshape-prim-offset: ~D~%" (-> obj actor-cshape-prim-offset)) + (format #t "~1Tactor-handle: ~D~%" (-> obj actor-handle)) + (format #t "~1Thanging-matrix: #~%" (-> obj hanging-matrix)) + (format #t "~1Tedge-vertex[2] @ #x~X~%" (-> obj world-vertex)) + (format #t "~1Tcenter-hold: ~`vector`P~%" (-> obj center-hold)) + (format #t "~1Ttri-vertex[3] @ #x~X~%" (-> obj tri-vertex)) + (format #t "~1Tadjacent-edge-left-vertex: #~%" (-> obj adjacent-edge-left-vertex)) + (format #t "~1Tadjacent-edge-right-vertex: #~%" (-> obj adjacent-edge-right-vertex)) + (format #t "~1Tleft-hand-hold: #~%" (-> obj left-hand-hold)) + (format #t "~1Tright-hand-hold: #~%" (-> obj right-hand-hold)) + (format #t "~1Tcenter-hold-old: ~`vector`P~%" (-> obj center-hold-old)) + (format #t "~1Tedge-tri-pat: ~D~%" (-> obj edge-tri-pat)) + (format #t "~1Tfound-edge?: ~A~%" (-> obj found-edge?)) + (format #t "~1Tpilot-edge-grab?: ~A~%" (-> obj pilot-edge-grab?)) + (format #t "~1Tpilot-edge-grab: #~%" (-> obj pilot-edge-grab)) + (format #t "~1Tpilot-start-grab-pos: #~%" (-> obj pilot-start-grab-pos)) + (format #t "~1Tpilot-grab-interp: ~f~%" (-> obj pilot-grab-interp)) + (label cfg-4) + obj + ) + +;; definition of type collide-edge-tri +(deftype collide-edge-tri (structure) + ((ctri collide-cache-tri :offset-assert 0) + (normal vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type collide-edge-tri +(defmethod inspect collide-edge-tri ((obj collide-edge-tri)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-edge-tri) + (format #t "~1Tctri: ~A~%" (-> obj ctri)) + (format #t "~1Tnormal: #~%" (-> obj normal)) + (label cfg-4) + obj + ) + +;; definition of type collide-edge-edge +(deftype collide-edge-edge (structure) + ((ignore basic :offset-assert 0) + (etri collide-edge-tri :offset-assert 4) + (vertex-ptr (inline-array vector) 2 :offset-assert 8) + (outward vector :inline :offset-assert 16) + (edge-vec-norm vector :inline :offset-assert 32) + ) + :method-count-assert 10 + :size-assert #x30 + :flag-assert #xa00000030 + (:methods + (collide-edge-edge-method-9 () none 9) + ) + ) + +;; definition for method 3 of type collide-edge-edge +(defmethod inspect collide-edge-edge ((obj collide-edge-edge)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-edge-edge) + (format #t "~1Tignore: ~A~%" (-> obj ignore)) + (format #t "~1Tetri: #~%" (-> obj etri)) + (format #t "~1Tvertex-ptr[2] @ #x~X~%" (-> obj vertex-ptr)) + (format #t "~1Toutward: #~%" (-> obj outward)) + (format #t "~1Tedge-vec-norm: #~%" (-> obj edge-vec-norm)) + (label cfg-4) + obj + ) + +;; definition of type collide-edge-hold-item +(deftype collide-edge-hold-item (structure) + ((next collide-edge-hold-item :offset-assert 0) + (rating float :offset-assert 4) + (split int8 :offset-assert 8) + (edge collide-edge-edge :offset-assert 12) + (center-pt vector :inline :offset-assert 16) + (outward-pt vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type collide-edge-hold-item +(defmethod inspect collide-edge-hold-item ((obj collide-edge-hold-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-edge-hold-item) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Trating: ~f~%" (-> obj rating)) + (format #t "~1Tsplit: ~D~%" (-> obj split)) + (format #t "~1Tedge: #~%" (-> obj edge)) + (format #t "~1Tcenter-pt: #~%" (-> obj center-pt)) + (format #t "~1Toutward-pt: #~%" (-> obj outward-pt)) + (label cfg-4) + obj + ) + +;; definition of type collide-edge-hold-list +(deftype collide-edge-hold-list (structure) + ((num-allocs uint32 :offset-assert 0) + (num-attempts uint32 :offset-assert 4) + (head collide-edge-hold-item :offset-assert 8) + (items collide-edge-hold-item 32 :inline :offset-assert 16) + (attempts qword 32 :inline :offset-assert 1552) + ) + :method-count-assert 11 + :size-assert #x810 + :flag-assert #xb00000810 + (:methods + (collide-edge-hold-list-method-9 () none 9) + (collide-edge-hold-list-method-10 () none 10) + ) + ) + +;; definition for method 3 of type collide-edge-hold-list +(defmethod inspect collide-edge-hold-list ((obj collide-edge-hold-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-edge-hold-list) + (format #t "~1Tnum-allocs: ~D~%" (-> obj num-allocs)) + (format #t "~1Tnum-attempts: ~D~%" (-> obj num-attempts)) + (format #t "~1Thead: #~%" (-> obj head)) + (format #t "~1Titems[32] @ #x~X~%" (-> obj items)) + (format #t "~1Tattempts[32] @ #x~X~%" (-> obj attempts)) + (label cfg-4) + obj + ) + +;; definition of type collide-edge-spec +(deftype collide-edge-spec (structure) + ((split-dists float 2 :offset-assert 0) + (outward-offset vector :inline :offset-assert 16) + (flags uint64 :offset-assert 32) + (ignore-pat pat-surface :offset-assert 40) + (max-dist-sqrd-to-outward-pt float :offset-assert 44) + (max-dir-cosa-delta float :offset-assert 48) + (max-dir-cosa-player float :offset-assert 52) + (touching-segment symbol :offset-assert 56) + (local-cache-fill-box bounding-box :inline :offset-assert 64) + (local-within-reach-box bounding-box :inline :offset-assert 96) + (local-player-spheres sphere 12 :inline :offset 128) + (local-player-hanging-spheres sphere 6 :inline :offset 128) + (local-player-leap-up-spheres sphere 6 :inline :offset 224) + ) + :method-count-assert 9 + :size-assert #x140 + :flag-assert #x900000140 + ) + +;; definition for method 3 of type collide-edge-spec +(defmethod inspect collide-edge-spec ((obj collide-edge-spec)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-edge-spec) + (format #t "~1Tsplit-dists[2] @ #x~X~%" (-> obj split-dists)) + (format #t "~1Toutward-offset: #~%" (-> obj outward-offset)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tignore-pat: ~D~%" (-> obj ignore-pat)) + (format #t "~1Tmax-dist-sqrd-to-outward-pt: ~f~%" (-> obj max-dist-sqrd-to-outward-pt)) + (format #t "~1Tmax-dir-cosa-delta: ~f~%" (-> obj max-dir-cosa-delta)) + (format #t "~1Tmax-dir-cosa-player: ~f~%" (-> obj max-dir-cosa-player)) + (format #t "~1Ttouching-segment: #x~X~%" (-> obj touching-segment)) + (format #t "~1Tlocal-cache-fill-box: #~%" (-> obj local-cache-fill-box)) + (format #t "~1Tlocal-within-reach-box: #~%" (-> obj local-within-reach-box)) + (format #t "~1Tlocal-player-spheres[12] @ #x~X~%" (-> obj local-player-spheres)) + (format #t "~1Tlocal-player-hanging-spheres[6] @ #x~X~%" (-> obj local-player-spheres)) + (format #t "~1Tlocal-player-leap-up-spheres[6] @ #x~X~%" (-> obj local-player-leap-up-spheres)) + (label cfg-4) + obj + ) + +;; definition of type collide-edge-work +(deftype collide-edge-work (structure) + ((ccache collide-cache :offset-assert 0) + (cshape collide-shape :offset-assert 4) + (num-verts uint32 :offset-assert 8) + (num-edges uint32 :offset-assert 12) + (num-tris uint32 :offset-assert 16) + (cache-fill-box bounding-box :inline :offset-assert 32) + (within-reach-box bounding-box :inline :offset-assert 64) + (within-reach-box4w bounding-box4w :inline :offset-assert 96) + (search-pt vector :inline :offset-assert 128) + (search-dir-vec vector :inline :offset-assert 144) + (world-player-spheres sphere 12 :inline :offset-assert 160) + (world-player-hanging-spheres sphere 6 :inline :offset 160) + (world-player-leap-up-spheres sphere 6 :inline :offset 256) + (spec collide-edge-spec :inline :offset-assert 352) + (process uint32 :offset-assert 672) + (verts vector 64 :inline :offset-assert 688) + (edges collide-edge-edge 96 :inline :offset-assert 1712) + (tris collide-edge-tri 48 :inline :offset-assert 6320) + (hold-list collide-edge-hold-list :inline :offset-assert 7856) + ) + :method-count-assert 21 + :size-assert #x26c0 + :flag-assert #x15000026c0 + (:methods + (collide-edge-work-method-9 () none 9) + (collide-edge-work-method-10 () none 10) + (collide-edge-work-method-11 () none 11) + (collide-edge-work-method-12 () none 12) + (collide-edge-work-method-13 () none 13) + (collide-edge-work-method-14 () none 14) + (collide-edge-work-method-15 () none 15) + (collide-edge-work-method-16 () none 16) + (collide-edge-work-method-17 () none 17) + (collide-edge-work-method-18 () none 18) + (collide-edge-work-method-19 () none 19) + (collide-edge-work-method-20 () none 20) + ) + ) + +;; definition for method 3 of type collide-edge-work +(defmethod inspect collide-edge-work ((obj collide-edge-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-edge-work) + (format #t "~1Tccache: ~A~%" (-> obj ccache)) + (format #t "~1Tcshape: ~A~%" (-> obj cshape)) + (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) + (format #t "~1Tnum-edges: ~D~%" (-> obj num-edges)) + (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) + (format #t "~1Tcache-fill-box: #~%" (-> obj cache-fill-box)) + (format #t "~1Twithin-reach-box: #~%" (-> obj within-reach-box)) + (format #t "~1Twithin-reach-box4w: #~%" (-> obj within-reach-box4w)) + (format #t "~1Tsearch-pt: #~%" (-> obj search-pt)) + (format #t "~1Tsearch-dir-vec: #~%" (-> obj search-dir-vec)) + (format #t "~1Tworld-player-spheres[12] @ #x~X~%" (-> obj world-player-spheres)) + (format #t "~1Tworld-player-hanging-spheres[6] @ #x~X~%" (-> obj world-player-spheres)) + (format #t "~1Tworld-player-leap-up-spheres[6] @ #x~X~%" (-> obj world-player-leap-up-spheres)) + (format #t "~1Tspec: #~%" (-> obj spec)) + (format #t "~1Tprocess: #x~X~%" (-> obj process)) + (format #t "~1Tverts[64] @ #x~X~%" (-> obj verts)) + (format #t "~1Tedges[96] @ #x~X~%" (-> obj edges)) + (format #t "~1Ttris[48] @ #x~X~%" (-> obj tris)) + (format #t "~1Thold-list: #~%" (-> obj hold-list)) + (label cfg-4) + obj + ) + +;; definition for symbol *collide-edge-spec*, type collide-edge-spec +(define *collide-edge-spec* + (new 'static 'collide-edge-spec + :split-dists (new 'static 'array float 2 1024.0 1433.6) + :outward-offset (new 'static 'vector :x 708.608 :y 13312.0 :w 1.0) + :flags #x8 + :ignore-pat (new 'static 'pat-surface :noentity #x1 :noedge #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + :max-dist-sqrd-to-outward-pt 37748736.0 + :max-dir-cosa-delta 0.6 + :touching-segment #f + :local-cache-fill-box (new 'static 'bounding-box + :min (new 'static 'vector :x -8192.0 :y -11059.2 :z -8192.0 :w 1.0) + :max (new 'static 'vector :x 8192.0 :y 24576.0 :z 8192.0 :w 1.0) + ) + :local-within-reach-box (new 'static 'bounding-box + :min (new 'static 'vector :x -6144.0 :y 5324.8 :z -6144.0 :w 1.0) + :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) + ) + ) + ) + +;; failed to figure out what this is: +(kmemopen global "collide-edge-work") + +;; definition for symbol *collide-edge-work*, type collide-edge-work +(define *collide-edge-work* (new 'global 'collide-edge-work)) + +;; failed to figure out what this is: +(mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer *collide-edge-spec*) 320) + +;; definition (perm) for symbol *edge-grab-info*, type edge-grab-info +(define-perm *edge-grab-info* edge-grab-info (new 'global 'edge-grab-info)) + +;; failed to figure out what this is: +(kmemclose) + + + + diff --git a/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc new file mode 100644 index 0000000000..d3ec62d657 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-frag-h_REF.gc @@ -0,0 +1,130 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-frag-vertex +(deftype collide-frag-vertex (vector) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type collide-frag-vertex +;; INFO: Used lq/sq +(defmethod inspect collide-frag-vertex ((obj collide-frag-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-frag-vertex) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type collide-frag-mesh +(deftype collide-frag-mesh (basic) + ((packed-data uint32 :offset-assert 4) + (pat-array uint32 :offset-assert 8) + (strip-data-len uint16 :offset-assert 12) + (poly-count uint16 :offset-assert 14) + (base-trans vector4w :inline :offset-assert 16) + (vertex-count uint8 :offset 28) + (vertex-data-qwc uint8 :offset 29) + (total-qwc uint8 :offset 30) + (unused uint8 :offset 31) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type collide-frag-mesh +(defmethod inspect collide-frag-mesh ((obj collide-frag-mesh)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tpacked-data: #x~X~%" (-> obj packed-data)) + (format #t "~1Tpat-array: #x~X~%" (-> obj pat-array)) + (format #t "~1Tstrip-data-len: ~D~%" (-> obj strip-data-len)) + (format #t "~1Tpoly-count: ~D~%" (-> obj poly-count)) + (format #t "~1Tbase-trans: #~%" (-> obj base-trans)) + (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) + (format #t "~1Tvertex-data-qwc: ~D~%" (-> obj vertex-data-qwc)) + (format #t "~1Ttotal-qwc: ~D~%" (-> obj total-qwc)) + (format #t "~1Tunused: ~D~%" (-> obj unused)) + (label cfg-4) + obj + ) + +;; definition of type collide-fragment +(deftype collide-fragment (drawable) + ((mesh collide-frag-mesh :offset 8) + (collide-new basic :offset 12) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type collide-fragment +(defmethod inspect collide-fragment ((obj collide-fragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tmesh: ~A~%" (-> obj mesh)) + (format #t "~1Tcollide-new: ~A~%" (-> obj collide-new)) + (label cfg-4) + obj + ) + +;; definition of type drawable-inline-array-collide-fragment +(deftype drawable-inline-array-collide-fragment (drawable-inline-array) + ((data collide-fragment 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +;; definition for method 3 of type drawable-inline-array-collide-fragment +(defmethod inspect drawable-inline-array-collide-fragment ((obj drawable-inline-array-collide-fragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type drawable-tree-collide-fragment +(deftype drawable-tree-collide-fragment (drawable-tree) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc new file mode 100644 index 0000000000..c9ce1fec45 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-h_REF.gc @@ -0,0 +1,105 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-query +(deftype collide-query (structure) + ((best-other-tri collide-tri-result :inline :offset-assert 0) + (best-my-tri collide-tri-result :inline :offset 0) + (ignore-processes process 2 :offset-assert 88) + (ignore-process0 process :offset 88) + (ignore-process1 process :offset 92) + (ignore-pat pat-surface :offset-assert 96) + (collide-with collide-spec :offset-assert 100) + (overlay-params uint32 3 :offset 112) + (bbox bounding-box :inline :offset-assert 128) + (bbox4w bounding-box4w :inline :offset-assert 160) + (bsphere sphere :inline :offset-assert 192) + (start-pos vector :inline :offset-assert 208) + (move-dist vector :inline :offset-assert 224) + (rlength vector :inline :offset-assert 240) + (exit-planes plane 2 :offset-assert 256) + (radius float :offset 268) + (inv-mat matrix :inline :offset 288) + (spheres uint32 :offset 112) + (num-spheres uint32 :offset 116) + (solid-only basic :offset 120) + (best-dist float :offset 112) + (best-other-prim basic :offset 116) + (best-my-prim basic :offset 120) + (move-vec vector :inline :offset 224) + (best-u float :offset 112) + (action-mask uint32 :offset-assert 352) + (local-box4w bounding-box4w :inline :offset-assert 368) + (search-box bounding-box4w :inline :offset-assert 400) + (search-vector vector4w :inline :offset-assert 432) + (instance-mat matrix :inline :offset-assert 448) + (instance-ptr basic :offset-assert 512) + (x-addr uint32 :offset-assert 516) + (x-step uint32 :offset-assert 520) + (y-addr uint32 :offset-assert 524) + (y-step uint32 :offset-assert 528) + (z-addr uint32 :offset-assert 532) + (z-step uint32 :offset-assert 536) + ) + :method-count-assert 9 + :size-assert #x21c + :flag-assert #x90000021c + ) + +;; definition for method 3 of type collide-query +(defmethod inspect collide-query ((obj collide-query)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-query) + (format #t "~1Tbest-other-tri: #~%" (-> obj best-other-tri)) + (format #t "~1Tbest-my-tri: #~%" (-> obj best-other-tri)) + (format #t "~1Tignore-processes[2] @ #x~X~%" (-> obj ignore-processes)) + (format #t "~1Tignore-process0: ~A~%" (-> obj ignore-process0)) + (format #t "~1Tignore-process1: ~A~%" (-> obj ignore-process1)) + (format #t "~1Tignore-pat: ~D~%" (-> obj ignore-pat)) + (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "~1Toverlay-params[3] @ #x~X~%" (&-> obj best-dist)) + (format #t "~1Tbbox: #~%" (-> obj bbox)) + (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) + (format #t "~1Tbsphere: #~%" (-> obj bsphere)) + (format #t "~1Tstart-pos: #~%" (-> obj start-pos)) + (format #t "~1Tmove-dist: #~%" (-> obj move-dist)) + (format #t "~1Trlength: #~%" (-> obj rlength)) + (format #t "~1Texit-planes[2] @ #x~X~%" (-> obj exit-planes)) + (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "~1Tinv-mat: #~%" (-> obj inv-mat)) + (format #t "~1Tspheres: #x~X~%" (-> obj best-dist)) + (format #t "~1Tnum-spheres: ~D~%" (-> obj num-spheres)) + (format #t "~1Tsolid-only: ~A~%" (-> obj solid-only)) + (format #t "~1Tbest-dist: ~f~%" (-> obj best-dist)) + (format #t "~1Tbest-other-prim: ~A~%" (-> obj num-spheres)) + (format #t "~1Tbest-my-prim: ~A~%" (-> obj solid-only)) + (format #t "~1Tmove-vec: #~%" (-> obj move-dist)) + (format #t "~1Tbest-u: ~f~%" (-> obj best-dist)) + (format #t "~1Taction-mask: ~D~%" (-> obj action-mask)) + (format #t "~1Tlocal-box4w: #~%" (-> obj local-box4w)) + (format #t "~1Tsearch-box: #~%" (-> obj search-box)) + (format #t "~1Tsearch-vector: #~%" (-> obj search-vector)) + (format #t "~1Tinstance-mat: #~%" (-> obj instance-mat)) + (format #t "~1Tinstance-ptr: ~A~%" (-> obj instance-ptr)) + (format #t "~1Tx-addr: ~D~%" (-> obj x-addr)) + (format #t "~1Tx-step: ~D~%" (-> obj x-step)) + (format #t "~1Ty-addr: ~D~%" (-> obj y-addr)) + (format #t "~1Ty-step: ~D~%" (-> obj y-step)) + (format #t "~1Tz-addr: ~D~%" (-> obj z-addr)) + (format #t "~1Tz-step: ~D~%" (-> obj z-step)) + (label cfg-4) + obj + ) + +;; definition for symbol *collide-test-flag*, type symbol +(define *collide-test-flag* #f) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc new file mode 100644 index 0000000000..9fb8fd92f6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-mesh-h_REF.gc @@ -0,0 +1,208 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-tri-result +(deftype collide-tri-result (structure) + ((vertex vector 3 :inline :offset-assert 0) + (intersect vector :inline :offset-assert 48) + (normal vector :inline :offset-assert 64) + (pat pat-surface :offset-assert 80) + (collide-ptr basic :offset-assert 84) + ) + :method-count-assert 9 + :size-assert #x58 + :flag-assert #x900000058 + ) + +;; definition for method 3 of type collide-tri-result +(defmethod inspect collide-tri-result ((obj collide-tri-result)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-tri-result) + (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) + (format #t "~1Tintersect: ~`vector`P~%" (-> obj intersect)) + (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) + (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "~1Tcollide-ptr: ~A~%" (-> obj collide-ptr)) + (label cfg-4) + obj + ) + +;; definition of type collide-mesh-tri +(deftype collide-mesh-tri (structure) + ((vertex-index uint8 3 :offset-assert 0) + (unused uint8 :offset-assert 3) + (pat pat-surface :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type collide-mesh-tri +(defmethod inspect collide-mesh-tri ((obj collide-mesh-tri)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-mesh-tri) + (format #t "~1Tvertex-index[3] @ #x~X~%" (-> obj vertex-index)) + (format #t "~1Tunused: ~D~%" (-> obj unused)) + (format #t "~1Tpat: ~D~%" (-> obj pat)) + (label cfg-4) + obj + ) + +;; definition of type collide-mesh +(deftype collide-mesh (basic) + ((joint-id int32 :offset-assert 4) + (num-tris uint32 :offset-assert 8) + (num-verts uint32 :offset-assert 12) + (vertex-data (inline-array vector) :offset-assert 16) + (tris collide-mesh-tri 1 :inline :offset 32) + ) + :method-count-assert 16 + :size-assert #x28 + :flag-assert #x1000000028 + (:methods + (collide-mesh-method-9 () none 9) + (collide-mesh-method-10 () none 10) + (collide-mesh-method-11 () none 11) + (collide-mesh-method-12 () none 12) + (collide-mesh-method-13 () none 13) + (collide-mesh-method-14 () none 14) + (collide-mesh-method-15 () none 15) + ) + ) + +;; definition for method 3 of type collide-mesh +(defmethod inspect collide-mesh ((obj collide-mesh)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tjoint-id: ~D~%" (-> obj joint-id)) + (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) + (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) + (format #t "~1Tvertex-data: #x~X~%" (-> obj vertex-data)) + (format #t "~1Ttris[1] @ #x~X~%" (-> obj tris)) + (label cfg-4) + obj + ) + +;; definition of type collide-mesh-cache-tri +(deftype collide-mesh-cache-tri (structure) + ((vertex vector 3 :inline :offset-assert 0) + (normal vector :inline :offset-assert 48) + (bbox4w bounding-box4w :inline :offset-assert 64) + (pat pat-surface :offset 60) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type collide-mesh-cache-tri +(defmethod inspect collide-mesh-cache-tri ((obj collide-mesh-cache-tri)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-mesh-cache-tri) + (format #t "~1Tvertex[3] @ #x~X~%" (-> obj vertex)) + (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) + (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) + (format #t "~1Tpat: ~D~%" (-> obj normal w)) + (label cfg-4) + obj + ) + +;; definition of type collide-mesh-cache-entry +(deftype collide-mesh-cache-entry (structure) + ((mat matrix :inline :offset-assert 0) + (tris collide-mesh-cache-tri :inline :dynamic :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type collide-mesh-cache-entry +(defmethod inspect collide-mesh-cache-entry ((obj collide-mesh-cache-entry)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-mesh-cache-entry) + (format #t "~1Tmat: #~%" (-> obj mat)) + (format #t "~1Ttris[0] @ #x~X~%" (-> obj tris)) + (label cfg-4) + obj + ) + +;; definition of type collide-mesh-cache +(deftype collide-mesh-cache (basic) + ((used-size uint32 :offset-assert 4) + (max-size uint32 :offset-assert 8) + (id uint32 :offset-assert 12) + (data uint8 48000 :offset-assert 16) + ) + :method-count-assert 13 + :size-assert #xbb90 + :flag-assert #xd0000bb90 + (:methods + (collide-mesh-cache-method-9 () none 9) + (is-id? (_type_ int) symbol 10) + (next-id! (_type_) uint 11) + (collide-mesh-cache-method-12 () none 12) + ) + ) + +;; definition for method 3 of type collide-mesh-cache +(defmethod inspect collide-mesh-cache ((obj collide-mesh-cache)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tused-size: ~D~%" (-> obj used-size)) + (format #t "~1Tmax-size: ~D~%" (-> obj max-size)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tdata[48000] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for method 11 of type collide-mesh-cache +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 10 of type collide-mesh-cache +(defmethod is-id? collide-mesh-cache ((obj collide-mesh-cache) (arg0 int)) + (= (-> obj id) arg0) + ) + +;; failed to figure out what this is: +(kmemopen global "collide-mesh-cache") + +;; definition (perm) for symbol *collide-mesh-cache*, type collide-mesh-cache +(define-perm *collide-mesh-cache* collide-mesh-cache (new 'global 'collide-mesh-cache)) + +;; failed to figure out what this is: +(set! (-> *collide-mesh-cache* id) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *collide-mesh-cache* used-size) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *collide-mesh-cache* max-size) (the-as uint #xbb80)) + +;; failed to figure out what this is: +(kmemclose) + + + + 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 new file mode 100644 index 0000000000..88abb5bf44 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-shape-h_REF.gc @@ -0,0 +1,2053 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type collide-rider +(deftype collide-rider (structure) + ((rider-handle uint64 :offset-assert 0) + (sticky-prim basic :offset-assert 8) + (prim-ry float :offset-assert 12) + (rider-local-pos vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type collide-rider +(defmethod inspect collide-rider ((obj collide-rider)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-rider) + (format #t "~1Trider-handle: ~D~%" (-> obj rider-handle)) + (format #t "~1Tsticky-prim: ~A~%" (-> obj sticky-prim)) + (format #t "~1Tprim-ry: ~f~%" (-> obj prim-ry)) + (format #t "~1Trider-local-pos: #~%" (-> obj rider-local-pos)) + (label cfg-4) + obj + ) + +;; definition of type collide-rider-pool +(deftype collide-rider-pool (basic) + ((alloc-count int32 :offset-assert 4) + (riders collide-rider 20 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x290 + :flag-assert #xb00000290 + (:methods + (collide-rider-pool-method-9 () none 9) + (prepare (_type_) none 10) + ) + ) + +;; definition for method 3 of type collide-rider-pool +(defmethod inspect collide-rider-pool ((obj collide-rider-pool)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Talloc-count: ~D~%" (-> obj alloc-count)) + (format #t "~1Triders[20] @ #x~X~%" (-> obj riders)) + (label cfg-4) + obj + ) + +;; definition for method 10 of type collide-rider-pool +;; INFO: Return type mismatch int vs none. +(defmethod prepare collide-rider-pool ((obj collide-rider-pool)) + "Gets this pool ready to be used to allow allocations. This should be called once at the start of every frame." + (set! (-> obj alloc-count) 0) + 0 + (none) + ) + +;; definition of type pull-rider-info +(deftype pull-rider-info (structure) + ((rider collide-rider :offset-assert 0) + (rider-cshape collide-shape-moving :offset-assert 4) + (rider-delta-ry float :offset-assert 8) + (rider-dest vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type pull-rider-info +(defmethod inspect pull-rider-info ((obj pull-rider-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pull-rider-info) + (format #t "~1Trider: #~%" (-> obj rider)) + (format #t "~1Trider-cshape: ~A~%" (-> obj rider-cshape)) + (format #t "~1Trider-delta-ry: ~f~%" (-> obj rider-delta-ry)) + (format #t "~1Trider-dest: #~%" (-> obj rider-dest)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(kmemopen global "collide-lists") + +;; definition for symbol *collide-hit-by-player-list*, type engine +(define *collide-hit-by-player-list* (new 'global 'engine 'collide-hit-by-player-list 640 connection)) + +;; definition for symbol *collide-hit-by-others-list*, type engine +(define *collide-hit-by-others-list* (new 'global 'engine 'collide-hit-by-others-list 768 connection)) + +;; definition for symbol *collide-player-list*, type engine +(define *collide-player-list* (new 'global 'engine 'collide-player-list 32 connection)) + +;; failed to figure out what this is: +(kmemclose) + +;; definition of type overlaps-others-params +(deftype overlaps-others-params (structure) + ((options overlaps-others-options :offset-assert 0) + (collide-with-filter collide-spec :offset-assert 4) + (tlist touching-list :offset-assert 8) + (filtered-root-collide-with collide-spec :offset-assert 12) + (filtered-child-collide-with collide-spec :offset-assert 16) + (filtered-other-collide-as collide-spec :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type overlaps-others-params +(defmethod inspect overlaps-others-params ((obj overlaps-others-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'overlaps-others-params) + (format #t "~1Toptions: ~D~%" (-> obj options)) + (format #t "~1Tcollide-with-filter: ~D~%" (-> obj collide-with-filter)) + (format #t "~1Ttlist: ~A~%" (-> obj tlist)) + (format #t "~1Tfiltered-root-collide-with: ~D~%" (-> obj filtered-root-collide-with)) + (format #t "~1Tfiltered-child-collide-with: ~D~%" (-> obj filtered-child-collide-with)) + (format #t "~1Tfiltered-other-collide-as: ~D~%" (-> obj filtered-other-collide-as)) + (label cfg-4) + obj + ) + +;; definition of type move-above-ground-params +(deftype move-above-ground-params (structure) + ((gnd-collide-with collide-spec :offset-assert 0) + (popup float :offset-assert 4) + (dont-move-if-overlaps? basic :offset-assert 8) + (hover-if-no-ground? basic :offset-assert 12) + (overlaps-params overlaps-others-params :inline :offset-assert 16) + (new-pos vector :inline :offset-assert 48) + (old-gspot-pos vector :inline :offset-assert 64) + (old-gspot-normal vector :inline :offset-assert 80) + (pat pat-surface :offset-assert 96) + (on-ground? basic :offset-assert 100) + (do-move? basic :offset-assert 104) + ) + :method-count-assert 9 + :size-assert #x6c + :flag-assert #x90000006c + ) + +;; definition for method 3 of type move-above-ground-params +(defmethod inspect move-above-ground-params ((obj move-above-ground-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'move-above-ground-params) + (format #t "~1Tgnd-collide-with: ~D~%" (-> obj gnd-collide-with)) + (format #t "~1Tpopup: ~f~%" (-> obj popup)) + (format #t "~1Tdont-move-if-overlaps?: ~A~%" (-> obj dont-move-if-overlaps?)) + (format #t "~1Thover-if-no-ground?: ~A~%" (-> obj hover-if-no-ground?)) + (format #t "~1Toverlaps-params: #~%" (-> obj overlaps-params)) + (format #t "~1Tnew-pos: #~%" (-> obj new-pos)) + (format #t "~1Told-gspot-pos: #~%" (-> obj old-gspot-pos)) + (format #t "~1Told-gspot-normal: #~%" (-> obj old-gspot-normal)) + (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "~1Ton-ground?: ~A~%" (-> obj on-ground?)) + (format #t "~1Tdo-move?: ~A~%" (-> obj do-move?)) + (label cfg-4) + obj + ) + +;; definition of type collide-prim-core +(deftype collide-prim-core (structure) + ((world-sphere vector :inline :offset-assert 0) + (collide-as collide-spec :offset-assert 16) + (collide-with uint32 :offset-assert 20) + (action collide-action :offset-assert 24) + (prim-type prim-type :offset-assert 28) + (unused1 uint8 3 :offset-assert 29) + (quad uint128 2 :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type collide-prim-core +(defmethod inspect collide-prim-core ((obj collide-prim-core)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-prim-core) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj world-sphere)) + (format #t "~1Tcollide-as: ~D~%" (-> obj collide-as)) + (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "~1Taction: ~D~%" (-> obj action)) + (format #t "~1Tprim-type: ~D~%" (-> obj prim-type)) + (format #t "~1Tunused1[3] @ #x~X~%" (-> obj unused1)) + (format #t "~1Tquad[2] @ #x~X~%" (-> obj world-sphere)) + (label cfg-4) + obj + ) + +;; definition of type collide-shape-prim +(deftype collide-shape-prim (basic) + ((cshape collide-shape :offset-assert 4) + (prim-id uint32 :offset-assert 8) + (transform-index int8 :offset-assert 12) + (unused2 int8 3 :offset-assert 13) + (prim-core collide-prim-core :inline :offset-assert 16) + (local-sphere vector :inline :offset-assert 48) + (world-sphere vector :inline :offset 16) + (collide-as collide-spec :offset 32) + (collide-with collide-spec :offset 36) + (action collide-action :offset 40) + (prim-type int8 :offset 44) + (radius float :offset 60) + (specific uint8 16 :offset-assert 64) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint int) _type_ 0) + (collide-shape-prim-method-9 () none 9) + (collide-shape-prim-method-10 () none 10) + (collide-shape-prim-method-11 () none 11) + (collide-shape-prim-method-12 () none 12) + (collide-shape-prim-method-13 () none 13) + (collide-shape-prim-method-14 () none 14) + (collide-shape-prim-method-15 () none 15) + (collide-shape-prim-method-16 () none 16) + (collide-shape-prim-method-17 () none 17) + (collide-shape-prim-method-18 () none 18) + (collide-shape-prim-method-19 () none 19) + ) + ) + +;; definition for method 3 of type collide-shape-prim +(defmethod inspect collide-shape-prim ((obj collide-shape-prim)) + (when (not obj) + (set! obj obj) + (goto cfg-146) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcshape: ~A~%" (-> obj cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) + (format #t "~1Tprim-core: #~%" (-> obj prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (-> obj specific)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) + (let ((s5-0 (-> obj prim-core collide-as))) + (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) + (format #t "special-obstacle ") + ) + (if (= (logand (collide-spec bot-targetable) s5-0) (collide-spec bot-targetable)) + (format #t "bot-targetable ") + ) + (if (= (logand s5-0 (collide-spec collectable)) (collide-spec collectable)) + (format #t "collectable ") + ) + (if (= (logand s5-0 (collide-spec projectile)) (collide-spec projectile)) + (format #t "projectile ") + ) + (if (= (logand (collide-spec mech-punch) s5-0) (collide-spec mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-0) (collide-spec vehicle-mesh-probeable)) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand (collide-spec obstacle-for-jak) s5-0) (collide-spec obstacle-for-jak)) + (format #t "obstacle-for-jak ") + ) + (if (= (logand s5-0 (collide-spec bot)) (collide-spec bot)) + (format #t "bot ") + ) + (if (= (logand s5-0 (collide-spec blocking-plane)) (collide-spec blocking-plane)) + (format #t "blocking-plane ") + ) + (if (= (logand s5-0 (collide-spec enemy)) (collide-spec enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-0 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) + (format #t "hit-by-player-list ") + ) + (if (= (logand s5-0 (collide-spec obstacle)) (collide-spec obstacle)) + (format #t "obstacle ") + ) + (if (= (logand (collide-spec jak-vehicle) s5-0) (collide-spec jak-vehicle)) + (format #t "jak-vehicle ") + ) + (if (= (logand (collide-spec vehicle-mesh) s5-0) (collide-spec vehicle-mesh)) + (format #t "vehicle-mesh ") + ) + (if (= (logand s5-0 (collide-spec water)) (collide-spec water)) + (format #t "water ") + ) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-0) (collide-spec notice-blue-eco-powerup)) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand s5-0 (collide-spec civilian)) (collide-spec civilian)) + (format #t "civilian ") + ) + (if (= (logand s5-0 (collide-spec player-list)) (collide-spec player-list)) + (format #t "player-list ") + ) + (if (= (logand s5-0 (collide-spec backgnd)) (collide-spec backgnd)) + (format #t "backgnd ") + ) + (if (= (logand s5-0 (collide-spec jak)) (collide-spec jak)) + (format #t "jak ") + ) + (if (= (logand (collide-spec pusher) s5-0) (collide-spec pusher)) + (format #t "pusher ") + ) + (if (= (logand s5-0 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) + (format #t "jak-vulnerable ") + ) + (if (= (logand (collide-spec camera-blocker) s5-0) (collide-spec camera-blocker)) + (format #t "camera-blocker ") + ) + (if (= (logand s5-0 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) + (format #t "hit-by-others-list ") + ) + (if (= (logand s5-0 (collide-spec crate)) (collide-spec crate)) + (format #t "crate ") + ) + (if (= (logand (collide-spec tobot) s5-0) (collide-spec tobot)) + (format #t "tobot ") + ) + (if (= (logand s5-0 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) + (let ((s5-1 (-> obj prim-core collide-with))) + (if (= (logand #x800000 s5-1) #x800000) + (format #t "special-obstacle ") + ) + (if (= (logand #x200000 s5-1) #x200000) + (format #t "bot-targetable ") + ) + (if (= (logand (the-as int s5-1) 4096) 4096) + (format #t "collectable ") + ) + (if (= (logand (the-as int s5-1) #x4000) #x4000) + (format #t "projectile ") + ) + (if (= (logand #x1000000 s5-1) #x1000000) + (format #t "mech-punch ") + ) + (if (= (logand #x4000000 s5-1) #x4000000) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand #x2000000 s5-1) #x2000000) + (format #t "obstacle-for-jak ") + ) + (if (= (logand (the-as int s5-1) 4) 4) + (format #t "bot ") + ) + (if (= (logand (the-as int s5-1) 8192) 8192) + (format #t "blocking-plane ") + ) + (if (= (logand (the-as int s5-1) 32) 32) + (format #t "enemy ") + ) + (if (= (logand (the-as int s5-1) 256) 256) + (format #t "hit-by-player-list ") + ) + (if (= (logand (the-as int s5-1) 64) 64) + (format #t "obstacle ") + ) + (if (= (logand #x400000 s5-1) #x400000) + (format #t "jak-vehicle ") + ) + (if (= (logand #x100000 s5-1) #x100000) + (format #t "vehicle-mesh ") + ) + (if (= (logand (the-as int s5-1) 2048) 2048) + (format #t "water ") + ) + (if (= (logand #x20000 s5-1) #x20000) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand (the-as int s5-1) 16) 16) + (format #t "civilian ") + ) + (if (= (logand (the-as int s5-1) 1024) 1024) + (format #t "player-list ") + ) + (if (= (logand (the-as int s5-1) 1) 1) + (format #t "backgnd ") + ) + (if (= (logand (the-as int s5-1) 2) 2) + (format #t "jak ") + ) + (if (= (logand #x80000 s5-1) #x80000) + (format #t "pusher ") + ) + (if (= (logand (the-as int s5-1) #x8000) #x8000) + (format #t "jak-vulnerable ") + ) + (if (= (logand #x10000 s5-1) #x10000) + (format #t "camera-blocker ") + ) + (if (= (logand (the-as int s5-1) 512) 512) + (format #t "hit-by-others-list ") + ) + (if (= (logand (the-as int s5-1) 8) 8) + (format #t "crate ") + ) + (if (= (logand #x40000 s5-1) #x40000) + (format #t "tobot ") + ) + (if (= (logand (the-as int s5-1) 128) 128) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) + (let ((s5-2 (-> obj prim-core action))) + (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) + (format #t "deadly ") + ) + (if (= (logand s5-2 (collide-action rideable)) (collide-action rideable)) + (format #t "rideable ") + ) + (if (= (logand s5-2 (collide-action can-ride)) (collide-action can-ride)) + (format #t "can-ride ") + ) + (if (= (logand s5-2 (collide-action persistent-attack)) (collide-action persistent-attack)) + (format #t "persistent-attack ") + ) + (if (= (logand (collide-action nav-sphere) s5-2) (collide-action nav-sphere)) + (format #t "nav-sphere ") + ) + (if (= (logand s5-2 (collide-action block-turn-around)) (collide-action block-turn-around)) + (format #t "block-turn-around ") + ) + (if (= (logand s5-2 (collide-action pull-rider-can-collide)) (collide-action pull-rider-can-collide)) + (format #t "pull-rider-can-collide ") + ) + (if (= (logand s5-2 (collide-action no-standon)) (collide-action no-standon)) + (format #t "no-standon ") + ) + (if (= (logand s5-2 (collide-action dont-push-away)) (collide-action dont-push-away)) + (format #t "dont-push-away ") + ) + (if (= (logand s5-2 (collide-action check-stuck)) (collide-action check-stuck)) + (format #t "check-stuck ") + ) + (if (= (logand s5-2 (collide-action no-smack)) (collide-action no-smack)) + (format #t "no-smack ") + ) + (if (= (logand s5-2 (collide-action semi-solid)) (collide-action semi-solid)) + (format #t "semi-solid ") + ) + (if (= (logand s5-2 (collide-action edge-grabbed)) (collide-action edge-grabbed)) + (format #t "edge-grabbed ") + ) + (if (= (logand s5-2 (collide-action stuck-wall-escape)) (collide-action stuck-wall-escape)) + (format #t "stuck-wall-escape ") + ) + (if (= (logand s5-2 (collide-action check-edge)) (collide-action check-edge)) + (format #t "check-edge ") + ) + (if (= (logand s5-2 (collide-action no-normal-reset)) (collide-action no-normal-reset)) + (format #t "no-normal-reset ") + ) + (if (= (logand s5-2 (collide-action solid)) (collide-action solid)) + (format #t "solid ") + ) + ) + (format #t ")~%") + (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) + (label cfg-146) + obj + ) + +;; definition of type collide-shape-prim-sphere +(deftype collide-shape-prim-sphere (collide-shape-prim) + ((pat pat-surface :offset 64) + (nav-radius float :offset 68) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint) _type_ 0) + ) + ) + +;; definition for method 3 of type collide-shape-prim-sphere +(defmethod inspect collide-shape-prim-sphere ((obj collide-shape-prim-sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-146) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcshape: ~A~%" (-> obj cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) + (format #t "~1Tprim-core: #~%" (-> obj prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (&-> obj pat)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) + (let ((s5-0 (-> obj prim-core collide-as))) + (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) + (format #t "special-obstacle ") + ) + (if (= (logand (collide-spec bot-targetable) s5-0) (collide-spec bot-targetable)) + (format #t "bot-targetable ") + ) + (if (= (logand s5-0 (collide-spec collectable)) (collide-spec collectable)) + (format #t "collectable ") + ) + (if (= (logand s5-0 (collide-spec projectile)) (collide-spec projectile)) + (format #t "projectile ") + ) + (if (= (logand (collide-spec mech-punch) s5-0) (collide-spec mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-0) (collide-spec vehicle-mesh-probeable)) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand (collide-spec obstacle-for-jak) s5-0) (collide-spec obstacle-for-jak)) + (format #t "obstacle-for-jak ") + ) + (if (= (logand s5-0 (collide-spec bot)) (collide-spec bot)) + (format #t "bot ") + ) + (if (= (logand s5-0 (collide-spec blocking-plane)) (collide-spec blocking-plane)) + (format #t "blocking-plane ") + ) + (if (= (logand s5-0 (collide-spec enemy)) (collide-spec enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-0 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) + (format #t "hit-by-player-list ") + ) + (if (= (logand s5-0 (collide-spec obstacle)) (collide-spec obstacle)) + (format #t "obstacle ") + ) + (if (= (logand (collide-spec jak-vehicle) s5-0) (collide-spec jak-vehicle)) + (format #t "jak-vehicle ") + ) + (if (= (logand (collide-spec vehicle-mesh) s5-0) (collide-spec vehicle-mesh)) + (format #t "vehicle-mesh ") + ) + (if (= (logand s5-0 (collide-spec water)) (collide-spec water)) + (format #t "water ") + ) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-0) (collide-spec notice-blue-eco-powerup)) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand s5-0 (collide-spec civilian)) (collide-spec civilian)) + (format #t "civilian ") + ) + (if (= (logand s5-0 (collide-spec player-list)) (collide-spec player-list)) + (format #t "player-list ") + ) + (if (= (logand s5-0 (collide-spec backgnd)) (collide-spec backgnd)) + (format #t "backgnd ") + ) + (if (= (logand s5-0 (collide-spec jak)) (collide-spec jak)) + (format #t "jak ") + ) + (if (= (logand (collide-spec pusher) s5-0) (collide-spec pusher)) + (format #t "pusher ") + ) + (if (= (logand s5-0 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) + (format #t "jak-vulnerable ") + ) + (if (= (logand (collide-spec camera-blocker) s5-0) (collide-spec camera-blocker)) + (format #t "camera-blocker ") + ) + (if (= (logand s5-0 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) + (format #t "hit-by-others-list ") + ) + (if (= (logand s5-0 (collide-spec crate)) (collide-spec crate)) + (format #t "crate ") + ) + (if (= (logand (collide-spec tobot) s5-0) (collide-spec tobot)) + (format #t "tobot ") + ) + (if (= (logand s5-0 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) + (let ((s5-1 (-> obj prim-core collide-with))) + (if (= (logand #x800000 s5-1) #x800000) + (format #t "special-obstacle ") + ) + (if (= (logand #x200000 s5-1) #x200000) + (format #t "bot-targetable ") + ) + (if (= (logand (the-as int s5-1) 4096) 4096) + (format #t "collectable ") + ) + (if (= (logand (the-as int s5-1) #x4000) #x4000) + (format #t "projectile ") + ) + (if (= (logand #x1000000 s5-1) #x1000000) + (format #t "mech-punch ") + ) + (if (= (logand #x4000000 s5-1) #x4000000) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand #x2000000 s5-1) #x2000000) + (format #t "obstacle-for-jak ") + ) + (if (= (logand (the-as int s5-1) 4) 4) + (format #t "bot ") + ) + (if (= (logand (the-as int s5-1) 8192) 8192) + (format #t "blocking-plane ") + ) + (if (= (logand (the-as int s5-1) 32) 32) + (format #t "enemy ") + ) + (if (= (logand (the-as int s5-1) 256) 256) + (format #t "hit-by-player-list ") + ) + (if (= (logand (the-as int s5-1) 64) 64) + (format #t "obstacle ") + ) + (if (= (logand #x400000 s5-1) #x400000) + (format #t "jak-vehicle ") + ) + (if (= (logand #x100000 s5-1) #x100000) + (format #t "vehicle-mesh ") + ) + (if (= (logand (the-as int s5-1) 2048) 2048) + (format #t "water ") + ) + (if (= (logand #x20000 s5-1) #x20000) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand (the-as int s5-1) 16) 16) + (format #t "civilian ") + ) + (if (= (logand (the-as int s5-1) 1024) 1024) + (format #t "player-list ") + ) + (if (= (logand (the-as int s5-1) 1) 1) + (format #t "backgnd ") + ) + (if (= (logand (the-as int s5-1) 2) 2) + (format #t "jak ") + ) + (if (= (logand #x80000 s5-1) #x80000) + (format #t "pusher ") + ) + (if (= (logand (the-as int s5-1) #x8000) #x8000) + (format #t "jak-vulnerable ") + ) + (if (= (logand #x10000 s5-1) #x10000) + (format #t "camera-blocker ") + ) + (if (= (logand (the-as int s5-1) 512) 512) + (format #t "hit-by-others-list ") + ) + (if (= (logand (the-as int s5-1) 8) 8) + (format #t "crate ") + ) + (if (= (logand #x40000 s5-1) #x40000) + (format #t "tobot ") + ) + (if (= (logand (the-as int s5-1) 128) 128) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) + (let ((s5-2 (-> obj prim-core action))) + (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) + (format #t "deadly ") + ) + (if (= (logand s5-2 (collide-action rideable)) (collide-action rideable)) + (format #t "rideable ") + ) + (if (= (logand s5-2 (collide-action can-ride)) (collide-action can-ride)) + (format #t "can-ride ") + ) + (if (= (logand s5-2 (collide-action persistent-attack)) (collide-action persistent-attack)) + (format #t "persistent-attack ") + ) + (if (= (logand (collide-action nav-sphere) s5-2) (collide-action nav-sphere)) + (format #t "nav-sphere ") + ) + (if (= (logand s5-2 (collide-action block-turn-around)) (collide-action block-turn-around)) + (format #t "block-turn-around ") + ) + (if (= (logand s5-2 (collide-action pull-rider-can-collide)) (collide-action pull-rider-can-collide)) + (format #t "pull-rider-can-collide ") + ) + (if (= (logand s5-2 (collide-action no-standon)) (collide-action no-standon)) + (format #t "no-standon ") + ) + (if (= (logand s5-2 (collide-action dont-push-away)) (collide-action dont-push-away)) + (format #t "dont-push-away ") + ) + (if (= (logand s5-2 (collide-action check-stuck)) (collide-action check-stuck)) + (format #t "check-stuck ") + ) + (if (= (logand s5-2 (collide-action no-smack)) (collide-action no-smack)) + (format #t "no-smack ") + ) + (if (= (logand s5-2 (collide-action semi-solid)) (collide-action semi-solid)) + (format #t "semi-solid ") + ) + (if (= (logand s5-2 (collide-action edge-grabbed)) (collide-action edge-grabbed)) + (format #t "edge-grabbed ") + ) + (if (= (logand s5-2 (collide-action stuck-wall-escape)) (collide-action stuck-wall-escape)) + (format #t "stuck-wall-escape ") + ) + (if (= (logand s5-2 (collide-action check-edge)) (collide-action check-edge)) + (format #t "check-edge ") + ) + (if (= (logand s5-2 (collide-action no-normal-reset)) (collide-action no-normal-reset)) + (format #t "no-normal-reset ") + ) + (if (= (logand s5-2 (collide-action solid)) (collide-action solid)) + (format #t "solid ") + ) + ) + (format #t ")~%") + (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) + (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "~1Tnav-radius: ~f~%" (-> obj nav-radius)) + (label cfg-146) + obj + ) + +;; definition of type collide-shape-prim-mesh +(deftype collide-shape-prim-mesh (collide-shape-prim) + ((mesh collide-mesh :offset 64) + (mesh-id int32 :offset 68) + (mesh-cache-id uint32 :offset 72) + (mesh-cache-entry collide-mesh-cache-entry :offset 76) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint uint) _type_ 0) + ) + ) + +;; definition for method 3 of type collide-shape-prim-mesh +(defmethod inspect collide-shape-prim-mesh ((obj collide-shape-prim-mesh)) + (when (not obj) + (set! obj obj) + (goto cfg-146) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcshape: ~A~%" (-> obj cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) + (format #t "~1Tprim-core: #~%" (-> obj prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (&-> obj mesh)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) + (let ((s5-0 (-> obj prim-core collide-as))) + (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) + (format #t "special-obstacle ") + ) + (if (= (logand (collide-spec bot-targetable) s5-0) (collide-spec bot-targetable)) + (format #t "bot-targetable ") + ) + (if (= (logand s5-0 (collide-spec collectable)) (collide-spec collectable)) + (format #t "collectable ") + ) + (if (= (logand s5-0 (collide-spec projectile)) (collide-spec projectile)) + (format #t "projectile ") + ) + (if (= (logand (collide-spec mech-punch) s5-0) (collide-spec mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-0) (collide-spec vehicle-mesh-probeable)) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand (collide-spec obstacle-for-jak) s5-0) (collide-spec obstacle-for-jak)) + (format #t "obstacle-for-jak ") + ) + (if (= (logand s5-0 (collide-spec bot)) (collide-spec bot)) + (format #t "bot ") + ) + (if (= (logand s5-0 (collide-spec blocking-plane)) (collide-spec blocking-plane)) + (format #t "blocking-plane ") + ) + (if (= (logand s5-0 (collide-spec enemy)) (collide-spec enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-0 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) + (format #t "hit-by-player-list ") + ) + (if (= (logand s5-0 (collide-spec obstacle)) (collide-spec obstacle)) + (format #t "obstacle ") + ) + (if (= (logand (collide-spec jak-vehicle) s5-0) (collide-spec jak-vehicle)) + (format #t "jak-vehicle ") + ) + (if (= (logand (collide-spec vehicle-mesh) s5-0) (collide-spec vehicle-mesh)) + (format #t "vehicle-mesh ") + ) + (if (= (logand s5-0 (collide-spec water)) (collide-spec water)) + (format #t "water ") + ) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-0) (collide-spec notice-blue-eco-powerup)) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand s5-0 (collide-spec civilian)) (collide-spec civilian)) + (format #t "civilian ") + ) + (if (= (logand s5-0 (collide-spec player-list)) (collide-spec player-list)) + (format #t "player-list ") + ) + (if (= (logand s5-0 (collide-spec backgnd)) (collide-spec backgnd)) + (format #t "backgnd ") + ) + (if (= (logand s5-0 (collide-spec jak)) (collide-spec jak)) + (format #t "jak ") + ) + (if (= (logand (collide-spec pusher) s5-0) (collide-spec pusher)) + (format #t "pusher ") + ) + (if (= (logand s5-0 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) + (format #t "jak-vulnerable ") + ) + (if (= (logand (collide-spec camera-blocker) s5-0) (collide-spec camera-blocker)) + (format #t "camera-blocker ") + ) + (if (= (logand s5-0 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) + (format #t "hit-by-others-list ") + ) + (if (= (logand s5-0 (collide-spec crate)) (collide-spec crate)) + (format #t "crate ") + ) + (if (= (logand (collide-spec tobot) s5-0) (collide-spec tobot)) + (format #t "tobot ") + ) + (if (= (logand s5-0 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) + (let ((s5-1 (-> obj prim-core collide-with))) + (if (= (logand #x800000 s5-1) #x800000) + (format #t "special-obstacle ") + ) + (if (= (logand #x200000 s5-1) #x200000) + (format #t "bot-targetable ") + ) + (if (= (logand (the-as int s5-1) 4096) 4096) + (format #t "collectable ") + ) + (if (= (logand (the-as int s5-1) #x4000) #x4000) + (format #t "projectile ") + ) + (if (= (logand #x1000000 s5-1) #x1000000) + (format #t "mech-punch ") + ) + (if (= (logand #x4000000 s5-1) #x4000000) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand #x2000000 s5-1) #x2000000) + (format #t "obstacle-for-jak ") + ) + (if (= (logand (the-as int s5-1) 4) 4) + (format #t "bot ") + ) + (if (= (logand (the-as int s5-1) 8192) 8192) + (format #t "blocking-plane ") + ) + (if (= (logand (the-as int s5-1) 32) 32) + (format #t "enemy ") + ) + (if (= (logand (the-as int s5-1) 256) 256) + (format #t "hit-by-player-list ") + ) + (if (= (logand (the-as int s5-1) 64) 64) + (format #t "obstacle ") + ) + (if (= (logand #x400000 s5-1) #x400000) + (format #t "jak-vehicle ") + ) + (if (= (logand #x100000 s5-1) #x100000) + (format #t "vehicle-mesh ") + ) + (if (= (logand (the-as int s5-1) 2048) 2048) + (format #t "water ") + ) + (if (= (logand #x20000 s5-1) #x20000) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand (the-as int s5-1) 16) 16) + (format #t "civilian ") + ) + (if (= (logand (the-as int s5-1) 1024) 1024) + (format #t "player-list ") + ) + (if (= (logand (the-as int s5-1) 1) 1) + (format #t "backgnd ") + ) + (if (= (logand (the-as int s5-1) 2) 2) + (format #t "jak ") + ) + (if (= (logand #x80000 s5-1) #x80000) + (format #t "pusher ") + ) + (if (= (logand (the-as int s5-1) #x8000) #x8000) + (format #t "jak-vulnerable ") + ) + (if (= (logand #x10000 s5-1) #x10000) + (format #t "camera-blocker ") + ) + (if (= (logand (the-as int s5-1) 512) 512) + (format #t "hit-by-others-list ") + ) + (if (= (logand (the-as int s5-1) 8) 8) + (format #t "crate ") + ) + (if (= (logand #x40000 s5-1) #x40000) + (format #t "tobot ") + ) + (if (= (logand (the-as int s5-1) 128) 128) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) + (let ((s5-2 (-> obj prim-core action))) + (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) + (format #t "deadly ") + ) + (if (= (logand s5-2 (collide-action rideable)) (collide-action rideable)) + (format #t "rideable ") + ) + (if (= (logand s5-2 (collide-action can-ride)) (collide-action can-ride)) + (format #t "can-ride ") + ) + (if (= (logand s5-2 (collide-action persistent-attack)) (collide-action persistent-attack)) + (format #t "persistent-attack ") + ) + (if (= (logand (collide-action nav-sphere) s5-2) (collide-action nav-sphere)) + (format #t "nav-sphere ") + ) + (if (= (logand s5-2 (collide-action block-turn-around)) (collide-action block-turn-around)) + (format #t "block-turn-around ") + ) + (if (= (logand s5-2 (collide-action pull-rider-can-collide)) (collide-action pull-rider-can-collide)) + (format #t "pull-rider-can-collide ") + ) + (if (= (logand s5-2 (collide-action no-standon)) (collide-action no-standon)) + (format #t "no-standon ") + ) + (if (= (logand s5-2 (collide-action dont-push-away)) (collide-action dont-push-away)) + (format #t "dont-push-away ") + ) + (if (= (logand s5-2 (collide-action check-stuck)) (collide-action check-stuck)) + (format #t "check-stuck ") + ) + (if (= (logand s5-2 (collide-action no-smack)) (collide-action no-smack)) + (format #t "no-smack ") + ) + (if (= (logand s5-2 (collide-action semi-solid)) (collide-action semi-solid)) + (format #t "semi-solid ") + ) + (if (= (logand s5-2 (collide-action edge-grabbed)) (collide-action edge-grabbed)) + (format #t "edge-grabbed ") + ) + (if (= (logand s5-2 (collide-action stuck-wall-escape)) (collide-action stuck-wall-escape)) + (format #t "stuck-wall-escape ") + ) + (if (= (logand s5-2 (collide-action check-edge)) (collide-action check-edge)) + (format #t "check-edge ") + ) + (if (= (logand s5-2 (collide-action no-normal-reset)) (collide-action no-normal-reset)) + (format #t "no-normal-reset ") + ) + (if (= (logand s5-2 (collide-action solid)) (collide-action solid)) + (format #t "solid ") + ) + ) + (format #t ")~%") + (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) + (format #t "~1Tmesh: ~A~%" (-> obj mesh)) + (format #t "~1Tmesh-id: ~D~%" (-> obj mesh-id)) + (format #t "~1Tmesh-cache-id: ~D~%" (-> obj mesh-cache-id)) + (format #t "~1Tmesh-cache-entry: #~%" (-> obj mesh-cache-entry)) + (label cfg-146) + obj + ) + +;; definition of type collide-shape-prim-group +(deftype collide-shape-prim-group (collide-shape-prim) + ((num-children uint8 :offset 64) + (num-alloc-children uint8 :offset 65) + (child (inline-array collide-shape) :offset 68) + ) + :method-count-assert 20 + :size-assert #x50 + :flag-assert #x1400000050 + (:methods + (new (symbol type collide-shape uint int) _type_ 0) + ) + ) + +;; definition for method 3 of type collide-shape-prim-group +(defmethod inspect collide-shape-prim-group ((obj collide-shape-prim-group)) + (when (not obj) + (set! obj obj) + (goto cfg-146) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcshape: ~A~%" (-> obj cshape)) + (format #t "~1Tprim-id: #x~X~%" (-> obj prim-id)) + (format #t "~1Ttransform-index: ~D~%" (-> obj transform-index)) + (format #t "~1Tunused2[3] @ #x~X~%" (-> obj unused2)) + (format #t "~1Tprim-core: #~%" (-> obj prim-core)) + (format #t "~1Tlocal-sphere: ~`vector`P~%" (-> obj local-sphere)) + (format #t "~1Tspecific[16] @ #x~X~%" (&-> obj num-children)) + (format #t "~1Tworld-sphere: ~`vector`P~%" (-> obj prim-core)) + (format #t "~1Tcollide-as: #x~X : (collide-spec " (-> obj prim-core collide-as)) + (let ((s5-0 (-> obj prim-core collide-as))) + (if (= (logand (collide-spec special-obstacle) s5-0) (collide-spec special-obstacle)) + (format #t "special-obstacle ") + ) + (if (= (logand (collide-spec bot-targetable) s5-0) (collide-spec bot-targetable)) + (format #t "bot-targetable ") + ) + (if (= (logand s5-0 (collide-spec collectable)) (collide-spec collectable)) + (format #t "collectable ") + ) + (if (= (logand s5-0 (collide-spec projectile)) (collide-spec projectile)) + (format #t "projectile ") + ) + (if (= (logand (collide-spec mech-punch) s5-0) (collide-spec mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (collide-spec vehicle-mesh-probeable) s5-0) (collide-spec vehicle-mesh-probeable)) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand (collide-spec obstacle-for-jak) s5-0) (collide-spec obstacle-for-jak)) + (format #t "obstacle-for-jak ") + ) + (if (= (logand s5-0 (collide-spec bot)) (collide-spec bot)) + (format #t "bot ") + ) + (if (= (logand s5-0 (collide-spec blocking-plane)) (collide-spec blocking-plane)) + (format #t "blocking-plane ") + ) + (if (= (logand s5-0 (collide-spec enemy)) (collide-spec enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-0 (collide-spec hit-by-player-list)) (collide-spec hit-by-player-list)) + (format #t "hit-by-player-list ") + ) + (if (= (logand s5-0 (collide-spec obstacle)) (collide-spec obstacle)) + (format #t "obstacle ") + ) + (if (= (logand (collide-spec jak-vehicle) s5-0) (collide-spec jak-vehicle)) + (format #t "jak-vehicle ") + ) + (if (= (logand (collide-spec vehicle-mesh) s5-0) (collide-spec vehicle-mesh)) + (format #t "vehicle-mesh ") + ) + (if (= (logand s5-0 (collide-spec water)) (collide-spec water)) + (format #t "water ") + ) + (if (= (logand (collide-spec notice-blue-eco-powerup) s5-0) (collide-spec notice-blue-eco-powerup)) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand s5-0 (collide-spec civilian)) (collide-spec civilian)) + (format #t "civilian ") + ) + (if (= (logand s5-0 (collide-spec player-list)) (collide-spec player-list)) + (format #t "player-list ") + ) + (if (= (logand s5-0 (collide-spec backgnd)) (collide-spec backgnd)) + (format #t "backgnd ") + ) + (if (= (logand s5-0 (collide-spec jak)) (collide-spec jak)) + (format #t "jak ") + ) + (if (= (logand (collide-spec pusher) s5-0) (collide-spec pusher)) + (format #t "pusher ") + ) + (if (= (logand s5-0 (collide-spec jak-vulnerable)) (collide-spec jak-vulnerable)) + (format #t "jak-vulnerable ") + ) + (if (= (logand (collide-spec camera-blocker) s5-0) (collide-spec camera-blocker)) + (format #t "camera-blocker ") + ) + (if (= (logand s5-0 (collide-spec hit-by-others-list)) (collide-spec hit-by-others-list)) + (format #t "hit-by-others-list ") + ) + (if (= (logand s5-0 (collide-spec crate)) (collide-spec crate)) + (format #t "crate ") + ) + (if (= (logand (collide-spec tobot) s5-0) (collide-spec tobot)) + (format #t "tobot ") + ) + (if (= (logand s5-0 (collide-spec vehicle-sphere)) (collide-spec vehicle-sphere)) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Tcollide-with: #x~X : (collide-spec " (-> obj prim-core collide-with)) + (let ((s5-1 (-> obj prim-core collide-with))) + (if (= (logand #x800000 s5-1) #x800000) + (format #t "special-obstacle ") + ) + (if (= (logand #x200000 s5-1) #x200000) + (format #t "bot-targetable ") + ) + (if (= (logand (the-as int s5-1) 4096) 4096) + (format #t "collectable ") + ) + (if (= (logand (the-as int s5-1) #x4000) #x4000) + (format #t "projectile ") + ) + (if (= (logand #x1000000 s5-1) #x1000000) + (format #t "mech-punch ") + ) + (if (= (logand #x4000000 s5-1) #x4000000) + (format #t "vehicle-mesh-probeable ") + ) + (if (= (logand #x2000000 s5-1) #x2000000) + (format #t "obstacle-for-jak ") + ) + (if (= (logand (the-as int s5-1) 4) 4) + (format #t "bot ") + ) + (if (= (logand (the-as int s5-1) 8192) 8192) + (format #t "blocking-plane ") + ) + (if (= (logand (the-as int s5-1) 32) 32) + (format #t "enemy ") + ) + (if (= (logand (the-as int s5-1) 256) 256) + (format #t "hit-by-player-list ") + ) + (if (= (logand (the-as int s5-1) 64) 64) + (format #t "obstacle ") + ) + (if (= (logand #x400000 s5-1) #x400000) + (format #t "jak-vehicle ") + ) + (if (= (logand #x100000 s5-1) #x100000) + (format #t "vehicle-mesh ") + ) + (if (= (logand (the-as int s5-1) 2048) 2048) + (format #t "water ") + ) + (if (= (logand #x20000 s5-1) #x20000) + (format #t "notice-blue-eco-powerup ") + ) + (if (= (logand (the-as int s5-1) 16) 16) + (format #t "civilian ") + ) + (if (= (logand (the-as int s5-1) 1024) 1024) + (format #t "player-list ") + ) + (if (= (logand (the-as int s5-1) 1) 1) + (format #t "backgnd ") + ) + (if (= (logand (the-as int s5-1) 2) 2) + (format #t "jak ") + ) + (if (= (logand #x80000 s5-1) #x80000) + (format #t "pusher ") + ) + (if (= (logand (the-as int s5-1) #x8000) #x8000) + (format #t "jak-vulnerable ") + ) + (if (= (logand #x10000 s5-1) #x10000) + (format #t "camera-blocker ") + ) + (if (= (logand (the-as int s5-1) 512) 512) + (format #t "hit-by-others-list ") + ) + (if (= (logand (the-as int s5-1) 8) 8) + (format #t "crate ") + ) + (if (= (logand #x40000 s5-1) #x40000) + (format #t "tobot ") + ) + (if (= (logand (the-as int s5-1) 128) 128) + (format #t "vehicle-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Taction: #x~X : (collide-action " (-> obj prim-core action)) + (let ((s5-2 (-> obj prim-core action))) + (if (= (logand s5-2 (collide-action deadly)) (collide-action deadly)) + (format #t "deadly ") + ) + (if (= (logand s5-2 (collide-action rideable)) (collide-action rideable)) + (format #t "rideable ") + ) + (if (= (logand s5-2 (collide-action can-ride)) (collide-action can-ride)) + (format #t "can-ride ") + ) + (if (= (logand s5-2 (collide-action persistent-attack)) (collide-action persistent-attack)) + (format #t "persistent-attack ") + ) + (if (= (logand (collide-action nav-sphere) s5-2) (collide-action nav-sphere)) + (format #t "nav-sphere ") + ) + (if (= (logand s5-2 (collide-action block-turn-around)) (collide-action block-turn-around)) + (format #t "block-turn-around ") + ) + (if (= (logand s5-2 (collide-action pull-rider-can-collide)) (collide-action pull-rider-can-collide)) + (format #t "pull-rider-can-collide ") + ) + (if (= (logand s5-2 (collide-action no-standon)) (collide-action no-standon)) + (format #t "no-standon ") + ) + (if (= (logand s5-2 (collide-action dont-push-away)) (collide-action dont-push-away)) + (format #t "dont-push-away ") + ) + (if (= (logand s5-2 (collide-action check-stuck)) (collide-action check-stuck)) + (format #t "check-stuck ") + ) + (if (= (logand s5-2 (collide-action no-smack)) (collide-action no-smack)) + (format #t "no-smack ") + ) + (if (= (logand s5-2 (collide-action semi-solid)) (collide-action semi-solid)) + (format #t "semi-solid ") + ) + (if (= (logand s5-2 (collide-action edge-grabbed)) (collide-action edge-grabbed)) + (format #t "edge-grabbed ") + ) + (if (= (logand s5-2 (collide-action stuck-wall-escape)) (collide-action stuck-wall-escape)) + (format #t "stuck-wall-escape ") + ) + (if (= (logand s5-2 (collide-action check-edge)) (collide-action check-edge)) + (format #t "check-edge ") + ) + (if (= (logand s5-2 (collide-action no-normal-reset)) (collide-action no-normal-reset)) + (format #t "no-normal-reset ") + ) + (if (= (logand s5-2 (collide-action solid)) (collide-action solid)) + (format #t "solid ") + ) + ) + (format #t ")~%") + (format #t "~1Tprim-type: ~D~%" (-> obj prim-core prim-type)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj local-sphere w)) + (format #t "~1Tnum-children: ~D~%" (-> obj num-children)) + (format #t "~1Tnum-alloc-children: ~D~%" (-> obj num-alloc-children)) + (format #t "~1Tchild: #x~X~%" (-> obj child)) + (label cfg-146) + obj + ) + +;; definition of type collide-shape +(deftype collide-shape (trsqv) + ((actor-hash-index int16 :offset 12) + (process process :offset-assert 140) + (max-iteration-count uint8 :offset-assert 144) + (nav-flags uint8 :offset-assert 145) + (total-prims uint8 :offset-assert 146) + (num-riders uint8 :offset-assert 147) + (pat-ignore-mask pat-surface :offset-assert 148) + (event-self symbol :offset-assert 152) + (event-other symbol :offset-assert 156) + (root-prim collide-shape-prim :offset-assert 160) + (riders pointer :offset-assert 164) + (penetrate-using penetrate :offset-assert 168) + (penetrated-by penetrate :offset-assert 176) + (backup-collide-as collide-spec :offset-assert 184) + (backup-collde-with collide-spec :offset-assert 188) + (event-priority uint8 :offset-assert 192) + (rider-max-momentum float :offset-assert 196) + ) + :method-count-assert 55 + :size-assert #xc8 + :flag-assert #x37000000c8 + (:methods + (new (symbol type process-drawable collide-list-enum) _type_ 0) + (collide-shape-method-28 () none 28) + (collide-shape-method-29 () none 29) + (collide-shape-method-30 () none 30) + (collide-shape-method-31 () none 31) + (collide-shape-method-32 () none 32) + (collide-shape-method-33 () none 33) + (collide-shape-method-34 () none 34) + (collide-shape-method-35 () none 35) + (collide-shape-method-36 () none 36) + (collide-shape-method-37 () none 37) + (collide-shape-method-38 () none 38) + (collide-shape-method-39 () none 39) + (collide-shape-method-40 () none 40) + (collide-shape-method-41 () none 41) + (collide-shape-method-42 () none 42) + (collide-shape-method-43 () none 43) + (collide-shape-method-44 () none 44) + (collide-shape-method-45 () none 45) + (collide-shape-method-46 () none 46) + (collide-shape-method-47 () none 47) + (collide-shape-method-48 () none 48) + (collide-shape-method-49 () none 49) + (collide-shape-method-50 () none 50) + (collide-shape-method-51 () none 51) + (collide-shape-method-52 () none 52) + (collide-shape-method-53 () none 53) + (collide-shape-method-54 () none 54) + ) + ) + +;; definition for method 3 of type collide-shape +(defmethod inspect collide-shape ((obj collide-shape)) + (when (not obj) + (set! obj obj) + (goto cfg-136) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> obj transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> obj rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> obj scalev)) + (format #t "~1Tdir-targ: #~%" (-> obj dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> obj angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) + (format #t "~1Tactor-hash-index: ~D~%" (-> obj actor-hash-index)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tmax-iteration-count: ~D~%" (-> obj max-iteration-count)) + (format #t "~1Tnav-flags: ~D~%" (-> obj nav-flags)) + (format #t "~1Ttotal-prims: ~D~%" (-> obj total-prims)) + (format #t "~1Tnum-riders: ~D~%" (-> obj num-riders)) + (format #t "~1Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask)) + (format #t "~1Tevent-self: ~A~%" (-> obj event-self)) + (format #t "~1Tevent-other: ~A~%" (-> obj event-other)) + (format #t "~1Troot-prim: ~A~%" (-> obj root-prim)) + (format #t "~1Triders: #x~X~%" (-> obj riders)) + (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> obj penetrate-using)) + (let ((s5-0 (-> obj penetrate-using))) + (if (= (logand s5-0 (penetrate mech-bonk)) (penetrate mech-bonk)) + (format #t "mech-bonk ") + ) + (if (= (logand (penetrate eco-blue) s5-0) (penetrate eco-blue)) + (format #t "eco-blue ") + ) + (if (= (logand (penetrate explode) s5-0) (penetrate explode)) + (format #t "explode ") + ) + (if (= (logand s5-0 (penetrate bonk)) (penetrate bonk)) + (format #t "bonk ") + ) + (if (= (logand (penetrate eco-red) s5-0) (penetrate eco-red)) + (format #t "eco-red ") + ) + (if (= (logand s5-0 (penetrate roll)) (penetrate roll)) + (format #t "roll ") + ) + (if (= (logand s5-0 (penetrate mech)) (penetrate mech)) + (format #t "mech ") + ) + (if (= (logand s5-0 (penetrate flut-attack)) (penetrate flut-attack)) + (format #t "flut-attack ") + ) + (if (= (logand s5-0 (penetrate mech-punch)) (penetrate mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (penetrate jak-dark-shot) s5-0) (penetrate jak-dark-shot)) + (format #t "jak-dark-shot ") + ) + (if (= (logand s5-0 (penetrate flop)) (penetrate flop)) + (format #t "flop ") + ) + (if (= (logand s5-0 (penetrate spin)) (penetrate spin)) + (format #t "spin ") + ) + (if (= (logand (penetrate dark-bomb) s5-0) (penetrate dark-bomb)) + (format #t "dark-bomb ") + ) + (if (= (logand s5-0 (penetrate vehicle)) (penetrate vehicle)) + (format #t "vehicle ") + ) + (if (= (logand s5-0 (penetrate generic-attack)) (penetrate generic-attack)) + (format #t "generic-attack ") + ) + (if (= (logand s5-0 (penetrate touch)) (penetrate touch)) + (format #t "touch ") + ) + (if (= (logand (penetrate eco-green) s5-0) (shl #x8000 16)) + (format #t "eco-green ") + ) + (if (= (logand (penetrate jak-red-shot) s5-0) (penetrate jak-red-shot)) + (format #t "jak-red-shot ") + ) + (if (= (logand s5-0 (penetrate lunge)) (penetrate lunge)) + (format #t "lunge ") + ) + (if (= (logand s5-0 (penetrate punch)) (penetrate punch)) + (format #t "punch ") + ) + (if (= (logand s5-0 (penetrate tube)) (penetrate tube)) + (format #t "tube ") + ) + (if (= (logand (penetrate enemy-yellow-shot) s5-0) (penetrate enemy-yellow-shot)) + (format #t "enemy-yellow-shot ") + ) + (if (= (logand (penetrate knocked) s5-0) (shl 1 32)) + (format #t "knocked ") + ) + (if (= (logand (penetrate dark-giant) s5-0) (penetrate dark-giant)) + (format #t "dark-giant ") + ) + (if (= (logand s5-0 (penetrate uppercut)) (penetrate uppercut)) + (format #t "uppercut ") + ) + (if (= (logand (penetrate dark-punch) s5-0) (penetrate dark-punch)) + (format #t "dark-punch ") + ) + (if (= (logand (penetrate shield) s5-0) (penetrate shield)) + (format #t "shield ") + ) + (if (= (logand (penetrate jak-yellow-shot) s5-0) (penetrate jak-yellow-shot)) + (format #t "jak-yellow-shot ") + ) + (if (= (logand s5-0 (penetrate board)) (penetrate board)) + (format #t "board ") + ) + (if (= (logand (penetrate eco-yellow) s5-0) (penetrate eco-yellow)) + (format #t "eco-yellow ") + ) + (if (= (logand (penetrate dark-skin) s5-0) (penetrate dark-skin)) + (format #t "dark-skin ") + ) + (if (= (logand (penetrate enemy-dark-shot) s5-0) (penetrate enemy-dark-shot)) + (format #t "enemy-dark-shot ") + ) + (if (= (logand (penetrate jak-blue-shot) s5-0) (penetrate jak-blue-shot)) + (format #t "jak-blue-shot ") + ) + ) + (format #t ")~%") + (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> obj penetrated-by)) + (let ((s5-1 (-> obj penetrated-by))) + (if (= (logand s5-1 (penetrate mech-bonk)) (penetrate mech-bonk)) + (format #t "mech-bonk ") + ) + (if (= (logand (penetrate eco-blue) s5-1) (penetrate eco-blue)) + (format #t "eco-blue ") + ) + (if (= (logand (penetrate explode) s5-1) (penetrate explode)) + (format #t "explode ") + ) + (if (= (logand s5-1 (penetrate bonk)) (penetrate bonk)) + (format #t "bonk ") + ) + (if (= (logand (penetrate eco-red) s5-1) (penetrate eco-red)) + (format #t "eco-red ") + ) + (if (= (logand s5-1 (penetrate roll)) (penetrate roll)) + (format #t "roll ") + ) + (if (= (logand s5-1 (penetrate mech)) (penetrate mech)) + (format #t "mech ") + ) + (if (= (logand s5-1 (penetrate flut-attack)) (penetrate flut-attack)) + (format #t "flut-attack ") + ) + (if (= (logand s5-1 (penetrate mech-punch)) (penetrate mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (penetrate jak-dark-shot) s5-1) (penetrate jak-dark-shot)) + (format #t "jak-dark-shot ") + ) + (if (= (logand s5-1 (penetrate flop)) (penetrate flop)) + (format #t "flop ") + ) + (if (= (logand s5-1 (penetrate spin)) (penetrate spin)) + (format #t "spin ") + ) + (if (= (logand (penetrate dark-bomb) s5-1) (penetrate dark-bomb)) + (format #t "dark-bomb ") + ) + (if (= (logand s5-1 (penetrate vehicle)) (penetrate vehicle)) + (format #t "vehicle ") + ) + (if (= (logand s5-1 (penetrate generic-attack)) (penetrate generic-attack)) + (format #t "generic-attack ") + ) + (if (= (logand s5-1 (penetrate touch)) (penetrate touch)) + (format #t "touch ") + ) + (if (= (logand (penetrate eco-green) s5-1) (shl #x8000 16)) + (format #t "eco-green ") + ) + (if (= (logand (penetrate jak-red-shot) s5-1) (penetrate jak-red-shot)) + (format #t "jak-red-shot ") + ) + (if (= (logand s5-1 (penetrate lunge)) (penetrate lunge)) + (format #t "lunge ") + ) + (if (= (logand s5-1 (penetrate punch)) (penetrate punch)) + (format #t "punch ") + ) + (if (= (logand s5-1 (penetrate tube)) (penetrate tube)) + (format #t "tube ") + ) + (if (= (logand (penetrate enemy-yellow-shot) s5-1) (penetrate enemy-yellow-shot)) + (format #t "enemy-yellow-shot ") + ) + (if (= (logand (penetrate knocked) s5-1) (shl 1 32)) + (format #t "knocked ") + ) + (if (= (logand (penetrate dark-giant) s5-1) (penetrate dark-giant)) + (format #t "dark-giant ") + ) + (if (= (logand s5-1 (penetrate uppercut)) (penetrate uppercut)) + (format #t "uppercut ") + ) + (if (= (logand (penetrate dark-punch) s5-1) (penetrate dark-punch)) + (format #t "dark-punch ") + ) + (if (= (logand (penetrate shield) s5-1) (penetrate shield)) + (format #t "shield ") + ) + (if (= (logand (penetrate jak-yellow-shot) s5-1) (penetrate jak-yellow-shot)) + (format #t "jak-yellow-shot ") + ) + (if (= (logand s5-1 (penetrate board)) (penetrate board)) + (format #t "board ") + ) + (if (= (logand (penetrate eco-yellow) s5-1) (penetrate eco-yellow)) + (format #t "eco-yellow ") + ) + (if (= (logand (penetrate dark-skin) s5-1) (penetrate dark-skin)) + (format #t "dark-skin ") + ) + (if (= (logand (penetrate enemy-dark-shot) s5-1) (penetrate enemy-dark-shot)) + (format #t "enemy-dark-shot ") + ) + (if (= (logand (penetrate jak-blue-shot) s5-1) (penetrate jak-blue-shot)) + (format #t "jak-blue-shot ") + ) + ) + (format #t ")~%") + (format #t "~1Tbackup-collide-as: ~D~%" (-> obj backup-collide-as)) + (format #t "~1Tbackup-collide-with: ~D~%" (-> obj backup-collde-with)) + (format #t "~1Tevent-priority: ~D~%" (-> obj event-priority)) + (format #t "~1Trider-max-momentum: ~f~%" (-> obj rider-max-momentum)) + (label cfg-136) + obj + ) + +;; definition of type collide-shape-moving +(deftype collide-shape-moving (collide-shape) + ((rider-time time-frame :offset-assert 200) + (rider-last-move vector :inline :offset-assert 208) + (trans-old vector :inline :offset-assert 224) + (poly-pat pat-surface :offset 272) + (cur-pat pat-surface :offset-assert 276) + (ground-pat pat-surface :offset-assert 280) + (status cshape-moving-flags :offset-assert 288) + (old-status cshape-moving-flags :offset-assert 296) + (prev-status cshape-moving-flags :offset-assert 304) + (reaction-flag cshape-reaction-flags :offset-assert 312) + (reaction function :offset-assert 316) + (no-reaction function :offset-assert 320) + (local-normal vector :inline :offset-assert 336) + (surface-normal vector :inline :offset-assert 352) + (poly-normal vector :inline :offset-assert 368) + (ground-poly-normal vector :inline :offset-assert 384) + (gspot-pos vector :inline :offset-assert 400) + (gspot-normal vector :inline :offset-assert 416) + (grount-touch-point vector :inline :offset-assert 432) + (ground-impact-vel meters :offset-assert 448) + (surface-angle float :offset-assert 452) + (poly-angle float :offset-assert 456) + (touch-angle float :offset-assert 460) + (coverage float :offset-assert 464) + (dynam dynamics :offset-assert 468) + (surf surface :offset-assert 472) + ) + :method-count-assert 68 + :size-assert #x1dc + :flag-assert #x44000001dc + (:methods + (collide-shape-moving-method-55 () none 55) + (collide-shape-moving-method-56 () none 56) + (collide-shape-moving-method-57 () none 57) + (collide-shape-moving-method-58 () none 58) + (collide-shape-moving-method-59 () none 59) + (collide-shape-moving-method-60 () none 60) + (collide-shape-moving-method-61 () none 61) + (collide-shape-moving-method-62 () none 62) + (collide-shape-moving-method-63 () none 63) + (collide-shape-moving-method-64 () none 64) + (collide-shape-moving-method-65 () none 65) + (collide-shape-moving-method-66 () none 66) + (collide-shape-moving-method-67 () none 67) + ) + ) + +;; definition for method 3 of type collide-shape-moving +(defmethod inspect collide-shape-moving ((obj collide-shape-moving)) + (when (not obj) + (set! obj obj) + (goto cfg-136) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> obj transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> obj rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> obj scalev)) + (format #t "~1Tdir-targ: #~%" (-> obj dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> obj angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) + (format #t "~1Tactor-hash-index: ~D~%" (-> obj actor-hash-index)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tmax-iteration-count: ~D~%" (-> obj max-iteration-count)) + (format #t "~1Tnav-flags: ~D~%" (-> obj nav-flags)) + (format #t "~1Ttotal-prims: ~D~%" (-> obj total-prims)) + (format #t "~1Tnum-riders: ~D~%" (-> obj num-riders)) + (format #t "~1Tpat-ignore-mask: ~D~%" (-> obj pat-ignore-mask)) + (format #t "~1Tevent-self: ~A~%" (-> obj event-self)) + (format #t "~1Tevent-other: ~A~%" (-> obj event-other)) + (format #t "~1Troot-prim: ~A~%" (-> obj root-prim)) + (format #t "~1Triders: #x~X~%" (-> obj riders)) + (format #t "~1Tpenetrate-using: #x~X : (penetrate " (-> obj penetrate-using)) + (let ((s5-0 (-> obj penetrate-using))) + (if (= (logand s5-0 (penetrate mech-bonk)) (penetrate mech-bonk)) + (format #t "mech-bonk ") + ) + (if (= (logand (penetrate eco-blue) s5-0) (penetrate eco-blue)) + (format #t "eco-blue ") + ) + (if (= (logand (penetrate explode) s5-0) (penetrate explode)) + (format #t "explode ") + ) + (if (= (logand s5-0 (penetrate bonk)) (penetrate bonk)) + (format #t "bonk ") + ) + (if (= (logand (penetrate eco-red) s5-0) (penetrate eco-red)) + (format #t "eco-red ") + ) + (if (= (logand s5-0 (penetrate roll)) (penetrate roll)) + (format #t "roll ") + ) + (if (= (logand s5-0 (penetrate mech)) (penetrate mech)) + (format #t "mech ") + ) + (if (= (logand s5-0 (penetrate flut-attack)) (penetrate flut-attack)) + (format #t "flut-attack ") + ) + (if (= (logand s5-0 (penetrate mech-punch)) (penetrate mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (penetrate jak-dark-shot) s5-0) (penetrate jak-dark-shot)) + (format #t "jak-dark-shot ") + ) + (if (= (logand s5-0 (penetrate flop)) (penetrate flop)) + (format #t "flop ") + ) + (if (= (logand s5-0 (penetrate spin)) (penetrate spin)) + (format #t "spin ") + ) + (if (= (logand (penetrate dark-bomb) s5-0) (penetrate dark-bomb)) + (format #t "dark-bomb ") + ) + (if (= (logand s5-0 (penetrate vehicle)) (penetrate vehicle)) + (format #t "vehicle ") + ) + (if (= (logand s5-0 (penetrate generic-attack)) (penetrate generic-attack)) + (format #t "generic-attack ") + ) + (if (= (logand s5-0 (penetrate touch)) (penetrate touch)) + (format #t "touch ") + ) + (if (= (logand (penetrate eco-green) s5-0) (shl #x8000 16)) + (format #t "eco-green ") + ) + (if (= (logand (penetrate jak-red-shot) s5-0) (penetrate jak-red-shot)) + (format #t "jak-red-shot ") + ) + (if (= (logand s5-0 (penetrate lunge)) (penetrate lunge)) + (format #t "lunge ") + ) + (if (= (logand s5-0 (penetrate punch)) (penetrate punch)) + (format #t "punch ") + ) + (if (= (logand s5-0 (penetrate tube)) (penetrate tube)) + (format #t "tube ") + ) + (if (= (logand (penetrate enemy-yellow-shot) s5-0) (penetrate enemy-yellow-shot)) + (format #t "enemy-yellow-shot ") + ) + (if (= (logand (penetrate knocked) s5-0) (shl 1 32)) + (format #t "knocked ") + ) + (if (= (logand (penetrate dark-giant) s5-0) (penetrate dark-giant)) + (format #t "dark-giant ") + ) + (if (= (logand s5-0 (penetrate uppercut)) (penetrate uppercut)) + (format #t "uppercut ") + ) + (if (= (logand (penetrate dark-punch) s5-0) (penetrate dark-punch)) + (format #t "dark-punch ") + ) + (if (= (logand (penetrate shield) s5-0) (penetrate shield)) + (format #t "shield ") + ) + (if (= (logand (penetrate jak-yellow-shot) s5-0) (penetrate jak-yellow-shot)) + (format #t "jak-yellow-shot ") + ) + (if (= (logand s5-0 (penetrate board)) (penetrate board)) + (format #t "board ") + ) + (if (= (logand (penetrate eco-yellow) s5-0) (penetrate eco-yellow)) + (format #t "eco-yellow ") + ) + (if (= (logand (penetrate dark-skin) s5-0) (penetrate dark-skin)) + (format #t "dark-skin ") + ) + (if (= (logand (penetrate enemy-dark-shot) s5-0) (penetrate enemy-dark-shot)) + (format #t "enemy-dark-shot ") + ) + (if (= (logand (penetrate jak-blue-shot) s5-0) (penetrate jak-blue-shot)) + (format #t "jak-blue-shot ") + ) + ) + (format #t ")~%") + (format #t "~1Tpenetrated-by: #x~X : (penetrate " (-> obj penetrated-by)) + (let ((s5-1 (-> obj penetrated-by))) + (if (= (logand s5-1 (penetrate mech-bonk)) (penetrate mech-bonk)) + (format #t "mech-bonk ") + ) + (if (= (logand (penetrate eco-blue) s5-1) (penetrate eco-blue)) + (format #t "eco-blue ") + ) + (if (= (logand (penetrate explode) s5-1) (penetrate explode)) + (format #t "explode ") + ) + (if (= (logand s5-1 (penetrate bonk)) (penetrate bonk)) + (format #t "bonk ") + ) + (if (= (logand (penetrate eco-red) s5-1) (penetrate eco-red)) + (format #t "eco-red ") + ) + (if (= (logand s5-1 (penetrate roll)) (penetrate roll)) + (format #t "roll ") + ) + (if (= (logand s5-1 (penetrate mech)) (penetrate mech)) + (format #t "mech ") + ) + (if (= (logand s5-1 (penetrate flut-attack)) (penetrate flut-attack)) + (format #t "flut-attack ") + ) + (if (= (logand s5-1 (penetrate mech-punch)) (penetrate mech-punch)) + (format #t "mech-punch ") + ) + (if (= (logand (penetrate jak-dark-shot) s5-1) (penetrate jak-dark-shot)) + (format #t "jak-dark-shot ") + ) + (if (= (logand s5-1 (penetrate flop)) (penetrate flop)) + (format #t "flop ") + ) + (if (= (logand s5-1 (penetrate spin)) (penetrate spin)) + (format #t "spin ") + ) + (if (= (logand (penetrate dark-bomb) s5-1) (penetrate dark-bomb)) + (format #t "dark-bomb ") + ) + (if (= (logand s5-1 (penetrate vehicle)) (penetrate vehicle)) + (format #t "vehicle ") + ) + (if (= (logand s5-1 (penetrate generic-attack)) (penetrate generic-attack)) + (format #t "generic-attack ") + ) + (if (= (logand s5-1 (penetrate touch)) (penetrate touch)) + (format #t "touch ") + ) + (if (= (logand (penetrate eco-green) s5-1) (shl #x8000 16)) + (format #t "eco-green ") + ) + (if (= (logand (penetrate jak-red-shot) s5-1) (penetrate jak-red-shot)) + (format #t "jak-red-shot ") + ) + (if (= (logand s5-1 (penetrate lunge)) (penetrate lunge)) + (format #t "lunge ") + ) + (if (= (logand s5-1 (penetrate punch)) (penetrate punch)) + (format #t "punch ") + ) + (if (= (logand s5-1 (penetrate tube)) (penetrate tube)) + (format #t "tube ") + ) + (if (= (logand (penetrate enemy-yellow-shot) s5-1) (penetrate enemy-yellow-shot)) + (format #t "enemy-yellow-shot ") + ) + (if (= (logand (penetrate knocked) s5-1) (shl 1 32)) + (format #t "knocked ") + ) + (if (= (logand (penetrate dark-giant) s5-1) (penetrate dark-giant)) + (format #t "dark-giant ") + ) + (if (= (logand s5-1 (penetrate uppercut)) (penetrate uppercut)) + (format #t "uppercut ") + ) + (if (= (logand (penetrate dark-punch) s5-1) (penetrate dark-punch)) + (format #t "dark-punch ") + ) + (if (= (logand (penetrate shield) s5-1) (penetrate shield)) + (format #t "shield ") + ) + (if (= (logand (penetrate jak-yellow-shot) s5-1) (penetrate jak-yellow-shot)) + (format #t "jak-yellow-shot ") + ) + (if (= (logand s5-1 (penetrate board)) (penetrate board)) + (format #t "board ") + ) + (if (= (logand (penetrate eco-yellow) s5-1) (penetrate eco-yellow)) + (format #t "eco-yellow ") + ) + (if (= (logand (penetrate dark-skin) s5-1) (penetrate dark-skin)) + (format #t "dark-skin ") + ) + (if (= (logand (penetrate enemy-dark-shot) s5-1) (penetrate enemy-dark-shot)) + (format #t "enemy-dark-shot ") + ) + (if (= (logand (penetrate jak-blue-shot) s5-1) (penetrate jak-blue-shot)) + (format #t "jak-blue-shot ") + ) + ) + (format #t ")~%") + (format #t "~1Tbackup-collide-as: ~D~%" (-> obj backup-collide-as)) + (format #t "~1Tbackup-collide-with: ~D~%" (-> obj backup-collde-with)) + (format #t "~1Tevent-priority: ~D~%" (-> obj event-priority)) + (format #t "~1Trider-max-momentum: ~f~%" (-> obj rider-max-momentum)) + (format #t "~1Trider-time: ~D~%" (-> obj rider-time)) + (format #t "~1Trider-last-move: ~`vector`P~%" (-> obj rider-last-move)) + (format #t "~1Ttrans-old: ~`vector`P~%" (-> obj trans-old)) + (format #t "~1Tpoly-pat: #x~X~%" (-> obj poly-pat)) + (format #t "~1Tcur-pat: #x~X~%" (-> obj cur-pat)) + (format #t "~1Tground-pat: #x~X~%" (-> obj ground-pat)) + (format #t "~1Tstatus: ~D~%" (-> obj status)) + (format #t "~1Told-status: ~D~%" (-> obj old-status)) + (format #t "~1Tprev-status: ~D~%" (-> obj prev-status)) + (format #t "~1Treaction-flag: ~D~%" (-> obj reaction-flag)) + (format #t "~1Treaction: ~A~%" (-> obj reaction)) + (format #t "~1Tno-reaction: ~A~%" (-> obj no-reaction)) + (format #t "~1Tlocal-normal: ~`vector`P~%" (-> obj local-normal)) + (format #t "~1Tsurface-normal: ~`vector`P~%" (-> obj surface-normal)) + (format #t "~1Tpoly-normal: ~`vector`P~%" (-> obj poly-normal)) + (format #t "~1Tground-poly-normal: ~`vector`P~%" (-> obj ground-poly-normal)) + (format #t "~1Tgspot-pos: ~`vector`P~%" (-> obj gspot-pos)) + (format #t "~1Tgspot-normal: ~`vector`P~%" (-> obj gspot-normal)) + (format #t "~1Tground-touch-point: ~`vector`P~%" (-> obj grount-touch-point)) + (format #t "~1Tground-impact-vel: (meters ~m)~%" (-> obj ground-impact-vel)) + (format #t "~1Tsurface-angle: ~f~%" (-> obj surface-angle)) + (format #t "~1Tpoly-angle: ~f~%" (-> obj poly-angle)) + (format #t "~1Ttouch-angle: ~f~%" (-> obj touch-angle)) + (format #t "~1Tcoverage: ~f~%" (-> obj coverage)) + (format #t "~1Tdynam: ~A~%" (-> obj dynam)) + (format #t "~1Tsurf: ~A~%" (-> obj surf)) + (label cfg-136) + obj + ) + +;; definition for method 0 of type collide-shape-prim +(defmethod new collide-shape-prim ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 int)) + (let ((v0-0 (object-new allocation type-to-make arg2))) + (set! (-> v0-0 cshape) arg0) + (set! (-> v0-0 prim-id) arg1) + (set! (-> v0-0 prim-core action) (collide-action)) + (set! (-> v0-0 prim-core collide-as) (collide-spec)) + (set! (-> v0-0 prim-core collide-with) (the-as uint 0)) + (set! (-> v0-0 transform-index) -2) + (set! (-> v0-0 prim-core prim-type) (prim-type prim)) + v0-0 + ) + ) + +;; definition for method 0 of type collide-shape-prim-sphere +;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-sphere. +(defmethod new collide-shape-prim-sphere ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint)) + (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg1 80))) + (set! (-> (the-as collide-shape-prim-sphere v0-0) pat) + (new 'static 'pat-surface :mode (pat-mode obstacle) :material (pat-material stone)) + ) + (set! (-> (the-as collide-shape-prim-sphere v0-0) prim-core prim-type) (prim-type sphere)) + (the-as collide-shape-prim-sphere v0-0) + ) + ) + +;; definition for method 0 of type collide-shape-prim-mesh +;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-mesh. +(defmethod new collide-shape-prim-mesh ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 uint)) + (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 arg2 80))) + (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh) #f) + (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh-id) (the-as int arg1)) + (set! (-> (the-as collide-shape-prim-mesh v0-0) mesh-cache-id) (the-as uint 0)) + (set! (-> (the-as collide-shape-prim-mesh v0-0) prim-core prim-type) (prim-type mesh)) + (the-as collide-shape-prim-mesh v0-0) + ) + ) + +;; definition for method 0 of type collide-shape-prim-group +;; INFO: Return type mismatch collide-shape-prim vs collide-shape-prim-group. +(defmethod new collide-shape-prim-group ((allocation symbol) (type-to-make type) (arg0 collide-shape) (arg1 uint) (arg2 int)) + (let ((v0-0 ((method-of-type collide-shape-prim new) allocation type-to-make arg0 (the-as uint arg2) 80))) + (set! (-> (the-as collide-shape-prim-group v0-0) num-children) arg1) + (set! (-> (the-as collide-shape-prim-group v0-0) num-alloc-children) arg1) + (set! (-> (the-as collide-shape-prim-group v0-0) prim-core prim-type) (prim-type group)) + (set! (-> (the-as collide-shape-prim-group v0-0) child) + (the-as (inline-array collide-shape) (&+ (the-as collide-shape-prim-group v0-0) 80)) + ) + (the-as collide-shape-prim-group v0-0) + ) + ) + +;; definition for method 4 of type collide-shape-prim-group +;; INFO: Return type mismatch uint8 vs int. +(defmethod length collide-shape-prim-group ((obj collide-shape-prim-group)) + (the-as int (-> obj num-children)) + ) + +;; definition for method 0 of type collide-shape +(defmethod new collide-shape ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (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 event-self) #f) + (set! (-> s5-0 event-other) #f) + (set! (-> s5-0 riders) (the-as pointer #f)) + (set! (-> s5-0 root-prim) #f) + (set! (-> s5-0 penetrate-using) (penetrate)) + (set! (-> s5-0 penetrated-by) (penetrate)) + (set! (-> s5-0 event-priority) (the-as uint 0)) + (set! (-> s5-0 rider-max-momentum) 409600.0) + (case (-> arg0 type symbol) + (('camera) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :nocamera #x1 :probe #x1 :noendlessfall #x1)) + ) + (('target) + (set! (-> s5-0 pat-ignore-mask) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1)) + ) + (else + (set! (-> s5-0 pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1) + ) + ) + ) + (set! (-> s5-0 trans w) 1.0) + (quaternion-identity! (-> s5-0 quat)) + (vector-identity! (-> s5-0 scale)) + (cond + ((= arg1 (collide-list-enum hit-by-player)) + (add-connection *collide-hit-by-player-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum usually-hit-by-player)) + (add-connection *collide-hit-by-others-list* arg0 #f s5-0 #f #f) + ) + ((= arg1 (collide-list-enum hit-by-others)) + (add-connection *collide-player-list* arg0 #f s5-0 #f #f) + ) + (else + (format 0 "Unsupported collide-list-enum in collide-shape constructor!~%") + ) + ) + s5-0 + ) + ) + +;; definition for method 0 of type collide-shape-moving +;; INFO: Used lq/sq +;; INFO: Return type mismatch collide-shape vs collide-shape-moving. +(defmethod new collide-shape-moving ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 collide-list-enum)) + (let ((v0-0 ((method-of-type collide-shape new) allocation type-to-make arg0 arg1))) + (set! (-> (the-as collide-shape-moving v0-0) gspot-pos y) -40959590.0) + (set! (-> (the-as collide-shape-moving v0-0) gspot-normal quad) (-> *y-vector* quad)) + (set! (-> (the-as collide-shape-moving v0-0) surf) *standard-ground-surface*) + (the-as collide-shape-moving v0-0) + ) + ) + +;; definition for symbol *collide-shape-prim-backgnd*, type collide-shape-prim-mesh +(define *collide-shape-prim-backgnd* (new 'static 'collide-shape-prim-mesh + :cshape #f + :prim-core (new 'static 'collide-prim-core + :world-sphere (new 'static 'vector :w 204800000.0) + :collide-as (collide-spec backgnd) + :action (collide-action solid) + :prim-type (prim-type fake-prim) + ) + :local-sphere (new 'static 'vector :w 204800000.0) + :mesh #f + ) + ) + +;; definition for symbol *collide-shape-prim-water*, type collide-shape-prim-mesh +(define *collide-shape-prim-water* (new 'static 'collide-shape-prim-mesh + :cshape #f + :prim-core (new 'static 'collide-prim-core + :world-sphere (new 'static 'vector :w 204800000.0) + :collide-as (collide-spec water) + :action (collide-action solid) + :prim-type (prim-type fake-prim) + ) + :local-sphere (new 'static 'vector :w 204800000.0) + :mesh #f + ) + ) + +;; definition (perm) for symbol *collide-rider-pool*, type collide-rider-pool +(define-perm *collide-rider-pool* collide-rider-pool (new 'global 'collide-rider-pool)) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc new file mode 100644 index 0000000000..fbb6ff121a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-target-h_REF.gc @@ -0,0 +1,18 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type control-info +(deftype control-info (collide-shape-moving) + ((pad uint8 :offset 6415) + ) + :method-count-assert 68 + :size-assert #x1910 + :flag-assert #x4400001910 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc new file mode 100644 index 0000000000..385c704f7d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/collide-touch-h_REF.gc @@ -0,0 +1,242 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type touching-prim +(deftype touching-prim (structure) + ((cprim collide-shape-prim :offset-assert 0) + (has-tri? symbol :offset-assert 4) + (tri collide-tri-result :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x68 + :flag-assert #x900000068 + ) + +;; definition for method 3 of type touching-prim +(defmethod inspect touching-prim ((obj touching-prim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'touching-prim) + (format #t "~1Tcprim: ~A~%" (-> obj cprim)) + (format #t "~1Thas-tri?: ~A~%" (-> obj has-tri?)) + (format #t "~1Ttri: #~%" (-> obj tri)) + (label cfg-4) + obj + ) + +;; definition of type touching-prims-entry +(deftype touching-prims-entry (structure) + ((next touching-prims-entry :offset-assert 0) + (prev touching-prims-entry :offset-assert 4) + (allocated? symbol :offset-assert 8) + (u float :offset-assert 12) + (prim1 touching-prim :inline :offset-assert 16) + (prim2 touching-prim :inline :offset-assert 128) + ) + :method-count-assert 12 + :size-assert #xe8 + :flag-assert #xc000000e8 + (:methods + (touching-prims-entry-method-9 () none 9) + (touching-prims-entry-method-10 () none 10) + (touching-prims-entry-method-11 () none 11) + ) + ) + +;; definition for method 3 of type touching-prims-entry +(defmethod inspect touching-prims-entry ((obj touching-prims-entry)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'touching-prims-entry) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tprev: #~%" (-> obj prev)) + (format #t "~1Tallocated?: ~A~%" (-> obj allocated?)) + (format #t "~1Tu: ~f~%" (-> obj u)) + (format #t "~1Tprim1: #~%" (-> obj prim1)) + (format #t "~1Tprim2: #~%" (-> obj prim2)) + (label cfg-4) + obj + ) + +;; definition of type touching-prims-entry-pool +(deftype touching-prims-entry-pool (structure) + ((head touching-prims-entry :offset-assert 0) + (nodes touching-prims-entry 64 :inline :offset-assert 16) + ) + :method-count-assert 13 + :size-assert #x3c10 + :flag-assert #xd00003c10 + (:methods + (touching-prims-entry-pool-method-9 () none 9) + (touching-prims-entry-pool-method-10 () none 10) + (init-list! (_type_) none 11) + (touching-prims-entry-pool-method-12 () none 12) + ) + ) + +;; definition for method 3 of type touching-prims-entry-pool +(defmethod inspect touching-prims-entry-pool ((obj touching-prims-entry-pool)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'touching-prims-entry-pool) + (format #t "~1Thead: #~%" (-> obj head)) + (format #t "~1Tnodes[64] @ #x~X~%" (-> obj nodes)) + (label cfg-4) + obj + ) + +;; definition for method 11 of type touching-prims-entry-pool +;; INFO: Return type mismatch int vs none. +(defmethod init-list! touching-prims-entry-pool ((obj touching-prims-entry-pool)) + (let ((v1-0 (the-as touching-prims-entry #f))) + (let ((a1-0 (the-as touching-prims-entry (-> obj nodes)))) + (set! (-> obj head) a1-0) + (countdown (a0-1 64) + (set! (-> a1-0 prev) v1-0) + (let ((a2-0 (&+ a1-0 240))) + (set! (-> a1-0 next) (the-as touching-prims-entry a2-0)) + (set! (-> a1-0 allocated?) #f) + (set! v1-0 a1-0) + (set! a1-0 (the-as touching-prims-entry a2-0)) + ) + ) + ) + (set! (-> v1-0 next) #f) + ) + 0 + (none) + ) + +;; definition for method 0 of type touching-prims-entry-pool +;; INFO: Return type mismatch structure vs touching-prims-entry-pool. +(defmethod new touching-prims-entry-pool ((allocation symbol) (type-to-make type)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((gp-0 (t9-0 allocation v1-1))) + ((method-of-type touching-prims-entry-pool init-list!) (the-as touching-prims-entry-pool gp-0)) + (the-as touching-prims-entry-pool gp-0) + ) + ) + ) + +;; definition of type touching-shapes-entry +(deftype touching-shapes-entry (structure) + ((cshape1 collide-shape :offset-assert 0) + (cshape2 collide-shape :offset-assert 4) + (resolve-u int8 :offset-assert 8) + (head touching-prims-entry :offset-assert 12) + (handle1 uint64 :offset-assert 16) + (handle2 uint64 :offset-assert 24) + ) + :pack-me + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (get-head (_type_) touching-prims-entry 9) + (get-next (_type_ touching-shapes-entry) touching-prims-entry 10) + (touching-shapes-entry-method-11 () none 11) + (touching-shapes-entry-method-12 () none 12) + (touching-shapes-entry-method-13 () none 13) + (touching-shapes-entry-method-14 () none 14) + ) + ) + +;; definition for method 3 of type touching-shapes-entry +(defmethod inspect touching-shapes-entry ((obj touching-shapes-entry)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'touching-shapes-entry) + (format #t "~1Tcshape1: ~A~%" (-> obj cshape1)) + (format #t "~1Tcshape2: ~A~%" (-> obj cshape2)) + (format #t "~1Tresolve-u: ~D~%" (-> obj resolve-u)) + (format #t "~1Thead: #~%" (-> obj head)) + (format #t "~1Thandle1: ~D~%" (-> obj handle1)) + (format #t "~1Thandle2: ~D~%" (-> obj handle2)) + (label cfg-4) + obj + ) + +;; definition of type touching-list +(deftype touching-list (structure) + ((num-touching-shapes int32 :offset-assert 0) + (resolve-u int8 :offset-assert 4) + (touching-shapes touching-shapes-entry 32 :inline :offset-assert 8) + ) + :method-count-assert 14 + :size-assert #x408 + :flag-assert #xe00000408 + (:methods + (touching-list-method-9 () none 9) + (touching-list-method-10 () none 10) + (touching-list-method-11 () none 11) + (touching-list-method-12 () none 12) + (touching-list-method-13 () none 13) + ) + ) + +;; definition for method 3 of type touching-list +(defmethod inspect touching-list ((obj touching-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'touching-list) + (format #t "~1Tnum-touching-shapes: ~D~%" (-> obj num-touching-shapes)) + (format #t "~1Tresolve-u: ~D~%" (-> obj resolve-u)) + (format #t "~1Ttouching-shapes[32] @ #x~X~%" (-> obj touching-shapes)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type touching-list +;; INFO: Return type mismatch structure vs touching-list. +(defmethod new touching-list ((allocation symbol) (type-to-make type)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((v0-0 (the-as touching-list (t9-0 allocation v1-1)))) + (set! (-> v0-0 num-touching-shapes) 0) + (set! (-> v0-0 resolve-u) 0) + v0-0 + ) + ) + ) + +;; definition for method 9 of type touching-shapes-entry +(defmethod get-head touching-shapes-entry ((obj touching-shapes-entry)) + (-> obj head) + ) + +;; definition for method 10 of type touching-shapes-entry +;; INFO: Return type mismatch collide-shape vs touching-prims-entry. +(defmethod get-next touching-shapes-entry ((obj touching-shapes-entry) (arg0 touching-shapes-entry)) + (the-as touching-prims-entry (-> arg0 cshape1)) + ) + +;; failed to figure out what this is: +(kmemopen global "collide-touching-lists") + +;; definition (perm) for symbol *touching-prims-entry-pool*, type touching-prims-entry-pool +(define-perm *touching-prims-entry-pool* touching-prims-entry-pool (new 'global 'touching-prims-entry-pool)) + +;; definition (perm) for symbol *touching-list*, type touching-list +(define-perm *touching-list* touching-list (new 'global 'touching-list)) + +;; failed to figure out what this is: +(kmemclose) + + + + diff --git a/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc b/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc new file mode 100644 index 0000000000..5bd3029011 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/collide/pat-h_REF.gc @@ -0,0 +1,294 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pat-surface +(deftype pat-surface (uint32) + ((skip uint8 :offset 0 :size 7) + (mode pat-mode :offset 7 :size 3) + (material pat-material :offset 10 :size 6) + (camera uint8 :offset 16 :size 1) + (event pat-event :offset 18 :size 6) + (skip2 uint8 :offset 24 :size 5) + (noentity uint8 :offset 0 :size 1) + (nocamera uint8 :offset 1 :size 1) + (noedge uint8 :offset 2 :size 1) + (nogrind uint8 :offset 3 :size 1) + (nojak uint8 :offset 4 :size 1) + (noboard uint8 :offset 5 :size 1) + (nopilot uint8 :offset 6 :size 1) + (probe uint8 :offset 24 :size 1) + (nomech uint8 :offset 25 :size 1) + (noproj uint8 :offset 26 :size 1) + (noendlessfall uint8 :offset 27 :size 1) + (noprobe uint8 :offset 28 :size 1) + (nolineofsight uint8 :offset 16 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type pat-surface +(defmethod inspect pat-surface ((obj pat-surface)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pat-surface) + (format #t "~1Tskip: ~D~%" (-> obj skip)) + (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "~1Tmaterial: ~D~%" (-> obj material)) + (format #t "~1Tcamera: ~D~%" (-> obj camera)) + (format #t "~1Tevent: ~D~%" (-> obj event)) + (format #t "~1Tskip2: ~D~%" (-> obj skip2)) + (format #t "~1Tnoentity: ~D~%" (-> obj noentity)) + (format #t "~1Tnocamera: ~D~%" (-> obj nocamera)) + (format #t "~1Tnoedge: ~D~%" (-> obj noedge)) + (format #t "~1Tnogrind: ~D~%" (-> obj nogrind)) + (format #t "~1Tnojak: ~D~%" (-> obj nojak)) + (format #t "~1Tnoboard: ~D~%" (-> obj noboard)) + (format #t "~1Tnopilot: ~D~%" (-> obj nopilot)) + (format #t "~1Tprobe: ~D~%" (-> obj probe)) + (format #t "~1Tnomech: ~D~%" (-> obj nomech)) + (format #t "~1Tnoproj: ~D~%" (-> obj noproj)) + (format #t "~1Tnoendlessfall: ~D~%" (-> obj noendlessfall)) + (format #t "~1Tnoprobe: ~D~%" (-> obj noprobe)) + (format #t "~1Tnolineofsight: ~D~%" (-> obj camera)) + (format #t "~1Tboard: ~D~%" (-> obj nojak)) + (label cfg-4) + obj + ) + +;; definition (debug) for function pat-material->string +(defun-debug pat-material->string ((arg0 pat-surface)) + (case (-> arg0 material) + (((pat-material deepsnow)) + "deepsnow" + ) + (((pat-material neutral)) + "neutral" + ) + (((pat-material carpet)) + "carpet" + ) + (((pat-material shmetal)) + "shmetal" + ) + (((pat-material grmetal)) + "grmetal" + ) + (((pat-material lava)) + "lava" + ) + (((pat-material crmetal)) + "crmetal" + ) + (((pat-material pcmetal)) + "pcmetal" + ) + (((pat-material grass)) + "grass" + ) + (((pat-material snow)) + "snow" + ) + (((pat-material swamp)) + "swamp" + ) + (((pat-material stone)) + "stone" + ) + (((pat-material hotcoals)) + "hotcoals" + ) + (((pat-material unknown)) + "unknown" + ) + (((pat-material dirt)) + "dirt" + ) + (((pat-material tube)) + "tube" + ) + (((pat-material stopproj)) + "stopproj" + ) + (((pat-material tar)) + "tar" + ) + (((pat-material straw)) + "straw" + ) + (((pat-material wood)) + "wood" + ) + (((pat-material quicksand)) + "quicksand" + ) + (((pat-material ice)) + "ice" + ) + (((pat-material rotate)) + "rotate" + ) + (((pat-material crwood)) + "crwood" + ) + (((pat-material waterbottom)) + "waterbottom" + ) + (((pat-material hdwood)) + "hdwood" + ) + (((pat-material sand)) + "sand" + ) + (((pat-material gravel)) + "gravel" + ) + (((pat-material metal)) + "metal" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition (debug) for function pat-mode->string +(defun-debug pat-mode->string ((arg0 pat-surface)) + (case (-> arg0 mode) + (((pat-mode wall)) + "wall" + ) + (((pat-mode halfpipe)) + "halfpipe" + ) + (((pat-mode obstacle)) + "obstacle" + ) + (((pat-mode ground)) + "ground" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition (debug) for function pat-event->string +(defun-debug pat-event->string ((arg0 pat-surface)) + (case (-> arg0 event) + (((pat-event burn)) + "burn" + ) + (((pat-event deadly)) + "deadly" + ) + (((pat-event slippery)) + "slippery" + ) + (((pat-event melt)) + "melt" + ) + (((pat-event endlessfall)) + "endlessfall" + ) + (((pat-event burnup)) + "burnup" + ) + (((pat-event hide)) + "hide" + ) + (((pat-event deadlup)) + "deadlyup" + ) + (((pat-event shockup)) + "shockup" + ) + (((pat-event slide)) + "slide" + ) + (((pat-event lipramp)) + "lipramp" + ) + (((pat-event rail)) + "rail" + ) + (((pat-event none)) + "none" + ) + (((pat-event lip)) + "lip" + ) + (((pat-event shock)) + "shock" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type pat-mode-info +(deftype pat-mode-info (structure) + ((name string :offset-assert 0) + (wall-angle float :offset-assert 4) + (color rgba :offset-assert 8) + (hilite-color rgba :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type pat-mode-info +(defmethod inspect pat-mode-info ((obj pat-mode-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pat-mode-info) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Twall-angle: ~f~%" (-> obj wall-angle)) + (format #t "~1Tcolor: ~D~%" (-> obj color)) + (format #t "~1Thilite-color: ~D~%" (-> obj hilite-color)) + (label cfg-4) + obj + ) + +;; definition for symbol *pat-mode-info*, type (inline-array pat-mode-info) +(define *pat-mode-info* (new 'static 'inline-array pat-mode-info 4 + (new 'static 'pat-mode-info + :name "ground" + :wall-angle 0.2 + :color (new 'static 'rgba :r #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "wall" + :wall-angle 2.0 + :color (new 'static 'rgba :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :b #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "obstacle" + :wall-angle 0.82 + :color (new 'static 'rgba :r #x7f :b #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :b #xff :a #x80) + ) + (new 'static 'pat-mode-info + :name "halfpipe" + :wall-angle -2.0 + :color (new 'static 'rgba :r #x7f :g #x7f :a #x40) + :hilite-color (new 'static 'rgba :r #xff :g #xff :a #x80) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc new file mode 100644 index 0000000000..0611b53d25 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/common_objs/generic-obs-h_REF.gc @@ -0,0 +1,605 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type manipy +(deftype manipy (process-drawable) + ((new-trans-hook (function none) :offset-assert 200) + (cur-trans-hook (function none) :offset-assert 204) + (cur-event-hook (function none) :offset-assert 208) + (new-joint-anim art-joint-anim :offset-assert 212) + (new-joint-anim-blend uint64 :offset-assert 216) + (anim-mode symbol :offset-assert 224) + (cur-grab-handle handle :offset-assert 232) + (cur-target-handle handle :offset-assert 240) + (old-grab-pos vector :inline :offset-assert 256) + (joint joint-mod 4 :offset-assert 272) + (new-post-hook (function none) :offset-assert 288) + (cur-post-hook (function none) :offset-assert 292) + (clone-copy-trans symbol :offset-assert 296) + (shadow-backup basic :offset-assert 300) + (draw? symbol :offset-assert 304) + (userdata uint64 :offset-assert 312) + (prefix basic :offset-assert 320) + (shadow-volume-joint int32 :offset-assert 324) + (speed float :offset-assert 328) + (user-uint64 uint64 4 :offset-assert 336) + (options manipy-options :offset-assert 368) + ) + :heap-base #x100 + :method-count-assert 21 + :size-assert #x174 + :flag-assert #x1501000174 + (:methods + (manipy-method-20 () none 20) + ) + ) + +;; definition for method 3 of type manipy +(defmethod inspect manipy ((obj manipy)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tnew-trans-hook: ~A~%" (-> obj new-trans-hook)) + (format #t "~2Tcur-trans-hook: ~A~%" (-> obj cur-trans-hook)) + (format #t "~2Tcur-event-hook: ~A~%" (-> obj cur-event-hook)) + (format #t "~2Tnew-joint-anim: ~A~%" (-> obj new-joint-anim)) + (format #t "~2Tnew-joint-anim-blend: ~D~%" (-> obj new-joint-anim-blend)) + (format #t "~2Tanim-mode: ~A~%" (-> obj anim-mode)) + (format #t "~2Tcur-grab-handle: ~D~%" (-> obj cur-grab-handle)) + (format #t "~2Tcur-target-handle: ~D~%" (-> obj cur-target-handle)) + (format #t "~2Told-grab-pos: ~`vector`P~%" (-> obj old-grab-pos)) + (format #t "~2Tjoint[4] @ #x~X~%" (-> obj joint)) + (format #t "~2Tnew-post-hook: ~A~%" (-> obj new-post-hook)) + (format #t "~2Tcur-post-hook: ~A~%" (-> obj cur-post-hook)) + (format #t "~2Tclone-copy-trans: ~A~%" (-> obj clone-copy-trans)) + (format #t "~2Tshadow-backup: ~A~%" (-> obj shadow-backup)) + (format #t "~2Tdraw?: ~A~%" (-> obj draw?)) + (format #t "~2Tuserdata: ~A~%" (-> obj userdata)) + (format #t "~2Tprefix: ~A~%" (-> obj prefix)) + (format #t "~2Tshadow-volume-joint: ~D~%" (-> obj shadow-volume-joint)) + (format #t "~2Tspeed: ~f~%" (-> obj speed)) + (format #t "~2Tuser-uint64[4] @ #x~X~%" (-> obj user-uint64)) + (format #t "~2Toptions: ~D~%" (-> obj options)) + (label cfg-4) + obj + ) + +;; definition of type part-spawner +(deftype part-spawner (process) + ((root trsqv :offset-assert 128) + (part sparticle-launch-control :offset-assert 132) + (sound ambient-sound :offset-assert 136) + (mode (pointer sparticle-launch-group) :offset-assert 140) + (enable symbol :offset-assert 144) + (radius meters :offset-assert 148) + (world-sphere sphere :inline :offset-assert 160) + ) + :heap-base #x30 + :method-count-assert 16 + :size-assert #xb0 + :flag-assert #x10003000b0 + (:methods + (part-spawner-method-14 () none 14) + (part-spawner-method-15 () none 15) + ) + ) + +;; definition for method 3 of type part-spawner +(defmethod inspect part-spawner ((obj part-spawner)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Troot: ~A~%" (-> obj root)) + (format #t "~2Tpart: ~A~%" (-> obj part)) + (format #t "~2Tsound: ~A~%" (-> obj sound)) + (format #t "~2Tmode: #x~X~%" (-> obj mode)) + (format #t "~2Tenable: ~A~%" (-> obj enable)) + (format #t "~2Tradius: (meters ~m)~%" (-> obj radius)) + (format #t "~2Tworld-sphere: #~%" (-> obj world-sphere)) + (label cfg-4) + obj + ) + +;; definition of type part-tracker +(deftype part-tracker (process) + ((root trsqv :offset-assert 128) + (mat matrix :inline :offset-assert 144) + (part sparticle-launch-control :offset-assert 208) + (callback (function part-tracker vector) :offset-assert 212) + (linger-callback (function part-tracker vector) :offset-assert 216) + (duration uint64 :offset-assert 224) + (linger-duration uint64 :offset-assert 232) + (start-time time-frame :offset-assert 240) + (target uint64 :offset-assert 248) + (target-joint int32 :offset-assert 256) + (offset vector :inline :offset-assert 272) + (userdata uint64 :offset-assert 288) + (user-time time-frame 2 :offset-assert 296) + (user-vector vector :inline :offset-assert 320) + (user-handle uint32 2 :offset 352) + ) + :heap-base #xf0 + :method-count-assert 16 + :size-assert #x168 + :flag-assert #x1000f00168 + (:methods + (part-tracker-method-14 () none 14) + (part-tracker-method-15 () none 15) + ) + ) + +;; definition for method 3 of type part-tracker +(defmethod inspect part-tracker ((obj part-tracker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Troot: ~A~%" (-> obj root)) + (format #t "~2Tmat: #~%" (-> obj mat)) + (format #t "~2Tpart: ~A~%" (-> obj part)) + (format #t "~2Tcallback: ~A~%" (-> obj callback)) + (format #t "~2Tlinger-callback: ~A~%" (-> obj linger-callback)) + (format #t "~2Tduration: ~D~%" (-> obj duration)) + (format #t "~2Tlinger-duration: ~D~%" (-> obj linger-duration)) + (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~2Ttarget: ~D~%" (-> obj target)) + (format #t "~2Ttarget-joint: ~D~%" (-> obj target-joint)) + (format #t "~2Toffset: ~`vector`P~%" (-> obj offset)) + (format #t "~2Tuserdata: ~A~%" (-> obj userdata)) + (format #t "~2Tuser-time[2] @ #x~X~%" (-> obj user-time)) + (format #t "~2Tuser-vector: ~`vector`P~%" (-> obj user-vector)) + (format #t "~2Tuser-handle[2] @ #x~X~%" (-> obj user-handle)) + (label cfg-4) + obj + ) + +;; definition of type lightning-tracker +(deftype lightning-tracker (process) + ((root basic :offset-assert 128) + (lightning basic :offset-assert 132) + (callback basic :offset-assert 136) + (duration uint64 :offset-assert 144) + (start-time time-frame :offset-assert 152) + (offset0 vector :inline :offset-assert 160) + (offset1 vector :inline :offset-assert 176) + (target0 uint64 :offset-assert 192) + (target1 uint64 :offset-assert 200) + (target-joint0 int32 :offset-assert 208) + (target-joint1 int32 :offset-assert 212) + (sound uint32 :offset-assert 216) + (userdata uint64 :offset-assert 224) + (user-time time-frame 2 :offset-assert 232) + (user-vector vector :inline :offset-assert 256) + (user-handle handle 2 :offset 288) + ) + :heap-base #xb0 + :method-count-assert 17 + :size-assert #x130 + :flag-assert #x1100b00130 + (:methods + (lightning-tracker-method-14 () none 14) + (lightning-tracker-method-15 () none 15) + (lightning-tracker-method-16 () none 16) + ) + ) + +;; definition for method 3 of type lightning-tracker +(defmethod inspect lightning-tracker ((obj lightning-tracker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Troot: ~A~%" (-> obj root)) + (format #t "~2Tlightning: ~A~%" (-> obj lightning)) + (format #t "~2Tcallback: ~A~%" (-> obj callback)) + (format #t "~2Tduration: ~D~%" (-> obj duration)) + (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~2Toffset0: ~`vector`P~%" (-> obj offset0)) + (format #t "~2Toffset1: ~`vector`P~%" (-> obj offset1)) + (format #t "~2Ttarget0: ~D~%" (-> obj target0)) + (format #t "~2Ttarget1: ~D~%" (-> obj target1)) + (format #t "~2Ttarget-joint0: ~D~%" (-> obj target-joint0)) + (format #t "~2Ttarget-joint1: ~D~%" (-> obj target-joint1)) + (format #t "~2Tsound: ~D~%" (-> obj sound)) + (format #t "~2Tuserdata: ~A~%" (-> obj userdata)) + (format #t "~2Tuser-time[2] @ #x~X~%" (-> obj user-time)) + (format #t "~2Tuser-vector: ~`vector`P~%" (-> obj user-vector)) + (format #t "~2Tuser-handle[2] @ #x~X~%" (-> obj user-handle)) + (label cfg-4) + obj + ) + +;; definition of type touch-tracker +(deftype touch-tracker (process-drawable) + ((duration time-frame :offset-assert 200) + (target handle :offset-assert 208) + (event symbol :offset-assert 216) + (run-function (function object) :offset-assert 220) + (callback (function touch-tracker none) :offset-assert 224) + (event-mode basic :offset-assert 228) + ) + :heap-base #x70 + :method-count-assert 21 + :size-assert #xe8 + :flag-assert #x15007000e8 + (:methods + (touch-tracker-method-20 () none 20) + ) + ) + +;; definition for method 3 of type touch-tracker +(defmethod inspect touch-tracker ((obj touch-tracker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tduration: ~D~%" (-> obj duration)) + (format #t "~2Ttarget: ~D~%" (-> obj target)) + (format #t "~2Tevent: ~A~%" (-> obj event)) + (format #t "~2Trun-function: ~A~%" (-> obj run-function)) + (format #t "~2Tcallback: ~A~%" (-> obj callback)) + (format #t "~2Tevent-mode: ~A~%" (-> obj event-mode)) + (label cfg-4) + obj + ) + +;; definition of type swingpole +(deftype swingpole (process-drawable) + ((edge-length meters :offset-assert 200) + (path-pos float :offset-assert 204) + (joint-track int32 :offset-assert 208) + (speed meters :offset-assert 212) + (dir vector :inline :offset-assert 224) + (sync sync-eased :inline :offset-assert 240) + ) + :heap-base #xa0 + :method-count-assert 23 + :size-assert #x11c + :flag-assert #x1700a0011c + (:methods + (swingpole-method-20 () none 20) + (swingpole-method-21 () none 21) + (swingpole-method-22 () none 22) + ) + ) + +;; definition for method 3 of type swingpole +(defmethod inspect swingpole ((obj swingpole)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tedge-length: (meters ~m)~%" (-> obj edge-length)) + (format #t "~2Tpath-pos: ~f~%" (-> obj path-pos)) + (format #t "~2Tjoint-track: ~D~%" (-> obj joint-track)) + (format #t "~2Tspeed: (meters ~m)~%" (-> obj speed)) + (format #t "~2Tdir: ~`vector`P~%" (-> obj dir)) + (format #t "~2Tsync: #~%" (-> obj sync)) + (label cfg-4) + obj + ) + +;; definition of type gui-query +(deftype gui-query (structure) + ((x-position int32 :offset-assert 0) + (y-position int32 :offset-assert 4) + (message string :offset-assert 8) + (decision symbol :offset-assert 12) + (only-allow-cancel symbol :offset-assert 16) + (no-msg string :offset-assert 20) + (message-space int32 :offset-assert 24) + ) + :method-count-assert 11 + :size-assert #x1c + :flag-assert #xb0000001c + (:methods + (gui-query-method-9 () none 9) + (gui-query-method-10 () none 10) + ) + ) + +;; definition for method 3 of type gui-query +(defmethod inspect gui-query ((obj gui-query)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gui-query) + (format #t "~1Tx-position: ~D~%" (-> obj x-position)) + (format #t "~1Ty-position: ~D~%" (-> obj y-position)) + (format #t "~1Tmessage: ~A~%" (-> obj message)) + (format #t "~1Tdecision: ~A~%" (-> obj decision)) + (format #t "~1Tonly-allow-cancel: ~A~%" (-> obj only-allow-cancel)) + (format #t "~1Tno-msg: ~A~%" (-> obj no-msg)) + (format #t "~1Tmessage-space: ~D~%" (-> obj message-space)) + (label cfg-4) + obj + ) + +;; definition of type othercam +(deftype othercam (process) + ((hand handle :offset-assert 128) + (old-global-mask process-mask :offset-assert 136) + (mask-to-clear process-mask :offset-assert 140) + (cam-joint-index int32 :offset-assert 144) + (old-pos vector :inline :offset-assert 160) + (old-mat-z vector :inline :offset-assert 176) + (had-valid-frame basic :offset-assert 192) + (border-value basic :offset-assert 196) + (die? symbol :offset-assert 200) + (survive-anim-end? symbol :offset-assert 204) + (spooling? symbol :offset-assert 208) + (fov float :offset-assert 212) + ) + :heap-base #x60 + :method-count-assert 14 + :size-assert #xd8 + :flag-assert #xe006000d8 + ) + +;; definition for method 3 of type othercam +(defmethod inspect othercam ((obj othercam)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Thand: ~D~%" (-> obj hand)) + (format #t "~2Told-global-mask: ~D~%" (-> obj old-global-mask)) + (format #t "~2Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) + (format #t "~2Tcam-joint-index: ~D~%" (-> obj cam-joint-index)) + (format #t "~2Told-pos: #~%" (-> obj old-pos)) + (format #t "~2Told-mat-z: #~%" (-> obj old-mat-z)) + (format #t "~2Thad-valid-frame: ~A~%" (-> obj had-valid-frame)) + (format #t "~2Tborder-value: ~A~%" (-> obj border-value)) + (format #t "~2Tdie?: ~A~%" (-> obj die?)) + (format #t "~2Tsurvive-anim-end?: ~A~%" (-> obj survive-anim-end?)) + (format #t "~2Tspooling?: ~A~%" (-> obj spooling?)) + (format #t "~2Tfov: ~f~%" (-> obj fov)) + (label cfg-4) + obj + ) + +;; definition of type explosion +(deftype explosion (process-drawable) + ((start-time time-frame :offset-assert 200) + (duration uint32 :offset-assert 208) + (linger-duration uint32 :offset-assert 212) + (attack-id uint32 :offset-assert 216) + ) + :heap-base #x60 + :method-count-assert 23 + :size-assert #xdc + :flag-assert #x17006000dc + (:methods + (explosion-method-20 () none 20) + (explosion-method-21 () none 21) + (explosion-method-22 () none 22) + ) + ) + +;; definition for method 3 of type explosion +(defmethod inspect explosion ((obj explosion)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~2Tduration: ~D~%" (-> obj duration)) + (format #t "~2Tlinger-duration: ~D~%" (-> obj linger-duration)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (label cfg-4) + obj + ) + +;; definition of type explosion-init-params +(deftype explosion-init-params (structure) + ((spawn-point vector :inline :offset-assert 0) + (spawn-quat quaternion :inline :offset-assert 16) + (radius float :offset-assert 32) + (group basic :offset-assert 36) + (collide-with collide-spec :offset-assert 40) + (penetrate-using penetrate :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +;; definition for method 3 of type explosion-init-params +(defmethod inspect explosion-init-params ((obj explosion-init-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'explosion-init-params) + (format #t "~1Tspawn-point: #~%" (-> obj spawn-point)) + (format #t "~1Tspawn-quat: #~%" (-> obj spawn-quat)) + (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "~1Tgroup: ~A~%" (-> obj group)) + (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "~1Tpenetrate-using: ~D~%" (-> obj penetrate-using)) + (label cfg-4) + obj + ) + +;; definition of type process-hidden +(deftype process-hidden (process) + () + :method-count-assert 15 + :size-assert #x80 + :flag-assert #xf00000080 + (:methods + (process-hidden-method-14 () none 14) + ) + ) + +;; definition for method 3 of type process-hidden +(defmethod inspect process-hidden ((obj process-hidden)) + (when (not obj) + (set! obj obj) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tmask: #x~X : (process-mask " (-> obj mask)) + (let ((s5-0 (-> obj mask))) + (if (= (logand s5-0 (process-mask process-tree)) (process-mask process-tree)) + (format #t "process-tree ") + ) + (if (= (logand s5-0 (process-mask target)) (process-mask target)) + (format #t "target ") + ) + (if (= (logand (process-mask collectable) s5-0) (process-mask collectable)) + (format #t "attackable ") + ) + (if (= (logand (process-mask bit18) s5-0) (process-mask bit18)) + (format #t "collectable ") + ) + (if (= (logand (process-mask projectile) s5-0) (process-mask projectile)) + (format #t "projectile ") + ) + (if (= (logand (process-mask no-track) s5-0) (process-mask no-track)) + (format #t "no-track ") + ) + (if (= (logand s5-0 (process-mask sleep-code)) (process-mask sleep-code)) + (format #t "sleep-code ") + ) + (if (= (logand s5-0 (process-mask actor-pause)) (process-mask actor-pause)) + (format #t "actor-pause ") + ) + (if (= (logand (process-mask bot) s5-0) (process-mask bot)) + (format #t "bot ") + ) + (if (= (logand (process-mask vehicle) s5-0) (process-mask vehicle)) + (format #t "vehicle ") + ) + (if (= (logand (process-mask enemy) s5-0) (process-mask enemy)) + (format #t "enemy ") + ) + (if (= (logand (process-mask entity) s5-0) (process-mask entity)) + (format #t "entity ") + ) + (if (= (logand s5-0 (process-mask heap-shrunk)) (process-mask heap-shrunk)) + (format #t "heap-shrunk ") + ) + (if (= (logand (process-mask sidekick) s5-0) (process-mask sidekick)) + (format #t "sidekick ") + ) + (if (= (logand s5-0 (process-mask going)) (process-mask going)) + (format #t "going ") + ) + (if (= (logand s5-0 (process-mask execute)) (process-mask execute)) + (format #t "execute ") + ) + (if (= (logand (process-mask civilian) s5-0) (shl #x8000 16)) + (format #t "civilian ") + ) + (if (= (logand (process-mask death) s5-0) (process-mask death)) + (format #t "death ") + ) + (if (= (logand (process-mask guard) s5-0) (process-mask guard)) + (format #t "guard ") + ) + (if (= (logand s5-0 (process-mask no-kill)) (process-mask no-kill)) + (format #t "no-kill ") + ) + (if (= (logand (process-mask platform) s5-0) (process-mask platform)) + (format #t "platform ") + ) + (if (= (logand s5-0 (process-mask freeze)) (process-mask freeze)) + (format #t "freeze ") + ) + (if (= (logand s5-0 (process-mask sleep)) (process-mask sleep)) + (format #t "sleep ") + ) + (if (= (logand s5-0 (process-mask progress)) (process-mask progress)) + (format #t "progress ") + ) + (if (= (logand s5-0 (process-mask menu)) (process-mask menu)) + (format #t "menu ") + ) + (if (= (logand (process-mask camera) s5-0) (process-mask camera)) + (format #t "camera ") + ) + (if (= (logand (process-mask ambient) s5-0) (process-mask ambient)) + (format #t "ambient ") + ) + (if (= (logand s5-0 (process-mask dark-effect)) (process-mask dark-effect)) + (format #t "dark-effect ") + ) + (if (= (logand (process-mask crate) s5-0) (process-mask crate)) + (format #t "crate ") + ) + (if (= (logand s5-0 (process-mask kernel-run)) (process-mask kernel-run)) + (format #t "kernel-run ") + ) + (if (= (logand s5-0 (process-mask movie)) (process-mask movie)) + (format #t "movie ") + ) + (if (= (logand s5-0 (process-mask pause)) (process-mask pause)) + (format #t "pause ") + ) + ) + (format #t ")~%") + (format #t "~1Tclock: ~A~%" (-> obj clock)) + (format #t "~1Tparent: #x~X~%" (-> obj parent)) + (format #t "~1Tbrother: #x~X~%" (-> obj brother)) + (format #t "~1Tchild: #x~X~%" (-> obj child)) + (format #t "~1Tppointer: #x~X~%" (-> obj ppointer)) + (format #t "~1Tself: ~A~%" (-> obj self)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Tstatus: ~A~%" (-> obj status)) + (format #t "~1Tpid: ~D~%" (-> obj pid)) + (format #t "~1Tmain-thread: ~A~%" (-> obj main-thread)) + (format #t "~1Ttop-thread: ~A~%" (-> obj top-thread)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tstate: ~A~%" (-> obj state)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "~1Ttrans-hook: ~A~%" (-> obj trans-hook)) + (format #t "~1Tpost-hook: ~A~%" (-> obj post-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Theap-base: #x~X~%" (-> obj heap-base)) + (format #t "~1Theap-top: #x~X~%" (-> obj heap-top)) + (format #t "~1Theap-cur: #x~X~%" (-> obj heap-cur)) + (format #t "~1Tstack-frame-top: ~A~%" (-> obj stack-frame-top)) + (format #t "~1Theap: #~%" (&-> obj heap-base)) + (format #t "~1Tconnection-list: ~`connectable`P~%" (-> obj connection-list)) + (format #t "~1Tstack[0] @ #x~X~%" (-> obj stack)) + (label cfg-68) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc b/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc new file mode 100644 index 0000000000..4959f882b2 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/common_objs/projectile-h_REF.gc @@ -0,0 +1,191 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type projectile +(deftype projectile (process-drawable) + ((starting-pos vector :inline :offset-assert 208) + (starting-dir vector :inline :offset-assert 224) + (target-pos vector :inline :offset-assert 240) + (base-target-pos vector :inline :offset-assert 256) + (pre-move-transv vector :inline :offset-assert 272) + (timeout time-frame :offset-assert 288) + (spawn-time time-frame :offset-assert 296) + (options projectile-options :offset-assert 304) + (last-target handle :offset-assert 312) + (notify-handle handle :offset-assert 320) + (owner-handle handle :offset-assert 328) + (ignore-handle handle :offset-assert 336) + (update-velocity (function projectile none) :offset-assert 344) + (move basic :offset-assert 348) + (pick-target basic :offset-assert 352) + (max-speed float :offset-assert 356) + (old-dist float 16 :offset-assert 360) + (old-dist-count int32 :offset-assert 424) + (hits int32 :offset-assert 428) + (max-hits int32 :offset-assert 432) + (tween float :offset-assert 436) + (attack-mode symbol :offset-assert 440) + (attack-id uint32 :offset-assert 444) + (damage float :offset-assert 448) + (charge-level float :offset-assert 452) + (sound-id sound-id :offset-assert 456) + (stop-speed meters :offset-assert 460) + (invinc-time time-frame :offset-assert 464) + ) + :heap-base #x160 + :method-count-assert 40 + :size-assert #x1d8 + :flag-assert #x28016001d8 + (:methods + (projectile-method-20 () none 20) + (projectile-method-21 () none 21) + (projectile-method-22 () none 22) + (projectile-method-23 () none 23) + (projectile-method-24 () none 24) + (projectile-method-25 () none 25) + (projectile-method-26 () none 26) + (projectile-method-27 () none 27) + (projectile-method-28 () none 28) + (projectile-method-29 () none 29) + (projectile-method-30 () none 30) + (projectile-method-31 () none 31) + (projectile-method-32 () none 32) + (projectile-method-33 () none 33) + (projectile-method-34 () none 34) + (projectile-method-35 () none 35) + (projectile-method-36 () none 36) + (projectile-method-37 () none 37) + (projectile-method-38 () none 38) + (projectile-method-39 () none 39) + ) + ) + +;; definition for method 3 of type projectile +(defmethod inspect projectile ((obj projectile)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tstarting-pos: ~`vector`P~%" (-> obj starting-pos)) + (format #t "~2Tstarting-dir: ~`vector`P~%" (-> obj starting-dir)) + (format #t "~2Ttarget-pos: ~`vector`P~%" (-> obj target-pos)) + (format #t "~2Tbase-target-pos: ~`vector`P~%" (-> obj base-target-pos)) + (format #t "~2Tpre-move-transv: ~`vector`P~%" (-> obj pre-move-transv)) + (format #t "~2Ttimeout: ~D~%" (-> obj timeout)) + (format #t "~2Tspawn-time: ~D~%" (-> obj spawn-time)) + (format #t "~2Toptions: ~D~%" (-> obj options)) + (format #t "~2Tlast-target: ~D~%" (-> obj last-target)) + (format #t "~2Tnotify-handle: ~D~%" (-> obj notify-handle)) + (format #t "~2Towner-handle: ~D~%" (-> obj owner-handle)) + (format #t "~2Tignore-handle: ~D~%" (-> obj ignore-handle)) + (format #t "~2Tupdate-velocity: ~A~%" (-> obj update-velocity)) + (format #t "~2Tmove: ~A~%" (-> obj move)) + (format #t "~2Tpick-target: ~A~%" (-> obj pick-target)) + (format #t "~2Tmax-speed: ~f~%" (-> obj max-speed)) + (format #t "~2Told-dist[16] @ #x~X~%" (-> obj old-dist)) + (format #t "~2Told-dist-count: ~D~%" (-> obj old-dist-count)) + (format #t "~2Thits: ~D~%" (-> obj hits)) + (format #t "~2Tmax-hits: ~D~%" (-> obj max-hits)) + (format #t "~2Ttween: ~f~%" (-> obj tween)) + (format #t "~2Tattack-mode: ~A~%" (-> obj attack-mode)) + (format #t "~2Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~2Tdamage: ~f~%" (-> obj damage)) + (format #t "~2Tcharge-level: ~f~%" (-> obj charge-level)) + (format #t "~2Tsound-id: ~D~%" (-> obj sound-id)) + (format #t "~2Tstop-speed: (meters ~m)~%" (-> obj stop-speed)) + (format #t "~2Tinvinc-time: ~D~%" (-> obj invinc-time)) + (label cfg-4) + obj + ) + +;; definition of type projectile-init-by-other-params +(deftype projectile-init-by-other-params (structure) + ((ent basic :offset-assert 0) + (charge float :offset-assert 4) + (attack-id uint32 :offset-assert 8) + (options projectile-options :offset-assert 16) + (notify-handle handle :offset-assert 24) + (owner-handle handle :offset-assert 32) + (ignore-handle handle :offset-assert 40) + (pos vector :inline :offset-assert 48) + (vel vector :inline :offset-assert 64) + (timeout handle :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x58 + :flag-assert #x900000058 + ) + +;; definition for method 3 of type projectile-init-by-other-params +(defmethod inspect projectile-init-by-other-params ((obj projectile-init-by-other-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'projectile-init-by-other-params) + (format #t "~1Tent: ~A~%" (-> obj ent)) + (format #t "~1Tcharge: ~f~%" (-> obj charge)) + (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~1Toptions: ~D~%" (-> obj options)) + (format #t "~1Tnotify-handle: ~D~%" (-> obj notify-handle)) + (format #t "~1Towner-handle: ~D~%" (-> obj owner-handle)) + (format #t "~1Tignore-handle: ~D~%" (-> obj ignore-handle)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tvel: #~%" (-> obj vel)) + (format #t "~1Ttimeout: ~D~%" (-> obj timeout)) + (label cfg-4) + obj + ) + +;; definition for function spawn-projectile +(defun spawn-projectile ((arg0 type) (arg1 projectile-init-by-other-params) (arg2 process-tree) (arg3 dead-pool)) + (let ((s4-0 (get-process arg3 arg0 #x4000))) + (when s4-0 + (let ((t9-1 (method-of-type process activate))) + (t9-1 s4-0 arg2 (symbol->string (-> arg0 symbol)) (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 projectile-init-by-other arg1) + (-> s4-0 ppointer) + ) + ) + ) + +;; definition of type projectile-bounce +(deftype projectile-bounce (projectile) + ((played-bounce-time time-frame :offset-assert 472) + (tumble-quat quaternion :inline :offset-assert 480) + ) + :heap-base #x170 + :method-count-assert 42 + :size-assert #x1f0 + :flag-assert #x2a017001f0 + (:methods + (projectile-bounce-method-40 () none 40) + (projectile-bounce-method-41 () none 41) + ) + ) + +;; definition for method 3 of type projectile-bounce +(defmethod inspect projectile-bounce ((obj projectile-bounce)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 obj) + ) + (format #t "~2Tplayed-bounce-time: ~D~%" (-> obj played-bounce-time)) + (format #t "~2Ttumble-quat: #~%" (-> obj tumble-quat)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/data/art-h_REF.gc b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc new file mode 100644 index 0000000000..44a7c012d9 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/data/art-h_REF.gc @@ -0,0 +1,755 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type joint-anim +(deftype joint-anim (basic) + ((name string :offset-assert 4) + (number int16 :offset-assert 8) + (length int16 :offset-assert 10) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type joint-anim +(defmethod inspect joint-anim ((obj joint-anim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tnumber: ~D~%" (-> obj number)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (label cfg-4) + obj + ) + +;; definition of type joint-anim-matrix +(deftype joint-anim-matrix (joint-anim) + ((data matrix :inline :dynamic :offset 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition of type joint-anim-transformq +(deftype joint-anim-transformq (joint-anim) + ((data transformq :inline :dynamic :offset 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type joint-anim-transformq +(defmethod inspect joint-anim-transformq ((obj joint-anim-transformq)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tnumber: ~D~%" (-> obj number)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D]~1Tdata: ~`transformq`P~%" s5-0 (-> obj data s5-0)) + ) + (label cfg-7) + obj + ) + +;; definition of type joint-anim-drawable +(deftype joint-anim-drawable (joint-anim) + ((data drawable :dynamic :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type joint-anim-drawable +(defmethod inspect joint-anim-drawable ((obj joint-anim-drawable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tnumber: ~D~%" (-> obj number)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type joint-anim-frame +(deftype joint-anim-frame (structure) + ((matrices matrix 2 :inline :offset-assert 0) + (data matrix :dynamic :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + (:methods + (new (symbol type int) _type_ 0) + ) + ) + +;; definition for method 3 of type joint-anim-frame +(defmethod inspect joint-anim-frame ((obj joint-anim-frame)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'joint-anim-frame) + (format #t "~1Tmatrices[2] @ #x~X~%" (-> obj matrices)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type joint-anim-frame +;; INFO: Return type mismatch structure vs joint-anim-frame. +(defmethod new joint-anim-frame ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v1-1 (max 0 (+ arg0 -2)))) + (the-as + joint-anim-frame + (new-dynamic-structure allocation type-to-make (the-as int (+ (-> type-to-make size) (* 48 v1-1)))) + ) + ) + ) + +;; definition of type joint-anim-compressed-hdr +(deftype joint-anim-compressed-hdr (structure) + ((control-bits uint32 14 :offset-assert 0) + (num-joints uint32 :offset-assert 56) + (matrix-bits uint32 :offset-assert 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type joint-anim-compressed-hdr +(defmethod inspect joint-anim-compressed-hdr ((obj joint-anim-compressed-hdr)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-hdr) + (format #t "~1Tcontrol-bits[14] @ #x~X~%" (-> obj control-bits)) + (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) + (format #t "~1Tmatrix-bits: ~D~%" (-> obj matrix-bits)) + (label cfg-4) + obj + ) + +;; definition of type joint-anim-compressed-fixed +(deftype joint-anim-compressed-fixed (structure) + ((hdr joint-anim-compressed-hdr :inline :offset-assert 0) + (offset-64 uint32 :offset-assert 64) + (offset-32 uint32 :offset-assert 68) + (offset-16 uint32 :offset-assert 72) + (reserved uint32 :offset-assert 76) + (data vector 133 :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x8a0 + :flag-assert #x9000008a0 + ) + +;; definition for method 3 of type joint-anim-compressed-fixed +(defmethod inspect joint-anim-compressed-fixed ((obj joint-anim-compressed-fixed)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-fixed) + (format #t "~1Thdr: #~%" (-> obj hdr)) + (format #t "~1Toffset-64: ~D~%" (-> obj offset-64)) + (format #t "~1Toffset-32: ~D~%" (-> obj offset-32)) + (format #t "~1Toffset-16: ~D~%" (-> obj offset-16)) + (format #t "~1Treserved: ~D~%" (-> obj reserved)) + (format #t "~1Tdata[133] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type joint-anim-compressed-frame +(deftype joint-anim-compressed-frame (structure) + ((offset-64 uint32 :offset-assert 0) + (offset-32 uint32 :offset-assert 4) + (offset-16 uint32 :offset-assert 8) + (reserved uint32 :offset-assert 12) + (data vector 133 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x860 + :flag-assert #x900000860 + ) + +;; definition for method 3 of type joint-anim-compressed-frame +(defmethod inspect joint-anim-compressed-frame ((obj joint-anim-compressed-frame)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-frame) + (format #t "~1Toffset-64: ~D~%" (-> obj offset-64)) + (format #t "~1Toffset-32: ~D~%" (-> obj offset-32)) + (format #t "~1Toffset-16: ~D~%" (-> obj offset-16)) + (format #t "~1Treserved: ~D~%" (-> obj reserved)) + (format #t "~1Tdata[133] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type joint-anim-compressed-control +(deftype joint-anim-compressed-control (structure) + ((num-frames uint16 :offset-assert 0) + (flags uint16 :offset-assert 2) + (fixed-qwc uint32 :offset-assert 4) + (frame-qwc uint32 :offset-assert 8) + (fixed joint-anim-compressed-fixed :offset-assert 12) + (data joint-anim-compressed-frame :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type joint-anim-compressed-control +(defmethod inspect joint-anim-compressed-control ((obj joint-anim-compressed-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'joint-anim-compressed-control) + (format #t "~1Tnum-frames: ~D~%" (-> obj num-frames)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tfixed-qwc: ~D~%" (-> obj fixed-qwc)) + (format #t "~1Tframe-qwc: ~D~%" (-> obj frame-qwc)) + (format #t "~1Tfixed: #~%" (-> obj fixed)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type art +(deftype art (basic) + ((name string :offset 8) + (length int32 :offset-assert 12) + (extra res-lump :offset-assert 16) + ) + :method-count-assert 13 + :size-assert #x14 + :flag-assert #xd00000014 + (:methods + (art-method-9 () none 9) + (art-method-10 () none 10) + (art-method-11 () none 11) + (art-method-12 () none 12) + ) + ) + +;; definition for method 3 of type art +(defmethod inspect art ((obj art)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (label cfg-4) + obj + ) + +;; definition of type art-element +(deftype art-element (art) + ((pad uint8 12 :offset-assert 20) + ) + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition for method 3 of type art-element +(defmethod inspect art-element ((obj art-element)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (label cfg-4) + obj + ) + +;; definition of type art-mesh-anim +(deftype art-mesh-anim (art-element) + () + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition of type art-joint-anim +(deftype art-joint-anim (art-element) + ((speed float :offset 20) + (artist-base float :offset 24) + (artist-step float :offset 28) + (eye-anim basic :offset 4) + (master-art-group-name string :offset-assert 32) + (master-art-group-index int32 :offset-assert 36) + (blend-shape-anim basic :offset-assert 40) + (frames joint-anim-compressed-control :offset-assert 44) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + ) + +;; definition for method 3 of type art-joint-anim +(defmethod inspect art-joint-anim ((obj art-joint-anim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "~1Tspeed: ~f~%" (-> obj speed)) + (format #t "~1Tartist-base: ~f~%" (-> obj artist-base)) + (format #t "~1Tartist-step: ~f~%" (-> obj artist-step)) + (format #t "~1Teye-anim: ~A~%" (-> obj eye-anim)) + (format #t "~1Tmaster-art-group-name: ~A~%" (-> obj master-art-group-name)) + (format #t "~1Tmaster-art-group-index: ~D~%" (-> obj master-art-group-index)) + (format #t "~1Tblend-shape-anim: ~A~%" (-> obj blend-shape-anim)) + (format #t "~1Tframes: #~%" (-> obj frames)) + (label cfg-4) + obj + ) + +;; definition of type art-group +(deftype art-group (art) + ((info file-info :offset 4) + (data art-element :dynamic :offset 32) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (art-group-method-13 () none 13) + (art-group-method-14 () none 14) + ) + ) + +;; definition of type art-mesh-geo +(deftype art-mesh-geo (art-element) + () + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition of type art-joint-geo +(deftype art-joint-geo (art-element) + () + :method-count-assert 13 + :size-assert #x20 + :flag-assert #xd00000020 + ) + +;; definition of type art-joint-anim-manager-slot +(deftype art-joint-anim-manager-slot (structure) + ((anim basic :offset-assert 0) + (comp-data uint32 :offset-assert 4) + (time-stamp uint64 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type art-joint-anim-manager-slot +(defmethod inspect art-joint-anim-manager-slot ((obj art-joint-anim-manager-slot)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'art-joint-anim-manager-slot) + (format #t "~1Tanim: ~A~%" (-> obj anim)) + (format #t "~1Tcomp-data: #x~X~%" (-> obj comp-data)) + (format #t "~1Ttime-stamp: ~D~%" (-> obj time-stamp)) + (label cfg-4) + obj + ) + +;; definition of type art-joint-anim-manager +(deftype art-joint-anim-manager (basic) + ((kheap kheap :inline :offset-assert 16) + (free-index int32 :offset-assert 32) + (slot art-joint-anim-manager-slot 64 :inline :offset-assert 48) + ) + :method-count-assert 14 + :size-assert #x430 + :flag-assert #xe00000430 + (:methods + (new (symbol type int) _type_ 0) + (art-joint-anim-manager-method-9 () none 9) + (art-joint-anim-manager-method-10 () none 10) + (unload-from-slot (_type_ int) none 11) + (art-joint-anim-manager-method-12 () none 12) + (unload-from-level (_type_ level) none 13) + ) + ) + +;; definition for method 3 of type art-joint-anim-manager +(defmethod inspect art-joint-anim-manager ((obj art-joint-anim-manager)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Theap: #~%" (-> obj kheap)) + (format #t "~1Tfree-index: ~D~%" (-> obj free-index)) + (format #t "~1Tslot[64] @ #x~X~%" (-> obj slot)) + (dotimes (s5-0 64) + (format #t "~T [~D]~1Tslot: ~`art-joint-anim-manager-slot`P~%" s5-0 (-> obj slot s5-0)) + ) + (label cfg-7) + obj + ) + +;; definition for method 0 of type art-joint-anim-manager +(defmethod new art-joint-anim-manager ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (let ((s4-0 (-> gp-0 kheap))) + (set! (-> s4-0 base) (kmalloc (the-as kheap (-> allocation value)) arg0 (kmalloc-flags) "heap")) + (set! (-> s4-0 current) (-> s4-0 base)) + (set! (-> s4-0 top-base) (&+ (-> s4-0 base) arg0)) + (set! (-> s4-0 top) (-> s4-0 top-base)) + ) + (dotimes (v1-6 64) + (set! (-> gp-0 slot v1-6 anim) #f) + ) + (set! (-> gp-0 free-index) 0) + gp-0 + ) + ) + +;; definition of type skeleton-group +(deftype skeleton-group (art-group) + ((art-group-name string :offset-assert 32) + (jgeo int32 :offset-assert 36) + (janim int32 :offset-assert 40) + (bounds vector :inline :offset-assert 48) + (radius meters :offset 60) + (mgeo int16 6 :offset-assert 64) + (max-lod int32 :offset-assert 76) + (lod-dist float 6 :offset-assert 80) + (longest-edge meters :offset-assert 104) + (texture-level int8 :offset-assert 108) + (version int8 :offset-assert 109) + (shadow int8 :offset-assert 110) + (sort int8 :offset-assert 111) + (origin-joint-index int8 :offset-assert 112) + (shadow-joint-index int8 :offset-assert 113) + (light-index uint8 :offset-assert 114) + (pad uint8 :offset-assert 115) + ) + :method-count-assert 16 + :size-assert #x74 + :flag-assert #x1000000074 + (:methods + (skeleton-group-method-15 () none 15) + ) + ) + +;; definition for method 3 of type skeleton-group +(defmethod inspect skeleton-group ((obj skeleton-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "~1Tinfo: ~A~%" (-> obj info)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "~1Tart-group-name: ~A~%" (-> obj art-group-name)) + (format #t "~1Tjgeo: ~D~%" (-> obj jgeo)) + (format #t "~1Tjanim: ~D~%" (-> obj janim)) + (format #t "~1Tbounds: ~`vector`P~%" (-> obj bounds)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj bounds w)) + (format #t "~1Tmgeo[6] @ #x~X~%" (-> obj mgeo)) + (format #t "~1Tmax-lod: ~D~%" (-> obj max-lod)) + (format #t "~1Tlod-dist[6] @ #x~X~%" (-> obj lod-dist)) + (format #t "~1Tlongest-edge: (meters ~m)~%" (-> obj longest-edge)) + (format #t "~1Ttexture-level: ~D~%" (-> obj texture-level)) + (format #t "~1Tversion: ~D~%" (-> obj version)) + (format #t "~1Tshadow: ~D~%" (-> obj shadow)) + (format #t "~1Tsort: ~D~%" (-> obj sort)) + (format #t "~1Torigin-joint-index: ~D~%" (-> obj origin-joint-index)) + (format #t "~1Tshadow-joint-index: ~D~%" (-> obj shadow-joint-index)) + (format #t "~1Tlight-index: ~D~%" (-> obj light-index)) + (label cfg-4) + obj + ) + +;; definition of type lod-group +(deftype lod-group (structure) + ((geo merc-ctrl :offset-assert 0) + (dist meters :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type lod-group +(defmethod inspect lod-group ((obj lod-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'lod-group) + (format #t "~1Tgeo: ~A~%" (-> obj geo)) + (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) + (label cfg-4) + obj + ) + +;; definition of type lod-set +(deftype lod-set (structure) + ((lod lod-group 6 :inline :offset-assert 0) + (max-lod int8 :offset-assert 48) + ) + :method-count-assert 10 + :size-assert #x31 + :flag-assert #xa00000031 + (:methods + (lod-set-method-9 () none 9) + ) + ) + +;; definition for method 3 of type lod-set +(defmethod inspect lod-set ((obj lod-set)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'lod-set) + (format #t "~1Tlod[6] @ #x~X~%" (-> obj lod)) + (format #t "~1Tmax-lod: ~D~%" (-> obj max-lod)) + (label cfg-4) + obj + ) + +;; definition of type draw-control +(deftype draw-control (basic) + ((process process :offset-assert 4) + (status draw-control-status :offset-assert 8) + (data-format draw-control-data-format :offset-assert 10) + (global-effect draw-control-global-effect :offset-assert 11) + (art-group art-group :offset-assert 12) + (jgeo art-joint-geo :offset-assert 16) + (mgeo merc-ctrl :offset-assert 20) + (dma-add-func function :offset-assert 24) + (skeleton skeleton :offset-assert 28) + (lod-set lod-set :inline :offset-assert 32) + (max-lod int8 :offset 80) + (force-lod int8 :offset-assert 81) + (cur-lod int8 :offset-assert 82) + (desired-lod int8 :offset-assert 83) + (ripple ripple-control :offset-assert 84) + (longest-edge meters :offset-assert 88) + (longest-edge? uint32 :offset 88) + (light-index uint8 :offset-assert 92) + (shadow-mask uint8 :offset-assert 93) + (level-index uint8 :offset-assert 94) + (death-draw-overlap uint8 :offset-assert 95) + (death-timer uint8 :offset-assert 96) + (death-timer-org uint8 :offset-assert 97) + (death-vertex-skip uint16 :offset-assert 98) + (death-effect uint32 :offset-assert 100) + (shadow uint32 :offset-assert 104) + (shadow-ctrl shadow-control :offset-assert 108) + (distance meters :offset-assert 112) + (origin vector :inline :offset-assert 128) + (bounds vector :inline :offset-assert 144) + (radius meters :offset 156) + (color-mult rgbaf :inline :offset-assert 160) + (color-emissive rgbaf :inline :offset-assert 176) + (effect-mask uint64 :offset-assert 192) + (seg-mask uint64 :offset-assert 200) + (origin-joint-index uint8 :offset-assert 208) + (shadow-joint-index uint8 :offset-assert 209) + (force-fade uint8 :offset-assert 210) + (default-texture-page uint8 :offset-assert 211) + (shadow-values uint32 :offset-assert 212) + ) + :method-count-assert 15 + :size-assert #xd8 + :flag-assert #xf000000d8 + (:methods + (get-skeleton-origin (_type_) vector 9) + (draw-control-method-10 () none 10) + (draw-control-method-11 () none 11) + (draw-control-method-12 () none 12) + (draw-control-method-13 () none 13) + (draw-control-method-14 () none 14) + ) + ) + +;; definition for method 3 of type draw-control +(defmethod inspect draw-control ((obj draw-control)) + (when (not obj) + (set! obj obj) + (goto cfg-47) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tstatus: #x~X : (draw-control-status " (-> obj status)) + (let ((s5-0 (-> obj status))) + (if (= (logand s5-0 (draw-control-status no-draw-temp)) (draw-control-status no-draw-temp)) + (format #t "no-draw-temp ") + ) + (if (= (logand s5-0 (draw-control-status lod-set)) (draw-control-status lod-set)) + (format #t "lod-set ") + ) + (if (= (logand s5-0 (draw-control-status no-draw-bounds2)) (draw-control-status no-draw-bounds2)) + (format #t "no-draw-bounds2 ") + ) + (if (= (logand s5-0 (draw-control-status math-skel)) (draw-control-status math-skel)) + (format #t "math-skel ") + ) + (if (= (logand s5-0 (draw-control-status force-vu1)) (draw-control-status force-vu1)) + (format #t "force-vu1 ") + ) + (if (= (logand s5-0 (draw-control-status warp-cross-fade)) (draw-control-status warp-cross-fade)) + (format #t "warp-cross-fade ") + ) + (if (= (logand s5-0 (draw-control-status disable-fog)) (draw-control-status disable-fog)) + (format #t "disable-fog ") + ) + (if (= (logand s5-0 (draw-control-status no-closest-distance)) (draw-control-status no-closest-distance)) + (format #t "no-closest-distance ") + ) + (if (= (logand s5-0 (draw-control-status hud)) (draw-control-status hud)) + (format #t "hud ") + ) + (if (= (logand s5-0 (draw-control-status no-draw)) (draw-control-status no-draw)) + (format #t "no-draw ") + ) + (if (= (logand s5-0 (draw-control-status on-screen)) (draw-control-status on-screen)) + (format #t "on-screen ") + ) + (if (= (logand s5-0 (draw-control-status close-to-screen)) (draw-control-status close-to-screen)) + (format #t "close-to-screen ") + ) + (if (= (logand s5-0 (draw-control-status force-fade)) (draw-control-status force-fade)) + (format #t "force-fade ") + ) + (if (= (logand s5-0 (draw-control-status no-draw-bounds)) (draw-control-status no-draw-bounds)) + (format #t "no-draw-bounds ") + ) + (if (= (logand s5-0 (draw-control-status uninited)) (draw-control-status uninited)) + (format #t "uninited ") + ) + ) + (format #t ")~%") + (let ((t9-19 format) + (a0-35 #t) + (a1-19 "~1Tdata-format: #x~X : ~S~%") + (a2-3 (-> obj data-format)) + (v1-47 (-> obj data-format)) + ) + (t9-19 a0-35 a1-19 a2-3 (cond + ((= v1-47 (draw-control-data-format merc)) + "merc" + ) + ((= v1-47 (draw-control-data-format pris)) + "pris" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tglobal-effect: #x~X : (draw-control-global-effect " (-> obj global-effect)) + (let ((s5-1 (-> obj global-effect))) + (if (= (logand s5-1 (draw-control-global-effect title-light)) (draw-control-global-effect title-light)) + (format #t "title-light ") + ) + (if (= (logand s5-1 (draw-control-global-effect bit-1)) (draw-control-global-effect bit-1)) + (format #t "bit-1 ") + ) + (if (= (logand s5-1 (draw-control-global-effect disable-envmap)) (draw-control-global-effect disable-envmap)) + (format #t "disable-envmap ") + ) + (if (= (logand s5-1 (draw-control-global-effect bit-0)) (draw-control-global-effect bit-0)) + (format #t "bit-0 ") + ) + ) + (format #t ")~%") + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tjgeo: ~A~%" (-> obj jgeo)) + (format #t "~1Tmgeo: ~A~%" (-> obj mgeo)) + (format #t "~1Tdma-add-func: ~A~%" (-> obj dma-add-func)) + (format #t "~1Tskeleton: ~A~%" (-> obj skeleton)) + (format #t "~1Tlod-set: #~%" (-> obj lod-set)) + (format #t "~1Tlod[6] @ #x~X~%" (-> obj lod-set)) + (format #t "~1Tmax-lod: ~D~%" (-> obj lod-set max-lod)) + (format #t "~1Tforce-lod: ~D~%" (-> obj force-lod)) + (format #t "~1Tcur-lod: ~D~%" (-> obj cur-lod)) + (format #t "~1Tdesired-lod: ~D~%" (-> obj desired-lod)) + (format #t "~1Tripple: ~A~%" (-> obj ripple)) + (format #t "~1Tlongest-edge: (meters ~m)~%" (-> obj longest-edge)) + (format #t "~1Tlongest-edge?: ~D~%" (-> obj longest-edge)) + (format #t "~1Tlight-index: ~D~%" (-> obj light-index)) + (format #t "~1Tshadow-mask: ~D~%" (-> obj shadow-mask)) + (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) + (format #t "~1Tdeath-draw-overlap: ~D~%" (-> obj death-draw-overlap)) + (format #t "~1Tdeath-timer: ~D~%" (-> obj death-timer)) + (format #t "~1Tdeath-timer-org: ~D~%" (-> obj death-timer-org)) + (format #t "~1Tdeath-vertex-skip: ~D~%" (-> obj death-vertex-skip)) + (format #t "~1Tdeath-effect: ~D~%" (-> obj death-effect)) + (format #t "~1Tshadow: ~A~%" (-> obj shadow)) + (format #t "~1Tshadow-ctrl: ~A~%" (-> obj shadow-ctrl)) + (format #t "~1Tdistance: (meters ~m)~%" (-> obj distance)) + (format #t "~1Torigin: ~`vector`P~%" (-> obj origin)) + (format #t "~1Tbounds: ~`vector`P~%" (-> obj bounds)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj bounds w)) + (format #t "~1Tcolor-mult: #~%" (-> obj color-mult)) + (format #t "~1Tcolor-emissive: #~%" (-> obj color-emissive)) + (format #t "~1Teffect-mask: #x~X~%" (-> obj effect-mask)) + (format #t "~1Tseg-mask: #x~X~%" (-> obj seg-mask)) + (format #t "~1Torigin-joint-index: ~D~%" (-> obj origin-joint-index)) + (format #t "~1Tshadow-joint-index: ~D~%" (-> obj shadow-joint-index)) + (format #t "~1Tforce-fade: ~D~%" (-> obj force-fade)) + (format #t "~1Tdefault-texture-page: ~D~%" (-> obj default-texture-page)) + (format #t "~1Tshadow-values: ~D~%" (-> obj shadow-values)) + (label cfg-47) + obj + ) + +;; definition for method 9 of type draw-control +(defmethod get-skeleton-origin draw-control ((obj draw-control)) + (-> obj skeleton bones 0 transform trans) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc new file mode 100644 index 0000000000..e89fe0f60c --- /dev/null +++ b/test/decompiler/reference/jak2/engine/debug/debug-h_REF.gc @@ -0,0 +1,154 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pos-history +(deftype pos-history (structure) + ((points (inline-array vector) :offset-assert 0) + (num-points int32 :offset-assert 4) + (h-first int32 :offset-assert 8) + (h-last int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type pos-history +(defmethod inspect pos-history ((obj pos-history)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pos-history) + (format #t "~1Tpoints: #x~X~%" (-> obj points)) + (format #t "~1Tnum-points: ~D~%" (-> obj num-points)) + (format #t "~1Th-first: ~D~%" (-> obj h-first)) + (format #t "~1Th-last: ~D~%" (-> obj h-last)) + (label cfg-4) + obj + ) + +;; definition of type debug-vertex +(deftype debug-vertex (structure) + ((trans vector4w :inline :offset-assert 0) + (normal vector3h :inline :offset-assert 16) + (st vector2h :inline :offset-assert 22) + (color uint32 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type debug-vertex +(defmethod inspect debug-vertex ((obj debug-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'debug-vertex) + (format #t "~1Ttrans: ~`vector4w`P~%" (-> obj trans)) + (format #t "~1Tnormal: ~`vector3h`P~%" (-> obj normal)) + (format #t "~1Tst: ~`vector2h`P~%" (-> obj st)) + (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (label cfg-4) + obj + ) + +;; definition of type debug-vertex-stats +(deftype debug-vertex-stats (basic) + ((length int32 :offset-assert 4) + (pos-count int32 :offset-assert 8) + (vertex debug-vertex 600 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x4b10 + :flag-assert #x900004b10 + ) + +;; definition for method 3 of type debug-vertex-stats +(defmethod inspect debug-vertex-stats ((obj debug-vertex-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tpos-count: ~D~%" (-> obj pos-count)) + (format #t "~1Tvertex[600] @ #x~X~%" (-> obj vertex)) + (label cfg-4) + obj + ) + +;; definition for symbol *color-black*, type rgba +(define *color-black* (new 'static 'rgba :a #x80)) + +;; definition for symbol *color-white*, type rgba +(define *color-white* (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)) + +;; definition for symbol *color-gray*, type rgba +(define *color-gray* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-red*, type rgba +(define *color-red* (new 'static 'rgba :r #xff :a #x80)) + +;; definition for symbol *color-green*, type rgba +(define *color-green* (new 'static 'rgba :g #xff :a #x80)) + +;; definition for symbol *color-blue*, type rgba +(define *color-blue* (new 'static 'rgba :b #xff :a #x80)) + +;; definition for symbol *color-cyan*, type rgba +(define *color-cyan* (new 'static 'rgba :g #xff :b #xff :a #x80)) + +;; definition for symbol *color-magenta*, type rgba +(define *color-magenta* (new 'static 'rgba :r #xff :b #xff :a #x80)) + +;; definition for symbol *color-yellow*, type rgba +(define *color-yellow* (new 'static 'rgba :r #xff :g #xff :a #x80)) + +;; definition for symbol *color-light-red*, type rgba +(define *color-light-red* (new 'static 'rgba :r #xff :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-light-green*, type rgba +(define *color-light-green* (new 'static 'rgba :r #x80 :g #xff :b #x80 :a #x80)) + +;; definition for symbol *color-light-blue*, type rgba +(define *color-light-blue* (new 'static 'rgba :r #x80 :g #x80 :b #xff :a #x80)) + +;; definition for symbol *color-light-cyan*, type rgba +(define *color-light-cyan* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) + +;; definition for symbol *color-light-magenta*, type rgba +(define *color-light-magenta* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) + +;; definition for symbol *color-light-yellow*, type rgba +(define *color-light-yellow* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) + +;; definition for symbol *color-dark-red*, type rgba +(define *color-dark-red* (new 'static 'rgba :r #x80 :a #x80)) + +;; definition for symbol *color-dark-green*, type rgba +(define *color-dark-green* (new 'static 'rgba :g #x80 :a #x80)) + +;; definition for symbol *color-dark-blue*, type rgba +(define *color-dark-blue* (new 'static 'rgba :b #x80 :a #x80)) + +;; definition for symbol *color-dark-cyan*, type rgba +(define *color-dark-cyan* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-dark-magenta*, type rgba +(define *color-dark-magenta* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) + +;; definition for symbol *color-dark-yellow*, type rgba +(define *color-dark-yellow* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) + +;; definition for symbol *color-orange*, type rgba +(define *color-orange* (new 'static 'rgba :r #xff :g #x80 :a #x80)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc new file mode 100644 index 0000000000..3676482560 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/debug/memory-usage-h_REF.gc @@ -0,0 +1,76 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition of type memory-usage-info +(deftype memory-usage-info (structure) + ((name string :offset-assert 0) + (count int32 :offset-assert 4) + (used int32 :offset-assert 8) + (total int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type memory-usage-info +(defmethod inspect memory-usage-info ((obj memory-usage-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'memory-usage-info) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tused: ~D~%" (-> obj used)) + (format #t "~1Ttotal: ~D~%" (-> obj total)) + (label cfg-4) + obj + ) + +;; definition of type memory-usage-block +(deftype memory-usage-block (basic) + ((work-bsp basic :offset-assert 4) + (length int32 :offset-assert 8) + (data memory-usage-info 112 :inline :offset-assert 16) + ) + :method-count-assert 12 + :size-assert #x710 + :flag-assert #xc00000710 + (:methods + (memory-usage-block-method-9 () none 9) + (memory-usage-block-method-10 () none 10) + (memory-usage-block-method-11 () none 11) + ) + ) + +;; definition for method 3 of type memory-usage-block +(defmethod inspect memory-usage-block ((obj memory-usage-block)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twork-bsp: ~A~%" (-> obj work-bsp)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[112] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for symbol *mem-usage*, type memory-usage-block +(define *mem-usage* (new 'debug 'memory-usage-block)) + +;; definition for symbol *dma-mem-usage*, type memory-usage-block +(define *dma-mem-usage* (new 'debug 'memory-usage-block)) + +;; definition for symbol *temp-mem-usage*, type memory-usage-block +(define *temp-mem-usage* (the-as memory-usage-block #f)) + +) + + + diff --git a/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc new file mode 100644 index 0000000000..8b2efab522 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/debug/stats-h_REF.gc @@ -0,0 +1,375 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tr-stat +(deftype tr-stat (structure) + ((groups uint16 :offset-assert 0) + (fragments uint16 :offset-assert 2) + (tris uint32 :offset-assert 4) + (dverts uint32 :offset-assert 8) + (instances uint16 :offset-assert 12) + (pad uint16 :offset-assert 14) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type tr-stat +(defmethod inspect tr-stat ((obj tr-stat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tr-stat) + (format #t "~1Tgroups: ~D~%" (-> obj groups)) + (format #t "~1Tfragments: ~D~%" (-> obj fragments)) + (format #t "~1Ttris: ~D~%" (-> obj tris)) + (format #t "~1Tdverts: ~D~%" (-> obj dverts)) + (format #t "~1Tinstances: ~D~%" (-> obj instances)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (label cfg-4) + obj + ) + +;; definition of type merc-global-stats +(deftype merc-global-stats (structure) + ((merc tr-stat :inline :offset-assert 0) + (emerc tr-stat :inline :offset-assert 16) + (mercneric tr-stat :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type merc-global-stats +(defmethod inspect merc-global-stats ((obj merc-global-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-global-stats) + (format #t "~1Tmerc: #~%" (-> obj merc)) + (format #t "~1Temerc: #~%" (-> obj emerc)) + (format #t "~1Tmercneric: #~%" (-> obj mercneric)) + (label cfg-4) + obj + ) + +;; definition of type perf-stat +(deftype perf-stat (structure) + ((frame-number uint32 :offset-assert 0) + (count uint32 :offset-assert 4) + (cycles uint32 :offset-assert 8) + (instructions uint32 :offset-assert 12) + (icache uint32 :offset-assert 16) + (dcache uint32 :offset-assert 20) + (select uint32 :offset-assert 24) + (ctrl uint32 :offset-assert 28) + (accum0 uint32 :offset-assert 32) + (accum1 uint32 :offset-assert 36) + (to-vu0-waits uint32 :offset-assert 40) + (to-spr-waits uint32 :offset-assert 44) + (from-spr-waits uint32 :offset-assert 48) + ) + :method-count-assert 14 + :size-assert #x34 + :flag-assert #xe00000034 + (:methods + (perf-stat-method-9 () none 9) + (print-to-stream (_type_ string basic) none 10) + (reset! (_type_) none 11) + (read! (_type_) none 12) + (update-wait-stats (_type_ uint uint uint) none 13) + ) + ) + +;; definition for method 3 of type perf-stat +(defmethod inspect perf-stat ((obj perf-stat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'perf-stat) + (format #t "~1Tframe-number: ~D~%" (-> obj frame-number)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tcycles: ~D~%" (-> obj cycles)) + (format #t "~1Tinstructions: ~D~%" (-> obj instructions)) + (format #t "~1Ticache: ~D~%" (-> obj icache)) + (format #t "~1Tdcache: ~D~%" (-> obj dcache)) + (format #t "~1Tselect: ~D~%" (-> obj select)) + (format #t "~1Tctrl: ~D~%" (-> obj ctrl)) + (format #t "~1Taccum0: ~D~%" (-> obj accum0)) + (format #t "~1Taccum1: ~D~%" (-> obj accum1)) + (format #t "~1Tto-vu0-waits: ~D~%" (-> obj to-vu0-waits)) + (format #t "~1Tto-spr-waits: ~D~%" (-> obj to-spr-waits)) + (format #t "~1Tfrom-spr-waits: ~D~%" (-> obj from-spr-waits)) + (label cfg-4) + obj + ) + +;; definition (debug) for function perf-stat-bucket->string +(defun-debug perf-stat-bucket->string ((arg0 perf-stat-bucket)) + (case arg0 + (((perf-stat-bucket collide-fill)) + "collide-fill" + ) + (((perf-stat-bucket nav)) + "nav" + ) + (((perf-stat-bucket bones)) + "bones" + ) + (((perf-stat-bucket foreground)) + "foreground" + ) + (((perf-stat-bucket inst-tie)) + "inst-tie" + ) + (((perf-stat-bucket common-post)) + "common-post" + ) + (((perf-stat-bucket nav-dma-write)) + "nav-dma-write" + ) + (((perf-stat-bucket collide-list)) + "collide-list" + ) + (((perf-stat-bucket clamp-vector-to-mesh)) + "clamp-vector-to-mesh" + ) + (((perf-stat-bucket nav-part3)) + "nav-part3" + ) + (((perf-stat-bucket mercneric)) + "mercneric" + ) + (((perf-stat-bucket apply-velocity)) + "apply-velocity" + ) + (((perf-stat-bucket tfrag-scissor)) + "tfrag-scissor" + ) + (((perf-stat-bucket misc)) + "misc" + ) + (((perf-stat-bucket find-nearest-poly)) + "find-nearest-poly" + ) + (((perf-stat-bucket nav-part6)) + "nav-part6" + ) + (((perf-stat-bucket nav-part2)) + "nav-part2" + ) + (((perf-stat-bucket generate-velocity)) + "generate-velocity" + ) + (((perf-stat-bucket inst-shrub)) + "inst-shrub" + ) + (((perf-stat-bucket avoid-spheres)) + "avoid-spheres" + ) + (((perf-stat-bucket proto-shrub)) + "proto-shrub" + ) + (((perf-stat-bucket drawable)) + "drawable" + ) + (((perf-stat-bucket nav-part9)) + "nav-part9" + ) + (((perf-stat-bucket all-code)) + "all-code" + ) + (((perf-stat-bucket actor-hash)) + "actor-hash" + ) + (((perf-stat-bucket nav-dma-all)) + "nav-dma-all" + ) + (((perf-stat-bucket travel-post)) + "travel-post" + ) + (((perf-stat-bucket travel-around-spheres)) + "travel-around-spheres" + ) + (((perf-stat-bucket nav-part10)) + "nav-part10" + ) + (((perf-stat-bucket nav-dma-work)) + "nav-dma-work" + ) + (((perf-stat-bucket proto-tie)) + "proto-tie" + ) + (((perf-stat-bucket nav-part4)) + "nav-part4" + ) + (((perf-stat-bucket ray-step)) + "ray-step" + ) + (((perf-stat-bucket spatial-hash-search)) + "spatial-hash-search" + ) + (((perf-stat-bucket apply-rotation)) + "apply-rotation" + ) + (((perf-stat-bucket find-containing-poly)) + "find-containing-poly" + ) + (((perf-stat-bucket update-spheres)) + "update-spheres" + ) + (((perf-stat-bucket nav-part7)) + "nav-part7" + ) + (((perf-stat-bucket tfrag)) + "tfrag" + ) + (((perf-stat-bucket collide)) + "collide" + ) + (((perf-stat-bucket update-current-poly)) + "update-current-poly" + ) + (((perf-stat-bucket nav-dma-read)) + "nav-dma-read" + ) + (((perf-stat-bucket spatial-hash-build)) + "spatial-hash-build" + ) + (((perf-stat-bucket tie-generic)) + "tie-generic" + ) + (((perf-stat-bucket camera)) + "camera" + ) + (((perf-stat-bucket background)) + "background" + ) + (((perf-stat-bucket nav-part5)) + "nav-part5" + ) + (((perf-stat-bucket nav-part1)) + "nav-part1" + ) + (((perf-stat-bucket check-vector-collision-with-nav-spheres)) + "check-vector-collision-with-nav-spheres" + ) + (((perf-stat-bucket add-to-translation)) + "add-to-translation" + ) + (((perf-stat-bucket nav-part8)) + "nav-part8" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type perf-stat-array +(deftype perf-stat-array (inline-array-class) + ((data perf-stat :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type perf-stat-array +(defmethod inspect perf-stat-array ((obj perf-stat-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! (-> perf-stat-array heap-base) (the-as uint 52)) + +;; definition for method 11 of type perf-stat +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [sync.p] +;; ERROR: Unsupported inline assembly instruction kind - [mtpc pcr0, r0] +;; ERROR: Unsupported inline assembly instruction kind - [mtpc pcr1, r0] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [sync.p] +;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, v1] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [sync.p] +(defmethod reset! perf-stat ((obj perf-stat)) + (let ((v1-0 (-> obj ctrl))) + (+! (-> obj count) 1) + (b! (zero? v1-0) cfg-2 :delay (nop!)) + (.mtc0 Perf r0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 r0) + (.mtpc pcr1 r0) + (.sync.l) + (.sync.p) + (.mtc0 Perf v1-0) + ) + (.sync.l) + (.sync.p) + (label cfg-2) + 0 + (none) + ) + +;; definition for method 12 of type perf-stat +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Perf, r0] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [sync.p] +;; ERROR: Unsupported inline assembly instruction kind - [mfpc v1, pcr0] +;; ERROR: Unsupported inline assembly instruction kind - [mfpc v1, pcr1] +(defmethod read! perf-stat ((obj perf-stat)) + (local-vars (v1-1 int) (v1-3 int)) + (b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!)) + (.mtc0 Perf r0) + (.sync.l) + (.sync.p) + (.mfpc v1-1 pcr0) + (+! (-> obj accum0) v1-1) + (.mfpc v1-3 pcr1) + (+! (-> obj accum1) v1-3) + (label cfg-2) + 0 + (none) + ) + +;; definition for method 13 of type perf-stat +;; INFO: Return type mismatch int vs none. +(defmethod update-wait-stats perf-stat ((obj perf-stat) (arg0 uint) (arg1 uint) (arg2 uint)) + (when (nonzero? (-> obj ctrl)) + (+! (-> obj to-vu0-waits) arg0) + (+! (-> obj to-spr-waits) arg1) + (+! (-> obj from-spr-waits) arg2) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(when (not *debug-segment*) + (set! (-> perf-stat method-table 11) nothing) + (set! (-> perf-stat method-table 12) nothing) + (set! (-> perf-stat method-table 13) nothing) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc new file mode 100644 index 0000000000..86fc1bb6dd --- /dev/null +++ b/test/decompiler/reference/jak2/engine/dma/dma-bucket_REF.gc @@ -0,0 +1,67 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function dma-buffer-add-buckets +;; INFO: Return type mismatch pointer vs (inline-array dma-bucket). +(defun dma-buffer-add-buckets ((arg0 dma-buffer) (arg1 int)) + (let ((v0-0 (-> arg0 base))) + (let ((v1-0 (the-as object v0-0))) + (dotimes (a2-0 arg1) + (set! (-> (the-as dma-bucket v1-0) tag) + (new 'static 'dma-tag :id (dma-tag-id next) :addr (the-as int (&+ (the-as pointer v1-0) 16))) + ) + (set! (-> (the-as dma-bucket v1-0) last) (the-as (pointer dma-tag) v1-0)) + (set! v1-0 (&+ (the-as pointer v1-0) 16)) + ) + (set! (-> arg0 base) (the-as pointer v1-0)) + ) + (the-as (inline-array dma-bucket) v0-0) + ) + ) + +;; definition for function dma-buffer-patch-buckets +;; INFO: Return type mismatch object vs (inline-array dma-bucket). +(defun dma-buffer-patch-buckets ((arg0 (inline-array dma-bucket)) (arg1 int)) + (when (nonzero? arg0) + (dotimes (v1-1 arg1) + (cond + ((= (the-as object arg0) (-> arg0 0 last)) + (set! (-> arg0 0 tag) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> arg0 0 clear) (the-as uint 0)) + 0 + ) + (else + (set! (-> arg0 0 last 0 addr) (the-as int (-> arg0 1))) + (cond + ((or *display-profile* *stats-profile-bars*) + (set! (-> (the-as dma-packet arg0) vif0) (new 'static 'vif-tag :cmd (vif-cmd mark) :imm v1-1)) + (set! (-> (the-as dma-packet arg0) vif1) (new 'static 'vif-tag :irq #x1)) + ) + (else + (set! (-> arg0 0 clear) (the-as uint 0)) + 0 + ) + ) + ) + ) + (set! arg0 (the-as (inline-array dma-bucket) (-> arg0 1))) + ) + ) + (the-as (inline-array dma-bucket) arg0) + ) + +;; definition for function dma-bucket-insert-tag +(defun dma-bucket-insert-tag ((arg0 (inline-array dma-bucket)) (arg1 bucket-id) (arg2 pointer) (arg3 (pointer dma-tag))) + (let ((v1-1 (-> arg0 arg1))) + (set! (-> (the-as dma-bucket (-> v1-1 last)) next) (the-as uint arg2)) + (set! (-> v1-1 last) arg3) + ) + arg2 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc new file mode 100644 index 0000000000..94a5692ff3 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/dma/dma-buffer_REF.gc @@ -0,0 +1,225 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type dma-packet +(deftype dma-packet (structure) + ((dma dma-tag :offset-assert 0) + (vif0 vif-tag :offset-assert 8) + (vif1 vif-tag :offset-assert 12) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type dma-packet +;; INFO: Used lq/sq +(defmethod inspect dma-packet ((obj dma-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-packet) + (format #t "~1Tdma: #x~X~%" (-> obj dma)) + (format #t "~1Tvif0: #x~X~%" (-> obj vif0)) + (format #t "~1Tvif1: #x~X~%" (-> obj vif1)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type dma-packet-array +(deftype dma-packet-array (inline-array-class) + ((data dma-packet :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type dma-packet-array +(defmethod inspect dma-packet-array ((obj dma-packet-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! (-> dma-packet-array heap-base) (the-as uint 16)) + +;; definition of type dma-gif +(deftype dma-gif (structure) + ((gif uint64 2 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type dma-gif +;; INFO: Used lq/sq +(defmethod inspect dma-gif ((obj dma-gif)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-gif) + (format #t "~1Tgif[2] @ #x~X~%" (-> obj gif)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type dma-gif-packet +(deftype dma-gif-packet (structure) + ((dma-vif dma-packet :inline :offset-assert 0) + (gif uint64 2 :offset-assert 16) + (gif0 uint64 :offset 16) + (gif1 uint64 :offset 24) + (quad uint128 2 :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type dma-gif-packet +(defmethod inspect dma-gif-packet ((obj dma-gif-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-gif-packet) + (format #t "~1Tdma-vif: #~%" (-> obj dma-vif)) + (format #t "~1Tgif[2] @ #x~X~%" (-> obj gif)) + (format #t "~1Tquad[2] @ #x~X~%" (-> obj dma-vif)) + (label cfg-4) + obj + ) + +;; definition of type dma-buffer +(deftype dma-buffer (basic) + ((allocated-length int32 :offset-assert 4) + (base pointer :offset-assert 8) + (end pointer :offset-assert 12) + (data uint64 1 :offset-assert 16) + (data-buffer uint8 :dynamic :offset 16) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + (:methods + (new (symbol type int) _type_ 0) + ) + ) + +;; definition for method 3 of type dma-buffer +(defmethod inspect dma-buffer ((obj dma-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tbase: #x~X~%" (-> obj base)) + (format #t "~1Tend: #x~X~%" (-> obj end)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type dma-buffer +(defmethod new dma-buffer ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v0-0 (object-new allocation type-to-make (+ arg0 -4 (-> type-to-make size))))) + (set! (-> v0-0 base) (-> v0-0 data)) + (set! (-> v0-0 allocated-length) arg0) + v0-0 + ) + ) + +;; definition for function dma-buffer-inplace-new +(defun dma-buffer-inplace-new ((arg0 dma-buffer) (arg1 int)) + (set! (-> arg0 base) (-> arg0 data)) + (set! (-> arg0 allocated-length) arg1) + arg0 + ) + +;; definition for method 4 of type dma-buffer +(defmethod length dma-buffer ((obj dma-buffer)) + (-> obj allocated-length) + ) + +;; definition for method 5 of type dma-buffer +(defmethod asize-of dma-buffer ((obj dma-buffer)) + (+ (-> obj allocated-length) -4 (-> dma-buffer size)) + ) + +;; definition for function dma-buffer-length +(defun dma-buffer-length ((arg0 dma-buffer)) + (shr (+ (&- (-> arg0 base) (the-as uint (-> arg0 data))) 15) 4) + ) + +;; definition for function dma-buffer-free +(defun dma-buffer-free ((arg0 dma-buffer)) + (shr (+ (&- (-> arg0 end) (the-as uint (-> arg0 base))) 15) 4) + ) + +;; definition for function dma-buffer-add-vu-function +(defun dma-buffer-add-vu-function ((arg0 dma-buffer) (arg1 vu-function) (arg2 int)) + (let ((v1-0 (&-> arg1 data 4)) + (a3-0 (-> arg1 qlength)) + (a1-1 (-> arg1 origin)) + ) + (while (> a3-0 0) + (let ((t0-1 (min 127 a3-0))) + (let* ((t1-1 arg0) + (t2-0 (the-as object (-> t1-1 base))) + ) + (set! (-> (the-as dma-packet t2-0) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int v1-0) :qwc t0-1) + ) + (set! (-> (the-as dma-packet t2-0) vif0) (new 'static 'vif-tag :cmd (if (zero? arg2) 16 19))) + (set! (-> (the-as dma-packet t2-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd mpg) :num (* t0-1 2) :imm a1-1)) + (set! (-> t1-1 base) (&+ (the-as pointer t2-0) 16)) + ) + (&+! v1-0 (* t0-1 16)) + (set! a3-0 (- a3-0 t0-1)) + (+! a1-1 (* t0-1 2)) + ) + ) + ) + #f + ) + +;; definition for function dma-buffer-send +(defun dma-buffer-send ((arg0 dma-bank) (arg1 dma-buffer)) + (when (< (-> arg1 allocated-length) (&- (-> arg1 base) (the-as uint (-> arg1 data)))) + (crash!) + 0 + ) + (dma-send arg0 (the-as uint (-> arg1 data)) (the-as uint (dma-buffer-length arg1))) + (none) + ) + +;; definition for function dma-buffer-send-chain +(defun dma-buffer-send-chain ((arg0 dma-bank-source) (arg1 dma-buffer)) + (when (< (-> arg1 allocated-length) (&- (-> arg1 base) (the-as uint (-> arg1 data)))) + (crash!) + 0 + ) + (dma-send-chain arg0 (the-as uint (-> arg1 data))) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc new file mode 100644 index 0000000000..e37a47efd9 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/dma/dma-disasm_REF.gc @@ -0,0 +1,733 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition of type vif-disasm-element +(deftype vif-disasm-element (structure) + ((mask uint32 :offset-assert 0) + (tag vif-cmd-32 :offset-assert 4) + (val uint32 :offset-assert 8) + (print uint32 :offset-assert 12) + (string1 string :offset-assert 16) + (string2 string :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type vif-disasm-element +(defmethod inspect vif-disasm-element ((obj vif-disasm-element)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vif-disasm-element) + (format #t "~1Tmask: ~D~%" (-> obj mask)) + (format #t "~1Ttag: ~D~%" (-> obj tag)) + (format #t "~1Tval: ~D~%" (-> obj val)) + (format #t "~1Tprint: ~D~%" (-> obj print)) + (format #t "~1Tstring1: ~A~%" (-> obj string1)) + (format #t "~1Tstring2: ~A~%" (-> obj string2)) + (label cfg-4) + obj + ) + +;; definition for symbol *vif-disasm-table*, type (array vif-disasm-element) +(define *vif-disasm-table* + (the-as (array vif-disasm-element) + (new 'static 'boxed-array :type vif-disasm-element + (new 'static 'vif-disasm-element :mask #x7f :string1 "nop") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 stcycl) :print #x2 :string1 "stcycl") + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 offset) + :print #x1 + :string1 "offset" + :string2 "offset" + ) + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 base) :print #x1 :string1 "base" :string2 "base") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 itop) :print #x1 :string1 "itop" :string2 "addr") + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 stmod) + :print #x1 + :string1 "stmod" + :string2 "mode" + ) + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 mskpath3) + :print #x1 + :string1 "mskpath3" + :string2 "mask" + ) + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mark) :print #x1 :string1 "mark" :string2 "mark") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 flushe) :string1 "flushe") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 flush) :string1 "flush") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 flusha) :string1 "flusha") + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 mscal) + :print #x1 + :string1 "mscal" + :string2 "addr" + ) + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mscnt) :string1 "mscnt") + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 mscalf) + :print #x1 + :string1 "mscalf" + :string2 "addr" + ) + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 stmask) + :print #x3 + :string1 "stmask" + :string2 "mask" + ) + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 strow) + :print #x4 + :string1 "strow" + :string2 "row" + ) + (new 'static 'vif-disasm-element + :mask #x7f + :tag (vif-cmd-32 stcol) + :print #x4 + :string1 "stcol" + :string2 "col" + ) + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 mpg) :print #x5 :string1 "mpg") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 direct) :print #x6 :string1 "direct") + (new 'static 'vif-disasm-element :mask #x7f :tag (vif-cmd-32 directhl) :print #x6 :string1 "directhl") + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-s-32) + :val #x10 + :print #x7 + :string1 "unpack-s-32" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-s-16) + :val #x8 + :print #x7 + :string1 "unpack-s-16" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-s-8) + :val #x4 + :print #x7 + :string1 "unpack-s-8" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v2-32) + :val #x8 + :print #x7 + :string1 "unpack-v2-32" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v2-16) + :val #x4 + :print #x7 + :string1 "unpack-v2-16" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v2-8) + :val #x2 + :print #x7 + :string1 "unpack-v2-8" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v3-32) + :val #xc + :print #x7 + :string1 "unpack-v3-32" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v3-16) + :val #x6 + :print #x7 + :string1 "unpack-v3-16" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v3-8) + :val #x3 + :print #x7 + :string1 "unpack-v3-8" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v4-32) + :val #x10 + :print #x7 + :string1 "unpack-v4-32" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v4-16) + :val #x8 + :print #x7 + :string1 "unpack-v4-16" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v4-8) + :val #x4 + :print #x7 + :string1 "unpack-v4-8" + ) + (new 'static 'vif-disasm-element + :mask #x6f + :tag (vif-cmd-32 unpack-v4-5) + :val #x2 + :print #x7 + :string1 "unpack-v4-5" + ) + (new 'static 'vif-disasm-element :print #x8) + ) + ) + ) + +;; definition for function disasm-vif-details +(defun disasm-vif-details ((arg0 symbol) (arg1 (pointer uint8)) (arg2 vif-cmd) (arg3 int)) + (let ((s4-0 arg3)) + (cond + ((= arg2 (vif-cmd unpack-v4-8)) + (let ((s3-0 (&-> arg1 4))) + (dotimes (s2-0 s4-0) + (format + arg0 + " #x~X: #x~2X #x~2X #x~2X #x~2X~%" + (+ (+ (* s2-0 4) 4) (the-as int arg1)) + (-> s3-0 (* s2-0 4)) + (-> s3-0 (+ (* s2-0 4) 1)) + (-> s3-0 (+ (* s2-0 4) 2)) + (-> s3-0 (+ (* s2-0 4) 3)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-s-8)) + (let ((s3-1 (&-> arg1 4))) + (dotimes (s2-1 s4-0) + (format arg0 " #x~X: #x~2x~%" (+ (+ s2-1 4) (the-as int arg1)) arg3) + (-> s3-1 (* 3 s2-1)) + (-> s3-1 (+ (* 3 s2-1) 1)) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v4-32)) + (let ((s3-2 (the-as (pointer uint32) (&-> arg1 4)))) + (dotimes (s2-2 s4-0) + (format + arg0 + " #x~X: #x~8x #x~8x #x~8x #x~8x~%" + (+ (+ (* s2-2 16) 4) (the-as int arg1)) + (-> s3-2 (* s2-2 4)) + (-> s3-2 (+ (* s2-2 4) 1)) + (-> s3-2 (+ (* s2-2 4) 2)) + (-> s3-2 (+ (* s2-2 4) 3)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v4-16)) + (let ((s3-3 (the-as (pointer uint16) (&-> arg1 4)))) + (dotimes (s2-3 s4-0) + (format + arg0 + " #x~X: #x~4x #x~4x #x~4x #x~4x~%" + (+ (+ (* s2-3 8) 4) (the-as int arg1)) + (-> s3-3 (* s2-3 4)) + (-> s3-3 (+ (* s2-3 4) 1)) + (-> s3-3 (+ (* s2-3 4) 2)) + (-> s3-3 (+ (* s2-3 4) 3)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v3-32)) + (let ((s3-4 (the-as (pointer uint32) (&-> arg1 4)))) + (dotimes (s2-4 s4-0) + (format + arg0 + " #x~X: #x~8x #x~8x #x~8x~%" + (+ (+ (* 12 s2-4) 4) (the-as int arg1)) + (-> (&+ s3-4 (* 12 s2-4)) 0) + (-> s3-4 (+ (* 3 s2-4) 1)) + (-> s3-4 (+ (* 3 s2-4) 2)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v3-16)) + (let ((s3-5 (the-as (pointer uint16) (&-> arg1 4)))) + (dotimes (s2-5 s4-0) + (format + arg0 + " #x~X: #x~4x #x~4x #x~4x~%" + (+ (+ (* 6 s2-5) 4) (the-as int arg1)) + (-> (&+ s3-5 (* 6 s2-5)) 0) + (-> s3-5 (+ (* 3 s2-5) 1)) + (-> s3-5 (+ (* 3 s2-5) 2)) + ) + ) + ) + ) + ((= arg2 (vif-cmd unpack-v2-16)) + (let ((s3-6 (the-as (pointer uint16) (&-> arg1 4)))) + (dotimes (s2-6 s4-0) + (format + arg0 + " #x~X: #x~4x #x~4x~%" + (+ (+ (* s2-6 4) 4) (the-as int arg1)) + (-> (&+ s3-6 (* 6 s2-6)) 0) + (-> s3-6 (+ (* 3 s2-6) 1)) + ) + ) + ) + ) + (else + (format arg0 " #x~X: Data format #b~b not yet supported, add it for yourself!~%" (&-> arg1 4) arg2) + ) + ) + ) + #f + ) + +;; definition for function disasm-vif-tag +;; INFO: Used lq/sq +(defun disasm-vif-tag ((arg0 (pointer vif-tag)) (arg1 int) (arg2 symbol) (arg3 symbol)) + (local-vars (sv-16 vif-cmd) (sv-32 (pointer vif-tag)) (sv-48 int) (sv-64 vif-unpack-imm)) + (let ((gp-0 0)) + (while (< gp-0 (* arg1 4)) + (let ((s0-0 4)) + (let ((s1-0 (-> arg0 0))) + (format arg2 " #x~X:" arg0) + (dotimes (v1-0 (-> *vif-disasm-table* length)) + (set! sv-16 (-> s1-0 cmd)) + (when (= (logand sv-16 (-> *vif-disasm-table* v1-0 mask)) (-> *vif-disasm-table* v1-0 tag)) + (let ((a0-12 (-> *vif-disasm-table* v1-0 print))) + (cond + ((zero? a0-12) + (format arg2 " (~s :irq ~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq)) + ) + ((= a0-12 1) + (format + arg2 + " (~s :irq ~D :~s #x~X)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> *vif-disasm-table* v1-0 string2) + (-> s1-0 imm) + ) + ) + ((= a0-12 2) + (let ((t1-1 (-> s1-0 imm))) + (format + arg2 + " (~s :irq ~D :wl ~D :cl ~D)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (shr (shl (the-as int t1-1) 48) 56) + (shr (shl (the-as int t1-1) 56) 56) + ) + ) + ) + ((= a0-12 3) + (set! s0-0 8) + (format + arg2 + " (~s :irq ~D :~s #x~X)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> *vif-disasm-table* v1-0 string2) + (-> arg0 1) + ) + ) + ((= a0-12 4) + (set! s0-0 20) + (format + arg2 + " (~s :irq ~D :~s " + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> *vif-disasm-table* v1-0 string2) + ) + (format arg2 "#x~X #x~X #x~X #x~X)~%" (-> arg0 1) (-> arg0 2) (-> arg0 3) (-> arg0 4)) + ) + ((= a0-12 5) + (format + arg2 + " (~s :irq ~D :instructions #x~D :addr #x~X)~%" + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> s1-0 num) + (-> s1-0 imm) + ) + ) + ((= a0-12 6) + (if (-> s1-0 imm) + (set! s0-0 #x100000) + (set! s0-0 (the-as int (* (-> s1-0 imm) 16))) + ) + (format arg2 " (~s :irq ~D :qwc #x~D)~%" (-> *vif-disasm-table* v1-0 string1) (-> s1-0 irq) (-> s1-0 imm)) + (set! sv-32 (&-> arg0 1)) + (set! sv-48 0) + (while (< sv-48 (the-as int (-> s1-0 imm))) + (format + arg2 + " #x~X: #x~8x #x~8x #x~8x #x~8x~%" + (+ (+ (* sv-48 16) 4) (the-as int arg0)) + (-> sv-32 (* sv-48 4)) + (-> sv-32 (+ (* sv-48 4) 1)) + (-> sv-32 (+ (* sv-48 4) 2)) + (-> sv-32 (+ (* sv-48 4) 3)) + ) + (set! sv-48 (+ sv-48 1)) + ) + #f + ) + ((= a0-12 7) + (set! s0-0 (the-as int (+ (logand -4 (+ (* (-> *vif-disasm-table* v1-0 val) (-> s1-0 num)) 3)) 4))) + (set! sv-64 (the-as vif-unpack-imm (-> s1-0 imm))) + (format + arg2 + " (~s :irq ~D :num ~D :addr #x~X " + (-> *vif-disasm-table* v1-0 string1) + (-> s1-0 irq) + (-> s1-0 num) + (-> sv-64 addr) + ) + (format + arg2 + ":msk ~D :flg ~D :usn ~D [skip ~d])~%" + (-> s1-0 msk) + (-> sv-64 flg) + (-> sv-64 usn) + (the-as uint s0-0) + ) + (if arg3 + (disasm-vif-details + arg2 + (the-as (pointer uint8) arg0) + (logand sv-16 (vif-cmd cmd-mask)) + (the-as int (-> s1-0 num)) + ) + ) + ) + ((= a0-12 8) + (format arg2 " (*unknown* vif-tag #x~X)~%" (-> s1-0 cmd)) + ) + ) + ) + (set! v1-0 (-> *vif-disasm-table* length)) + ) + ) + ) + (+! gp-0 s0-0) + (&+! arg0 s0-0) + ) + ) + (- gp-0 (* arg1 4)) + ) + ) + +;; definition for function disasm-dma-tag +;; INFO: Return type mismatch object vs none. +(defun disasm-dma-tag ((arg0 dma-tag) (arg1 symbol)) + (format arg1 "(dma-tag ") + (let ((t9-1 format) + (a0-2 arg1) + (a1-2 "~s") + (v1-1 (-> arg0 id)) + ) + (t9-1 a0-2 a1-2 (cond + ((= v1-1 (dma-tag-id refe)) + "refe" + ) + ((= v1-1 (dma-tag-id refs)) + "refs" + ) + ((= v1-1 (dma-tag-id ret)) + "ret" + ) + ((= v1-1 (dma-tag-id cnt)) + "cnt" + ) + ((= v1-1 (dma-tag-id next)) + "next" + ) + ((= v1-1 (dma-tag-id call)) + "call" + ) + ((= v1-1 (dma-tag-id ref)) + "ref" + ) + ((= v1-1 (dma-tag-id end)) + "end" + ) + (else + "*unknown*" + ) + ) + ) + ) + (if (> (-> arg0 addr) 0) + (format arg1 " :addr #x~8x" (-> arg0 addr)) + ) + (if (> (-> arg0 qwc) 0) + (format arg1 " :qwc ~d" (-> arg0 qwc)) + ) + (if (> (-> arg0 spr) 0) + (format arg1 " :spr ~d" (-> arg0 spr)) + ) + (if (> (-> arg0 irq) 0) + (format arg1 " :irq ~d" (-> arg0 irq)) + ) + (if (> (-> arg0 pce) 0) + (format arg1 " :pce ~d" (-> arg0 pce)) + ) + (format arg1 ")~%") + (none) + ) + +;; definition for symbol *dma-disasm*, type symbol +(define *dma-disasm* #t) + +;; definition for function disasm-dma-list +;; WARN: Check prologue - tricky store of a0 +;; INFO: Used lq/sq +(defun disasm-dma-list ((arg0 dma-packet) (arg1 symbol) (arg2 symbol) (arg3 symbol) (arg4 int)) + (local-vars + (sv-16 object) + (sv-32 dma-packet) + (sv-48 int) + (sv-64 object) + (sv-80 object) + (sv-96 int) + (sv-112 dma-tag) + ) + (set! sv-32 arg0) + (let ((s2-0 arg1) + (s3-0 arg2) + (gp-0 arg3) + (s1-0 arg4) + ) + (if s3-0 + (format gp-0 "~%--- ~X -----------------------------~%" sv-32) + ) + (let ((s0-0 #f)) + (let ((s4-0 0) + (s5-0 0) + ) + (set! sv-16 0) + (set! sv-48 0) + (set! sv-64 0) + (set! sv-80 1) + (set! sv-96 -1) + (set! sv-112 (new 'static 'dma-tag)) + (while (not s0-0) + (let ((t9-1 valid?) + (a0-2 sv-32) + (a1-2 #f) + (a2-2 "dma-list tag pointer") + ) + (cond + ((not (t9-1 a0-2 (the-as type a1-2) (the-as symbol a2-2) #t gp-0)) + (format gp-0 "ERROR: dma-list tag pointer invalid~%") + (set! s0-0 'error) + ) + (else + (set! sv-112 (-> sv-32 dma)) + (when (not (or (zero? s5-0) (let ((t9-3 valid?) + (a0-4 sv-16) + (a1-4 #f) + ) + (set! a2-2 "dma-list data pointer") + (t9-3 a0-4 (the-as type a1-4) (the-as symbol a2-2) #t gp-0) + ) + ) + ) + (format gp-0 "ERROR: dma-list data pointer invalid~%") + (set! s0-0 'error) + ) + (when (logtest? (the-as dma-tag #x3ff0000) sv-112) + (format gp-0 "ERROR: dma tag has data in reserved bits ~X~%" (the-as none a2-2)) + (set! s0-0 'error) + ) + ) + ) + ) + (when (or s3-0 (= s0-0 'error)) + (format gp-0 "#x~8x: " sv-32) + (cond + ((zero? sv-96) + (format gp-0 " ") + ) + ((= sv-96 1) + (format gp-0 " ") + ) + ) + (disasm-dma-tag sv-112 gp-0) + ) + (cond + (s0-0 + ) + ((or (= (-> sv-112 id) (dma-tag-id ref)) (= (-> sv-112 id) (dma-tag-id refs)) (zero? (-> sv-112 id))) + (set! sv-16 (-> sv-112 addr)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (when s2-0 + (let ((v0-10 (disasm-vif-tag (&-> sv-32 vif0) 2 gp-0 (= s2-0 'details)))) + (disasm-vif-tag + (the-as (pointer vif-tag) (+ sv-16 v0-10)) + (the-as int (- (* sv-48 4) (the-as uint (/ v0-10 4)))) + gp-0 + (= s2-0 'details) + ) + ) + ) + (set! sv-32 (the-as dma-packet (&-> (the-as (pointer uint64) sv-32) 2))) + (if (= (-> sv-112 id) (dma-tag-id refe)) + (set! s0-0 #t) + ) + ) + ((= (-> sv-112 id) (dma-tag-id cnt)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (set! sv-32 (the-as dma-packet (+ (the-as uint sv-32) (* (+ sv-48 1) 16)))) + sv-32 + ) + ((= (-> sv-112 id) (dma-tag-id next)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (when (= sv-32 (-> sv-112 addr)) + (format gp-0 "ERROR: next tag creates infinite loop.~%") + (set! s0-0 'error) + ) + (set! sv-32 (the-as dma-packet (-> sv-112 addr))) + sv-32 + ) + ((= (-> sv-112 id) (dma-tag-id call)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (set! sv-32 (the-as dma-packet (-> sv-112 addr))) + (set! sv-96 (+ sv-96 1)) + (cond + ((zero? sv-96) + (set! sv-64 (&+ sv-16 sv-48)) + (the-as (pointer uint64) sv-64) + ) + (else + (set! sv-80 (&+ sv-16 sv-48)) + (the-as (pointer uint64) sv-80) + ) + ) + ) + ((= (-> sv-112 id) (dma-tag-id ret)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + (let ((v1-123 sv-96)) + (cond + ((zero? v1-123) + (set! sv-32 (the-as dma-packet sv-64)) + sv-32 + ) + ((= v1-123 1) + (set! sv-32 (the-as dma-packet sv-80)) + sv-32 + ) + (else + (set! s0-0 #t) + ) + ) + ) + (set! sv-96 (+ sv-96 -1)) + sv-96 + ) + ((= (-> sv-112 id) (dma-tag-id end)) + (set! sv-16 (&-> (the-as (pointer uint64) sv-32) 2)) + (set! sv-48 (the-as int (-> sv-112 qwc))) + (set! s0-0 #t) + (if s2-0 + (disasm-vif-tag + (the-as (pointer vif-tag) (&-> (the-as (pointer uint64) sv-32) 1)) + (the-as int (+ (* sv-48 4) 2)) + gp-0 + (= s2-0 'details) + ) + ) + ) + (else + (format gp-0 "ERROR: Unknown DMA TAG command.~%") + (set! s0-0 'error) + ) + ) + (+! s4-0 sv-48) + (+! s5-0 1) + (if (and (>= s1-0 0) (>= s5-0 s1-0)) + (set! s0-0 #t) + ) + ) + (when (or s3-0 (= s0-0 'error)) + (format gp-0 "NOTICE: Total tags: ~d~%" s5-0) + (format gp-0 "NOTICE: Total QWC: ~d~%" s4-0) + (format gp-0 "--------------------------------~%~%") + ) + ) + (!= s0-0 'error) + ) + ) + ) + +) + + + diff --git a/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc b/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc new file mode 100644 index 0000000000..1d51b6c4ea --- /dev/null +++ b/test/decompiler/reference/jak2/engine/dma/dma-h_REF.gc @@ -0,0 +1,395 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type dma-chcr +(deftype dma-chcr (uint32) + ((dir uint8 :offset 0 :size 1) + (mod uint8 :offset 2 :size 2) + (asp uint8 :offset 4 :size 2) + (tte uint8 :offset 6 :size 1) + (tie uint8 :offset 7 :size 1) + (str uint8 :offset 8 :size 1) + (tag uint16 :offset 16 :size 16) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type dma-chcr +(defmethod inspect dma-chcr ((obj dma-chcr)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-chcr) + (format #t "~1Tdir: ~D~%" (-> obj dir)) + (format #t "~1Tmod: ~D~%" (-> obj mod)) + (format #t "~1Tasp: ~D~%" (-> obj asp)) + (format #t "~1Ttte: ~D~%" (-> obj tte)) + (format #t "~1Ttie: ~D~%" (-> obj tie)) + (format #t "~1Tstr: ~D~%" (-> obj str)) + (format #t "~1Ttag: #x~X~%" (-> obj tag)) + (label cfg-4) + obj + ) + +;; definition of type dma-bank +(deftype dma-bank (structure) + ((chcr dma-chcr :offset 0) + (madr uint32 :offset 16) + (qwc uint32 :offset 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type dma-bank +(defmethod inspect dma-bank ((obj dma-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-bank) + (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) + (format #t "~1Tmadr: #x~X~%" (-> obj madr)) + (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) + (label cfg-4) + obj + ) + +;; definition of type dma-bank-source +(deftype dma-bank-source (dma-bank) + ((tadr uint32 :offset 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type dma-bank-source +(defmethod inspect dma-bank-source ((obj dma-bank-source)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-bank-source) + (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) + (format #t "~1Tmadr: #x~X~%" (-> obj madr)) + (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) + (format #t "~1Ttadr: #x~X~%" (-> obj tadr)) + (label cfg-4) + obj + ) + +;; definition of type dma-bank-vif +(deftype dma-bank-vif (dma-bank-source) + ((as0 uint32 :offset 64) + (as1 uint32 :offset 80) + ) + :method-count-assert 9 + :size-assert #x54 + :flag-assert #x900000054 + ) + +;; definition for method 3 of type dma-bank-vif +(defmethod inspect dma-bank-vif ((obj dma-bank-vif)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-bank-vif) + (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) + (format #t "~1Tmadr: #x~X~%" (-> obj madr)) + (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) + (format #t "~1Ttadr: #x~X~%" (-> obj tadr)) + (format #t "~1Tas0: #x~X~%" (-> obj as0)) + (format #t "~1Tas1: #x~X~%" (-> obj as1)) + (label cfg-4) + obj + ) + +;; definition of type dma-bank-spr +(deftype dma-bank-spr (dma-bank-source) + ((sadr uint32 :offset 128) + ) + :method-count-assert 9 + :size-assert #x84 + :flag-assert #x900000084 + ) + +;; definition for method 3 of type dma-bank-spr +(defmethod inspect dma-bank-spr ((obj dma-bank-spr)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-bank-spr) + (format #t "~1Tchcr: #x~X~%" (-> obj chcr)) + (format #t "~1Tmadr: #x~X~%" (-> obj madr)) + (format #t "~1Tqwc: #x~X~%" (-> obj qwc)) + (format #t "~1Ttadr: #x~X~%" (-> obj tadr)) + (format #t "~1Tsadr: #x~X~%" (-> obj sadr)) + (label cfg-4) + obj + ) + +;; definition of type dma-ctrl +(deftype dma-ctrl (uint32) + ((dmae uint8 :offset 0 :size 1) + (rele uint8 :offset 1 :size 1) + (mfd uint8 :offset 2 :size 2) + (sts uint8 :offset 4 :size 2) + (std uint8 :offset 6 :size 2) + (rcyc uint8 :offset 8 :size 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type dma-enable +(deftype dma-enable (uint32) + ((cpnd uint8 :offset 16 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type dma-sqwc +(deftype dma-sqwc (uint32) + ((sqwc uint8 :offset 0 :size 8) + (tqwc uint8 :offset 16 :size 8) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type dma-bank-control +(deftype dma-bank-control (structure) + ((ctrl dma-ctrl :offset 0) + (stat uint32 :offset 16) + (pcr uint32 :offset 32) + (sqwc dma-sqwc :offset 48) + (rbsr uint32 :offset 64) + (rbor uint32 :offset 80) + (stadr uint32 :offset 96) + (enabler uint32 :offset 5408) + (enablew uint32 :offset 5520) + ) + :method-count-assert 9 + :size-assert #x1594 + :flag-assert #x900001594 + ) + +;; definition for method 3 of type dma-bank-control +(defmethod inspect dma-bank-control ((obj dma-bank-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-bank-control) + (format #t "~1Tctrl: #x~X~%" (-> obj ctrl)) + (format #t "~1Tstat: #x~X~%" (-> obj stat)) + (format #t "~1Tpcr: #x~X~%" (-> obj pcr)) + (format #t "~1Tsqwc: #x~X~%" (-> obj sqwc)) + (format #t "~1Trbsr: #x~X~%" (-> obj rbsr)) + (format #t "~1Trbor: #x~X~%" (-> obj rbor)) + (format #t "~1Tstadr: #x~X~%" (-> obj stadr)) + (format #t "~1Tenabler: ~D~%" (-> obj enabler)) + (format #t "~1Tenablew: ~D~%" (-> obj enablew)) + (label cfg-4) + obj + ) + +;; definition of type vu-code-block +(deftype vu-code-block (basic) + ((name basic :offset-assert 4) + (code uint32 :offset-assert 8) + (size int32 :offset-assert 12) + (dest-address uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type vu-code-block +(defmethod inspect vu-code-block ((obj vu-code-block)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tcode: #x~X~%" (-> obj code)) + (format #t "~1Tsize: ~D~%" (-> obj size)) + (format #t "~1Tdest-address: ~D~%" (-> obj dest-address)) + (label cfg-4) + obj + ) + +;; definition of type vu-stat +(deftype vu-stat (uint64) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type dma-tag +(deftype dma-tag (uint64) + ((qwc uint16 :offset 0 :size 16) + (pce uint8 :offset 26 :size 2) + (id dma-tag-id :offset 28 :size 3) + (irq uint8 :offset 31 :size 1) + (addr uint32 :offset 32 :size 31) + (spr uint8 :offset 63 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type dma-tag +(defmethod inspect dma-tag ((obj dma-tag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-tag) + (format #t "~1Tqwc: ~D~%" (-> obj qwc)) + (format #t "~1Tpce: ~D~%" (-> obj pce)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tirq: ~D~%" (-> obj irq)) + (format #t "~1Taddr: #x~X~%" (-> obj addr)) + (format #t "~1Tspr: ~D~%" (-> obj spr)) + (label cfg-4) + obj + ) + +;; definition of type dma-bucket +(deftype dma-bucket (structure) + ((tag dma-tag :offset-assert 0) + (last (pointer dma-tag) :offset-assert 8) + (dummy uint32 :offset-assert 12) + (next uint32 :offset 4) + (clear uint64 :offset 8) + (vif0 uint32 :offset 8) + (vif1 uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type dma-bucket +(defmethod inspect dma-bucket ((obj dma-bucket)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-bucket) + (format #t "~1Ttag: ~D~%" (-> obj tag)) + (format #t "~1Tlast: #x~X~%" (-> obj last)) + (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (format #t "~1Tnext: #x~X~%" (-> obj next)) + (format #t "~1Tclear: ~D~%" (-> obj clear)) + (format #t "~1Tvif0: ~D~%" (-> obj last)) + (format #t "~1Tvif1: ~D~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type vif-mask +(deftype vif-mask (uint32) + ((m0 uint8 :offset 0 :size 2) + (m1 uint8 :offset 2 :size 2) + (m2 uint8 :offset 4 :size 2) + (m3 uint8 :offset 6 :size 2) + (m4 uint8 :offset 8 :size 2) + (m5 uint8 :offset 10 :size 2) + (m6 uint8 :offset 12 :size 2) + (m7 uint8 :offset 14 :size 2) + (m8 uint8 :offset 16 :size 2) + (m9 uint8 :offset 18 :size 2) + (m10 uint8 :offset 20 :size 2) + (m11 uint8 :offset 22 :size 2) + (m12 uint8 :offset 24 :size 2) + (m13 uint8 :offset 26 :size 2) + (m14 uint8 :offset 28 :size 2) + (m15 uint8 :offset 30 :size 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type vif-stcycl-imm +(deftype vif-stcycl-imm (uint16) + ((cl uint8 :offset 0 :size 8) + (wl uint8 :offset 8 :size 8) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition of type vif-unpack-imm +(deftype vif-unpack-imm (uint16) + ((addr uint16 :offset 0 :size 10) + (usn uint8 :offset 14 :size 1) + (flg uint8 :offset 15 :size 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition of type vif-tag +(deftype vif-tag (uint32) + ((imm uint16 :offset 0 :size 16) + (num uint8 :offset 16 :size 8) + (cmd vif-cmd :offset 24 :size 7) + (irq uint8 :offset 31 :size 1) + (msk uint8 :offset 28 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type vif-tag +(defmethod inspect vif-tag ((obj vif-tag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vif-tag) + (format #t "~1Timm: #x~X~%" (-> obj imm)) + (format #t "~1Tnum: ~D~%" (-> obj num)) + (format #t "~1Tcmd: #x~X~%" (-> obj cmd)) + (format #t "~1Tmsk: ~D~%" (-> obj msk)) + (format #t "~1Tirq: ~D~%" (-> obj irq)) + (label cfg-4) + obj + ) + +;; definition for function dma-sync-fast +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function dma-send-no-scratch +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function dma-sync-with-count +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function dma-count-until-done +;; ERROR: function was not converted to expressions. Cannot decompile. + + + + diff --git a/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc new file mode 100644 index 0000000000..c7d249a2c1 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/draw/draw-node-h_REF.gc @@ -0,0 +1,71 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type draw-node +(deftype draw-node (drawable) + ((child-count uint8 :offset 6) + (flags uint8 :offset 7) + (child drawable :offset 8) + (distance float :offset 12) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type draw-node +(defmethod inspect draw-node ((obj draw-node)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tchild-count: ~D~%" (-> obj child-count)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tchild: #x~X~%" (-> obj child)) + (format #t "~1Tdistance: #x~X~%" (-> obj distance)) + (label cfg-4) + obj + ) + +;; definition of type drawable-inline-array-node +(deftype drawable-inline-array-node (drawable-inline-array) + ((data draw-node 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +;; definition of type draw-node-dma +(deftype draw-node-dma (structure) + ((banka draw-node 32 :inline :offset-assert 0) + (bankb draw-node 32 :inline :offset-assert 1024) + ) + :method-count-assert 9 + :size-assert #x800 + :flag-assert #x900000800 + ) + +;; definition for method 3 of type draw-node-dma +(defmethod inspect draw-node-dma ((obj draw-node-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'draw-node-dma) + (format #t "~1Tbanka[32] @ #x~X~%" (-> obj banka)) + (format #t "~1Tbankb[32] @ #x~X~%" (-> obj bankb)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc new file mode 100644 index 0000000000..772cc03e37 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/draw/drawable-actor-h_REF.gc @@ -0,0 +1,50 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-actor +(deftype drawable-actor (drawable) + ((actor entity-actor :offset 8) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type drawable-actor +(defmethod inspect drawable-actor ((obj drawable-actor)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tactor: ~A~%" (-> obj actor)) + (label cfg-4) + obj + ) + +;; definition of type drawable-tree-actor +(deftype drawable-tree-actor (drawable-tree) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type drawable-inline-array-actor +(deftype drawable-inline-array-actor (drawable-inline-array) + ((data drawable-actor 1 :inline :offset-assert 32) + (pad uint8 4 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +;; definition for method 10 of type drawable-tree-actor +;; INFO: Return type mismatch int vs none. +(defmethod draw drawable-tree-actor ((obj drawable-tree-actor) (arg0 drawable-tree-actor) (arg1 display-frame)) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc new file mode 100644 index 0000000000..b94d6ba6ad --- /dev/null +++ b/test/decompiler/reference/jak2/engine/draw/drawable-group-h_REF.gc @@ -0,0 +1,37 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-group +(deftype drawable-group (drawable) + ((length int16 :offset 6) + (data drawable :dynamic :offset-assert 32) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type drawable-group +(defmethod inspect drawable-group ((obj drawable-group)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + ) + (label cfg-7) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc new file mode 100644 index 0000000000..4fc3391c12 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/draw/drawable-h_REF.gc @@ -0,0 +1,61 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable +(deftype drawable (basic) + ((id int16 :offset-assert 4) + (bsphere vector :inline :offset-assert 16) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + (:methods + (login (_type_) _type_ 9) + (draw (_type_ _type_ display-frame) none 10) + (drawable-method-11 () none 11) + (drawable-method-12 () none 12) + (drawable-method-13 () none 13) + (debug-draw (_type_ drawable display-frame) none 14) + (unpack-vis (_type_ (pointer int8) (pointer int8)) (pointer int8) 15) + (drawable-method-16 () none 16) + ) + ) + +;; definition for method 3 of type drawable +(defmethod inspect drawable ((obj drawable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (label cfg-4) + obj + ) + +;; definition of type drawable-error +(deftype drawable-error (drawable) + ((name string :offset-assert 32) + ) + :method-count-assert 17 + :size-assert #x24 + :flag-assert #x1100000024 + ) + +;; definition for method 3 of type drawable-error +(defmethod inspect drawable-error ((obj drawable-error)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc new file mode 100644 index 0000000000..c3b0832cfb --- /dev/null +++ b/test/decompiler/reference/jak2/engine/draw/drawable-inline-array-h_REF.gc @@ -0,0 +1,32 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-inline-array +(deftype drawable-inline-array (drawable) + ((length int16 :offset 6) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type drawable-inline-array +(defmethod inspect drawable-inline-array ((obj drawable-inline-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc b/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc new file mode 100644 index 0000000000..9d2e2c433a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/draw/drawable-tree-h_REF.gc @@ -0,0 +1,26 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type drawable-tree +(deftype drawable-tree (drawable-group) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type drawable-tree-array +(deftype drawable-tree-array (drawable-group) + ((trees drawable-tree :dynamic :offset 32) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/engine/engines_REF.gc b/test/decompiler/reference/jak2/engine/engine/engines_REF.gc new file mode 100644 index 0000000000..816f62bcf4 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/engine/engines_REF.gc @@ -0,0 +1,45 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(kmemopen global "engines") + +;; definition for symbol *background-draw-engine*, type engine +(define *background-draw-engine* (new 'global 'engine 'draw 10 connection)) + +;; definition for symbol *matrix-engine*, type (array handle) +(define *matrix-engine* (the-as (array handle) (new 'global 'boxed-array handle 1024))) + +;; failed to figure out what this is: +(set! (-> *matrix-engine* length) 0) + +;; definition for symbol *part-engine*, type engine +(define *part-engine* (new 'global 'engine 'sparticle-launcher 256 connection)) + +;; definition for symbol *camera-engine*, type engine +(define *camera-engine* (new 'global 'engine 'camera-eng 128 connection)) + +;; this part is debug only +(when *debug-segment* +;; definition for symbol *debug-engine*, type engine +(define *debug-engine* (new 'debug 'engine 'debug 64 connection)) + +) +;; definition for symbol *pad-engine*, type engine +(define *pad-engine* (new 'global 'engine 'pad 4 connection)) + +;; definition for symbol *lightning-engine*, type engine +(define *lightning-engine* (new 'global 'engine 'lightning-control 128 connection)) + +;; definition for symbol *hud-engine*, type engine +(define *hud-engine* (new 'global 'engine 'hud 16 connection)) + +;; definition for symbol *task-manager-engine*, type engine +(define *task-manager-engine* (new 'global 'engine 'task-manager 16 connection)) + +;; failed to figure out what this is: +(kmemclose) + + + + diff --git a/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc new file mode 100644 index 0000000000..94e2c56160 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/entity/actor-link-h_REF.gc @@ -0,0 +1,402 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function entity-actor-lookup +;; INFO: Used lq/sq +;; INFO: Return type mismatch entity vs entity-actor. +(defun entity-actor-lookup ((arg0 res-lump) (arg1 symbol) (arg2 int)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16)))) + (the-as + entity-actor + (when (and v1-1 (< arg2 (the-as int (-> sv-16 elt-count)))) + (if (= (-> sv-16 elt-type) string) + (entity-by-name (the-as string (-> (the-as (pointer uint32) (&+ v1-1 (* arg2 4)))))) + (entity-by-aid (-> (the-as (pointer uint32) (&+ v1-1 (* arg2 4))))) + ) + ) + ) + ) + ) + +;; definition for function entity-actor-count +;; WARN: Check prologue - tricky store of r0 +;; INFO: Used lq/sq +(defun entity-actor-count ((arg0 res-lump) (arg1 symbol)) + (local-vars (sv-16 res-tag)) + (set! sv-16 (new 'static 'res-tag)) + (if (res-lump-data arg0 arg1 pointer :tag-ptr (& sv-16)) + (the-as int (-> sv-16 elt-count)) + 0 + ) + ) + +;; definition of type actor-link-info +(deftype actor-link-info (basic) + ((process process :offset-assert 4) + (next entity-actor :offset-assert 8) + (prev entity-actor :offset-assert 12) + ) + :method-count-assert 26 + :size-assert #x10 + :flag-assert #x1a00000010 + (:methods + (new (symbol type process symbol) _type_ 0) + (get-matching-actor-type-mask (_type_ type) int 9) + (actor-count-before (_type_) int 10) + (link-to-next-and-prev-actor (_type_) actor-link-info 11) + (get-next (_type_) entity-actor 12) + (get-prev (_type_) entity-actor 13) + (get-next-process (_type_) process 14) + (get-prev-process (_type_) process 15) + (apply-function-forward (_type_ (function entity-actor object object) object) int 16) + (apply-function-reverse (_type_ (function entity-actor object object) object) int 17) + (apply-all (_type_ (function entity-actor object object) object) int 18) + (send-to-all (_type_ symbol) none 19) + (send-to-all-after (_type_ symbol) object 20) + (send-to-all-before (_type_ symbol) object 21) + (send-to-next-and-prev (_type_ symbol) none 22) + (send-to-next (_type_ symbol) none 23) + (send-to-prev (_type_ symbol) none 24) + (actor-count (_type_) int 25) + ) + ) + +;; definition for method 3 of type actor-link-info +(defmethod inspect actor-link-info ((obj actor-link-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tnext: ~A~%" (-> obj next)) + (format #t "~1Tprev: ~A~%" (-> obj prev)) + (label cfg-4) + obj + ) + +;; definition for method 27 of type entity-actor +(defmethod next-actor entity-actor ((obj entity-actor)) + (entity-actor-lookup obj 'next-actor 0) + ) + +;; definition for method 28 of type entity-actor +(defmethod prev-actor entity-actor ((obj entity-actor)) + (entity-actor-lookup obj 'prev-actor 0) + ) + +;; definition for method 0 of type actor-link-info +(defmethod new actor-link-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol)) + (let* ((a0-1 (-> arg0 entity)) + (s4-0 (entity-actor-lookup a0-1 'next-actor 0)) + (a0-2 (-> arg0 entity)) + (s3-0 (entity-actor-lookup a0-2 'prev-actor 0)) + ) + (when (or (not arg1) s4-0 s3-0) + (let ((v0-2 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-2 process) arg0) + (set! (-> v0-2 next) s4-0) + (set! (-> v0-2 prev) s3-0) + v0-2 + ) + ) + ) + ) + +;; definition for method 12 of type actor-link-info +(defmethod get-next actor-link-info ((obj actor-link-info)) + (-> obj next) + ) + +;; definition for method 13 of type actor-link-info +(defmethod get-prev actor-link-info ((obj actor-link-info)) + (-> obj prev) + ) + +;; definition for method 14 of type actor-link-info +;; INFO: Return type mismatch basic vs process. +(defmethod get-next-process actor-link-info ((obj actor-link-info)) + (the-as process (and (-> obj next) (-> obj next extra process))) + ) + +;; definition for method 15 of type actor-link-info +;; INFO: Return type mismatch basic vs process. +(defmethod get-prev-process actor-link-info ((obj actor-link-info)) + (the-as process (and (-> obj prev) (-> obj prev extra process))) + ) + +;; definition for method 11 of type actor-link-info +(defmethod link-to-next-and-prev-actor actor-link-info ((obj actor-link-info)) + (let ((a0-1 (-> obj process entity))) + (set! (-> obj next) (entity-actor-lookup a0-1 'next-actor 0)) + ) + (let ((a0-2 (-> obj process entity))) + (set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0)) + ) + obj + ) + +;; definition for method 16 of type actor-link-info +(defmethod apply-function-forward actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> obj next))) + (while s3-0 + (if (arg0 s3-0 arg1) + (return (the-as int #f)) + ) + (set! s3-0 (entity-actor-lookup s3-0 'next-actor 0)) + ) + ) + 0 + ) + +;; definition for method 17 of type actor-link-info +(defmethod apply-function-reverse actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s3-0 (-> obj prev))) + (while s3-0 + (if (arg0 s3-0 arg1) + (return (the-as int #f)) + ) + (set! s3-0 (entity-actor-lookup s3-0 'prev-actor 0)) + ) + ) + 0 + ) + +;; definition for method 18 of type actor-link-info +(defmethod apply-all actor-link-info ((obj actor-link-info) (arg0 (function entity-actor object object)) (arg1 object)) + (let ((s4-0 (-> obj process entity))) + (while (let ((a0-2 s4-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) + ) + (while s4-0 + (if (arg0 (the-as entity-actor s4-0) arg1) + (return (the-as int #f)) + ) + (let ((a0-4 s4-0)) + (set! s4-0 (entity-actor-lookup a0-4 'next-actor 0)) + ) + ) + ) + 0 + ) + +;; definition for method 20 of type actor-link-info +(defmethod send-to-all-after actor-link-info ((obj actor-link-info) (arg0 symbol)) + (with-pp + (let ((s4-0 (-> obj next)) + (s5-0 (the-as object #f)) + ) + (while s4-0 + (let ((a0-1 (-> s4-0 extra process))) + (when a0-1 + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) arg0) + (set! s5-0 (or (send-event-function a0-1 a1-1) s5-0)) + ) + ) + ) + (set! s4-0 (entity-actor-lookup s4-0 'next-actor 0)) + ) + s5-0 + ) + ) + ) + +;; definition for method 21 of type actor-link-info +(defmethod send-to-all-before actor-link-info ((obj actor-link-info) (arg0 symbol)) + (with-pp + (let ((s4-0 (-> obj prev)) + (s5-0 (the-as object #f)) + ) + (while s4-0 + (let ((a0-1 (-> s4-0 extra process))) + (when a0-1 + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) arg0) + (set! s5-0 (or (send-event-function a0-1 a1-1) s5-0)) + ) + ) + ) + (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) + ) + s5-0 + ) + ) + ) + +;; definition for method 23 of type actor-link-info +;; INFO: Return type mismatch symbol vs none. +(defmethod send-to-next actor-link-info ((obj actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> obj next))) + (when a0-1 + (let ((a0-2 (-> a0-1 extra process))) + (if a0-2 + (send-event a0-2 arg0) + ) + ) + ) + ) + (none) + ) + +;; definition for method 24 of type actor-link-info +;; INFO: Return type mismatch symbol vs none. +(defmethod send-to-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) + (let ((a0-1 (-> obj prev))) + (when a0-1 + (let ((a0-2 (-> a0-1 extra process))) + (if a0-2 + (send-event a0-2 arg0) + ) + ) + ) + ) + (none) + ) + +;; definition for method 22 of type actor-link-info +;; INFO: Return type mismatch symbol vs none. +(defmethod send-to-next-and-prev actor-link-info ((obj actor-link-info) (arg0 symbol)) + (send-to-next obj arg0) + (send-to-prev obj arg0) + (none) + ) + +;; definition for method 19 of type actor-link-info +;; INFO: Return type mismatch symbol vs none. +(defmethod send-to-all actor-link-info ((obj actor-link-info) (arg0 symbol)) + (send-to-all-after obj arg0) + (send-to-all-before obj arg0) + (none) + ) + +;; definition for method 25 of type actor-link-info +(defmethod actor-count actor-link-info ((obj actor-link-info)) + (let ((s5-0 (-> obj process entity)) + (gp-0 0) + ) + (while (let ((a0-2 s5-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s5-0 (entity-actor-lookup s5-0 'prev-actor 0)) + ) + (while s5-0 + (+! gp-0 1) + (let ((a0-3 s5-0)) + (set! s5-0 (entity-actor-lookup a0-3 'next-actor 0)) + ) + ) + gp-0 + ) + ) + +;; definition for method 9 of type actor-link-info +(defmethod get-matching-actor-type-mask actor-link-info ((obj actor-link-info) (arg0 type)) + (let ((s3-0 (the-as entity-actor (-> obj process entity))) + (s5-0 0) + ) + (let ((s4-0 1)) + (while (let ((a0-2 s3-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s3-0 (entity-actor-lookup s3-0 'prev-actor 0)) + ) + (while s3-0 + (if (= (-> s3-0 etype) arg0) + (set! s5-0 (logior s5-0 s4-0)) + ) + (let ((a0-3 s3-0)) + (set! s3-0 (entity-actor-lookup a0-3 'next-actor 0)) + ) + (set! s4-0 (* s4-0 2)) + ) + ) + s5-0 + ) + ) + +;; definition for method 10 of type actor-link-info +(defmethod actor-count-before actor-link-info ((obj actor-link-info)) + (let* ((s5-0 (-> obj process entity)) + (s4-0 s5-0) + (gp-0 0) + ) + (while (let ((a0-2 s4-0)) + (entity-actor-lookup a0-2 'prev-actor 0) + ) + (set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0)) + ) + (while (!= s4-0 s5-0) + (+! gp-0 1) + (let ((a0-3 s4-0)) + (set! s4-0 (entity-actor-lookup a0-3 'next-actor 0)) + ) + ) + gp-0 + ) + ) + +;; definition for function actor-link-subtask-complete-hook +(defun actor-link-subtask-complete-hook ((arg0 entity-actor) (arg1 (pointer symbol))) + (cond + ((logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete)) + (set! (-> arg1 0) #t) + #f + ) + (else + (set! (-> arg1 0) #f) + #t + ) + ) + ) + +;; definition for function actor-link-subtask-incomplete-count-hook +(defun actor-link-subtask-incomplete-count-hook ((arg0 entity-actor) (arg1 (pointer uint64))) + (cond + ((logtest? (-> arg0 extra perm status) (entity-perm-status subtask-complete)) + #f + ) + (else + (+! (-> arg1 0) 1) + #f + ) + ) + ) + +;; definition for function actor-link-dead-hook +(defun actor-link-dead-hook ((arg0 entity-actor) (arg1 (pointer symbol))) + (cond + ((logtest? (-> arg0 extra perm status) (entity-perm-status dead)) + (set! (-> arg1 0) #t) + #f + ) + (else + (set! (-> arg1 0) #f) + #t + ) + ) + ) + +;; definition for function alt-actor-list-subtask-incomplete-count +(defun alt-actor-list-subtask-incomplete-count ((arg0 process-drawable)) + (let ((s4-0 (entity-actor-count (-> arg0 entity) 'alt-actor)) + (gp-0 0) + ) + (dotimes (s3-0 s4-0) + (let ((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor s3-0))) + (if (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status subtask-complete)))) + (+! gp-0 1) + ) + ) + ) + gp-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 new file mode 100644 index 0000000000..ad3e4482ae --- /dev/null +++ b/test/decompiler/reference/jak2/engine/entity/entity-h_REF.gc @@ -0,0 +1,404 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *generate-actor-vis*, type symbol +(define *generate-actor-vis* #f) + +;; definition for symbol *generate-actor-vis-start*, type symbol +(define *generate-actor-vis-start* #f) + +;; definition for symbol *generate-actor-vis-output*, type symbol +(define *generate-actor-vis-output* #f) + +;; definition of type entity-perm +(deftype entity-perm (structure) + ((user-object object 2 :offset-assert 0) + (user-uint64 uint64 :offset 0) + (user-float float 2 :offset 0) + (user-int32 int32 2 :offset 0) + (user-uint32 uint32 2 :offset 0) + (user-int16 int16 4 :offset 0) + (user-uint16 uint16 4 :offset 0) + (user-int8 int8 8 :offset 0) + (user-uint8 uint8 8 :offset 0) + (status entity-perm-status :offset 8) + (dummy uint8 1 :offset 10) + (task uint8 :offset 11) + (aid actor-id :offset 12) + (quad uint128 :offset 0) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (entity-perm-method-9 () none 9) + ) + ) + +;; definition for method 3 of type entity-perm +;; INFO: Used lq/sq +(defmethod inspect entity-perm ((obj entity-perm)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'entity-perm) + (format #t "~1Tuser-object[2] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-uint64: ~D~%" (-> obj user-uint64)) + (format #t "~1Tuser-float[2] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-int32[2] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-uint32[2] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-int16[4] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-uint16[4] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-int8[8] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tuser-uint8[8] @ #x~X~%" (-> obj user-object)) + (format #t "~1Tstatus: ~D~%" (-> obj status)) + (format #t "~1Tdummy[1] @ #x~X~%" (-> obj dummy)) + (format #t "~1Ttask: ~D~%" (-> obj task)) + (format #t "~1Taid: ~D~%" (-> obj aid)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type entity-links +(deftype entity-links (structure) + ((prev-link entity-links :offset-assert 0) + (next-link entity-links :offset-assert 4) + (entity entity :offset-assert 8) + (process process :offset-assert 12) + (level level :offset-assert 16) + (vis-id int32 :offset-assert 20) + (kill-mask task-mask :offset-assert 24) + (vis-dist meters :offset-assert 28) + (trans vector :inline :offset-assert 32) + (perm entity-perm :inline :offset-assert 48) + (status uint16 :offset 56) + (aid uint32 :offset 60) + (task uint8 :offset 59) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (entity-links-method-9 () none 9) + ) + ) + +;; definition for method 3 of type entity-links +(defmethod inspect entity-links ((obj entity-links)) + (when (not obj) + (set! obj obj) + (goto cfg-42) + ) + (format #t "[~8x] ~A~%" obj 'entity-links) + (format #t "~1Tprev-link: #~%" (-> obj prev-link)) + (format #t "~1Tnext-link: #~%" (-> obj next-link)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tvis-id: ~D~%" (-> obj vis-id)) + (format #t "~1Tkill-mask: #x~X : (task-mask " (-> obj kill-mask)) + (let ((s5-0 (-> obj kill-mask))) + (if (= (logand s5-0 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-0 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-0 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-0 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-0 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-0 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-0) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-0 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-0 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-0 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-0 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-0 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-0 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-0) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-0 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-0 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-0 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-0) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-0 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Tvis-dist: (meters ~m)~%" (-> obj vis-dist)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tperm: ~`entity-perm`P~%" (-> obj perm)) + (format #t "~1Tstatus: ~D~%" (-> obj perm status)) + (format #t "~1Taid: ~D~%" (-> obj perm aid)) + (format #t "~1Ttask: ~D~%" (-> obj perm task)) + (label cfg-42) + obj + ) + +;; definition of type entity-perm-array +(deftype entity-perm-array (inline-array-class) + ((data entity-perm :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type entity-perm-array +(defmethod inspect entity-perm-array ((obj entity-perm-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! (-> entity-perm-array heap-base) (the-as uint 16)) + +;; definition of type entity-links-array +(deftype entity-links-array (inline-array-class) + ((data entity-links :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type entity-links-array +(defmethod inspect entity-links-array ((obj entity-links-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! (-> entity-links-array heap-base) (the-as uint 64)) + +;; definition of type entity +(deftype entity (res-lump) + ((trans vector :inline :offset-assert 32) + (aid uint32 :offset-assert 48) + ) + :method-count-assert 27 + :size-assert #x34 + :flag-assert #x1b00000034 + (:methods + (entity-method-22 () none 22) + (entity-method-23 () none 23) + (entity-method-24 () none 24) + (entity-method-25 () none 25) + (entity-method-26 () none 26) + ) + ) + +;; definition of type entity-camera +(deftype entity-camera (entity) + ((connect connectable :inline :offset-assert 64) + ) + :method-count-assert 27 + :size-assert #x50 + :flag-assert #x1b00000050 + ) + +;; definition of type entity-nav-mesh +(deftype entity-nav-mesh (entity) + ((nav-mesh nav-mesh :offset-assert 52) + ) + :method-count-assert 29 + :size-assert #x38 + :flag-assert #x1d00000038 + (:methods + (entity-nav-mesh-method-27 () none 27) + (entity-nav-mesh-method-28 () none 28) + ) + ) + +;; definition of type entity-race-mesh +(deftype entity-race-mesh (entity) + ((race-mesh race-mesh :offset-assert 52) + ) + :method-count-assert 29 + :size-assert #x38 + :flag-assert #x1d00000038 + (:methods + (entity-race-mesh-method-27 () none 27) + (entity-race-mesh-method-28 () none 28) + ) + ) + +;; definition of type entity-actor +(deftype entity-actor (entity) + ((etype type :offset 56) + (task game-task :offset-assert 60) + (kill-mask task-mask :offset 52) + (vis-id int16 :offset-assert 62) + (quat quaternion :inline :offset-assert 64) + ) + :method-count-assert 33 + :size-assert #x50 + :flag-assert #x2100000050 + (:methods + (next-actor (_type_) entity-actor 27) + (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) + ) + ) + +;; definition of type actor-reference +(deftype actor-reference (structure) + ((actor basic :offset-assert 0) + (id uint32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type actor-reference +(defmethod inspect actor-reference ((obj actor-reference)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'actor-reference) + (format #t "~1Tactor: ~A~%" (-> obj actor)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition of type actor-group +(deftype actor-group (inline-array-class) + ((data actor-reference :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type actor-group +(defmethod inspect actor-group ((obj actor-group)) + (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! (-> actor-group heap-base) (the-as uint 8)) + +;; definition of type entity-info +(deftype entity-info (basic) + ((ptype type :offset-assert 4) + (package basic :offset-assert 8) + (art-group pair :offset-assert 12) + (pool basic :offset-assert 16) + (heap-size int32 :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type entity-info +(defmethod inspect entity-info ((obj entity-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tptype: ~A~%" (-> obj ptype)) + (format #t "~1Tpackage: ~A~%" (-> obj package)) + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tpool: ~A~%" (-> obj pool)) + (format #t "~1Theap-size: ~D~%" (-> obj heap-size)) + (label cfg-4) + obj + ) + +;; definition of type actor-bank +(deftype actor-bank (basic) + ((pause-dist meters :offset-assert 4) + (birth-dist meters :offset-assert 8) + (birth-max int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type actor-bank +(defmethod inspect actor-bank ((obj actor-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tpause-dist: ~f~%" (-> obj pause-dist)) + (format #t "~1Tbirth-dist: ~f~%" (-> obj birth-dist)) + (format #t "~1Tbirth-max: ~D~%" (-> obj birth-max)) + (label cfg-4) + obj + ) + +;; definition for symbol *ACTOR-bank*, type actor-bank +(define *ACTOR-bank* (new 'static 'actor-bank :pause-dist (meters 50) :birth-dist (meters 220) :birth-max 10)) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc b/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc new file mode 100644 index 0000000000..78b8a5dd75 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/entity/res-h_REF.gc @@ -0,0 +1,72 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type res-tag +(deftype res-tag (uint128) + ((name symbol :offset 0 :size 32) + (key-frame float :offset 32 :size 32) + (elt-type type :offset 64 :size 32) + (data-offset uint16 :offset 96 :size 16) + (elt-count uint32 :offset 112 :size 15) + (inlined? uint8 :offset 127 :size 1) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition of type res-lump +(deftype res-lump (basic) + ((length int32 :offset-assert 4) + (allocated-length int32 :offset-assert 8) + (data-base pointer :offset-assert 12) + (data-top pointer :offset-assert 16) + (data-size int32 :offset-assert 20) + (extra entity-links :offset-assert 24) + (tag (pointer res-tag) :offset-assert 28) + ) + :method-count-assert 22 + :size-assert #x20 + :flag-assert #x1600000020 + (:methods + (new (symbol type int int) _type_ 0) + (get-property-data (_type_ symbol symbol float pointer (pointer res-tag) pointer) pointer :no-virtual 9) + (get-property-struct (_type_ symbol symbol float structure (pointer res-tag) pointer) structure :no-virtual 10) + (get-property-value (_type_ symbol symbol float uint128 (pointer res-tag) pointer) uint128 :no-virtual 11) + (get-property-value-float (_type_ symbol symbol float float (pointer res-tag) pointer) float :no-virtual 12) + (get-tag-index-data (_type_ int) pointer 13) + (get-tag-data (_type_ res-tag) pointer 14) + (allocate-data-memory-for-tag! (_type_ res-tag) res-tag 15) + (sort! (_type_) _type_ 16) + (add-data! (_type_ res-tag pointer) res-lump 17) + (add-32bit-data! (_type_ res-tag object) res-lump 18) + (lookup-tag-idx (_type_ symbol symbol float) res-tag-pair :no-virtual 19) + (make-property-data (_type_ float res-tag-pair pointer) pointer 20) + (get-curve-data! (_type_ curve symbol symbol float) symbol 21) + ) + ) + +;; definition for method 3 of type res-lump +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect res-lump ((obj res-lump)) + (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-base: #x~X~%" (-> obj data-base)) + (format #t "~1Tdata-top: #x~X~%" (-> obj data-top)) + (format #t "~1Tdata-size: ~D~%" (-> obj data-size)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "~1Ttag: #x~X~%" (-> obj tag)) + (label cfg-4) + obj + ) + +;; definition for symbol *res-key-string*, type string +(define *res-key-string* (new 'global 'string 64 (the-as string #f))) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/entity/res_REF.gc b/test/decompiler/reference/jak2/engine/entity/res_REF.gc new file mode 100644 index 0000000000..4712937b14 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/entity/res_REF.gc @@ -0,0 +1,871 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 2 of type res-tag +(defmethod print res-tag ((obj res-tag)) + (if (zero? (-> obj inlined?)) + (format + #t + "#" + (-> obj name) + (-> obj key-frame) + (-> obj elt-type) + (-> obj elt-count) + ) + (format + #t + "#" + (-> obj name) + (-> obj key-frame) + (-> obj elt-type) + (-> obj elt-count) + ) + ) + obj + ) + +;; definition for method 4 of type res-tag +;; INFO: Return type mismatch uint vs int. +(defmethod length res-tag ((obj res-tag)) + (the-as int (if (zero? (-> obj inlined?)) + (* (-> obj elt-count) 4) + (* (-> obj elt-count) (-> obj elt-type size)) + ) + ) + ) + +;; definition for method 13 of type res-lump +;; INFO: Used lq/sq +(defmethod get-tag-index-data res-lump ((obj res-lump) (arg0 int)) + (&+ (-> obj data-base) (-> obj tag arg0 data-offset)) + ) + +;; definition for method 14 of type res-lump +(defmethod get-tag-data res-lump ((obj res-lump) (arg0 res-tag)) + (&+ (-> obj data-base) (-> arg0 data-offset)) + ) + +;; definition for method 0 of type res-lump +(defmethod new res-lump ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 16) arg1))))) + (set! (-> v0-0 allocated-length) arg0) + (set! (-> v0-0 data-size) arg1) + (set! (-> v0-0 length) 0) + (set! (-> v0-0 data-base) (&-> (-> v0-0 tag) arg0)) + (set! (-> v0-0 data-top) (&-> (-> v0-0 tag) arg0)) + v0-0 + ) + ) + +;; definition for method 4 of type res-lump +(defmethod length res-lump ((obj res-lump)) + (-> obj length) + ) + +;; definition for method 5 of type res-lump +;; INFO: Return type mismatch uint vs int. +(defmethod asize-of res-lump ((obj res-lump)) + (the-as int (+ (-> obj type psize) (* (-> obj allocated-length) 16) (-> obj data-size))) + ) + +;; definition for method 3 of type res-lump +;; INFO: this function exists in multiple non-identical object files +;; INFO: Used lq/sq +(defmethod inspect res-lump ((obj res-lump)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Textra: ~A~%" (-> obj extra)) + (format #t "~Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~Tlength: ~D~%" (-> obj length)) + (format #t "~Tdata-base: #x~X~%" (-> obj data-base)) + (format #t "~Tdata-top: #x~X~%" (-> obj data-top)) + (format #t "~Tdata-size: #x~X~%" (-> obj data-size)) + (format #t "~Ttag[~D]: @ #x~X~%" (-> obj allocated-length) (-> obj tag)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D] " s5-0) + (print (-> obj tag s5-0)) + (let ((t9-10 format) + (a0-12 #t) + (a1-9 " @ #x~X") + (a3-2 obj) + (a2-9 s5-0) + ) + (t9-10 a0-12 a1-9 (&+ (-> a3-2 data-base) (-> a3-2 tag a2-9 data-offset))) + ) + (cond + ((zero? (-> obj tag s5-0 inlined?)) + (let ((t9-11 format) + (a0-14 #t) + (a1-10 " = ~A~%") + (a3-4 obj) + (a2-17 s5-0) + ) + (t9-11 a0-14 a1-10 (-> (the-as (pointer uint32) (&+ (-> a3-4 data-base) (-> a3-4 tag a2-17 data-offset))))) + ) + ) + (else + (format #t "~%") + ) + ) + ) + obj + ) + +;; definition for method 19 of type res-lump +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs res-tag-pair. +(defmethod lookup-tag-idx res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float)) + (local-vars (t4-1 int)) + (when (or (= arg0 'id) + (= arg0 'aid) + (= arg0 'trans) + (= arg0 'rot) + (= arg0 'nav-mesh) + (= arg0 'process-type) + (= arg0 'task) + ) + (crash!) + 0 + ) + (if (or (not obj) (zero? obj) (<= (-> obj length) 0)) + (return (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) + ) + (let ((v1-14 -1) + (t0-6 -1) + ) + (let ((t1-0 -1) + (t2-4 (-> (the-as (pointer uint64) (-> (symbol->string arg0) data)) 0)) + ) + (let ((t3-1 (+ (-> obj length) -1)) + (t4-0 0) + ) + (while (>= t3-1 t4-0) + (let* ((t5-2 (+ t4-0 (/ (- t3-1 t4-0) 2))) + (t6-5 (- t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag t5-2 name)) data)) 0))) + ) + (cond + ((zero? t6-5) + (set! t4-1 t5-2) + (goto cfg-32) + ) + ((< (the-as int t6-5) 0) + (set! t3-1 (+ t5-2 -1)) + ) + (else + (set! t4-0 (+ t5-2 1)) + ) + ) + ) + ) + ) + (set! t4-1 -1) + (label cfg-32) + (if (< t4-1 0) + (return (the-as res-tag-pair t4-1)) + ) + (while (and (> t4-1 0) + (= t2-4 (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ t4-1 -1) name)) data)) 0)) + ) + (+! t4-1 -1) + ) + (when (= arg1 'base) + (set! t0-6 t4-1) + (set! v1-14 t4-1) + (goto cfg-73) + ) + (let ((t3-13 t4-1) + (t4-4 (&-> (-> obj tag) t4-1)) + ) + (while (not (or (>= t3-13 (-> obj length)) + (< t2-4 (-> (&+ (the-as (pointer uint64) (symbol->string (-> t4-4 0 name))) 4) 0)) + ) + ) + (cond + ((!= arg0 (-> t4-4 0 name)) + ) + ((= (-> t4-4 0 key-frame) arg2) + (set! t0-6 t3-13) + (set! v1-14 t3-13) + (goto cfg-73) + ) + ((and (>= arg2 (-> t4-4 0 key-frame)) (!= arg1 'exact)) + (set! t0-6 t3-13) + (set! v1-14 t3-13) + (if (= (-> t4-4 0 key-frame) -1000000000.0) + (set! t1-0 t3-13) + ) + ) + ((< arg2 (-> t4-4 0 key-frame)) + (if (and (!= t0-6 t1-0) (= arg1 'interp)) + (set! v1-14 t3-13) + ) + (goto cfg-73) + ) + ) + (+! t3-13 1) + (set! t4-4 (&-> t4-4 1)) + ) + ) + ) + (label cfg-73) + (the-as res-tag-pair (logior (logand (the-as uint #xffffffff) t0-6) (shl v1-14 32))) + ) + ) + +;; definition for method 20 of type res-lump +;; INFO: Used lq/sq +(defmethod make-property-data res-lump ((obj res-lump) (arg0 float) (arg1 res-tag-pair) (arg2 pointer)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let* ((t0-2 (-> obj tag (-> arg1 lo))) + (t1-2 (-> obj tag (-> arg1 hi))) + (v1-6 (-> t0-2 elt-count)) + ) + (cond + ((zero? (-> t0-2 inlined?)) + (&+ (-> obj data-base) (-> t0-2 data-offset)) + ) + ((or (not arg2) + (= (-> arg1 lo) (-> arg1 hi)) + (!= v1-6 (-> t1-2 elt-count)) + (!= (-> t0-2 elt-type) (-> t1-2 elt-type)) + ) + (let ((a0-4 t0-2)) + (&+ (-> obj data-base) (-> a0-4 data-offset)) + ) + ) + (else + (let* ((f0-2 (/ (- arg0 (-> t0-2 key-frame)) (- (-> t1-2 key-frame) (-> t0-2 key-frame)))) + (a1-4 obj) + (a2-7 t0-2) + (a1-6 (&+ (-> a1-4 data-base) (-> a2-7 data-offset))) + (a2-13 (&+ (-> obj data-base) (-> t1-2 data-offset))) + ) + (case (-> t0-2 elt-type symbol) + (('float) + (dotimes (a0-8 (the-as int v1-6)) + (set! (-> (the-as (pointer float) (&+ arg2 (* a0-8 4)))) + (+ (* (-> (the-as (pointer float) (&+ a1-6 (* a0-8 4)))) (- 1.0 f0-2)) + (* (-> (the-as (pointer float) (&+ a2-13 (* a0-8 4)))) f0-2) + ) + ) + ) + arg2 + ) + (('integer 'sinteger 'uinteger 'int64 'uint64) + (let ((a0-10 (the int (* 4096.0 f0-2)))) + (dotimes (t0-10 (the-as int v1-6)) + (set! (-> (the-as (pointer int64) (&+ arg2 (* t0-10 8)))) + (sar + (+ (* (the-as int (-> (the-as (pointer uint64) (&+ a1-6 (* t0-10 8))))) (- 4096 a0-10)) + (* (the-as int (-> (the-as (pointer uint64) (&+ a2-13 (* t0-10 8))))) a0-10) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('int8) + (let ((a0-12 (the int (* 4096.0 f0-2)))) + (dotimes (t0-11 (the-as int v1-6)) + (set! (-> (the-as (pointer int8) (&+ arg2 t0-11))) + (sar + (+ (* (-> (the-as (pointer int8) (&+ a1-6 t0-11))) (- 4096 a0-12)) + (* (-> (the-as (pointer int8) (&+ a2-13 t0-11))) a0-12) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('uint8) + (let ((a0-14 (the int (* 4096.0 f0-2)))) + (dotimes (t0-12 (the-as int v1-6)) + (set! (-> (the-as (pointer uint8) (&+ arg2 t0-12))) + (shr + (+ (* (-> (the-as (pointer uint8) (&+ a1-6 t0-12))) (the-as uint (- 4096 a0-14))) + (* (-> (the-as (pointer uint8) (&+ a2-13 t0-12))) (the-as uint a0-14)) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('int16) + (let ((a0-16 (the int (* 4096.0 f0-2)))) + (dotimes (t0-13 (the-as int v1-6)) + (set! (-> (the-as (pointer int16) (&+ arg2 (* t0-13 2)))) + (sar + (+ (* (-> (the-as (pointer int16) (&+ a1-6 (* t0-13 2)))) (- 4096 a0-16)) + (* (-> (the-as (pointer int16) (&+ a2-13 (* t0-13 2)))) a0-16) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('uint16) + (let ((a0-18 (the int (* 4096.0 f0-2)))) + (dotimes (t0-14 (the-as int v1-6)) + (set! (-> (the-as (pointer uint16) (&+ arg2 (* t0-14 2)))) + (shr + (+ (* (-> (the-as (pointer uint16) (&+ a1-6 (* t0-14 2)))) (the-as uint (- 4096 a0-18))) + (* (-> (the-as (pointer uint16) (&+ a2-13 (* t0-14 2)))) (the-as uint a0-18)) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('int32) + (let ((a0-20 (the int (* 4096.0 f0-2)))) + (dotimes (t0-15 (the-as int v1-6)) + (set! (-> (the-as (pointer int32) (&+ arg2 (* t0-15 4)))) + (sar + (+ (* (-> (the-as (pointer int32) (&+ a1-6 (* t0-15 4)))) (- 4096 a0-20)) + (* (-> (the-as (pointer int32) (&+ a2-13 (* t0-15 4)))) a0-20) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('uint32) + (let ((a0-22 (the int (* 4096.0 f0-2)))) + (dotimes (t0-16 (the-as int v1-6)) + (set! (-> (the-as (pointer uint32) (&+ arg2 (* t0-16 4)))) + (shr + (+ (* (-> (the-as (pointer uint32) (&+ a1-6 (* t0-16 4)))) (the-as uint (- 4096 a0-22))) + (* (-> (the-as (pointer uint32) (&+ a2-13 (* t0-16 4)))) (the-as uint a0-22)) + ) + 12 + ) + ) + ) + ) + arg2 + ) + (('vector) + (let ((a0-23 f0-2)) + (.mov vf3 a0-23) + ) + (let ((a0-25 (- 1.0 f0-2))) + (.mov vf4 a0-25) + ) + (dotimes (a0-26 (the-as int v1-6)) + (let ((t0-18 (+ (* a0-26 16) (the-as int a1-6)))) + (.lvf vf1 (&-> (the-as (pointer int128) t0-18))) + ) + (let ((t0-20 (+ (* a0-26 16) (the-as int a2-13)))) + (.lvf vf2 (&-> (the-as (pointer int128) t0-20))) + ) + (.mul.x.vf vf1 vf1 vf4) + (.mul.x.vf vf2 vf2 vf3) + (.add.vf vf1 vf1 vf2) + (.svf (&-> (the-as (pointer uint128) (+ (* a0-26 16) (the-as int arg2))) 0) vf1) + ) + arg2 + ) + (else + (let ((a0-27 t0-2)) + (&+ (-> obj data-base) (-> a0-27 data-offset)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 9 of type res-lump +;; INFO: Used lq/sq +(defmethod get-property-data res-lump ((obj res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 pointer) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) + (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int s3-0) 0) + (empty) + ) + (else + (set! arg3 (make-property-data obj arg2 s3-0 arg5)) + (if arg4 + (set! (-> arg4 0) (-> obj tag (-> s3-0 lo))) + ) + ) + ) + ) + arg3 + ) + +;; definition for method 10 of type res-lump +;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs structure. +(defmethod get-property-struct res-lump ((obj res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 structure) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) + (let ((s3-0 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int s3-0) 0) + (empty) + ) + (else + (set! arg3 (the-as structure (make-property-data obj arg2 s3-0 arg5))) + (let ((v1-4 (-> obj tag (-> s3-0 lo)))) + (if arg4 + (set! (-> arg4 0) v1-4) + ) + (if (zero? (-> v1-4 inlined?)) + (set! arg3 (the-as structure (-> (the-as (pointer uint32) arg3)))) + (empty) + ) + ) + ) + ) + ) + (the-as structure arg3) + ) + +;; definition for method 11 of type res-lump +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs uint128. +(defmethod get-property-value res-lump ((obj res-lump) + (arg0 symbol) + (arg1 symbol) + (arg2 float) + (arg3 uint128) + (arg4 (pointer res-tag)) + (arg5 pointer) + ) + (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int a2-1) 0) + (empty) + ) + (else + (let* ((a0-2 (-> a2-1 lo)) + (s1-0 (-> obj tag a0-2)) + (s0-0 (-> s1-0 elt-type)) + (gp-1 (make-property-data obj arg2 a2-1 arg5)) + ) + (if arg4 + (set! (-> arg4 0) s1-0) + ) + (cond + ((type-type? (the-as type s0-0) uinteger) + (case (-> s1-0 elt-type size) + ((1) + (set! arg3 (the-as uint128 (-> (the-as (pointer uint8) gp-1)))) + ) + ((2) + (set! arg3 (the-as uint128 (-> (the-as (pointer uint16) gp-1)))) + ) + ((4) + (set! arg3 (the-as uint128 (-> (the-as (pointer uint32) gp-1)))) + ) + ((16) + (set! arg3 (-> (the-as (pointer uint128) gp-1))) + ) + (else + (set! arg3 (the-as uint128 (-> (the-as (pointer uint64) gp-1)))) + ) + ) + ) + ((type-type? (the-as type s0-0) integer) + (case (-> s1-0 elt-type size) + ((1) + (set! arg3 (the-as uint128 (-> (the-as (pointer int8) gp-1)))) + ) + ((2) + (set! arg3 (the-as uint128 (-> (the-as (pointer int16) gp-1)))) + ) + ((4) + (set! arg3 (the-as uint128 (-> (the-as (pointer int32) gp-1)))) + ) + ((16) + (set! arg3 (-> (the-as (pointer uint128) gp-1))) + ) + (else + (set! arg3 (the-as uint128 (-> (the-as (pointer uint64) gp-1)))) + ) + ) + ) + ((type-type? (the-as type s0-0) float) + (set! arg3 (the-as uint128 (the int (-> (the-as (pointer float) gp-1))))) + ) + (else + (empty) + ) + ) + ) + ) + ) + ) + (the-as uint128 arg3) + ) + +;; definition for method 12 of type res-lump +;; INFO: Used lq/sq +(defmethod get-property-value-float res-lump ((obj res-lump) (arg0 symbol) (arg1 symbol) (arg2 float) (arg3 float) (arg4 (pointer res-tag)) (arg5 pointer)) + (local-vars (v1-8 uint) (v1-11 int)) + (let ((a2-1 (lookup-tag-idx obj arg0 arg1 arg2))) + (cond + ((< (the-as int a2-1) 0) + (empty) + ) + (else + (let* ((a0-2 (-> a2-1 lo)) + (s1-0 (-> obj tag a0-2)) + (s0-0 (-> s1-0 elt-type)) + (gp-1 (make-property-data obj arg2 a2-1 arg5)) + ) + (if arg4 + (set! (-> arg4 0) s1-0) + ) + (cond + ((type-type? (the-as type s0-0) float) + (set! arg3 (-> (the-as (pointer float) gp-1))) + ) + ((type-type? (the-as type s0-0) uinteger) + (case (-> s1-0 elt-type size) + ((1) + (set! v1-8 (-> (the-as (pointer uint8) gp-1))) + ) + ((2) + (set! v1-8 (-> (the-as (pointer uint16) gp-1))) + ) + ((4) + (set! v1-8 (-> (the-as (pointer uint32) gp-1))) + ) + ((16) + (set! v1-8 (the-as uint (-> (the-as (pointer uint128) gp-1)))) + ) + (else + (set! v1-8 (-> (the-as (pointer uint64) gp-1))) + ) + ) + (set! arg3 (the float v1-8)) + ) + ((type-type? (the-as type s0-0) integer) + (case (-> s1-0 elt-type size) + ((1) + (set! v1-11 (-> (the-as (pointer int8) gp-1))) + ) + ((2) + (set! v1-11 (-> (the-as (pointer int16) gp-1))) + ) + ((4) + (set! v1-11 (-> (the-as (pointer int32) gp-1))) + ) + ((16) + (set! v1-11 (the-as int (-> (the-as (pointer uint128) gp-1)))) + ) + (else + (set! v1-11 (the-as int (-> (the-as (pointer uint64) gp-1)))) + ) + ) + (set! arg3 (the float v1-11)) + ) + (else + (empty) + ) + ) + ) + ) + ) + ) + arg3 + ) + +;; definition for method 16 of type res-lump +;; INFO: Used lq/sq +(defmethod sort! res-lump ((obj res-lump)) + (let ((v1-0 -1)) + (while (nonzero? v1-0) + (set! v1-0 0) + (let ((a1-0 0) + (a2-1 (+ (-> obj length) -2)) + ) + (while (>= a2-1 a1-0) + (let* ((a3-2 (-> obj tag a1-0)) + (t0-3 (-> obj tag (+ a1-0 1))) + (t1-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> a3-2 name)) data)) 0)) + (t2-6 (-> (the-as (pointer uint64) (-> (symbol->string (-> t0-3 name)) data)) 0)) + ) + (when (or (< t2-6 t1-6) (and (= t1-6 t2-6) (< (-> t0-3 key-frame) (-> a3-2 key-frame)))) + (+! v1-0 1) + (set! (-> obj tag a1-0) t0-3) + (set! (-> obj tag (+ a1-0 1)) a3-2) + ) + ) + (+! a1-0 1) + ) + ) + ) + ) + obj + ) + +;; definition for method 15 of type res-lump +;; INFO: Used lq/sq +(defmethod allocate-data-memory-for-tag! res-lump ((obj res-lump) (arg0 res-tag)) + (local-vars (resource-mem pointer)) + (let* ((tag-pair (lookup-tag-idx obj (-> arg0 name) 'exact (-> arg0 key-frame))) + (existing-tag (-> obj tag (-> tag-pair lo))) + ) + 0 + (if (and (>= (the-as int tag-pair) 0) (!= (-> arg0 key-frame) (-> arg0 key-frame))) + (set! tag-pair (new 'static 'res-tag-pair :lo #xffffffff :hi #xffffffff)) + ) + (if (zero? (-> arg0 elt-count)) + (set! arg0 (copy-and-set-field arg0 elt-count 1)) + ) + (let ((data-size (length arg0))) + (cond + ((and (>= (the-as int tag-pair) 0) (>= (length existing-tag) data-size)) + (set! resource-mem (&+ (-> obj data-base) (-> existing-tag data-offset))) + (when (logtest? (the-as int resource-mem) 7) + (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) + (set! (-> obj data-top) (&+ resource-mem data-size)) + ) + ) + (else + (set! resource-mem (logand -16 (&+ (-> obj data-top) 15))) + (set! (-> obj data-top) (&+ resource-mem data-size)) + ) + ) + (let* ((a0-22 arg0) + (s4-1 (copy-and-set-field a0-22 data-offset (&- resource-mem (the-as uint (-> obj data-base))))) + ) + (when (>= (the-as int (&+ resource-mem data-size)) (the-as int (&+ (-> obj data-base) (-> obj data-size)))) + (format + 0 + "ERROR: attempting to a new tag ~`res-tag`P data of #x~X bytes to ~A, but data memory is full.~%" + s4-1 + data-size + obj + ) + (return (the-as res-tag #f)) + ) + (cond + ((< (the-as int tag-pair) 0) + (cond + ((>= (-> obj length) (-> obj allocated-length)) + (format 0 "ERROR: attempting to a new tag ~`res-tag`P to ~A, but tag memory is full.~%" s4-1 obj) + (return (the-as res-tag #f)) + ) + (else + (set! (-> obj tag (-> obj length)) s4-1) + (+! (-> obj length) 1) + (sort! obj) + ) + ) + ) + (else + (set! (-> obj tag (-> tag-pair lo)) s4-1) + ) + ) + s4-1 + ) + ) + ) + ) + +;; definition for method 17 of type res-lump +(defmethod add-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 pointer)) + (let ((a0-2 (allocate-data-memory-for-tag! obj arg0))) + (when a0-2 + (let* ((v1-2 obj) + (a1-1 a0-2) + (s4-0 (&+ (-> v1-2 data-base) (-> a1-1 data-offset))) + ) + (cond + ((zero? (-> a0-2 inlined?)) + (length a0-2) + (set! (-> (the-as (pointer pointer) s4-0) 0) arg1) + ) + (else + (let ((a2-1 (length a0-2))) + (mem-copy! s4-0 arg1 a2-1) + ) + ) + ) + ) + ) + ) + obj + ) + +;; definition for method 18 of type res-lump +(defmethod add-32bit-data! res-lump ((obj res-lump) (arg0 res-tag) (arg1 object)) + (local-vars (sv-16 object)) + (set! sv-16 arg1) + (let* ((v1-0 arg0) (a1-4 (copy-and-set-field v1-0 inlined? 1))) (add-data! obj a1-4 (& sv-16))) + ) + +;; definition for method 21 of type res-lump +;; INFO: Used lq/sq +(defmethod get-curve-data! res-lump ((obj res-lump) (arg0 curve) (arg1 symbol) (arg2 symbol) (arg3 float)) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (let ((s5-0 #f)) + (set! sv-16 (new 'static 'res-tag)) + (let ((a0-2 + ((method-of-object obj get-property-data) obj arg1 'exact arg3 (the-as pointer #f) (& sv-16) *res-static-buf*) + ) + ) + (when a0-2 + (set! (-> arg0 cverts) (the-as (inline-array vector) a0-2)) + (set! (-> arg0 num-cverts) (the-as int (-> sv-16 elt-count))) + (when (< 256 (-> arg0 num-cverts)) + (format + 0 + "ERROR: curve has ~D control points--only ~D are allowed. Increase MAX-CURVE-CONTROL-POINTS or shorten the curve.~%" + (-> arg0 num-cverts) + 256 + ) + (set! (-> arg0 num-cverts) 256) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((a0-6 + ((method-of-object obj get-property-data) obj arg2 'exact arg3 (the-as pointer #f) (& sv-32) *res-static-buf*) + ) + ) + (when a0-6 + (set! (-> arg0 knots) (the-as (pointer float) a0-6)) + (set! (-> arg0 num-knots) (the-as int (-> sv-32 elt-count))) + (set! s5-0 #t) + ) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 8 of type res-lump +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs res-lump. +;; WARN: Using new Jak 2 rtype-of +;; WARN: Using new Jak 2 rtype-of +;; WARN: Using new Jak 2 rtype-of +;; WARN: Using new Jak 2 rtype-of +;; WARN: Using new Jak 2 rtype-of +;; WARN: Using new Jak 2 rtype-of +(defmethod mem-usage res-lump ((obj res-lump) (arg0 memory-usage-block) (arg1 int)) + (local-vars (sv-16 int)) + (let ((s3-0 48) + (s2-0 "res") + ) + (cond + ((logtest? arg1 256) + (set! s3-0 44) + (set! s2-0 "camera") + ) + ((logtest? arg1 64) + (set! s3-0 43) + (set! s2-0 "entity") + ) + ((logtest? arg1 512) + (set! s3-0 76) + (set! s2-0 "art-joint-geo") + ) + ) + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let ((v1-19 (asize-of obj))) + (+! (-> arg0 data s3-0 used) v1-19) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-19 15))) + ) + (dotimes (s1-0 (-> obj length)) + (when (zero? (-> obj tag s1-0 inlined?)) + (let* ((a1-4 obj) + (a0-15 s1-0) + (s0-0 (the-as object (-> (the-as (pointer int32) (&+ (-> a1-4 data-base) (-> a1-4 tag a0-15 data-offset)))))) + ) + (when (not (part-group-pointer? (the-as pointer s0-0))) + (let ((v1-34 (rtype-of (the-as int s0-0)))) + (cond + ((or (= v1-34 symbol) (or (= v1-34 type) (= v1-34 pair))) + ) + ((= v1-34 string) + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let ((v1-48 ((method-of-type (rtype-of (the-as int s0-0)) asize-of) (the-as int s0-0)))) + (+! (-> arg0 data s3-0 used) v1-48) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-48 15))) + ) + ) + ((or (= v1-34 nav-mesh) (= v1-34 collide-mesh)) + (let ((a0-48 (the-as (array object) s0-0))) + ((method-of-type (rtype-of a0-48) mem-usage) a0-48 arg0 arg1) + ) + ) + ((= v1-34 array) + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let* ((a0-53 (the-as (array object) s0-0)) + (v1-68 ((method-of-type (rtype-of a0-53) asize-of) a0-53)) + ) + (+! (-> arg0 data s3-0 used) v1-68) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-68 15))) + ) + (set! sv-16 0) + (while (< sv-16 (-> (the-as array s0-0) length)) + (let ((a0-63 (-> (the-as (array object) s0-0) sv-16))) + ((method-of-type (rtype-of a0-63) mem-usage) a0-63 arg0 arg1) + ) + (set! sv-16 (+ sv-16 1)) + ) + ) + (else + (set! (-> arg0 length) (max (-> arg0 length) (+ s3-0 1))) + (set! (-> arg0 data s3-0 name) s2-0) + (+! (-> arg0 data s3-0 count) 1) + (let* ((a0-68 (the-as int s0-0)) + (v1-96 ((method-of-type (rtype-of a0-68) asize-of) a0-68)) + ) + (+! (-> arg0 data s3-0 used) v1-96) + (+! (-> arg0 data s3-0 total) (logand -16 (+ v1-96 15))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (the-as res-lump 0) + ) + +;; definition for symbol *res-static-buf*, type pointer +(define *res-static-buf* (malloc 'global 128)) diff --git a/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc new file mode 100644 index 0000000000..fd1fc47bc2 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/effect-control-h_REF.gc @@ -0,0 +1,77 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type effect-control +(deftype effect-control (basic) + ((process process-drawable :offset-assert 4) + (flags effect-control-flag :offset-assert 8) + (last-frame-group art-joint-anim :offset-assert 12) + (last-frame-num float :offset-assert 16) + (channel-offset int32 :offset-assert 20) + (res res-lump :offset-assert 24) + (name (pointer res-tag) :offset-assert 28) + (param uint32 :offset-assert 32) + ) + :method-count-assert 15 + :size-assert #x24 + :flag-assert #xf00000024 + (:methods + (new (symbol type process-drawable) _type_ 0) + (effect-control-method-9 () none 9) + (effect-control-method-10 () none 10) + (effect-control-method-11 () none 11) + (effect-control-method-12 () none 12) + (set-channel-offset! (_type_ int) none 13) + (effect-control-method-14 () none 14) + ) + ) + +;; definition for method 3 of type effect-control +(defmethod inspect effect-control ((obj effect-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tflags: #x~X~%" (-> obj flags)) + (format #t "~1Tlast-frame-group: ~A~%" (-> obj last-frame-group)) + (format #t "~1Tlast-frame-num: ~f~%" (-> obj last-frame-num)) + (format #t "~1Tchannel-offset: ~D~%" (-> obj channel-offset)) + (format #t "~1Tres: ~A~%" (-> obj res)) + (format #t "~1Tname: #x~X~%" (-> obj name)) + (format #t "~1Tparam: #x~X~%" (-> obj param)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type effect-control +(defmethod new effect-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) + (cond + ((res-lump-struct (-> arg0 draw jgeo extra) 'effect-name structure) + (let ((v0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-1 process) arg0) + (set! (-> v0-1 last-frame-group) #f) + v0-1 + ) + ) + (else + (the-as effect-control #f) + ) + ) + ) + +;; definition for method 13 of type effect-control +;; INFO: Return type mismatch int vs none. +(defmethod set-channel-offset! effect-control ((obj effect-control) (arg0 int)) + (set! (-> obj channel-offset) arg0) + 0 + (none) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc new file mode 100644 index 0000000000..506ea84d2b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/fact-h_REF.gc @@ -0,0 +1,1505 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fact-bank +(deftype fact-bank (basic) + ((eco-level-max float :offset-assert 4) + (eco-single-inc float :offset-assert 8) + (eco-full-inc float :offset-assert 12) + (eco-single-timeout seconds :offset-assert 16) + (eco-full-timeout seconds :offset-assert 24) + (dummy seconds :offset-assert 32) + (health-max-default float :offset-assert 40) + (health-single-inc float :offset-assert 44) + (health-default-inc float :offset-assert 48) + (health-darkjak-inc float :offset-assert 52) + (health-darkjak-min float :offset-assert 56) + (health-darkjak-error float :offset-assert 60) + (eco-pill-green-max-default float :offset-assert 64) + (eco-pill-dark-max-default float :offset-assert 68) + (health-small-inc float :offset-assert 72) + (buzzer-max-default float :offset-assert 76) + (buzzer-single-inc float :offset-assert 80) + (suck-bounce-dist meters :offset-assert 84) + (suck-suck-dist meters :offset-assert 88) + (default-eco-pill-green-inc float :offset-assert 92) + (default-eco-pill-dark-inc float :offset-assert 96) + (ammo-yellow-max float :offset-assert 100) + (ammo-red-max float :offset-assert 104) + (ammo-blue-max float :offset-assert 108) + (ammo-dark-max float :offset-assert 112) + (ammo-yellow-start float :offset-assert 116) + (ammo-red-start float :offset-assert 120) + (ammo-blue-start float :offset-assert 124) + (ammo-dark-start float :offset-assert 128) + (shield-max float :offset-assert 132) + (shield-use-speed float :offset-assert 136) + (shield-time-min seconds :offset-assert 144) + (trick-point-max float :offset-assert 152) + (super-skill-inc float :offset-assert 156) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +;; definition for method 3 of type fact-bank +(defmethod inspect fact-bank ((obj fact-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Teco-level-max: ~f~%" (-> obj eco-level-max)) + (format #t "~1Teco-single-inc: ~f~%" (-> obj eco-single-inc)) + (format #t "~1Teco-full-inc: ~f~%" (-> obj eco-full-inc)) + (format #t "~1Teco-single-timeout: (seconds ~e)~%" (-> obj eco-single-timeout)) + (format #t "~1Teco-full-timeout: (seconds ~e)~%" (-> obj eco-full-timeout)) + (format #t "~1Tdummy: (seconds ~e)~%" (-> obj dummy)) + (format #t "~1Thealth-max-default: ~f~%" (-> obj health-max-default)) + (format #t "~1Thealth-single-inc: ~f~%" (-> obj health-single-inc)) + (format #t "~1Thealth-default-inc: ~f~%" (-> obj health-default-inc)) + (format #t "~1Thealth-darkjak-inc: ~f~%" (-> obj health-darkjak-inc)) + (format #t "~1Thealth-darkjak-min: ~f~%" (-> obj health-darkjak-min)) + (format #t "~1Thealth-darkjak-error: ~f~%" (-> obj health-darkjak-error)) + (format #t "~1Teco-pill-green-max-default: ~f~%" (-> obj eco-pill-green-max-default)) + (format #t "~1Teco-pill-dark-max-default: ~f~%" (-> obj eco-pill-dark-max-default)) + (format #t "~1Thealth-small-inc: ~f~%" (-> obj health-small-inc)) + (format #t "~1Tbuzzer-max-default: ~f~%" (-> obj buzzer-max-default)) + (format #t "~1Tbuzzer-single-inc: ~f~%" (-> obj buzzer-single-inc)) + (format #t "~1Tsuck-bounce-dist: (meters ~m)~%" (-> obj suck-bounce-dist)) + (format #t "~1Tsuck-suck-dist: (meters ~m)~%" (-> obj suck-suck-dist)) + (format #t "~1Tdefault-eco-pill-green-inc: ~f~%" (-> obj default-eco-pill-green-inc)) + (format #t "~1Tdefault-eco-pill-dark-inc: ~f~%" (-> obj default-eco-pill-dark-inc)) + (format #t "~1Tammo-yellow-max: ~f~%" (-> obj ammo-yellow-max)) + (format #t "~1Tammo-red-max: ~f~%" (-> obj ammo-red-max)) + (format #t "~1Tammo-blue-max: ~f~%" (-> obj ammo-blue-max)) + (format #t "~1Tammo-dark-max: ~f~%" (-> obj ammo-dark-max)) + (format #t "~1Tammo-yellow-start: ~f~%" (-> obj ammo-yellow-start)) + (format #t "~1Tammo-red-start: ~f~%" (-> obj ammo-red-start)) + (format #t "~1Tammo-blue-start: ~f~%" (-> obj ammo-blue-start)) + (format #t "~1Tammo-dark-start: ~f~%" (-> obj ammo-dark-start)) + (format #t "~1Tshield-max: ~f~%" (-> obj shield-max)) + (format #t "~1Tshield-use-speed: ~f~%" (-> obj shield-use-speed)) + (format #t "~1Tshield-time-min: (seconds ~e)~%" (-> obj shield-time-min)) + (format #t "~1Ttrick-point-max: ~f~%" (-> obj trick-point-max)) + (format #t "~1Tsuper-skill-inc: ~f~%" (-> obj super-skill-inc)) + (label cfg-4) + obj + ) + +;; definition for symbol *FACT-bank*, type fact-bank +(define *FACT-bank* (new 'static 'fact-bank + :eco-level-max 2.0 + :eco-single-inc 1.0 + :eco-full-inc 5.0 + :eco-single-timeout (seconds 5) + :eco-full-timeout (seconds 20) + :dummy (seconds 15) + :health-max-default 8.0 + :health-single-inc 1.0 + :health-default-inc 2.0 + :health-darkjak-inc 0.1 + :health-darkjak-min 1.05 + :health-darkjak-error 0.05 + :eco-pill-green-max-default 50.0 + :eco-pill-dark-max-default 100.0 + :health-small-inc 1.0 + :buzzer-max-default 7.0 + :buzzer-single-inc 1.0 + :suck-bounce-dist (meters 18) + :suck-suck-dist (meters 7.5) + :ammo-yellow-max 100.0 + :ammo-red-max 50.0 + :ammo-blue-max 100.0 + :ammo-dark-max 5.0 + :ammo-yellow-start 100.0 + :ammo-red-start 50.0 + :ammo-blue-start 100.0 + :ammo-dark-start 5.0 + :shield-max 100.0 + :shield-use-speed 10.0 + :shield-time-min (seconds 1.5) + :trick-point-max 999999.0 + :super-skill-inc 3.0 + ) + ) + +;; definition for function pickup-type->string +(defun pickup-type->string ((arg0 pickup-type)) + (case arg0 + (((pickup-type eco-pill-dark)) + "eco-pill-dark" + ) + (((pickup-type gun-blue)) + "gun-blue" + ) + (((pickup-type ammo-random)) + "ammo-random" + ) + (((pickup-type eco-blue)) + "eco-blue" + ) + (((pickup-type gun-red)) + "gun-red" + ) + (((pickup-type pass-red)) + "pass-red" + ) + (((pickup-type eco-pill-green)) + "eco-pill-green" + ) + (((pickup-type eco-red)) + "eco-red" + ) + (((pickup-type skill)) + "skill" + ) + (((pickup-type karma)) + "karma" + ) + (((pickup-type gun-dark)) + "gun-dark" + ) + (((pickup-type eco-dark)) + "eco-dark" + ) + (((pickup-type gem)) + "gem" + ) + (((pickup-type eco-green)) + "eco-green" + ) + (((pickup-type darkjak)) + "darkjak" + ) + (((pickup-type ammo-yellow)) + "ammo-yellow" + ) + (((pickup-type pass-blue)) + "pass-blue" + ) + (((pickup-type ammo-red)) + "ammo-red" + ) + (((pickup-type fuel-cell)) + "fuel-cell" + ) + (((pickup-type buzzer)) + "buzzer" + ) + (((pickup-type shield)) + "shield" + ) + (((pickup-type eco-pill-random)) + "eco-pill-random" + ) + (((pickup-type board)) + "board" + ) + (((pickup-type none)) + "none" + ) + (((pickup-type pass-green)) + "pass-green" + ) + (((pickup-type gun-yellow)) + "gun-yellow" + ) + (((pickup-type money)) + "money" + ) + (((pickup-type eco-yellow)) + "eco-yellow" + ) + (((pickup-type ammo-dark)) + "ammo-dark" + ) + (((pickup-type trick-judge)) + "trick-judge" + ) + (((pickup-type trick-point)) + "trick-point" + ) + (((pickup-type ammo-blue)) + "ammo-blue" + ) + (((pickup-type pass-yellow)) + "pass-yellow" + ) + (((pickup-type health)) + "health" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type fact-info +(deftype fact-info (basic) + ((process process :offset-assert 4) + (pickup-type pickup-type :offset-assert 8) + (pickup-amount float :offset-assert 12) + (pickup-spawn-amount float :offset-assert 16) + (options actor-option :offset-assert 24) + (fade-time time-frame :offset-assert 32) + ) + :method-count-assert 12 + :size-assert #x28 + :flag-assert #xc00000028 + (:methods + (new (symbol type process pickup-type float) _type_ 0) + (fact-info-method-9 () none 9) + (reset! (_type_ symbol) none 10) + (pickup-collectable! (_type_ pickup-type float handle) float 11) + ) + ) + +;; definition for method 3 of type fact-info +(defmethod inspect fact-info ((obj fact-info)) + (when (not obj) + (set! obj obj) + (goto cfg-129) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (let ((t9-2 format) + (a0-3 #t) + (a1-2 "~1Tpickup-type: #x~X : ~S~%") + (a2-2 (-> obj pickup-type)) + (v1-2 (-> obj pickup-type)) + ) + (t9-2 a0-3 a1-2 a2-2 (cond + ((= v1-2 (pickup-type eco-pill-dark)) + "eco-pill-dark" + ) + ((= v1-2 (pickup-type gun-blue)) + "gun-blue" + ) + ((= v1-2 (pickup-type ammo-random)) + "ammo-random" + ) + ((= v1-2 (pickup-type eco-blue)) + "eco-blue" + ) + ((= v1-2 (pickup-type gun-red)) + "gun-red" + ) + ((= v1-2 (pickup-type pass-red)) + "pass-red" + ) + ((= v1-2 (pickup-type eco-pill-green)) + "eco-pill-green" + ) + ((= v1-2 (pickup-type eco-red)) + "eco-red" + ) + ((= v1-2 (pickup-type skill)) + "skill" + ) + ((= v1-2 (pickup-type karma)) + "karma" + ) + ((= v1-2 (pickup-type gun-dark)) + "gun-dark" + ) + ((= v1-2 (pickup-type eco-dark)) + "eco-dark" + ) + ((= v1-2 (pickup-type gem)) + "gem" + ) + ((= v1-2 (pickup-type eco-green)) + "eco-green" + ) + ((= v1-2 (pickup-type darkjak)) + "darkjak" + ) + ((= v1-2 (pickup-type ammo-yellow)) + "ammo-yellow" + ) + ((= v1-2 (pickup-type pass-blue)) + "pass-blue" + ) + ((= v1-2 (pickup-type ammo-red)) + "ammo-red" + ) + ((= v1-2 (pickup-type fuel-cell)) + "fuel-cell" + ) + ((= v1-2 (pickup-type buzzer)) + "buzzer" + ) + ((= v1-2 (pickup-type shield)) + "shield" + ) + ((= v1-2 (pickup-type eco-pill-random)) + "eco-pill-random" + ) + ((= v1-2 (pickup-type board)) + "board" + ) + ((= v1-2 (pickup-type none)) + "none" + ) + ((= v1-2 (pickup-type pass-green)) + "pass-green" + ) + ((= v1-2 (pickup-type gun-yellow)) + "gun-yellow" + ) + ((= v1-2 (pickup-type money)) + "money" + ) + ((= v1-2 (pickup-type eco-yellow)) + "eco-yellow" + ) + ((= v1-2 (pickup-type ammo-dark)) + "ammo-dark" + ) + ((= v1-2 (pickup-type trick-judge)) + "trick-judge" + ) + ((= v1-2 (pickup-type trick-point)) + "trick-point" + ) + ((= v1-2 (pickup-type ammo-blue)) + "ammo-blue" + ) + ((= v1-2 (pickup-type pass-yellow)) + "pass-yellow" + ) + ((= v1-2 (pickup-type health)) + "health" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) + (let ((s5-0 (-> obj options))) + (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) + (format #t "respawn-delay ") + ) + (if (= (logand s5-0 (actor-option draw-blocker)) (actor-option draw-blocker)) + (format #t "draw-blocker ") + ) + (if (= (logand (actor-option user20) s5-0) (actor-option user20)) + (format #t "user20 ") + ) + (if (= (logand (actor-option no-amb-sound) s5-0) (actor-option no-amb-sound)) + (format #t "no-amb-sound ") + ) + (if (= (logand s5-0 (actor-option auto-pickup)) (actor-option auto-pickup)) + (format #t "auto-pickup ") + ) + (if (= (logand (actor-option no-track) s5-0) (actor-option no-track)) + (format #t "no-track ") + ) + (if (= (logand s5-0 (actor-option no-shadow)) (actor-option no-shadow)) + (format #t "no-shadow ") + ) + (if (= (logand s5-0 (actor-option loop)) (actor-option loop)) + (format #t "loop ") + ) + (if (= (logand s5-0 (actor-option fuel-cell-no-jump)) (actor-option fuel-cell-no-jump)) + (format #t "fuel-cell-no-jump ") + ) + (if (= (logand (actor-option fall) s5-0) (actor-option fall)) + (format #t "fall ") + ) + (if (= (logand (actor-option user18) s5-0) (actor-option user18)) + (format #t "user18 ") + ) + (if (= (logand s5-0 (actor-option big-collision)) (actor-option big-collision)) + (format #t "big-collision ") + ) + (if (= (logand s5-0 (actor-option no-reaction)) (actor-option no-reaction)) + (format #t "no-reaction ") + ) + (if (= (logand s5-0 (actor-option suck-in)) (actor-option suck-in)) + (format #t "suck-in ") + ) + (if (= (logand s5-0 (actor-option racer-only)) (actor-option racer-only)) + (format #t "racer-only ") + ) + (if (= (logand s5-0 (actor-option blocked)) (actor-option blocked)) + (format #t "blocked ") + ) + (if (= (logand (actor-option no-distance-check-fadeout) s5-0) (actor-option no-distance-check-fadeout)) + (format #t "no-distance-check-fadeout ") + ) + (if (= (logand (actor-option cond-hide) s5-0) (actor-option cond-hide)) + (format #t "cond-hide ") + ) + (if (= (logand (actor-option user17) s5-0) (actor-option user17)) + (format #t "user17 ") + ) + (if (= (logand s5-0 (actor-option wait-for-cue)) (actor-option wait-for-cue)) + (format #t "wait-for-cue ") + ) + (if (= (logand s5-0 (actor-option reflect)) (actor-option reflect)) + (format #t "reflect ") + ) + (if (= (logand (actor-option user19) s5-0) (actor-option user19)) + (format #t "user19 ") + ) + (if (= (logand (actor-option cond-respawn) s5-0) (actor-option cond-respawn)) + (format #t "cond-respawn ") + ) + (if (= (logand s5-0 (actor-option wait-for-task-complete)) (actor-option wait-for-task-complete)) + (format #t "wait-for-task-complete ") + ) + (if (= (logand s5-0 (actor-option fade-out)) (actor-option fade-out)) + (format #t "fade-out ") + ) + (if (= (logand (actor-option cond-low-ammo) s5-0) (actor-option cond-low-ammo)) + (format #t "cond-low-ammo ") + ) + (if (= (logand (actor-option mirror) s5-0) (actor-option mirror)) + (format #t "mirror ") + ) + (if (= (logand s5-0 (actor-option spawns-fuel-cell)) (actor-option spawns-fuel-cell)) + (format #t "spawns-fuel-cell ") + ) + ) + (format #t ")~%") + (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) + (label cfg-129) + obj + ) + +;; definition of type fact-info-target +(deftype fact-info-target (fact-info) + ((eco-type int32 :offset-assert 40) + (eco-level float :offset-assert 44) + (eco-pickup-time time-frame :offset-assert 48) + (eco-timeout time-frame :offset-assert 56) + (eco-source uint64 :offset-assert 64) + (eco-source-time time-frame :offset-assert 72) + (health float :offset-assert 80) + (health-max float :offset-assert 84) + (health-pickup-time time-frame :offset-assert 88) + (buzzer float :offset-assert 96) + (buzzer-max float :offset-assert 100) + (eco-pill-green float :offset-assert 104) + (eco-pill-green-max float :offset-assert 108) + (eco-pill-green-pickup-time time-frame :offset-assert 112) + (eco-pill-dark-pickup-time time-frame :offset-assert 120) + (money-pickup-time time-frame :offset-assert 128) + (buzzer-pickup-time time-frame :offset-assert 136) + (task-pickup-time time-frame :offset-assert 144) + (stop-time-timeout time-frame :offset-assert 152) + (darkjak-start-time time-frame :offset-assert 160) + (darkjak-effect-time time-frame :offset-assert 168) + (ammo-pickup-time time-frame :offset-assert 176) + (shield-pickup-time time-frame :offset-assert 184) + (shield-start-time time-frame :offset-assert 192) + (shield-use-time time-frame :offset-assert 200) + (shield-level float :offset-assert 208) + (shield-attack-id uint32 :offset-assert 212) + (trick-point float :offset-assert 216) + (trick-point-pickup-time time-frame :offset-assert 224) + (trick-point-start-time time-frame :offset-assert 232) + (trick-point-duration time-frame :offset-assert 240) + (gem-pickup-time time-frame :offset-assert 248) + (skill-pickup-time time-frame :offset-assert 256) + (karma-pickup-time time-frame :offset-assert 264) + ) + :method-count-assert 13 + :size-assert #x110 + :flag-assert #xd00000110 + (:methods + (fact-info-target-method-12 () none 12) + ) + ) + +;; definition for method 3 of type fact-info-target +(defmethod inspect fact-info-target ((obj fact-info-target)) + (when (not obj) + (set! obj obj) + (goto cfg-129) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (let ((t9-2 format) + (a0-3 #t) + (a1-2 "~1Tpickup-type: #x~X : ~S~%") + (a2-2 (-> obj pickup-type)) + (v1-2 (-> obj pickup-type)) + ) + (t9-2 a0-3 a1-2 a2-2 (cond + ((= v1-2 (pickup-type eco-pill-dark)) + "eco-pill-dark" + ) + ((= v1-2 (pickup-type gun-blue)) + "gun-blue" + ) + ((= v1-2 (pickup-type ammo-random)) + "ammo-random" + ) + ((= v1-2 (pickup-type eco-blue)) + "eco-blue" + ) + ((= v1-2 (pickup-type gun-red)) + "gun-red" + ) + ((= v1-2 (pickup-type pass-red)) + "pass-red" + ) + ((= v1-2 (pickup-type eco-pill-green)) + "eco-pill-green" + ) + ((= v1-2 (pickup-type eco-red)) + "eco-red" + ) + ((= v1-2 (pickup-type skill)) + "skill" + ) + ((= v1-2 (pickup-type karma)) + "karma" + ) + ((= v1-2 (pickup-type gun-dark)) + "gun-dark" + ) + ((= v1-2 (pickup-type eco-dark)) + "eco-dark" + ) + ((= v1-2 (pickup-type gem)) + "gem" + ) + ((= v1-2 (pickup-type eco-green)) + "eco-green" + ) + ((= v1-2 (pickup-type darkjak)) + "darkjak" + ) + ((= v1-2 (pickup-type ammo-yellow)) + "ammo-yellow" + ) + ((= v1-2 (pickup-type pass-blue)) + "pass-blue" + ) + ((= v1-2 (pickup-type ammo-red)) + "ammo-red" + ) + ((= v1-2 (pickup-type fuel-cell)) + "fuel-cell" + ) + ((= v1-2 (pickup-type buzzer)) + "buzzer" + ) + ((= v1-2 (pickup-type shield)) + "shield" + ) + ((= v1-2 (pickup-type eco-pill-random)) + "eco-pill-random" + ) + ((= v1-2 (pickup-type board)) + "board" + ) + ((= v1-2 (pickup-type none)) + "none" + ) + ((= v1-2 (pickup-type pass-green)) + "pass-green" + ) + ((= v1-2 (pickup-type gun-yellow)) + "gun-yellow" + ) + ((= v1-2 (pickup-type money)) + "money" + ) + ((= v1-2 (pickup-type eco-yellow)) + "eco-yellow" + ) + ((= v1-2 (pickup-type ammo-dark)) + "ammo-dark" + ) + ((= v1-2 (pickup-type trick-judge)) + "trick-judge" + ) + ((= v1-2 (pickup-type trick-point)) + "trick-point" + ) + ((= v1-2 (pickup-type ammo-blue)) + "ammo-blue" + ) + ((= v1-2 (pickup-type pass-yellow)) + "pass-yellow" + ) + ((= v1-2 (pickup-type health)) + "health" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) + (let ((s5-0 (-> obj options))) + (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) + (format #t "respawn-delay ") + ) + (if (= (logand s5-0 (actor-option draw-blocker)) (actor-option draw-blocker)) + (format #t "draw-blocker ") + ) + (if (= (logand (actor-option user20) s5-0) (actor-option user20)) + (format #t "user20 ") + ) + (if (= (logand (actor-option no-amb-sound) s5-0) (actor-option no-amb-sound)) + (format #t "no-amb-sound ") + ) + (if (= (logand s5-0 (actor-option auto-pickup)) (actor-option auto-pickup)) + (format #t "auto-pickup ") + ) + (if (= (logand (actor-option no-track) s5-0) (actor-option no-track)) + (format #t "no-track ") + ) + (if (= (logand s5-0 (actor-option no-shadow)) (actor-option no-shadow)) + (format #t "no-shadow ") + ) + (if (= (logand s5-0 (actor-option loop)) (actor-option loop)) + (format #t "loop ") + ) + (if (= (logand s5-0 (actor-option fuel-cell-no-jump)) (actor-option fuel-cell-no-jump)) + (format #t "fuel-cell-no-jump ") + ) + (if (= (logand (actor-option fall) s5-0) (actor-option fall)) + (format #t "fall ") + ) + (if (= (logand (actor-option user18) s5-0) (actor-option user18)) + (format #t "user18 ") + ) + (if (= (logand s5-0 (actor-option big-collision)) (actor-option big-collision)) + (format #t "big-collision ") + ) + (if (= (logand s5-0 (actor-option no-reaction)) (actor-option no-reaction)) + (format #t "no-reaction ") + ) + (if (= (logand s5-0 (actor-option suck-in)) (actor-option suck-in)) + (format #t "suck-in ") + ) + (if (= (logand s5-0 (actor-option racer-only)) (actor-option racer-only)) + (format #t "racer-only ") + ) + (if (= (logand s5-0 (actor-option blocked)) (actor-option blocked)) + (format #t "blocked ") + ) + (if (= (logand (actor-option no-distance-check-fadeout) s5-0) (actor-option no-distance-check-fadeout)) + (format #t "no-distance-check-fadeout ") + ) + (if (= (logand (actor-option cond-hide) s5-0) (actor-option cond-hide)) + (format #t "cond-hide ") + ) + (if (= (logand (actor-option user17) s5-0) (actor-option user17)) + (format #t "user17 ") + ) + (if (= (logand s5-0 (actor-option wait-for-cue)) (actor-option wait-for-cue)) + (format #t "wait-for-cue ") + ) + (if (= (logand s5-0 (actor-option reflect)) (actor-option reflect)) + (format #t "reflect ") + ) + (if (= (logand (actor-option user19) s5-0) (actor-option user19)) + (format #t "user19 ") + ) + (if (= (logand (actor-option cond-respawn) s5-0) (actor-option cond-respawn)) + (format #t "cond-respawn ") + ) + (if (= (logand s5-0 (actor-option wait-for-task-complete)) (actor-option wait-for-task-complete)) + (format #t "wait-for-task-complete ") + ) + (if (= (logand s5-0 (actor-option fade-out)) (actor-option fade-out)) + (format #t "fade-out ") + ) + (if (= (logand (actor-option cond-low-ammo) s5-0) (actor-option cond-low-ammo)) + (format #t "cond-low-ammo ") + ) + (if (= (logand (actor-option mirror) s5-0) (actor-option mirror)) + (format #t "mirror ") + ) + (if (= (logand s5-0 (actor-option spawns-fuel-cell)) (actor-option spawns-fuel-cell)) + (format #t "spawns-fuel-cell ") + ) + ) + (format #t ")~%") + (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) + (format #t "~1Teco-type: ~D~%" (-> obj eco-type)) + (format #t "~1Teco-level: ~f~%" (-> obj eco-level)) + (format #t "~1Teco-pickup-time: ~D~%" (-> obj eco-pickup-time)) + (format #t "~1Teco-timeout: (seconds ~e)~%" (-> obj eco-timeout)) + (format #t "~1Teco-source: ~D~%" (-> obj eco-source)) + (format #t "~1Teco-source-time: ~D~%" (-> obj eco-source-time)) + (format #t "~1Thealth: ~f~%" (-> obj health)) + (format #t "~1Thealth-max: ~f~%" (-> obj health-max)) + (format #t "~1Thealth-pickup-time: ~D~%" (-> obj health-pickup-time)) + (format #t "~1Tbuzzer: ~f~%" (-> obj buzzer)) + (format #t "~1Tbuzzer-max: ~f~%" (-> obj buzzer-max)) + (format #t "~1Teco-pill-green: ~f~%" (-> obj eco-pill-green)) + (format #t "~1Teco-pill-green-max: ~f~%" (-> obj eco-pill-green-max)) + (format #t "~1Teco-pill-green-pickup-time: ~D~%" (-> obj eco-pill-green-pickup-time)) + (format #t "~1Teco-pill-dark-pickup-time: ~D~%" (-> obj eco-pill-dark-pickup-time)) + (format #t "~1Tmoney-pickup-time: ~D~%" (-> obj money-pickup-time)) + (format #t "~1Tbuzzer-pickup-time: ~D~%" (-> obj buzzer-pickup-time)) + (format #t "~1Ttask-pickup-time: ~D~%" (-> obj task-pickup-time)) + (format #t "~1Tstop-time-timeout: ~D~%" (-> obj stop-time-timeout)) + (format #t "~1Tdarkjak-start-time: ~D~%" (-> obj darkjak-start-time)) + (format #t "~1Tdarkjak-effect-time: ~D~%" (-> obj darkjak-effect-time)) + (format #t "~1Tammo-pickup-time: ~D~%" (-> obj ammo-pickup-time)) + (format #t "~1Tshield-pickup-time: ~D~%" (-> obj shield-pickup-time)) + (format #t "~1Tshield-start-time: ~D~%" (-> obj shield-start-time)) + (format #t "~1Tshield-use-time: ~D~%" (-> obj shield-use-time)) + (format #t "~1Tshield-level: ~f~%" (-> obj shield-level)) + (format #t "~1Tshield-attack-id: ~D~%" (-> obj shield-attack-id)) + (format #t "~1Ttrick-point: ~f~%" (-> obj trick-point)) + (format #t "~1Ttrick-point-pickup-time: ~D~%" (-> obj trick-point-pickup-time)) + (format #t "~1Ttrick-point-start-time: ~D~%" (-> obj trick-point-start-time)) + (format #t "~1Ttrick-point-duration: ~D~%" (-> obj trick-point-duration)) + (format #t "~1Tgem-pickup-time: ~D~%" (-> obj gem-pickup-time)) + (format #t "~1Tskill-pickup-time: ~D~%" (-> obj skill-pickup-time)) + (format #t "~1Tkarma-pickup-time: ~D~%" (-> obj karma-pickup-time)) + (label cfg-129) + obj + ) + +;; definition of type fact-info-enemy +(deftype fact-info-enemy (fact-info) + ((speed float :offset-assert 40) + (idle-distance meters :offset-assert 44) + (notice-top meters :offset-assert 48) + (notice-bottom meters :offset-assert 52) + (cam-horz meters :offset-assert 56) + (cam-vert meters :offset-assert 60) + (cam-notice-dist meters :offset-assert 64) + (enemy-options enemy-option :offset-assert 68) + (trig-dist meters :offset-assert 72) + (trig-actor-group uint32 :offset-assert 76) + (trig-mask-count int8 :offset-assert 80) + (trig-mask uint8 2 :offset-assert 81) + ) + :method-count-assert 13 + :size-assert #x53 + :flag-assert #xd00000053 + (:methods + (new (symbol type process (pointer float) pickup-type float) _type_ 0) + (clear-mask-bits (_type_ int) none 12) + ) + ) + +;; definition for method 3 of type fact-info-enemy +(defmethod inspect fact-info-enemy ((obj fact-info-enemy)) + (when (not obj) + (set! obj obj) + (goto cfg-181) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (let ((t9-2 format) + (a0-3 #t) + (a1-2 "~1Tpickup-type: #x~X : ~S~%") + (a2-2 (-> obj pickup-type)) + (v1-2 (-> obj pickup-type)) + ) + (t9-2 a0-3 a1-2 a2-2 (cond + ((= v1-2 (pickup-type eco-pill-dark)) + "eco-pill-dark" + ) + ((= v1-2 (pickup-type gun-blue)) + "gun-blue" + ) + ((= v1-2 (pickup-type ammo-random)) + "ammo-random" + ) + ((= v1-2 (pickup-type eco-blue)) + "eco-blue" + ) + ((= v1-2 (pickup-type gun-red)) + "gun-red" + ) + ((= v1-2 (pickup-type pass-red)) + "pass-red" + ) + ((= v1-2 (pickup-type eco-pill-green)) + "eco-pill-green" + ) + ((= v1-2 (pickup-type eco-red)) + "eco-red" + ) + ((= v1-2 (pickup-type skill)) + "skill" + ) + ((= v1-2 (pickup-type karma)) + "karma" + ) + ((= v1-2 (pickup-type gun-dark)) + "gun-dark" + ) + ((= v1-2 (pickup-type eco-dark)) + "eco-dark" + ) + ((= v1-2 (pickup-type gem)) + "gem" + ) + ((= v1-2 (pickup-type eco-green)) + "eco-green" + ) + ((= v1-2 (pickup-type darkjak)) + "darkjak" + ) + ((= v1-2 (pickup-type ammo-yellow)) + "ammo-yellow" + ) + ((= v1-2 (pickup-type pass-blue)) + "pass-blue" + ) + ((= v1-2 (pickup-type ammo-red)) + "ammo-red" + ) + ((= v1-2 (pickup-type fuel-cell)) + "fuel-cell" + ) + ((= v1-2 (pickup-type buzzer)) + "buzzer" + ) + ((= v1-2 (pickup-type shield)) + "shield" + ) + ((= v1-2 (pickup-type eco-pill-random)) + "eco-pill-random" + ) + ((= v1-2 (pickup-type board)) + "board" + ) + ((= v1-2 (pickup-type none)) + "none" + ) + ((= v1-2 (pickup-type pass-green)) + "pass-green" + ) + ((= v1-2 (pickup-type gun-yellow)) + "gun-yellow" + ) + ((= v1-2 (pickup-type money)) + "money" + ) + ((= v1-2 (pickup-type eco-yellow)) + "eco-yellow" + ) + ((= v1-2 (pickup-type ammo-dark)) + "ammo-dark" + ) + ((= v1-2 (pickup-type trick-judge)) + "trick-judge" + ) + ((= v1-2 (pickup-type trick-point)) + "trick-point" + ) + ((= v1-2 (pickup-type ammo-blue)) + "ammo-blue" + ) + ((= v1-2 (pickup-type pass-yellow)) + "pass-yellow" + ) + ((= v1-2 (pickup-type health)) + "health" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) + (let ((s5-0 (-> obj options))) + (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) + (format #t "respawn-delay ") + ) + (if (= (logand s5-0 (actor-option draw-blocker)) (actor-option draw-blocker)) + (format #t "draw-blocker ") + ) + (if (= (logand (actor-option user20) s5-0) (actor-option user20)) + (format #t "user20 ") + ) + (if (= (logand (actor-option no-amb-sound) s5-0) (actor-option no-amb-sound)) + (format #t "no-amb-sound ") + ) + (if (= (logand s5-0 (actor-option auto-pickup)) (actor-option auto-pickup)) + (format #t "auto-pickup ") + ) + (if (= (logand (actor-option no-track) s5-0) (actor-option no-track)) + (format #t "no-track ") + ) + (if (= (logand s5-0 (actor-option no-shadow)) (actor-option no-shadow)) + (format #t "no-shadow ") + ) + (if (= (logand s5-0 (actor-option loop)) (actor-option loop)) + (format #t "loop ") + ) + (if (= (logand s5-0 (actor-option fuel-cell-no-jump)) (actor-option fuel-cell-no-jump)) + (format #t "fuel-cell-no-jump ") + ) + (if (= (logand (actor-option fall) s5-0) (actor-option fall)) + (format #t "fall ") + ) + (if (= (logand (actor-option user18) s5-0) (actor-option user18)) + (format #t "user18 ") + ) + (if (= (logand s5-0 (actor-option big-collision)) (actor-option big-collision)) + (format #t "big-collision ") + ) + (if (= (logand s5-0 (actor-option no-reaction)) (actor-option no-reaction)) + (format #t "no-reaction ") + ) + (if (= (logand s5-0 (actor-option suck-in)) (actor-option suck-in)) + (format #t "suck-in ") + ) + (if (= (logand s5-0 (actor-option racer-only)) (actor-option racer-only)) + (format #t "racer-only ") + ) + (if (= (logand s5-0 (actor-option blocked)) (actor-option blocked)) + (format #t "blocked ") + ) + (if (= (logand (actor-option no-distance-check-fadeout) s5-0) (actor-option no-distance-check-fadeout)) + (format #t "no-distance-check-fadeout ") + ) + (if (= (logand (actor-option cond-hide) s5-0) (actor-option cond-hide)) + (format #t "cond-hide ") + ) + (if (= (logand (actor-option user17) s5-0) (actor-option user17)) + (format #t "user17 ") + ) + (if (= (logand s5-0 (actor-option wait-for-cue)) (actor-option wait-for-cue)) + (format #t "wait-for-cue ") + ) + (if (= (logand s5-0 (actor-option reflect)) (actor-option reflect)) + (format #t "reflect ") + ) + (if (= (logand (actor-option user19) s5-0) (actor-option user19)) + (format #t "user19 ") + ) + (if (= (logand (actor-option cond-respawn) s5-0) (actor-option cond-respawn)) + (format #t "cond-respawn ") + ) + (if (= (logand s5-0 (actor-option wait-for-task-complete)) (actor-option wait-for-task-complete)) + (format #t "wait-for-task-complete ") + ) + (if (= (logand s5-0 (actor-option fade-out)) (actor-option fade-out)) + (format #t "fade-out ") + ) + (if (= (logand (actor-option cond-low-ammo) s5-0) (actor-option cond-low-ammo)) + (format #t "cond-low-ammo ") + ) + (if (= (logand (actor-option mirror) s5-0) (actor-option mirror)) + (format #t "mirror ") + ) + (if (= (logand s5-0 (actor-option spawns-fuel-cell)) (actor-option spawns-fuel-cell)) + (format #t "spawns-fuel-cell ") + ) + ) + (format #t ")~%") + (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) + (format #t "~1Tspeed: ~f~%" (-> obj speed)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) + (format #t "~1Tnotice-top: (meters ~m)~%" (-> obj notice-top)) + (format #t "~1Tnotice-bottom: (meters ~m)~%" (-> obj notice-bottom)) + (format #t "~1Tcam-horz: (meters ~m)~%" (-> obj cam-horz)) + (format #t "~1Tcam-vert: (meters ~m)~%" (-> obj cam-vert)) + (format #t "~1Tcam-notice-dist: (meters ~m)~%" (-> obj cam-notice-dist)) + (format #t "~1Tenemy-options: #x~X : (enemy-option " (-> obj enemy-options)) + (let ((s5-1 (-> obj enemy-options))) + (if (= (logand s5-1 (enemy-option user11)) (enemy-option user11)) + (format #t "user11 ") + ) + (if (= (logand (enemy-option spawner) s5-1) (enemy-option spawner)) + (format #t "spawner ") + ) + (if (= (logand (enemy-option dormant-aware) s5-1) (enemy-option dormant-aware)) + (format #t "dormant-aware ") + ) + (if (= (logand s5-1 (enemy-option user0)) (enemy-option user0)) + (format #t "user0 ") + ) + (if (= (logand s5-1 (enemy-option user2)) (enemy-option user2)) + (format #t "user2 ") + ) + (if (= (logand (enemy-option prespawned) s5-1) (enemy-option prespawned)) + (format #t "prespawned ") + ) + (if (= (logand s5-1 (enemy-option user4)) (enemy-option user4)) + (format #t "user4 ") + ) + (if (= (logand s5-1 (enemy-option user6)) (enemy-option user6)) + (format #t "user6 ") + ) + (if (= (logand s5-1 (enemy-option user8)) (enemy-option user8)) + (format #t "user8 ") + ) + (if (= (logand (enemy-option multi-focus) s5-1) (enemy-option multi-focus)) + (format #t "multi-focus ") + ) + (if (= (logand (enemy-option ambush) s5-1) (enemy-option ambush)) + (format #t "ambush ") + ) + (if (= (logand s5-1 (enemy-option user12)) (enemy-option user12)) + (format #t "user12 ") + ) + (if (= (logand (enemy-option water) s5-1) (enemy-option water)) + (format #t "water ") + ) + (if (= (logand s5-1 (enemy-option user14)) (enemy-option user14)) + (format #t "user14 ") + ) + (if (= (logand (enemy-option knocked-into-water) s5-1) (enemy-option knocked-into-water)) + (format #t "knocked-into-water ") + ) + (if (= (logand s5-1 (enemy-option user10)) (enemy-option user10)) + (format #t "user10 ") + ) + (if (= (logand (enemy-option idle-til-trigger) s5-1) (enemy-option idle-til-trigger)) + (format #t "idle-til-trigger ") + ) + (if (= (logand s5-1 (enemy-option user1)) (enemy-option user1)) + (format #t "user1 ") + ) + (if (= (logand s5-1 (enemy-option user3)) (enemy-option user3)) + (format #t "user3 ") + ) + (if (= (logand s5-1 (enemy-option user5)) (enemy-option user5)) + (format #t "user5 ") + ) + (if (= (logand s5-1 (enemy-option user7)) (enemy-option user7)) + (format #t "user7 ") + ) + (if (= (logand (enemy-option dormant) s5-1) (enemy-option dormant)) + (format #t "dormant ") + ) + (if (= (logand s5-1 (enemy-option user9)) (enemy-option user9)) + (format #t "user9 ") + ) + (if (= (logand s5-1 (enemy-option user13)) (enemy-option user13)) + (format #t "user13 ") + ) + (if (= (logand s5-1 (enemy-option user15)) (enemy-option user15)) + (format #t "user15 ") + ) + (if (= (logand (enemy-option has-trigger) s5-1) (enemy-option has-trigger)) + (format #t "has-trigger ") + ) + ) + (format #t ")~%") + (format #t "~1Ttrig-dist: (meters ~m)~%" (-> obj trig-dist)) + (format #t "~1Ttrig-actor-group: #x~X~%" (-> obj trig-actor-group)) + (format #t "~1Ttrig-mask-count: ~D~%" (-> obj trig-mask-count)) + (format #t "~1Ttrig-mask[2] @ #x~X~%" (-> obj trig-mask)) + (label cfg-181) + obj + ) + +;; definition of type fact-info-crate +(deftype fact-info-crate (fact-info) + ((suck-count int32 :offset-assert 40) + ) + :method-count-assert 12 + :size-assert #x2c + :flag-assert #xc0000002c + ) + +;; definition for method 3 of type fact-info-crate +(defmethod inspect fact-info-crate ((obj fact-info-crate)) + (when (not obj) + (set! obj obj) + (goto cfg-129) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (let ((t9-2 format) + (a0-3 #t) + (a1-2 "~1Tpickup-type: #x~X : ~S~%") + (a2-2 (-> obj pickup-type)) + (v1-2 (-> obj pickup-type)) + ) + (t9-2 a0-3 a1-2 a2-2 (cond + ((= v1-2 (pickup-type eco-pill-dark)) + "eco-pill-dark" + ) + ((= v1-2 (pickup-type gun-blue)) + "gun-blue" + ) + ((= v1-2 (pickup-type ammo-random)) + "ammo-random" + ) + ((= v1-2 (pickup-type eco-blue)) + "eco-blue" + ) + ((= v1-2 (pickup-type gun-red)) + "gun-red" + ) + ((= v1-2 (pickup-type pass-red)) + "pass-red" + ) + ((= v1-2 (pickup-type eco-pill-green)) + "eco-pill-green" + ) + ((= v1-2 (pickup-type eco-red)) + "eco-red" + ) + ((= v1-2 (pickup-type skill)) + "skill" + ) + ((= v1-2 (pickup-type karma)) + "karma" + ) + ((= v1-2 (pickup-type gun-dark)) + "gun-dark" + ) + ((= v1-2 (pickup-type eco-dark)) + "eco-dark" + ) + ((= v1-2 (pickup-type gem)) + "gem" + ) + ((= v1-2 (pickup-type eco-green)) + "eco-green" + ) + ((= v1-2 (pickup-type darkjak)) + "darkjak" + ) + ((= v1-2 (pickup-type ammo-yellow)) + "ammo-yellow" + ) + ((= v1-2 (pickup-type pass-blue)) + "pass-blue" + ) + ((= v1-2 (pickup-type ammo-red)) + "ammo-red" + ) + ((= v1-2 (pickup-type fuel-cell)) + "fuel-cell" + ) + ((= v1-2 (pickup-type buzzer)) + "buzzer" + ) + ((= v1-2 (pickup-type shield)) + "shield" + ) + ((= v1-2 (pickup-type eco-pill-random)) + "eco-pill-random" + ) + ((= v1-2 (pickup-type board)) + "board" + ) + ((= v1-2 (pickup-type none)) + "none" + ) + ((= v1-2 (pickup-type pass-green)) + "pass-green" + ) + ((= v1-2 (pickup-type gun-yellow)) + "gun-yellow" + ) + ((= v1-2 (pickup-type money)) + "money" + ) + ((= v1-2 (pickup-type eco-yellow)) + "eco-yellow" + ) + ((= v1-2 (pickup-type ammo-dark)) + "ammo-dark" + ) + ((= v1-2 (pickup-type trick-judge)) + "trick-judge" + ) + ((= v1-2 (pickup-type trick-point)) + "trick-point" + ) + ((= v1-2 (pickup-type ammo-blue)) + "ammo-blue" + ) + ((= v1-2 (pickup-type pass-yellow)) + "pass-yellow" + ) + ((= v1-2 (pickup-type health)) + "health" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tpickup-amount: ~f~%" (-> obj pickup-amount)) + (format #t "~1Tpickup-spawn-amount: ~f~%" (-> obj pickup-spawn-amount)) + (format #t "~1Toptions: #x~X : (actor-option " (-> obj options)) + (let ((s5-0 (-> obj options))) + (if (= (logand s5-0 (actor-option respawn-delay)) (actor-option respawn-delay)) + (format #t "respawn-delay ") + ) + (if (= (logand s5-0 (actor-option draw-blocker)) (actor-option draw-blocker)) + (format #t "draw-blocker ") + ) + (if (= (logand (actor-option user20) s5-0) (actor-option user20)) + (format #t "user20 ") + ) + (if (= (logand (actor-option no-amb-sound) s5-0) (actor-option no-amb-sound)) + (format #t "no-amb-sound ") + ) + (if (= (logand s5-0 (actor-option auto-pickup)) (actor-option auto-pickup)) + (format #t "auto-pickup ") + ) + (if (= (logand (actor-option no-track) s5-0) (actor-option no-track)) + (format #t "no-track ") + ) + (if (= (logand s5-0 (actor-option no-shadow)) (actor-option no-shadow)) + (format #t "no-shadow ") + ) + (if (= (logand s5-0 (actor-option loop)) (actor-option loop)) + (format #t "loop ") + ) + (if (= (logand s5-0 (actor-option fuel-cell-no-jump)) (actor-option fuel-cell-no-jump)) + (format #t "fuel-cell-no-jump ") + ) + (if (= (logand (actor-option fall) s5-0) (actor-option fall)) + (format #t "fall ") + ) + (if (= (logand (actor-option user18) s5-0) (actor-option user18)) + (format #t "user18 ") + ) + (if (= (logand s5-0 (actor-option big-collision)) (actor-option big-collision)) + (format #t "big-collision ") + ) + (if (= (logand s5-0 (actor-option no-reaction)) (actor-option no-reaction)) + (format #t "no-reaction ") + ) + (if (= (logand s5-0 (actor-option suck-in)) (actor-option suck-in)) + (format #t "suck-in ") + ) + (if (= (logand s5-0 (actor-option racer-only)) (actor-option racer-only)) + (format #t "racer-only ") + ) + (if (= (logand s5-0 (actor-option blocked)) (actor-option blocked)) + (format #t "blocked ") + ) + (if (= (logand (actor-option no-distance-check-fadeout) s5-0) (actor-option no-distance-check-fadeout)) + (format #t "no-distance-check-fadeout ") + ) + (if (= (logand (actor-option cond-hide) s5-0) (actor-option cond-hide)) + (format #t "cond-hide ") + ) + (if (= (logand (actor-option user17) s5-0) (actor-option user17)) + (format #t "user17 ") + ) + (if (= (logand s5-0 (actor-option wait-for-cue)) (actor-option wait-for-cue)) + (format #t "wait-for-cue ") + ) + (if (= (logand s5-0 (actor-option reflect)) (actor-option reflect)) + (format #t "reflect ") + ) + (if (= (logand (actor-option user19) s5-0) (actor-option user19)) + (format #t "user19 ") + ) + (if (= (logand (actor-option cond-respawn) s5-0) (actor-option cond-respawn)) + (format #t "cond-respawn ") + ) + (if (= (logand s5-0 (actor-option wait-for-task-complete)) (actor-option wait-for-task-complete)) + (format #t "wait-for-task-complete ") + ) + (if (= (logand s5-0 (actor-option fade-out)) (actor-option fade-out)) + (format #t "fade-out ") + ) + (if (= (logand (actor-option cond-low-ammo) s5-0) (actor-option cond-low-ammo)) + (format #t "cond-low-ammo ") + ) + (if (= (logand (actor-option mirror) s5-0) (actor-option mirror)) + (format #t "mirror ") + ) + (if (= (logand s5-0 (actor-option spawns-fuel-cell)) (actor-option spawns-fuel-cell)) + (format #t "spawns-fuel-cell ") + ) + ) + (format #t ")~%") + (format #t "~1Tfade-time: ~D~%" (-> obj fade-time)) + (format #t "~1Tsuck-count: ~D~%" (-> obj suck-count)) + (label cfg-129) + obj + ) + +;; definition for method 0 of type fact-info +;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs fact-info. +(defmethod new fact-info ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) + (local-vars (sv-16 fact-info) (sv-20 entity) (sv-24 task-mask)) + (set! sv-16 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + (set! sv-20 (-> arg0 entity)) + (set! sv-24 (process-task-mask arg0)) + (when (zero? sv-16) + (go process-drawable-art-error "memory") + (return (the-as fact-info 0)) + ) + (set! (-> sv-16 process) arg0) + (set! (-> sv-16 pickup-type) arg1) + (set! (-> sv-16 pickup-amount) arg2) + (let ((s4-1 (-> ((method-of-type res-lump lookup-tag-idx) sv-20 'eco-info 'base -1000000000.0) lo))) + (when (>= (the-as int s4-1) 0) + (let ((s3-0 (the-as int s4-1)) + (s2-0 (-> sv-20 tag s4-1)) + ) + 0 + (while (= (-> s2-0 name) (-> sv-20 tag s4-1 name)) + (let ((v1-17 (make-property-data sv-20 0.0 (the-as res-tag-pair s3-0) (the-as pointer #f))) + (a0-7 (the int (-> s2-0 key-frame))) + ) + (when (or (< a0-7 0) (and (-> arg0 entity) (logtest? sv-24 (ash 1 a0-7)))) + (when v1-17 + (let ((a0-15 (-> s2-0 elt-count))) + (set! (-> sv-16 pickup-type) (the-as pickup-type (-> (the-as (pointer int32) v1-17)))) + (set! (-> sv-16 pickup-amount) (if (< (the-as uint 1) a0-15) + (the float (-> (the-as (pointer int32) v1-17) 1)) + arg2 + ) + ) + ) + ) + ) + ) + (+! s3-0 1) + (set! s2-0 (-> sv-20 tag s3-0)) + ) + ) + ) + ) + (set! (-> sv-16 options) (res-lump-value sv-20 'options actor-option :time -1000000000.0)) + (if (logtest? (-> sv-16 options) (actor-option fade-out respawn-delay)) + (set! (-> sv-16 fade-time) (the-as time-frame (the int (* 300.0 (res-lump-float sv-20 'timeout))))) + ) + (the-as fact-info sv-16) + ) + +;; definition for method 11 of type fact-info +(defmethod pickup-collectable! fact-info ((obj fact-info) (arg0 pickup-type) (arg1 float) (arg2 handle)) + 0.0 + ) + +;; definition of type fact-info-enemy-defaults +(deftype fact-info-enemy-defaults (basic) + ((idle-distance meters :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type fact-info-enemy-defaults +(defmethod inspect fact-info-enemy-defaults ((obj fact-info-enemy-defaults)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tidle-distance: (meters ~m)~%" (-> obj idle-distance)) + (label cfg-4) + obj + ) + +;; definition for symbol *fact-info-enemy-defaults*, type fact-info-enemy-defaults +(define *fact-info-enemy-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +;; definition for method 0 of type fact-info-enemy +;; INFO: Used lq/sq +(defmethod new fact-info-enemy ((allocation symbol) + (type-to-make type) + (arg0 process) + (arg1 (pointer float)) + (arg2 pickup-type) + (arg3 float) + ) + (local-vars (sv-16 res-tag) (sv-32 res-tag)) + (let ((gp-0 (the-as fact-info-enemy ((method-of-type fact-info new) allocation type-to-make arg0 arg2 arg3)))) + (let ((s5-0 (-> gp-0 process entity))) + (set! (-> gp-0 speed) (res-lump-float s5-0 'speed :default 1.0)) + (set! (-> gp-0 idle-distance) (res-lump-float s5-0 'idle-distance :default (-> arg1 0))) + (set! (-> gp-0 notice-top) (res-lump-float s5-0 'notice-top :default 4096000.0)) + (set! (-> gp-0 notice-bottom) (res-lump-float s5-0 'notice-bottom :default 4096000.0)) + (set! (-> gp-0 cam-horz) (res-lump-float s5-0 'cam-horz)) + (set! (-> gp-0 cam-vert) (res-lump-float s5-0 'cam-vert)) + (set! (-> gp-0 cam-notice-dist) (res-lump-float s5-0 'cam-notice-dist :default -4096.0)) + (set! (-> gp-0 enemy-options) (res-lump-value s5-0 'enemy-options enemy-option :time -1000000000.0)) + (let ((s4-1 0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-11 (res-lump-data s5-0 'trigger pointer :tag-ptr (& sv-16)))) + (when v1-11 + (set! (-> gp-0 enemy-options) (logior (enemy-option has-trigger) (-> gp-0 enemy-options))) + (let ((a0-13 0)) + (dotimes (a1-11 (the-as int (-> sv-16 elt-count))) + (let ((a2-12 (-> (the-as (pointer uint32) (&+ v1-11 (* a1-11 4)))))) + (when (and (nonzero? a2-12) (< a0-13 2)) + (set! (-> gp-0 trig-mask a0-13) a2-12) + (set! s4-1 (logior s4-1 a2-12)) + (+! a0-13 1) + ) + ) + ) + (set! (-> gp-0 trig-mask-count) a0-13) + ) + ) + ) + (set! (-> gp-0 trig-dist) (if (logtest? s4-1 1) + (res-lump-float s5-0 'trig-dist :default 327680.0) + 327680.0 + ) + ) + (when (logtest? s4-1 2) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-20 (res-lump-data s5-0 'trig-ag pointer :tag-ptr (& sv-32)))) + (if (and v1-20 (nonzero? (-> sv-32 elt-count))) + (set! (-> gp-0 trig-actor-group) (the-as uint v1-20)) + (clear-mask-bits gp-0 2) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 12 of type fact-info-enemy +;; INFO: Return type mismatch int vs none. +(defmethod clear-mask-bits fact-info-enemy ((obj fact-info-enemy) (arg0 int)) + (let ((v1-0 (lognot arg0))) + (dotimes (a1-1 (-> obj trig-mask-count)) + (logand! (-> obj trig-mask a1-1) v1-0) + ) + ) + 0 + (none) + ) + +;; definition for method 0 of type fact-info-crate +(defmethod new fact-info-crate ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) + (let ((gp-0 (the-as fact-info-crate ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (let ((a0-1 (-> gp-0 process entity))) + (set! (-> gp-0 suck-count) (res-lump-value a0-1 'suck-count int :time -1000000000.0)) + ) + gp-0 + ) + ) + +;; definition for method 0 of type fact-info-target +(defmethod new fact-info-target ((allocation symbol) (type-to-make type) (arg0 process) (arg1 pickup-type) (arg2 float)) + (let ((gp-0 (the-as fact-info-target ((method-of-type fact-info new) allocation type-to-make arg0 arg1 arg2)))) + (set! (-> gp-0 eco-source) (the-as uint #f)) + (reset! gp-0 #f) + gp-0 + ) + ) diff --git a/test/decompiler/reference/jak2/engine/game/game-h_REF.gc b/test/decompiler/reference/jak2/engine/game/game-h_REF.gc new file mode 100644 index 0000000000..17f9aaa9c0 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/game-h_REF.gc @@ -0,0 +1,451 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type process-drawable +(deftype process-drawable (process) + ((root trsqv :offset-assert 128) + (node-list cspace-array :offset-assert 132) + (draw draw-control :offset-assert 136) + (skel joint-control :offset-assert 140) + (nav nav-control :offset-assert 144) + (align align-control :offset-assert 148) + (path path-control :offset-assert 152) + (vol vol-control :offset-assert 156) + (fact fact-info :offset-assert 160) + (link actor-link-info :offset-assert 164) + (part sparticle-launch-control :offset-assert 168) + (water water-control :offset-assert 172) + (sound ambient-sound :offset-assert 176) + (carry basic :offset-assert 180) + (rbody basic :offset-assert 184) + (state-flags state-flags :offset-assert 188) + (state-time time-frame :offset-assert 192) + ) + :heap-base #x50 + :method-count-assert 20 + :size-assert #xc8 + :flag-assert #x14005000c8 + (:methods + (process-drawable-method-14 () none 14) + (process-drawable-method-15 () none 15) + (process-drawable-method-16 () none 16) + (process-drawable-method-17 () none 17) + (process-drawable-method-18 () none 18) + (process-drawable-method-19 () none 19) + ) + ) + +;; definition for method 3 of type process-drawable +(defmethod inspect process-drawable ((obj process-drawable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Troot: ~A~%" (-> obj root)) + (format #t "~2Tnode-list: ~A~%" (-> obj node-list)) + (format #t "~2Tdraw: ~A~%" (-> obj draw)) + (format #t "~2Tskel: ~A~%" (-> obj skel)) + (format #t "~2Tnav: ~A~%" (-> obj nav)) + (format #t "~2Talign: ~A~%" (-> obj align)) + (format #t "~2Tpath: ~A~%" (-> obj path)) + (format #t "~2Tvol: ~A~%" (-> obj vol)) + (format #t "~2Tfact: ~A~%" (-> obj fact)) + (format #t "~2Tlink: ~A~%" (-> obj link)) + (format #t "~2Tpart: ~A~%" (-> obj part)) + (format #t "~2Twater: ~A~%" (-> obj water)) + (format #t "~2Tsound: ~A~%" (-> obj sound)) + (format #t "~2Tcarry: ~A~%" (-> obj carry)) + (format #t "~2Trbody: ~A~%" (-> obj rbody)) + (format #t "~2Tstate-flags: ~D~%" (-> obj state-flags)) + (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (label cfg-4) + obj + ) + +;; definition of type process-drawable-reserved +(deftype process-drawable-reserved (process-drawable) + () + :heap-base #x50 + :method-count-assert 178 + :size-assert #xc8 + :flag-assert #xb2005000c8 + (:methods + (process-drawable-reserved-method-20 () none 20) + (process-drawable-reserved-method-21 () none 21) + (process-drawable-reserved-method-22 () none 22) + (process-drawable-reserved-method-23 () none 23) + (process-drawable-reserved-method-24 () none 24) + (process-drawable-reserved-method-25 () none 25) + (process-drawable-reserved-method-26 () none 26) + (process-drawable-reserved-method-27 () none 27) + (process-drawable-reserved-method-28 () none 28) + (process-drawable-reserved-method-29 () none 29) + (process-drawable-reserved-method-30 () none 30) + (process-drawable-reserved-method-31 () none 31) + (process-drawable-reserved-method-32 () none 32) + (process-drawable-reserved-method-33 () none 33) + (process-drawable-reserved-method-34 () none 34) + (process-drawable-reserved-method-35 () none 35) + (process-drawable-reserved-method-36 () none 36) + (process-drawable-reserved-method-37 () none 37) + (process-drawable-reserved-method-38 () none 38) + (process-drawable-reserved-method-39 () none 39) + (process-drawable-reserved-method-40 () none 40) + (process-drawable-reserved-method-41 () none 41) + (process-drawable-reserved-method-42 () none 42) + (process-drawable-reserved-method-43 () none 43) + (process-drawable-reserved-method-44 () none 44) + (process-drawable-reserved-method-45 () none 45) + (process-drawable-reserved-method-46 () none 46) + (process-drawable-reserved-method-47 () none 47) + (process-drawable-reserved-method-48 () none 48) + (process-drawable-reserved-method-49 () none 49) + (process-drawable-reserved-method-50 () none 50) + (process-drawable-reserved-method-51 () none 51) + (process-drawable-reserved-method-52 () none 52) + (process-drawable-reserved-method-53 () none 53) + (process-drawable-reserved-method-54 () none 54) + (process-drawable-reserved-method-55 () none 55) + (process-drawable-reserved-method-56 () none 56) + (process-drawable-reserved-method-57 () none 57) + (process-drawable-reserved-method-58 () none 58) + (process-drawable-reserved-method-59 () none 59) + (process-drawable-reserved-method-60 () none 60) + (process-drawable-reserved-method-61 () none 61) + (process-drawable-reserved-method-62 () none 62) + (process-drawable-reserved-method-63 () none 63) + (process-drawable-reserved-method-64 () none 64) + (process-drawable-reserved-method-65 () none 65) + (process-drawable-reserved-method-66 () none 66) + (process-drawable-reserved-method-67 () none 67) + (process-drawable-reserved-method-68 () none 68) + (process-drawable-reserved-method-69 () none 69) + (process-drawable-reserved-method-70 () none 70) + (process-drawable-reserved-method-71 () none 71) + (process-drawable-reserved-method-72 () none 72) + (process-drawable-reserved-method-73 () none 73) + (process-drawable-reserved-method-74 () none 74) + (process-drawable-reserved-method-75 () none 75) + (process-drawable-reserved-method-76 () none 76) + (process-drawable-reserved-method-77 () none 77) + (process-drawable-reserved-method-78 () none 78) + (process-drawable-reserved-method-79 () none 79) + (process-drawable-reserved-method-80 () none 80) + (process-drawable-reserved-method-81 () none 81) + (process-drawable-reserved-method-82 () none 82) + (process-drawable-reserved-method-83 () none 83) + (process-drawable-reserved-method-84 () none 84) + (process-drawable-reserved-method-85 () none 85) + (process-drawable-reserved-method-86 () none 86) + (process-drawable-reserved-method-87 () none 87) + (process-drawable-reserved-method-88 () none 88) + (process-drawable-reserved-method-89 () none 89) + (process-drawable-reserved-method-90 () none 90) + (process-drawable-reserved-method-91 () none 91) + (process-drawable-reserved-method-92 () none 92) + (process-drawable-reserved-method-93 () none 93) + (process-drawable-reserved-method-94 () none 94) + (process-drawable-reserved-method-95 () none 95) + (process-drawable-reserved-method-96 () none 96) + (process-drawable-reserved-method-97 () none 97) + (process-drawable-reserved-method-98 () none 98) + (process-drawable-reserved-method-99 () none 99) + (process-drawable-reserved-method-100 () none 100) + (process-drawable-reserved-method-101 () none 101) + (process-drawable-reserved-method-102 () none 102) + (process-drawable-reserved-method-103 () none 103) + (process-drawable-reserved-method-104 () none 104) + (process-drawable-reserved-method-105 () none 105) + (process-drawable-reserved-method-106 () none 106) + (process-drawable-reserved-method-107 () none 107) + (process-drawable-reserved-method-108 () none 108) + (process-drawable-reserved-method-109 () none 109) + (process-drawable-reserved-method-110 () none 110) + (process-drawable-reserved-method-111 () none 111) + (process-drawable-reserved-method-112 () none 112) + (process-drawable-reserved-method-113 () none 113) + (process-drawable-reserved-method-114 () none 114) + (process-drawable-reserved-method-115 () none 115) + (process-drawable-reserved-method-116 () none 116) + (process-drawable-reserved-method-117 () none 117) + (process-drawable-reserved-method-118 () none 118) + (process-drawable-reserved-method-119 () none 119) + (process-drawable-reserved-method-120 () none 120) + (process-drawable-reserved-method-121 () none 121) + (process-drawable-reserved-method-122 () none 122) + (process-drawable-reserved-method-123 () none 123) + (process-drawable-reserved-method-124 () none 124) + (process-drawable-reserved-method-125 () none 125) + (process-drawable-reserved-method-126 () none 126) + (process-drawable-reserved-method-127 () none 127) + (process-drawable-reserved-method-128 () none 128) + (process-drawable-reserved-method-129 () none 129) + (process-drawable-reserved-method-130 () none 130) + (process-drawable-reserved-method-131 () none 131) + (process-drawable-reserved-method-132 () none 132) + (process-drawable-reserved-method-133 () none 133) + (process-drawable-reserved-method-134 () none 134) + (process-drawable-reserved-method-135 () none 135) + (process-drawable-reserved-method-136 () none 136) + (process-drawable-reserved-method-137 () none 137) + (process-drawable-reserved-method-138 () none 138) + (process-drawable-reserved-method-139 () none 139) + (process-drawable-reserved-method-140 () none 140) + (process-drawable-reserved-method-141 () none 141) + (process-drawable-reserved-method-142 () none 142) + (process-drawable-reserved-method-143 () none 143) + (process-drawable-reserved-method-144 () none 144) + (process-drawable-reserved-method-145 () none 145) + (process-drawable-reserved-method-146 () none 146) + (process-drawable-reserved-method-147 () none 147) + (process-drawable-reserved-method-148 () none 148) + (process-drawable-reserved-method-149 () none 149) + (process-drawable-reserved-method-150 () none 150) + (process-drawable-reserved-method-151 () none 151) + (process-drawable-reserved-method-152 () none 152) + (process-drawable-reserved-method-153 () none 153) + (process-drawable-reserved-method-154 () none 154) + (process-drawable-reserved-method-155 () none 155) + (process-drawable-reserved-method-156 () none 156) + (process-drawable-reserved-method-157 () none 157) + (process-drawable-reserved-method-158 () none 158) + (process-drawable-reserved-method-159 () none 159) + (process-drawable-reserved-method-160 () none 160) + (process-drawable-reserved-method-161 () none 161) + (process-drawable-reserved-method-162 () none 162) + (process-drawable-reserved-method-163 () none 163) + (process-drawable-reserved-method-164 () none 164) + (process-drawable-reserved-method-165 () none 165) + (process-drawable-reserved-method-166 () none 166) + (process-drawable-reserved-method-167 () none 167) + (process-drawable-reserved-method-168 () none 168) + (process-drawable-reserved-method-169 () none 169) + (process-drawable-reserved-method-170 () none 170) + (process-drawable-reserved-method-171 () none 171) + (process-drawable-reserved-method-172 () none 172) + (process-drawable-reserved-method-173 () none 173) + (process-drawable-reserved-method-174 () none 174) + (process-drawable-reserved-method-175 () none 175) + (process-drawable-reserved-method-176 () none 176) + (process-drawable-reserved-method-177 () none 177) + ) + ) + +;; definition for method 3 of type process-drawable-reserved +(defmethod inspect process-drawable-reserved ((obj process-drawable-reserved)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type attack-dir-info +(deftype attack-dir-info (structure) + ((dir vector :inline :offset-assert 0) + (xz-dir vector :inline :offset-assert 16) + (attacker-velocity vector :inline :offset-assert 32) + (pos vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type attack-dir-info +(defmethod inspect attack-dir-info ((obj attack-dir-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'attack-dir-info) + (format #t "~1Tdir: #~%" (-> obj dir)) + (format #t "~1Txz-dir: #~%" (-> obj xz-dir)) + (format #t "~1Tattacker-velocity: #~%" (-> obj attacker-velocity)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (label cfg-4) + obj + ) + +;; definition of type attack-info +(deftype attack-info (structure) + ((trans vector :inline :offset-assert 0) + (vector vector :inline :offset-assert 16) + (attacker-velocity vector :inline :offset-assert 32) + (intersection vector :inline :offset-assert 48) + (attacker handle :offset-assert 64) + (attack-time time-frame :offset-assert 72) + (invinc-time time-frame :offset-assert 80) + (mask attack-info-mask :offset-assert 88) + (mode symbol :offset-assert 92) + (shove-back meters :offset-assert 96) + (shove-up meters :offset-assert 100) + (speed meters :offset-assert 104) + (dist meters :offset-assert 108) + (control float :offset-assert 112) + (angle symbol :offset-assert 116) + (rotate-to degrees :offset-assert 120) + (prev-state state :offset-assert 124) + (id uint32 :offset-assert 128) + (count uint32 :offset-assert 132) + (penetrate-using uint64 :offset-assert 136) + (damage float :offset-assert 144) + (shield-damage float :offset-assert 148) + (knock uint8 :offset-assert 152) + (test uint32 :offset-assert 156) + ) + :method-count-assert 12 + :size-assert #xa0 + :flag-assert #xc000000a0 + (:methods + (attack-info-method-9 () none 9) + (attack-info-method-10 () none 10) + (attack-info-method-11 () none 11) + ) + ) + +;; definition for method 3 of type attack-info +(defmethod inspect attack-info ((obj attack-info)) + (when (not obj) + (set! obj obj) + (goto cfg-50) + ) + (format #t "[~8x] ~A~%" obj 'attack-info) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tvector: ~`vector`P~%" (-> obj vector)) + (format #t "~1Tattacker-velocity: ~`vector`P~%" (-> obj attacker-velocity)) + (format #t "~1Tintersection: ~`vector`P~%" (-> obj intersection)) + (format #t "~1Tattacker: ~`handle`P~%" (-> obj attacker)) + (format #t "~1Tattack-time: ~D~%" (-> obj attack-time)) + (format #t "~1Tinvinc-time: ~D~%" (-> obj invinc-time)) + (format #t "~1Tmask: #x~X : (attack-info-mask " (-> obj mask)) + (let ((s5-0 (-> obj mask))) + (if (= (logand s5-0 (attack-info-mask vector)) (attack-info-mask vector)) + (format #t "vector ") + ) + (if (= (logand s5-0 (attack-info-mask angle)) (attack-info-mask angle)) + (format #t "angle ") + ) + (if (= (logand (attack-info-mask test) s5-0) (attack-info-mask test)) + (format #t "test ") + ) + (if (= (logand s5-0 (attack-info-mask invinc-time)) (attack-info-mask invinc-time)) + (format #t "invinc-time ") + ) + (if (= (logand s5-0 (attack-info-mask attacker)) (attack-info-mask attacker)) + (format #t "attacker ") + ) + (if (= (logand s5-0 (attack-info-mask dist)) (attack-info-mask dist)) + (format #t "dist ") + ) + (if (= (logand s5-0 (attack-info-mask intersection)) (attack-info-mask intersection)) + (format #t "intersection ") + ) + (if (= (logand s5-0 (attack-info-mask shove-back)) (attack-info-mask shove-back)) + (format #t "shove-back ") + ) + (if (= (logand s5-0 (attack-info-mask shove-up)) (attack-info-mask shove-up)) + (format #t "shove-up ") + ) + (if (= (logand s5-0 (attack-info-mask mode)) (attack-info-mask mode)) + (format #t "mode ") + ) + (if (= (logand (attack-info-mask count) s5-0) (attack-info-mask count)) + (format #t "count ") + ) + (if (= (logand s5-0 (attack-info-mask rotate-to)) (attack-info-mask rotate-to)) + (format #t "rotate-to ") + ) + (if (= (logand s5-0 (attack-info-mask speed)) (attack-info-mask speed)) + (format #t "speed ") + ) + (if (= (logand s5-0 (attack-info-mask attack-time)) (attack-info-mask attack-time)) + (format #t "attack-time ") + ) + (if (= (logand (attack-info-mask damage) s5-0) (attack-info-mask damage)) + (format #t "damage ") + ) + (if (= (logand s5-0 (attack-info-mask control)) (attack-info-mask control)) + (format #t "control ") + ) + (if (= (logand s5-0 (attack-info-mask trans)) (attack-info-mask trans)) + (format #t "trans ") + ) + (if (= (logand (attack-info-mask penetrate-using) s5-0) (attack-info-mask penetrate-using)) + (format #t "penetrate-using ") + ) + (if (= (logand (attack-info-mask attacker-velocity) s5-0) (attack-info-mask attacker-velocity)) + (format #t "attacker-velocity ") + ) + (if (= (logand s5-0 (attack-info-mask id)) (attack-info-mask id)) + (format #t "id ") + ) + (if (= (logand s5-0 (attack-info-mask prev-state)) (attack-info-mask prev-state)) + (format #t "prev-state ") + ) + (if (= (logand (attack-info-mask knock) s5-0) (attack-info-mask knock)) + (format #t "knock ") + ) + (if (= (logand (attack-info-mask shield-damage) s5-0) (attack-info-mask shield-damage)) + (format #t "shield-damage ") + ) + ) + (format #t ")~%") + (format #t "~1Tmode: ~A~%" (-> obj mode)) + (format #t "~1Tshove-back: (meters ~m)~%" (-> obj shove-back)) + (format #t "~1Tshove-up: (meters ~m)~%" (-> obj shove-up)) + (format #t "~1Tspeed: (meters ~m)~%" (-> obj speed)) + (format #t "~1Tdist: (meters ~m)~%" (-> obj dist)) + (format #t "~1Tcontrol: ~f~%" (-> obj control)) + (format #t "~1Tangle: ~A~%" (-> obj angle)) + (format #t "~1Trotate-to: (deg ~r)~%" (-> obj rotate-to)) + (format #t "~1Tprev-state: ~A~%" (-> obj prev-state)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tpenetrate-using: ~D~%" (-> obj penetrate-using)) + (format #t "~1Tdamage: ~f~%" (-> obj damage)) + (format #t "~1Tshield-damage: ~f~%" (-> obj shield-damage)) + (format #t "~1Tknock: ~D~%" (-> obj knock)) + (format #t "~1Ttest: ~A~%" (-> obj test)) + (label cfg-50) + obj + ) + +;; definition of type ground-tween-info +(deftype ground-tween-info (structure) + ((chan uint8 3 :offset-assert 0) + (blend float 3 :offset-assert 4) + (group uint32 5 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type ground-tween-info +(defmethod inspect ground-tween-info ((obj ground-tween-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ground-tween-info) + (format #t "~1Tchan[3] @ #x~X~%" (-> obj chan)) + (format #t "~1Tblend[3] @ #x~X~%" (-> obj blend)) + (format #t "~1Tgroup[5] @ #x~X~%" (-> obj group)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + 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 new file mode 100644 index 0000000000..fe0fcd0691 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/game-info-h_REF.gc @@ -0,0 +1,464 @@ +;;-*-Lisp-*- +(in-package goal) + +(local-vars (gp-0 game-info)) + +;; definition of type game-bank +(deftype game-bank (basic) + ((life-max-default float :offset-assert 4) + (life-start-default float :offset-assert 8) + (life-single-inc float :offset-assert 12) + (money-task-inc float :offset-assert 16) + (money-oracle-inc float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type game-bank +(defmethod inspect game-bank ((obj game-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlife-max-default: ~f~%" (-> obj life-max-default)) + (format #t "~1Tlife-start-default: ~f~%" (-> obj life-start-default)) + (format #t "~1Tlife-single-inc: ~f~%" (-> obj life-single-inc)) + (format #t "~1Tmoney-task-inc: ~f~%" (-> obj money-task-inc)) + (format #t "~1Tmoney-oracle-inc: ~f~%" (-> obj money-oracle-inc)) + (label cfg-4) + obj + ) + +;; definition for symbol *GAME-bank*, type game-bank +(define *GAME-bank* (new 'static 'game-bank + :life-max-default 99.0 + :life-start-default 5.0 + :life-single-inc 1.0 + :money-task-inc 90.0 + :money-oracle-inc 120.0 + ) + ) + +;; definition of type actor-id +(deftype actor-id (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type highscore-info +(deftype highscore-info (structure) + ((flags uint8 :offset-assert 0) + (award-scores float 3 :offset-assert 4) + (bronze-score float :offset 4) + (silver-score float :offset 8) + (gold-score float :offset 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (highscore-info-method-9 () none 9) + ) + ) + +;; definition for method 3 of type highscore-info +(defmethod inspect highscore-info ((obj highscore-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'highscore-info) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Taward-scores[3] @ #x~X~%" (-> obj award-scores)) + (format #t "~1Tbronze-score: ~f~%" (-> obj bronze-score)) + (format #t "~1Tsilver-score: ~f~%" (-> obj silver-score)) + (format #t "~1Tgold-score: ~f~%" (-> obj gold-score)) + (label cfg-4) + obj + ) + +;; definition of type level-buffer-state +(deftype level-buffer-state (structure) + ((name symbol :offset-assert 0) + (display? symbol :offset-assert 4) + (force-vis? symbol :offset-assert 8) + (force-inside? symbol :offset-assert 12) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type level-buffer-state +(defmethod inspect level-buffer-state ((obj level-buffer-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'level-buffer-state) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tdisplay?: ~A~%" (-> obj display?)) + (format #t "~1Tforce-vis?: ~A~%" (-> obj force-vis?)) + (format #t "~1Tforce-inside?: ~A~%" (-> obj force-inside?)) + (label cfg-4) + obj + ) + +;; definition of type load-state +(deftype load-state (basic) + ((want level-buffer-state 6 :inline :offset-assert 4) + (want-sound symbol 3 :offset-assert 100) + (vis-nick symbol :offset-assert 112) + (command-list pair :offset-assert 116) + (object-name string 256 :offset-assert 120) + (object-status basic 256 :offset-assert 1144) + ) + :method-count-assert 22 + :size-assert #x878 + :flag-assert #x1600000878 + (:methods + (new (symbol type) _type_ 0) + (reset! (_type_) _type_ 9) + (update! (_type_) int 10) + (want-levels (_type_ (pointer symbol)) int 11) + (load-state-method-12 () none 12) + (want-display-level (_type_ symbol symbol) int 13) + (want-vis-level (_type_ symbol) none 14) + (load-state-method-15 () none 15) + (load-state-method-16 () none 16) + (load-state-method-17 () none 17) + (load-state-method-18 () none 18) + (load-state-method-19 () none 19) + (load-state-method-20 () none 20) + (load-state-method-21 () none 21) + ) + ) + +;; definition for method 3 of type load-state +(defmethod inspect load-state ((obj load-state)) + (when (not obj) + (set! obj obj) + (goto cfg-10) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twant[6] @ #x~X~%" (-> obj want)) + (dotimes (s5-0 6) + (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> obj want s5-0)) + ) + (format #t "~1Twant-sound[3] @ #x~X~%" (-> obj want-sound)) + (dotimes (s5-1 3) + (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> obj want-sound s5-1)) + ) + (format #t "~1Tvis-nick: ~A~%" (-> obj vis-nick)) + (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) + (format #t "~1Tobject-name[256] @ #x~X~%" (-> obj object-name)) + (format #t "~1Tobject-status[256] @ #x~X~%" (-> obj object-status)) + (label cfg-10) + obj + ) + +;; definition for method 0 of type load-state +(defmethod new load-state ((allocation symbol) (type-to-make type)) + (reset! (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + ) + +;; definition of type continue-point +(deftype continue-point (basic) + ((name string :offset-assert 4) + (level symbol :offset-assert 8) + (flags continue-flags :offset-assert 12) + (trans vector :inline :offset-assert 16) + (quat vector :inline :offset-assert 32) + (camera-trans vector :inline :offset-assert 48) + (camera-rot float 9 :offset-assert 64) + (on-goto pair :offset-assert 100) + (vis-nick symbol :offset-assert 104) + (want level-buffer-state 6 :inline :offset-assert 108) + (want-sound symbol 3 :offset-assert 204) + ) + :method-count-assert 12 + :size-assert #xd8 + :flag-assert #xc000000d8 + (:methods + (continue-point-method-9 () none 9) + (continue-point-method-10 () none 10) + (continue-point-method-11 () none 11) + ) + ) + +;; definition for method 3 of type continue-point +(defmethod inspect continue-point ((obj continue-point)) + (when (not obj) + (set! obj obj) + (goto cfg-10) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tquat: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tcamera-trans: ~`vector`P~%" (-> obj camera-trans)) + (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> obj camera-rot)) + (format #t "~1Ton-goto: ~A~%" (-> obj on-goto)) + (format #t "~1Tvis-nick: ~A~%" (-> obj vis-nick)) + (format #t "~1Twant[6] @ #x~X~%" (-> obj want)) + (dotimes (s5-0 6) + (format #t "~T [~D]~1Twant: ~`level-buffer-state`P~%" s5-0 (-> obj want s5-0)) + ) + (format #t "~1Twant-sound[3] @ #x~X~%" (-> obj want-sound)) + (dotimes (s5-1 3) + (format #t "~T [~D]~1Twant-sound: ~`symbol`P~%" s5-1 (-> obj want-sound s5-1)) + ) + (label cfg-10) + obj + ) + +;; definition of type game-info +(deftype game-info (basic) + ((mode symbol :offset-assert 4) + (save-name basic :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 uint64 :offset-assert 128) + (debug-features uint64 :offset-assert 136) + (secrets uint32 :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 uint32 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 basic :offset-assert 244) + (unknown-pad3 uint32 3 :offset-assert 248) + (task-counter uint32 :offset-assert 260) + (unknown-pad4 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 basic :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 + :flag-assert #x1f0000025c + (:methods + (initialize! (_type_ symbol game-save string) _type_ 9) + (game-info-method-10 () none 10) + (game-info-method-11 () none 11) + (game-info-method-12 () none 12) + (game-info-method-13 () none 13) + (game-info-method-14 () none 14) + (game-info-method-15 () none 15) + (copy-perms-from-level! (_type_ level) none 16) + (copy-perms-to-level! (_type_ level) none 17) + (game-info-method-18 () none 18) + (game-info-method-19 () none 19) + (game-info-method-20 () none 20) + (set-continue! (_type_ basic) continue-point 21) + (game-info-method-22 () none 22) + (game-info-method-23 () none 23) + (game-info-method-24 () none 24) + (game-info-method-25 () none 25) + (game-info-method-26 () none 26) + (get-next-attack-id (_type_) uint 27) + (game-info-method-28 () none 28) + (game-info-method-29 () none 29) + (game-info-method-30 () none 30) + ) + ) + +;; definition for method 3 of type game-info +(defmethod inspect game-info ((obj game-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmode: ~A~%" (-> obj mode)) + (format #t "~1Tsave-name: ~A~%" (-> obj save-name)) + (format #t "~1Tlife: ~f~%" (-> obj life)) + (format #t "~1Tlife-max: ~f~%" (-> obj life-max)) + (format #t "~1Tmoney: ~f~%" (-> obj money)) + (format #t "~1Tmoney-total: ~f~%" (-> obj money-total)) + (format #t "~1Tmoney-per-level[32] @ #x~X~%" (-> obj money-per-level)) + (format #t "~1Tdeaths-per-level[32] @ #x~X~%" (-> obj deaths-per-level)) + (format #t "~1Tbuzzer-total: ~f~%" (-> obj buzzer-total)) + (format #t "~1Tfuel: ~f~%" (-> obj fuel)) + (format #t "~1Tgem: ~f~%" (-> obj gem)) + (format #t "~1Tgem-total: ~f~%" (-> obj gem-total)) + (format #t "~1Tskill: ~f~%" (-> obj skill)) + (format #t "~1Tskill-total: ~f~%" (-> obj skill-total)) + (format #t "~1Tkarma: ~f~%" (-> obj karma)) + (format #t "~1Teco-pill-dark: ~f~%" (-> obj eco-pill-dark)) + (format #t "~1Teco-pill-dark-total: ~f~%" (-> obj eco-pill-dark-total)) + (format #t "~1Tfeatures: ~D~%" (-> obj features)) + (format #t "~1Tdebug-features: ~D~%" (-> obj debug-features)) + (format #t "~1Tsecrets: ~D~%" (-> obj secrets)) + (format #t "~1Tpurchase-secrets: ~D~%" (-> obj purchase-secrets)) + (format #t "~1Tgun-type: ~D~%" (-> obj gun-type)) + (format #t "~1Tgun-ammo[4] @ #x~X~%" (-> obj gun-ammo)) + (format #t "~1Tshield: ~f~%" (-> obj shield)) + (format #t "~1Tscore: ~f~%" (-> obj score)) + (format #t "~1Tscore-owner: ~D~%" (-> obj score-owner)) + (format #t "~1Ttimer: ~D~%" (-> obj timer)) + (format #t "~1Ttimer-owner: ~D~%" (-> obj timer-owner)) + (format #t "~1Ttimer-flash: ~A~%" (-> obj timer-flash)) + (format #t "~1Tcounter: ~f~%" (-> obj counter)) + (format #t "~1Tcounter-flash: ~A~%" (-> obj counter-flash)) + (format #t "~1Tattack-id: ~D~%" (-> obj attack-id)) + (format #t "~1Tperm-list: ~A~%" (-> obj perm-list)) + (format #t "~1Ttask-perm-list: ~A~%" (-> obj task-perm-list)) + (format #t "~1Tcurrent-continue: ~A~%" (-> obj current-continue)) + (format #t "~1Tlast-continue: ~A~%" (-> obj last-continue)) + (format #t "~1Ttask-counter: ~D~%" (-> obj task-counter)) + (format #t "~1Tlevel-opened[32] @ #x~X~%" (-> obj level-opened)) + (format #t "~1Ttotal-deaths: ~D~%" (-> obj total-deaths)) + (format #t "~1Tcontinue-deaths: ~D~%" (-> obj continue-deaths)) + (format #t "~1Ttask-deaths: ~D~%" (-> obj task-deaths)) + (format #t "~1Ttotal-trys: ~D~%" (-> obj total-trys)) + (format #t "~1Tgame-start-time: ~D~%" (-> obj game-start-time)) + (format #t "~1Tcontinue-time: ~D~%" (-> obj continue-time)) + (format #t "~1Tdeath-time: ~D~%" (-> obj death-time)) + (format #t "~1Thit-time: ~D~%" (-> obj hit-time)) + (format #t "~1Ttask-pickup-time: ~D~%" (-> obj task-pickup-time)) + (format #t "~1Tdeath-pos: ~A~%" (-> obj death-pos)) + (format #t "~1Tstop-watch-start: ~D~%" (-> obj stop-watch-start)) + (format #t "~1Tstop-watch-stop: ~D~%" (-> obj stop-watch-stop)) + (format #t "~1Tblackout-time: ~D~%" (-> obj blackout-time)) + (format #t "~1Tletterbox-time: ~D~%" (-> obj letterbox-time)) + (format #t "~1Thint-play-time: ~D~%" (-> obj hint-play-time)) + (format #t "~1Tdisplay-text-time: ~D~%" (-> obj display-text-time)) + (format #t "~1Tdisplay-text-handle: ~D~%" (-> obj display-text-handle)) + (format #t "~1Tdeath-movie-tick: ~D~%" (-> obj death-movie-tick)) + (format #t "~1Twant-auto-save: ~A~%" (-> obj want-auto-save)) + (format #t "~1Tauto-save-proc: ~D~%" (-> obj auto-save-proc)) + (format #t "~1Tauto-save-status: ~D~%" (-> obj auto-save-status)) + (format #t "~1Tauto-save-card: ~D~%" (-> obj auto-save-card)) + (format #t "~1Tauto-save-which: ~D~%" (-> obj auto-save-which)) + (format #t "~1Tauto-save-count: ~D~%" (-> obj auto-save-count)) + (format #t "~1Tpov-camera-handle: ~D~%" (-> obj pov-camera-handle)) + (format #t "~1Tother-camera-handle: ~D~%" (-> obj other-camera-handle)) + (format #t "~1Tcontroller[2] @ #x~X~%" (-> obj controller)) + (format #t "~1Trace-timer: ~D~%" (-> obj race-timer)) + (format #t "~1Trace-current-lap-count: ~D~%" (-> obj race-current-lap-count)) + (format #t "~1Trace-total-lap-count: ~D~%" (-> obj race-total-lap-count)) + (format #t "~1Trace-position: ~D~%" (-> obj race-position)) + (format #t "~1Trace-number-turbos: ~D~%" (-> obj race-number-turbos)) + (format #t "~1Tbot-health[3] @ #x~X~%" (-> obj bot-health)) + (format #t "~1Tdemo-state: ~D~%" (-> obj demo-state)) + (format #t "~1Twanted-flash: ~A~%" (-> obj wanted-flash)) + (format #t "~1Tdistance: ~f~%" (-> obj distance)) + (format #t "~1Tkiosk-timeout: ~D~%" (-> obj kiosk-timeout)) + (format #t "~1Tpause-start-time: ~D~%" (-> obj pause-start-time)) + (format #t "~1Tgame-score: ~A~%" (-> obj game-score)) + (format #t "~1Tgoal: ~f~%" (-> obj goal)) + (format #t "~1Tmiss: ~f~%" (-> obj miss)) + (format #t "~1Tmiss-max: ~f~%" (-> obj miss-max)) + (format #t "~1Tlive-eco-pill-count: ~D~%" (-> obj live-eco-pill-count)) + (format #t "~1Tlive-gem-count: ~D~%" (-> obj live-gem-count)) + (format #t "~1Tair-supply: ~f~%" (-> obj air-supply)) + (format #t "~1Thoming-beacon: ~D~%" (-> obj homing-beacon)) + (format #t "~1Tdark-eco-pickup: ~D~%" (-> obj dark-eco-pickup)) + (format #t "~1Tgreen-eco-pickup: ~D~%" (-> obj green-eco-pickup)) + (label cfg-4) + obj + ) + +;; definition for method 27 of type game-info +(defmethod get-next-attack-id game-info ((obj game-info)) + (let ((v0-0 (+ (-> obj attack-id) 1))) + (set! (-> obj attack-id) v0-0) + v0-0 + ) + ) + +;; failed to figure out what this is: +(set! gp-0 (when (or (not *game-info*) (zero? *game-info*)) + (set! gp-0 (new 'static 'game-info :mode 'debug :current-continue #f :last-continue #f)) + (set! (-> gp-0 unknown-array1) (the-as (array uint64) (new 'global 'boxed-array uint64 110))) + (set! (-> gp-0 unknown-array4) (the-as (array uint64) (new 'global 'boxed-array uint64 110))) + (set! (-> gp-0 unknown-array2) (the-as (array uint64) (new 'global 'boxed-array uint64 32))) + (set! (-> gp-0 unknown-array3) (the-as (array uint64) (new 'global 'boxed-array uint64 32))) + (set! *game-info* gp-0) + gp-0 + ) + ) diff --git a/test/decompiler/reference/jak2/engine/game/main-h_REF.gc b/test/decompiler/reference/jak2/engine/game/main-h_REF.gc new file mode 100644 index 0000000000..624e9d7390 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/main-h_REF.gc @@ -0,0 +1,471 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *stats-poly*, type symbol +(define *stats-poly* #f) + +;; definition for symbol *stats-memory*, type symbol +(define *stats-memory* #f) + +;; definition for symbol *stats-memory-short*, type symbol +(define *stats-memory-short* #f) + +;; definition for symbol *stats-memory-level-index*, type int +(define *stats-memory-level-index* 0) + +;; definition for symbol *stats-collide*, type symbol +(define *stats-collide* #f) + +;; definition for symbol *stats-bsp*, type symbol +(define *stats-bsp* #f) + +;; definition for symbol *stats-buffer*, type symbol +(define *stats-buffer* #f) + +;; definition for symbol *stats-target*, type symbol +(define *stats-target* #f) + +;; definition for symbol *stats-profile-bars*, type symbol +(define *stats-profile-bars* #f) + +;; definition for symbol *stats-perf*, type symbol +(define *stats-perf* #f) + +;; definition for symbol *artist-all-visible*, type symbol +(define *artist-all-visible* #f) + +;; definition for symbol *artist-flip-visible*, type symbol +(define *artist-flip-visible* #f) + +;; definition for symbol *artist-fix-visible*, type symbol +(define *artist-fix-visible* #f) + +;; definition for symbol *artist-fix-frustum*, type symbol +(define *artist-fix-frustum* #f) + +;; definition for symbol *artist-error-spheres*, type symbol +(define *artist-error-spheres* #f) + +;; definition for symbol *artist-use-menu-subdiv*, type symbol +(define *artist-use-menu-subdiv* #f) + +;; definition for symbol *display-profile*, type symbol +(define *display-profile* #t) + +;; definition for symbol *display-sidekick-stats*, type symbol +(define *display-sidekick-stats* #f) + +;; definition for symbol *display-quad-stats*, type symbol +(define *display-quad-stats* #f) + +;; definition for symbol *display-tri-stats*, type symbol +(define *display-tri-stats* #f) + +;; definition for symbol *display-ground-stats*, type symbol +(define *display-ground-stats* #f) + +;; definition for symbol *display-collision-marks*, type symbol +(define *display-collision-marks* #f) + +;; definition for symbol *display-collide-cache*, type symbol +(define *display-collide-cache* #f) + +;; definition for symbol *display-render-collision*, type symbol +(define *display-render-collision* #f) + +;; definition for symbol *display-hipri-collision-marks*, type symbol +(define *display-hipri-collision-marks* #f) + +;; definition for symbol *display-edge-collision-marks*, type symbol +(define *display-edge-collision-marks* #f) + +;; definition for symbol *display-geo-marks*, type symbol +(define *display-geo-marks* #f) + +;; definition for symbol *display-target-marks*, type symbol +(define *display-target-marks* #f) + +;; definition for symbol *target-rc-board-controls*, type symbol +(define *target-rc-board-controls* #f) + +;; definition for symbol *display-collide-history*, type int +(define *display-collide-history* 0) + +;; definition for symbol *display-xyz-axes*, type symbol +(define *display-xyz-axes* #f) + +;; definition for symbol *display-cam-collide-history*, type symbol +(define *display-cam-collide-history* #f) + +;; definition for symbol *record-cam-collide-history*, type symbol +(define *record-cam-collide-history* #f) + +;; definition for symbol *display-cam-master-marks*, type symbol +(define *display-cam-master-marks* #f) + +;; definition for symbol *display-cam-other*, type symbol +(define *display-cam-other* #f) + +;; definition for symbol *display-camera-marks*, type symbol +(define *display-camera-marks* #f) + +;; definition for symbol *camera-no-mip-correction*, type symbol +(define *camera-no-mip-correction* #f) + +;; definition for symbol *display-cam-los-info*, type symbol +(define *display-cam-los-info* #f) + +;; definition for symbol *display-cam-los-debug*, type symbol +(define *display-cam-los-debug* #f) + +;; definition for symbol *display-cam-los-marks*, type symbol +(define *display-cam-los-marks* #f) + +;; definition for symbol *display-cam-coll-marks*, type symbol +(define *display-cam-coll-marks* #f) + +;; definition for symbol *display-camera-info*, type symbol +(define *display-camera-info* #f) + +;; definition for symbol *display-camera-old-stats*, type symbol +(define *display-camera-old-stats* #f) + +;; definition for symbol *display-camera-last-attacker*, type symbol +(define *display-camera-last-attacker* #f) + +;; definition for symbol *display-file-info*, type symbol +(define *display-file-info* #f) + +;; definition for symbol *display-actor-marks*, type symbol +(define *display-actor-marks* #f) + +;; definition for symbol *display-sprite-info*, type symbol +(define *display-sprite-info* #f) + +;; definition for symbol *display-sprite-marks*, type symbol +(define *display-sprite-marks* #f) + +;; definition for symbol *display-sprite-spheres*, type symbol +(define *display-sprite-spheres* #f) + +;; definition for symbol *display-entity-errors*, type symbol +(define *display-entity-errors* #t) + +;; definition for symbol *display-instance-info*, type symbol +(define *display-instance-info* #f) + +;; definition for symbol *display-deci-count*, type symbol +(define *display-deci-count* #f) + +;; definition for symbol *sync-dma*, type symbol +(define *sync-dma* #f) + +;; definition for symbol *display-strip-lines*, type int +(define *display-strip-lines* 0) + +;; definition for symbol *display-battle-marks*, type symbol +(define *display-battle-marks* #f) + +;; definition for symbol *display-joint-axes*, type symbol +(define *display-joint-axes* #f) + +;; definition for symbol *display-nav-marks*, type symbol +(define *display-nav-marks* #f) + +;; definition for symbol *display-nav-network*, type symbol +(define *display-nav-network* #f) + +;; definition for symbol *display-path-marks*, type symbol +(define *display-path-marks* #f) + +;; definition for symbol *display-vol-marks*, type symbol +(define *display-vol-marks* #f) + +;; definition for symbol *display-water-marks*, type symbol +(define *display-water-marks* #f) + +;; definition for symbol *display-nav-mesh*, type symbol +(define *display-nav-mesh* #f) + +;; definition for symbol *display-actor-pointer*, type symbol +(define *display-actor-pointer* #f) + +;; definition for symbol *display-actor-vis*, type symbol +(define *display-actor-vis* #f) + +;; definition for symbol *display-actor-graph*, type symbol +(define *display-actor-graph* #f) + +;; definition for symbol *display-traffic-height-map*, type symbol +(define *display-traffic-height-map* #f) + +;; definition for symbol *display-trail-graph*, type symbol +(define *display-trail-graph* #f) + +;; definition for symbol *display-color-bars*, type symbol +(define *display-color-bars* #f) + +;; definition for symbol *display-bug-report*, type symbol +(define *display-bug-report* #f) + +;; definition for symbol *display-level-border*, type symbol +(define *display-level-border* #f) + +;; definition for symbol *display-memcard-info*, type symbol +(define *display-memcard-info* #f) + +;; definition for symbol *display-split-boxes*, type symbol +(define *display-split-boxes* #f) + +;; definition for symbol *display-split-box-info*, type symbol +(define *display-split-box-info* #f) + +;; definition for symbol *display-texture-distances*, type symbol +(define *display-texture-distances* #f) + +;; definition for symbol *display-texture-download*, type symbol +(define *display-texture-download* #f) + +;; definition for symbol *display-art-control*, type symbol +(define *display-art-control* #f) + +;; definition for symbol *display-gui-control*, type symbol +(define *display-gui-control* #f) + +;; definition for symbol *display-level-spheres*, type symbol +(define *display-level-spheres* #f) + +;; definition for symbol *time-of-day-fast*, type symbol +(define *time-of-day-fast* #f) + +;; definition for symbol *display-iop-info*, type symbol +(define *display-iop-info* #f) + +;; definition for symbol *ambient-sound-class*, type symbol +(define *ambient-sound-class* #t) + +;; definition for symbol *slow-frame-rate*, type symbol +(define *slow-frame-rate* #f) + +;; definition for symbol *display-region-marks*, type symbol +(define *display-region-marks* #f) + +;; definition for symbol *execute-regions*, type symbol +(define *execute-regions* #t) + +;; definition for symbol *debug-pause*, type symbol +(define *debug-pause* #f) + +;; definition for symbol *debug-view-anims*, type symbol +(define *debug-view-anims* #f) + +;; definition for symbol *debug-unkillable*, type symbol +(define *debug-unkillable* #f) + +;; definition for symbol *debug-actor*, type object +(define *debug-actor* (the-as object #f)) + +;; definition for symbol *gun-marks*, type symbol +(define *gun-marks* #f) + +;; definition for symbol *bug-report-output-mode*, type symbol +(define *bug-report-output-mode* (if *debug-segment* + 'file-stream + '*stdcon* + ) + ) + +;; definition for symbol *display-scene-control*, type int +(define *display-scene-control* 0) + +;; definition for symbol *display-bot-marks*, type int +(define *display-bot-marks* 0) + +;; definition for symbol *display-race-marks*, type int +(define *display-race-marks* 0) + +;; definition for symbol *race-record-path*, type symbol +(define *race-record-path* #f) + +;; definition for symbol *select-race*, type int +(define *select-race* 0) + +;; definition for symbol *select-race-path*, type int +(define *select-race-path* 0) + +;; definition for symbol *bot-record-path*, type int +(define *bot-record-path* -1) + +;; definition for symbol *subdivide-draw-mode*, type int +(define *subdivide-draw-mode* 0) + +;; definition for symbol *subdivide-scissor-draw-mode*, type int +(define *subdivide-scissor-draw-mode* 0) + +;; definition for symbol *subdivide-foreground-draw-mode*, type int +(define *subdivide-foreground-draw-mode* 0) + +;; definition for symbol *subdivide-ocean-draw-mode*, type int +(define *subdivide-ocean-draw-mode* 0) + +;; definition for symbol *ocean-height-hack*, type int +(define *ocean-height-hack* 0) + +;; definition (perm) for symbol *dproc*, type process +(define-perm *dproc* process #f) + +;; definition for symbol *run*, type symbol +(define *run* #f) + +;; definition for symbol *teleport*, type symbol +(define *teleport* #f) + +;; definition for symbol *teleport-count*, type int +(define *teleport-count* 0) + +;; definition for symbol *draw-hook*, type (function none) +(define *draw-hook* nothing) + +;; definition for symbol *debug-hook*, type pair +(define *debug-hook* '()) + +;; definition for symbol *menu-hook*, type (function debug-menu-context) +(define *menu-hook* (the-as (function debug-menu-context) nothing)) + +;; definition for symbol *progress-hook*, type (function none) +(define *progress-hook* nothing) + +;; definition for symbol *dma-timeout-hook*, type (function none) +(define *dma-timeout-hook* nothing) + +;; definition of type frame-stats +(deftype frame-stats (structure) + ((field-time time-frame 2 :offset-assert 0) + (field int32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type frame-stats +(defmethod inspect frame-stats ((obj frame-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'frame-stats) + (format #t "~1Tfield-time[2] @ #x~X~%" (-> obj field-time)) + (format #t "~1Tfield: ~D~%" (-> obj field)) + (label cfg-4) + obj + ) + +;; definition for symbol *frame-stats*, type frame-stats +(define *frame-stats* (new 'static 'frame-stats)) + +;; definition of type screen-filter +(deftype screen-filter (basic) + ((draw? symbol :offset-assert 4) + (bucket bucket-id :offset-assert 8) + (color vector :inline :offset-assert 16) + (color-src vector :inline :offset-assert 32) + (color-dest vector :inline :offset-assert 48) + (extra vector :inline :offset-assert 64) + (speed float :offset 64) + (current-interp float :offset 68) + ) + :method-count-assert 12 + :size-assert #x50 + :flag-assert #xc00000050 + (:methods + (draw (_type_) none 9) + (setup (_type_ vector vector float bucket-id) none 10) + (disable (_type_) none 11) + ) + ) + +;; definition for method 3 of type screen-filter +(defmethod inspect screen-filter ((obj screen-filter)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdraw?: ~A~%" (-> obj draw?)) + (format #t "~1Tbucket: ~D~%" (-> obj bucket)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tcolor-src: #~%" (-> obj color-src)) + (format #t "~1Tcolor-dest: #~%" (-> obj color-dest)) + (format #t "~1Textra: #~%" (-> obj extra)) + (format #t "~1Tspeed: ~f~%" (-> obj extra x)) + (format #t "~1Tcurrent-interp: ~f~%" (-> obj extra y)) + (label cfg-4) + obj + ) + +;; definition of type col-rend +(deftype col-rend (basic) + ((draw? symbol :offset-assert 4) + (outline? symbol :offset-assert 8) + (show-back-faces? symbol :offset-assert 12) + (show-normals? symbol :offset-assert 16) + (ghost-hidden? symbol :offset-assert 20) + (show-only uint32 :offset-assert 24) + (cspec uint32 :offset-assert 28) + (track uint8 :offset-assert 32) + (bbox-radius float :offset-assert 36) + (bbox-center vector :inline :offset-assert 48) + (camera-to-bbox-dist float :offset-assert 64) + ) + :method-count-assert 10 + :size-assert #x44 + :flag-assert #xa00000044 + (:methods + (col-rend-method-9 () none 9) + ) + ) + +;; definition for method 3 of type col-rend +(defmethod inspect col-rend ((obj col-rend)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdraw?: ~A~%" (-> obj draw?)) + (format #t "~1Toutline?: ~A~%" (-> obj outline?)) + (format #t "~1Tshow-back-faces?: ~A~%" (-> obj show-back-faces?)) + (format #t "~1Tshow-normals?: ~A~%" (-> obj show-normals?)) + (format #t "~1Tghost-hidden?: ~A~%" (-> obj ghost-hidden?)) + (format #t "~1Tshow-only: ~D~%" (-> obj show-only)) + (format #t "~1Tcspec: ~D~%" (-> obj cspec)) + (format #t "~1Ttrack: ~D~%" (-> obj track)) + (format #t "~1Tbbox-radius: ~f~%" (-> obj bbox-radius)) + (format #t "~1Tbbox-center: #~%" (-> obj bbox-center)) + (format #t "~1Tcamera-to-bbox-dist: ~f~%" (-> obj camera-to-bbox-dist)) + (label cfg-4) + obj + ) + +;; definition for symbol *col-rend*, type col-rend +(define *col-rend* (new 'static 'col-rend + :draw? #f + :outline? #t + :show-back-faces? #t + :show-normals? #f + :ghost-hidden? #t + :cspec #x38 + :track #x1 + :bbox-radius 24576.0 + :camera-to-bbox-dist 65536.0 + ) + ) + +;; definition (debug) for function debug-actor? +(defun-debug debug-actor? ((arg0 object)) + (= arg0 *debug-actor*) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc b/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc new file mode 100644 index 0000000000..dc2ad46c44 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/penetrate-h_REF.gc @@ -0,0 +1,122 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function penetrate-using->damage +(defun penetrate-using->damage ((arg0 penetrate)) + (cond + ((logtest? (penetrate dark-bomb dark-giant) arg0) + 15 + ) + ((logtest? arg0 (penetrate mech-punch mech-bonk)) + 5 + ) + ((logtest? (penetrate) arg0) + 4 + ) + ((logtest? (penetrate punch spin jak-dark-shot enemy-dark-shot) arg0) + 3 + ) + ((logtest? (penetrate + flop + uppercut + tube + flut-attack + dark-punch + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + enemy-yellow-shot + eco-yellow + ) + arg0 + ) + 2 + ) + ((logtest? arg0 (penetrate generic-attack roll bonk board)) + 1 + ) + (else + 0 + ) + ) + ) + +;; definition for function penetrated-by-all&hit-points->penetrated-by +;; INFO: Return type mismatch uint vs penetrate. +(defun penetrated-by-all&hit-points->penetrated-by ((arg0 penetrate) (arg1 int)) + (let ((a0-1 arg1)) + (the-as penetrate (logior (logclear arg0 (penetrate + generic-attack + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-giant + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + knocked + ) + ) + (cond + ((or (zero? a0-1) (= a0-1 1)) + (the-as int (the-as uint #x11fffdffa)) + ) + ((= a0-1 2) + #x1feeceb8 + ) + ((= a0-1 3) + #xa0cc430 + ) + ((= a0-1 4) + #xcc400 + ) + ((= a0-1 5) + #xcc400 + ) + ((or (= a0-1 6) + (= a0-1 7) + (= a0-1 8) + (= a0-1 9) + (= a0-1 10) + (= a0-1 11) + (= a0-1 12) + (= a0-1 13) + (= a0-1 14) + (= a0-1 15) + ) + #xc0400 + ) + (else + 1024 + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc new file mode 100644 index 0000000000..a2c623b33e --- /dev/null +++ b/test/decompiler/reference/jak2/engine/game/settings-h_REF.gc @@ -0,0 +1,601 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type user-setting-data +(deftype user-setting-data (structure) + ((border-mode symbol :offset-assert 0) + (process-mask process-mask :offset-assert 4) + (language language-enum :offset 16) + (movie (pointer process) :offset 40) + (talking (pointer process) :offset-assert 44) + (spooling (pointer process) :offset-assert 48) + (hint (pointer process) :offset-assert 52) + (ambient (pointer process) :offset-assert 56) + (video-mode symbol :offset-assert 60) + (aspect-ratio symbol :offset-assert 64) + (auto-save symbol :offset 72) + (bg-r float :offset-assert 76) + (bg-g float :offset-assert 80) + (bg-b float :offset-assert 84) + (bg-a float :offset-assert 88) + (bg-a-speed float :offset-assert 92) + (bg-a-force float :offset-assert 96) + (allow-progress symbol :offset-assert 100) + (allow-pause symbol :offset-assert 104) + (movie-name symbol :offset 120) + (weather symbol :offset-assert 124) + (task-mask task-mask :offset 136) + (duck symbol :offset 144) + (attack symbol :offset-assert 148) + (gun symbol :offset-assert 152) + (board symbol :offset-assert 156) + (jump symbol :offset-assert 160) + (speed-mult float :offset-assert 164) + (features uint64 :offset-assert 168) + (sfx-volume float :offset-assert 176) + (sfx-movie-volume float :offset-assert 180) + (music-volume float :offset-assert 184) + (music-volume-movie float :offset-assert 188) + (dialog-volume float :offset-assert 192) + (dialog-volume-hint float :offset-assert 196) + (ambient-volume float :offset-assert 200) + (ambient-volume-move float :offset-assert 204) + (sound-flava uint8 :offset-assert 208) + (sound-flava-priority float :offset-assert 212) + (mode-sound-bank uint32 :offset-assert 216) + (sound-excitement float :offset-assert 220) + (sound-reverb float :offset-assert 224) + (stereo-mode int32 :offset-assert 228) + (music symbol :offset-assert 232) + (sound-stinger int32 :offset-assert 236) + (spool-anim symbol :offset-assert 240) + (sound-mode uint32 :offset-assert 244) + (task-manager (pointer process) :offset-assert 248) + (task symbol :offset-assert 252) + (airlock symbol :offset-assert 256) + (minimap uint16 :offset-assert 260) + (sound-tune uint32 :offset-assert 264) + (allow-continue symbol :offset-assert 268) + (spotlight-color rgba :offset-assert 272) + (subtitle symbol :offset-assert 276) + (borrow symbol :offset-assert 280) + (doorway symbol :offset-assert 284) + (gen symbol :offset-assert 288) + (half-speed symbol :offset-assert 292) + (gun-buoy symbol :offset-assert 296) + (double-jump symbol :offset-assert 300) + (pilot symbol :offset-assert 304) + (pilot-exit symbol :offset-assert 308) + (exclusive-task int32 :offset-assert 312) + (speech-control symbol :offset-assert 316) + (vehicle-hijacking symbol :offset-assert 320) + (darkjak symbol :offset-assert 324) + (endlessfall symbol :offset-assert 328) + (rain float :offset-assert 332) + (snow float :offset-assert 336) + (exclusive-load symbol :offset-assert 340) + (render symbol :offset-assert 344) + (allow-timeout symbol :offset-assert 348) + (mirror symbol :offset-assert 352) + (movie-skip-frame float :offset-assert 356) + (allow-blackout symbol :offset-assert 360) + (race-minimap int32 :offset-assert 364) + (extra-bank symbol :offset-assert 368) + (beard symbol :offset-assert 372) + (ignore-target symbol :offset-assert 376) + (subtitle-language language-enum :offset-assert 384) + (sound-bank-load symbol :offset-assert 392) + (allow-error symbol :offset-assert 396) + (under-water-pitch-mod float :offset-assert 400) + (dummy object 31 :offset-assert 404) + ) + :method-count-assert 11 + :size-assert #x210 + :flag-assert #xb00000210 + (:methods + (user-setting-data-method-9 () none 9) + (user-setting-data-method-10 () none 10) + ) + ) + +;; definition for method 3 of type user-setting-data +(defmethod inspect user-setting-data ((obj user-setting-data)) + (when (not obj) + (set! obj obj) + (goto cfg-71) + ) + (format #t "[~8x] ~A~%" obj 'user-setting-data) + (format #t "~1Tborder-mode: ~A~%" (-> obj border-mode)) + (format #t "~1Tprocess-mask: #x~X~%" (-> obj process-mask)) + (let ((t9-3 format) + (a0-4 #t) + (a1-3 "~1Tlanguage: #x~X : ~S~%") + (a2-3 (-> obj language)) + (v1-2 (-> obj language)) + ) + (t9-3 a0-4 a1-3 a2-3 (cond + ((= v1-2 (language-enum english)) + "english" + ) + ((= v1-2 (language-enum uk-english)) + "uk-english" + ) + ((= v1-2 (language-enum french)) + "french" + ) + ((= v1-2 (language-enum korean)) + "korean" + ) + ((= v1-2 (language-enum german)) + "german" + ) + ((= v1-2 (language-enum spanish)) + "spanish" + ) + ((= v1-2 (language-enum italian)) + "italian" + ) + ((= v1-2 (language-enum japanese)) + "japanese" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tmovie: ~A~%" (ppointer->process (-> obj movie))) + (format #t "~1Ttalking: ~A~%" (ppointer->process (-> obj talking))) + (format #t "~1Tspooling: ~A~%" (ppointer->process (-> obj spooling))) + (format #t "~1Thint: ~A~%" (ppointer->process (-> obj hint))) + (format #t "~1Tambient: ~A~%" (ppointer->process (-> obj ambient))) + (format #t "~1Tvideo-mode: ~A~%" (-> obj video-mode)) + (format #t "~1Taspect-ratio: ~A~%" (-> obj aspect-ratio)) + (format #t "~1Tauto-save: ~A~%" (-> obj auto-save)) + (format #t "~1Tbg-r: ~f~%" (-> obj bg-r)) + (format #t "~1Tbg-g: ~f~%" (-> obj bg-g)) + (format #t "~1Tbg-b: ~f~%" (-> obj bg-b)) + (format #t "~1Tbg-a: ~f~%" (-> obj bg-a)) + (format #t "~1Tbg-a-speed: ~f~%" (-> obj bg-a-speed)) + (format #t "~1Tbg-a-force: ~f~%" (-> obj bg-a-force)) + (format #t "~1Tallow-progress: ~A~%" (-> obj allow-progress)) + (format #t "~1Tallow-pause: ~A~%" (-> obj allow-pause)) + (format #t "~1Tmovie-name: ~A~%" (-> obj movie-name)) + (format #t "~1Tweather: ~A~%" (-> obj weather)) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) + (let ((s5-0 (-> obj task-mask))) + (if (= (logand s5-0 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-0 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-0 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-0 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-0 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-0 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-0) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-0 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-0 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-0 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-0 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-0 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-0 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-0) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-0 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-0 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-0 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-0) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-0 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Tduck: ~A~%" (-> obj duck)) + (format #t "~1Tattack: ~A~%" (-> obj attack)) + (format #t "~1Tgun: ~A~%" (-> obj gun)) + (format #t "~1Tboard: ~A~%" (-> obj board)) + (format #t "~1Tjump: ~A~%" (-> obj jump)) + (format #t "~1Tspeed-mult: ~f~%" (-> obj speed-mult)) + (format #t "~1Tfeatures: ~D~%" (-> obj features)) + (format #t "~1Tsfx-volume: ~f~%" (-> obj sfx-volume)) + (format #t "~1Tsfx-volume-movie: ~f~%" (-> obj sfx-movie-volume)) + (format #t "~1Tmusic-volume: ~f~%" (-> obj music-volume)) + (format #t "~1Tmusic-volume-movie: ~f~%" (-> obj music-volume-movie)) + (format #t "~1Tdialog-volume: ~f~%" (-> obj dialog-volume)) + (format #t "~1Tdialog-volume-hint: ~f~%" (-> obj dialog-volume-hint)) + (format #t "~1Tambient-volume: ~f~%" (-> obj ambient-volume)) + (format #t "~1Tambient-volume-movie: ~f~%" (-> obj ambient-volume-move)) + (format #t "~1Tsound-flava: ~D~%" (-> obj sound-flava)) + (format #t "~1Tsound-flava-priority: ~f~%" (-> obj sound-flava-priority)) + (format #t "~1Tmode-sound-bank: ~A~%" (-> obj mode-sound-bank)) + (format #t "~1Tsound-excitement: ~f~%" (-> obj sound-excitement)) + (format #t "~1Tsound-reverb: ~f~%" (-> obj sound-reverb)) + (format #t "~1Tstereo-mode: ~D~%" (-> obj stereo-mode)) + (format #t "~1Tmusic: ~A~%" (-> obj music)) + (format #t "~1Tsound-stinger: ~D~%" (-> obj sound-stinger)) + (format #t "~1Tspool-anim: ~A~%" (-> obj spool-anim)) + (format #t "~1Tsound-mode: ~D~%" (-> obj sound-mode)) + (format #t "~1Ttask-manager: ~A~%" (ppointer->process (-> obj task-manager))) + (format #t "~1Ttask: ~A~%" (-> obj task)) + (format #t "~1Tairlock: ~A~%" (-> obj airlock)) + (format #t "~1Tminimap: ~D~%" (-> obj minimap)) + (format #t "~1Tsound-tune: ~D~%" (-> obj sound-tune)) + (format #t "~1Tallow-continue: ~A~%" (-> obj allow-continue)) + (format #t "~1Tspotlight-color: ~D~%" (-> obj spotlight-color)) + (format #t "~1Tsubtitle: ~A~%" (-> obj subtitle)) + (format #t "~1Tborrow: ~A~%" (-> obj borrow)) + (format #t "~1Tdoorway: ~A~%" (-> obj doorway)) + (format #t "~1Tgem: ~A~%" (-> obj gen)) + (format #t "~1Thalf-speed: ~A~%" (-> obj half-speed)) + (format #t "~1Tgun-buoy: ~A~%" (-> obj gun-buoy)) + (format #t "~1Tdouble-jump: ~A~%" (-> obj double-jump)) + (format #t "~1Tpilot: ~A~%" (-> obj pilot)) + (format #t "~1Tpilot-exit: ~A~%" (-> obj pilot-exit)) + (format #t "~1Texclusive-task: ~D~%" (-> obj exclusive-task)) + (format #t "~1Tspeech-control: ~A~%" (-> obj speech-control)) + (format #t "~1Tvehicle-hijacking: ~A~%" (-> obj vehicle-hijacking)) + (format #t "~1Tdarkjak: ~A~%" (-> obj darkjak)) + (format #t "~1Tendlessfall: ~A~%" (-> obj endlessfall)) + (format #t "~1Train: ~f~%" (-> obj rain)) + (format #t "~1Tsnow: ~f~%" (-> obj snow)) + (format #t "~1Texclusive-load: ~A~%" (-> obj exclusive-load)) + (format #t "~1Trender: ~A~%" (-> obj render)) + (format #t "~1Tallow-timeout: ~A~%" (-> obj allow-timeout)) + (format #t "~1Tmirror: ~A~%" (-> obj mirror)) + (format #t "~1Tmovie-skip-frame: ~f~%" (-> obj movie-skip-frame)) + (format #t "~1Tallow-blackout: ~A~%" (-> obj allow-blackout)) + (format #t "~1Trace-minimap: ~D~%" (-> obj race-minimap)) + (format #t "~1Textra-bank: ~A~%" (-> obj extra-bank)) + (format #t "~1Tbeard: ~A~%" (-> obj beard)) + (format #t "~1Tignore-target: ~A~%" (-> obj ignore-target)) + (format #t "~1Tsubtitle-language: ~D~%" (-> obj subtitle-language)) + (format #t "~1Tsound-bank-load: ~A~%" (-> obj sound-bank-load)) + (format #t "~1Tallow-error: ~A~%" (-> obj allow-error)) + (format #t "~1Tunder-water-pitch-mod: ~f~%" (-> obj under-water-pitch-mod)) + (format #t "~1Tdummy[31] @ #x~X~%" (-> obj dummy)) + (label cfg-71) + obj + ) + +;; definition of type cam-setting-data +(deftype cam-setting-data (structure) + ((fov degrees :offset-assert 0) + (pov-handle handle :offset 16) + (pov-bone int32 :offset-assert 24) + (pov-offset vector :inline :offset-assert 32) + (string-default symbol :offset-assert 48) + (string-max-length meters :offset-assert 52) + (string-min-length meters :offset-assert 56) + (string-max-height meters :offset-assert 60) + (string-min-height meters :offset-assert 64) + (string-cliff-height meters :offset-assert 68) + (string-camera-ceiling meters :offset-assert 72) + (gun-max-height meters :offset-assert 76) + (gun-min-height meters :offset-assert 80) + (string-local-down vector :inline :offset-assert 96) + (slave-options cam-slave-options :offset-assert 112) + (matrix-blend-max-angle degrees :offset-assert 120) + (matrix-blend-max-partial float :offset-assert 124) + (string-spline-max-move meters :offset-assert 128) + (string-spline-accel meters :offset-assert 132) + (string-spline-max-move-player meters :offset-assert 136) + (string-spline-accel-player meters :offset-assert 140) + (string-startup-vector vector :inline :offset-assert 144) + (string-use-startup-vector symbol :offset-assert 160) + (look-at-point vector :inline :offset-assert 176) + (use-look-at-point symbol :offset-assert 192) + (target-height meters :offset-assert 196) + (foot-offset meters :offset-assert 200) + (head-offset meters :offset-assert 204) + (teleport-on-entity-change symbol :offset-assert 208) + (entity-name string :offset-assert 212) + (entity-or-mode-changed symbol :offset-assert 216) + (master-options cam-master-options :offset-assert 224) + (entity-mask uint32 :offset-assert 232) + (mode-name symbol :offset-assert 236) + (real-entity-name string :offset-assert 240) + (cam-mode symbol :offset-assert 244) + (interp-time uint32 :offset-assert 248) + (no-intro symbol :offset-assert 252) + (use-point-of-interest symbol :offset-assert 256) + (point-of-interest vector :inline :offset-assert 272) + (handle-of-interest handle :offset-assert 288) + (mouse-tumble-point vector :inline :offset-assert 304) + (use-mouse-tumble-point symbol :offset-assert 320) + (mouse-input symbol :offset-assert 324) + (cpad1-skip-buttons symbol :offset-assert 328) + (butt-handle handle :offset-assert 336) + (butt-angle float :offset-assert 344) + (extra-follow-height float :offset-assert 348) + (1Tinterp-time-priority uint32 :offset-assert 352) + (string-max-length-default symbol :offset-assert 356) + (string-min-length-default symbol :offset-assert 360) + (string-max-height-default symbol :offset-assert 364) + (string-min-height-default symbol :offset-assert 368) + (dummy object 102 :offset-assert 372) + ) + :method-count-assert 11 + :size-assert #x30c + :flag-assert #xb0000030c + (:methods + (cam-setting-data-method-9 () none 9) + (cam-setting-data-method-10 () none 10) + ) + ) + +;; definition for method 3 of type cam-setting-data +(defmethod inspect cam-setting-data ((obj cam-setting-data)) + (when (not obj) + (set! obj obj) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" obj 'cam-setting-data) + (format #t "~1Tfov: (deg ~r)~%" (-> obj fov)) + (format #t "~1Tpov-handle: ~D~%" (-> obj pov-handle)) + (format #t "~1Tpov-bone: ~D~%" (-> obj pov-bone)) + (format #t "~1Tpov-offset: ~`vector`P~%" (-> obj pov-offset)) + (format #t "~1Tstring-default: ~`boolean`P~%" (-> obj string-default)) + (format #t "~1Tstring-max-length: (meters ~m)~%" (-> obj string-max-length)) + (format #t "~1Tstring-min-length: (meters ~m)~%" (-> obj string-min-length)) + (format #t "~1Tstring-max-height: (meters ~m)~%" (-> obj string-max-height)) + (format #t "~1Tstring-min-height: (meters ~m)~%" (-> obj string-min-height)) + (format #t "~1Tstring-cliff-height: (meters ~m)~%" (-> obj string-cliff-height)) + (format #t "~1Tstring-camera-ceiling: (meters ~m)~%" (-> obj string-camera-ceiling)) + (format #t "~1Tgun-max-height: (meters ~m)~%" (-> obj gun-max-height)) + (format #t "~1Tgun-min-height: (meters ~m)~%" (-> obj gun-min-height)) + (format #t "~1Tstring-local-down: ~`vector`P~%" (-> obj string-local-down)) + (format #t "~1Tslave-options: #x~X : (cam-slave-options " (-> obj slave-options)) + (let ((s5-0 (-> obj slave-options))) + (if (= (logand s5-0 (cam-slave-options SAME_SIDE)) (cam-slave-options SAME_SIDE)) + (format #t "SAME_SIDE ") + ) + (if (= (logand (cam-slave-options GUN_CAM) s5-0) (cam-slave-options GUN_CAM)) + (format #t "GUN_CAM ") + ) + (if (= (logand s5-0 (cam-slave-options STICKY_ANGLE)) (cam-slave-options STICKY_ANGLE)) + (format #t "STICKY_ANGLE ") + ) + (if (= (logand s5-0 (cam-slave-options FIND_HIDDEN_TARGET)) (cam-slave-options FIND_HIDDEN_TARGET)) + (format #t "FIND_HIDDEN_TARGET ") + ) + (if (= (logand (cam-slave-options RAPID_TRACKING) s5-0) (cam-slave-options RAPID_TRACKING)) + (format #t "RAPID_TRACKING ") + ) + (if (= (logand s5-0 (cam-slave-options SHRINK_MAX_ANGLE)) (cam-slave-options SHRINK_MAX_ANGLE)) + (format #t "SHRINK_MAX_ANGLE ") + ) + (if (= (logand s5-0 (cam-slave-options JUMP_PITCHES)) (cam-slave-options JUMP_PITCHES)) + (format #t "JUMP_PITCHES ") + ) + (if (= (logand s5-0 (cam-slave-options LINE_OF_SIGHT)) (cam-slave-options LINE_OF_SIGHT)) + (format #t "LINE_OF_SIGHT ") + ) + (if (= (logand s5-0 (cam-slave-options PLAYER_MOVING_CAMERA)) (cam-slave-options PLAYER_MOVING_CAMERA)) + (format #t "PLAYER_MOVING_CAMERA ") + ) + (if (= (logand (cam-slave-options ALLOW_SHIFT_BUTTONS) s5-0) (cam-slave-options ALLOW_SHIFT_BUTTONS)) + (format #t "ALLOW_SHIFT_BUTTONS ") + ) + (if (= (logand s5-0 (cam-slave-options NO_ROTATE)) (cam-slave-options NO_ROTATE)) + (format #t "NO_ROTATE ") + ) + (if (= (logand (cam-slave-options WIDE_FOV) s5-0) (cam-slave-options WIDE_FOV)) + (format #t "WIDE_FOV ") + ) + (if (= (logand s5-0 (cam-slave-options MOVE_SPHERICAL)) (cam-slave-options MOVE_SPHERICAL)) + (format #t "MOVE_SPHERICAL ") + ) + (if (= (logand s5-0 (cam-slave-options DRAG)) (cam-slave-options DRAG)) + (format #t "DRAG ") + ) + (if (= (logand s5-0 (cam-slave-options MOVEMENT_BLOCKED)) (cam-slave-options MOVEMENT_BLOCKED)) + (format #t "MOVEMENT_BLOCKED ") + ) + (if (= (logand (cam-slave-options BLOCK_RIGHT_STICK) s5-0) (cam-slave-options BLOCK_RIGHT_STICK)) + (format #t "BLOCK_RIGHT_STICK ") + ) + (if (= (logand s5-0 (cam-slave-options COLLIDE)) (cam-slave-options COLLIDE)) + (format #t "COLLIDE ") + ) + (if (= (logand s5-0 (cam-slave-options ALLOW_Z_ROT)) (cam-slave-options ALLOW_Z_ROT)) + (format #t "ALLOW_Z_ROT ") + ) + (if (= (logand s5-0 (cam-slave-options BIKE_MODE)) (cam-slave-options BIKE_MODE)) + (format #t "BIKE_MODE ") + ) + (if (= (logand (cam-slave-options EASE_SPLINE_IDX) s5-0) (cam-slave-options EASE_SPLINE_IDX)) + (format #t "EASE_SPLINE_IDX ") + ) + (if (= (logand s5-0 (cam-slave-options GOTO_GOOD_POINT)) (cam-slave-options GOTO_GOOD_POINT)) + (format #t "GOTO_GOOD_POINT ") + ) + (if (= (logand s5-0 (cam-slave-options BUTT_CAM)) (cam-slave-options BUTT_CAM)) + (format #t "BUTT_CAM ") + ) + (if (= (logand (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA) s5-0) + (cam-slave-options VERTICAL_FOLLOW_MATCHES_CAMERA) + ) + (format #t "VERTICAL_FOLLOW_MATCHES_CAMERA ") + ) + (if (= (logand (cam-slave-options HAVE_BUTT_HANDLE) s5-0) (cam-slave-options HAVE_BUTT_HANDLE)) + (format #t "HAVE_BUTT_HANDLE ") + ) + ) + (format #t ")~%") + (format #t "~1Tmatrix-blend-max-angle: (deg ~r)~%" (-> obj matrix-blend-max-angle)) + (format #t "~1Tmatrix-blend-max-partial: ~f~%" (-> obj matrix-blend-max-partial)) + (format #t "~1Tstring-spline-max-move: (meters ~m)~%" (-> obj string-spline-max-move)) + (format #t "~1Tstring-spline-accel: (meters ~m)~%" (-> obj string-spline-accel)) + (format #t "~1Tstring-spline-max-move-player: (meters ~m)~%" (-> obj string-spline-max-move-player)) + (format #t "~1Tstring-spline-accel-player: (meters ~m)~%" (-> obj string-spline-accel-player)) + (format #t "~1Tstring-startup-vector: ~`vector`P~%" (-> obj string-startup-vector)) + (format #t "~1Tuse-string-startup-vector: ~A~%" (-> obj string-use-startup-vector)) + (format #t "~1Tlook-at-point: ~`vector`P~%" (-> obj look-at-point)) + (format #t "~1Tuse-look-at-point: ~A~%" (-> obj use-look-at-point)) + (format #t "~1Ttarget-height: (meters ~m)~%" (-> obj target-height)) + (format #t "~1Tfoot-offset: (meters ~m)~%" (-> obj foot-offset)) + (format #t "~1Thead-offset: (meters ~m)~%" (-> obj head-offset)) + (format #t "~1Tteleport-on-entity-change: ~`boolean`P~%" (-> obj teleport-on-entity-change)) + (format #t "~1Tentity-name: ~`string`P~%" (-> obj entity-name)) + (format #t "~1Tentity-or-mode-changed: ~`boolean`P~%" (-> obj entity-or-mode-changed)) + (format #t "~1Tmaster-options: #x~X : (cam-master-options " (-> obj master-options)) + (let ((s5-1 (-> obj master-options))) + (if (= (logand s5-1 (cam-master-options IMMEDIATE_STRING_MIN_MAX)) (cam-master-options IMMEDIATE_STRING_MIN_MAX)) + (format #t "IMMEDIATE_STRING_MIN_MAX ") + ) + (if (= (logand s5-1 (cam-master-options IN_BASE_REGION)) (cam-master-options IN_BASE_REGION)) + (format #t "IN_BASE_REGION ") + ) + (if (= (logand s5-1 (cam-master-options FLIP_COMBINER)) (cam-master-options FLIP_COMBINER)) + (format #t "FLIP_COMBINER ") + ) + (if (= (logand s5-1 (cam-master-options SET_COMBINER_AXIS)) (cam-master-options SET_COMBINER_AXIS)) + (format #t "SET_COMBINER_AXIS ") + ) + (if (= (logand s5-1 (cam-master-options IGNORE_ANALOG)) (cam-master-options IGNORE_ANALOG)) + (format #t "IGNORE_ANALOG ") + ) + (if (= (logand s5-1 (cam-master-options READ_BUTTONS)) (cam-master-options READ_BUTTONS)) + (format #t "READ_BUTTONS ") + ) + (if (= (logand s5-1 (cam-master-options HAVE_TARGET)) (cam-master-options HAVE_TARGET)) + (format #t "HAVE_TARGET ") + ) + (if (= (logand s5-1 (cam-master-options HAVE_EASE_TO_POS)) (cam-master-options HAVE_EASE_TO_POS)) + (format #t "HAVE_EASE_TO_POS ") + ) + ) + (format #t ")~%") + (format #t "~1Tentity-mask: ~D~%" (-> obj entity-mask)) + (format #t "~1Tmode-name: ~A~%" (-> obj mode-name)) + (format #t "~1Treal-entity-name: ~`string`P~%" (-> obj real-entity-name)) + (format #t "~1Tcam-mode: ~A~%" (-> obj cam-mode)) + (format #t "~1Tinterp-time: ~D~%" (-> obj interp-time)) + (format #t "~1Tno-intro: ~A~%" (-> obj no-intro)) + (format #t "~1Tuse-point-of-interest: ~A~%" (-> obj use-point-of-interest)) + (format #t "~1Tpoint-of-interest: ~`vector`P~%" (-> obj point-of-interest)) + (format #t "~1Thandle-of-interest: ~D~%" (-> obj handle-of-interest)) + (format #t "~1Tmouse-tumble-point: ~`vector`P~%" (-> obj mouse-tumble-point)) + (format #t "~1Tuse-mouse-tumble-point: ~A~%" (-> obj use-mouse-tumble-point)) + (format #t "~1Tmouse-input: ~A~%" (-> obj mouse-input)) + (format #t "~1Tcpad1-skip-buttons: ~A~%" (-> obj cpad1-skip-buttons)) + (format #t "~1Tbutt-handle: ~D~%" (-> obj butt-handle)) + (format #t "~1Tbutt-angle: ~f~%" (-> obj butt-angle)) + (format #t "~1Textra-follow-height: ~f~%" (-> obj extra-follow-height)) + (format #t "~1Tinterp-time-priority: ~D~%" (-> obj 1Tinterp-time-priority)) + (format #t "~1Tstring-max-length-default: ~A~%" (-> obj string-max-length-default)) + (format #t "~1Tstring-min-length-default: ~A~%" (-> obj string-min-length-default)) + (format #t "~1Tstring-max-height-default: ~A~%" (-> obj string-max-height-default)) + (format #t "~1Tstring-min-height-default: ~A~%" (-> obj string-min-height-default)) + (format #t "~1Tdummy[102] @ #x~X~%" (-> obj dummy)) + (label cfg-68) + obj + ) + +;; definition of type setting-control +(deftype setting-control (basic) + ((user-current user-setting-data :inline :offset-assert 16) + (user-target user-setting-data :inline :offset-assert 544) + (user-default user-setting-data :inline :offset-assert 1072) + (cam-current cam-setting-data :inline :offset-assert 1600) + (cam-target cam-setting-data :inline :offset-assert 2384) + (cam-default cam-setting-data :inline :offset-assert 3168) + (engine engine :offset-assert 3948) + (engine-pers basic :offset-assert 3952) + (engine-hi basic :offset-assert 3956) + (sound-stinger-time time-frame :offset-assert 3960) + (sound-stinger-change-time time-frame 4 :offset-assert 3968) + (sound-excitement-change-time time-frame :offset-assert 4000) + (sound-excitement-targ float :offset-assert 4008) + (sound-excitement-level uint32 :offset-assert 4012) + ) + :method-count-assert 19 + :size-assert #xfb0 + :flag-assert #x1300000fb0 + (:methods + (new (symbol type int) _type_ 0) + (setting-control-method-9 () none 9) + (setting-control-method-10 () none 10) + (setting-control-method-11 () none 11) + (setting-control-method-12 () none 12) + (setting-control-method-13 () none 13) + (setting-control-method-14 () none 14) + (setting-control-method-15 () none 15) + (setting-control-method-16 () none 16) + (setting-control-method-17 () none 17) + (update (_type_) none 18) + ) + ) + +;; definition for method 3 of type setting-control +(defmethod inspect setting-control ((obj setting-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tuser-current: #~%" (-> obj user-current)) + (format #t "~1Tuser-target: #~%" (-> obj user-target)) + (format #t "~1Tuser-default: #~%" (-> obj user-default)) + (format #t "~1Tcam-current: #~%" (-> obj cam-current)) + (format #t "~1Tcam-target: #~%" (-> obj cam-target)) + (format #t "~1Tcam-default: #~%" (-> obj cam-default)) + (format #t "~1Tengine: ~A~%" (-> obj engine)) + (format #t "~1Tengine-pers: ~A~%" (-> obj engine-pers)) + (format #t "~1Tengine-hi: ~A~%" (-> obj engine-hi)) + (format #t "~1Tsound-stinger-time: ~D~%" (-> obj sound-stinger-time)) + (format #t "~1Tsound-stinger-change-time[4] @ #x~X~%" (-> obj sound-stinger-change-time)) + (format #t "~1Tsound-excitement-change-time: ~D~%" (-> obj sound-excitement-change-time)) + (format #t "~1Tsound-excitement-targ: ~f~%" (-> obj sound-excitement-targ)) + (format #t "~1Tsound-excitement-level: ~D~%" (-> obj sound-excitement-level)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type setting-control +(defmethod new setting-control ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s4-0 engine) ((method-of-type engine new) allocation engine 'setting-control arg0 connection)) + (set! (-> s4-0 engine-hi) ((method-of-type engine new) allocation engine 'setting-control arg0 connection)) + (set! (-> s4-0 engine-pers) + ((method-of-type engine-pers new) allocation engine-pers 'setting-control arg0 connection-pers) + ) + s4-0 + ) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc new file mode 100644 index 0000000000..8e914e9a83 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box-h_REF.gc @@ -0,0 +1,115 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bounding-box +(deftype bounding-box (structure) + ((min vector :inline :offset-assert 0) + (max vector :inline :offset-assert 16) + ) + :method-count-assert 21 + :size-assert #x20 + :flag-assert #x1500000020 + (:methods + (add-spheres! (_type_ (inline-array sphere) int) int 9) + (add-box! (_type_ bounding-box) int 10) + (add-point! (_type_ vector) none 11) + (intersects-line-segment? (_type_ vector vector) symbol 12) + (set-from-point-offset! (_type_ vector vector) none 13) + (set-from-point-offset-pad! (_type_ vector vector float) int 14) + (set-to-point! (_type_ vector) none 15) + (set-from-sphere! (_type_ sphere) none 16) + (set-from-spheres! (_type_ (inline-array sphere) int) int 17) + (get-bounding-sphere (_type_ vector) vector 18) + (inside-xyz? (bounding-box vector) symbol 19) + (inside-xz? (bounding-box vector) symbol 20) + ) + ) + +;; definition for method 3 of type bounding-box +(defmethod inspect bounding-box ((obj bounding-box)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bounding-box) + (format #t "~1Tmin: ~`vector`P~%" (-> obj min)) + (format #t "~1Tmax: ~`vector`P~%" (-> obj max)) + (label cfg-4) + obj + ) + +;; definition of type bounding-box4w +(deftype bounding-box4w (structure) + ((min vector4w :inline :offset-assert 0) + (max vector4w :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type bounding-box4w +(defmethod inspect bounding-box4w ((obj bounding-box4w)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bounding-box4w) + (format #t "~1Tmin: ~`vector4w`P~%" (-> obj min)) + (format #t "~1Tmax: ~`vector4w`P~%" (-> obj max)) + (label cfg-4) + obj + ) + +;; definition of type bounding-box-both +(deftype bounding-box-both (structure) + ((box bounding-box :inline :offset-assert 0) + (box4w bounding-box4w :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type bounding-box-both +(defmethod inspect bounding-box-both ((obj bounding-box-both)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bounding-box-both) + (format #t "~1Tbox: #~%" (-> obj box)) + (format #t "~1Tbox4w: #~%" (-> obj box4w)) + (label cfg-4) + obj + ) + +;; definition of type bounding-box-array +(deftype bounding-box-array (inline-array-class) + ((data bounding-box :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type bounding-box-array +(defmethod inspect bounding-box-array ((obj bounding-box-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! (-> bounding-box-array heap-base) (the-as uint 32)) + + + + diff --git a/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc new file mode 100644 index 0000000000..2e15a7bca1 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/bounding-box_REF.gc @@ -0,0 +1,270 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 19 of type bounding-box +(defmethod inside-xyz? bounding-box ((obj bounding-box) (arg0 vector)) + (and (< (-> obj min x) (-> arg0 x)) + (< (-> obj min y) (-> arg0 y)) + (< (-> obj min z) (-> arg0 z)) + (< (-> arg0 x) (-> obj max x)) + (< (-> arg0 y) (-> obj max y)) + (< (-> arg0 z) (-> obj max z)) + ) + ) + +;; definition for method 20 of type bounding-box +(defmethod inside-xz? bounding-box ((obj bounding-box) (arg0 vector)) + (and (< (-> obj min x) (-> arg0 x)) + (< (-> obj min z) (-> arg0 z)) + (< (-> arg0 x) (-> obj max x)) + (< (-> arg0 z) (-> obj max z)) + ) + ) + +;; definition for function box-vector-enside? +(defun box-vector-enside? ((arg0 bounding-box) (arg1 vector)) + (and (< (-> arg0 min x) (-> arg1 x)) + (< (-> arg0 min y) (-> arg1 y)) + (< (-> arg0 min z) (-> arg1 z)) + (< (-> arg1 x) (-> arg0 max x)) + (< (-> arg1 y) (-> arg0 max y)) + (< (-> arg1 z) (-> arg0 max z)) + ) + ) + +;; definition for function box-vector-inside? +(defun box-vector-inside? ((arg0 bounding-box) (arg1 vector)) + (and (>= (-> arg1 x) (-> arg0 min x)) + (>= (-> arg1 y) (-> arg0 min y)) + (>= (-> arg1 z) (-> arg0 min z)) + (>= (-> arg0 max x) (-> arg1 x)) + (>= (-> arg0 max y) (-> arg1 y)) + (>= (-> arg0 max z) (-> arg1 z)) + ) + ) + +;; definition for method 13 of type bounding-box +;; INFO: Return type mismatch int vs none. +(defmethod set-from-point-offset! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf3 (&-> arg1 quad)) + (.lvf vf4 (&-> arg0 quad)) + (.add.vf vf5 vf4 vf3) + (.min.vf vf1 vf4 vf5) + (.max.vf vf2 vf4 vf5) + (.mov.vf vf1 vf0 :mask #b1000) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> obj min quad) vf1) + (.svf (&-> obj max quad) vf2) + 0 + (none) + ) + ) + +;; definition for method 11 of type bounding-box +;; INFO: Return type mismatch int vs none. +(defmethod add-point! bounding-box ((obj bounding-box) (arg0 vector)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf1 (&-> obj min quad)) + (.lvf vf2 (&-> obj max quad)) + (.lvf vf3 (&-> arg0 quad)) + (.min.vf vf1 vf1 vf3) + (.max.vf vf2 vf2 vf3) + (.svf (&-> obj min quad) vf1) + (.svf (&-> obj max quad) vf2) + 0 + (none) + ) + ) + +;; definition for method 10 of type bounding-box +(defmethod add-box! bounding-box ((obj bounding-box) (arg0 bounding-box)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (.lvf vf1 (&-> obj min quad)) + (.lvf vf2 (&-> obj max quad)) + (.lvf vf3 (&-> arg0 min quad)) + (.lvf vf4 (&-> arg0 max quad)) + (.min.vf vf1 vf1 vf3) + (.max.vf vf2 vf2 vf4) + (.svf (&-> obj min quad) vf1) + (.svf (&-> obj max quad) vf2) + 0 + ) + ) + +;; definition for method 15 of type bounding-box +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defmethod set-to-point! bounding-box ((obj bounding-box) (arg0 vector)) + (set! (-> obj min quad) (-> arg0 quad)) + (set! (-> obj max quad) (-> arg0 quad)) + 0 + (none) + ) + +;; definition for method 14 of type bounding-box +(defmethod set-from-point-offset-pad! bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg0 quad)) + (.mov vf1 arg2) + (.add.vf vf6 vf5 vf4) + (.min.vf vf2 vf5 vf6) + (.max.vf vf3 vf5 vf6) + (.add.x.vf vf3 vf3 vf1 :mask #b111) + (.sub.x.vf vf2 vf2 vf1 :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mov.vf vf3 vf0 :mask #b1000) + (.svf (&-> obj min quad) vf2) + (.svf (&-> obj max quad) vf3) + 0 + ) + ) + +;; definition for method 16 of type bounding-box +;; INFO: Return type mismatch int vs none. +(defmethod set-from-sphere! bounding-box ((obj bounding-box) (arg0 sphere)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.sub.w.vf vf2 vf1 vf1 :mask #b111) + (.add.w.vf vf3 vf1 vf1 :mask #b111) + (.mov.vf vf2 vf0 :mask #b1000) + (.mov.vf vf3 vf0 :mask #b1000) + (.svf (&-> obj min quad) vf2) + (.svf (&-> obj max quad) vf3) + 0 + (none) + ) + ) + +;; definition for method 17 of type bounding-box +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 9 of type bounding-box +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 18 of type bounding-box +(defmethod get-bounding-sphere bounding-box ((obj bounding-box) (arg0 vector)) + (let* ((a1-2 (vector-! (new 'stack-no-clear 'vector) (-> obj max) (-> obj min))) + (a0-3 (vector-float*! (new 'stack-no-clear 'vector) a1-2 0.5)) + ) + (vector+! arg0 (-> obj min) a0-3) + (set! (-> arg0 w) (vector-length a0-3)) + ) + arg0 + ) + +;; definition of type liang-barsky-line-clip-params +(deftype liang-barsky-line-clip-params (structure) + ((te float :offset-assert 0) + (tl float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type liang-barsky-line-clip-params +(defmethod inspect liang-barsky-line-clip-params ((obj liang-barsky-line-clip-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'liang-barsky-line-clip-params) + (format #t "~1Tte: ~f~%" (-> obj te)) + (format #t "~1Ttl: ~f~%" (-> obj tl)) + (label cfg-4) + obj + ) + +;; definition for function liang-barsky-line-clipt +(defun liang-barsky-line-clipt ((arg0 liang-barsky-line-clip-params) (arg1 float) (arg2 float)) + (cond + ((< 0.0 arg1) + (let ((f0-2 (/ arg2 arg1))) + (if (< (-> arg0 tl) f0-2) + (return #f) + ) + (if (< (-> arg0 te) f0-2) + (set! (-> arg0 te) f0-2) + ) + ) + ) + ((< arg1 0.0) + (let ((f0-5 (/ arg2 arg1))) + (if (< f0-5 (-> arg0 te)) + (return #f) + ) + (if (< f0-5 (-> arg0 tl)) + (set! (-> arg0 tl) f0-5) + ) + ) + ) + (else + (if (< 0.0 arg2) + (return #f) + ) + ) + ) + #t + ) + +;; definition for method 12 of type bounding-box +;; WARN: disable def twice: 23. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod intersects-line-segment? bounding-box ((obj bounding-box) (arg0 vector) (arg1 vector)) + (let ((f28-0 (- (-> arg1 x) (-> arg0 x))) + (f30-0 (- (-> arg1 z) (-> arg0 z))) + ) + (cond + ((and (= f28-0 0.0) (= f30-0 0.0)) + (let ((f1-2 (-> arg0 x)) + (f0-4 (-> arg0 z)) + ) + (and (>= f1-2 (-> obj min x)) (>= (-> obj max x) f1-2) (>= f0-4 (-> obj min z)) (>= (-> obj max z) f0-4)) + ) + ) + (else + (let ((s4-0 (new 'stack-no-clear 'liang-barsky-line-clip-params))) + (set! (-> s4-0 te) 0.0) + (set! (-> s4-0 tl) 1.0) + (and (liang-barsky-line-clipt s4-0 f28-0 (- (-> obj min x) (-> arg0 x))) + (liang-barsky-line-clipt s4-0 (- f28-0) (- (-> arg0 x) (-> obj max x))) + (liang-barsky-line-clipt s4-0 f30-0 (- (-> obj min z) (-> arg0 z))) + (liang-barsky-line-clipt s4-0 (- f30-0) (- (-> arg0 z) (-> obj max z))) + ) + ) + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc new file mode 100644 index 0000000000..97bd2d7b2b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/geometry-h_REF.gc @@ -0,0 +1,71 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type curve +(deftype curve (structure) + ((cverts (inline-array vector) :offset-assert 0) + (num-cverts int32 :offset-assert 4) + (knots (pointer float) :offset-assert 8) + (num-knots int32 :offset-assert 12) + (length float :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type curve +(defmethod inspect curve ((obj curve)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'curve) + (format #t "~1Tcverts: #x~X~%" (-> obj cverts)) + (format #t "~1Tnum-cverts: ~D~%" (-> obj num-cverts)) + (format #t "~1Tknots: #x~X~%" (-> obj knots)) + (format #t "~1Tnum-knots: ~D~%" (-> obj num-knots)) + (format #t "~1Tlength: ~f~%" (-> obj length)) + (label cfg-4) + obj + ) + +;; definition of type border-plane +(deftype border-plane (basic) + ((name symbol :offset-assert 4) + (action basic :offset-assert 8) + (slot int8 :offset-assert 12) + (trans vector :inline :offset-assert 16) + (normal vector :inline :offset-assert 32) + ) + :method-count-assert 11 + :size-assert #x30 + :flag-assert #xb00000030 + (:methods + (debug-draw! (_type_) none 9) + (point-past-plane? (_type_ vector) symbol 10) + ) + ) + +;; definition for method 3 of type border-plane +(defmethod inspect border-plane ((obj border-plane)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Taction: ~A~%" (-> obj action)) + (format #t "~1Tslot: ~D~%" (-> obj slot)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tnormal: ~`vector`P~%" (-> obj normal)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc new file mode 100644 index 0000000000..c515b8d5ae --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/geometry_REF.gc @@ -0,0 +1,1691 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function vector-flatten! +(defun vector-flatten! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +;; definition for function vector-reflect! +(defun vector-reflect! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.add.vf acc vf3 vf3 :mask #b111) + (.sub.mul.w.vf vf3 vf1 vf0 acc :mask #b111) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +;; definition for function vector-reflect-flat! +(defun vector-reflect-flat! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.add.vf vf3 vf3 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +;; definition for function vector-reflect-flat-above! +(defun vector-reflect-flat-above! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov.vf vf3 vf0 :mask #b1000) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf3 vf3 vf2 acc) + (.svf (&-> arg0 quad) vf3) + (let* ((f0-0 (vector-length arg0)) + (f1-1 (vector-dot arg0 arg2)) + (f0-2 (- (* 0.02 f0-0) f1-1)) + ) + (vector+float*! arg0 arg0 arg2 (fmin 16384.0 (* 16.0 f0-2))) + ) + ) + ) + +;; definition for function vector-reflect-flat-gravity! +;; INFO: Used lq/sq +(defun vector-reflect-flat-gravity! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> arg1 quad)) + (vector-reflect-flat! arg0 s4-0 arg2) + (let* ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) s4-0 1.0)) + (f28-0 (vector-length s4-0)) + (f30-0 (vector-length arg0)) + (f0-1 (vector-dot s2-0 arg2)) + (f1-1 (vector-dot arg3 arg2)) + ) + (when (and (< 0.0001 f1-1) (< 8192.0 f28-0)) + (let ((f0-3 (- (/ f0-1 f1-1)))) + (vector+float*! arg0 s4-0 arg3 (* f28-0 f0-3)) + ) + (vector+! arg0 arg0 arg2) + (vector-normalize! arg0 f30-0) + ) + ) + ) + arg0 + ) + +;; definition for function vector-segment-distance-point! +(defun vector-segment-distance-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (local-vars (v0-0 float) (v1-0 float) (v1-1 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (init-vf0-vector) + (nop!) + (.lvf vf3 (&-> arg1 quad)) + (.lvf vf4 (&-> arg2 quad)) + (.lvf vf5 (&-> arg0 quad)) + (.sub.vf vf1 vf4 vf3) + (.sub.vf vf6 vf5 vf3) + (.mul.vf vf2 vf1 vf1) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.sqrt.vf Q vf2 :ftf #b11) + (.wait.vf) + (.add.vf vf2 vf0 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b0) + (.mov v1-0 vf2) + (let ((f2-0 v1-0)) + (.wait.vf) + (.mul.vf vf1 vf1 Q) + (.mul.vf vf7 vf1 vf6) + (let ((f1-0 (the-as float 0.0))) + (.add.y.vf vf7 vf7 vf7 :mask #b1) + (.add.z.vf vf7 vf7 vf7 :mask #b1) + (.mov v1-1 vf7) + (let ((f0-0 v1-1)) + (b! (< f0-0 f1-0) cfg-4 :likely-delay (set! f0-0 f1-0)) + (b! (< f2-0 f0-0) cfg-4 :likely-delay (set! f0-0 f2-0)) + (label cfg-4) + (let ((v1-2 f0-0)) + (.mov vf7 v1-2) + ) + ) + ) + ) + (.mul.x.vf vf1 vf1 vf7) + (b! (= arg3 #f) cfg-6 :delay (.mov.vf vf8 vf0 :mask #b1000)) + (.add.vf vf8 vf3 vf1 :mask #b111) + (.svf (&-> arg3 quad) vf8) + (label cfg-6) + (.sub.vf vf2 vf6 vf1) + (.mul.vf vf2 vf2 vf2) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.sqrt.vf Q vf2 :ftf #b11) + (.wait.vf) + (.add.vf vf2 vf0 Q :mask #b1) + (.nop.vf) + (.mov v0-0 vf2) + v0-0 + ) + ) + +;; definition for function vector-line-distance +;; INFO: Used lq/sq +(defun vector-line-distance ((arg0 vector) (arg1 vector) (arg2 vector)) + (let* ((a1-3 (vector-normalize! (vector-! (new-stack-vector0) arg2 arg1) 1.0)) + (gp-1 (vector-! (new-stack-vector0) arg0 arg1)) + (f0-1 (vector-dot a1-3 gp-1)) + (v1-3 (vector-float*! (new-stack-vector0) a1-3 f0-1)) + ) + (vector-length (vector-! (new-stack-vector0) gp-1 v1-3)) + ) + ) + +;; definition for function vector-line-distance-point! +;; INFO: Used lq/sq +(defun vector-line-distance-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let* ((a1-3 (vector-normalize! (vector-! (new-stack-vector0) arg2 arg1) 1.0)) + (s4-1 (vector-! (new-stack-vector0) arg0 arg1)) + (f0-1 (vector-dot a1-3 s4-1)) + (v1-4 (vector-float*! (new-stack-vector0) a1-3 f0-1)) + ) + (if arg3 + (vector+! arg3 arg1 v1-4) + ) + (vector-length (vector-! (new-stack-vector0) s4-1 v1-4)) + ) + ) + +;; definition for function vector-segment-overlap +(defun vector-segment-overlap ((arg0 vector) (arg1 vector) (arg2 vector)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) arg1 arg2)) + (s5-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) gp-1 1.0)) + ) + (let ((a3-0 (new 'stack-no-clear 'vector))) + (vector-line-distance-point! arg0 arg1 arg2 a3-0) + ) + (/ (vector-dot s5-0 (vector-! (new 'stack-no-clear 'vector) arg1 arg0)) (vector-length gp-1)) + ) + ) + +;; definition for function line-sphere-intersection? +(defun line-sphere-intersection? ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (vector-! s3-0 arg2 arg1) + (let ((f0-0 (vector-length-squared s3-0))) + (if (< 0.0 f0-0) + (set! f30-0 (/ 1.0 f0-0)) + ) + ) + (let ((v1-6 (new 'stack-no-clear 'vector))) + (vector-! v1-6 arg0 arg1) + (let* ((f1-2 (* (vector-dot s3-0 v1-6) f30-0)) + (f0-5 (fmax 0.0 (fmin 1.0 f1-2))) + ) + (vector+float*! s5-0 arg1 s3-0 f0-5) + ) + ) + ) + (let ((f0-6 (vector-vector-distance-squared s5-0 arg0)) + (f1-4 (-> arg0 w)) + ) + (< f0-6 (* f1-4 f1-4)) + ) + ) + ) + +;; definition for function vector-orient-by-quat! +(defun vector-orient-by-quat! ((arg0 vector) (arg1 vector) (arg2 quaternion)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg2 vec quad)) + (.lvf vf6 (&-> arg1 quad)) + (.add.vf vf5 vf1 vf1) + (.add.w.vf vf2 vf0 vf1 :mask #b1) + (.add.z.vf vf2 vf0 vf1 :mask #b10) + (.sub.y.vf vf2 vf0 vf1 :mask #b100) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (.sub.z.vf vf3 vf0 vf1 :mask #b1) + (.add.w.vf vf3 vf0 vf1 :mask #b10) + (.add.x.vf vf3 vf0 vf1 :mask #b100) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.add.y.vf vf4 vf0 vf1 :mask #b1) + (.sub.x.vf vf4 vf0 vf1 :mask #b10) + (.add.w.vf vf4 vf0 vf1 :mask #b100) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (.outer.product.a.vf acc vf5 vf2) + (.outer.product.b.vf vf2 vf2 vf5 acc) + (.outer.product.a.vf acc vf5 vf3) + (.outer.product.b.vf vf3 vf3 vf5 acc) + (.outer.product.a.vf acc vf5 vf4) + (.outer.product.b.vf vf4 vf4 vf5 acc) + (.add.w.vf vf2 vf2 vf0 :mask #b1) + (.add.w.vf vf3 vf3 vf0 :mask #b10) + (.add.w.vf vf4 vf4 vf0 :mask #b100) + (.mul.w.vf acc vf0 vf6) + (.add.mul.x.vf acc vf2 vf6 acc) + (.add.mul.y.vf acc vf3 vf6 acc) + (.add.mul.z.vf vf6 vf4 vf6 acc) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; definition for function vector-inv-orient-by-quat! +;; ERROR: Bad vector register dependency: vf7 +(defun vector-inv-orient-by-quat! ((arg0 vector) (arg1 vector) (arg2 quaternion)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.sub.vf vf7 vf7 vf7) + (.lvf vf1 (&-> arg2 vec quad)) + (.lvf vf6 (&-> arg1 quad)) + (.sub.vf vf1 vf7 vf1 :mask #b111) + (.add.vf vf5 vf1 vf1) + (.add.w.vf vf2 vf0 vf1 :mask #b1) + (.add.z.vf vf2 vf0 vf1 :mask #b10) + (.sub.y.vf vf2 vf0 vf1 :mask #b100) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (.sub.z.vf vf3 vf0 vf1 :mask #b1) + (.add.w.vf vf3 vf0 vf1 :mask #b10) + (.add.x.vf vf3 vf0 vf1 :mask #b100) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.add.y.vf vf4 vf0 vf1 :mask #b1) + (.sub.x.vf vf4 vf0 vf1 :mask #b10) + (.add.w.vf vf4 vf0 vf1 :mask #b100) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (.outer.product.a.vf acc vf5 vf2) + (.outer.product.b.vf vf2 vf2 vf5 acc) + (.outer.product.a.vf acc vf5 vf3) + (.outer.product.b.vf vf3 vf3 vf5 acc) + (.outer.product.a.vf acc vf5 vf4) + (.outer.product.b.vf vf4 vf4 vf5 acc) + (.add.w.vf vf2 vf2 vf0 :mask #b1) + (.add.w.vf vf3 vf3 vf0 :mask #b10) + (.add.w.vf vf4 vf4 vf0 :mask #b100) + (.mul.w.vf acc vf0 vf6) + (.add.mul.x.vf acc vf2 vf6 acc) + (.add.mul.y.vf acc vf3 vf6 acc) + (.add.mul.z.vf vf6 vf4 vf6 acc) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; definition for function forward-down->inv-matrix +;; INFO: Used lq/sq +(defun forward-down->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + (vector-normalize-copy! (the-as vector (&-> arg0 data 8)) arg1 1.0) + (vector-cross! (the-as vector (-> arg0 data)) (the-as vector (&-> arg0 data 8)) arg2) + (vector-normalize! (the-as vector (-> arg0 data)) 1.0) + (vector-cross! (the-as vector (&-> arg0 data 4)) arg1 (the-as vector (-> arg0 data))) + (vector-normalize! (the-as vector (&-> arg0 data 4)) 1.0) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 11) 0.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function forward-down-nopitch->inv-matrix +;; INFO: Used lq/sq +(defun forward-down-nopitch->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + (vector-normalize-copy! (the-as vector (&-> arg0 data 4)) arg2 1.0) + (vector-negate! (the-as vector (&-> arg0 data 4)) (the-as vector (&-> arg0 data 4))) + (vector-cross! (the-as vector (-> arg0 data)) (the-as vector (&-> arg0 data 4)) arg1) + (vector-normalize! (the-as vector (-> arg0 data)) 1.0) + (vector-cross! + (the-as vector (&-> arg0 data 8)) + (the-as vector (-> arg0 data)) + (the-as vector (&-> arg0 data 4)) + ) + (vector-normalize! (the-as vector (&-> arg0 data 8)) 1.0) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 11) 0.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function forward-up->inv-matrix +(defun forward-up->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + (forward-down->inv-matrix arg0 arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2)) + ) + +;; definition for function forward-up-nopitch->inv-matrix +;; INFO: Used lq/sq +(defun forward-up-nopitch->inv-matrix ((arg0 matrix) (arg1 vector) (arg2 vector)) + (forward-down-nopitch->inv-matrix arg0 arg1 (vector-negate! (new-stack-vector0) arg2)) + ) + +;; definition for function forward-up-nopitch->quaternion +;; INFO: Used lq/sq +(defun forward-up-nopitch->quaternion ((arg0 quaternion) (arg1 vector) (arg2 vector)) + (matrix->quaternion arg0 (forward-up-nopitch->inv-matrix (new-stack-matrix0) arg1 arg2)) + ) + +;; definition for function forward-up->quaternion +;; INFO: Used lq/sq +(defun forward-up->quaternion ((arg0 quaternion) (arg1 vector) (arg2 vector)) + (matrix->quaternion + arg0 + (forward-down->inv-matrix (new-stack-matrix0) arg1 (vector-negate! (new 'stack-no-clear 'vector) arg2)) + ) + ) + +;; definition for function quaternion-from-two-vectors! +;; INFO: Used lq/sq +(defun quaternion-from-two-vectors! ((arg0 quaternion) (arg1 vector) (arg2 vector)) + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f1-0 (vector-length s5-0)) + (f0-1 (vector-dot arg1 arg2)) + ) + (let ((f1-1 (/ (sqrtf (* 0.5 (- 1.0 f0-1))) f1-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f1-1)) + (set! (-> arg0 y) (* (-> s5-0 y) f1-1)) + (set! (-> arg0 z) (* (-> s5-0 z) f1-1)) + ) + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f0-1)))) + ) + arg0 + ) + +;; definition for function quaternion-from-two-vectors-partial! +;; INFO: Used lq/sq +(defun quaternion-from-two-vectors-partial! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float)) + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f0-0 (vector-length s5-0)) + (f1-1 (+ 1.0 (* arg3 (+ -1.0 (vector-dot arg1 arg2))))) + ) + (let ((f0-1 (/ (sqrtf (* 0.5 (- 1.0 f1-1))) f0-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f0-1)) + (set! (-> arg0 y) (* (-> s5-0 y) f0-1)) + (set! (-> arg0 z) (* (-> s5-0 z) f0-1)) + ) + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f1-1)))) + ) + arg0 + ) + +;; definition for function quaternion-from-two-vectors-max-angle! +;; INFO: Used lq/sq +(defun quaternion-from-two-vectors-max-angle! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float)) + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f30-0 (vector-length s5-0)) + (f26-0 (vector-dot arg1 arg2)) + (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) + ) + (let ((f0-5 (sin (* 0.5 arg3)))) + (cond + ((< f0-5 f28-0) + (set! f28-0 f0-5) + (set! (-> arg0 w) (cos (* 0.5 arg3))) + ) + (else + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) + ) + ) + ) + (let ((f0-12 (/ f28-0 f30-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f0-12)) + (set! (-> arg0 y) (* (-> s5-0 y) f0-12)) + (set! (-> arg0 z) (* (-> s5-0 z) f0-12)) + ) + ) + arg0 + ) + +;; definition for function quaternion-from-two-vectors-max-angle-partial! +;; INFO: Used lq/sq +(defun quaternion-from-two-vectors-max-angle-partial! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float) (arg4 float)) + (let* ((s5-0 (vector-cross! (new-stack-vector0) arg1 arg2)) + (f30-0 (vector-length s5-0)) + (f26-0 (+ 1.0 (* arg4 (+ -1.0 (vector-dot arg1 arg2))))) + (f28-0 (sqrtf (* 0.5 (- 1.0 f26-0)))) + ) + (let ((f0-5 (sin (* 0.5 arg3)))) + (cond + ((< f0-5 f28-0) + (set! f28-0 f0-5) + (set! (-> arg0 w) (cos (* 0.5 arg3))) + ) + (else + (set! (-> arg0 w) (sqrtf (* 0.5 (+ 1.0 f26-0)))) + ) + ) + ) + (let ((f0-12 (/ f28-0 f30-0))) + (set! (-> arg0 x) (* (-> s5-0 x) f0-12)) + (set! (-> arg0 y) (* (-> s5-0 y) f0-12)) + (set! (-> arg0 z) (* (-> s5-0 z) f0-12)) + ) + ) + arg0 + ) + +;; definition for function matrix-from-two-vectors! +;; INFO: Used lq/sq +(defun matrix-from-two-vectors! ((arg0 matrix) (arg1 vector) (arg2 vector)) + (let* ((a1-3 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + (f1-0 1.0) + (f2-0 f0-1) + (f1-2 (sqrtf (- f1-0 (* f2-0 f2-0)))) + ) + (matrix-axis-sin-cos! arg0 a1-3 f1-2 f0-1) + ) + ) + +;; definition for function matrix-from-two-vectors-max-angle! +;; INFO: Used lq/sq +(defun matrix-from-two-vectors-max-angle! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((s4-1 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0)) + (f30-0 (vector-dot arg1 arg2)) + (f28-0 (cos arg3)) + ) + (cond + ((< f30-0 f28-0) + (matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f28-0) + ) + (else + (let ((t9-5 matrix-axis-sin-cos!) + (a0-6 arg0) + (a1-4 s4-1) + (f0-1 1.0) + (f1-0 f30-0) + ) + (t9-5 a0-6 a1-4 (sqrtf (- f0-1 (* f1-0 f1-0))) f30-0) + ) + ) + ) + ) + ) + +;; definition for function matrix-from-two-vectors-smooth! +(defun matrix-from-two-vectors-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) + (with-pp + (let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + (f0-2 (acos f0-1)) + (f1-2 (fmin (* arg3 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-2)) (the float arg4)))) + (f30-0 (fmax (fmin f0-2 f1-2) (- f1-2))) + ) + (matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0)) + ) + arg0 + ) + ) + +;; definition for function matrix-from-two-vectors-the-long-way-smooth! +(defun matrix-from-two-vectors-the-long-way-smooth! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) + (with-pp + (let* ((s5-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + (f0-3 (- (acos f0-1))) + (f1-2 (fmin (* arg3 (-> pp clock seconds-per-frame)) (/ (* 5.0 (fabs f0-3)) (the float arg4)))) + (f30-0 (fmax (fmin f0-3 f1-2) (- f1-2))) + ) + (matrix-axis-sin-cos! arg0 s5-1 (sin f30-0) (cos f30-0)) + ) + arg0 + ) + ) + +;; definition for function quaternion-from-two-vectors-smooth! +(defun quaternion-from-two-vectors-smooth! ((arg0 quaternion) (arg1 vector) (arg2 vector) (arg3 float) (arg4 int)) + (let ((a1-1 (matrix-from-two-vectors-smooth! (new 'stack-no-clear 'matrix) arg1 arg2 arg3 arg4))) + (matrix->quaternion arg0 a1-1) + ) + ) + +;; definition for function matrix-from-two-vectors-max-angle-partial! +(defun matrix-from-two-vectors-max-angle-partial! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float) (arg4 float)) + (let* ((s4-1 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) arg2 arg1) 1.0)) + (f28-0 (vector-dot arg1 arg2)) + (f30-0 (cos arg3)) + (f0-2 (+ 1.0 (* (+ -1.0 f28-0) arg4))) + ) + (cond + ((< f0-2 f30-0) + (matrix-axis-sin-cos! arg0 s4-1 (sin arg3) f30-0) + ) + (else + (let ((t9-5 matrix-axis-sin-cos!) + (a0-6 arg0) + (a1-4 s4-1) + (f1-3 1.0) + (f2-1 f0-2) + ) + (t9-5 a0-6 a1-4 (sqrtf (- f1-3 (* f2-1 f2-1))) f0-2) + ) + ) + ) + ) + ) + +;; definition for function matrix-from-two-vectors-partial-linear! +;; INFO: Used lq/sq +(defun matrix-from-two-vectors-partial-linear! ((arg0 matrix) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-1 (vector-normalize! (vector-cross! (new-stack-vector0) arg2 arg1) 1.0)) + (f0-1 (vector-dot arg1 arg2)) + ) + (cond + ((< 0.9999 (fabs f0-1)) + (matrix-identity! arg0) + ) + (else + (let* ((f0-4 (cos (* arg3 (acos f0-1)))) + (t9-5 matrix-axis-sin-cos!) + (a0-6 arg0) + (f1-1 1.0) + (f2-1 f0-4) + ) + (t9-5 a0-6 gp-1 (sqrtf (- f1-1 (* f2-1 f2-1))) f0-4) + ) + ) + ) + ) + ) + +;; definition for function matrix-remove-z-rot +;; INFO: Used lq/sq +(defun matrix-remove-z-rot ((arg0 matrix) (arg1 matrix)) + (let ((s4-0 (new-stack-vector0))) + 0.0 + 0.0 + (let ((s5-0 (new-stack-matrix0))) + (vector-negate! s4-0 (the-as vector arg1)) + (vector-flatten! s4-0 s4-0 (the-as vector (&-> arg0 data 8))) + (vector-normalize! s4-0 1.0) + (let ((f30-0 (vector-dot (the-as vector (&-> arg0 data 4)) s4-0))) + (when (< f30-0 0.99999) + (vector-cross! s4-0 (the-as vector (&-> arg0 data 4)) s4-0) + (let ((f0-4 (vector-length s4-0))) + (if (< 0.0 (vector-dot s4-0 (the-as vector (&-> arg0 data 8)))) + (set! f0-4 (- f0-4)) + ) + (matrix-axis-sin-cos! s5-0 (the-as vector (&-> arg0 data 8)) f0-4 f30-0) + ) + (matrix*! arg0 arg0 s5-0) + ) + ) + ) + ) + arg0 + ) + +;; definition for function matrix-rot-diff! +;; INFO: Used lq/sq +(defun matrix-rot-diff! ((arg0 vector) (arg1 matrix) (arg2 matrix)) + (let ((s3-0 (new-stack-quaternion0)) + (s2-0 (new-stack-quaternion0)) + (s5-0 (new-stack-quaternion0)) + ) + 0.0 + (matrix->quaternion s3-0 arg1) + (matrix->quaternion s2-0 arg2) + (quaternion-conjugate! s5-0 s3-0) + (quaternion*! s5-0 s2-0 s5-0) + (quaternion-normalize! s5-0) + (if (< (-> s5-0 w) 0.0) + (quaternion-negate! s5-0 s5-0) + ) + (let ((f30-1 (* 2.0 (acos (-> s5-0 w))))) + (set! (-> arg0 quad) (-> s5-0 vec quad)) + (vector-negate! arg0 arg0) + (if (= (vector-normalize-ret-len! arg0 1.0) 0.0) + (set! (-> arg0 y) 1.0) + ) + f30-1 + ) + ) + ) + +;; definition for function quaternion-seek +;; INFO: Used lq/sq +(defun quaternion-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float) (arg4 float)) + (let ((s5-0 (new-stack-matrix0)) + (s4-0 (new-stack-matrix0)) + ) + (quaternion->matrix s5-0 arg1) + (quaternion->matrix s4-0 arg2) + (let ((s2-1 (new-stack-quaternion0))) + (quaternion-from-two-vectors-max-angle! + s2-1 + (the-as vector (&-> s5-0 data 8)) + (the-as vector (&-> s4-0 data 8)) + arg4 + ) + (quaternion-normalize! (quaternion*! arg0 arg0 s2-1)) + ) + ) + ) + +;; definition for function vector-deg-seek +;; INFO: Used lq/sq +(defun vector-deg-seek ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((s4-0 (new-stack-matrix0))) + (matrix-from-two-vectors-max-angle! s4-0 arg1 arg2 arg3) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +;; definition for function vector-deg-slerp +;; INFO: Used lq/sq +(defun vector-deg-slerp ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + arg0 + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + arg0 + ) + (else + (let ((s1-0 (new-stack-matrix0))) + (let ((s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) + (a2-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0)) + ) + (matrix-from-two-vectors-partial-linear! s1-0 s2-0 a2-3 arg3) + ) + (vector-matrix*! arg0 arg1 s1-0) + ) + ) + ) + ) + +;; definition for function vector-vector-deg-slerp! +;; INFO: Used lq/sq +(defun vector-vector-deg-slerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (local-vars (sv-112 (function float float float float))) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (let* ((s0-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0)) + (s1-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 1.0)) + (s0-1 (forward-up->quaternion (new 'stack-no-clear 'quaternion) s0-0 arg4)) + (a2-5 (forward-up->quaternion (new 'stack-no-clear 'quaternion) s1-0 arg4)) + (a1-6 (quaternion-slerp! (new 'stack-no-clear 'quaternion) s0-1 a2-5 arg3)) + (s2-1 vector-normalize-copy!) + (s1-1 arg0) + (s0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) a1-6)) + ) + (set! sv-112 lerp) + (let ((s3-1 (vector-length arg1)) + (a1-7 (vector-length arg2)) + ) + (s2-1 s1-1 s0-2 (sv-112 s3-1 a1-7 arg3)) + ) + ) + ) + ) + arg0 + ) + +;; definition for function normal-of-plane +(defun normal-of-plane ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf3 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg3 quad)) + (.sub.vf vf1 vf3 vf1) + (.sub.vf vf2 vf3 vf2) + (.outer.product.a.vf acc vf2 vf1) + (.outer.product.b.vf vf4 vf1 vf2 acc) + (.mul.vf vf5 vf4 vf4) + (.add.y.vf vf5 vf5 vf5 :mask #b1) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.isqrt.vf Q vf0 vf5 :fsf #b11 :ftf #b0) + (.mov.vf vf4 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf4 vf4 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function vector-3pt-cross! +(defun vector-3pt-cross! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf3 (&-> arg3 quad)) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.sub.vf vf3 vf3 vf1) + (.outer.product.a.vf acc vf2 vf3) + (.outer.product.b.vf vf4 vf3 vf2 acc) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function closest-pt-in-triangle +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defun closest-pt-in-triangle ((arg0 vector) (arg1 vector) (arg2 matrix) (arg3 vector)) + (local-vars + (v1-0 float) + (v1-4 uint) + (v1-5 uint) + (v1-6 uint) + (v1-7 uint) + (v1-10 uint) + (a0-1 float) + (a1-1 float) + ) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (nop!) + (.lvf vf3 (&-> arg2 vector 1 quad)) + (nop!) + (.lvf vf4 (&-> arg2 vector 2 quad)) + (nop!) + (.lvf vf5 (&-> arg1 quad)) + (.sub.vf vf6 vf3 vf4) + (.lvf vf2 (&-> arg2 vector 0 quad)) + (.sub.vf vf7 vf3 vf5) + (.lvf vf1 (&-> arg3 quad)) + (.sub.vf vf8 vf3 vf2) + (.sub.vf vf9 vf5 vf4) + (.sub.vf vf10 vf5 vf2) + (.outer.product.a.vf acc vf7 vf8) + (.outer.product.b.vf vf14 vf8 vf7 acc) + (.outer.product.a.vf acc vf6 vf7) + (.outer.product.b.vf vf15 vf7 vf6 acc) + (.mul.vf vf11 vf14 vf1) + (.outer.product.a.vf acc vf9 vf10) + (.outer.product.b.vf vf16 vf10 vf9 acc) + (.mul.vf vf12 vf15 vf1) + (.add.x.vf vf11 vf11 vf11 :mask #b10) + (.mul.vf vf13 vf16 vf1) + (.add.x.vf vf12 vf12 vf12 :mask #b10) + (.add.x.vf vf13 vf13 vf13 :mask #b10) + (.add.z.vf vf11 vf11 vf11 :mask #b10) + (.add.z.vf vf12 vf12 vf12 :mask #b10) + (.add.z.vf vf13 vf13 vf13 :mask #b10) + (.mov v1-0 vf11) + (.mov a1-1 vf12) + (.mov a0-1 vf13) + (let* ((v1-1 (shr (the-as int v1-0) 63)) + (a1-2 (shr (the-as int a1-1) 63)) + (a0-2 (shr (the-as int a0-1) 63)) + (a1-3 (* a1-2 2)) + (a0-3 (* a0-2 4)) + (v1-3 (logior (logior v1-1 a1-3) a0-3)) + ) + (b! (nonzero? v1-3) cfg-3 :delay (set! v1-4 (+ v1-3 -1))) + ) + (.sub.vf vf17 vf5 vf2) + (.mov.vf vf18 vf0 :mask #b1000) + (.outer.product.a.vf acc vf17 vf1) + (.outer.product.b.vf vf18 vf1 vf17 acc) + (.outer.product.a.vf acc vf1 vf18) + (.outer.product.b.vf vf18 vf18 vf1 acc) + (.add.vf vf18 vf18 vf2 :mask #b111) + (b! #t cfg-24 :delay (.svf (&-> arg0 quad) vf18)) + (nop!) + (label cfg-3) + (b! (nonzero? v1-4) cfg-6 :delay (set! v1-5 (+ v1-4 -1))) + (vector-segment-distance-point! arg1 (the-as vector (-> arg2 data)) (the-as vector (&-> arg2 data 4)) arg0) + (goto cfg-24) + (label cfg-6) + (b! (nonzero? v1-5) cfg-9 :delay (set! v1-6 (+ v1-5 -1))) + (vector-segment-distance-point! arg1 (the-as vector (&-> arg2 data 4)) (the-as vector (&-> arg2 data 8)) arg0) + (goto cfg-24) + (label cfg-9) + (b! (nonzero? v1-6) cfg-14 :delay (set! v1-7 (+ v1-6 -1))) + (let ((f30-0 + (vector-segment-distance-point! arg1 (the-as vector (&-> arg2 data 4)) (the-as vector (-> arg2 data)) arg0) + ) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-segment-distance-point! arg1 (the-as vector (&-> arg2 data 4)) (the-as vector (&-> arg2 data 8)) s3-0) + f30-0 + ) + (set! (-> arg0 quad) (-> s3-0 quad)) + ) + ) + (goto cfg-24) + (label cfg-14) + (b! (nonzero? v1-7) cfg-17 :delay (set! v1-10 (+ v1-7 -1))) + (vector-segment-distance-point! arg1 (the-as vector (&-> arg2 data 8)) (the-as vector (-> arg2 data)) arg0) + (goto cfg-24) + (label cfg-17) + (b! (nonzero? v1-10) cfg-22 :delay (nop!)) + (let ((f30-1 + (vector-segment-distance-point! arg1 (the-as vector (-> arg2 data)) (the-as vector (&-> arg2 data 4)) arg0) + ) + (s3-1 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-segment-distance-point! arg1 (the-as vector (-> arg2 data)) (the-as vector (&-> arg2 data 8)) s3-1) + f30-1 + ) + (set! (-> arg0 quad) (-> s3-1 quad)) + ) + ) + (goto cfg-24) + (label cfg-22) + (let ((f30-2 + (vector-segment-distance-point! arg1 (the-as vector (&-> arg2 data 8)) (the-as vector (-> arg2 data)) arg0) + ) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (if (< (vector-segment-distance-point! arg1 (the-as vector (&-> arg2 data 8)) (the-as vector (&-> arg2 data 4)) s3-2) + f30-2 + ) + (set! (-> arg0 quad) (-> s3-2 quad)) + ) + ) + (label cfg-24) + 0 + (none) + ) + ) + +;; definition for function point-in-triangle-cross +;; WARN: Using logior on floats +;; WARN: Using logior on floats +;; WARN: Using logior on floats +;; WARN: Using logior on floats +(defun point-in-triangle-cross ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector)) + (local-vars (v1-0 float) (a0-1 float) (a1-1 float)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.lvf vf3 (&-> arg3 quad)) + (.lvf vf4 (&-> arg4 quad)) + (.lvf vf5 (&-> arg0 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.sub.vf vf6 vf3 vf4) + (.sub.vf vf7 vf3 vf5) + (.sub.vf vf8 vf3 vf2) + (.sub.vf vf9 vf5 vf4) + (.sub.vf vf10 vf5 vf2) + (.outer.product.a.vf acc vf6 vf7) + (.outer.product.b.vf vf2 vf7 vf6 acc) + (.outer.product.a.vf acc vf7 vf8) + (.outer.product.b.vf vf3 vf8 vf7 acc) + (.outer.product.a.vf acc vf9 vf10) + (.outer.product.b.vf vf4 vf10 vf9 acc) + (.mul.vf vf2 vf2 vf1) + (.mul.vf vf3 vf3 vf1) + (.nop.vf) + (.mul.vf vf4 vf4 vf1) + (.add.x.vf vf2 vf2 vf2 :mask #b10) + (.add.x.vf vf3 vf3 vf3 :mask #b10) + (.add.x.vf vf4 vf4 vf4 :mask #b10) + (.nop.vf) + (.add.z.vf vf2 vf2 vf2 :mask #b10) + (.add.z.vf vf3 vf3 vf3 :mask #b10) + (.add.z.vf vf4 vf4 vf4 :mask #b10) + (.nop.vf) + (.mov a0-1 vf2) + (.mov a1-1 vf3) + (.mov v1-0 vf4) + (>= (the-as int (logior (logior a0-1 (the-as uint a1-1)) (the-as uint v1-0))) 0) + ) + ) + +;; definition for function point-in-plane-<-point+normal! +(defun point-in-plane-<-point+normal! ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((f0-3 (+ (* (-> arg2 x) (-> arg1 x)) (* (-> arg2 y) (-> arg1 y)) (* (-> arg2 z) (-> arg1 z))))) + (set! (-> arg0 w) 1.0) + (let ((f1-7 (fabs (-> arg2 x))) + (f2-3 (fabs (-> arg2 y))) + (f3-1 (fabs (-> arg2 z))) + ) + (cond + ((and (< f2-3 f1-7) (< f3-1 f1-7)) + (set! (-> arg0 y) (+ 4096.0 (-> arg1 y))) + (set! (-> arg0 z) (+ 4096.0 (-> arg1 z))) + (set! (-> arg0 x) (/ (+ (- (- (* (-> arg2 y) (-> arg0 y))) (* (-> arg2 z) (-> arg0 z))) f0-3) (-> arg2 x))) + ) + ((and (< f1-7 f2-3) (< f3-1 f2-3)) + (set! (-> arg0 x) (+ 4096.0 (-> arg1 x))) + (set! (-> arg0 z) (+ 4096.0 (-> arg1 z))) + (set! (-> arg0 y) (/ (- (- f0-3 (* (-> arg2 x) (-> arg0 x))) (* (-> arg2 z) (-> arg0 z))) (-> arg2 y))) + ) + (else + (set! (-> arg0 x) (+ 4096.0 (-> arg1 x))) + (set! (-> arg0 y) (+ 4096.0 (-> arg1 y))) + (set! (-> arg0 z) (/ (+ (- (- (* (-> arg2 x) (-> arg0 x))) (* (-> arg2 y) (-> arg0 y))) f0-3) (-> arg2 z))) + ) + ) + ) + ) + arg0 + ) + +;; definition for function circle-circle-xz-intersect +;; INFO: Return type mismatch uint vs int. +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f5, f5] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f1] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f0, f0] +;; ERROR: Unsupported inline assembly instruction kind - [msuba.s f2, f2] +;; ERROR: Unsupported inline assembly instruction kind - [msuba.s f3, f3] +;; ERROR: Unsupported inline assembly instruction kind - [msub.s f6, f4, f4] +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f3, f3] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f4, f4] +;; ERROR: Unsupported inline assembly instruction kind - [msub.s f3, f5, f5] +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f4, f4] +;; ERROR: Unsupported inline assembly instruction kind - [msub.s f5, f6, f5] +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f4, f4] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f3, f3] +;; ERROR: Unsupported inline assembly instruction kind - [msub.s f4, f5, f5] +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f3, f3] +;; ERROR: Unsupported inline assembly instruction kind - [msub.s f5, f6, f5] +(defun circle-circle-xz-intersect ((arg0 sphere) (arg1 sphere) (arg2 vector) (arg3 vector)) + (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)) + (f1-0 (-> arg1 x)) + (f0-0 (-> arg1 z)) + (f2-0 (-> arg1 w)) + (v1-0 0.5) + ) + (.mula.s f5-0 f5-0) + (.madda.s f1-0 f1-0) + (.madda.s f0-0 f0-0) + (.msuba.s f2-0 f2-0) + (.msuba.s f3-0 f3-0) + (.msub.s f6-0 f4-0 f4-0) + (let* ((f7-0 v1-0) + (f1-1 (- f1-0 f3-0)) + (f2-1 (- f0-0 f4-0)) + (f0-1 (* f6-0 f7-0)) + (a0-1 f1-1) + (f6-1 (fabs f1-1)) + (v1-1 f2-1) + (f8-0 (fabs f2-1)) + ) + (nop!) + (let ((f7-1 (* f1-1 f1-1))) + (nop!) + (let ((f6-2 (- f6-1 f8-0))) + (b! (nonzero? a0-1) cfg-2 :delay (set! f8-1 (*.s f2-1 f2-1))) + (b! (zero? v1-1) cfg-14 :delay (nop!)) + (label cfg-2) + (let ((v1-2 f6-2)) + (nop!) + (b! (< (the-as int v1-2) 0) cfg-7 :delay (nop!)) + ) + ) + (let* ((f7-2 1.0) + (f6-3 (+ f7-2 f7-2)) + (f1-2 (/ f7-2 f1-1)) + (f12-0 (* f6-3 f0-1)) + (f10-0 (* f0-1 f2-1)) + (f11-0 (* f3-0 f2-1)) + (f9-0 (* f0-1 f0-1)) + (f12-1 (* f12-0 f3-0)) + ) + (.mula.s f3-0 f3-0) + (.madda.s f4-0 f4-0) + (.msub.s f3-1 f5-0 f5-0) + (let* ((f5-1 (* f12-1 f1-2)) + (f12-2 (* f1-2 f1-2)) + (f11-1 (* f11-0 f1-2)) + (f10-1 (* f10-0 f12-2)) + (f8-2 (* f8-1 f12-2)) + (f9-1 (* f9-0 f12-2)) + (f5-2 (- f3-1 f5-1)) + (f10-2 (- f11-1 f10-1)) + (f3-2 (+ f8-2 f7-2)) + (f4-1 (- f10-2 f4-0)) + (f5-3 (+ f9-1 f5-2)) + (f4-2 (* f4-1 f6-3)) + ) + (let ((f5-4 (* f3-2 f5-3)) + (f6-4 (+ f6-3 f6-3)) + ) + (.mula.s f4-2 f4-2) + (.msub.s f5-5 f6-4 f5-4) + ) + (let ((v1-4 f5-5) + (f5-6 (sqrtf f5-5)) + ) + (b! (< (the-as int v1-4) 0) cfg-11 :delay (nop!)) + (b! (zero? v1-4) cfg-6 :delay (nop!)) + (let* ((f7-3 0.5) + (f6-5 0.0) + (f7-4 (/ f7-3 f3-2)) + (f3-3 (+ f5-6 f4-2)) + (f4-3 (- f5-6 f4-2)) + (f5-7 (- f6-5 f3-3)) + (f3-4 (* f4-3 f7-4)) + (f4-4 (* f5-7 f7-4)) + ) + (let* ((f5-8 (* f3-4 f2-1)) + (f2-2 (* f4-4 f2-1)) + (f5-9 (- f0-1 f5-8)) + (f0-2 (- f0-1 f2-2)) + (f2-3 (* f1-2 f5-9)) + (f0-3 (* f1-2 f0-2)) + ) + (set! (-> arg2 x) f2-3) + (set! (-> arg2 z) f3-4) + (set! (-> arg3 x) f0-3) + ) + (b! #t cfg-13 :delay (set! (-> arg3 z) f4-4)) + ) + ) + (label cfg-6) + (let ((f3-6 (/ f4-2 (* -2.0 f3-2)))) + (let ((f0-5 (* (- f0-1 (* f3-6 f2-1)) f1-2))) + (set! (-> arg2 x) f0-5) + (set! (-> arg2 z) f3-6) + (set! (-> arg3 x) f0-5) + ) + (b! #t cfg-12 :delay (set! (-> arg3 z) f3-6)) + ) + ) + ) + (label cfg-7) + (let* ((f8-3 1.0) + (f6-6 (+ f8-3 f8-3)) + (f2-5 (/ f8-3 f2-1)) + (f12-3 (* f6-6 f0-1)) + (f10-3 (* f0-1 f1-1)) + (f11-2 (* f4-0 f1-1)) + (f9-2 (* f0-1 f0-1)) + (f12-4 (* f12-3 f4-0)) + ) + (.mula.s f4-0 f4-0) + (.madda.s f3-0 f3-0) + (.msub.s f4-5 f5-0 f5-0) + (let* ((f5-11 (* f12-4 f2-5)) + (f12-5 (* f2-5 f2-5)) + (f11-3 (* f11-2 f2-5)) + (f10-4 (* f10-3 f12-5)) + (f7-5 (* f7-1 f12-5)) + (f9-3 (* f9-2 f12-5)) + (f5-12 (- f4-5 f5-11)) + (f10-5 (- f11-3 f10-4)) + (f4-6 (+ f7-5 f8-3)) + (f3-7 (- f10-5 f3-0)) + (f5-13 (+ f9-3 f5-12)) + (f3-8 (* f3-7 f6-6)) + ) + (let ((f5-14 (* f4-6 f5-13)) + (f6-7 (+ f6-6 f6-6)) + ) + (.mula.s f3-8 f3-8) + (.msub.s f5-15 f6-7 f5-14) + ) + (let ((v1-8 f5-15) + (f5-16 (sqrtf f5-15)) + ) + (b! (< (the-as int v1-8) 0) cfg-11 :delay (nop!)) + (b! (zero? v1-8) cfg-10 :delay (nop!)) + (let* ((f7-6 0.5) + (f6-8 0.0) + (f4-7 (/ f7-6 f4-6)) + (f7-7 (+ f5-16 f3-8)) + (f3-9 (- f5-16 f3-8)) + (f5-17 (- f6-8 f7-7)) + (f3-10 (* f3-9 f4-7)) + (f4-8 (* f5-17 f4-7)) + (f5-18 (* f3-10 f1-1)) + (f1-3 (* f4-8 f1-1)) + (f5-19 (- f0-1 f5-18)) + (f0-6 (- f0-1 f1-3)) + (f1-4 (* f2-5 f5-19)) + (f0-7 (* f2-5 f0-6)) + ) + (set! (-> arg2 x) f3-10) + (set! (-> arg2 z) f1-4) + (set! (-> arg3 x) f4-8) + (b! #t cfg-13 :delay (set! (-> arg3 z) f0-7)) + ) + ) + (label cfg-10) + (let* ((f3-11 (/ f3-8 (* -2.0 f4-6))) + (f0-9 (* (- f0-1 (* f3-11 f1-1)) f2-5)) + ) + (set! (-> arg2 x) f3-11) + (set! (-> arg2 z) f0-9) + (set! (-> arg3 x) f3-11) + (b! #t cfg-12 :delay (set! (-> arg3 z) f0-9)) + ) + ) + ) + ) + ) + ) + (label cfg-11) + (b! #t cfg-15 :delay (set! v0-0 (the-as uint 0))) + (label cfg-12) + (b! #t cfg-15 :delay (set! v0-0 (the-as uint 1))) + (label cfg-13) + (b! #t cfg-15 :delay (set! v0-0 (the-as uint 2))) + (label cfg-14) + (b! #t cfg-15 :delay (set! v0-0 (the-as uint -1))) + (label cfg-15) + (the-as int v0-0) + ) + +;; definition for function circle-test +;; INFO: Used lq/sq +;; INFO: Return type mismatch object vs none. +(defun circle-test () + (let ((s4-0 (new 'stack 'sphere)) + (a1-2 (new 'stack 'sphere)) + (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 ((a2-1 (circle-circle-xz-intersect s4-0 a1-2 s5-0 gp-0))) + (format #t "res = ~d~%" a2-1) + ) + (format #t "(~f, ~f)~%" (-> s5-0 x) (-> s5-0 z)) + (format #t "(~f, ~f)~%" (-> gp-0 x) (-> gp-0 z)) + ) + (none) + ) + +;; definition for function vector-circle-tangent-new +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defun vector-circle-tangent-new ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (let ((a1-2 (new 'stack 'sphere))) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (set! (-> (new 'stack-no-clear 'vector) quad) (the-as uint128 0)) + (let ((v1-3 #x3f000000)) + (.lvf vf3 (&-> arg1 quad)) + (.mov vf2 v1-3) + ) + (.lvf vf4 (&-> arg0 quad)) + (.add.vf vf1 vf3 vf4) + (.sub.vf vf5 vf4 vf3) + (.mul.x.vf vf1 vf1 vf2) + (.mul.x.vf vf5 vf5 vf2) + (.mul.vf vf5 vf5 vf5 :mask #b101) + (.add.z.vf vf5 vf5 vf5 :mask #b1) + (.sqrt.vf Q vf5 :ftf #b0) + (.wait.vf) + (.mul.vf vf1 vf0 Q :mask #b1000) + (.nop.vf) + (.nop.vf) + (.svf (&-> a1-2 quad) vf1) + (circle-circle-xz-intersect (the-as sphere arg1) a1-2 arg2 arg3) + ) + 0 + (none) + ) + ) + +;; definition for function vector-circle-tangent +;; INFO: Return type mismatch int vs none. +(defun vector-circle-tangent ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let* ((s3-1 (vector-! (the-as vector (new 'stack-no-clear 'sphere)) arg1 arg0)) + (f0-0 (vector-xz-length s3-1)) + (f28-0 (acos (/ (-> arg1 w) f0-0))) + ) + (cond + ((>= 546.13336 f28-0) + (set! (-> arg2 x) (- (-> arg0 x) (-> s3-1 z))) + (set! (-> arg2 y) 0.0) + (set! (-> arg2 z) (+ (-> arg0 z) (-> s3-1 x))) + (set! (-> arg3 x) (+ (-> arg0 x) (-> s3-1 z))) + (set! (-> arg3 y) 0.0) + (set! (-> arg3 z) (- (-> arg0 z) (-> s3-1 x))) + ) + (else + (let ((f0-15 (atan (-> s3-1 z) (-> s3-1 x))) + (f30-0 (- (-> arg1 w))) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (let ((a2-1 (new 'stack-no-clear 'vector))) + (set! (-> a2-1 x) (- f0-15 f28-0)) + (set! (-> a2-1 y) (+ f0-15 f28-0)) + (vector-sincos! s3-2 s2-1 a2-1) + ) + (set! (-> arg2 x) (+ (-> arg1 x) (* f30-0 (-> s2-1 x)))) + (set! (-> arg2 z) (+ (-> arg1 z) (* f30-0 (-> s3-2 x)))) + (set! (-> arg3 x) (+ (-> arg1 x) (* f30-0 (-> s2-1 y)))) + ) + (set! (-> arg3 z) (+ (-> arg1 z) (* f30-0 (-> s3-2 y)))) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function find-knot-span +(defun find-knot-span ((arg0 int) (arg1 int) (arg2 float) (arg3 (inline-array vector))) + (local-vars (v0-0 int)) + (b! (= arg2 (-> (&-> arg3 0 data (+ arg0 1)) 0)) cfg-11 :delay (set! v0-0 arg0)) + (let ((v1-3 (the int arg2))) + (let* ((a2-1 (+ v1-3 3)) + (t0-1 (&-> arg3 0 data a2-1)) + (f1-2 (-> t0-1 0)) + (f2-0 (-> t0-1 1)) + ) + (b! (> f1-2 arg2) cfg-4) + (b! (>= arg2 f2-0) cfg-4 :delay (set! v0-0 a2-1)) + ) + (b! #t cfg-11 :delay (nop!)) + (label cfg-4) + (let ((a1-1 arg1) + (a0-1 (+ arg0 1)) + ) + (label cfg-5) + (let ((a2-3 (/ (+ a1-1 a0-1) 2))) + (let ((t0-3 (&-> arg3 0 data a2-3))) + (b! (>= arg2 (-> t0-3 0)) cfg-7) + (b! #t cfg-5 :delay (set! a0-1 a2-3)) + (label cfg-7) + (b! (< arg2 (-> t0-3 1)) cfg-9) + ) + (b! #t cfg-5 :delay (set! a1-1 a2-3)) + (label cfg-9) + (set! v0-0 a2-3) + ) + ) + (b! (= v0-0 v1-3) cfg-11 :delay (nop!)) + ) + (nop!) + (nop!) + (label cfg-11) + v0-0 + ) + +;; definition for function calculate-basis-functions-vector! +;; ERROR: Unsupported inline assembly instruction kind - [sll v1, a1, 2] +;; ERROR: Unsupported inline assembly instruction kind - [addu v1, a3, v1] +(defun calculate-basis-functions-vector! ((arg0 vector) (arg1 int) (arg2 float) (arg3 (pointer float))) + (local-vars (v1-0 int) (v1-1 object)) + (.sll v1-0 arg1 2) + (let ((a1-1 1.0) + (f3-0 arg2) + ) + (.addu v1-1 arg3 v1-0) + (let* ((f1-0 a1-1) (f5-0 f1-0)) 0.0 0.0 (let* ((f0-2 (-> (the-as (pointer float) v1-1) 0)) + (f2-0 (-> (the-as (pointer float) v1-1) 1)) + (f0-3 (- f3-0 f0-2)) + (f4-0 (- f2-0 f3-0)) + (f10-0 (/ f1-0 (+ f4-0 f0-3))) + (f2-2 (-> (the-as (pointer float) v1-1) -1)) + (f8-0 (-> (the-as (pointer float) v1-1) 2)) + (f2-3 (- f3-0 f2-2)) + (f9-0 (+ f4-0 f2-3)) + (f6-0 (-> (the-as (pointer float) v1-1) -2)) + (f7-0 (-> (the-as (pointer float) v1-1) 3)) + (f9-1 (/ f1-0 f9-0)) + (f5-1 (* f5-0 f10-0)) + (f11-0 (* f4-0 f5-1)) + (f10-1 (* f0-3 f5-1)) + (f5-2 (- f8-0 f3-0)) + (f8-1 (* f11-0 f9-1)) + (f11-1 (/ f1-0 (+ f5-2 f0-3))) + (f9-3 (* f4-0 f8-1)) + (f8-2 (* f2-3 f8-1)) + (f11-2 (* f10-1 f11-1)) + (f10-3 (+ (* f5-2 f11-2) f8-2)) + (f8-3 (* f0-3 f11-2)) + (f6-1 (- f3-0 f6-0)) + (f3-1 (- f7-0 f3-0)) + (f7-3 (* f9-3 (/ f1-0 (+ f4-0 f6-1)))) + (f4-1 (* f4-0 f7-3)) + (f6-2 (* f6-1 f7-3)) + (f7-6 (* f10-3 (/ f1-0 (+ f5-2 f2-3)))) + (f5-4 (+ (* f5-2 f7-6) f6-2)) + (f2-4 (* f2-3 f7-6)) + (f1-2 (* f8-3 (the-as float (/ f1-0 (+ f3-1 f0-3))))) + (f2-5 (+ (* f3-1 f1-2) f2-4)) + (f0-4 (* f0-3 f1-2)) + ) + (set! (-> arg0 x) f4-1) + (set! (-> arg0 y) f5-4) + (set! (-> arg0 z) f2-5) + (set! (-> arg0 w) f0-4) + ) + ) + ) + arg0 + ) + +;; definition for function curve-evaluate! +;; ERROR: Unsupported inline assembly instruction kind - [addiu v1, s3, -3] +;; ERROR: Unsupported inline assembly instruction kind - [sll v1, v1, 4] +(defun curve-evaluate! ((arg0 vector) (arg1 float) (arg2 (inline-array vector)) (arg3 int) (arg4 (pointer float)) (arg5 int)) + (local-vars (v1-7 int) (v1-8 int) (v1-10 float) (s3-0 int)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'static 'vector))) + 0 + (let* ((f0-0 (-> arg4 0)) + (f1-0 (-> arg4 (+ arg5 -1))) + (a2-1 (fmax (fmin (* arg1 f1-0) f1-0) f0-0)) + ) + (let* ((a1-1 (+ arg5 -5)) + (a3-1 3) + (f0-2 a2-1) + (v1-5 arg4) + (f0-3 f0-2) + ) + (b! (= f0-3 (-> v1-5 (+ a1-1 1))) cfg-11 :delay (set! s3-0 a1-1)) + (let* ((a0-4 (the int f0-3)) + (t1-1 (+ a0-4 3)) + (t2-1 (+ (* t1-1 4) (the-as int v1-5))) + (f1-4 (dynamic-array-field-access t2-1 PLACEHOLDER)) + (f2-3 (-> t2-1 1)) + ) + (cond + ((<= f1-4 f0-3) + (b! (>= f0-3 f2-3) cfg-4 :delay (set! s3-0 t1-1)) + ) + (else + (label cfg-4) + (let ((a3-2 a3-1) + (a1-2 (+ a1-1 1)) + ) + (label cfg-5) + (let ((t1-3 (/ (+ a3-2 a1-2) 2))) + (let ((t2-3 (&+ v1-5 (* t1-3 4)))) + (b! (>= f0-3 (dynamic-array-field-access t2-3 PLACEHOLDER)) cfg-7) + (b! #t cfg-5 :delay (set! a1-2 t1-3)) + (label cfg-7) + (b! (< f0-3 (-> t2-3 1)) cfg-9) + ) + (b! #t cfg-5 :delay (set! a3-2 t1-3)) + (label cfg-9) + (set! s3-0 t1-3) + ) + ) + (b! (= s3-0 a0-4) cfg-11 :delay (nop!)) + (nop!) + (nop!) + ) + ) + ) + ) + (label cfg-11) + (calculate-basis-functions-vector! s4-0 s3-0 a2-1 arg4) + ) + (.addiu v1-7 s3-0 -3) + (.lvf vf6 (&-> s4-0 quad)) + ) + (.sll v1-8 v1-7 4) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (let ((v1-9 (+ v1-8 (the-as int arg2)))) + (nop!) + (nop!) + (.lvf vf2 (&-> (the-as (pointer int128) v1-9))) + (nop!) + (.lvf vf3 (+ v1-9 16)) + (nop!) + (.lvf vf4 (+ v1-9 32)) + (nop!) + (.lvf vf5 (+ v1-9 48)) + ) + (.mul.x.vf acc vf2 vf6) + (nop!) + (.add.mul.y.vf acc vf3 vf6 acc :mask #b111) + (nop!) + (.add.mul.z.vf acc vf4 vf6 acc :mask #b111) + (nop!) + (.add.mul.w.vf vf1 vf5 vf6 acc :mask #b111) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (.svf (&-> arg0 quad) vf1) + (.mov v1-10 vf1) + arg0 + ) + ) + +;; definition for function curve-get-pos! +(defun curve-get-pos! ((arg0 vector) (arg1 float) (arg2 curve)) + (curve-evaluate! arg0 arg1 (-> arg2 cverts) (-> arg2 num-cverts) (-> arg2 knots) (-> arg2 num-knots)) + ) + +;; definition for function curve-length +;; INFO: Used lq/sq +(defun curve-length ((arg0 curve)) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (* 3 (-> arg0 num-cverts))) + (f30-0 0.0) + ) + (when (nonzero? s3-0) + (curve-evaluate! + s4-0 + (-> arg0 knots 0) + (-> arg0 cverts) + (-> arg0 num-cverts) + (-> arg0 knots) + (-> arg0 num-knots) + ) + (dotimes (s2-0 s3-0) + (set! (-> s5-0 quad) (-> s4-0 quad)) + (curve-evaluate! + s4-0 + (/ (the float (+ s2-0 1)) (the float s3-0)) + (-> arg0 cverts) + (-> arg0 num-cverts) + (-> arg0 knots) + (-> arg0 num-knots) + ) + (+! f30-0 (vector-vector-distance s5-0 s4-0)) + ) + ) + f30-0 + ) + ) + +;; definition for function curve-copy! +(defun curve-copy! ((arg0 curve) (arg1 curve)) + (set! (-> arg0 cverts) (-> arg1 cverts)) + (set! (-> arg0 num-cverts) (-> arg1 num-cverts)) + (set! (-> arg0 knots) (-> arg1 knots)) + (set! (-> arg0 num-knots) (-> arg1 num-knots)) + (set! (-> arg0 length) (-> arg1 length)) + arg0 + ) + +;; definition for function curve-closest-point +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +;; WARN: Stack slot offset 48 signed mismatch +(defun curve-closest-point ((arg0 curve) (arg1 vector) (arg2 float) (arg3 float) (arg4 int) (arg5 float)) + (local-vars (sv-48 float)) + (set! sv-48 arg3) + (let ((s3-0 arg4) + (gp-0 arg5) + (f30-0 (curve-length arg0)) + (s2-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + 0.0 + (let ((f28-0 0.5)) + 0.0 + (if (< 0.0 sv-48) + (set! f28-0 (/ sv-48 f30-0)) + ) + (let* ((s0-1 (- arg2 (/ gp-0 f30-0))) + (f26-0 (- s0-1 f28-0)) + (f24-0 (+ s0-1 f28-0)) + ) + (curve-get-pos! s2-0 f26-0 arg0) + (curve-get-pos! s1-0 f24-0 arg0) + (let ((f22-0 (vector-vector-distance-squared s2-0 arg1)) + (f20-0 (vector-vector-distance-squared s1-0 arg1)) + ) + (while (> s3-0 0) + (+! s3-0 -1) + (set! f28-0 (* 0.5 f28-0)) + (let ((v1-6 (cond + ((< f22-0 f20-0) + (curve-get-pos! s1-0 s0-1 arg0) + (set! f20-0 (vector-vector-distance-squared s1-0 arg1)) + (set! f24-0 s0-1) + (- s0-1 f28-0) + ) + (else + (curve-get-pos! s2-0 s0-1 arg0) + (set! f22-0 (vector-vector-distance-squared s2-0 arg1)) + (set! f26-0 s0-1) + (+ s0-1 f28-0) + ) + ) + ) + ) + (set! s0-1 (fmin 1.0 (fmax 0.0 v1-6))) + ) + ) + (+ (if (< f22-0 f20-0) + f26-0 + f24-0 + ) + (/ gp-0 f30-0) + ) + ) + ) + ) + ) + ) + +;; definition for function vector-plane-distance +(defun vector-plane-distance ((arg0 vector) (arg1 plane) (arg2 vector)) + (vector-dot (vector-! (new 'stack-no-clear 'vector) arg0 (the-as vector (&-> arg1 x))) arg2) + ) + +;; definition for function intersect-ray-plane +(defun intersect-ray-plane ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let ((f0-1 (vector-dot arg3 arg1))) + (if (= f0-1 0.0) + -1.0 + (/ (- (vector-dot arg3 arg0) (vector-dot arg3 arg2)) (- f0-1)) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc new file mode 100644 index 0000000000..dfac1d96e6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/geometry/path-h_REF.gc @@ -0,0 +1,242 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type path-control +(deftype path-control (basic) + ((flags path-control-flag :offset-assert 4) + (name symbol :offset-assert 8) + (process process-drawable :offset-assert 12) + (curve curve :inline :offset-assert 16) + (num-cverts int32 :offset 20) + (cverts (inline-array vector) :offset 16) + ) + :method-count-assert 27 + :size-assert #x24 + :flag-assert #x1b00000024 + (:methods + (new (symbol type process symbol float entity symbol) _type_ 0) + (path-control-method-9 () none 9) + (path-control-method-10 () none 10) + (path-control-method-11 () none 11) + (path-control-method-12 () none 12) + (path-control-method-13 () none 13) + (path-control-method-14 () none 14) + (path-control-method-15 () none 15) + (path-control-method-16 () none 16) + (get-num-segments (_type_) float 17) + (path-control-method-18 () none 18) + (get-num-verts (_type_) int 19) + (path-distance-equal-spacing (_type_ float) float 20) + (average-segment-length (_type_ float) float 21) + (path-control-method-22 () none 22) + (path-control-method-23 () none 23) + (path-control-method-24 () none 24) + (should-display-marks? (_type_) symbol 25) + (path-control-method-26 () none 26) + ) + ) + +;; definition for method 3 of type path-control +(defmethod inspect path-control ((obj path-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: #x~X~%" (-> obj flags)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tcurve: #~%" (-> obj curve)) + (format #t "~1Tnum-cverts: ~D~%" (-> obj curve num-cverts)) + (format #t "~1Tcverts: #x~X~%" (-> obj curve cverts)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> path-control method-table 9) nothing) + +;; definition of type curve-control +(deftype curve-control (path-control) + () + :method-count-assert 27 + :size-assert #x24 + :flag-assert #x1b00000024 + (:methods + (new (symbol type process symbol float) _type_ 0) + ) + ) + +;; definition for method 3 of type curve-control +(defmethod inspect curve-control ((obj curve-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: #x~X~%" (-> obj flags)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tcurve: #~%" (-> obj curve)) + (format #t "~1Tnum-cverts: ~D~%" (-> obj curve num-cverts)) + (format #t "~1Tcverts: #x~X~%" (-> obj curve cverts)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type path-control +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 32 mismatch: defined as size 4, got size 16 +;; INFO: Return type mismatch object vs path-control. +(defmethod new path-control ((allocation symbol) + (type-to-make type) + (arg0 process) + (arg1 symbol) + (arg2 float) + (arg3 entity) + (arg4 symbol) + ) + (local-vars (v0-3 object) (sv-16 res-tag) (sv-32 float)) + (set! sv-32 arg2) + (let ((s0-0 arg3) + (s1-0 arg4) + ) + (if (not s0-0) + (set! s0-0 (-> arg0 entity)) + ) + (when (= arg1 'path) + (let ((v0-0 (entity-actor-lookup s0-0 'path-actor 0))) + (if v0-0 + (set! s0-0 v0-0) + ) + ) + ) + (let ((s2-0 (the-as object 0))) + (set! sv-16 (new 'static 'res-tag)) + (let* ((t9-1 (method-of-type res-lump get-property-data)) + (a1-2 arg1) + (a2-2 'interp) + (t0-1 #f) + (t1-1 (the-as (pointer res-tag) (& sv-16))) + (t2-1 *res-static-buf*) + (s0-1 (t9-1 s0-0 a1-2 a2-2 sv-32 (the-as pointer t0-1) t1-1 t2-1)) + ) + (cond + (s0-1 + (set! s2-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + (set! v0-3 (cond + ((nonzero? (the-as path-control s2-0)) + (set! (-> (the-as path-control s2-0) process) (the-as process-drawable arg0)) + (set! (-> (the-as path-control s2-0) name) arg1) + (set! (-> (the-as path-control s2-0) curve cverts) (the-as (inline-array vector) s0-1)) + (set! v0-3 (-> sv-16 elt-count)) + (set! (-> (the-as path-control s2-0) curve num-cverts) (the-as int v0-3)) + v0-3 + ) + (else + (go process-drawable-art-error "memory") + ) + ) + ) + ) + (else + (when (not s1-0) + (set! s2-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))) + (cond + ((nonzero? (the-as path-control s2-0)) + (logior! (-> (the-as path-control s2-0) flags) (path-control-flag not-found)) + (set! (-> (the-as path-control s2-0) process) (the-as process-drawable arg0)) + (set! (-> (the-as path-control s2-0) name) arg1) + (set! (-> (the-as path-control s2-0) curve cverts) (the-as (inline-array vector) #f)) + (set! (-> (the-as path-control s2-0) curve num-cverts) 0) + 0 + ) + (else + (go process-drawable-art-error "memory") + ) + ) + ) + ) + ) + ) + (the-as path-control s2-0) + ) + ) + ) + +;; definition for method 25 of type path-control +(defmethod should-display-marks? path-control ((obj path-control)) + (and *display-path-marks* (logtest? (-> obj flags) (path-control-flag display))) + ) + +;; definition for method 17 of type path-control +(defmethod get-num-segments path-control ((obj path-control)) + (the float (+ (-> obj curve num-cverts) -1)) + ) + +;; definition for method 19 of type path-control +;; INFO: Return type mismatch int32 vs int. +(defmethod get-num-verts path-control ((obj path-control)) + (the-as int (-> obj curve num-cverts)) + ) + +;; definition for method 20 of type path-control +(defmethod path-distance-equal-spacing path-control ((obj path-control) (arg0 float)) + (* arg0 (get-num-segments obj)) + ) + +;; definition for method 21 of type path-control +(defmethod average-segment-length path-control ((obj path-control) (arg0 float)) + (/ arg0 (get-num-segments obj)) + ) + +;; definition for method 0 of type curve-control +(defmethod new curve-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 symbol) (arg2 float)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> gp-0 process) (the-as process-drawable arg0)) + (set! (-> gp-0 name) arg1) + (let* ((s3-1 (-> arg0 entity)) + (v1-2 arg1) + (s2-0 (cond + ((= v1-2 'path) + 'path-k + ) + (else + (let ((s2-1 string->symbol)) + (format (clear *temp-string*) "~A-k" arg1) + (s2-1 *temp-string*) + ) + ) + ) + ) + ) + (let ((v1-3 (entity-actor-lookup s3-1 'path-actor 0))) + (if v1-3 + (set! s3-1 v1-3) + ) + ) + (when (not (get-curve-data! s3-1 (-> gp-0 curve) arg1 s2-0 arg2)) + (cond + ((> (the-as int (-> gp-0 curve num-cverts)) 0) + (set! (-> gp-0 type) path-control) + ) + (else + (logior! (-> gp-0 flags) (path-control-flag not-found)) + (set! (-> gp-0 curve cverts) (the-as (inline-array vector) #f)) + (set! (-> gp-0 curve num-cverts) 0) + 0 + ) + ) + ) + ) + gp-0 + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc new file mode 100644 index 0000000000..2ba5eee2e1 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/background/background-h_REF.gc @@ -0,0 +1,64 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type background-work +(deftype background-work (basic) + ((tfrag-tree-count int32 :offset-assert 4) + (tfrag-trees drawable-tree-tfrag 8 :offset-assert 8) + (tfrag-levels level 8 :offset-assert 40) + (tfrag-trans-tree-count int32 :offset-assert 72) + (tfrag-trans-trees drawable-tree-tfrag-trans 8 :offset-assert 76) + (tfrag-trans-levels level 8 :offset-assert 108) + (tfrag-water-tree-count int32 :offset-assert 140) + (tfrag-water-trees drawable-tree-tfrag-water 8 :offset-assert 144) + (tfrag-water-levels level 8 :offset-assert 176) + (shrub-tree-count int32 :offset-assert 208) + (shrub-trees drawable-tree-instance-shrub 8 :offset-assert 212) + (shrub-levels level 8 :offset-assert 244) + (tie-tree-count int32 :offset-assert 276) + (tie-trees drawable-tree-instance-tie 8 :offset-assert 280) + (tie-levels level 8 :offset-assert 312) + (tie-generic basic 8 :offset-assert 344) + (tie-generic-trans basic 8 :offset-assert 376) + (wait-to-vu0 uint32 :offset-assert 408) + ) + :method-count-assert 9 + :size-assert #x19c + :flag-assert #x90000019c + ) + +;; definition for method 3 of type background-work +(defmethod inspect background-work ((obj background-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttfrag-tree-count: ~D~%" (-> obj tfrag-tree-count)) + (format #t "~1Ttfrag-trees[8] @ #x~X~%" (-> obj tfrag-trees)) + (format #t "~1Ttfrag-levels[8] @ #x~X~%" (-> obj tfrag-levels)) + (format #t "~1Ttfrag-trans-tree-count: ~D~%" (-> obj tfrag-trans-tree-count)) + (format #t "~1Ttfrag-trans-trees[8] @ #x~X~%" (-> obj tfrag-trans-trees)) + (format #t "~1Ttfrag-trans-levels[8] @ #x~X~%" (-> obj tfrag-trans-levels)) + (format #t "~1Ttfrag-water-tree-count: ~D~%" (-> obj tfrag-water-tree-count)) + (format #t "~1Ttfrag-water-trees[8] @ #x~X~%" (-> obj tfrag-water-trees)) + (format #t "~1Ttfrag-water-levels[8] @ #x~X~%" (-> obj tfrag-water-levels)) + (format #t "~1Tshrub-tree-count: ~D~%" (-> obj shrub-tree-count)) + (format #t "~1Tshrub-trees[8] @ #x~X~%" (-> obj shrub-trees)) + (format #t "~1Tshrub-levels[8] @ #x~X~%" (-> obj shrub-levels)) + (format #t "~1Ttie-tree-count: ~D~%" (-> obj tie-tree-count)) + (format #t "~1Ttie-trees[8] @ #x~X~%" (-> obj tie-trees)) + (format #t "~1Ttie-levels[8] @ #x~X~%" (-> obj tie-levels)) + (format #t "~1Ttie-generic[8] @ #x~X~%" (-> obj tie-generic)) + (format #t "~1Ttie-generic-trans[8] @ #x~X~%" (-> obj tie-generic-trans)) + (format #t "~1Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc new file mode 100644 index 0000000000..9d9b760159 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/background/prototype-h_REF.gc @@ -0,0 +1,434 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type prototype-bucket +(deftype prototype-bucket (basic) + ((name string :offset-assert 4) + (flags uint16 :offset-assert 8) + (texture-masks-index uint16 :offset-assert 10) + (in-level uint16 :offset-assert 12) + (utextures uint16 :offset-assert 14) + (geometry drawable 4 :offset-assert 16) + (dists vector :inline :offset-assert 32) + (rdists vector :inline :offset-assert 48) + (near-plane meters :offset 32) + (near-stiff meters :offset 36) + (mid-plane meters :offset 40) + (far-plane meters :offset 44) + (rlength-near float :offset 48) + (rlength-stiff float :offset 52) + (rlength-mid float :offset 56) + (stiffness float :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type prototype-bucket +(defmethod inspect prototype-bucket ((obj prototype-bucket)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) + (format #t "~1Tin-level: ~D~%" (-> obj in-level)) + (format #t "~1Tutextures: ~D~%" (-> obj utextures)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj geometry)) + (format #t "~1Tdists: #~%" (-> obj dists)) + (format #t "~1Trdists: #~%" (-> obj rdists)) + (format #t "~1Tnear-plane: (meters ~m)~%" (-> obj dists x)) + (format #t "~1Tnear-stiff: (meters ~m)~%" (-> obj dists y)) + (format #t "~1Tmid-plane: (meters ~m)~%" (-> obj dists z)) + (format #t "~1Tfar-plane: (meters ~m)~%" (-> obj dists w)) + (format #t "~1Trlength-near: ~f~%" (-> obj rdists x)) + (format #t "~1Trlength-stiff: ~f~%" (-> obj rdists y)) + (format #t "~1Trlength-mid: ~f~%" (-> obj rdists z)) + (format #t "~1Tstiffness: ~f~%" (-> obj rdists w)) + (label cfg-4) + obj + ) + +;; definition of type prototype-bucket-shrub +(deftype prototype-bucket-shrub (prototype-bucket) + ((next uint32 4 :offset-assert 64) + (count uint16 4 :offset-assert 80) + (mod-count uint16 4 :offset-assert 88) + (last dma-packet 4 :offset-assert 96) + (next-clear uint128 :offset 64) + (count-clear uint64 :offset 80) + (last-clear uint128 :offset 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type prototype-bucket-shrub +;; INFO: Used lq/sq +(defmethod inspect prototype-bucket-shrub ((obj prototype-bucket-shrub)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) + (format #t "~1Tin-level: ~D~%" (-> obj in-level)) + (format #t "~1Tutextures: ~D~%" (-> obj utextures)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj geometry)) + (format #t "~1Tdists: #~%" (-> obj dists)) + (format #t "~1Trdists: #~%" (-> obj rdists)) + (format #t "~1Tnear-plane: (meters ~m)~%" (-> obj dists x)) + (format #t "~1Tnear-stiff: (meters ~m)~%" (-> obj dists y)) + (format #t "~1Tmid-plane: (meters ~m)~%" (-> obj dists z)) + (format #t "~1Tfar-plane: (meters ~m)~%" (-> obj dists w)) + (format #t "~1Trlength-near: ~f~%" (-> obj rdists x)) + (format #t "~1Trlength-stiff: ~f~%" (-> obj rdists y)) + (format #t "~1Trlength-mid: ~f~%" (-> obj rdists z)) + (format #t "~1Tstiffness: ~f~%" (-> obj rdists w)) + (format #t "~1Tnext[4] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount[4] @ #x~X~%" (-> obj count)) + (format #t "~1Tmod-count[4] @ #x~X~%" (-> obj mod-count)) + (format #t "~1Tlast[4] @ #x~X~%" (-> obj last)) + (format #t "~1Tnext-clear: ~D~%" (-> obj next-clear)) + (format #t "~1Tcount-clear: ~D~%" (-> obj count-clear)) + (format #t "~1Tlast-clear: ~D~%" (-> obj last-clear)) + (label cfg-4) + obj + ) + +;; definition of type prototype-inline-array-shrub +(deftype prototype-inline-array-shrub (drawable) + ((length int16 :offset 6) + (data prototype-bucket-shrub 1 :inline :offset 32) + (_pad uint32 :offset-assert 144) + ) + :method-count-assert 17 + :size-assert #x94 + :flag-assert #x1100000094 + ) + +;; definition for method 3 of type prototype-inline-array-shrub +(defmethod inspect prototype-inline-array-shrub ((obj prototype-inline-array-shrub)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type prototype-array-shrub-info +(deftype prototype-array-shrub-info (basic) + ((prototype-inline-array-shrub prototype-inline-array-shrub :offset-assert 4) + (wind-vectors uint32 :offset-assert 8) + (wind-count int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type prototype-array-shrub-info +(defmethod inspect prototype-array-shrub-info ((obj prototype-array-shrub-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprototype-inline-array-shrub: ~A~%" (-> obj prototype-inline-array-shrub)) + (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) + (format #t "~1Twind-count: ~D~%" (-> obj wind-count)) + (label cfg-4) + obj + ) + +;; definition of type prototype-bucket-tie +(deftype prototype-bucket-tie (prototype-bucket) + ((next uint32 12 :offset-assert 64) + (count uint16 12 :offset-assert 112) + (frag-count uint8 4 :offset-assert 136) + (index-start uint8 4 :offset-assert 140) + (base-qw uint16 4 :offset-assert 144) + (tie-rvanish float :offset-assert 152) + (tie-vanish-far float :offset-assert 156) + (envmap-rfade float :offset-assert 160) + (envmap-fade-far float :offset-assert 164) + (envmap-shader adgif-shader :offset-assert 168) + (tint-color uint32 :offset-assert 172) + (collide-hash-fragment-array basic :offset-assert 176) + (tie-colors time-of-day-palette :offset-assert 180) + (data uint32 :dynamic :offset-assert 184) + (color-index-qwc uint32 :dynamic :offset-assert 184) + (scissor-frag-count uint8 :offset 136) + (near-frag-count uint8 :offset 137) + (mid-frag-count uint8 :offset 138) + (far-frag-count uint8 :offset 139) + (scissor-index-start uint8 :offset 140) + (near-index-start uint8 :offset 141) + (mid-index-start uint8 :offset 142) + (far-index-start uint8 :offset 143) + (scissor-base-qw uint16 :offset 144) + (near-base-qw uint16 :offset 146) + (mid-base-qw uint16 :offset 148) + (far-base-qw uint16 :offset 150) + (tie-next uint32 4 :offset 64) + (tie-scissor-next uint32 :offset 64) + (tie-near-next uint32 :offset 68) + (tie-mid-next uint32 :offset 72) + (tie-far-next uint32 :offset 76) + (trans-next uint32 4 :offset 64) + (trans-scissor-next uint32 4 :offset 64) + (trans-near-next uint32 :offset 68) + (trans-mid-next uint32 :offset 72) + (trans-far-next uint32 :offset 76) + (water-next uint32 4 :offset 64) + (water-scissor-next uint32 4 :offset 64) + (water-near-next uint32 :offset 68) + (water-mid-next uint32 :offset 72) + (water-far-next uint32 :offset 76) + (envmap-next uint32 4 :offset 80) + (envmap-scissor-next uint32 4 :offset 80) + (envmap-near-next uint32 :offset 84) + (envmap-mid-next uint32 :offset 88) + (envmap-far-next uint32 :offset 92) + (generic-next uint32 3 :offset 96) + (generic-near-next uint32 :offset 96) + (generic-mid-next uint32 :offset 100) + (generic-far-next uint32 :offset 104) + (vanish-next uint32 :offset 108) + (tie-count uint16 4 :offset 112) + (tie-scissor-count uint16 :offset 112) + (tie-near-count uint16 :offset 114) + (tie-mid-count uint16 :offset 116) + (tie-far-count uint16 :offset 118) + (trans-count uint16 4 :offset 112) + (trans-scissor-count uint16 :offset 112) + (trans-near-count uint16 :offset 114) + (trans-mid-count uint16 :offset 116) + (trans-far-count uint16 :offset 118) + (water-count uint16 4 :offset 112) + (water-scissor-count uint16 :offset 112) + (water-near-count uint16 :offset 114) + (water-mid-count uint16 :offset 116) + (water-far-count uint16 :offset 118) + (envmap-count uint16 4 :offset 120) + (envmap-scissor-count uint16 :offset 120) + (envmap-near-count uint16 :offset 122) + (envmap-mid-count uint16 :offset 124) + (envmap-far-count uint16 :offset 126) + (generic-count uint16 3 :offset 128) + (generic-near-count uint16 :offset 128) + (generic-mid-count uint16 :offset 130) + (generic-far-count uint16 :offset 132) + (vanish-count uint16 :offset 134) + (next-clear uint128 3 :offset 64) + (count-clear uint64 3 :offset 112) + (tie-geom prototype-tie 4 :offset 16) + ) + :method-count-assert 9 + :size-assert #xb8 + :flag-assert #x9000000b8 + ) + +;; definition for method 3 of type prototype-bucket-tie +(defmethod inspect prototype-bucket-tie ((obj prototype-bucket-tie)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) + (format #t "~1Tin-level: ~D~%" (-> obj in-level)) + (format #t "~1Tutextures: ~D~%" (-> obj utextures)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj tie-geom)) + (format #t "~1Tdists: #~%" (-> obj dists)) + (format #t "~1Trdists: #~%" (-> obj rdists)) + (format #t "~1Tnear-plane: (meters ~m)~%" (-> obj dists x)) + (format #t "~1Tnear-stiff: (meters ~m)~%" (-> obj dists y)) + (format #t "~1Tmid-plane: (meters ~m)~%" (-> obj dists z)) + (format #t "~1Tfar-plane: (meters ~m)~%" (-> obj dists w)) + (format #t "~1Trlength-near: ~f~%" (-> obj rdists x)) + (format #t "~1Trlength-stiff: ~f~%" (-> obj rdists y)) + (format #t "~1Trlength-mid: ~f~%" (-> obj rdists z)) + (format #t "~1Tstiffness: ~f~%" (-> obj rdists w)) + (format #t "~1Tnext[12] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount[12] @ #x~X~%" (-> obj count)) + (format #t "~1Tfrag-count[4] @ #x~X~%" (-> obj frag-count)) + (format #t "~1Tindex-start[4] @ #x~X~%" (-> obj index-start)) + (format #t "~1Tbase-qw[4] @ #x~X~%" (-> obj base-qw)) + (format #t "~1Ttie-rvanish: ~f~%" (-> obj tie-rvanish)) + (format #t "~1Ttie-vanish-far: ~f~%" (-> obj tie-vanish-far)) + (format #t "~1Tenvmap-rfade: ~f~%" (-> obj envmap-rfade)) + (format #t "~1Tenvmap-fade-far: ~f~%" (-> obj envmap-fade-far)) + (format #t "~1Tenvmap-shader: #~%" (-> obj envmap-shader)) + (format #t "~1Ttint-color: ~D~%" (-> obj tint-color)) + (format #t "~1Tcollide-hash-fragment-array: ~A~%" (-> obj collide-hash-fragment-array)) + (format #t "~1Ttie-colors: ~A~%" (-> obj tie-colors)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "~1Tcolor-index-qwc[0] @ #x~X~%" (-> obj data)) + (format #t "~1Tscissor-frag-count: ~D~%" (-> obj scissor-frag-count)) + (format #t "~1Tnear-frag-count: ~D~%" (-> obj near-frag-count)) + (format #t "~1Tmid-frag-count: ~D~%" (-> obj mid-frag-count)) + (format #t "~1Tfar-frag-count: ~D~%" (-> obj far-frag-count)) + (format #t "~1Tscissor-index-start: ~D~%" (-> obj scissor-index-start)) + (format #t "~1Tnear-index-start: ~D~%" (-> obj near-index-start)) + (format #t "~1Tmid-index-start: ~D~%" (-> obj mid-index-start)) + (format #t "~1Tfar-index-start: ~D~%" (-> obj far-index-start)) + (format #t "~1Tscissor-base-qw: ~D~%" (-> obj scissor-base-qw)) + (format #t "~1Tnear-base-qw: ~D~%" (-> obj near-base-qw)) + (format #t "~1Tmid-base-qw: ~D~%" (-> obj mid-base-qw)) + (format #t "~1Tfar-base-qw: ~D~%" (-> obj far-base-qw)) + (format #t "~1Ttie-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Ttie-scissor-next: #x~X~%" (-> obj tie-scissor-next)) + (format #t "~1Ttie-near-next: #x~X~%" (-> obj tie-near-next)) + (format #t "~1Ttie-mid-next: #x~X~%" (-> obj tie-mid-next)) + (format #t "~1Ttie-far-next: #x~X~%" (-> obj tie-far-next)) + (format #t "~1Ttrans-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Ttrans-near-next: #x~X~%" (-> obj tie-near-next)) + (format #t "~1Ttrans-mid-next: #x~X~%" (-> obj tie-mid-next)) + (format #t "~1Ttrans-far-next: #x~X~%" (-> obj tie-far-next)) + (format #t "~1Twater-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Twater-near-next: #x~X~%" (-> obj tie-near-next)) + (format #t "~1Twater-mid-next: #x~X~%" (-> obj tie-mid-next)) + (format #t "~1Twater-far-next: #x~X~%" (-> obj tie-far-next)) + (format #t "~1Tenvmap-next[4] @ #x~X~%" (-> obj envmap-next)) + (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> obj envmap-next)) + (format #t "~1Tenvmap-near-next: #x~X~%" (-> obj envmap-near-next)) + (format #t "~1Tenvmap-mid-next: #x~X~%" (-> obj envmap-mid-next)) + (format #t "~1Tenvmap-far-next: #x~X~%" (-> obj envmap-far-next)) + (format #t "~1Tgeneric-next[3] @ #x~X~%" (-> obj generic-next)) + (format #t "~1Tgeneric-near-next: #x~X~%" (-> obj generic-near-next)) + (format #t "~1Tgeneric-mid-next: #x~X~%" (-> obj generic-mid-next)) + (format #t "~1Tgeneric-far-next: #x~X~%" (-> obj generic-far-next)) + (format #t "~1Tvanish-next: #x~X~%" (-> obj vanish-next)) + (format #t "~1Ttie-count[4] @ #x~X~%" (-> obj count)) + (format #t "~1Ttie-scissor-count: ~D~%" (-> obj tie-scissor-count)) + (format #t "~1Ttie-near-count: ~D~%" (-> obj tie-near-count)) + (format #t "~1Ttie-mid-count: ~D~%" (-> obj tie-mid-count)) + (format #t "~1Ttie-far-count: ~D~%" (-> obj tie-far-count)) + (format #t "~1Ttrans-count[4] @ #x~X~%" (-> obj count)) + (format #t "~1Ttrans-scissor-count: ~D~%" (-> obj tie-scissor-count)) + (format #t "~1Ttrans-near-count: ~D~%" (-> obj tie-near-count)) + (format #t "~1Ttrans-mid-count: ~D~%" (-> obj tie-mid-count)) + (format #t "~1Ttrans-far-count: ~D~%" (-> obj tie-far-count)) + (format #t "~1Twater-count[4] @ #x~X~%" (-> obj count)) + (format #t "~1Twater-scissor-count: ~D~%" (-> obj tie-scissor-count)) + (format #t "~1Twater-near-count: ~D~%" (-> obj tie-near-count)) + (format #t "~1Twater-mid-count: ~D~%" (-> obj tie-mid-count)) + (format #t "~1Twater-far-count: ~D~%" (-> obj tie-far-count)) + (format #t "~1Tenvmap-count[4] @ #x~X~%" (-> obj envmap-count)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> obj envmap-scissor-count)) + (format #t "~1Tenvmap-near-count: ~D~%" (-> obj envmap-near-count)) + (format #t "~1Tenvmap-mid-count: ~D~%" (-> obj envmap-mid-count)) + (format #t "~1Tenvmap-far-count: ~D~%" (-> obj envmap-far-count)) + (format #t "~1Tgeneric-count[3] @ #x~X~%" (-> obj generic-count)) + (format #t "~1Tgeneric-near-count: ~D~%" (-> obj generic-near-count)) + (format #t "~1Tgeneric-mid-count: ~D~%" (-> obj generic-mid-count)) + (format #t "~1Tgeneric-far-count: ~D~%" (-> obj generic-far-count)) + (format #t "~1Tvanish-count: ~D~%" (-> obj vanish-count)) + (format #t "~1Tnext-clear[3] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount-clear[3] @ #x~X~%" (-> obj count)) + (label cfg-4) + obj + ) + +;; definition of type prototype-array-tie +(deftype prototype-array-tie (array) + ((array-data prototype-bucket-tie :dynamic :offset 16) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (login (_type_) none 9) + ) + ) + +;; definition for method 3 of type prototype-array-tie +(defmethod inspect prototype-array-tie ((obj prototype-array-tie)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttype: ~A~%" (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tcontent-type: ~A~%" (-> obj content-type)) + (label cfg-4) + obj + ) + +;; definition of type proxy-prototype-array-tie +(deftype proxy-prototype-array-tie (basic) + ((prototype-array-tie prototype-array-tie :offset-assert 4) + (wind-vectors uint32 :offset-assert 8) + (wind-count uint16 :offset-assert 12) + (prototype-max-qwc uint16 :offset-assert 14) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type proxy-prototype-array-tie +(defmethod inspect proxy-prototype-array-tie ((obj proxy-prototype-array-tie)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprototype-array-tie: ~A~%" (-> obj prototype-array-tie)) + (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) + (format #t "~1Twind-count: ~D~%" (-> obj wind-count)) + (format #t "~1Tprototype-max-qwc: ~D~%" (-> obj prototype-max-qwc)) + (label cfg-4) + obj + ) + +;; definition of type instance +(deftype instance (drawable) + ((bucket-index uint16 :offset 6) + (origin matrix4h :inline :offset-assert 32) + (flags uint16 :offset 46) + (wind-index uint16 :offset 62) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +;; definition for method 3 of type instance +(defmethod inspect instance ((obj instance)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> obj bucket-index)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Twind-index: ~D~%" (-> obj wind-index)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc new file mode 100644 index 0000000000..0106268c33 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/background/subdivide-h_REF.gc @@ -0,0 +1,377 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type subdivide-settings +(deftype subdivide-settings (basic) + ((dist float 5 :offset-assert 4) + (meters float 5 :offset-assert 24) + (close float 8 :offset-assert 44) + (far float 8 :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x6c + :flag-assert #x90000006c + (:methods + (new (symbol type meters meters) _type_ 0) + ) + ) + +;; definition for method 3 of type subdivide-settings +(defmethod inspect subdivide-settings ((obj subdivide-settings)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdist[5] @ #x~X~%" (-> obj dist)) + (format #t "~1Tmeters[5] @ #x~X~%" (-> obj meters)) + (format #t "~1Tclose[8] @ #x~X~%" (-> obj close)) + (format #t "~1Tfar[8] @ #x~X~%" (-> obj far)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type subdivide-settings +(defmethod new subdivide-settings ((allocation symbol) (type-to-make type) (arg0 meters) (arg1 meters)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (dotimes (v1-2 6) + (set! (-> v0-0 close v1-2) arg0) + (set! (-> v0-0 far v1-2) arg1) + ) + v0-0 + ) + ) + +;; definition of type subdivide-dists +(deftype subdivide-dists (structure) + ((data uint32 32 :offset-assert 0) + (vector vector 8 :inline :offset 0) + (k0s uint128 4 :offset 0) + (k1s uint128 4 :offset 64) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type subdivide-dists +(defmethod inspect subdivide-dists ((obj subdivide-dists)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'subdivide-dists) + (format #t "~1Tdata[32] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tk0s[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tk1s[4] @ #x~X~%" (-> obj k1s)) + (label cfg-4) + obj + ) + +;; definition of type terrain-stats +(deftype terrain-stats (structure) + ((pris tr-stat :inline :offset-assert 0) + (tie-generic tr-stat :inline :offset-assert 16) + (tie-vanish tr-stat :inline :offset-assert 32) + (tie tr-stat :inline :offset-assert 48) + (tie-scissor tr-stat :inline :offset-assert 64) + (tie-envmap tr-stat :inline :offset-assert 80) + (tie-envmap-scissor tr-stat :inline :offset-assert 96) + (tie-trans tr-stat :inline :offset-assert 112) + (tie-scissor-trans tr-stat :inline :offset-assert 128) + (tie-envmap-trans tr-stat :inline :offset-assert 144) + (tie-envmap-scissor-trans tr-stat :inline :offset-assert 160) + (tie-water tr-stat :inline :offset-assert 176) + (tie-scissor-water tr-stat :inline :offset-assert 192) + (tie-envmap-water tr-stat :inline :offset-assert 208) + (tie-envmap-scissor-water tr-stat :inline :offset-assert 224) + (shrub-near tr-stat :inline :offset-assert 240) + (shrub tr-stat :inline :offset-assert 256) + (tfrag-scissor tr-stat :inline :offset-assert 272) + (tfrag tr-stat :inline :offset-assert 288) + (billboard tr-stat :inline :offset-assert 304) + (tfrag-trans tr-stat :inline :offset-assert 320) + (tfrag-scissor-trans tr-stat :inline :offset-assert 336) + (tfrag-water tr-stat :inline :offset-assert 352) + (tfrag-scissor-water tr-stat :inline :offset-assert 368) + (trans-pris tr-stat :inline :offset-assert 384) + (trans-shrub tr-stat :inline :offset-assert 400) + (ocean-mid tr-stat :inline :offset-assert 416) + (ocean-near tr-stat :inline :offset-assert 432) + (shadow tr-stat :inline :offset-assert 448) + (total tr-stat :inline :offset-assert 464) + ) + :method-count-assert 9 + :size-assert #x1e0 + :flag-assert #x9000001e0 + ) + +;; definition for method 3 of type terrain-stats +(defmethod inspect terrain-stats ((obj terrain-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'terrain-stats) + (format #t "~1Tpris: #~%" (-> obj pris)) + (format #t "~1Ttie-generic: #~%" (-> obj tie-generic)) + (format #t "~1Ttie-vanish: #~%" (-> obj tie-vanish)) + (format #t "~1Ttie: #~%" (-> obj tie)) + (format #t "~1Ttie-scissor: #~%" (-> obj tie-scissor)) + (format #t "~1Ttie-envmap: #~%" (-> obj tie-envmap)) + (format #t "~1Ttie-envmap-scissor: #~%" (-> obj tie-envmap-scissor)) + (format #t "~1Ttie-trans: #~%" (-> obj tie-trans)) + (format #t "~1Ttie-scissor-trans: #~%" (-> obj tie-scissor-trans)) + (format #t "~1Ttie-envmap-trans: #~%" (-> obj tie-envmap-trans)) + (format #t "~1Ttie-envmap-scissor-trans: #~%" (-> obj tie-envmap-scissor-trans)) + (format #t "~1Ttie-water: #~%" (-> obj tie-water)) + (format #t "~1Ttie-scissor-water: #~%" (-> obj tie-scissor-water)) + (format #t "~1Ttie-envmap-water: #~%" (-> obj tie-envmap-water)) + (format #t "~1Ttie-envmap-scissor-water: #~%" (-> obj tie-envmap-scissor-water)) + (format #t "~1Tshrub-near: #~%" (-> obj shrub-near)) + (format #t "~1Tshrub: #~%" (-> obj shrub)) + (format #t "~1Ttfrag-scissor: #~%" (-> obj tfrag-scissor)) + (format #t "~1Ttfrag: #~%" (-> obj tfrag)) + (format #t "~1Tbillboard: #~%" (-> obj billboard)) + (format #t "~1Ttfrag-trans: #~%" (-> obj tfrag-trans)) + (format #t "~1Ttfrag-scissor-trans: #~%" (-> obj tfrag-scissor-trans)) + (format #t "~1Ttfrag-water: #~%" (-> obj tfrag-water)) + (format #t "~1Ttfrag-scissor-water: #~%" (-> obj tfrag-scissor-water)) + (format #t "~1Ttrans-pris: #~%" (-> obj trans-pris)) + (format #t "~1Ttrans-shrub: #~%" (-> obj trans-shrub)) + (format #t "~1Tocean-mid: #~%" (-> obj ocean-mid)) + (format #t "~1Tocean-near: #~%" (-> obj ocean-near)) + (format #t "~1Tshadow: #~%" (-> obj shadow)) + (format #t "~1Ttotal: #~%" (-> obj total)) + (label cfg-4) + obj + ) + +;; definition of type dma-area +(deftype dma-area (structure) + ((instance-shrub-dma instance-shrub-dma :inline :offset 0) + (draw-node-dma draw-node-dma :inline :offset 0) + (tfrag-dma tfrag-dma :inline :offset 0) + (instance-tie-dma instance-tie-dma :inline :offset 0) + (prototype-tie-dma prototype-tie-dma :inline :offset 0) + (wind-dma wind-dma :inline :offset 0) + (time-of-day-dma time-of-day-dma :inline :offset 0) + (decomp-work decomp-work :inline :offset 0) + (ocean-vertex ocean-vertex 4 :offset 0) + ) + :method-count-assert 9 + :size-assert #x38a0 + :flag-assert #x9000038a0 + ) + +;; definition for method 3 of type dma-area +(defmethod inspect dma-area ((obj dma-area)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'dma-area) + (format #t "~1Tinstance-shrub-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Tdraw-node-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Ttfrag-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Tinstance-tie-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Tprototype-tie-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Twind-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Ttime-of-day-dma: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Tdecomp-work: #~%" (-> obj instance-shrub-dma)) + (format #t "~1Tocean-vertex[4] @ #x~X~%" (-> obj instance-shrub-dma)) + (label cfg-4) + obj + ) + +;; definition of type background-area +(deftype background-area (structure) + ((dma-area dma-area :inline :offset-assert 0) + (vis-list uint8 2048 :offset-assert 14496) + ) + :method-count-assert 9 + :size-assert #x40a0 + :flag-assert #x9000040a0 + ) + +;; definition for method 3 of type background-area +(defmethod inspect background-area ((obj background-area)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'background-area) + (format #t "~1Tdma-area: #~%" (-> obj dma-area)) + (format #t "~1Tvis-list[2048] @ #x~X~%" (-> obj vis-list)) + (label cfg-4) + obj + ) + +;; definition of type foreground-area +(deftype foreground-area (structure) + ((generic-work generic-work :inline :offset-assert 0) + (foreground-work foreground-work :inline :offset 0) + (joint-work joint-work :inline :offset 0) + (bone-mem bone-memory :inline :offset 0) + (shadow-work shadow-work :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x3fe0 + :flag-assert #x900003fe0 + ) + +;; definition for method 3 of type foreground-area +(defmethod inspect foreground-area ((obj foreground-area)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-area) + (format #t "~1Tgeneric-work: #~%" (-> obj generic-work)) + (format #t "~1Tforeground-work: #~%" (-> obj generic-work)) + (format #t "~1Tjoint-work: #~%" (-> obj generic-work)) + (format #t "~1Tbone-mem: #~%" (-> obj generic-work)) + (format #t "~1Tshadow-work: #~%" (-> obj generic-work)) + (label cfg-4) + obj + ) + +;; definition of type region-prim-area +(deftype region-prim-area (structure) + ((region-prim-list region-prim-list :inline :offset-assert 0) + (pos vector :inline :offset-assert 1296) + (ray vector :inline :offset 1328) + (region-enter-count int32 :offset 1360) + (region-enter-list uint32 320 :offset-assert 1364) + (region-enter-prim-list uint32 320 :offset-assert 2644) + (region-exit-count int32 :offset-assert 3924) + (region-exit-list uint32 320 :offset-assert 3928) + (region-exit-prim-list uint32 320 :offset-assert 5208) + (region-inside-count int32 :offset-assert 6488) + (region-inside-list uint32 320 :offset-assert 6492) + (region-inside-prim-list uint32 320 :offset-assert 7772) + (region-start-count int32 :offset-assert 9052) + (region-start-list uint32 320 :offset-assert 9056) + (region-start-prim-list uint32 320 :offset-assert 10336) + ) + :method-count-assert 13 + :size-assert #x2d60 + :flag-assert #xd00002d60 + (:methods + (region-prim-area-method-9 () none 9) + (region-prim-area-method-10 () none 10) + (region-prim-area-method-11 () none 11) + (region-prim-area-method-12 () none 12) + ) + ) + +;; definition for method 3 of type region-prim-area +(defmethod inspect region-prim-area ((obj region-prim-area)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'region-prim-area) + (format #t "~1Tregion-prim-list: #~%" (-> obj region-prim-list)) + (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) + (format #t "~1Tray: ~`vector`P~%" (-> obj ray)) + (format #t "~1Tregion-enter-count: ~D~%" (-> obj region-enter-count)) + (format #t "~1Tregion-enter-list[320] @ #x~X~%" (-> obj region-enter-list)) + (format #t "~1Tregion-enter-prim-list[320] @ #x~X~%" (-> obj region-enter-prim-list)) + (format #t "~1Tregion-exit-count: ~D~%" (-> obj region-exit-count)) + (format #t "~1Tregion-exit-list[320] @ #x~X~%" (-> obj region-exit-list)) + (format #t "~1Tregion-exit-prim-list[320] @ #x~X~%" (-> obj region-exit-prim-list)) + (format #t "~1Tregion-inside-count: ~D~%" (-> obj region-inside-count)) + (format #t "~1Tregion-inside-list[320] @ #x~X~%" (-> obj region-inside-list)) + (format #t "~1Tregion-inside-prim-list[320] @ #x~X~%" (-> obj region-inside-prim-list)) + (format #t "~1Tregion-start-count: ~D~%" (-> obj region-start-count)) + (format #t "~1Tregion-start-list[320] @ #x~X~%" (-> obj region-start-list)) + (format #t "~1Tregion-start-prim-list[320] @ #x~X~%" (-> obj region-start-prim-list)) + (label cfg-4) + obj + ) + +;; definition of type sprite-area +(deftype sprite-area (structure) + ((clock-data vector 13 :inline :offset-assert 0) + (buffer uint8 :dynamic :offset-assert 208) + ) + :method-count-assert 9 + :size-assert #xd0 + :flag-assert #x9000000d0 + ) + +;; definition for method 3 of type sprite-area +(defmethod inspect sprite-area ((obj sprite-area)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sprite-area) + (format #t "~1Tclock-data[13] @ #x~X~%" (-> obj clock-data)) + (format #t "~1Tbuffer[0] @ #x~X~%" (-> obj buffer)) + (label cfg-4) + obj + ) + +;; definition of type work-area +(deftype work-area (structure) + ((background background-area :inline :offset-assert 0) + (foreground foreground-area :inline :offset 0) + (region-prim region-prim-area :inline :offset 0) + (sprite sprite-area :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x40a0 + :flag-assert #x9000040a0 + ) + +;; definition for method 3 of type work-area +(defmethod inspect work-area ((obj work-area)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'work-area) + (format #t "~1Tbackground: #~%" (-> obj background)) + (format #t "~1Tforeground: #~%" (-> obj background)) + (format #t "~1Tregion-prim: #~%" (-> obj background)) + (format #t "~1Tsprite: #~%" (-> obj background)) + (label cfg-4) + obj + ) + +;; definition of type terrain-context +(deftype terrain-context (structure) + ((work work-area :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40a0 + :flag-assert #x9000040a0 + ) + +;; definition for method 3 of type terrain-context +(defmethod inspect terrain-context ((obj terrain-context)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'terrain-context) + (format #t "~1Twork: #~%" (-> obj work)) + (label cfg-4) + obj + ) + +;; definition for symbol *terrain-stats*, type terrain-stats +(define *terrain-stats* (new 'global 'terrain-stats)) + +;; definition for symbol *collide-stats*, type collide-stats +(define *collide-stats* (new 'global 'collide-stats)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc new file mode 100644 index 0000000000..df0f0e84bb --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/background/wind-h_REF.gc @@ -0,0 +1,156 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type wind-vector +(deftype wind-vector (structure) + ((wind-pos vector4w :inline :offset-assert 0) + (wind-vel vector4w :inline :offset-assert 16) + (stiffness float :offset 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type wind-vector +(defmethod inspect wind-vector ((obj wind-vector)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'wind-vector) + (format #t "~1Twind-pos: #~%" (-> obj wind-pos)) + (format #t "~1Twind-vel: #~%" (-> obj wind-vel)) + (format #t "~1Tstiffness: ~f~%" (-> obj stiffness)) + (label cfg-4) + obj + ) + +;; definition for symbol *wind-scales*, type (array uint8) +(define *wind-scales* (the-as (array uint8) (new 'static 'boxed-array :type uint8 + #x2 + #x5 + #x2 + #x3 + #x2 + #x2 + #x3 + #x10 + #xa + #x2 + #x4 + #x2 + #x8 + #x2 + #x2 + #x10 + #x2 + #x2 + #x8 + #x2 + #x10 + #x2 + #x4 + #x10 + #xa + #x2 + #x4 + #x2 + #x8 + #x2 + #x2 + #x10 + ) + ) + ) + +;; definition of type wind-work +(deftype wind-work (basic) + ((wind-array vector 64 :inline :offset-assert 16) + (wind-normal vector :inline :offset-assert 1040) + (wind-temp vector :inline :offset-assert 1056) + (wind-force float 64 :offset-assert 1072) + (wind-const vector :inline :offset-assert 1328) + (wind-time uint32 :offset-assert 1344) + (wait-to-vu0 uint32 :offset-assert 1348) + (wait-to-spr uint32 :offset-assert 1352) + (wait-from-spr uint32 :offset-assert 1356) + (spr-index uint32 :offset-assert 1360) + (count uint32 :offset-assert 1364) + (next-count uint32 :offset-assert 1368) + (last-count uint32 :offset-assert 1372) + (to-spr uint32 :offset-assert 1376) + (from-spr uint32 :offset-assert 1380) + (next-mem uint32 :offset-assert 1384) + (last-mem uint32 :offset-assert 1388) + (next-spr uint32 :offset-assert 1392) + (last-spr uint32 :offset-assert 1396) + (to-ptrs uint32 3 :offset-assert 1400) + ) + :method-count-assert 9 + :size-assert #x584 + :flag-assert #x900000584 + ) + +;; definition for method 3 of type wind-work +(defmethod inspect wind-work ((obj wind-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twind-array[64] @ #x~X~%" (-> obj wind-array)) + (format #t "~1Twind-normal: ~`vector`P~%" (-> obj wind-normal)) + (format #t "~1Twind-temp: ~`vector`P~%" (-> obj wind-temp)) + (format #t "~1Twind-force[64] @ #x~X~%" (-> obj wind-force)) + (format #t "~1Twind-const: ~`vector`P~%" (-> obj wind-const)) + (format #t "~1Twind-time: ~D~%" (-> obj wind-time)) + (format #t "~1Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) + (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) + (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) + (format #t "~1Tspr-index: ~D~%" (-> obj spr-index)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tnext-count: ~D~%" (-> obj next-count)) + (format #t "~1Tlast-count: ~D~%" (-> obj last-count)) + (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> obj from-spr)) + (format #t "~1Tnext-mem: #x~X~%" (-> obj next-mem)) + (format #t "~1Tlast-mem: #x~X~%" (-> obj last-mem)) + (format #t "~1Tnext-spr: #x~X~%" (-> obj next-spr)) + (format #t "~1Tlast-spr: #x~X~%" (-> obj last-spr)) + (format #t "~1Tto-ptrs[3] @ #x~X~%" (-> obj to-ptrs)) + (label cfg-4) + obj + ) + +;; definition of type wind-dma +(deftype wind-dma (structure) + ((buffer0 wind-vector 128 :inline :offset-assert 0) + (buffer1 wind-vector 128 :inline :offset-assert 4096) + (buffer2 wind-vector 128 :inline :offset-assert 8192) + ) + :method-count-assert 9 + :size-assert #x3000 + :flag-assert #x900003000 + ) + +;; definition for method 3 of type wind-dma +(defmethod inspect wind-dma ((obj wind-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'wind-dma) + (format #t "~1Tbuffer0[128] @ #x~X~%" (-> obj buffer0)) + (format #t "~1Tbuffer1[128] @ #x~X~%" (-> obj buffer1)) + (format #t "~1Tbuffer2[128] @ #x~X~%" (-> obj buffer2)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc new file mode 100644 index 0000000000..e29a3c5651 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/blit-displays-h_REF.gc @@ -0,0 +1,66 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type blit-displays-work +(deftype blit-displays-work (structure) + ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl dma-gif-packet :inline :offset-assert 32) + (sprite-slow-tmpl dma-gif-packet :inline :offset-assert 64) + (line-tmpl dma-gif-packet :inline :offset-assert 96) + (scan-tmpl dma-gif-packet :inline :offset-assert 128) + (color vector4w :inline :offset-assert 160) + (line-color uint64 :offset-assert 176) + (scan-colors vector4w 15 :inline :offset-assert 192) + (menu-mode basic :offset-assert 432) + (screen-copied basic :offset-assert 436) + (vu1-enable-user-menu uint64 :offset-assert 440) + (texture-enable-user-menu uint32 :offset-assert 448) + (count-down uint32 :offset-assert 452) + (horizontal-flip-flag basic :offset-assert 456) + (scan-alpha float :offset-assert 460) + (scanline uint32 :offset-assert 464) + (progress-interp float :offset-assert 468) + (progress-interp-dest float :offset-assert 472) + (progress-interp-speed float :offset-assert 476) + ) + :method-count-assert 9 + :size-assert #x1e0 + :flag-assert #x9000001e0 + ) + +;; definition for method 3 of type blit-displays-work +(defmethod inspect blit-displays-work ((obj blit-displays-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'blit-displays-work) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tsprite-slow-tmpl: #~%" (-> obj sprite-slow-tmpl)) + (format #t "~1Tline-tmpl: #~%" (-> obj line-tmpl)) + (format #t "~1Tscan-tmpl: #~%" (-> obj scan-tmpl)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tline-color: ~D~%" (-> obj line-color)) + (format #t "~1Tscan-colors[15] @ #x~X~%" (-> obj scan-colors)) + (format #t "~1Tmenu-mode: ~A~%" (-> obj menu-mode)) + (format #t "~1Tscreen-copied: ~A~%" (-> obj screen-copied)) + (format #t "~1Tvu1-enable-user-menu: ~D~%" (-> obj vu1-enable-user-menu)) + (format #t "~1Ttexture-enable-user-menu: ~D~%" (-> obj texture-enable-user-menu)) + (format #t "~1Tcount-down: ~D~%" (-> obj count-down)) + (format #t "~1Thorizontal-flip-flag: ~A~%" (-> obj horizontal-flip-flag)) + (format #t "~1Tscan-alpha: ~f~%" (-> obj scan-alpha)) + (format #t "~1Tscanline: ~D~%" (-> obj scanline)) + (format #t "~1Tprogress-interp: ~f~%" (-> obj progress-interp)) + (format #t "~1Tprogress-interp-dest: ~f~%" (-> obj progress-interp-dest)) + (format #t "~1Tprogress-interp-speed: ~f~%" (-> obj progress-interp-speed)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc new file mode 100644 index 0000000000..099413c2a9 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/bones-h_REF.gc @@ -0,0 +1,214 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bone-buffer +(deftype bone-buffer (structure) + ((joint joint-anim-compressed-hdr 16 :inline :offset-assert 0) + (bone bone 16 :inline :offset-assert 1024) + (_pad uint8 2048 :offset-assert 2304) + ) + :method-count-assert 9 + :size-assert #x1100 + :flag-assert #x900001100 + ) + +;; definition for method 3 of type bone-buffer +(defmethod inspect bone-buffer ((obj bone-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-buffer) + (format #t "~1Tjoint[16] @ #x~X~%" (-> obj joint)) + (format #t "~1Tbone[16] @ #x~X~%" (-> obj bone)) + (format #t "~1Toutput[16] @ #x~X~%" (-> obj _pad)) + (label cfg-4) + obj + ) + +;; definition of type bone-layout +(deftype bone-layout (structure) + ((data uint16 8 :offset-assert 0) + (joint joint 2 :offset 0) + (bone bone 2 :offset 8) + (output uint32 2 :offset 16) + (unused uint32 2 :offset 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type bone-layout +(defmethod inspect bone-layout ((obj bone-layout)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-layout) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tjoint[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tbone[2] @ #x~X~%" (-> obj bone)) + (format #t "~1Toutput[2] @ #x~X~%" (-> obj output)) + (format #t "~1Tunused[2] @ #x~X~%" (-> obj unused)) + (label cfg-4) + obj + ) + +;; definition of type bone-regs +(deftype bone-regs (structure) + ((dma-buf basic :offset-assert 0) + (wait-count uint32 :offset-assert 4) + (in-count uint32 :offset-assert 8) + (sp-size uint32 :offset-assert 12) + (sp-bufnum uint32 :offset-assert 16) + (joint-ptr (inline-array joint) :offset-assert 20) + (bone-ptr (inline-array bone) :offset-assert 24) + (num-bones uint32 :offset-assert 28) + (mtxs uint32 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type bone-regs +(defmethod inspect bone-regs ((obj bone-regs)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-regs) + (format #t "~1Tdma-buf: ~A~%" (-> obj dma-buf)) + (format #t "~1Twait-count: ~D~%" (-> obj wait-count)) + (format #t "~1Tin-count: ~D~%" (-> obj in-count)) + (format #t "~1Tsp-size: ~D~%" (-> obj sp-size)) + (format #t "~1Tsp-bufnum: ~D~%" (-> obj sp-bufnum)) + (format #t "~1Tjoint-ptr: #x~X~%" (-> obj joint-ptr)) + (format #t "~1Tbone-ptr: #x~X~%" (-> obj bone-ptr)) + (format #t "~1Tnum-bones: ~D~%" (-> obj num-bones)) + (format #t "~1Tmtxs: #x~X~%" (-> obj mtxs)) + (label cfg-4) + obj + ) + +;; definition of type bone-work +(deftype bone-work (structure) + ((layout bone-layout :inline :offset-assert 0) + (regs bone-regs :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +;; definition for method 3 of type bone-work +(defmethod inspect bone-work ((obj bone-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-work) + (format #t "~1Tlayout: #~%" (-> obj layout)) + (format #t "~1Tregs: #~%" (-> obj regs)) + (label cfg-4) + obj + ) + +;; definition of type bone-debug +(deftype bone-debug (structure) + ((time-ctr uint32 :offset-assert 0) + (timing uint32 360 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x5a4 + :flag-assert #x9000005a4 + ) + +;; definition for method 3 of type bone-debug +(defmethod inspect bone-debug ((obj bone-debug)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-debug) + (format #t "~1Ttime-ctr: ~D~%" (-> obj time-ctr)) + (format #t "~1Ttiming[360] @ #x~X~%" (-> obj timing)) + (label cfg-4) + obj + ) + +;; definition of type bone-memory +(deftype bone-memory (structure) + ((work bone-work :inline :offset-assert 0) + (buffer bone-buffer 2 :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x2250 + :flag-assert #x900002250 + ) + +;; definition for method 3 of type bone-memory +(defmethod inspect bone-memory ((obj bone-memory)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-memory) + (format #t "~1Twork: #~%" (-> obj work)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (label cfg-4) + obj + ) + +;; definition of type bone-calculation +(deftype bone-calculation (structure) + ((flags bone-calc-flags :offset-assert 0) + (num-bones uint16 :offset-assert 2) + (matrix-area (inline-array matrix) :offset-assert 4) + (joints (inline-array joint) :offset-assert 8) + (bones (inline-array bone) :offset-assert 12) + (ripple-scale float :offset-assert 16) + (ripple-y-scale float :offset-assert 20) + (ripple-normal-scale float :offset-assert 24) + (ripple-area (inline-array vector) :offset-assert 28) + (next bone-calculation :offset-assert 32) + (dummy-1 uint32 :offset-assert 36) + (dummy-2 uint32 :offset-assert 40) + (dummy-3 uint32 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type bone-calculation +(defmethod inspect bone-calculation ((obj bone-calculation)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bone-calculation) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tnum-bones: ~D~%" (-> obj num-bones)) + (format #t "~1Tmatrix-area: #x~X~%" (-> obj matrix-area)) + (format #t "~1Tjoints: #x~X~%" (-> obj joints)) + (format #t "~1Tbones: #x~X~%" (-> obj bones)) + (format #t "~1Tripple-scale: ~f~%" (-> obj ripple-scale)) + (format #t "~1Tripple-y-scale: ~f~%" (-> obj ripple-y-scale)) + (format #t "~1Tripple-normal-scale: ~f~%" (-> obj ripple-normal-scale)) + (format #t "~1Tripple-area: #x~X~%" (-> obj ripple-area)) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tdummy-1: ~D~%" (-> obj dummy-1)) + (format #t "~1Tdummy-2: ~D~%" (-> obj dummy-2)) + (format #t "~1Tdummy-3: ~D~%" (-> obj dummy-3)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc new file mode 100644 index 0000000000..afdf466812 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/eye-h_REF.gc @@ -0,0 +1,175 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type eye +(deftype eye (structure) + ((data vector 2 :inline :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (lid float :offset 8) + (iris-scale float :offset 16) + (pupil-scale float :offset 20) + (lid-scale float :offset 24) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type eye +(defmethod inspect eye ((obj eye)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'eye) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~f~%" (-> obj x)) + (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "~1Tlid: ~f~%" (-> obj lid)) + (format #t "~1Tiris-scale: ~f~%" (-> obj iris-scale)) + (format #t "~1Tpupil-scale: ~f~%" (-> obj pupil-scale)) + (format #t "~1Tlid-scale: ~f~%" (-> obj lid-scale)) + (label cfg-4) + obj + ) + +;; definition of type eye-control +(deftype eye-control (structure) + ((process handle :offset-assert 0) + (draw-flag symbol :offset-assert 8) + (different-eyes basic :offset-assert 12) + (random-time uint16 :offset-assert 16) + (bucket uint16 :offset-assert 18) + (blink float :offset-assert 20) + (shaders (inline-array adgif-shader) :offset-assert 24) + (left eye :inline :offset-assert 32) + (right eye :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type eye-control +(defmethod inspect eye-control ((obj eye-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'eye-control) + (format #t "~1Tprocess: ~D~%" (-> obj process)) + (format #t "~1Tdraw-flag: ~A~%" (-> obj draw-flag)) + (format #t "~1Tdifferent-eyes: ~A~%" (-> obj different-eyes)) + (format #t "~1Trandom-time: ~D~%" (-> obj random-time)) + (format #t "~1Tbucket: ~D~%" (-> obj bucket)) + (format #t "~1Tblink: ~f~%" (-> obj blink)) + (format #t "~1Tshaders: #x~X~%" (-> obj shaders)) + (format #t "~1Tleft: #~%" (-> obj left)) + (format #t "~1Tright: #~%" (-> obj right)) + (label cfg-4) + obj + ) + +;; definition of type eye-control-array +(deftype eye-control-array (basic) + ((data eye-control 16 :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x610 + :flag-assert #x900000610 + ) + +;; definition for method 3 of type eye-control-array +(defmethod inspect eye-control-array ((obj eye-control-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type eye-control-arrays +(deftype eye-control-arrays (basic) + ((data eye-control-array 6 :inline :offset-assert 16) + (pad uint32 :offset-assert 9328) + ) + :method-count-assert 9 + :size-assert #x2474 + :flag-assert #x900002474 + ) + +;; definition for method 3 of type eye-control-arrays +(defmethod inspect eye-control-arrays ((obj eye-control-arrays)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdata[6] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type eye-work +(deftype eye-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 32) + (adgif-tmpl dma-gif-packet :inline :offset-assert 64) + (blink-table float 10 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) + +;; definition for method 3 of type eye-work +(defmethod inspect eye-work ((obj eye-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'eye-work) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tblink-table[10] @ #x~X~%" (-> obj blink-table)) + (label cfg-4) + obj + ) + +;; definition for symbol *eye-control-arrays*, type eye-control-arrays +(define *eye-control-arrays* + (new 'static 'eye-control-arrays :data (new 'static 'inline-array eye-control-array 6 + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + (new 'static 'eye-control-array) + ) + ) + ) + +;; failed to figure out what this is: +(dotimes (v1-6 6) + (dotimes (a0-10 16) + (let ((a1-14 (the-as eye-control (+ (+ (* 96 a0-10) 28 (* 1552 v1-6)) (the-as int *eye-control-arrays*))))) + (set! (-> a1-14 process) (the-as handle #f)) + (set! (-> a1-14 draw-flag) #t) + (set! (-> a1-14 shaders) (the-as (inline-array adgif-shader) #f)) + (set! (-> a1-14 random-time) (the-as uint 60)) + (set! (-> a1-14 blink) 0.0) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc new file mode 100644 index 0000000000..bb28cc682d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/foreground/foreground-h_REF.gc @@ -0,0 +1,366 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mercneric-chain +(deftype mercneric-chain (structure) + ((first uint32 :offset-assert 0) + (next uint32 :offset-assert 4) + (state generic-bucket-state :inline :offset-assert 8) + (vu1-bucket int32 :offset-assert 16) + ) + :pack-me + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type mercneric-chain +(defmethod inspect mercneric-chain ((obj mercneric-chain)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mercneric-chain) + (format #t "~1Tfirst: #x~X~%" (-> obj first)) + (format #t "~1Tnext: #x~X~%" (-> obj next)) + (format #t "~1Tstate: #~%" (-> obj state)) + (format #t "~1Tvu1-bucket: ~D~%" (-> obj vu1-bucket)) + (label cfg-4) + obj + ) + +;; definition of type merc-chain +(deftype merc-chain (structure) + ((first dma-packet :offset-assert 0) + (patch dma-packet :offset-assert 4) + (vu1-bucket int32 :offset-assert 8) + ) + :pack-me + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type merc-chain +(defmethod inspect merc-chain ((obj merc-chain)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-chain) + (format #t "~1Tfirst: #~%" (-> obj first)) + (format #t "~1Tpatch: #~%" (-> obj patch)) + (format #t "~1Tvu1-bucket: ~D~%" (-> obj vu1-bucket)) + (label cfg-4) + obj + ) + +;; definition of type foreground-bucket +(deftype foreground-bucket (structure) + ((merc merc-chain :inline :offset-assert 0) + (emerc merc-chain :inline :offset-assert 12) + (mercneric mercneric-chain :inline :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type foreground-bucket +(defmethod inspect foreground-bucket ((obj foreground-bucket)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-bucket) + (format #t "~1Tmerc: #~%" (-> obj merc)) + (format #t "~1Temerc: #~%" (-> obj emerc)) + (format #t "~1Tmercneric: #~%" (-> obj mercneric)) + (label cfg-4) + obj + ) + +;; definition of type foreground-level-buckets +(deftype foreground-level-buckets (structure) + ((data foreground-bucket 7 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x150 + :flag-assert #x900000150 + ) + +;; definition for method 3 of type foreground-level-buckets +(defmethod inspect foreground-level-buckets ((obj foreground-level-buckets)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-level-buckets) + (format #t "~1Tdata[7] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type foreground-bucket-grid +(deftype foreground-bucket-grid (structure) + ((level-buckets foreground-level-buckets 7 :inline :offset-assert 0) + (warp-chain mercneric-chain :inline :offset-assert 2352) + ) + :method-count-assert 9 + :size-assert #x944 + :flag-assert #x900000944 + ) + +;; definition for method 3 of type foreground-bucket-grid +(defmethod inspect foreground-bucket-grid ((obj foreground-bucket-grid)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-bucket-grid) + (format #t "~1Tlevel-buckets[7] @ #x~X~%" (-> obj level-buckets)) + (format #t "~1Twarp-chain: #~%" (-> obj warp-chain)) + (label cfg-4) + obj + ) + +;; definition of type foreground-regs +(deftype foreground-regs (structure) + ((dist float :offset-assert 0) + (merc-used uint32 :offset-assert 4) + (emerc-used uint32 :offset-assert 8) + (mercneric-used uint32 :offset-assert 12) + (use-isometric uint32 :offset-assert 16) + (base-start dma-packet :offset-assert 20) + (joint-ptr uint32 :offset-assert 24) + (bone-ptr uint32 :offset-assert 28) + (num-bones uint32 :offset-assert 32) + (mtxs uint32 :offset-assert 36) + (dma-buf basic :offset-assert 40) + (default-texture-index uint32 :offset-assert 44) + (mercneric-chain mercneric-chain :offset-assert 48) + (level-buckets foreground-level-buckets :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x38 + :flag-assert #x900000038 + ) + +;; definition for method 3 of type foreground-regs +(defmethod inspect foreground-regs ((obj foreground-regs)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-regs) + (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "~1Tmerc-used: ~D~%" (-> obj merc-used)) + (format #t "~1Temerc-used: ~D~%" (-> obj emerc-used)) + (format #t "~1Tmercneric-used: ~D~%" (-> obj mercneric-used)) + (format #t "~1Tuse-isometric: ~D~%" (-> obj use-isometric)) + (format #t "~1Tbase-start: #~%" (-> obj base-start)) + (format #t "~1Tjoint-ptr: #x~X~%" (-> obj joint-ptr)) + (format #t "~1Tbone-ptr: #x~X~%" (-> obj bone-ptr)) + (format #t "~1Tnum-bones: ~D~%" (-> obj num-bones)) + (format #t "~1Tmtxs: #x~X~%" (-> obj mtxs)) + (format #t "~1Tdma-buf: ~A~%" (-> obj dma-buf)) + (format #t "~1Tdefault-texture-index: ~D~%" (-> obj default-texture-index)) + (format #t "~1Tmercneric-chain: #~%" (-> obj mercneric-chain)) + (format #t "~1Tlevel-buckets: #~%" (-> obj level-buckets)) + (label cfg-4) + obj + ) + +;; definition of type foreground-work +(deftype foreground-work (structure) + ((regs foreground-regs :inline :offset-assert 0) + (draw-index-map uint16 7 :offset 64) + (grid foreground-bucket-grid :inline :offset-assert 80) + (bounds sphere :inline :offset-assert 2464) + (lights vu-lights :inline :offset-assert 2480) + (distance vector :inline :offset-assert 2592) + (next-tmpl dma-packet :inline :offset-assert 2608) + ) + :method-count-assert 9 + :size-assert #xa40 + :flag-assert #x900000a40 + ) + +;; definition for method 3 of type foreground-work +(defmethod inspect foreground-work ((obj foreground-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-work) + (format #t "~1Tregs: #~%" (-> obj regs)) + (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> obj draw-index-map)) + (format #t "~1Tgrid: #~%" (-> obj grid)) + (format #t "~1Tbounds: #~%" (-> obj bounds)) + (format #t "~1Tlights: #~%" (-> obj lights)) + (format #t "~1Tdistance: #~%" (-> obj distance)) + (format #t "~1Tnext-tmpl: #~%" (-> obj next-tmpl)) + (label cfg-4) + obj + ) + +;; definition for function invalidate-cache-line +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 0] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [cache dxwbin a0, 1] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +(defun invalidate-cache-line ((arg0 pointer)) + (.sync.l) + (.cache dxwbin arg0 0) + (.sync.l) + (.cache dxwbin arg0 1) + (.sync.l) + 0 + ) + +;; definition of type texscroll-globals +(deftype texscroll-globals (structure) + ((requests int32 :offset-assert 0) + (effects merc-effect 32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x84 + :flag-assert #x900000084 + ) + +;; definition for method 3 of type texscroll-globals +(defmethod inspect texscroll-globals ((obj texscroll-globals)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texscroll-globals) + (format #t "~1Trequests: ~D~%" (-> obj requests)) + (format #t "~1Teffects[32] @ #x~X~%" (-> obj effects)) + (label cfg-4) + obj + ) + +;; definition of type merc-effect-bucket-info +(deftype merc-effect-bucket-info (structure) + ((color-fade rgba :offset-assert 0) + (merc-path uint8 :offset-assert 4) + (ignore-alpha uint8 :offset-assert 5) + (disable-draw uint8 :offset-assert 6) + (disable-envmap uint8 :offset-assert 7) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type merc-effect-bucket-info +(defmethod inspect merc-effect-bucket-info ((obj merc-effect-bucket-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-effect-bucket-info) + (format #t "~1Tcolor-fade: ~D~%" (-> obj color-fade)) + (format #t "~1Tmerc-path: ~D~%" (-> obj merc-path)) + (format #t "~1Tignore-alpha: ~D~%" (-> obj ignore-alpha)) + (format #t "~1Tdisable-draw: ~D~%" (-> obj disable-draw)) + (format #t "~1Tdisable-envmap: ~D~%" (-> obj disable-envmap)) + (label cfg-4) + obj + ) + +;; definition of type merc-bucket-info +(deftype merc-bucket-info (structure) + ((light vu-lights :inline :offset-assert 0) + (needs-clip int32 :offset-assert 112) + (need-mercprime-if-merc int32 :offset-assert 116) + (must-use-mercneric-for-clip int32 :offset-assert 120) + (effect merc-effect-bucket-info 64 :inline :offset-assert 124) + ) + :method-count-assert 9 + :size-assert #x27c + :flag-assert #x90000027c + ) + +;; definition for method 3 of type merc-bucket-info +(defmethod inspect merc-bucket-info ((obj merc-bucket-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-bucket-info) + (format #t "~1Tlight: #~%" (-> obj light)) + (format #t "~1Tneeds-clip: ~D~%" (-> obj needs-clip)) + (format #t "~1Tneed-mercprime-if-merc: ~D~%" (-> obj need-mercprime-if-merc)) + (format #t "~1Tmust-use-mercneric-for-clip: ~D~%" (-> obj must-use-mercneric-for-clip)) + (format #t "~1Teffect[64] @ #x~X~%" (-> obj effect)) + (label cfg-4) + obj + ) + +;; definition of type foreground-globals +(deftype foreground-globals (structure) + ((foreground-grid foreground-bucket-grid :inline :offset-assert 0) + (merc-bucket-info merc-bucket-info :inline :offset-assert 2384) + (texscroll texscroll-globals :inline :offset-assert 3024) + ) + :method-count-assert 9 + :size-assert #xc54 + :flag-assert #x900000c54 + ) + +;; definition for method 3 of type foreground-globals +(defmethod inspect foreground-globals ((obj foreground-globals)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'foreground-globals) + (format #t "~1Tforeground-grid: #~%" (-> obj foreground-grid)) + (format #t "~1Tmerc-bucket-info: #~%" (-> obj merc-bucket-info)) + (format #t "~1Ttexscroll: #~%" (-> obj texscroll)) + (label cfg-4) + obj + ) + +;; definition for symbol *foreground*, type foreground-globals +(define *foreground* (new 'global 'foreground-globals)) + +;; definition of type shadow-dma-packet +(deftype shadow-dma-packet (structure) + ((tag generic-merc-tag :inline :offset-assert 0) + (settings shadow-settings :inline :offset-assert 16) + (geo-ref dma-packet :inline :offset-assert 96) + (mtx-ref dma-packet :inline :offset-assert 112) + (end-tag dma-packet :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) + +;; definition for method 3 of type shadow-dma-packet +(defmethod inspect shadow-dma-packet ((obj shadow-dma-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'shadow-dma-packet) + (format #t "~1Ttag: #~%" (-> obj tag)) + (format #t "~1Tsettings: #~%" (-> obj settings)) + (format #t "~1Tgeo-ref: #~%" (-> obj geo-ref)) + (format #t "~1Tmtx-ref: #~%" (-> obj mtx-ref)) + (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc new file mode 100644 index 0000000000..9c1e20f352 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/generic/generic-h_REF.gc @@ -0,0 +1,545 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gsf-vertex +(deftype gsf-vertex (structure) + ((data uint32 8 :offset-assert 0) + (byte uint8 32 :offset 0) + (quad uint128 2 :offset 0) + (vt qword :inline :offset 0) + (pos vector3s :inline :offset 0) + (tex vector2uh :inline :offset 12) + (nrm vector3s :inline :offset 16) + (nc qword :inline :offset 16) + (clr vector4ub :inline :offset 28) + (dtex vector2uh :inline :offset 16) + (dclr vector4ub :inline :offset 20) + ) + :pack-me + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type gsf-vertex +(defmethod inspect gsf-vertex ((obj gsf-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-vertex) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tbyte[32] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tvt: #~%" (-> obj data)) + (format #t "~1Tpos: #~%" (-> obj data)) + (format #t "~1Ttex: #~%" (&-> obj vt vector4w w)) + (format #t "~1Tnrm: #~%" (-> obj nrm)) + (format #t "~1Tnc: #~%" (-> obj nrm)) + (format #t "~1Tclr: #~%" (&-> obj nc vector4w w)) + (format #t "~1Tdtex: #~%" (-> obj nrm)) + (format #t "~1Tdclr: #~%" (&-> obj nrm y)) + (label cfg-4) + obj + ) + +;; definition of type gsf-vertex-array +(deftype gsf-vertex-array (structure) + ((vtx gsf-vertex :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type gsf-vertex-array +(defmethod inspect gsf-vertex-array ((obj gsf-vertex-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-vertex-array) + (format #t "~1Tvtx[0] @ #x~X~%" (-> obj vtx)) + (label cfg-4) + obj + ) + +;; definition of type gsf-fx-vertex +(deftype gsf-fx-vertex (structure) + ((clr vector4ub :inline :offset-assert 0) + (tex vector2uh :inline :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type gsf-fx-vertex +(defmethod inspect gsf-fx-vertex ((obj gsf-fx-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-fx-vertex) + (format #t "~1Tclr: #~%" (-> obj clr)) + (format #t "~1Ttex: #~%" (-> obj tex)) + (label cfg-4) + obj + ) + +;; definition of type gsf-fx-vertex-array +(deftype gsf-fx-vertex-array (structure) + ((data gsf-fx-vertex :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type gsf-fx-vertex-array +(defmethod inspect gsf-fx-vertex-array ((obj gsf-fx-vertex-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-fx-vertex-array) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type gsf-header +(deftype gsf-header (structure) + ((num-strips uint8 :offset-assert 0) + (num-new-vtxs uint8 :offset-assert 1) + (num-dps uint16 :offset-assert 2) + (num-vtxs uint16 :offset-assert 4) + (strip-table uint8 10 :offset-assert 6) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gsf-header +(defmethod inspect gsf-header ((obj gsf-header)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-header) + (format #t "~1Tnum-strips: ~D~%" (-> obj num-strips)) + (format #t "~1Tnum-new-vtxs: ~D~%" (-> obj num-new-vtxs)) + (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) + (format #t "~1Tnum-vtxs: ~D~%" (-> obj num-vtxs)) + (format #t "~1Tstrip-table[10] @ #x~X~%" (-> obj strip-table)) + (label cfg-4) + obj + ) + +;; definition of type gsf-ik +(deftype gsf-ik (structure) + ((index uint8 :offset-assert 0) + (no-kick uint8 :offset-assert 1) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition for method 3 of type gsf-ik +(defmethod inspect gsf-ik ((obj gsf-ik)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-ik) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tno-kick: ~D~%" (-> obj no-kick)) + (label cfg-4) + obj + ) + +;; definition of type gsf-info +(deftype gsf-info (structure) + ((ptr-iks uint32 :offset-assert 0) + (ptr-verts uint32 :offset-assert 4) + (ptr-fx uint32 :offset-assert 8) + (dummy2 uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gsf-info +(defmethod inspect gsf-info ((obj gsf-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-info) + (format #t "~1Tptr-iks: #x~X~%" (-> obj ptr-iks)) + (format #t "~1Tptr-verts: #x~X~%" (-> obj ptr-verts)) + (format #t "~1Tptr-fx: #x~X~%" (-> obj ptr-fx)) + (format #t "~1Tdummy2: ~D~%" (-> obj dummy2)) + (label cfg-4) + obj + ) + +;; definition of type gsf-buffer +(deftype gsf-buffer (structure) + ((data uint8 8192 :offset-assert 0) + (info gsf-info :inline :offset 0) + (header gsf-header :inline :offset 16) + (work-area uint8 :dynamic :offset 32) + ) + :method-count-assert 9 + :size-assert #x2000 + :flag-assert #x900002000 + ) + +;; definition for method 3 of type gsf-buffer +(defmethod inspect gsf-buffer ((obj gsf-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gsf-buffer) + (format #t "~1Tdata[8192] @ #x~X~%" (-> obj data)) + (format #t "~1Tinfo: #~%" (-> obj data)) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Twork-area[0] @ #x~X~%" (-> obj work-area)) + (label cfg-4) + obj + ) + +;; definition of type generic-frag +(deftype generic-frag (structure) + ((start-pos uint16 :offset-assert 0) + (end-pos uint16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type generic-frag +(defmethod inspect generic-frag ((obj generic-frag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-frag) + (format #t "~1Tstart-pos: ~D~%" (-> obj start-pos)) + (format #t "~1Tend-pos: ~D~%" (-> obj end-pos)) + (label cfg-4) + obj + ) + +;; definition of type generic-strip +(deftype generic-strip (structure) + ((pos uint16 :offset-assert 0) + (len uint16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type generic-strip +(defmethod inspect generic-strip ((obj generic-strip)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-strip) + (format #t "~1Tpos: ~D~%" (-> obj pos)) + (format #t "~1Tlen: ~D~%" (-> obj len)) + (label cfg-4) + obj + ) + +;; definition of type generic-envmap-saves +(deftype generic-envmap-saves (structure) + ((index-mask vector4w :inline :offset-assert 0) + (verts uint128 12 :offset-assert 16) + (kicks uint128 4 :offset-assert 208) + ) + :method-count-assert 9 + :size-assert #x110 + :flag-assert #x900000110 + ) + +;; definition for method 3 of type generic-envmap-saves +(defmethod inspect generic-envmap-saves ((obj generic-envmap-saves)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-envmap-saves) + (format #t "~1Tindex-mask: #~%" (-> obj index-mask)) + (format #t "~1Tverts[12] @ #x~X~%" (-> obj verts)) + (format #t "~1Tkicks[4] @ #x~X~%" (-> obj kicks)) + (label cfg-4) + obj + ) + +;; definition of type generic-interp-job +(deftype generic-interp-job (structure) + ((job-type uint16 :offset-assert 0) + (num uint16 :offset-assert 2) + (first uint16 :offset-assert 4) + (pad uint16 :offset-assert 6) + (ptr-data uint32 :offset-assert 8) + (morph-z uint16 :offset-assert 12) + (morph-w uint16 :offset-assert 14) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type generic-interp-job +(defmethod inspect generic-interp-job ((obj generic-interp-job)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-interp-job) + (format #t "~1Tjob-type: ~D~%" (-> obj job-type)) + (format #t "~1Tnum: ~D~%" (-> obj num)) + (format #t "~1Tfirst: ~D~%" (-> obj first)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "~1Tptr-data: #x~X~%" (-> obj ptr-data)) + (format #t "~1Tmorph-z: ~D~%" (-> obj morph-z)) + (format #t "~1Tmorph-w: ~D~%" (-> obj morph-w)) + (label cfg-4) + obj + ) + +;; definition of type generic-saves +(deftype generic-saves (structure) + ((ptr-dma uint32 :offset-assert 0) + (ptr-vtxs uint32 :offset-assert 4) + (ptr-clrs uint32 :offset-assert 8) + (ptr-texs uint32 :offset-assert 12) + (ptr-env-clrs uint32 :offset-assert 16) + (ptr-env-texs uint32 :offset-assert 20) + (cur-outbuf uint32 :offset-assert 24) + (ptr-fx-buf uint32 :offset-assert 28) + (xor-outbufs uint32 :offset-assert 32) + (num-dps uint32 :offset-assert 36) + (qwc uint32 :offset-assert 40) + (gsf-buf gsf-buffer :offset-assert 44) + (ptr-shaders uint32 :offset-assert 48) + (ptr-env-shader uint32 :offset-assert 52) + (is-envmap uint16 :offset-assert 56) + (is-translucent uint16 :offset-assert 58) + (basep uint32 :offset-assert 60) + (ptr-interp-job generic-interp-job :offset-assert 64) + (gifbuf-adr uint32 :offset-assert 68) + (inbuf-adr uint32 :offset-assert 72) + (fade-val uint32 :offset-assert 76) + (time-of-day-color rgba :offset-assert 80) + (to-vu0-waits uint32 :offset-assert 84) + (to-spr-waits uint32 :offset-assert 88) + (from-spr-waits uint32 :offset-assert 92) + (envmap generic-envmap-saves :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x170 + :flag-assert #x900000170 + ) + +;; definition for method 3 of type generic-saves +(defmethod inspect generic-saves ((obj generic-saves)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-saves) + (format #t "~1Tptr-dma: #x~X~%" (-> obj ptr-dma)) + (format #t "~1Tptr-vtxs: #x~X~%" (-> obj ptr-vtxs)) + (format #t "~1Tptr-clrs: #x~X~%" (-> obj ptr-clrs)) + (format #t "~1Tptr-texs: #x~X~%" (-> obj ptr-texs)) + (format #t "~1Tptr-env-clrs: #x~X~%" (-> obj ptr-env-clrs)) + (format #t "~1Tptr-env-texs: #x~X~%" (-> obj ptr-env-texs)) + (format #t "~1Tcur-outbuf: #x~X~%" (-> obj cur-outbuf)) + (format #t "~1Tptr-fx-buf: ~D~%" (-> obj ptr-fx-buf)) + (format #t "~1Txor-outbufs: ~D~%" (-> obj xor-outbufs)) + (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) + (format #t "~1Tqwc: ~D~%" (-> obj qwc)) + (format #t "~1Tgsf-buf: #~%" (-> obj gsf-buf)) + (format #t "~1Tptr-shaders: #x~X~%" (-> obj ptr-shaders)) + (format #t "~1Tptr-env-shader: ~D~%" (-> obj ptr-env-shader)) + (format #t "~1Tis-envmap: ~D~%" (-> obj is-envmap)) + (format #t "~1Tis-translucent: ~D~%" (-> obj is-translucent)) + (format #t "~1Tbasep: #x~X~%" (-> obj basep)) + (format #t "~1Tptr-interp-job: #~%" (-> obj ptr-interp-job)) + (format #t "~1Tgifbuf-adr: ~D~%" (-> obj gifbuf-adr)) + (format #t "~1Tinbuf-adr: ~D~%" (-> obj inbuf-adr)) + (format #t "~1Tfade-val: ~D~%" (-> obj fade-val)) + (format #t "~1Ttime-of-day-color: ~D~%" (-> obj time-of-day-color)) + (format #t "~1Tto-vu0-waits: ~D~%" (-> obj to-vu0-waits)) + (format #t "~1Tto-spr-waits: ~D~%" (-> obj to-spr-waits)) + (format #t "~1Tfrom-spr-waits: ~D~%" (-> obj from-spr-waits)) + (format #t "~1Tenvmap: #~%" (-> obj envmap)) + (label cfg-4) + obj + ) + +;; definition of type generic-gif-tag +(deftype generic-gif-tag (structure) + ((data uint32 4 :offset-assert 0) + (qword qword :inline :offset 0) + (fan-prim uint32 :offset 0) + (str-prim uint32 :offset 4) + (regs uint32 :offset 8) + (num-strips uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type generic-gif-tag +(defmethod inspect generic-gif-tag ((obj generic-gif-tag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-gif-tag) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tqword: #~%" (-> obj data)) + (format #t "~1Tfan-prim: ~D~%" (-> obj fan-prim)) + (format #t "~1Tstr-prim: ~D~%" (-> obj str-prim)) + (format #t "~1Tregs: ~D~%" (-> obj regs)) + (format #t "~1Tnum-strips: ~D~%" (-> obj num-strips)) + (label cfg-4) + obj + ) + +;; definition of type generic-envmap-consts +(deftype generic-envmap-consts (structure) + ((consts vector :inline :offset-assert 0) + (strgif generic-gif-tag :inline :offset-assert 16) + (colors vector4w :inline :offset-assert 32) + (shader adgif-shader :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type generic-envmap-consts +(defmethod inspect generic-envmap-consts ((obj generic-envmap-consts)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-envmap-consts) + (format #t "~1Tconsts: #~%" (-> obj consts)) + (format #t "~1Tstrgif: #~%" (-> obj strgif)) + (format #t "~1Tcolors: #~%" (-> obj colors)) + (format #t "~1Tshader: #~%" (-> obj shader)) + (label cfg-4) + obj + ) + +;; definition of type generic-consts +(deftype generic-consts (structure) + ((dma-header dma-packet :inline :offset-assert 0) + (vif-header uint32 4 :offset-assert 16) + (dma-ref-vtxs dma-packet :inline :offset-assert 32) + (dma-cnt-call dma-packet :inline :offset-assert 48) + (matrix matrix :inline :offset-assert 64) + (base-strgif generic-gif-tag :inline :offset-assert 128) + (alpha-opaque gs-adcmd :inline :offset-assert 144) + (alpha-translucent gs-adcmd :inline :offset-assert 160) + (ztest-normal gs-adcmd :inline :offset-assert 176) + (ztest-opaque gs-adcmd :inline :offset-assert 192) + (adcmd-offsets uint8 16 :offset-assert 208) + (stcycle-tag uint32 :offset-assert 224) + (unpack-vtx-tag uint32 :offset-assert 228) + (unpack-clr-tag uint32 :offset-assert 232) + (unpack-tex-tag uint32 :offset-assert 236) + (mscal-tag uint32 :offset-assert 240) + (flush-tag uint32 :offset-assert 244) + (reset-cycle-tag uint32 :offset-assert 248) + (dummy0 uint32 :offset-assert 252) + (dma-tag-cnt uint64 :offset-assert 256) + (envmap generic-envmap-consts :inline :offset-assert 272) + (light-consts vector :inline :offset-assert 400) + (texture-offset uint16 8 :offset-assert 416) + ) + :method-count-assert 9 + :size-assert #x1b0 + :flag-assert #x9000001b0 + ) + +;; definition for method 3 of type generic-consts +(defmethod inspect generic-consts ((obj generic-consts)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-consts) + (format #t "~1Tdma-header: #~%" (-> obj dma-header)) + (format #t "~1Tvif-header[4] @ #x~X~%" (-> obj vif-header)) + (format #t "~1Tdma-ref-vtxs: #~%" (-> obj dma-ref-vtxs)) + (format #t "~1Tdma-cnt-call: #~%" (-> obj dma-cnt-call)) + (format #t "~1Tmatrix: #~%" (-> obj matrix)) + (format #t "~1Tbase-strgif: #~%" (-> obj base-strgif)) + (format #t "~1Talpha-opaque: #~%" (-> obj alpha-opaque)) + (format #t "~1Talpha-translucent: #~%" (-> obj alpha-translucent)) + (format #t "~1Tztest-normal: #~%" (-> obj ztest-normal)) + (format #t "~1Tztest-opaque: #~%" (-> obj ztest-opaque)) + (format #t "~1Tadcmd-offsets[16] @ #x~X~%" (-> obj adcmd-offsets)) + (format #t "~1Tadcmds[4] @ #x~X~%" (-> obj alpha-opaque)) + (format #t "~1Tstcycle-tag: ~D~%" (-> obj stcycle-tag)) + (format #t "~1Tunpack-vtx-tag: ~D~%" (-> obj unpack-vtx-tag)) + (format #t "~1Tunpack-clr-tag: ~D~%" (-> obj unpack-clr-tag)) + (format #t "~1Tunpack-tex-tag: ~D~%" (-> obj unpack-tex-tag)) + (format #t "~1Tmscal-tag: ~D~%" (-> obj mscal-tag)) + (format #t "~1Tflush-tag: ~D~%" (-> obj flush-tag)) + (format #t "~1Treset-cycle-tag: ~D~%" (-> obj reset-cycle-tag)) + (format #t "~1Tdummy0: ~D~%" (-> obj dummy0)) + (format #t "~1Tdma-tag-cnt: ~D~%" (-> obj dma-tag-cnt)) + (format #t "~1Tenvmap: #~%" (-> obj envmap)) + (format #t "~1Tlight-consts: #~%" (-> obj light-consts)) + (format #t "~1Ttexture-offset[8] @ #x~X~%" (-> obj texture-offset)) + (label cfg-4) + obj + ) + +;; definition of type generic-storage +(deftype generic-storage (structure) + ((data uint128 16 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +;; definition for method 3 of type generic-storage +(defmethod inspect generic-storage ((obj generic-storage)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-storage) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(kmemopen global "gsf-buffer") + +;; definition for symbol *gsf-buffer*, type gsf-buffer +(define *gsf-buffer* (the-as gsf-buffer (kmalloc global 9216 (kmalloc-flags align-64) "malloc"))) + +;; failed to figure out what this is: +(kmemclose) diff --git a/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc new file mode 100644 index 0000000000..2d271bc637 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/generic/generic-vu1-h_REF.gc @@ -0,0 +1,202 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pris-mtx +(deftype pris-mtx (structure) + ((data float 32 :offset-assert 0) + (vector vector 8 :offset 0) + (t-mtx matrix :inline :offset 0) + (n-mtx matrix3 :inline :offset 64) + (scale vector :inline :offset 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type pris-mtx +(defmethod inspect pris-mtx ((obj pris-mtx)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'pris-mtx) + (format #t "~1Tdata[32] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tt-mtx: #~%" (-> obj data)) + (format #t "~1Tn-mtx: #~%" (-> obj n-mtx)) + (format #t "~1Tscale: #~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; definition of type generic-pris-mtx-save +(deftype generic-pris-mtx-save (structure) + ((loc-mtx pris-mtx :inline :offset-assert 0) + (par-mtx pris-mtx :inline :offset-assert 128) + (dif-mtx pris-mtx :inline :offset-assert 256) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +;; definition for method 3 of type generic-pris-mtx-save +(defmethod inspect generic-pris-mtx-save ((obj generic-pris-mtx-save)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-pris-mtx-save) + (format #t "~1Tloc-mtx: #~%" (-> obj loc-mtx)) + (format #t "~1Tpar-mtx: #~%" (-> obj par-mtx)) + (format #t "~1Tdif-mtx: #~%" (-> obj dif-mtx)) + (label cfg-4) + obj + ) + +;; definition of type generic-constants +(deftype generic-constants (structure) + ((fog vector :inline :offset-assert 0) + (adgif gs-gif-tag :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (hmge-scale vector :inline :offset-assert 48) + (invh-scale vector :inline :offset-assert 64) + (guard vector :inline :offset-assert 80) + (flush qword :inline :offset-assert 96) + (stores qword :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type generic-constants +(defmethod inspect generic-constants ((obj generic-constants)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-constants) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tadgif: #~%" (-> obj adgif)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) + (format #t "~1Tinvh-scale: #~%" (-> obj invh-scale)) + (format #t "~1Tguard: #~%" (-> obj guard)) + (format #t "~1Tflush: #~%" (-> obj flush)) + (format #t "~1Tstores: #~%" (-> obj stores)) + (label cfg-4) + obj + ) + +;; definition of type generic-shrub-constants +(deftype generic-shrub-constants (structure) + ((shrub-giftag generic-gif-tag :inline :offset-assert 0) + (shrub-adnop qword :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type generic-shrub-constants +(defmethod inspect generic-shrub-constants ((obj generic-shrub-constants)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-shrub-constants) + (format #t "~1Tshrub-giftag: #~%" (-> obj shrub-giftag)) + (format #t "~1Tshrub-adnop: #~%" (-> obj shrub-adnop)) + (label cfg-4) + obj + ) + +;; definition of type gcf-shader +(deftype gcf-shader (structure) + ((adgif uint128 5 :offset-assert 0) + (shader adgif-shader :inline :offset 0) + (pos uint32 :offset 12) + (num uint32 :offset 28) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type gcf-shader +(defmethod inspect gcf-shader ((obj gcf-shader)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gcf-shader) + (format #t "~1Tadgif[5] @ #x~X~%" (-> obj adgif)) + (format #t "~1Tshader: #~%" (-> obj adgif)) + (format #t "~1Tpos: ~D~%" (-> obj pos)) + (format #t "~1Tnum: ~D~%" (-> obj num)) + (label cfg-4) + obj + ) + +;; definition of type gcf-control +(deftype gcf-control (structure) + ((matrix matrix :inline :offset-assert 0) + (giftag generic-gif-tag :inline :offset-assert 64) + (adnops uint32 2 :offset-assert 80) + (num-strips uint32 :offset 76) + (num-dps uint32 :offset 92) + (kick-offset uint32 :offset 108) + (shader gcf-shader :inline :dynamic :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type gcf-control +(defmethod inspect gcf-control ((obj gcf-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gcf-control) + (format #t "~1Tmatrix: #~%" (-> obj matrix)) + (format #t "~1Tgiftag: #~%" (-> obj giftag)) + (format #t "~1Tadnops[2] @ #x~X~%" (-> obj adnops)) + (format #t "~1Tnum-strips: ~D~%" (-> obj giftag num-strips)) + (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) + (format #t "~1Tkick-offset: ~D~%" (-> obj kick-offset)) + (format #t "~1Tshader[0] @ #x~X~%" (-> obj shader)) + (label cfg-4) + obj + ) + +;; definition of type gcf-vertex +(deftype gcf-vertex (structure) + ((tex vector4w :inline :offset-assert 0) + (clr gs-packed-rgba :inline :offset-assert 16) + (pos gs-packed-xyzw :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type gcf-vertex +(defmethod inspect gcf-vertex ((obj gcf-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gcf-vertex) + (format #t "~1Ttex: #~%" (-> obj tex)) + (format #t "~1Tclr: #~%" (-> obj clr)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc new file mode 100644 index 0000000000..db2ccfb826 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display-h_REF.gc @@ -0,0 +1,224 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type display-frame +(deftype display-frame (basic) + ((buffer dma-buffer 11 :offset-assert 4) + (calc-buf dma-buffer :offset 8) + (vu1-buf dma-buffer :offset 8) + (debug-buf dma-buffer :offset 36) + (global-buf dma-buffer :offset 40) + (bucket-group dma-bucket :offset 44) + (profile-array profile-array :inline :offset-assert 48) + (start-time time-frame :offset-assert 56) + (run-time time-frame :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x48 + :flag-assert #x900000048 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type display-frame +(defmethod inspect display-frame ((obj display-frame)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbuffer[11] @ #x~X~%" (-> obj buffer)) + (format #t "~1Tcalc-buf: ~A~%" (-> obj calc-buf)) + (format #t "~1Tvu1-buf: ~A~%" (-> obj calc-buf)) + (format #t "~1Tdebug-buf: ~A~%" (-> obj debug-buf)) + (format #t "~1Tglobal-buf: ~A~%" (-> obj global-buf)) + (format #t "~1Tbucket-group: #~%" (-> obj bucket-group)) + (format #t "~1Tprofile-array: #~%" (-> obj profile-array)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Trun-time: ~D~%" (-> obj run-time)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type display-frame +(defmethod new display-frame ((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 calc-buf) (the-as dma-buffer 0)) + (set! (-> gp-0 global-buf) (the-as dma-buffer 0)) + (set! (-> gp-0 debug-buf) (the-as dma-buffer 0)) + (when *debug-segment* + (set! (-> gp-0 profile-array data 0) (new 'debug 'profile-segment-array)) + (set! (-> gp-0 profile-array data 1) (new 'debug 'profile-segment-array)) + ) + gp-0 + ) + ) + +;; definition of type display +(deftype display (basic) + ((on-screen int32 :offset-assert 4) + (last-screen int32 :offset-assert 8) + (frames display-frame 2 :offset-assert 12) + (bgcolor uint64 :offset-assert 24) + (pmode gs-pmode :offset-assert 32) + (clock clock 13 :offset-assert 40) + (session-clock clock :offset 40) + (game-clock clock :offset 44) + (base-clock clock :offset 48) + (real-clock clock :offset 52) + (frame-clock clock :offset 56) + (real-frame-clock clock :offset 60) + (target-clock clock :offset 64) + (entity-clock clock :offset 68) + (part-clock clock :offset 72) + (bg-clock clock :offset 76) + (camera-clock clock :offset 80) + (user0-clock clock :offset 84) + (total-game-clock clock :offset 88) + (time-factor float :offset-assert 92) + (dog-ratio float :offset-assert 96) + (vblank-start-time time-frame 2 :offset-assert 104) + (total-run-time time-frame :offset-assert 120) + (run-half-speed basic :offset-assert 128) + (dog-count float :offset-assert 132) + (vu1-enable-user vu1-renderer-mask :offset-assert 136) + (vu1-enable-user-menu vu1-renderer-mask :offset-assert 144) + (force-sync uint32 :offset-assert 152) + ) + :method-count-assert 10 + :size-assert #x9c + :flag-assert #xa0000009c + (:methods + (new (symbol type int int int int int) _type_ 0) + (set-time-ratios (_type_ float) float 9) + ) + ) + +;; definition for method 3 of type display +(defmethod inspect display ((obj display)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ton-screen: ~D~%" (-> obj on-screen)) + (format #t "~1Tlast-screen: ~D~%" (-> obj last-screen)) + (format #t "~1Tframes[2] @ #x~X~%" (-> obj frames)) + (format #t "~1Tbgcolor: #x~X~%" (-> obj bgcolor)) + (format #t "~1Tpmode: ~D~%" (-> obj pmode)) + (format #t "~1Tclock[13] @ #x~X~%" (-> obj clock)) + (format #t "~1Tsession-clock: ~A~%" (-> obj session-clock)) + (format #t "~1Tgame-clock: ~A~%" (-> obj game-clock)) + (format #t "~1Tbase-clock: ~A~%" (-> obj base-clock)) + (format #t "~1Treal-clock: ~A~%" (-> obj real-clock)) + (format #t "~1Tframe-clock: ~A~%" (-> obj frame-clock)) + (format #t "~1Treal-frame-clock: ~A~%" (-> obj real-frame-clock)) + (format #t "~1Ttarget-clock: ~A~%" (-> obj target-clock)) + (format #t "~1Tentity-clock: ~A~%" (-> obj entity-clock)) + (format #t "~1Tpart-clock: ~A~%" (-> obj part-clock)) + (format #t "~1Tbg-clock: ~A~%" (-> obj bg-clock)) + (format #t "~1Tcamera-clock: ~A~%" (-> obj camera-clock)) + (format #t "~1Tuser0-clock: ~A~%" (-> obj user0-clock)) + (format #t "~1Ttotal-game-clock: ~A~%" (-> obj total-game-clock)) + (format #t "~1Ttime-factor: ~f~%" (-> obj time-factor)) + (format #t "~1Tdog-ratio: ~f~%" (-> obj dog-ratio)) + (format #t "~1Tvblank-start-time[2] @ #x~X~%" (-> obj vblank-start-time)) + (format #t "~1Ttotal-run-time: ~D~%" (-> obj total-run-time)) + (format #t "~1Trun-half-speed: ~A~%" (-> obj run-half-speed)) + (format #t "~1Tdog-count: ~f~%" (-> obj dog-count)) + (format #t "~1Tvu1-enable-user: ~D~%" (-> obj vu1-enable-user)) + (format #t "~1Tvu1-enable-user-menu: ~D~%" (-> obj vu1-enable-user-menu)) + (format #t "~1Tforce-sync: ~D~%" (-> obj force-sync)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type display +(defmethod new display ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set-display gp-0) + (set! (-> gp-0 frames 0) (new 'global 'display-frame)) + (set! (-> gp-0 frames 1) (new 'global 'display-frame)) + (set! (-> gp-0 pmode) (new 'static 'gs-pmode :en1 #x1 :crtmd #x1 :mmod #x1 :slbg #x1)) + (set! (-> gp-0 run-half-speed) #f) + (set! (-> gp-0 vu1-enable-user-menu) (vu1-renderer-mask + rn3 + rn4 + rn5 + rn6 + rn7 + rn8 + rn9 + rn10 + rn11 + rn12 + rn13 + rn14 + rn15 + rn16 + rn17 + rn18 + rn19 + rn20 + rn21 + rn22 + rn23 + rn24 + rn25 + rn26 + rn27 + rn28 + rn29 + rn30 + rn31 + rn32 + rn34 + ) + ) + (set! (-> gp-0 vu1-enable-user) (vu1-renderer-mask + rn3 + rn4 + rn5 + rn6 + rn7 + rn8 + rn9 + rn10 + rn11 + rn12 + rn13 + rn14 + rn15 + rn16 + rn17 + rn18 + rn19 + rn20 + rn21 + rn22 + rn23 + rn24 + rn25 + rn26 + rn27 + rn28 + rn29 + rn30 + rn31 + rn32 + rn34 + ) + ) + gp-0 + ) + ) + +;; definition for symbol *pre-draw-hook*, type (function object none) +(define *pre-draw-hook* (the-as (function object none) nothing)) + +;; definition for symbol *post-draw-hook*, type (function dma-buffer none) +(define *post-draw-hook* (the-as (function dma-buffer none) nothing)) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc new file mode 100644 index 0000000000..ec3af31414 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/hw/display_REF.gc @@ -0,0 +1,497 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function get-current-time +(defun get-current-time () + (-> *display* base-clock frame-counter) + ) + +;; definition for function get-integral-current-time +(defun get-integral-current-time () + (-> *display* base-clock integral-frame-counter) + ) + +;; definition for method 9 of type display +(defmethod set-time-ratios display ((obj display) (arg0 float)) + (set! (-> obj dog-ratio) (fmin 4.0 arg0)) + (case (get-video-mode) + (('pal) + (set! (-> obj time-factor) 6.0) + ) + (else + (set! (-> obj time-factor) 5.0) + ) + ) + (-> obj dog-ratio) + ) + +;; definition for function set-display +(defun set-display ((arg0 display)) + (dotimes (s5-0 13) + (set! (-> arg0 clock s5-0) (new 'global 'clock s5-0)) + ) + (set! (-> arg0 base-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 game-clock mask) (process-mask freeze pause menu progress movie)) + (set! (-> arg0 total-game-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 frame-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 target-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 camera-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 entity-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 part-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 bg-clock mask) (process-mask freeze pause menu progress)) + (set! (-> arg0 user0-clock mask) (process-mask freeze pause menu progress)) + (set! (-> *listener-process* clock) (-> arg0 real-clock)) + (set! (-> *active-pool* clock) (-> arg0 real-clock)) + (set! (-> *display-pool* clock) (-> arg0 real-clock)) + (set! (-> *camera-pool* clock) (-> arg0 camera-clock)) + (set! (-> *target-pool* clock) (-> arg0 target-clock)) + (set! (-> *mid-pool* clock) (-> arg0 real-clock)) + (set! (-> *pusher-pool* clock) (-> arg0 entity-clock)) + (set! (-> *entity-pool* clock) (-> arg0 entity-clock)) + (set! (-> *bg-pool* clock) (-> arg0 bg-clock)) + (set! (-> *default-pool* clock) (-> arg0 base-clock)) + arg0 + ) + +;; definition for function allocate-dma-buffers +(defun allocate-dma-buffers ((arg0 display)) + (when (zero? (-> arg0 frames 0 calc-buf)) + (set! (-> arg0 frames 0 calc-buf) (new 'global 'dma-buffer 10000)) + (set! (-> arg0 frames 1 calc-buf) (new 'global 'dma-buffer 10000)) + (set! (-> arg0 frames 0 global-buf) (new 'global 'dma-buffer #x140000)) + (set! (-> arg0 frames 1 global-buf) (new 'global 'dma-buffer #x140000)) + (when *debug-segment* + (set! (-> arg0 frames 0 debug-buf) (new 'debug 'dma-buffer #x800000)) + (set! (-> arg0 frames 1 debug-buf) (new 'debug 'dma-buffer #x800000)) + ) + ) + arg0 + ) + +;; definition for symbol *font-context*, type font-context +(define *font-context* + (new 'global 'font-context *font-default-matrix* 0 0 0.0 (font-color zero) (font-flags shadow kerning)) + ) + +;; definition for function draw-sprite2d-xy +;; INFO: Return type mismatch pointer vs none. +(defun draw-sprite2d-xy ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) + (let* ((t2-1 (new 'stack 'draw-context arg1 arg2 arg3 arg4 arg5)) + (a1-3 (max 1792 (min 2304 (+ (-> t2-1 orgx) 1792)))) + (a0-5 (max 1840 (min 2256 (+ (-> t2-1 orgy) 1840)))) + (t1-2 (-> t2-1 width)) + (a2-4 (-> t2-1 height)) + (v1-6 (-> arg0 base)) + ) + (let* ((a3-2 arg0) + (t0-2 (the-as object (-> a3-2 base))) + ) + (set! (-> (the-as dma-packet t0-2) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t0-2) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t0-2) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a3-2 base) (&+ (the-as pointer t0-2) 16)) + ) + (let* ((a3-3 arg0) + (t0-4 (the-as object (-> a3-3 base))) + ) + (set! (-> (the-as gs-gif-tag t0-4) tag) + (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :flg (gif-flag reg-list) :nreg #x4) + ) + (set! (-> (the-as gs-gif-tag t0-4) regs) + (new 'static 'gif-tag-regs :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2) :regs3 (gif-reg-id xyzf2)) + ) + (set! (-> a3-3 base) (&+ (the-as pointer t0-4) 16)) + ) + (let* ((a3-4 arg0) + (t0-6 (-> a3-4 base)) + ) + (set! (-> (the-as (pointer gs-prim) t0-6) 0) (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe #x1)) + (set! (-> (the-as (pointer gs-rgbaq) t0-6) 1) (the-as gs-rgbaq (-> t2-1 color 0))) + (set! (-> (the-as (pointer gs-xyzf) t0-6) 2) (new 'static 'gs-xyzf :z #x3fffff :y (* a0-5 16) :x (* a1-3 16))) + (set! (-> (the-as (pointer gs-xyzf) t0-6) 3) (new 'static 'gs-xyzf + :z #x3fffff + :y (* (max 1840 (min 2256 (+ a0-5 a2-4))) 16) + :x (* (max 1792 (min 2304 (+ a1-3 t1-2))) 16) + ) + ) + (set! (-> a3-4 base) (&+ t0-6 32)) + ) + (let ((a0-14 (/ (the-as int (+ (- -16 (the-as int v1-6)) (the-as int (-> arg0 base)))) 16))) + (cond + ((nonzero? a0-14) + (logior! (-> (the-as (pointer uint64) v1-6) 0) (shr (shl a0-14 48) 48)) + (logior! (-> (the-as (pointer uint64) v1-6) 1) (shl (shr (shl a0-14 48) 48) 32)) + ) + (else + (set! (-> arg0 base) v1-6) + ) + ) + ) + ) + (none) + ) + +;; definition for function draw-sprite2d-xy-absolute +;; INFO: Return type mismatch pointer vs none. +(defun draw-sprite2d-xy-absolute ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 rgba)) + (let ((t2-0 (+ arg1 1792)) + (a1-1 (+ arg2 1840)) + (v1-0 (-> arg0 base)) + ) + (let* ((a2-1 arg0) + (t3-0 (the-as object (-> a2-1 base))) + ) + (set! (-> (the-as dma-packet t3-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t3-0) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t3-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) + (set! (-> a2-1 base) (&+ (the-as pointer t3-0) 16)) + ) + (let* ((a2-2 arg0) + (t3-2 (the-as object (-> a2-2 base))) + ) + (set! (-> (the-as gs-gif-tag t3-2) tag) + (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :flg (gif-flag reg-list) :nreg #x4) + ) + (set! (-> (the-as gs-gif-tag t3-2) regs) + (new 'static 'gif-tag-regs :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2) :regs3 (gif-reg-id xyzf2)) + ) + (set! (-> a2-2 base) (&+ (the-as pointer t3-2) 16)) + ) + (let* ((a2-3 arg0) + (t3-4 (-> a2-3 base)) + ) + (set! (-> (the-as (pointer gs-prim) t3-4) 0) (new 'static 'gs-prim :prim (gs-prim-type sprite) :abe #x1)) + (set! (-> (the-as (pointer gs-rgbaq) t3-4) 1) (the-as gs-rgbaq arg5)) + (set! (-> (the-as (pointer gs-xyzf) t3-4) 2) (new 'static 'gs-xyzf :z #x3fffff :y (* a1-1 16) :x (* t2-0 16))) + (set! (-> (the-as (pointer gs-xyzf) t3-4) 3) + (new 'static 'gs-xyzf :z #x3fffff :y (* (+ a1-1 arg4) 16) :x (* (+ t2-0 arg3) 16)) + ) + (set! (-> a2-3 base) (&+ t3-4 32)) + ) + (let ((a1-10 (/ (the-as int (+ (- -16 (the-as int v1-0)) (the-as int (-> arg0 base)))) 16))) + (cond + ((nonzero? a1-10) + (set! (-> (the-as (pointer uint64) v1-0) 0) + (logior (-> (the-as (pointer uint64) v1-0)) (shr (shl a1-10 48) 48)) + ) + (logior! (-> (the-as (pointer uint64) v1-0) 1) (shl (shr (shl a1-10 48) 48) 32)) + ) + (else + (set! (-> arg0 base) v1-0) + ) + ) + ) + ) + (none) + ) + +;; definition for function draw-quad2d +;; INFO: Return type mismatch pointer vs none. +(defun draw-quad2d ((arg0 dma-buffer) (arg1 draw-context)) + (let ((a3-1 (max 1792 (min 2304 (+ (-> arg1 orgx) 1792)))) + (a2-3 (max 1840 (min 2256 (+ (-> arg1 orgy) 1840)))) + (t3-0 (-> arg1 width)) + (t0-2 (-> arg1 height)) + (v1-4 (-> arg0 base)) + ) + (let* ((t1-0 arg0) + (t2-0 (the-as object (-> t1-0 base))) + ) + (set! (-> (the-as dma-packet t2-0) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t2-0) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet t2-0) vif1) (new 'static 'vif-tag :cmd (vif-cmd direct) :msk #x1)) + (set! (-> t1-0 base) (&+ (the-as pointer t2-0) 16)) + ) + (let* ((t1-1 arg0) + (t2-2 (the-as object (-> t1-1 base))) + ) + (set! (-> (the-as gs-gif-tag t2-2) tag) + (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :flg (gif-flag reg-list) :nreg #x9) + ) + (set! (-> (the-as gs-gif-tag t2-2) regs) (new 'static 'gif-tag-regs + :regs1 (gif-reg-id rgbaq) + :regs2 (gif-reg-id xyzf2) + :regs3 (gif-reg-id rgbaq) + :regs4 (gif-reg-id xyzf2) + :regs5 (gif-reg-id rgbaq) + :regs6 (gif-reg-id xyzf2) + :regs7 (gif-reg-id rgbaq) + :regs8 (gif-reg-id xyzf2) + ) + ) + (set! (-> t1-1 base) (&+ (the-as pointer t2-2) 16)) + ) + (let* ((t1-2 arg0) + (t2-4 (-> t1-2 base)) + ) + (set! (-> (the-as (pointer gs-prim) t2-4) 0) + (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + ) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 1) (the-as gs-rgbaq (-> arg1 color 0))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 2) (new 'static 'gs-xyzf :y (* a2-3 16) :x (* a3-1 16))) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 3) (the-as gs-rgbaq (-> arg1 color 1))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 4) + (new 'static 'gs-xyzf :y (* a2-3 16) :x (* (max 1792 (min 2304 (+ a3-1 t3-0))) 16)) + ) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 5) (the-as gs-rgbaq (-> arg1 color 2))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 6) + (new 'static 'gs-xyzf :y (* (max 1840 (min 2256 (+ a2-3 t0-2))) 16) :x (* a3-1 16)) + ) + (set! (-> (the-as (pointer gs-rgbaq) t2-4) 7) (the-as gs-rgbaq (-> arg1 color 3))) + (set! (-> (the-as (pointer gs-xyzf) t2-4) 8) (new 'static 'gs-xyzf + :y (* (max 1840 (min 2256 (+ a2-3 t0-2))) 16) + :x (* (max 1792 (min 2304 (+ a3-1 t3-0))) 16) + ) + ) + (set! (-> (the-as (pointer uint64) t2-4) 9) (the-as uint 0)) + (set! (-> t1-2 base) (&+ t2-4 80)) + ) + (let ((a1-11 (/ (the-as int (+ (- -16 (the-as int v1-4)) (the-as int (-> arg0 base)))) 16))) + (cond + ((nonzero? a1-11) + (set! (-> (the-as (pointer uint64) v1-4) 0) + (logior (-> (the-as (pointer uint64) v1-4)) (shr (shl a1-11 48) 48)) + ) + (logior! (-> (the-as (pointer uint64) v1-4) 1) (shl (shr (shl a1-11 48) 48) 32)) + ) + (else + (set! (-> arg0 base) v1-4) + ) + ) + ) + ) + (none) + ) + +;; definition for function screen-gradient +(defun screen-gradient ((arg0 dma-buffer) (arg1 rgba) (arg2 rgba) (arg3 rgba) (arg4 rgba)) + (let ((a1-2 (new 'stack 'draw-context 0 0 512 416 (new 'static 'rgba)))) + (set! (-> a1-2 color 0) arg1) + (set! (-> a1-2 color 1) arg2) + (set! (-> a1-2 color 2) arg3) + (set! (-> a1-2 color 3) arg4) + (draw-quad2d arg0 a1-2) + ) + (none) + ) + +;; definition for function vif1-handler-debug +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function vif1-handler +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; failed to figure out what this is: +(install-handler 5 (if *debug-segment* + vif1-handler-debug + vif1-handler + ) + ) + +;; definition for function vblank-handler +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function set-display-gs-state +(defun set-display-gs-state ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int)) + (let ((t2-0 (/ (+ arg2 63) 64))) + (let* ((v1-1 arg0) + (t3-0 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet t3-0) dma) (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t3-0) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet t3-0) vif1) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer t3-0) 16)) + ) + (let* ((v1-2 arg0) + (t3-2 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag t3-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) + (set! (-> (the-as gs-gif-tag t3-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-2 base) (&+ (the-as pointer t3-2) 16)) + ) + (let* ((v1-3 arg0) + (t3-4 (-> v1-3 base)) + ) + (set! (-> (the-as (pointer gs-scissor) t3-4) 0) + (new 'static 'gs-scissor :scax1 (+ arg2 -1) :scay1 (+ arg3 -1)) + ) + (set! (-> (the-as (pointer gs-reg64) t3-4) 1) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-xy-offset) t3-4) 2) (new 'static 'gs-xy-offset)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 3) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) t3-4) 4) + (new 'static 'gs-frame :fbp arg1 :fbw t2-0 :psm arg5 :fbmsk arg4) + ) + (set! (-> (the-as (pointer gs-reg64) t3-4) 5) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-test) t3-4) 6) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) + (set! (-> (the-as (pointer gs-reg64) t3-4) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-texa) t3-4) 8) (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-zbuf) t3-4) 10) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 11) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer uint64) t3-4) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) t3-4) 13) (gs-reg64 texflush)) + (set! (-> v1-3 base) (&+ t3-4 112)) + ) + ) + arg0 + ) + +;; definition for function set-display-gs-state-offset +(defun set-display-gs-state-offset ((arg0 dma-buffer) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int) (arg6 int) (arg7 int)) + (let ((t4-0 (/ (+ arg2 63) 64))) + (let* ((v1-1 arg0) + (t5-0 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as dma-packet t5-0) dma) (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet t5-0) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet t5-0) vif1) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-1 base) (&+ (the-as pointer t5-0) 16)) + ) + (let* ((v1-2 arg0) + (t5-2 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as gs-gif-tag t5-2) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) + (set! (-> (the-as gs-gif-tag t5-2) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-2 base) (&+ (the-as pointer t5-2) 16)) + ) + (let* ((v1-3 arg0) + (t5-4 (-> v1-3 base)) + ) + (set! (-> (the-as (pointer gs-scissor) t5-4) 0) + (new 'static 'gs-scissor :scax1 (+ arg2 -1) :scay1 (+ arg3 -1)) + ) + (set! (-> (the-as (pointer gs-reg64) t5-4) 1) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-xy-offset) t5-4) 2) + (new 'static 'gs-xy-offset :ofx (* arg6 16) :ofy (* arg7 16)) + ) + (set! (-> (the-as (pointer gs-reg64) t5-4) 3) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) t5-4) 4) + (new 'static 'gs-frame :fbp arg1 :fbw t4-0 :psm arg5 :fbmsk arg4) + ) + (set! (-> (the-as (pointer gs-reg64) t5-4) 5) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-test) t5-4) 6) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) + (set! (-> (the-as (pointer gs-reg64) t5-4) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-texa) t5-4) 8) (new 'static 'gs-texa :ta0 #x80 :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) t5-4) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-zbuf) t5-4) 10) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (set! (-> (the-as (pointer gs-reg64) t5-4) 11) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer uint64) t5-4) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) t5-4) 13) (gs-reg64 texflush)) + (set! (-> v1-3 base) (&+ t5-4 112)) + ) + ) + arg0 + ) + +;; definition for function reset-display-gs-state +(defun reset-display-gs-state ((arg0 display) (arg1 dma-buffer) (arg2 int)) + (let* ((v1-0 arg1) + (a2-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a2-1) dma) (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a2-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> (the-as dma-packet a2-1) vif1) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a2-1) 16)) + ) + (let* ((v1-1 arg1) + (a2-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a2-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x7)) + (set! (-> (the-as gs-gif-tag a2-3) regs) + (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-1 base) (&+ (the-as pointer a2-3) 16)) + ) + (let* ((v1-2 arg1) + (a1-1 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-scissor) a1-1) 0) (new 'static 'gs-scissor :scax1 #x1ff :scay1 #x19f)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 1) (gs-reg64 scissor-1)) + (set! (-> (the-as (pointer gs-xy-offset) a1-1) 2) (new 'static 'gs-xy-offset :ofx #x7000 :ofy #x7300)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 3) (gs-reg64 xyoffset-1)) + (set! (-> (the-as (pointer gs-frame) a1-1) 4) (new 'static 'gs-frame :fbp #x198 :fbw #x8)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 5) (gs-reg64 frame-1)) + (set! (-> (the-as (pointer gs-test) a1-1) 6) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))) + (set! (-> (the-as (pointer gs-reg64) a1-1) 7) (gs-reg64 test-1)) + (set! (-> (the-as (pointer gs-texa) a1-1) 8) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 9) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-zbuf) a1-1) 10) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24))) + (set! (-> (the-as (pointer gs-reg64) a1-1) 11) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer uint64) a1-1) 12) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a1-1) 13) (gs-reg64 texflush)) + (set! (-> v1-2 base) (&+ a1-1 112)) + ) + arg0 + ) + +;; failed to figure out what this is: +(kmemopen global "dma-buffers") + +;; definition for symbol *vu0-dma-list*, type dma-buffer +(define *vu0-dma-list* (new 'global 'dma-buffer 4096)) + +;; definition for symbol *display*, type display +(define *display* (new 'global 'display 0 512 416 2 49)) + +;; failed to figure out what this is: +(allocate-dma-buffers *display*) + +;; failed to figure out what this is: +(kmemclose) + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc new file mode 100644 index 0000000000..fd181458c2 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/hw/gs_REF.gc @@ -0,0 +1,1150 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gs-pmode +(deftype gs-pmode (uint64) + ((en1 uint8 :offset 0 :size 1) + (en2 uint8 :offset 1 :size 1) + (crtmd uint8 :offset 2 :size 3) + (mmod uint8 :offset 5 :size 1) + (amod uint8 :offset 6 :size 1) + (slbg uint8 :offset 7 :size 1) + (alp uint8 :offset 8 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-smode2 +(deftype gs-smode2 (uint64) + ((int uint8 :offset 0 :size 1) + (ffmd uint8 :offset 1 :size 1) + (dpms uint8 :offset 2 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for function psm-size +(defun psm-size ((arg0 gs-psm)) + (cond + ((= arg0 (gs-psm mt8)) + 64 + ) + ((= arg0 (gs-psm mt4)) + 32 + ) + ((or (= arg0 (gs-psm ct16)) (= arg0 (gs-psm ct16s)) (= arg0 (gs-psm mz16)) (= arg0 (gs-psm mz16s))) + 128 + ) + (else + 256 + ) + ) + ) + +;; definition for function psm-page-height +(defun psm-page-height ((arg0 gs-psm)) + (cond + ((= arg0 (gs-psm mt8)) + 64 + ) + ((= arg0 (gs-psm mt4)) + 128 + ) + ((or (= arg0 (gs-psm ct16)) (= arg0 (gs-psm ct16s)) (= arg0 (gs-psm mz16)) (= arg0 (gs-psm mz16s))) + 64 + ) + (else + 32 + ) + ) + ) + +;; definition for function psm->string +(defun psm->string ((arg0 gs-psm)) + (case arg0 + (((gs-psm ct24)) + "ct24" + ) + (((gs-psm mt4)) + "mt4" + ) + (((gs-psm ct32)) + "ct32" + ) + (((gs-psm mz16s)) + "mz16s" + ) + (((gs-psm ct16s)) + "ct16s" + ) + (((gs-psm mt8)) + "mt8" + ) + (((gs-psm mt8h)) + "mt8h" + ) + (((gs-psm mz16)) + "mz16" + ) + (((gs-psm mz24)) + "mz24" + ) + (((gs-psm mt4hh)) + "mt4hh" + ) + (((gs-psm ct16)) + "ct16" + ) + (((gs-psm mt4hl)) + "mt4hl" + ) + (((gs-psm mz32)) + "mz32" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type gs-display-fb +(deftype gs-display-fb (uint64) + ((fbp uint16 :offset 0 :size 9) + (fbw uint8 :offset 9 :size 6) + (psm gs-psm :offset 15 :size 5) + (dbx uint16 :offset 32 :size 11) + (dby uint16 :offset 43 :size 11) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-display +(deftype gs-display (uint64) + ((dx uint16 :offset 0 :size 12) + (dy uint16 :offset 12 :size 11) + (magh uint8 :offset 23 :size 4) + (magv uint8 :offset 27 :size 2) + (dw uint16 :offset 32 :size 12) + (dh uint16 :offset 44 :size 11) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-bgcolor +(deftype gs-bgcolor (uint64) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-csr +(deftype gs-csr (uint64) + ((signal uint8 :offset 0 :size 1) + (finish uint8 :offset 1 :size 1) + (hsint uint8 :offset 2 :size 1) + (vsint uint8 :offset 3 :size 1) + (edwint uint8 :offset 4 :size 1) + (flush uint8 :offset 8 :size 1) + (reset uint8 :offset 9 :size 1) + (nfield uint8 :offset 12 :size 1) + (field uint8 :offset 13 :size 1) + (fifo uint8 :offset 14 :size 2) + (rev uint8 :offset 16 :size 8) + (id uint8 :offset 24 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-bank +(deftype gs-bank (structure) + ((pmode gs-pmode :offset-assert 0) + (smode2 gs-smode2 :offset 32) + (dspfb1 gs-display-fb :offset 112) + (display1 gs-display :offset 128) + (dspfb2 gs-display-fb :offset 144) + (display2 gs-display :offset 160) + (extbuf uint64 :offset 176) + (extdata uint64 :offset 192) + (extwrite uint64 :offset 208) + (bgcolor gs-bgcolor :offset 224) + (csr gs-csr :offset 4096) + (imr uint64 :offset 4112) + (busdir uint64 :offset 4160) + ) + :method-count-assert 9 + :size-assert #x1048 + :flag-assert #x900001048 + ) + +;; definition for method 3 of type gs-bank +(defmethod inspect gs-bank ((obj gs-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-bank) + (format #t "~1Tpmode: #x~X~%" (-> obj pmode)) + (format #t "~1Tsmode2: #x~X~%" (-> obj smode2)) + (format #t "~1Tdspfb1: #x~X~%" (-> obj dspfb1)) + (format #t "~1Tdisplay1: #x~X~%" (-> obj display1)) + (format #t "~1Tdspfb2: #x~X~%" (-> obj dspfb2)) + (format #t "~1Tdisplay2: #x~X~%" (-> obj display2)) + (format #t "~1Textbuf: #x~X~%" (-> obj extbuf)) + (format #t "~1Textdata: #x~X~%" (-> obj extdata)) + (format #t "~1Textwrite: #x~X~%" (-> obj extwrite)) + (format #t "~1Tbgcolor: #x~X~%" (-> obj bgcolor)) + (format #t "~1Tcsr: #x~X~%" (-> obj csr)) + (format #t "~1Timr: #x~X~%" (-> obj imr)) + (format #t "~1Tbusdir: #x~X~%" (-> obj busdir)) + (label cfg-4) + obj + ) + +;; definition of type gs-frame +(deftype gs-frame (uint64) + ((fbp uint16 :offset 0 :size 9) + (fbw uint8 :offset 16 :size 6) + (psm gs-psm :offset 24 :size 6) + (fbmsk uint32 :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-zbuf +(deftype gs-zbuf (uint64) + ((zbp uint16 :offset 0 :size 9) + (psm gs-psm :offset 24 :size 4) + (zmsk uint8 :offset 32 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-xy-offset +(deftype gs-xy-offset (uint64) + ((ofx uint16 :offset 0 :size 16) + (ofy uint16 :offset 32 :size 16) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-scissor +(deftype gs-scissor (uint64) + ((scax0 uint16 :offset 0 :size 11) + (scax1 uint16 :offset 16 :size 11) + (scay0 uint16 :offset 32 :size 11) + (scay1 uint16 :offset 48 :size 11) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-prmode-cont +(deftype gs-prmode-cont (uint64) + ((ac uint8 :offset 0 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-color-clamp +(deftype gs-color-clamp (uint64) + ((clamp uint8 :offset 0 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-dthe +(deftype gs-dthe (uint64) + ((dthe uint8 :offset 0 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-test +(deftype gs-test (uint64) + ((ate uint8 :offset 0 :size 1) + (atst gs-atest :offset 1 :size 3) + (aref uint8 :offset 4 :size 8) + (afail uint8 :offset 12 :size 2) + (date uint8 :offset 14 :size 1) + (datm uint8 :offset 15 :size 1) + (zte uint8 :offset 16 :size 1) + (ztst gs-ztest :offset 17 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-prim +(deftype gs-prim (uint64) + ((prim gs-prim-type :offset 0 :size 3) + (iip uint8 :offset 3 :size 1) + (tme uint8 :offset 4 :size 1) + (fge uint8 :offset 5 :size 1) + (abe uint8 :offset 6 :size 1) + (aa1 uint8 :offset 7 :size 1) + (fst uint8 :offset 8 :size 1) + (ctxt uint8 :offset 9 :size 1) + (fix uint8 :offset 10 :size 1) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-rgbaq +(deftype gs-rgbaq (uint64) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + (a uint8 :offset 24 :size 8) + (q float :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-xyz +(deftype gs-xyz (uint64) + ((x uint16 :offset 0 :size 16) + (y uint16 :offset 16 :size 16) + (z uint32 :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-uv +(deftype gs-uv (uint64) + ((u uint16 :offset 0 :size 14) + (v uint16 :offset 16 :size 14) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-st +(deftype gs-st (uint64) + ((s float :offset 0 :size 32) + (t float :offset 32 :size 32) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-xyzf +(deftype gs-xyzf (uint64) + ((x uint16 :offset 0 :size 16) + (y uint16 :offset 16 :size 16) + (z uint32 :offset 32 :size 24) + (f uint8 :offset 56 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-adcmd +(deftype gs-adcmd (structure) + ((word uint32 4 :offset-assert 0) + (quad uint128 :offset 0) + (data uint64 :offset 0) + (cmds uint64 :offset 8) + (cmd uint8 :offset 8) + (x uint32 :offset 0) + (y uint32 :offset 4) + (z uint32 :offset 8) + (w uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gs-adcmd +;; INFO: Used lq/sq +(defmethod inspect gs-adcmd ((obj gs-adcmd)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-adcmd) + (format #t "~1Tword[4] @ #x~X~%" (-> obj word)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tdata: ~D~%" (-> obj data)) + (format #t "~1Tcmds: ~D~%" (-> obj cmds)) + (format #t "~1Tcmd: ~D~%" (-> obj cmd)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (label cfg-4) + obj + ) + +;; definition of type gs-trxpos +(deftype gs-trxpos (uint64) + ((ssax uint16 :offset 0 :size 11) + (ssay uint16 :offset 16 :size 11) + (dsax uint16 :offset 32 :size 11) + (dsay uint16 :offset 48 :size 11) + (dir uint8 :offset 59 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-trxreg +(deftype gs-trxreg (uint64) + ((rrw uint16 :offset 0 :size 12) + (rrh uint16 :offset 32 :size 12) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-trxdir +(deftype gs-trxdir (uint64) + ((xdir uint8 :offset 0 :size 2) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-bitbltbuf +(deftype gs-bitbltbuf (uint64) + ((sbp uint16 :offset 0 :size 14) + (sbw uint8 :offset 16 :size 6) + (spsm uint8 :offset 24 :size 6) + (dbp uint16 :offset 32 :size 14) + (dbw uint8 :offset 48 :size 6) + (dpsm uint8 :offset 56 :size 6) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-tex0 +(deftype gs-tex0 (uint64) + ((tbp0 uint16 :offset 0 :size 14) + (tbw uint8 :offset 14 :size 6) + (psm uint8 :offset 20 :size 6) + (tw uint8 :offset 26 :size 4) + (th uint8 :offset 30 :size 4) + (tcc uint8 :offset 34 :size 1) + (tfx uint8 :offset 35 :size 2) + (cbp uint16 :offset 37 :size 14) + (cpsm uint8 :offset 51 :size 4) + (csm uint8 :offset 55 :size 1) + (csa uint8 :offset 56 :size 5) + (cld uint8 :offset 61 :size 3) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-tex1 +(deftype gs-tex1 (uint64) + ((lcm uint8 :offset 0 :size 1) + (mxl uint8 :offset 2 :size 3) + (mmag uint8 :offset 5 :size 1) + (mmin uint8 :offset 6 :size 3) + (mtba uint8 :offset 9 :size 1) + (l uint8 :offset 19 :size 2) + (k int16 :offset 32 :size 12) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-texa +(deftype gs-texa (uint64) + ((ta0 uint8 :offset 0 :size 8) + (aem uint8 :offset 15 :size 1) + (ta1 uint8 :offset 32 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-texclut +(deftype gs-texclut (uint64) + ((cbw uint8 :offset 0 :size 6) + (cou uint8 :offset 6 :size 6) + (cov uint16 :offset 12 :size 10) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-miptbp +(deftype gs-miptbp (uint64) + ((tbp1 uint16 :offset 0 :size 14) + (tbw1 uint8 :offset 14 :size 6) + (tbp2 uint16 :offset 20 :size 14) + (tbw2 uint8 :offset 34 :size 6) + (tbp3 uint16 :offset 40 :size 14) + (tbw3 uint8 :offset 54 :size 6) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-alpha +(deftype gs-alpha (uint64) + ((a uint8 :offset 0 :size 2) + (b uint8 :offset 2 :size 2) + (c uint8 :offset 4 :size 2) + (d uint8 :offset 6 :size 2) + (fix uint8 :offset 32 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type gs-alpha +(defmethod inspect gs-alpha ((obj gs-alpha)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-alpha) + (format #t "~1Ta: ~D~%" (-> obj a)) + (format #t "~1Tb: ~D~%" (-> obj b)) + (format #t "~1Tc: ~D~%" (-> obj c)) + (format #t "~1Td: ~D~%" (-> obj d)) + (format #t "~1Tfix: ~D~%" (-> obj fix)) + (label cfg-4) + obj + ) + +;; definition of type gs-clamp +(deftype gs-clamp (uint64) + ((wms gs-tex-wrap-mode :offset 0 :size 2) + (wmt gs-tex-wrap-mode :offset 2 :size 2) + (minu uint16 :offset 4 :size 10) + (maxu uint16 :offset 14 :size 10) + (minv uint16 :offset 24 :size 10) + (maxv uint16 :offset 34 :size 10) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gs-fog +(deftype gs-fog (uint64) + ((f uint8 :offset 56 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type gs-fog +(defmethod inspect gs-fog ((obj gs-fog)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-fog) + (format #t "~1Tf: ~D~%" (-> obj f)) + (label cfg-4) + obj + ) + +;; definition of type gs-fogcol +(deftype gs-fogcol (uint64) + ((fcr uint8 :offset 0 :size 8) + (fcg uint8 :offset 8 :size 8) + (fcb uint8 :offset 16 :size 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type gs-fogcol +(defmethod inspect gs-fogcol ((obj gs-fogcol)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-fogcol) + (format #t "~1Tr: ~D~%" (-> obj fcr)) + (format #t "~1Tg: ~D~%" (-> obj fcg)) + (format #t "~1Tb: ~D~%" (-> obj fcb)) + (label cfg-4) + obj + ) + +;; definition of type gif-ctrl +(deftype gif-ctrl (uint32) + ((rst uint8 :offset 0 :size 1) + (pse uint8 :offset 3 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-mode +(deftype gif-mode (uint32) + ((m3r uint8 :offset 0 :size 1) + (imt uint8 :offset 2 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-stat +(deftype gif-stat (uint32) + ((m3r uint8 :offset 0 :size 1) + (m3p uint8 :offset 1 :size 1) + (imt uint8 :offset 2 :size 1) + (pse uint8 :offset 3 :size 1) + (ip3 uint8 :offset 5 :size 1) + (p3q uint8 :offset 6 :size 1) + (p2q uint8 :offset 7 :size 1) + (p1q uint8 :offset 8 :size 1) + (oph uint8 :offset 9 :size 1) + (apath uint8 :offset 10 :size 2) + (dir uint8 :offset 12 :size 1) + (fqc uint8 :offset 24 :size 5) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-cnt +(deftype gif-cnt (uint32) + ((loopcnt uint16 :offset 0 :size 15) + (regcnt uint8 :offset 16 :size 4) + (vuaddr uint16 :offset 20 :size 10) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-p3cnt +(deftype gif-p3cnt (uint32) + ((p3cnt uint16 :offset 0 :size 15) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-p3tag +(deftype gif-p3tag (uint32) + ((loopcnt uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-bank +(deftype gif-bank (structure) + ((ctrl gif-ctrl :offset 0) + (mode gif-mode :offset 16) + (stat gif-stat :offset 32) + (tag0 uint32 :offset 64) + (tag1 uint32 :offset 80) + (tag2 uint32 :offset 96) + (tag3 uint32 :offset 112) + (cnt gif-cnt :offset 128) + (p3cnt gif-p3cnt :offset 144) + (p3tag gif-p3tag :offset 160) + ) + :method-count-assert 9 + :size-assert #xa4 + :flag-assert #x9000000a4 + ) + +;; definition for method 3 of type gif-bank +(defmethod inspect gif-bank ((obj gif-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gif-bank) + (format #t "~1Tctrl: #x~X~%" (-> obj ctrl)) + (format #t "~1Tmode: #x~X~%" (-> obj mode)) + (format #t "~1Tstat: #x~X~%" (-> obj stat)) + (format #t "~1Ttag0: #x~X~%" (-> obj tag0)) + (format #t "~1Ttag1: #x~X~%" (-> obj tag1)) + (format #t "~1Ttag2: #x~X~%" (-> obj tag2)) + (format #t "~1Ttag3: #x~X~%" (-> obj tag3)) + (format #t "~1Tcnt: #x~X~%" (-> obj cnt)) + (format #t "~1Tp3cnt: #x~X~%" (-> obj p3cnt)) + (format #t "~1Tp3tag: #x~X~%" (-> obj p3tag)) + (label cfg-4) + obj + ) + +;; definition of type gif-tag-prim +(deftype gif-tag-prim (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-tag-count +(deftype gif-tag-count (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type gif-tag64 +(deftype gif-tag64 (uint64) + ((nloop uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + (id uint16 :offset 32 :size 14) + (pre uint8 :offset 46 :size 1) + (prim gs-prim :offset 47 :size 11) + (flg gif-flag :offset 58 :size 2) + (nreg uint8 :offset 60 :size 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition of type gif-tag +(deftype gif-tag (uint128) + ((nloop uint16 :offset 0 :size 15) + (eop uint8 :offset 15 :size 1) + (id uint16 :offset 32 :size 14) + (pre uint8 :offset 46 :size 1) + (prim uint16 :offset 47 :size 11) + (flg gif-flag :offset 58 :size 2) + (nreg uint8 :offset 60 :size 4) + (regs0 gif-reg-id :offset 64 :size 4) + (regs1 gif-reg-id :offset 68 :size 4) + (regs2 gif-reg-id :offset 72 :size 4) + (regs3 gif-reg-id :offset 76 :size 4) + (regs4 gif-reg-id :offset 80 :size 4) + (regs5 gif-reg-id :offset 84 :size 4) + (regs6 gif-reg-id :offset 88 :size 4) + (regs7 gif-reg-id :offset 92 :size 4) + (regs8 gif-reg-id :offset 96 :size 4) + (regs9 gif-reg-id :offset 100 :size 4) + (regs10 gif-reg-id :offset 104 :size 4) + (regs11 gif-reg-id :offset 108 :size 4) + (regs12 gif-reg-id :offset 112 :size 4) + (regs13 gif-reg-id :offset 116 :size 4) + (regs14 gif-reg-id :offset 120 :size 4) + (regs15 gif-reg-id :offset 124 :size 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition of type gs-gif-tag +(deftype gs-gif-tag (structure) + ((qword uint128 :offset-assert 0) + (tag gif-tag64 :offset 0) + (regs gif-tag-regs :offset 8) + (dword uint64 2 :offset 0) + (word uint32 4 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gs-gif-tag +(defmethod inspect gs-gif-tag ((obj gs-gif-tag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-gif-tag) + (format #t "~1Tqword: #~%" (&-> obj tag)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> obj tag)) + (format #t "~1Tword[4] @ #x~X~%" (&-> obj tag)) + (format #t "~1Ttag: ~D~%" (-> obj tag)) + (format #t "~1Tregs: ~D~%" (-> obj regs)) + (label cfg-4) + obj + ) + +;; definition for method 3 of type gif-tag +;; INFO: Return type mismatch object vs gif-tag. +(defmethod inspect gif-tag ((obj gif-tag)) + (format #t "[~8x] gif-tag~%" obj) + (format #t "~Tnloop: ~4d~%" (-> obj nloop)) + (format #t "~Teop : ~4d~%" (-> obj eop)) + (format #t "~Tid : ~4d~%" (-> obj id)) + (format #t "~Tpre : ~4d~%" (-> obj pre)) + (format #t "~Tprim : ~4d~%" (-> obj prim)) + (format #t "~Tflg : ~4d~%" (-> obj flg)) + (format #t "~Tnreg : ~4d~%" (-> obj nreg)) + (format #t "~Tregs0 : ~4d~%" (-> obj regs0)) + (format #t "~Tregs1 : ~4d~%" (-> obj regs1)) + (format #t "~Tregs2 : ~4d~%" (-> obj regs2)) + (format #t "~Tregs3 : ~4d~%" (-> obj regs3)) + (format #t "~Tregs4 : ~4d~%" (-> obj regs4)) + (format #t "~Tregs5 : ~4d~%" (-> obj regs5)) + (format #t "~Tregs6 : ~4d~%" (-> obj regs6)) + (format #t "~Tregs7 : ~4d~%" (-> obj regs7)) + (format #t "~Tregs8 : ~4d~%" (-> obj regs8)) + (format #t "~Tregs9 : ~4d~%" (-> obj regs9)) + (format #t "~Tregs10: ~4d~%" (-> obj regs10)) + (format #t "~Tregs11: ~4d~%" (-> obj regs11)) + (format #t "~Tregs12: ~4d~%" (-> obj regs12)) + (format #t "~Tregs13: ~4d~%" (-> obj regs13)) + (format #t "~Tregs14: ~4d~%" (-> obj regs14)) + (the-as gif-tag (format #t "~Tregs15: ~4d~%" (-> obj regs15))) + ) + +;; definition for symbol *fog-color*, type rgba +(define *fog-color* (new 'static 'rgba :r #x80)) + +;; definition of type gif-packet +(deftype gif-packet (basic) + ((reg-count int32 :offset-assert 4) + (gif-tag gs-gif-tag :inline :offset-assert 16) + (gif-tag0 uint128 :offset 16) + (args uint64 1 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type int) _type_ 0) + ) + ) + +;; definition for method 3 of type gif-packet +;; INFO: Used lq/sq +(defmethod inspect gif-packet ((obj gif-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Treg-count: ~D~%" (-> obj reg-count)) + (format #t "~1Tgif-tag0: #x~X~%" (-> obj gif-tag0)) + (format #t "~1Targs[1] @ #x~X~%" (-> obj args)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type gif-packet +(defmethod new gif-packet ((allocation symbol) (type-to-make type) (arg0 int)) + (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (+ arg0 -1) 8)))) + ) + +;; definition for function open-gif-packet +(defun open-gif-packet ((arg0 gif-packet)) + (set! (-> arg0 reg-count) 0) + (set! (-> arg0 gif-tag regs) (new 'static 'gif-tag-regs)) + arg0 + ) + +;; definition for function add-reg-gif-packet +;; INFO: Return type mismatch gif-packet vs none. +(defun add-reg-gif-packet ((arg0 gif-packet) (arg1 int) (arg2 int)) + (let ((v1-0 (-> arg0 gif-tag))) + (logior! (-> v1-0 regs) (ash arg1 (* (-> arg0 reg-count) 4))) + ) + (set! (-> (&-> arg0 args (-> arg0 reg-count)) 0) (the-as uint arg2)) + (+! (-> arg0 reg-count) 1) + (none) + ) + +;; definition for function close-gif-packet +(defun close-gif-packet ((arg0 gif-packet) (arg1 int)) + (set! (-> arg0 gif-tag tag) + (new 'static 'gif-tag64 :nloop #x1 :flg (gif-flag reg-list) :eop arg1 :nreg (-> arg0 reg-count)) + ) + arg0 + ) + +;; definition of type draw-context +(deftype draw-context (basic) + ((orgx int32 :offset-assert 4) + (orgy int32 :offset-assert 8) + (orgz int32 :offset-assert 12) + (width int32 :offset-assert 16) + (height int32 :offset-assert 20) + (color rgba 4 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type int int int int rgba) _type_ 0) + ) + ) + +;; definition for method 3 of type draw-context +(defmethod inspect draw-context ((obj draw-context)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Torgx: ~D~%" (-> obj orgx)) + (format #t "~1Torgy: ~D~%" (-> obj orgy)) + (format #t "~1Torgz: ~D~%" (-> obj orgz)) + (format #t "~1Twidth: ~D~%" (-> obj width)) + (format #t "~1Theight: ~D~%" (-> obj height)) + (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type draw-context +(defmethod new draw-context ((allocation symbol) (type-to-make type) (arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 rgba)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 orgx) arg0) + (set! (-> v0-0 orgy) arg1) + (set! (-> v0-0 orgz) #xffffff) + (set! (-> v0-0 width) arg2) + (set! (-> v0-0 height) arg3) + (set! (-> v0-0 color 0) arg4) + v0-0 + ) + ) + +;; definition for function draw-context-set-xy +;; INFO: Return type mismatch int vs none. +(defun draw-context-set-xy ((arg0 draw-context) (arg1 int) (arg2 int)) + (set! (-> arg0 orgx) arg1) + (set! (-> arg0 orgy) arg2) + (none) + ) + +;; definition of type gs-packed-rgba +(deftype gs-packed-rgba (vector4w) + ((r int32 :offset 0) + (g int32 :offset 4) + (b int32 :offset 8) + (a int32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gs-packed-rgba +;; INFO: Used lq/sq +(defmethod inspect gs-packed-rgba ((obj gs-packed-rgba)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-packed-rgba) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> obj x)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tr: ~D~%" (-> obj x)) + (format #t "~1Tg: ~D~%" (-> obj y)) + (format #t "~1Tb: ~D~%" (-> obj z)) + (format #t "~1Ta: ~D~%" (-> obj w)) + (label cfg-4) + obj + ) + +;; definition of type gs-packed-xyzw +(deftype gs-packed-xyzw (vector) + ((ix int32 :offset 0) + (iy int32 :offset 4) + (iz int32 :offset 8) + (iw int32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gs-packed-xyzw +;; INFO: Used lq/sq +(defmethod inspect gs-packed-xyzw ((obj gs-packed-xyzw)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-packed-xyzw) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tix: ~D~%" (-> obj x)) + (format #t "~1Tiy: ~D~%" (-> obj y)) + (format #t "~1Tiz: ~D~%" (-> obj z)) + (format #t "~1Tiw: ~D~%" (-> obj w)) + (label cfg-4) + obj + ) + +;; definition of type gs-packed-stq +(deftype gs-packed-stq (vector) + ((tex-s float :offset 0) + (tex-t float :offset 4) + (tex-q float :offset 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gs-packed-stq +;; INFO: Used lq/sq +(defmethod inspect gs-packed-stq ((obj gs-packed-stq)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-packed-stq) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Ttex-s: ~f~%" (-> obj x)) + (format #t "~1Ttex-t: ~f~%" (-> obj y)) + (format #t "~1Ttex-q: ~f~%" (-> obj z)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type gs-packed-uv +(deftype gs-packed-uv (vector) + ((u int16 :offset 0) + (v int16 :offset 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type gs-packed-uv +;; INFO: Used lq/sq +(defmethod inspect gs-packed-uv ((obj gs-packed-uv)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-packed-uv) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tu: ~D~%" (-> obj u)) + (format #t "~1Tv: ~D~%" (-> obj v)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type gs-packed-gt +(deftype gs-packed-gt (structure) + ((stq gs-packed-stq :inline :offset 0) + (rgba gs-packed-rgba :inline :offset 16) + (xyzw gs-packed-xyzw :inline :offset 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type gs-packed-gt +(defmethod inspect gs-packed-gt ((obj gs-packed-gt)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-packed-gt) + (format #t "~1Tstq: #~%" (-> obj stq)) + (format #t "~1Trgba: #~%" (-> obj rgba)) + (format #t "~1Txyzw: #~%" (-> obj xyzw)) + (label cfg-4) + obj + ) + +;; definition of type gs-packed-gt4 +(deftype gs-packed-gt4 (structure) + ((data gs-packed-gt 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +;; definition for method 3 of type gs-packed-gt4 +(defmethod inspect gs-packed-gt4 ((obj gs-packed-gt4)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-packed-gt4) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc new file mode 100644 index 0000000000..29cfb60bd8 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/hw/video-h_REF.gc @@ -0,0 +1,59 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type video-params +(deftype video-params (structure) + ((set-video-mode basic :offset-assert 0) + (reset-video-mode basic :offset-assert 4) + (display-fbp int32 :offset-assert 8) + (relative-x-scale float :offset 16) + (display-dx int32 :offset-assert 20) + (display-dy int32 :offset-assert 24) + (display-sy int32 :offset-assert 28) + (relative-x-scale-reciprical float :offset-assert 32) + (screen-pages-high int32 :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type video-params +(defmethod inspect video-params ((obj video-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'video-params) + (format #t "~1Tset-video-mode: ~A~%" (-> obj set-video-mode)) + (format #t "~1Treset-video-mode: ~A~%" (-> obj reset-video-mode)) + (format #t "~1Tdisplay-fbp: ~D~%" (-> obj display-fbp)) + (format #t "~1Trelative-x-scale: ~f~%" (-> obj relative-x-scale)) + (format #t "~1Tdisplay-dx: ~D~%" (-> obj display-dx)) + (format #t "~1Tdisplay-dy: ~D~%" (-> obj display-dy)) + (format #t "~1Tdisplay-sy: ~D~%" (-> obj display-sy)) + (format #t "~1Trelative-x-scale-reciprical: ~f~%" (-> obj relative-x-scale-reciprical)) + (format #t "~1Tscreen-pages-high: ~D~%" (-> obj screen-pages-high)) + (label cfg-4) + obj + ) + +;; definition for symbol *video-params*, type video-params +(define *video-params* (new 'static 'video-params + :set-video-mode #f + :reset-video-mode #f + :display-fbp #xa4 + :relative-x-scale 1.0 + :display-dy 8 + :display-sy #xe0 + :relative-x-scale-reciprical 1.0 + :screen-pages-high 13 + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc new file mode 100644 index 0000000000..970c5d06e6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/lightning-h_REF.gc @@ -0,0 +1,327 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type lightning-spec +(deftype lightning-spec (basic) + ((name string :offset-assert 4) + (flags lightning-spec-flags :offset-assert 8) + (rand-func uint8 :offset-assert 10) + (adjust-distance uint8 :offset-assert 11) + (start-color uint32 :offset-assert 12) + (end-color uint32 :offset-assert 16) + (fade-to-color uint32 :offset-assert 20) + (fade-start-factor float :offset-assert 24) + (fade-time float :offset-assert 28) + (texture uint32 :offset-assert 32) + (reduction float :offset-assert 36) + (num-points int32 :offset-assert 40) + (box-size float :offset-assert 44) + (merge-factor float :offset-assert 48) + (merge-count int32 :offset-assert 52) + (radius float :offset-assert 56) + (duration float :offset-assert 60) + (duration-rand float :offset-assert 64) + (sound basic :offset-assert 68) + (delay float :offset-assert 72) + (delay-rand float :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type lightning-spec +(defmethod inspect lightning-spec ((obj lightning-spec)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Trand-func: ~D~%" (-> obj rand-func)) + (format #t "~1Tadjust-distance: ~D~%" (-> obj adjust-distance)) + (format #t "~1Tstart-color: ~D~%" (-> obj start-color)) + (format #t "~1Tend-color: ~D~%" (-> obj end-color)) + (format #t "~1Tfade-to-color: ~D~%" (-> obj fade-to-color)) + (format #t "~1Tfade-start-factor: ~f~%" (-> obj fade-start-factor)) + (format #t "~1Tfade-time: ~f~%" (-> obj fade-time)) + (format #t "~1Ttexture: ~D~%" (-> obj texture)) + (format #t "~1Treduction: ~f~%" (-> obj reduction)) + (format #t "~1Tnum-points: ~D~%" (-> obj num-points)) + (format #t "~1Tbox-size: ~f~%" (-> obj box-size)) + (format #t "~1Tmerge-factor: ~f~%" (-> obj merge-factor)) + (format #t "~1Tmerge-count: ~D~%" (-> obj merge-count)) + (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "~1Tduration: ~f~%" (-> obj duration)) + (format #t "~1Tduration-rand: ~f~%" (-> obj duration-rand)) + (format #t "~1Tsound: ~A~%" (-> obj sound)) + (format #t "~1Tdelay: ~f~%" (-> obj delay)) + (format #t "~1Tdelay-rand: ~f~%" (-> obj delay-rand)) + (label cfg-4) + obj + ) + +;; definition for function lookup-lightning-spec-by-name +(defun lookup-lightning-spec-by-name ((arg0 string)) + (let* ((s5-0 *lightning-spec-id-table*) + (s4-0 (-> s5-0 length)) + ) + (dotimes (s3-0 s4-0) + (let ((s2-0 (-> s5-0 s3-0))) + (if (and (nonzero? s2-0) (string= arg0 (-> s2-0 name))) + (return s2-0) + ) + ) + ) + ) + (the-as lightning-spec #f) + ) + +;; definition of type lightning-state +(deftype lightning-state (structure) + ((mode lightning-mode :offset-assert 0) + (counter float :offset-assert 4) + (points-to-draw int32 :offset-assert 8) + (box-size float :offset-assert 12) + (gcf-control gcf-control :inline :offset-assert 16) + (line vector-array :offset-assert 128) + (meet vector-array :offset-assert 132) + (path vector-array :offset-assert 136) + (start-color uint32 :offset-assert 140) + (end-color uint32 :offset-assert 144) + ) + :method-count-assert 9 + :size-assert #x94 + :flag-assert #x900000094 + ) + +;; definition for method 3 of type lightning-state +(defmethod inspect lightning-state ((obj lightning-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'lightning-state) + (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "~1Tcounter: ~f~%" (-> obj counter)) + (format #t "~1Tpoints-to-draw: ~D~%" (-> obj points-to-draw)) + (format #t "~1Tbox-size: ~f~%" (-> obj box-size)) + (format #t "~1Tgcf-control: #~%" (-> obj gcf-control)) + (format #t "~1Tline: ~A~%" (-> obj line)) + (format #t "~1Tmeet: ~A~%" (-> obj meet)) + (format #t "~1Tpath: ~A~%" (-> obj path)) + (format #t "~1Tstart-color: ~D~%" (-> obj start-color)) + (format #t "~1Tend-color: ~D~%" (-> obj end-color)) + (label cfg-4) + obj + ) + +;; definition of type lightning-control +(deftype lightning-control (basic) + ((spec lightning-spec :offset-assert 4) + (process process :offset-assert 8) + (state lightning-state :inline :offset-assert 16) + ) + :method-count-assert 14 + :size-assert #xa4 + :flag-assert #xe000000a4 + (:methods + (new (symbol type lightning-spec process float) _type_ 0) + (change-mode (_type_ lightning-mode) lightning-mode 9) + (get-mode (_type_) lightning-mode 10) + (set-point (_type_ int vector) none 11) + (set-first-meet-point (_type_ vector) none 12) + (set-last-meet-point (_type_ vector) none 13) + ) + ) + +;; definition for method 3 of type lightning-control +(defmethod inspect lightning-control ((obj lightning-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tspec: ~A~%" (-> obj spec)) + (format #t "~1Tprocess: #x~X~%" (-> obj process)) + (format #t "~1Tstate: #~%" (-> obj state)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type lightning-control +(defmethod change-mode lightning-control ((obj lightning-control) (arg0 lightning-mode)) + (let ((v1-1 (!= arg0 (-> obj state mode)))) + (case arg0 + (((lightning-mode lm3)) + (if v1-1 + (set! (-> obj state counter) 0.0) + ) + ) + (((lightning-mode lm1)) + (set! (-> obj state start-color) (-> obj spec start-color)) + (set! (-> obj state end-color) (-> obj spec end-color)) + ) + ) + ) + (set! (-> obj state mode) arg0) + arg0 + ) + +;; definition for method 10 of type lightning-control +(defmethod get-mode lightning-control ((obj lightning-control)) + (-> obj state mode) + ) + +;; definition for method 11 of type lightning-control +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defmethod set-point lightning-control ((obj lightning-control) (arg0 int) (arg1 vector)) + (let ((v1-0 (-> obj state))) + (when (and (-> v1-0 path) (>= arg0 0) (< arg0 (-> v1-0 path length))) + (set! (-> v1-0 path data arg0 quad) (-> arg1 quad)) + (when (and (< (+ (-> v1-0 points-to-draw) -1) arg0) (case (-> v1-0 mode) + (((lightning-mode lm2) (lightning-mode lm3)) + #t + ) + (else + #f + ) + ) + ) + (set! (-> v1-0 line data arg0 quad) (-> arg1 quad)) + (set! (-> v1-0 meet data arg0 quad) (-> arg1 quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 12 of type lightning-control +;; INFO: Used lq/sq +;; INFO: Return type mismatch (inline-array vector) vs none. +(defmethod set-first-meet-point lightning-control ((obj lightning-control) (arg0 vector)) + (set! (-> obj state meet data 0 quad) (-> arg0 quad)) + (none) + ) + +;; definition for method 13 of type lightning-control +;; INFO: Used lq/sq +;; INFO: Return type mismatch vector vs none. +(defmethod set-last-meet-point lightning-control ((obj lightning-control) (arg0 vector)) + (set! (-> obj state meet data (+ (-> obj state points-to-draw) -1) quad) (-> arg0 quad)) + (none) + ) + +;; definition for method 7 of type lightning-control +(defmethod relocate lightning-control ((obj lightning-control) (arg0 int)) + (&+! (-> obj state line) arg0) + (&+! (-> obj state meet) arg0) + (if (-> obj state path) + (&+! (-> obj state path) arg0) + ) + (let ((v1-8 (-> obj spec))) + (if (and (>= (the-as int v1-8) (-> *kernel-context* relocating-min)) + (< (the-as int v1-8) (-> *kernel-context* relocating-max)) + ) + (&+! (-> obj spec) arg0) + ) + ) + obj + ) + +;; definition for method 0 of type lightning-control +;; INFO: Return type mismatch object vs lightning-control. +(defmethod new lightning-control ((allocation symbol) (type-to-make type) (arg0 lightning-spec) (arg1 process) (arg2 float)) + (with-pp + (let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (when (zero? obj) + (go process-drawable-art-error "memory") + (set! obj (the-as lightning-control 0)) + (goto cfg-14) + ) + (let ((s3-0 (-> arg0 num-points))) + (let ((f0-0 (-> arg0 box-size))) + (when (logtest? (-> arg0 flags) (lightning-spec-flags size-from-adjust-dist)) + (let ((f1-1 (fmax 1.0 (fmin 5.0 (/ arg2 (* 4096.0 (the float (-> arg0 adjust-distance)))))))) + (set! s3-0 (* s3-0 (the int f1-1))) + (set! f0-0 (* f0-0 f1-1)) + ) + ) + (set! (-> obj state box-size) f0-0) + ) + (set! (-> obj process) (the-as process (process->ppointer arg1))) + (set! (-> obj state mode) (lightning-mode lm1)) + (set! (-> obj state line) ((method-of-type vector-array new) allocation vector-array s3-0)) + (set! (-> obj state meet) ((method-of-type vector-array new) allocation vector-array s3-0)) + (let ((v1-18 (-> arg0 rand-func))) + (set! (-> obj state path) (if (or (= v1-18 2) (= v1-18 3)) + ((method-of-type vector-array new) allocation vector-array s3-0) + (the-as vector-array #f) + ) + ) + ) + (set! (-> obj state counter) 0.0) + (set! (-> obj state points-to-draw) s3-0) + ) + (set! (-> obj spec) arg0) + (set! (-> obj state start-color) (-> arg0 start-color)) + (set! (-> obj state end-color) (-> arg0 end-color)) + (add-connection *lightning-engine* pp nothing obj #f #f) + (label cfg-14) + (the-as lightning-control obj) + ) + ) + ) + +;; definition of type lightning-probe-vars +(deftype lightning-probe-vars (basic) + ((src-joint-index uint32 :offset-assert 4) + (next-spawn-time time-frame :offset-assert 8) + (last-valid-time time-frame :offset-assert 16) + (point vector 2 :inline :offset-assert 32) + (start-pos vector :inline :offset 32) + (end-pos vector :inline :offset 48) + (probe-dirs (inline-array vector) :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +;; definition for method 3 of type lightning-probe-vars +(defmethod inspect lightning-probe-vars ((obj lightning-probe-vars)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tsrc-joint-index: ~D~%" (-> obj src-joint-index)) + (format #t "~1Tnext-spawn-time: ~D~%" (-> obj next-spawn-time)) + (format #t "~1Tlast-valid-time: ~D~%" (-> obj last-valid-time)) + (format #t "~1Tpoint[2] @ #x~X~%" (-> obj point)) + (format #t "~1Tstart-pos: #~%" (-> obj point)) + (format #t "~1Tend-pos: #~%" (-> obj end-pos)) + (format #t "~1Tprobe-dirs: #x~X~%" (-> obj probe-dirs)) + (label cfg-4) + obj + ) + +;; definition for symbol *lightning-probe-vars*, type lightning-probe-vars +(define *lightning-probe-vars* + (new 'static 'lightning-probe-vars :probe-dirs (new 'static 'inline-array vector 6 + (new 'static 'vector :z 1.0 :w 1.0) + (new 'static 'vector :x 1.0 :w 1.0) + (new 'static 'vector :z -1.0 :w 1.0) + (new 'static 'vector :x -1.0 :w 1.0) + (new 'static 'vector :y 1.0 :w 1.0) + (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/lights-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/lights-h_REF.gc new file mode 100644 index 0000000000..1c0c461216 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/lights-h_REF.gc @@ -0,0 +1,234 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vu-lights +(deftype vu-lights (structure) + ((direction vector 3 :inline :offset-assert 0) + (color vector 3 :inline :offset-assert 48) + (ambient vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type vu-lights +(defmethod inspect vu-lights ((obj vu-lights)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vu-lights) + (format #t "~1Tdirection[3] @ #x~X~%" (-> obj direction)) + (format #t "~1Tcolor[3] @ #x~X~%" (-> obj color)) + (format #t "~1Tambient: ~`vector`P~%" (-> obj ambient)) + (label cfg-4) + obj + ) + +;; definition of type light +(deftype light (structure) + ((direction vector :inline :offset-assert 0) + (color rgbaf :inline :offset-assert 16) + (extra vector :inline :offset-assert 32) + (level float :offset 32) + (luminance float :offset 40) + (priority float :offset 44) + (bytes uint8 4 :offset 36) + (mask uint16 :offset 36) + (palette-index int8 :offset 39) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type light +(defmethod inspect light ((obj light)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'light) + (format #t "~1Tdirection: #~%" (-> obj direction)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Textra: #~%" (-> obj extra)) + (format #t "~1Tlevel: ~f~%" (-> obj extra x)) + (format #t "~1Tluminance: ~f~%" (-> obj extra z)) + (format #t "~1Tpriority: ~f~%" (-> obj extra w)) + (format #t "~1Tbytes[4] @ #x~X~%" (&-> obj extra y)) + (format #t "~1Tmask: ~D~%" (-> obj mask)) + (format #t "~1Tpalette-index: ~D~%" (-> obj palette-index)) + (label cfg-4) + obj + ) + +;; definition of type light-sphere +(deftype light-sphere (structure) + ((name string :offset-assert 0) + (bsphere vector :inline :offset-assert 16) + (direction vector :inline :offset-assert 32) + (color vector :inline :offset-assert 48) + (decay-start float :offset 4) + (ambient-point-ratio float :offset 8) + (brightness float :offset 12) + (bytes uint8 4 :offset 60) + (mask uint16 :offset 60) + (palette-index int8 :offset 63) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type light-sphere +(defmethod inspect light-sphere ((obj light-sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'light-sphere) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tdirection: ~`vector`P~%" (-> obj direction)) + (format #t "~1Tcolor: ~`vector`P~%" (-> obj color)) + (format #t "~1Tdecay-start: ~f~%" (-> obj decay-start)) + (format #t "~1Tambient-point-ratio: ~f~%" (-> obj ambient-point-ratio)) + (format #t "~1Tbrightness: ~f~%" (-> obj brightness)) + (format #t "~1Tbytes[4] @ #x~X~%" (&-> obj color w)) + (format #t "~1Tmask: ~D~%" (-> obj mask)) + (format #t "~1Tpalette-index: ~D~%" (-> obj palette-index)) + (label cfg-4) + obj + ) + +;; definition of type light-hash-bucket +(deftype light-hash-bucket (structure) + ((index uint16 :offset-assert 0) + (count uint16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type light-hash-bucket +(defmethod inspect light-hash-bucket ((obj light-hash-bucket)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'light-hash-bucket) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (label cfg-4) + obj + ) + +;; definition of type light-hash +(deftype light-hash (basic) + ((num-lights uint16 :offset-assert 4) + (num-indices uint16 :offset-assert 6) + (num-buckets uint16 :offset-assert 8) + (bucket-step uint8 2 :offset-assert 10) + (base-trans vector :inline :offset-assert 16) + (axis-scale vector :inline :offset-assert 32) + (dimension-array vector4w :inline :offset-assert 48) + (bucket-array pointer :offset-assert 64) + (index-array pointer :offset-assert 68) + (light-sphere-array (inline-array light-sphere) :offset-assert 72) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +;; definition for method 3 of type light-hash +(defmethod inspect light-hash ((obj light-hash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnum-lights: ~D~%" (-> obj num-lights)) + (format #t "~1Tnum-indices: ~D~%" (-> obj num-indices)) + (format #t "~1Tnum-buckets: ~D~%" (-> obj num-buckets)) + (format #t "~1Tbucket-step[2] @ #x~X~%" (-> obj bucket-step)) + (format #t "~1Tbase-trans: #~%" (-> obj base-trans)) + (format #t "~1Taxis-scale: #~%" (-> obj axis-scale)) + (format #t "~1Tdimension-array: #~%" (-> obj dimension-array)) + (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) + (format #t "~1Tindex-array: #x~X~%" (-> obj index-array)) + (format #t "~1Tlight-sphere-array: #x~X~%" (-> obj light-sphere-array)) + (label cfg-4) + obj + ) + +;; definition of type light-hash-work +(deftype light-hash-work (structure) + ((ones vector4w :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type light-hash-work +(defmethod inspect light-hash-work ((obj light-hash-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'light-hash-work) + (format #t "~1Tones: #~%" (-> obj ones)) + (label cfg-4) + obj + ) + +;; definition for symbol *light-hash*, type light-hash +(define *light-hash* (the-as light-hash #f)) + +;; definition for method 2 of type light +(defmethod print light ((obj light)) + (format + #t + "# obj extra x) + (-> obj direction x) + (-> obj direction y) + (-> obj direction z) + ) + (format #t "~F ~F ~F @ #x~X>" (-> obj color x) (-> obj color y) (-> obj color z) obj) + obj + ) + +;; definition of type light-group +(deftype light-group (structure) + ((dir0 light :inline :offset-assert 0) + (dir1 light :inline :offset-assert 48) + (dir2 light :inline :offset-assert 96) + (ambi light :inline :offset-assert 144) + (lights light 4 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +;; definition for method 3 of type light-group +(defmethod inspect light-group ((obj light-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'light-group) + (format #t "~1Tdir0: ~`light`P~%" (-> obj dir0)) + (format #t "~1Tdir1: ~`light`P~%" (-> obj dir1)) + (format #t "~1Tdir2: ~`light`P~%" (-> obj dir2)) + (format #t "~1Tambi: ~`light`P~%" (-> obj ambi)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc new file mode 100644 index 0000000000..377830c2a1 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera-h_REF.gc @@ -0,0 +1,229 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vis-gif-tag +(deftype vis-gif-tag (structure) + ((fog0 uint32 :offset-assert 0) + (strip uint32 :offset-assert 4) + (regs uint32 :offset-assert 8) + (fan uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vis-gif-tag +(defmethod inspect vis-gif-tag ((obj vis-gif-tag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vis-gif-tag) + (format #t "~1Tfog0: ~D~%" (-> obj fog0)) + (format #t "~1Tstrip: ~D~%" (-> obj strip)) + (format #t "~1Tregs: ~D~%" (-> obj regs)) + (format #t "~1Tfan: ~D~%" (-> obj fan)) + (label cfg-4) + obj + ) + +;; definition of type cull-info +(deftype cull-info (structure) + ((x-fact float :offset-assert 0) + (y-fact float :offset-assert 4) + (z-fact float :offset-assert 8) + (cam-radius float :offset-assert 12) + (cam-x float :offset-assert 16) + (cam-y float :offset-assert 20) + (xz-dir-ax float :offset-assert 24) + (xz-dir-az float :offset-assert 28) + (xz-dir-bx float :offset-assert 32) + (xz-dir-bz float :offset-assert 36) + (xz-cross-ab float :offset-assert 40) + (yz-dir-ay float :offset-assert 44) + (yz-dir-az float :offset-assert 48) + (yz-dir-by float :offset-assert 52) + (yz-dir-bz float :offset-assert 56) + (yz-cross-ab float :offset-assert 60) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type cull-info +(defmethod inspect cull-info ((obj cull-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cull-info) + (format #t "~1Tx-fact: ~f~%" (-> obj x-fact)) + (format #t "~1Ty-fact: ~f~%" (-> obj y-fact)) + (format #t "~1Tz-fact: ~f~%" (-> obj z-fact)) + (format #t "~1Tcam-radius: ~f~%" (-> obj cam-radius)) + (format #t "~1Tcam-x: ~f~%" (-> obj cam-x)) + (format #t "~1Tcam-y: ~f~%" (-> obj cam-y)) + (format #t "~1Txz-dir-ax: ~f~%" (-> obj xz-dir-ax)) + (format #t "~1Txz-dir-az: ~f~%" (-> obj xz-dir-az)) + (format #t "~1Txz-dir-bx: ~f~%" (-> obj xz-dir-bx)) + (format #t "~1Txz-dir-bz: ~f~%" (-> obj xz-dir-bz)) + (format #t "~1Txz-cross-ab: ~f~%" (-> obj xz-cross-ab)) + (format #t "~1Tyz-dir-ay: ~f~%" (-> obj yz-dir-ay)) + (format #t "~1Tyz-dir-az: ~f~%" (-> obj yz-dir-az)) + (format #t "~1Tyz-dir-by: ~f~%" (-> obj yz-dir-by)) + (format #t "~1Tyz-dir-bz: ~f~%" (-> obj yz-dir-bz)) + (format #t "~1Tyz-cross-ab: ~f~%" (-> obj yz-cross-ab)) + (label cfg-4) + obj + ) + +;; definition of type math-camera +(deftype math-camera (basic) + ((d meters :offset-assert 4) + (f meters :offset-assert 8) + (fov degrees :offset-assert 12) + (x-ratio float :offset-assert 16) + (y-ratio float :offset-assert 20) + (x-pix float :offset-assert 24) + (x-clip float :offset-assert 28) + (x-clip-ratio-in float :offset-assert 32) + (x-clip-ratio-over float :offset-assert 36) + (y-pix float :offset-assert 40) + (y-clip float :offset-assert 44) + (y-clip-ratio-in float :offset-assert 48) + (y-clip-ratio-over float :offset-assert 52) + (cull-info cull-info :inline :offset-assert 56) + (fog-start meters :offset-assert 120) + (fog-end meters :offset-assert 124) + (fog-max float :offset-assert 128) + (fog-min float :offset-assert 132) + (reset int32 :offset-assert 136) + (smooth-step float :offset-assert 140) + (smooth-t float :offset-assert 144) + (perspective matrix :inline :offset-assert 160) + (isometric matrix :inline :offset-assert 224) + (sprite-2d matrix :inline :offset-assert 288) + (sprite-2d-hvdf vector :inline :offset-assert 352) + (camera-rot matrix :inline :offset-assert 368) + (inv-camera-rot matrix :inline :offset-assert 432) + (inv-camera-rot-smooth matrix :inline :offset-assert 496) + (inv-camera-rot-smooth-from quaternion :inline :offset-assert 560) + (camera-temp matrix :inline :offset-assert 576) + (prev-camera-temp matrix :inline :offset-assert 640) + (prev-inv-camera-rot matrix :inline :offset-assert 704) + (prev-trans vector :inline :offset-assert 768) + (hmge-scale vector :inline :offset-assert 784) + (inv-hmge-scale vector :inline :offset-assert 800) + (hvdf-off vector :inline :offset-assert 816) + (guard vector :inline :offset-assert 832) + (vis-gifs vis-gif-tag 4 :inline :offset-assert 848) + (giftex uint128 :offset 848) + (gifgr uint128 :offset 864) + (giftex-trans uint128 :offset 880) + (gifgr-trans uint128 :offset 896) + (pfog0 float :offset-assert 912) + (pfog1 float :offset-assert 916) + (trans vector :inline :offset-assert 928) + (plane plane 4 :inline :offset-assert 944) + (guard-plane plane 4 :inline :offset-assert 1008) + (shrub-mat matrix :inline :offset-assert 1072) + (quat-other quaternion :inline :offset-assert 1136) + (trans-other vector :inline :offset-assert 1152) + (shrub-mat-other matrix :inline :offset-assert 1168) + (camera-temp-other matrix :inline :offset-assert 1232) + (camera-rot-other matrix :inline :offset-assert 1296) + (inv-camera-rot-other matrix :inline :offset-assert 1360) + (plane-other plane 4 :inline :offset-assert 1424) + (guard-plane-other plane 4 :inline :offset-assert 1488) + (mirror-trans vector :inline :offset-assert 1552) + (mirror-normal vector :inline :offset-assert 1568) + (fov-correction-factor float :offset-assert 1584) + ) + :method-count-assert 9 + :size-assert #x634 + :flag-assert #x900000634 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type math-camera +;; INFO: Used lq/sq +(defmethod inspect math-camera ((obj math-camera)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Td: (meters ~m)~%" (-> obj d)) + (format #t "~1Tf: (meters ~m)~%" (-> obj f)) + (format #t "~1Tfov: (deg ~r)~%" (-> obj fov)) + (format #t "~1Tx-ratio: ~f~%" (-> obj x-ratio)) + (format #t "~1Ty-ratio: ~f~%" (-> obj y-ratio)) + (format #t "~1Tx-pix: ~f~%" (-> obj x-pix)) + (format #t "~1Tx-clip: ~f~%" (-> obj x-clip)) + (format #t "~1Tx-clip-ratio-in: ~f~%" (-> obj x-clip-ratio-in)) + (format #t "~1Tx-clip-ratio-over: ~f~%" (-> obj x-clip-ratio-over)) + (format #t "~1Ty-pix: ~f~%" (-> obj y-pix)) + (format #t "~1Ty-clip: ~f~%" (-> obj y-clip)) + (format #t "~1Ty-clip-ratio-in: ~f~%" (-> obj y-clip-ratio-in)) + (format #t "~1Ty-clip-ratio-over: ~f~%" (-> obj y-clip-ratio-over)) + (format #t "~1Tcull-info: #~%" (-> obj cull-info)) + (format #t "~1Tfog-start: (meters ~m)~%" (-> obj fog-start)) + (format #t "~1Tfog-end: (meters ~m)~%" (-> obj fog-end)) + (format #t "~1Tfog-max: ~f~%" (-> obj fog-max)) + (format #t "~1Tfog-min: ~f~%" (-> obj fog-min)) + (format #t "~1Treset: ~D~%" (-> obj reset)) + (format #t "~1Tsmooth-step: ~f~%" (-> obj smooth-step)) + (format #t "~1Tsmooth-t: ~f~%" (-> obj smooth-t)) + (format #t "~1Tperspective: #~%" (-> obj perspective)) + (format #t "~1Tisometric: #~%" (-> obj isometric)) + (format #t "~1Tsprite-2d: #~%" (-> obj sprite-2d)) + (format #t "~1Tsprite-2d-hvdf: #~%" (-> obj sprite-2d-hvdf)) + (format #t "~1Tcamera-rot: #~%" (-> obj camera-rot)) + (format #t "~1Tinv-camera-rot: #~%" (-> obj inv-camera-rot)) + (format #t "~1Tinv-camera-rot-smooth: #~%" (-> obj inv-camera-rot-smooth)) + (format #t "~1Tinv-camera-rot-smooth-from: #~%" (-> obj inv-camera-rot-smooth-from)) + (format #t "~1Tcamera-temp: #~%" (-> obj camera-temp)) + (format #t "~1Tprev-camera-temp: #~%" (-> obj prev-camera-temp)) + (format #t "~1Tprev-inv-camera-rot: #~%" (-> obj prev-inv-camera-rot)) + (format #t "~1Tprev-trans: ~`vector`P~%" (-> obj prev-trans)) + (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) + (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) + (format #t "~1Thvdf-off: #~%" (-> obj hvdf-off)) + (format #t "~1Tguard: #~%" (-> obj guard)) + (format #t "~1Tvis-gifs[4] @ #x~X~%" (-> obj vis-gifs)) + (format #t "~1Tgiftex: ~D~%" (-> obj giftex)) + (format #t "~1Tgifgr: ~D~%" (-> obj gifgr)) + (format #t "~1Tgiftex-trans: ~D~%" (-> obj giftex-trans)) + (format #t "~1Tgifgr-trans: ~D~%" (-> obj gifgr-trans)) + (format #t "~1Tpfog0: ~f~%" (-> obj pfog0)) + (format #t "~1Tpfog1: ~f~%" (-> obj pfog1)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tplane[4] @ #x~X~%" (-> obj plane)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) + (format #t "~1Tshrub-mat: #~%" (-> obj shrub-mat)) + (format #t "~1Tquat-other: #~%" (-> obj quat-other)) + (format #t "~1Ttrans-other: #~%" (-> obj trans-other)) + (format #t "~1Tshrub-mat-other: #~%" (-> obj shrub-mat-other)) + (format #t "~1Tcamera-temp-other: #~%" (-> obj camera-temp-other)) + (format #t "~1Tcamera-rot-other: #~%" (-> obj camera-rot-other)) + (format #t "~1Tinv-camera-rot-other: #~%" (-> obj inv-camera-rot-other)) + (format #t "~1Tplane-other[4] @ #x~X~%" (-> obj plane-other)) + (format #t "~1Tguard-plane-other[4] @ #x~X~%" (-> obj guard-plane-other)) + (format #t "~1Tmirror-trans: #~%" (-> obj mirror-trans)) + (format #t "~1Tmirror-normal: #~%" (-> obj mirror-normal)) + (format #t "~1Tfov-correction-factor: ~f~%" (-> obj fov-correction-factor)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc new file mode 100644 index 0000000000..0a01f8911d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/math-camera_REF.gc @@ -0,0 +1,612 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fog-corrector +(deftype fog-corrector (structure) + ((fog-end float :offset-assert 0) + (fog-start float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type fog-corrector +(defmethod inspect fog-corrector ((obj fog-corrector)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'fog-corrector) + (format #t "~1Tfog-end: ~f~%" (-> obj fog-end)) + (format #t "~1Tfog-start: ~f~%" (-> obj fog-start)) + (label cfg-4) + obj + ) + +;; definition for function fog-corrector-setup +;; INFO: Return type mismatch float vs none. +(defun fog-corrector-setup ((arg0 fog-corrector) (arg1 math-camera)) + (set! (-> arg0 fog-end) (* (-> arg1 fog-end) (-> arg1 fov-correction-factor))) + (set! (-> arg0 fog-start) (* (-> arg1 fog-start) (-> arg1 fov-correction-factor))) + (none) + ) + +;; definition for symbol *math-camera-fog-correction*, type fog-corrector +(define *math-camera-fog-correction* (new 'global 'fog-corrector)) + +;; definition for function update-math-camera +;; INFO: Used lq/sq +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +;; WARN: Stack slot offset 16 signed mismatch +(defun update-math-camera ((arg0 math-camera) (arg1 symbol) (arg2 symbol) (arg3 float)) + (local-vars (sv-16 float)) + (set! (-> arg0 x-ratio) (tan (* 0.5 arg3))) + (if (= arg2 'aspect4x3) + (set! (-> arg0 y-ratio) (* 0.75 (-> arg0 x-ratio))) + (set! (-> arg0 y-ratio) (* 0.5625 (-> arg0 x-ratio))) + ) + (let ((f1-3 (-> arg0 x-ratio)) + (f0-7 (-> arg0 y-ratio)) + (v1-6 (-> arg0 cull-info)) + ) + (/ (+ 1.0 (* 4.0 f1-3 f1-3)) (+ 1.0 (* f1-3 f1-3))) + (let ((f2-5 (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (+ 1.0 (* f0-7 f0-7))))) + (set! (-> v1-6 x-fact) (/ (+ 1.0 (* 4.0 f1-3 f1-3)) (* f1-3 (sqrtf (+ 1.0 (* 16.0 f1-3 f1-3)))))) + (set! (-> v1-6 y-fact) (/ (+ 1.0 (* 4.0 f0-7 f0-7)) (* f0-7 (sqrtf (+ 1.0 (* 16.0 f0-7 f0-7)))))) + (set! (-> v1-6 z-fact) (sqrtf (+ (* (+ -4.0 f2-5) (+ -4.0 f2-5) f0-7 f0-7) (* (+ -1.0 f2-5) (+ -1.0 f2-5))))) + ) + (let* ((f2-11 (* f1-3 (-> arg0 d))) + (f1-5 (* f0-7 (-> arg0 d))) + (f0-10 (+ (* f2-11 f2-11) (* f1-5 f1-5))) + (f1-8 (-> arg0 d)) + ) + (set! (-> v1-6 cam-radius) (sqrtf (+ f0-10 (* f1-8 f1-8)))) + ) + (let* ((f1-12 (* (-> arg0 d) (-> arg0 x-ratio))) + (f0-14 (-> arg0 d)) + (f2-13 (* 4.0 f1-12)) + (f3-21 (-> arg0 d)) + ) + (let ((f4-21 (/ 1.0 (sqrtf (+ (* f1-12 f1-12) (* f0-14 f0-14))))) + (f5-11 (/ 1.0 (sqrtf (+ (* f2-13 f2-13) (* f3-21 f3-21))))) + ) + (set! (-> v1-6 xz-dir-ax) (* f1-12 f4-21)) + (set! (-> v1-6 xz-dir-az) (* f0-14 f4-21)) + (set! (-> v1-6 xz-dir-bx) (* f2-13 f5-11)) + (set! (-> v1-6 xz-dir-bz) (* f3-21 f5-11)) + ) + (set! (-> v1-6 xz-cross-ab) (- (* f1-12 f3-21) (* f0-14 f2-13))) + ) + (let* ((f1-15 (* (-> arg0 d) (-> arg0 y-ratio))) + (f0-18 (-> arg0 d)) + (f2-15 (* 4.0 f1-15)) + (f3-22 (-> arg0 d)) + ) + (let ((f4-26 (/ 1.0 (sqrtf (+ (* f1-15 f1-15) (* f0-18 f0-18))))) + (f5-16 (/ 1.0 (sqrtf (+ (* f2-15 f2-15) (* f3-22 f3-22))))) + ) + (set! (-> v1-6 yz-dir-ay) (* f1-15 f4-26)) + (set! (-> v1-6 yz-dir-az) (* f0-18 f4-26)) + (set! (-> v1-6 yz-dir-by) (* f2-15 f5-16)) + (set! (-> v1-6 yz-dir-bz) (* f3-22 f5-16)) + ) + (set! (-> v1-6 yz-cross-ab) (- (* f1-15 f3-22) (* f0-18 f2-15))) + ) + ) + (fog-corrector-setup *math-camera-fog-correction* arg0) + (matrix-identity! (-> arg0 camera-rot)) + (let ((f0-21 100.0) + (f2-16 16760631.0) + ) + 16777115.0 + (let ((f30-0 (/ (* (-> arg0 d) (- (-> arg0 fog-min) (-> arg0 fog-max))) + (- (-> *math-camera-fog-correction* fog-end) (-> *math-camera-fog-correction* fog-start)) + ) + ) + (f1-21 (* -0.5 (- f2-16 f0-21))) + ) + (let ((f4-34 (/ f1-21 (* (-> arg0 d) (- (-> arg0 f) (-> arg0 d))))) + (f3-30 (-> arg0 fov-correction-factor)) + ) + (set! (-> arg0 perspective data 0) (* f3-30 (- (/ (-> arg0 x-pix) (* (-> arg0 x-ratio) (-> arg0 d)))))) + (set! (-> arg0 perspective data 5) (* f3-30 (- (/ (-> arg0 y-pix) (* (-> arg0 y-ratio) (-> arg0 d)))))) + (set! (-> arg0 perspective data 10) (* f3-30 (+ (-> arg0 f) (-> arg0 d)) f4-34)) + (set! (-> arg0 perspective data 11) (* (/ f3-30 (-> arg0 d)) f30-0)) + (set! (-> arg0 perspective trans z) (* -2.0 f4-34 (-> arg0 f) (-> arg0 d) f3-30)) + ) + (let ((f24-0 2048.0) + (f26-0 2048.0) + (f28-0 (/ (- (* (-> *math-camera-fog-correction* fog-end) (-> arg0 fog-max)) + (* (-> *math-camera-fog-correction* fog-start) (-> arg0 fog-min)) + ) + (- (-> *math-camera-fog-correction* fog-end) (-> *math-camera-fog-correction* fog-start)) + ) + ) + ) + (let ((f22-0 (* 0.5 (+ f2-16 f0-21)))) + (set! (-> arg0 hmge-scale x) (/ 1.0 (-> arg0 x-clip))) + (set! (-> arg0 hmge-scale y) (/ 1.0 (-> arg0 y-clip))) + (set! (-> arg0 hmge-scale z) (/ 1.0 f1-21)) + (set! (-> arg0 hmge-scale w) (/ 1.0 f30-0)) + (set! (-> arg0 inv-hmge-scale x) (-> arg0 x-clip)) + (set! (-> arg0 inv-hmge-scale y) (-> arg0 y-clip)) + (set! (-> arg0 inv-hmge-scale z) f1-21) + (set! (-> arg0 inv-hmge-scale w) f30-0) + (cond + ((or (zero? *screen-shot-work*) (= (-> *screen-shot-work* count) -1)) + (set! (-> arg0 hvdf-off x) f24-0) + (set! (-> arg0 hvdf-off y) f26-0) + ) + (else + (let* ((v1-32 (-> *screen-shot-work* count)) + (a0-36 (-> *screen-shot-work* size)) + (f0-34 (the float a0-36)) + (f20-0 (/ (the float (mod v1-32 a0-36)) f0-34)) + ) + (set! sv-16 (/ (the float (/ v1-32 a0-36)) f0-34)) + (format 0 "~f ~f~%" f20-0 sv-16) + (set! (-> arg0 hvdf-off x) (- f24-0 f20-0)) + ) + (set! (-> arg0 hvdf-off y) (- f26-0 sv-16)) + ) + ) + (set! (-> arg0 hvdf-off z) f22-0) + (set! (-> arg0 hvdf-off w) f28-0) + (set! (-> arg0 guard x) (/ (-> arg0 x-clip) (-> arg0 x-pix))) + (set! (-> arg0 guard y) (/ (-> arg0 y-clip) (-> arg0 y-pix))) + (set! (-> arg0 guard z) 1.0) + (set! (-> arg0 guard w) 1.0) + (set! (-> arg0 isometric trans z) (- 16777215.0 f22-0)) + ) + (set! (-> arg0 isometric trans w) f30-0) + (let ((f1-28 (-> arg0 perspective data 0)) + (f2-19 (-> arg0 perspective data 5)) + (f0-48 (* -1.9996 (-> arg0 perspective data 0))) + ) + (let ((v1-39 (-> arg0 sprite-2d))) + (set! (-> v1-39 data 0) f0-48) + (set! (-> v1-39 data 1) 0.0) + (set! (-> v1-39 data 2) 0.0) + (set! (-> v1-39 data 3) 0.0) + ) + (let ((v1-40 (&-> arg0 sprite-2d data 4))) + (set! (-> v1-40 0) 0.0) + (set! (-> v1-40 1) (- (* (/ f2-19 f1-28) f0-48))) + (set! (-> v1-40 2) 0.0) + (set! (-> v1-40 3) 0.0) + ) + (let ((v1-41 (&-> arg0 sprite-2d data 8))) + (set! (-> v1-41 0) 0.0) + (set! (-> v1-41 1) 0.0) + (set! (-> v1-41 2) (- f0-48)) + (set! (-> v1-41 3) 0.0) + ) + (set-vector! (-> arg0 sprite-2d trans) 0.0 0.0 (* 500000000.0 f0-48) (* 60.0 f0-48 (-> arg0 pfog0))) + ) + (set! (-> arg0 sprite-2d-hvdf quad) (-> arg0 hvdf-off quad)) + (set! (-> arg0 sprite-2d-hvdf x) 2048.0) + (set! (-> arg0 sprite-2d-hvdf y) 2048.0) + (set! (-> arg0 sprite-2d-hvdf z) (-> arg0 hvdf-off z)) + (set! (-> arg0 pfog0) f30-0) + (set! (-> arg0 pfog1) f28-0) + ) + ) + ) + 0 + (make-u128 0 (shl #x301ec000 32)) + (make-u128 0 (shl #x303ec000 32)) + (let ((v1-54 (-> arg0 pfog0))) + (let ((a0-42 (-> arg0 vis-gifs))) + (set! (-> a0-42 0 fog0) (the-as uint v1-54)) + (set! (-> a0-42 0 strip) (the-as uint #x301e4000)) + (set! (-> a0-42 0 regs) (the-as uint 1042)) + (set! (-> a0-42 0 fan) (the-as uint #x301ec000)) + ) + (let ((a0-43 (&-> arg0 gifgr))) + (s.w! a0-43 v1-54) + (let ((a1-9 (make-u128 0 (shl #x20164000 32)))) + (s.w! (+ a0-43 4) a1-9) + ) + (let ((a1-10 65)) + (s.w! (+ a0-43 8) a1-10) + ) + (let ((a1-11 #x301ec000)) + (s.w! (+ a0-43 12) a1-11) + ) + ) + (let ((a0-44 (-> arg0 vis-gifs))) + (set! (-> a0-44 0 fog0) (the-as uint v1-54)) + (set! (-> a0-44 0 strip) (the-as uint #x303e4000)) + (set! (-> a0-44 0 regs) (the-as uint 1042)) + (set! (-> a0-44 0 fan) (the-as uint #x303ec000)) + ) + (let ((a0-45 (-> arg0 vis-gifs))) + (set! (-> a0-45 0 fog0) (the-as uint v1-54)) + (set! (-> a0-45 0 strip) (the-as uint #x303e4000)) + (set! (-> a0-45 0 regs) (the-as uint 1042)) + (set! (-> a0-45 0 fan) (the-as uint #x303ec000)) + ) + ) + (if (nonzero? sprite-distorter-generate-tables) + (sprite-distorter-generate-tables) + ) + arg0 + ) + +;; definition for method 0 of type math-camera +(defmethod new math-camera ((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 d) 1024.0) + (set! (-> gp-0 f) 40960000.0) + (set! (-> gp-0 fov) 11650.845) + (set! (-> gp-0 x-pix) 256.0) + (set! (-> gp-0 x-clip) 1024.0) + (set! (-> gp-0 y-pix) 112.0) + (set! (-> gp-0 y-clip) 448.0) + (set! (-> gp-0 fog-start) 40960.0) + (set! (-> gp-0 fog-end) 819200.0) + (set! (-> gp-0 fog-max) 255.0) + (set! (-> gp-0 fog-min) 150.0) + (matrix-identity! (-> gp-0 inv-camera-rot)) + (matrix-identity! (-> gp-0 camera-rot)) + (vector-reset! (-> gp-0 trans)) + (quaternion-identity! (-> gp-0 quat-other)) + (set-vector! (-> gp-0 trans-other) 0.0 0.0 0.0 1.0) + (matrix-identity! (-> gp-0 inv-camera-rot-other)) + (matrix-identity! (-> gp-0 camera-rot-other)) + (matrix-identity! (-> gp-0 camera-temp-other)) + (set! (-> gp-0 isometric data 0) 1.0) + (set! (-> gp-0 isometric data 5) 0.5) + (set! (-> gp-0 isometric data 10) -1.0) + (set! (-> gp-0 reset) 1) + (set! (-> gp-0 smooth-step) 0.0) + (set! (-> gp-0 smooth-t) 0.0) + (update-math-camera gp-0 'ntsc 'aspect4x3 (-> gp-0 fov)) + ) + ) + +;; definition for symbol *math-camera*, type math-camera +(define *math-camera* (new 'global 'math-camera)) + +;; definition for function math-cam-start-smoothing +(defun math-cam-start-smoothing ((arg0 float) (arg1 float)) + (set! (-> *math-camera* smooth-step) (/ 1.0 arg0)) + (set! (-> *math-camera* smooth-t) arg1) + (matrix->quaternion (-> *math-camera* inv-camera-rot-smooth-from) (-> *math-camera* inv-camera-rot-smooth)) + ) + +;; definition for function move-target-from-pad +;; INFO: Used lq/sq +(defun move-target-from-pad ((arg0 transform) (arg1 int)) + (let ((s4-0 (new-stack-vector0))) + (set! (-> s4-0 x) (cond + ((cpad-hold? arg1 circle) + -80.0 + ) + ((cpad-hold? arg1 square) + 80.0 + ) + (else + 0.0 + ) + ) + ) + (set! (-> s4-0 y) 0.0) + (set! (-> s4-0 z) (cond + ((cpad-hold? arg1 down) + -80.0 + ) + ((cpad-hold? arg1 up) + 80.0 + ) + (else + 0.0 + ) + ) + ) + (set! (-> s4-0 w) 1.0) + (let ((a0-5 (new-stack-vector0)) + (s3-0 (new-stack-matrix0)) + ) + (vector-negate! a0-5 (-> arg0 rot)) + (matrix-rotate-zyx! s3-0 (-> arg0 rot)) + (vector-matrix*! s4-0 s4-0 s3-0) + ) + (vector+! (-> arg0 trans) (-> arg0 trans) s4-0) + ) + (set! (-> arg0 trans w) 1.0) + (if (cpad-hold? arg1 r1) + (set! (-> arg0 trans y) (+ 80.0 (-> arg0 trans y))) + ) + (if (cpad-hold? arg1 r2) + (set! (-> arg0 trans y) (+ -80.0 (-> arg0 trans y))) + ) + (if (cpad-hold? arg1 x) + (set! (-> arg0 rot x) (+ 546.13336 (-> arg0 rot x))) + ) + (if (cpad-hold? arg1 triangle) + (set! (-> arg0 rot x) (+ -546.13336 (-> arg0 rot x))) + ) + (if (cpad-hold? arg1 left) + (set! (-> arg0 rot y) (+ 546.13336 (-> arg0 rot y))) + ) + (if (cpad-hold? arg1 right) + (set! (-> arg0 rot y) (+ -546.13336 (-> arg0 rot y))) + ) + arg0 + ) + +;; definition for function transform-point-vector! +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] +;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] +(defun transform-point-vector! ((arg0 vector) (arg1 vector)) + (local-vars (v1-2 int)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + 0 + (let ((v1-1 *math-camera*)) + (.lvf vf24 (&-> v1-1 camera-temp vector 0 quad)) + (.lvf vf25 (&-> v1-1 camera-temp vector 1 quad)) + (.lvf vf26 (&-> v1-1 camera-temp vector 2 quad)) + (.lvf vf27 (&-> v1-1 camera-temp trans quad)) + (.lvf vf29 (&-> v1-1 hmge-scale quad)) + (.lvf vf30 (&-> v1-1 hvdf-off quad)) + ) + (.lvf vf28 (&-> arg1 quad)) + (.mul.x.vf acc vf24 vf28) + (.add.mul.y.vf acc vf25 vf28 acc) + (.add.mul.z.vf acc vf26 vf28 acc) + (.add.mul.w.vf vf28 vf27 vf0 acc) + (.add.w.vf vf23 vf0 vf0) + (.mul.vf vf31 vf28 vf29) + (TODO.VCLIP vf31 vf31) + (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) + (.wait.vf) + (.cfc2.i v1-2 Clipping) + (.mul.vf vf28 vf28 Q :mask #b111) + (.mul.vf vf23 vf23 Q) + (.add.vf vf28 vf28 vf30) + (.max.x.vf vf28 vf28 vf0 :mask #b1000) + (.svf (&-> arg0 quad) vf28) + (zero? (logand v1-2 63)) + ) + ) + +;; definition for function transform-point-qword! +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] +;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] +(defun transform-point-qword! ((arg0 vector4w) (arg1 vector)) + (local-vars (v1-2 int)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + 0 + (let ((v1-1 *math-camera*)) + (.lvf vf24 (&-> v1-1 camera-temp vector 0 quad)) + (.lvf vf25 (&-> v1-1 camera-temp vector 1 quad)) + (.lvf vf26 (&-> v1-1 camera-temp vector 2 quad)) + (.lvf vf27 (&-> v1-1 camera-temp trans quad)) + (.lvf vf29 (&-> v1-1 hmge-scale quad)) + (.lvf vf30 (&-> v1-1 hvdf-off quad)) + ) + (.lvf vf28 (&-> arg1 quad)) + (.mul.x.vf acc vf24 vf28) + (.add.mul.y.vf acc vf25 vf28 acc) + (.add.mul.z.vf acc vf26 vf28 acc) + (.add.mul.w.vf vf28 vf27 vf0 acc) + (.add.w.vf vf23 vf0 vf0) + (.mul.vf vf31 vf28 vf29) + (TODO.VCLIP vf31 vf31) + (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) + (.wait.vf) + (.cfc2.i v1-2 Clipping) + (.mul.vf vf28 vf28 Q :mask #b111) + (.mul.vf vf23 vf23 Q) + (.add.vf vf28 vf28 vf30) + (.max.x.vf vf28 vf28 vf0 :mask #b1000) + (vftoi4.xyzw vf28 vf28) + (.svf (&-> arg0 quad) vf28) + (zero? (logand v1-2 63)) + ) + ) + +;; definition for function transform-point-vector-scale! +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VCLIP] +;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v1, Clipping] +(defun transform-point-vector-scale! ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float) (v1-2 int)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf30 :class vf) + (vf31 :class vf) + ) + (init-vf0-vector) + 0 + (let ((v1-1 *math-camera*)) + (.lvf vf24 (&-> v1-1 camera-temp vector 0 quad)) + (.lvf vf25 (&-> v1-1 camera-temp vector 1 quad)) + (.lvf vf26 (&-> v1-1 camera-temp vector 2 quad)) + (.lvf vf27 (&-> v1-1 camera-temp trans quad)) + (.lvf vf29 (&-> v1-1 hmge-scale quad)) + (.lvf vf30 (&-> v1-1 hvdf-off quad)) + ) + (.lvf vf28 (&-> arg1 quad)) + (.mul.x.vf acc vf24 vf28) + (.add.mul.y.vf acc vf25 vf28 acc) + (.add.mul.z.vf acc vf26 vf28 acc) + (.add.mul.w.vf vf28 vf27 vf0 acc) + (.add.w.vf vf23 vf0 vf0) + (.mul.vf vf31 vf28 vf29) + (TODO.VCLIP vf31 vf31) + (.div.vf Q vf0 vf31 :fsf #b11 :ftf #b11) + (.wait.vf) + (.cfc2.i v1-2 Clipping) + (.mul.vf vf28 vf28 Q :mask #b111) + (.mul.vf vf23 vf23 Q) + (.add.vf vf28 vf28 vf30) + (.max.x.vf vf28 vf28 vf0 :mask #b1000) + (.svf (&-> arg0 quad) vf28) + (zero? (logand v1-2 63)) + (.mov v0-0 vf23) + v0-0 + ) + ) + +;; definition for function reverse-transform-point! +;; INFO: Return type mismatch vector vs none. +(defun reverse-transform-point! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector)) + (let* ((v1-1 (-> *math-camera* perspective)) + (s2-0 (-> *math-camera* camera-rot)) + (f30-0 (* (/ (-> v1-1 data 11) (-> v1-1 data 0)) (-> *math-camera* hmge-scale w))) + (f28-0 (* (/ (-> v1-1 data 11) (-> v1-1 data 5)) (-> *math-camera* hmge-scale w))) + (s4-0 (vector-rotate*! (new 'stack-no-clear 'vector) arg2 s2-0)) + (v1-3 (vector-matrix*! (new 'stack-no-clear 'vector) arg1 s2-0)) + (f0-8 (/ (+ (* (-> s4-0 x) (-> v1-3 x)) (* (-> s4-0 y) (-> v1-3 y)) (* (-> s4-0 z) (-> v1-3 z))) + (+ (* (-> s4-0 x) (-> arg3 x) f30-0) (* (-> s4-0 y) (-> arg3 y) f28-0) (-> s4-0 z)) + ) + ) + (f1-16 (* (-> arg3 x) f0-8 f30-0)) + (f2-9 (* (-> arg3 y) f0-8 f28-0)) + (t9-2 vector-matrix*!) + (a0-5 arg0) + (a1-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> a1-3 x) f1-16) + (set! (-> a1-3 y) f2-9) + (set! (-> a1-3 z) f0-8) + (set! (-> a1-3 w) 1.0) + (t9-2 a0-5 a1-3 (-> *math-camera* inv-camera-rot)) + ) + (none) + ) + +;; definition for function init-for-transform +;; INFO: Used lq/sq +;; INFO: Return type mismatch symbol vs none. +(defun init-for-transform ((arg0 matrix)) + (local-vars (v1-14 float)) + (rlet ((vf1 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf2 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + (s4-0 (new 'stack 'vector4s-3)) + (s3-0 (new-stack-vector0)) + ) + (let ((s2-0 (new 'stack 'vector4s-3))) + (matrix*! s5-0 arg0 (-> *math-camera* camera-temp)) + (matrix-3x3-inverse-transpose! gp-0 arg0) + (set-vector! s3-0 0.4 0.4 0.4 1.0) + (let ((v1-4 (-> s4-0 data))) + (set! (-> v1-4 0) 1.0) + (set! (-> v1-4 1) 1.0) + (set! (-> v1-4 2) 1.0) + (set! (-> v1-4 3) 1.0) + ) + (let ((v1-5 (&-> s4-0 data 4))) + (set! (-> v1-5 0) 0.0) + (set! (-> v1-5 1) 0.0) + (set! (-> v1-5 2) 0.0) + (set! (-> v1-5 3) 1.0) + ) + (let ((v1-6 (&-> s4-0 data 8))) + (set! (-> v1-6 0) 0.0) + (set! (-> v1-6 1) 0.0) + (set! (-> v1-6 2) 0.0) + (set! (-> v1-6 3) 1.0) + ) + (let ((v1-7 (-> s2-0 data))) + (set! (-> v1-7 0) 1.0) + (set! (-> v1-7 1) 0.0) + (set! (-> v1-7 2) 0.0) + (set! (-> v1-7 3) 1.0) + ) + (let ((v1-8 (&-> s2-0 data 4))) + (set! (-> v1-8 0) 0.0) + (set! (-> v1-8 1) 1.0) + (set! (-> v1-8 2) 0.0) + (set! (-> v1-8 3) 1.0) + ) + (let ((v1-9 (&-> s2-0 data 8))) + (set! (-> v1-9 0) 0.0) + (set! (-> v1-9 1) 0.0) + (set! (-> v1-9 2) 1.0) + (set! (-> v1-9 3) 1.0) + ) + (.lvf vf7 (&-> *math-camera* hmge-scale quad)) + (.lvf vf8 (&-> *math-camera* hvdf-off quad)) + (.lvf vf9 (&-> *math-camera* giftex)) + (let ((v1-13 255)) + (.mov vf6 v1-13) + ) + (.mov v1-14 vf6) + (.itof.vf vf6 vf6) + (.lvf vf1 (&-> s5-0 vector 0 quad)) + (.lvf vf2 (&-> s5-0 vector 1 quad)) + (.lvf vf3 (&-> s5-0 vector 2 quad)) + (.lvf vf4 (&-> s5-0 trans quad)) + (.lvf vf17 (&-> gp-0 vector 0 quad)) + (.lvf vf18 (&-> gp-0 vector 1 quad)) + (.lvf vf19 (&-> gp-0 vector 2 quad)) + (.lvf vf23 (&-> s2-0 quad 0)) + (.lvf vf24 (&-> s2-0 quad 1)) + (.lvf vf25 (&-> s2-0 quad 2)) + ) + (.lvf vf27 (&-> s4-0 quad 0)) + (.lvf vf28 (&-> s4-0 quad 1)) + (.lvf vf29 (&-> s4-0 quad 2)) + (.lvf vf26 (&-> s3-0 quad)) + ) + (none) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/gfx/merc/generic-merc-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/merc/generic-merc-h_REF.gc new file mode 100644 index 0000000000..01b9b3f9a4 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/merc/generic-merc-h_REF.gc @@ -0,0 +1,311 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type merc-matrix +(deftype merc-matrix (structure) + ((quad uint128 8 :offset-assert 0) + (vector vector 8 :offset 0) + (tag uint64 :offset 0) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type merc-matrix +(defmethod inspect merc-matrix ((obj merc-matrix)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-matrix) + (format #t "~1Tquad[8] @ #x~X~%" (-> obj quad)) + (format #t "~1Tvector[8] @ #x~X~%" (-> obj quad)) + (format #t "~1Ttag: ~D~%" (-> obj tag)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-tag +(deftype generic-merc-tag (dma-packet) + ((next-ptr uint32 :offset 12) + (size uint32 :offset 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type generic-merc-tag +;; INFO: Used lq/sq +(defmethod inspect generic-merc-tag ((obj generic-merc-tag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-tag) + (format #t "~1Tdma: #x~X~%" (-> obj dma)) + (format #t "~1Tvif0: #x~X~%" (-> obj vif0)) + (format #t "~1Tvif1: #x~X~%" (-> obj vif1)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tnext-ptr: ~D~%" (-> obj vif1)) + (format #t "~1Tsize: ~D~%" (-> obj vif0)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-ctrl +(deftype generic-merc-ctrl (structure) + ((tag generic-merc-tag :inline :offset-assert 0) + (lights vu-lights :inline :offset-assert 16) + (header merc-ctrl-header :inline :offset-assert 128) + (effect merc-effect :inline :offset-assert 256) + ) + :method-count-assert 9 + :size-assert #x120 + :flag-assert #x900000120 + ) + +;; definition for method 3 of type generic-merc-ctrl +(defmethod inspect generic-merc-ctrl ((obj generic-merc-ctrl)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-ctrl) + (format #t "~1Ttag: #~%" (-> obj tag)) + (format #t "~1Tlights: #~%" (-> obj lights)) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Teffect: #~%" (-> obj effect)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-ctrl-with-sfx +(deftype generic-merc-ctrl-with-sfx (generic-merc-ctrl) + ((sfx-data uint128 11 :offset-assert 288) + ) + :method-count-assert 9 + :size-assert #x1d0 + :flag-assert #x9000001d0 + ) + +;; definition for method 3 of type generic-merc-ctrl-with-sfx +(defmethod inspect generic-merc-ctrl-with-sfx ((obj generic-merc-ctrl-with-sfx)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-ctrl-with-sfx) + (format #t "~1Ttag: #~%" (-> obj tag)) + (format #t "~1Tlights: #~%" (-> obj lights)) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Teffect: #~%" (-> obj effect)) + (format #t "~1Tsfx-data[11] @ #x~X~%" (-> obj sfx-data)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-input +(deftype generic-merc-input (structure) + ((geo-tag generic-merc-tag :inline :offset-assert 0) + (geo-block uint8 1296 :offset-assert 16) + (byte-header merc-byte-header :inline :offset 16) + (matrix merc-matrix 9 :inline :offset-assert 1312) + (control generic-merc-ctrl-with-sfx :inline :offset-assert 2464) + (end-tag generic-merc-tag :inline :offset-assert 2928) + (shader adgif-shader :inline :offset-assert 2944) + ) + :method-count-assert 9 + :size-assert #xbd0 + :flag-assert #x900000bd0 + ) + +;; definition for method 3 of type generic-merc-input +(defmethod inspect generic-merc-input ((obj generic-merc-input)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-input) + (format #t "~1Tgeo-tag: #~%" (-> obj geo-tag)) + (format #t "~1Tgeo-block[1296] @ #x~X~%" (-> obj geo-block)) + (format #t "~1Tbyte-header: #~%" (-> obj geo-block)) + (format #t "~1Tmatrix[9] @ #x~X~%" (-> obj matrix)) + (format #t "~1Tcontrol: #~%" (-> obj control)) + (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (format #t "~1Tshader: #~%" (-> obj shader)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-output +(deftype generic-merc-output (structure) + ((info gsf-info :inline :offset-assert 0) + (header gsf-header :inline :offset-assert 16) + (index-kick-table uint16 80 :offset-assert 32) + (index-table uint8 160 :offset 32) + (inverse-table uint8 256 :offset-assert 192) + (vertex-table gsf-vertex 72 :inline :offset-assert 448) + ) + :method-count-assert 9 + :size-assert #xac0 + :flag-assert #x900000ac0 + ) + +;; definition for method 3 of type generic-merc-output +(defmethod inspect generic-merc-output ((obj generic-merc-output)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-output) + (format #t "~1Tinfo: #~%" (-> obj info)) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Tindex-kick-table[80] @ #x~X~%" (-> obj index-kick-table)) + (format #t "~1Tindex-table[160] @ #x~X~%" (-> obj index-kick-table)) + (format #t "~1Tinverse-table[256] @ #x~X~%" (-> obj inverse-table)) + (format #t "~1Tvertex-table[72] @ #x~X~%" (-> obj vertex-table)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-dcache +(deftype generic-merc-dcache (structure) + ((output-a generic-merc-output :inline :offset-assert 0) + (output-b generic-merc-output :inline :offset-assert 2752) + (inv-table-1 uint8 544 :offset-assert 5504) + (inv-table-7 uint8 544 :offset-assert 6048) + (inv-safety uint8 16 :offset-assert 6592) + (effect-data uint8 1584 :offset-assert 6608) + ) + :method-count-assert 9 + :size-assert #x2000 + :flag-assert #x900002000 + ) + +;; definition for method 3 of type generic-merc-dcache +(defmethod inspect generic-merc-dcache ((obj generic-merc-dcache)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-dcache) + (format #t "~1Toutput-a: #~%" (-> obj output-a)) + (format #t "~1Toutput-b: #~%" (-> obj output-b)) + (format #t "~1Tinv-table-1[544] @ #x~X~%" (-> obj inv-table-1)) + (format #t "~1Tinv-table-7[544] @ #x~X~%" (-> obj inv-table-7)) + (format #t "~1Tinv-safety[16] @ #x~X~%" (-> obj inv-safety)) + (format #t "~1Teffect-data[1584] @ #x~X~%" (-> obj effect-data)) + (label cfg-4) + obj + ) + +;; definition of type gm-shadow +(deftype gm-shadow (structure) + ((perspective matrix :inline :offset-assert 0) + (isometric matrix :inline :offset-assert 64) + (inv-camera-rot matrix :inline :offset-assert 128) + (envmap-shader adgif-shader :inline :offset-assert 192) + (current-chain uint32 :offset-assert 272) + (next-chain uint32 :offset-assert 276) + (buf-index uint32 :offset-assert 280) + (fragment-count uint32 :offset-assert 284) + (write-limit int32 :offset-assert 288) + (indexed-input-base generic-merc-input :offset-assert 292) + (other-input-base generic-merc-input :offset-assert 296) + (indexed-output-base generic-merc-output :offset-assert 300) + (other-output-base generic-merc-output :offset-assert 304) + (p-input uint32 :offset-assert 308) + (gsf-buf generic-merc-dcache :offset-assert 312) + (p-fheader merc-fp-header :offset-assert 316) + (curr-chain basic :offset-assert 320) + (mercneric-convert basic :offset-assert 324) + (generic-prepare-dma-single basic :offset-assert 328) + (generic-prepare-dma-double basic :offset-assert 332) + (generic-light-proc basic :offset-assert 336) + (generic-envmap-proc basic :offset-assert 340) + (high-speed-reject basic :offset-assert 344) + (dummy-0 uint32 :offset-assert 348) + (hsr-xmult vector :inline :offset-assert 352) + (hsr-ymult vector :inline :offset-assert 368) + (warp-consts vector :inline :offset-assert 384) + ) + :method-count-assert 9 + :size-assert #x190 + :flag-assert #x900000190 + ) + +;; definition for method 3 of type gm-shadow +(defmethod inspect gm-shadow ((obj gm-shadow)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gm-shadow) + (format #t "~1Tperspective: #~%" (-> obj perspective)) + (format #t "~1Tisometric: #~%" (-> obj isometric)) + (format #t "~1Tinv-camera-rot: #~%" (-> obj inv-camera-rot)) + (format #t "~1Tenvmap-shader: #~%" (-> obj envmap-shader)) + (format #t "~1Tcurrent-chain: ~D~%" (-> obj current-chain)) + (format #t "~1Tnext-chain: ~D~%" (-> obj next-chain)) + (format #t "~1Tbuf-index: ~D~%" (-> obj buf-index)) + (format #t "~1Tfragment-count: ~D~%" (-> obj fragment-count)) + (format #t "~1Twrite-limit: ~D~%" (-> obj write-limit)) + (format #t "~1Tindexed-input-base: #~%" (-> obj indexed-input-base)) + (format #t "~1Tother-input-base: #~%" (-> obj other-input-base)) + (format #t "~1Tindexed-output-base: #~%" (-> obj indexed-output-base)) + (format #t "~1Tother-output-base: #~%" (-> obj other-output-base)) + (format #t "~1Tp-input: #x~X~%" (-> obj p-input)) + (format #t "~1Tgsf-buf: #~%" (-> obj gsf-buf)) + (format #t "~1Tp-fheader: #~%" (-> obj p-fheader)) + (format #t "~1Tcurr-chain: ~A~%" (-> obj curr-chain)) + (format #t "~1Tmercneric-convert: ~A~%" (-> obj mercneric-convert)) + (format #t "~1Tgeneric-prepare-dma-single: ~A~%" (-> obj generic-prepare-dma-single)) + (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double)) + (format #t "~1Tgeneric-light-proc: ~A~%" (-> obj generic-light-proc)) + (format #t "~1Tgeneric-envmap-proc: ~A~%" (-> obj generic-envmap-proc)) + (format #t "~1Thigh-speed-reject: ~A~%" (-> obj high-speed-reject)) + (format #t "~1Tdummy-0: ~D~%" (-> obj dummy-0)) + (format #t "~1Thsr-xmult: #~%" (-> obj hsr-xmult)) + (format #t "~1Thsr-ymult: #~%" (-> obj hsr-ymult)) + (format #t "~1Twarp-consts: #~%" (-> obj warp-consts)) + (label cfg-4) + obj + ) + +;; definition of type generic-merc-work +(deftype generic-merc-work (structure) + ((input-a generic-merc-input :inline :offset-assert 0) + (input-b generic-merc-input :inline :offset-assert 3024) + (ctrl generic-merc-ctrl-with-sfx :inline :offset-assert 6048) + (shadow gm-shadow :inline :offset-assert 6512) + (stack uint128 16 :offset-assert 6912) + ) + :method-count-assert 9 + :size-assert #x1c00 + :flag-assert #x900001c00 + ) + +;; definition for method 3 of type generic-merc-work +(defmethod inspect generic-merc-work ((obj generic-merc-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-merc-work) + (format #t "~1Tinput-a: #~%" (-> obj input-a)) + (format #t "~1Tinput-b: #~%" (-> obj input-b)) + (format #t "~1Tctrl: #~%" (-> obj ctrl)) + (format #t "~1Tshadow: #~%" (-> obj shadow)) + (format #t "~1Tstack[16] @ #x~X~%" (-> obj stack)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc new file mode 100644 index 0000000000..96c3747d21 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/merc/merc-h_REF.gc @@ -0,0 +1,902 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ripple-merc-query +(deftype ripple-merc-query (inline-array-class) + ((start-vertex int32 :offset-assert 16) + (vertex-skip int32 :offset-assert 20) + (vertex-count int32 :offset-assert 24) + (current-loc int32 :offset-assert 28) + (data vector :inline :dynamic :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type ripple-merc-query +(defmethod inspect ripple-merc-query ((obj ripple-merc-query)) + (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 "~1Tstart-vertex: ~D~%" (-> obj start-vertex)) + (format #t "~1Tvertex-skip: ~D~%" (-> obj vertex-skip)) + (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) + (format #t "~1Tcurrent-loc: ~D~%" (-> obj current-loc)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> ripple-merc-query heap-base) (the-as uint 16)) + +;; definition of type merc-byte-header +(deftype merc-byte-header (structure) + ((srcdest-off uint8 :offset-assert 0) + (rgba-off uint8 :offset-assert 1) + (lump-off uint8 :offset-assert 2) + (fp-off uint8 :offset-assert 3) + (mat1-cnt uint8 :offset-assert 4) + (mat2-cnt uint8 :offset-assert 5) + (mat3-cnt uint8 :offset-assert 6) + (samecopy-cnt uint8 :offset-assert 7) + (crosscopy-cnt uint8 :offset-assert 8) + (strip-len uint8 :offset-assert 9) + (mm-quadword-fp-off uint8 :offset-assert 10) + (mm-quadword-size uint8 :offset-assert 11) + (perc-off uint8 :offset-assert 12) + (mat-slot uint8 10 :offset-assert 13) + ) + :method-count-assert 9 + :size-assert #x17 + :flag-assert #x900000017 + ) + +;; definition for method 3 of type merc-byte-header +(defmethod inspect merc-byte-header ((obj merc-byte-header)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-byte-header) + (format #t "~1Tsrcdest-off: ~D~%" (-> obj srcdest-off)) + (format #t "~1Trgba-off: ~D~%" (-> obj rgba-off)) + (format #t "~1Tlump-off: ~D~%" (-> obj lump-off)) + (format #t "~1Tfp-off: ~D~%" (-> obj fp-off)) + (format #t "~1Tmat1-cnt: ~D~%" (-> obj mat1-cnt)) + (format #t "~1Tmat2-cnt: ~D~%" (-> obj mat2-cnt)) + (format #t "~1Tmat3-cnt: ~D~%" (-> obj mat3-cnt)) + (format #t "~1Tsamecopy-cnt: ~D~%" (-> obj samecopy-cnt)) + (format #t "~1Tcrosscopy-cnt: ~D~%" (-> obj crosscopy-cnt)) + (format #t "~1Tstrip-len: ~D~%" (-> obj strip-len)) + (format #t "~1Tmm-quadword-fp-off: ~D~%" (-> obj mm-quadword-fp-off)) + (format #t "~1Tmm-quadword-size: ~D~%" (-> obj mm-quadword-size)) + (format #t "~1Tperc-off: ~D~%" (-> obj perc-off)) + (format #t "~1Tmat-slot[10] @ #x~X~%" (-> obj mat-slot)) + (label cfg-4) + obj + ) + +;; definition of type merc-fragment +(deftype merc-fragment (structure) + ((header merc-byte-header :inline :offset-assert 0) + (rest uint8 1 :offset-assert 23) + ) + :method-count-assert 10 + :size-assert #x18 + :flag-assert #xa00000018 + (:methods + (login-adgifs (_type_) none 9) + ) + ) + +;; definition for method 3 of type merc-fragment +(defmethod inspect merc-fragment ((obj merc-fragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-fragment) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Trest[1] @ #x~X~%" (-> obj rest)) + (label cfg-4) + obj + ) + +;; definition of type merc-vtx +(deftype merc-vtx (structure) + ((mat-0 uint8 :offset-assert 0) + (mat-1 uint8 :offset-assert 1) + (nrm-x uint8 :offset-assert 2) + (pos-x uint8 :offset-assert 3) + (dst-0 uint8 :offset-assert 4) + (dst-1 uint8 :offset-assert 5) + (nrm-y uint8 :offset-assert 6) + (pos-y uint8 :offset-assert 7) + (tex-s uint8 :offset-assert 8) + (tex-t uint8 :offset-assert 9) + (nrm-z uint8 :offset-assert 10) + (pos-z uint8 :offset-assert 11) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type merc-vtx +(defmethod inspect merc-vtx ((obj merc-vtx)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-vtx) + (format #t "~1Tmat-0: ~D~%" (-> obj mat-0)) + (format #t "~1Tmat-1: ~D~%" (-> obj mat-1)) + (format #t "~1Tnrm-x: ~D~%" (-> obj nrm-x)) + (format #t "~1Tpos-x: ~D~%" (-> obj pos-x)) + (format #t "~1Tdst-0: ~D~%" (-> obj dst-0)) + (format #t "~1Tdst-1: ~D~%" (-> obj dst-1)) + (format #t "~1Tnrm-y: ~D~%" (-> obj nrm-y)) + (format #t "~1Tpos-y: ~D~%" (-> obj pos-y)) + (format #t "~1Ttex-s: ~D~%" (-> obj tex-s)) + (format #t "~1Ttex-t: ~D~%" (-> obj tex-t)) + (format #t "~1Tnrm-z: ~D~%" (-> obj nrm-z)) + (format #t "~1Tpos-z: ~D~%" (-> obj pos-z)) + (label cfg-4) + obj + ) + +;; definition of type merc-fp-header +(deftype merc-fp-header (structure) + ((x-add float :offset-assert 0) + (y-add float :offset-assert 4) + (z-add float :offset-assert 8) + (shader-cnt uint8 :offset-assert 12) + (kick-info-offset uint8 :offset-assert 13) + (kick-info-step uint8 :offset-assert 14) + (hword-cnt uint8 :offset-assert 15) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type merc-fp-header +(defmethod inspect merc-fp-header ((obj merc-fp-header)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-fp-header) + (format #t "~1Tx-add: ~f~%" (-> obj x-add)) + (format #t "~1Ty-add: ~f~%" (-> obj y-add)) + (format #t "~1Tz-add: ~f~%" (-> obj z-add)) + (format #t "~1Tshader-cnt: ~D~%" (-> obj shader-cnt)) + (format #t "~1Tkick-info-offset: ~D~%" (-> obj kick-info-offset)) + (format #t "~1Tkick-info-step: ~D~%" (-> obj kick-info-step)) + (format #t "~1Thword-cnt: ~D~%" (-> obj hword-cnt)) + (label cfg-4) + obj + ) + +;; definition for function merc-fragment-fp-data +;; INFO: Return type mismatch int vs merc-fp-header. +(defun merc-fragment-fp-data ((arg0 merc-fragment)) + (the-as merc-fp-header (+ (the-as uint arg0) (* (-> arg0 header mm-quadword-fp-off) 16))) + ) + +;; definition of type merc-mat-dest +(deftype merc-mat-dest (structure) + ((matrix-number uint8 :offset-assert 0) + (matrix-dest uint8 :offset-assert 1) + ) + :pack-me + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition for method 3 of type merc-mat-dest +(defmethod inspect merc-mat-dest ((obj merc-mat-dest)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-mat-dest) + (format #t "~1Tmatrix-number: ~D~%" (-> obj matrix-number)) + (format #t "~1Tmatrix-dest: ~D~%" (-> obj matrix-dest)) + (label cfg-4) + obj + ) + +;; definition of type merc-fragment-control +(deftype merc-fragment-control (structure) + ((unsigned-four-count uint8 :offset-assert 0) + (lump-four-count uint8 :offset-assert 1) + (fp-qwc uint8 :offset-assert 2) + (mat-xfer-count uint8 :offset-assert 3) + (mat-dest-data merc-mat-dest :inline :dynamic :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type merc-fragment-control +(defmethod inspect merc-fragment-control ((obj merc-fragment-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-fragment-control) + (format #t "~1Tunsigned-four-count: ~D~%" (-> obj unsigned-four-count)) + (format #t "~1Tlump-four-count: ~D~%" (-> obj lump-four-count)) + (format #t "~1Tfp-qwc: ~D~%" (-> obj fp-qwc)) + (format #t "~1Tmat-xfer-count: ~D~%" (-> obj mat-xfer-count)) + (format #t "~1Tmat-dest-data[0] @ #x~X~%" (-> obj mat-dest-data)) + (label cfg-4) + obj + ) + +;; definition of type merc-blend-data +(deftype merc-blend-data (structure) + ((int8-data int8 :dynamic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x0 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type merc-blend-data +(defmethod inspect merc-blend-data ((obj merc-blend-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-blend-data) + (format #t "~1Tint8-data[0] @ #x~X~%" (-> obj int8-data)) + (label cfg-4) + obj + ) + +;; definition of type merc-blend-ctrl +(deftype merc-blend-ctrl (structure) + ((blend-vtx-count uint8 :offset-assert 0) + (nonzero-index-count uint8 :offset-assert 1) + (bt-index uint8 :dynamic :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition for method 3 of type merc-blend-ctrl +(defmethod inspect merc-blend-ctrl ((obj merc-blend-ctrl)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-blend-ctrl) + (format #t "~1Tblend-vtx-count: ~D~%" (-> obj blend-vtx-count)) + (format #t "~1Tnonzero-index-count: ~D~%" (-> obj nonzero-index-count)) + (format #t "~1Tbt-index[0] @ #x~X~%" (-> obj bt-index)) + (label cfg-4) + obj + ) + +;; definition of type mei-envmap-tint +(deftype mei-envmap-tint (structure) + ((fade0 float :offset-assert 0) + (fade1 float :offset-assert 4) + (tint uint32 :offset-assert 8) + (dummy int32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type mei-envmap-tint +(defmethod inspect mei-envmap-tint ((obj mei-envmap-tint)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mei-envmap-tint) + (format #t "~1Tfade0: ~f~%" (-> obj fade0)) + (format #t "~1Tfade1: ~f~%" (-> obj fade1)) + (format #t "~1Ttint: ~D~%" (-> obj tint)) + (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type mei-texture-scroll +(deftype mei-texture-scroll (structure) + ((max-dist float :offset-assert 0) + (st-int-scale uint8 :offset-assert 4) + (time-factor uint8 :offset-assert 5) + (scroll-dir uint8 :offset-assert 6) + (cached-time uint8 :offset-assert 7) + (time-delta uint8 :offset-assert 8) + (dummy uint8 7 :offset-assert 9) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type mei-texture-scroll +(defmethod inspect mei-texture-scroll ((obj mei-texture-scroll)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mei-texture-scroll) + (format #t "~1Tmax-dist: ~f~%" (-> obj max-dist)) + (format #t "~1Tst-int-scale: ~D~%" (-> obj st-int-scale)) + (format #t "~1Ttime-factor: ~D~%" (-> obj time-factor)) + (format #t "~1Tscroll-dir: ~D~%" (-> obj scroll-dir)) + (format #t "~1Tcached-time: ~D~%" (-> obj cached-time)) + (format #t "~1Ttime-delta: ~D~%" (-> obj time-delta)) + (format #t "~1Tdummy[7] @ #x~X~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type mei-ripple +(deftype mei-ripple (structure) + ((x-base float :offset-assert 0) + (z-base float :offset-assert 4) + (grid-size float :offset-assert 8) + (angle float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type mei-ripple +(defmethod inspect mei-ripple ((obj mei-ripple)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mei-ripple) + (format #t "~1Tx-base: ~f~%" (-> obj x-base)) + (format #t "~1Tz-base: ~f~%" (-> obj z-base)) + (format #t "~1Tgrid-size: ~f~%" (-> obj grid-size)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (label cfg-4) + obj + ) + +;; definition of type merc-extra-info +(deftype merc-extra-info (structure) + ((envmap-tint-offset uint8 :offset-assert 0) + (shader-offset uint8 :offset-assert 1) + (texture-scroll-offset uint8 :offset-assert 2) + (ripple-offset uint8 :offset-assert 3) + (dummy uint8 12 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type merc-extra-info +(defmethod inspect merc-extra-info ((obj merc-extra-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-extra-info) + (format #t "~1Tenvmap-tint-offset: ~D~%" (-> obj envmap-tint-offset)) + (format #t "~1Tshader-offset: ~D~%" (-> obj shader-offset)) + (format #t "~1Ttexture-scroll-offset: ~D~%" (-> obj texture-scroll-offset)) + (format #t "~1Tripple-offset: ~D~%" (-> obj ripple-offset)) + (format #t "~1Tdummy[12] @ #x~X~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type merc-effect +(deftype merc-effect (structure) + ((frag-geo merc-fragment :offset-assert 0) + (frag-ctrl merc-fragment-control :offset-assert 4) + (blend-data merc-blend-data :offset-assert 8) + (blend-ctrl merc-blend-ctrl :offset-assert 12) + (merc-effect-version uint8 :offset-assert 16) + (effect-bits uint8 :offset-assert 17) + (frag-count uint16 :offset-assert 18) + (blend-frag-count uint16 :offset-assert 20) + (tri-count uint16 :offset-assert 22) + (dvert-count uint16 :offset-assert 24) + (texture-index uint8 :offset-assert 26) + (effect-usage uint8 :offset-assert 27) + (extra-info merc-extra-info :offset-assert 28) + ) + :method-count-assert 10 + :size-assert #x20 + :flag-assert #xa00000020 + (:methods + (login-adgifs (_type_) none 9) + ) + ) + +;; definition for method 3 of type merc-effect +(defmethod inspect merc-effect ((obj merc-effect)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-effect) + (format #t "~1Tfrag-geo: #~%" (-> obj frag-geo)) + (format #t "~1Tfrag-ctrl: #~%" (-> obj frag-ctrl)) + (format #t "~1Tblend-data: #~%" (-> obj blend-data)) + (format #t "~1Tblend-ctrl: #~%" (-> obj blend-ctrl)) + (format #t "~1Tmerc-effect-version: ~D~%" (-> obj merc-effect-version)) + (format #t "~1Teffect-bits: ~D~%" (-> obj effect-bits)) + (format #t "~1Tfrag-count: ~D~%" (-> obj frag-count)) + (format #t "~1Tblend-frag-count: ~D~%" (-> obj blend-frag-count)) + (format #t "~1Ttri-count: ~D~%" (-> obj tri-count)) + (format #t "~1Tdvert-count: ~D~%" (-> obj dvert-count)) + (format #t "~1Ttexture-index: ~D~%" (-> obj texture-index)) + (format #t "~1Teffect-usage: ~D~%" (-> obj effect-usage)) + (format #t "~1Textra-info: #~%" (-> obj extra-info)) + (label cfg-4) + obj + ) + +;; definition of type merc-eye-ctrl +(deftype merc-eye-ctrl (structure) + ((eye-slot int8 :offset-assert 0) + (shader-offset int8 :offset-assert 1) + (shader-count int8 :offset-assert 2) + (shader adgif-shader 6 :inline :offset-assert 16) + (left-iris-shader adgif-shader :inline :offset 16) + (left-pupil-shader adgif-shader :inline :offset 96) + (left-lid-shader adgif-shader :inline :offset 176) + (right-iris-shader adgif-shader :inline :offset 256) + (right-pupil-shader adgif-shader :inline :offset 336) + (right-lid-shader adgif-shader :inline :offset 416) + ) + :method-count-assert 9 + :size-assert #x1f0 + :flag-assert #x9000001f0 + ) + +;; definition for method 3 of type merc-eye-ctrl +(defmethod inspect merc-eye-ctrl ((obj merc-eye-ctrl)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-eye-ctrl) + (format #t "~1Teye-slot: ~D~%" (-> obj eye-slot)) + (format #t "~1Tshader-offset: ~D~%" (-> obj shader-offset)) + (format #t "~1Tshader-count: ~D~%" (-> obj shader-count)) + (format #t "~1Tshader[6] @ #x~X~%" (-> obj left-iris-shader)) + (format #t "~1Tleft-iris-shader: #~%" (-> obj left-iris-shader)) + (format #t "~1Tleft-pupil-shader: #~%" (-> obj left-pupil-shader)) + (format #t "~1Tleft-lid-shader: #~%" (-> obj left-lid-shader)) + (format #t "~1Tright-iris-shader: #~%" (-> obj right-iris-shader)) + (format #t "~1Tright-pupil-shader: #~%" (-> obj right-pupil-shader)) + (format #t "~1Tright-lid-shader: #~%" (-> obj right-lid-shader)) + (label cfg-4) + obj + ) + +;; definition of type merc-eye-anim-frame +(deftype merc-eye-anim-frame (structure) + ((pupil-trans-x int8 :offset-assert 0) + (pupil-trans-y int8 :offset-assert 1) + (blink int8 :offset-assert 2) + (iris-scale int8 :offset 4) + (pupil-scale int8 :offset 5) + (lid-scale int8 :offset 6) + (dword uint64 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type merc-eye-anim-frame +(defmethod inspect merc-eye-anim-frame ((obj merc-eye-anim-frame)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-eye-anim-frame) + (format #t "~1Tpupil-trans-x: ~D~%" (-> obj pupil-trans-x)) + (format #t "~1Tpupil-trans-y: ~D~%" (-> obj pupil-trans-y)) + (format #t "~1Tblink: ~D~%" (-> obj blink)) + (format #t "~1Tiris-scale: ~D~%" (-> obj iris-scale)) + (format #t "~1Tpupil-scale: ~D~%" (-> obj pupil-scale)) + (format #t "~1Tlid-scale: ~D~%" (-> obj lid-scale)) + (format #t "~1Tdword: ~D~%" (-> obj dword)) + (label cfg-4) + obj + ) + +;; definition of type merc-eye-anim-block +(deftype merc-eye-anim-block (structure) + ((max-frame int16 :offset-assert 0) + (data merc-eye-anim-frame :inline :dynamic :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type merc-eye-anim-block +(defmethod inspect merc-eye-anim-block ((obj merc-eye-anim-block)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-eye-anim-block) + (format #t "~1Tmax-frame: ~D~%" (-> obj max-frame)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type texture-usage-group +(deftype texture-usage-group (structure) + ((data texture-masks 7 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x150 + :flag-assert #x900000150 + ) + +;; definition for method 3 of type texture-usage-group +(defmethod inspect texture-usage-group ((obj texture-usage-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-usage-group) + (format #t "~1Tdata[7] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type merc-ctrl-header +(deftype merc-ctrl-header (structure) + ((xyz-scale float :offset-assert 0) + (st-magic uint32 :offset-assert 4) + (st-out-a uint32 :offset-assert 8) + (st-out-b uint32 :offset-assert 12) + (st-vif-add uint32 :offset-assert 16) + (st-int-off uint16 :offset-assert 20) + (st-int-scale uint16 :offset-assert 22) + (effect-count uint32 :offset-assert 24) + (blend-target-count uint32 :offset-assert 28) + (fragment-count uint16 :offset-assert 32) + (tri-count uint16 :offset-assert 34) + (matrix-count uint8 :offset-assert 36) + (shader-count uint8 :offset-assert 37) + (transform-vertex-count uint16 :offset-assert 38) + (dvert-count uint16 :offset-assert 40) + (one-mat-count uint16 :offset-assert 42) + (two-mat-count uint16 :offset-assert 44) + (two-mat-reuse-count uint16 :offset-assert 46) + (three-mat-count uint16 :offset-assert 48) + (three-mat-reuse-count uint16 :offset-assert 50) + (shader-upload-count uint8 :offset-assert 52) + (matrix-upload-count uint8 :offset-assert 53) + (same-copy-count uint16 :offset-assert 54) + (cross-copy-count uint16 :offset-assert 56) + (num-verts uint16 :offset-assert 58) + (longest-edge float :offset-assert 60) + (eye-ctrl merc-eye-ctrl :offset-assert 64) + (pad uint32 3 :offset-assert 68) + (masks-padding texture-masks :inline :offset-assert 80) + (texture-usage-group texture-usage-group :offset 80) + (dummy-bytes uint8 :dynamic :offset 32) + (envmap-tint uint32 :offset 32) + (query basic :offset 36) + (needs-clip uint8 :offset 40) + (use-isometric uint8 :offset 41) + (use-attached-shader uint8 :offset 42) + (display-triangles uint8 :offset 43) + (death-vertex-skip uint16 :offset 44) + (death-start-vertex uint16 :offset 46) + (death-effect uint32 :offset 48) + (use-translucent uint8 :offset 52) + (display-this-fragment uint8 :offset 53) + (use-warp uint8 :offset 54) + (ignore-alpha uint8 :offset 55) + (force-fade uint8 :offset 56) + (disable-fog uint8 :offset 57) + (disable-envmap uint8 :offset 58) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type merc-ctrl-header +(defmethod inspect merc-ctrl-header ((obj merc-ctrl-header)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-ctrl-header) + (format #t "~1Txyz-scale: #x~X~%" (-> obj xyz-scale)) + (format #t "~1Tst-magic: #x~X~%" (-> obj st-magic)) + (format #t "~1Tst-out-a: #x~X~%" (-> obj st-out-a)) + (format #t "~1Tst-out-b: #x~X~%" (-> obj st-out-b)) + (format #t "~1Tst-vif-add: #x~X~%" (-> obj st-vif-add)) + (format #t "~1Tst-int-off: ~D~%" (-> obj st-int-off)) + (format #t "~1Tst-int-scale: ~D~%" (-> obj st-int-scale)) + (format #t "~1Teffect-count: ~D~%" (-> obj effect-count)) + (format #t "~1Tblend-target-count: ~D~%" (-> obj blend-target-count)) + (format #t "~1Tfragment-count: ~D~%" (-> obj fragment-count)) + (format #t "~1Ttri-count: ~D~%" (-> obj tri-count)) + (format #t "~1Tmatrix-count: ~D~%" (-> obj matrix-count)) + (format #t "~1Tshader-count: ~D~%" (-> obj shader-count)) + (format #t "~1Ttransform-vertex-count: ~D~%" (-> obj transform-vertex-count)) + (format #t "~1Tdvert-count: ~D~%" (-> obj dvert-count)) + (format #t "~1Tone-mat-count: ~D~%" (-> obj one-mat-count)) + (format #t "~1Ttwo-mat-count: ~D~%" (-> obj two-mat-count)) + (format #t "~1Ttwo-mat-reuse-count: ~D~%" (-> obj two-mat-reuse-count)) + (format #t "~1Tthree-mat-count: ~D~%" (-> obj three-mat-count)) + (format #t "~1Tthree-mat-reuse-count: ~D~%" (-> obj three-mat-reuse-count)) + (format #t "~1Tshader-upload-count: ~D~%" (-> obj shader-upload-count)) + (format #t "~1Tmatrix-upload-count: ~D~%" (-> obj matrix-upload-count)) + (format #t "~1Tsame-copy-count: ~D~%" (-> obj same-copy-count)) + (format #t "~1Tcross-copy-count: ~D~%" (-> obj cross-copy-count)) + (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) + (format #t "~1Tlongest-edge: ~f~%" (-> obj longest-edge)) + (format #t "~1Teye-ctrl: #~%" (-> obj eye-ctrl)) + (format #t "~1Tpad[3] @ #x~X~%" (-> obj pad)) + (format #t "~1Tmasks-padding: #~%" (-> obj masks-padding)) + (format #t "~1Ttexture-usage-group: #~%" (-> obj texture-usage-group)) + (format #t "~1Tdummy-bytes[0] @ #x~X~%" (&-> obj fragment-count)) + (format #t "~1Tenvmap-tint: ~D~%" (-> obj envmap-tint)) + (format #t "~1Tquery: ~A~%" (-> obj query)) + (format #t "~1Tneeds-clip: ~D~%" (-> obj needs-clip)) + (format #t "~1Tuse-isometric: ~D~%" (-> obj use-isometric)) + (format #t "~1Tuse-attached-shader: ~D~%" (-> obj use-attached-shader)) + (format #t "~1Tdisplay-triangles: ~D~%" (-> obj display-triangles)) + (format #t "~1Tdeath-vertex-skip: ~D~%" (-> obj two-mat-count)) + (format #t "~1Tdeath-start-vertex: ~D~%" (-> obj two-mat-reuse-count)) + (format #t "~1Tdeath-effect: ~D~%" (-> obj death-effect)) + (format #t "~1Tuse-translucent: ~D~%" (-> obj shader-upload-count)) + (format #t "~1Tdisplay-this-fragment: ~D~%" (-> obj matrix-upload-count)) + (format #t "~1Tuse-warp: ~D~%" (-> obj use-warp)) + (format #t "~1Tignore-alpha: ~D~%" (-> obj ignore-alpha)) + (format #t "~1Tforce-fade: ~D~%" (-> obj force-fade)) + (format #t "~1Tdisable-fog: ~D~%" (-> obj disable-fog)) + (format #t "~1Tdisable-envmap: ~D~%" (-> obj disable-envmap)) + (label cfg-4) + obj + ) + +;; definition of type merc-ctrl +(deftype merc-ctrl (art-element) + ((num-joints int32 :offset 20) + (seg-table basic :offset 24) + (header merc-ctrl-header :inline :offset-assert 32) + (effect merc-effect :inline :dynamic :offset-assert 160) + ) + :method-count-assert 13 + :size-assert #xa0 + :flag-assert #xd000000a0 + ) + +;; definition for method 3 of type merc-ctrl +(defmethod inspect merc-ctrl ((obj merc-ctrl)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) + (format #t "~1Tseg-table: ~A~%" (-> obj seg-table)) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Teffect[0] @ #x~X~%" (-> obj effect)) + (label cfg-4) + obj + ) + +;; definition of type merc-vu1-low-mem +(deftype merc-vu1-low-mem (structure) + ((tri-strip-gif gs-gif-tag :inline :offset-assert 0) + (ad-gif gs-gif-tag :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (perspective uint128 4 :offset-assert 48) + (fog vector :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type merc-vu1-low-mem +(defmethod inspect merc-vu1-low-mem ((obj merc-vu1-low-mem)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'merc-vu1-low-mem) + (format #t "~1Ttri-strip-gif: #~%" (-> obj tri-strip-gif)) + (format #t "~1Tad-gif: #~%" (-> obj ad-gif)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Tperspective[4] @ #x~X~%" (-> obj perspective)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (label cfg-4) + obj + ) + +;; definition of type emerc-vu1-low-mem +(deftype emerc-vu1-low-mem (structure) + ((tri-strip-gif qword :inline :offset-assert 0) + (ad-gif qword :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (perspective vector 4 :inline :offset-assert 48) + (fog vector :inline :offset-assert 112) + (unperspect vector :inline :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) + +;; definition for method 3 of type emerc-vu1-low-mem +(defmethod inspect emerc-vu1-low-mem ((obj emerc-vu1-low-mem)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'emerc-vu1-low-mem) + (format #t "~1Ttri-strip-gif: #~%" (-> obj tri-strip-gif)) + (format #t "~1Tad-gif: #~%" (-> obj ad-gif)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Tperspective[4] @ #x~X~%" (-> obj perspective)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tunperspect: #~%" (-> obj unperspect)) + (label cfg-4) + obj + ) + +;; definition of type ripple-wave +(deftype ripple-wave (structure) + ((scale float :offset-assert 0) + (offs float :offset-assert 4) + (xdiv int16 :offset-assert 8) + (zdiv int16 :offset-assert 10) + (speed float :offset-assert 12) + (xmul float :offset-assert 16) + (zmul float :offset-assert 20) + (delta float :offset-assert 24) + ) + :pack-me + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type ripple-wave +(defmethod inspect ripple-wave ((obj ripple-wave)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ripple-wave) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "~1Toffs: ~f~%" (-> obj offs)) + (format #t "~1Txdiv: ~D~%" (-> obj xdiv)) + (format #t "~1Tzdiv: ~D~%" (-> obj zdiv)) + (format #t "~1Tspeed: ~f~%" (-> obj speed)) + (format #t "~1Txmul: ~f~%" (-> obj xmul)) + (format #t "~1Tzmul: ~f~%" (-> obj zmul)) + (format #t "~1Tdelta: ~f~%" (-> obj delta)) + (label cfg-4) + obj + ) + +;; definition of type ripple-wave-set +(deftype ripple-wave-set (basic) + ((count int32 :offset-assert 4) + (converted basic :offset-assert 8) + (normal-scale float :offset-assert 12) + (wave ripple-wave 4 :inline :offset-assert 16) + (frame-save uint64 :offset-assert 128) + ) + :method-count-assert 9 + :size-assert #x88 + :flag-assert #x900000088 + ) + +;; definition for method 3 of type ripple-wave-set +(defmethod inspect ripple-wave-set ((obj ripple-wave-set)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tconverted: ~A~%" (-> obj converted)) + (format #t "~1Tnormal-scale: ~f~%" (-> obj normal-scale)) + (format #t "~1Twave[4] @ #x~X~%" (-> obj wave)) + (format #t "~1Tframe-save: ~D~%" (-> obj frame-save)) + (label cfg-4) + obj + ) + +;; definition of type ripple-control +(deftype ripple-control (basic) + ((global-scale float :offset-assert 4) + (last-frame-scale float :offset-assert 8) + (close-fade-dist float :offset-assert 12) + (far-fade-dist float :offset-assert 16) + (faded-scale float :offset-assert 20) + (individual-normal-scale float :offset-assert 24) + (waveform ripple-wave-set :offset-assert 28) + (send-query symbol :offset-assert 32) + (query ripple-merc-query :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type ripple-control +(defmethod inspect ripple-control ((obj ripple-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tglobal-scale: ~f~%" (-> obj global-scale)) + (format #t "~1Tlast-frame-scale: ~f~%" (-> obj last-frame-scale)) + (format #t "~1Tclose-fade-dist: ~f~%" (-> obj close-fade-dist)) + (format #t "~1Tfar-fade-dist: ~f~%" (-> obj far-fade-dist)) + (format #t "~1Tfaded-scale: ~f~%" (-> obj faded-scale)) + (format #t "~1Tindividual-normal-scale: ~f~%" (-> obj individual-normal-scale)) + (format #t "~1Twaveform: ~A~%" (-> obj waveform)) + (format #t "~1Tsend-query: ~A~%" (-> obj send-query)) + (format #t "~1Tquery: ~A~%" (-> obj query)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type ripple-control +(defmethod new ripple-control ((allocation symbol) (type-to-make type)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 global-scale) 0.0) + (set! (-> v0-0 last-frame-scale) -0.001) + (set! (-> v0-0 close-fade-dist) 4096000000.0) + (set! (-> v0-0 far-fade-dist) 8192000000.0) + (set! (-> v0-0 faded-scale) -0.001) + (set! (-> v0-0 waveform) #f) + (set! (-> v0-0 individual-normal-scale) 1.0) + (set! (-> v0-0 send-query) #f) + (set! (-> v0-0 query) #f) + v0-0 + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc new file mode 100644 index 0000000000..a31d6d8597 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/mood-h_REF.gc @@ -0,0 +1,593 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mood-channel +(deftype mood-channel (structure) + ((data float 24 :offset-assert 0) + (vecs vector4 6 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type mood-channel +(defmethod inspect mood-channel ((obj mood-channel)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-channel) + (format #t "~1Tdata[24] @ #x~X~%" (-> obj data)) + (format #t "~1Tvecs[6] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-channel-group +(deftype mood-channel-group (structure) + ((data mood-channel 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +;; definition for method 3 of type mood-channel-group +(defmethod inspect mood-channel-group ((obj mood-channel-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-channel-group) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-fog +(deftype mood-fog (structure) + ((fog-color vector :inline :offset-assert 0) + (fog-dists vector :inline :offset-assert 16) + (fog-start meters :offset 16) + (fog-end meters :offset 20) + (fog-max float :offset 24) + (fog-min float :offset 28) + (erase-color vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type mood-fog +(defmethod inspect mood-fog ((obj mood-fog)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-fog) + (format #t "~1Tfog-color: #~%" (-> obj fog-color)) + (format #t "~1Tfog-dists: #~%" (-> obj fog-dists)) + (format #t "~1Tfog-start: (meters ~m)~%" (-> obj fog-dists x)) + (format #t "~1Tfog-end: (meters ~m)~%" (-> obj fog-dists y)) + (format #t "~1Tfog-max: ~f~%" (-> obj fog-dists z)) + (format #t "~1Tfog-min: ~f~%" (-> obj fog-dists w)) + (format #t "~1Terase-color: #~%" (-> obj erase-color)) + (label cfg-4) + obj + ) + +;; definition of type mood-fog-table +(deftype mood-fog-table (structure) + ((data mood-fog 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +;; definition for method 3 of type mood-fog-table +(defmethod inspect mood-fog-table ((obj mood-fog-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-fog-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-color +(deftype mood-color (structure) + ((lgt-color vector :inline :offset-assert 0) + (amb-color vector :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type mood-color +(defmethod inspect mood-color ((obj mood-color)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-color) + (format #t "~1Tlgt-color: #~%" (-> obj lgt-color)) + (format #t "~1Tamb-color: #~%" (-> obj amb-color)) + (label cfg-4) + obj + ) + +;; definition of type mood-direction-table +(deftype mood-direction-table (structure) + ((data vector 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type mood-direction-table +(defmethod inspect mood-direction-table ((obj mood-direction-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-direction-table) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-color-table +(deftype mood-color-table (structure) + ((data mood-color 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +;; definition for method 3 of type mood-color-table +(defmethod inspect mood-color-table ((obj mood-color-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-color-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-sky-table +(deftype mood-sky-table (structure) + ((data vector 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type mood-sky-table +(defmethod inspect mood-sky-table ((obj mood-sky-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-sky-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-clouds +(deftype mood-clouds (structure) + ((cloud-min float :offset-assert 0) + (cloud-max float :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type mood-clouds +(defmethod inspect mood-clouds ((obj mood-clouds)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-clouds) + (format #t "~1Tcloud-min: ~f~%" (-> obj cloud-min)) + (format #t "~1Tcloud-max: ~f~%" (-> obj cloud-max)) + (label cfg-4) + obj + ) + +;; definition of type mood-weather +(deftype mood-weather (structure) + ((data float 2 :offset-assert 0) + (cloud float :offset 0) + (fog float :offset 4) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type mood-weather +(defmethod inspect mood-weather ((obj mood-weather)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-weather) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tcloud: ~f~%" (-> obj cloud)) + (format #t "~1Tfog: ~f~%" (-> obj fog)) + (label cfg-4) + obj + ) + +;; definition of type mood-iweather +(deftype mood-iweather (structure) + ((data int32 2 :offset-assert 0) + (cloud int32 :offset 0) + (fog int32 :offset 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type mood-iweather +(defmethod inspect mood-iweather ((obj mood-iweather)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-iweather) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tcloud: ~D~%" (-> obj cloud)) + (format #t "~1Tfog: ~D~%" (-> obj fog)) + (label cfg-4) + obj + ) + +;; definition of type mood-range +(deftype mood-range (structure) + ((data float 4 :offset-assert 0) + (min-cloud float :offset 0) + (max-cloud float :offset 4) + (min-fog float :offset 8) + (max-fog float :offset 12) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type mood-range +;; INFO: Used lq/sq +(defmethod inspect mood-range ((obj mood-range)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-range) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tmin-cloud: ~f~%" (-> obj min-cloud)) + (format #t "~1Tmax-cloud: ~f~%" (-> obj max-cloud)) + (format #t "~1Tmin-fog: ~f~%" (-> obj min-fog)) + (format #t "~1Tmax-fog: ~f~%" (-> obj max-fog)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type mood-filters-table +(deftype mood-filters-table (structure) + ((data vector 8 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type mood-filters-table +(defmethod inspect mood-filters-table ((obj mood-filters-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-filters-table) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type mood-table +(deftype mood-table (basic) + ((mood-fog-table mood-fog-table :offset-assert 4) + (mood-color-table mood-color-table :offset-assert 8) + (mood-channel-group mood-channel-group :offset-assert 12) + (mood-direction-table mood-direction-table :offset-assert 16) + (mood-sky-table mood-sky-table :offset-assert 20) + (mood-interp-table basic :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type mood-table +(defmethod inspect mood-table ((obj mood-table)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmood-fog-table: #~%" (-> obj mood-fog-table)) + (format #t "~1Tmood-color-table: #~%" (-> obj mood-color-table)) + (format #t "~1Tmood-channel-group: #~%" (-> obj mood-channel-group)) + (format #t "~1Tmood-direction-table: #~%" (-> obj mood-direction-table)) + (format #t "~1Tmood-sky-table: #~%" (-> obj mood-sky-table)) + (format #t "~1Tmood-interp-table: ~A~%" (-> obj mood-interp-table)) + (label cfg-4) + obj + ) + +;; definition of type mood-context-core +(deftype mood-context-core (structure) + ((current-fog mood-fog :inline :offset-assert 0) + (current-sky-color vector :inline :offset-assert 48) + (current-env-color vector :inline :offset-assert 64) + (current-prt-color vector :inline :offset-assert 80) + (current-shadow-color vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type mood-context-core +(defmethod inspect mood-context-core ((obj mood-context-core)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-context-core) + (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) + (label cfg-4) + obj + ) + +;; definition of type mood-context-core2 +(deftype mood-context-core2 (mood-context-core) + ((light-group light-group 8 :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x670 + :flag-assert #x900000670 + ) + +;; definition for method 3 of type mood-context-core2 +(defmethod inspect mood-context-core2 ((obj mood-context-core2)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-context-core2) + (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) + (label cfg-4) + obj + ) + +;; definition of type mood-context-core3 +(deftype mood-context-core3 (mood-context-core2) + ((times vector 8 :inline :offset-assert 1648) + ) + :method-count-assert 9 + :size-assert #x6f0 + :flag-assert #x9000006f0 + ) + +;; definition for method 3 of type mood-context-core3 +(defmethod inspect mood-context-core3 ((obj mood-context-core3)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-context-core3) + (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) + (format #t "~1Ttimes[8] @ #x~X~%" (-> obj times)) + (label cfg-4) + obj + ) + +;; definition of type mood-context +(deftype mood-context (mood-context-core3) + ((itimes vector4w 4 :inline :offset-assert 1776) + (state uint32 32 :offset-assert 1840) + ) + :method-count-assert 9 + :size-assert #x7b0 + :flag-assert #x9000007b0 + ) + +;; definition for method 3 of type mood-context +(defmethod inspect mood-context ((obj mood-context)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-context) + (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) + (format #t "~1Ttimes[8] @ #x~X~%" (-> obj times)) + (format #t "~1Titimes[4] @ #x~X~%" (-> obj itimes)) + (format #t "~1Tstate[32] @ #x~X~%" (-> obj state)) + (label cfg-4) + obj + ) + +;; definition of type mood-control-work +(deftype mood-control-work (structure) + ((weather mood-weather :inline :offset-assert 0) + (iweather mood-iweather :inline :offset-assert 8) + (interp mood-weather :inline :offset-assert 16) + (index int32 4 :offset-assert 24) + (color-interp float :offset-assert 40) + (color-index int32 2 :offset-assert 44) + (channel-interp float :offset-assert 52) + (channel-index int32 2 :offset-assert 56) + (cloud-interp float :offset-assert 64) + (cloud-index int32 2 :offset-assert 68) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +;; definition for method 3 of type mood-control-work +(defmethod inspect mood-control-work ((obj mood-control-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mood-control-work) + (format #t "~1Tweather: #~%" (-> obj weather)) + (format #t "~1Tiweather: #~%" (-> obj iweather)) + (format #t "~1Tinterp: #~%" (-> obj interp)) + (format #t "~1Tindex[4] @ #x~X~%" (-> obj index)) + (format #t "~1Tcolor-interp: ~f~%" (-> obj color-interp)) + (format #t "~1Tcolor-index[2] @ #x~X~%" (-> obj color-index)) + (format #t "~1Tchannel-interp: ~f~%" (-> obj channel-interp)) + (format #t "~1Tchannel-index[2] @ #x~X~%" (-> obj channel-index)) + (format #t "~1Tcloud-interp: ~f~%" (-> obj cloud-interp)) + (format #t "~1Tcloud-index[2] @ #x~X~%" (-> obj cloud-index)) + (label cfg-4) + obj + ) + +;; definition of type mood-control +(deftype mood-control (mood-table) + ((mood-clouds mood-clouds :offset-assert 28) + (current-interp mood-weather :inline :offset-assert 32) + (target-interp mood-weather :inline :offset-assert 40) + (speed-interp mood-weather :inline :offset-assert 48) + (range mood-range :inline :offset-assert 64) + (time-until-random mood-weather :inline :offset-assert 80) + (time-until-random-min mood-weather :inline :offset-assert 88) + (time-until-random-max mood-weather :inline :offset-assert 96) + (display-flag basic :offset-assert 104) + (overide-weather-flag basic :offset-assert 108) + (overide mood-weather :inline :offset-assert 112) + (lightning-index int32 :offset-assert 120) + (lightning-val int32 :offset-assert 124) + (lightning-time int32 :offset-assert 128) + (lightning-time2 float :offset-assert 132) + (lightning-flash float :offset-assert 136) + (lightning-id uint32 :offset-assert 140) + (lightning-count0 uint32 :offset-assert 144) + (lightning-count1 uint32 :offset-assert 148) + (lightning-count2 uint32 :offset-assert 152) + (rain-id uint32 :offset-assert 156) + (sound-pitch float :offset-assert 160) + (fogs mood-fog 9 :offset-assert 164) + (colors mood-color 3 :offset-assert 200) + (channels mood-channel 3 :offset-assert 212) + (clouds mood-clouds 9 :offset-assert 224) + ) + :method-count-assert 19 + :size-assert #x104 + :flag-assert #x1300000104 + (:methods + (mood-control-method-9 () none 9) + (mood-control-method-10 () none 10) + (mood-control-method-11 () none 11) + (mood-control-method-12 () none 12) + (mood-control-method-13 () none 13) + (mood-control-method-14 () none 14) + (mood-control-method-15 () none 15) + (mood-control-method-16 () none 16) + (mood-control-method-17 () none 17) + (mood-control-method-18 () none 18) + ) + ) + +;; definition for method 3 of type mood-control +(defmethod inspect mood-control ((obj mood-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmood-fog-table: #~%" (-> obj mood-fog-table)) + (format #t "~1Tmood-color-table: #~%" (-> obj mood-color-table)) + (format #t "~1Tmood-channel-group: #~%" (-> obj mood-channel-group)) + (format #t "~1Tmood-direction-table: #~%" (-> obj mood-direction-table)) + (format #t "~1Tmood-sky-table: #~%" (-> obj mood-sky-table)) + (format #t "~1Tmood-interp-table: ~A~%" (-> obj mood-interp-table)) + (format #t "~1Tmood-clouds: #~%" (-> obj mood-clouds)) + (format #t "~1Tcurrent-interp: #~%" (-> obj current-interp)) + (format #t "~1Ttarget-interp: #~%" (-> obj target-interp)) + (format #t "~1Tspeed-interp: #~%" (-> obj speed-interp)) + (format #t "~1Trange: #~%" (-> obj range)) + (format #t "~1Ttime-until-random: #~%" (-> obj time-until-random)) + (format #t "~1Ttime-until-random-min: #~%" (-> obj time-until-random-min)) + (format #t "~1Ttime-until-random-max: #~%" (-> obj time-until-random-max)) + (format #t "~1Tdisplay-flag: ~A~%" (-> obj display-flag)) + (format #t "~1Toveride-weather-flag: ~A~%" (-> obj overide-weather-flag)) + (format #t "~1Toveride: #~%" (-> obj overide)) + (format #t "~1Tlightning-index: ~D~%" (-> obj lightning-index)) + (format #t "~1Tlightning-val: ~D~%" (-> obj lightning-val)) + (format #t "~1Tlightning-time: ~D~%" (-> obj lightning-time)) + (format #t "~1Tlightning-time2: ~f~%" (-> obj lightning-time2)) + (format #t "~1Tlightning-flash: ~f~%" (-> obj lightning-flash)) + (format #t "~1Tlightning-id: ~D~%" (-> obj lightning-id)) + (format #t "~1Tlightning-count0: ~D~%" (-> obj lightning-count0)) + (format #t "~1Tlightning-count1: ~D~%" (-> obj lightning-count1)) + (format #t "~1Tlightning-count2: ~D~%" (-> obj lightning-count2)) + (format #t "~1Train-id: ~D~%" (-> obj rain-id)) + (format #t "~1Tsound-pitch: ~f~%" (-> obj sound-pitch)) + (format #t "~1Tfogs[9] @ #x~X~%" (-> obj fogs)) + (format #t "~1Tcolors[3] @ #x~X~%" (-> obj colors)) + (format #t "~1Tchannels[3] @ #x~X~%" (-> obj channels)) + (format #t "~1Tclouds[9] @ #x~X~%" (-> obj clouds)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc new file mode 100644 index 0000000000..763fe664e1 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/mood/time-of-day-h_REF.gc @@ -0,0 +1,242 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type palette-fade-control +(deftype palette-fade-control (structure) + ((trans vector :inline :offset-assert 0) + (fade float :offset-assert 16) + (actor-dist float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type palette-fade-control +(defmethod inspect palette-fade-control ((obj palette-fade-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'palette-fade-control) + (format #t "~1Ttrans: #~%" (-> obj trans)) + (format #t "~1Tfade: ~f~%" (-> obj fade)) + (format #t "~1Tactor-dist: ~f~%" (-> obj actor-dist)) + (label cfg-4) + obj + ) + +;; definition of type palette-fade-controls +(deftype palette-fade-controls (basic) + ((control palette-fade-control 8 :inline :offset-assert 16) + ) + :method-count-assert 11 + :size-assert #x110 + :flag-assert #xb00000110 + (:methods + (palette-fade-controls-method-9 () none 9) + (palette-fade-controls-method-10 () none 10) + ) + ) + +;; definition for method 3 of type palette-fade-controls +(defmethod inspect palette-fade-controls ((obj palette-fade-controls)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcontrol[8] @ #x~X~%" (-> obj control)) + (label cfg-4) + obj + ) + +;; definition (perm) for symbol *palette-fade-controls*, type palette-fade-controls +(define-perm *palette-fade-controls* palette-fade-controls (new 'global 'palette-fade-controls)) + +;; definition of type time-of-day-proc +(deftype time-of-day-proc (process) + ((hours int32 :offset-assert 128) + (minutes int32 :offset-assert 132) + (seconds int32 :offset-assert 136) + (old-frame uint64 :offset-assert 144) + (current-frame uint64 :offset-assert 152) + (frames uint64 :offset-assert 160) + (time-of-day float :offset-assert 168) + (time-ratio float :offset-assert 172) + (dest-time-ratio float :offset-assert 176) + (dest-time-delta float :offset-assert 180) + (sun-count int32 :offset-assert 184) + (sun sparticle-launch-control :offset-assert 188) + (green-sun-count int32 :offset-assert 192) + (green-sun sparticle-launch-control :offset-assert 196) + (moon-count int32 :offset-assert 200) + (moon sparticle-launch-control :offset-assert 204) + ) + :heap-base #x50 + :method-count-assert 14 + :size-assert #xd0 + :flag-assert #xe005000d0 + ) + +;; definition for method 3 of type time-of-day-proc +(defmethod inspect time-of-day-proc ((obj time-of-day-proc)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Thours: ~D~%" (-> obj hours)) + (format #t "~2Tminutes: ~D~%" (-> obj minutes)) + (format #t "~2Tseconds: ~D~%" (-> obj seconds)) + (format #t "~2Told-frame: ~D~%" (-> obj old-frame)) + (format #t "~2Tcurrent-frame: ~D~%" (-> obj current-frame)) + (format #t "~2Tframes: ~D~%" (-> obj frames)) + (format #t "~2Ttime-of-day: ~f~%" (-> obj time-of-day)) + (format #t "~2Ttime-ratio: ~f~%" (-> obj time-ratio)) + (format #t "~2Tdest-time-ratio: ~f~%" (-> obj dest-time-ratio)) + (format #t "~2Tdest-time-delta: ~f~%" (-> obj dest-time-delta)) + (format #t "~2Tsun-count: ~D~%" (-> obj sun-count)) + (format #t "~2Tsun: ~A~%" (-> obj sun)) + (format #t "~2Tgreen-sun-count: ~D~%" (-> obj green-sun-count)) + (format #t "~2Tgreen-sun: ~A~%" (-> obj green-sun)) + (format #t "~2Tmoon-count: ~D~%" (-> obj moon-count)) + (format #t "~2Tmoon: ~A~%" (-> obj moon)) + (label cfg-4) + obj + ) + +;; definition of type time-of-day-palette +(deftype time-of-day-palette (basic) + ((width int32 :offset-assert 4) + (height int32 :offset-assert 8) + (pad int32 :offset-assert 12) + (data int32 1 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type time-of-day-palette +(defmethod inspect time-of-day-palette ((obj time-of-day-palette)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twidth: ~D~%" (-> obj width)) + (format #t "~1Theight: ~D~%" (-> obj height)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type time-of-day-context +(deftype time-of-day-context (basic) + ((interp float 6 :offset-assert 4) + (current-fog mood-fog :inline :offset-assert 32) + (current-sky-color vector :inline :offset-assert 80) + (current-env-color vector :inline :offset-assert 96) + (current-prt-color vector :inline :offset-assert 112) + (current-shadow-color vector :inline :offset-assert 128) + (light-group light-group 8 :inline :offset-assert 144) + (current-clouds mood-clouds :inline :offset-assert 1680) + (times vector 8 :inline :offset-assert 1696) + (title-light-group light-group :inline :offset-assert 1824) + (filter vector :inline :offset-assert 2016) + (filter-color vector :inline :offset-assert 2032) + (time float :offset-assert 2048) + (target-interp float :offset-assert 2052) + (erase-color rgba :offset-assert 2056) + (sky symbol :offset-assert 2060) + (use-camera-other basic :offset-assert 2064) + (title-updated symbol :offset-assert 2068) + (mode uint32 :offset-assert 2072) + (overide-enable basic :offset-assert 2076) + (overide-palette uint32 :offset-assert 2080) + (max-rain float :offset-assert 2084) + (fog-mult float :offset-assert 2088) + (exterior-level basic :offset-assert 2092) + (ocean-alpha float :offset-assert 2096) + ) + :method-count-assert 9 + :size-assert #x834 + :flag-assert #x900000834 + ) + +;; definition for method 3 of type time-of-day-context +(defmethod inspect time-of-day-context ((obj time-of-day-context)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tinterp[6] @ #x~X~%" (-> obj interp)) + (format #t "~1Tcurrent-fog: #~%" (-> obj current-fog)) + (format #t "~1Tcurrent-sky-color: #~%" (-> obj current-sky-color)) + (format #t "~1Tcurrent-env-color: #~%" (-> obj current-env-color)) + (format #t "~1Tcurrent-prt-color: #~%" (-> obj current-prt-color)) + (format #t "~1Tcurrent-shadow-color: #~%" (-> obj current-shadow-color)) + (format #t "~1Tlight-group[8] @ #x~X~%" (-> obj light-group)) + (format #t "~1Tcurrent-clouds: #~%" (-> obj current-clouds)) + (format #t "~1Ttimes[8] @ #x~X~%" (-> obj times)) + (format #t "~1Ttitle-light-group: #~%" (-> obj title-light-group)) + (format #t "~1Tfilter: #~%" (-> obj filter)) + (format #t "~1Tfilter-color: #~%" (-> obj filter-color)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Ttarget-interp: ~f~%" (-> obj target-interp)) + (format #t "~1Terase-color: ~D~%" (-> obj erase-color)) + (format #t "~1Tsky: ~A~%" (-> obj sky)) + (format #t "~1Tuse-camera-other: ~A~%" (-> obj use-camera-other)) + (format #t "~1Ttitle-updated: ~A~%" (-> obj title-updated)) + (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "~1Toveride-enable: ~A~%" (-> obj overide-enable)) + (format #t "~1Toveride-palette: ~D~%" (-> obj overide-palette)) + (format #t "~1Tmax-rain: ~f~%" (-> obj max-rain)) + (format #t "~1Tfog-mult: ~f~%" (-> obj fog-mult)) + (format #t "~1Texterior-level: ~A~%" (-> obj exterior-level)) + (format #t "~1Tocean-alpha: ~f~%" (-> obj ocean-alpha)) + (label cfg-4) + obj + ) + +;; definition of type time-of-day-dma +(deftype time-of-day-dma (structure) + ((outa uint32 256 :offset-assert 0) + (outb uint32 256 :offset-assert 1024) + (banka uint32 256 :offset-assert 2048) + (bankb uint32 256 :offset-assert 3072) + ) + :method-count-assert 9 + :size-assert #x1000 + :flag-assert #x900001000 + ) + +;; definition for method 3 of type time-of-day-dma +(defmethod inspect time-of-day-dma ((obj time-of-day-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'time-of-day-dma) + (format #t "~1Touta[256] @ #x~X~%" (-> obj outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> obj outb)) + (format #t "~1Tbanka[256] @ #x~X~%" (-> obj banka)) + (format #t "~1Tbankb[256] @ #x~X~%" (-> obj bankb)) + (label cfg-4) + obj + ) + +;; definition for symbol *time-of-day-context*, type time-of-day-context +(define *time-of-day-context* (new 'static 'time-of-day-context)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc new file mode 100644 index 0000000000..207d6c3864 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-h_REF.gc @@ -0,0 +1,1445 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ocean-corner +(deftype ocean-corner (structure) + ((bsphere sphere :inline :offset-assert 0) + (start-corner vector :inline :offset-assert 16) + (y-scales vector :inline :offset-assert 32) + (alphas vector :inline :offset-assert 48) + (colors uint32 4 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type ocean-corner +(defmethod inspect ocean-corner ((obj ocean-corner)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-corner) + (format #t "~1Tbsphere: #~%" (-> obj bsphere)) + (format #t "~1Tstart-corner: #~%" (-> obj start-corner)) + (format #t "~1Ty-scales: #~%" (-> obj y-scales)) + (format #t "~1Talphas: #~%" (-> obj alphas)) + (format #t "~1Tcolors[4] @ #x~X~%" (-> obj colors)) + (label cfg-4) + obj + ) + +;; definition of type ocean-wave-info +(deftype ocean-wave-info (structure) + ((frequency float :offset-assert 0) + (amplitude float :offset-assert 4) + (wave-speed float :offset-assert 8) + (angle float :offset-assert 12) + (kx float :offset-assert 16) + (ky float :offset-assert 20) + (w float :offset-assert 24) + (flags int32 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type ocean-wave-info +(defmethod inspect ocean-wave-info ((obj ocean-wave-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-wave-info) + (format #t "~1Tfrequency: ~f~%" (-> obj frequency)) + (format #t "~1Tamplitude: ~f~%" (-> obj amplitude)) + (format #t "~1Twave-speed: ~f~%" (-> obj wave-speed)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "~1Tkx: ~f~%" (-> obj kx)) + (format #t "~1Tky: ~f~%" (-> obj ky)) + (format #t "~1Tw: ~f~%" (-> obj w)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (label cfg-4) + obj + ) + +;; definition of type ocean-vertex +(deftype ocean-vertex (structure) + ((pos vector :inline :offset-assert 0) + (stq vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type ocean-vertex +(defmethod inspect ocean-vertex ((obj ocean-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-vertex) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tstq: #~%" (-> obj stq)) + (format #t "~1Tcol: #~%" (-> obj col)) + (label cfg-4) + obj + ) + +;; definition of type ocean-spheres +(deftype ocean-spheres (structure) + ((spheres sphere 36 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x240 + :flag-assert #x900000240 + ) + +;; definition for method 3 of type ocean-spheres +(defmethod inspect ocean-spheres ((obj ocean-spheres)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-spheres) + (format #t "~1Tspheres[36] @ #x~X~%" (-> obj spheres)) + (label cfg-4) + obj + ) + +;; definition of type ocean-colors +(deftype ocean-colors (structure) + ((colors rgba 2548 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x27d0 + :flag-assert #x9000027d0 + ) + +;; definition for method 3 of type ocean-colors +(defmethod inspect ocean-colors ((obj ocean-colors)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-colors) + (format #t "~1Tcolors[2548] @ #x~X~%" (-> obj colors)) + (label cfg-4) + obj + ) + +;; definition of type ocean-colors-float +(deftype ocean-colors-float (structure) + ((colors vector 2548 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x9f40 + :flag-assert #x900009f40 + ) + +;; definition for method 3 of type ocean-colors-float +(defmethod inspect ocean-colors-float ((obj ocean-colors-float)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-colors-float) + (format #t "~1Tcolors[2548] @ #x~X~%" (-> obj colors)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-mask +(deftype ocean-mid-mask (structure) + ((mask uint8 8 :offset-assert 0) + (dword uint64 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type ocean-mid-mask +(defmethod inspect ocean-mid-mask ((obj ocean-mid-mask)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-mid-mask) + (format #t "~1Tmask[8] @ #x~X~%" (-> obj mask)) + (format #t "~1Tdword: #x~X~%" (-> obj dword)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-indices +(deftype ocean-mid-indices (basic) + ((data uint16 36 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +;; definition for method 3 of type ocean-mid-indices +(defmethod inspect ocean-mid-indices ((obj ocean-mid-indices)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdata[36] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-masks +(deftype ocean-mid-masks (basic) + ((data (inline-array ocean-mid-mask) :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type ocean-mid-masks +(defmethod inspect ocean-mid-masks ((obj ocean-mid-masks)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdata: #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-trans-mask +(deftype ocean-trans-mask (structure) + ((mask uint8 4 :offset-assert 0) + (word int32 :offset 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type ocean-trans-mask +(defmethod inspect ocean-trans-mask ((obj ocean-trans-mask)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-trans-mask) + (format #t "~1Tmask[4] @ #x~X~%" (-> obj mask)) + (format #t "~1Tword: #x~X~%" (-> obj word)) + (label cfg-4) + obj + ) + +;; definition of type ocean-trans-index +(deftype ocean-trans-index (structure) + ((parent int16 :offset-assert 0) + (child int16 :offset-assert 2) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type ocean-trans-index +(defmethod inspect ocean-trans-index ((obj ocean-trans-index)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-trans-index) + (format #t "~1Tparent: ~D~%" (-> obj parent)) + (format #t "~1Tchild: ~D~%" (-> obj child)) + (label cfg-4) + obj + ) + +;; definition of type ocean-trans-indices +(deftype ocean-trans-indices (basic) + ((data ocean-trans-index 2304 :inline :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x2404 + :flag-assert #x900002404 + ) + +;; definition for method 3 of type ocean-trans-indices +(defmethod inspect ocean-trans-indices ((obj ocean-trans-indices)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdata[2304] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-index +(deftype ocean-near-index (structure) + ((data uint16 16 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type ocean-near-index +(defmethod inspect ocean-near-index ((obj ocean-near-index)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-near-index) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-indices +(deftype ocean-near-indices (basic) + ((data (inline-array ocean-near-index) :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type ocean-near-indices +(defmethod inspect ocean-near-indices ((obj ocean-near-indices)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdata: #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-colors +(deftype ocean-near-colors (structure) + ((color0 vector :inline :offset-assert 0) + (color1 vector :inline :offset-assert 16) + (color2 vector :inline :offset-assert 32) + (color3 vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type ocean-near-colors +(defmethod inspect ocean-near-colors ((obj ocean-near-colors)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-near-colors) + (format #t "~1Tcolor0: #~%" (-> obj color0)) + (format #t "~1Tcolor1: #~%" (-> obj color1)) + (format #t "~1Tcolor2: #~%" (-> obj color2)) + (format #t "~1Tcolor3: #~%" (-> obj color3)) + (label cfg-4) + obj + ) + +;; definition of type ocean-trans-strip +(deftype ocean-trans-strip (structure) + ((verts uint128 10 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +;; definition for method 3 of type ocean-trans-strip +(defmethod inspect ocean-trans-strip ((obj ocean-trans-strip)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-trans-strip) + (format #t "~1Tverts[10] @ #x~X~%" (-> obj verts)) + (label cfg-4) + obj + ) + +;; definition of type ocean-trans-strip-array +(deftype ocean-trans-strip-array (structure) + ((data ocean-trans-strip 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x280 + :flag-assert #x900000280 + ) + +;; definition for method 3 of type ocean-trans-strip-array +(defmethod inspect ocean-trans-strip-array ((obj ocean-trans-strip-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-trans-strip-array) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-wave-data +(deftype ocean-wave-data (structure) + ((data uint8 1024 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x400 + :flag-assert #x900000400 + ) + +;; definition for method 3 of type ocean-wave-data +(defmethod inspect ocean-wave-data ((obj ocean-wave-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-wave-data) + (format #t "~1Tdata[1024] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-wave-frames +(deftype ocean-wave-frames (structure) + ((frame ocean-wave-data 64 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10000 + :flag-assert #x900000000 + ) + +;; definition for method 3 of type ocean-wave-frames +(defmethod inspect ocean-wave-frames ((obj ocean-wave-frames)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-wave-frames) + (format #t "~1Tframe[64] @ #x~X~%" (-> obj frame)) + (label cfg-4) + obj + ) + +;; definition of type ocean-texture-constants +(deftype ocean-texture-constants (structure) + ((giftag gs-gif-tag :inline :offset-assert 0) + (buffers vector4w :inline :offset-assert 16) + (dests vector4w :inline :offset-assert 32) + (start vector :inline :offset-assert 48) + (offsets vector :inline :offset-assert 64) + (constants vector :inline :offset-assert 80) + (cam-nrm vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type ocean-texture-constants +(defmethod inspect ocean-texture-constants ((obj ocean-texture-constants)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-texture-constants) + (format #t "~1Tgiftag: #~%" (-> obj giftag)) + (format #t "~1Tbuffers: #~%" (-> obj buffers)) + (format #t "~1Tdests: #~%" (-> obj dests)) + (format #t "~1Tstart: #~%" (-> obj start)) + (format #t "~1Toffsets: #~%" (-> obj offsets)) + (format #t "~1Tconstants: #~%" (-> obj constants)) + (format #t "~1Tcam-nrm: #~%" (-> obj cam-nrm)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-vertex +(deftype ocean-mid-vertex (structure) + ((stq vector :inline :offset-assert 0) + (col vector :inline :offset-assert 16) + (pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type ocean-mid-vertex +(defmethod inspect ocean-mid-vertex ((obj ocean-mid-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-mid-vertex) + (format #t "~1Tstq: #~%" (-> obj stq)) + (format #t "~1Tcol: #~%" (-> obj col)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-constants +(deftype ocean-mid-constants (structure) + ((hmge-scale vector :inline :offset-assert 0) + (inv-hmge-scale vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (fog vector :inline :offset-assert 48) + (constants vector :inline :offset-assert 64) + (constants2 vector :inline :offset-assert 80) + (drw-fan gs-gif-tag :inline :offset-assert 96) + (env-fan gs-gif-tag :inline :offset-assert 112) + (drw-adgif gs-gif-tag :inline :offset-assert 128) + (drw-texture adgif-shader :inline :offset-assert 144) + (drw-strip-0 gs-gif-tag :inline :offset-assert 224) + (drw-strip-1 gs-gif-tag :inline :offset-assert 240) + (env-adgif gs-gif-tag :inline :offset-assert 256) + (env-texture adgif-shader :inline :offset-assert 272) + (env-strip gs-gif-tag :inline :offset-assert 352) + (env-color vector :inline :offset-assert 368) + (index-table vector4w 8 :inline :offset-assert 384) + (pos0 vector :inline :offset-assert 512) + (pos1 vector :inline :offset-assert 528) + (pos2 vector :inline :offset-assert 544) + (pos3 vector :inline :offset-assert 560) + ) + :method-count-assert 9 + :size-assert #x240 + :flag-assert #x900000240 + ) + +;; definition for method 3 of type ocean-mid-constants +(defmethod inspect ocean-mid-constants ((obj ocean-mid-constants)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-mid-constants) + (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) + (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tconstants: #~%" (-> obj constants)) + (format #t "~1Tconstants2: #~%" (-> obj constants2)) + (format #t "~1Tdrw-fan: #~%" (-> obj drw-fan)) + (format #t "~1Tenv-fan: #~%" (-> obj env-fan)) + (format #t "~1Tdrw-adgif: #~%" (-> obj drw-adgif)) + (format #t "~1Tdrw-texture: #~%" (-> obj drw-texture)) + (format #t "~1Tdrw-strip-0: #~%" (-> obj drw-strip-0)) + (format #t "~1Tdrw-strip-1: #~%" (-> obj drw-strip-1)) + (format #t "~1Tenv-adgif: #~%" (-> obj env-adgif)) + (format #t "~1Tenv-texture: #~%" (-> obj env-texture)) + (format #t "~1Tenv-strip: #~%" (-> obj env-strip)) + (format #t "~1Tenv-color: #~%" (-> obj env-color)) + (format #t "~1Tindex-table[8] @ #x~X~%" (-> obj index-table)) + (format #t "~1Tpos0: #~%" (-> obj pos0)) + (format #t "~1Tpos1: #~%" (-> obj pos1)) + (format #t "~1Tpos2: #~%" (-> obj pos2)) + (format #t "~1Tpos3: #~%" (-> obj pos3)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-upload +(deftype ocean-mid-upload (structure) + ((rot matrix :inline :offset-assert 0) + (matrix matrix :inline :offset-assert 64) + (colors uint128 108 :offset-assert 128) + (masks uint128 2 :offset-assert 1856) + ) + :method-count-assert 9 + :size-assert #x760 + :flag-assert #x900000760 + ) + +;; definition for method 3 of type ocean-mid-upload +(defmethod inspect ocean-mid-upload ((obj ocean-mid-upload)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-mid-upload) + (format #t "~1Trot: #~%" (-> obj rot)) + (format #t "~1Tmatrix: #~%" (-> obj matrix)) + (format #t "~1Tcolors[108] @ #x~X~%" (-> obj colors)) + (format #t "~1Tmasks[2] @ #x~X~%" (-> obj masks)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-upload2 +(deftype ocean-mid-upload2 (structure) + ((rot matrix :inline :offset-assert 0) + (matrix matrix :inline :offset-assert 64) + (count vector4w :inline :offset-assert 128) + (tex0 vector :inline :offset-assert 144) + (tex1 vector :inline :offset-assert 160) + (tex2 vector :inline :offset-assert 176) + (tex3 vector :inline :offset-assert 192) + (clr0 vector :inline :offset-assert 208) + (clr1 vector :inline :offset-assert 224) + (clr2 vector :inline :offset-assert 240) + (clr3 vector :inline :offset-assert 256) + (verts uint128 18 :offset-assert 272) + ) + :method-count-assert 9 + :size-assert #x230 + :flag-assert #x900000230 + ) + +;; definition for method 3 of type ocean-mid-upload2 +(defmethod inspect ocean-mid-upload2 ((obj ocean-mid-upload2)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-mid-upload2) + (format #t "~1Trot: #~%" (-> obj rot)) + (format #t "~1Tmatrix: #~%" (-> obj matrix)) + (format #t "~1Tcount: #~%" (-> obj count)) + (format #t "~1Ttex0: #~%" (-> obj tex0)) + (format #t "~1Ttex1: #~%" (-> obj tex1)) + (format #t "~1Ttex2: #~%" (-> obj tex2)) + (format #t "~1Ttex3: #~%" (-> obj tex3)) + (format #t "~1Tclr0: #~%" (-> obj clr0)) + (format #t "~1Tclr1: #~%" (-> obj clr1)) + (format #t "~1Tclr2: #~%" (-> obj clr2)) + (format #t "~1Tclr3: #~%" (-> obj clr3)) + (format #t "~1Tverts[18] @ #x~X~%" (-> obj verts)) + (label cfg-4) + obj + ) + +;; definition of type ocean-mid-work +(deftype ocean-mid-work (structure) + ((env0 vector :inline :offset-assert 0) + (env1 vector :inline :offset-assert 16) + (env2 vector :inline :offset-assert 32) + (hmg0 vector :inline :offset-assert 48) + (hmg1 vector :inline :offset-assert 64) + (hmg2 vector :inline :offset-assert 80) + (indices uint128 16 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x160 + :flag-assert #x900000160 + ) + +;; definition for method 3 of type ocean-mid-work +(defmethod inspect ocean-mid-work ((obj ocean-mid-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-mid-work) + (format #t "~1Tenv0: #~%" (-> obj env0)) + (format #t "~1Tenv1: #~%" (-> obj env1)) + (format #t "~1Tenv2: #~%" (-> obj env2)) + (format #t "~1Thmg0: #~%" (-> obj hmg0)) + (format #t "~1Thmg1: #~%" (-> obj hmg1)) + (format #t "~1Thmg2: #~%" (-> obj hmg2)) + (format #t "~1Tindices[16] @ #x~X~%" (-> obj indices)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-constants +(deftype ocean-near-constants (structure) + ((hmge-scale vector :inline :offset-assert 0) + (inv-hmge-scale vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (fog vector :inline :offset-assert 48) + (constants vector :inline :offset-assert 64) + (constants2 vector :inline :offset-assert 80) + (constants3 vector :inline :offset-assert 96) + (constants4 vector :inline :offset-assert 112) + (constants5 vector :inline :offset-assert 128) + (drw-fan gs-gif-tag :inline :offset-assert 144) + (drw2-fan gs-gif-tag :inline :offset-assert 160) + (env-fan gs-gif-tag :inline :offset-assert 176) + (drw-adgif gs-gif-tag :inline :offset-assert 192) + (drw-texture adgif-shader :inline :offset-assert 208) + (drw-strip gs-gif-tag :inline :offset-assert 288) + (env-adgif gs-gif-tag :inline :offset-assert 304) + (env-texture adgif-shader :inline :offset-assert 320) + (env-strip gs-gif-tag :inline :offset-assert 400) + (env-color vector :inline :offset-assert 416) + (drw2-adgif gs-gif-tag :inline :offset-assert 432) + (drw2-tex0 qword :inline :offset-assert 448) + (drw2-frame qword :inline :offset-assert 464) + (drw2-strip gs-gif-tag :inline :offset-assert 480) + (drw3-adgif gs-gif-tag :inline :offset-assert 496) + (drw3-frame qword :inline :offset-assert 512) + (index-table vector4w 4 :inline :offset-assert 528) + ) + :method-count-assert 9 + :size-assert #x250 + :flag-assert #x900000250 + ) + +;; definition for method 3 of type ocean-near-constants +(defmethod inspect ocean-near-constants ((obj ocean-near-constants)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-near-constants) + (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) + (format #t "~1Tinv-hmge-scale: #~%" (-> obj inv-hmge-scale)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tconstants: #~%" (-> obj constants)) + (format #t "~1Tconstants2: #~%" (-> obj constants2)) + (format #t "~1Tconstants3: #~%" (-> obj constants3)) + (format #t "~1Tconstants4: #~%" (-> obj constants4)) + (format #t "~1Tconstants5: #~%" (-> obj constants5)) + (format #t "~1Tdrw-fan: #~%" (-> obj drw-fan)) + (format #t "~1Tdrw2-fan: #~%" (-> obj drw2-fan)) + (format #t "~1Tenv-fan: #~%" (-> obj env-fan)) + (format #t "~1Tdrw-adgif: #~%" (-> obj drw-adgif)) + (format #t "~1Tdrw-texture: #~%" (-> obj drw-texture)) + (format #t "~1Tdrw-strip: #~%" (-> obj drw-strip)) + (format #t "~1Tenv-adgif: #~%" (-> obj env-adgif)) + (format #t "~1Tenv-texture: #~%" (-> obj env-texture)) + (format #t "~1Tenv-strip: #~%" (-> obj env-strip)) + (format #t "~1Tenv-color: #~%" (-> obj env-color)) + (format #t "~1Tdrw2-adgif: #~%" (-> obj drw2-adgif)) + (format #t "~1Tdrw2-tex0: #~%" (-> obj drw2-tex0)) + (format #t "~1Tdrw2-frame: #~%" (-> obj drw2-frame)) + (format #t "~1Tdrw2-strip: #~%" (-> obj drw2-strip)) + (format #t "~1Tdrw3-adgif: #~%" (-> obj drw3-adgif)) + (format #t "~1Tdrw3-frame: #~%" (-> obj drw3-frame)) + (format #t "~1Tindex-table[4] @ #x~X~%" (-> obj index-table)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-upload +(deftype ocean-near-upload (structure) + ((rot matrix :inline :offset-assert 0) + (matrix matrix :inline :offset-assert 64) + (masks uint128 2 :offset-assert 128) + (start-height vector4w :inline :offset-assert 160) + (start-st vector :inline :offset-assert 176) + (near-colors ocean-near-colors :inline :offset-assert 192) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +;; definition for method 3 of type ocean-near-upload +(defmethod inspect ocean-near-upload ((obj ocean-near-upload)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-near-upload) + (format #t "~1Trot: #~%" (-> obj rot)) + (format #t "~1Tmatrix: #~%" (-> obj matrix)) + (format #t "~1Tmasks[2] @ #x~X~%" (-> obj masks)) + (format #t "~1Tstart-height: #~%" (-> obj start-height)) + (format #t "~1Tstart-st: #~%" (-> obj start-st)) + (format #t "~1Tnear-colors: #~%" (-> obj near-colors)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-vertex +(deftype ocean-near-vertex (structure) + ((stq vector :inline :offset-assert 0) + (clr vector :inline :offset-assert 16) + (pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type ocean-near-vertex +(defmethod inspect ocean-near-vertex ((obj ocean-near-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-near-vertex) + (format #t "~1Tstq: #~%" (-> obj stq)) + (format #t "~1Tclr: #~%" (-> obj clr)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (label cfg-4) + obj + ) + +;; definition of type ocean-near-work +(deftype ocean-near-work (structure) + ((verts-ptr vector :inline :offset-assert 0) + (indices uint128 16 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x110 + :flag-assert #x900000110 + ) + +;; definition for method 3 of type ocean-near-work +(defmethod inspect ocean-near-work ((obj ocean-near-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-near-work) + (format #t "~1Tverts-ptr: #~%" (-> obj verts-ptr)) + (format #t "~1Tindices[16] @ #x~X~%" (-> obj indices)) + (label cfg-4) + obj + ) + +;; definition of type ocean-height-array +(deftype ocean-height-array (structure) + ((data float 1024 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x1000 + :flag-assert #x900001000 + ) + +;; definition for method 3 of type ocean-height-array +(defmethod inspect ocean-height-array ((obj ocean-height-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-height-array) + (format #t "~1Tdata[1024] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-vert-array +(deftype ocean-vert-array (structure) + ((data vector 2048 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x8000 + :flag-assert #x900008000 + ) + +;; definition for method 3 of type ocean-vert-array +(defmethod inspect ocean-vert-array ((obj ocean-vert-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-vert-array) + (format #t "~1Tdata[2048] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type ocean-map +(deftype ocean-map (structure) + ((start-corner vector :inline :offset-assert 0) + (far-color vector :inline :offset-assert 16) + (ocean-spheres ocean-spheres :offset-assert 32) + (ocean-colors ocean-colors :offset-assert 36) + (ocean-mid-indices ocean-mid-indices :offset-assert 40) + (ocean-trans-indices ocean-trans-indices :offset-assert 44) + (ocean-near-indices ocean-near-indices :offset-assert 48) + (ocean-mid-masks ocean-mid-masks :offset-assert 52) + ) + :method-count-assert 11 + :size-assert #x38 + :flag-assert #xb00000038 + (:methods + (ocean-map-method-9 () none 9) + (ocean-map-method-10 () none 10) + ) + ) + +;; definition for method 3 of type ocean-map +(defmethod inspect ocean-map ((obj ocean-map)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean-map) + (format #t "~1Tstart-corner: #~%" (-> obj start-corner)) + (format #t "~1Tfar-color: #~%" (-> obj far-color)) + (format #t "~1Tocean-spheres: #~%" (-> obj ocean-spheres)) + (format #t "~1Tocean-colors: #~%" (-> obj ocean-colors)) + (format #t "~1Tocean-mid-indices: ~A~%" (-> obj ocean-mid-indices)) + (format #t "~1Tocean-trans-indices: ~A~%" (-> obj ocean-trans-indices)) + (format #t "~1Tocean-near-indices: ~A~%" (-> obj ocean-near-indices)) + (format #t "~1Tocean-mid-masks: ~A~%" (-> obj ocean-mid-masks)) + (label cfg-4) + obj + ) + +;; definition of type ocean +(deftype ocean (ocean-map) + ((off basic :offset-assert 56) + (near-off basic :offset-assert 60) + (mid-off basic :offset-assert 64) + (far-on basic :offset-assert 68) + (ocean-facing uint32 :offset-assert 72) + (heights ocean-height-array :offset-assert 76) + (heights2 ocean-height-array :offset-assert 80) + (verts ocean-vert-array :offset-assert 84) + (ocean-near-translucent? basic :offset-assert 88) + (deltas vector :inline :offset-assert 96) + (map-min vector :inline :offset-assert 112) + (map-max vector :inline :offset-assert 128) + (interp vector :inline :offset-assert 144) + (corner-array ocean-corner 25 :inline :offset-assert 160) + (corner-count int32 :offset-assert 2160) + (temp-vecs vector 4 :inline :offset-assert 2176) + (mid-mask-ptrs pointer 36 :offset-assert 2240) + (mid-camera-masks uint64 36 :offset-assert 2384) + (trans-mask-ptrs pointer 64 :offset-assert 2672) + (trans-camera-masks uint32 16 :offset-assert 2928) + (trans-temp-masks uint32 16 :offset-assert 2992) + (sprite-tmpl dma-gif-packet :inline :offset-assert 3056) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 3088) + (sprite-tmpl3 dma-gif-packet :inline :offset-assert 3120) + (adgif-tmpl dma-gif-packet :inline :offset-assert 3152) + (line-tmpl dma-gif-packet :inline :offset-assert 3184) + (sun-tmpl dma-gif-packet :inline :offset-assert 3216) + (erase-tmpl dma-gif-packet :inline :offset-assert 3248) + (haze-tmpl dma-gif-packet :inline :offset-assert 3280) + (cloud-tmpl dma-gif-packet :inline :offset-assert 3312) + (clut-tmpl dma-gif-packet :inline :offset-assert 3344) + (cloud-lights cloud-lights :inline :offset-assert 3376) + (haze-lights haze-lights :inline :offset-assert 3536) + (constant vector :inline :offset-assert 3664) + (sky-color vector :inline :offset-assert 3680) + (haze-verts vector4w 32 :inline :offset-assert 3696) + (cloud-verts vector4w 36 :inline :offset-assert 4208) + (cloud-nrms vector 36 :inline :offset-assert 4784) + (cloud-col0 vector 36 :inline :offset-assert 5360) + (cloud-col1 vector 36 :inline :offset-assert 5936) + (cloud-st0 vector 36 :inline :offset-assert 6512) + (cloud-st1 vector 36 :inline :offset-assert 7088) + (color80808080 vector4w :inline :offset-assert 7664) + (color80808040 vector4w :inline :offset-assert 7680) + (color80808000 vector4w :inline :offset-assert 7696) + (st0000 vector :inline :offset-assert 7712) + (st0505 vector :inline :offset-assert 7728) + (st1010 vector :inline :offset-assert 7744) + (uv00 vector4w :inline :offset-assert 7760) + (uv44 vector4w :inline :offset-assert 7776) + (uv88 vector4w :inline :offset-assert 7792) + (uv1010 vector4w :inline :offset-assert 7808) + (uv2020 vector4w :inline :offset-assert 7824) + (uv4040 vector4w :inline :offset-assert 7840) + (uv8080 vector4w :inline :offset-assert 7856) + (xy00 vector4w :inline :offset-assert 7872) + (xy88 vector4w :inline :offset-assert 7888) + (xy1010 vector4w :inline :offset-assert 7904) + (xy2020 vector4w :inline :offset-assert 7920) + (xy4040 vector4w :inline :offset-assert 7936) + (xy8080 vector4w :inline :offset-assert 7952) + (cloud-alpha uint8 36 :offset-assert 7968) + (near-mask-indices uint16 16 :offset-assert 8004) + (mid-minx uint8 :offset-assert 8036) + (mid-maxx uint8 :offset-assert 8037) + (mid-minz uint8 :offset-assert 8038) + (mid-maxz uint8 :offset-assert 8039) + (near-minx uint8 :offset-assert 8040) + (near-maxx uint8 :offset-assert 8041) + (near-minz uint8 :offset-assert 8042) + (near-maxz uint8 :offset-assert 8043) + (temp-minx uint8 :offset-assert 8044) + (temp-maxx uint8 :offset-assert 8045) + (temp-minz uint8 :offset-assert 8046) + (temp-maxz uint8 :offset-assert 8047) + (tex1 uint64 :offset-assert 8048) + (tex1-near uint64 :offset-assert 8056) + (corner00 float :offset-assert 8064) + (corner01 float :offset-assert 8068) + (corner10 float :offset-assert 8072) + (corner11 float :offset-assert 8076) + (frame-num float :offset-assert 8080) + (frame-speed float :offset-assert 8084) + (frame-num2 float :offset-assert 8088) + (frame-speed2 float :offset-assert 8092) + (cloud-interp float :offset 3676) + (scales vector :inline :offset-assert 8096) + (mask-hi vector4w :inline :offset-assert 8112) + (mask-lo vector4w :inline :offset-assert 8128) + (lights vu-lights :inline :offset-assert 8144) + (uv-scroll-0 vector4w :inline :offset-assert 8256) + (uv-scroll-1 vector4w :inline :offset-assert 8272) + (st-scroll vector2 :inline :offset-assert 8288) + (wait-to-vu0 uint32 :offset-assert 8296) + ) + :method-count-assert 92 + :size-assert #x206c + :flag-assert #x5c0000206c + (:methods + (ocean-method-11 () none 11) + (ocean-method-12 () none 12) + (ocean-method-13 () none 13) + (ocean-method-14 () none 14) + (ocean-method-15 () none 15) + (ocean-method-16 () none 16) + (ocean-method-17 () none 17) + (ocean-method-18 () none 18) + (ocean-method-19 () none 19) + (ocean-method-20 () none 20) + (ocean-method-21 () none 21) + (ocean-method-22 () none 22) + (ocean-method-23 () none 23) + (ocean-method-24 () none 24) + (ocean-method-25 () none 25) + (ocean-method-26 () none 26) + (ocean-method-27 () none 27) + (ocean-method-28 () none 28) + (ocean-method-29 () none 29) + (ocean-method-30 () none 30) + (ocean-method-31 () none 31) + (ocean-method-32 () none 32) + (ocean-method-33 () none 33) + (ocean-method-34 () none 34) + (ocean-method-35 () none 35) + (ocean-method-36 () none 36) + (ocean-method-37 () none 37) + (ocean-method-38 () none 38) + (ocean-method-39 () none 39) + (ocean-method-40 () none 40) + (ocean-method-41 () none 41) + (ocean-method-42 () none 42) + (ocean-method-43 () none 43) + (ocean-method-44 () none 44) + (ocean-method-45 () none 45) + (ocean-method-46 () none 46) + (ocean-method-47 () none 47) + (ocean-method-48 () none 48) + (ocean-method-49 () none 49) + (ocean-method-50 () none 50) + (ocean-method-51 () none 51) + (ocean-method-52 () none 52) + (ocean-method-53 () none 53) + (ocean-method-54 () none 54) + (ocean-method-55 () none 55) + (ocean-method-56 () none 56) + (ocean-method-57 () none 57) + (ocean-method-58 () none 58) + (ocean-method-59 () none 59) + (ocean-method-60 () none 60) + (ocean-method-61 () none 61) + (ocean-method-62 () none 62) + (ocean-method-63 () none 63) + (ocean-method-64 () none 64) + (ocean-method-65 () none 65) + (ocean-method-66 () none 66) + (ocean-method-67 () none 67) + (ocean-method-68 () none 68) + (ocean-method-69 () none 69) + (ocean-method-70 () none 70) + (ocean-method-71 () none 71) + (ocean-method-72 () none 72) + (ocean-method-73 () none 73) + (ocean-method-74 () none 74) + (ocean-method-75 () none 75) + (ocean-method-76 () none 76) + (ocean-method-77 () none 77) + (ocean-method-78 () none 78) + (ocean-method-79 () none 79) + (ocean-method-80 () none 80) + (ocean-method-81 () none 81) + (ocean-method-82 () none 82) + (ocean-method-83 () none 83) + (ocean-method-84 () none 84) + (ocean-method-85 () none 85) + (ocean-method-86 () none 86) + (ocean-method-87 () none 87) + (ocean-method-88 () none 88) + (ocean-method-89 () none 89) + (ocean-method-90 () none 90) + (ocean-method-91 () none 91) + ) + ) + +;; definition for method 3 of type ocean +(defmethod inspect ocean ((obj ocean)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ocean) + (format #t "~1Tstart-corner: #~%" (-> obj start-corner)) + (format #t "~1Tfar-color: #~%" (-> obj far-color)) + (format #t "~1Tocean-spheres: #~%" (-> obj ocean-spheres)) + (format #t "~1Tocean-colors: #~%" (-> obj ocean-colors)) + (format #t "~1Tocean-mid-indices: ~A~%" (-> obj ocean-mid-indices)) + (format #t "~1Tocean-trans-indices: ~A~%" (-> obj ocean-trans-indices)) + (format #t "~1Tocean-near-indices: ~A~%" (-> obj ocean-near-indices)) + (format #t "~1Tocean-mid-masks: ~A~%" (-> obj ocean-mid-masks)) + (format #t "~1Toff: ~A~%" (-> obj off)) + (format #t "~1Tnear-off: ~A~%" (-> obj near-off)) + (format #t "~1Tmid-off: ~A~%" (-> obj mid-off)) + (format #t "~1Tfar-on: ~A~%" (-> obj far-on)) + (format #t "~1Tocean-facing: ~D~%" (-> obj ocean-facing)) + (format #t "~1Theights: #~%" (-> obj heights)) + (format #t "~1Theights2: #~%" (-> obj heights2)) + (format #t "~1Tverts: #~%" (-> obj verts)) + (format #t "~1Tocean-near-translucent?: ~A~%" (-> obj ocean-near-translucent?)) + (format #t "~1Tdeltas: #~%" (-> obj deltas)) + (format #t "~1Tmap-min: #~%" (-> obj map-min)) + (format #t "~1Tmap-max: #~%" (-> obj map-max)) + (format #t "~1Tinterp: #~%" (-> obj interp)) + (format #t "~1Tcorner-array[25] @ #x~X~%" (-> obj corner-array)) + (format #t "~1Tcorner-count: ~D~%" (-> obj corner-count)) + (format #t "~1Ttemp-vecs[4] @ #x~X~%" (-> obj temp-vecs)) + (format #t "~1Tmid-mask-ptrs[36] @ #x~X~%" (-> obj mid-mask-ptrs)) + (format #t "~1Tmid-camera-masks[36] @ #x~X~%" (-> obj mid-camera-masks)) + (format #t "~1Ttrans-mask-ptrs[64] @ #x~X~%" (-> obj trans-mask-ptrs)) + (format #t "~1Ttrans-camera-masks[16] @ #x~X~%" (-> obj trans-camera-masks)) + (format #t "~1Ttrans-temp-masks[16] @ #x~X~%" (-> obj trans-temp-masks)) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) + (format #t "~1Tsprite-tmpl3: #~%" (-> obj sprite-tmpl3)) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tline-tmpl: #~%" (-> obj line-tmpl)) + (format #t "~1Tsun-tmpl: #~%" (-> obj sun-tmpl)) + (format #t "~1Terase-tmpl: #~%" (-> obj erase-tmpl)) + (format #t "~1Thaze-tmpl: #~%" (-> obj haze-tmpl)) + (format #t "~1Tcloud-tmpl: #~%" (-> obj cloud-tmpl)) + (format #t "~1Tclut-tmpl: #~%" (-> obj clut-tmpl)) + (format #t "~1Tcloud-lights: #~%" (-> obj cloud-lights)) + (format #t "~1Thaze-lights: #~%" (-> obj haze-lights)) + (format #t "~1Tconstant: #~%" (-> obj constant)) + (format #t "~1Tsky-color: #~%" (-> obj sky-color)) + (format #t "~1Thaze-verts[32] @ #x~X~%" (-> obj haze-verts)) + (format #t "~1Tcloud-verts[36] @ #x~X~%" (-> obj cloud-verts)) + (format #t "~1Tcloud-nrms[36] @ #x~X~%" (-> obj cloud-nrms)) + (format #t "~1Tcloud-col0[36] @ #x~X~%" (-> obj cloud-col0)) + (format #t "~1Tcloud-col1[36] @ #x~X~%" (-> obj cloud-col1)) + (format #t "~1Tcloud-st0[36] @ #x~X~%" (-> obj cloud-st0)) + (format #t "~1Tcloud-st1[36] @ #x~X~%" (-> obj cloud-st1)) + (format #t "~1Tcolor80808080: #~%" (-> obj color80808080)) + (format #t "~1Tcolor80808040: #~%" (-> obj color80808040)) + (format #t "~1Tcolor80808000: #~%" (-> obj color80808000)) + (format #t "~1Tst0000: #~%" (-> obj st0000)) + (format #t "~1Tst0505: #~%" (-> obj st0505)) + (format #t "~1Tst1010: #~%" (-> obj st1010)) + (format #t "~1Tuv00: #~%" (-> obj uv00)) + (format #t "~1Tuv44: #~%" (-> obj uv44)) + (format #t "~1Tuv88: #~%" (-> obj uv88)) + (format #t "~1Tuv1010: #~%" (-> obj uv1010)) + (format #t "~1Tuv2020: #~%" (-> obj uv2020)) + (format #t "~1Tuv4040: #~%" (-> obj uv4040)) + (format #t "~1Tuv8080: #~%" (-> obj uv8080)) + (format #t "~1Txy00: #~%" (-> obj xy00)) + (format #t "~1Txy88: #~%" (-> obj xy88)) + (format #t "~1Txy1010: #~%" (-> obj xy1010)) + (format #t "~1Txy2020: #~%" (-> obj xy2020)) + (format #t "~1Txy4040: #~%" (-> obj xy4040)) + (format #t "~1Txy8080: #~%" (-> obj xy8080)) + (format #t "~1Tcloud-alpha[36] @ #x~X~%" (-> obj cloud-alpha)) + (format #t "~1Tnear-mask-indices[16] @ #x~X~%" (-> obj near-mask-indices)) + (format #t "~1Tmid-minx: ~D~%" (-> obj mid-minx)) + (format #t "~1Tmid-maxx: ~D~%" (-> obj mid-maxx)) + (format #t "~1Tmid-minz: ~D~%" (-> obj mid-minz)) + (format #t "~1Tmid-maxz: ~D~%" (-> obj mid-maxz)) + (format #t "~1Tnear-minx: ~D~%" (-> obj near-minx)) + (format #t "~1Tnear-maxx: ~D~%" (-> obj near-maxx)) + (format #t "~1Tnear-minz: ~D~%" (-> obj near-minz)) + (format #t "~1Tnear-maxz: ~D~%" (-> obj near-maxz)) + (format #t "~1Ttemp-minx: ~D~%" (-> obj temp-minx)) + (format #t "~1Ttemp-maxx: ~D~%" (-> obj temp-maxx)) + (format #t "~1Ttemp-minz: ~D~%" (-> obj temp-minz)) + (format #t "~1Ttemp-maxz: ~D~%" (-> obj temp-maxz)) + (format #t "~1Ttex1: ~D~%" (-> obj tex1)) + (format #t "~1Ttex1-near: ~D~%" (-> obj tex1-near)) + (format #t "~1Tcorner00: ~f~%" (-> obj corner00)) + (format #t "~1Tcorner01: ~f~%" (-> obj corner01)) + (format #t "~1Tcorner10: ~f~%" (-> obj corner10)) + (format #t "~1Tcorner11: ~f~%" (-> obj corner11)) + (format #t "~1Tframe-num: ~f~%" (-> obj frame-num)) + (format #t "~1Tframe-speed: ~f~%" (-> obj frame-speed)) + (format #t "~1Tframe-num2: ~f~%" (-> obj frame-num2)) + (format #t "~1Tframe-speed2: ~f~%" (-> obj frame-speed2)) + (format #t "~1Tcloud-interp: ~f~%" (-> obj constant w)) + (format #t "~1Tscales: #~%" (-> obj scales)) + (format #t "~1Tmask-hi: #~%" (-> obj mask-hi)) + (format #t "~1Tmask-lo: #~%" (-> obj mask-lo)) + (format #t "~1Tlights: #~%" (-> obj lights)) + (format #t "~1Tuv-scroll-0: #~%" (-> obj uv-scroll-0)) + (format #t "~1Tuv-scroll-1: #~%" (-> obj uv-scroll-1)) + (format #t "~1Tst-scroll: #~%" (-> obj st-scroll)) + (format #t "~1Twait-to-vu0: ~D~%" (-> obj wait-to-vu0)) + (label cfg-4) + obj + ) + +;; definition for symbol *ocean-map*, type ocean-map +(define *ocean-map* (the-as ocean-map #f)) + +;; definition for symbol *ocean*, type ocean +(define *ocean* (new 'static 'ocean + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x508b400000008001 #x53531) + ) + :sprite-tmpl2 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x3023400000008001 #x551) + ) + :sprite-tmpl3 (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x50ab400000008001 #x53531) + ) + :adgif-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x1000000000008005 #xe) + ) + :line-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x141 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x141 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x5008c00000008040 #x52521) + ) + :sun-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x502b400000008001 #x52521) + ) + :erase-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x3003400000008001 #x551) + ) + :haze-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x45 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x45 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x4026400000008011 #x4141) + ) + :cloud-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x25 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x25 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x602e400000008006 #x421421) + ) + :clut-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x41 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x41 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x800000000008040 #x0) + ) + :constant (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :haze-verts (new 'static 'inline-array vector4w 32 + (new 'static 'vector4w :x #x400 :y #x5c0 :z #xffffff) + (new 'static 'vector4w :x #x400 :y #x600 :z #xffffff) + (new 'static 'vector4w :x #x4a0 :y #x590 :z #xffffff) + (new 'static 'vector4w :x #x4c0 :y #x5e0 :z #xffffff) + (new 'static 'vector4w :x #x530 :y #x530 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x560 :z #xffffff) + (new 'static 'vector4w :x #x590 :y #x4a0 :z #xffffff) + (new 'static 'vector4w :x #x5e0 :y #x4c0 :z #xffffff) + (new 'static 'vector4w :x #x5c0 :y #x3f0 :z #xffffff) + (new 'static 'vector4w :x #x600 :y #x3f0 :z #xffffff) + (new 'static 'vector4w :x #x590 :y #x350 :z #xffffff) + (new 'static 'vector4w :x #x5e0 :y #x330 :z #xffffff) + (new 'static 'vector4w :x #x530 :y #x2c0 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x4a0 :y #x260 :z #xffffff) + (new 'static 'vector4w :x #x4c0 :y #x210 :z #xffffff) + (new 'static 'vector4w :x #x3f0 :y #x240 :z #xffffff) + (new 'static 'vector4w :x #x3f0 :y #x1f0 :z #xffffff) + (new 'static 'vector4w :x #x350 :y #x260 :z #xffffff) + (new 'static 'vector4w :x #x330 :y #x210 :z #xffffff) + (new 'static 'vector4w :x #x2c0 :y #x2c0 :z #xffffff) + (new 'static 'vector4w :x #x290 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x260 :y #x350 :z #xffffff) + (new 'static 'vector4w :x #x210 :y #x330 :z #xffffff) + (new 'static 'vector4w :x #x240 :y #x400 :z #xffffff) + (new 'static 'vector4w :x #x1f0 :y #x400 :z #xffffff) + (new 'static 'vector4w :x #x260 :y #x4a0 :z #xffffff) + (new 'static 'vector4w :x #x210 :y #x4c0 :z #xffffff) + (new 'static 'vector4w :x #x2c0 :y #x530 :z #xffffff) + (new 'static 'vector4w :x #x290 :y #x560 :z #xffffff) + (new 'static 'vector4w :x #x350 :y #x590 :z #xffffff) + (new 'static 'vector4w :x #x330 :y #x5e0 :z #xffffff) + ) + :cloud-verts (new 'static 'inline-array vector4w 36 + (new 'static 'vector4w :x #x290 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x310 :y #x230 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x200 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x200 :z #xffffff) + (new 'static 'vector4w :x #x4e0 :y #x230 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x290 :z #xffffff) + (new 'static 'vector4w :x #x230 :y #x310 :z #xffffff) + (new 'static 'vector4w :x #x300 :y #x300 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x2b0 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x2b0 :z #xffffff) + (new 'static 'vector4w :x #x4f0 :y #x300 :z #xffffff) + (new 'static 'vector4w :x #x5c0 :y #x310 :z #xffffff) + (new 'static 'vector4w :x #x200 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x2b0 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x380 :y #x380 :z #xffffff) + (new 'static 'vector4w :x #x470 :y #x380 :z #xffffff) + (new 'static 'vector4w :x #x540 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x5f0 :y #x3a0 :z #xffffff) + (new 'static 'vector4w :x #x200 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x2b0 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x380 :y #x470 :z #xffffff) + (new 'static 'vector4w :x #x470 :y #x470 :z #xffffff) + (new 'static 'vector4w :x #x540 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x5f0 :y #x450 :z #xffffff) + (new 'static 'vector4w :x #x230 :y #x4e0 :z #xffffff) + (new 'static 'vector4w :x #x300 :y #x4f0 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x540 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x540 :z #xffffff) + (new 'static 'vector4w :x #x4f0 :y #x4f0 :z #xffffff) + (new 'static 'vector4w :x #x5c0 :y #x4e0 :z #xffffff) + (new 'static 'vector4w :x #x290 :y #x560 :z #xffffff) + (new 'static 'vector4w :x #x310 :y #x5c0 :z #xffffff) + (new 'static 'vector4w :x #x3a0 :y #x5f0 :z #xffffff) + (new 'static 'vector4w :x #x450 :y #x5f0 :z #xffffff) + (new 'static 'vector4w :x #x4e0 :y #x5c0 :z #xffffff) + (new 'static 'vector4w :x #x560 :y #x560 :z #xffffff) + ) + :cloud-nrms (new 'static 'inline-array vector 36 + (new 'static 'vector :x -0.4999 :y 0.7071 :z -0.5) + (new 'static 'vector :x -0.3209 :y 0.7071 :z -0.63) + (new 'static 'vector :x -0.1105 :y 0.7071 :z -0.6984) + (new 'static 'vector :x 0.1105 :y 0.7071 :z -0.6983) + (new 'static 'vector :x 0.321 :y 0.7071 :z -0.63) + (new 'static 'vector :x 0.5 :y 0.7071 :z -0.4999) + (new 'static 'vector :x -0.63 :y 0.7071 :z -0.321) + (new 'static 'vector :x -0.3921 :y 0.832 :z -0.3922) + (new 'static 'vector :x -0.1434 :y 0.832 :z -0.5358) + (new 'static 'vector :x 0.1435 :y 0.832 :z -0.5357) + (new 'static 'vector :x 0.3922 :y 0.832 :z -0.3921) + (new 'static 'vector :x 0.63 :y 0.7071 :z -0.3209) + (new 'static 'vector :x -0.6983 :y 0.7071 :z -0.1106) + (new 'static 'vector :x -0.5357 :y 0.832 :z -0.1435) + (new 'static 'vector :x -0.334 :y 0.8814 :z -0.334) + (new 'static 'vector :x 0.334 :y 0.8814 :z -0.334) + (new 'static 'vector :x 0.5358 :y 0.832 :z -0.1434) + (new 'static 'vector :x 0.6984 :y 0.7071 :z -0.1105) + (new 'static 'vector :x -0.6984 :y 0.7071 :z 0.1105) + (new 'static 'vector :x -0.5358 :y 0.832 :z 0.1435) + (new 'static 'vector :x -0.334 :y 0.8814 :z 0.334) + (new 'static 'vector :x 0.334 :y 0.8814 :z 0.334) + (new 'static 'vector :x 0.5357 :y 0.832 :z 0.1435) + (new 'static 'vector :x 0.6983 :y 0.7071 :z 0.1105) + (new 'static 'vector :x -0.63 :y 0.7071 :z 0.321) + (new 'static 'vector :x -0.3922 :y 0.832 :z 0.3921) + (new 'static 'vector :x -0.1435 :y 0.832 :z 0.5357) + (new 'static 'vector :x 0.1435 :y 0.832 :z 0.5358) + (new 'static 'vector :x 0.3922 :y 0.832 :z 0.3922) + (new 'static 'vector :x 0.63 :y 0.7071 :z 0.321) + (new 'static 'vector :x -0.5 :y 0.7071 :z 0.4999) + (new 'static 'vector :x -0.321 :y 0.7071 :z 0.63) + (new 'static 'vector :x -0.1106 :y 0.7071 :z 0.6983) + (new 'static 'vector :x 0.1105 :y 0.7071 :z 0.6984) + (new 'static 'vector :x 0.321 :y 0.7071 :z 0.63) + (new 'static 'vector :x 0.4999 :y 0.7071 :z 0.5) + ) + :color80808080 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80) + :color80808040 (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w 64) + :color80808000 (new 'static 'vector4w :x #x80 :y #x80 :z #x80) + :st0000 (new 'static 'vector :z 1.0) + :st0505 (new 'static 'vector :x 0.5 :y 0.5 :z 1.0) + :st1010 (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :uv44 (new 'static 'vector4w :x 64 :y 64) + :uv88 (new 'static 'vector4w :x #x80 :y #x80) + :uv1010 (new 'static 'vector4w :x #x100 :y #x100) + :uv2020 (new 'static 'vector4w :x #x200 :y #x200) + :uv4040 (new 'static 'vector4w :x #x400 :y #x400) + :uv8080 (new 'static 'vector4w :x #x800 :y #x800) + :xy00 (new 'static 'vector4w :z #xffffff) + :xy88 (new 'static 'vector4w :x #x80 :y #x80 :z #xffffff) + :xy1010 (new 'static 'vector4w :x #x100 :y #x100 :z #xffffff) + :xy2020 (new 'static 'vector4w :x #x200 :y #x200 :z #xffffff) + :xy4040 (new 'static 'vector4w :x #x400 :y #x400 :z #xffffff) + :xy8080 (new 'static 'vector4w :x #x800 :y #x800 :z #xffffff) + :cloud-alpha (new 'static 'array uint8 36 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + #x80 + ) + :tex1 #xeed00080178 + :tex1-near #xeed0008016c + :scales (new 'static 'vector :x -0.00012207031 :y 255.0 :z -0.00012207031 :w 128.0) + :mask-hi (new 'static 'vector4w :x -65536 :y -65536 :z -65536 :w -65536) + :mask-lo (new 'static 'vector4w :x #xffff :y #xffff :z #xffff :w #xffff) + ) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-trans-tables_REF.gc b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-trans-tables_REF.gc new file mode 100644 index 0000000000..bcc28f530c --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/ocean/ocean-trans-tables_REF.gc @@ -0,0 +1,1102 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *ocean-left-table*, type (pointer float) +(define *ocean-left-table* (new 'static 'array float 28 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-right-table*, type (pointer float) +(define *ocean-right-table* (new 'static 'array float 28 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-up-table*, type (pointer float) +(define *ocean-up-table* (new 'static 'array float 28 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-down-table*, type (pointer float) +(define *ocean-down-table* (new 'static 'array float 28 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-down-left-table*, type (pointer float) +(define *ocean-down-left-table* (new 'static 'array float 40 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-down-right-table*, type (pointer float) +(define *ocean-down-right-table* (new 'static 'array float 40 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-up-right-table*, type (pointer float) +(define *ocean-up-right-table* (new 'static 'array float 40 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 1.0 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-up-left-table*, type (pointer float) +(define *ocean-up-left-table* (new 'static 'array float 40 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-left-table*, type (pointer float) +(define *ocean-trans-left-table* (new 'static 'array float 44 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-right-table*, type (pointer float) +(define *ocean-trans-right-table* (new 'static 'array float 44 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-up-table*, type (pointer float) +(define *ocean-trans-up-table* (new 'static 'array float 44 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-down-table*, type (pointer float) +(define *ocean-trans-down-table* (new 'static 'array float 44 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-down-left-table*, type (pointer float) +(define *ocean-trans-down-left-table* (new 'static 'array float 72 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-down-right-table*, type (pointer float) +(define *ocean-trans-down-right-table* (new 'static 'array float 72 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-up-right-table*, type (pointer float) +(define *ocean-trans-up-right-table* (new 'static 'array float 72 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 1.0 + 0.0 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-up-left-table*, type (pointer float) +(define *ocean-trans-up-left-table* (new 'static 'array float 72 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.125 + 0.0 + 0.875 + 0.0 + 0.125 + 0.875 + 0.0 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.375 + 0.0 + 0.625 + 0.0 + 0.375 + 0.625 + 0.0 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.625 + 0.0 + 0.375 + 0.0 + 0.625 + 0.375 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.875 + 0.0 + 0.125 + 0.0 + 0.875 + 0.125 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + ) + ) + +;; definition for symbol *ocean-trans-corner-table*, type (inline-array vector4w-2) +(define *ocean-trans-corner-table* (the-as (inline-array vector4w-2) (new 'static 'array float 100 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5625 + 0.1875 + 0.1875 + 0.0625 + 0.375 + 0.375 + 0.125 + 0.125 + 0.1875 + 0.5625 + 0.0625 + 0.1875 + 0.0 + 0.75 + 0.0 + 0.25 + 0.5 + 0.0 + 0.5 + 0.0 + 0.375 + 0.125 + 0.375 + 0.125 + 0.25 + 0.25 + 0.25 + 0.25 + 0.125 + 0.375 + 0.125 + 0.375 + 0.0 + 0.5 + 0.0 + 0.5 + 0.25 + 0.0 + 0.75 + 0.0 + 0.1875 + 0.0625 + 0.5625 + 0.1875 + 0.125 + 0.125 + 0.375 + 0.375 + 0.0625 + 0.1875 + 0.1875 + 0.5625 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + ) + +;; definition for symbol *ocean-trans-strip-array*, type (pointer float) +(define *ocean-trans-strip-array* (new 'static 'array float 160 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.0 + 0.5625 + 0.1875 + 0.1875 + 0.0625 + 0.5 + 0.5 + 0.0 + 0.0 + 0.375 + 0.375 + 0.125 + 0.125 + 0.25 + 0.75 + 0.0 + 0.0 + 0.1875 + 0.5625 + 0.0625 + 0.1875 + 0.0 + 1.0 + 0.0 + 0.0 + 0.0 + 0.75 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.5625 + 0.1875 + 0.1875 + 0.0625 + 0.375 + 0.125 + 0.375 + 0.125 + 0.375 + 0.375 + 0.125 + 0.125 + 0.25 + 0.25 + 0.25 + 0.25 + 0.1875 + 0.5625 + 0.0625 + 0.1875 + 0.125 + 0.375 + 0.125 + 0.375 + 0.0 + 0.75 + 0.0 + 0.25 + 0.0 + 0.5 + 0.0 + 0.5 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.375 + 0.125 + 0.375 + 0.125 + 0.1875 + 0.0625 + 0.5625 + 0.1875 + 0.25 + 0.25 + 0.25 + 0.25 + 0.125 + 0.125 + 0.375 + 0.375 + 0.125 + 0.375 + 0.125 + 0.375 + 0.0625 + 0.1875 + 0.1875 + 0.5625 + 0.0 + 0.5 + 0.0 + 0.5 + 0.0 + 0.25 + 0.0 + 0.75 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + 0.0 + 0.1875 + 0.0625 + 0.5625 + 0.1875 + 0.0 + 0.0 + 0.75 + 0.25 + 0.125 + 0.125 + 0.375 + 0.375 + 0.0 + 0.0 + 0.5 + 0.5 + 0.0625 + 0.1875 + 0.1875 + 0.5625 + 0.0 + 0.0 + 0.25 + 0.75 + 0.0 + 0.25 + 0.0 + 0.75 + 0.0 + 0.0 + 0.0 + 1.0 + ) + ) + +;; definition for symbol *ocean-trans-st-table*, type (inline-array vector) +(define *ocean-trans-st-table* (new 'static 'inline-array vector 4 + (new 'static 'vector :z 1.0) + (new 'static 'vector :x 1.0 :z 1.0) + (new 'static 'vector :y 1.0 :z 1.0) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc new file mode 100644 index 0000000000..63a2b2723e --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/shrub/shrubbery-h_REF.gc @@ -0,0 +1,509 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type billboard +(deftype billboard (drawable) + ((flat adgif-shader :inline :offset-assert 32) + ) + :method-count-assert 17 + :size-assert #x70 + :flag-assert #x1100000070 + ) + +;; definition for method 3 of type billboard +(defmethod inspect billboard ((obj billboard)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tflat: #~%" (-> obj flat)) + (label cfg-4) + obj + ) + +;; definition of type shrub-view-data +(deftype shrub-view-data (structure) + ((data uint128 3 :offset-assert 0) + (texture-giftag gs-gif-tag :inline :offset 0) + (consts vector :inline :offset 16) + (fog-clamp vector :inline :offset 32) + (tex-start-ptr int32 :offset 16) + (gifbufsum float :offset 16) + (mtx-buf-ptr int32 :offset 20) + (exp23 float :offset 20) + (fog-0 float :offset 24) + (fog-1 float :offset 28) + (fog-min float :offset 32) + (fog-max float :offset 36) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type shrub-view-data +(defmethod inspect shrub-view-data ((obj shrub-view-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'shrub-view-data) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "~1Ttexture-giftag: #~%" (-> obj data)) + (format #t "~1Tconsts: #~%" (-> obj consts)) + (format #t "~1Tfog-clamp: #~%" (-> obj fog-clamp)) + (format #t "~1Ttex-start-ptr: ~D~%" (-> obj consts x)) + (format #t "~1Tgifbufsum: ~f~%" (-> obj consts x)) + (format #t "~1Tmtx-buf-ptr: ~D~%" (-> obj consts y)) + (format #t "~1Texp23: ~f~%" (-> obj consts y)) + (format #t "~1Tfog-0: ~f~%" (-> obj consts z)) + (format #t "~1Tfog-1: ~f~%" (-> obj consts w)) + (format #t "~1Tfog-min: ~f~%" (-> obj fog-clamp x)) + (format #t "~1Tfog-max: ~f~%" (-> obj fog-clamp y)) + (label cfg-4) + obj + ) + +;; definition of type shrubbery +(deftype shrubbery (drawable) + ((textures (inline-array adgif-shader) :offset 4) + (header qword :offset 8) + (obj-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (obj uint32 :offset 16) + (vtx uint32 :offset 20) + (col uint32 :offset 24) + (stq uint32 :offset 28) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type shrubbery +(defmethod inspect shrubbery ((obj shrubbery)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (&-> obj obj)) + (format #t "~1Ttextures: #x~X~%" (-> obj textures)) + (format #t "~1Theader: #~%" (-> obj header)) + (format #t "~1Tobj-qwc: ~D~%" (-> obj obj-qwc)) + (format #t "~1Tvtx-qwc: ~D~%" (-> obj vtx-qwc)) + (format #t "~1Tcol-qwc: ~D~%" (-> obj col-qwc)) + (format #t "~1Tstq-qwc: ~D~%" (-> obj stq-qwc)) + (format #t "~1Tobj: #x~X~%" (-> obj obj)) + (format #t "~1Tvtx: #x~X~%" (-> obj vtx)) + (format #t "~1Tcol: #x~X~%" (-> obj col)) + (format #t "~1Tstq: #x~X~%" (-> obj stq)) + (label cfg-4) + obj + ) + +;; definition of type instance-shrubbery +(deftype instance-shrubbery (instance) + ((flat-normal vector :inline :offset-assert 64) + (flat-hwidth float :offset 76) + (color uint32 :offset 8) + ) + :method-count-assert 17 + :size-assert #x50 + :flag-assert #x1100000050 + ) + +;; definition for method 3 of type instance-shrubbery +(defmethod inspect instance-shrubbery ((obj instance-shrubbery)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> obj bucket-index)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Twind-index: ~D~%" (-> obj wind-index)) + (format #t "~1Tflat-normal: #~%" (-> obj flat-normal)) + (format #t "~1Tflat-hwidth: ~f~%" (-> obj flat-normal w)) + (format #t "~1Tcolor: ~D~%" (-> obj color)) + (label cfg-4) + obj + ) + +;; definition of type drawable-inline-array-instance-shrub +(deftype drawable-inline-array-instance-shrub (drawable-inline-array) + ((data instance-shrubbery 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 112) + ) + :method-count-assert 17 + :size-assert #x74 + :flag-assert #x1100000074 + ) + +;; definition of type drawable-tree-instance-shrub +(deftype drawable-tree-instance-shrub (drawable-tree) + ((info prototype-array-shrub-info :offset 8) + (colors-added time-of-day-palette :offset 12) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type generic-shrub-fragment +(deftype generic-shrub-fragment (drawable) + ((textures (inline-array adgif-shader) :offset 4) + (vtx-cnt uint32 :offset 8) + (cnt-qwc uint8 :offset 12) + (vtx-qwc uint8 :offset 13) + (col-qwc uint8 :offset 14) + (stq-qwc uint8 :offset 15) + (cnt uint32 :offset 16) + (vtx uint32 :offset 20) + (col uint32 :offset 24) + (stq uint32 :offset 28) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type generic-shrub-fragment +(defmethod inspect generic-shrub-fragment ((obj generic-shrub-fragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Ttextures: #x~X~%" (-> obj textures)) + (format #t "~1Tvtx-cnt: ~D~%" (-> obj vtx-cnt)) + (format #t "~1Tcnt-qwc: ~D~%" (-> obj cnt-qwc)) + (format #t "~1Tvtx-qwc: ~D~%" (-> obj vtx-qwc)) + (format #t "~1Tcol-qwc: ~D~%" (-> obj col-qwc)) + (format #t "~1Tstq-qwc: ~D~%" (-> obj stq-qwc)) + (format #t "~1Tcnt: #x~X~%" (-> obj bsphere x)) + (format #t "~1Tvtx: #x~X~%" (-> obj bsphere y)) + (format #t "~1Tcol: #x~X~%" (-> obj bsphere z)) + (format #t "~1Tstq: #x~X~%" (-> obj bsphere w)) + (label cfg-4) + obj + ) + +;; definition of type prototype-shrubbery +(deftype prototype-shrubbery (drawable-inline-array) + ((data shrubbery 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +;; definition of type prototype-trans-shrubbery +(deftype prototype-trans-shrubbery (prototype-shrubbery) + () + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +;; definition of type prototype-generic-shrub +(deftype prototype-generic-shrub (drawable-group) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type shrubbery-matrix +(deftype shrubbery-matrix (structure) + ((mat matrix :inline :offset-assert 0) + (color qword :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type shrubbery-matrix +(defmethod inspect shrubbery-matrix ((obj shrubbery-matrix)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'shrubbery-matrix) + (format #t "~1Tmat: #~%" (-> obj mat)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (label cfg-4) + obj + ) + +;; definition for function shrubbery-login-post-texture +;; INFO: Used lq/sq +;; INFO: Return type mismatch symbol vs none. +(defun shrubbery-login-post-texture ((arg0 shrubbery)) + (let* ((v1-1 (-> arg0 header data 0)) + (a1-1 (the-as object (+ (the-as uint (-> arg0 header)) (* (+ (-> arg0 header data 1) 1) 16)))) + (a2-5 (the-as object (+ (the-as int a1-1) (* v1-1 64)))) + (a3-0 (the-as object (-> arg0 textures))) + ) + (dotimes (a0-1 (the-as int v1-1)) + (set! (-> (the-as qword a2-5) quad) (-> (the-as qword a3-0) quad)) + (let ((a2-6 (the-as object (+ (the-as int a2-5) 16))) + (a3-1 (the-as object (&+ (the-as pointer a3-0) 16))) + ) + (set! (-> (the-as qword a1-1) vector4w x) (the-as int (-> (the-as qword a3-1) data 0))) + (set! (-> (the-as qword a1-1) vector4w y) (the-as int (-> (the-as qword a3-1) data 1))) + (set! (-> (the-as qword a1-1) vector4w z) (the-as int (-> (the-as qword a3-1) data 2))) + (set! a1-1 (+ (the-as int a1-1) 16)) + (let ((a3-2 (the-as object (&+ (the-as pointer a3-1) 16)))) + (dotimes (t0-4 3) + (set! (-> (the-as qword a1-1) quad) (-> (the-as qword a3-2) quad)) + (set! a1-1 (+ (the-as int a1-1) 16)) + (set! a3-2 (&+ (the-as pointer a3-2) 16)) + ) + (set! (-> (the-as qword a2-6) quad) (-> (the-as qword a3-2) quad)) + (set! a2-5 (+ (the-as int a2-6) 16)) + (set! a3-0 (&+ (the-as pointer a3-2) 80)) + ) + ) + ) + ) + (none) + ) + +;; definition for symbol *shrub-state*, type int +(define *shrub-state* 0) + +;; definition of type shrub-near-packet +(deftype shrub-near-packet (structure) + ((matrix-tmpl dma-packet :inline :offset-assert 0) + (header-tmpl dma-packet :inline :offset-assert 16) + (stq-tmpl dma-packet :inline :offset-assert 32) + (color-tmpl dma-packet :inline :offset-assert 48) + (vertex-tmpl dma-packet :inline :offset-assert 64) + (mscal-tmpl dma-packet :inline :offset-assert 80) + (init-tmpl dma-packet :inline :offset-assert 96) + (init-data uint32 8 :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x90 + :flag-assert #x900000090 + ) + +;; definition for method 3 of type shrub-near-packet +(defmethod inspect shrub-near-packet ((obj shrub-near-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'shrub-near-packet) + (format #t "~1Tmatrix-tmpl: #~%" (-> obj matrix-tmpl)) + (format #t "~1Theader-tmpl: #~%" (-> obj header-tmpl)) + (format #t "~1Tstq-tmpl: #~%" (-> obj stq-tmpl)) + (format #t "~1Tcolor-tmpl: #~%" (-> obj color-tmpl)) + (format #t "~1Tvertex-tmpl: #~%" (-> obj vertex-tmpl)) + (format #t "~1Tmscal-tmpl: #~%" (-> obj mscal-tmpl)) + (format #t "~1Tinit-tmpl: #~%" (-> obj init-tmpl)) + (format #t "~1Tinit-data[8] @ #x~X~%" (-> obj init-data)) + (label cfg-4) + obj + ) + +;; definition of type instance-shrub-work +(deftype instance-shrub-work (structure) + ((dummy qword 3 :inline :offset-assert 0) + (chaina qword 8 :inline :offset-assert 48) + (chainb qword 8 :inline :offset-assert 176) + (colors rgba 1024 :offset-assert 304) + (matrix-tmpl qword 20 :inline :offset-assert 4400) + (count-tmpl vector4w 20 :inline :offset-assert 4720) + (mscalf-tmpl dma-packet :inline :offset-assert 5040) + (mscalf-ret-tmpl dma-packet :inline :offset-assert 5056) + (adgif-tmpl dma-gif-packet :inline :offset-assert 5072) + (billboard-tmpl dma-gif-packet :inline :offset-assert 5104) + (billboard-const vector :inline :offset-assert 5136) + (shrub-near-packets shrub-near-packet 6 :inline :offset-assert 5152) + (dma-ref dma-packet :inline :offset-assert 6016) + (dma-end dma-packet :inline :offset-assert 6032) + (wind-const vector :inline :offset-assert 6048) + (constants vector :inline :offset-assert 6064) + (color-constant vector4w :inline :offset-assert 6080) + (hmge-d vector :inline :offset-assert 6096) + (hvdf-offset vector :inline :offset-assert 6112) + (wind-force vector :inline :offset-assert 6128) + (color vector :inline :offset-assert 6144) + (bb-color vector :inline :offset-assert 6160) + (min-dist vector :inline :offset-assert 6176) + (temp-vec vector :inline :offset-assert 6192) + (guard-plane plane 4 :inline :offset-assert 6208) + (plane plane 4 :inline :offset-assert 6272) + (last uint32 4 :offset-assert 6336) + (next uint32 4 :offset-assert 6352) + (count uint16 4 :offset-assert 6368) + (mod-count uint16 4 :offset-assert 6376) + (wind-vectors uint32 :offset-assert 6384) + (instance-ptr uint32 :offset-assert 6388) + (chain-ptr uint32 :offset-assert 6392) + (chain-ptr-next uint32 :offset-assert 6396) + (stack-ptr uint32 :offset-assert 6400) + (bucket-ptr uint32 :offset-assert 6404) + (src-ptr uint32 :offset-assert 6408) + (to-spr uint32 :offset-assert 6412) + (from-spr uint32 :offset-assert 6416) + (shrub-count uint32 :offset-assert 6420) + (pad uint32 :offset-assert 6424) + (node uint32 6 :offset-assert 6428) + (length uint32 6 :offset-assert 6452) + (prototypes uint32 :offset-assert 6476) + (pad2 uint32 :offset-assert 6480) + (start-bank uint8 20 :offset-assert 6484) + (buffer-index uint32 :offset-assert 6504) + (current-spr uint32 :offset-assert 6508) + (current-mem uint32 :offset-assert 6512) + (current-shrub-near-packet uint32 :offset-assert 6516) + (current-shrub-near-trans-packet uint32 :offset-assert 6520) + (pad3 uint32 :offset-assert 6524) + (dma-buffer basic :offset-assert 6528) + (near-last uint32 :offset-assert 6532) + (near-next uint32 :offset-assert 6536) + (near-count uint32 :offset-assert 6540) + (near-trans-last uint32 :offset-assert 6544) + (near-trans-next uint32 :offset-assert 6548) + (near-trans-count uint32 :offset-assert 6552) + (last-shrubs uint32 :offset-assert 6556) + (chains uint32 :offset-assert 6560) + (flags uint32 :offset-assert 6564) + (node-count uint32 :offset-assert 6568) + (inst-count uint32 :offset-assert 6572) + (wait-from-spr uint32 :offset-assert 6576) + (wait-to-spr uint32 :offset-assert 6580) + (texture-dists uint32 :offset-assert 6584) + ) + :method-count-assert 9 + :size-assert #x19bc + :flag-assert #x9000019bc + ) + +;; definition for method 3 of type instance-shrub-work +(defmethod inspect instance-shrub-work ((obj instance-shrub-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'instance-shrub-work) + (format #t "~1Tdummy[3] @ #x~X~%" (-> obj dummy)) + (format #t "~1Tchaina[8] @ #x~X~%" (-> obj chaina)) + (format #t "~1Tchainb[8] @ #x~X~%" (-> obj chainb)) + (format #t "~1Tcolors[1024] @ #x~X~%" (-> obj colors)) + (format #t "~1Tmatrix-tmpl[20] @ #x~X~%" (-> obj matrix-tmpl)) + (format #t "~1Tcount-tmpl[20] @ #x~X~%" (-> obj count-tmpl)) + (format #t "~1Tmscalf-tmpl: #~%" (-> obj mscalf-tmpl)) + (format #t "~1Tmscalf-ret-tmpl: #~%" (-> obj mscalf-ret-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tbillboard-tmpl: #~%" (-> obj billboard-tmpl)) + (format #t "~1Tbillboard-const: #~%" (-> obj billboard-const)) + (format #t "~1Tshrub-near-packets[6] @ #x~X~%" (-> obj shrub-near-packets)) + (format #t "~1Tdma-ref: #~%" (-> obj dma-ref)) + (format #t "~1Tdma-end: #~%" (-> obj dma-end)) + (format #t "~1Twind-const: #~%" (-> obj wind-const)) + (format #t "~1Tconstants: #~%" (-> obj constants)) + (format #t "~1Tcolor-constant: #~%" (-> obj color-constant)) + (format #t "~1Thmge-d: #~%" (-> obj hmge-d)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Twind-force: #~%" (-> obj wind-force)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tbb-color: #~%" (-> obj bb-color)) + (format #t "~1Tmin-dist: #~%" (-> obj min-dist)) + (format #t "~1Ttemp-vec: #~%" (-> obj temp-vec)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) + (format #t "~1Tplane[4] @ #x~X~%" (-> obj plane)) + (format #t "~1Tlast[4] @ #x~X~%" (-> obj last)) + (format #t "~1Tnext[4] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount[4] @ #x~X~%" (-> obj count)) + (format #t "~1Tmod-count[4] @ #x~X~%" (-> obj mod-count)) + (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) + (format #t "~1Tinstance-ptr: ~D~%" (-> obj instance-ptr)) + (format #t "~1Tchain-ptr: ~D~%" (-> obj chain-ptr)) + (format #t "~1Tchain-ptr-next: ~D~%" (-> obj chain-ptr-next)) + (format #t "~1Tstack-ptr: ~D~%" (-> obj stack-ptr)) + (format #t "~1Tbucket-ptr: ~D~%" (-> obj bucket-ptr)) + (format #t "~1Tsrc-ptr: ~D~%" (-> obj src-ptr)) + (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> obj from-spr)) + (format #t "~1Tshrub-count: ~D~%" (-> obj shrub-count)) + (format #t "~1Tstack-ptr: ~D~%" (-> obj stack-ptr)) + (format #t "~1Tnode[6] @ #x~X~%" (-> obj node)) + (format #t "~1Tlength[6] @ #x~X~%" (-> obj length)) + (format #t "~1Tprototypes: ~D~%" (-> obj prototypes)) + (format #t "~1Tbucket-ptr: ~D~%" (-> obj bucket-ptr)) + (format #t "~1Tstart-bank[20] @ #x~X~%" (-> obj start-bank)) + (format #t "~1Tbuffer-index: ~D~%" (-> obj buffer-index)) + (format #t "~1Tcurrent-spr: ~D~%" (-> obj current-spr)) + (format #t "~1Tcurrent-mem: ~D~%" (-> obj current-mem)) + (format #t "~1Tcurrent-shrub-near-packet: ~D~%" (-> obj current-shrub-near-packet)) + (format #t "~1Tcurrent-shrub-near-trans-packet: ~D~%" (-> obj current-shrub-near-trans-packet)) + (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) + (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) + (format #t "~1Tnear-last: ~D~%" (-> obj near-last)) + (format #t "~1Tnear-next: ~D~%" (-> obj near-next)) + (format #t "~1Tnear-count: ~D~%" (-> obj near-count)) + (format #t "~1Tnear-trans-last: ~D~%" (-> obj near-trans-last)) + (format #t "~1Tnear-trans-next: ~D~%" (-> obj near-trans-next)) + (format #t "~1Tnear-trans-count: ~D~%" (-> obj near-trans-count)) + (format #t "~1Tlast-shrubs: ~D~%" (-> obj last-shrubs)) + (format #t "~1Tchains: ~D~%" (-> obj chains)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) + (format #t "~1Tinst-count: ~D~%" (-> obj inst-count)) + (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) + (format #t "~1Ttexture-dists: #x~X~%" (-> obj texture-dists)) + (label cfg-4) + obj + ) + +;; definition of type instance-shrub-dma +(deftype instance-shrub-dma (structure) + ((instancea uint128 325 :offset-assert 0) + (instanceb uint128 325 :offset-assert 5200) + (outa uint128 128 :offset-assert 10400) + (outb uint128 128 :offset-assert 12448) + ) + :method-count-assert 9 + :size-assert #x38a0 + :flag-assert #x9000038a0 + ) + +;; definition for method 3 of type instance-shrub-dma +(defmethod inspect instance-shrub-dma ((obj instance-shrub-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'instance-shrub-dma) + (format #t "~1Tinstancea[325] @ #x~X~%" (-> obj instancea)) + (format #t "~1Tinstanceb[325] @ #x~X~%" (-> obj instanceb)) + (format #t "~1Touta[128] @ #x~X~%" (-> obj outa)) + (format #t "~1Toutb[128] @ #x~X~%" (-> obj outb)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc new file mode 100644 index 0000000000..7957bc7fec --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/sky/sky-h_REF.gc @@ -0,0 +1,537 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sky-color-hour +(deftype sky-color-hour (structure) + ((snapshot1 int32 :offset-assert 0) + (snapshot2 int32 :offset-assert 4) + (morph-start float :offset-assert 8) + (morph-end float :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type sky-color-hour +(defmethod inspect sky-color-hour ((obj sky-color-hour)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-color-hour) + (format #t "~1Tsnapshot1: ~D~%" (-> obj snapshot1)) + (format #t "~1Tsnapshot2: ~D~%" (-> obj snapshot2)) + (format #t "~1Tmorph-start: ~f~%" (-> obj morph-start)) + (format #t "~1Tmorph-end: ~f~%" (-> obj morph-end)) + (label cfg-4) + obj + ) + +;; definition of type sky-color-day +(deftype sky-color-day (structure) + ((hour sky-color-hour 24 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x180 + :flag-assert #x900000180 + ) + +;; definition for method 3 of type sky-color-day +(defmethod inspect sky-color-day ((obj sky-color-day)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-color-day) + (format #t "~1Thour[24] @ #x~X~%" (-> obj hour)) + (label cfg-4) + obj + ) + +;; definition of type sky-sun-data +(deftype sky-sun-data (structure) + ((data uint128 4 :offset-assert 0) + (pos vector :inline :offset 0) + (r-sun float :offset 16) + (r-halo float :offset 20) + (r-aurora float :offset 24) + (c-sun-start rgba :offset 32) + (c-sun-end rgba :offset 48) + (c-halo-start rgba :offset 36) + (c-halo-end rgba :offset 52) + (c-aurora-start rgba :offset 40) + (c-aurora-end rgba :offset 56) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type sky-sun-data +(defmethod inspect sky-sun-data ((obj sky-sun-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-sun-data) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tpos: #~%" (-> obj data)) + (format #t "~1Tr-sun: ~f~%" (-> obj r-sun)) + (format #t "~1Tr-halo: ~f~%" (-> obj r-halo)) + (format #t "~1Tr-aurora: ~f~%" (-> obj r-aurora)) + (format #t "~1Tc-sun-start: ~D~%" (-> obj c-sun-start)) + (format #t "~1Tc-sun-end: ~D~%" (-> obj c-sun-end)) + (format #t "~1Tc-halo-start: ~D~%" (-> obj c-halo-start)) + (format #t "~1Tc-halo-end: ~D~%" (-> obj c-halo-end)) + (format #t "~1Tc-aurora-start: ~D~%" (-> obj c-aurora-start)) + (format #t "~1Tc-aurora-end: ~D~%" (-> obj c-aurora-end)) + (label cfg-4) + obj + ) + +;; definition of type sky-moon-data +(deftype sky-moon-data (structure) + ((data uint128 2 :offset-assert 0) + (pos vector :inline :offset 0) + (scale vector :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type sky-moon-data +(defmethod inspect sky-moon-data ((obj sky-moon-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-moon-data) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tpos: #~%" (-> obj data)) + (format #t "~1Tscale: #~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; definition of type sky-orbit +(deftype sky-orbit (structure) + ((high-noon float :offset-assert 0) + (tilt float :offset-assert 4) + (rise float :offset-assert 8) + (dist float :offset-assert 12) + (min-halo float :offset-assert 16) + (max-halo float :offset-assert 20) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type sky-orbit +(defmethod inspect sky-orbit ((obj sky-orbit)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-orbit) + (format #t "~1Thigh-noon: ~f~%" (-> obj high-noon)) + (format #t "~1Ttilt: ~f~%" (-> obj tilt)) + (format #t "~1Trise: ~f~%" (-> obj rise)) + (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "~1Tmin-halo: ~f~%" (-> obj min-halo)) + (format #t "~1Tmax-halo: ~f~%" (-> obj max-halo)) + (label cfg-4) + obj + ) + +;; definition of type sky-upload-data +(deftype sky-upload-data (structure) + ((data uint128 10 :offset-assert 0) + (sun sky-sun-data 2 :inline :offset 0) + (moon sky-moon-data :inline :offset 128) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +;; definition for method 3 of type sky-upload-data +(defmethod inspect sky-upload-data ((obj sky-upload-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-upload-data) + (format #t "~1Tdata[10] @ #x~X~%" (-> obj data)) + (format #t "~1Tsun[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tmoon: #~%" (-> obj moon)) + (label cfg-4) + obj + ) + +;; definition of type sky-vertex +(deftype sky-vertex (structure) + ((pos vector :inline :offset-assert 0) + (stq vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type sky-vertex +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect sky-vertex ((obj sky-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-vertex) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tstq: #~%" (-> obj stq)) + (format #t "~1Tcol: #~%" (-> obj col)) + (label cfg-4) + obj + ) + +;; definition for method 3 of type sky-vertex +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect sky-vertex ((obj sky-vertex)) + (format #t "sky-vertex [~X]:~%" obj) + (format #t "~TPos: [~F ~F ~F ~F]~%" (-> obj pos x) (-> obj pos y) (-> obj pos z) (-> obj pos w)) + (format #t "~TSTQ: [~F ~F ~F ~F]~%" (-> obj stq x) (-> obj stq y) (-> obj stq z) (-> obj stq w)) + (format #t "~TCol: [~F ~F ~F ~F]~%" (-> obj col x) (-> obj col y) (-> obj col z) (-> obj col w)) + obj + ) + +;; definition of type cloud-vertex +(deftype cloud-vertex (structure) + ((pos vector :inline :offset-assert 0) + (stq vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + (nrm vector :inline :offset-assert 48) + (stq2 vector :inline :offset-assert 64) + (col2 vector :inline :offset-assert 80) + (nrm2 vector :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type cloud-vertex +(defmethod inspect cloud-vertex ((obj cloud-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cloud-vertex) + (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) + (format #t "~1Tstq: ~`vector`P~%" (-> obj stq)) + (format #t "~1Tcol: ~`vector`P~%" (-> obj col)) + (format #t "~1Tnrm: ~`vector`P~%" (-> obj nrm)) + (format #t "~1Tstq2: ~`vector`P~%" (-> obj stq2)) + (format #t "~1Tcol2: ~`vector`P~%" (-> obj col2)) + (format #t "~1Tnrm2: ~`vector`P~%" (-> obj nrm2)) + (label cfg-4) + obj + ) + +;; definition of type cloud-vert-array +(deftype cloud-vert-array (structure) + ((data cloud-vertex 100 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x2bc0 + :flag-assert #x900002bc0 + ) + +;; definition for method 3 of type cloud-vert-array +(defmethod inspect cloud-vert-array ((obj cloud-vert-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cloud-vert-array) + (format #t "~1Tdata[100] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type haze-vertex +(deftype haze-vertex (structure) + ((pos vector :inline :offset-assert 0) + (nrm vector :inline :offset-assert 16) + (col vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type haze-vertex +(defmethod inspect haze-vertex ((obj haze-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'haze-vertex) + (format #t "~1Tpos: ~`vector`P~%" (-> obj pos)) + (format #t "~1Tnrm: ~`vector`P~%" (-> obj nrm)) + (format #t "~1Tcol: ~`vector`P~%" (-> obj col)) + (label cfg-4) + obj + ) + +;; definition of type haze-vert-array +(deftype haze-vert-array (structure) + ((data haze-vertex 36 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x6c0 + :flag-assert #x9000006c0 + ) + +;; definition for method 3 of type haze-vert-array +(defmethod inspect haze-vert-array ((obj haze-vert-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'haze-vert-array) + (format #t "~1Tdata[36] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type cloud-lights +(deftype cloud-lights (structure) + ((sun0-normal vector :inline :offset-assert 0) + (sun1-normal vector :inline :offset-assert 16) + (moon-normal vector :inline :offset-assert 32) + (ambi-color vector :inline :offset-assert 48) + (ambi-color-lower vector :inline :offset-assert 64) + (sun0-color vector :inline :offset-assert 80) + (sun1-color vector :inline :offset-assert 96) + (moon-color vector :inline :offset-assert 112) + (sun0-color-lower vector :inline :offset-assert 128) + (sun0-scale float :offset-assert 144) + (sun1-scale float :offset-assert 148) + (moon-scale float :offset-assert 152) + ) + :method-count-assert 9 + :size-assert #x9c + :flag-assert #x90000009c + ) + +;; definition for method 3 of type cloud-lights +(defmethod inspect cloud-lights ((obj cloud-lights)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cloud-lights) + (format #t "~1Tsun0-normal: #~%" (-> obj sun0-normal)) + (format #t "~1Tsun1-normal: #~%" (-> obj sun1-normal)) + (format #t "~1Tmoon-normal: #~%" (-> obj moon-normal)) + (format #t "~1Tambi-color: #~%" (-> obj ambi-color)) + (format #t "~1Tambi-color-lower: #~%" (-> obj ambi-color-lower)) + (format #t "~1Tsun0-color: #~%" (-> obj sun0-color)) + (format #t "~1Tsun1-color: #~%" (-> obj sun1-color)) + (format #t "~1Tmoon-color: #~%" (-> obj moon-color)) + (format #t "~1Tsun0-color-lower: #~%" (-> obj sun0-color-lower)) + (format #t "~1Tsun0-scale: ~f~%" (-> obj sun0-scale)) + (format #t "~1Tsun1-scale: ~f~%" (-> obj sun1-scale)) + (format #t "~1Tmoon-scale: ~f~%" (-> obj moon-scale)) + (label cfg-4) + obj + ) + +;; definition of type haze-lights +(deftype haze-lights (structure) + ((sun0-normal vector :inline :offset-assert 0) + (sun1-normal vector :inline :offset-assert 16) + (moon-normal vector :inline :offset-assert 32) + (ambi-color vector :inline :offset-assert 48) + (sun0-color vector :inline :offset-assert 64) + (sun1-color vector :inline :offset-assert 80) + (moon-color vector :inline :offset-assert 96) + (sun0-scale float :offset-assert 112) + (sun1-scale float :offset-assert 116) + (moon-scale float :offset-assert 120) + ) + :method-count-assert 9 + :size-assert #x7c + :flag-assert #x90000007c + ) + +;; definition for method 3 of type haze-lights +(defmethod inspect haze-lights ((obj haze-lights)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'haze-lights) + (format #t "~1Tsun0-normal: #~%" (-> obj sun0-normal)) + (format #t "~1Tsun1-normal: #~%" (-> obj sun1-normal)) + (format #t "~1Tmoon-normal: #~%" (-> obj moon-normal)) + (format #t "~1Tambi-color: #~%" (-> obj ambi-color)) + (format #t "~1Tsun0-color: #~%" (-> obj sun0-color)) + (format #t "~1Tsun1-color: #~%" (-> obj sun1-color)) + (format #t "~1Tmoon-color: #~%" (-> obj moon-color)) + (format #t "~1Tsun0-scale: ~f~%" (-> obj sun0-scale)) + (format #t "~1Tsun1-scale: ~f~%" (-> obj sun1-scale)) + (format #t "~1Tmoon-scale: ~f~%" (-> obj moon-scale)) + (label cfg-4) + obj + ) + +;; definition of type sky-work +(deftype sky-work (structure) + ((adgif-tmpl dma-gif-packet :inline :offset-assert 0) + (draw-tmpl dma-gif-packet :inline :offset-assert 32) + (draw-tmpl2 dma-gif-packet :inline :offset-assert 64) + (fog-tmpl dma-gif-packet :inline :offset-assert 96) + (blend-tmpl dma-gif-packet :inline :offset-assert 128) + (sprite-tmpl dma-gif-packet :inline :offset-assert 160) + (sprite-tmpl2 dma-gif-packet :inline :offset-assert 192) + (sun-coords vector 2 :inline :offset-assert 224) + (green-coords vector 2 :inline :offset-assert 256) + (moon0-coords vector 2 :inline :offset-assert 288) + (moon1-coords vector 2 :inline :offset-assert 320) + (moon2-coords vector 2 :inline :offset-assert 352) + (star-coords vector 2 :inline :offset-assert 384) + (sun-colors vector 2 :inline :offset-assert 416) + (green-colors vector 2 :inline :offset-assert 448) + (moon-colors vector 3 :inline :offset-assert 480) + (star-colors vector 16 :inline :offset-assert 528) + (st-coords vector 2 :inline :offset-assert 784) + (random vector 8 :inline :offset-assert 816) + (giftag-base dma-gif :inline :offset-assert 944) + (giftag-haze dma-gif :inline :offset-assert 960) + (giftag-roof dma-gif :inline :offset-assert 976) + (giftag-ocean dma-gif :inline :offset-assert 992) + (fog vector :inline :offset-assert 1008) + (sky float 8 :offset-assert 1024) + (time float :offset-assert 1056) + (off-s uint16 :offset-assert 1060) + (off-t uint16 :offset-assert 1062) + (orbit sky-orbit 3 :inline :offset-assert 1064) + (upload-data sky-upload-data :inline :offset-assert 1168) + (ambi-color vector :inline :offset-assert 1328) + (ambi-color-lower vector :inline :offset-assert 1344) + (sun0-color vector :inline :offset-assert 1360) + (sun1-color vector :inline :offset-assert 1376) + (moon-color vector :inline :offset-assert 1392) + (sun0-color-lower vector :inline :offset-assert 1408) + (cam-mat matrix :inline :offset-assert 1424) + (star-mat matrix :inline :offset-assert 1488) + (vec0 vector4w :inline :offset-assert 1552) + (vec1 vector4w :inline :offset-assert 1568) + (cloud-lights cloud-lights :inline :offset-assert 1584) + (haze-lights haze-lights :inline :offset-assert 1744) + (buf basic :offset-assert 1868) + (draw-vortex basic :offset-assert 1872) + (stars vector 512 :inline :offset-assert 1888) + ) + :method-count-assert 37 + :size-assert #x2760 + :flag-assert #x2500002760 + (:methods + (sky-work-method-9 () none 9) + (sky-work-method-10 () none 10) + (sky-work-method-11 () none 11) + (sky-work-method-12 () none 12) + (sky-work-method-13 () none 13) + (sky-work-method-14 () none 14) + (sky-work-method-15 () none 15) + (sky-work-method-16 () none 16) + (sky-work-method-17 () none 17) + (sky-work-method-18 () none 18) + (sky-work-method-19 () none 19) + (sky-work-method-20 () none 20) + (sky-work-method-21 () none 21) + (sky-work-method-22 () none 22) + (sky-work-method-23 () none 23) + (sky-work-method-24 () none 24) + (sky-work-method-25 () none 25) + (sky-work-method-26 () none 26) + (sky-work-method-27 () none 27) + (sky-work-method-28 () none 28) + (sky-work-method-29 () none 29) + (sky-work-method-30 () none 30) + (sky-work-method-31 () none 31) + (sky-work-method-32 () none 32) + (sky-work-method-33 () none 33) + (sky-work-method-34 () none 34) + (sky-work-method-35 () none 35) + (sky-work-method-36 () none 36) + ) + ) + +;; definition for method 3 of type sky-work +(defmethod inspect sky-work ((obj sky-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sky-work) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) + (format #t "~1Tdraw-tmpl2: #~%" (-> obj draw-tmpl2)) + (format #t "~1Tfog-tmpl: #~%" (-> obj fog-tmpl)) + (format #t "~1Tblend-tmpl: #~%" (-> obj blend-tmpl)) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tsprite-tmpl2: #~%" (-> obj sprite-tmpl2)) + (format #t "~1Tsun-coords[2] @ #x~X~%" (-> obj sun-coords)) + (format #t "~1Tgreen-coords[2] @ #x~X~%" (-> obj green-coords)) + (format #t "~1Tmoon0-coords[2] @ #x~X~%" (-> obj moon0-coords)) + (format #t "~1Tmoon1-coords[2] @ #x~X~%" (-> obj moon1-coords)) + (format #t "~1Tmoon2-coords[2] @ #x~X~%" (-> obj moon2-coords)) + (format #t "~1Tstar-coords[2] @ #x~X~%" (-> obj star-coords)) + (format #t "~1Tsun-colors[2] @ #x~X~%" (-> obj sun-colors)) + (format #t "~1Tgreen-colors[2] @ #x~X~%" (-> obj green-colors)) + (format #t "~1Tmoon-colors[3] @ #x~X~%" (-> obj moon-colors)) + (format #t "~1Tstar-colors[16] @ #x~X~%" (-> obj star-colors)) + (format #t "~1Tst-coords[2] @ #x~X~%" (-> obj st-coords)) + (format #t "~1Trandom[8] @ #x~X~%" (-> obj random)) + (format #t "~1Tgiftag-base: #~%" (-> obj giftag-base)) + (format #t "~1Tgiftag-haze: #~%" (-> obj giftag-haze)) + (format #t "~1Tgiftag-roof: #~%" (-> obj giftag-roof)) + (format #t "~1Tgiftag-ocean: #~%" (-> obj giftag-ocean)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tsky[8] @ #x~X~%" (-> obj sky)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Toff-s: ~D~%" (-> obj off-s)) + (format #t "~1Toff-t: ~D~%" (-> obj off-t)) + (format #t "~1Torbit[3] @ #x~X~%" (-> obj orbit)) + (format #t "~1Tupload-data: #~%" (-> obj upload-data)) + (format #t "~1Tambi-color: #~%" (-> obj ambi-color)) + (format #t "~1Tambi-color-lower: #~%" (-> obj ambi-color-lower)) + (format #t "~1Tsun0-color: #~%" (-> obj sun0-color)) + (format #t "~1Tsun1-color: #~%" (-> obj sun1-color)) + (format #t "~1Tmoon-color: #~%" (-> obj moon-color)) + (format #t "~1Tsun0-color-lower: #~%" (-> obj sun0-color-lower)) + (format #t "~1Tcam-mat: #~%" (-> obj cam-mat)) + (format #t "~1Tstar-mat: #~%" (-> obj star-mat)) + (format #t "~1Tvec0: #~%" (-> obj vec0)) + (format #t "~1Tvec1: #~%" (-> obj vec1)) + (format #t "~1Tcloud-lights: #~%" (-> obj cloud-lights)) + (format #t "~1Thaze-lights: #~%" (-> obj haze-lights)) + (format #t "~1Tbuf: ~A~%" (-> obj buf)) + (format #t "~1Tdraw-vortex: ~A~%" (-> obj draw-vortex)) + (format #t "~1Tstars[512] @ #x~X~%" (-> obj stars)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc new file mode 100644 index 0000000000..8f2dcab193 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-h_REF.gc @@ -0,0 +1,183 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *sp-60-hz*, type symbol +(define *sp-60-hz* #t) + +;; definition of type sparticle-cpuinfo +(deftype sparticle-cpuinfo (structure) + ((sprite sprite-vec-data-2d :offset-assert 0) + (adgif adgif-shader :offset-assert 4) + (radius float :offset-assert 8) + (omega float :offset-assert 12) + (vel-sxvel vector :inline :offset-assert 16) + (rot-syvel vector :inline :offset-assert 32) + (fade rgbaf :inline :offset-assert 48) + (acc vector :inline :offset-assert 64) + (rotvel3d quaternion :inline :offset-assert 80) + (vel vector3s :inline :offset 16) + (accel vector3s :inline :offset 64) + (scalevelx float :offset 28) + (scalevely float :offset 44) + (friction float :offset-assert 96) + (timer int32 :offset-assert 100) + (flags sp-cpuinfo-flag :offset-assert 104) + (user-int32 int32 :offset-assert 108) + (user-uint32 uint32 :offset 108) + (user-float float :offset 108) + (user-pntr uint32 :offset 108) + (user-object basic :offset 108) + (user-sprite sprite-vec-data-2d :offset 108) + (sp-func basic :offset-assert 112) + (next-time uint32 :offset-assert 116) + (next-launcher basic :offset-assert 120) + (cache-alpha float :offset-assert 124) + (valid uint8 :offset-assert 128) + (clock-index uint8 :offset-assert 129) + (user1-int16 uint16 :offset-assert 130) + (key sparticle-launch-control :offset-assert 132) + (binding sparticle-launch-state :offset-assert 136) + (data uint32 1 :offset 12) + (datab uint8 4 :offset 12) + (dataf float 1 :offset 12) + (datac uint8 1 :offset 12) + ) + :method-count-assert 9 + :size-assert #x8c + :flag-assert #x90000008c + ) + +;; definition for method 3 of type sparticle-cpuinfo +(defmethod inspect sparticle-cpuinfo ((obj sparticle-cpuinfo)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sparticle-cpuinfo) + (format #t "~1Tsprite: #~%" (-> obj sprite)) + (format #t "~1Tadgif: #~%" (-> obj adgif)) + (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "~1Tomega: ~f~%" (-> obj omega)) + (format #t "~1Tvel-sxvel: #~%" (-> obj vel-sxvel)) + (format #t "~1Trot-syvel: #~%" (-> obj rot-syvel)) + (format #t "~1Tfade: #~%" (-> obj fade)) + (format #t "~1Tacc: #~%" (-> obj acc)) + (format #t "~1Trotvel3d: #~%" (-> obj rotvel3d)) + (format #t "~1Tvel: #~%" (-> obj vel-sxvel)) + (format #t "~1Taccel: #~%" (-> obj acc)) + (format #t "~1Tscalevelx: ~f~%" (-> obj vel-sxvel w)) + (format #t "~1Tscalevely: ~f~%" (-> obj rot-syvel w)) + (format #t "~1Tfriction: ~f~%" (-> obj friction)) + (format #t "~1Ttimer: ~D~%" (-> obj timer)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tuser-int32: ~D~%" (-> obj user-float)) + (format #t "~1Tuser-uint32: ~D~%" (-> obj user-float)) + (format #t "~1Tuser-float: ~f~%" (-> obj user-float)) + (format #t "~1Tuser-pntr: #x~X~%" (-> obj user-float)) + (format #t "~1Tuser-object: ~A~%" (-> obj user-float)) + (format #t "~1Tuser-sprite: #~%" (-> obj user-float)) + (format #t "~1Tsp-func: ~A~%" (-> obj sp-func)) + (format #t "~1Tnext-time: ~D~%" (-> obj next-time)) + (format #t "~1Tnext-launcher: ~A~%" (-> obj next-launcher)) + (format #t "~1Tcache-alpha: ~f~%" (-> obj cache-alpha)) + (format #t "~1Tvalid: ~D~%" (-> obj valid)) + (format #t "~1Tclock-index: ~D~%" (-> obj clock-index)) + (format #t "~1Tuser1-int16: ~D~%" (-> obj user1-int16)) + (format #t "~1Tkey: ~A~%" (-> obj key)) + (format #t "~1Tbinding: #~%" (-> obj binding)) + (format #t "~1Tdata[1] @ #x~X~%" (&-> obj omega)) + (format #t "~1Tdatab[4] @ #x~X~%" (&-> obj omega)) + (format #t "~1Tdataf[1] @ #x~X~%" (&-> obj omega)) + (format #t "~1Tdatac[1] @ #x~X~%" (&-> obj omega)) + (label cfg-4) + obj + ) + +;; definition of type sparticle-launchinfo +(deftype sparticle-launchinfo (structure) + ((launchrot vector :inline :offset-assert 0) + (conerot vector :inline :offset-assert 16) + (rotate-x float :offset-assert 32) + (rotate-y float :offset-assert 36) + (rotate-z float :offset-assert 40) + (coneradius float :offset-assert 44) + (rotate vector :inline :offset 32) + (scale-x float :offset 48) + (scale-y float :offset 52) + (scale-z float :offset 56) + (dummy float :offset 60) + (scale vector :inline :offset 48) + (data uint8 1 :offset 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type sparticle-launchinfo +(defmethod inspect sparticle-launchinfo ((obj sparticle-launchinfo)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sparticle-launchinfo) + (format #t "~1Tlaunchrot: ~`vector`P~%" (-> obj launchrot)) + (format #t "~1Tconerot: ~`vector`P~%" (-> obj conerot)) + (format #t "~1Trotate-x: ~f~%" (-> obj rotate-x)) + (format #t "~1Trotate-y: ~f~%" (-> obj rotate-y)) + (format #t "~1Trotate-z: ~f~%" (-> obj rotate-z)) + (format #t "~1Tconeradius: ~f~%" (-> obj coneradius)) + (format #t "~1Trotate: ~`vector`P~%" (&-> obj rotate-x)) + (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) + (format #t "~1Tscale-z: ~f~%" (-> obj scale-z)) + (format #t "~1Tdummy: ~f~%" (-> obj dummy)) + (format #t "~1Tscale: ~`vector`P~%" (&-> obj scale-x)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj launchrot)) + (label cfg-4) + obj + ) + +;; definition of type sparticle-system +(deftype sparticle-system (basic) + ((blocks int32 2 :offset-assert 4) + (length int32 2 :offset-assert 12) + (num-alloc int32 2 :offset-assert 20) + (is-3d basic :offset-assert 28) + (flags uint32 :offset-assert 32) + (alloc-table (pointer uint64) :offset-assert 36) + (cpuinfo-table (inline-array sparticle-cpuinfo) :offset-assert 40) + (vecdata-table pointer :offset-assert 44) + (adgifdata-table (inline-array adgif-shader) :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type sparticle-system +(defmethod inspect sparticle-system ((obj sparticle-system)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tblocks[2] @ #x~X~%" (-> obj blocks)) + (format #t "~1Tlength[2] @ #x~X~%" (-> obj length)) + (format #t "~1Tnum-alloc[2] @ #x~X~%" (-> obj num-alloc)) + (format #t "~1Tis-3d: ~A~%" (-> obj is-3d)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Talloc-table: #x~X~%" (-> obj alloc-table)) + (format #t "~1Tcpuinfo-table: #x~X~%" (-> obj cpuinfo-table)) + (format #t "~1Tvecdata-table: #x~X~%" (-> obj vecdata-table)) + (format #t "~1Tadgifdata-table: #x~X~%" (-> obj adgifdata-table)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc new file mode 100644 index 0000000000..db94684229 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/particles/sparticle-launcher-h_REF.gc @@ -0,0 +1,316 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sparticle-birthinfo +(deftype sparticle-birthinfo (structure) + ((sprite uint32 :offset-assert 0) + (anim int32 :offset-assert 4) + (anim-speed float :offset-assert 8) + (birth-func basic :offset-assert 12) + (joint-ppoint int32 :offset-assert 16) + (num-to-birth float :offset-assert 20) + (sound basic :offset-assert 24) + (dataf float 1 :offset 0) + (data uint32 1 :offset 0) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type sparticle-birthinfo +(defmethod inspect sparticle-birthinfo ((obj sparticle-birthinfo)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sparticle-birthinfo) + (format #t "~1Tsprite: ~D~%" (-> obj sprite)) + (format #t "~1Tanim: ~D~%" (-> obj anim)) + (format #t "~1Tanim-speed: ~f~%" (-> obj anim-speed)) + (format #t "~1Tbirth-func: ~A~%" (-> obj birth-func)) + (format #t "~1Tjoint-ppoint: ~D~%" (-> obj joint-ppoint)) + (format #t "~1Tnum-to-birth: ~f~%" (-> obj num-to-birth)) + (format #t "~1Tsound: ~A~%" (-> obj sound)) + (format #t "~1Tdataf[1] @ #x~X~%" (&-> obj sprite)) + (format #t "~1Tdata[1] @ #x~X~%" (&-> obj sprite)) + (label cfg-4) + obj + ) + +;; definition of type sp-field-init-spec +(deftype sp-field-init-spec (structure) + ((field sp-field-id :offset-assert 0) + (flags sp-flag :offset-assert 2) + (initial-valuef float :offset-assert 4) + (random-rangef float :offset-assert 8) + (random-multf float :offset-assert 12) + (initial-value int32 :offset 4) + (random-range int32 :offset 8) + (random-mult int32 :offset 12) + (func symbol :offset 4) + (tex texture-id :offset 4) + (pntr pointer :offset 4) + (object basic :offset 4) + (sym symbol :offset 4) + (sound sound-spec :offset 4) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type sp-field-init-spec +(defmethod inspect sp-field-init-spec ((obj sp-field-init-spec)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sp-field-init-spec) + (format #t "~1Tfield: ~D~%" (-> obj field)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tinitial-valuef: ~f~%" (-> obj initial-valuef)) + (format #t "~1Trandom-rangef: ~f~%" (-> obj random-rangef)) + (format #t "~1Trandom-multf: ~f~%" (-> obj random-multf)) + (format #t "~1Tinitial-value: ~D~%" (-> obj initial-valuef)) + (format #t "~1Trandom-range: ~D~%" (-> obj random-rangef)) + (format #t "~1Trandom-mult: ~D~%" (-> obj random-multf)) + (format #t "~1Tfunc: ~A~%" (-> obj initial-valuef)) + (format #t "~1Ttex: ~D~%" (-> obj initial-valuef)) + (format #t "~1Tpntr: #x~X~%" (-> obj initial-valuef)) + (format #t "~1Tobject: ~A~%" (-> obj initial-valuef)) + (format #t "~1Tsym: ~A~%" (-> obj initial-valuef)) + (format #t "~1Tsound: ~A~%" (-> obj initial-valuef)) + (label cfg-4) + obj + ) + +;; definition of type sparticle-launcher +(deftype sparticle-launcher (basic) + ((birthaccum float :offset-assert 4) + (soundaccum float :offset-assert 8) + (init-specs (inline-array sp-field-init-spec) :offset-assert 12) + ) + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (sparticle-launcher-method-9 () none 9) + (sparticle-launcher-method-10 () none 10) + ) + ) + +;; definition for method 3 of type sparticle-launcher +(defmethod inspect sparticle-launcher ((obj sparticle-launcher)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbirthaccum: ~f~%" (-> obj birthaccum)) + (format #t "~1Tsoundaccum: ~f~%" (-> obj soundaccum)) + (format #t "~1Tinit-specs: #x~X~%" (-> obj init-specs)) + (label cfg-4) + obj + ) + +;; definition of type sparticle-group-item +(deftype sparticle-group-item (structure) + ((launcher uint32 :offset-assert 0) + (fade-after meters :offset-assert 4) + (falloff-to meters :offset-assert 8) + (flags sp-group-item-flag :offset-assert 12) + (period uint16 :offset-assert 14) + (length uint16 :offset-assert 16) + (offset int16 :offset-assert 18) + (hour-mask uint32 :offset-assert 20) + (binding uint32 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type sparticle-group-item +(defmethod inspect sparticle-group-item ((obj sparticle-group-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sparticle-group-item) + (format #t "~1Tlauncher: ~D~%" (-> obj launcher)) + (format #t "~1Tfade-after: (meters ~m)~%" (-> obj fade-after)) + (format #t "~1Tfalloff-to: (meters ~m)~%" (-> obj falloff-to)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tperiod: ~D~%" (-> obj period)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Toffset: ~D~%" (-> obj offset)) + (format #t "~1Thour-mask: ~D~%" (-> obj hour-mask)) + (format #t "~1Tbinding: ~D~%" (-> obj binding)) + (label cfg-4) + obj + ) + +;; definition of type sparticle-launch-state +(deftype sparticle-launch-state (structure) + ((group-item sparticle-group-item :offset-assert 0) + (flags sp-launch-state-flags :offset-assert 4) + (randomize uint16 :offset-assert 6) + (center vector :offset-assert 8) + (sprite3d sprite-vec-data-3d :offset-assert 12) + (sprite sparticle-cpuinfo :offset-assert 16) + (offset uint32 :offset-assert 20) + (accum float :offset-assert 24) + (spawn-time uint32 :offset-assert 28) + (control basic :offset-assert 32) + (swarm basic :offset 20) + (seed uint32 :offset 24) + (time uint32 :offset 28) + (spec basic :offset 16) + (id uint32 :offset 12) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type sparticle-launch-state +(defmethod inspect sparticle-launch-state ((obj sparticle-launch-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sparticle-launch-state) + (format #t "~1Tgroup-item: #~%" (-> obj group-item)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Trandomize: ~D~%" (-> obj randomize)) + (format #t "~1Tcenter: #~%" (-> obj center)) + (format #t "~1Tsprite3d: #~%" (-> obj sprite3d)) + (format #t "~1Tsprite: ~A~%" (-> obj sprite)) + (format #t "~1Toffset: ~D~%" (-> obj offset)) + (format #t "~1Taccum: ~f~%" (-> obj accum)) + (format #t "~1Tspawn-time: ~D~%" (-> obj spawn-time)) + (format #t "~1Tcontrol: ~A~%" (-> obj control)) + (format #t "~1Tswarm: ~A~%" (-> obj offset)) + (format #t "~1Tseed: ~D~%" (-> obj accum)) + (format #t "~1Ttime: ~D~%" (-> obj spawn-time)) + (format #t "~1Tspec: ~A~%" (-> obj sprite)) + (format #t "~1Tid: ~D~%" (-> obj sprite3d)) + (label cfg-4) + obj + ) + +;; definition of type sparticle-launch-group +(deftype sparticle-launch-group (basic) + ((length int16 :offset-assert 4) + (duration uint16 :offset-assert 6) + (linger-duration uint16 :offset-assert 8) + (flags sp-group-flag :offset-assert 10) + (name string :offset-assert 12) + (launcher (inline-array sparticle-group-item) :offset-assert 16) + (rotate-x degrees :offset-assert 20) + (rotate-y degrees :offset-assert 24) + (rotate-z degrees :offset-assert 28) + (scale-x float :offset-assert 32) + (scale-y float :offset-assert 36) + (scale-z float :offset-assert 40) + (bounds sphere :inline :offset-assert 48) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (sparticle-launch-group-method-9 () none 9) + ) + ) + +;; definition for method 3 of type sparticle-launch-group +(defmethod inspect sparticle-launch-group ((obj sparticle-launch-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tduration: ~D~%" (-> obj duration)) + (format #t "~1Tlinger-duration: ~D~%" (-> obj linger-duration)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlauncher: #x~X~%" (-> obj launcher)) + (format #t "~1Trotate-x: (deg ~r)~%" (-> obj rotate-x)) + (format #t "~1Trotate-y: (deg ~r)~%" (-> obj rotate-y)) + (format #t "~1Trotate-z: (deg ~r)~%" (-> obj rotate-z)) + (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) + (format #t "~1Tscale-z: ~f~%" (-> obj scale-z)) + (format #t "~1Tbounds: #~%" (-> obj bounds)) + (label cfg-4) + obj + ) + +;; definition for symbol *launch-matrix*, type matrix +(define *launch-matrix* (matrix-identity! (new 'global 'matrix))) + +;; definition of type sparticle-launch-control +(deftype sparticle-launch-control (inline-array-class) + ((group sparticle-launch-group :offset-assert 16) + (proc process :offset-assert 20) + (local-clock int32 :offset-assert 24) + (fade float :offset-assert 28) + (matrix int8 :offset-assert 32) + (state-mode uint8 3 :offset-assert 33) + (state-counter uint32 :offset-assert 36) + (last-spawn-frame int32 :offset-assert 40) + (last-spawn-time int32 :offset-assert 44) + (origin matrix :inline :offset-assert 48) + (center vector :inline :offset 96) + (data sparticle-launch-state :inline :dynamic :offset-assert 112) + ) + :method-count-assert 16 + :size-assert #x70 + :flag-assert #x1000000070 + (:methods + (sparticle-launch-control-method-9 () none 9) + (sparticle-launch-control-method-10 () none 10) + (sparticle-launch-control-method-11 () none 11) + (sparticle-launch-control-method-12 () none 12) + (sparticle-launch-control-method-13 () none 13) + (sparticle-launch-control-method-14 () none 14) + (sparticle-launch-control-method-15 () none 15) + ) + ) + +;; definition for method 3 of type sparticle-launch-control +(defmethod inspect sparticle-launch-control ((obj sparticle-launch-control)) + (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 "~1Tgroup: ~A~%" (-> obj group)) + (format #t "~1Tproc: ~A~%" (-> obj proc)) + (format #t "~1Tlocal-clock: ~D~%" (-> obj local-clock)) + (format #t "~1Tfade: ~f~%" (-> obj fade)) + (format #t "~1Tmatrix: ~D~%" (-> obj matrix)) + (format #t "~1Tstate-mode[3] @ #x~X~%" (-> obj state-mode)) + (format #t "~1Tstate-counter: ~D~%" (-> obj state-counter)) + (format #t "~1Tlast-spawn-frame: ~D~%" (-> obj last-spawn-frame)) + (format #t "~1Tlast-spawn-time: ~D~%" (-> obj last-spawn-time)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tcenter: ~`vector`P~%" (-> obj origin trans)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +(set! (-> sparticle-launch-control heap-base) (the-as uint 48)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc new file mode 100644 index 0000000000..2af01a5a9a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/simple-sprite-h_REF.gc @@ -0,0 +1,95 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sprite-glow-data +(deftype sprite-glow-data (structure) + ((position vector :inline :offset-assert 0) + (size-x float :offset 12) + (size-probe float :offset-assert 16) + (z-offset float :offset-assert 20) + (rot-angle float :offset-assert 24) + (size-y float :offset-assert 28) + (color rgbaf :inline :offset-assert 32) + (fade-a float :offset-assert 48) + (fade-b float :offset-assert 52) + (tex-id uint32 :offset-assert 56) + (dummy uint32 :offset-assert 60) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (set-trans (_type_ vector) none 9) + ) + ) + +;; definition for method 3 of type sprite-glow-data +(defmethod inspect sprite-glow-data ((obj sprite-glow-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sprite-glow-data) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Tsize-x: ~f~%" (-> obj position w)) + (format #t "~1Tsize-probe: ~f~%" (-> obj size-probe)) + (format #t "~1Tz-offset: ~f~%" (-> obj z-offset)) + (format #t "~1Trot-angle: ~f~%" (-> obj rot-angle)) + (format #t "~1Tsize-y: ~f~%" (-> obj size-y)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tfade-a: ~f~%" (-> obj fade-a)) + (format #t "~1Tfade-b: ~f~%" (-> obj fade-b)) + (format #t "~1Ttex-id: ~D~%" (-> obj tex-id)) + (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type sprite-glow-data +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defmethod set-trans sprite-glow-data ((obj sprite-glow-data) (arg0 vector)) + (let ((f0-0 (-> obj position w))) + (set! (-> obj position quad) (-> arg0 quad)) + (set! (-> obj position w) f0-0) + ) + 0 + (none) + ) + +;; definition of type simple-sprite-system +(deftype simple-sprite-system (structure) + ((count int16 :offset-assert 0) + (max-count int16 :offset-assert 2) + (data uint32 :offset-assert 4) + ) + :method-count-assert 12 + :size-assert #x8 + :flag-assert #xc00000008 + (:methods + (simple-sprite-system-method-9 () none 9) + (simple-sprite-system-method-10 () none 10) + (simple-sprite-system-method-11 () none 11) + ) + ) + +;; definition for method 3 of type simple-sprite-system +(defmethod inspect simple-sprite-system ((obj simple-sprite-system)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'simple-sprite-system) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tmax-count: ~D~%" (-> obj max-count)) + (format #t "~1Tdata: #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc new file mode 100644 index 0000000000..73482edc1d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/sprite/sprite-h_REF.gc @@ -0,0 +1,185 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sprite-vec-data-2d +(deftype sprite-vec-data-2d (structure) + ((x-y-z-sx vector :inline :offset-assert 0) + (flag-rot-sy vector :inline :offset-assert 16) + (r-g-b-a vector :inline :offset-assert 32) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (sx float :offset 12) + (sy float :offset 28) + (rot float :offset 24) + (flag int32 :offset 16) + (matrix int32 :offset 20) + (warp-turns int32 :offset 16) + (r float :offset 32) + (g float :offset 36) + (b float :offset 40) + (a float :offset 44) + (trans vector3s :inline :offset 0) + (color rgbaf :inline :offset 32) + (data uint128 1 :offset 0) + (data64 uint64 6 :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type sprite-vec-data-2d +(defmethod inspect sprite-vec-data-2d ((obj sprite-vec-data-2d)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sprite-vec-data-2d) + (format #t "~1Tx-y-z-sx: #~%" (-> obj x-y-z-sx)) + (format #t "~1Tflag-rot-sy: #~%" (-> obj flag-rot-sy)) + (format #t "~1Tr-g-b-a: #~%" (-> obj r-g-b-a)) + (format #t "~1Tx: ~f~%" (-> obj x-y-z-sx x)) + (format #t "~1Ty: ~f~%" (-> obj x-y-z-sx y)) + (format #t "~1Tz: ~f~%" (-> obj x-y-z-sx z)) + (format #t "~1Tsx: ~f~%" (-> obj x-y-z-sx w)) + (format #t "~1Tsy: ~f~%" (-> obj flag-rot-sy w)) + (format #t "~1Trot: ~f~%" (-> obj flag-rot-sy z)) + (format #t "~1Tflag: ~D~%" (-> obj flag-rot-sy x)) + (format #t "~1Tmatrix: ~D~%" (-> obj flag-rot-sy y)) + (format #t "~1Twarp-turns: ~D~%" (-> obj flag-rot-sy x)) + (format #t "~1Tr: ~f~%" (-> obj r-g-b-a x)) + (format #t "~1Tg: ~f~%" (-> obj r-g-b-a y)) + (format #t "~1Tb: ~f~%" (-> obj r-g-b-a z)) + (format #t "~1Ta: ~f~%" (-> obj r-g-b-a w)) + (format #t "~1Ttrans: #~%" (-> obj x-y-z-sx)) + (format #t "~1Tcolor: #~%" (-> obj r-g-b-a)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj x-y-z-sx)) + (format #t "~1Tdata64[6] @ #x~X~%" (-> obj x-y-z-sx)) + (label cfg-4) + obj + ) + +;; definition of type sprite-array-2d +(deftype sprite-array-2d (basic) + ((num-sprites int32 2 :offset-assert 4) + (num-valid int32 2 :offset-assert 12) + (vec-data pointer :offset-assert 20) + (adgif-data (inline-array adgif-shader) :offset-assert 24) + (pad uint128 4 :offset-assert 32) + (data uint128 1 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type sprite-array-2d +(defmethod inspect sprite-array-2d ((obj sprite-array-2d)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnum-sprites[2] @ #x~X~%" (-> obj num-sprites)) + (format #t "~1Tnum-valid[2] @ #x~X~%" (-> obj num-valid)) + (format #t "~1Tvec-data: #x~X~%" (-> obj vec-data)) + (format #t "~1Tadgif-data: #x~X~%" (-> obj adgif-data)) + (format #t "~1Tpad[4] @ #x~X~%" (-> obj pad)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type sprite-vec-data-3d +(deftype sprite-vec-data-3d (structure) + ((x-y-z-sx vector :inline :offset-assert 0) + (qx-qy-qz-sy vector :inline :offset-assert 16) + (r-g-b-a vector :inline :offset-assert 32) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (sx float :offset 12) + (sy float :offset 28) + (qx float :offset 16) + (qy float :offset 20) + (qz float :offset 24) + (r float :offset 32) + (g float :offset 36) + (b float :offset 40) + (a float :offset 44) + (trans vector3s :inline :offset 0) + (rot vector3s :inline :offset 16) + (color rgbaf :inline :offset 32) + (data uint128 1 :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type sprite-vec-data-3d +(defmethod inspect sprite-vec-data-3d ((obj sprite-vec-data-3d)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sprite-vec-data-3d) + (format #t "~1Tx-y-z-sx: #~%" (-> obj x-y-z-sx)) + (format #t "~1Tqx-qy-qz-sy: #~%" (-> obj qx-qy-qz-sy)) + (format #t "~1Tr-g-b-a: #~%" (-> obj r-g-b-a)) + (format #t "~1Tx: ~f~%" (-> obj x-y-z-sx x)) + (format #t "~1Ty: ~f~%" (-> obj x-y-z-sx y)) + (format #t "~1Tz: ~f~%" (-> obj x-y-z-sx z)) + (format #t "~1Tsx: ~f~%" (-> obj x-y-z-sx w)) + (format #t "~1Tsy: ~f~%" (-> obj qx-qy-qz-sy w)) + (format #t "~1Tqx: ~f~%" (-> obj qx-qy-qz-sy x)) + (format #t "~1Tqy: ~f~%" (-> obj qx-qy-qz-sy y)) + (format #t "~1Tqz: ~f~%" (-> obj qx-qy-qz-sy z)) + (format #t "~1Tr: ~f~%" (-> obj r-g-b-a x)) + (format #t "~1Tg: ~f~%" (-> obj r-g-b-a y)) + (format #t "~1Tb: ~f~%" (-> obj r-g-b-a z)) + (format #t "~1Ta: ~f~%" (-> obj r-g-b-a w)) + (format #t "~1Ttrans: #~%" (-> obj x-y-z-sx)) + (format #t "~1Trot: #~%" (-> obj qx-qy-qz-sy)) + (format #t "~1Tcolor: #~%" (-> obj r-g-b-a)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj x-y-z-sx)) + (label cfg-4) + obj + ) + +;; definition of type sprite-array-3d +(deftype sprite-array-3d (basic) + ((num-sprites int32 2 :offset-assert 4) + (num-valid int32 2 :offset-assert 12) + (vec-data pointer :offset-assert 20) + (adgif-data (inline-array adgif-shader) :offset-assert 24) + (data uint128 1 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type sprite-array-3d +(defmethod inspect sprite-array-3d ((obj sprite-array-3d)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnum-sprites[2] @ #x~X~%" (-> obj num-sprites)) + (format #t "~1Tnum-valid[2] @ #x~X~%" (-> obj num-valid)) + (format #t "~1Tvec-data: #x~X~%" (-> obj vec-data)) + (format #t "~1Tadgif-data: #x~X~%" (-> obj adgif-data)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc new file mode 100644 index 0000000000..79e31cd478 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-anim-h_REF.gc @@ -0,0 +1,470 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type texture-anim-layer +(deftype texture-anim-layer (structure) + ((extra vector :inline :offset 240) + (func basic :offset 256) + (func-id basic :offset 256) + (init-func basic :offset 260) + (init-func-id basic :offset 260) + (tex basic :offset 264) + (start-time float :offset 268) + (end-time float :offset 272) + (tex-name basic :offset 276) + (test uint64 :offset 280) + (alpha uint64 :offset 288) + (clamp uint64 :offset 296) + (start-color vector :inline :offset 80) + (start-scale vector2 :inline :offset 96) + (start-offset vector2 :inline :offset 104) + (start-st-scale vector2 :inline :offset 112) + (start-st-offset vector2 :inline :offset 120) + (start-qs vector :inline :offset 128) + (start-rot degrees :offset 144) + (start-st-rot degrees :offset 148) + (end-color vector :inline :offset 160) + (end-scale vector2 :inline :offset 176) + (end-offset vector2 :inline :offset 184) + (end-st-scale vector2 :inline :offset 192) + (end-st-offset vector2 :inline :offset 200) + (end-qs vector :inline :offset 208) + (end-rot degrees :offset 224) + (end-st-rot degrees :offset 228) + ) + :method-count-assert 11 + :size-assert #x130 + :flag-assert #xb00000130 + (:methods + (texture-anim-layer-method-9 () none 9) + (texture-anim-layer-method-10 () none 10) + ) + ) + +;; definition for method 3 of type texture-anim-layer +(defmethod inspect texture-anim-layer ((obj texture-anim-layer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-anim-layer) + (format #t "~1Textra: #~%" (-> obj extra)) + (format #t "~1Tfunc: ~A~%" (-> obj func)) + (format #t "~1Tfunc-id: ~A~%" (-> obj func)) + (format #t "~1Tinit-func: ~A~%" (-> obj init-func)) + (format #t "~1Tinit-func-id: ~A~%" (-> obj init-func)) + (format #t "~1Ttex: ~A~%" (-> obj tex)) + (format #t "~1Tstart-time: ~f~%" (-> obj start-time)) + (format #t "~1Tend-time: ~f~%" (-> obj end-time)) + (format #t "~1Ttex-name: ~A~%" (-> obj tex-name)) + (format #t "~1Ttest: #x~X~%" (-> obj test)) + (format #t "~1Talpha: #x~X~%" (-> obj alpha)) + (format #t "~1Tclamp: #x~X~%" (-> obj clamp)) + (format #t "~1Tstart-color: ~`vector`P~%" (-> obj start-color)) + (format #t "~1Tstart-scale: ~`vector2`P~%" (-> obj start-scale)) + (format #t "~1Tstart-offset: ~`vector2`P~%" (-> obj start-offset)) + (format #t "~1Tstart-st-scale: ~`vector2`P~%" (-> obj start-st-scale)) + (format #t "~1Tstart-st-offset: ~`vector2`P~%" (-> obj start-st-offset)) + (format #t "~1Tstart-qs: ~`vector`P~%" (-> obj start-qs)) + (format #t "~1Tstart-rot: (deg ~r)~%" (-> obj start-rot)) + (format #t "~1Tstart-st-rot: (deg ~r)~%" (-> obj start-st-rot)) + (format #t "~1Tend-color: ~`vector`P~%" (-> obj end-color)) + (format #t "~1Tend-scale: ~`vector2`P~%" (-> obj end-scale)) + (format #t "~1Tend-offset: ~`vector2`P~%" (-> obj end-offset)) + (format #t "~1Tend-st-scale: ~`vector2`P~%" (-> obj end-st-scale)) + (format #t "~1Tend-st-offset: ~`vector2`P~%" (-> obj end-st-offset)) + (format #t "~1Tend-qs: ~`vector`P~%" (-> obj end-qs)) + (format #t "~1Tend-rot: (deg ~r)~%" (-> obj end-rot)) + (format #t "~1Tend-st-rot: (deg ~r)~%" (-> obj end-st-rot)) + (label cfg-4) + obj + ) + +;; definition of type texture-anim +(deftype texture-anim (structure) + ((num-layers uint32 :offset-assert 0) + (func basic :offset-assert 4) + (func-id basic :offset 4) + (init-func basic :offset-assert 8) + (init-func-id basic :offset 8) + (tex basic :offset-assert 12) + (tex-name basic :offset-assert 16) + (extra vector :inline :offset-assert 32) + (color uint32 :offset-assert 48) + (frame-time float :offset-assert 52) + (frame-delta float :offset-assert 56) + (frame-mod float :offset-assert 60) + (test uint64 :offset-assert 64) + (alpha uint64 :offset-assert 72) + (clamp uint64 :offset-assert 80) + (data uint8 :dynamic :offset-assert 88) + ) + :method-count-assert 11 + :size-assert #x58 + :flag-assert #xb00000058 + (:methods + (texture-anim-method-9 () none 9) + (texture-anim-method-10 () none 10) + ) + ) + +;; definition for method 3 of type texture-anim +(defmethod inspect texture-anim ((obj texture-anim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-anim) + (format #t "~1Tnum-layers: ~D~%" (-> obj num-layers)) + (format #t "~1Tfunc: ~A~%" (-> obj func)) + (format #t "~1Tfunc-id: ~A~%" (-> obj func)) + (format #t "~1Tinit-func: ~A~%" (-> obj init-func)) + (format #t "~1Tinit-func-id: ~A~%" (-> obj init-func)) + (format #t "~1Ttex: ~A~%" (-> obj tex)) + (format #t "~1Ttex-name: ~A~%" (-> obj tex-name)) + (format #t "~1Textra: #~%" (-> obj extra)) + (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (format #t "~1Tframe-time: ~f~%" (-> obj frame-time)) + (format #t "~1Tframe-delta: ~f~%" (-> obj frame-delta)) + (format #t "~1Tframe-mod: ~f~%" (-> obj frame-mod)) + (format #t "~1Ttest: #x~X~%" (-> obj test)) + (format #t "~1Talpha: #x~X~%" (-> obj alpha)) + (format #t "~1Tclamp: #x~X~%" (-> obj clamp)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type texture-anim-array +(deftype texture-anim-array (array) + () + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (texture-anim-array-method-9 () none 9) + (texture-anim-array-method-10 () none 10) + ) + ) + +;; definition for method 3 of type texture-anim-array +(defmethod inspect texture-anim-array ((obj texture-anim-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttype: ~A~%" (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tcontent-type: ~A~%" (-> obj content-type)) + (label cfg-4) + obj + ) + +;; definition of type texture-anim-work +(deftype texture-anim-work (structure) + ((erase-tmpl dma-gif-packet :inline :offset-assert 0) + (draw-tmpl dma-gif-packet :inline :offset-assert 32) + (draw2-tmpl dma-gif-packet :inline :offset-assert 64) + (fill-tmpl dma-gif-packet :inline :offset-assert 96) + (adgif-tmpl dma-gif-packet :inline :offset-assert 128) + (corner0 vector :inline :offset-assert 160) + (corner1 vector :inline :offset-assert 176) + (corner2 vector :inline :offset-assert 192) + (corner3 vector :inline :offset-assert 208) + (const vector :inline :offset-assert 224) + (random vector 8 :inline :offset-assert 240) + (random-index uint8 :offset-assert 368) + ) + :method-count-assert 9 + :size-assert #x171 + :flag-assert #x900000171 + ) + +;; definition for method 3 of type texture-anim-work +(defmethod inspect texture-anim-work ((obj texture-anim-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-anim-work) + (format #t "~1Terase-tmpl: #~%" (-> obj erase-tmpl)) + (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) + (format #t "~1Tdraw2-tmpl: #~%" (-> obj draw2-tmpl)) + (format #t "~1Tfill-tmpl: #~%" (-> obj fill-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tcorner0: #~%" (-> obj corner0)) + (format #t "~1Tcorner1: #~%" (-> obj corner1)) + (format #t "~1Tcorner2: #~%" (-> obj corner2)) + (format #t "~1Tcorner3: #~%" (-> obj corner3)) + (format #t "~1Tconst: #~%" (-> obj const)) + (format #t "~1Trandom[8] @ #x~X~%" (-> obj random)) + (format #t "~1Trandom-index: ~D~%" (-> obj random-index)) + (label cfg-4) + obj + ) + +;; definition of type clut16x16 +(deftype clut16x16 (structure) + ((clut rgba 256 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x400 + :flag-assert #x900000400 + ) + +;; definition for method 3 of type clut16x16 +(defmethod inspect clut16x16 ((obj clut16x16)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'clut16x16) + (format #t "~1Tclut[256] @ #x~X~%" (-> obj clut)) + (label cfg-4) + obj + ) + +;; definition of type noise8x8 +(deftype noise8x8 (structure) + ((image uint8 64 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type noise8x8 +(defmethod inspect noise8x8 ((obj noise8x8)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'noise8x8) + (format #t "~1Timage[64] @ #x~X~%" (-> obj image)) + (label cfg-4) + obj + ) + +;; definition of type noise16x16 +(deftype noise16x16 (structure) + ((image uint8 256 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +;; definition for method 3 of type noise16x16 +(defmethod inspect noise16x16 ((obj noise16x16)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'noise16x16) + (format #t "~1Timage[256] @ #x~X~%" (-> obj image)) + (label cfg-4) + obj + ) + +;; definition of type noise32x32 +(deftype noise32x32 (structure) + ((image uint8 1024 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x400 + :flag-assert #x900000400 + ) + +;; definition for method 3 of type noise32x32 +(defmethod inspect noise32x32 ((obj noise32x32)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'noise32x32) + (format #t "~1Timage[1024] @ #x~X~%" (-> obj image)) + (label cfg-4) + obj + ) + +;; definition of type noise64x64 +(deftype noise64x64 (structure) + ((image uint8 4096 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x1000 + :flag-assert #x900001000 + ) + +;; definition for method 3 of type noise64x64 +(defmethod inspect noise64x64 ((obj noise64x64)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'noise64x64) + (format #t "~1Timage[4096] @ #x~X~%" (-> obj image)) + (label cfg-4) + obj + ) + +;; definition of type noise128x128 +(deftype noise128x128 (structure) + ((image uint8 16384 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4000 + :flag-assert #x900004000 + ) + +;; definition for method 3 of type noise128x128 +(defmethod inspect noise128x128 ((obj noise128x128)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'noise128x128) + (format #t "~1Timage[16384] @ #x~X~%" (-> obj image)) + (label cfg-4) + obj + ) + +;; definition of type fog8x256 +(deftype fog8x256 (structure) + ((image uint8 256 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x100 + :flag-assert #x900000100 + ) + +;; definition for method 3 of type fog8x256 +(defmethod inspect fog8x256 ((obj fog8x256)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'fog8x256) + (format #t "~1Timage[256] @ #x~X~%" (-> obj image)) + (label cfg-4) + obj + ) + +;; definition of type fog-texture-work +(deftype fog-texture-work (structure) + ((corner vector 4 :inline :offset-assert 0) + (const vector :inline :offset-assert 64) + (min-corner vector :inline :offset-assert 80) + (max-corner vector :inline :offset-assert 96) + (fog-near float :offset-assert 112) + (fog-far float :offset-assert 116) + (fog-delta float :offset-assert 120) + (alpha-near float :offset-assert 124) + (alpha-far float :offset-assert 128) + (alpha-delta float :offset-assert 132) + (color uint32 :offset-assert 136) + ) + :method-count-assert 9 + :size-assert #x8c + :flag-assert #x90000008c + ) + +;; definition for method 3 of type fog-texture-work +(defmethod inspect fog-texture-work ((obj fog-texture-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'fog-texture-work) + (format #t "~1Tcorner[4] @ #x~X~%" (-> obj corner)) + (format #t "~1Tconst: #~%" (-> obj const)) + (format #t "~1Tmin-corner: #~%" (-> obj min-corner)) + (format #t "~1Tmax-corner: #~%" (-> obj max-corner)) + (format #t "~1Tfog-near: ~f~%" (-> obj fog-near)) + (format #t "~1Tfog-far: ~f~%" (-> obj fog-far)) + (format #t "~1Tfog-delta: ~f~%" (-> obj fog-delta)) + (format #t "~1Talpha-near: ~f~%" (-> obj alpha-near)) + (format #t "~1Talpha-far: ~f~%" (-> obj alpha-far)) + (format #t "~1Talpha-delta: ~f~%" (-> obj alpha-delta)) + (format #t "~1Tcolor: ~D~%" (-> obj color)) + (label cfg-4) + obj + ) + +;; definition for symbol *clut-translate*, type (pointer uint32) +(define *clut-translate* (new 'static 'array uint32 64 + #x3020100 + #x7060504 + #x13121110 + #x17161514 + #xb0a0908 + #xf0e0d0c + #x1b1a1918 + #x1f1e1d1c + #x23222120 + #x27262524 + #x33323130 + #x37363534 + #x2b2a2928 + #x2f2e2d2c + #x3b3a3938 + #x3f3e3d3c + #x43424140 + #x47464544 + #x53525150 + #x57565554 + #x4b4a4948 + #x4f4e4d4c + #x5b5a5958 + #x5f5e5d5c + #x63626160 + #x67666564 + #x73727170 + #x77767574 + #x6b6a6968 + #x6f6e6d6c + #x7b7a7978 + #x7f7e7d7c + #x83828180 + #x87868584 + #x93929190 + #x97969594 + #x8b8a8988 + #x8f8e8d8c + #x9b9a9998 + #x9f9e9d9c + #xa3a2a1a0 + #xa7a6a5a4 + #xb3b2b1b0 + #xb7b6b5b4 + #xabaaa9a8 + #xafaeadac + #xbbbab9b8 + #xbfbebdbc + #xc3c2c1c0 + #xc7c6c5c4 + #xd3d2d1d0 + #xd7d6d5d4 + #xcbcac9c8 + #xcfcecdcc + #xdbdad9d8 + #xdfdedddc + #xe3e2e1e0 + #xe7e6e5e4 + #xf3f2f1f0 + #xf7f6f5f4 + #xebeae9e8 + #xefeeedec + #xfbfaf9f8 + #xfffefdfc + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc new file mode 100644 index 0000000000..b30090355d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/texture/texture-h_REF.gc @@ -0,0 +1,1250 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type texture-id +(deftype texture-id (uint32) + ((index uint16 :offset 8 :size 12) + (page uint16 :offset 20 :size 12) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type texture-id +(defmethod inspect texture-id ((obj texture-id)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-id) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tpage: ~D~%" (-> obj page)) + (label cfg-4) + obj + ) + +;; definition of type texture-pool-segment +(deftype texture-pool-segment (structure) + ((dest uint32 :offset-assert 0) + (size uint32 :offset-assert 4) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type texture-pool-segment +(defmethod inspect texture-pool-segment ((obj texture-pool-segment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-pool-segment) + (format #t "~1Tdest: #x~X~%" (-> obj dest)) + (format #t "~1Tsize: #x~X~%" (-> obj size)) + (label cfg-4) + obj + ) + +;; definition of type texture-pool +(deftype texture-pool (basic) + ((top int32 :offset-assert 4) + (cur int32 :offset-assert 8) + (allocate-func (function texture-pool texture-page kheap int texture-page) :offset-assert 12) + (font-palette int32 :offset-assert 16) + (segment texture-pool-segment 4 :inline :offset-assert 20) + (segment-near texture-pool-segment :inline :offset 20) + (segment-common texture-pool-segment :inline :offset 28) + (common-page texture-page 32 :offset-assert 52) + (common-page-mask int32 :offset-assert 180) + (update-sprites-flag symbol :offset-assert 184) + (update-flag symbol :offset-assert 188) + (texture-enable-user uint64 :offset-assert 192) + (texture-enable-user-menu uint64 :offset-assert 200) + (ids uint32 128 :offset-assert 208) + ) + :method-count-assert 26 + :size-assert #x2d0 + :flag-assert #x1a000002d0 + (:methods + (new (symbol type) _type_ 0) + (initialize! (_type_) _type_ 9) + (texture-pool-method-10 () none 10) + (texture-pool-method-11 () none 11) + (allocate-defaults! (_type_) none 12) + (login-level-textures (_type_ level int (pointer texture-id)) none 13) + (texture-pool-method-14 () none 14) + (allocate-vram-words! (_type_ int) int 15) + (allocate-segment! (_type_ texture-pool-segment int) texture-pool-segment 16) + (texture-pool-method-17 () none 17) + (texture-pool-method-18 (_type_ int) int 18) + (update-warp-and-hud (_type_) none 19) + (update-sprites (_type_) none 20) + (flag-update-and-sprite (_type_) none 21) + (relocate-sprite-dests! (_type_) none 22) + (relocate-hud-dests! (_type_) none 23) + (relocate-warp-dests! (_type_) none 24) + (clear-ids (_type_) none 25) + ) + ) + +;; definition for method 3 of type texture-pool +(defmethod inspect texture-pool ((obj texture-pool)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttop: #x~X~%" (-> obj top)) + (format #t "~1Tcur: #x~X~%" (-> obj cur)) + (format #t "~1Tallocate-func: ~A~%" (-> obj allocate-func)) + (format #t "~1Tfont-palette: ~D~%" (-> obj font-palette)) + (format #t "~1Tsegment[4] @ #x~X~%" (-> obj segment)) + (format #t "~1Tsegment-near: #~%" (-> obj segment)) + (format #t "~1Tsegment-common: #~%" (-> obj segment-common)) + (format #t "~1Tcommon-page[32] @ #x~X~%" (-> obj common-page)) + (format #t "~1Tcommon-page-mask: ~D~%" (-> obj common-page-mask)) + (format #t "~1Tupdate-sprites-flag: ~A~%" (-> obj update-sprites-flag)) + (format #t "~1Tupdate-flag: ~A~%" (-> obj update-flag)) + (format #t "~1Ttexture-enable-user: ~D~%" (-> obj texture-enable-user)) + (format #t "~1Ttexture-enable-user-menu: ~D~%" (-> obj texture-enable-user-menu)) + (format #t "~1Tids[128] @ #x~X~%" (-> obj ids)) + (label cfg-4) + obj + ) + +;; definition of type texture-mask +(deftype texture-mask (structure) + ((mask vector4w :inline :offset-assert 0) + (dist float :offset 12) + (long uint64 2 :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type texture-mask +;; INFO: Used lq/sq +(defmethod inspect texture-mask ((obj texture-mask)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-mask) + (format #t "~1Tmask: #~%" (-> obj mask)) + (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "~1Tlong[2] @ #x~X~%" (-> obj mask)) + (format #t "~1Tquad: ~D~%" (-> obj mask quad)) + (label cfg-4) + obj + ) + +;; definition of type texture-masks +(deftype texture-masks (structure) + ((data texture-mask 3 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type texture-masks +(defmethod inspect texture-masks ((obj texture-masks)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-masks) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type texture-masks-array +(deftype texture-masks-array (inline-array-class) + ((data texture-masks :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type texture-masks-array +(defmethod inspect texture-masks-array ((obj texture-masks-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! (-> texture-masks-array heap-base) (the-as uint 48)) + +;; definition for symbol *texture-masks*, type texture-masks +(define *texture-masks* (the-as texture-masks #f)) + +;; definition for symbol *texture-masks-array*, type texture-masks-array +(define *texture-masks-array* (the-as texture-masks-array #f)) + +;; definition of type texture +(deftype texture (basic) + ((w int16 :offset-assert 4) + (h int16 :offset-assert 6) + (num-mips uint8 :offset-assert 8) + (tex1-control uint8 :offset-assert 9) + (psm gs-psm :offset-assert 10) + (mip-shift uint8 :offset-assert 11) + (clutpsm uint16 :offset-assert 12) + (dest uint16 7 :offset-assert 14) + (clutdest uint16 :offset-assert 28) + (width uint8 7 :offset-assert 30) + (name string :offset-assert 40) + (size uint32 :offset-assert 44) + (uv-dist float :offset-assert 48) + (pad uint32 3 :offset-assert 52) + (masks texture-masks :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type texture +(defmethod inspect texture ((obj texture)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Th: ~D~%" (-> obj h)) + (format #t "~1Tnum-mips: ~D~%" (-> obj num-mips)) + (format #t "~1Ttex1-control: ~D~%" (-> obj tex1-control)) + (format #t "~1Tpsm: ~D~%" (-> obj psm)) + (format #t "~1Tmip-shift: ~D~%" (-> obj mip-shift)) + (format #t "~1Tclutpsm: ~D~%" (-> obj clutpsm)) + (format #t "~1Tdest[7] @ #x~X~%" (-> obj dest)) + (format #t "~1Tclutdest: ~D~%" (-> obj clutdest)) + (format #t "~1Twidth[7] @ #x~X~%" (-> obj width)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tsize: #x~X~%" (-> obj size)) + (format #t "~1Tuv-dist: ~f~%" (-> obj uv-dist)) + (format #t "~1Tpad[3] @ #x~X~%" (-> obj pad)) + (format #t "~1Tmasks: #~%" (-> obj masks)) + (label cfg-4) + obj + ) + +;; definition of type texture-page-segment +(deftype texture-page-segment (structure) + ((block-data pointer :offset-assert 0) + (size uint32 :offset-assert 4) + (dest uint32 :offset-assert 8) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type texture-page-segment +(defmethod inspect texture-page-segment ((obj texture-page-segment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-page-segment) + (format #t "~1Tblock-data: #x~X~%" (-> obj block-data)) + (format #t "~1Tsize: #x~X~%" (-> obj size)) + (format #t "~1Tdest: #x~X~%" (-> obj dest)) + (label cfg-4) + obj + ) + +;; definition for function texture-mip->segment +(defun texture-mip->segment ((arg0 int) (arg1 int)) + (if (>= 2 arg1) + (+ (- -1 arg0) arg1) + (max 0 (- 2 arg0)) + ) + ) + +;; definition of type texture-page +(deftype texture-page (basic) + ((info file-info :offset-assert 4) + (name basic :offset-assert 8) + (id uint32 :offset-assert 12) + (length int32 :offset-assert 16) + (mip0-size uint32 :offset-assert 20) + (size uint32 :offset-assert 24) + (segment texture-page-segment 3 :inline :offset-assert 28) + (dram-size uint32 :offset-assert 64) + (pad uint32 15 :offset-assert 68) + (data texture :dynamic :offset-assert 128) + ) + :method-count-assert 14 + :size-assert #x80 + :flag-assert #xe00000080 + (:methods + (remove-from-heap (_type_ kheap) _type_ 9) + (get-leftover-block-count (_type_ int int) int 10) + (relocate-dests! (_type_ int int) none 11) + (texture-page-method-12 () none 12) + (upload-now! (_type_ int) none 13) + ) + ) + +;; definition for method 3 of type texture-page +(defmethod inspect texture-page ((obj texture-page)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tinfo: ~A~%" (-> obj info)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tmip0-size: ~D~%" (-> obj mip0-size)) + (format #t "~1Tsize: #x~X~%" (-> obj size)) + (format #t "~1Tsegment[3] @ #x~X~%" (-> obj segment)) + (format #t "~1Tdram-size: ~D~%" (-> obj dram-size)) + (format #t "~1Tpad[15] @ #x~X~%" (-> obj pad)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type shader-ptr +(deftype shader-ptr (uint32) + ((shader uint32 :offset 8 :size 24) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type texture-link +(deftype texture-link (structure) + ((next shader-ptr :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type texture-link +(defmethod inspect texture-link ((obj texture-link)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-link) + (format #t "~1Tnext: #x~X~%" (-> obj next)) + (label cfg-4) + obj + ) + +;; definition of type texture-page-dir-entry +(deftype texture-page-dir-entry (structure) + ((length int16 :offset-assert 0) + (status uint16 :offset-assert 2) + (page texture-page :offset-assert 4) + (link texture-link :offset-assert 8) + ) + :pack-me + :allow-misaligned + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type texture-page-dir-entry +(defmethod inspect texture-page-dir-entry ((obj texture-page-dir-entry)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-page-dir-entry) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tstatus: ~D~%" (-> obj status)) + (format #t "~1Tpage: ~A~%" (-> obj page)) + (format #t "~1Tlink: #x~X~%" (-> obj link)) + (label cfg-4) + obj + ) + +;; definition of type texture-page-dir +(deftype texture-page-dir (basic) + ((length int32 :offset-assert 4) + (entries texture-page-dir-entry 1 :inline :offset-assert 8) + ) + :method-count-assert 10 + :size-assert #x14 + :flag-assert #xa00000014 + (:methods + (relocate (_type_ kheap (pointer uint8)) none :replace 7) + (unlink-textures-in-heap! (_type_ kheap) int 9) + ) + ) + +;; definition of type texture-relocate-later +(deftype texture-relocate-later (basic) + ((memcpy symbol :offset-assert 4) + (dest uint32 :offset-assert 8) + (source uint32 :offset-assert 12) + (move uint32 :offset-assert 16) + (entry texture-page-dir-entry :offset-assert 20) + (page texture-page :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type texture-relocate-later +(defmethod inspect texture-relocate-later ((obj texture-relocate-later)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmemcpy: ~A~%" (-> obj memcpy)) + (format #t "~1Tdest: ~D~%" (-> obj dest)) + (format #t "~1Tsource: ~D~%" (-> obj source)) + (format #t "~1Tmove: ~D~%" (-> obj move)) + (format #t "~1Tentry: #~%" (-> obj entry)) + (format #t "~1Tpage: ~A~%" (-> obj page)) + (label cfg-4) + obj + ) + +;; definition for symbol *texture-relocate-later*, type texture-relocate-later +(define *texture-relocate-later* (new 'global 'texture-relocate-later)) + +;; failed to figure out what this is: +(set! (-> *texture-relocate-later* memcpy) #f) + +;; definition for symbol *texture-page-dir*, type texture-page-dir +(define *texture-page-dir* (the-as texture-page-dir #f)) + +;; definition of type adgif-shader +(deftype adgif-shader (structure) + ((quad qword 5 :inline :offset-assert 0) + (prims gs-reg64 10 :offset 0) + (reg-0 uint8 :offset 8) + (reg-1 uint8 :offset 24) + (reg-2 uint8 :offset 40) + (reg-3 uint8 :offset 56) + (reg-4 uint8 :offset 72) + (tex0 gs-tex0 :offset 0) + (tex1 gs-tex1 :offset 16) + (miptbp1 gs-miptbp :offset 32) + (clamp gs-clamp :offset 48) + (clamp-reg gs-reg64 :offset 56) + (alpha gs-alpha :offset 64) + (link-test link-test-flags :offset 8) + (texture-id texture-id :offset 24) + (next shader-ptr :offset 40) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type adgif-shader +(defmethod inspect adgif-shader ((obj adgif-shader)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'adgif-shader) + (format #t "~1Tquad[5] @ #x~X~%" (&-> obj tex0)) + (format #t "~1Tprims[10] @ #x~X~%" (&-> obj tex0)) + (format #t "~1Treg-0: ~D~%" (-> obj reg-0)) + (format #t "~1Treg-1: ~D~%" (-> obj reg-1)) + (format #t "~1Treg-2: ~D~%" (-> obj reg-2)) + (format #t "~1Treg-3: ~D~%" (-> obj reg-3)) + (format #t "~1Treg-4: ~D~%" (-> obj reg-4)) + (format #t "~1Ttex0: #x~X~%" (-> obj tex0)) + (format #t "~1Ttex1: #x~X~%" (-> obj tex1)) + (format #t "~1Tmiptbp1: #x~X~%" (-> obj miptbp1)) + (format #t "~1Tclamp: #x~X~%" (-> obj clamp)) + (format #t "~1Tclamp-reg: ~D~%" (-> obj clamp-reg)) + (format #t "~1Talpha: #x~X~%" (-> obj alpha)) + (format #t "~1Tlink-test: ~D~%" (-> obj link-test)) + (format #t "~1Ttexture-id: ~D~%" (-> obj texture-id)) + (format #t "~1Tnext: #x~X~%" (-> obj next)) + (label cfg-4) + obj + ) + +;; definition of type adgif-shader-array +(deftype adgif-shader-array (inline-array-class) + ((data adgif-shader :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type adgif-shader-array +(defmethod inspect adgif-shader-array ((obj adgif-shader-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! (-> adgif-shader-array heap-base) (the-as uint 80)) + +;; definition of type texture-base +(deftype texture-base (structure) + ((vram-page uint32 :offset-assert 0) + (vram-block uint32 :offset-assert 4) + (vram-word uint32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type texture-base +(defmethod inspect texture-base ((obj texture-base)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-base) + (format #t "~1Tvram-page: ~D~%" (-> obj vram-page)) + (format #t "~1Tvram-block: ~D~%" (-> obj vram-block)) + (format #t "~1Tvram-word: ~D~%" (-> obj vram-word)) + (label cfg-4) + obj + ) + +;; definition for symbol ct32-24-block-table, type (array int32) +(define ct32-24-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 0 + 1 + 4 + 5 + 16 + 17 + 20 + 21 + 2 + 3 + 6 + 7 + 18 + 19 + 22 + 23 + 8 + 9 + 12 + 13 + 24 + 25 + 28 + 29 + 10 + 11 + 14 + 15 + 26 + 27 + 30 + 31 + ) + ) + ) + +;; definition for symbol mz32-24-block-table, type (array int32) +(define mz32-24-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 16 + 17 + 20 + 21 + 0 + 1 + 4 + 5 + 18 + 19 + 22 + 23 + 2 + 3 + 6 + 7 + 24 + 25 + 28 + 29 + 8 + 9 + 12 + 13 + 26 + 27 + 30 + 31 + 10 + 11 + 14 + 15 + ) + ) + ) + +;; definition for symbol ct16-block-table, type (array int32) +(define ct16-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 0 + 2 + 8 + 10 + 1 + 3 + 9 + 11 + 4 + 6 + 12 + 14 + 5 + 7 + 13 + 15 + 16 + 18 + 24 + 26 + 17 + 19 + 25 + 27 + 20 + 22 + 28 + 30 + 21 + 23 + 29 + 31 + ) + ) + ) + +;; definition for symbol ct16s-block-table, type (array int32) +(define ct16s-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 0 + 2 + 16 + 18 + 1 + 3 + 17 + 19 + 8 + 10 + 24 + 26 + 9 + 11 + 25 + 27 + 4 + 6 + 20 + 22 + 5 + 7 + 21 + 23 + 12 + 14 + 28 + 30 + 13 + 15 + 29 + 31 + ) + ) + ) + +;; definition for symbol mz16-block-table, type (array int32) +(define mz16-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 16 + 18 + 24 + 26 + 17 + 19 + 25 + 27 + 20 + 22 + 28 + 30 + 21 + 23 + 29 + 31 + 0 + 2 + 8 + 10 + 1 + 3 + 9 + 11 + 4 + 6 + 12 + 14 + 5 + 7 + 13 + 15 + ) + ) + ) + +;; definition for symbol mz16s-block-table, type (array int32) +(define mz16s-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 16 + 18 + 0 + 2 + 17 + 19 + 1 + 3 + 24 + 26 + 8 + 10 + 25 + 27 + 9 + 11 + 20 + 22 + 4 + 6 + 21 + 23 + 5 + 7 + 28 + 30 + 12 + 14 + 29 + 31 + 13 + 15 + ) + ) + ) + +;; definition for symbol mt8-block-table, type (array int32) +(define mt8-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 0 + 1 + 4 + 5 + 16 + 17 + 20 + 21 + 2 + 3 + 6 + 7 + 18 + 19 + 22 + 23 + 8 + 9 + 12 + 13 + 24 + 25 + 28 + 29 + 10 + 11 + 14 + 15 + 26 + 27 + 30 + 31 + ) + ) + ) + +;; definition for symbol mt4-block-table, type (array int32) +(define mt4-block-table (the-as (array int32) (new 'static 'boxed-array :type int32 + 0 + 2 + 8 + 10 + 1 + 3 + 9 + 11 + 4 + 6 + 12 + 14 + 5 + 7 + 13 + 15 + 16 + 18 + 24 + 26 + 17 + 19 + 25 + 27 + 20 + 22 + 28 + 30 + 21 + 23 + 29 + 31 + ) + ) + ) + +;; definition of type texture-page-translate-item +(deftype texture-page-translate-item (structure) + ((bucket bucket-id :offset-assert 0) + (level-index uint32 :offset-assert 4) + (level-texture-page uint32 :offset-assert 8) + (texture-user uint32 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type texture-page-translate-item +(defmethod inspect texture-page-translate-item ((obj texture-page-translate-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'texture-page-translate-item) + (format #t "~1Tbucket: ~D~%" (-> obj bucket)) + (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) + (format #t "~1Tlevel-texture-page: ~D~%" (-> obj level-texture-page)) + (format #t "~1Ttexture-user: ~D~%" (-> obj texture-user)) + (label cfg-4) + obj + ) + +;; definition for symbol *texture-page-translate*, type (array texture-page-translate-item) +(define *texture-page-translate* + (the-as (array texture-page-translate-item) + (new 'static 'boxed-array :type texture-page-translate-item + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-4) + :level-index #x6 + :level-texture-page #x9 + :texture-user #x100 + ) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-7) :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-18) :level-index #x1 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-29) :level-index #x2 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-40) :level-index #x3 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-51) :level-index #x4 :texture-user #x1) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-62) :level-index #x5 :texture-user #x1) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-73) + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-82) + :level-index #x1 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-91) + :level-index #x2 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-100) + :level-index #x3 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-109) + :level-index #x4 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-118) + :level-index #x5 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-127) + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-137) + :level-index #x1 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-147) + :level-index #x2 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-157) + :level-index #x3 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-167) + :level-index #x4 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-177) + :level-index #x5 + :level-texture-page #x3 + :texture-user #x8 + ) + (new 'static 'texture-page-translate-item :bucket (bucket-id bucket-187) :level-index #x6 :texture-user #x1) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-191) + :level-index #x6 + :level-texture-page #x2 + :texture-user #x4 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-196) + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-200) + :level-index #x1 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-204) + :level-index #x2 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-208) + :level-index #x3 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-212) + :level-index #x4 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-216) + :level-index #x5 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-220) + :level-index #x6 + :level-texture-page #x1 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-224) + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-228) + :level-index #x1 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-232) + :level-index #x2 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-236) + :level-index #x3 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-240) + :level-index #x4 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-244) + :level-index #x5 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-248) + :level-index #x6 + :level-texture-page #x6 + :texture-user #x2 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-252) + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-261) + :level-index #x1 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-270) + :level-index #x2 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-279) + :level-index #x3 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-288) + :level-index #x4 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-297) + :level-index #x5 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-306) + :level-index #x6 + :level-texture-page #x4 + :texture-user #x10 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-309) + :level-index #x6 + :level-texture-page #x9 + :texture-user #x100 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x1 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x2 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x3 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x4 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x5 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-312) + :level-index #x6 + :level-texture-page #x7 + :texture-user #x40 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x1 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x2 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x3 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x4 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x5 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-316) + :level-index #x6 + :level-texture-page #x5 + :texture-user #x20 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x1 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x2 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x3 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x4 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x5 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x6 + :level-texture-page #x8 + :texture-user #x80 + ) + (new 'static 'texture-page-translate-item + :bucket (bucket-id bucket-319) + :level-index #x6 + :level-texture-page #x3 + :texture-user #x80 + ) + ) + ) + ) + +;; definition for symbol *eyes-texture-base*, type texture-base +(define *eyes-texture-base* (new 'static 'texture-base)) + +;; definition for symbol *skull-gem-texture-base*, type texture-base +(define *skull-gem-texture-base* (new 'static 'texture-base)) + +;; definition for symbol *ocean-texture-base*, type texture-base +(define *ocean-texture-base* (new 'static 'texture-base)) + +;; definition for symbol *ocean-envmap-texture-base*, type texture-base +(define *ocean-envmap-texture-base* (new 'static 'texture-base)) + +;; definition for symbol *grey-scale-base*, type texture-base +(define *grey-scale-base* (new 'static 'texture-base)) + +;; definition for symbol *map-texture-base*, type texture-base +(define *map-texture-base* (new 'static 'texture-base)) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/gfx/tfrag/tfrag-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/tfrag/tfrag-h_REF.gc new file mode 100644 index 0000000000..894ae6a189 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/tfrag/tfrag-h_REF.gc @@ -0,0 +1,496 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tfragment-stats +(deftype tfragment-stats (structure) + ((num-tris uint16 4 :offset-assert 0) + (num-dverts uint16 4 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type tfragment-stats +(defmethod inspect tfragment-stats ((obj tfragment-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfragment-stats) + (format #t "~1Tnum-tris[4] @ #x~X~%" (-> obj num-tris)) + (format #t "~1Tnum-dverts[4] @ #x~X~%" (-> obj num-dverts)) + (label cfg-4) + obj + ) + +;; definition of type tfragment-debug-data +(deftype tfragment-debug-data (structure) + ((stats tfragment-stats :inline :offset-assert 0) + (debug-lines (array vector-array) :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type tfragment-debug-data +(defmethod inspect tfragment-debug-data ((obj tfragment-debug-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfragment-debug-data) + (format #t "~1Tstats: #~%" (-> obj stats)) + (format #t "~1Tdebug-lines: ~A~%" (-> obj debug-lines)) + (label cfg-4) + obj + ) + +;; definition of type generic-tfragment +(deftype generic-tfragment (structure) + ((dummy int32 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type generic-tfragment +(defmethod inspect generic-tfragment ((obj generic-tfragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tfragment) + (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type tfragment +(deftype tfragment (drawable) + ((color-index uint16 :offset 6) + (debug-data tfragment-debug-data :offset 8) + (color-indices uint32 :offset 12) + (colors uint32 :offset 12) + (dma-chain uint32 3 :offset 32) + (dma-common uint32 :offset 32) + (dma-level-0 uint32 :offset 32) + (dma-base uint32 :offset 36) + (dma-level-1 uint32 :offset 40) + (dma-qwc uint8 4 :offset 44) + (shader (inline-array adgif-shader) :offset 48) + (num-shaders uint8 :offset 52) + (num-base-colors uint8 :offset 53) + (num-level0-colors uint8 :offset 54) + (num-level1-colors uint8 :offset 55) + (color-offset uint8 :offset 56) + (color-count uint8 :offset 57) + (texture-masks-index uint16 :offset 58) + (generic generic-tfragment :offset 60) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +;; definition for method 3 of type tfragment +(defmethod inspect tfragment ((obj tfragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tcolor-index: ~D~%" (-> obj color-index)) + (format #t "~1Tdebug-data: #~%" (-> obj debug-data)) + (format #t "~1Tcolor-indices: #x~X~%" (-> obj color-indices)) + (format #t "~1Tcolors: #x~X~%" (-> obj color-indices)) + (format #t "~1Tdma-chain[3] @ #x~X~%" (-> obj dma-chain)) + (format #t "~1Tdma-common: #x~X~%" (-> obj dma-common)) + (format #t "~1Tdma-level-0: #x~X~%" (-> obj dma-common)) + (format #t "~1Tdma-base: #x~X~%" (-> obj dma-base)) + (format #t "~1Tdma-level-1: #x~X~%" (-> obj dma-level-1)) + (format #t "~1Tdma-qwc[4] @ #x~X~%" (-> obj dma-qwc)) + (format #t "~1Tshader: #x~X~%" (-> obj shader)) + (format #t "~1Tnum-shaders: ~D~%" (-> obj num-shaders)) + (format #t "~1Tnum-base-colors: ~D~%" (-> obj num-base-colors)) + (format #t "~1Tnum-level0-colors: ~D~%" (-> obj num-level0-colors)) + (format #t "~1Tnum-level1-colors: ~D~%" (-> obj num-level1-colors)) + (format #t "~1Tcolor-offset: ~D~%" (-> obj color-offset)) + (format #t "~1Tcolor-count: ~D~%" (-> obj color-count)) + (format #t "~1Ttexture-masks-index: ~D~%" (-> obj texture-masks-index)) + (format #t "~1Tgeneric: #~%" (-> obj generic)) + (label cfg-4) + obj + ) + +;; definition of type drawable-inline-array-tfrag +(deftype drawable-inline-array-tfrag (drawable-inline-array) + ((data tfragment 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 96) + ) + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ) + +;; definition of type drawable-inline-array-tfrag-trans +(deftype drawable-inline-array-tfrag-trans (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline :offset-assert 112) + (pad2 uint32 :offset-assert 176) + ) + :method-count-assert 17 + :size-assert #xb4 + :flag-assert #x11000000b4 + ) + +;; definition of type drawable-inline-array-tfrag-water +(deftype drawable-inline-array-tfrag-water (drawable-inline-array-tfrag) + ((data2 tfragment 1 :inline :offset-assert 112) + (pad2 uint32 :offset-assert 176) + ) + :method-count-assert 17 + :size-assert #xb4 + :flag-assert #x11000000b4 + ) + +;; definition of type drawable-tree-tfrag +(deftype drawable-tree-tfrag (drawable-tree) + ((time-of-day-pal time-of-day-palette :offset 12) + (arrays drawable-inline-array :dynamic :offset 32) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type drawable-tree-tfrag-trans +(deftype drawable-tree-tfrag-trans (drawable-tree-tfrag) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type drawable-tree-tfrag-water +(deftype drawable-tree-tfrag-water (drawable-tree-tfrag-trans) + () + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition of type tfrag-dists +(deftype tfrag-dists (structure) + ((data uint32 16 :offset-assert 0) + (vector vector 4 :inline :offset 0) + (k0s vector 2 :inline :offset 0) + (k1s vector 2 :inline :offset 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type tfrag-dists +(defmethod inspect tfrag-dists ((obj tfrag-dists)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-dists) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj k0s)) + (format #t "~1Tvector[4] @ #x~X~%" (-> obj k0s)) + (format #t "~1Tk0s[2] @ #x~X~%" (-> obj k0s)) + (format #t "~1Tk1s[2] @ #x~X~%" (-> obj k1s)) + (label cfg-4) + obj + ) + +;; definition of type tfrag-data +(deftype tfrag-data (structure) + ((data uint32 56 :offset 0) + (vector vector 14 :inline :offset 0) + (fog vector :inline :offset 0) + (val vector :inline :offset 16) + (strgif gs-gif-tag :inline :offset 32) + (fangif gs-gif-tag :inline :offset 48) + (adgif gs-gif-tag :inline :offset 64) + (hvdf-offset vector :inline :offset 80) + (hmge-scale vector :inline :offset 96) + (invh-scale vector :inline :offset 112) + (ambient vector :inline :offset 128) + (guard vector :inline :offset 144) + (dists tfrag-dists :inline :offset 160) + (k0s uint128 2 :offset 160) + (k1s uint128 2 :offset 192) + ) + :method-count-assert 9 + :size-assert #xe0 + :flag-assert #x9000000e0 + ) + +;; definition for method 3 of type tfrag-data +(defmethod inspect tfrag-data ((obj tfrag-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-data) + (format #t "~1Tdata[56] @ #x~X~%" (-> obj fog)) + (format #t "~1Tvector[14] @ #x~X~%" (-> obj fog)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tval: #~%" (-> obj val)) + (format #t "~1Tstrgif: #~%" (-> obj strgif)) + (format #t "~1Tfangif: #~%" (-> obj fangif)) + (format #t "~1Tadgif: #~%" (-> obj adgif)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Thmge-scale: #~%" (-> obj hmge-scale)) + (format #t "~1Tinvh-scale: #~%" (-> obj invh-scale)) + (format #t "~1Tambient: #~%" (-> obj ambient)) + (format #t "~1Tguard: #~%" (-> obj guard)) + (format #t "~1Tdists: #~%" (-> obj dists)) + (format #t "~1Tk0s[2] @ #x~X~%" (-> obj dists)) + (format #t "~1Tk1s[2] @ #x~X~%" (-> obj dists k1s)) + (label cfg-4) + obj + ) + +;; definition of type tfrag-control +(deftype tfrag-control (structure) + ((num-base-points uint32 :offset-assert 0) + (num-shared-base-points uint32 :offset-assert 4) + (num-level0-points uint32 :offset-assert 8) + (num-shared-level0-points uint32 :offset-assert 12) + (num-level1-points uint32 :offset-assert 16) + (num-shared-level1-points uint32 :offset-assert 20) + (ptr-vtxdata uint32 :offset-assert 24) + (ptr-base-points uint32 :offset-assert 28) + (ptr-shared-base-points uint32 :offset-assert 32) + (ptr-level0-points uint32 :offset-assert 36) + (ptr-shared-level0-points uint32 :offset-assert 40) + (ptr-level1-points uint32 :offset-assert 44) + (ptr-shared-level1-points uint32 :offset-assert 48) + (ptr-draw-points uint32 :offset-assert 52) + (ptr-interpolated-0 uint32 :offset-assert 56) + (ptr-shared-interpolated-0 uint32 :offset-assert 60) + (ptr-interpolated1 uint32 :offset-assert 64) + (ptr-shared-interpolated1 uint32 :offset-assert 68) + (ptr-strip-data uint32 :offset-assert 72) + (ptr-texture-data uint32 :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type tfrag-control +(defmethod inspect tfrag-control ((obj tfrag-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-control) + (format #t "~1Tnum-base-points: ~D~%" (-> obj num-base-points)) + (format #t "~1Tnum-shared-base-points: ~D~%" (-> obj num-shared-base-points)) + (format #t "~1Tnum-level0-points: ~D~%" (-> obj num-level0-points)) + (format #t "~1Tnum-shared-level0-points: ~D~%" (-> obj num-shared-level0-points)) + (format #t "~1Tnum-level1-points: ~D~%" (-> obj num-level1-points)) + (format #t "~1Tnum-shared-level1-points: ~D~%" (-> obj num-shared-level1-points)) + (format #t "~1Tptr-vtxdata: ~D~%" (-> obj ptr-vtxdata)) + (format #t "~1Tptr-base-points: ~D~%" (-> obj ptr-base-points)) + (format #t "~1Tptr-shared-base-points: ~D~%" (-> obj ptr-shared-base-points)) + (format #t "~1Tptr-level0-points: ~D~%" (-> obj ptr-level0-points)) + (format #t "~1Tptr-shared-level0-points: ~D~%" (-> obj ptr-shared-level0-points)) + (format #t "~1Tptr-level1-points: ~D~%" (-> obj ptr-level1-points)) + (format #t "~1Tptr-shared-level1-points: ~D~%" (-> obj ptr-shared-level1-points)) + (format #t "~1Tptr-draw-points: ~D~%" (-> obj ptr-draw-points)) + (format #t "~1Tptr-interpolated-0: ~D~%" (-> obj ptr-interpolated-0)) + (format #t "~1Tptr-shared-interpolated-0: ~D~%" (-> obj ptr-shared-interpolated-0)) + (format #t "~1Tptr-interpolated1: ~D~%" (-> obj ptr-interpolated1)) + (format #t "~1Tptr-shared-interpolated1: ~D~%" (-> obj ptr-shared-interpolated1)) + (format #t "~1Tptr-strip-data: ~D~%" (-> obj ptr-strip-data)) + (format #t "~1Tptr-texture-data: ~D~%" (-> obj ptr-texture-data)) + (label cfg-4) + obj + ) + +;; definition of type tfrag-stats +(deftype tfrag-stats (structure) + ((from int32 :offset-assert 0) + (to int32 :offset-assert 4) + (cnt int32 :offset-assert 8) + (tris int32 :offset-assert 12) + (tfaces int32 :offset-assert 16) + (tfrags int32 :offset-assert 20) + (dtris int32 :offset-assert 24) + (base-verts int32 :offset-assert 28) + (level0-verts int32 :offset-assert 32) + (level1-verts int32 :offset-assert 36) + (dma-cnt int32 :offset-assert 40) + (dma-dta int32 :offset-assert 44) + (dma-tex int32 :offset-assert 48) + (strips int32 :offset-assert 52) + (drawpoints int32 :offset-assert 56) + (vif int32 :offset-assert 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type tfrag-stats +(defmethod inspect tfrag-stats ((obj tfrag-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-stats) + (format #t "~1Tfrom: ~D~%" (-> obj from)) + (format #t "~1Tto: ~D~%" (-> obj to)) + (format #t "~1Tcnt: ~D~%" (-> obj cnt)) + (format #t "~1Ttris: ~D~%" (-> obj tris)) + (format #t "~1Ttfaces: ~D~%" (-> obj tfaces)) + (format #t "~1Ttfrags: ~D~%" (-> obj tfrags)) + (format #t "~1Tdtris: ~D~%" (-> obj dtris)) + (format #t "~1Tbase-verts: ~D~%" (-> obj base-verts)) + (format #t "~1Tlevel0-verts: ~D~%" (-> obj level0-verts)) + (format #t "~1Tlevel1-verts: ~D~%" (-> obj level1-verts)) + (format #t "~1Tdma-cnt: ~D~%" (-> obj dma-cnt)) + (format #t "~1Tdma-dta: ~D~%" (-> obj dma-dta)) + (format #t "~1Tdma-tex: ~D~%" (-> obj dma-tex)) + (format #t "~1Tstrips: ~D~%" (-> obj strips)) + (format #t "~1Tdrawpoints: ~D~%" (-> obj drawpoints)) + (format #t "~1Tvif: ~D~%" (-> obj vif)) + (label cfg-4) + obj + ) + +;; definition of type tfrag-packet +(deftype tfrag-packet (structure) + ((tag uint128 2 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type tfrag-packet +(defmethod inspect tfrag-packet ((obj tfrag-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-packet) + (format #t "~1Ttag[2] @ #x~X~%" (-> obj tag)) + (label cfg-4) + obj + ) + +;; definition of type tfrag-work +(deftype tfrag-work (structure) + ((base-tmpl dma-packet :inline :offset-assert 0) + (level-0-tmpl dma-packet :inline :offset-assert 16) + (common-tmpl dma-packet :inline :offset-assert 32) + (level-1-tmpl dma-packet :inline :offset-assert 48) + (color-tmpl dma-packet :inline :offset-assert 64) + (frag-dists vector :inline :offset-assert 80) + (min-dist vector :inline :offset-assert 96) + (color-ptr vector4w :inline :offset-assert 112) + (tr-stat-tfrag tr-stat :offset-assert 128) + (tr-stat-tfrag-scissor tr-stat :offset-assert 132) + (vu1-enable-tfrag int32 :offset-assert 136) + (vu1-enable-tfrag-scissor int32 :offset-assert 140) + (cur-vis-bits uint32 :offset-assert 144) + (end-vis-bits uint32 :offset-assert 148) + (src-ptr uint32 :offset-assert 152) + (last-call uint32 :offset-assert 156) + (dma-buffer basic :offset-assert 160) + (test-id uint32 :offset-assert 164) + (wait-from-spr uint32 :offset-assert 168) + (wait-to-spr uint32 :offset-assert 172) + (near-wait-from-spr uint32 :offset-assert 176) + (near-wait-to-spr uint32 :offset-assert 180) + (max-fragment uint16 :offset-assert 184) + (min-fragment uint16 :offset-assert 186) + (texture-dists uint32 :offset-assert 188) + ) + :method-count-assert 9 + :size-assert #xc0 + :flag-assert #x9000000c0 + ) + +;; definition for method 3 of type tfrag-work +(defmethod inspect tfrag-work ((obj tfrag-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-work) + (format #t "~1Tbase-tmpl: #~%" (-> obj base-tmpl)) + (format #t "~1Tlevel-0-tmpl: #~%" (-> obj level-0-tmpl)) + (format #t "~1Tcommon-tmpl: #~%" (-> obj common-tmpl)) + (format #t "~1Tlevel-1-tmpl: #~%" (-> obj level-1-tmpl)) + (format #t "~1Tcolor-tmpl: #~%" (-> obj color-tmpl)) + (format #t "~1Tfrag-dists: #~%" (-> obj frag-dists)) + (format #t "~1Tmin-dist: #~%" (-> obj min-dist)) + (format #t "~1Tcolor-ptr: #~%" (-> obj color-ptr)) + (format #t "~1Ttr-stat-tfrag: #~%" (-> obj tr-stat-tfrag)) + (format #t "~1Ttr-stat-tfrag-scissor: #~%" (-> obj tr-stat-tfrag-scissor)) + (format #t "~1Tvu1-enable-tfrag: ~D~%" (-> obj vu1-enable-tfrag)) + (format #t "~1Tvu1-enable-tfrag-scissor: ~D~%" (-> obj vu1-enable-tfrag-scissor)) + (format #t "~1Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits)) + (format #t "~1Tend-vis-bits: ~D~%" (-> obj end-vis-bits)) + (format #t "~1Tsrc-ptr: ~D~%" (-> obj src-ptr)) + (format #t "~1Tlast-call: ~D~%" (-> obj last-call)) + (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) + (format #t "~1Ttest-id: ~D~%" (-> obj test-id)) + (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) + (format #t "~1Tnear-wait-from-spr: ~D~%" (-> obj near-wait-from-spr)) + (format #t "~1Tnear-wait-to-spr: ~D~%" (-> obj near-wait-to-spr)) + (format #t "~1Tmax-fragment: ~D~%" (-> obj max-fragment)) + (format #t "~1Tmin-fragment: ~D~%" (-> obj min-fragment)) + (format #t "~1Ttexture-dists: #x~X~%" (-> obj texture-dists)) + (label cfg-4) + obj + ) + +;; definition of type tfrag-dma +(deftype tfrag-dma (structure) + ((banka tfragment 16 :inline :offset-assert 0) + (bankb tfragment 16 :inline :offset-assert 1024) + (outa uint128 128 :offset-assert 2048) + (outb uint128 128 :offset-assert 4096) + (colors rgba 2047 :offset-assert 6144) + ) + :method-count-assert 9 + :size-assert #x37fc + :flag-assert #x9000037fc + ) + +;; definition for method 3 of type tfrag-dma +(defmethod inspect tfrag-dma ((obj tfrag-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tfrag-dma) + (format #t "~1Tbanka[16] @ #x~X~%" (-> obj banka)) + (format #t "~1Tbankb[16] @ #x~X~%" (-> obj bankb)) + (format #t "~1Touta[128] @ #x~X~%" (-> obj outa)) + (format #t "~1Toutb[128] @ #x~X~%" (-> obj outb)) + (format #t "~1Tcolors[2048] @ #x~X~%" (-> obj colors)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/tie/generic-tie-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/tie/generic-tie-h_REF.gc new file mode 100644 index 0000000000..eeca28254b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/tie/generic-tie-h_REF.gc @@ -0,0 +1,534 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type generic-tie-instance +(deftype generic-tie-instance (structure) + ((matrix-tag dma-packet :inline :offset-assert 0) + (matrix-data vector 6 :inline :offset-assert 16) + (index-tag dma-packet :inline :offset-assert 112) + (indices uint8 224 :offset-assert 128) + (end-tag dma-packet :inline :offset-assert 352) + ) + :method-count-assert 9 + :size-assert #x170 + :flag-assert #x900000170 + ) + +;; definition for method 3 of type generic-tie-instance +(defmethod inspect generic-tie-instance ((obj generic-tie-instance)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-instance) + (format #t "~1Tmatrix-tag: #~%" (-> obj matrix-tag)) + (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data)) + (format #t "~1Tindex-tag: #~%" (-> obj index-tag)) + (format #t "~1Tindices[224] @ #x~X~%" (-> obj indices)) + (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-input +(deftype generic-tie-input (structure) + ((palette-tag dma-packet :inline :offset-assert 0) + (palette rgba 128 :offset-assert 16) + (model-tag dma-packet :inline :offset-assert 528) + (model vector 146 :inline :offset-assert 544) + (matrix-tag dma-packet :inline :offset-assert 2880) + (matrix-data vector 6 :inline :offset-assert 2896) + (index-tag dma-packet :inline :offset-assert 2992) + (indices uint8 224 :offset-assert 3008) + (end-tag dma-packet :inline :offset-assert 3232) + ) + :method-count-assert 9 + :size-assert #xcb0 + :flag-assert #x900000cb0 + ) + +;; definition for method 3 of type generic-tie-input +(defmethod inspect generic-tie-input ((obj generic-tie-input)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-input) + (format #t "~1Tpalette-tag: #~%" (-> obj palette-tag)) + (format #t "~1Tpalette[128] @ #x~X~%" (-> obj palette)) + (format #t "~1Tmodel-tag: #~%" (-> obj model-tag)) + (format #t "~1Tmodel[146] @ #x~X~%" (-> obj model)) + (format #t "~1Tmatrix-tag: #~%" (-> obj matrix-tag)) + (format #t "~1Tmatrix-data[6] @ #x~X~%" (-> obj matrix-data)) + (format #t "~1Tindex-tag: #~%" (-> obj index-tag)) + (format #t "~1Tindices[224] @ #x~X~%" (-> obj indices)) + (format #t "~1Tend-tag: #~%" (-> obj end-tag)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-run-control +(deftype generic-tie-run-control (structure) + ((skip-bp2 uint8 :offset-assert 0) + (skip-ips uint8 :offset-assert 1) + (gifbuf-skip uint8 :offset-assert 2) + (strips uint8 :offset-assert 3) + (target-bp1 uint8 :offset-assert 4) + (target-bp2 uint8 :offset-assert 5) + (target-ip1 uint8 :offset-assert 6) + (target-ip2 uint8 :offset-assert 7) + (target-bps uint8 :offset-assert 8) + (target-ips uint8 :offset-assert 9) + (is-generic uint8 :offset-assert 10) + (reserved uint8 :offset-assert 11) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type generic-tie-run-control +(defmethod inspect generic-tie-run-control ((obj generic-tie-run-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-run-control) + (format #t "~1Tskip-bp2: ~D~%" (-> obj skip-bp2)) + (format #t "~1Tskip-ips: ~D~%" (-> obj skip-ips)) + (format #t "~1Tgifbuf-skip: ~D~%" (-> obj gifbuf-skip)) + (format #t "~1Tstrips: ~D~%" (-> obj strips)) + (format #t "~1Ttarget-bp1: ~D~%" (-> obj target-bp1)) + (format #t "~1Ttarget-bp2: ~D~%" (-> obj target-bp2)) + (format #t "~1Ttarget-ip1: ~D~%" (-> obj target-ip1)) + (format #t "~1Ttarget-ip2: ~D~%" (-> obj target-ip2)) + (format #t "~1Ttarget-bps: ~D~%" (-> obj target-bps)) + (format #t "~1Ttarget-ips: ~D~%" (-> obj target-ips)) + (format #t "~1Tis-generic: ~D~%" (-> obj is-generic)) + (format #t "~1Treserved: ~D~%" (-> obj reserved)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-base-point +(deftype generic-tie-base-point (structure) + ((data uint16 8 :offset-assert 0) + (quad uint128 :offset 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (d0 int16 :offset 6) + (vtx uint64 :offset 0) + (u int16 :offset 8) + (v int16 :offset 10) + (tex uint32 :offset 8) + (w int16 :offset 12) + (d1 int16 :offset 14) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type generic-tie-base-point +;; INFO: Used lq/sq +(defmethod inspect generic-tie-base-point ((obj generic-tie-base-point)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-base-point) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Td0: ~D~%" (-> obj d0)) + (format #t "~1Tvtx: ~D~%" (-> obj vtx)) + (format #t "~1Tu: ~D~%" (-> obj u)) + (format #t "~1Tv: ~D~%" (-> obj v)) + (format #t "~1Ttex: ~D~%" (-> obj tex)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Td1: ~D~%" (-> obj d1)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-bps +(deftype generic-tie-bps (structure) + ((bp generic-tie-base-point 4 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type generic-tie-bps +(defmethod inspect generic-tie-bps ((obj generic-tie-bps)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-bps) + (format #t "~1Tbp[4] @ #x~X~%" (-> obj bp)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-interp-point +(deftype generic-tie-interp-point (structure) + ((data uint16 12 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (d0 int16 :offset 6) + (vtx0 uint64 :offset 0) + (dx int16 :offset 8) + (dy int16 :offset 10) + (dz int16 :offset 12) + (unused int16 :offset 14) + (vtx1 uint64 :offset 8) + (u int16 :offset 16) + (v int16 :offset 18) + (tex uint32 :offset 16) + (w int16 :offset 20) + (d1 int16 :offset 22) + ) + :pack-me + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type generic-tie-interp-point +;; INFO: Used lq/sq +(defmethod inspect generic-tie-interp-point ((obj generic-tie-interp-point)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-interp-point) + (format #t "~1Tdata[12] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> (the-as (pointer uint128) obj) 0)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Td0: ~D~%" (-> obj d0)) + (format #t "~1Tvtx0: ~D~%" (-> obj vtx0)) + (format #t "~1Tdx: ~D~%" (-> obj dx)) + (format #t "~1Tdy: ~D~%" (-> obj dy)) + (format #t "~1Tdz: ~D~%" (-> obj dz)) + (format #t "~1Tunused: ~D~%" (-> obj unused)) + (format #t "~1Tvtx1: ~D~%" (-> obj vtx1)) + (format #t "~1Tu: ~D~%" (-> obj u)) + (format #t "~1Tv: ~D~%" (-> obj v)) + (format #t "~1Ttex: ~D~%" (-> obj tex)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Td1: ~D~%" (-> obj d1)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-ips +(deftype generic-tie-ips (structure) + ((ip generic-tie-interp-point 2 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type generic-tie-ips +(defmethod inspect generic-tie-ips ((obj generic-tie-ips)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-ips) + (format #t "~1Tip[2] @ #x~X~%" (-> obj ip)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-header +(deftype generic-tie-header (structure) + ((effect uint8 :offset-assert 0) + (interp-table-size uint8 :offset-assert 1) + (num-bps uint8 :offset-assert 2) + (num-ips uint8 :offset-assert 3) + (tint-color uint32 :offset-assert 4) + (index-table-offset uint16 :offset-assert 8) + (kick-table-offset uint16 :offset-assert 10) + (normal-table-offset uint16 :offset-assert 12) + (interp-table-offset uint16 :offset-assert 14) + (gsf-header gsf-header :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type generic-tie-header +(defmethod inspect generic-tie-header ((obj generic-tie-header)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-header) + (format #t "~1Teffect: ~D~%" (-> obj effect)) + (format #t "~1Tinterp-table-size: ~D~%" (-> obj interp-table-size)) + (format #t "~1Tnum-bps: ~D~%" (-> obj num-bps)) + (format #t "~1Tnum-ips: ~D~%" (-> obj num-ips)) + (format #t "~1Ttint-color: ~D~%" (-> obj tint-color)) + (format #t "~1Tindex-table-offset: ~D~%" (-> obj index-table-offset)) + (format #t "~1Tkick-table-offset: ~D~%" (-> obj kick-table-offset)) + (format #t "~1Tnormal-table-offset: ~D~%" (-> obj normal-table-offset)) + (format #t "~1Tinterp-table-offset: ~D~%" (-> obj interp-table-offset)) + (format #t "~1Tgsf-header: #~%" (-> obj gsf-header)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-matrix +(deftype generic-tie-matrix (structure) + ((matrix matrix :inline :offset-assert 0) + (morph vector :inline :offset-assert 64) + (fog qword :inline :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type generic-tie-matrix +(defmethod inspect generic-tie-matrix ((obj generic-tie-matrix)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-matrix) + (format #t "~1Tmatrix: #~%" (-> obj matrix)) + (format #t "~1Tmorph: #~%" (-> obj morph)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-normal +(deftype generic-tie-normal (structure) + ((x int8 :offset-assert 0) + (y int8 :offset-assert 1) + (z int8 :offset-assert 2) + (dummy int8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type generic-tie-normal +(defmethod inspect generic-tie-normal ((obj generic-tie-normal)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-normal) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tdummy: ~D~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-control +(deftype generic-tie-control (structure) + ((ptr-palette uint32 :offset-assert 0) + (ptr-shaders uint32 :offset-assert 4) + (ptr-runctrl generic-tie-run-control :offset-assert 8) + (ptr-verts uint32 :offset-assert 12) + (ptr-generic generic-tie-header :offset-assert 16) + (ptr-dps uint32 :offset-assert 20) + (ptr-kicks uint32 :offset-assert 24) + (ptr-normals uint32 :offset-assert 28) + (ptr-interp uint32 :offset-assert 32) + (ptr-mtxs generic-tie-matrix :offset-assert 36) + (ptr-cinds uint32 :offset-assert 40) + (next-instance uint32 :offset-assert 44) + (next-model uint32 :offset-assert 48) + (next-is-model uint32 :offset-assert 52) + (tie-type uint32 :offset-assert 56) + ) + :method-count-assert 9 + :size-assert #x3c + :flag-assert #x90000003c + ) + +;; definition for method 3 of type generic-tie-control +(defmethod inspect generic-tie-control ((obj generic-tie-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-control) + (format #t "~1Tptr-palette: #x~X~%" (-> obj ptr-palette)) + (format #t "~1Tptr-shaders: #x~X~%" (-> obj ptr-shaders)) + (format #t "~1Tptr-runctrl: #~%" (-> obj ptr-runctrl)) + (format #t "~1Tptr-verts: #x~X~%" (-> obj ptr-verts)) + (format #t "~1Tptr-generic: #~%" (-> obj ptr-generic)) + (format #t "~1Tptr-dps: #x~X~%" (-> obj ptr-dps)) + (format #t "~1Tptr-kicks: #x~X~%" (-> obj ptr-kicks)) + (format #t "~1Tptr-normals: #x~X~%" (-> obj ptr-normals)) + (format #t "~1Tptr-interp: #x~X~%" (-> obj ptr-interp)) + (format #t "~1Tptr-mtxs: #~%" (-> obj ptr-mtxs)) + (format #t "~1Tptr-cinds: #x~X~%" (-> obj ptr-cinds)) + (format #t "~1Tnext-instance: #x~X~%" (-> obj next-instance)) + (format #t "~1Tnext-model: #x~X~%" (-> obj next-model)) + (format #t "~1Tnext-is-model: ~D~%" (-> obj next-is-model)) + (format #t "~1Ttie-type: ~D~%" (-> obj tie-type)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-stats +(deftype generic-tie-stats (structure) + ((num-bps uint32 :offset-assert 0) + (num-ips uint32 :offset-assert 4) + (num-dps uint32 :offset-assert 8) + (num-shaders uint32 :offset-assert 12) + (num-models uint32 :offset-assert 16) + (num-instances uint32 :offset-assert 20) + (num-waits uint32 :offset-assert 24) + (num-qwc uint32 :offset-assert 28) + (max-qwc uint32 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type generic-tie-stats +(defmethod inspect generic-tie-stats ((obj generic-tie-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-stats) + (format #t "~1Tnum-bps: ~D~%" (-> obj num-bps)) + (format #t "~1Tnum-ips: ~D~%" (-> obj num-ips)) + (format #t "~1Tnum-dps: ~D~%" (-> obj num-dps)) + (format #t "~1Tnum-shaders: ~D~%" (-> obj num-shaders)) + (format #t "~1Tnum-models: ~D~%" (-> obj num-models)) + (format #t "~1Tnum-instances: ~D~%" (-> obj num-instances)) + (format #t "~1Tnum-waits: ~D~%" (-> obj num-waits)) + (format #t "~1Tnum-qwc: ~D~%" (-> obj num-qwc)) + (format #t "~1Tmax-qwc: ~D~%" (-> obj max-qwc)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-calls +(deftype generic-tie-calls (structure) + ((generic-prepare-dma-double basic :offset-assert 0) + (generic-envmap-dproc basic :offset-assert 4) + (generic-interp-dproc basic :offset-assert 8) + (generic-no-light-dproc basic :offset-assert 12) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type generic-tie-calls +(defmethod inspect generic-tie-calls ((obj generic-tie-calls)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-calls) + (format #t "~1Tgeneric-prepare-dma-double: ~A~%" (-> obj generic-prepare-dma-double)) + (format #t "~1Tgeneric-envmap-dproc: ~A~%" (-> obj generic-envmap-dproc)) + (format #t "~1Tgeneric-interp-dproc: ~A~%" (-> obj generic-interp-dproc)) + (format #t "~1Tgeneric-no-light-dproc: ~A~%" (-> obj generic-no-light-dproc)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-shadow +(deftype generic-tie-shadow (structure) + ((out-buf gsf-buffer :offset-assert 0) + (cur-buf uint32 :offset-assert 4) + (tie-type int32 :offset-assert 8) + (ptr-inst uint32 :offset-assert 12) + (ptr-buf uint32 :offset-assert 16) + (inst-xor int32 :offset-assert 20) + (end-of-chain uint32 :offset-assert 24) + (write-limit uint32 :offset-assert 28) + (calls generic-tie-calls :inline :offset-assert 32) + ) + :pack-me + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type generic-tie-shadow +(defmethod inspect generic-tie-shadow ((obj generic-tie-shadow)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-shadow) + (format #t "~1Tout-buf: #~%" (-> obj out-buf)) + (format #t "~1Tcur-buf: #x~X~%" (-> obj cur-buf)) + (format #t "~1Ttie-type: ~D~%" (-> obj tie-type)) + (format #t "~1Tptr-inst: #x~X~%" (-> obj ptr-inst)) + (format #t "~1Tptr-buf: #x~X~%" (-> obj ptr-buf)) + (format #t "~1Tinst-xor: ~D~%" (-> obj inst-xor)) + (format #t "~1Tend-of-chain: ~D~%" (-> obj end-of-chain)) + (format #t "~1Twrite-limit: ~D~%" (-> obj write-limit)) + (format #t "~1Tcalls: #~%" (-> obj calls)) + (label cfg-4) + obj + ) + +;; definition of type generic-tie-work +(deftype generic-tie-work (structure) + ((control generic-tie-control :inline :offset-assert 0) + (interp-job generic-interp-job :inline :offset-assert 60) + (shadow generic-tie-shadow :inline :offset-assert 76) + (input-a generic-tie-input :inline :offset-assert 128) + (input-b generic-tie-input :inline :offset-assert 3376) + (inst-buf generic-tie-instance :inline :offset-assert 6624) + (palette-buf rgba 128 :offset-assert 6992) + ) + :method-count-assert 9 + :size-assert #x1d50 + :flag-assert #x900001d50 + ) + +;; definition for method 3 of type generic-tie-work +(defmethod inspect generic-tie-work ((obj generic-tie-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-tie-work) + (format #t "~1Tcontrol: #~%" (-> obj control)) + (format #t "~1Tinterp-job: #~%" (-> obj interp-job)) + (format #t "~1Tshadow: #~%" (-> obj shadow)) + (format #t "~1Tinput-a: #~%" (-> obj input-a)) + (format #t "~1Tinput-b: #~%" (-> obj input-b)) + (format #t "~1Tinst-buf: #~%" (-> obj inst-buf)) + (format #t "~1Tpalette-buf[128] @ #x~X~%" (-> obj palette-buf)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/tie/tie-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/tie/tie-h_REF.gc new file mode 100644 index 0000000000..4a0219af9c --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/tie/tie-h_REF.gc @@ -0,0 +1,692 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type tie-fragment-debug +(deftype tie-fragment-debug (structure) + ((num-tris uint16 :offset-assert 0) + (num-dverts uint16 :offset-assert 2) + (debug-lines (array vector-array) :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type tie-fragment-debug +(defmethod inspect tie-fragment-debug ((obj tie-fragment-debug)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tie-fragment-debug) + (format #t "~1Tnum-tris: ~D~%" (-> obj num-tris)) + (format #t "~1Tnum-dverts: ~D~%" (-> obj num-dverts)) + (format #t "~1Tdebug-lines: ~A~%" (-> obj debug-lines)) + (label cfg-4) + obj + ) + +;; definition of type tie-fragment +(deftype tie-fragment (drawable) + ((gif-ref (inline-array adgif-shader) :offset 4) + (point-ref uint32 :offset 8) + (color-index uint16 :offset 12) + (base-colors uint8 :offset 14) + (tex-count uint16 :offset 32) + (gif-count uint16 :offset 34) + (vertex-count uint16 :offset 36) + (color-count uint16 :offset 38) + (dp-ref uint32 :offset 40) + (dp-qwc uint32 :offset 44) + (generic-ref uint32 :offset 48) + (generic-count uint16 :offset 52) + (normal-count uint16 :offset 54) + (normal-ref uint32 :offset 56) + (debug tie-fragment-debug :offset 60) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +;; definition for method 3 of type tie-fragment +(defmethod inspect tie-fragment ((obj tie-fragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tgif-ref: #x~X~%" (-> obj gif-ref)) + (format #t "~1Tpoint-ref: #x~X~%" (-> obj point-ref)) + (format #t "~1Tcolor-index: ~D~%" (-> obj color-index)) + (format #t "~1Tbase-colors: ~D~%" (-> obj base-colors)) + (format #t "~1Ttex-count: ~D~%" (-> obj tex-count)) + (format #t "~1Tgif-count: ~D~%" (-> obj gif-count)) + (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) + (format #t "~1Tcolor-count: ~D~%" (-> obj color-count)) + (format #t "~1Tdp-ref: #x~X~%" (-> obj dp-ref)) + (format #t "~1Tdp-qwc: ~D~%" (-> obj dp-qwc)) + (format #t "~1Tgeneric-ref: #x~X~%" (-> obj generic-ref)) + (format #t "~1Tgeneric-count: ~D~%" (-> obj generic-count)) + (format #t "~1Tnormal-count: ~D~%" (-> obj normal-count)) + (format #t "~1Tnormal-ref: #x~X~%" (-> obj normal-ref)) + (format #t "~1Tdebug: #~%" (-> obj debug)) + (label cfg-4) + obj + ) + +;; definition of type instance-tie +(deftype instance-tie (instance) + ((color-indices uint32 :offset 8) + (bucket-ptr prototype-bucket-tie :offset 12) + (max-scale uint16 :offset 38) + (rmin-scale uint16 :offset 54) + ) + :method-count-assert 17 + :size-assert #x40 + :flag-assert #x1100000040 + ) + +;; definition for method 3 of type instance-tie +(defmethod inspect instance-tie ((obj instance-tie)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tbucket-index: ~D~%" (-> obj bucket-index)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Twind-index: ~D~%" (-> obj wind-index)) + (format #t "~1Tcolor-indices: #x~X~%" (-> obj color-indices)) + (format #t "~1Tbucket-ptr: ~A~%" (-> obj bucket-ptr)) + (format #t "~1Tmax-scale: ~D~%" (-> obj max-scale)) + (format #t "~1Trmin-scale: ~D~%" (-> obj rmin-scale)) + (label cfg-4) + obj + ) + +;; definition of type drawable-inline-array-instance-tie +(deftype drawable-inline-array-instance-tie (drawable-inline-array) + ((data instance-tie 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 96) + ) + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ) + +;; definition of type drawable-tree-instance-tie +(deftype drawable-tree-instance-tie (drawable-tree) + ((prototypes proxy-prototype-array-tie :offset 8) + ) + :method-count-assert 17 + :size-assert #x20 + :flag-assert #x1100000020 + ) + +;; definition for method 3 of type drawable-tree-instance-tie +(defmethod inspect drawable-tree-instance-tie ((obj drawable-tree-instance-tie)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data s5-0)) + ) + (format #t "~1Tprototypes: ~A~%" (-> obj prototypes)) + (label cfg-7) + obj + ) + +;; definition of type prototype-tie +(deftype prototype-tie (drawable-inline-array) + ((data tie-fragment 1 :inline :offset-assert 32) + (pad uint32 :offset-assert 96) + ) + :method-count-assert 17 + :size-assert #x64 + :flag-assert #x1100000064 + ) + +;; definition of type tie-matrix +(deftype tie-matrix (structure) + ((mat matrix :inline :offset-assert 0) + (morph qword :inline :offset-assert 64) + (fog qword :inline :offset-assert 80) + (envmap-flag uint32 :offset 80) + (guard-flag uint32 :offset 84) + (vertex-alpha float :offset 88) + (fog-value float :offset 92) + (fixed-alpha float :offset 68) + ) + :method-count-assert 9 + :size-assert #x60 + :flag-assert #x900000060 + ) + +;; definition for method 3 of type tie-matrix +(defmethod inspect tie-matrix ((obj tie-matrix)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'tie-matrix) + (format #t "~1Tmat: #~%" (-> obj mat)) + (format #t "~1Tmorph: #~%" (-> obj morph)) + (format #t "~1Tfog: #~%" (-> obj fog)) + (format #t "~1Tenvmap-flag: ~D~%" (-> obj envmap-flag)) + (format #t "~1Tguard-flag: ~D~%" (-> obj guard-flag)) + (format #t "~1Tvertex-alpha: ~f~%" (-> obj vertex-alpha)) + (format #t "~1Tfog-value: ~f~%" (-> obj fog-value)) + (format #t "~1Tfixed-alpha: ~f~%" (-> obj fixed-alpha)) + (label cfg-4) + obj + ) + +;; definition of type instance-tie-work +(deftype instance-tie-work (structure) + ((wind-const vector :inline :offset-assert 0) + (hmge-d vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (wind-force vector :inline :offset-assert 48) + (constant vector :inline :offset-assert 64) + (far-morph vector :inline :offset-assert 80) + (dist-test vector :inline :offset-assert 96) + (min-dist vector :inline :offset-assert 112) + (guard-plane plane 4 :inline :offset-assert 128) + (upload-color-0 dma-packet :inline :offset-assert 192) + (upload-color-1 dma-packet :inline :offset-assert 208) + (upload-color-2 dma-packet :inline :offset-assert 224) + (upload-color-ret dma-packet :inline :offset-assert 240) + (upload-color-temp dma-packet :inline :offset-assert 256) + (generic-color-0 dma-packet :inline :offset-assert 272) + (generic-color-1 dma-packet :inline :offset-assert 288) + (generic-color-end dma-packet :inline :offset-assert 304) + (envmap-color-0 dma-packet :inline :offset-assert 320) + (envmap-color-1 dma-packet :inline :offset-assert 336) + (tie-scissor-perspective-matrix matrix :inline :offset-assert 352) + (tod-env-color vector :inline :offset-assert 416) + (morph-temp vector :inline :offset-assert 432) + (fog-temp vector :inline :offset-assert 448) + (fade-temp float :offset-assert 464) + (wind-vectors uint32 :offset-assert 468) + (test-id uint32 :offset-assert 472) + (test-id2 uint32 :offset-assert 476) + (dma-buffer basic :offset-assert 480) + (to-spr uint32 :offset-assert 484) + (from-spr uint32 :offset-assert 488) + (wind-work uint32 :offset-assert 492) + (cur-vis-bits uint32 :offset-assert 496) + (end-vis-bits uint32 :offset-assert 500) + (refl-fade-fac float :offset-assert 504) + (refl-fade-end float :offset-assert 508) + (flags uint32 :offset-assert 512) + (vanish-flag uint32 :offset-assert 516) + (translucent-flag uint32 :offset-assert 520) + (wait-from-spr uint32 :offset-assert 524) + (wait-to-spr uint32 :offset-assert 528) + (use-etie basic :offset-assert 532) + (buffer-start uint32 :offset-assert 536) + (buffer-end uint32 :offset-assert 540) + (tfrag-dists uint32 :offset-assert 544) + (alpha-dists uint32 :offset-assert 548) + (water-dists uint32 :offset-assert 552) + ) + :method-count-assert 9 + :size-assert #x22c + :flag-assert #x90000022c + ) + +;; definition for method 3 of type instance-tie-work +(defmethod inspect instance-tie-work ((obj instance-tie-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'instance-tie-work) + (format #t "~1Twind-const: #~%" (-> obj wind-const)) + (format #t "~1Thmge-d: #~%" (-> obj hmge-d)) + (format #t "~1Thvdf-offset: #~%" (-> obj hvdf-offset)) + (format #t "~1Twind-force: #~%" (-> obj wind-force)) + (format #t "~1Tconstant: #~%" (-> obj constant)) + (format #t "~1Tfar-morph: #~%" (-> obj far-morph)) + (format #t "~1Tdist-test: #~%" (-> obj dist-test)) + (format #t "~1Tmin-dist: #~%" (-> obj min-dist)) + (format #t "~1Tguard-plane[4] @ #x~X~%" (-> obj guard-plane)) + (format #t "~1Tupload-color-0: #~%" (-> obj upload-color-0)) + (format #t "~1Tupload-color-1: #~%" (-> obj upload-color-1)) + (format #t "~1Tupload-color-2: #~%" (-> obj upload-color-2)) + (format #t "~1Tupload-color-ret: #~%" (-> obj upload-color-ret)) + (format #t "~1Tupload-color-temp: #~%" (-> obj upload-color-temp)) + (format #t "~1Tgeneric-color-0: #~%" (-> obj generic-color-0)) + (format #t "~1Tgeneric-color-1: #~%" (-> obj generic-color-1)) + (format #t "~1Tgeneric-color-end: #~%" (-> obj generic-color-end)) + (format #t "~1Tenvmap-color-0: #~%" (-> obj envmap-color-0)) + (format #t "~1Tenvmap-color-1: #~%" (-> obj envmap-color-1)) + (format #t "~1Ttie-scissor-perspective-matrix: #~%" (-> obj tie-scissor-perspective-matrix)) + (format #t "~1Ttod-env-color: #~%" (-> obj tod-env-color)) + (format #t "~1Tmorph-temp: #~%" (-> obj morph-temp)) + (format #t "~1Tfog-temp: #~%" (-> obj fog-temp)) + (format #t "~1Tfade-temp: ~f~%" (-> obj fade-temp)) + (format #t "~1Twind-vectors: #x~X~%" (-> obj wind-vectors)) + (format #t "~1Ttest-id: ~D~%" (-> obj test-id)) + (format #t "~1Ttest-id2: ~D~%" (-> obj test-id2)) + (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) + (format #t "~1Tto-spr: ~D~%" (-> obj to-spr)) + (format #t "~1Tfrom-spr: ~D~%" (-> obj from-spr)) + (format #t "~1Twind-work: ~D~%" (-> obj wind-work)) + (format #t "~1Tcur-vis-bits: ~D~%" (-> obj cur-vis-bits)) + (format #t "~1Tend-vis-bits: ~D~%" (-> obj end-vis-bits)) + (format #t "~1Trefl-fade-fac: ~f~%" (-> obj refl-fade-fac)) + (format #t "~1Trefl-fade-end: ~f~%" (-> obj refl-fade-end)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tvanish-flag: ~D~%" (-> obj vanish-flag)) + (format #t "~1Ttranslucent-flag: ~D~%" (-> obj translucent-flag)) + (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) + (format #t "~1Tuse-etie: ~A~%" (-> obj use-etie)) + (format #t "~1Tbuffer-start: #x~X~%" (-> obj buffer-start)) + (format #t "~1Tbuffer-end: #x~X~%" (-> obj buffer-end)) + (format #t "~1Ttfrag-dists: #x~X~%" (-> obj tfrag-dists)) + (format #t "~1Talpha-dists: #x~X~%" (-> obj alpha-dists)) + (format #t "~1Twater-dists: #x~X~%" (-> obj water-dists)) + (label cfg-4) + obj + ) + +;; definition of type instance-tie-dma +(deftype instance-tie-dma (structure) + ((banka instance-tie 32 :inline :offset-assert 0) + (bankb instance-tie 32 :inline :offset-assert 2048) + (outa uint128 256 :offset-assert 4096) + (outb uint128 256 :offset-assert 8192) + (work instance-tie-work :dynamic :offset-assert 12288) + ) + :method-count-assert 9 + :size-assert #x3000 + :flag-assert #x900003000 + ) + +;; definition for method 3 of type instance-tie-dma +(defmethod inspect instance-tie-dma ((obj instance-tie-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'instance-tie-dma) + (format #t "~1Tbanka[32] @ #x~X~%" (-> obj banka)) + (format #t "~1Tbankb[32] @ #x~X~%" (-> obj bankb)) + (format #t "~1Touta[256] @ #x~X~%" (-> obj outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> obj outb)) + (format #t "~1Twork: #~%" (-> obj work 0)) + (label cfg-4) + obj + ) + +;; definition of type prototype-tie-work +(deftype prototype-tie-work (structure) + ((upload-flushe dma-packet :inline :offset-assert 0) + (upload-palette dma-packet :inline :offset-assert 16) + (upload-model-0 dma-packet :inline :offset-assert 32) + (upload-model-1 dma-packet :inline :offset-assert 48) + (upload-model-2 dma-packet :inline :offset-assert 64) + (upload-model-3 dma-packet :inline :offset-assert 80) + (upload-model-near-0 dma-packet :inline :offset-assert 96) + (upload-model-near-1 dma-packet :inline :offset-assert 112) + (upload-model-near-2 dma-packet :inline :offset-assert 128) + (upload-model-near-3 dma-packet :inline :offset-assert 144) + (upload-model-near-4 dma-packet :inline :offset-assert 160) + (envmap-palette dma-packet :inline :offset-assert 176) + (envmap-shader dma-packet :inline :offset-assert 192) + (upload-envmap-0 dma-packet :inline :offset-assert 208) + (upload-envmap-1 dma-packet :inline :offset-assert 224) + (upload-envmap-2 dma-packet :inline :offset-assert 240) + (upload-envmap-3 dma-packet :inline :offset-assert 256) + (upload-envmap-4 dma-packet :inline :offset-assert 272) + (upload-envmap-scissor-4 dma-packet :inline :offset-assert 288) + (generic-palette dma-packet :inline :offset-assert 304) + (generic-model-0 dma-packet :inline :offset-assert 320) + (generic-model-1 dma-packet :inline :offset-assert 336) + (generic-model-2 dma-packet :inline :offset-assert 352) + (model-next dma-packet :inline :offset-assert 368) + (clamp uint64 :offset-assert 384) + (prototype-array basic :offset-assert 392) + (wait-from-spr uint32 :offset-assert 396) + (wait-to-spr uint32 :offset-assert 400) + (mood mood-context :offset-assert 404) + (last uint32 16 :offset 416) + (next uint32 16 :offset-assert 480) + (count uint16 16 :offset-assert 544) + (tie-last uint32 :offset 416) + (tie-next uint32 :offset 480) + (tie-count uint16 :offset 544) + (trans-last uint32 :offset 420) + (trans-next uint32 :offset 484) + (trans-count uint16 :offset 546) + (water-last uint32 :offset 424) + (water-next uint32 :offset 488) + (water-count uint16 :offset 548) + (scissor-last uint32 :offset 428) + (scissor-next uint32 :offset 492) + (scissor-count uint16 :offset 550) + (scissor-trans-last uint32 :offset 432) + (scissor-trans-next uint32 :offset 496) + (scissor-trans-count uint16 :offset 552) + (scissor-water-last uint32 :offset 436) + (scissor-water-next uint32 :offset 500) + (scissor-water-count uint16 :offset 554) + (envmap-last uint32 :offset 440) + (envmap-next uint32 :offset 504) + (envmap-count uint16 :offset 556) + (envmap-trans-last uint32 :offset 444) + (envmap-trans-next uint32 :offset 508) + (envmap-trans-count uint16 :offset 558) + (envmap-water-last uint32 :offset 448) + (envmap-water-next uint32 :offset 512) + (envmap-water-count uint16 :offset 560) + (envmap-scissor-last uint32 :offset 452) + (envmap-scissor-next uint32 :offset 516) + (envmap-scissor-count uint16 :offset 562) + (envmap-scissor-trans-last uint32 :offset 456) + (envmap-scissor-trans-next uint32 :offset 520) + (envmap-scissor-trans-count uint16 :offset 564) + (envmap-scissor-water-last uint32 :offset 460) + (envmap-scissor-water-next uint32 :offset 524) + (envmap-scissor-water-count uint16 :offset 566) + (generic-last uint32 :offset 464) + (generic-next uint32 :offset 528) + (generic-count uint16 :offset 568) + (generic-trans-last uint32 :offset 468) + (generic-trans-next uint32 :offset 532) + (generic-trans-count uint16 :offset 570) + (generic-water-last uint32 :offset 472) + (generic-water-next uint32 :offset 536) + (generic-water-count uint16 :offset 572) + (vanish-last uint32 :offset 476) + (vanish-next uint32 :offset 540) + (vanish-count uint16 :offset 574) + ) + :method-count-assert 9 + :size-assert #x240 + :flag-assert #x900000240 + ) + +;; definition for method 3 of type prototype-tie-work +(defmethod inspect prototype-tie-work ((obj prototype-tie-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'prototype-tie-work) + (format #t "~1Tupload-flushe: #~%" (-> obj upload-flushe)) + (format #t "~1Tupload-palette: #~%" (-> obj upload-palette)) + (format #t "~1Tupload-model-0: #~%" (-> obj upload-model-0)) + (format #t "~1Tupload-model-1: #~%" (-> obj upload-model-1)) + (format #t "~1Tupload-model-2: #~%" (-> obj upload-model-2)) + (format #t "~1Tupload-model-3: #~%" (-> obj upload-model-3)) + (format #t "~1Tupload-model-near-0: #~%" (-> obj upload-model-near-0)) + (format #t "~1Tupload-model-near-1: #~%" (-> obj upload-model-near-1)) + (format #t "~1Tupload-model-near-2: #~%" (-> obj upload-model-near-2)) + (format #t "~1Tupload-model-near-3: #~%" (-> obj upload-model-near-3)) + (format #t "~1Tupload-model-near-4: #~%" (-> obj upload-model-near-4)) + (format #t "~1Tenvmap-palette: #~%" (-> obj envmap-palette)) + (format #t "~1Tenvmap-shader: #~%" (-> obj envmap-shader)) + (format #t "~1Tupload-envmap-0: #~%" (-> obj upload-envmap-0)) + (format #t "~1Tupload-envmap-1: #~%" (-> obj upload-envmap-1)) + (format #t "~1Tupload-envmap-2: #~%" (-> obj upload-envmap-2)) + (format #t "~1Tupload-envmap-3: #~%" (-> obj upload-envmap-3)) + (format #t "~1Tupload-envmap-4: #~%" (-> obj upload-envmap-4)) + (format #t "~1Tupload-envmap-scissor-4: #~%" (-> obj upload-envmap-scissor-4)) + (format #t "~1Tgeneric-palette: #~%" (-> obj generic-palette)) + (format #t "~1Tgeneric-model-0: #~%" (-> obj generic-model-0)) + (format #t "~1Tgeneric-model-1: #~%" (-> obj generic-model-1)) + (format #t "~1Tgeneric-model-2: #~%" (-> obj generic-model-2)) + (format #t "~1Tmodel-next: #~%" (-> obj model-next)) + (format #t "~1Tclamp: ~D~%" (-> obj clamp)) + (format #t "~1Tprototype-array: ~A~%" (-> obj prototype-array)) + (format #t "~1Twait-from-spr: ~D~%" (-> obj wait-from-spr)) + (format #t "~1Twait-to-spr: ~D~%" (-> obj wait-to-spr)) + (format #t "~1Tmood: #~%" (-> obj mood)) + (format #t "~1Tlast[16] @ #x~X~%" (-> obj last)) + (format #t "~1Tnext[16] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount[16] @ #x~X~%" (-> obj count)) + (format #t "~1Ttie-last: #x~X~%" (-> obj tie-last)) + (format #t "~1Ttie-next: #x~X~%" (-> obj tie-next)) + (format #t "~1Ttie-count: ~D~%" (-> obj tie-count)) + (format #t "~1Ttrans-last: #x~X~%" (-> obj trans-last)) + (format #t "~1Ttrans-next: #x~X~%" (-> obj trans-next)) + (format #t "~1Ttrans-count: ~D~%" (-> obj trans-count)) + (format #t "~1Twater-last: #x~X~%" (-> obj water-last)) + (format #t "~1Twater-next: #x~X~%" (-> obj water-next)) + (format #t "~1Twater-count: ~D~%" (-> obj water-count)) + (format #t "~1Tscissor-last: #x~X~%" (-> obj scissor-last)) + (format #t "~1Tscissor-next: #x~X~%" (-> obj scissor-next)) + (format #t "~1Tscissor-count: ~D~%" (-> obj scissor-count)) + (format #t "~1Tscissor-trans-last: #x~X~%" (-> obj scissor-trans-last)) + (format #t "~1Tscissor-trans-next: #x~X~%" (-> obj scissor-trans-next)) + (format #t "~1Tscissor-trans-count: ~D~%" (-> obj scissor-trans-count)) + (format #t "~1Tscissor-water-last: #x~X~%" (-> obj scissor-water-last)) + (format #t "~1Tscissor-water-next: #x~X~%" (-> obj scissor-water-next)) + (format #t "~1Tscissor-water-count: ~D~%" (-> obj scissor-water-count)) + (format #t "~1Tenvmap-last: #x~X~%" (-> obj envmap-last)) + (format #t "~1Tenvmap-next: #x~X~%" (-> obj envmap-next)) + (format #t "~1Tenvmap-count: ~D~%" (-> obj envmap-count)) + (format #t "~1Tenvmap-trans-last: #x~X~%" (-> obj envmap-trans-last)) + (format #t "~1Tenvmap-trans-next: #x~X~%" (-> obj envmap-trans-next)) + (format #t "~1Tenvmap-trans-count: ~D~%" (-> obj envmap-trans-count)) + (format #t "~1Tenvmap-water-last: #x~X~%" (-> obj envmap-water-last)) + (format #t "~1Tenvmap-water-next: #x~X~%" (-> obj envmap-water-next)) + (format #t "~1Tenvmap-water-count: ~D~%" (-> obj envmap-water-count)) + (format #t "~1Tenvmap-scissor-last: #x~X~%" (-> obj envmap-scissor-last)) + (format #t "~1Tenvmap-scissor-next: #x~X~%" (-> obj envmap-scissor-next)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> obj envmap-scissor-count)) + (format #t "~1Tenvmap-scissor-trans-last: #x~X~%" (-> obj envmap-scissor-trans-last)) + (format #t "~1Tenvmap-scissor-trans-next: #x~X~%" (-> obj envmap-scissor-trans-next)) + (format #t "~1Tenvmap-scissor-trans-count: ~D~%" (-> obj envmap-scissor-trans-count)) + (format #t "~1Tenvmap-scissor-water-last: #x~X~%" (-> obj envmap-scissor-water-last)) + (format #t "~1Tenvmap-scissor-water-next: #x~X~%" (-> obj envmap-scissor-water-next)) + (format #t "~1Tenvmap-scissor-water-count: ~D~%" (-> obj envmap-scissor-water-count)) + (format #t "~1Tgeneric-last: #x~X~%" (-> obj generic-last)) + (format #t "~1Tgeneric-next: #x~X~%" (-> obj generic-next)) + (format #t "~1Tgeneric-count: ~D~%" (-> obj generic-count)) + (format #t "~1Tgeneric-trans-last: #x~X~%" (-> obj generic-trans-last)) + (format #t "~1Tgeneric-trans-next: #x~X~%" (-> obj generic-trans-next)) + (format #t "~1Tgeneric-trans-count: ~D~%" (-> obj generic-trans-count)) + (format #t "~1Tgeneric-water-last: #x~X~%" (-> obj generic-water-last)) + (format #t "~1Tgeneric-water-next: #x~X~%" (-> obj generic-water-next)) + (format #t "~1Tgeneric-water-count: ~D~%" (-> obj generic-water-count)) + (format #t "~1Tvanish-last: #x~X~%" (-> obj vanish-last)) + (format #t "~1Tvanish-next: #x~X~%" (-> obj vanish-next)) + (format #t "~1Tvanish-count: ~D~%" (-> obj vanish-count)) + (label cfg-4) + obj + ) + +;; definition of type prototype-tie-dma +(deftype prototype-tie-dma (structure) + ((colora rgba 256 :offset-assert 0) + (colorb rgba 256 :offset-assert 1024) + (outa uint128 256 :offset-assert 2048) + (outb uint128 256 :offset-assert 6144) + (geometry uint32 4 :offset-assert 10240) + (next uint32 12 :offset 10256) + (count uint16 12 :offset 10304) + (counts uint32 4 :offset 10328) + (palette-ptr uint32 :offset 10336) + (model-ptr uint32 :offset 10340) + (ret-ptr uint32 :offset 10344) + (length uint32 :offset 10348) + (flags uint32 :offset 10352) + (dma-buffer basic :offset 10356) + (this-frag-count uint32 :offset 10360) + (frag-count uint8 4 :offset 10364) + (from-spr uint32 :offset 10368) + (to-spr uint32 :offset 10372) + (spr-out uint32 :offset 10376) + (this-count uint32 :offset 10380) + (scissor-geometry uint32 :offset 10240) + (near-geometry uint32 :offset 10244) + (mid-geometry uint32 :offset 10248) + (far-geometry uint32 :offset 10252) + (scissor-frag-count uint8 :offset 10364) + (near-frag-count uint8 :offset 10365) + (mid-frag-count uint8 :offset 10366) + (far-frag-count uint8 :offset 10367) + (tie-scissor-next uint32 :offset 10256) + (tie-near-next uint32 :offset 10260) + (tie-mid-next uint32 :offset 10264) + (tie-far-next uint32 :offset 10268) + (trans-scissor-next uint32 4 :offset 10256) + (trans-near-next uint32 :offset 10260) + (trans-mid-next uint32 :offset 10264) + (trans-far-next uint32 :offset 10268) + (water-scissor-next uint32 4 :offset 10256) + (water-near-next uint32 :offset 10260) + (water-mid-next uint32 :offset 10264) + (water-far-next uint32 :offset 10268) + (envmap-scissor-next uint32 4 :offset 10272) + (envmap-near-next uint32 :offset 10276) + (envmap-mid-next uint32 :offset 10280) + (envmap-far-next uint32 :offset 10284) + (generic-near-next uint32 :offset 10288) + (generic-mid-next uint32 :offset 10292) + (generic-far-next uint32 :offset 10296) + (vanish-next uint32 :offset 10300) + (tie-count uint16 :offset 10304) + (tie-scissor-count uint16 :offset 10304) + (tie-near-count uint16 :offset 10306) + (tie-mid-count uint16 :offset 10308) + (tie-far-count uint16 :offset 10310) + (trans-count uint16 :offset 10304) + (trans-scissor-count uint16 :offset 10304) + (trans-near-count uint16 :offset 10306) + (trans-mid-count uint16 :offset 10308) + (trans-far-count uint16 :offset 10310) + (water-count uint16 :offset 10304) + (water-scissor-count uint16 :offset 10304) + (water-near-count uint16 :offset 10306) + (water-mid-count uint16 :offset 10308) + (water-far-count uint16 :offset 10310) + (envmap-count uint16 :offset 10312) + (envmap-scissor-count uint16 :offset 10312) + (envmap-near-count uint16 :offset 10314) + (envmap-mid-count uint16 :offset 10316) + (envmap-far-count uint16 :offset 10318) + (generic-count uint16 :offset 10320) + (generic-near-count uint16 :offset 10320) + (generic-mid-count uint16 :offset 10322) + (generic-far-count uint16 :offset 10324) + (vanish-count uint16 :offset 10326) + (next-clear uint32 3 :offset 10256) + (count-clear uint16 3 :offset 10304) + ) + :method-count-assert 9 + :size-assert #x2890 + :flag-assert #x900002890 + ) + +;; definition for method 3 of type prototype-tie-dma +(defmethod inspect prototype-tie-dma ((obj prototype-tie-dma)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'prototype-tie-dma) + (format #t "~1Tcolora[256] @ #x~X~%" (-> obj colora)) + (format #t "~1Tcolorb[256] @ #x~X~%" (-> obj colorb)) + (format #t "~1Touta[256] @ #x~X~%" (-> obj outa)) + (format #t "~1Toutb[256] @ #x~X~%" (-> obj outb)) + (format #t "~1Tgeometry[4] @ #x~X~%" (-> obj geometry)) + (format #t "~1Tnext[12] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount[12] @ #x~X~%" (-> obj count)) + (format #t "~1Tcounts[4] @ #x~X~%" (-> obj counts)) + (format #t "~1Tpalette-ptr: #x~X~%" (-> obj palette-ptr)) + (format #t "~1Tmodel-ptr: #x~X~%" (-> obj model-ptr)) + (format #t "~1Tret-ptr: #x~X~%" (-> obj ret-ptr)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tdma-buffer: ~A~%" (-> obj dma-buffer)) + (format #t "~1Tthis-frag-count: ~D~%" (-> obj this-frag-count)) + (format #t "~1Tfrag-count[4] @ #x~X~%" (-> obj frag-count)) + (format #t "~1Tfrom-spr: #x~X~%" (-> obj from-spr)) + (format #t "~1Tto-spr: #x~X~%" (-> obj to-spr)) + (format #t "~1Tspr-out: #x~X~%" (-> obj spr-out)) + (format #t "~1Tthis-count: ~D~%" (-> obj this-count)) + (format #t "~1Tscissor-geometry: #x~X~%" (-> obj scissor-geometry)) + (format #t "~1Tnear-geometry: #x~X~%" (-> obj near-geometry)) + (format #t "~1Tmid-geometry: #x~X~%" (-> obj mid-geometry)) + (format #t "~1Tfar-geometry: #x~X~%" (-> obj far-geometry)) + (format #t "~1Tscissor-frag-count: ~D~%" (-> obj scissor-frag-count)) + (format #t "~1Tnear-frag-count: ~D~%" (-> obj near-frag-count)) + (format #t "~1Tmid-frag-count: ~D~%" (-> obj mid-frag-count)) + (format #t "~1Tfar-frag-count: ~D~%" (-> obj far-frag-count)) + (format #t "~1Ttie-scissor-next: #x~X~%" (-> obj tie-scissor-next)) + (format #t "~1Ttie-near-next: #x~X~%" (-> obj tie-near-next)) + (format #t "~1Ttie-mid-next: #x~X~%" (-> obj tie-mid-next)) + (format #t "~1Ttie-far-next: #x~X~%" (-> obj tie-far-next)) + (format #t "~1Ttrans-scissor-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Ttrans-near-next: #x~X~%" (-> obj tie-near-next)) + (format #t "~1Ttrans-mid-next: #x~X~%" (-> obj tie-mid-next)) + (format #t "~1Ttrans-far-next: #x~X~%" (-> obj tie-far-next)) + (format #t "~1Twater-scissor-next[4] @ #x~X~%" (-> obj next)) + (format #t "~1Twater-near-next: #x~X~%" (-> obj tie-near-next)) + (format #t "~1Twater-mid-next: #x~X~%" (-> obj tie-mid-next)) + (format #t "~1Twater-far-next: #x~X~%" (-> obj tie-far-next)) + (format #t "~1Tenvmap-scissor-next[4] @ #x~X~%" (-> obj envmap-scissor-next)) + (format #t "~1Tenvmap-near-next: #x~X~%" (-> obj envmap-near-next)) + (format #t "~1Tenvmap-mid-next: #x~X~%" (-> obj envmap-mid-next)) + (format #t "~1Tenvmap-far-next: #x~X~%" (-> obj envmap-far-next)) + (format #t "~1Tgeneric-near-next: #x~X~%" (-> obj generic-near-next)) + (format #t "~1Tgeneric-mid-next: #x~X~%" (-> obj generic-mid-next)) + (format #t "~1Tgeneric-far-next: #x~X~%" (-> obj generic-far-next)) + (format #t "~1Tvanish-next: #x~X~%" (-> obj vanish-next)) + (format #t "~1Ttie-count: ~D~%" (-> obj tie-count)) + (format #t "~1Ttie-scissor-count: ~D~%" (-> obj tie-count)) + (format #t "~1Ttie-near-count: ~D~%" (-> obj tie-near-count)) + (format #t "~1Ttie-mid-count: ~D~%" (-> obj tie-mid-count)) + (format #t "~1Ttie-far-count: ~D~%" (-> obj tie-far-count)) + (format #t "~1Ttrans-count: ~D~%" (-> obj tie-count)) + (format #t "~1Ttrans-scissor-count: ~D~%" (-> obj tie-count)) + (format #t "~1Ttrans-near-count: ~D~%" (-> obj tie-near-count)) + (format #t "~1Ttrans-mid-count: ~D~%" (-> obj tie-mid-count)) + (format #t "~1Ttrans-far-count: ~D~%" (-> obj tie-far-count)) + (format #t "~1Twater-count: ~D~%" (-> obj tie-count)) + (format #t "~1Twater-scissor-count: ~D~%" (-> obj tie-count)) + (format #t "~1Twater-near-count: ~D~%" (-> obj tie-near-count)) + (format #t "~1Twater-mid-count: ~D~%" (-> obj tie-mid-count)) + (format #t "~1Twater-far-count: ~D~%" (-> obj tie-far-count)) + (format #t "~1Tenvmap-count: ~D~%" (-> obj envmap-count)) + (format #t "~1Tenvmap-scissor-count: ~D~%" (-> obj envmap-count)) + (format #t "~1Tenvmap-near-count: ~D~%" (-> obj envmap-near-count)) + (format #t "~1Tenvmap-mid-count: ~D~%" (-> obj envmap-mid-count)) + (format #t "~1Tenvmap-far-count: ~D~%" (-> obj envmap-far-count)) + (format #t "~1Tgeneric-count: ~D~%" (-> obj generic-count)) + (format #t "~1Tgeneric-near-count: ~D~%" (-> obj generic-count)) + (format #t "~1Tgeneric-mid-count: ~D~%" (-> obj generic-mid-count)) + (format #t "~1Tgeneric-far-count: ~D~%" (-> obj generic-far-count)) + (format #t "~1Tvanish-count: ~D~%" (-> obj vanish-count)) + (format #t "~1Tnext-clear[3] @ #x~X~%" (-> obj next)) + (format #t "~1Tcount-clear[3] @ #x~X~%" (-> obj count)) + (label cfg-4) + obj + ) + +;; definition for symbol *instance-tie-work-copy*, type instance-tie-work +(define *instance-tie-work-copy* (the-as instance-tie-work #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc b/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc new file mode 100644 index 0000000000..cc1a59f7c7 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/gfx/vu1-user-h_REF.gc @@ -0,0 +1,85 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type dma-foreground-sink +(deftype dma-foreground-sink (basic) + ((bucket bucket-id :offset-assert 4) + (foreground-texture-page tpage-category :offset-assert 8) + (foreground-texture-level int8 :offset-assert 9) + (foreground-output-bucket int8 :offset-assert 10) + ) + :method-count-assert 9 + :size-assert #xb + :flag-assert #x90000000b + ) + +;; definition for method 3 of type dma-foreground-sink +(defmethod inspect dma-foreground-sink ((obj dma-foreground-sink)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbucket: ~D~%" (-> obj bucket)) + (format #t "~1Tforeground-texture-page: ~D~%" (-> obj foreground-texture-page)) + (format #t "~1Tforeground-texture-level: ~D~%" (-> obj foreground-texture-level)) + (format #t "~1Tforeground-output-bucket: ~D~%" (-> obj foreground-output-bucket)) + (label cfg-4) + obj + ) + +;; definition of type generic-bucket-state +(deftype generic-bucket-state (structure) + ((gifbuf-adr uint32 :offset-assert 0) + (inbuf-adr uint32 :offset-assert 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type generic-bucket-state +(defmethod inspect generic-bucket-state ((obj generic-bucket-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'generic-bucket-state) + (format #t "~1Tgifbuf-adr: ~D~%" (-> obj gifbuf-adr)) + (format #t "~1Tinbuf-adr: ~D~%" (-> obj inbuf-adr)) + (label cfg-4) + obj + ) + +;; definition of type generic-dma-foreground-sink +(deftype generic-dma-foreground-sink (dma-foreground-sink) + ((state generic-bucket-state :inline :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type generic-dma-foreground-sink +(defmethod inspect generic-dma-foreground-sink ((obj generic-dma-foreground-sink)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbucket: ~D~%" (-> obj bucket)) + (format #t "~1Tforeground-texture-page: ~D~%" (-> obj foreground-texture-page)) + (format #t "~1Tforeground-texture-level: ~D~%" (-> obj foreground-texture-level)) + (format #t "~1Tforeground-output-bucket: ~D~%" (-> obj foreground-output-bucket)) + (format #t "~1Tstate: #~%" (-> obj state)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc new file mode 100644 index 0000000000..2826e2503e --- /dev/null +++ b/test/decompiler/reference/jak2/engine/level/bsp-h_REF.gc @@ -0,0 +1,226 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bsp-node +(deftype bsp-node (structure) + ((front int16 :offset-assert 0) + (back int16 :offset-assert 2) + (front-box-min vector4b :inline :offset-assert 4) + (front-box-max vector4b :inline :offset-assert 8) + (back-box-min vector4b :inline :offset-assert 12) + (back-box-max vector4b :inline :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type bsp-node +(defmethod inspect bsp-node ((obj bsp-node)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bsp-node) + (format #t "~1Tfront: ~D~%" (-> obj front)) + (format #t "~1Tback: ~D~%" (-> obj back)) + (format #t "~1Tfront-box-min: #~%" (-> obj front-box-min)) + (format #t "~1Tfront-box-max: #~%" (-> obj front-box-max)) + (format #t "~1Tback-box-min: #~%" (-> obj back-box-min)) + (format #t "~1Tback-box-max: #~%" (-> obj back-box-max)) + (label cfg-4) + obj + ) + +;; definition of type bsp-header +(deftype bsp-header (drawable) + ((info file-info :offset 4) + (all-visible-list (pointer uint16) :offset-assert 32) + (visible-list-length int16 :offset-assert 36) + (drawable-trees drawable-tree-array :offset-assert 40) + (pat pointer :offset-assert 44) + (pat-length int32 :offset-assert 48) + (texture-ids (pointer texture-id) :offset 60) + (texture-page-count int32 :offset 64) + (name symbol :offset 72) + (nickname symbol :offset-assert 76) + (vis-info level-vis-info 8 :offset 80) + (actors drawable-inline-array-actor :offset-assert 112) + (cameras (array entity-camera) :offset-assert 116) + (nodes (inline-array bsp-node) :offset 120) + (level level :offset-assert 124) + (unk-data-2 uint16 9 :offset 130) + (unk-byte uint8 :offset 152) + (unk-data-4 float :offset 160) + (unk-data-5 float :offset-assert 164) + (race-meshes (array entity-race-mesh) :offset 168) + (light-hash light-hash :offset 176) + (nav-meshes (array entity-nav-mesh) :offset 180) + (actor-groups (array actor-group) :offset 184) + (collide-hash collide-hash :offset 196) + (region-tree drawable-tree-region-prim :offset 252) + (unk-data-8 uint32 55 :offset 180) + ) + :method-count-assert 19 + :size-assert #x190 + :flag-assert #x1300000190 + (:methods + (birth (_type_) none 17) + (deactivate-entities (_type_) none 18) + ) + ) + +;; definition of type game-level +(deftype game-level (basic) + ((master-bsp basic :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type game-level +(defmethod inspect game-level ((obj game-level)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmaster-bsp: ~A~%" (-> obj master-bsp)) + (label cfg-4) + obj + ) + +;; definition of type view-frustum +(deftype view-frustum (structure) + ((hither-top-left vector :inline :offset-assert 0) + (hither-top-right vector :inline :offset-assert 16) + (hither-bottom-left vector :inline :offset-assert 32) + (hither-bottom-right vector :inline :offset-assert 48) + (yon-top-left vector :inline :offset-assert 64) + (yon-top-right vector :inline :offset-assert 80) + (yon-bottom-left vector :inline :offset-assert 96) + (yon-bottom-right vector :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type view-frustum +(defmethod inspect view-frustum ((obj view-frustum)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'view-frustum) + (format #t "~1Thither-top-left: #~%" (-> obj hither-top-left)) + (format #t "~1Thither-top-right: #~%" (-> obj hither-top-right)) + (format #t "~1Thither-bottom-left: #~%" (-> obj hither-bottom-left)) + (format #t "~1Thither-bottom-right: #~%" (-> obj hither-bottom-right)) + (format #t "~1Tyon-top-left: #~%" (-> obj yon-top-left)) + (format #t "~1Tyon-top-right: #~%" (-> obj yon-top-right)) + (format #t "~1Tyon-bottom-left: #~%" (-> obj yon-bottom-left)) + (format #t "~1Tyon-bottom-right: #~%" (-> obj yon-bottom-right)) + (label cfg-4) + obj + ) + +;; definition for method 3 of type bsp-header +(defmethod inspect bsp-header ((obj bsp-header)) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~Tall-visible-list: #x~X~%" (-> obj all-visible-list)) + (format #t "~Tvisible-list-length: ~D~%" (-> obj visible-list-length)) + (format #t "~Tdrawable-trees: ~A~%" (-> obj drawable-trees)) + (format #t "~Tpat: #x~X~%" (-> obj pat)) + (format #t "~Tpat-length: ~D~%" (-> obj pat-length)) + (inspect-bsp-tree obj (-> obj nodes 0)) + obj + ) + +;; definition (debug) for function inspect-bsp-tree +;; INFO: Return type mismatch bsp-header vs none. +(defun-debug inspect-bsp-tree ((arg0 bsp-header) (arg1 bsp-node)) + (cond + ((zero? arg1) + ) + (else + (format #t "_#x~X________________~%" arg1) + (inspect arg1) + (let ((s4-0 *print-column*)) + (set! *print-column* (+ *print-column* 64)) + (if (> (-> arg1 front) 0) + (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 front))) + (format #t "_#x~X________________~%" arg1) + ) + (if (> (-> arg1 back) 0) + (inspect-bsp-tree arg0 (the-as bsp-node (-> arg1 back))) + (format #t "_#x~X________________~%" arg1) + ) + (set! *print-column* s4-0) + ) + ) + ) + (none) + ) + +;; definition for function map-bsp-tree +;; INFO: Return type mismatch bsp-header vs none. +(defun map-bsp-tree ((arg0 (function bsp-node none)) (arg1 bsp-header) (arg2 bsp-node)) + (cond + ((zero? arg2) + ) + (else + (if (> (-> arg2 front) 0) + (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 front))) + (arg0 arg2) + ) + (if (> (-> arg2 back) 0) + (map-bsp-tree arg0 arg1 (the-as bsp-node (-> arg2 back))) + (arg0 arg2) + ) + ) + ) + (none) + ) + +;; definition of type collide-stats +(deftype collide-stats (structure) + ((calls uint32 :offset-assert 0) + (spheres uint32 :offset-assert 4) + (nodes uint32 :offset-assert 8) + (frags uint32 :offset-assert 12) + (tris uint32 :offset-assert 16) + (output uint32 :offset-assert 20) + (pad0 uint32 2 :offset-assert 24) + (total-target uint32 8 :offset-assert 32) + (target-cache-fill uint32 8 :offset-assert 64) + (target-ray-poly uint32 6 :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #x78 + :flag-assert #x900000078 + ) + +;; definition for method 3 of type collide-stats +(defmethod inspect collide-stats ((obj collide-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-stats) + (format #t "~1Tcalls: ~D~%" (-> obj calls)) + (format #t "~1Tspheres: ~D~%" (-> obj spheres)) + (format #t "~1Tnodes: ~D~%" (-> obj nodes)) + (format #t "~1Tfrags: ~D~%" (-> obj frags)) + (format #t "~1Ttris: ~D~%" (-> obj tris)) + (format #t "~1Toutput: ~D~%" (-> obj output)) + (format #t "~1Ttotal-target: #~%" (&-> obj pad0 1)) + (format #t "~1Ttarget-cache-fill: #~%" (&-> obj total-target 7)) + (format #t "~1Ttarget-ray-poly: #~%" (&-> obj target-cache-fill 7)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/level/level-h_REF.gc b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc new file mode 100644 index 0000000000..df20e8b943 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/level/level-h_REF.gc @@ -0,0 +1,861 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type level-vis-info +(deftype level-vis-info (basic) + ((level level :offset-assert 4) + (from-level level :offset-assert 8) + (from-bsp bsp-header :offset-assert 12) + (flags vis-info-flag :offset-assert 16) + (length uint32 :offset-assert 20) + (allocated-length uint32 :offset-assert 24) + (dictionary-length uint32 :offset-assert 28) + (dictionary uint32 :offset-assert 32) + (string-block uint32 :offset-assert 36) + (ramdisk uint32 :offset-assert 40) + (vis-bits uint32 :offset-assert 44) + (current-vis-string uint32 :offset-assert 48) + (vis-string uint32 :dynamic :offset-assert 52) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type level-vis-info +(defmethod inspect level-vis-info ((obj level-vis-info)) + (when (not obj) + (set! obj obj) + (goto cfg-68) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tfrom-level: ~A~%" (-> obj from-level)) + (format #t "~1Tfrom-bsp: ~A~%" (-> obj from-bsp)) + (format #t "~1Tflags: #x~X : (vis-info-flag " (-> obj flags)) + (let ((s5-0 (-> obj flags))) + (if (= (logand (vis-info-flag dummy22) s5-0) (vis-info-flag dummy22)) + (format #t "dummy22 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy14)) (vis-info-flag dummy14)) + (format #t "dummy14 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy9)) (vis-info-flag dummy9)) + (format #t "dummy9 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy10)) (vis-info-flag dummy10)) + (format #t "dummy10 ") + ) + (if (= (logand (vis-info-flag dummy23) s5-0) (vis-info-flag dummy23)) + (format #t "dummy23 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy15)) (vis-info-flag dummy15)) + (format #t "dummy15 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy5)) (vis-info-flag dummy5)) + (format #t "dummy5 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy7)) (vis-info-flag dummy7)) + (format #t "dummy7 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy1)) (vis-info-flag dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy11)) (vis-info-flag dummy11)) + (format #t "dummy11 ") + ) + (if (= (logand (vis-info-flag dummy28) s5-0) (vis-info-flag dummy28)) + (format #t "dummy28 ") + ) + (if (= (logand (vis-info-flag dummy24) s5-0) (vis-info-flag dummy24)) + (format #t "dummy24 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy3)) (vis-info-flag dummy3)) + (format #t "dummy3 ") + ) + (if (= (logand (vis-info-flag dummy16) s5-0) (vis-info-flag dummy16)) + (format #t "dummy16 ") + ) + (if (= (logand (vis-info-flag dummy17) s5-0) (vis-info-flag dummy17)) + (format #t "dummy17 ") + ) + (if (= (logand (vis-info-flag dummy20) s5-0) (vis-info-flag dummy20)) + (format #t "dummy20 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy12)) (vis-info-flag dummy12)) + (format #t "dummy12 ") + ) + (if (= (logand (vis-info-flag loading) s5-0) (vis-info-flag loading)) + (format #t "loading ") + ) + (if (= (logand (vis-info-flag dummy25) s5-0) (vis-info-flag dummy25)) + (format #t "dummy25 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy6)) (vis-info-flag dummy6)) + (format #t "dummy6 ") + ) + (if (= (logand (vis-info-flag vis-valid) s5-0) (shl #x8000 16)) + (format #t "vis-valid ") + ) + (if (= (logand (vis-info-flag in-iop) s5-0) (vis-info-flag in-iop)) + (format #t "in-iop ") + ) + (if (= (logand (vis-info-flag dummy18) s5-0) (vis-info-flag dummy18)) + (format #t "dummy18 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy8)) (vis-info-flag dummy8)) + (format #t "dummy8 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy2)) (vis-info-flag dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand (vis-info-flag dummy21) s5-0) (vis-info-flag dummy21)) + (format #t "dummy21 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy13)) (vis-info-flag dummy13)) + (format #t "dummy13 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy4)) (vis-info-flag dummy4)) + (format #t "dummy4 ") + ) + (if (= (logand (vis-info-flag dummy26) s5-0) (vis-info-flag dummy26)) + (format #t "dummy26 ") + ) + (if (= (logand (vis-info-flag dummy27) s5-0) (vis-info-flag dummy27)) + (format #t "dummy27 ") + ) + (if (= (logand (vis-info-flag dummy19) s5-0) (vis-info-flag dummy19)) + (format #t "dummy19 ") + ) + (if (= (logand s5-0 (vis-info-flag dummy0)) (vis-info-flag dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tdictionary-length: ~D~%" (-> obj dictionary-length)) + (format #t "~1Tdictionary: #x~X~%" (-> obj dictionary)) + (format #t "~1Tstring-block: #x~X~%" (-> obj string-block)) + (format #t "~1Tramdisk: ~D~%" (-> obj ramdisk)) + (format #t "~1Tvis-bits: #x~X~%" (-> obj vis-bits)) + (format #t "~1Tcurrent-vis-string: ~D~%" (-> obj current-vis-string)) + (format #t "~1Tvis-string[0] @ #x~X~%" (-> obj vis-string)) + (label cfg-68) + obj + ) + +;; definition for method 5 of type level-vis-info +;; INFO: Return type mismatch uint vs int. +(defmethod asize-of level-vis-info ((obj level-vis-info)) + (the-as int (+ (-> level-vis-info size) (-> obj dictionary-length))) + ) + +;; definition of type level-load-info +(deftype level-load-info (basic) + ((name-list symbol 6 :offset-assert 4) + (index int16 :offset-assert 28) + (task-level uint8 :offset-assert 30) + (name symbol :offset 4) + (visname symbol :offset 8) + (nickname symbol :offset 12) + (dbname symbol :offset 16) + (taskname symbol :offset 20) + (other-name-1 symbol :offset 24) + (packages pair :offset-assert 32) + (memory-mode uint32 :offset-assert 36) + (music-bank basic :offset-assert 40) + (ambient-sounds basic :offset-assert 44) + (sound-reverb float :offset-assert 48) + (mood-func symbol :offset-assert 52) + (mood-init symbol :offset-assert 56) + (ocean basic :offset-assert 60) + (sky basic :offset-assert 64) + (use-camera-other basic :offset-assert 68) + (part-engine-max int32 :offset-assert 72) + (city-map-bits uint64 :offset-assert 80) + (continues pair :offset-assert 88) + (tasks pair :offset-assert 92) + (priority int32 :offset-assert 96) + (load-commands pair :offset-assert 100) + (alt-load-commands pair :offset-assert 104) + (bsp-mask uint64 :offset-assert 112) + (buzzer int32 :offset-assert 120) + (buttom-height meters :offset-assert 124) + (run-packages pair :offset-assert 128) + (prev-level basic :offset-assert 132) + (next-level basic :offset-assert 136) + (wait-for-load symbol :offset-assert 140) + (login-func symbol :offset-assert 144) + (activate-func symbol :offset-assert 148) + (deactivate-func symbol :offset-assert 152) + (kill-func symbol :offset-assert 156) + (borrow-size uint16 2 :offset-assert 160) + (borrow-level symbol 2 :offset-assert 164) + (borrow-display? basic 2 :offset-assert 172) + (base-task-mask task-mask :offset-assert 180) + (texture-anim symbol 10 :offset-assert 184) + (texture-anim-tfrag symbol :offset 184) + (texture-anim-pris symbol :offset 188) + (texture-anim-shrub symbol :offset 192) + (texture-anim-alpha symbol :offset 196) + (texture-anim-water symbol :offset 200) + (texture-anim-twarp symbol :offset 204) + (texture-anim-pris2 symbol :offset 208) + (texture-anim-sprite symbol :offset 212) + (texture-anim-map symbol :offset 216) + (texture-anim-sky symbol :offset 220) + (draw-priority float :offset-assert 224) + (level-flags uint32 :offset-assert 228) + (fog-height float :offset-assert 232) + (bigmap-id uint32 :offset-assert 236) + (ocean-near-translucent? symbol :offset-assert 240) + (ocean-far? symbol :offset-assert 244) + (mood-range mood-range :inline :offset-assert 256) + (max-rain float :offset-assert 272) + (fog-mult float :offset-assert 276) + (ocean-alpha float :offset-assert 280) + (extra-sound-bank pair :offset-assert 284) + ) + :method-count-assert 9 + :size-assert #x120 + :flag-assert #x900000120 + ) + +;; definition for method 3 of type level-load-info +(defmethod inspect level-load-info ((obj level-load-info)) + (when (not obj) + (set! obj obj) + (goto cfg-51) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname-list[6] @ #x~X~%" (&-> obj name)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Ttask-level: ~D~%" (-> obj task-level)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tvisname: ~A~%" (-> obj visname)) + (format #t "~1Tnickname: ~A~%" (-> obj nickname)) + (format #t "~1Tdbname: ~A~%" (-> obj dbname)) + (format #t "~1Ttaskname: ~A~%" (-> obj taskname)) + (format #t "~1Tpackages: ~A~%" (-> obj packages)) + (format #t "~1Tmemory-mode: ~D~%" (-> obj memory-mode)) + (format #t "~1Tmusic-bank: ~A~%" (-> obj music-bank)) + (format #t "~1Tambient-sounds: ~A~%" (-> obj ambient-sounds)) + (format #t "~1Tsound-reverb: ~f~%" (-> obj sound-reverb)) + (format #t "~1Tmood-func: ~A~%" (-> obj mood-func)) + (format #t "~1Tmood-init: ~A~%" (-> obj mood-init)) + (format #t "~1Tocean: ~A~%" (-> obj ocean)) + (format #t "~1Tsky: ~A~%" (-> obj sky)) + (format #t "~1Tuse-camera-other: ~A~%" (-> obj use-camera-other)) + (format #t "~1Tpart-engine-max: ~D~%" (-> obj part-engine-max)) + (format #t "~1Tcity-map-bits: ~D~%" (-> obj city-map-bits)) + (format #t "~1Tcontinues: ~A~%" (-> obj continues)) + (format #t "~1Ttasks: ~A~%" (-> obj tasks)) + (format #t "~1Tpriority: ~D~%" (-> obj priority)) + (format #t "~1Tload-commands: ~A~%" (-> obj load-commands)) + (format #t "~1Talt-load-commands: ~A~%" (-> obj alt-load-commands)) + (format #t "~1Tbsp-mask: ~D~%" (-> obj bsp-mask)) + (format #t "~1Tbuzzer: ~D~%" (-> obj buzzer)) + (format #t "~1Tbottom-height: (meters ~m)~%" (-> obj buttom-height)) + (format #t "~1Trun-packages: ~A~%" (-> obj run-packages)) + (format #t "~1Tprev-level: ~A~%" (-> obj prev-level)) + (format #t "~1Tnext-level: ~A~%" (-> obj next-level)) + (format #t "~1Twait-for-load: ~A~%" (-> obj wait-for-load)) + (format #t "~1Tlogin-func: ~A~%" (-> obj login-func)) + (format #t "~1Tactivate-func: ~A~%" (-> obj activate-func)) + (format #t "~1Tdeactivate-func: ~A~%" (-> obj deactivate-func)) + (format #t "~1Tkill-func: ~A~%" (-> obj kill-func)) + (format #t "~1Tborrow-size[2] @ #x~X~%" (-> obj borrow-size)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Tborrow-size: ~`integer`P~%" s5-0 (-> obj borrow-size s5-0)) + ) + (format #t "~1Tborrow-level[2] @ #x~X~%" (-> obj borrow-level)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tborrow-level: ~`symbol`P~%" s5-1 (-> obj borrow-level s5-1)) + ) + (format #t "~1Tborrow-display?[2] @ #x~X~%" (-> obj borrow-display?)) + (dotimes (s5-2 2) + (format #t "~T [~D]~1Tborrow-display?: ~A~%" s5-2 (-> obj borrow-display? s5-2)) + ) + (format #t "~1Tbase-task-mask: #x~X : (task-mask " (-> obj base-task-mask)) + (let ((s5-3 (-> obj base-task-mask))) + (if (= (logand s5-3 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-3 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-3 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-3 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-3 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-3 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-3) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-3 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-3 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-3 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-3 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-3 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-3 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-3) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-3 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-3 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-3 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-3) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-3 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Ttexture-anim[10] @ #x~X~%" (&-> obj texture-anim-tfrag)) + (format #t "~1Ttexture-anim-tfrag: ~A~%" (-> obj texture-anim-tfrag)) + (format #t "~1Ttexture-anim-pris: ~A~%" (-> obj texture-anim-pris)) + (format #t "~1Ttexture-anim-shrub: ~A~%" (-> obj texture-anim-shrub)) + (format #t "~1Ttexture-anim-alpha: ~A~%" (-> obj texture-anim-alpha)) + (format #t "~1Ttexture-anim-water: ~A~%" (-> obj texture-anim-water)) + (format #t "~1Ttexture-anim-warp: ~A~%" (-> obj texture-anim-twarp)) + (format #t "~1Ttexture-anim-pris2: ~A~%" (-> obj texture-anim-pris2)) + (format #t "~1Ttexture-anim-sprite: ~A~%" (-> obj texture-anim-sprite)) + (format #t "~1Ttexture-anim-map: ~A~%" (-> obj texture-anim-map)) + (format #t "~1Ttexture-anim-sky: ~A~%" (-> obj texture-anim-sky)) + (format #t "~1Tdraw-priority: ~f~%" (-> obj draw-priority)) + (format #t "~1Tlevel-flags: ~D~%" (-> obj level-flags)) + (format #t "~1Tfog-height: ~f~%" (-> obj fog-height)) + (format #t "~1Tbigmap-id: ~D~%" (-> obj bigmap-id)) + (format #t "~1Tocean-near-translucent?: ~A~%" (-> obj ocean-near-translucent?)) + (format #t "~1Tocean-far?: ~A~%" (-> obj ocean-far?)) + (format #t "~1Tmood-range: #~%" (-> obj mood-range)) + (format #t "~1Tmax-rain: ~f~%" (-> obj max-rain)) + (format #t "~1Tfog-mult: ~f~%" (-> obj fog-mult)) + (format #t "~1Tocean-alpha: ~f~%" (-> obj ocean-alpha)) + (format #t "~1Textra-sound-bank: ~A~%" (-> obj extra-sound-bank)) + (label cfg-51) + obj + ) + +;; definition of type login-state +(deftype login-state (basic) + ((state int32 :offset-assert 4) + (pos uint32 :offset-assert 8) + (elts uint32 :offset-assert 12) + (elt drawable 16 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type login-state +(defmethod inspect login-state ((obj login-state)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tstate: ~D~%" (-> obj state)) + (format #t "~1Tpos: ~D~%" (-> obj pos)) + (format #t "~1Telts: ~D~%" (-> obj elts)) + (format #t "~1Telt[16] @ #x~X~%" (-> obj elt)) + (label cfg-4) + obj + ) + +;; definition of type level +(deftype level (basic) + ((name symbol :offset-assert 4) + (load-name basic :offset-assert 8) + (nickname basic :offset-assert 12) + (index int32 :offset-assert 16) + (status symbol :offset-assert 20) + (borrow-level basic 2 :offset-assert 24) + (borrow-from-level basic :offset-assert 32) + (heap kheap :inline :offset-assert 48) + (borrow-heap kheap 2 :inline :offset-assert 64) + (bsp bsp-header :offset-assert 96) + (art-group load-dir-art-group :offset-assert 100) + (info level-load-info :offset-assert 104) + (texture-page texture-page 18 :offset-assert 108) + (loaded-texture-page texture-page 16 :offset-assert 180) + (loaded-texture-page-count int32 :offset-assert 244) + (entity entity-links-array :offset-assert 248) + (closest-object float :offset-assert 252) + (closest-object-array float 18 :offset 252) + (upload-size int32 18 :offset 324) + (inside-boxes symbol :offset-assert 396) + (display? symbol :offset-assert 400) + (render? symbol :offset-assert 404) + (meta-inside? symbol :offset-assert 408) + (force-inside? symbol :offset-assert 412) + (mood-context mood-context :inline :offset-assert 416) + (mood-func basic :offset-assert 2384) + (mood-init (function mood-context none) :offset-assert 2388) + (vis-bits pointer :offset-assert 2392) + (all-visible? symbol :offset-assert 2396) + (force-all-visible? symbol :offset-assert 2400) + (linking basic :offset-assert 2404) + (vis-info level-vis-info 8 :offset-assert 2408) + (vis-self-index int32 :offset-assert 2440) + (vis-adj-index int32 :offset-assert 2444) + (vis-buffer uint8 2048 :offset-assert 2448) + (mem-usage-block basic :offset-assert 4496) + (mem-usage int32 :offset-assert 4500) + (code-memory-start pointer :offset-assert 4504) + (code-memory-end pointer :offset-assert 4508) + (load-start-time time-frame :offset-assert 4512) + (load-stop-time time-frame :offset-assert 4520) + (load-buffer uint32 2 :offset-assert 4528) + (load-buffer-size uint32 :offset-assert 4536) + (load-buffer-last uint32 :offset-assert 4540) + (load-buffer-mode load-buffer-mode :offset-assert 4544) + (display-start-time time-frame :offset-assert 4552) + (memory-mask uint32 :offset-assert 4560) + (task-mask task-mask :offset-assert 4564) + (tfrag-gs-test uint64 :offset-assert 4568) + (texture-dirty-masks texture-mask 10 :inline :offset-assert 4576) + (texture-mask texture-mask 18 :inline :offset-assert 4736) + (sky-mask texture-mask :inline :offset-assert 5024) + (tfrag-masks basic :offset-assert 5040) + (tfrag-dists pointer :offset-assert 5044) + (shrub-masks basic :offset-assert 5048) + (shrub-dists pointer :offset-assert 5052) + (alpha-masks basic :offset-assert 5056) + (alpha-dists pointer :offset-assert 5060) + (water-masks basic :offset-assert 5064) + (water-dists pointer :offset-assert 5068) + (tfrag-last-calls int32 6 :offset-assert 5072) + (texture-anim-array texture-anim-array 10 :offset-assert 5096) + (light-hash basic :offset-assert 5136) + (draw-priority float :offset-assert 5140) + (draw-index int32 :offset-assert 5144) + (part-engine basic :offset-assert 5148) + (user-object basic 4 :offset-assert 5152) + (loaded-text-info-count int32 :offset-assert 5168) + (loaded-text-info game-text-info 8 :offset-assert 5172) + (level-type basic :offset-assert 5204) + (load-order int64 :offset-assert 5208) + (pad int8 12 :offset-assert 5216) + ) + :method-count-assert 30 + :size-assert #x146c + :flag-assert #x1e0000146c + (:methods + (deactivate (_type_) _type_ 9) + (level-method-10 () none 10) + (level-method-11 () none 11) + (unload! (_type_) _type_ 12) + (bsp-name (_type_) symbol 13) + (compute-memory-usage (_type_ object) memory-usage-block 14) + (point-in-boxes? (_type_ vector) symbol 15) + (level-method-16 () none 16) + (load-continue (_type_) _type_ 17) + (load-begin (_type_) _type_ 18) + (login-begin (_type_) _type_ 19) + (debug-print-region-splitbox (_type_ vector object) none 20) + (get-art-group-by-name (_type_ string) art-group 21) + (level-method-22 () none 22) + (level-method-23 () none 23) + (level-method-24 () none 24) + (birth (_type_) _type_ 25) + (level-status-update! (_type_ symbol) _type_ 26) + (load-required-packages (_type_) _type_ 27) + (init-vis-from-bsp (_type_) none 28) + (vis-clear (_type_) none 29) + ) + ) + +;; definition for method 3 of type level +(defmethod inspect level ((obj level)) + (when (not obj) + (set! obj obj) + (goto cfg-48) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tload-name: ~A~%" (-> obj load-name)) + (format #t "~1Tnickname: ~A~%" (-> obj nickname)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tstatus: ~A~%" (-> obj status)) + (format #t "~1Tborrow-level[2] @ #x~X~%" (-> obj borrow-level)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Tborrow-level: ~A~%" s5-0 (-> obj borrow-level s5-0)) + ) + (format #t "~1Tborrow-from-level: ~A~%" (-> obj borrow-from-level)) + (format #t "~1Theap: #~%" (-> obj heap)) + (format #t "~1Tborrow-heap[2] @ #x~X~%" (-> obj borrow-heap)) + (format #t "~1Tbsp: ~A~%" (-> obj bsp)) + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tinfo: ~A~%" (-> obj info)) + (format #t "~1Ttexture-page[18] @ #x~X~%" (-> obj texture-page)) + (format #t "~1Tloaded-texture-page[16] @ #x~X~%" (-> obj loaded-texture-page)) + (format #t "~1Tloaded-texture-page-count: ~D~%" (-> obj loaded-texture-page-count)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tclosest-object: (meters ~m)~%" (&-> obj closest-object)) + (format #t "~1Tupload-size[18] @ #x~X~%" (-> obj upload-size)) + (format #t "~1Tinside-boxes?: ~A~%" (-> obj inside-boxes)) + (format #t "~1Tdisplay?: ~A~%" (-> obj display?)) + (format #t "~1Trender?: ~A~%" (-> obj render?)) + (format #t "~1Tmeta-inside?: ~A~%" (-> obj meta-inside?)) + (format #t "~1Tforce-inside?: ~A~%" (-> obj force-inside?)) + (format #t "~1Tmood-context: #~%" (-> obj mood-context)) + (format #t "~1Tmood-func: ~A~%" (-> obj mood-func)) + (format #t "~1Tmood-init: ~A~%" (-> obj mood-init)) + (format #t "~1Tvis-bits: #x~X~%" (-> obj vis-bits)) + (format #t "~1Tall-visible?: ~A~%" (-> obj all-visible?)) + (format #t "~1Tforce-all-visible?: ~A~%" (-> obj force-all-visible?)) + (format #t "~1Tlinking: ~A~%" (-> obj linking)) + (format #t "~1Tvis-info[8] @ #x~X~%" (-> obj vis-info)) + (format #t "~1Tvis-self-index: ~D~%" (-> obj vis-self-index)) + (format #t "~1Tvis-adj-index: ~D~%" (-> obj vis-adj-index)) + (format #t "~1Tvis-buffer[2048] @ #x~X~%" (-> obj vis-buffer)) + (format #t "~1Tmem-usage-block: ~A~%" (-> obj mem-usage-block)) + (format #t "~1Tmem-usage: ~D~%" (-> obj mem-usage)) + (format #t "~1Tcode-memory-start: #x~X~%" (-> obj code-memory-start)) + (format #t "~1Tcode-memory-end: #x~X~%" (-> obj code-memory-end)) + (format #t "~1Tload-start-time: ~D~%" (-> obj load-start-time)) + (format #t "~1Tload-stop-time: ~D~%" (-> obj load-stop-time)) + (format #t "~1Tload-buffer[2] @ #x~X~%" (-> obj load-buffer)) + (format #t "~1Tload-buffer-size: ~D~%" (-> obj load-buffer-size)) + (format #t "~1Tload-buffer-last: ~A~%" (-> obj load-buffer-last)) + (format #t "~1Tload-buffer-mode: ~D~%" (-> obj load-buffer-mode)) + (format #t "~1Tdisplay-start-time: ~D~%" (-> obj display-start-time)) + (format #t "~1Tmemory-mask: #b~B~%" (-> obj memory-mask)) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) + (let ((s5-1 (-> obj task-mask))) + (if (= (logand s5-1 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-1 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-1 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-1 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-1 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-1 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-1) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-1 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-1 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-1 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-1 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-1 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-1 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-1) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-1 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-1 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-1 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-1) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-1 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Ttfrag-gs-test: ~D~%" (-> obj tfrag-gs-test)) + (format #t "~1Ttexture-dirty-masks[10] @ #x~X~%" (-> obj texture-dirty-masks)) + (format #t "~1Ttexture-mask[18] @ #x~X~%" (-> obj texture-mask)) + (format #t "~1Tsky-mask: #~%" (-> obj sky-mask)) + (format #t "~1Ttfrag-masks: ~A~%" (-> obj tfrag-masks)) + (format #t "~1Ttfrag-dists: #x~X~%" (-> obj tfrag-dists)) + (format #t "~1Tshrub-masks: ~A~%" (-> obj shrub-masks)) + (format #t "~1Tshrub-dists: #x~X~%" (-> obj shrub-dists)) + (format #t "~1Talpha-masks: ~A~%" (-> obj alpha-masks)) + (format #t "~1Talpha-dists: #x~X~%" (-> obj alpha-dists)) + (format #t "~1Twater-masks: ~A~%" (-> obj water-masks)) + (format #t "~1Twater-dists: #x~X~%" (-> obj water-dists)) + (format #t "~1Ttfrag-last-calls[6] @ #x~X~%" (-> obj tfrag-last-calls)) + (format #t "~1Ttexture-anim-array[10] @ #x~X~%" (-> obj texture-anim-array)) + (format #t "~1Tlight-hash: ~A~%" (-> obj light-hash)) + (format #t "~1Tdraw-priority: ~f~%" (-> obj draw-priority)) + (format #t "~1Tdraw-index: ~D~%" (-> obj draw-index)) + (format #t "~1Tpart-engine: ~A~%" (-> obj part-engine)) + (format #t "~1Tuser-object[4] @ #x~X~%" (-> obj user-object)) + (dotimes (s5-2 4) + (format #t "~T [~D]~1Tuser-object: ~A~%" s5-2 (-> obj user-object s5-2)) + ) + (format #t "~1Tloaded-text-info-count: ~D~%" (-> obj loaded-text-info-count)) + (format #t "~1Tloaded-text-info[8] @ #x~X~%" (-> obj loaded-text-info)) + (format #t "~1Tlevel-type: ~A~%" (-> obj level-type)) + (format #t "~1Tload-order: ~D~%" (-> obj load-order)) + (label cfg-48) + obj + ) + +;; definition of type level-group +(deftype level-group (basic) + ((length int32 :offset-assert 4) + (log-in-level-bsp bsp-header :offset-assert 8) + (loading-level level :offset-assert 12) + (entity-link entity-links :offset 16) + (border? symbol :offset-assert 20) + (vis? symbol :offset-assert 24) + (want-level basic :offset-assert 28) + (receiving-level basic :offset-assert 32) + (load-commands pair :offset-assert 36) + (play? symbol :offset-assert 40) + (target-pos vector 2 :inline :offset-assert 48) + (camera-pos vector 2 :inline :offset-assert 80) + (heap kheap :inline :offset-assert 112) + (sound-bank basic 4 :offset-assert 128) + (disk-load-timing? symbol :offset-assert 144) + (load-level basic :offset-assert 148) + (load-size uint32 :offset-assert 152) + (load-time float :offset-assert 156) + (load-login-time float :offset-assert 160) + (draw-level-count int32 :offset-assert 164) + (draw-level basic 7 :offset-assert 168) + (draw-index-map uint8 7 :offset-assert 196) + (load-order uint64 :offset-assert 208) + (pad uint8 30 :offset-assert 216) + (level level 7 :inline :offset-assert 256) + (level0 level :inline :offset 256) + (level1 level :inline :offset 5488) + (level2 level :inline :offset 10720) + (level3 level :inline :offset 15952) + (level4 level :inline :offset 21184) + (level5 level :inline :offset 26416) + (default-level level :inline :offset 31648) + (pad2 uint8 4 :offset-assert 36880) + ) + :method-count-assert 31 + :size-assert #x9014 + :flag-assert #x1f00009014 + (:methods + (level-get (_type_ symbol) level 9) + (level-get-with-status (_type_ symbol) level 10) + (get-level-by-heap-ptr-and-status (_type_ pointer uint) level 11) + (level-get-for-use (_type_ symbol symbol) level 12) + (activate-levels! (_type_) int 13) + (level-group-method-14 () none 14) + (level-group-method-15 () none 15) + (assign-draw-indices (_type_) none 16) + (level-group-method-17 () none 17) + (level-group-method-18 () none 18) + (level-update (_type_) none 19) + (level-get-target-inside (_type_) level 20) + (alloc-levels-if-needed (_type_ symbol) none 21) + (load-commands-set! (_type_ pair) pair 22) + (level-group-method-23 () none 23) + (load-command-get-index (_type_ symbol int) pair 24) + (level-group-method-25 () none 25) + (level-group-method-26 () none 26) + (level-group-method-27 () none 27) + (level-status (_type_ symbol) symbol 28) + (load-in-progress? (_type_) symbol 29) + (level-get-most-disposable (_type_) level 30) + ) + ) + +;; definition for method 3 of type level-group +(defmethod inspect level-group ((obj level-group)) + (when (not obj) + (set! obj obj) + (goto cfg-13) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tentity-link: ~`entity-links`P~%" (-> obj entity-link)) + (format #t "~1Tborder?: ~A~%" (-> obj border?)) + (format #t "~1Tvis?: ~A~%" (-> obj vis?)) + (format #t "~1Twant-level: ~A~%" (-> obj want-level)) + (format #t "~1Treceiving-level: ~A~%" (-> obj receiving-level)) + (format #t "~1Tload-commands: ~A~%" (-> obj load-commands)) + (format #t "~1Tplay?: ~A~%" (-> obj play?)) + (format #t "~1Ttarget-pos[2] @ #x~X~%" (-> obj target-pos)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttarget-pos: ~`vector`P~%" s5-0 (-> obj target-pos s5-0)) + ) + (format #t "~1Tcamera-pos[2] @ #x~X~%" (-> obj camera-pos)) + (dotimes (s5-1 2) + (format #t "~T [~D]~1Tcamera-pos: ~`vector`P~%" s5-1 (-> obj camera-pos s5-1)) + ) + (format #t "~1Theap: #~%" (-> obj heap)) + (format #t "~1Tsound-bank[4] @ #x~X~%" (-> obj sound-bank)) + (format #t "~1Tdisk-load-timing?: ~A~%" (-> obj disk-load-timing?)) + (format #t "~1Tload-level: ~A~%" (-> obj load-level)) + (format #t "~1Tload-size: ~D~%" (-> obj load-size)) + (format #t "~1Tload-time: ~f~%" (-> obj load-time)) + (format #t "~1Tload-login-time: ~f~%" (-> obj load-login-time)) + (format #t "~1Tdraw-level-count: ~D~%" (-> obj draw-level-count)) + (format #t "~1Tdraw-level[7] @ #x~X~%" (-> obj draw-level)) + (dotimes (s5-2 (-> obj draw-level-count)) + (format #t "~T [~D]~1Tdraw-level: ~`object`P~%" s5-2 (-> obj draw-level s5-2)) + ) + (format #t "~1Tdraw-index-map[7] @ #x~X~%" (-> obj draw-index-map)) + (format #t "~1Tload-order: ~D~%" (-> obj load-order)) + (format #t "~1Tlevel[7] @ #x~X~%" (-> obj level)) + (format #t "~1Tdata[7] @ #x~X~%" (-> obj level)) + (format #t "~1Tlevel0: ~`level`P~%" (-> obj level)) + (format #t "~1Tlevel1: ~`level`P~%" (-> obj level1)) + (format #t "~1Tlevel2: ~`level`P~%" (-> obj level2)) + (format #t "~1Tlevel3: ~`level`P~%" (-> obj level3)) + (format #t "~1Tlevel4: ~`level`P~%" (-> obj level4)) + (format #t "~1Tlevel5: ~`level`P~%" (-> obj level5)) + (format #t "~1Tlevel-default: ~`level`P~%" (-> obj default-level)) + (label cfg-13) + obj + ) + +;; failed to figure out what this is: +(when (zero? *level*) + (set! *level* (new 'static 'level-group + :length 6 + :log-in-level-bsp #f + :loading-level #f + :entity-link #f + :border? #f + :vis? #f + :want-level #f + :load-commands '() + :play? #f + :sound-bank (new 'static 'array basic 4 #f #f #f #f) + :disk-load-timing? #f + :level (new 'static 'inline-array level 7 + (new 'static 'level + :name #f + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 1 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 2 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 3 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 4 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name #f + :index 5 + :status 'inactive + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :inside-boxes #f + :force-inside? #f + :linking #f + :level-type #f + ) + (new 'static 'level + :name 'default + :index 6 + :status 'reserved + :borrow-level (new 'static 'array basic 2 #f #f) + :borrow-from-level #f + :bsp #f + :inside-boxes #f + :display? #f + :force-inside? #f + :linking #f + :level-type #f + ) + ) + ) + ) + (set! *draw-index* 0) + (set! *level-index* 0) + 0 + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/level/region-h_REF.gc b/test/decompiler/reference/jak2/engine/level/region-h_REF.gc new file mode 100644 index 0000000000..f459cae9d6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/level/region-h_REF.gc @@ -0,0 +1,278 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type region +(deftype region (structure) + ((id uint32 :offset-assert 0) + (on-enter basic :offset-assert 4) + (on-inside basic :offset-assert 8) + (on-exit basic :offset-assert 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (region-method-9 () none 9) + ) + ) + +;; definition for method 3 of type region +(defmethod inspect region ((obj region)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'region) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Ton-enter: ~A~%" (-> obj on-enter)) + (format #t "~1Ton-inside: ~A~%" (-> obj on-inside)) + (format #t "~1Ton-exit: ~A~%" (-> obj on-exit)) + (label cfg-4) + obj + ) + +;; definition of type region-array +(deftype region-array (inline-array-class) + ((data region :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type region-array +(defmethod inspect region-array ((obj region-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! (-> region-array heap-base) (the-as uint 16)) + +;; definition of type drawable-region-prim +(deftype drawable-region-prim (drawable) + ((region region :offset 8) + ) + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + (:methods + (drawable-region-prim-method-17 () none 17) + (drawable-region-prim-method-18 () none 18) + (drawable-region-prim-method-19 () none 19) + ) + ) + +;; definition for method 3 of type drawable-region-prim +(defmethod inspect drawable-region-prim ((obj drawable-region-prim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tregion: #~%" (-> obj region)) + (label cfg-4) + obj + ) + +;; definition of type drawable-tree-region-prim +(deftype drawable-tree-region-prim (drawable-tree) + ((name basic :offset 8) + (data2 drawable-inline-array :dynamic :offset 32) + ) + :method-count-assert 19 + :size-assert #x20 + :flag-assert #x1300000020 + (:methods + (drawable-tree-region-prim-method-17 () none 17) + (debug-print (_type_ vector object) none 18) + ) + ) + +;; definition for method 3 of type drawable-tree-region-prim +(defmethod inspect drawable-tree-region-prim ((obj drawable-tree-region-prim)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data2)) + (dotimes (s5-0 (-> obj length)) + (format #t "~T [~D]~1Tdata: ~A~%" s5-0 (-> obj data2 s5-0)) + ) + (format #t "~1Tname: ~A~%" (-> obj name)) + (label cfg-7) + obj + ) + +;; definition of type drawable-inline-array-region-prim +(deftype drawable-inline-array-region-prim (drawable-inline-array) + ((data drawable-region-prim 1 :inline :offset-assert 32) + (pad uint8 4 :offset-assert 64) + ) + :method-count-assert 17 + :size-assert #x44 + :flag-assert #x1100000044 + ) + +;; definition of type drawable-region-sphere +(deftype drawable-region-sphere (drawable-region-prim) + () + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + ) + +;; definition for method 3 of type drawable-region-sphere +(defmethod inspect drawable-region-sphere ((obj drawable-region-sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tregion: #~%" (-> obj region)) + (label cfg-4) + obj + ) + +;; definition of type region-face-data +(deftype region-face-data (structure) + ((normal vector :inline :offset-assert 0) + (normal-offset float :offset 12) + (num-points uint32 :offset-assert 16) + (points vector :inline :dynamic :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type region-face-data +(defmethod inspect region-face-data ((obj region-face-data)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'region-face-data) + (format #t "~1Tnormal: #~%" (-> obj normal)) + (format #t "~1Tnormal-offset: ~f~%" (-> obj normal w)) + (format #t "~1Tnum-points: ~D~%" (-> obj num-points)) + (format #t "~1Tpoints[0] @ #x~X~%" (-> obj points)) + (label cfg-4) + obj + ) + +;; definition of type drawable-region-face +(deftype drawable-region-face (drawable-region-prim) + ((data region-face-data :offset 12) + ) + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + ) + +;; definition for method 3 of type drawable-region-face +(defmethod inspect drawable-region-face ((obj drawable-region-face)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tregion: #~%" (-> obj region)) + (format #t "~1Tdata: #~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type region-face-array +(deftype region-face-array (inline-array-class) + ((data region-face-data :dynamic :offset 20) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type region-face-array +(defmethod inspect region-face-array ((obj region-face-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! (-> region-face-array heap-base) (the-as uint 32)) + +;; definition of type drawable-region-volume +(deftype drawable-region-volume (drawable-region-prim) + ((faces region-face-array :offset 12) + ) + :method-count-assert 20 + :size-assert #x20 + :flag-assert #x1400000020 + ) + +;; definition for method 3 of type drawable-region-volume +(defmethod inspect drawable-region-volume ((obj drawable-region-volume)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tregion: #~%" (-> obj region)) + (format #t "~1Tfaces: ~A~%" (-> obj faces)) + (label cfg-4) + obj + ) + +;; definition of type region-prim-list +(deftype region-prim-list (structure) + ((num-items int32 :offset-assert 0) + (items drawable-region-prim 320 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x504 + :flag-assert #x900000504 + ) + +;; definition for method 3 of type region-prim-list +(defmethod inspect region-prim-list ((obj region-prim-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'region-prim-list) + (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) + (format #t "~1Titems[320] @ #x~X~%" (-> obj items)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc b/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc new file mode 100644 index 0000000000..c08a38fc19 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/load/decomp-h_REF.gc @@ -0,0 +1,36 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type decomp-work +(deftype decomp-work (structure) + ((buffer0 uint8 2048 :offset-assert 0) + (buffer1 uint8 2048 :offset-assert 2048) + (indices uint16 2048 :offset-assert 4096) + (temp-indices uint16 2048 :offset-assert 8192) + ) + :method-count-assert 9 + :size-assert #x3000 + :flag-assert #x900003000 + ) + +;; definition for method 3 of type decomp-work +(defmethod inspect decomp-work ((obj decomp-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'decomp-work) + (format #t "~1Tbuffer0[2048] @ #x~X~%" (-> obj buffer0)) + (format #t "~1Tbuffer1[2048] @ #x~X~%" (-> obj buffer1)) + (format #t "~1Tindices[2048] @ #x~X~%" (-> obj indices)) + (format #t "~1Ttemp-indices[2048] @ #x~X~%" (-> obj temp-indices)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/load/file-io_REF.gc b/test/decompiler/reference/jak2/engine/load/file-io_REF.gc new file mode 100644 index 0000000000..5dd2084ffa --- /dev/null +++ b/test/decompiler/reference/jak2/engine/load/file-io_REF.gc @@ -0,0 +1,220 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type file-stream +(deftype file-stream (basic) + ((flags uint32 :offset-assert 4) + (mode symbol :offset-assert 8) + (name string :offset-assert 12) + (file uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + (:methods + (new (symbol type string symbol) _type_ 0) + ) + ) + +;; definition for method 3 of type file-stream +(defmethod inspect file-stream ((obj file-stream)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tflags: #x~X~%" (-> obj flags)) + (format #t "~1Tmode: ~A~%" (-> obj mode)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tfile: ~D~%" (-> obj file)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type file-stream +(defmethod new file-stream ((allocation symbol) (type-to-make type) (arg0 string) (arg1 symbol)) + (let ((a0-1 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (file-stream-open a0-1 arg0 arg1) + ) + ) + +;; failed to figure out what this is: +(set! (-> file-stream method-table 4) file-stream-length) + +;; definition for function file-stream-read-string +(defun file-stream-read-string ((arg0 file-stream) (arg1 string)) + (clear arg1) + (file-stream-read arg0 (-> arg1 data) (length arg0)) + arg1 + ) + +;; definition of type file-info +(deftype file-info (basic) + ((file-type (pointer string) :offset-assert 4) + (file-name basic :offset-assert 8) + (major-version uint32 :offset-assert 12) + (minor-version uint32 :offset-assert 16) + (maya-file-name basic :offset-assert 20) + (tool-debug basic :offset-assert 24) + (mdb-file-name basic :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type file-info +(defmethod inspect file-info ((obj file-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tfile-type: ~A~%" (-> obj file-type)) + (format #t "~1Tfile-name: ~A~%" (-> obj file-name)) + (format #t "~1Tmajor-version: ~D~%" (-> obj major-version)) + (format #t "~1Tminor-version: ~D~%" (-> obj minor-version)) + (format #t "~1Tmaya-file-name: ~A~%" (-> obj maya-file-name)) + (format #t "~1Ttool-debug: ~A~%" (-> obj tool-debug)) + (format #t "~1Tmdb-file-name: ~A~%" (-> obj mdb-file-name)) + (label cfg-4) + obj + ) + +;; definition for method 2 of type file-info +(defmethod print file-info ((obj file-info)) + (format + #t + "#<~A ~A :version ~D.~D @ #x~X>" + (-> obj type) + (-> obj file-name) + (-> obj major-version) + (-> obj minor-version) + obj + ) + obj + ) + +;; definition for symbol *file-temp-string*, type string +(define *file-temp-string* (new 'global 'string 128 (the-as string #f))) + +;; definition for function make-file-name +(defun make-file-name ((arg0 file-kind) (arg1 string) (arg2 int) (arg3 symbol)) + (clear *file-temp-string*) + (cond + ((= arg0 (file-kind dir-tpage)) + (format *file-temp-string* "texture-page~D/dir-tpages" 8) + ) + ((= arg0 (file-kind tpage)) + (format *file-temp-string* "texture-page~D/tpage-~S" 8 arg1) + ) + ((= arg0 (file-kind level-bt)) + (format *file-temp-string* "level~D/~S-bt" 36 arg1) + ) + ((= arg0 (file-kind tx)) + (format *file-temp-string* "res~D/~S-tx" 1 arg1) + ) + ((= arg0 (file-kind level-vs)) + (format *file-temp-string* "level~D/~S-vs" 36 arg1) + ) + ((= arg0 (file-kind vis)) + (format *file-temp-string* "~S.VIS" arg1) + ) + ((= arg0 (file-kind map)) + (format *file-temp-string* "map~D/~S-mp" 1 arg1) + ) + ((= arg0 (file-kind art-group)) + (format + *file-temp-string* + "art-group~D/~S-ag" + (cond + ((> arg2 0) + (empty) + arg2 + ) + (else + 7 + ) + ) + arg1 + ) + ) + ) + *file-temp-string* + ) + +;; definition for function make-vfile-name +(defun make-vfile-name ((arg0 file-kind) (arg1 string)) + (clear *file-temp-string*) + (cond + ((= arg0 (file-kind level-bt)) + (format *file-temp-string* "$LEVEL/~S" arg1) + ) + ((= arg0 (file-kind art-group)) + (format *file-temp-string* "$ART_GROUP/~S" arg1) + ) + ) + *file-temp-string* + ) + +;; definition for function file-info-correct-version? +(defun file-info-correct-version? ((arg0 file-info) (arg1 file-kind) (arg2 int)) + (let* ((s5-0 (cond + ((zero? arg2) + (case arg1 + (((file-kind tpage) (file-kind dir-tpage)) + 8 + ) + (((file-kind level-bt)) + 36 + ) + (((file-kind art-group)) + 7 + ) + ) + ) + (else + arg2 + ) + ) + ) + (v1-1 arg1) + (s4-0 (cond + ((= v1-1 (file-kind tpage)) + "texture-page" + ) + ((= v1-1 (file-kind level-bt)) + "bsp-header" + ) + ((= v1-1 (file-kind art-group)) + "art-group" + ) + ) + ) + ) + (cond + ((not (name= (-> arg0 file-type 0) s4-0)) + (format 0 "ERROR: file ~A is of type ~S but needs to be ~S.~%" (-> arg0 file-name) (-> arg0 file-type) s4-0) + #f + ) + ((!= s5-0 (-> arg0 major-version)) + (format + 0 + "ERROR: file ~A is version ~D.~D, but needs to be ~D.x~%" + (-> arg0 file-name) + (-> arg0 major-version) + (-> arg0 minor-version) + s5-0 + ) + #f + ) + (else + #t + ) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc new file mode 100644 index 0000000000..6af026470b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/load/loader-h_REF.gc @@ -0,0 +1,311 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type load-dir +(deftype load-dir (basic) + ((lev level :offset-assert 4) + (string-array (array string) :offset-assert 8) + (data-array (array basic) :offset-assert 12) + ) + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (new (symbol type int level) _type_ 0) + (load-dir-method-9 () none 9) + (load-dir-method-10 () none 10) + ) + ) + +;; definition of type load-dir-art-group +(deftype load-dir-art-group (load-dir) + ((art-group-array (array art-group) :offset 12) + ) + :method-count-assert 11 + :size-assert #x10 + :flag-assert #xb00000010 + (:methods + (new (symbol type int level) _type_ 0) + ) + ) + +;; definition for method 0 of type load-dir +(defmethod new load-dir ((allocation symbol) (type-to-make type) (arg0 int) (arg1 level)) + (let ((s4-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s4-0 lev) arg1) + (set! (-> s4-0 string-array) + (the-as (array string) ((method-of-type array new) allocation array string arg0)) + ) + (set! (-> s4-0 string-array length) 0) + (set! (-> s4-0 data-array) (the-as (array basic) ((method-of-type array new) allocation array basic arg0))) + (set! (-> s4-0 data-array length) 0) + s4-0 + ) + ) + +;; definition for method 0 of type load-dir-art-group +;; INFO: Return type mismatch load-dir vs load-dir-art-group. +(defmethod new load-dir-art-group ((allocation symbol) (type-to-make type) (arg0 int) (arg1 level)) + (let ((v0-0 ((method-of-type load-dir new) allocation type-to-make arg0 arg1))) + (set! (-> v0-0 data-array content-type) art-group) + (the-as load-dir-art-group v0-0) + ) + ) + +;; definition of type external-art-buffer +(deftype external-art-buffer (basic) + ((index int32 :offset-assert 4) + (other external-art-buffer :offset-assert 8) + (status symbol :offset-assert 12) + (locked? symbol :offset-assert 16) + (login? symbol :offset-assert 20) + (frame-lock symbol :offset-assert 24) + (init-heap function :offset-assert 28) + (heap kheap :inline :offset-assert 32) + (pending-load-file string :offset-assert 48) + (pending-load-file-part int32 :offset-assert 52) + (pending-load-file-owner handle :offset-assert 56) + (pending-load-file-priority float :offset-assert 64) + (load-file string :offset-assert 68) + (load-file-part int32 :offset-assert 72) + (load-file-owner handle :offset-assert 80) + (load-file-priority float :offset-assert 88) + (buf pointer :offset-assert 92) + (len int32 :offset-assert 96) + (art-group art-group :offset-assert 100) + (art-data uint32 :offset 100) + ) + :method-count-assert 16 + :size-assert #x68 + :flag-assert #x1000000068 + (:methods + (new (symbol type int function symbol) _type_ 0) + (external-art-buffer-method-9 () none 9) + (external-art-buffer-method-10 () none 10) + (external-art-buffer-method-11 () none 11) + (external-art-buffer-method-12 () none 12) + (external-art-buffer-method-13 () none 13) + (external-art-buffer-method-14 () none 14) + (external-art-buffer-method-15 () none 15) + ) + ) + +;; definition for method 3 of type external-art-buffer +(defmethod inspect external-art-buffer ((obj external-art-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tother: ~A~%" (-> obj other)) + (format #t "~1Tstatus: ~A~%" (-> obj status)) + (format #t "~1Tlocked?: ~A~%" (-> obj locked?)) + (format #t "~1Tlogin?: ~A~%" (-> obj login?)) + (format #t "~1Tframe-lock: ~A~%" (-> obj frame-lock)) + (format #t "~1Tinit-heap: ~A~%" (-> obj init-heap)) + (format #t "~1Theap: #~%" (-> obj heap)) + (format #t "~1Tpending-load-file: ~A~%" (-> obj pending-load-file)) + (format #t "~1Tpending-load-file-part: ~D~%" (-> obj pending-load-file-part)) + (format #t "~1Tpending-load-file-owner: ~D~%" (-> obj pending-load-file-owner)) + (format #t "~1Tpending-load-file-priority: ~f~%" (-> obj pending-load-file-priority)) + (format #t "~1Tload-file: ~A~%" (-> obj load-file)) + (format #t "~1Tload-file-part: ~D~%" (-> obj load-file-part)) + (format #t "~1Tload-file-owner: ~D~%" (-> obj load-file-owner)) + (format #t "~1Tload-file-priority: ~f~%" (-> obj load-file-priority)) + (format #t "~1Tbuf: #x~X~%" (-> obj buf)) + (format #t "~1Tlen: ~D~%" (-> obj len)) + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tart-data: #x~X~%" (-> obj art-group)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type external-art-buffer +(defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (arg0 int) (arg1 function) (arg2 symbol)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 index) arg0) + (set! (-> v0-0 init-heap) arg1) + (set! (-> v0-0 login?) arg2) + (set! (-> v0-0 load-file) #f) + (set! (-> v0-0 load-file-part) -1) + (set! (-> v0-0 load-file-owner) (the-as handle #f)) + (set! (-> v0-0 load-file-priority) 100000000.0) + (set! (-> v0-0 pending-load-file) #f) + (set! (-> v0-0 pending-load-file-part) -1) + (set! (-> v0-0 pending-load-file-owner) (the-as handle #f)) + (set! (-> v0-0 pending-load-file-priority) 100000000.0) + (set! (-> v0-0 art-group) #f) + (set! (-> v0-0 status) 'initialize) + (set! (-> v0-0 locked?) #f) + (set! (-> v0-0 other) #f) + v0-0 + ) + ) + +;; definition of type spool-anim +(deftype spool-anim (basic) + ((name string :offset 16) + (anim-name basic :offset-assert 20) + (parts int32 :offset-assert 24) + (hint-id int32 :offset 24) + (priority float :offset-assert 28) + (owner uint64 :offset-assert 32) + (command-list pair :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type spool-anim +(defmethod inspect spool-anim ((obj spool-anim)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tanim-name: ~A~%" (-> obj anim-name)) + (format #t "~1Tparts: ~D~%" (-> obj parts)) + (format #t "~1Thint-id: ~D~%" (-> obj parts)) + (format #t "~1Tpriority: ~f~%" (-> obj priority)) + (format #t "~1Towner: ~D~%" (-> obj owner)) + (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) + (label cfg-4) + obj + ) + +;; definition of type external-art-control +(deftype external-art-control (basic) + ((buffer external-art-buffer 2 :offset-assert 4) + (rec spool-anim 3 :inline :offset-assert 16) + (spool-lock handle :offset-assert 160) + (reserve-buffer external-art-buffer :offset-assert 168) + (reserve-buffer-count int16 :offset-assert 172) + (dma-reserve-buffer-count int16 :offset-assert 174) + (active-stream string :offset-assert 176) + (queue-stream (array spool-anim) :offset-assert 180) + (frame-mask uint32 :offset-assert 184) + (dma-reserve-heap kheap :inline :offset-assert 192) + ) + :method-count-assert 16 + :size-assert #xd0 + :flag-assert #x10000000d0 + (:methods + (new (symbol type) _type_ 0) + (update (_type_ symbol) int 9) + (clear-rec (_type_) int 10) + (external-art-control-method-11 () none 11) + (external-art-control-method-12 () none 12) + (external-art-control-method-13 () none 13) + (external-art-control-method-14 () none 14) + (external-art-control-method-15 () none 15) + ) + ) + +;; definition for method 3 of type external-art-control +(defmethod inspect external-art-control ((obj external-art-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (format #t "~1Trec[3] @ #x~X~%" (-> obj rec)) + (format #t "~1Tspool-lock: ~D~%" (-> obj spool-lock)) + (format #t "~1Treserve-buffer: ~A~%" (-> obj reserve-buffer)) + (format #t "~1Treserve-buffer-count: ~D~%" (-> obj reserve-buffer-count)) + (format #t "~1Tdma-reserve-buffer-count: ~D~%" (-> obj dma-reserve-buffer-count)) + (format #t "~1Tactive-stream: ~A~%" (-> obj active-stream)) + (format #t "~1Tqueue-stream: ~A~%" (-> obj queue-stream)) + (format #t "~1Tframe-mask: ~D~%" (-> obj frame-mask)) + (format #t "~1Tdma-reserve-heap: #~%" (-> obj dma-reserve-heap)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type external-art-control +(defmethod new external-art-control ((allocation symbol) (type-to-make type)) + (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (dotimes (s4-0 2) + (set! (-> gp-0 buffer s4-0) + ((method-of-type external-art-buffer new) allocation external-art-buffer s4-0 external-art-buffer-init #t) + ) + ) + (set! (-> gp-0 buffer 0 other) (-> gp-0 buffer 1)) + (set! (-> gp-0 buffer 1 other) (-> gp-0 buffer 0)) + (dotimes (v1-9 3) + (set! (-> gp-0 rec v1-9 name) #f) + (set! (-> gp-0 rec v1-9 priority) 100000000.0) + (set! (-> gp-0 rec v1-9 owner) (the-as uint #f)) + ) + (set! (-> gp-0 spool-lock) (the-as handle #f)) + (set! (-> gp-0 reserve-buffer) #f) + (set! (-> gp-0 active-stream) #f) + (set! (-> gp-0 queue-stream) (the-as (array spool-anim) (new 'global 'boxed-array spool-anim 4))) + (dotimes (s5-1 (-> gp-0 queue-stream allocated-length)) + (set! (-> gp-0 queue-stream s5-1) (new 'global 'spool-anim)) + ) + (set! (-> gp-0 queue-stream length) 0) + gp-0 + ) + ) + +;; definition of type subtitle-range +(deftype subtitle-range (basic) + ((start-frame float :offset-assert 4) + (end-frame float :offset-assert 8) + (message object 8 :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type subtitle-range +(defmethod inspect subtitle-range ((obj subtitle-range)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tstart-frame: ~f~%" (-> obj start-frame)) + (format #t "~1Tend-frame: ~f~%" (-> obj end-frame)) + (format #t "~1Tmessage[8] @ #x~X~%" (-> obj message)) + (dotimes (s5-0 8) + (format #t "~T [~D]~1Tmessage: ~`object`P~%" s5-0 (-> obj message s5-0)) + ) + (label cfg-7) + obj + ) + +;; definition of type subtitle-image +(deftype subtitle-image (basic) + ((width uint16 :offset-assert 4) + (height uint16 :offset-assert 6) + (palette rgba 16 :offset 16) + (data uint8 :dynamic :offset-assert 80) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type subtitle-image +(defmethod inspect subtitle-image ((obj subtitle-image)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twidth: ~D~%" (-> obj width)) + (format #t "~1Theight: ~D~%" (-> obj height)) + (format #t "~1Tpalette[16] @ #x~X~%" (-> obj palette)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc b/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc new file mode 100644 index 0000000000..a9883776a3 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/euler-h_REF.gc @@ -0,0 +1,41 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol EulSafe, type (array int32) +(define EulSafe (the-as (array int32) (new 'static 'boxed-array :type int32 0 1 2 0))) + +;; definition for symbol EulNext, type (array int32) +(define EulNext (the-as (array int32) (new 'static 'boxed-array :type int32 1 2 0 1))) + +;; definition of type euler-angles +(deftype euler-angles (vector) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type euler-angles +;; INFO: Used lq/sq +(defmethod inspect euler-angles ((obj euler-angles)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'euler-angles) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/math/euler_REF.gc b/test/decompiler/reference/jak2/engine/math/euler_REF.gc new file mode 100644 index 0000000000..537e56ba1b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/euler_REF.gc @@ -0,0 +1,213 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function set-eul! +(defun set-eul! ((arg0 euler-angles) (arg1 float) (arg2 float) (arg3 float) (arg4 int)) + (set! (-> arg0 x) arg1) + (set! (-> arg0 y) arg2) + (set! (-> arg0 z) arg3) + (set! (-> arg0 w) (the float arg4)) + arg0 + ) + +;; definition for function eul->matrix +;; INFO: Used lq/sq +(defun eul->matrix ((arg0 matrix) (arg1 euler-angles)) + (matrix-identity! arg0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg1 quad)) + (when (= (logand (the int (-> s5-0 w)) 1) 1) + (let ((f0-2 (-> s5-0 x))) + (set! (-> s5-0 x) (-> s5-0 z)) + (set! (-> s5-0 z) f0-2) + ) + ) + (when (= (logand (/ (the int (-> s5-0 w)) 4) 1) 1) + (set! (-> s5-0 x) (- (-> s5-0 x))) + (set! (-> s5-0 y) (- (-> s5-0 y))) + (set! (-> s5-0 z) (- (-> s5-0 z))) + ) + (let* ((f26-0 (cos (-> s5-0 x))) + (f30-0 (cos (-> s5-0 y))) + (f22-0 (cos (-> s5-0 z))) + (f24-0 (sin (-> s5-0 x))) + (f28-0 (sin (-> s5-0 y))) + (f4-0 (sin (-> s5-0 z))) + (f0-17 (* f26-0 f22-0)) + (f1-1 (* f26-0 f4-0)) + (f2-0 (* f24-0 f22-0)) + (f3-0 (* f24-0 f4-0)) + ) + 0 + 0 + 0 + (let* ((v1-12 (logand (/ (the int (-> s5-0 w)) 4) 1)) + (a1-2 (-> EulSafe (logand (/ (the int (-> s5-0 w)) 8) 3))) + (a0-21 (-> EulNext (+ a1-2 v1-12))) + (v1-17 (-> EulNext (+ (- 1 v1-12) a1-2))) + ) + (cond + ((= (logand (/ (the int (-> s5-0 w)) 2) 1) 1) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a1-2 4)) (the-as int arg0)))) f30-0) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a0-21 4)) (the-as int arg0)))) (* f28-0 f24-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* v1-17 4)) (the-as int arg0)))) (* f28-0 f26-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a1-2 4)) (the-as int arg0)))) (* f28-0 f4-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a0-21 4)) (the-as int arg0)))) + (- f0-17 (* f30-0 f3-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* v1-17 4)) (the-as int arg0)))) + (- (- f2-0) (* f30-0 f1-1)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a1-2 4)) (the-as int arg0)))) (- (* f28-0 f22-0))) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a0-21 4)) (the-as int arg0)))) + (+ f1-1 (* f30-0 f2-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* v1-17 4)) (the-as int arg0)))) + (+ (- f3-0) (* f30-0 f0-17)) + ) + ) + (else + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a1-2 4)) (the-as int arg0)))) (* f30-0 f22-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* a0-21 4)) (the-as int arg0)))) + (+ (- f1-1) (* f28-0 f2-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a1-2 16) (* v1-17 4)) (the-as int arg0)))) + (+ f3-0 (* f28-0 f0-17)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a1-2 4)) (the-as int arg0)))) (* f30-0 f4-0)) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* a0-21 4)) (the-as int arg0)))) + (+ f0-17 (* f28-0 f3-0)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* a0-21 16) (* v1-17 4)) (the-as int arg0)))) + (+ (- f2-0) (* f28-0 f1-1)) + ) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a1-2 4)) (the-as int arg0)))) (- f28-0)) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* a0-21 4)) (the-as int arg0)))) (* f30-0 f24-0)) + (set! (-> (the-as (pointer float) (+ (+ (* v1-17 16) (* v1-17 4)) (the-as int arg0)))) (* f30-0 f26-0)) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function matrix->eul +(defun matrix->eul ((arg0 euler-angles) (arg1 matrix) (arg2 int)) + 0 + 0 + 0 + (let* ((v1-4 (logand (/ arg2 4) 1)) + (s3-0 (-> EulSafe (logand (/ arg2 8) 3))) + (s2-0 (-> EulNext (+ s3-0 v1-4))) + (s1-0 (-> EulNext (+ (- 1 v1-4) s3-0))) + ) + (cond + ((= (logand (/ arg2 2) 1) 1) + (let* ((f0-0 (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1))))) + (f0-2 (* f0-0 f0-0)) + (f1-0 (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1))))) + (f30-0 (sqrtf (+ f0-2 (* f1-0 f1-0)))) + ) + (cond + ((< 0.00000000001 f30-0) + (set! (-> arg0 x) (atan + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s3-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) (atan f30-0 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))))) + (set! (-> arg0 z) (atan + (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1)))) + (- (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))))) + ) + ) + ) + (else + (set! (-> arg0 x) (atan + (- (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s2-0 16)) (the-as int arg1))))) + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s2-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) (atan f30-0 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))))) + (set! (-> arg0 z) 0.0) + ) + ) + ) + ) + (else + (let* ((f0-21 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1))))) + (f0-23 (* f0-21 f0-21)) + (f1-3 (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1))))) + (f30-1 (sqrtf (+ f0-23 (* f1-3 f1-3)))) + ) + (cond + ((< 0.00000000001 f30-1) + (set! (-> arg0 x) + (atan + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s1-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s1-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) + (atan (- (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))))) f30-1) + ) + (set! (-> arg0 z) (atan + (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s2-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s3-0 16)) (the-as int arg1)))) + ) + ) + ) + (else + (set! (-> arg0 x) + (atan + (- (-> (the-as (pointer float) (+ (+ (* s1-0 4) (* s2-0 16)) (the-as int arg1))))) + (-> (the-as (pointer float) (+ (+ (* s2-0 4) (* s2-0 16)) (the-as int arg1)))) + ) + ) + (set! (-> arg0 y) + (atan (- (-> (the-as (pointer float) (+ (+ (* s3-0 4) (* s1-0 16)) (the-as int arg1))))) f30-1) + ) + (set! (-> arg0 z) 0.0) + ) + ) + ) + ) + ) + ) + (when (= (logand (/ arg2 4) 1) 1) + (set! (-> arg0 x) (- (-> arg0 x))) + (set! (-> arg0 y) (- (-> arg0 y))) + (set! (-> arg0 z) (- (-> arg0 z))) + ) + (when (= (logand arg2 1) 1) + (let ((f0-49 (-> arg0 x))) + (set! (-> arg0 x) (-> arg0 z)) + (set! (-> arg0 z) f0-49) + ) + ) + (set! (-> arg0 w) (the float arg2)) + arg0 + ) + +;; definition for function eul->quat +(defun eul->quat ((arg0 quaternion) (arg1 euler-angles)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (eul->matrix s5-0 arg1) + (matrix->quaternion arg0 s5-0) + ) + arg0 + ) + +;; definition for function quat->eul +(defun quat->eul ((arg0 euler-angles) (arg1 quaternion) (arg2 int)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (quaternion->matrix s5-0 arg1) + (matrix->eul arg0 s5-0 arg2) + ) + arg0 + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/math/math_REF.gc b/test/decompiler/reference/jak2/engine/math/math_REF.gc new file mode 100644 index 0000000000..8bb86cac99 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/math_REF.gc @@ -0,0 +1,670 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function truncate +(defun truncate ((arg0 float)) + (the float (the int arg0)) + ) + +;; definition for function floor +(defun floor ((arg0 float)) + (let ((f0-3 (the float (the int arg0)))) + (if (or (>= arg0 0.0) (= arg0 f0-3)) + f0-3 + (+ -1.0 f0-3) + ) + ) + ) + +;; definition for function ceil +(defun ceil ((arg0 float)) + (let ((f0-3 (the float (the int arg0)))) + (if (or (>= 0.0 arg0) (= arg0 f0-3)) + f0-3 + (+ 1.0 f0-3) + ) + ) + ) + +;; definition for function integral? +(defun integral? ((arg0 float)) + (= (the float (the int arg0)) arg0) + ) + +;; definition for function fractional-part +(defun fractional-part ((arg0 float)) + (- arg0 (the float (the int arg0))) + ) + +;; definition for function sawtooth-wave +(defun sawtooth-wave ((arg0 float)) + (let ((f0-2 (- arg0 (the float (the int arg0))))) + (if (< f0-2 0.0) + (set! f0-2 (+ 1.0 f0-2)) + ) + f0-2 + ) + ) + +;; definition for function triangle-wave +(defun triangle-wave ((arg0 float)) + (let* ((f0-1 (* 0.25 (+ -1.0 arg0))) + (f0-3 (- f0-1 (the float (the int f0-1)))) + ) + (if (< f0-3 0.0) + (set! f0-3 (+ 1.0 f0-3)) + ) + (+ -1.0 (fabs (+ -2.0 (* 4.0 f0-3)))) + ) + ) + +;; definition for function log-x-plus-1-order9 +(defun log-x-plus-1-order9 ((arg0 float)) + (* arg0 + (+ 1.0 + (* arg0 + (+ -0.5 + (* arg0 + (+ 0.33333334 + (* arg0 + (+ -0.25 + (* arg0 (+ 0.2 (* arg0 (+ -0.16666666 (* arg0 (+ 0.14285715 (* arg0 (+ -0.125 (* 0.11111111 arg0))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function logf +(defun logf ((arg0 float)) + (let ((v1-1 (the-as int (+ (shr (the-as int arg0) 23) -126))) + (a0-2 (the-as number (logior #x3f000000 (logand (the-as uint #x807fffff) (the-as uint arg0))))) + ) + (when (< (the-as float (gpr->fpr (the-as int a0-2))) 0.70710677) + (set! a0-2 (+ (the-as float (gpr->fpr (the-as int a0-2))) (the-as float (gpr->fpr (the-as int a0-2))))) + (set! v1-1 (the-as int (+ (the-as uint v1-1) -1))) + ) + (let ((f0-5 (+ -1.0 (the-as float (gpr->fpr a0-2))))) + (+ (* f0-5 + (+ 1.0 + (* f0-5 + (+ -0.5 + (* f0-5 + (+ 0.33333334 + (* f0-5 + (+ -0.25 + (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + (* 0.6931472 (the float v1-1)) + ) + ) + ) + ) + +;; definition for function log2f +(defun log2f ((arg0 float)) + (let ((v1-1 (the-as int (+ (shr (the-as int arg0) 23) -126))) + (a0-2 (the-as number (logior #x3f000000 (logand (the-as uint #x807fffff) (the-as uint arg0))))) + ) + (when (< (the-as float (gpr->fpr (the-as int a0-2))) 0.70710677) + (set! a0-2 (+ (the-as float (gpr->fpr (the-as int a0-2))) (the-as float (gpr->fpr (the-as int a0-2))))) + (set! v1-1 (the-as int (+ (the-as uint v1-1) -1))) + ) + (let* ((f0-5 (+ -1.0 (the-as float (gpr->fpr a0-2)))) + (f0-7 + (* f0-5 + (+ 1.0 + (* f0-5 + (+ -0.5 + (* f0-5 + (+ 0.33333334 + (* f0-5 + (+ -0.25 + (* f0-5 (+ 0.2 (* f0-5 (+ -0.16666666 (* f0-5 (+ 0.14285715 (* f0-5 (+ -0.125 (* 0.11111111 f0-5))))))))) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (+ (* 1.442695 f0-7) (the float v1-1)) + ) + ) + ) + +;; definition of type float-type +(deftype float-type (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for symbol exp-slead, type (pointer float) +(define exp-slead (new 'static 'array float 32 + 1.0 + 1.0218964 + 1.0442734 + 1.0671387 + 1.0905075 + 1.1143799 + 1.1387863 + 1.1637192 + 1.1892014 + 1.2152405 + 1.2418518 + 1.2690506 + 1.2968369 + 1.3252335 + 1.354248 + 1.3839035 + 1.4142075 + 1.4451752 + 1.4768219 + 1.5091629 + 1.5422058 + 1.5759735 + 1.6104889 + 1.645752 + 1.6817856 + 1.7186127 + 1.7562485 + 1.7947083 + 1.8340073 + 1.8741608 + 1.9151993 + 1.9571381 + ) + ) + +;; definition for symbol exp-strail, type (pointer float) +(define exp-strail (new 'static 'array float 32 + 0.0 + 0.0000007863494 + 0.00000040596257 + 0.0000017288019 + 0.00000022534104 + 0.0000068597833 + 0.0000023188388 + 0.0000056815315 + 0.0000057600223 + 0.0000068814647 + 0.000006005433 + 0.0000003590472 + 0.0000027016238 + 0.000003183687 + 0.000007500062 + 0.000006378546 + 0.000006103877 + 0.0000056360786 + 0.0000042465254 + 0.0000015247614 + 0.000005014861 + 0.000007334366 + 0.0000014403477 + 0.000003525029 + 0.000007247011 + 0.000006627224 + 0.0000036862523 + 0.00000082304996 + 0.0000008232258 + 0.0000068675085 + 0.000007281612 + 0.000006062652 + ) + ) + +;; definition for function exp +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function pow +(defun pow ((arg0 float) (arg1 float)) + (exp (* arg1 (logf arg0))) + ) + +;; definition for function print-exp +;; INFO: Return type mismatch int vs none. +(defun print-exp ((arg0 float)) + (let* ((f30-1 (floor (/ (logf (fabs arg0)) (logf 10.0)))) + (f0-4 (pow 10.0 f30-1)) + ) + (format #t "~fe~d" (/ arg0 f0-4) (the int f30-1)) + ) + 0 + (none) + ) + +;; definition of type rgba +(deftype rgba (uint32) + ((r uint8 :offset 0 :size 8) + (g uint8 :offset 8 :size 8) + (b uint8 :offset 16 :size 8) + (a uint8 :offset 24 :size 8) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type xyzw +(deftype xyzw (uint128) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition of type xyzwh +(deftype xyzwh (uint128) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for function print-time +;; INFO: Return type mismatch int vs none. +(defun print-time ((arg0 object) (arg1 time-frame)) + 0 + 0 + 0 + (let* ((f0-1 (* 0.0033333334 (the float arg1))) + (a2-0 (the int (* 0.016666668 f0-1))) + (f0-2 (- f0-1 (* 60.0 (the float a2-0)))) + (a3-0 (the int f0-2)) + (f0-3 (- f0-2 (the float a3-0))) + (t0-0 (the int (* 1000.0 f0-3))) + ) + (format arg0 "~d:~2,'0,d:~3,'0,d" a2-0 a3-0 t0-0) + ) + 0 + (none) + ) + +;; definition for function log2 +;; INFO: Return type mismatch uint vs int. +(defun log2 ((arg0 int)) + (the-as int (+ (sar (the-as int (the float arg0)) 23) -127)) + ) + +;; definition for function seek +(defun seek ((arg0 float) (arg1 float) (arg2 float)) + (let ((f2-0 (- arg1 arg0))) + (cond + ((>= arg2 (fabs f2-0)) + arg1 + ) + ((>= f2-0 0.0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) + ) + ) + ) + ) + +;; definition for function seek-ease +(defun seek-ease ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let ((f2-0 (- arg1 arg0))) + (when (>= arg3 (fabs f2-0)) + (set! arg2 (* arg2 (- 1.0 (/ (- arg3 (fabs f2-0)) arg3)))) + (if (< arg2 arg4) + (set! arg2 arg4) + ) + ) + (cond + ((>= arg2 (fabs f2-0)) + arg1 + ) + ((>= f2-0 0.0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) + ) + ) + ) + ) + +;; definition for function seek-ease-in-out +(defun seek-ease-in-out ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float) (arg5 float) (arg6 float)) + (let ((f2-0 (- arg2 arg0))) + (let ((f4-1 (- arg0 arg1))) + (when (>= arg4 (fabs f4-1)) + (set! arg3 (* arg3 (- 1.0 (/ (- arg4 (fabs f4-1)) arg4)))) + (if (< arg3 arg6) + (set! arg3 arg6) + ) + ) + ) + (when (>= arg5 (fabs f2-0)) + (set! arg3 (* arg3 (- 1.0 (/ (- arg5 (fabs f2-0)) arg5)))) + (if (< arg3 arg6) + (set! arg3 arg6) + ) + ) + (cond + ((>= arg3 (fabs f2-0)) + arg2 + ) + ((>= f2-0 0.0) + (+ arg0 arg3) + ) + (else + (- arg0 arg3) + ) + ) + ) + ) + +;; definition for function lerp +(defun lerp ((arg0 float) (arg1 float) (arg2 float)) + (+ arg0 (* arg2 (- arg1 arg0))) + ) + +;; definition (debug) for function lerp-scale-old +(defun-debug lerp-scale-old ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let ((f0-1 (fmax 0.0 (fmin 1.0 (/ (- arg2 arg3) (- arg4 arg3)))))) + (+ (* (- 1.0 f0-1) arg0) (* f0-1 arg1)) + ) + ) + +;; definition for function lerp-scale +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f2] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f1, f3] +(defun lerp-scale ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (f0-2 float)) + (let* ((v1-0 1.0) + (f1-0 0.0) + (f0-0 v1-0) + (f4-0 arg2) + (f2-0 arg3) + (f3-0 arg4) + (f1-2 (fmin (fmax (/ (- f4-0 f2-0) (- f3-0 f2-0)) f1-0) f0-0)) + (f0-1 (- f0-0 f1-2)) + (f2-3 arg0) + (f3-1 arg1) + ) + (.mula.s f0-1 f2-3) + (.madd.s f0-2 f1-2 f3-1) + ) + f0-2 + ) + +;; definition for function lerp-clamp +(defun lerp-clamp ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (+ (* (- 1.0 arg2) arg0) (* arg2 arg1)) + ) + ) + ) + +;; definition for function seekl +(defun seekl ((arg0 int) (arg1 int) (arg2 int)) + (let* ((v1-0 (- arg1 arg0)) (a3-0 (abs v1-0))) (cond + ((>= arg2 a3-0) + arg1 + ) + ((>= v1-0 0) + (+ arg0 arg2) + ) + (else + (- arg0 arg2) + ) + ) + ) + ) + +;; definition for function rand-vu-init +;; INFO: Return type mismatch int vs float. +;; ERROR: Unsupported inline assembly instruction kind - [ctc2.i vi_R, a0] +;; ERROR: Unsupported inline assembly instruction kind - [cfc2.i v0, vi_R] +(defun rand-vu-init ((arg0 float)) + (local-vars (v0-0 int)) + (.ctc2.i vi_R arg0) + (.cfc2.i v0-0 vi_R) + (the-as float v0-0) + ) + +;; failed to figure out what this is: +(rand-vu-init 1.418091) + +;; definition for function rand-vu +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VRGET] +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VRXOR] +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VRNEXT] +(defun rand-vu () + (local-vars (v0-0 float)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (TODO.VRGET vf1) + (.sqrt.vf Q vf1 :ftf #b0) + (.add.vf vf2 vf0 Q :mask #b1) + (TODO.VRXOR vf2) + (TODO.VRNEXT vf1) + (.sub.w.vf vf1 vf1 vf0) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function rand-vu-nostep +;; ERROR: Inline assembly instruction marked with TODO - [TODO.VRGET] +(defun rand-vu-nostep () + (local-vars (v0-0 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (TODO.VRGET vf1) + (.sub.w.vf vf1 vf1 vf0) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function rand-vu-float-range +(defun rand-vu-float-range ((arg0 float) (arg1 float)) + (+ arg0 (* (rand-vu) (- arg1 arg0))) + ) + +;; definition for function rand-vu-percent? +(defun rand-vu-percent? ((arg0 float)) + (>= arg0 (rand-vu)) + ) + +;; definition for function rand-vu-int-range +(defun rand-vu-int-range ((arg0 int) (arg1 int)) + (if (< arg0 arg1) + (set! arg1 (+ arg1 1)) + (set! arg0 (+ arg0 1)) + ) + (let ((f0-4 (rand-vu-float-range (the float arg0) (the float arg1)))) + (if (< f0-4 0.0) + (set! f0-4 (+ -1.0 f0-4)) + ) + (the int f0-4) + ) + ) + +;; definition for function rand-vu-int-count +(defun rand-vu-int-count ((arg0 int)) + (the int (* (rand-vu) (the float arg0))) + ) + +;; definition for function rand-vu-int-count-excluding +;; WARN: new jak 2 until loop case, check carefully +(defun rand-vu-int-count-excluding ((arg0 int) (arg1 int)) + (let ((s4-0 0) + (s5-0 0) + ) + (let ((v1-0 1)) + (while (nonzero? arg0) + (+! arg0 -1) + (if (zero? (logand arg1 v1-0)) + (+! s4-0 1) + ) + (set! v1-0 (* v1-0 2)) + ) + ) + (when (> s4-0 0) + (let ((v1-4 (the int (* (rand-vu) (the float s4-0)))) + (a0-1 1) + ) + (until #f + (while (logtest? arg1 a0-1) + (nop!) + (nop!) + (+! s5-0 1) + (set! a0-1 (* a0-1 2)) + ) + (if (zero? v1-4) + (goto cfg-14) + ) + (+! v1-4 -1) + (+! s5-0 1) + (set! a0-1 (* a0-1 2)) + ) + ) + #f + ) + (label cfg-14) + s5-0 + ) + ) + +;; definition for function rand-vu-int-range-exclude +;; WARN: new jak 2 until loop case, check carefully +(defun rand-vu-int-range-exclude ((arg0 int) (arg1 int) (arg2 int)) + (until #f + (let ((v1-0 (rand-vu-int-range arg0 arg1))) + (if (!= v1-0 arg2) + (return v1-0) + ) + ) + ) + (the-as int #f) + ) + +;; definition of type random-generator +(deftype random-generator (basic) + ((seed uint32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type random-generator +(defmethod inspect random-generator ((obj random-generator)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tseed: ~D~%" (-> obj seed)) + (label cfg-4) + obj + ) + +;; definition for symbol *random-generator*, type random-generator +(define *random-generator* (new 'global 'random-generator)) + +;; failed to figure out what this is: +(set! (-> *random-generator* seed) (the-as uint #x666edd1e)) + +;; definition for function rand-uint31-gen +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function cube-root +(defun cube-root ((arg0 float)) + (cond + ((!= arg0 0.0) + (let* ((v1-0 arg0) + (a1-2 (+ (logand (shr (the-as int v1-0) 23) 255) -127)) + (f0-1 + (the-as + number + (gpr->fpr + (logior (logand (the-as uint #x807fffff) (the-as uint v1-0)) (shl (+ (/ (the-as int a1-2) 3) 127) 23)) + ) + ) + ) + ) + (dotimes (v1-3 6) + (set! f0-1 (- (the-as float f0-1) + (/ (- (* (the-as float (* (the-as float f0-1) (the-as float f0-1))) (the-as float f0-1)) arg0) + (* 3.0 (the-as float f0-1) (the-as float f0-1)) + ) + ) + ) + ) + (the-as float f0-1) + ) + ) + (else + 0.0 + ) + ) + ) + +;; definition for function int-noise +(defun int-noise ((arg0 int)) + (let ((v1-1 (logxor (shl arg0 13) arg0))) + (- 1.0 (* 0.0000000009313226 + (the float (logand #x7fffffff (+ #x5208dd0d (* v1-1 (+ #xc0ae5 (* (* #x3d73 v1-1) v1-1)))))) + ) + ) + ) + ) + +;; definition for function smooth-step +(defun smooth-step ((arg0 float)) + (cond + ((>= 0.0 arg0) + 0.0 + ) + ((>= arg0 1.0) + 1.0 + ) + (else + (* arg0 arg0 (+ 3.0 (* -2.0 arg0))) + ) + ) + ) + +;; definition for function smooth-interp +(defun smooth-interp ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (+ arg0 (* (- arg1 arg0) (smooth-step (/ (- arg2 arg3) (- arg4 arg3))))) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc new file mode 100644 index 0000000000..ddffd63bad --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/matrix-h_REF.gc @@ -0,0 +1,103 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type matrix +(deftype matrix (structure) + ((data float 16 :offset-assert 0) + (vector vector 4 :inline :offset 0) + (quad uint128 4 :offset 0) + (trans vector :inline :offset 48) + ) + :method-count-assert 10 + :size-assert #x40 + :flag-assert #xa00000040 + (:methods + (transform-vectors! (_type_ (inline-array vector) (inline-array vector) int) none 9) + ) + ) + +;; definition for method 3 of type matrix +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix ((obj matrix)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'matrix) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[4] @ #x~X~%" (-> obj data)) + (format #t "~1Ttrans: #~%" (-> obj trans)) + (label cfg-4) + obj + ) + +;; definition of type matrix3 +(deftype matrix3 (structure) + ((data float 12 :offset-assert 0) + (vector vector 3 :inline :offset 0) + (quad uint128 3 :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type matrix3 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix3 ((obj matrix3)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'matrix3) + (format #t "~1Tdata[12] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[3] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type matrix4h +(deftype matrix4h (structure) + ((data int16 16 :offset-assert 0) + (vector4h vector4h 4 :inline :offset 0) + (long int64 4 :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type matrix4h +(defmethod inspect matrix4h ((obj matrix4h)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'matrix4h) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector4h[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tlong[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for function matrix-copy! +;; INFO: Used lq/sq +(defun matrix-copy! ((arg0 matrix) (arg1 matrix)) + (let ((v1-0 (-> arg1 vector 0 quad)) + (a2-0 (-> arg1 vector 1 quad)) + (a3-0 (-> arg1 vector 2 quad)) + (a1-1 (-> arg1 trans quad)) + ) + (set! (-> arg0 vector 0 quad) v1-0) + (set! (-> arg0 vector 1 quad) a2-0) + (set! (-> arg0 vector 2 quad) a3-0) + (set! (-> arg0 trans quad) a1-1) + ) + arg0 + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/math/matrix_REF.gc b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc new file mode 100644 index 0000000000..1bafcce7be --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/matrix_REF.gc @@ -0,0 +1,1800 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 3 of type matrix +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix ((obj matrix)) + (format #t "[~8x] matrix~%" obj) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2) (-> obj data 3)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6) (-> obj data 7)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10) (-> obj data 11)) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) + obj + ) + +;; definition for method 3 of type matrix3 +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect matrix3 ((obj matrix3)) + (format #t "[~8x] matrix3~%" obj) + (format #t "~T[~F] [~F] [~F]~%" (-> obj data 0) (-> obj data 1) (-> obj data 2)) + (format #t "~T[~F] [~F] [~F]~%" (-> obj data 4) (-> obj data 5) (-> obj data 6)) + (format #t "~T[~F] [~F] [~F]~%" (-> obj data 8) (-> obj data 9) (-> obj data 10)) + obj + ) + +;; definition for function matrix-identity! +;; INFO: Used lq/sq +(defun matrix-identity! ((arg0 matrix)) + (set! (-> arg0 vector 0 quad) (the-as uint128 0)) + (set! (-> arg0 vector 1 quad) (the-as uint128 0)) + (set! (-> arg0 vector 2 quad) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (let ((f0-0 1.0)) + (set! (-> arg0 trans w) f0-0) + (set! (-> arg0 data 10) f0-0) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 0) f0-0) + ) + arg0 + ) + +;; definition for symbol *identity-matrix*, type matrix +(define *identity-matrix* (matrix-identity! (new 'global 'matrix))) + +;; definition for symbol *hermite-matrix*, type matrix +(define *hermite-matrix* + (new 'static 'matrix + :data (new 'static 'array float 16 2.0 -2.0 1.0 1.0 -3.0 3.0 -2.0 -1.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0) + ) + ) + +;; definition for function matrix+! +(defun matrix+! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + (dotimes (v1-0 16) + (set! (-> arg0 data v1-0) (+ (-> arg1 data v1-0) (-> arg2 data v1-0))) + ) + arg0 + ) + +;; definition for function matrix-! +(defun matrix-! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + (dotimes (v1-0 16) + (set! (-> arg0 data v1-0) (- (-> arg1 data v1-0) (-> arg2 data v1-0))) + ) + arg0 + ) + +;; definition for function matrix*! +(defun matrix*! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + (rlet ((acc :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf20 :class vf) + (vf21 :class vf) + ) + (.lvf vf10 (&-> arg1 vector 0 quad)) + (.lvf vf14 (&-> arg2 vector 0 quad)) + (.lvf vf15 (&-> arg2 vector 1 quad)) + (.lvf vf16 (&-> arg2 vector 2 quad)) + (.lvf vf17 (&-> arg2 trans quad)) + (.lvf vf11 (&-> arg1 vector 1 quad)) + (.lvf vf12 (&-> arg1 vector 2 quad)) + (.lvf vf13 (&-> arg1 trans quad)) + (.mul.x.vf acc vf14 vf10) + (.add.mul.y.vf acc vf15 vf10 acc) + (.add.mul.z.vf acc vf16 vf10 acc) + (.add.mul.w.vf vf18 vf17 vf10 acc) + (.mul.x.vf acc vf14 vf11) + (.add.mul.y.vf acc vf15 vf11 acc) + (.add.mul.z.vf acc vf16 vf11 acc) + (.add.mul.w.vf vf19 vf17 vf11 acc) + (.mul.x.vf acc vf14 vf12) + (.add.mul.y.vf acc vf15 vf12 acc) + (.add.mul.z.vf acc vf16 vf12 acc) + (.add.mul.w.vf vf20 vf17 vf12 acc) + (.mul.x.vf acc vf14 vf13) + (.add.mul.y.vf acc vf15 vf13 acc) + (.add.mul.z.vf acc vf16 vf13 acc) + (.add.mul.w.vf vf21 vf17 vf13 acc) + (.svf (&-> arg0 vector 0 quad) vf18) + (.svf (&-> arg0 vector 1 quad) vf19) + (.svf (&-> arg0 vector 2 quad) vf20) + (.svf (&-> arg0 trans quad) vf21) + arg0 + ) + ) + +;; definition for function matrixp*! +;; INFO: Used lq/sq +(defun matrixp*! ((arg0 matrix) (arg1 matrix) (arg2 matrix)) + (let ((s5-0 (new-stack-matrix0))) + (matrix*! s5-0 arg1 arg2) + (set! (-> arg0 vector 0 quad) (-> s5-0 vector 0 quad)) + (set! (-> arg0 vector 1 quad) (-> s5-0 vector 1 quad)) + (set! (-> arg0 vector 2 quad) (-> s5-0 vector 2 quad)) + (set! (-> arg0 trans quad) (-> s5-0 trans quad)) + ) + arg0 + ) + +;; definition for function vector-matrix*! +(defun vector-matrix*! ((arg0 vector) (arg1 vector) (arg2 matrix)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (.lvf vf1 (&-> arg2 vector 0 quad)) + (.lvf vf2 (&-> arg2 vector 1 quad)) + (.lvf vf3 (&-> arg2 vector 2 quad)) + (.lvf vf4 (&-> arg2 trans quad)) + (.lvf vf5 (&-> arg1 quad)) + (.mul.x.vf acc vf1 vf5) + (.add.mul.y.vf acc vf2 vf5 acc) + (.add.mul.z.vf acc vf3 vf5 acc) + (.add.mul.w.vf vf5 vf4 vf5 acc) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +;; definition for function vector-rotate*! +(defun vector-rotate*! ((arg0 vector) (arg1 vector) (arg2 matrix)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (nop!) + (nop!) + (.lvf vf5 (&-> arg1 quad)) + (nop!) + (.lvf vf1 (&-> arg2 vector 0 quad)) + (nop!) + (.lvf vf2 (&-> arg2 vector 1 quad)) + (.mul.x.vf acc vf1 vf5) + (.lvf vf3 (&-> arg2 vector 2 quad)) + (.add.mul.y.vf acc vf2 vf5 acc) + (.lvf vf4 (&-> arg2 trans quad)) + (.add.mul.z.vf vf5 vf3 vf5 acc) + (nop!) + (nop!) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +;; definition for function vector3s-matrix*! +;; INFO: Used lq/sq +(defun vector3s-matrix*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix)) + (let ((s5-0 (new-stack-vector0))) + (set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0) + (vector-matrix*! s5-0 s5-0 arg2) + (set! (-> arg0 x) (-> s5-0 x)) + (set! (-> arg0 y) (-> s5-0 y)) + (set! (-> arg0 z) (-> s5-0 z)) + ) + arg0 + ) + +;; definition for function vector3s-rotate*! +;; INFO: Used lq/sq +(defun vector3s-rotate*! ((arg0 vector3s) (arg1 vector3s) (arg2 matrix)) + (let ((s5-0 (new-stack-vector0))) + (set-vector! s5-0 (-> arg1 x) (-> arg1 y) (-> arg1 z) 1.0) + (vector-rotate*! s5-0 s5-0 arg2) + (set! (-> arg0 x) (-> s5-0 x)) + (set! (-> arg0 y) (-> s5-0 y)) + (set! (-> arg0 z) (-> s5-0 z)) + ) + arg0 + ) + +;; definition for function matrix-transpose! +;; INFO: Used lq/sq +;; ERROR: Function may read a register that is not set: f31 +(defun matrix-transpose! ((arg0 matrix) (arg1 matrix)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (r0-3 int) + (v1-0 uint128) + (v1-1 uint128) + (v1-2 uint128) + (a1-1 uint128) + (a2-1 uint128) + (t0-1 uint128) + (f31-0 none) + ) + (nop!) + (nop!) + (let ((t0-0 (-> arg1 vector 0 quad))) + (nop!) + (let ((t1-0 (-> arg1 vector 1 quad))) + (nop!) + (let ((a2-0 (-> arg1 vector 2 quad))) + (.pextlw v1-0 t1-0 t0-0) + (let ((a3-0 (-> arg1 trans quad))) + (.pextuw a1-1 t1-0 t0-0) + (.mov r0-0 f31-0) + (.pextlw t0-1 a3-0 a2-0) + (.mov r0-1 f31-0) + (.pextuw a2-1 a3-0 a2-0) + ) + ) + ) + ) + (.mov r0-2 f31-0) + (let ((a3-1 (make-u128 t0-1 v1-0))) + (.mov r0-3 f31-0) + (.pcpyud v1-1 v1-0 t0-1) + (set! (-> arg0 vector 0 quad) (the-as uint128 a3-1)) + ) + (let ((a3-2 (make-u128 a2-1 a1-1))) + (set! (-> arg0 vector 1 quad) v1-1) + (.pcpyud v1-2 a1-1 a2-1) + (set! (-> arg0 vector 2 quad) (the-as uint128 a3-2)) + ) + (nop!) + (set! (-> arg0 trans quad) v1-2) + arg0 + ) + +;; definition for function matrix-inverse-of-rot-trans! +(defun matrix-inverse-of-rot-trans! ((arg0 matrix) (arg1 matrix)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf8 :class vf) + ) + (init-vf0-vector) + (matrix-transpose! arg0 arg1) + (.lvf vf1 (&-> arg0 vector 0 quad)) + (.lvf vf2 (&-> arg0 vector 1 quad)) + (.lvf vf3 (&-> arg0 vector 2 quad)) + (.sub.vf vf1 vf1 vf1 :mask #b1000) + (.sub.vf vf2 vf2 vf2 :mask #b1000) + (.sub.vf vf3 vf3 vf3 :mask #b1000) + (.lvf vf8 (&-> arg1 trans quad)) + (.mul.x.vf acc vf1 vf8) + (.add.mul.y.vf acc vf2 vf8 acc) + (.add.mul.z.vf vf4 vf3 vf8 acc) + (.sub.vf vf4 vf0 vf4) + (.mov.vf vf4 vf0 :mask #b1000) + (.svf (&-> arg0 vector 0 quad) vf1) + (.svf (&-> arg0 vector 1 quad) vf2) + (.svf (&-> arg0 vector 2 quad) vf3) + (.svf (&-> arg0 trans quad) vf4) + arg0 + ) + ) + +;; definition for function matrix-4x4-inverse! +;; ERROR: Bad vector register dependency: vf3 +;; ERROR: Bad vector register dependency: vf4 +;; ERROR: Bad vector register dependency: vf5 +(defun matrix-4x4-inverse! ((arg0 matrix) (arg1 matrix)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + (vf17 :class vf) + (vf18 :class vf) + (vf19 :class vf) + (vf2 :class vf) + (vf20 :class vf) + (vf23 :class vf) + (vf24 :class vf) + (vf25 :class vf) + (vf26 :class vf) + (vf27 :class vf) + (vf28 :class vf) + (vf29 :class vf) + (vf3 :class vf) + (vf30 :class vf) + (vf31 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (nop!) + (.lvf vf23 (&-> arg1 vector 0 quad)) + (nop!) + (.lvf vf24 (&-> arg1 vector 1 quad)) + (nop!) + (.lvf vf25 (&-> arg1 vector 2 quad)) + (nop!) + (.lvf vf1 (&-> arg1 trans quad)) + (.mul.x.vf vf7 vf24 vf23) + (nop!) + (.mul.y.vf vf8 vf24 vf23) + (nop!) + (.mul.z.vf vf9 vf24 vf23) + (nop!) + (.mul.x.vf vf10 vf25 vf23) + (nop!) + (.mul.y.vf vf11 vf25 vf23) + (nop!) + (.mul.z.vf vf12 vf25 vf23) + (nop!) + (.mul.x.vf vf13 vf25 vf24) + (nop!) + (.mul.y.vf vf14 vf25 vf24) + (nop!) + (.mul.z.vf vf15 vf25 vf24) + (nop!) + (.mul.z.vf vf26 vf7 vf25 :mask #b10) + (nop!) + (.mul.z.vf vf27 vf11 vf24 :mask #b1) + (nop!) + (.mul.y.vf vf28 vf9 vf25 :mask #b1) + (nop!) + (.mul.z.vf vf29 vf14 vf23 :mask #b1) + (nop!) + (.mul.z.vf vf30 vf8 vf25 :mask #b1) + (nop!) + (.mul.y.vf vf31 vf7 vf25 :mask #b100) + (nop!) + (.add.y.vf vf16 vf27 vf26 :mask #b1) + (nop!) + (.sub.vf vf1 vf0 vf1) + (nop!) + (.add.x.vf vf17 vf29 vf30 :mask #b1) + (nop!) + (.sub.z.vf vf18 vf28 vf31 :mask #b1) + (nop!) + (.sub.y.vf vf23 vf14 vf15 :mask #b100) + (nop!) + (.sub.z.vf vf26 vf15 vf13 :mask #b1) + (nop!) + (.sub.x.vf vf29 vf13 vf14 :mask #b10) + (nop!) + (.sub.vf vf19 vf16 vf17 :mask #b1) + (nop!) + (.sub.z.vf vf24 vf12 vf11 :mask #b10) + (nop!) + (.sub.x.vf vf27 vf10 vf12 :mask #b100) + (nop!) + (.sub.y.vf vf30 vf11 vf10 :mask #b1) + (nop!) + (.add.vf vf20 vf19 vf18 :mask #b1) + (nop!) + (.sub.y.vf vf25 vf8 vf9 :mask #b100) + (nop!) + (.sub.z.vf vf28 vf9 vf7 :mask #b1) + (nop!) + (.sub.x.vf vf31 vf7 vf8 :mask #b10) + (nop!) + (.div.vf Q vf0 vf20 :fsf #b11 :ftf #b0) + (nop!) + (.sub.w.vf vf3 vf3 vf3 :mask #b1000) + (nop!) + (.sub.w.vf vf4 vf4 vf4 :mask #b1000) + (nop!) + (.sub.w.vf vf5 vf5 vf5 :mask #b1000) + (nop!) + (.mov.vf vf6 vf0 :mask #b1000) + (nop!) + (.wait.vf) + (nop!) + (.add.vf vf2 vf0 Q :mask #b1) + (nop!) + (.add.x.vf vf2 vf0 vf2 :mask #b111) + (nop!) + (.mul.z.vf vf3 vf2 vf23 :mask #b1) + (nop!) + (.mul.x.vf vf4 vf2 vf26 :mask #b1) + (nop!) + (.mul.y.vf vf5 vf2 vf29 :mask #b1) + (nop!) + (.mul.y.vf vf3 vf2 vf24 :mask #b10) + (nop!) + (.mul.z.vf vf4 vf2 vf27 :mask #b10) + (nop!) + (.mul.x.vf vf5 vf2 vf30 :mask #b10) + (nop!) + (.mul.z.vf vf3 vf2 vf25 :mask #b100) + (nop!) + (.mul.x.vf vf4 vf2 vf28 :mask #b100) + (nop!) + (.mul.y.vf vf5 vf2 vf31 :mask #b100) + (nop!) + (.mul.x.vf acc vf3 vf1) + (.svf (&-> arg0 vector 0 quad) vf3) + (.add.mul.y.vf acc vf4 vf1 acc) + (.svf (&-> arg0 vector 1 quad) vf4) + (.add.mul.z.vf vf6 vf5 vf1 acc :mask #b111) + (.svf (&-> arg0 vector 2 quad) vf5) + (nop!) + (.svf (&-> arg0 trans quad) vf6) + arg0 + ) + ) + +;; definition for function matrix-translate! +(defun matrix-translate! ((arg0 matrix) (arg1 vector)) + (matrix-identity! arg0) + (set! (-> arg0 trans x) (-> arg1 x)) + (set! (-> arg0 trans y) (-> arg1 y)) + (set! (-> arg0 trans z) (-> arg1 z)) + arg0 + ) + +;; definition for function matrix-translate+! +;; INFO: Used lq/sq +(defun matrix-translate+! ((arg0 matrix) (arg1 matrix) (arg2 vector)) + (set! (-> arg0 trans x) (+ (-> arg1 trans x) (-> arg2 x))) + (set! (-> arg0 trans y) (+ (-> arg1 trans y) (-> arg2 y))) + (set! (-> arg0 trans z) (+ (-> arg1 trans z) (-> arg2 z))) + (when (!= arg0 arg1) + (set! (-> arg0 vector 0 quad) (-> arg1 vector 0 quad)) + (set! (-> arg0 vector 1 quad) (-> arg1 vector 1 quad)) + (set! (-> arg0 vector 2 quad) (-> arg1 vector 2 quad)) + ) + arg0 + ) + +;; definition for function matrix-scale! +;; INFO: Used lq/sq +(defun matrix-scale! ((arg0 matrix) (arg1 vector)) + (set! (-> arg0 vector 0 quad) (the-as uint128 0)) + (set! (-> arg0 vector 1 quad) (the-as uint128 0)) + (set! (-> arg0 vector 2 quad) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) (-> arg1 x)) + (set! (-> arg0 data 5) (-> arg1 y)) + (set! (-> arg0 data 10) (-> arg1 z)) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function scale-matrix! +(defun scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg2 vector 0 quad)) + (.lvf vf6 (&-> arg2 vector 1 quad)) + (.lvf vf7 (&-> arg2 vector 2 quad)) + (.lvf vf8 (&-> arg2 trans quad)) + (.mul.x.vf vf5 vf5 vf4) + (.mul.y.vf vf6 vf6 vf4) + (.mul.z.vf vf7 vf7 vf4) + (.mul.w.vf vf8 vf8 vf4) + (.svf (&-> arg0 vector 0 quad) vf5) + (.svf (&-> arg0 vector 1 quad) vf6) + (.svf (&-> arg0 vector 2 quad) vf7) + (.svf (&-> arg0 trans quad) vf8) + arg0 + ) + ) + +;; definition for function matrix-inv-scale! +;; INFO: Used lq/sq +(defun matrix-inv-scale! ((arg0 matrix) (arg1 vector)) + (set! (-> arg0 vector 0 quad) (the-as uint128 0)) + (set! (-> arg0 vector 1 quad) (the-as uint128 0)) + (set! (-> arg0 vector 2 quad) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) (/ 1.0 (-> arg1 x))) + (set! (-> arg0 data 5) (/ 1.0 (-> arg1 y))) + (set! (-> arg0 data 10) (/ 1.0 (-> arg1 z))) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function column-scale-matrix! +(defun column-scale-matrix! ((arg0 matrix) (arg1 vector) (arg2 matrix)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + ) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg2 vector 0 quad)) + (.lvf vf6 (&-> arg2 vector 1 quad)) + (.lvf vf7 (&-> arg2 vector 2 quad)) + (.lvf vf8 (&-> arg2 trans quad)) + (.mul.vf vf5 vf5 vf4) + (.mul.vf vf6 vf6 vf4) + (.mul.vf vf7 vf7 vf4) + (.mul.vf vf8 vf8 vf4) + (.svf (&-> arg0 vector 0 quad) vf5) + (.svf (&-> arg0 vector 1 quad) vf6) + (.svf (&-> arg0 vector 2 quad) vf7) + (.svf (&-> arg0 trans quad) vf8) + arg0 + ) + ) + +;; definition for function matrix-rotate-x! +;; INFO: Used lq/sq +(defun matrix-rotate-x! ((arg0 matrix) (arg1 float)) + (let ((f30-0 (sin arg1)) + (f0-0 (cos arg1)) + ) + (set! (-> arg0 vector 0 quad) (the-as uint128 0)) + (set! (-> arg0 vector 1 quad) (the-as uint128 0)) + (set! (-> arg0 vector 2 quad) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) 1.0) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 6) f30-0) + (set! (-> arg0 data 9) (- f30-0)) + (set! (-> arg0 data 10) f0-0) + ) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function matrix-rotate-y! +;; INFO: Used lq/sq +(defun matrix-rotate-y! ((arg0 matrix) (arg1 float)) + (let ((f30-0 (sin arg1)) + (f0-0 (cos arg1)) + ) + (set! (-> arg0 vector 0 quad) (the-as uint128 0)) + (set! (-> arg0 vector 1 quad) (the-as uint128 0)) + (set! (-> arg0 vector 2 quad) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) f0-0) + (set! (-> arg0 data 2) (- f30-0)) + (set! (-> arg0 data 5) 1.0) + (set! (-> arg0 data 8) f30-0) + (set! (-> arg0 data 10) f0-0) + ) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function matrix-rotate-z! +;; INFO: Used lq/sq +(defun matrix-rotate-z! ((arg0 matrix) (arg1 float)) + (let ((f30-0 (sin arg1)) + (f0-0 (cos arg1)) + ) + (set! (-> arg0 vector 0 quad) (the-as uint128 0)) + (set! (-> arg0 vector 1 quad) (the-as uint128 0)) + (set! (-> arg0 vector 2 quad) (the-as uint128 0)) + (set! (-> arg0 trans quad) (the-as uint128 0)) + (set! (-> arg0 data 0) f0-0) + (set! (-> arg0 data 1) f30-0) + (set! (-> arg0 data 4) (- f30-0)) + (set! (-> arg0 data 5) f0-0) + ) + (set! (-> arg0 data 10) 1.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function matrix-rotate-zyx! +;; INFO: Used lq/sq +(defun matrix-rotate-zyx! ((arg0 matrix) (arg1 vector)) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-x! arg0 (-> arg1 x)) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-z! gp-0 (-> arg1 z)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +;; definition (debug) for function matrix-rotate-xyz-2! +(defun-debug matrix-rotate-xyz-2! ((arg0 matrix) (arg1 vector)) + (let ((gp-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (matrix-rotate-z! arg0 (-> arg1 z)) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +;; definition for function matrix-rotate-xyz! +(defun matrix-rotate-xyz! ((arg0 matrix) (arg1 vector)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-sincos! s4-0 s5-0 arg1) + (let ((f2-0 (-> s4-0 x)) + (f5-0 (-> s4-0 y)) + (f3-0 (-> s4-0 z)) + (f0-0 (-> s5-0 x)) + (f1-0 (-> s5-0 y)) + ) + (let ((f4-0 (-> s5-0 z))) + (set! (-> arg0 data 0) (* f1-0 f4-0)) + (set! (-> arg0 data 1) (* f1-0 f3-0)) + (set! (-> arg0 data 2) (- f5-0)) + (set! (-> arg0 data 3) 0.0) + (let ((f6-4 (* f2-0 f5-0)) + (f5-1 (* f0-0 f5-0)) + ) + (set! (-> arg0 data 4) (- (* f6-4 f4-0) (* f0-0 f3-0))) + (set! (-> arg0 data 5) (+ (* f6-4 f3-0) (* f0-0 f4-0))) + (set! (-> arg0 data 6) (* f2-0 f1-0)) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 8) (+ (* f2-0 f3-0) (* f5-1 f4-0))) + (set! (-> arg0 data 9) (- (* f5-1 f3-0) (* f2-0 f4-0))) + ) + ) + (set! (-> arg0 data 10) (* f0-0 f1-0)) + ) + ) + (set! (-> arg0 data 11) 0.0) + (.svf (&-> arg0 trans quad) vf0) + arg0 + ) + ) + +;; definition for function matrix-rotate-zxy! +;; INFO: Used lq/sq +(defun matrix-rotate-zxy! ((arg0 matrix) (arg1 vector)) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-y! arg0 (-> arg1 y)) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-z! gp-0 (-> arg1 z)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +;; definition for function matrix-rotate-yxz! +;; INFO: Used lq/sq +(defun matrix-rotate-yxz! ((arg0 matrix) (arg1 vector)) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-z! arg0 (-> arg1 z)) + (matrix-rotate-x! gp-0 (-> arg1 x)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +;; definition for function matrix-rotate-yzx! +;; INFO: Used lq/sq +(defun matrix-rotate-yzx! ((arg0 matrix) (arg1 vector)) + (let ((gp-0 (new-stack-matrix0)) + (s5-0 (new-stack-matrix0)) + ) + (matrix-rotate-z! arg0 (-> arg1 x)) + (matrix-rotate-x! gp-0 (-> arg1 z)) + (matrix*! s5-0 gp-0 arg0) + (matrix-rotate-y! gp-0 (-> arg1 y)) + (matrix*! arg0 gp-0 s5-0) + ) + arg0 + ) + +;; definition for function matrix-rotate-yxy! +(defun matrix-rotate-yxy! ((arg0 matrix) (arg1 vector)) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! a2-0 (-> arg1 x) (- (-> arg1 y) (-> arg1 z)) (-> arg1 z) 1.0) + (vector-sincos! s5-0 s4-0 a2-0) + (let ((f1-1 (-> s4-0 y)) + (f0-5 (-> s5-0 y)) + (f2-0 (-> s4-0 x)) + (f5-0 (-> s5-0 x)) + (f3-0 (-> s4-0 z)) + (f4-0 (-> s5-0 z)) + ) + (set! (-> arg0 data 0) (- (* f1-1 f3-0) (* f0-5 f2-0 f4-0))) + (set! (-> arg0 data 1) (* f0-5 f5-0)) + (set! (-> arg0 data 2) (- (+ (* f1-1 f4-0) (* f0-5 f2-0 f3-0)))) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 4) (* f5-0 f4-0)) + (set! (-> arg0 data 5) f2-0) + (set! (-> arg0 data 6) (* f5-0 f3-0)) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 8) (+ (* f0-5 f3-0) (* f1-1 f2-0 f4-0))) + (set! (-> arg0 data 9) (- (* f1-1 f5-0))) + (set! (-> arg0 data 10) (- (* f1-1 f2-0 f3-0) (* f0-5 f4-0))) + ) + ) + (set! (-> arg0 data 11) 0.0) + (set! (-> arg0 trans x) 0.0) + (set! (-> arg0 trans y) 0.0) + (set! (-> arg0 trans z) 0.0) + (set! (-> arg0 trans w) 1.0) + arg0 + ) + +;; definition for function matrix-rotate-yx! +;; INFO: Used lq/sq +(defun matrix-rotate-yx! ((arg0 matrix) (arg1 float) (arg2 float)) + (matrix-rotate-y! arg0 arg1) + (let ((a1-2 (matrix-rotate-x! (new-stack-matrix0) arg2))) + (matrix*! arg0 a1-2 arg0) + ) + arg0 + ) + +;; definition for function matrix-axis-sin-cos-vu! +;; INFO: Used lq/sq +;; INFO: Return type mismatch matrix vs none. +;; ERROR: Function may read a register that is not set: f31 +;; ERROR: Unsupported inline assembly instruction kind - [prot3w a1, v1] +;; ERROR: Unsupported inline assembly instruction kind - [prot3w a2, a1] +(defun matrix-axis-sin-cos-vu! ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (r0-3 int) + (a1-2 uint128) + (a2-1 uint128) + (a3-1 uint128) + (a3-2 uint128) + (f31-0 none) + ) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (nop!) + (let* ((t0-0 #xffff) + (v1-0 (-> arg1 quad)) + (a1-1 (shl t0-0 48)) + ) + (.mov vf6 arg3) + (.pceqw a3-1 v1-0 0) + (.mov r0-0 f31-0) + (.ppach a3-2 (the-as uint128 0) a3-1) + (.mov r0-1 f31-0) + (nop!) + (.mov vf1 v1-0) + (let ((v1-1 (logior a3-2 a1-1))) + (.mov vf5 arg2) + (let ((v1-2 (+ v1-1 1))) + (.sub.x.vf vf5 vf0 vf6 :mask #b1000) + (b! (zero? v1-2) cfg-2 :delay (.add.x.vf vf5 vf0 vf6 :mask #b10)) + ) + ) + ) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (nop!) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (nop!) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (nop!) + (.mul.x.vf vf11 vf1 vf5 :mask #b111) + (nop!) + (.add.y.vf vf7 vf0 vf5 :mask #b1) + (nop!) + (.add.y.vf vf8 vf0 vf5 :mask #b10) + (nop!) + (.add.y.vf vf9 vf0 vf5 :mask #b100) + (nop!) + (.mul.w.vf vf10 vf1 vf5 :mask #b111) + (nop!) + (.sub.z.vf vf7 vf0 vf11 :mask #b10) + (nop!) + (.add.y.vf vf7 vf0 vf11 :mask #b100) + (nop!) + (.add.z.vf vf8 vf0 vf11 :mask #b1) + (nop!) + (.sub.x.vf vf8 vf0 vf11 :mask #b100) + (nop!) + (.mul.x.vf vf2 vf10 vf1 :mask #b111) + (nop!) + (.mul.y.vf vf3 vf10 vf1 :mask #b111) + (nop!) + (.mul.z.vf vf4 vf10 vf1 :mask #b111) + (nop!) + (.sub.y.vf vf9 vf0 vf11 :mask #b1) + (nop!) + (.add.x.vf vf9 vf0 vf11 :mask #b10) + (nop!) + (.add.vf vf2 vf2 vf7 :mask #b111) + (nop!) + (.add.vf vf3 vf3 vf8 :mask #b111) + (nop!) + (nop!) + (nop!) + (.add.vf vf4 vf4 vf9 :mask #b111) + (nop!) + (nop!) + (.svf (&-> arg0 vector 0 quad) vf2) + (nop!) + (.svf (&-> arg0 vector 1 quad) vf3) + (nop!) + (.svf (&-> arg0 trans quad) vf0) + (b! #t cfg-3 :delay (.svf (&-> arg0 vector 2 quad) vf4)) + (label cfg-2) + (let ((v1-3 #x3f800000)) + (.svf (&-> arg0 trans quad) vf0) + (let ((v1-4 (the-as uint128 (make-u128 0 v1-3)))) + (.mov r0-2 f31-0) + (.prot3w a1-2 (the-as uint v1-4)) + (.mov r0-3 f31-0) + (.prot3w a2-1 (the-as int a1-2)) + (set! (-> arg0 vector 0 quad) v1-4) + ) + ) + (nop!) + (set! (-> arg0 vector 2 quad) a1-2) + (nop!) + (set! (-> arg0 vector 1 quad) a2-1) + (label cfg-3) + (none) + ) + ) + +;; definition for function matrix-axis-sin-cos! +;; INFO: Used lq/sq +;; ERROR: Function may read a register that is not set: f31 +;; ERROR: Unsupported inline assembly instruction kind - [prot3w a0, v1] +;; ERROR: Unsupported inline assembly instruction kind - [prot3w a1, a0] +(defun matrix-axis-sin-cos! ((arg0 matrix) (arg1 vector) (arg2 float) (arg3 float)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (r0-3 int) + (a0-4 uint128) + (a1-2 uint128) + (a1-3 uint128) + (a1-4 uint128) + (f31-0 none) + ) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 arg0)) + (let ((v1-0 arg1) + (f0-0 arg2) + (f1-0 arg3) + ) + (nop!) + (let* ((a0-1 #xffff) + (v1-1 (-> v1-0 quad)) + (a0-2 (shl a0-1 48)) + ) + (let ((a1-1 f1-0)) + (.mov vf6 a1-1) + ) + (.pceqw a1-2 v1-1 0) + (.mov r0-0 f31-0) + (.ppach a1-3 (the-as uint128 0) a1-2) + (.mov r0-1 f31-0) + (nop!) + (.mov vf1 v1-1) + (let ((v1-2 (logior a1-3 a0-2))) + (let ((a0-3 f0-0)) + (.mov vf5 a0-3) + ) + (let ((v1-3 (+ v1-2 1))) + (.sub.x.vf vf5 vf0 vf6 :mask #b1000) + (b! (zero? v1-3) cfg-2 :delay (.add.x.vf vf5 vf0 vf6 :mask #b10)) + ) + ) + ) + ) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (nop!) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (nop!) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (nop!) + (.mul.x.vf vf11 vf1 vf5 :mask #b111) + (nop!) + (.add.y.vf vf7 vf0 vf5 :mask #b1) + (nop!) + (.add.y.vf vf8 vf0 vf5 :mask #b10) + (nop!) + (.add.y.vf vf9 vf0 vf5 :mask #b100) + (nop!) + (.mul.w.vf vf10 vf1 vf5 :mask #b111) + (nop!) + (.sub.z.vf vf7 vf0 vf11 :mask #b10) + (nop!) + (.add.y.vf vf7 vf0 vf11 :mask #b100) + (nop!) + (.add.z.vf vf8 vf0 vf11 :mask #b1) + (nop!) + (.sub.x.vf vf8 vf0 vf11 :mask #b100) + (nop!) + (.mul.x.vf vf2 vf10 vf1 :mask #b111) + (nop!) + (.mul.y.vf vf3 vf10 vf1 :mask #b111) + (nop!) + (.mul.z.vf vf4 vf10 vf1 :mask #b111) + (nop!) + (.sub.y.vf vf9 vf0 vf11 :mask #b1) + (nop!) + (.add.x.vf vf9 vf0 vf11 :mask #b10) + (nop!) + (.add.vf vf2 vf2 vf7 :mask #b111) + (nop!) + (.add.vf vf3 vf3 vf8 :mask #b111) + (nop!) + (nop!) + (nop!) + (.add.vf vf4 vf4 vf9 :mask #b111) + (nop!) + (nop!) + (.svf (&-> v0-0 vector 0 quad) vf2) + (nop!) + (.svf (&-> v0-0 vector 1 quad) vf3) + (nop!) + (.svf (&-> v0-0 trans quad) vf0) + (b! #t cfg-3 :delay (.svf (&-> v0-0 vector 2 quad) vf4)) + (label cfg-2) + (let ((v1-4 #x3f800000)) + (.svf (&-> v0-0 trans quad) vf0) + (let ((v1-5 (the-as uint128 (make-u128 0 v1-4)))) + (.mov r0-2 f31-0) + (.prot3w a0-4 (the-as uint v1-5)) + (.mov r0-3 f31-0) + (.prot3w a1-4 (the-as int a0-4)) + (set! (-> v0-0 vector 0 quad) v1-5) + ) + ) + (nop!) + (set! (-> v0-0 vector 2 quad) a0-4) + (nop!) + (set! (-> v0-0 vector 1 quad) a1-4) + (label cfg-3) + v0-0 + ) + ) + ) + +;; definition for function matrix-axis-angle! +;; INFO: Return type mismatch matrix vs none. +(defun matrix-axis-angle! ((arg0 matrix) (arg1 vector) (arg2 float)) + (matrix-axis-sin-cos! arg0 arg1 (sin arg2) (cos arg2)) + (none) + ) + +;; definition for function matrix-lerp! +(defun matrix-lerp! ((arg0 matrix) (arg1 matrix) (arg2 matrix) (arg3 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.mov vf9 arg3) + (.lvf vf1 (&-> arg1 vector 0 quad)) + (.lvf vf2 (&-> arg1 vector 1 quad)) + (.lvf vf3 (&-> arg1 vector 2 quad)) + (.lvf vf4 (&-> arg1 trans quad)) + (.lvf vf5 (&-> arg2 vector 0 quad)) + (.lvf vf6 (&-> arg2 vector 1 quad)) + (.lvf vf7 (&-> arg2 vector 2 quad)) + (.lvf vf8 (&-> arg2 trans quad)) + (.sub.vf vf5 vf5 vf1) + (.sub.vf vf6 vf6 vf2) + (.sub.vf vf7 vf7 vf3) + (.sub.vf vf8 vf8 vf4) + (.mul.x.vf vf5 vf5 vf9) + (.mul.x.vf vf6 vf6 vf9) + (.mul.x.vf vf7 vf7 vf9) + (.mul.x.vf vf8 vf8 vf9) + (.add.vf vf1 vf1 vf5) + (.add.vf vf2 vf2 vf6) + (.add.vf vf3 vf3 vf7) + (.add.vf vf4 vf4 vf8) + (.svf (&-> arg0 vector 0 quad) vf1) + (.svf (&-> arg0 vector 1 quad) vf2) + (.svf (&-> arg0 vector 2 quad) vf3) + (.svf (&-> arg0 trans quad) vf4) + arg0 + ) + ) + +;; definition for function matrix-3x3-determinant +(defun matrix-3x3-determinant ((arg0 matrix)) + (let ((f8-0 (-> arg0 data 0)) + (f1-0 (-> arg0 data 1)) + (f4-0 (-> arg0 data 2)) + (f2-0 (-> arg0 data 4)) + (f5-0 (-> arg0 data 5)) + (f9-0 (-> arg0 data 6)) + (f3-0 (-> arg0 data 8)) + (f6-0 (-> arg0 data 9)) + (f0-0 (-> arg0 data 10)) + ) + (- (+ (* f8-0 f5-0 f0-0) (* f1-0 f9-0 f3-0) (* f4-0 f2-0 f6-0)) + (+ (* f8-0 f9-0 f6-0) (* f4-0 f5-0 f3-0) (* f1-0 f2-0 f0-0)) + ) + ) + ) + +;; definition for function matrix3-determinant +(defun matrix3-determinant ((arg0 matrix)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + ) + (.lvf vf11 (&-> arg0 vector 1 quad)) + (.lvf vf12 (&-> arg0 vector 2 quad)) + (.lvf vf10 (&-> arg0 vector 0 quad)) + (.outer.product.a.vf acc vf11 vf12) + (.outer.product.b.vf vf13 vf12 vf11 acc) + (.mul.vf vf13 vf13 vf10 :mask #b111) + (.add.y.vf vf13 vf13 vf13 :mask #b1) + (.add.z.vf vf13 vf13 vf13 :mask #b1) + (.mov v0-0 vf13) + v0-0 + ) + ) + +;; definition for function matrix-3x3-inverse! +(defun matrix-3x3-inverse! ((arg0 matrix) (arg1 matrix)) + (let ((f0-0 (matrix-3x3-determinant arg1))) + (set! (-> arg0 data 0) + (/ (- (* (-> arg1 data 5) (-> arg1 data 10)) (* (-> arg1 data 6) (-> arg1 data 9))) f0-0) + ) + (set! (-> arg0 data 4) + (/ (- (* (-> arg1 data 6) (-> arg1 data 8)) (* (-> arg1 data 4) (-> arg1 data 10))) f0-0) + ) + (set! (-> arg0 data 8) + (/ (- (* (-> arg1 data 4) (-> arg1 data 9)) (* (-> arg1 data 5) (-> arg1 data 8))) f0-0) + ) + (set! (-> arg0 data 1) + (/ (- (* (-> arg1 data 9) (-> arg1 data 2)) (* (-> arg1 data 10) (-> arg1 data 1))) f0-0) + ) + (set! (-> arg0 data 5) + (/ (- (* (-> arg1 data 10) (-> arg1 data 0)) (* (-> arg1 data 8) (-> arg1 data 2))) f0-0) + ) + (set! (-> arg0 data 9) + (/ (- (* (-> arg1 data 8) (-> arg1 data 1)) (* (-> arg1 data 9) (-> arg1 data 0))) f0-0) + ) + (set! (-> arg0 data 2) + (/ (- (* (-> arg1 data 1) (-> arg1 data 6)) (* (-> arg1 data 2) (-> arg1 data 5))) f0-0) + ) + (set! (-> arg0 data 6) + (/ (- (* (-> arg1 data 2) (-> arg1 data 4)) (* (-> arg1 data 0) (-> arg1 data 6))) f0-0) + ) + (set! (-> arg0 data 10) + (/ (- (* (-> arg1 data 0) (-> arg1 data 5)) (* (-> arg1 data 1) (-> arg1 data 4))) f0-0) + ) + ) + arg0 + ) + +;; definition for function matrix-3x3-inverse-transpose! +(defun matrix-3x3-inverse-transpose! ((arg0 matrix) (arg1 matrix)) + (let ((f0-0 (matrix-3x3-determinant arg1))) + (set! (-> arg0 data 0) + (/ (- (* (-> arg1 data 5) (-> arg1 data 10)) (* (-> arg1 data 6) (-> arg1 data 9))) f0-0) + ) + (set! (-> arg0 data 1) + (/ (- (* (-> arg1 data 6) (-> arg1 data 8)) (* (-> arg1 data 4) (-> arg1 data 10))) f0-0) + ) + (set! (-> arg0 data 2) + (/ (- (* (-> arg1 data 4) (-> arg1 data 9)) (* (-> arg1 data 5) (-> arg1 data 8))) f0-0) + ) + (set! (-> arg0 data 4) + (/ (- (* (-> arg1 data 9) (-> arg1 data 2)) (* (-> arg1 data 10) (-> arg1 data 1))) f0-0) + ) + (set! (-> arg0 data 5) + (/ (- (* (-> arg1 data 10) (-> arg1 data 0)) (* (-> arg1 data 8) (-> arg1 data 2))) f0-0) + ) + (set! (-> arg0 data 6) + (/ (- (* (-> arg1 data 8) (-> arg1 data 1)) (* (-> arg1 data 9) (-> arg1 data 0))) f0-0) + ) + (set! (-> arg0 data 8) + (/ (- (* (-> arg1 data 1) (-> arg1 data 6)) (* (-> arg1 data 2) (-> arg1 data 5))) f0-0) + ) + (set! (-> arg0 data 9) + (/ (- (* (-> arg1 data 2) (-> arg1 data 4)) (* (-> arg1 data 0) (-> arg1 data 6))) f0-0) + ) + (set! (-> arg0 data 10) + (/ (- (* (-> arg1 data 0) (-> arg1 data 5)) (* (-> arg1 data 1) (-> arg1 data 4))) f0-0) + ) + ) + arg0 + ) + +;; definition for function matrix3-inverse-transpose! +(defun matrix3-inverse-transpose! ((arg0 matrix) (arg1 matrix)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + ) + (init-vf0-vector) + (.lvf vf10 (&-> arg1 vector 0 quad)) + (.lvf vf11 (&-> arg1 vector 1 quad)) + (.lvf vf12 (&-> arg1 vector 2 quad)) + (.outer.product.a.vf acc vf11 vf12) + (.outer.product.b.vf vf13 vf12 vf11 acc) + (.outer.product.a.vf acc vf12 vf10) + (.outer.product.b.vf vf14 vf10 vf12 acc) + (.mul.vf vf1 vf10 vf13 :mask #b111) + (.outer.product.a.vf acc vf10 vf11) + (.outer.product.b.vf vf15 vf11 vf10 acc) + (.nop.vf) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.div.vf Q vf0 vf1 :fsf #b11 :ftf #b0) + (.wait.vf) + (.mul.vf vf13 vf13 Q) + (.mul.vf vf14 vf14 Q) + (.mul.vf vf15 vf15 Q) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 vector 0 quad) vf13) + (.svf (&-> arg0 vector 1 quad) vf14) + (.svf (&-> arg0 vector 2 quad) vf15) + arg0 + ) + ) + +;; definition for function matrix-3x3-normalize! +;; ERROR: Unsupported inline assembly instruction kind - [mula.s f2, f2] +;; ERROR: Unsupported inline assembly instruction kind - [madda.s f0, f0] +;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f1, f1] +;; ERROR: Unsupported inline assembly instruction kind - [rsqrt.s f0, f2, f0] +(defun matrix-3x3-normalize! ((arg0 matrix) (arg1 matrix)) + (local-vars (f0-1 float) (f0-2 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf15 :class vf) + (vf16 :class vf) + ) + (init-vf0-vector) + (let ((f2-0 (-> arg1 data 0)) + (f0-0 (-> arg1 data 1)) + (f1-0 (-> arg1 data 2)) + (v1-0 #x3f800000) + ) + (.lvf vf10 (&-> arg1 vector 0 quad)) + (.mula.s f2-0 f2-0) + (.lvf vf11 (&-> arg1 vector 1 quad)) + (let ((f2-1 (gpr->fpr v1-0))) + (.lvf vf12 (&-> arg1 vector 2 quad)) + (.madda.s f0-0 f0-0) + (.sub.w.vf vf13 vf0 vf0 :mask #b1000) + (.madd.s f0-1 f1-0 f1-0) + (.sub.w.vf vf14 vf0 vf0 :mask #b1000) + (.rsqrt.s f0-2 f2-1 f0-1) + ) + ) + (.sub.w.vf vf15 vf0 vf0 :mask #b1000) + (let ((v1-1 f0-2)) + (.mov vf16 v1-1) + ) + (.mul.x.vf vf13 vf10 vf16 :mask #b111) + (.outer.product.a.vf acc vf11 vf13) + (.outer.product.b.vf vf14 vf13 vf11 acc) + (.outer.product.a.vf acc vf13 vf14) + (.outer.product.b.vf vf14 vf14 vf13 acc) + (.mul.vf vf16 vf14 vf14 :mask #b111) + (.mul.x.vf acc vf0 vf16 :mask #b1000) + (.add.mul.y.vf acc vf0 vf16 acc :mask #b1000) + (.add.mul.z.vf vf16 vf0 vf16 acc :mask #b1000) + (.isqrt.vf Q vf0 vf16 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf14 vf14 Q :mask #b111) + (.outer.product.a.vf acc vf13 vf14) + (.outer.product.b.vf vf15 vf14 vf13 acc) + (.svf (&-> arg0 vector 0 quad) vf13) + (.svf (&-> arg0 vector 1 quad) vf14) + (.svf (&-> arg0 vector 2 quad) vf15) + arg0 + ) + ) + +;; definition for function matrix-4x4-determinant +(defun matrix-4x4-determinant ((arg0 matrix)) + (let ((f15-0 (-> arg0 data 0)) + (f14-0 (-> arg0 data 1)) + (f10-0 (-> arg0 data 2)) + (f2-0 (-> arg0 data 3)) + (f9-0 (-> arg0 data 4)) + (f6-0 (-> arg0 data 5)) + (f3-0 (-> arg0 data 6)) + (f11-0 (-> arg0 data 7)) + (f5-0 (-> arg0 data 8)) + (f1-0 (-> arg0 data 9)) + (f8-0 (-> arg0 data 10)) + (f13-0 (-> arg0 data 11)) + (f0-0 (-> arg0 trans x)) + (f7-0 (-> arg0 trans y)) + (f4-0 (-> arg0 trans z)) + (f12-0 (-> arg0 trans w)) + ) + (- (+ (* f15-0 f6-0 f8-0 f12-0) + (* f15-0 f3-0 f13-0 f7-0) + (* f15-0 f11-0 f1-0 f4-0) + (* f14-0 f9-0 f13-0 f4-0) + (* f14-0 f3-0 f5-0 f4-0) + (* f14-0 f11-0 f8-0 f0-0) + (* f10-0 f9-0 f1-0 f12-0) + (* f10-0 f6-0 f13-0 f0-0) + (* f10-0 f11-0 f5-0 f7-0) + (* f2-0 f9-0 f1-0 f4-0) + (* f2-0 f6-0 f8-0 f0-0) + (* f2-0 f3-0 f5-0 f7-0) + ) + (+ (* f15-0 f6-0 f13-0 f4-0) + (* f15-0 f3-0 f1-0 f12-0) + (* f15-0 f11-0 f8-0 f7-0) + (* f14-0 f9-0 f8-0 f12-0) + (* f14-0 f3-0 f13-0 f0-0) + (* f14-0 f11-0 f5-0 f4-0) + (* f10-0 f9-0 f13-0 f7-0) + (* f10-0 f6-0 f5-0 f12-0) + (* f10-0 f11-0 f1-0 f0-0) + (* f2-0 f9-0 f8-0 f7-0) + (* f2-0 f6-0 f5-0 f4-0) + (* f2-0 f3-0 f1-0 f0-0) + ) + ) + ) + ) + +;; definition for function matrix-4x4-inverse-transpose! +(defun matrix-4x4-inverse-transpose! ((arg0 matrix) (arg1 matrix)) + (let ((f0-0 (matrix-4x4-determinant arg1))) + (let ((f9-0 (-> arg1 data 5)) + (f2-0 (-> arg1 data 6)) + (f5-0 (-> arg1 data 7)) + (f3-0 (-> arg1 data 9)) + (f6-0 (-> arg1 data 10)) + (f10-0 (-> arg1 data 11)) + (f4-0 (-> arg1 trans y)) + (f7-0 (-> arg1 trans z)) + (f1-0 (-> arg1 trans w)) + ) + (set! (-> arg0 data 0) (/ (- (+ (* f9-0 f6-0 f1-0) (* f2-0 f10-0 f4-0) (* f5-0 f3-0 f7-0)) + (+ (* f9-0 f10-0 f7-0) (* f5-0 f6-0 f4-0) (* f2-0 f3-0 f1-0)) + ) + f0-0 + ) + ) + ) + (let ((f9-2 (-> arg1 data 4)) + (f2-2 (-> arg1 data 6)) + (f5-2 (-> arg1 data 7)) + (f3-1 (-> arg1 data 8)) + (f6-1 (-> arg1 data 10)) + (f10-1 (-> arg1 data 11)) + (f4-3 (-> arg1 trans x)) + (f7-2 (-> arg1 trans z)) + (f1-6 (-> arg1 trans w)) + ) + (set! (-> arg0 data 1) (- (/ (- (+ (* f9-2 f6-1 f1-6) (* f2-2 f10-1 f4-3) (* f5-2 f3-1 f7-2)) + (+ (* f9-2 f10-1 f7-2) (* f5-2 f6-1 f4-3) (* f2-2 f3-1 f1-6)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-4 (-> arg1 data 4)) + (f2-4 (-> arg1 data 5)) + (f5-4 (-> arg1 data 7)) + (f3-2 (-> arg1 data 8)) + (f6-2 (-> arg1 data 9)) + (f10-2 (-> arg1 data 11)) + (f4-6 (-> arg1 trans x)) + (f7-4 (-> arg1 trans y)) + (f1-13 (-> arg1 trans w)) + ) + (set! (-> arg0 data 2) (/ (- (+ (* f9-4 f6-2 f1-13) (* f2-4 f10-2 f4-6) (* f5-4 f3-2 f7-4)) + (+ (* f9-4 f10-2 f7-4) (* f5-4 f6-2 f4-6) (* f2-4 f3-2 f1-13)) + ) + f0-0 + ) + ) + ) + (let ((f9-6 (-> arg1 data 4)) + (f2-6 (-> arg1 data 5)) + (f5-6 (-> arg1 data 6)) + (f3-3 (-> arg1 data 8)) + (f6-3 (-> arg1 data 9)) + (f10-3 (-> arg1 data 10)) + (f4-9 (-> arg1 trans x)) + (f7-6 (-> arg1 trans y)) + (f1-19 (-> arg1 trans z)) + ) + (set! (-> arg0 data 3) (- (/ (- (+ (* f9-6 f6-3 f1-19) (* f2-6 f10-3 f4-9) (* f5-6 f3-3 f7-6)) + (+ (* f9-6 f10-3 f7-6) (* f5-6 f6-3 f4-9) (* f2-6 f3-3 f1-19)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-8 (-> arg1 data 1)) + (f2-8 (-> arg1 data 2)) + (f5-8 (-> arg1 data 3)) + (f3-4 (-> arg1 data 9)) + (f6-4 (-> arg1 data 10)) + (f10-4 (-> arg1 data 11)) + (f4-12 (-> arg1 trans y)) + (f7-8 (-> arg1 trans z)) + (f1-26 (-> arg1 trans w)) + ) + (set! (-> arg0 data 4) (- (/ (- (+ (* f9-8 f6-4 f1-26) (* f2-8 f10-4 f4-12) (* f5-8 f3-4 f7-8)) + (+ (* f9-8 f10-4 f7-8) (* f5-8 f6-4 f4-12) (* f2-8 f3-4 f1-26)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-10 (-> arg1 data 0)) + (f2-10 (-> arg1 data 2)) + (f5-10 (-> arg1 data 3)) + (f3-5 (-> arg1 data 8)) + (f6-5 (-> arg1 data 10)) + (f10-5 (-> arg1 data 11)) + (f4-15 (-> arg1 trans x)) + (f7-10 (-> arg1 trans z)) + (f1-33 (-> arg1 trans w)) + ) + (set! (-> arg0 data 5) (/ (- (+ (* f9-10 f6-5 f1-33) (* f2-10 f10-5 f4-15) (* f5-10 f3-5 f7-10)) + (+ (* f9-10 f10-5 f7-10) (* f5-10 f6-5 f4-15) (* f2-10 f3-5 f1-33)) + ) + f0-0 + ) + ) + ) + (let ((f9-12 (-> arg1 data 0)) + (f2-12 (-> arg1 data 1)) + (f5-12 (-> arg1 data 3)) + (f3-6 (-> arg1 data 8)) + (f6-6 (-> arg1 data 9)) + (f10-6 (-> arg1 data 11)) + (f4-18 (-> arg1 trans x)) + (f7-12 (-> arg1 trans y)) + (f1-39 (-> arg1 trans w)) + ) + (set! (-> arg0 data 6) (- (/ (- (+ (* f9-12 f6-6 f1-39) (* f2-12 f10-6 f4-18) (* f5-12 f3-6 f7-12)) + (+ (* f9-12 f10-6 f7-12) (* f5-12 f6-6 f4-18) (* f2-12 f3-6 f1-39)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-14 (-> arg1 data 0)) + (f2-14 (-> arg1 data 1)) + (f5-14 (-> arg1 data 2)) + (f3-7 (-> arg1 data 8)) + (f6-7 (-> arg1 data 9)) + (f10-7 (-> arg1 data 10)) + (f4-21 (-> arg1 trans x)) + (f7-14 (-> arg1 trans y)) + (f1-46 (-> arg1 trans z)) + ) + (set! (-> arg0 data 7) (/ (- (+ (* f9-14 f6-7 f1-46) (* f2-14 f10-7 f4-21) (* f5-14 f3-7 f7-14)) + (+ (* f9-14 f10-7 f7-14) (* f5-14 f6-7 f4-21) (* f2-14 f3-7 f1-46)) + ) + f0-0 + ) + ) + ) + (let ((f9-16 (-> arg1 data 1)) + (f2-16 (-> arg1 data 2)) + (f5-16 (-> arg1 data 3)) + (f3-8 (-> arg1 data 5)) + (f6-8 (-> arg1 data 6)) + (f10-8 (-> arg1 data 7)) + (f4-24 (-> arg1 trans y)) + (f7-16 (-> arg1 trans z)) + (f1-52 (-> arg1 trans w)) + ) + (set! (-> arg0 data 8) (/ (- (+ (* f9-16 f6-8 f1-52) (* f2-16 f10-8 f4-24) (* f5-16 f3-8 f7-16)) + (+ (* f9-16 f10-8 f7-16) (* f5-16 f6-8 f4-24) (* f2-16 f3-8 f1-52)) + ) + f0-0 + ) + ) + ) + (let ((f9-18 (-> arg1 data 0)) + (f2-18 (-> arg1 data 2)) + (f5-18 (-> arg1 data 3)) + (f3-9 (-> arg1 data 4)) + (f6-9 (-> arg1 data 6)) + (f10-9 (-> arg1 data 7)) + (f4-27 (-> arg1 trans x)) + (f7-18 (-> arg1 trans z)) + (f1-58 (-> arg1 trans w)) + ) + (set! (-> arg0 data 9) (- (/ (- (+ (* f9-18 f6-9 f1-58) (* f2-18 f10-9 f4-27) (* f5-18 f3-9 f7-18)) + (+ (* f9-18 f10-9 f7-18) (* f5-18 f6-9 f4-27) (* f2-18 f3-9 f1-58)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-20 (-> arg1 data 0)) + (f2-20 (-> arg1 data 1)) + (f5-20 (-> arg1 data 3)) + (f3-10 (-> arg1 data 4)) + (f6-10 (-> arg1 data 5)) + (f10-10 (-> arg1 data 7)) + (f4-30 (-> arg1 trans x)) + (f7-20 (-> arg1 trans y)) + (f1-65 (-> arg1 trans w)) + ) + (set! (-> arg0 data 10) (/ (- (+ (* f9-20 f6-10 f1-65) (* f2-20 f10-10 f4-30) (* f5-20 f3-10 f7-20)) + (+ (* f9-20 f10-10 f7-20) (* f5-20 f6-10 f4-30) (* f2-20 f3-10 f1-65)) + ) + f0-0 + ) + ) + ) + (let ((f9-22 (-> arg1 data 0)) + (f2-22 (-> arg1 data 1)) + (f5-22 (-> arg1 data 2)) + (f3-11 (-> arg1 data 4)) + (f6-11 (-> arg1 data 5)) + (f10-11 (-> arg1 data 6)) + (f4-33 (-> arg1 trans x)) + (f7-22 (-> arg1 trans y)) + (f1-71 (-> arg1 trans z)) + ) + (set! (-> arg0 data 11) (- (/ (- (+ (* f9-22 f6-11 f1-71) (* f2-22 f10-11 f4-33) (* f5-22 f3-11 f7-22)) + (+ (* f9-22 f10-11 f7-22) (* f5-22 f6-11 f4-33) (* f2-22 f3-11 f1-71)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-24 (-> arg1 data 1)) + (f2-24 (-> arg1 data 2)) + (f5-24 (-> arg1 data 3)) + (f3-12 (-> arg1 data 5)) + (f6-12 (-> arg1 data 6)) + (f10-12 (-> arg1 data 7)) + (f4-36 (-> arg1 data 9)) + (f7-24 (-> arg1 data 10)) + (f1-78 (-> arg1 data 11)) + ) + (set! (-> arg0 trans x) (- (/ (- (+ (* f9-24 f6-12 f1-78) (* f2-24 f10-12 f4-36) (* f5-24 f3-12 f7-24)) + (+ (* f9-24 f10-12 f7-24) (* f5-24 f6-12 f4-36) (* f2-24 f3-12 f1-78)) + ) + f0-0 + ) + ) + ) + ) + (let ((f9-26 (-> arg1 data 0)) + (f2-26 (-> arg1 data 2)) + (f5-26 (-> arg1 data 3)) + (f3-13 (-> arg1 data 4)) + (f6-13 (-> arg1 data 6)) + (f10-13 (-> arg1 data 7)) + (f4-39 (-> arg1 data 8)) + (f7-26 (-> arg1 data 10)) + (f1-85 (-> arg1 data 11)) + ) + (set! (-> arg0 trans y) (/ (- (+ (* f9-26 f6-13 f1-85) (* f2-26 f10-13 f4-39) (* f5-26 f3-13 f7-26)) + (+ (* f9-26 f10-13 f7-26) (* f5-26 f6-13 f4-39) (* f2-26 f3-13 f1-85)) + ) + f0-0 + ) + ) + ) + (let ((f9-28 (-> arg1 data 0)) + (f2-28 (-> arg1 data 1)) + (f5-28 (-> arg1 data 3)) + (f3-14 (-> arg1 data 4)) + (f6-14 (-> arg1 data 5)) + (f10-14 (-> arg1 data 7)) + (f4-42 (-> arg1 data 8)) + (f7-28 (-> arg1 data 9)) + (f1-91 (-> arg1 data 11)) + ) + (set! (-> arg0 trans z) (- (/ (- (+ (* f9-28 f6-14 f1-91) (* f2-28 f10-14 f4-42) (* f5-28 f3-14 f7-28)) + (+ (* f9-28 f10-14 f7-28) (* f5-28 f6-14 f4-42) (* f2-28 f3-14 f1-91)) + ) + f0-0 + ) + ) + ) + ) + (let ((f8-60 (-> arg1 data 0)) + (f1-98 (-> arg1 data 1)) + (f5-30 (-> arg1 data 2)) + (f2-30 (-> arg1 data 4)) + (f6-15 (-> arg1 data 5)) + (f9-30 (-> arg1 data 6)) + (f4-45 (-> arg1 data 8)) + (f7-30 (-> arg1 data 9)) + (f3-15 (-> arg1 data 10)) + ) + (set! (-> arg0 trans w) (/ (- (+ (* f8-60 f6-15 f3-15) (* f1-98 f9-30 f4-45) (* f5-30 f2-30 f7-30)) + (+ (* f8-60 f9-30 f7-30) (* f5-30 f6-15 f4-45) (* f1-98 f2-30 f3-15)) + ) + f0-0 + ) + ) + ) + ) + arg0 + ) + +;; definition for function matrix-y-angle +(defun matrix-y-angle ((arg0 matrix)) + (let ((v1-0 (&-> arg0 data 8))) + (atan (-> v1-0 0) (-> v1-0 2)) + ) + ) + +;; definition for function matrix->trans +(defun matrix->trans ((arg0 matrix) (arg1 vector)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 trans quad)) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf2 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> arg1 quad) vf2) + arg1 + ) + ) + +;; definition for function matrix<-trans +;; INFO: Used lq/sq +(defun matrix<-trans ((arg0 matrix) (arg1 vector)) + (set! (-> arg0 trans quad) (-> arg1 quad)) + arg0 + ) + +;; definition for function matrix->scale +(defun matrix->scale ((arg0 matrix) (arg1 vector)) + (set! (-> arg1 x) (vector-length (the-as vector (-> arg0 data)))) + (set! (-> arg1 y) (vector-length (the-as vector (&-> arg0 data 4)))) + (set! (-> arg1 z) (vector-length (the-as vector (&-> arg0 data 8)))) + (set! (-> arg1 w) 1.0) + arg1 + ) + +;; definition for function matrix<-scale +(defun matrix<-scale ((arg0 matrix) (arg1 vector)) + (vector-normalize! (the-as vector (-> arg0 data)) (-> arg1 x)) + (vector-normalize! (the-as vector (&-> arg0 data 4)) (-> arg1 y)) + (vector-normalize! (the-as vector (&-> arg0 data 8)) (-> arg1 z)) + arg0 + ) + +;; definition for function matrix->quat +;; INFO: Used lq/sq +(defun matrix->quat ((arg0 matrix) (arg1 quaternion)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 arg0) + (v1-0 (-> a2-0 vector 0 quad)) + (a0-1 (-> a2-0 vector 1 quad)) + (a1-1 (-> a2-0 vector 2 quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s5-0 vector 0 quad) v1-0) + (set! (-> s5-0 vector 1 quad) a0-1) + (set! (-> s5-0 vector 2 quad) a1-1) + (set! (-> s5-0 trans quad) a2-1) + ) + (vector-reset! (-> s5-0 trans)) + (vector-normalize! (the-as vector (-> s5-0 data)) 1.0) + (vector-normalize! (the-as vector (&-> s5-0 data 4)) 1.0) + (vector-normalize! (the-as vector (&-> s5-0 data 8)) 1.0) + (matrix->quaternion arg1 s5-0) + ) + ) + +;; definition for function matrix<-quat +(defun matrix<-quat ((arg0 matrix) (arg1 quaternion)) + (let ((s5-0 (matrix->scale arg0 (new 'stack-no-clear 'vector))) + (s4-1 (quaternion->matrix (new 'stack-no-clear 'matrix) arg1)) + ) + (vector-normalize-copy! (the-as vector (-> arg0 data)) (the-as vector (-> s4-1 data)) (-> s5-0 x)) + (vector-normalize-copy! (the-as vector (&-> arg0 data 4)) (the-as vector (&-> s4-1 data 4)) (-> s5-0 y)) + (vector-normalize-copy! (the-as vector (&-> arg0 data 8)) (the-as vector (&-> s4-1 data 8)) (-> s5-0 z)) + ) + (set! (-> arg0 data 3) 0.0) + (set! (-> arg0 data 7) 0.0) + (set! (-> arg0 data 11) 0.0) + arg0 + ) + +;; definition for function matrix->transformq +;; INFO: Used lq/sq +(defun matrix->transformq ((arg0 transformq) (arg1 matrix)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg1 trans quad)) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf2 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.mov.vf vf2 vf0 :mask #b1000) + (.svf (&-> arg0 trans quad) vf2) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 arg1) + (v1-0 (-> a2-0 vector 0 quad)) + (a0-1 (-> a2-0 vector 1 quad)) + (a1-1 (-> a2-0 vector 2 quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> s4-0 vector 0 quad) v1-0) + (set! (-> s4-0 vector 1 quad) a0-1) + (set! (-> s4-0 vector 2 quad) a1-1) + (set! (-> s4-0 trans quad) a2-1) + ) + (vector-normalize! (the-as vector (-> s4-0 data)) 1.0) + (vector-normalize! (the-as vector (&-> s4-0 data 4)) 1.0) + (vector-normalize! (the-as vector (&-> s4-0 data 8)) 1.0) + (vector-cross! + (the-as vector (&-> s4-0 data 8)) + (the-as vector (-> s4-0 data)) + (the-as vector (&-> s4-0 data 4)) + ) + (vector-cross! + (the-as vector (&-> s4-0 data 4)) + (the-as vector (&-> s4-0 data 8)) + (the-as vector (-> s4-0 data)) + ) + (matrix->quaternion (-> arg0 quat) s4-0) + ) + (set-vector! + (-> arg0 scale) + (vector-length (the-as vector (-> arg1 data))) + (vector-length (the-as vector (&-> arg1 data 4))) + (vector-length (the-as vector (&-> arg1 data 8))) + 1.0 + ) + arg0 + ) + ) + +;; definition for method 9 of type matrix +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function matrix-mirror! +(defun matrix-mirror! ((arg0 matrix) (arg1 vector) (arg2 vector)) + (let ((f10-0 -2.0) + (f0-0 1.0) + ) + (let* ((f1-0 0.0) + (f9-0 (-> arg2 x)) + (f12-0 (-> arg2 y)) + (f11-0 (-> arg2 z)) + (f6-0 (-> arg1 x)) + (f5-0 (-> arg1 y)) + (f2-0 (-> arg1 z)) + (f3-2 (+ f0-0 (* f10-0 f9-0 f9-0))) + (f4-2 (+ f0-0 (* f10-0 f12-0 f12-0))) + (f7-2 (+ f0-0 (* f10-0 f11-0 f11-0))) + (f8-1 (* f10-0 f9-0 f12-0)) + (f9-2 (* f10-0 f9-0 f11-0)) + (f10-2 (* f10-0 f12-0 f11-0)) + (f11-4 (- f6-0 (+ (* f6-0 f3-2) (* f5-0 f8-1) (* f2-0 f9-2)))) + (f12-6 (- f5-0 (+ (* f6-0 f8-1) (* f5-0 f4-2) (* f2-0 f10-2)))) + (f2-1 (- f2-0 (+ (* f6-0 f9-2) (* f5-0 f10-2) (* f2-0 f7-2)))) + ) + (set! (-> arg0 data 0) f3-2) + (set! (-> arg0 data 1) f8-1) + (set! (-> arg0 data 2) f9-2) + (set! (-> arg0 data 3) f1-0) + (set! (-> arg0 data 4) f8-1) + (set! (-> arg0 data 5) f4-2) + (set! (-> arg0 data 6) f10-2) + (set! (-> arg0 data 7) f1-0) + (set! (-> arg0 data 8) f9-2) + (set! (-> arg0 data 9) f10-2) + (set! (-> arg0 data 10) f7-2) + (set! (-> arg0 data 11) f1-0) + (set! (-> arg0 trans x) f11-4) + (set! (-> arg0 trans y) f12-6) + (set! (-> arg0 trans z) f2-1) + ) + (set! (-> arg0 trans w) f0-0) + ) + arg0 + ) diff --git a/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc new file mode 100644 index 0000000000..e26092e8fb --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/quaternion-h_REF.gc @@ -0,0 +1,47 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type quaternion +(deftype quaternion (structure) + ((data float 4 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (w float :offset 12) + (vec vector :inline :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type quaternion +;; INFO: this function exists in multiple non-identical object files +;; INFO: Used lq/sq +(defmethod inspect quaternion ((obj quaternion)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'quaternion) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tvec: #~%" (&-> obj x)) + (format #t "~1Tquad: ~D~%" (-> obj vec quad)) + (label cfg-4) + obj + ) + +;; definition for symbol *unity-quaternion*, type quaternion +(define *unity-quaternion* (new 'static 'quaternion :w 1.0)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc new file mode 100644 index 0000000000..8100b5b2a5 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/quaternion_REF.gc @@ -0,0 +1,1010 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 3 of type quaternion +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect quaternion ((obj quaternion)) + (format #t "[~8x] quaternion~%" obj) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) + (let ((f0-5 (/ 1.0 (sqrtf (+ (* (-> obj x) (-> obj x)) (* (-> obj y) (-> obj y)) (* (-> obj z) (-> obj z))))))) + (format #t "~Taxis: ~F ~F ~F" (* f0-5 (-> obj x)) (* f0-5 (-> obj y)) (* f0-5 (-> obj z))) + ) + (let ((f0-9 (* 2.0 (acos (-> obj w))))) + (format #t "~T~Tangle: (deg ~R)~%" f0-9) + ) + obj + ) + +;; definition for function quaternion-axis-angle! +(defun quaternion-axis-angle! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos! (the-as (pointer float) s5-0) (* 0.5 arg4)) + (let ((f0-2 (-> s5-0 x))) + (set! (-> arg0 x) (* arg1 f0-2)) + (set! (-> arg0 y) (* arg2 f0-2)) + (set! (-> arg0 z) (* arg3 f0-2)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + arg0 + ) + +;; definition for function quaternion-vector-angle! +(defun quaternion-vector-angle! ((arg0 quaternion) (arg1 vector) (arg2 float)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos! (the-as (pointer float) s5-0) (* 0.5 arg2)) + (let ((f0-2 (-> s5-0 x))) + (set! (-> arg0 x) (* (-> arg1 x) f0-2)) + (set! (-> arg0 y) (* (-> arg1 y) f0-2)) + (set! (-> arg0 z) (* (-> arg1 z) f0-2)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + arg0 + ) + +;; definition for function vector-angle<-quaternion! +(defun vector-angle<-quaternion! ((arg0 vector) (arg1 quaternion)) + (let* ((f0-0 1.0) + (f1-0 1.0) + (f2-0 (-> arg1 w)) + (f30-0 (/ f0-0 (sqrtf (- f1-0 (* f2-0 f2-0))))) + (f0-3 (* 2.0 (acos-rad (-> arg1 w)))) + ) + (set! (-> arg0 x) (* (-> arg1 x) f30-0)) + (set! (-> arg0 y) (* (-> arg1 y) f30-0)) + (set! (-> arg0 z) (* (-> arg1 z) f30-0)) + (set! (-> arg0 w) f0-3) + ) + arg0 + ) + +;; definition for function quaternion-look-at! +;; INFO: Used lq/sq +(defun quaternion-look-at! ((arg0 quaternion) (arg1 vector) (arg2 vector)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (vector-cross! (the-as vector (-> s5-0 data)) arg2 arg1) + (vector-cross! (the-as vector (&-> s5-0 data 4)) arg1 (the-as vector (-> s5-0 data))) + (set! (-> (the-as vector (&-> s5-0 data 8)) quad) (-> arg1 quad)) + (quaternion-normalize! (matrix->quaternion arg0 s5-0)) + ) + ) + +;; definition for function quaternion-zero! +;; INFO: Used lq/sq +(defun quaternion-zero! ((arg0 quaternion)) + (set! (-> arg0 vec quad) (the-as uint128 0)) + arg0 + ) + +;; definition for function quaternion-identity! +;; INFO: Used lq/sq +(defun quaternion-identity! ((arg0 quaternion)) + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 w) 1.0) + arg0 + ) + +;; definition for function quaternion-i! +;; INFO: Used lq/sq +(defun quaternion-i! ((arg0 quaternion)) + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 x) 1.0) + arg0 + ) + +;; definition for function quaternion-j! +;; INFO: Used lq/sq +(defun quaternion-j! ((arg0 quaternion)) + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 y) 1.0) + arg0 + ) + +;; definition for function quaternion-k! +;; INFO: Used lq/sq +(defun quaternion-k! ((arg0 quaternion)) + (set! (-> arg0 vec quad) (the-as uint128 0)) + (set! (-> arg0 z) 1.0) + arg0 + ) + +;; definition for function quaternion-copy! +;; INFO: Used lq/sq +(defun quaternion-copy! ((arg0 quaternion) (arg1 quaternion)) + (set! (-> arg0 vec quad) (-> arg1 vec quad)) + arg0 + ) + +;; definition for function quaternion-set! +(defun quaternion-set! ((arg0 quaternion) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (set! (-> arg0 x) arg1) + (set! (-> arg0 y) arg2) + (set! (-> arg0 z) arg3) + (set! (-> arg0 w) arg4) + arg0 + ) + +;; definition for function quaternion+! +(defun quaternion+! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.lvf vf2 (&-> arg2 vec quad)) + (.add.vf vf1 vf1 vf2) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +;; definition for function quaternion-! +(defun quaternion-! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.lvf vf2 (&-> arg2 vec quad)) + (.sub.vf vf1 vf1 vf2) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +;; definition for function quaternion-negate! +;; ERROR: Bad vector register dependency: vf2 +(defun quaternion-negate! ((arg0 quaternion) (arg1 quaternion)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.sub.vf vf2 vf2 vf2) + (.sub.vf vf1 vf2 vf1) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +;; definition for function quaternion-conjugate! +;; ERROR: Bad vector register dependency: vf2 +(defun quaternion-conjugate! ((arg0 quaternion) (arg1 quaternion)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.sub.vf vf2 vf2 vf2) + (.sub.vf vf2 vf2 vf1 :mask #b111) + (.add.vf vf2 vf2 vf1 :mask #b1000) + (.svf (&-> arg0 vec quad) vf2) + arg0 + ) + ) + +;; definition for function quaternion-float*! +(defun quaternion-float*! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 vec quad)) + (.mov vf2 arg2) + (.mul.x.vf vf1 vf1 vf2) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +;; definition for function quaternion-float/! +(defun quaternion-float/! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((f0-1 (/ 1.0 arg2))) + (quaternion-float*! arg0 arg1 f0-1) + ) + arg0 + ) + +;; definition for function quaternion-norm2 +(defun quaternion-norm2 ((arg0 quaternion)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf acc vf1 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.x.vf vf1 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf1 vf0 vf1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function quaternion-norm +(defun quaternion-norm ((arg0 quaternion)) + (local-vars (v1-1 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf acc vf1 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.x.vf vf1 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf1 vf0 vf1) + (.mov v1-1 vf1) + (sqrtf v1-1) + ) + ) + +;; definition for function quaternion-normalize! +(defun quaternion-normalize! ((arg0 quaternion)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.mul.vf vf2 vf1 vf1) + (.add.z.vf acc vf2 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.x.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.wait.vf) + (.mul.vf vf2 vf1 Q) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 vec quad) vf2) + arg0 + ) + ) + +;; definition for function quaternion-inverse! +;; ERROR: Bad vector register dependency: vf3 +(defun quaternion-inverse! ((arg0 quaternion) (arg1 quaternion)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 vec quad)) + (.mul.vf vf2 vf1 vf1) + (.sub.vf vf3 vf3 vf3) + (.add.z.vf acc vf2 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.x.vf vf2 vf0 vf2 acc :mask #b1000) + (.sub.vf vf3 vf3 vf1 :mask #b111) + (.div.vf Q vf0 vf2 :fsf #b11 :ftf #b11) + (.add.vf vf3 vf3 vf1 :mask #b1000) + (.wait.vf) + (.mul.vf vf3 vf3 Q) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 vec quad) vf3) + arg0 + ) + ) + +;; definition for function quaternion-dot +(defun quaternion-dot ((arg0 quaternion) (arg1 quaternion)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 vec quad)) + (.lvf vf2 (&-> arg1 vec quad)) + (.mul.vf vf1 vf1 vf2) + (.add.z.vf acc vf1 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.x.vf vf1 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf1 vf0 vf1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function quaternion*! +(defun quaternion*! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 vec quad)) + (.lvf vf2 (&-> arg2 vec quad)) + (.sub.vf vf4 vf0 vf0 :mask #b1000) + (.mul.vf vf3 vf1 vf2) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf4 vf2 vf1 acc) + (.mul.w.vf acc vf1 vf2) + (.add.mul.w.vf acc vf2 vf1 acc) + (.sub.mul.w.vf acc vf0 vf3 acc :mask #b1000) + (.sub.mul.z.vf acc vf0 vf3 acc :mask #b1000) + (.sub.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.sub.mul.x.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.w.vf vf1 vf4 vf0 acc) + (.svf (&-> arg0 vec quad) vf1) + arg0 + ) + ) + +;; definition for function quaternion-right-mult-matrix! +(defun quaternion-right-mult-matrix! ((arg0 matrix) (arg1 quaternion)) + (let ((f3-0 (-> arg1 x)) + (f2-0 (-> arg1 y)) + (f1-0 (-> arg1 z)) + (f0-0 (-> arg1 w)) + ) + (set! (-> arg0 data 0) f0-0) + (set! (-> arg0 data 1) f1-0) + (set! (-> arg0 data 2) (- f2-0)) + (set! (-> arg0 data 3) f3-0) + (set! (-> arg0 data 4) (- f1-0)) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 6) f3-0) + (set! (-> arg0 data 7) f2-0) + (set! (-> arg0 data 8) f2-0) + (set! (-> arg0 data 9) (- f3-0)) + (set! (-> arg0 data 10) f0-0) + (set! (-> arg0 data 11) f1-0) + (set! (-> arg0 trans x) (- f3-0)) + (set! (-> arg0 trans y) (- f2-0)) + (set! (-> arg0 trans z) (- f1-0)) + (set! (-> arg0 trans w) f0-0) + ) + arg0 + ) + +;; definition for function quaternion-left-mult-matrix! +(defun quaternion-left-mult-matrix! ((arg0 matrix) (arg1 quaternion)) + (let ((f2-0 (-> arg1 x)) + (f1-0 (-> arg1 y)) + (f0-0 (-> arg1 z)) + ) + (let ((f3-0 (-> arg1 w))) + (set! (-> arg0 data 0) f2-0) + (set! (-> arg0 data 1) f3-0) + (set! (-> arg0 data 2) (- f0-0)) + (set! (-> arg0 data 3) f1-0) + (set! (-> arg0 data 4) f1-0) + (set! (-> arg0 data 5) f0-0) + (set! (-> arg0 data 6) f3-0) + (set! (-> arg0 data 7) (- f3-0)) + (set! (-> arg0 data 8) f0-0) + (set! (-> arg0 data 9) (- f1-0)) + (set! (-> arg0 data 10) f2-0) + (set! (-> arg0 data 11) f3-0) + (set! (-> arg0 trans x) f3-0) + ) + (set! (-> arg0 trans y) (- f2-0)) + (set! (-> arg0 trans z) (- f1-0)) + (set! (-> arg0 trans w) (- f0-0)) + ) + arg0 + ) + +;; definition for function quaternion->matrix +(defun quaternion->matrix ((arg0 matrix) (arg1 quaternion)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 vec quad)) + (.add.vf vf5 vf1 vf1) + (.add.w.vf vf2 vf0 vf1 :mask #b1) + (.add.z.vf vf2 vf0 vf1 :mask #b10) + (.sub.y.vf vf2 vf0 vf1 :mask #b100) + (.sub.w.vf vf2 vf0 vf0 :mask #b1000) + (.sub.z.vf vf3 vf0 vf1 :mask #b1) + (.add.w.vf vf3 vf0 vf1 :mask #b10) + (.add.x.vf vf3 vf0 vf1 :mask #b100) + (.sub.w.vf vf3 vf0 vf0 :mask #b1000) + (.add.y.vf vf4 vf0 vf1 :mask #b1) + (.sub.x.vf vf4 vf0 vf1 :mask #b10) + (.add.w.vf vf4 vf0 vf1 :mask #b100) + (.sub.w.vf vf4 vf0 vf0 :mask #b1000) + (.outer.product.a.vf acc vf5 vf2) + (.outer.product.b.vf vf2 vf2 vf5 acc) + (.outer.product.a.vf acc vf5 vf3) + (.outer.product.b.vf vf3 vf3 vf5 acc) + (.outer.product.a.vf acc vf5 vf4) + (.outer.product.b.vf vf4 vf4 vf5 acc) + (.add.w.vf vf2 vf2 vf0 :mask #b1) + (.add.w.vf vf3 vf3 vf0 :mask #b10) + (.add.w.vf vf4 vf4 vf0 :mask #b100) + (.svf (&-> arg0 trans quad) vf0) + (.svf (&-> arg0 vector 0 quad) vf2) + (.svf (&-> arg0 vector 1 quad) vf3) + (.svf (&-> arg0 vector 2 quad) vf4) + arg0 + ) + ) + +;; definition for function quaternion->matrix-2 +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function matrix->quaternion +(defun matrix->quaternion ((arg0 quaternion) (arg1 matrix)) + (let ((f0-2 (+ (-> arg1 data 0) (-> arg1 data 5) (-> arg1 data 10)))) + (cond + ((< 0.0 f0-2) + (let ((f0-4 (sqrtf (+ 1.0 f0-2)))) + (set! (-> arg0 w) (* 0.5 f0-4)) + (let ((f0-5 (/ 0.5 f0-4))) + (set! (-> arg0 x) (* f0-5 (- (-> arg1 data 6) (-> arg1 data 9)))) + (set! (-> arg0 y) (* f0-5 (- (-> arg1 data 8) (-> arg1 data 2)))) + (set! (-> arg0 z) (* f0-5 (- (-> arg1 data 1) (-> arg1 data 4)))) + ) + ) + ) + (else + (let ((a2-0 0) + (a3-0 1) + (v1-4 2) + ) + (when (< (-> arg1 data 0) (-> arg1 data 5)) + (set! a2-0 1) + (set! a3-0 2) + (set! v1-4 0) + ) + (when (< (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1)))) (-> arg1 data 10)) + (set! a2-0 2) + (set! a3-0 0) + (set! v1-4 1) + ) + (let ((f0-12 + (sqrtf + (+ (- 1.0 + (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* v1-4 4) (* v1-4 16)) (the-as int arg1)))) + ) + ) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1)))) + ) + ) + ) + ) + (set! (-> arg0 data a2-0) (* 0.5 f0-12)) + (if (!= f0-12 0.0) + (set! f0-12 (/ 0.5 f0-12)) + ) + (set! (-> arg0 w) + (* (- (-> (the-as (pointer float) (+ (+ (* v1-4 4) (* a3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* v1-4 16)) (the-as int arg1)))) + ) + f0-12 + ) + ) + (set! (-> arg0 data a3-0) + (* (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a2-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a3-0 16)) (the-as int arg1)))) + ) + f0-12 + ) + ) + (set! (-> arg0 data v1-4) + (* (+ (-> (the-as (pointer float) (+ (+ (* v1-4 4) (* a2-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* v1-4 16)) (the-as int arg1)))) + ) + f0-12 + ) + ) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function matrix-with-scale->quaternion +;; INFO: Used lq/sq +(defun matrix-with-scale->quaternion ((arg0 quaternion) (arg1 matrix)) + (local-vars (a1-4 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (let ((v1-0 (new-stack-matrix0))) + (let* ((f0-1 (vector-dot (the-as vector (-> arg1 data)) (the-as vector (-> arg1 data)))) + (f1-1 (vector-dot (the-as vector (&-> arg1 data 4)) (the-as vector (&-> arg1 data 4)))) + (f2-1 (vector-dot (the-as vector (&-> arg1 data 8)) (the-as vector (&-> arg1 data 8)))) + (f0-3 (/ 1.0 (sqrtf f0-1))) + (f1-3 (/ 1.0 (sqrtf f1-1))) + (f2-3 (/ 1.0 (sqrtf f2-1))) + ) + (.lvf vf1 (&-> arg1 vector 0 quad)) + (.lvf vf2 (&-> arg1 vector 1 quad)) + (.lvf vf3 (&-> arg1 vector 2 quad)) + (.lvf vf4 (&-> arg1 trans quad)) + (let ((a1-1 f0-3)) + (.mov vf5 a1-1) + ) + (let ((a1-2 f1-3)) + (.mov vf6 a1-2) + ) + (let ((a1-3 f2-3)) + (.mov vf7 a1-3) + ) + ) + (.mul.x.vf vf1 vf1 vf5) + (.mul.x.vf vf2 vf2 vf6) + (.mul.x.vf vf3 vf3 vf7) + (.svf (&-> v1-0 vector 0 quad) vf1) + (.svf (&-> v1-0 vector 1 quad) vf2) + (.svf (&-> v1-0 vector 2 quad) vf3) + (.svf (&-> v1-0 trans quad) vf4) + (.mov a1-4 vf4) + (matrix->quaternion arg0 v1-0) + ) + ) + ) + +;; definition for function quaternion-vector-len +(defun quaternion-vector-len ((arg0 quaternion)) + (let ((f0-0 1.0) + (f1-0 (-> arg0 w)) + ) + (sqrtf (- f0-0 (* f1-0 f1-0))) + ) + ) + +;; definition for function quaternion-log! +(defun quaternion-log! ((arg0 quaternion) (arg1 quaternion)) + (cond + ((= (-> arg1 w) 0.0) + (set! (-> arg0 x) (* 1.5707963 (-> arg1 x))) + (set! (-> arg0 y) (* 1.5707963 (-> arg1 y))) + (set! (-> arg0 z) (* 1.5707963 (-> arg1 z))) + ) + (else + (let* ((f30-0 (quaternion-vector-len arg1)) + (f0-9 (/ (atan2-rad (-> arg1 w) f30-0) f30-0)) + ) + (set! (-> arg0 x) (* (-> arg1 x) f0-9)) + (set! (-> arg0 y) (* (-> arg1 y) f0-9)) + (set! (-> arg0 z) (* (-> arg1 z) f0-9)) + ) + ) + ) + arg0 + ) + +;; definition for function quaternion-exp! +(defun quaternion-exp! ((arg0 quaternion) (arg1 quaternion)) + (let ((f30-0 (vector-length (the-as vector arg1)))) + (cond + ((= f30-0 0.0) + (set! (-> arg0 x) 0.0) + (set! (-> arg0 y) 0.0) + (set! (-> arg0 z) 0.0) + (set! (-> arg0 w) 1.0) + ) + (else + (let ((s5-0 (new 'stack-no-clear 'vector))) + (sincos-rad! (the-as (pointer float) s5-0) f30-0) + (let ((f0-6 (/ (-> s5-0 x) f30-0))) + (set! (-> arg0 x) (* (-> arg1 x) f0-6)) + (set! (-> arg0 y) (* (-> arg1 y) f0-6)) + (set! (-> arg0 z) (* (-> arg1 z) f0-6)) + ) + (set! (-> arg0 w) (-> s5-0 y)) + ) + ) + ) + ) + arg0 + ) + +;; definition for function quaternion-slerp! +(defun quaternion-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + (local-vars (v1-15 float)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let ((f0-0 (quaternion-dot arg1 arg2)) + (f30-0 1.0) + ) + (when (< f0-0 0.0) + (set! f0-0 (- f0-0)) + (set! f30-0 -1.0) + ) + (cond + ((< (- 1.0 f0-0) 0.0001) + (let ((v1-7 (- 1.0 arg3))) + (.mov vf1 v1-7) + ) + (let ((v1-8 (* arg3 f30-0))) + (.mov vf2 v1-8) + ) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.x.vf vf3 vf4 vf2 acc) + (.svf (&-> arg0 vec quad) vf3) + (quaternion-normalize! arg0) + ) + (else + (let* ((f1-4 1.0) + (f2-1 f0-0) + (f1-6 (sqrtf (- f1-4 (* f2-1 f2-1)))) + (f0-6 (/ (- f1-6 f0-0) (+ f1-6 f0-0))) + (f28-0 (/ 1.0 f1-6)) + ) + (let ((f0-7 (atan-series-rad f0-6)) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 x) (* (- 1.0 arg3) f0-7)) + (set! (-> s2-0 y) (* arg3 f0-7 f30-0)) + (vector-sin-rad! s2-0 s2-0) + (.lvf vf1 (&-> s2-0 quad)) + ) + (let ((v1-14 f28-0)) + (.mov vf2 v1-14) + ) + ) + (.mul.x.vf vf1 vf1 vf2) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.y.vf vf3 vf4 vf1 acc) + (.svf (&-> arg0 vec quad) vf3) + (.mov v1-15 vf3) + ) + ) + ) + arg0 + ) + ) + +;; definition for function quaternion-pseudo-slerp! +(defun quaternion-pseudo-slerp! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (let ((f1-0 (quaternion-dot arg1 arg2)) + (f0-0 1.0) + ) + (when (< f1-0 0.0) + (- f1-0) + (set! f0-0 -1.0) + ) + (let ((v1-5 (- 1.0 arg3))) + (.mov vf1 v1-5) + ) + (let ((v1-6 (* arg3 f0-0))) + (.mov vf2 v1-6) + ) + ) + (.lvf vf3 (&-> arg1 vec quad)) + (.lvf vf4 (&-> arg2 vec quad)) + (.mul.x.vf acc vf3 vf1) + (.add.mul.x.vf vf3 vf4 vf2 acc) + (.svf (&-> arg0 vec quad) vf3) + (quaternion-normalize! arg0) + arg0 + ) + ) + +;; definition for function quaternion-pseudo-seek +(defun quaternion-pseudo-seek ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + (let ((s3-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (quaternion-copy! s3-0 arg2) + (if (< (quaternion-dot s3-0 arg1) 0.0) + (quaternion-negate! s3-0 s3-0) + ) + (quaternion-! s5-0 s3-0 arg1) + (let ((f0-1 (quaternion-norm2 s5-0)) + (f1-1 arg3) + ) + (if (< (* f1-1 f1-1) f0-1) + (quaternion-float*! s5-0 s5-0 (/ arg3 (sqrtf f0-1))) + ) + ) + (quaternion+! s3-0 arg1 s5-0) + ) + (quaternion-normalize! s3-0) + (quaternion-copy! arg0 s3-0) + ) + ) + +;; definition for function quaternion-smooth-seek! +(defun quaternion-smooth-seek! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + (let ((gp-0 (new 'stack-no-clear 'inline-array 'quaternion 2))) + (quaternion-copy! (-> gp-0 0) arg2) + (if (< (quaternion-dot (-> gp-0 0) arg1) 0.0) + (quaternion-negate! (-> gp-0 0) (-> gp-0 0)) + ) + (quaternion-! (-> gp-0 1) (-> gp-0 0) arg1) + (quaternion-float*! (-> gp-0 1) (-> gp-0 1) (fmin 1.0 arg3)) + (quaternion+! (-> gp-0 0) arg1 (-> gp-0 1)) + (quaternion-normalize! (-> gp-0 0)) + (quaternion-copy! arg0 (-> gp-0 0)) + ) + ) + +;; definition for function quaternion-zxy! +(defun quaternion-zxy! ((arg0 quaternion) (arg1 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-rad<-vector-deg/2! s4-0 arg1) + (vector-sincos-rad! gp-0 s5-0 s4-0) + (.lvf vf1 (&-> gp-0 quad)) + (.lvf vf2 (&-> s5-0 quad)) + ) + (.mul.x.vf vf4 vf0 vf1 :mask #b1000) + (.add.vf vf4 vf0 vf2 :mask #b111) + (.sub.vf vf4 vf0 vf4 :mask #b110) + (.add.vf vf3 vf0 vf1 :mask #b111) + (.mul.x.vf vf3 vf0 vf2 :mask #b1000) + (.outer.product.a.vf acc vf1 vf1) + (.outer.product.b.vf vf6 vf0 vf0 acc) + (.outer.product.a.vf acc vf2 vf2) + (.outer.product.b.vf vf5 vf0 vf0 acc) + (.mul.x.vf vf6 vf0 vf6 :mask #b1000) + (.mul.x.vf vf5 vf0 vf5 :mask #b1000) + (.mul.vf acc vf6 vf4) + (.add.mul.vf vf7 vf5 vf3 acc) + (.svf (&-> arg0 vec quad) vf7) + arg0 + ) + ) + +;; definition for function vector-x-quaternion! +;; INFO: Used lq/sq +(defun vector-x-quaternion! ((arg0 vector) (arg1 quaternion)) + (let ((s5-0 (new-stack-matrix0))) + (quaternion->matrix s5-0 arg1) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (-> s5-0 data)) 0)) + ) + arg0 + ) + +;; definition for function vector-y-quaternion! +;; INFO: Used lq/sq +(defun vector-y-quaternion! ((arg0 vector) (arg1 quaternion)) + (let ((s5-0 (new-stack-matrix0))) + (quaternion->matrix s5-0 arg1) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (&-> s5-0 data 4)) 0)) + ) + arg0 + ) + +;; definition for function vector-z-quaternion! +;; INFO: Used lq/sq +(defun vector-z-quaternion! ((arg0 vector) (arg1 quaternion)) + (let ((s5-0 (new-stack-matrix0))) + (quaternion->matrix s5-0 arg1) + (set! (-> arg0 quad) (-> (the-as (pointer uint128) (&-> s5-0 data 8)) 0)) + ) + arg0 + ) + +;; definition for function quaternion-x-angle +(defun quaternion-x-angle ((arg0 quaternion)) + (let ((v1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0))) + (atan (-> v1-1 z) (-> v1-1 y)) + ) + ) + +;; definition for function quaternion-y-angle +(defun quaternion-y-angle ((arg0 quaternion)) + (let ((v1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0))) + (atan (-> v1-1 x) (-> v1-1 z)) + ) + ) + +;; definition for function quaternion-z-angle +(defun quaternion-z-angle ((arg0 quaternion)) + (let ((v1-1 (vector-y-quaternion! (new 'stack-no-clear 'vector) arg0))) + (atan (-> v1-1 x) (-> v1-1 y)) + ) + ) + +;; definition for function quaternion-vector-y-angle +(defun quaternion-vector-y-angle ((arg0 quaternion) (arg1 vector)) + (let ((f30-0 (quaternion-y-angle arg0)) + (f0-2 (atan (-> arg1 x) (-> arg1 z))) + ) + (deg-diff f30-0 f0-2) + ) + ) + +;; definition for function quaternion-rotate-local-x! +;; INFO: Used lq/sq +(defun quaternion-rotate-local-x! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :x 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) + ) + ) + +;; definition for function quaternion-rotate-local-y! +;; INFO: Used lq/sq +(defun quaternion-rotate-local-y! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :y 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) + ) + ) + +;; definition for function quaternion-rotate-local-z! +;; INFO: Used lq/sq +(defun quaternion-rotate-local-z! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((a2-1 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :z 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 arg1 a2-1)) + ) + ) + +;; definition for function quaternion-rotate-y! +;; INFO: Used lq/sq +(defun quaternion-rotate-y! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((a1-2 (quaternion-vector-angle! (new-stack-quaternion0) (new 'static 'vector :y 1.0 :w 1.0) arg2))) + (quaternion-normalize! (quaternion*! arg0 a1-2 arg1)) + ) + ) + +;; definition for function quaternion-rotate-x! +;; INFO: Used lq/sq +(defun quaternion-rotate-x! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((a1-3 (quaternion-vector-angle! (new-stack-quaternion0) (vector-x-quaternion! (new-stack-vector0) arg1) arg2)) + ) + (quaternion-normalize! (quaternion*! arg0 a1-3 arg1)) + ) + ) + +;; definition for function quaternion-rotate-z! +;; INFO: Used lq/sq +(defun quaternion-rotate-z! ((arg0 quaternion) (arg1 quaternion) (arg2 float)) + (let ((a1-3 (quaternion-vector-angle! (new-stack-quaternion0) (vector-z-quaternion! (new-stack-vector0) arg1) arg2)) + ) + (quaternion-normalize! (quaternion*! arg0 a1-3 arg1)) + ) + ) + +;; definition for function quaternion-delta-y +(defun quaternion-delta-y ((arg0 quaternion) (arg1 quaternion)) + (acos (vector-dot + (vector-z-quaternion! (new 'stack-no-clear 'vector) arg0) + (vector-z-quaternion! (new 'stack-no-clear 'vector) arg1) + ) + ) + ) + +;; definition for function quaternion-rotate-y-to-vector! +(defun quaternion-rotate-y-to-vector! ((arg0 quaternion) (arg1 quaternion) (arg2 quaternion) (arg3 float)) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((t9-0 vector-xz-normalize!) + (a0-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> a0-1 x) (-> arg2 x)) + (set! (-> a0-1 y) 0.0) + (set! (-> a0-1 z) (-> arg2 z)) + (set! (-> a0-1 w) 1.0) + (let ((s0-0 (t9-0 a0-1 1.0))) + (quaternion-from-two-vectors-max-angle! + s5-0 + (vector-z-quaternion! (new 'stack-no-clear 'vector) arg1) + s0-0 + arg3 + ) + ) + ) + (quaternion-normalize! (quaternion*! arg0 s5-0 arg1)) + ) + ) + +;; definition for function vector-rotate-x! +(defun vector-rotate-x! ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :x 1.0 :w 1.0) arg2)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (quaternion->matrix s4-0 a1-2) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +;; definition for function vector-rotate-y! +(defun vector-rotate-y! ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :y 1.0 :w 1.0) arg2)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (quaternion->matrix s4-0 a1-2) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +;; definition for function vector-rotate-z! +(defun vector-rotate-z! ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((a1-2 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) (new 'static 'vector :z 1.0 :w 1.0) arg2)) + (s4-0 (new 'stack-no-clear 'matrix)) + ) + (quaternion->matrix s4-0 a1-2) + (vector-matrix*! arg0 arg1 s4-0) + ) + ) + +;; definition for function vector-y-angle +(defun vector-y-angle ((arg0 vector)) + (atan (-> arg0 x) (-> arg0 z)) + ) + +;; definition for function vector-x-angle +(defun vector-x-angle ((arg0 vector)) + (atan (-> arg0 y) (vector-xz-length arg0)) + ) + +;; definition for function quaternion<-rotate-y-vector +(defun quaternion<-rotate-y-vector ((arg0 quaternion) (arg1 vector)) + (quaternion-vector-angle! arg0 (new 'static 'vector :y 1.0 :w 1.0) (vector-y-angle arg1)) + ) + +;; definition (debug) for function quaternion-validate +;; INFO: Return type mismatch int vs none. +(defun-debug quaternion-validate ((arg0 quaternion)) + (with-pp + (let ((f0-0 (quaternion-norm arg0))) + (when (or (< 1.01 f0-0) (< f0-0 0.99)) + (format #t "WARNING: bad quaternion (magnitude ~F) process is " f0-0) + (if (and pp (type? pp process-tree)) + (format #t "~A~%" (-> pp name)) + (format #t "#f~%") + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for function quaternion-xz-angle +(defun quaternion-xz-angle ((arg0 quaternion)) + (let ((gp-0 (new 'stack-no-clear 'matrix)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (quaternion->matrix gp-0 arg0) + (set-vector! s5-0 0.0 0.0 1.0 1.0) + (vector-matrix*! s5-0 s5-0 gp-0) + (vector-y-angle s5-0) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc b/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc new file mode 100644 index 0000000000..02d251fc66 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/transform-h_REF.gc @@ -0,0 +1,58 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type transform +(deftype transform (structure) + ((trans vector :inline :offset-assert 0) + (rot vector :inline :offset-assert 16) + (scale vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type transform +(defmethod inspect transform ((obj transform)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'transform) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj rot)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; definition of type trs +(deftype trs (basic) + ((trans vector :inline :offset-assert 16) + (rot vector :inline :offset-assert 32) + (scale vector :inline :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type trs +(defmethod inspect trs ((obj trs)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj rot)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/math/transform_REF.gc b/test/decompiler/reference/jak2/engine/math/transform_REF.gc new file mode 100644 index 0000000000..b11fd3565e --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/transform_REF.gc @@ -0,0 +1,70 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 2 of type transform +(defmethod print transform ((obj transform)) + (format #t "# obj trans x) (-> obj trans y) (-> obj trans z) (-> obj trans w)) + (format #t "~T~Trot: ~F ~F ~F ~F ~%" (-> obj rot x) (-> obj rot y) (-> obj rot z) (-> obj rot w)) + (format #t "~T~Tscale:~F ~F ~F ~F>" (-> obj scale x) (-> obj scale y) (-> obj scale z) (-> obj scale w)) + obj + ) + +;; definition for method 0 of type trs +(defmethod new trs ((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 trans w) 1.0) + (set! (-> gp-0 rot w) 1.0) + (vector-identity! (-> gp-0 scale)) + gp-0 + ) + ) + +;; definition for function transform-matrix-calc! +;; INFO: Used lq/sq +(defun transform-matrix-calc! ((arg0 transform) (arg1 matrix)) + (let ((s4-0 (new-stack-matrix0)) + (s3-0 (new-stack-matrix0)) + ) + (matrix-identity! arg1) + (matrix-translate! arg1 (-> arg0 trans)) + (matrix-rotate-y! s4-0 (-> arg0 rot y)) + (matrix*! s3-0 s4-0 arg1) + (matrix-rotate-x! s4-0 (-> arg0 rot x)) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-z! s4-0 (-> arg0 rot z)) + (matrix*! s3-0 s4-0 arg1) + (matrix-scale! s4-0 (-> arg0 scale)) + (matrix*! arg1 s4-0 s3-0) + ) + ) + +;; definition for function transform-matrix-parent-calc! +;; INFO: Used lq/sq +(defun transform-matrix-parent-calc! ((arg0 transform) (arg1 matrix) (arg2 vector)) + (let ((s4-0 (new-stack-matrix0)) + (s3-0 (new-stack-matrix0)) + ) + (matrix-identity! s3-0) + (matrix-translate! s3-0 (-> arg0 trans)) + (matrix-inv-scale! s4-0 arg2) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-y! s4-0 (-> arg0 rot y)) + (matrix*! s3-0 s4-0 arg1) + (matrix-rotate-x! s4-0 (-> arg0 rot x)) + (matrix*! arg1 s4-0 s3-0) + (matrix-rotate-z! s4-0 (-> arg0 rot z)) + (matrix*! s3-0 s4-0 arg1) + (matrix-scale! s4-0 (-> arg0 scale)) + (matrix*! arg1 s4-0 s3-0) + ) + ) + +;; definition for function trs-matrix-calc! +(defun trs-matrix-calc! ((arg0 trs) (arg1 matrix)) + (transform-matrix-calc! (the-as transform (-> arg0 trans)) arg1) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc b/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc new file mode 100644 index 0000000000..d44e3ef74a --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/transformq-h_REF.gc @@ -0,0 +1,127 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type transformq +(deftype transformq (transform) + ((quat quaternion :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type transformq +(defmethod inspect transformq ((obj transformq)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'transformq) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "~1Tquat: #~%" (-> obj quat)) + (label cfg-4) + obj + ) + +;; definition of type trsq +(deftype trsq (trs) + ((quat quaternion :inline :offset 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type trsq +(defmethod inspect trsq ((obj trsq)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "~1Tquat: #~%" (-> obj quat)) + (label cfg-4) + obj + ) + +;; definition of type trsqv +(deftype trsqv (trsq) + ((pause-adjust-distance meters :offset 4) + (nav-radius meters :offset 8) + (transv vector :inline :offset-assert 64) + (rotv vector :inline :offset-assert 80) + (scalev vector :inline :offset-assert 96) + (dir-targ quaternion :inline :offset-assert 112) + (angle-change-time time-frame :offset-assert 128) + (old-y-angle-diff float :offset-assert 136) + ) + :method-count-assert 28 + :size-assert #x8c + :flag-assert #x1c0000008c + (:methods + (seek-toward-heading-vec! (_type_ vector float time-frame) quaternion 9) + (set-heading-vec! (_type_ vector) quaternion 10) + (seek-to-point-toward-point! (_type_ vector float time-frame) quaternion 11) + (point-toward-point! (_type_ vector) quaternion 12) + (seek-toward-yaw-angle! (_type_ float float time-frame) quaternion 13) + (set-yaw-angle-clear-roll-pitch! (_type_ float) quaternion 14) + (set-roll-to-grav! (_type_ float) quaternion 15) + (set-roll-to-grav-2! (_type_ float) quaternion 16) + (rotate-toward-orientation! (_type_ quaternion float float) quaternion 17) + (set-quaternion! (_type_ quaternion) quaternion 18) + (set-heading-vec-clear-roll-pitch! (_type_ vector) quaternion 19) + (point-toward-point-clear-roll-pitch! (_type_ vector) quaternion 20) + (rot->dir-targ! (_type_) quaternion 21) + (y-angle (_type_) float 22) + (global-y-angle-to-point (_type_ vector) float 23) + (relative-y-angle-to-point (_type_ vector) float 24) + (roll-relative-to-gravity (_type_) float 25) + (set-and-limit-velocity (_type_ int vector float) trsqv 26) + (get-quaternion (_type_) quaternion 27) + ) + ) + +;; definition for method 3 of type trsqv +(defmethod inspect trsqv ((obj trsqv)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Trot: ~`vector`P~%" (-> obj quat)) + (format #t "~1Tscale: ~`vector`P~%" (-> obj scale)) + (format #t "~1Tquat: #~%" (-> obj quat)) + (format #t "~1Tpause-adjust-distance: (meters ~m)~%" (-> obj pause-adjust-distance)) + (format #t "~1Tnav-radius: (meters ~m)~%" (-> obj nav-radius)) + (format #t "~1Ttransv: ~`vector`P~%" (-> obj transv)) + (format #t "~1Trotv: ~`vector`P~%" (-> obj rotv)) + (format #t "~1Tscalev: ~`vector`P~%" (-> obj scalev)) + (format #t "~1Tdir-targ: #~%" (-> obj dir-targ)) + (format #t "~1Tangle-change-time: ~D~%" (-> obj angle-change-time)) + (format #t "~1Told-y-angle-diff: ~f~%" (-> obj old-y-angle-diff)) + (label cfg-4) + obj + ) + +;; definition for method 23 of type trsqv +(defmethod global-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) + (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans))) + ) + +;; definition for method 24 of type trsqv +(defmethod relative-y-angle-to-point trsqv ((obj trsqv) (arg0 vector)) + (deg-diff (y-angle obj) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) arg0 (-> obj trans)))) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/math/trigonometry-h_REF.gc b/test/decompiler/reference/jak2/engine/math/trigonometry-h_REF.gc new file mode 100644 index 0000000000..8e4b1f21d4 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/trigonometry-h_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc b/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc new file mode 100644 index 0000000000..f375bc91ea --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/trigonometry_REF.gc @@ -0,0 +1,616 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function radmod +(defun radmod ((arg0 float)) + (let ((f0-1 (+ 3.1415925 arg0))) + (if (< 0.0 f0-1) + (+ -3.1415925 (- f0-1 (* (the float (the int (/ f0-1 6.283185))) 6.283185))) + (+ 3.1415925 (- f0-1 (* (the float (the int (/ f0-1 6.283185))) 6.283185))) + ) + ) + ) + +;; definition for function deg- +(defun deg- ((arg0 float) (arg1 float)) + (the float (sar (- (shl (the int arg0) 48) (shl (the int arg1) 48)) 48)) + ) + +;; definition for function deg-diff +(defun deg-diff ((arg0 float) (arg1 float)) + (the float (sar (- (shl (the int arg1) 48) (shl (the int arg0) 48)) 48)) + ) + +;; definition for function deg-seek +(defun deg-seek ((arg0 float) (arg1 float) (arg2 float)) + (let ((v1-1 (shl (the int arg0) 48)) + (a0-2 (shl (the int arg1) 48)) + ) + (let* ((a1-2 (shl (the int arg2) 48)) (a2-1 (- a0-2 v1-1)) (a3-0 (abs a2-1))) (set! a0-2 (cond + ((< a3-0 0) + (+ v1-1 a1-2) + ) + ((>= a1-2 a3-0) + (empty) + a0-2 + ) + ((>= a2-1 0) + (+ v1-1 a1-2) + ) + (else + (- v1-1 a1-2) + ) + ) + ) + ) + (the float (sar a0-2 48)) + ) + ) + +;; definition for function deg-seek-smooth +(defun deg-seek-smooth ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((f0-1 (* (deg- arg1 arg0) arg3))) + (if (< arg2 (fabs f0-1)) + (set! f0-1 (if (>= f0-1 0.0) + arg2 + (- arg2) + ) + ) + ) + (+ arg0 f0-1) + ) + ) + +;; definition for function deg-lerp-clamp +(defun deg-lerp-clamp ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (the float (sar (shl (the int (+ arg0 (* arg2 (deg-diff arg0 arg1)))) 48) 48)) + ) + ) + ) + +;; definition for symbol binary-table, type (array float) +(define binary-table (the-as (array float) (new 'static 'boxed-array :type float + 1.0 + 0.5 + 0.25 + 0.125 + 0.0625 + 0.03125 + 0.015625 + 0.0078125 + 0.00390625 + 0.001953125 + 0.0009765625 + 0.00048828125 + 0.00024414062 + 0.00012207031 + 0.000061035156 + 0.000030517578 + 0.000015258789 + 0.0000076293945 + 0.0000038146973 + 0.0000019073486 + 0.0000009536743 + 0.00000047683716 + 0.00000023841858 + 0.00000011920929 + 0.000000059604645 + 0.000000029802322 + 0.000000014901161 + 0.000000007450581 + 0.0000000037252903 + 0.0000000018626451 + 0.0000000009313226 + 0.0000000004656613 + ) + ) + ) + +;; definition for symbol sincos-table, type (array float) +(define sincos-table (the-as (array float) (new 'static 'boxed-array :type float + 0.7853982 + 0.4636476 + 0.24497867 + 0.124354996 + 0.06241881 + 0.031239834 + 0.015623729 + 0.007812341 + 0.0039062302 + 0.0019531226 + 0.0009765622 + 0.0004882812 + 0.00024414062 + 0.00012207031 + 0.000061035156 + 0.000030517578 + 0.000015258789 + 0.0000076293945 + 0.0000038146973 + 0.0000019073486 + 0.0000009536743 + 0.00000047683716 + 0.00000023841858 + 0.00000011920929 + 0.000000059604645 + 0.000000029802322 + 0.000000014901161 + 0.000000007450581 + 0.0000000037252903 + 0.0000000018626451 + 0.0000000009313226 + 0.0000000004656613 + ) + ) + ) + +;; definition for function sin +(defun sin ((arg0 float)) + (let ((f2-0 (* 0.000095873795 (the float (sar (shl (the int arg0) 48) 48))))) + f2-0 + (let* ((f1-4 (* 0.999998 f2-0)) + (f0-3 (* f2-0 f2-0)) + (f2-1 (* f2-0 f0-3)) + (f1-5 (+ f1-4 (* -0.16666014 f2-1))) + (f2-2 (* f2-1 f0-3)) + (f1-6 (+ f1-5 (* 0.008326521 f2-2))) + (f2-3 (* f2-2 f0-3)) + (f1-7 (+ f1-6 (* -0.0001956241 f2-3))) + (f0-4 (* f2-3 f0-3)) + ) + (+ f1-7 (* 0.0000023042373 f0-4)) + ) + ) + ) + +;; definition for function sin-rad +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for symbol *sin-poly-vec*, type vector +(define *sin-poly-vec* + (new 'static 'vector :x -0.16666014 :y 0.008326521 :z -0.0001956241 :w 0.0000023042373) + ) + +;; definition for symbol *sin-poly-vec2*, type vector +(define *sin-poly-vec2* (new 'static 'vector :x 0.999998)) + +;; definition for function vector-sin-rad! +(defun vector-sin-rad! ((arg0 vector) (arg1 vector)) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.mul.vf vf3 vf1 vf1) + (.lvf vf10 (&-> *sin-poly-vec2* quad)) + (.lvf vf9 (&-> *sin-poly-vec* quad)) + (.mul.vf vf4 vf3 vf1) + (.mul.vf vf5 vf3 vf3) + (.mul.x.vf acc vf1 vf10) + (.mul.vf vf6 vf4 vf3) + (.mul.vf vf7 vf5 vf4) + (.add.mul.x.vf acc vf4 vf9 acc) + (.mul.vf vf8 vf6 vf5) + (.add.mul.y.vf acc vf6 vf9 acc) + (.add.mul.z.vf acc vf7 vf9 acc) + (.add.mul.w.vf vf2 vf8 vf9 acc) + (.svf (&-> arg0 quad) vf2) + arg0 + ) + ) + +;; definition for function cos-rad +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for symbol *cos-poly-vec*, type vector +(define *cos-poly-vec* (new 'static 'vector :x -0.49998003 :y 0.041620404 :z -0.0013636408 :w 0.000020170546)) + +;; definition for function vector-cos-rad! +;; ERROR: Bad vector register dependency: vf2 +(defun vector-cos-rad! ((arg0 vector) (arg1 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.sub.vf vf2 vf2 vf2) + (.lvf vf9 (&-> *cos-poly-vec* quad)) + (.mul.vf vf3 vf1 vf1) + (.add.w.vf acc vf2 vf0) + (.mul.vf vf4 vf3 vf3) + (.add.mul.x.vf acc vf3 vf9 acc) + (.mul.vf vf5 vf4 vf3) + (.add.mul.y.vf acc vf4 vf9 acc) + (.mul.vf vf6 vf4 vf4) + (.add.mul.z.vf acc vf5 vf9 acc) + (.add.mul.w.vf vf2 vf6 vf9 acc) + (.svf (&-> arg0 quad) vf2) + arg0 + ) + ) + +;; definition for function vector-sincos-rad! +;; ERROR: Bad vector register dependency: vf14 +(defun vector-sincos-rad! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :class vf) + (vf13 :class vf) + (vf14 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + (vf8 :class vf) + (vf9 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg2 quad)) + (.sub.vf vf14 vf14 vf14) + (.lvf vf11 (&-> *sin-poly-vec2* quad)) + (.mul.vf vf2 vf1 vf1) + (.lvf vf10 (&-> *sin-poly-vec* quad)) + (.lvf vf13 (&-> *cos-poly-vec* quad)) + (.mul.x.vf acc vf1 vf11) + (.mul.vf vf3 vf2 vf1) + (.mul.vf vf4 vf2 vf2) + (.mul.vf vf5 vf3 vf2) + (.mul.vf vf6 vf3 vf3) + (.mul.vf vf7 vf4 vf3) + (.mul.vf vf8 vf4 vf4) + (.mul.vf vf9 vf5 vf4) + (.add.mul.x.vf acc vf3 vf10 acc) + (.add.mul.y.vf acc vf5 vf10 acc) + (.add.mul.z.vf acc vf7 vf10 acc) + (.add.mul.w.vf vf12 vf9 vf10 acc) + (.add.w.vf acc vf14 vf0) + (.add.mul.x.vf acc vf2 vf13 acc) + (.add.mul.y.vf acc vf4 vf13 acc) + (.add.mul.z.vf acc vf6 vf13 acc) + (.add.mul.w.vf vf14 vf8 vf13 acc) + (.svf (&-> arg0 quad) vf12) + (.svf (&-> arg1 quad) vf14) + 0 + ) + ) + +;; definition for function sincos-rad! +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function sincos! +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function vector-rad<-vector-deg! +;; INFO: Return type mismatch float vs none. +(defun vector-rad<-vector-deg! ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-0 #x38c90fda)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.mov vf2 v1-0) + ) + (.mov v1-1 vf1) + (.pw.sll v1-2 v1-1 16) + (.pw.sra v1-3 v1-2 16) + (.mov vf1 v1-3) + (.itof.vf vf1 vf1) + (.mul.x.vf vf1 vf1 vf2) + (.svf (&-> arg0 quad) vf1) + (.mov v0-0 vf1) + (none) + ) + ) + +;; definition for function vector-rad<-vector-deg/2! +;; INFO: Return type mismatch float vs int. +(defun vector-rad<-vector-deg/2! ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float) (v1-1 uint128) (v1-2 uint128) (v1-3 uint128)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-0 #x38c90fda)) + (let ((a2-0 #x3f000000)) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf2 a2-0) + ) + (.mul.x.vf vf1 vf1 vf2) + (.ftoi.vf vf1 vf1) + (.mov vf2 v1-0) + ) + (.mov v1-1 vf1) + (.pw.sll v1-2 v1-1 16) + (.pw.sra v1-3 v1-2 16) + (.mov vf1 v1-3) + (.itof.vf vf1 vf1) + (.mul.x.vf vf1 vf1 vf2) + (.svf (&-> arg0 quad) vf1) + (.mov v0-0 vf1) + (the-as int v0-0) + ) + ) + +;; definition for function vector-sincos! +(defun vector-sincos! ((arg0 vector) (arg1 vector) (arg2 vector)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-rad<-vector-deg! s4-0 arg2) + (vector-sincos-rad! arg0 arg1 s4-0) + ) + ) + +;; definition for function tan-rad +(defun tan-rad ((arg0 float)) + (/ (sin arg0) (cos arg0)) + ) + +;; definition for function cos +(defun cos ((arg0 float)) + (sin (+ 16384.0 arg0)) + ) + +;; definition for function tan +(defun tan ((arg0 float)) + (/ (sin arg0) (cos arg0)) + ) + +;; definition for function atan0 +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function atan-series-rad +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function atan-rad +(defun atan-rad ((arg0 float)) + (atan-series-rad (/ (+ -1.0 arg0) (+ 1.0 arg0))) + ) + +;; definition for function sign-bit +(defun sign-bit ((arg0 int)) + (local-vars (v1-1 int)) + (let ((v1-0 arg0)) + (shift-arith-right-32 v1-1 v1-0 31) + ) + (logand v1-1 1) + ) + +;; definition for function sign-float +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function sign +(defun sign ((arg0 float)) + (cond + ((< 0.0 arg0) + 1.0 + ) + ((< arg0 0.0) + -1.0 + ) + (else + 0.0 + ) + ) + ) + +;; definition for function atan2-rad +(defun atan2-rad ((arg0 float) (arg1 float)) + (cond + ((= arg1 0.0) + (* 1.5707963 (sign arg0)) + ) + ((and (< arg0 0.0) (< arg1 0.0)) + (let ((f30-1 -3.1415925) + (f0-6 (/ arg0 arg1)) + ) + (+ f30-1 (atan-series-rad (/ (+ -1.0 f0-6) (+ 1.0 f0-6)))) + ) + ) + ((< arg0 0.0) + (let ((f0-14 (- (/ arg0 arg1)))) + (- (atan-series-rad (/ (+ -1.0 f0-14) (+ 1.0 f0-14)))) + ) + ) + ((< arg1 0.0) + (let ((f30-2 3.1415925) + (f0-22 (- (/ arg0 arg1))) + ) + (- f30-2 (atan-series-rad (/ (+ -1.0 f0-22) (+ 1.0 f0-22)))) + ) + ) + (else + (let ((f0-28 (/ arg0 arg1))) + (atan-series-rad (/ (+ -1.0 f0-28) (+ 1.0 f0-28))) + ) + ) + ) + ) + +;; definition for function atan +(defun atan ((arg0 float) (arg1 float)) + (cond + ((and (= arg1 0.0) (= arg0 0.0)) + 0.0 + ) + ((and (< arg1 0.0) (< arg0 0.0)) + (+ -32768.0 (atan0 (- arg0) (- arg1))) + ) + ((< arg0 0.0) + (- (atan0 (- arg0) arg1)) + ) + ((< arg1 0.0) + (- 32768.0 (atan0 arg0 (- arg1))) + ) + (else + (atan0 arg0 arg1) + ) + ) + ) + +;; definition for function asin +(defun asin ((arg0 float)) + (let ((gp-0 #f)) + 0.0 + (when (< arg0 0.0) + (set! arg0 (- arg0)) + (set! gp-0 #t) + ) + (let ((f0-5 (cond + ((< 1.0 arg0) + 16383.996 + ) + (else + (let* ((f0-6 1.0) (f1-2 arg0) (f0-8 (sqrtf (- f0-6 (* f1-2 f1-2))))) (atan0 arg0 f0-8)) + ) + ) + ) + ) + (if gp-0 + (- f0-5) + f0-5 + ) + ) + ) + ) + +;; definition for function acos +(defun acos ((arg0 float)) + (- 16384.0 (asin arg0)) + ) + +;; definition for function acos-rad +(defun acos-rad ((arg0 float)) + (cond + ((>= arg0 0.0) + (let* ((f0-1 1.0) + (f1-1 arg0) + (f0-3 (sqrtf (- f0-1 (* f1-1 f1-1)))) + (f0-5 (/ (- f0-3 arg0) (+ f0-3 arg0))) + ) + (atan-series-rad f0-5) + ) + ) + (else + (let* ((f0-6 1.0) + (f1-6 arg0) + (f0-8 (sqrtf (- f0-6 (* f1-6 f1-6)))) + (f0-10 (/ (+ f0-8 arg0) (- f0-8 arg0))) + ) + (- 3.1415925 (atan-series-rad f0-10)) + ) + ) + ) + ) + +;; definition for function sinerp +(defun sinerp ((arg0 float) (arg1 float) (arg2 float)) + (lerp arg0 arg1 (sin (* 16384.0 arg2))) + ) + +;; definition for function sinerp-clamp +(defun sinerp-clamp ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (sinerp arg0 arg1 arg2) + ) + ) + ) + +;; definition for function coserp +(defun coserp ((arg0 float) (arg1 float) (arg2 float)) + (lerp arg0 arg1 (- 1.0 (cos (* 16384.0 arg2)))) + ) + +;; definition for function coserp-clamp +(defun coserp-clamp ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (coserp arg0 arg1 arg2) + ) + ) + ) + +;; definition for function coserp180 +(defun coserp180 ((arg0 float) (arg1 float) (arg2 float)) + (lerp arg0 arg1 (* 0.5 (- 1.0 (cos (* 32768.0 arg2))))) + ) + +;; definition for function coserp180-clamp +(defun coserp180-clamp ((arg0 float) (arg1 float) (arg2 float)) + (cond + ((>= 0.0 arg2) + arg0 + ) + ((>= arg2 1.0) + arg1 + ) + (else + (coserp180 arg0 arg1 arg2) + ) + ) + ) + +;; definition for function ease-in-out +(defun ease-in-out ((arg0 int) (arg1 int)) + (local-vars (v1-0 int)) + (cond + ((>= arg1 arg0) + 1.0 + ) + ((<= arg1 0) + 0.0 + ) + ((begin (set! v1-0 (/ arg0 2)) (< v1-0 arg1)) + (let ((a0-1 (- arg1 arg0))) + (+ 0.5 (* 0.5 (sin (- 16384.0 (/ (* 16384.0 (the float a0-1)) (the float v1-0)))))) + ) + ) + (else + (- 0.5 (* 0.5 (cos (/ (* 16384.0 (the float arg1)) (the float v1-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 new file mode 100644 index 0000000000..f82cd70622 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/vector-h_REF.gc @@ -0,0 +1,1181 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bit-array +(deftype bit-array (basic) + ((length int32 :offset-assert 4) + (allocated-length int32 :offset-assert 8) + (_pad uint8 :offset-assert 12) + (bytes uint8 :dynamic :offset 12) + ) + :method-count-assert 13 + :size-assert #xd + :flag-assert #xd0000000d + (:methods + (new (symbol type int) _type_ 0) + (get-bit (_type_ int) symbol 9) + (clear-bit (_type_ int) int 10) + (set-bit (_type_ int) int 11) + (clear-all! (_type_) _type_ 12) + ) + ) + +;; definition for method 3 of type bit-array +(defmethod inspect bit-array ((obj bit-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)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type bit-array +(defmethod new bit-array ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((v0-0 (object-new allocation type-to-make (+ (/ (logand -8 (+ arg0 7)) 8) -1 (-> type-to-make size))))) + (set! (-> v0-0 length) arg0) + (set! (-> v0-0 allocated-length) arg0) + v0-0 + ) + ) + +;; definition for method 4 of type bit-array +(defmethod length bit-array ((obj bit-array)) + (-> obj length) + ) + +;; definition for method 5 of type bit-array +;; INFO: Return type mismatch uint vs int. +(defmethod asize-of bit-array ((obj bit-array)) + (the-as int (+ (-> obj type size) (/ (logand -8 (+ (-> obj allocated-length) 7)) 8))) + ) + +;; definition for method 9 of type bit-array +(defmethod get-bit bit-array ((obj bit-array) (arg0 int)) + (let ((v1-2 (-> obj bytes (/ arg0 8)))) + (logtest? v1-2 (ash 1 (logand arg0 7))) + ) + ) + +;; definition for method 10 of type bit-array +(defmethod clear-bit bit-array ((obj bit-array) (arg0 int)) + (logclear! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) + 0 + ) + +;; definition for method 11 of type bit-array +(defmethod set-bit bit-array ((obj bit-array) (arg0 int)) + (logior! (-> obj bytes (/ arg0 8)) (ash 1 (logand arg0 7))) + 0 + ) + +;; definition for method 12 of type bit-array +(defmethod clear-all! bit-array ((obj bit-array)) + (countdown (v1-2 (/ (logand -8 (+ (-> obj allocated-length) 7)) 8)) + (nop!) + (nop!) + (set! (-> obj bytes v1-2) (the-as uint 0)) + ) + obj + ) + +;; definition of type vector16ub +(deftype vector16ub (structure) + ((data uint8 16 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vector16ub +;; INFO: Used lq/sq +(defmethod inspect vector16ub ((obj vector16ub)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector16ub) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type vector4ub +(deftype vector4ub (structure) + ((data uint8 4 :offset-assert 0) + (x uint8 :offset 0) + (y uint8 :offset 1) + (z uint8 :offset 2) + (w uint8 :offset 3) + (clr uint32 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type vector4ub +(defmethod inspect vector4ub ((obj vector4ub)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4ub) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Tclr: ~D~%" (-> obj clr)) + (label cfg-4) + obj + ) + +;; definition of type vector4b +(deftype vector4b (structure) + ((data int8 4 :offset-assert 0) + (x int8 :offset 0) + (y int8 :offset 1) + (z int8 :offset 2) + (w int8 :offset 3) + (clr int32 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type vector4b +(defmethod inspect vector4b ((obj vector4b)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4b) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Tclr: ~D~%" (-> obj clr)) + (label cfg-4) + obj + ) + +;; definition of type vector2ub +(deftype vector2ub (structure) + ((data uint8 2 :offset-assert 0) + (x uint8 :offset 0) + (y uint8 :offset 1) + (clr uint16 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition for method 3 of type vector2ub +(defmethod inspect vector2ub ((obj vector2ub)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector2ub) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tclr: ~D~%" (-> obj clr)) + (label cfg-4) + obj + ) + +;; definition of type vector2b +(deftype vector2b (structure) + ((data int8 2 :offset-assert 0) + (x int8 :offset 0) + (y int8 :offset 1) + (clr int16 :offset 0) + ) + :method-count-assert 9 + :size-assert #x2 + :flag-assert #x900000002 + ) + +;; definition for method 3 of type vector2b +(defmethod inspect vector2b ((obj vector2b)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector2b) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tclr: ~D~%" (-> obj clr)) + (label cfg-4) + obj + ) + +;; definition of type vector2h +(deftype vector2h (structure) + ((data int16 2 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type vector2h +(defmethod inspect vector2h ((obj vector2h)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector2h) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (label cfg-4) + obj + ) + +;; definition of type vector2uh +(deftype vector2uh (structure) + ((data uint16 2 :offset-assert 0) + (x uint16 :offset 0) + (y uint16 :offset 2) + (val uint32 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type vector2uh +(defmethod inspect vector2uh ((obj vector2uh)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector2uh) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tval: ~D~%" (-> obj val)) + (label cfg-4) + obj + ) + +;; definition of type vector3h +(deftype vector3h (structure) + ((data int16 3 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; definition for method 3 of type vector3h +(defmethod inspect vector3h ((obj vector3h)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector3h) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (label cfg-4) + obj + ) + +;; definition of type vector3uh +(deftype vector3uh (structure) + ((data uint16 3 :offset-assert 0) + (x uint16 :offset 0) + (y uint16 :offset 2) + (z uint16 :offset 4) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; definition for method 3 of type vector3uh +(defmethod inspect vector3uh ((obj vector3uh)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector3uh) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (label cfg-4) + obj + ) + +;; definition of type vector2w +(deftype vector2w (structure) + ((data int32 2 :offset-assert 0) + (x int32 :offset 0) + (y int32 :offset 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type vector2w +(defmethod inspect vector2w ((obj vector2w)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector2w) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (label cfg-4) + obj + ) + +;; definition of type vector3w +(deftype vector3w (structure) + ((data int32 3 :offset-assert 0) + (x int32 :offset 0) + (y int32 :offset 4) + (z int32 :offset 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type vector3w +(defmethod inspect vector3w ((obj vector3w)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector3w) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (label cfg-4) + obj + ) + +;; definition of type vector4w +(deftype vector4w (structure) + ((data uint32 4 :offset-assert 0) + (x int32 :offset 0) + (y int32 :offset 4) + (z int32 :offset 8) + (w int32 :offset 12) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vector4w +;; INFO: Used lq/sq +(defmethod inspect vector4w ((obj vector4w)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4w) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Tdword[2] @ #x~X~%" (&-> obj x)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type vector2 +(deftype vector2 (structure) + ((data float 2 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type vector2 +(defmethod inspect vector2 ((obj vector2)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector2) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~f~%" (-> obj x)) + (format #t "~1Ty: ~f~%" (-> obj y)) + (label cfg-4) + obj + ) + +;; definition of type vector3 +(deftype vector3 (structure) + ((data float 3 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type vector3 +(defmethod inspect vector3 ((obj vector3)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector3) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~f~%" (-> obj x)) + (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "~1Tz: ~f~%" (-> obj z)) + (label cfg-4) + obj + ) + +;; definition of type vector4 +(deftype vector4 (structure) + ((data float 4 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + (w float :offset 12) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vector4 +;; INFO: Used lq/sq +(defmethod inspect vector4 ((obj vector4)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (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 "~1Tdword[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition for method 2 of type vector4w +(defmethod print vector4w ((obj vector4w)) + (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) + obj + ) + +;; definition of type vector4w-2 +(deftype vector4w-2 (structure) + ((data int32 8 :offset-assert 0) + (quad uint128 2 :offset 0) + (vector vector4w 2 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type vector4w-2 +(defmethod inspect vector4w-2 ((obj vector4w-2)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4w-2) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[2] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type vector4w-3 +(deftype vector4w-3 (structure) + ((data int32 12 :offset-assert 0) + (quad uint128 3 :offset 0) + (vector vector4w 3 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type vector4w-3 +(defmethod inspect vector4w-3 ((obj vector4w-3)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4w-3) + (format #t "~1Tdata[12] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[3] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type vector4w-4 +(deftype vector4w-4 (structure) + ((data int32 16 :offset-assert 0) + (quad uint128 4 :offset 0) + (vector vector4w 4 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type vector4w-4 +(defmethod inspect vector4w-4 ((obj vector4w-4)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4w-4) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type vector4h +(deftype vector4h (structure) + ((data int16 4 :offset-assert 0) + (x int16 :offset 0) + (y int16 :offset 2) + (z int16 :offset 4) + (w int16 :offset 6) + (long uint64 :offset 0) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type vector4h +(defmethod inspect vector4h ((obj vector4h)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4h) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Ty: ~D~%" (-> obj y)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tw: ~D~%" (-> obj w)) + (format #t "~1Tlong: ~D~%" (-> obj long)) + (label cfg-4) + obj + ) + +;; definition of type vector8h +(deftype vector8h (structure) + ((data int16 8 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vector8h +;; INFO: Used lq/sq +(defmethod inspect vector8h ((obj vector8h)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector8h) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type vector16b +(deftype vector16b (structure) + ((data int8 16 :offset-assert 0) + (quad uint128 :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vector16b +;; INFO: Used lq/sq +(defmethod inspect vector16b ((obj vector16b)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector16b) + (format #t "~1Tdata[16] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition for method 3 of type vector +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect vector ((obj vector)) + (format #t "[~8x] vector~%" obj) + (format #t "~T[~F] [~F] [~F] [~F]~%" (-> obj x) (-> obj y) (-> obj z) (-> obj w)) + obj + ) + +;; definition for method 2 of type vector +(defmethod print vector ((obj vector)) + (format #t "#" (-> obj x) (-> obj y) (-> obj z) (-> obj w) obj) + obj + ) + +;; definition for symbol *null-vector*, type vector +(define *null-vector* (new 'static 'vector :w 1.0)) + +;; definition for symbol *identity-vector*, type vector +(define *identity-vector* (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)) + +;; definition for symbol *x-vector*, type vector +(define *x-vector* (new 'static 'vector :x 1.0 :w 1.0)) + +;; definition for symbol *y-vector*, type vector +(define *y-vector* (new 'static 'vector :y 1.0 :w 1.0)) + +;; definition for symbol *z-vector*, type vector +(define *z-vector* (new 'static 'vector :z 1.0 :w 1.0)) + +;; definition for symbol *up-vector*, type vector +(define *up-vector* (new 'static 'vector :y 1.0 :w 1.0)) + +;; definition of type vector4s-3 +(deftype vector4s-3 (structure) + ((data float 12 :offset-assert 0) + (quad uint128 3 :offset 0) + (vector vector 3 :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type vector4s-3 +(defmethod inspect vector4s-3 ((obj vector4s-3)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector4s-3) + (format #t "~1Tdata[12] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[3] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type vector-array +(deftype vector-array (inline-array-class) + ((data vector :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vector-array +(defmethod inspect vector-array ((obj vector-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! (-> vector-array heap-base) (the-as uint 16)) + +;; definition of type rgbaf +(deftype rgbaf (vector) + ((r float :offset 0) + (g float :offset 4) + (b float :offset 8) + (a float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type rgbaf +;; INFO: Used lq/sq +(defmethod inspect rgbaf ((obj rgbaf)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'rgbaf) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tr: ~f~%" (-> obj x)) + (format #t "~1Tg: ~f~%" (-> obj y)) + (format #t "~1Tb: ~f~%" (-> obj z)) + (format #t "~1Ta: ~f~%" (-> obj w)) + (label cfg-4) + obj + ) + +;; definition of type plane +(deftype plane (vector) + ((a float :offset 0) + (b float :offset 4) + (c float :offset 8) + (d float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type plane +;; INFO: Used lq/sq +(defmethod inspect plane ((obj plane)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'plane) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Ta: ~f~%" (-> obj x)) + (format #t "~1Tb: ~f~%" (-> obj y)) + (format #t "~1Tc: ~f~%" (-> obj z)) + (format #t "~1Td: ~f~%" (-> obj w)) + (label cfg-4) + obj + ) + +;; definition of type sphere +(deftype sphere (vector) + ((r float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type sphere +;; INFO: Used lq/sq +(defmethod inspect sphere ((obj sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sphere) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tr: ~f~%" (-> obj w)) + (label cfg-4) + obj + ) + +;; definition of type isphere +(deftype isphere (vec4s) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition of type box8s +(deftype box8s (structure) + ((data float 8 :offset-assert 0) + (quad uint128 2 :offset 0) + (vector vector 2 :offset 0) + (min vector :inline :offset 0) + (max vector :inline :offset 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type box8s +(defmethod inspect box8s ((obj box8s)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'box8s) + (format #t "~1Tdata[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tvector[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tmin: #~%" (-> obj data)) + (format #t "~1Tmax: #~%" (-> obj max)) + (label cfg-4) + obj + ) + +;; definition of type box8s-array +(deftype box8s-array (inline-array-class) + ((data box8s :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type box8s-array +(defmethod inspect box8s-array ((obj box8s-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! (-> box8s-array heap-base) (the-as uint 32)) + +;; definition of type cylinder +(deftype cylinder (structure) + ((origin vector :inline :offset-assert 0) + (axis vector :inline :offset-assert 16) + (radius float :offset-assert 32) + (length float :offset-assert 36) + ) + :method-count-assert 11 + :size-assert #x28 + :flag-assert #xb00000028 + (:methods + (debug-draw (_type_ vector4w) none 9) + (ray-capsule-intersect (_type_ vector vector) float 10) + ) + ) + +;; definition for method 3 of type cylinder +(defmethod inspect cylinder ((obj cylinder)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cylinder) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Taxis: #~%" (-> obj axis)) + (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "~1Tlength: ~f~%" (-> obj length)) + (label cfg-4) + obj + ) + +;; definition of type cylinder-flat +(deftype cylinder-flat (structure) + ((origin vector :inline :offset-assert 0) + (axis vector :inline :offset-assert 16) + (radius float :offset-assert 32) + (length float :offset-assert 36) + ) + :method-count-assert 11 + :size-assert #x28 + :flag-assert #xb00000028 + (:methods + (debug-draw (_type_ vector4w) none 9) + (ray-flat-cyl-intersect (_type_ vector vector) float 10) + ) + ) + +;; definition for method 3 of type cylinder-flat +(defmethod inspect cylinder-flat ((obj cylinder-flat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cylinder-flat) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Taxis: #~%" (-> obj axis)) + (format #t "~1Tradius: ~f~%" (-> obj radius)) + (format #t "~1Tlength: ~f~%" (-> obj length)) + (label cfg-4) + obj + ) + +;; definition of type vertical-planes +(deftype vertical-planes (structure) + ((data uint128 4 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type vertical-planes +(defmethod inspect vertical-planes ((obj vertical-planes)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vertical-planes) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type vertical-planes-array +(deftype vertical-planes-array (basic) + ((length uint32 :offset-assert 4) + (data vertical-planes :inline :dynamic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type vertical-planes-array +(defmethod inspect vertical-planes-array ((obj vertical-planes-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 "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type qword +(deftype qword (structure) + ((data uint32 4 :offset-assert 0) + (byte uint8 16 :offset 0) + (hword uint16 8 :offset 0) + (word uint32 4 :offset 0) + (dword uint64 2 :offset 0) + (quad uint128 :offset 0) + (vector vector :inline :offset 0) + (vector4w vector4w :inline :offset 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type qword +;; INFO: Used lq/sq +(defmethod inspect qword ((obj qword)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'qword) + (format #t "~1Tdata[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tbyte[16] @ #x~X~%" (-> obj data)) + (format #t "~1Thword[8] @ #x~X~%" (-> obj data)) + (format #t "~1Tword[4] @ #x~X~%" (-> obj data)) + (format #t "~1Tdword[2] @ #x~X~%" (-> obj data)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tvector: #~%" (-> obj data)) + (format #t "~1Tvector4w: #~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type vector3s +(deftype vector3s (structure) + ((data float 3 :offset-assert 0) + (x float :offset 0) + (y float :offset 4) + (z float :offset 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type vector3s +(defmethod inspect vector3s ((obj vector3s)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vector3s) + (format #t "~1Tdata[3] @ #x~X~%" (-> obj data)) + (format #t "~1Tx: ~f~%" (-> obj x)) + (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "~1Tz: ~f~%" (-> obj z)) + (label cfg-4) + obj + ) + +;; definition for function vector-dot +(defun vector-dot ((arg0 vector) (arg1 vector)) + (vector-dot arg0 arg1) + ) + +;; definition for function vector-dot-vu +(defun vector-dot-vu ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector4-dot +(defun vector4-dot ((arg0 vector) (arg1 vector)) + (vector4-dot arg0 arg1) + ) + +;; definition for function vector4-dot-vu +(defun vector4-dot-vu ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.w.vf vf3 vf0 vf0 :mask #b1) + (.mul.x.vf acc vf3 vf1 :mask #b1) + (.add.mul.y.vf acc vf3 vf1 acc :mask #b1) + (.add.mul.z.vf acc vf3 vf1 acc :mask #b1) + (.add.mul.w.vf vf1 vf3 vf1 acc :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector+! +(defun vector+! ((arg0 vector) (arg1 vector) (arg2 vector)) + (vector+! arg0 arg1 arg2) + ) + +;; definition for function vector-! +(defun vector-! ((arg0 vector) (arg1 vector) (arg2 vector)) + (vector-! arg0 arg1 arg2) + ) + +;; definition for function vector-zero! +;; INFO: Used lq/sq +(defun vector-zero! ((arg0 vector)) + (set! (-> arg0 quad) (the-as uint128 0)) + arg0 + ) + +;; definition for function vector-reset! +(defun vector-reset! ((arg0 vector)) + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (.svf (&-> arg0 quad) vf0) + arg0 + ) + ) + +;; definition for function vector-copy! +;; INFO: Used lq/sq +(defun vector-copy! ((arg0 vector) (arg1 vector)) + (set! (-> arg0 quad) (-> arg1 quad)) + arg0 + ) + +;; definition for function vector-length< +(defun vector-length< ((arg0 vector) (arg1 float)) + (let ((f0-0 (vector-length-squared arg0)) + (f1-0 arg1) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + +;; definition for function vector-length> +(defun vector-length> ((arg0 vector) (arg1 float)) + (< (* arg1 arg1) (vector-length-squared arg0)) + ) + +;; definition for symbol *zero-vector*, type vector +(define *zero-vector* (new 'static 'vector)) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/math/vector_REF.gc b/test/decompiler/reference/jak2/engine/math/vector_REF.gc new file mode 100644 index 0000000000..84c6ad3a58 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/math/vector_REF.gc @@ -0,0 +1,1640 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function vector-cross! +(defun vector-cross! ((arg0 vector) (arg1 vector) (arg2 vector)) + (vector-cross! arg0 arg1 arg2) + ) + +;; definition for function vector-xz-cross! +(defun vector-xz-cross! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.add.x.vf vf1 vf0 vf0 :mask #b10) + (.add.x.vf vf2 vf0 vf0 :mask #b10) + (.outer.product.a.vf acc vf1 vf2) + (.outer.product.b.vf vf3 vf2 vf1 acc) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +;; definition for function vector+float! +(defun vector+float! ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.mov vf6 arg2) + (.lvf vf4 (&-> arg1 quad)) + (.add.x.vf vf5 vf0 vf0 :mask #b1000) + (.add.x.vf vf5 vf4 vf6 :mask #b111) + (.svf (&-> arg0 quad) vf5) + arg0 + ) + ) + +;; definition for function vector*! +(defun vector*! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (init-vf0-vector) + (.lvf vf4 (&-> arg1 quad)) + (.lvf vf5 (&-> arg2 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.vf vf6 vf4 vf5 :mask #b111) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; definition for function vector+*! +(defun vector+*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg2 quad)) + (.lvf vf4 (&-> arg1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; definition for function vector-*! +(defun vector-*! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg2 quad)) + (.lvf vf4 (&-> arg1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.w.vf acc vf4 vf0 :mask #b111) + (.sub.mul.x.vf vf6 vf5 vf7 acc :mask #b111) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; definition for function vector/! +(defun vector/! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.lvf vf5 (&-> arg2 quad)) + (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b1) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.lvf vf4 (&-> arg1 quad)) + (let ((v1-0 (/ (-> arg1 x) (-> arg2 x)))) + (.wait.vf) + (.mul.vf vf6 vf4 Q :mask #b10) + (.nop.vf) + (.nop.vf) + (.div.vf Q vf0 vf5 :fsf #b11 :ftf #b10) + (.mov vf7 v1-0) + ) + (.add.x.vf vf6 vf0 vf7 :mask #b1) + (.wait.vf) + (.mul.vf vf6 vf4 Q :mask #b100) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf6) + arg0 + ) + ) + +;; definition for function vector-float*! +(defun vector-float*! ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf2 arg2) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector-average! +(defun vector-average! ((arg0 vector) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 #x3f000000)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov vf3 v1-0) + ) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf1 vf3) + (.add.mul.x.vf vf4 vf2 vf3 acc :mask #b111) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function vector+float*! +(defun vector+float*! ((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) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf3 arg3) + (.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 (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function vector--float*! +(defun vector--float*! ((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) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (.mov vf3 arg3) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.mul.w.vf acc vf1 vf0) + (.sub.mul.x.vf vf4 vf2 vf3 acc :mask #b111) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function vector-float/! +(defun vector-float/! ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.mov vf3 arg2) + (.div.vf Q vf0 vf3 :fsf #b11 :ftf #b0) + (.lvf vf1 (&-> arg1 quad)) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.wait.vf) + (.mul.vf vf4 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function vector-negate! +(defun vector-negate! ((arg0 vector) (arg1 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.sub.vf vf4 vf0 vf1 :mask #b111) + (.add.x.vf vf4 vf0 vf0 :mask #b1000) + (.svf (&-> arg0 quad) vf4) + arg0 + ) + ) + +;; definition for function vector-negate-in-place! +(defun vector-negate-in-place! ((arg0 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.sub.vf vf1 vf0 vf1 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector= +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for function vector-delta +(defun vector-delta ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.sub.vf vf1 vf2 vf1) + (.abs.vf vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf1 acc :mask #b1000) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov v0-0 vf3) + v0-0 + ) + ) + +;; definition for function vector-seek! +(defun vector-seek! ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + (vf5 :class vf) + ) + (init-vf0-vector) + (.mov vf4 arg2) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg0 quad)) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.sub.x.vf vf5 vf0 vf4 :mask #b1) + (.sub.vf vf3 vf1 vf2 :mask #b111) + (.min.x.vf vf3 vf3 vf4 :mask #b111) + (.max.x.vf vf3 vf3 vf5 :mask #b111) + (.add.vf vf1 vf2 vf3 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector-smooth-seek! +(defun vector-smooth-seek! ((arg0 vector) (arg1 vector) (arg2 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 arg1 arg0) + (let ((v0-0 arg0)) + (let ((a1-2 (fmin 1.0 arg2))) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> v1-0 quad)) + (.lvf vf4 (&-> arg0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v0-0 quad) vf6) + v0-0 + ) + ) + ) + ) + +;; definition for function vector-seek-2d-xz-smooth! +(defun vector-seek-2d-xz-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-1 (- (-> arg1 x) (-> arg0 x))) + (f2-1 (- (-> arg1 z) (-> arg0 z))) + ) + (when (or (!= f0-1 0.0) (!= f2-1 0.0)) + (let* ((f1-5 (* f0-1 arg3)) + (f0-3 (* f2-1 arg3)) + (f2-4 (sqrtf (+ (* f1-5 f1-5) (* f0-3 f0-3)))) + ) + (cond + ((>= arg2 f2-4) + (+! (-> arg0 x) f1-5) + (+! (-> arg0 z) f0-3) + ) + (else + (let ((f2-6 (/ arg2 f2-4))) + (+! (-> arg0 x) (* f2-6 f1-5)) + (+! (-> arg0 z) (* f2-6 f0-3)) + ) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function vector-seek-2d-yz-smooth! +(defun vector-seek-2d-yz-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-1 (- (-> arg1 y) (-> arg0 y))) + (f2-1 (- (-> arg1 z) (-> arg0 z))) + ) + (when (or (!= f0-1 0.0) (!= f2-1 0.0)) + (let* ((f1-5 (* f0-1 arg3)) + (f0-3 (* f2-1 arg3)) + (f2-4 (sqrtf (+ (* f1-5 f1-5) (* f0-3 f0-3)))) + ) + (cond + ((>= arg2 f2-4) + (+! (-> arg0 y) f1-5) + (+! (-> arg0 z) f0-3) + ) + (else + (let ((f2-6 (/ arg2 f2-4))) + (+! (-> arg0 y) (* f2-6 f1-5)) + (+! (-> arg0 z) (* f2-6 f0-3)) + ) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function vector-seek-3d-smooth! +(defun vector-seek-3d-smooth! ((arg0 vector) (arg1 vector) (arg2 float) (arg3 float)) + (let ((f0-1 (- (-> arg1 x) (-> arg0 x))) + (f1-2 (- (-> arg1 y) (-> arg0 y))) + (f3-1 (- (-> arg1 z) (-> arg0 z))) + ) + (when (or (!= f0-1 0.0) (!= f1-2 0.0) (!= f3-1 0.0)) + (let* ((f2-6 (* f0-1 arg3)) + (f1-3 (* f1-2 arg3)) + (f0-4 (* f3-1 arg3)) + (f3-5 (sqrtf (+ (* f2-6 f2-6) (* f1-3 f1-3) (* f0-4 f0-4)))) + ) + (cond + ((>= arg2 f3-5) + (+! (-> arg0 x) f2-6) + (+! (-> arg0 y) f1-3) + (+! (-> arg0 z) f0-4) + ) + (else + (let ((f3-7 (/ arg2 f3-5))) + (+! (-> arg0 x) (* f3-7 f2-6)) + (+! (-> arg0 y) (* f3-7 f1-3)) + (+! (-> arg0 z) (* f3-7 f0-4)) + ) + ) + ) + ) + ) + ) + arg0 + ) + +;; definition for function seek-with-smooth +(defun seek-with-smooth ((arg0 float) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let ((f0-1 (- arg1 arg0))) + (cond + ((>= arg4 (fabs f0-1)) + arg1 + ) + (else + (let ((f0-2 (* f0-1 arg3))) + (let ((f1-4 (- arg2))) + (cond + ((< f0-2 f1-4) + (set! f0-2 f1-4) + ) + ((< arg2 f0-2) + (set! f0-2 arg2) + ) + ) + ) + (+ f0-2 arg0) + ) + ) + ) + ) + ) + +;; definition for function vector-identity! +(defun vector-identity! ((arg0 vector)) + (set! (-> arg0 x) 1.0) + (set! (-> arg0 y) 1.0) + (set! (-> arg0 z) 1.0) + (set! (-> arg0 w) 1.0) + arg0 + ) + +;; definition for function vector-seconds +(defun vector-seconds ((arg0 vector) (arg1 vector)) + (set! (-> arg0 x) (* 300.0 (-> arg1 x))) + (set! (-> arg0 y) (* 300.0 (-> arg1 y))) + (set! (-> arg0 z) (* 300.0 (-> arg1 z))) + arg0 + ) + +;; definition for function vector-seconds! +(defun vector-seconds! ((arg0 vector)) + (set! (-> arg0 x) (* 300.0 (-> arg0 x))) + (set! (-> arg0 y) (* 300.0 (-> arg0 y))) + (set! (-> arg0 z) (* 300.0 (-> arg0 z))) + arg0 + ) + +;; definition for function vector-v! +(defun vector-v! ((arg0 vector)) + (with-pp + (vector-float*! arg0 arg0 (-> pp clock seconds-per-frame)) + arg0 + ) + ) + +;; definition for function vector-v+! +(defun vector-v+! ((arg0 vector) (arg1 vector) (arg2 vector)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((f0-0 (-> pp clock seconds-per-frame))) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (let ((a1-1 f0-0)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +;; definition for function vector-v*float+! +(defun vector-v*float+! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((f0-1 (* arg3 (-> pp clock seconds-per-frame)))) + (.lvf vf2 (&-> arg2 quad)) + (.lvf vf1 (&-> arg1 quad)) + (let ((a1-1 f0-1)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +;; definition for function vector-v++! +(defun vector-v++! ((arg0 vector) (arg1 vector)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((a2-0 arg0) + (f0-0 (-> pp clock seconds-per-frame)) + ) + (.lvf vf2 (&-> arg1 quad)) + (.lvf vf1 (&-> a2-0 quad)) + (let ((a1-1 f0-0)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +;; definition for function vector-v*float! +;; INFO: Return type mismatch uint vs vector. +(defun vector-v*float! ((arg0 vector) (arg1 vector) (arg2 float)) + (with-pp + (the-as vector (vector-float*! arg0 arg1 (* arg2 (-> pp clock seconds-per-frame)))) + ) + ) + +;; definition for function vector-v*float++! +(defun vector-v*float++! ((arg0 vector) (arg1 vector) (arg2 float)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (let ((v1-0 arg0)) + (let ((a3-0 arg0) + (f0-1 (* arg2 (-> pp clock seconds-per-frame))) + ) + (.lvf vf2 (&-> arg1 quad)) + (.lvf vf1 (&-> a3-0 quad)) + (let ((a1-1 f0-1)) + (.mov vf3 a1-1) + ) + ) + (.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-0 quad) vf4) + ) + arg0 + ) + ) + ) + +;; definition for function vector-to-ups! +(defun vector-to-ups! ((arg0 vector) (arg1 vector)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (let ((f0-0 (-> pp clock frames-per-second))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + ) + +;; definition for function vector-from-ups! +(defun vector-from-ups! ((arg0 vector) (arg1 vector)) + (local-vars (at-0 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (let ((f0-0 (-> pp clock seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + ) + +;; definition for function vector-length +(defun vector-length ((arg0 vector)) + (vector-length arg0) + ) + +;; definition for function vector-length-squared +(defun vector-length-squared ((arg0 vector)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector-xz-length-squared +(defun vector-xz-length-squared ((arg0 vector)) + (+ (* (-> arg0 x) (-> arg0 x)) (* (-> arg0 z) (-> arg0 z))) + ) + +;; definition for function vector-xz-length +(defun vector-xz-length ((arg0 vector)) + (sqrtf (+ (* (-> arg0 x) (-> arg0 x)) (* (-> arg0 z) (-> arg0 z)))) + ) + +;; definition for function vector-vector-distance +(defun vector-vector-distance ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf acc vf0 vf1 acc :mask #b1000) + (.add.mul.z.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector-vector-distance-squared +(defun vector-vector-distance-squared ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector-vector-xz-distance +(defun vector-vector-xz-distance ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.z.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector-vector-xy-distance +(defun vector-vector-xy-distance ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf0 vf1 :mask #b1000) + (.add.mul.y.vf vf1 vf0 vf1 acc :mask #b1000) + (.sqrt.vf Q vf1 :ftf #b11) + (.add.w.vf vf1 vf0 vf0 :mask #b1) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b1) + (.nop.vf) + (.nop.vf) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector-vector-xz-distance-squared +(defun vector-vector-xz-distance-squared ((arg0 vector) (arg1 vector)) + (local-vars (v0-0 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (.lvf vf2 (&-> arg0 quad)) + (.lvf vf3 (&-> arg1 quad)) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v0-0 vf1) + v0-0 + ) + ) + +;; definition for function vector-normalize! +(defun vector-normalize! ((arg0 vector) (arg1 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-0 arg1)) + (.mov vf3 v1-0) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector-normalize-ret-len! +(defun vector-normalize-ret-len! ((arg0 vector) (arg1 float)) + (local-vars (v1-1 float)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-0 arg1)) + (.mov vf3 v1-0) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.add.w.vf vf2 vf0 vf2 :mask #b1) + (.mov v1-1 vf2) + (let ((v0-0 (sqrtf v1-1))) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> arg0 quad) vf1) + v0-0 + ) + ) + ) + +;; definition for function vector-normalize-copy! +;; INFO: Used lq/sq +(defun vector-normalize-copy! ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((f0-0 (vector-length arg1))) + (cond + ((= f0-0 0.0) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + (else + (let ((v1-3 (/ arg2 f0-0))) + (set! (-> arg0 x) (* (-> arg1 x) v1-3)) + (set! (-> arg0 y) (* (-> arg1 y) v1-3)) + (set! (-> arg0 z) (* (-> arg1 z) v1-3)) + ) + ) + ) + ) + (set! (-> arg0 w) 1.0) + arg0 + ) + +;; definition for function vector-xz-normalize! +(defun vector-xz-normalize! ((arg0 vector) (arg1 float)) + (let* ((v1-0 arg0) + (f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z))))) + ) + (when (!= f0-4 0.0) + (let ((v1-3 (/ arg1 f0-4))) + (set! (-> arg0 x) (* (-> arg0 x) v1-3)) + (set! (-> arg0 z) (* (-> arg0 z) v1-3)) + ) + ) + ) + arg0 + ) + +;; definition for function vector-xz-normalize-copy! +;; INFO: Used lq/sq +(defun vector-xz-normalize-copy! ((arg0 vector) (arg1 vector) (arg2 float)) + (let* ((v1-0 arg1) + (f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z))))) + ) + (cond + ((= f0-4 0.0) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + (else + (let ((v1-3 (/ arg2 f0-4))) + (set! (-> arg0 x) (* (-> arg1 x) v1-3)) + (set! (-> arg0 y) 0.0) + (set! (-> arg0 z) (* (-> arg1 z) v1-3)) + ) + ) + ) + ) + (set! (-> arg0 w) 1.0) + arg0 + ) + +;; definition for function vector-length-max! +(defun vector-length-max! ((arg0 vector) (arg1 float)) + (let ((f0-0 (vector-length arg0))) + (when (not (or (= f0-0 0.0) (< f0-0 arg1))) + (let ((f0-1 (/ f0-0 arg1))) + (when (!= f0-1 0.0) + (set! (-> arg0 x) (/ (-> arg0 x) f0-1)) + (set! (-> arg0 y) (/ (-> arg0 y) f0-1)) + (set! (-> arg0 z) (/ (-> arg0 z) f0-1)) + ) + ) + ) + ) + arg0 + ) + +;; definition for function vector-xz-length-max! +(defun vector-xz-length-max! ((arg0 vector) (arg1 float)) + (let* ((v1-0 arg0) + (f0-4 (sqrtf (+ (* (-> v1-0 x) (-> v1-0 x)) (* (-> v1-0 z) (-> v1-0 z))))) + ) + (when (not (or (= f0-4 0.0) (< f0-4 arg1))) + (let ((f0-5 (/ f0-4 arg1))) + (when (!= f0-5 0.0) + (set! (-> arg0 x) (/ (-> arg0 x) f0-5)) + (set! (-> arg0 z) (/ (-> arg0 z) f0-5)) + ) + ) + ) + ) + arg0 + ) + +;; definition for function vector-rotate-around-x! +;; INFO: Used lq/sq +(defun vector-rotate-around-x! ((arg0 vector) (arg1 vector) (arg2 float)) + (let* ((f28-0 (- arg2)) + (f30-0 (cos f28-0)) + (f1-0 (sin f28-0)) + (f2-0 (-> arg1 z)) + (f0-1 (-> arg1 y)) + ) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 z) (- (* f2-0 f30-0) (* f0-1 f1-0))) + (set! (-> arg0 y) (+ (* f2-0 f1-0) (* f0-1 f30-0))) + ) + arg0 + ) + +;; definition for function vector-rotate-around-y! +;; INFO: Used lq/sq +(defun vector-rotate-around-y! ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((f26-0 (-> arg1 z)) + (f30-0 (-> arg1 x)) + (f28-0 (cos arg2)) + (f0-0 (sin arg2)) + ) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 z) (- (* f26-0 f28-0) (* f30-0 f0-0))) + (set! (-> arg0 x) (+ (* f26-0 f0-0) (* f30-0 f28-0))) + ) + arg0 + ) + +;; definition for function vector-rotate90-around-y! +;; INFO: Used lq/sq +(defun vector-rotate90-around-y! ((arg0 vector) (arg1 vector)) + (set! (-> arg0 quad) (-> arg1 quad)) + (let ((f0-0 (-> arg0 x))) + (set! (-> arg0 x) (- (-> arg1 z))) + (set! (-> arg0 z) f0-0) + ) + arg0 + ) + +;; definition for function vector-rotate-around-z! +;; INFO: Used lq/sq +(defun vector-rotate-around-z! ((arg0 vector) (arg1 vector) (arg2 float)) + (let ((f26-0 (-> arg1 x)) + (f30-0 (-> arg1 y)) + (f28-0 (cos arg2)) + (f0-0 (sin arg2)) + ) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 x) (- (* f26-0 f28-0) (* f30-0 f0-0))) + (set! (-> arg0 y) (+ (* f26-0 f0-0) (* f30-0 f28-0))) + ) + arg0 + ) + +;; definition for function rotate-y<-vector+vector +(defun rotate-y<-vector+vector ((arg0 vector) (arg1 vector)) + (atan (- (-> arg1 x) (-> arg0 x)) (- (-> arg1 z) (-> arg0 z))) + ) + +;; definition for function rotate-x<-vector+vector +(defun rotate-x<-vector+vector ((arg0 vector) (arg1 vector)) + (atan (- (-> arg1 y) (-> arg0 y)) (- (-> arg1 z) (-> arg0 z))) + ) + +;; definition for function rotate-z<-vector+vector +(defun rotate-z<-vector+vector ((arg0 vector) (arg1 vector)) + (atan (- (-> arg1 x) (-> arg0 x)) (- (-> arg1 y) (-> arg0 y))) + ) + +;; definition for function vector-cvt.w.s! +(defun vector-cvt.w.s! ((arg0 vector) (arg1 vector)) + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector-cvt.s.w! +(defun vector-cvt.s.w! ((arg0 vector) (arg1 vector)) + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function rot-zxy-from-vector! +(defun rot-zxy-from-vector! ((arg0 vector) (arg1 vector)) + (let* ((f28-0 (-> arg1 z)) + (f30-0 (-> arg1 x)) + (f0-0 (atan f30-0 f28-0)) + ) + (set! (-> arg0 y) f0-0) + (let* ((f26-0 (- f0-0)) + (f0-4 (- (* f28-0 (cos f26-0)) (* f30-0 (sin f26-0)))) + ) + (set! (-> arg0 x) (atan (- (-> arg1 y)) f0-4)) + ) + ) + (set! (-> arg0 z) 0.0) + arg0 + ) + +;; definition for function rot-zyx-from-vector! +(defun rot-zyx-from-vector! ((arg0 vector) (arg1 vector)) + (let* ((f28-0 (-> arg1 z)) + (f30-0 (- (-> arg1 y))) + (f0-1 (atan f30-0 f28-0)) + ) + (set! (-> arg0 x) f0-1) + (let* ((f26-0 (- f0-1)) + (f0-5 (- (* f28-0 (cos f26-0)) (* f30-0 (sin f26-0)))) + ) + (set! (-> arg0 y) (atan (-> arg1 x) f0-5)) + ) + ) + (set! (-> arg0 z) 0.0) + arg0 + ) + +;; definition for function vector-lerp! +(defun vector-lerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov vf4 arg3) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +;; definition for function vector-lerp-clamp! +;; INFO: Used lq/sq +(defun vector-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (let ((v1-3 arg0)) + (let ((f0-2 arg3)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (let ((a1-1 f0-2)) + (.mov vf4 a1-1) + ) + ) + (.add.x.vf vf3 vf0 vf0 :mask #b1000) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2 :mask #b111) + (.svf (&-> v1-3 quad) vf3) + ) + ) + ) + arg0 + ) + ) + +;; definition for function vector4-lerp! +(defun vector4-lerp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.mov vf4 arg3) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2) + (.svf (&-> arg0 quad) vf3) + arg0 + ) + ) + +;; definition for function vector4-lerp-clamp! +;; INFO: Used lq/sq +(defun vector4-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (let ((v1-3 arg0)) + (let ((f0-2 arg3)) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (let ((a1-1 f0-2)) + (.mov vf4 a1-1) + ) + ) + (.sub.vf vf2 vf2 vf1) + (.mul.x.vf vf2 vf2 vf4) + (.add.vf vf3 vf1 vf2) + (.svf (&-> v1-3 quad) vf3) + ) + ) + ) + arg0 + ) + ) + +;; definition for function vector-degi +;; INFO: Used lq/sq +(defun vector-degi ((arg0 vector) (arg1 vector)) + (local-vars (v1-0 uint128) (v1-1 uint128)) + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.mov v1-0 vf1) + (.pw.sll v1-1 v1-0 16) + (set! (-> arg0 quad) v1-1) + arg0 + ) + ) + +;; definition for function vector-degf +;; INFO: Used lq/sq +(defun vector-degf ((arg0 vector) (arg1 vector)) + (local-vars (v1-1 uint128)) + (rlet ((vf1 :class vf)) + (let ((v1-0 (-> arg1 quad))) + (.pw.sra v1-1 v1-0 16) + ) + (.mov vf1 v1-1) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector-degmod +(defun vector-degmod ((arg0 vector) (arg1 vector)) + (local-vars (v1-0 uint128) (v1-1 uint128) (v1-2 uint128)) + (rlet ((vf1 :class vf)) + (.lvf vf1 (&-> arg1 quad)) + (.ftoi.vf vf1 vf1) + (.mov v1-0 vf1) + (.pw.sll v1-1 v1-0 16) + (.pw.sra v1-2 v1-1 16) + (.mov vf1 v1-2) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + arg0 + ) + ) + +;; definition for function vector-deg-diff +;; INFO: Return type mismatch float vs none. +(defun vector-deg-diff ((arg0 vector) (arg1 vector) (arg2 vector)) + (local-vars + (v0-0 float) + (v1-0 uint128) + (v1-1 uint128) + (v1-2 uint128) + (v1-3 uint128) + (a1-1 uint128) + (a1-2 uint128) + ) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (.lvf vf1 (&-> arg1 quad)) + (.lvf vf2 (&-> arg2 quad)) + (.ftoi.vf vf1 vf1) + (.ftoi.vf vf2 vf2) + (.mov a1-1 vf1) + (.mov v1-0 vf2) + (.pw.sll a1-2 a1-1 16) + (.pw.sll v1-1 v1-0 16) + (.psubw v1-2 a1-2 v1-1) + (.pw.sra v1-3 v1-2 16) + (.mov vf1 v1-3) + (.itof.vf vf1 vf1) + (.svf (&-> arg0 quad) vf1) + (.mov v0-0 vf1) + (none) + ) + ) + +;; definition for function vector-deg-lerp-clamp! +;; INFO: Used lq/sq +(defun vector-deg-lerp-clamp! ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float)) + (cond + ((>= 0.0 arg3) + (set! (-> arg0 quad) (-> arg1 quad)) + ) + ((>= arg3 1.0) + (set! (-> arg0 quad) (-> arg2 quad)) + ) + (else + (set! (-> arg0 x) (deg-lerp-clamp (-> arg1 x) (-> arg2 x) arg3)) + (set! (-> arg0 y) (deg-lerp-clamp (-> arg1 y) (-> arg2 y) arg3)) + (set! (-> arg0 z) (deg-lerp-clamp (-> arg1 z) (-> arg2 z) arg3)) + (set! (-> arg0 w) 1.0) + ) + ) + arg0 + ) + +;; definition for function vector3s-copy! +(defun vector3s-copy! ((arg0 vector) (arg1 vector)) + "Copy a vector3s" + (set! (-> arg0 x) (-> arg1 x)) + (set! (-> arg0 y) (-> arg1 y)) + (set! (-> arg0 z) (-> arg1 z)) + arg0 + ) + +;; definition for function vector3s+! +(defun vector3s+! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Add 2 vectors3." + (set! (-> arg0 x) (+ (-> arg1 x) (-> arg2 x))) + (set! (-> arg0 y) (+ (-> arg1 y) (-> arg2 y))) + (set! (-> arg0 z) (+ (-> arg1 z) (-> arg2 z))) + arg0 + ) + +;; definition for function vector3s*float! +(defun vector3s*float! ((arg0 vector) (arg1 vector) (arg2 float)) + "mult vectors3 by float" + (set! (-> arg0 x) (* (-> arg1 x) arg2)) + (set! (-> arg0 y) (* (-> arg1 y) arg2)) + (set! (-> arg0 z) (* (-> arg1 z) arg2)) + arg0 + ) + +;; definition for function vector3s-! +(defun vector3s-! ((arg0 vector) (arg1 vector) (arg2 vector)) + "Subtract 2 vectors3: c = (a - b)." + (set! (-> arg0 x) (- (-> arg1 x) (-> arg2 x))) + (set! (-> arg0 y) (- (-> arg1 y) (-> arg2 y))) + (set! (-> arg0 z) (- (-> arg1 z) (-> arg2 z))) + arg0 + ) + +;; definition for function vector4-add! +;; INFO: Return type mismatch float vs none. +(defun vector4-add! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.add.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +;; definition for function vector4-sub! +;; INFO: Return type mismatch float vs none. +(defun vector4-sub! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.sub.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +;; definition for function vector4-mul! +;; INFO: Return type mismatch float vs none. +(defun vector4-mul! ((arg0 vector4) (arg1 vector4) (arg2 vector4)) + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.mul.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +;; definition for function vector4-scale! +;; INFO: Return type mismatch float vs none. +(defun vector4-scale! ((arg0 vector4) (arg1 vector4) (arg2 float)) + (local-vars (v0-0 float)) + (rlet ((vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + ) + (.mov vf6 arg2) + (.lvf vf5 (&-> arg1 quad)) + (.mul.x.vf vf4 vf5 vf6) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +;; definition for function vector4-madd! +;; INFO: Return type mismatch float vs none. +(defun vector4-madd! ((arg0 vector4) (arg1 vector4) (arg2 vector4) (arg3 float)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.mul.w.vf acc vf5 vf0) + (.add.mul.x.vf vf4 vf6 vf7 acc) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +;; definition for function vector4-msub! +;; INFO: Return type mismatch float vs none. +(defun vector4-msub! ((arg0 vector4) (arg1 vector4) (arg2 vector4) (arg3 float)) + (local-vars (v0-0 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (.mov vf7 arg3) + (.lvf vf5 (&-> arg1 quad)) + (.lvf vf6 (&-> arg2 quad)) + (.mul.w.vf acc vf5 vf0) + (.sub.mul.x.vf vf4 vf6 vf7 acc) + (.svf (&-> arg0 quad) vf4) + (.mov v0-0 vf4) + (none) + ) + ) + +;; definition for function vector4-array-add! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-add! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) + (dotimes (s2-0 arg3) + (vector4-add! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function vector4-array-sub! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-sub! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) + (dotimes (s2-0 arg3) + (vector4-sub! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function vector4-array-mul! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-mul! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 (inline-array vector4)) (arg3 int)) + (dotimes (s2-0 arg3) + (vector4-mul! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2)) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function vector4-array-scale! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-scale! ((arg0 (inline-array vector4)) (arg1 (inline-array vector4)) (arg2 float) (arg3 int)) + (dotimes (s2-0 arg3) + (vector4-scale! (the-as vector4 arg0) (the-as vector4 arg1) arg2) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function vector4-array-madd! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-madd! ((arg0 (inline-array vector4)) + (arg1 (inline-array vector4)) + (arg2 (inline-array vector4)) + (arg3 float) + (arg4 int) + ) + (dotimes (s1-0 arg4) + (vector4-madd! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2) arg3) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function vector4-array-msub! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-msub! ((arg0 (inline-array vector4)) + (arg1 (inline-array vector4)) + (arg2 (inline-array vector4)) + (arg3 float) + (arg4 int) + ) + (dotimes (s1-0 arg4) + (vector4-msub! (the-as vector4 arg0) (the-as vector4 arg1) (the-as vector4 arg2) arg3) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function vector4-array-lerp! +;; INFO: Return type mismatch symbol vs none. +(defun vector4-array-lerp! ((arg0 (inline-array vector4)) + (arg1 (inline-array vector4)) + (arg2 (inline-array vector4)) + (arg3 float) + (arg4 int) + ) + (dotimes (s1-0 arg4) + (vector4-lerp! (the-as vector arg0) (the-as vector arg1) (the-as vector arg2) arg3) + (set! arg1 (the-as (inline-array vector4) (-> arg1 1))) + (set! arg2 (the-as (inline-array vector4) (-> arg2 1))) + (set! arg0 (the-as (inline-array vector4) (-> arg0 1))) + ) + (none) + ) + +;; definition for function spheres-overlap? +(defun spheres-overlap? ((arg0 sphere) (arg1 sphere)) + (local-vars (v1-0 float) (a0-1 float)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (.lvf vf1 (&-> arg0 quad)) + (.lvf vf2 (&-> arg1 quad)) + (.sub.vf vf3 vf1 vf2 :mask #b111) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.add.y.vf vf3 vf3 vf3 :mask #b1) + (.add.z.vf vf3 vf3 vf3 :mask #b1) + (.add.w.vf vf4 vf0 vf4 :mask #b1) + (.mov a0-1 vf4) + (.mov v1-0 vf3) + (>= a0-1 v1-0) + ) + ) + +;; definition for function sphere<-vector! +;; INFO: Used lq/sq +(defun sphere<-vector! ((arg0 sphere) (arg1 vector)) + (let ((f0-0 (-> arg0 w))) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 w) f0-0) + ) + arg0 + ) + +;; definition for function sphere<-vector+r! +;; INFO: Used lq/sq +(defun sphere<-vector+r! ((arg0 sphere) (arg1 vector) (arg2 float)) + (set! (-> arg0 quad) (-> arg1 quad)) + (set! (-> arg0 w) arg2) + arg0 + ) + +;; definition for function rand-vu-sphere-point! +(defun rand-vu-sphere-point! ((arg0 vector) (arg1 float)) + (set-vector! + arg0 + (rand-vu-float-range -1.0 1.0) + (rand-vu-float-range -1.0 1.0) + (rand-vu-float-range -1.0 1.0) + 1.0 + ) + (vector-normalize! arg0 (rand-vu-float-range 0.0 arg1)) + ) + +;; definition for method 2 of type vector2 +(defmethod print vector2 ((obj vector2)) + (format #t "#" (-> obj x) (-> obj y) obj) + obj + ) + +;; definition for function vector-vector-angle-safe +(defun vector-vector-angle-safe ((arg0 vector) (arg1 vector)) + (let ((f0-1 (vector-dot + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg0 1.0) + (vector-normalize-copy! (new 'stack-no-clear 'vector) arg1 1.0) + ) + ) + ) + (cond + ((>= f0-1 1.0) + 0.0 + ) + ((>= -1.0 f0-1) + 0.017257283 + ) + (else + (acos f0-1) + ) + ) + ) + ) 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 new file mode 100644 index 0000000000..ad0fd3035c --- /dev/null +++ b/test/decompiler/reference/jak2/engine/nav/nav-control-h_REF.gc @@ -0,0 +1,405 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type check-vector-collision-with-nav-spheres-info +(deftype check-vector-collision-with-nav-spheres-info (structure) + ((u float :offset-assert 0) + (intersect vector :inline :offset-assert 16) + (normal vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type check-vector-collision-with-nav-spheres-info +(defmethod inspect check-vector-collision-with-nav-spheres-info ((obj check-vector-collision-with-nav-spheres-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'check-vector-collision-with-nav-spheres-info) + (format #t "~1Tu: ~f~%" (-> obj u)) + (format #t "~1Tintersect: #~%" (-> obj intersect)) + (format #t "~1Tnormal: #~%" (-> obj normal)) + (label cfg-4) + obj + ) + +;; definition of type nav-gap-info +(deftype nav-gap-info (structure) + ((dest vector :inline :offset-assert 0) + (poly nav-poly :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type nav-gap-info +(defmethod inspect nav-gap-info ((obj nav-gap-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-gap-info) + (format #t "~1Tdest: ~`vector`P~%" (-> obj dest)) + (format #t "~1Tpoly: #~%" (-> obj poly)) + (label cfg-4) + obj + ) + +;; definition of type nav-avoid-spheres-params +(deftype nav-avoid-spheres-params (structure) + ((current-pos vector :inline :offset-assert 0) + (travel vector :inline :offset-assert 16) + (pref-dir vector :inline :offset-assert 32) + (out-travel vector 2 :inline :offset-assert 48) + (closest-sphere-dist2 float :offset-assert 80) + (avoiding-sphere? basic :offset-assert 84) + ) + :method-count-assert 9 + :size-assert #x58 + :flag-assert #x900000058 + ) + +;; definition for method 3 of type nav-avoid-spheres-params +(defmethod inspect nav-avoid-spheres-params ((obj nav-avoid-spheres-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-avoid-spheres-params) + (format #t "~1Tcurrent-pos: #~%" (-> obj current-pos)) + (format #t "~1Ttravel: #~%" (-> obj travel)) + (format #t "~1Tpref-dir: #~%" (-> obj pref-dir)) + (format #t "~1Tout-travel[2] @ #x~X~%" (-> obj out-travel)) + (format #t "~1Tclosest-sphere-dist2: ~f~%" (-> obj closest-sphere-dist2)) + (format #t "~1Tavoiding-sphere?: ~A~%" (-> obj avoiding-sphere?)) + (label cfg-4) + obj + ) + +;; definition of type nav-callback-info +(deftype nav-callback-info (structure) + ((callback-count int32 :offset-assert 0) + (callback-array uint32 10 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type nav-callback-info +(defmethod inspect nav-callback-info ((obj nav-callback-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-callback-info) + (format #t "~1Tcallback-count: ~D~%" (-> obj callback-count)) + (format #t "~1Tcallback-array[10] @ #x~X~%" (-> obj callback-array)) + (label cfg-4) + obj + ) + +;; definition of type nav-state +(deftype nav-state (structure) + ((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) + (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 + :flag-assert #x37000000b0 + (:methods + (nav-state-method-9 () none 9) + (nav-state-method-10 () none 10) + (nav-state-method-11 () none 11) + (nav-state-method-12 () none 12) + (nav-state-method-13 () none 13) + (nav-state-method-14 () none 14) + (nav-state-method-15 () none 15) + (nav-state-method-16 () none 16) + (nav-state-method-17 () none 17) + (nav-state-method-18 () none 18) + (nav-state-method-19 () none 19) + (nav-state-method-20 () none 20) + (nav-state-method-21 () none 21) + (nav-state-method-22 () none 22) + (nav-state-method-23 () none 23) + (nav-state-method-24 () none 24) + (nav-state-method-25 () none 25) + (nav-state-method-26 () none 26) + (nav-state-method-27 () none 27) + (nav-state-method-28 () none 28) + (nav-state-method-29 () none 29) + (nav-state-method-30 () none 30) + (nav-state-method-31 () none 31) + (nav-state-method-32 () none 32) + (nav-state-method-33 () none 33) + (nav-state-method-34 () none 34) + (nav-state-method-35 () none 35) + (nav-state-method-36 () none 36) + (nav-state-method-37 () none 37) + (nav-state-method-38 () none 38) + (nav-state-method-39 () none 39) + (nav-state-method-40 () none 40) + (nav-state-method-41 () none 41) + (nav-state-method-42 () none 42) + (nav-state-method-43 () none 43) + (nav-state-method-44 () none 44) + (nav-state-method-45 () none 45) + (nav-state-method-46 () none 46) + (nav-state-method-47 () none 47) + (nav-state-method-48 () none 48) + (nav-state-method-49 () none 49) + (nav-state-method-50 () none 50) + (nav-state-method-51 () none 51) + (nav-state-method-52 () none 52) + (nav-state-method-53 () none 53) + (nav-state-method-54 () none 54) + ) + ) + +;; definition for method 3 of type nav-state +(defmethod inspect nav-state ((obj nav-state)) + (when (not obj) + (set! obj obj) + (goto cfg-34) + ) + (format #t "[~8x] ~A~%" obj 'nav-state) + (format #t "~1Tflags: #x~X : (nav-state-flag " (-> obj flags)) + (let ((s5-0 (-> obj flags))) + (if (= (logand s5-0 (nav-state-flag in-target-poly)) (nav-state-flag in-target-poly)) + (format #t "in-target-poly ") + ) + (if (= (logand s5-0 (nav-state-flag directional-mode)) (nav-state-flag directional-mode)) + (format #t "directional-mode ") + ) + (if (= (logand s5-0 (nav-state-flag initialized)) (nav-state-flag initialized)) + (format #t "initialized ") + ) + (if (= (logand s5-0 (nav-state-flag display-marks)) (nav-state-flag display-marks)) + (format #t "display-marks ") + ) + (if (= (logand s5-0 (nav-state-flag recovery-mode)) (nav-state-flag recovery-mode)) + (format #t "recovery-mode ") + ) + (if (= (logand s5-0 (nav-state-flag touching-sphere)) (nav-state-flag touching-sphere)) + (format #t "touching-sphere ") + ) + (if (= (logand s5-0 (nav-state-flag trapped-by-sphere)) (nav-state-flag trapped-by-sphere)) + (format #t "trapped-by-sphere ") + ) + (if (= (logand s5-0 (nav-state-flag blocked)) (nav-state-flag blocked)) + (format #t "blocked ") + ) + (if (= (logand s5-0 (nav-state-flag avoiding-sphere)) (nav-state-flag avoiding-sphere)) + (format #t "avoiding-sphere ") + ) + (if (= (logand s5-0 (nav-state-flag target-inside)) (nav-state-flag target-inside)) + (format #t "target-inside ") + ) + (if (= (logand s5-0 (nav-state-flag debug)) (nav-state-flag debug)) + (format #t "debug ") + ) + (if (= (logand s5-0 (nav-state-flag at-gap)) (nav-state-flag at-gap)) + (format #t "at-gap ") + ) + (if (= (logand s5-0 (nav-state-flag in-mesh)) (nav-state-flag in-mesh)) + (format #t "in-mesh ") + ) + (if (= (logand s5-0 (nav-state-flag at-target)) (nav-state-flag at-target)) + (format #t "at-target ") + ) + (if (= (logand s5-0 (nav-state-flag target-poly-dirty)) (nav-state-flag target-poly-dirty)) + (format #t "target-poly-dirty ") + ) + ) + (format #t ")~%") + (format #t "~1Tnav: ~A~%" (-> obj nav)) + (format #t "~1Tuser-poly: #~%" (-> obj user-poly)) + (format #t "~1Tmesh: ~A~%" (-> obj mesh)) + (format #t "~1Tcurrent-poly: #~%" (-> obj current-poly)) + (format #t "~1Tvirtual-current-poly: #~%" (-> obj virtual-current-poly)) + (format #t "~1Tnext-poly: #~%" (-> obj next-poly)) + (format #t "~1Ttarget-poly: #~%" (-> obj target-poly)) + (format #t "~1Trotation-rate: ~f~%" (-> obj rotation-rate)) + (format #t "~1Tspeed: (meters ~m)~%" (-> obj speed)) + (format #t "~1Tprev-speed: (meters ~m)~%" (-> obj prev-speed)) + (format #t "~1Tpad0[1] @ #x~X~%" (-> obj pad0)) + (format #t "~1Ttravel: ~`vector`P~%" (-> obj travel)) + (format #t "~1Ttarget-pos: ~`vector`P~%" (-> obj target-post)) + (format #t "~1Tcurrent-pos: ~`vector`P~%" (-> obj current-pos)) + (format #t "~1Tcurrent-pos-local: ~`vector`P~%" (-> obj current-pos-local)) + (format #t "~1Tvirtual-current-pos-local: ~`vector`P~%" (-> obj virtual-current-pos-local)) + (format #t "~1Tvelocity: ~`vector`P~%" (-> obj velocity)) + (format #t "~1Theading: ~`vector`P~%" (-> obj heading)) + (format #t "~1Ttarget-dir: ~`vector`P~%" (-> obj target-dir)) + (format #t "~1Taccel: #~%" (-> obj target-dir)) + (label cfg-34) + obj + ) + +;; definition of type nav-control +(deftype nav-control (structure) + ((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 basic :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 vector :inline :offset-assert 80) + (root-nav-sphere vector :inline :offset-assert 96) + (state nav-state :inline :offset-assert 112) + ) + :method-count-assert 47 + :size-assert #x120 + :flag-assert #x2f00000120 + (:methods + (nav-control-method-9 () none 9) + (nav-control-method-10 () none 10) + (nav-control-method-11 () none 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) + (nav-control-method-18 () none 18) + (nav-control-method-19 () none 19) + (nav-control-method-20 () none 20) + (nav-control-method-21 () none 21) + (nav-control-method-22 () none 22) + (nav-control-method-23 () 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) + (nav-control-method-44 () none 44) + (nav-control-method-45 () none 45) + (nav-control-method-46 () none 46) + ) + ) + +;; definition for method 3 of type nav-control +(defmethod inspect nav-control ((obj nav-control)) + (when (not obj) + (set! obj obj) + (goto cfg-25) + ) + (format #t "[~8x] ~A~%" obj 'nav-control) + (format #t "~1Tflags: #x~X : (nav-control-flag " (-> obj flags)) + (let ((s5-0 (-> obj flags))) + (if (= (logand s5-0 (nav-control-flag display-marks)) (nav-control-flag display-marks)) + (format #t "display-marks ") + ) + (if (= (logand s5-0 (nav-control-flag limit-rotation-rate)) (nav-control-flag limit-rotation-rate)) + (format #t "limit-rotation-rate ") + ) + (if (= (logand s5-0 (nav-control-flag update-heading-from-facing)) (nav-control-flag update-heading-from-facing)) + (format #t "update-heading-from-facing ") + ) + (if (= (logand s5-0 (nav-control-flag use-momentum)) (nav-control-flag use-momentum)) + (format #t "use-momentum ") + ) + (if (= (logand s5-0 (nav-control-flag output-sphere-hash)) (nav-control-flag output-sphere-hash)) + (format #t "output-sphere-hash ") + ) + (if (= (logand s5-0 (nav-control-flag no-redirect-in-clamp)) (nav-control-flag no-redirect-in-clamp)) + (format #t "no-redirect-in-clamp ") + ) + (if (= (logand s5-0 (nav-control-flag momentum-ignore-heading)) (nav-control-flag momentum-ignore-heading)) + (format #t "momentum-ignore-heading ") + ) + (if (= (logand s5-0 (nav-control-flag debug)) (nav-control-flag debug)) + (format #t "debug ") + ) + (if (= (logand s5-0 (nav-control-flag kernel-run)) (nav-control-flag kernel-run)) + (format #t "kernel-run ") + ) + ) + (format #t ")~%") + (format #t "~1Tcallback-info: #~%" (-> obj callback-info)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Tpad0: ~D~%" (-> obj pad0)) + (format #t "~1Tshape: ~A~%" (-> obj shape)) + (format #t "~1Tnearest-y-threshold: (meters ~m)~%" (-> obj nearest-y-threshold)) + (format #t "~1Tnav-cull-radius: (meters ~m)~%" (-> obj nav-cull-radius)) + (format #t "~1Tsec-per-frame: ~f~%" (-> obj sec-per-frame)) + (format #t "~1Ttarget-speed: (meters ~m)~%" (-> obj target-speed)) + (format #t "~1Tacceleration: (meters ~m)~%" (-> obj acceleration)) + (format #t "~1Tturning-acceleration: (meters ~m)~%" (-> obj turning-acceleration)) + (format #t "~1Tmax-rotation-rate: ~f~%" (-> obj max-rotation-rate)) + (format #t "~1Tspeed-scale: ~f~%" (-> obj speed-scale)) + (format #t "~1Tsphere-count: ~D~%" (-> obj sphere-count)) + (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) + (format #t "~1Troot-sphere-id: ~D~%" (-> obj root-sphere-id)) + (format #t "~1Tsphere-mask: ~D~%" (-> obj sphere-mask)) + (format #t "~1Tpad1[2] @ #x~X~%" (-> obj pad1)) + (format #t "~1Tsphere-id-array[16] @ #x~X~%" (-> obj sphere-id-array)) + (dotimes (s5-1 (-> obj sphere-count)) + (format #t "~T [~D]~1Tsphere-id-array: ~D~%" s5-1 (-> obj sphere-id-array s5-1)) + ) + (format #t "~1Textra-nav-sphere: ~`vector`P~%" (-> obj extra-nav-sphere)) + (format #t "~1Troot-nav-sphere: ~`vector`P~%" (-> obj root-nav-sphere)) + (format #t "~1Tstate: #~%" (-> obj state)) + (format #t "~1Tmesh: ~A~%" (-> obj state mesh)) + (label cfg-25) + obj + ) + +;; failed to figure out what this is: +0 + + + + 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 new file mode 100644 index 0000000000..90a5185641 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/nav/nav-mesh-h_REF.gc @@ -0,0 +1,872 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type nav-mesh-work-debug +(deftype nav-mesh-work-debug (structure) + ((debug-vec1 vector :inline :offset-assert 0) + (debug-vec2 vector :inline :offset-assert 16) + (debug-vec3 vector :inline :offset-assert 32) + (debug-vec4 vector :inline :offset-assert 48) + (debug-vec5 vector :inline :offset-assert 64) + (debug-vec6 vector :inline :offset-assert 80) + (debug-vec7 vector :inline :offset-assert 96) + (debug-vec8 vector :inline :offset-assert 112) + (debug-vec9 vector :inline :offset-assert 128) + (debug-vec10 vector :inline :offset-assert 144) + (debug-vec11 vector :inline :offset-assert 160) + (debug-vec12 vector :inline :offset-assert 176) + (sphere-array sphere 16 :inline :offset-assert 192) + ) + :method-count-assert 9 + :size-assert #x1c0 + :flag-assert #x9000001c0 + ) + +;; definition for method 3 of type nav-mesh-work-debug +(defmethod inspect nav-mesh-work-debug ((obj nav-mesh-work-debug)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-mesh-work-debug) + (format #t "~1Tdebug-vec1: ~`vector`P~%" (-> obj debug-vec1)) + (format #t "~1Tdebug-vec2: ~`vector`P~%" (-> obj debug-vec2)) + (format #t "~1Tdebug-vec3: ~`vector`P~%" (-> obj debug-vec3)) + (format #t "~1Tdebug-vec4: ~`vector`P~%" (-> obj debug-vec4)) + (format #t "~1Tdebug-vec5: ~`vector`P~%" (-> obj debug-vec5)) + (format #t "~1Tdebug-vec6: ~`vector`P~%" (-> obj debug-vec6)) + (format #t "~1Tdebug-vec7: ~`vector`P~%" (-> obj debug-vec7)) + (format #t "~1Tdebug-vec8: ~`vector`P~%" (-> obj debug-vec8)) + (format #t "~1Tdebug-vec9: ~`vector`P~%" (-> obj debug-vec9)) + (format #t "~1Tdebug-vec10: ~`vector`P~%" (-> obj debug-vec10)) + (format #t "~1Tdebug-vec11: ~`vector`P~%" (-> obj debug-vec11)) + (format #t "~1Tdebug-vec12: ~`vector`P~%" (-> obj debug-vec12)) + (format #t "~1Tsphere-array[16] @ #x~X~%" (-> obj sphere-array)) + (label cfg-4) + obj + ) + +;; definition of type nav-mesh-work +(deftype nav-mesh-work (structure) + ((vert0-table int8 4 :offset-assert 0) + (vert1-table int8 4 :offset-assert 4) + (edge-mask-table uint8 3 :offset-assert 8) + (pad0 uint32 :offset-assert 12) + (deg-to-rad float :offset-assert 16) + (rad-to-deg float :offset-assert 20) + (nav-poly-min-dist float :offset-assert 24) + (nav-poly-epsilon float :offset-assert 28) + (sphere-array sphere 16 :inline :offset-assert 32) + (debug nav-mesh-work-debug :offset-assert 288) + (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) + (nav basic :offset-assert 300) + (poly0 basic :offset-assert 304) + (poly1 basic :offset-assert 308) + (poly-id int32 :offset-assert 312) + ) + :method-count-assert 9 + :size-assert #x13c + :flag-assert #x90000013c + ) + +;; definition for method 3 of type nav-mesh-work +(defmethod inspect nav-mesh-work ((obj nav-mesh-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-mesh-work) + (format #t "~1Tvert0-table[4] @ #x~X~%" (-> obj vert0-table)) + (format #t "~1Tvert1-table[4] @ #x~X~%" (-> obj vert1-table)) + (format #t "~1Tedge-mask-table[3] @ #x~X~%" (-> obj edge-mask-table)) + (format #t "~1Tpad0: ~D~%" (-> obj pad0)) + (format #t "~1Tdeg-to-rad: ~f~%" (-> obj deg-to-rad)) + (format #t "~1Trad-to-deg: ~f~%" (-> obj rad-to-deg)) + (format #t "~1Tnav-poly-min-dist: ~f~%" (-> obj nav-poly-min-dist)) + (format #t "~1Tnav-poly-epsilon: ~f~%" (-> obj nav-poly-epsilon)) + (format #t "~1Tsphere-array[16] @ #x~X~%" (-> obj sphere-array)) + (format #t "~1Tdebug: #~%" (-> obj debug)) + (format #t "~1Twork-struct-in-scratch: ~D~%" (-> obj work-struct-in-scratch)) + (format #t "~1Tmesh-struct-in-scratch: ~D~%" (-> obj mesh-struct-in-scratch)) + (format #t "~1Tpolys-in-scratch: ~D~%" (-> obj polys-in-scratch)) + (format #t "~1Tmesh: ~A~%" (-> obj mesh)) + (format #t "~1Tnav: ~A~%" (-> obj nav)) + (format #t "~1Tpoly0: ~A~%" (-> obj poly0)) + (format #t "~1Tpoly1: ~A~%" (-> obj poly1)) + (format #t "~1Tpoly-id: ~D~%" (-> obj poly-id)) + (label cfg-4) + obj + ) + +;; definition of type nav-mesh-link +(deftype nav-mesh-link (structure) + ((id uint32 :offset-assert 0) + (dest-mesh-id uint32 :offset-assert 4) + (src-link-poly-id uint8 :offset-assert 8) + (src-switch-poly-id uint8 :offset-assert 9) + (dest-link-poly-id uint8 :offset-assert 10) + (dest-switch-poly-id uint8 :offset-assert 11) + (dest-mesh basic :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-mesh-link +(defmethod inspect nav-mesh-link ((obj nav-mesh-link)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-mesh-link) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tdest-mesh-id: ~D~%" (-> obj dest-mesh-id)) + (format #t "~1Tsrc-link-poly-id: ~D~%" (-> obj src-link-poly-id)) + (format #t "~1Tsrc-switch-poly-id: ~D~%" (-> obj src-switch-poly-id)) + (format #t "~1Tdest-link-poly-id: ~D~%" (-> obj dest-link-poly-id)) + (format #t "~1Tdest-switch-poly-id: ~D~%" (-> obj dest-switch-poly-id)) + (format #t "~1Tdest-mesh: ~A~%" (-> obj dest-mesh)) + (label cfg-4) + obj + ) + +;; definition of type nav-poly +(deftype nav-poly (structure) + ((data uint8 64 :offset-assert 0) + (vertex vector 4 :inline :offset 0) + (vertex0 vector :inline :offset 0) + (vertex1 vector :inline :offset 16) + (vertex2 vector :inline :offset 32) + (vertex3 vector :inline :offset 48) + (id uint8 :offset 12) + (pat uint8 :offset 13) + (vertex-count uint8 :offset 14) + (link uint8 :offset 15) + (adj-poly uint8 4 :offset 28) + (adj-poly0 uint8 :offset 28) + (adj-poly1 uint8 :offset 29) + (adj-poly2 uint8 :offset 30) + (adj-poly3 uint8 :offset 31) + (min-y float :offset 44) + (max-y float :offset 60) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type nav-poly +(defmethod inspect nav-poly ((obj nav-poly)) + (when (not obj) + (set! obj obj) + (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 "~1Tvertex1: ~`vector`P~%" (-> obj vertex1)) + (format #t "~1Tvertex2: ~`vector`P~%" (-> obj vertex2)) + (format #t "~1Tvertex3: ~`vector`P~%" (-> obj vertex3)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tpat: ~D~%" (-> obj pat)) + (format #t "~1Tvertex-count: ~D~%" (-> obj vertex-count)) + (format #t "~1Tlink: ~D~%" (-> obj link)) + (format #t "~1Tadj-poly[4] @ #x~X~%" (&-> obj vertex1 w)) + (format #t "~1Tadj-poly0: ~D~%" (-> obj adj-poly0)) + (format #t "~1Tadj-poly1: ~D~%" (-> obj adj-poly1)) + (format #t "~1Tadj-poly2: ~D~%" (-> obj adj-poly2)) + (format #t "~1Tadj-poly3: ~D~%" (-> obj adj-poly3)) + (format #t "~1Tmin-y: ~f~%" (-> obj vertex2 w)) + (format #t "~1Tmax-y: ~f~%" (-> obj vertex3 w)) + (label cfg-4) + obj + ) + +;; definition of type nav-vertex +(deftype nav-vertex (vector) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-vertex +;; INFO: Used lq/sq +(defmethod inspect nav-vertex ((obj nav-vertex)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-vertex) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (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 "~1Tquad: ~D~%" (-> obj quad)) + (label cfg-4) + obj + ) + +;; definition of type nav-sphere +(deftype nav-sphere (structure) + ((trans sphere :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type nav-sphere +(defmethod inspect nav-sphere ((obj nav-sphere)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-sphere) + (format #t "~1Ttrans: #~%" (-> obj trans)) + (label cfg-4) + obj + ) + +;; definition of type nav-ray +(deftype nav-ray (structure) + ((current-pos vector :inline :offset-assert 0) + (dir vector :inline :offset-assert 16) + (dest-pos vector :inline :offset-assert 32) + (current-poly nav-poly :offset-assert 48) + (next-poly nav-poly :offset-assert 52) + (len meters :offset-assert 56) + (last-edge int8 :offset-assert 60) + (ignore uint8 :offset-assert 61) + (terminated symbol :offset-assert 64) + (reached-dest symbol :offset-assert 68) + (hit-boundary symbol :offset-assert 72) + (hit-gap symbol :offset-assert 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type nav-ray +(defmethod inspect nav-ray ((obj nav-ray)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-ray) + (format #t "~1Tcurrent-pos: #~%" (-> obj current-pos)) + (format #t "~1Tdir: #~%" (-> obj dir)) + (format #t "~1Tdest-pos: #~%" (-> obj dest-pos)) + (format #t "~1Tcurrent-poly: #~%" (-> obj current-poly)) + (format #t "~1Tnext-poly: #~%" (-> obj next-poly)) + (format #t "~1Tlen: (meters ~m)~%" (-> obj len)) + (format #t "~1Tlast-edge: ~D~%" (-> obj last-edge)) + (format #t "~1Tignore: ~D~%" (-> obj ignore)) + (format #t "~1Tterminated: ~A~%" (-> obj terminated)) + (format #t "~1Treached-dest: ~A~%" (-> obj reached-dest)) + (format #t "~1Thit-boundary: ~A~%" (-> obj hit-boundary)) + (format #t "~1Thit-gap: ~A~%" (-> obj hit-gap)) + (label cfg-4) + obj + ) + +;; definition of type nav-route-portal +(deftype nav-route-portal (structure) + ((vertex nav-vertex 2 :inline :offset-assert 0) + (next-poly nav-poly :offset-assert 32) + (edge-index int8 :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x25 + :flag-assert #x900000025 + ) + +;; definition for method 3 of type nav-route-portal +(defmethod inspect nav-route-portal ((obj nav-route-portal)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-route-portal) + (format #t "~1Tvertex[2] @ #x~X~%" (-> obj vertex)) + (format #t "~1Tnext-poly: #~%" (-> obj next-poly)) + (format #t "~1Tedge-index: ~D~%" (-> obj edge-index)) + (label cfg-4) + obj + ) + +;; definition of type nav-find-poly-parms +(deftype nav-find-poly-parms (structure) + ((point vector :inline :offset-assert 0) + (y-threshold float :offset-assert 16) + (ignore uint8 :offset-assert 20) + (poly nav-poly :offset-assert 24) + (dist float :offset-assert 28) + (point-inside? symbol :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type nav-find-poly-parms +(defmethod inspect nav-find-poly-parms ((obj nav-find-poly-parms)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'nav-find-poly-parms) + (format #t "~1Tpoint: #~%" (-> obj point)) + (format #t "~1Ty-threshold: ~f~%" (-> obj y-threshold)) + (format #t "~1Tignore: ~D~%" (-> obj ignore)) + (format #t "~1Tpoly: #~%" (-> obj poly)) + (format #t "~1Tdist: ~f~%" (-> obj dist)) + (format #t "~1Tpoint-inside?: ~A~%" (-> obj point-inside?)) + (label cfg-4) + obj + ) + +;; definition of type clamp-travel-vector-to-mesh-return-info +(deftype clamp-travel-vector-to-mesh-return-info (structure) + ((found-boundary basic :offset-assert 0) + (intersection vector :inline :offset-assert 16) + (boundary-normal vector :inline :offset-assert 32) + (prev-normal vector :inline :offset-assert 48) + (next-normal vector :inline :offset-assert 64) + (poly nav-poly :offset-assert 80) + (gap-poly nav-poly :offset-assert 84) + (edge int8 :offset-assert 88) + (ignore uint8 :offset-assert 89) + (vert-prev vector :inline :offset-assert 96) + (vert-0 vector :inline :offset-assert 112) + (vert-1 vector :inline :offset-assert 128) + (vert-next vector :inline :offset-assert 144) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +;; definition for method 3 of type clamp-travel-vector-to-mesh-return-info +(defmethod inspect clamp-travel-vector-to-mesh-return-info ((obj clamp-travel-vector-to-mesh-return-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'clamp-travel-vector-to-mesh-return-info) + (format #t "~1Tfound-boundary: ~A~%" (-> obj found-boundary)) + (format #t "~1Tintersection: #~%" (-> obj intersection)) + (format #t "~1Tboundary-normal: #~%" (-> obj boundary-normal)) + (format #t "~1Tprev-normal: #~%" (-> obj prev-normal)) + (format #t "~1Tnext-normal: #~%" (-> obj next-normal)) + (format #t "~1Tpoly: #~%" (-> obj poly)) + (format #t "~1Tgap-poly: #~%" (-> obj gap-poly)) + (format #t "~1Tedge: ~D~%" (-> obj edge)) + (format #t "~1Tignore: ~D~%" (-> obj ignore)) + (format #t "~1Tvert-prev: #~%" (-> obj vert-prev)) + (format #t "~1Tvert-0: #~%" (-> obj vert-0)) + (format #t "~1Tvert-1: #~%" (-> obj vert-1)) + (format #t "~1Tvert-next: #~%" (-> obj vert-next)) + (label cfg-4) + obj + ) + +;; 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) + ) + :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) + (move-along-nav-ray! (_type_ nav-ray) none 16) + (nav-mesh-method-17 () none 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-35 () none 35) + (nav-mesh-method-36 () none 36) + (point-in-poly? (_type_ nav-poly vector) symbol 37) + (nav-mesh-method-38 () none 38) + (closest-point-on-boundary (_type_ nav-poly vector vector) none 39) + (nav-mesh-method-40 () 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) + ) + ) + +;; definition for method 3 of type nav-mesh +(defmethod inspect nav-mesh ((obj nav-mesh)) + (when (not obj) + (set! obj obj) + (goto cfg-6) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twork: #~%" (-> obj work)) + (format #t "~1Tpoly-array: #x~X~%" (-> obj poly-array)) + (format #t "~1Tstatic-sphere-count: ~D~%" (-> obj static-sphere-count)) + (format #t "~1Tpoly-count: ~D~%" (-> obj poly-count)) + (format #t "~1Tnav-control-count: ~D~%" (-> obj nav-control-count)) + (format #t "~1Tmax-nav-control-count: ~D~%" (-> obj max-nav-control-count)) + (format #t "~1Troute: #x~X~%" (-> obj route)) + (format #t "~1Tpoly-hash: ~A~%" (-> obj poly-hash)) + (format #t "~1Tnav-control-array: #x~X~%" (-> obj nav-control-array)) + (format #t "~1Tsphere-hash: ~A~%" (-> obj sphere-hash)) + (format #t "~1Tstatic-sphere: #x~X~%" (-> obj static-sphere)) + (format #t "~1Tuser-list: ~A~%" (-> obj user-list)) + (format #t "~1Tnext-nav-mesh: ~A~%" (-> obj next-nav-mesh)) + (format #t "~1Tprev-nav-mesh: ~A~%" (-> obj prev-nav-mesh)) + (format #t "~1Tbounds: ~`sphere`P~%" (-> obj bounds)) + (format #t "~1Torigin: #~%" (-> obj bounds)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tlink-array: #x~X~%" (-> obj link-array)) + (format #t "~1Tlink-count: ~D~%" (-> obj link-count)) + (format #t "~1Tflags: #x~X : (nav-mesh-flag " (-> obj flags)) + (let ((a0-22 (-> obj flags))) + (if (= (logand a0-22 (nav-mesh-flag dummy)) (nav-mesh-flag dummy)) + (format #t "dummy ") + ) + ) + (format #t ")~%") + (format #t "~1Tpad1[2] @ #x~X~%" (-> obj pad1)) + (format #t "~1Tnearest-y-threshold: (meters ~m)~%" (-> obj nearest-y-threshold)) + (format #t "~1Twater-max-height: (meters ~m)~%" (-> obj water-max-height)) + (format #t "~1Tpad2[7] @ #x~X~%" (-> obj pad2)) + (label cfg-6) + obj + ) + +;; definition for function vector-normalize-unity! +(defun vector-normalize-unity! ((arg0 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (let ((v0-0 arg0)) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v0-0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-1 f0-0)) + (.mov vf3 v1-1) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v0-0 quad) vf1) + v0-0 + ) + ) + ) + +;; definition for function vector-normalize-unity-copy! +;; INFO: Used lq/sq +(defun vector-normalize-unity-copy! ((arg0 vector) (arg1 vector)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (set! (-> arg0 quad) (-> arg1 quad)) + (let ((v0-0 arg0)) + (let ((f0-0 1.0)) + (.lvf vf1 (&-> v0-0 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((v1-2 f0-0)) + (.mov vf3 v1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v0-0 quad) vf1) + v0-0 + ) + ) + ) + +;; definition (debug) for function debug-validate-current-poly +(defun-debug debug-validate-current-poly () + #f + ) + +;; definition for function init-ray +;; INFO: Return type mismatch int vs none. +(defun init-ray ((arg0 nav-ray)) + (rlet ((acc :class vf) + (Q :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (init-vf0-vector) + (vector-! (-> arg0 dir) (-> arg0 dest-pos) (-> arg0 current-pos)) + (set! (-> arg0 dir y) 0.0) + (let ((v1-1 (-> arg0 dir))) + (let ((f0-1 1.0)) + (.lvf vf1 (&-> v1-1 quad)) + (.mul.vf vf2 vf1 vf1 :mask #b111) + (let ((a1-2 f0-1)) + (.mov vf3 a1-2) + ) + ) + (.mul.x.vf acc vf0 vf2 :mask #b1000) + (.add.mul.y.vf acc vf0 vf2 acc :mask #b1000) + (.add.mul.z.vf vf2 vf0 vf2 acc :mask #b1000) + (.isqrt.vf Q vf3 vf2 :fsf #b0 :ftf #b11) + (.wait.vf) + (.mul.vf vf1 vf1 Q :mask #b111) + (.nop.vf) + (.nop.vf) + (.nop.vf) + (.svf (&-> v1-1 quad) vf1) + ) + (set! (-> arg0 next-poly) #f) + (set! (-> arg0 len) 0.0) + (set! (-> arg0 last-edge) -1) + (set! (-> arg0 terminated) #f) + (set! (-> arg0 reached-dest) #f) + (set! (-> arg0 hit-boundary) #f) + (set! (-> arg0 hit-gap) #f) + (set! (-> arg0 ignore) (the-as uint 3)) + 0 + (none) + ) + ) + +;; definition for function point-poly-intersection? +(defun point-poly-intersection? ((arg0 nav-mesh) (arg1 vector) (arg2 int) (arg3 (inline-array vector))) + (let ((v1-1 (-> arg0 work vert0-table)) + (a0-2 (-> arg0 work vert1-table)) + ) + (dotimes (t0-0 arg2) + (let* ((t1-3 (-> arg3 (-> v1-1 t0-0))) + (t2-3 (-> arg3 (-> a0-2 t0-0))) + (f0-1 (- (-> t1-3 z) (-> t2-3 z))) + (f1-2 (- (-> t2-3 x) (-> t1-3 x))) + (f2-2 (- (-> arg1 x) (-> t1-3 x))) + (f3-2 (- (-> arg1 z) (-> t1-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (if (< 0.0 f0-3) + (return #f) + ) + ) + ) + ) + #t + ) + +;; definition for method 37 of type nav-mesh +(defmethod point-in-poly? nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector)) + (let* ((a3-0 obj) + (v1-0 arg1) + (a0-1 (-> arg0 vertex-count)) + (a1-1 (-> arg0 vertex)) + (a2-2 (-> a3-0 work vert0-table)) + (a3-2 (-> a3-0 work vert1-table)) + ) + (dotimes (t0-0 (the-as int a0-1)) + (let* ((t1-3 (-> a1-1 (-> a2-2 t0-0))) + (t2-3 (-> a1-1 (-> a3-2 t0-0))) + (f0-1 (- (-> t1-3 z) (-> t2-3 z))) + (f1-2 (- (-> t2-3 x) (-> t1-3 x))) + (f2-2 (- (-> v1-0 x) (-> t1-3 x))) + (f3-2 (- (-> v1-0 z) (-> t1-3 z))) + (f0-3 (+ (* f2-2 f0-1) (* f3-2 f1-2))) + ) + (if (< 0.0 f0-3) + (return #f) + ) + ) + ) + ) + #t + ) + +;; definition for method 39 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; INFO: Return type mismatch vector vs none. +(defmethod closest-point-on-boundary nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) + (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)) + (set! sv-56 (the-as float 10000000000000000000000000000000000000.0)) + (let* ((s3-0 (-> arg0 vertex-count)) + (v1-3 (the-as int (+ s3-0 -1))) + ) + (dotimes (s2-0 (the-as int s3-0)) + (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-3) (-> arg0 vertex s2-0) sv-48))) + (when (< f0-1 sv-56) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-3 s2-0) + ) + ) + (set! (-> arg1 quad) (-> sv-52 quad)) + (none) + ) + +;; definition for method 41 of type nav-mesh +;; INFO: Used lq/sq +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; WARN: Stack slot offset 56 signed mismatch +;; INFO: Return type mismatch vector vs none. +(defmethod project-point-into-poly-2d nav-mesh ((obj nav-mesh) (arg0 nav-poly) (arg1 vector) (arg2 vector)) + (local-vars (sv-48 vector) (sv-52 vector) (sv-56 float)) + (cond + ((point-in-poly? obj arg0 arg2) + (set! (-> arg1 quad) (-> arg2 quad)) + ) + (else + (let ((s5-1 arg1)) + (set! sv-48 (new 'stack-no-clear 'vector)) + (set! sv-52 (new 'stack-no-clear 'vector)) + (set! sv-56 (the-as float 10000000000000000000000000000000000000.0)) + (let* ((s2-0 (-> arg0 vertex-count)) + (v1-6 (the-as int (+ s2-0 -1))) + ) + (dotimes (s1-0 (the-as int s2-0)) + (let ((f0-1 (vector-segment-distance-point! arg2 (-> arg0 vertex v1-6) (-> arg0 vertex s1-0) sv-48))) + (when (< f0-1 sv-56) + (set! sv-56 f0-1) + (set! (-> sv-52 quad) (-> sv-48 quad)) + ) + ) + (set! v1-6 s1-0) + ) + ) + (set! (-> s5-1 quad) (-> sv-52 quad)) + ) + ) + ) + (none) + ) + +;; definition for method 16 of type nav-mesh +;; INFO: Used lq/sq +;; 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 +;; INFO: Return type mismatch int vs none. +(defmethod move-along-nav-ray! nav-mesh ((obj nav-mesh) (ray nav-ray)) + (local-vars + (next-poly-idx int) + (work nav-mesh-work) + (current-poly nav-poly) + (current-poly-vtx-count uint8) + (v0-table (pointer int8)) + (v1-table (pointer int8)) + (delta-x float) + (delta-z float) + (adj-vtx-0 vector) + (adj-vtx-1 vector) + (adj-edge-dz float) + (adj-edge-minus-dx float) + (sv-68 uint) + ) + (set! next-poly-idx -1) + (set! work (-> obj work)) + (set! current-poly (-> ray current-poly)) + (set! current-poly-vtx-count (-> ray current-poly vertex-count)) + (set! v0-table (-> obj work vert0-table)) + (set! v1-table (-> obj work vert1-table)) + (set! delta-x (- (-> ray dest-pos x) (-> ray current-pos x))) + (set! delta-z (- (-> ray dest-pos z) (-> ray current-pos z))) + (dotimes (i (the-as int current-poly-vtx-count)) + (set! adj-vtx-0 (-> current-poly vertex (-> v0-table i))) + (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 ((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 heading-dot) + (set! next-poly-idx i) + (let ((f0-12 (fmax 0.0 (/ f1-10 heading-dot)))) + (set! delta-x (* delta-x f0-12)) + (set! delta-z (* delta-z f0-12)) + ) + ) + ) + ) + ) + ) + (let ((f0-16 (+ (* delta-x (-> ray dir x)) (* delta-z (-> ray dir z))))) + (+! (-> ray len) f0-16) + ) + 0 + (set! (-> ray next-poly) #f) + (cond + ((= next-poly-idx -1) + (set! (-> ray current-pos quad) (-> ray dest-pos quad)) + (set! (-> ray reached-dest) #t) + (set! (-> ray terminated) #t) + ) + (else + (+! (-> ray current-pos x) delta-x) + (+! (-> 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)) + ) + (cond + ((and (-> ray next-poly) (zero? (logand (-> ray next-poly pat) (-> ray ignore)))) + (set! (-> ray current-poly) (-> ray next-poly)) + ) + (else + (set! (-> ray last-edge) next-poly-idx) + (if (-> ray next-poly) + (set! (-> ray hit-gap) #t) + (set! (-> ray hit-boundary) #t) + ) + (set! (-> ray terminated) #t) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition (debug) for function nav-sphere-from-cam +;; INFO: 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)) + ) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc new file mode 100644 index 0000000000..93987961fd --- /dev/null +++ b/test/decompiler/reference/jak2/engine/physics/chain-physics-h_REF.gc @@ -0,0 +1,117 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type chain-physics-setup +(deftype chain-physics-setup (structure) + ((joint-index int32 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type chain-physics-setup +(defmethod inspect chain-physics-setup ((obj chain-physics-setup)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'chain-physics-setup) + (format #t "~1Tjoint-index: ~D~%" (-> obj joint-index)) + (label cfg-4) + obj + ) + +;; definition of type chain-physics-joint +(deftype chain-physics-joint (structure) + ((position vector :inline :offset-assert 0) + (velocity vector :inline :offset-assert 16) + (old-x vector :inline :offset-assert 32) + (joint-mod basic :offset-assert 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type chain-physics-joint +(defmethod inspect chain-physics-joint ((obj chain-physics-joint)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'chain-physics-joint) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Tvelocity: #~%" (-> obj velocity)) + (format #t "~1Told-x: #~%" (-> obj old-x)) + (format #t "~1Tjoint-mod: ~A~%" (-> obj joint-mod)) + (label cfg-4) + obj + ) + +;; definition of type chain-physics +(deftype chain-physics (basic) + ((chain-joints chain-physics-joint 20 :inline :offset-assert 16) + (num-joints uint8 :offset-assert 1296) + (root-joint-index uint8 :offset-assert 1297) + (joint-length float :offset-assert 1300) + (gravity vector :inline :offset-assert 1312) + (gravity-target vector :inline :offset-assert 1328) + (stretch-vel float :offset-assert 1344) + (stretch-vel-parallel float :offset-assert 1348) + (compress-vel float :offset-assert 1352) + (compress-vel-parallel float :offset-assert 1356) + (negate-y basic :offset-assert 1360) + (axial-slop float :offset-assert 1364) + (maximum-stretch float :offset-assert 1368) + (turn-off-start uint64 :offset-assert 1376) + (turn-off-duration uint64 :offset-assert 1384) + ) + :method-count-assert 18 + :size-assert #x570 + :flag-assert #x1200000570 + (:methods + (chain-physics-method-9 () none 9) + (chain-physics-method-10 () none 10) + (chain-physics-method-11 () none 11) + (chain-physics-method-12 () none 12) + (chain-physics-method-13 () none 13) + (chain-physics-method-14 () none 14) + (chain-physics-method-15 () none 15) + (chain-physics-method-16 () none 16) + (chain-physics-method-17 () none 17) + ) + ) + +;; definition for method 3 of type chain-physics +(defmethod inspect chain-physics ((obj chain-physics)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> obj chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> obj num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> obj root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> obj joint-length)) + (format #t "~1Tgravity: #~%" (-> obj gravity)) + (format #t "~1Tgravity-target: #~%" (-> obj gravity-target)) + (format #t "~1Tstretch-vel: ~f~%" (-> obj stretch-vel)) + (format #t "~1Tstretch-vel-parallel: ~f~%" (-> obj stretch-vel-parallel)) + (format #t "~1Tcompress-vel: ~f~%" (-> obj compress-vel)) + (format #t "~1Tcompress-vel-parallel: ~f~%" (-> obj compress-vel-parallel)) + (format #t "~1Tnegate-y: ~A~%" (-> obj negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> obj axial-slop)) + (format #t "~1Tmaximum-stretch: ~f~%" (-> obj maximum-stretch)) + (format #t "~1Tturn-off-start: ~D~%" (-> obj turn-off-start)) + (format #t "~1Tturn-off-duration: ~D~%" (-> obj turn-off-duration)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc new file mode 100644 index 0000000000..2ed6bcef1f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/physics/dynamics-h_REF.gc @@ -0,0 +1,85 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type dynamics +(deftype dynamics (basic) + ((name symbol :offset-assert 4) + (gravity-max meters :offset-assert 8) + (gravity-length meters :offset-assert 12) + (gravity vector :inline :offset-assert 16) + (gravity-normal vector :inline :offset-assert 32) + (walk-distance meters :offset-assert 48) + (run-distance meters :offset-assert 52) + ) + :method-count-assert 10 + :size-assert #x38 + :flag-assert #xa00000038 + (:methods + (set-gravity-length (_type_ float) none 9) + ) + ) + +;; definition for method 3 of type dynamics +(defmethod inspect dynamics ((obj dynamics)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tgravity-max: (meters ~m)~%" (-> obj gravity-max)) + (format #t "~1Tgravity-length: (meters ~m)~%" (-> obj gravity-length)) + (format #t "~1Tgravity: ~`vector`P~%" (-> obj gravity)) + (format #t "~1Tgravity-normal: ~`vector`P~%" (-> obj gravity-normal)) + (format #t "~1Twalk-distance: (meters ~m)~%" (-> obj walk-distance)) + (format #t "~1Trun-distance: (meters ~m)~%" (-> obj run-distance)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type dynamics +;; INFO: Return type mismatch int vs none. +(defmethod set-gravity-length dynamics ((obj dynamics) (arg0 float)) + (set! (-> obj gravity-length) arg0) + (vector-float*! (-> obj gravity) (-> obj gravity-normal) arg0) + 0 + (none) + ) + +;; definition for function time-to-apex +(defun time-to-apex ((arg0 float) (arg1 float)) + (the int (/ arg0 (- (* 0.0033333334 arg1)))) + ) + +;; definition for function time-to-ground +(defun time-to-ground ((arg0 float) (arg1 float) (arg2 float)) + (let ((f0-0 0.0) + (v0-0 0) + ) + (while (< (- arg2) f0-0) + (set! arg0 (- arg0 (* 0.0033333334 arg1))) + (+! f0-0 (* 0.0033333334 arg0)) + (+! v0-0 1) + ) + v0-0 + ) + ) + +;; definition for symbol *standard-dynamics*, type dynamics +(define *standard-dynamics* (new 'static 'dynamics + :name 'standard + :gravity-max (meters 40) + :gravity-length (meters 60) + :gravity (new 'static 'vector :y 245760.0 :w 1.0) + :gravity-normal (new 'static 'vector :y 1.0 :w 1.0) + :walk-distance (meters 2) + :run-distance (meters 5) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/physics/gravity-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/gravity-h_REF.gc new file mode 100644 index 0000000000..8e4b1f21d4 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/physics/gravity-h_REF.gc @@ -0,0 +1,9 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc b/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc new file mode 100644 index 0000000000..0c02d2c345 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/physics/trajectory-h_REF.gc @@ -0,0 +1,270 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type trajectory +(deftype trajectory (structure) + ((initial-position vector :inline :offset-assert 0) + (initial-velocity vector :inline :offset-assert 16) + (time float :offset-assert 32) + (gravity meters :offset-assert 36) + ) + :method-count-assert 18 + :size-assert #x28 + :flag-assert #x1200000028 + (:methods + (compute-trans-at-time (_type_ float vector) vector 9) + (compute-transv-at-time (_type_ float vector) vector 10) + (compute-time-until-apex (_type_) float 11) + (setup-from-to-duration! (_type_ vector vector float float) none 12) + (setup-from-to-xz-vel! (_type_ vector vector float float) none 13) + (setup-from-to-y-vel! (_type_ vector vector float float) none 14) + (setup-from-to-height! (_type_ vector vector float float) none 15) + (setup-from-to-duration-and-height! (_type_ vector vector float float) none 16) + (debug-draw (_type_) none 17) + ) + ) + +;; definition for method 3 of type trajectory +(defmethod inspect trajectory ((obj trajectory)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trajectory) + (format #t "~1Tinitial-position: ~`vector`P~%" (-> obj initial-position)) + (format #t "~1Tinitial-velocity: ~`vector`P~%" (-> obj initial-velocity)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Tgravity: (meters ~m)~%" (-> obj gravity)) + (label cfg-4) + obj + ) + +;; definition of type impact-control +(deftype impact-control (structure) + ((process (pointer process-drawable) :offset-assert 0) + (radius float :offset-assert 4) + (joint int32 :offset-assert 8) + (collide-with collide-spec :offset-assert 12) + (start-time time-frame :offset-assert 16) + (trans vector 2 :inline :offset-assert 32) + (dir vector :inline :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x50 + :flag-assert #xc00000050 + (:methods + (new (symbol type process-drawable int float collide-spec) _type_ 0) + (initialize (_type_ process-drawable int float collide-spec) impact-control :behavior process 9) + (update-from-cspace (_type_) none 10) + (impact-control-method-11 () none 11) + ) + ) + +;; definition for method 3 of type impact-control +(defmethod inspect impact-control ((obj impact-control)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj 'impact-control) + (format #t "~1Tprocess: #x~X~%" (-> obj process)) + (format #t "~1Tradius: (meters ~m)~%" (-> obj radius)) + (format #t "~1Tjoint: ~D~%" (-> obj joint)) + (format #t "~1Tcollide-with: ~D~%" (-> obj collide-with)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Ttrans[2] @ #x~X~%" (-> obj trans)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> obj trans s5-0)) + ) + (format #t "~1Tdir: ~`vector`P~%" (-> obj dir)) + (label cfg-7) + obj + ) + +;; definition for method 0 of type impact-control +(defmethod new impact-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type impact-control initialize) + (the-as impact-control (t9-0 allocation v1-1)) + arg0 + arg1 + arg2 + arg3 + ) + ) + ) + +;; definition of type point-tracker +(deftype point-tracker (structure) + ((trans vector 2 :inline :offset-assert 0) + ) + :method-count-assert 12 + :size-assert #x20 + :flag-assert #xc00000020 + (:methods + (new (symbol type vector vector) _type_ 0) + (initialize (_type_ vector vector) point-tracker 9) + (point-tracker-method-10 () none 10) + (point-tracker-method-11 () none 11) + ) + ) + +;; definition for method 3 of type point-tracker +(defmethod inspect point-tracker ((obj point-tracker)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj 'point-tracker) + (format #t "~1Ttrans[2] @ #x~X~%" (-> obj trans)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> obj trans s5-0)) + ) + (label cfg-7) + obj + ) + +;; definition for method 0 of type point-tracker +(defmethod new point-tracker ((allocation symbol) (type-to-make type) (arg0 vector) (arg1 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + ((method-of-type point-tracker initialize) (the-as point-tracker (t9-0 allocation v1-1)) arg0 arg1) + ) + ) + +;; definition of type combo-tracker +(deftype combo-tracker (point-tracker) + ((target handle :offset-assert 32) + (move-start-time time-frame :offset-assert 40) + ) + :method-count-assert 14 + :size-assert #x30 + :flag-assert #xe00000030 + (:methods + (combo-tracker-method-12 () none 12) + (combo-tracker-method-13 () none 13) + ) + ) + +;; definition for method 3 of type combo-tracker +(defmethod inspect combo-tracker ((obj combo-tracker)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj 'combo-tracker) + (format #t "~1Ttrans[2] @ #x~X~%" (-> obj trans)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Ttrans: ~`vector`P~%" s5-0 (-> obj trans s5-0)) + ) + (format #t "~1Ttarget: ~D~%" (-> obj target)) + (format #t "~1Tmove-start-time: ~D~%" (-> obj move-start-time)) + (label cfg-7) + obj + ) + +;; definition of type traj2d-params +(deftype traj2d-params (structure) + ((x float :offset-assert 0) + (y float :offset-assert 4) + (gravity float :offset-assert 8) + (initial-tilt float :offset-assert 12) + (initial-speed float :offset-assert 16) + (time float :offset-assert 20) + ) + :method-count-assert 9 + :size-assert #x18 + :flag-assert #x900000018 + ) + +;; definition for method 3 of type traj2d-params +(defmethod inspect traj2d-params ((obj traj2d-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'traj2d-params) + (format #t "~1Tx: ~f~%" (-> obj x)) + (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "~1Tgravity: ~f~%" (-> obj gravity)) + (format #t "~1Tinitial-tilt: ~f~%" (-> obj initial-tilt)) + (format #t "~1Tinitial-speed: ~f~%" (-> obj initial-speed)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (label cfg-4) + obj + ) + +;; definition of type traj3d-params +(deftype traj3d-params (structure) + ((gravity float :offset-assert 0) + (initial-tilt float :offset-assert 4) + (initial-speed float :offset-assert 8) + (time float :offset-assert 12) + (src vector :inline :offset-assert 16) + (dest vector :inline :offset-assert 32) + (diff vector :inline :offset-assert 48) + (initial-velocity vector :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type traj3d-params +(defmethod inspect traj3d-params ((obj traj3d-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'traj3d-params) + (format #t "~1Tgravity: ~f~%" (-> obj gravity)) + (format #t "~1Tinitial-tilt: ~f~%" (-> obj initial-tilt)) + (format #t "~1Tinitial-speed: ~f~%" (-> obj initial-speed)) + (format #t "~1Ttime: ~f~%" (-> obj time)) + (format #t "~1Tsrc: #~%" (-> obj src)) + (format #t "~1Tdest: #~%" (-> obj dest)) + (format #t "~1Tdiff: #~%" (-> obj diff)) + (format #t "~1Tinitial-velocity: #~%" (-> obj initial-velocity)) + (label cfg-4) + obj + ) + +;; definition of type cubic-curve +(deftype cubic-curve (structure) + ((mat matrix :inline :offset-assert 0) + ) + :method-count-assert 14 + :size-assert #x40 + :flag-assert #xe00000040 + (:methods + (cubic-curve-method-9 () none 9) + (cubic-curve-method-10 () none 10) + (cubic-curve-method-11 () none 11) + (cubic-curve-method-12 () none 12) + (cubic-curve-method-13 () none 13) + ) + ) + +;; definition for method 3 of type cubic-curve +(defmethod inspect cubic-curve ((obj cubic-curve)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'cubic-curve) + (format #t "~1Tmat: #~%" (-> obj mat)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc new file mode 100644 index 0000000000..28f6169c3f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-drawable-h_REF.gc @@ -0,0 +1,213 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function cspace-by-name-no-fail +;; INFO: Return type mismatch object vs cspace. +(defun cspace-by-name-no-fail ((arg0 process-drawable) (arg1 string)) + (let ((v0-0 (the-as object (cspace-by-name arg0 arg1)))) + (the-as cspace (cond + ((the-as cspace v0-0) + (empty) + v0-0 + ) + (else + (format 0 "no cspace (~A)~%" arg1) + (-> arg0 node-list data) + ) + ) + ) + ) + ) + +;; definition for function cspace-index-by-name-no-fail +(defun cspace-index-by-name-no-fail ((arg0 process-drawable) (arg1 string)) + (let ((v0-0 (cspace-index-by-name arg0 arg1))) + (cond + ((< v0-0 0) + (format 0 "no cspace[ndx] (~A)~%" arg1) + 0 + ) + (else + (empty) + v0-0 + ) + ) + ) + ) + +;; definition for function num-func-none +(defun num-func-none ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (-> arg0 frame-num) + ) + +;; definition for function num-func-+! +(defun num-func-+! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f0-1 (+ (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))))) + (set! (-> arg0 frame-num) f0-1) + f0-1 + ) + ) + ) + +;; definition for function num-func--! +(defun num-func--! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f0-1 (- (-> arg0 frame-num) (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))))) + (set! (-> arg0 frame-num) f0-1) + f0-1 + ) + ) + ) + +;; definition for function num-func-loop! +(defun num-func-loop! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f1-2 (+ (-> arg0 frame-num) f0-1 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio))))) + (f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + (set! (-> arg0 frame-num) f0-3) + f0-3 + ) + ) + ) + +;; definition for function num-func-loop-speedless! +(defun num-func-loop-speedless! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (let* ((f0-1 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f1-2 (+ (-> arg0 frame-num) f0-1 arg1)) + (f0-3 (- f1-2 (* (the float (the int (/ f1-2 f0-1))) f0-1))) + ) + (set! (-> arg0 frame-num) f0-3) + f0-3 + ) + ) + +;; definition for function num-func-seek! +(defun num-func-seek! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f0-3 + (seek (-> arg0 frame-num) arg1 (* arg2 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))) + ) + ) + (set! (-> arg0 frame-num) f0-3) + f0-3 + ) + ) + ) + +;; definition for function num-func-blend-in! +(defun num-func-blend-in! ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (with-pp + (let ((f30-0 (seek (-> arg0 frame-interp 0) 1.0 (* arg1 (-> pp clock time-adjust-ratio))))) + (set! (-> arg0 frame-interp 0) f30-0) + (set! (-> arg0 frame-interp 1) f30-0) + (if (= f30-0 1.0) + (joint-control-reset! (-> arg0 parent) arg0) + ) + f30-0 + ) + ) + ) + +;; definition for function joint-channel-float-delete! +;; INFO: Return type mismatch int vs none. +(defun joint-channel-float-delete! ((arg0 joint-control-channel)) + (let ((v1-0 (-> arg0 parent))) + (+! (-> v1-0 float-channels) -1) + (when (nonzero? (-> v1-0 float-channels)) + (let ((a1-5 (/ (&- (the-as pointer arg0) (the-as uint (the-as pointer (-> v1-0 channel)))) 64))) + (if (< a1-5 (the-as int (+ (-> v1-0 active-channels) (-> v1-0 float-channels)))) + (qmem-copy<-! + (the-as pointer (-> v1-0 channel a1-5)) + (the-as pointer (-> v1-0 channel (+ a1-5 1))) + (the-as int (* (-> v1-0 float-channels) 64)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function num-func-interp-play! +(defun num-func-interp-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (with-pp + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 0) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 0) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 0) arg2) + ) + ) + ) + (set! (-> arg0 frame-interp 1) (-> arg0 frame-interp 0)) + (-> arg0 frame-num) + ) + ) + +;; definition for function num-func-interp1-play! +(defun num-func-interp1-play! ((arg0 joint-control-channel) (arg1 float) (arg2 float) (arg3 float)) + (with-pp + (let ((f30-0 (the float (+ (-> arg0 frame-group frames num-frames) -1))) + (f28-0 (* arg3 (-> arg0 frame-group speed))) + ) + (seek! (-> arg0 frame-num) f30-0 (* arg1 (* (-> arg0 frame-group speed) (-> pp clock time-adjust-ratio)))) + (cond + ((< (-> arg0 frame-num) f28-0) + (set! (-> arg0 frame-interp 1) (/ (* (-> arg0 frame-num) arg2) f28-0)) + ) + ((< (- f30-0 f28-0) (-> arg0 frame-num)) + (set! (-> arg0 frame-interp 1) (/ (* (- f30-0 (-> arg0 frame-num)) arg2) f28-0)) + (when (and (= (-> arg0 frame-num) f30-0) (logtest? (-> arg0 command) (joint-control-command eight))) + (joint-channel-float-delete! arg0) + (return 0.0) + ) + ) + (else + (set! (-> arg0 frame-interp 1) arg2) + ) + ) + ) + (-> arg0 frame-num) + ) + ) + +;; definition for function num-func-chan +(defun num-func-chan ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (let ((f0-2 + (-> (the-as joint-control-channel (+ (the-as uint arg0) (* (- (the int arg1) (-> arg0 group-sub-index)) 64))) + frame-num + ) + ) + ) + (set! (-> arg0 frame-num) f0-2) + f0-2 + ) + ) + +;; definition for function num-func-identity +(defun num-func-identity ((arg0 joint-control-channel) (arg1 float) (arg2 float)) + (-> arg0 frame-num) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc new file mode 100644 index 0000000000..3796b7e77f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-focusable_REF.gc @@ -0,0 +1,98 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type process-focusable +(deftype process-focusable (process-drawable) + ((focus-status focus-status :offset-assert 200) + ) + :heap-base #x50 + :method-count-assert 27 + :size-assert #xcc + :flag-assert #x1b005000cc + (:methods + (get-trans (_type_ int) vector 20) + (get-quat (_type_) quaternion 21) + (get-transv (_type_) vector 22) + (process-focusable-method-23 (_type_) none 23) + (process-focusable-method-24 (_type_) none 24) + (process-focusable-method-25 (_type_) none 25) + (process-focusable-method-26 (_type_) none 26) + ) + ) + +;; definition for method 3 of type process-focusable +(defmethod inspect process-focusable ((obj process-focusable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tfocus-status: ~D~%" (-> obj focus-status)) + (label cfg-4) + obj + ) + +;; definition for method 20 of type process-focusable +;; INFO: Return type mismatch structure vs vector. +(defmethod get-trans process-focusable ((obj process-focusable) (arg0 int)) + (let ((gp-0 (-> obj root))) + (the-as vector (cond + ((zero? arg0) + (-> gp-0 trans) + ) + ((and (= arg0 1) (type? gp-0 collide-shape-moving)) + (-> (the-as collide-shape-moving gp-0) gspot-pos) + ) + ((and (or (= arg0 2) (= arg0 3)) (type? gp-0 collide-shape)) + (-> (the-as collide-shape gp-0) root-prim prim-core) + ) + (else + (-> gp-0 trans) + ) + ) + ) + ) + ) + +;; definition for method 22 of type process-focusable +(defmethod get-transv process-focusable ((obj process-focusable)) + (-> obj root transv) + ) + +;; definition for method 21 of type process-focusable +(defmethod get-quat process-focusable ((obj process-focusable)) + (-> obj root quat) + ) + +;; definition for method 23 of type process-focusable +;; INFO: Return type mismatch int vs none. +(defmethod process-focusable-method-23 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +;; definition for method 24 of type process-focusable +;; INFO: Return type mismatch int vs none. +(defmethod process-focusable-method-24 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +;; definition for method 26 of type process-focusable +;; INFO: Return type mismatch int vs none. +(defmethod process-focusable-method-26 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +;; definition for method 25 of type process-focusable +;; INFO: Return type mismatch int vs none. +(defmethod process-focusable-method-25 process-focusable ((obj process-focusable)) + 0 + (none) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc new file mode 100644 index 0000000000..1e7e4d58f0 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/process-drawable/process-taskable-h_REF.gc @@ -0,0 +1,72 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type process-taskable +(deftype process-taskable (process-focusable) + ((task basic :offset-assert 204) + (ambient ambient-control :inline :offset-assert 208) + (neck-joint-index int32 :offset-assert 224) + (talk-message game-text-id :offset-assert 228) + (bounce-away symbol :offset-assert 232) + (will-talk symbol :offset-assert 236) + (look-at-me symbol :offset-assert 240) + (hide-during-movie symbol :offset-assert 244) + (talk-distance meters :offset-assert 248) + (talk-height meters :offset-assert 252) + (last-talk time-frame :offset-assert 256) + (want-to-say uint64 :offset-assert 264) + (birth-time time-frame :offset-assert 272) + (slave handle :offset-assert 280) + ) + :heap-base #xa0 + :method-count-assert 38 + :size-assert #x120 + :flag-assert #x2600a00120 + (:methods + (process-taskable-method-27 () none 27) + (process-taskable-method-28 () none 28) + (process-taskable-method-29 () none 29) + (process-taskable-method-30 () none 30) + (process-taskable-method-31 () none 31) + (process-taskable-method-32 () none 32) + (process-taskable-method-33 () none 33) + (process-taskable-method-34 () none 34) + (process-taskable-method-35 () none 35) + (process-taskable-method-36 () none 36) + (process-taskable-method-37 () none 37) + ) + ) + +;; definition for method 3 of type process-taskable +(defmethod inspect process-taskable ((obj process-taskable)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 obj) + ) + (format #t "~2Ttask: ~A~%" (-> obj task)) + (format #t "~2Tambient: #~%" (-> obj ambient)) + (format #t "~2Tneck-joint-index: ~D~%" (-> obj neck-joint-index)) + (format #t "~2Ttalk-message: ~D~%" (-> obj talk-message)) + (format #t "~2Tbounce-away: ~A~%" (-> obj bounce-away)) + (format #t "~2Twill-talk: ~A~%" (-> obj will-talk)) + (format #t "~2Tlook-at-me: ~A~%" (-> obj look-at-me)) + (format #t "~2Thide-during-movie: ~A~%" (-> obj hide-during-movie)) + (format #t "~2Ttalk-distance: (meters ~m)~%" (-> obj talk-distance)) + (format #t "~2Ttalk-height: (meters ~m)~%" (-> obj talk-height)) + (format #t "~2Tlast-talk: ~D~%" (-> obj last-talk)) + (format #t "~2Twant-to-say: ~D~%" (-> obj want-to-say)) + (format #t "~2Tbirth-time: ~D~%" (-> obj birth-time)) + (format #t "~2Tslave: ~D~%" (-> obj slave)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc new file mode 100644 index 0000000000..90e4746ca6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ps2/memcard-h_REF.gc @@ -0,0 +1,168 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type mc-handle +(deftype mc-handle (int32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type mc-file-info +(deftype mc-file-info (structure) + ((present int32 :offset-assert 0) + (blind-data float 16 :offset 4) + (blind-data-int8 int8 64 :offset 4) + (level-index int32 :offset 4) + (gem-count float :offset 8) + (skill-count float :offset 12) + (completion-percentage float :offset 16) + (minute uint8 :offset 24) + (hour uint8 :offset 25) + (week uint8 :offset 26) + (day uint8 :offset 27) + (month uint8 :offset 28) + (year uint8 :offset 29) + (game-time0 uint32 :offset 36) + (game-time1 uint32 :offset 40) + (secrets uint32 :offset 44) + (features uint32 :offset 48) + ) + :pack-me + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +;; definition for method 3 of type mc-file-info +(defmethod inspect mc-file-info ((obj mc-file-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mc-file-info) + (format #t "~1Tpresent: ~D~%" (-> obj present)) + (format #t "~1Tblind-data[16] @ #x~X~%" (-> obj blind-data)) + (format #t "~1Tblind-data-int8[64] @ #x~X~%" (-> obj blind-data)) + (format #t "~1Tlevel-index: ~D~%" (-> obj level-index)) + (format #t "~1Tgem-count: ~f~%" (-> obj gem-count)) + (format #t "~1Tskill-count: ~f~%" (-> obj skill-count)) + (format #t "~1Tcompletion-percentage: ~f~%" (-> obj completion-percentage)) + (format #t "~1Tminute: #x~X~%" (-> obj minute)) + (format #t "~1Thour: #x~X~%" (-> obj hour)) + (format #t "~1Tweek: #x~X~%" (-> obj week)) + (format #t "~1Tday: #x~X~%" (-> obj day)) + (format #t "~1Tmonth: #x~X~%" (-> obj month)) + (format #t "~1Tyear: #x~X~%" (-> obj year)) + (format #t "~1Tgame-time0: ~D~%" (-> obj game-time0)) + (format #t "~1Tgame-time1: ~D~%" (-> obj game-time1)) + (format #t "~1Tsecrets: #x~X~%" (-> obj secrets)) + (format #t "~1Tfeatures: #x~X~%" (-> obj features)) + (label cfg-4) + obj + ) + +;; definition of type mc-slot-info +(deftype mc-slot-info (structure) + ((handle int32 :offset-assert 0) + (known int32 :offset-assert 4) + (formatted int32 :offset-assert 8) + (inited int32 :offset-assert 12) + (last-file int32 :offset-assert 16) + (mem-required int32 :offset-assert 20) + (mem-actual int32 :offset-assert 24) + (file mc-file-info 4 :inline :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x12c + :flag-assert #x90000012c + ) + +;; definition for method 3 of type mc-slot-info +(defmethod inspect mc-slot-info ((obj mc-slot-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'mc-slot-info) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Tknown: ~D~%" (-> obj known)) + (format #t "~1Tformatted: ~D~%" (-> obj formatted)) + (format #t "~1Tinited: ~D~%" (-> obj inited)) + (format #t "~1Tlast-file: ~D~%" (-> obj last-file)) + (format #t "~1Tmem-required: ~D~%" (-> obj mem-required)) + (format #t "~1Tmem-actual: ~D~%" (-> obj mem-actual)) + (format #t "~1Tfile[4] @ #x~X~%" (-> obj file)) + (label cfg-4) + obj + ) + +;; definition for function mc-sync +(defun mc-sync () + (let ((v0-0 0)) + (while (zero? v0-0) + (mc-run) + (set! v0-0 (mc-check-result)) + ) + v0-0 + ) + ) + +;; definition for function show-mc-info +;; INFO: Return type mismatch int vs none. +(defun show-mc-info ((arg0 dma-buffer)) + (let ((s5-0 (new 'stack-no-clear 'mc-slot-info))) + (dotimes (s4-0 2) + (mc-get-slot-info s4-0 s5-0) + (cond + ((zero? (-> s5-0 known)) + (format (clear *temp-string*) "SLOT ~D: EXAMINING SLOT~%" s4-0) + *temp-string* + ) + ((zero? (-> s5-0 handle)) + (format (clear *temp-string*) "SLOT ~D: NO CARD~%" s4-0) + *temp-string* + ) + ((zero? (-> s5-0 formatted)) + (format (clear *temp-string*) "SLOT ~D: CARD [~D] : NOT FORMATTED~%" s4-0 (-> s5-0 handle)) + *temp-string* + ) + ((zero? (-> s5-0 inited)) + (format + (clear *temp-string*) + "SLOT ~D: CARD [~D] : NO FILE [~D/~D]~%" + s4-0 + (-> s5-0 handle) + (-> s5-0 mem-required) + (-> s5-0 mem-actual) + ) + *temp-string* + ) + (else + (format (clear *temp-string*) "SLOT ~D: CARD [~D] : " s4-0 (-> s5-0 handle)) + *temp-string* + (format + *temp-string* + "SAVES ~D ~D ~D ~D : LAST ~D~%" + (-> s5-0 file 0 present) + (-> s5-0 file 1 present) + (-> s5-0 file 2 present) + (-> s5-0 file 3 present) + (-> s5-0 last-file) + ) + ) + ) + (draw-string-xy *temp-string* arg0 32 (+ (* 12 s4-0) 8) (font-color orange-red) (font-flags shadow)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc new file mode 100644 index 0000000000..d9a03b7396 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ps2/pad_REF.gc @@ -0,0 +1,663 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type scf-time +(deftype scf-time (structure) + ((stat uint8 :offset-assert 0) + (second uint8 :offset-assert 1) + (minute uint8 :offset-assert 2) + (hour uint8 :offset-assert 3) + (week uint8 :offset-assert 4) + (day uint8 :offset-assert 5) + (month uint8 :offset-assert 6) + (year uint8 :offset-assert 7) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type scf-time +(defmethod inspect scf-time ((obj scf-time)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'scf-time) + (format #t "~1Tstat: ~D~%" (-> obj stat)) + (format #t "~1Tsecond: #x~X~%" (-> obj second)) + (format #t "~1Tminute: #x~X~%" (-> obj minute)) + (format #t "~1Thour: #x~X~%" (-> obj hour)) + (format #t "~1Tweek: #x~X~%" (-> obj week)) + (format #t "~1Tday: #x~X~%" (-> obj day)) + (format #t "~1Tmonth: #x~X~%" (-> obj month)) + (format #t "~1Tyear: #x~X~%" (-> obj year)) + (label cfg-4) + obj + ) + +;; definition for symbol *cheat-mode*, type symbol +(define *cheat-mode* #t) + +;; definition of type hw-cpad +(deftype hw-cpad (basic) + ((valid uint8 :offset-assert 4) + (status uint8 :offset-assert 5) + (button0 uint16 :offset-assert 6) + (rightx uint8 :offset-assert 8) + (righty uint8 :offset-assert 9) + (leftx uint8 :offset-assert 10) + (lefty uint8 :offset-assert 11) + (abutton uint8 12 :offset-assert 12) + (dummy uint8 12 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type hw-cpad +(defmethod inspect hw-cpad ((obj hw-cpad)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tvalid: #x~X~%" (-> obj valid)) + (format #t "~1Tstatus: #x~X~%" (-> obj status)) + (format #t "~1Tbutton0: #x~X~%" (-> obj button0)) + (format #t "~1Trightx: ~D~%" (-> obj rightx)) + (format #t "~1Trighty: ~D~%" (-> obj righty)) + (format #t "~1Tleftx: ~D~%" (-> obj leftx)) + (format #t "~1Tlefty: ~D~%" (-> obj lefty)) + (format #t "~1Tabutton[12] @ #x~X~%" (-> obj abutton)) + (format #t "~1Tdummy[12] @ #x~X~%" (-> obj dummy)) + (label cfg-4) + obj + ) + +;; definition of type cpad-info +(deftype cpad-info (hw-cpad) + ((number int32 :offset-assert 36) + (cpad-file int32 :offset-assert 40) + (button0-abs pad-buttons 3 :offset-assert 44) + (button0-shadow-abs pad-buttons 1 :offset-assert 56) + (button0-rel pad-buttons 3 :offset-assert 60) + (stick0-dir float :offset-assert 72) + (stick0-speed float :offset-assert 76) + (new-pad int32 :offset-assert 80) + (state int32 :offset-assert 84) + (align uint8 6 :offset-assert 88) + (direct uint8 6 :offset-assert 94) + (buzz-val uint8 2 :offset-assert 100) + (buzz-pause-val uint8 1 :offset-assert 102) + (buzz-pause-time uint8 :offset-assert 103) + (buzz-time time-frame 2 :offset-assert 104) + (buzz basic :offset-assert 120) + (buzz-act int32 :offset-assert 124) + (change-time time-frame :offset-assert 128) + (old-rightx uint8 2 :offset-assert 136) + (old-righty uint8 2 :offset-assert 138) + (old-leftx uint8 2 :offset-assert 140) + (old-lefty uint8 2 :offset-assert 142) + ) + :method-count-assert 10 + :size-assert #x90 + :flag-assert #xa00000090 + (:methods + (new (symbol type int) _type_ 0) + (invert-analog-if-needed (_type_) none 9) + ) + ) + +;; definition for method 3 of type cpad-info +(defmethod inspect cpad-info ((obj cpad-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tvalid: #x~X~%" (-> obj valid)) + (format #t "~1Tstatus: #x~X~%" (-> obj status)) + (format #t "~1Tbutton0: #x~X~%" (-> obj button0)) + (format #t "~1Trightx: ~D~%" (-> obj rightx)) + (format #t "~1Trighty: ~D~%" (-> obj righty)) + (format #t "~1Tleftx: ~D~%" (-> obj leftx)) + (format #t "~1Tlefty: ~D~%" (-> obj lefty)) + (format #t "~1Tabutton[12] @ #x~X~%" (-> obj abutton)) + (format #t "~1Tdummy[12] @ #x~X~%" (-> obj dummy)) + (format #t "~1Tnumber: ~D~%" (-> obj number)) + (format #t "~1Tcpad-file: ~D~%" (-> obj cpad-file)) + (format #t "~1Tbutton0-abs[3] @ #x~X~%" (-> obj button0-abs)) + (format #t "~1Tbutton0-shadow-abs[1] @ #x~X~%" (-> obj button0-shadow-abs)) + (format #t "~1Tbutton0-rel[3] @ #x~X~%" (-> obj button0-rel)) + (format #t "~1Tstick0-dir: ~f~%" (-> obj stick0-dir)) + (format #t "~1Tstick0-speed: ~f~%" (-> obj stick0-speed)) + (format #t "~1Tnew-pad: ~D~%" (-> obj new-pad)) + (format #t "~1Tstate: ~D~%" (-> obj state)) + (format #t "~1Talign[6] @ #x~X~%" (-> obj align)) + (format #t "~1Tdirect[6] @ #x~X~%" (-> obj direct)) + (format #t "~1Tbuzz-val[2] @ #x~X~%" (-> obj buzz-val)) + (format #t "~1Tbuzz-pause-val[1] @ #x~X~%" (-> obj buzz-pause-val)) + (format #t "~1Tbuzz-pause-time: ~D~%" (-> obj buzz-pause-time)) + (format #t "~1Tbuzz-time[2] @ #x~X~%" (-> obj buzz-time)) + (format #t "~1Tbuzz: ~A~%" (-> obj buzz)) + (format #t "~1Tbuzz-act: ~D~%" (-> obj buzz-act)) + (format #t "~1Tchange-time: ~D~%" (-> obj change-time)) + (format #t "~1Told-rightx[2] @ #x~X~%" (-> obj old-rightx)) + (format #t "~1Told-righty[2] @ #x~X~%" (-> obj old-righty)) + (format #t "~1Told-leftx[2] @ #x~X~%" (-> obj old-leftx)) + (format #t "~1Told-lefty[2] @ #x~X~%" (-> obj old-lefty)) + (label cfg-4) + obj + ) + +;; definition for function cpad-invalid! +(defun cpad-invalid! ((arg0 cpad-info)) + (logior! (-> arg0 valid) 128) + (set! (-> arg0 button0) (the-as uint 0)) + (set! (-> arg0 button0-abs 0) (pad-buttons)) + (set! (-> arg0 button0-shadow-abs 0) (pad-buttons)) + (set! (-> arg0 button0-rel 0) (pad-buttons)) + (dotimes (v1-2 12) + (nop!) + (set! (-> arg0 abutton v1-2) (the-as uint 0)) + ) + (set! (-> arg0 stick0-dir) 0.0) + (set! (-> arg0 stick0-speed) 0.0) + (set! (-> arg0 rightx) (the-as uint 128)) + (set! (-> arg0 righty) (the-as uint 128)) + (set! (-> arg0 leftx) (the-as uint 128)) + (set! (-> arg0 lefty) (the-as uint 128)) + (set! (-> arg0 align 0) (the-as uint 0)) + (set! (-> arg0 align 1) (the-as uint 1)) + (set! (-> arg0 align 2) (the-as uint 255)) + (set! (-> arg0 align 3) (the-as uint 255)) + (set! (-> arg0 align 4) (the-as uint 255)) + (set! (-> arg0 align 5) (the-as uint 255)) + (dotimes (v1-14 6) + (nop!) + (set! (-> arg0 direct v1-14) (the-as uint 0)) + ) + (dotimes (v1-17 2) + (nop!) + (set! (-> arg0 buzz-val v1-17) (the-as uint 0)) + (set! (-> arg0 buzz-time v1-17) 0) + ) + (set! (-> arg0 buzz-pause-val 0) (the-as uint 0)) + (set! (-> arg0 buzz-time 0) 0) + arg0 + ) + +;; definition for method 0 of type cpad-info +(defmethod new cpad-info ((allocation symbol) (type-to-make type) (arg0 int)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 number) arg0) + (set! (-> s5-0 buzz) #f) + (cpad-open s5-0 arg0) + (cpad-invalid! s5-0) + ) + ) + +;; definition of type cpad-list +(deftype cpad-list (basic) + ((num-cpads int32 :offset-assert 4) + (cpads cpad-info 2 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type cpad-list +(defmethod inspect cpad-list ((obj cpad-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tnum-cpads: ~D~%" (-> obj num-cpads)) + (format #t "~1Tcpads[2] @ #x~X~%" (-> obj cpads)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type cpad-list +(defmethod new cpad-list ((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 num-cpads) 2) + (set! (-> gp-0 cpads 0) (new 'global 'cpad-info 0)) + (set! (-> gp-0 cpads 1) (new 'global 'cpad-info 1)) + gp-0 + ) + ) + +;; definition for function analog-input +(defun analog-input ((arg0 int) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (let* ((f1-1 (- (the float arg0) arg1)) + (f0-3 (- (fabs f1-1) arg2)) + (v1-0 (- arg3 arg2)) + ) + (if (< f1-1 0.0) + (set! arg4 (- arg4)) + ) + (cond + ((>= 0.0 f0-3) + 0.0 + ) + ((>= f0-3 v1-0) + arg4 + ) + (else + (/ (* f0-3 arg4) v1-0) + ) + ) + ) + ) + +;; definition for function cpad-set-buzz! +;; INFO: Return type mismatch int vs none. +(defun cpad-set-buzz! ((arg0 cpad-info) (arg1 int) (arg2 int) (arg3 time-frame)) + (cond + ((zero? arg2) + (set! (-> arg0 buzz-val arg1) (the-as uint 0)) + 0 + ) + ((= arg2 (-> arg0 buzz-val arg1)) + (set! (-> arg0 buzz-time arg1) (the-as time-frame (max (-> arg0 buzz-time arg1) (+ (get-current-time) arg3)))) + ) + ((< (-> arg0 buzz-val arg1) (the-as uint arg2)) + (set! (-> arg0 buzz-val arg1) (the-as uint arg2)) + (set! (-> arg0 buzz-time arg1) (+ (get-current-time) arg3)) + ) + ) + 0 + (none) + ) + +;; definition for symbol *cpad-list*, type cpad-list +(define *cpad-list* (new 'global 'cpad-list)) + +;; definition for symbol *cpad-debug*, type symbol +(define *cpad-debug* #f) + +;; definition for function service-cpads +(defun service-cpads () + (let ((gp-0 *cpad-list*)) + (dotimes (s5-0 (-> gp-0 num-cpads)) + (let ((s4-0 (-> *cpad-list* cpads s5-0))) + (set! (-> s4-0 old-leftx 1) (-> s4-0 old-leftx 0)) + (set! (-> s4-0 old-leftx 0) (-> s4-0 leftx)) + (set! (-> s4-0 old-lefty 1) (-> s4-0 old-lefty 0)) + (set! (-> s4-0 old-lefty 0) (-> s4-0 lefty)) + (set! (-> s4-0 old-rightx 1) (-> s4-0 old-rightx 0)) + (set! (-> s4-0 old-rightx 0) (-> s4-0 rightx)) + (set! (-> s4-0 old-righty 1) (-> s4-0 old-righty 0)) + (set! (-> s4-0 old-righty 0) (-> s4-0 righty)) + (cpad-get-data s4-0) + (invert-analog-if-needed s4-0) + (cond + ((zero? (logand (-> s4-0 valid) 128)) + (dotimes (s3-0 2) + (cond + ((and (-> s4-0 buzz) (< (get-current-time) (-> s4-0 buzz-time s3-0)) (= *master-mode* 'game)) + (let ((v1-20 s3-0)) + (cond + ((zero? v1-20) + (set! (-> s4-0 direct s3-0) + (logand (ash (-> s4-0 buzz-val s3-0) (- (the-as int (logand (get-integral-current-time) 7)))) 1) + ) + ) + ((= v1-20 1) + (set! (-> s4-0 direct s3-0) (-> s4-0 buzz-val s3-0)) + ) + ) + ) + ) + ((and (zero? s3-0) (> (-> s4-0 buzz-pause-time) 0)) + (set! (-> s4-0 direct s3-0) + (logand (ash (-> s4-0 buzz-pause-val s3-0) (- (the-as int (logand (get-integral-current-time) 7)))) 1) + ) + (+! (-> s4-0 buzz-pause-time) -1) + ) + (else + (set! (-> s4-0 buzz-val s3-0) (the-as uint 0)) + (set! (-> s4-0 direct s3-0) (the-as uint 0)) + (when (zero? s3-0) + (set! (-> s4-0 buzz-pause-time) (the-as uint 0)) + 0 + ) + ) + ) + ) + (when (< (the-as uint 192) (-> s4-0 direct 1)) + (set! (-> s4-0 direct 0) (the-as uint 0)) + 0 + ) + (set! (-> s4-0 button0-abs 2) (-> s4-0 button0-abs 1)) + (set! (-> s4-0 button0-abs 1) (-> s4-0 button0-shadow-abs 0)) + (set! (-> s4-0 button0-rel 2) (-> s4-0 button0-rel 1)) + (set! (-> s4-0 button0-rel 1) (-> s4-0 button0-rel 0)) + (when (= (-> s4-0 status) 115) + (set! (-> s4-0 abutton 0) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons right)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 1) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons left)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 2) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons up)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 3) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons down)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 6) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons x)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 5) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons circle)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 4) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons triangle)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 7) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons square)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 8) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons l1)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 10) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons l2)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 9) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons r1)) + 255 + 0 + ) + ) + ) + (set! (-> s4-0 abutton 11) (the-as uint (if (logtest? (-> s4-0 button0-abs 0) (pad-buttons r2)) + 255 + 0 + ) + ) + ) + ) + (let ((s3-1 (-> s4-0 button0))) + (cond + ((< (-> s4-0 lefty) (the-as uint 30)) + (set! s3-1 (logior #x10000 s3-1)) + ) + ((< (the-as uint 225) (-> s4-0 lefty)) + (set! s3-1 (logior #x40000 s3-1)) + ) + ) + (cond + ((< (-> s4-0 leftx) (the-as uint 30)) + (set! s3-1 (logior #x80000 s3-1)) + ) + ((< (the-as uint 225) (-> s4-0 leftx)) + (set! s3-1 (logior #x20000 s3-1)) + ) + ) + (cond + ((< (-> s4-0 righty) (the-as uint 30)) + (set! s3-1 (logior #x100000 s3-1)) + ) + ((< (the-as uint 225) (-> s4-0 righty)) + (set! s3-1 (logior #x400000 s3-1)) + ) + ) + (cond + ((< (-> s4-0 rightx) (the-as uint 30)) + (set! s3-1 (logior #x800000 s3-1)) + ) + ((< (the-as uint 225) (-> s4-0 rightx)) + (set! s3-1 (logior #x200000 s3-1)) + ) + ) + (let ((v1-123 (get-current-language))) + (cond + ((or (= v1-123 (language-enum japanese)) (= v1-123 (language-enum korean))) + (case (scf-get-territory) + ((2 3) + (if (logtest? s3-1 8192) + (set! s3-1 (logior #x1000000 s3-1)) + ) + ) + (else + (if (logtest? s3-1 #x6000) + (set! s3-1 (logior #x1000000 s3-1)) + ) + ) + ) + ) + ((let ((v1-135 (scf-get-territory))) + (or (= v1-135 2) (= v1-135 3)) + ) + (if (logtest? s3-1 #x6000) + (set! s3-1 (logior #x1000000 s3-1)) + ) + ) + (else + (if (logtest? s3-1 #x4000) + (set! s3-1 (logior #x1000000 s3-1)) + ) + ) + ) + ) + (set! (-> s4-0 button0-shadow-abs 0) (the-as pad-buttons s3-1)) + (set! (-> s4-0 button0-abs 0) (the-as pad-buttons s3-1)) + ) + (set! (-> s4-0 button0-rel 0) (logclear (-> s4-0 button0-abs 0) (-> s4-0 button0-abs 1))) + (when *cpad-debug* + (set! (-> s4-0 leftx) (the-as uint 255)) + (set! (-> s4-0 rightx) (the-as uint 255)) + ) + (set! (-> s4-0 stick0-speed) 1.0) + (cond + ((= (shr (-> s4-0 status) 4) 7) + (let ((f30-0 (* 0.0078125 (the float (+ (-> s4-0 leftx) -128)))) + (f28-0 (* 0.0078125 (the float (- 127 (the-as int (-> s4-0 lefty)))))) + ) + (set! (-> s4-0 stick0-dir) (atan (- f30-0) f28-0)) + (set! (-> s4-0 stick0-speed) (fmin 1.0 (sqrtf (+ (* f30-0 f30-0) (* f28-0 f28-0))))) + ) + (if (< (-> s4-0 stick0-speed) 0.3) + (set! (-> s4-0 stick0-speed) 0.0) + ) + ) + (else + (set! (-> s4-0 leftx) (the-as uint 128)) + (set! (-> s4-0 lefty) (the-as uint 128)) + (set! (-> s4-0 rightx) (the-as uint 128)) + (set! (-> s4-0 righty) (the-as uint 128)) + (set! (-> s4-0 stick0-dir) 0.0) + (set! (-> s4-0 stick0-speed) 0.0) + ) + ) + (if (or (!= (-> s4-0 button0-abs 0) (-> s4-0 button0-abs 1)) + (or (< 0.3 (-> s4-0 stick0-speed)) (zero? (-> s4-0 change-time))) + ) + (set! (-> s4-0 change-time) (get-current-time)) + ) + ) + (else + (cpad-invalid! s4-0) + ) + ) + ) + ) + ) + *cpad-list* + ) + +;; definition for function buzz-stop! +;; INFO: Return type mismatch int vs none. +(defun buzz-stop! ((arg0 int)) + (cpad-set-buzz! (-> *cpad-list* cpads arg0) 0 0 0) + (cpad-set-buzz! (-> *cpad-list* cpads arg0) 1 0 0) + 0 + (none) + ) + +;; definition of type mouse-info +(deftype mouse-info (basic) + ((active symbol :offset-assert 4) + (cursor basic :offset-assert 8) + (valid symbol :offset-assert 12) + (id uint8 :offset-assert 16) + (status uint16 :offset-assert 18) + (button0 uint16 :offset-assert 20) + (deltax int8 :offset-assert 22) + (deltay int8 :offset-assert 23) + (wheel uint8 :offset-assert 24) + (change-time time-frame :offset-assert 32) + (button0-abs uint32 3 :offset-assert 40) + (button0-shadow-abs uint32 1 :offset-assert 52) + (button0-rel uint32 3 :offset-assert 56) + (pos vector 2 :inline :offset-assert 80) + (posx float :offset 80) + (posy float :offset 84) + (oldposx float :offset 96) + (oldposy float :offset 100) + (speedx float :offset 92) + (speedy float :offset 108) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + (:methods + (new (symbol type) _type_ 0) + ) + ) + +;; definition for method 3 of type mouse-info +(defmethod inspect mouse-info ((obj mouse-info)) + (when (not obj) + (set! obj obj) + (goto cfg-7) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tactive: ~A~%" (-> obj active)) + (format #t "~1Tcursor: ~A~%" (-> obj cursor)) + (format #t "~1Tvalid: ~A~%" (-> obj valid)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tstatus: #x~X~%" (-> obj status)) + (format #t "~1Tbutton0: #x~X~%" (-> obj button0)) + (format #t "~1Tdeltax: ~D~%" (-> obj deltax)) + (format #t "~1Tdeltay: ~D~%" (-> obj deltay)) + (format #t "~1Twheel: ~D~%" (-> obj wheel)) + (format #t "~1Tchange-time: ~D~%" (-> obj change-time)) + (format #t "~1Tbutton0-abs[3] @ #x~X~%" (-> obj button0-abs)) + (format #t "~1Tbutton0-shadow-abs[1] @ #x~X~%" (-> obj button0-shadow-abs)) + (format #t "~1Tbutton0-rel[3] @ #x~X~%" (-> obj button0-rel)) + (format #t "~1Tpos[2] @ #x~X~%" (-> obj pos)) + (dotimes (s5-0 2) + (format #t "~T [~D]~1Tpos: ~`vector`P~%" s5-0 (-> obj pos s5-0)) + ) + (format #t "~1Tposx: ~f~%" (-> obj posx)) + (format #t "~1Tposy: ~f~%" (-> obj posy)) + (format #t "~1Toldposx: ~f~%" (-> obj pos 1 x)) + (format #t "~1Toldposy: ~f~%" (-> obj oldposy)) + (format #t "~1Tspeedx: ~f~%" (-> obj speedx)) + (format #t "~1Tspeedy: ~f~%" (-> obj speedy)) + (label cfg-7) + obj + ) + +;; definition for method 0 of type mouse-info +(defmethod new mouse-info ((allocation symbol) (type-to-make type)) + (let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> v0-0 active) #f) + (set! (-> v0-0 valid) #f) + (set! (-> v0-0 cursor) #f) + v0-0 + ) + ) + +;; definition for symbol *mouse*, type mouse-info +(define *mouse* (new 'global 'mouse-info)) + +;; definition for function service-mouse +;; INFO: Used lq/sq +;; INFO: Return type mismatch mouse-info vs none. +(defun service-mouse () + (let ((gp-0 *mouse*)) + (mouse-get-data gp-0) + (set! (-> gp-0 pos 1 quad) (-> gp-0 pos 0 quad)) + (set! (-> gp-0 button0-abs 2) (-> gp-0 button0-abs 1)) + (set! (-> gp-0 button0-abs 1) (-> gp-0 button0-shadow-abs 0)) + (set! (-> gp-0 button0-rel 2) (-> gp-0 button0-rel 1)) + (set! (-> gp-0 button0-rel 1) (-> gp-0 button0-rel 0)) + (set! (-> gp-0 button0-rel 0) (the-as uint 0)) + (set! (-> gp-0 speedx) 0.0) + (set! (-> gp-0 speedy) 0.0) + (cond + ((or (not (-> gp-0 valid)) (not (-> gp-0 active))) + (set! (-> gp-0 valid) #f) + (set! (-> gp-0 status) (the-as uint 0)) + (set! (-> gp-0 pos 0 quad) (the-as uint128 0)) + (set! (-> gp-0 pos 1 quad) (the-as uint128 0)) + ) + ((logtest? (-> gp-0 status) 1) + (set! (-> gp-0 change-time) (get-current-time)) + (set! (-> gp-0 speedx) (* (sign (the float (-> gp-0 deltax))) (pow (fabs (the float (-> gp-0 deltax))) 1.3))) + (set! (-> gp-0 speedy) (* (sign (the float (-> gp-0 deltay))) (pow (fabs (the float (-> gp-0 deltay))) 1.3))) + (set! (-> gp-0 posx) (fmax -256.0 (fmin 256.0 (+ (-> gp-0 posx) (-> gp-0 speedx))))) + (set! (-> gp-0 posy) (fmax -208.0 (fmin 208.0 (+ (-> gp-0 posy) (-> gp-0 speedy))))) + (let ((v1-22 (-> gp-0 button0))) + (set! (-> gp-0 button0-shadow-abs 0) v1-22) + (set! (-> gp-0 button0-abs 0) v1-22) + ) + (set! (-> gp-0 button0-rel 0) (logclear (-> gp-0 button0-abs 0) (-> gp-0 button0-abs 1))) + ) + ) + (if (and (-> gp-0 active) (-> gp-0 valid) (-> gp-0 cursor)) + (add-debug-cursor + #t + (bucket-id debug-no-zbuf) + (+ (the int (-> gp-0 posx)) 256) + (+ (the int (-> gp-0 posy)) 208) + (the-as int (-> gp-0 button0-abs 0)) + ) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc new file mode 100644 index 0000000000..7b594c69d8 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ps2/rpc-h_REF.gc @@ -0,0 +1,236 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type rpc-buffer +(deftype rpc-buffer (basic) + ((elt-size uint32 :offset-assert 4) + (elt-count uint32 :offset-assert 8) + (elt-used uint32 :offset-assert 12) + (busy basic :offset-assert 16) + (base pointer :offset-assert 20) + (data uint8 :dynamic :offset 32) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + (:methods + (new (symbol type uint uint) rpc-buffer 0) + ) + ) + +;; definition for method 3 of type rpc-buffer +(defmethod inspect rpc-buffer ((obj rpc-buffer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Telt-size: ~D~%" (-> obj elt-size)) + (format #t "~1Telt-count: ~D~%" (-> obj elt-count)) + (format #t "~1Telt-used: ~D~%" (-> obj elt-used)) + (format #t "~1Tbusy: ~A~%" (-> obj busy)) + (format #t "~1Tbase: ~D~%" (-> obj base)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type rpc-buffer +(defmethod new rpc-buffer ((allocation symbol) (type-to-make type) (arg0 uint) (arg1 uint)) + (let* ((a2-2 (+ (-> type-to-make size) 63 (* (the-as int arg0) (the-as int arg1)))) + (v0-0 (object-new allocation type-to-make (the-as int a2-2))) + ) + (set! (-> v0-0 elt-size) arg0) + (set! (-> v0-0 elt-count) arg1) + (set! (-> v0-0 elt-used) (the-as uint 0)) + (set! (-> v0-0 busy) #f) + (set! (-> v0-0 base) (logand -64 (&-> (-> v0-0 data) 63))) + v0-0 + ) + ) + +;; definition of type rpc-buffer-pair +(deftype rpc-buffer-pair (basic) + ((buffer rpc-buffer 2 :offset-assert 4) + (current rpc-buffer :offset-assert 12) + (last-recv-buffer pointer :offset-assert 16) + (rpc-port int32 :offset-assert 20) + ) + :method-count-assert 15 + :size-assert #x18 + :flag-assert #xf00000018 + (:methods + (new (symbol type uint uint int) rpc-buffer-pair 0) + (call (rpc-buffer-pair uint pointer uint) int 9) + (add-element (rpc-buffer-pair) pointer 10) + (decrement-elt-used (rpc-buffer-pair) int 11) + (sync (rpc-buffer-pair symbol) int 12) + (check-busy (rpc-buffer-pair) symbol 13) + (pop-last-received (rpc-buffer-pair) pointer 14) + ) + ) + +;; definition for method 3 of type rpc-buffer-pair +(defmethod inspect rpc-buffer-pair ((obj rpc-buffer-pair)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tbuffer[2] @ #x~X~%" (-> obj buffer)) + (format #t "~1Tcurrent: ~A~%" (-> obj current)) + (format #t "~1Tlast-recv-buffer: #x~X~%" (-> obj last-recv-buffer)) + (format #t "~1Trpc-port: ~D~%" (-> obj rpc-port)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type rpc-buffer-pair +(defmethod new rpc-buffer-pair ((allocation symbol) (type-to-make type) (arg0 uint) (arg1 uint) (arg2 int)) + (let ((s3-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s3-0 buffer 0) (new 'global 'rpc-buffer arg0 arg1)) + (set! (-> s3-0 buffer 1) (new 'global 'rpc-buffer arg0 arg1)) + (set! (-> s3-0 current) (-> s3-0 buffer 0)) + (set! (-> s3-0 last-recv-buffer) (the-as pointer #f)) + (set! (-> s3-0 rpc-port) arg2) + s3-0 + ) + ) + +;; definition for method 12 of type rpc-buffer-pair +(defmethod sync rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 symbol)) + (let ((s5-0 (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) + (when (-> s5-0 busy) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (if arg0 + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + ) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + ) + ) + (set! (-> s5-0 busy) #f) + (set! (-> s5-0 elt-used) (the-as uint 0)) + 0 + ) + ) + 0 + ) + +;; definition for method 13 of type rpc-buffer-pair +(defmethod check-busy rpc-buffer-pair ((obj rpc-buffer-pair)) + (let ((gp-0 (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) + (when (-> gp-0 busy) + (if (nonzero? (rpc-busy? (-> obj rpc-port))) + (return #t) + ) + (set! (-> gp-0 busy) #f) + (set! (-> gp-0 elt-used) (the-as uint 0)) + 0 + ) + ) + #f + ) + +;; definition for method 9 of type rpc-buffer-pair +(defmethod call rpc-buffer-pair ((obj rpc-buffer-pair) (arg0 uint) (arg1 pointer) (arg2 uint)) + (when (nonzero? (-> obj current elt-used)) + (let ((s2-0 (if (= (-> obj current) (-> obj buffer 0)) + (-> obj buffer 1) + (-> obj buffer 0) + ) + ) + ) + (when (-> s2-0 busy) + (when (nonzero? (rpc-busy? (-> obj rpc-port))) + (format 0 "STALL: waiting for IOP on RPC port #~D~%" (-> obj rpc-port)) + (while (nonzero? (rpc-busy? (-> obj rpc-port))) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + (nop!) + ) + ) + (set! (-> s2-0 busy) #f) + (set! (-> s2-0 elt-used) (the-as uint 0)) + 0 + ) + (let ((s1-0 (-> obj current))) + (rpc-call + (-> obj rpc-port) + arg0 + (the-as uint 1) + (the-as uint (-> s1-0 base)) + (the-as int (* (-> s1-0 elt-size) (-> s1-0 elt-used))) + (the-as uint arg1) + (the-as int arg2) + ) + (set! (-> s1-0 busy) (the-as basic #t)) + ) + (set! (-> obj last-recv-buffer) arg1) + (set! (-> obj current) s2-0) + ) + ) + 0 + ) + +;; definition for method 14 of type rpc-buffer-pair +(defmethod pop-last-received rpc-buffer-pair ((obj rpc-buffer-pair)) + (let ((v0-0 (-> obj last-recv-buffer))) + (set! (-> obj last-recv-buffer) (the-as pointer #f)) + v0-0 + ) + ) + +;; definition for method 10 of type rpc-buffer-pair +(defmethod add-element rpc-buffer-pair ((obj rpc-buffer-pair)) + (let ((v1-0 (-> obj current))) + (when (= (-> v1-0 elt-used) (-> v1-0 elt-count)) + (if (zero? (-> obj rpc-port)) + (format 0 "WARNING: too many sound commands queued~%") + ) + (call obj (the-as uint 0) (the-as pointer 0) (the-as uint 0)) + (set! v1-0 (-> obj current)) + ) + (let ((v0-2 (&+ (-> v1-0 base) (* (-> v1-0 elt-used) (-> v1-0 elt-size))))) + (+! (-> v1-0 elt-used) 1) + v0-2 + ) + ) + ) + +;; definition for method 11 of type rpc-buffer-pair +(defmethod decrement-elt-used rpc-buffer-pair ((obj rpc-buffer-pair)) + (if (> (-> obj current elt-used) 0) + (+! (-> obj current elt-used) -1) + ) + 0 + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc new file mode 100644 index 0000000000..ae62c6496e --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ps2/timer-h_REF.gc @@ -0,0 +1,117 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type timer-mode +(deftype timer-mode (uint32) + ((clks timer-clock-selection :offset 0 :size 2) + (gate uint8 :offset 2 :size 1) + (gats uint8 :offset 3 :size 1) + (gatm uint8 :offset 4 :size 2) + (zret uint8 :offset 6 :size 1) + (cue uint8 :offset 7 :size 1) + (cmpe uint8 :offset 8 :size 1) + (ovfe uint8 :offset 9 :size 1) + (equf uint8 :offset 10 :size 1) + (ovff uint8 :offset 11 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type timer-bank +(deftype timer-bank (structure) + ((count uint32 :offset-assert 0) + (mode timer-mode :offset 16) + (comp uint32 :offset 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type timer-bank +(defmethod inspect timer-bank ((obj timer-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'timer-bank) + (format #t "~1Tcount: #x~X~%" (-> obj count)) + (format #t "~1Tmode: #x~X~%" (-> obj mode)) + (format #t "~1Tcomp: #x~X~%" (-> obj comp)) + (label cfg-4) + obj + ) + +;; definition of type timer-hold-bank +(deftype timer-hold-bank (timer-bank) + ((hold uint32 :offset 48) + ) + :method-count-assert 9 + :size-assert #x34 + :flag-assert #x900000034 + ) + +;; definition for method 3 of type timer-hold-bank +(defmethod inspect timer-hold-bank ((obj timer-hold-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'timer-hold-bank) + (format #t "~1Tcount: #x~X~%" (-> obj count)) + (format #t "~1Tmode: #x~X~%" (-> obj mode)) + (format #t "~1Tcomp: #x~X~%" (-> obj comp)) + (format #t "~1Thold: #x~X~%" (-> obj hold)) + (label cfg-4) + obj + ) + +;; definition of type stopwatch +(deftype stopwatch (basic) + ((prev-time-elapsed time-frame :offset-assert 8) + (start-time time-frame :offset-assert 16) + (begin-level int32 :offset-assert 24) + ) + :method-count-assert 9 + :size-assert #x1c + :flag-assert #x90000001c + ) + +;; definition for method 3 of type stopwatch +(defmethod inspect stopwatch ((obj stopwatch)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tprev-time-elapsed: ~D~%" (-> obj prev-time-elapsed)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tbegin-level: ~D~%" (-> obj begin-level)) + (label cfg-4) + obj + ) + +;; definition for symbol *ticks-per-frame*, type int +(define *ticks-per-frame* 9765) + +;; definition for function timer-init +(defun timer-init ((arg0 timer-bank) (arg1 timer-mode)) + (set! (-> arg0 mode) arg1) + (set! (-> arg0 count) (the-as uint 0)) + 0 + ) + +;; failed to figure out what this is: +(timer-init + (the-as timer-bank #x10000800) + (new 'static 'timer-mode :clks (timer-clock-selection busclk/256) :cue #x1) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc new file mode 100644 index 0000000000..0b856f4c4f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ps2/timer_REF.gc @@ -0,0 +1,232 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function timer-count +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +(defun timer-count ((arg0 timer-bank)) + (.sync.l) + (let ((v0-0 (-> arg0 count))) + (.sync.l) + v0-0 + ) + ) + +;; definition for function disable-irq +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v0, Status] +;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Status, v0] +;; ERROR: Unsupported inline assembly instruction kind - [sync.p] +(defun disable-irq () + (local-vars (v0-0 int)) + (let ((v1-0 (the-as uint #xfffffffe))) + (.mfc0 v0-0 Status) + (let ((v0-1 (logand v0-0 v1-0))) + (.mtc0 Status v0-1) + ) + ) + (.sync.p) + 0 + (none) + ) + +;; definition for function enable-irq +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v0, Status] +;; ERROR: Unsupported inline assembly instruction kind - [mtc0 Status, v0] +;; ERROR: Unsupported inline assembly instruction kind - [sync.p] +(defun enable-irq () + (local-vars (v0-0 int)) + (.mfc0 v0-0 Status) + (let ((v0-1 (logior v0-0 1))) + (.mtc0 Status v0-1) + ) + (.sync.p) + 0 + (none) + ) + +;; definition for function stopwatch-init +(defun stopwatch-init ((arg0 stopwatch)) + (set! (-> arg0 begin-level) 0) + (set! (-> arg0 prev-time-elapsed) 0) + 0 + ) + +;; definition for function stopwatch-reset +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defun stopwatch-reset ((arg0 stopwatch)) + (local-vars (v1-3 int)) + (set! (-> arg0 prev-time-elapsed) 0) + (when (> (-> arg0 begin-level) 0) + 0 + (.mfc0 v1-3 Count) + (set! (-> arg0 start-time) (the-as time-frame v1-3)) + ) + 0 + ) + +;; definition for function stopwatch-start +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defun stopwatch-start ((arg0 stopwatch)) + (local-vars (v1-4 int)) + (when (zero? (-> arg0 begin-level)) + (set! (-> arg0 begin-level) 1) + 0 + (.mfc0 v1-4 Count) + (set! (-> arg0 start-time) (the-as time-frame v1-4)) + ) + 0 + ) + +;; definition for function stopwatch-stop +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count] +(defun stopwatch-stop ((arg0 stopwatch)) + (local-vars (a1-0 int)) + (when (> (-> arg0 begin-level) 0) + (set! (-> arg0 begin-level) 0) + 0 + (.mfc0 a1-0 Count) + (+! (-> arg0 prev-time-elapsed) (- (the-as time-frame a1-0) (-> arg0 start-time))) + ) + 0 + (none) + ) + +;; definition for function stopwatch-begin +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defun stopwatch-begin ((arg0 stopwatch)) + (local-vars (v1-3 int)) + (when (zero? (-> arg0 begin-level)) + 0 + (.mfc0 v1-3 Count) + (set! (-> arg0 start-time) (the-as time-frame v1-3)) + ) + (+! (-> arg0 begin-level) 1) + 0 + ) + +;; definition for function stopwatch-end +;; INFO: Return type mismatch int vs none. +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 a1, Count] +(defun stopwatch-end ((arg0 stopwatch)) + (local-vars (a1-0 int)) + (+! (-> arg0 begin-level) -1) + (when (zero? (-> arg0 begin-level)) + 0 + (.mfc0 a1-0 Count) + (+! (-> arg0 prev-time-elapsed) (- (the-as time-frame a1-0) (-> arg0 start-time))) + ) + 0 + (none) + ) + +;; definition for function stopwatch-elapsed-ticks +;; ERROR: Unsupported inline assembly instruction kind - [mfc0 v1, Count] +(defun stopwatch-elapsed-ticks ((arg0 stopwatch)) + (local-vars (v1-3 int)) + (let ((v0-0 (-> arg0 prev-time-elapsed))) + (when (> (-> arg0 begin-level) 0) + 0 + (.mfc0 v1-3 Count) + (+! v0-0 (- (the-as time-frame v1-3) (-> arg0 start-time))) + ) + v0-0 + ) + ) + +;; definition for function stopwatch-elapsed-seconds +(defun stopwatch-elapsed-seconds ((arg0 stopwatch)) + (let ((v1-0 (stopwatch-elapsed-ticks arg0))) + (* 0.0000000033333334 (the float v1-0)) + ) + ) + +;; definition for method 9 of type clock +(defmethod update-rates! clock ((obj clock) (arg0 float)) + (set! (-> obj clock-ratio) arg0) + (let ((f0-6 (if (nonzero? *display*) + (* (-> *display* time-factor) (-> *display* dog-ratio) arg0) + (* 5.0 arg0) + ) + ) + ) + (set! (-> obj time-adjust-ratio) (* 0.2 f0-6)) + ) + (set! (-> obj seconds-per-frame) (* 0.016666668 (-> obj time-adjust-ratio))) + (set! (-> obj frames-per-second) (if (= (-> obj time-adjust-ratio) 0.0) + 0.0 + (* 60.0 (/ 1.0 (-> obj time-adjust-ratio))) + ) + ) + (let* ((v1-12 (- (-> obj frame-counter) (-> obj old-frame-counter))) + (f0-14 (gpr->fpr v1-12)) + (f1-9 (* 0.2 (the float v1-12))) + ) + (set-vector! (-> obj sparticle-data) (the-as float f0-14) (* 5.0 f1-9) f1-9 f1-9) + ) + arg0 + ) + +;; definition for method 10 of type clock +(defmethod advance-by! clock ((obj clock) (arg0 float)) + (the int (+ arg0 (-> obj accum))) + (+! (-> obj integral-accum) arg0) + (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) + (while (>= (-> obj integral-accum) (-> *display* time-factor)) + (+! (-> obj integral-frame-counter) 1) + (set! (-> obj integral-accum) (- (-> obj integral-accum) (-> *display* time-factor))) + ) + (let ((v1-7 (the int (+ arg0 (-> obj accum))))) + (set! (-> obj accum) (- (+ arg0 (-> obj accum)) (the float v1-7))) + (set! (-> obj old-frame-counter) (-> obj frame-counter)) + (+! (-> obj frame-counter) v1-7) + ) + (update-rates! obj (-> obj clock-ratio)) + obj + ) + +;; definition for method 11 of type clock +(defmethod tick! clock ((obj clock)) + (if (zero? (logand (-> obj mask) (-> *kernel-context* prevent-from-run))) + (advance-by! obj (* (-> *display* time-factor) (-> *display* dog-ratio) (-> obj clock-ratio))) + (set! (-> obj sparticle-data x) 0.0) + ) + obj + ) + +;; definition for method 14 of type clock +;; INFO: Return type mismatch int vs none. +(defmethod reset! clock ((obj clock)) + (set! (-> obj frame-counter) (seconds 1000)) + (set! (-> obj integral-frame-counter) (the-as uint #x493e0)) + (set! (-> obj accum) 0.0) + (set! (-> obj old-frame-counter) (+ (-> obj frame-counter) -1)) + (set! (-> obj old-integral-frame-counter) (+ (-> obj integral-frame-counter) -1)) + (update-rates! obj 1.0) + 0 + (none) + ) + +;; definition for method 12 of type clock +(defmethod save! clock ((obj clock) (arg0 (pointer uint64))) + (set! (-> arg0 0) (the-as uint (-> obj frame-counter))) + (set! (-> arg0 1) (-> obj integral-frame-counter)) + 16 + ) + +;; definition for method 13 of type clock +(defmethod load! clock ((obj clock) (arg0 (pointer uint64))) + (set! (-> obj frame-counter) (the-as time-frame (-> arg0 0))) + (set! (-> obj integral-frame-counter) (-> arg0 1)) + (set! (-> obj accum) 0.0) + (set! (-> obj integral-accum) 0.0) + (set! (-> obj old-frame-counter) (-> obj frame-counter)) + (set! (-> obj old-integral-frame-counter) (-> obj integral-frame-counter)) + 16 + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc b/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc new file mode 100644 index 0000000000..6b74e546e5 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ps2/vif-h_REF.gc @@ -0,0 +1,136 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type vif-stat +(deftype vif-stat (uint32) + ((vps uint8 :offset 0 :size 2) + (vew uint8 :offset 2 :size 1) + (mrk uint8 :offset 6 :size 1) + (vss uint8 :offset 8 :size 1) + (vfs uint8 :offset 9 :size 1) + (vis uint8 :offset 10 :size 1) + (int uint8 :offset 11 :size 1) + (er0 uint8 :offset 12 :size 1) + (er1 uint8 :offset 13 :size 1) + (fqc uint8 :offset 24 :size 4) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type vif-stat +(defmethod inspect vif-stat ((obj vif-stat)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vif-stat) + (format #t "~1Tvps: ~D~%" (-> obj vps)) + (format #t "~1Tvew: ~D~%" (-> obj vew)) + (format #t "~1Tmrk: ~D~%" (-> obj mrk)) + (format #t "~1Tvss: ~D~%" (-> obj vss)) + (format #t "~1Tvfs: ~D~%" (-> obj vfs)) + (format #t "~1Tvis: ~D~%" (-> obj vis)) + (format #t "~1Tint: ~D~%" (-> obj int)) + (format #t "~1Ter0: ~D~%" (-> obj er0)) + (format #t "~1Ter1: ~D~%" (-> obj er1)) + (format #t "~1Tfqc: ~D~%" (-> obj fqc)) + (label cfg-4) + obj + ) + +;; definition of type vif-fbrst +(deftype vif-fbrst (uint32) + ((rst uint8 :offset 0 :size 1) + (fbk uint8 :offset 1 :size 1) + (stp uint8 :offset 2 :size 1) + (stc uint8 :offset 3 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type vif-err +(deftype vif-err (uint32) + ((mii uint8 :offset 0 :size 1) + (me0 uint8 :offset 1 :size 1) + (me1 uint8 :offset 2 :size 1) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type vif-bank +(deftype vif-bank (structure) + ((stat uint32 :offset-assert 0) + (fbrst uint32 :offset 16) + (err vif-err :offset 32) + (mark uint32 :offset 48) + (cycle uint32 :offset 64) + (mode uint32 :offset 80) + (num uint32 :offset 96) + (mask uint32 :offset 112) + (code uint32 :offset 128) + (itops uint32 :offset 144) + (base uint32 :offset 160) + (offset uint32 :offset 176) + (tops uint32 :offset 192) + (itop uint32 :offset 208) + (top uint32 :offset 224) + (r0 uint32 :offset 256) + (r1 uint32 :offset 272) + (r2 uint32 :offset 288) + (r3 uint32 :offset 304) + (c0 uint32 :offset 320) + (c1 uint32 :offset 336) + (c2 uint32 :offset 352) + (c3 uint32 :offset 368) + ) + :method-count-assert 9 + :size-assert #x174 + :flag-assert #x900000174 + ) + +;; definition for method 3 of type vif-bank +(defmethod inspect vif-bank ((obj vif-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'vif-bank) + (format #t "~1Tstat: #x~X~%" (-> obj stat)) + (format #t "~1Tfbrst: #x~X~%" (-> obj fbrst)) + (format #t "~1Terr: #x~X~%" (-> obj err)) + (format #t "~1Tmark: #x~X~%" (-> obj mark)) + (format #t "~1Tcycle: #x~X~%" (-> obj cycle)) + (format #t "~1Tmode: #x~X~%" (-> obj mode)) + (format #t "~1Tnum: #x~X~%" (-> obj num)) + (format #t "~1Tmask: #x~X~%" (-> obj mask)) + (format #t "~1Tcode: #x~X~%" (-> obj code)) + (format #t "~1Titops: #x~X~%" (-> obj itops)) + (format #t "~1Tbase: #x~X~%" (-> obj base)) + (format #t "~1Toffset: #x~X~%" (-> obj offset)) + (format #t "~1Ttops: #x~X~%" (-> obj tops)) + (format #t "~1Titop: #x~X~%" (-> obj itop)) + (format #t "~1Ttop: #x~X~%" (-> obj top)) + (format #t "~1Tr0: #x~X~%" (-> obj r0)) + (format #t "~1Tr1: #x~X~%" (-> obj r1)) + (format #t "~1Tr2: #x~X~%" (-> obj r2)) + (format #t "~1Tr3: #x~X~%" (-> obj r3)) + (format #t "~1Tc0: #x~X~%" (-> obj c0)) + (format #t "~1Tc1: #x~X~%" (-> obj c1)) + (format #t "~1Tc2: #x~X~%" (-> obj c2)) + (format #t "~1Tc3: #x~X~%" (-> obj c3)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc b/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc new file mode 100644 index 0000000000..80e5420f1c --- /dev/null +++ b/test/decompiler/reference/jak2/engine/scene/scene-h_REF.gc @@ -0,0 +1,218 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type scene-actor +(deftype scene-actor (basic) + ((name basic :offset-assert 4) + (level basic :offset-assert 8) + (art-group basic :offset-assert 12) + (prefix basic :offset-assert 16) + (draw-frames basic :offset-assert 20) + (scissor-frames basic :offset-assert 24) + (camera int16 :offset-assert 28) + (light-index uint8 :offset-assert 30) + (shadow-mask uint8 :offset-assert 31) + (shadow-values uint32 :offset-assert 32) + (flags uint32 :offset-assert 36) + (command-list basic :offset-assert 40) + (shadow-flags int32 :offset-assert 44) + (shadow-volume-joint basic :offset-assert 48) + (draw-seg uint64 :offset-assert 56) + (no-draw-seg uint64 :offset-assert 64) + (process uint64 :offset-assert 72) + ) + :method-count-assert 10 + :size-assert #x50 + :flag-assert #xa00000050 + (:methods + (scene-actor-method-9 () none 9) + ) + ) + +;; definition for method 3 of type scene-actor +(defmethod inspect scene-actor ((obj scene-actor)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tprefix: ~A~%" (-> obj prefix)) + (format #t "~1Tdraw-frames: ~A~%" (-> obj draw-frames)) + (format #t "~1Tscissor-frames: ~A~%" (-> obj scissor-frames)) + (format #t "~1Tcamera: ~D~%" (-> obj camera)) + (format #t "~1Tlight-index: ~D~%" (-> obj light-index)) + (format #t "~1Tshadow-mask: ~D~%" (-> obj shadow-mask)) + (format #t "~1Tshadow-values: ~D~%" (-> obj shadow-values)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) + (format #t "~1Tshadow-flags: ~D~%" (-> obj shadow-flags)) + (format #t "~1Tshadow-volume-joint: ~A~%" (-> obj shadow-volume-joint)) + (format #t "~1Tdraw-seg: ~D~%" (-> obj draw-seg)) + (format #t "~1Tno-draw-seg: ~D~%" (-> obj no-draw-seg)) + (format #t "~1Tprocess: ~D~%" (-> obj process)) + (label cfg-4) + obj + ) + +;; definition of type scene +(deftype scene (art-group) + ((mask-to-clear uint32 :offset-assert 32) + (entity basic :offset-assert 36) + (art-group basic :offset-assert 40) + (anim basic :offset-assert 44) + (parts int32 :offset-assert 48) + (command-list basic :offset-assert 52) + (cut-list basic :offset-assert 56) + (wait-max-time time-frame :offset-assert 64) + (wait-air-time time-frame :offset-assert 72) + (wait-ground-time time-frame :offset-assert 80) + (draw-target basic :offset-assert 88) + (abort basic :offset-assert 92) + (actor basic :offset-assert 96) + (load-point basic :offset-assert 100) + (end-point basic :offset-assert 104) + (borrow basic :offset-assert 108) + (sfx-volume float :offset-assert 112) + (ambient-volume float :offset-assert 116) + (music-volume float :offset-assert 120) + (blackout-end basic :offset-assert 124) + (peaceful basic :offset-assert 128) + (music-delay float :offset-assert 132) + (save basic :offset-assert 136) + (scene-task uint16 :offset-assert 140) + ) + :method-count-assert 17 + :size-assert #x8e + :flag-assert #x110000008e + (:methods + (scene-method-15 () none 15) + (scene-method-16 () none 16) + ) + ) + +;; definition for method 3 of type scene +(defmethod inspect scene ((obj scene)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Textra: ~A~%" (-> obj extra)) + (format #t "~1Tinfo: ~A~%" (-> obj info)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (format #t "~1Tmask-to-clear: ~D~%" (-> obj mask-to-clear)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tart-group: ~A~%" (-> obj art-group)) + (format #t "~1Tanim: ~A~%" (-> obj anim)) + (format #t "~1Tparts: ~D~%" (-> obj parts)) + (format #t "~1Tcommand-list: ~A~%" (-> obj command-list)) + (format #t "~1Tcut-list: ~A~%" (-> obj cut-list)) + (format #t "~1Twait-max-time: ~D~%" (-> obj wait-max-time)) + (format #t "~1Twait-air-time: ~D~%" (-> obj wait-air-time)) + (format #t "~1Twait-ground-time: ~D~%" (-> obj wait-ground-time)) + (format #t "~1Tdraw-target: ~A~%" (-> obj draw-target)) + (format #t "~1Tabort: ~A~%" (-> obj abort)) + (format #t "~1Tactor: ~A~%" (-> obj actor)) + (format #t "~1Tload-point: ~A~%" (-> obj load-point)) + (format #t "~1Tend-point: ~A~%" (-> obj end-point)) + (format #t "~1Tborrow: ~A~%" (-> obj borrow)) + (format #t "~1Tsfx-volume: ~f~%" (-> obj sfx-volume)) + (format #t "~1Tambient-volume: ~f~%" (-> obj ambient-volume)) + (format #t "~1Tmusic-volume: ~f~%" (-> obj music-volume)) + (format #t "~1Tblackout-end: ~A~%" (-> obj blackout-end)) + (format #t "~1Tpeaceful: ~A~%" (-> obj peaceful)) + (format #t "~1Tmusic-delay: ~f~%" (-> obj music-delay)) + (format #t "~1Tsave: ~A~%" (-> obj save)) + (format #t "~1Tscene-task: ~D~%" (-> obj scene-task)) + (label cfg-4) + obj + ) + +;; definition of type scene-player +(deftype scene-player (process-drawable) + ((scene-list basic :offset-assert 200) + (scene basic :offset-assert 204) + (scene-index int32 :offset-assert 208) + (anim basic :offset-assert 212) + (next-anim basic :offset-assert 216) + (camera uint64 :offset-assert 224) + (main-entity basic :offset-assert 232) + (wait basic :offset-assert 236) + (old-target-pos transformq :inline :offset-assert 240) + (pre-cut-frame basic :offset-assert 288) + (preload-continue basic :offset-assert 292) + (dma-max uint32 :offset-assert 296) + (gui-id uint32 :offset-assert 300) + (aborted? basic :offset-assert 304) + (scene-start-time time-frame :offset-assert 312) + (targ-speed float :offset-assert 320) + (cur-speed float :offset-assert 324) + (speed-change-time time-frame :offset-assert 328) + (speed-press-time time-frame :offset-assert 336) + (speed-change-speed float :offset-assert 344) + (subtitle-change-time time-frame :offset-assert 352) + (user-sound uint32 4 :offset-assert 360) + ) + :heap-base #x100 + :method-count-assert 26 + :size-assert #x178 + :flag-assert #x1a01000178 + (:methods + (scene-player-method-20 () none 20) + (scene-player-method-21 () none 21) + (scene-player-method-22 () none 22) + (scene-player-method-23 () none 23) + (scene-player-method-24 () none 24) + (scene-player-method-25 () none 25) + ) + ) + +;; definition for method 3 of type scene-player +(defmethod inspect scene-player ((obj scene-player)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tscene-list: ~A~%" (-> obj scene-list)) + (format #t "~2Tscene: ~A~%" (-> obj scene)) + (format #t "~2Tscene-index: ~D~%" (-> obj scene-index)) + (format #t "~2Tanim: ~A~%" (-> obj anim)) + (format #t "~2Tnext-anim: ~A~%" (-> obj next-anim)) + (format #t "~2Tcamera: ~D~%" (-> obj camera)) + (format #t "~2Tmain-entity: ~A~%" (-> obj main-entity)) + (format #t "~2Twait: ~A~%" (-> obj wait)) + (format #t "~2Told-target-pos: #~%" (-> obj old-target-pos)) + (format #t "~2Tpre-cut-frame: ~A~%" (-> obj pre-cut-frame)) + (format #t "~2Tpreload-continue: ~A~%" (-> obj preload-continue)) + (format #t "~2Tdma-max: ~D~%" (-> obj dma-max)) + (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (format #t "~2Taborted?: ~A~%" (-> obj aborted?)) + (format #t "~2Tscene-start-time: ~D~%" (-> obj scene-start-time)) + (format #t "~2Ttarg-speed: ~f~%" (-> obj targ-speed)) + (format #t "~2Tcur-speed: ~f~%" (-> obj cur-speed)) + (format #t "~2Tspeed-change-time: ~D~%" (-> obj speed-change-time)) + (format #t "~2Tspeed-press-time: ~D~%" (-> obj speed-press-time)) + (format #t "~2Tspeed-change-speed: ~f~%" (-> obj speed-change-speed)) + (format #t "~2Tsubtitle-change-time: ~D~%" (-> obj subtitle-change-time)) + (format #t "~2Tuser-sound[4] @ #x~X~%" (-> obj user-sound)) + (label cfg-4) + obj + ) + +;; definition for symbol *scene-player*, type scene-player +(define *scene-player* (the-as scene-player #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc b/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc new file mode 100644 index 0000000000..f599cd7711 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/sound/gsound-h_REF.gc @@ -0,0 +1,943 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sound-stream-name +(deftype sound-stream-name (structure) + ((name uint8 48 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type sound-stream-name +(defmethod inspect sound-stream-name ((obj sound-stream-name)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-stream-name) + (format #t "~1Tname[48] @ #x~X~%" (-> obj name)) + (label cfg-4) + obj + ) + +;; definition of type sound-id +(deftype sound-id (uint32) + () + :method-count-assert 10 + :size-assert #x4 + :flag-assert #xa00000004 + (:methods + (unused-9 () none 9) + ) + ) + +;; definition of type sound-bank-id +(deftype sound-bank-id (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition of type sound-name +(deftype sound-name (uint128) + ((lo uint64 :offset 0 :size 64) + (hi uint64 :offset 64 :size 64) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition of type sound-rpc-cmd +(deftype sound-rpc-cmd (structure) + ((rsvd1 uint16 :offset-assert 0) + (command sound-command :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type sound-rpc-cmd +(defmethod inspect sound-rpc-cmd ((obj sound-rpc-cmd)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-cmd) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (label cfg-4) + obj + ) + +;; definition of type sound-play-params +(deftype sound-play-params (structure) + ((mask uint16 :offset-assert 0) + (pitch-mod int16 :offset-assert 2) + (bend int16 :offset-assert 4) + (fo-min int16 :offset-assert 6) + (fo-max int16 :offset-assert 8) + (fo-curve int8 :offset-assert 10) + (priority int8 :offset-assert 11) + (volume int32 :offset-assert 12) + (trans int32 3 :offset-assert 16) + (group uint8 :offset-assert 28) + (reg uint8 3 :offset-assert 29) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type sound-play-params +(defmethod inspect sound-play-params ((obj sound-play-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-play-params) + (format #t "~1Tmask: ~D~%" (-> obj mask)) + (format #t "~1Tpitch-mod: ~D~%" (-> obj pitch-mod)) + (format #t "~1Tbend: ~D~%" (-> obj bend)) + (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) + (format #t "~1Tpriority: ~D~%" (-> obj priority)) + (format #t "~1Tvolume: ~D~%" (-> obj volume)) + (format #t "~1Ttrans[3] @ #x~X~%" (-> obj trans)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "~1Treg[3] @ #x~X~%" (-> obj reg)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-bank-cmd +(deftype sound-rpc-bank-cmd (sound-rpc-cmd) + ((bank-name sound-name :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type sound-rpc-bank-cmd +;; INFO: Used lq/sq +(defmethod inspect sound-rpc-bank-cmd ((obj sound-rpc-bank-cmd)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-bank-cmd) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-test-cmd +(deftype sound-rpc-test-cmd (sound-rpc-cmd) + ((ee-addr uint32 :offset-assert 4) + (param0 uint16 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xa + :flag-assert #x90000000a + ) + +;; definition for method 3 of type sound-rpc-test-cmd +(defmethod inspect sound-rpc-test-cmd ((obj sound-rpc-test-cmd)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-test-cmd) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tee-addr: ~D~%" (-> obj ee-addr)) + (format #t "~1Tparam0: ~D~%" (-> obj param0)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-sound-cmd +(deftype sound-rpc-sound-cmd (sound-rpc-cmd) + ((id sound-id :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type sound-rpc-sound-cmd +(defmethod inspect sound-rpc-sound-cmd ((obj sound-rpc-sound-cmd)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-sound-cmd) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-group-cmd +(deftype sound-rpc-group-cmd (sound-rpc-cmd) + ((group sound-group :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +;; definition for method 3 of type sound-rpc-group-cmd +(defmethod inspect sound-rpc-group-cmd ((obj sound-rpc-group-cmd)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-group-cmd) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-load-bank +(deftype sound-rpc-load-bank (sound-rpc-bank-cmd) + ((ee-addr uint32 :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type sound-rpc-load-bank +;; INFO: Used lq/sq +(defmethod inspect sound-rpc-load-bank ((obj sound-rpc-load-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-load-bank) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (format #t "~1Tee-addr: ~D~%" (-> obj ee-addr)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-load-music +(deftype sound-rpc-load-music (sound-rpc-bank-cmd) + () + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type sound-rpc-load-music +;; INFO: Used lq/sq +(defmethod inspect sound-rpc-load-music ((obj sound-rpc-load-music)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-load-music) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-unload-bank +(deftype sound-rpc-unload-bank (sound-rpc-bank-cmd) + () + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type sound-rpc-unload-bank +;; INFO: Used lq/sq +(defmethod inspect sound-rpc-unload-bank ((obj sound-rpc-unload-bank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-unload-bank) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tbank-name: ~D~%" (-> obj bank-name)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-play +(deftype sound-rpc-play (sound-rpc-sound-cmd) + ((name sound-name :offset-assert 16) + (params sound-play-params :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x40 + :flag-assert #x900000040 + ) + +;; definition for method 3 of type sound-rpc-play +;; INFO: Used lq/sq +(defmethod inspect sound-rpc-play ((obj sound-rpc-play)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-play) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tparams: #~%" (-> obj params)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-pause-sound +(deftype sound-rpc-pause-sound (sound-rpc-sound-cmd) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type sound-rpc-pause-sound +(defmethod inspect sound-rpc-pause-sound ((obj sound-rpc-pause-sound)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-pause-sound) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-stop-sound +(deftype sound-rpc-stop-sound (sound-rpc-sound-cmd) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type sound-rpc-stop-sound +(defmethod inspect sound-rpc-stop-sound ((obj sound-rpc-stop-sound)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-stop-sound) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-continue-sound +(deftype sound-rpc-continue-sound (sound-rpc-sound-cmd) + () + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type sound-rpc-continue-sound +(defmethod inspect sound-rpc-continue-sound ((obj sound-rpc-continue-sound)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-continue-sound) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-param +(deftype sound-rpc-set-param (sound-rpc-sound-cmd) + ((params sound-play-params :inline :offset-assert 8) + (auto-time int32 :offset-assert 40) + (auto-from int32 :offset-assert 44) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type sound-rpc-set-param +(defmethod inspect sound-rpc-set-param ((obj sound-rpc-set-param)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-param) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tparams: #~%" (-> obj params)) + (format #t "~1Tauto-time: ~D~%" (-> obj auto-time)) + (format #t "~1Tauto-from: ~D~%" (-> obj auto-from)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-master-volume +(deftype sound-rpc-set-master-volume (sound-rpc-group-cmd) + ((volume int32 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xc + :flag-assert #x90000000c + ) + +;; definition for method 3 of type sound-rpc-set-master-volume +(defmethod inspect sound-rpc-set-master-volume ((obj sound-rpc-set-master-volume)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-master-volume) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "~1Tvolume: ~D~%" (-> obj volume)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-pause-group +(deftype sound-rpc-pause-group (sound-rpc-group-cmd) + () + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +;; definition for method 3 of type sound-rpc-pause-group +(defmethod inspect sound-rpc-pause-group ((obj sound-rpc-pause-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-pause-group) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-stop-group +(deftype sound-rpc-stop-group (sound-rpc-group-cmd) + () + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +;; definition for method 3 of type sound-rpc-stop-group +(defmethod inspect sound-rpc-stop-group ((obj sound-rpc-stop-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-stop-group) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-continue-group +(deftype sound-rpc-continue-group (sound-rpc-group-cmd) + () + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +;; definition for method 3 of type sound-rpc-continue-group +(defmethod inspect sound-rpc-continue-group ((obj sound-rpc-continue-group)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-continue-group) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-get-irx-version +(deftype sound-rpc-get-irx-version (sound-rpc-cmd) + ((major uint32 :offset-assert 4) + (minor uint32 :offset-assert 8) + (ee-addr pointer :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type sound-rpc-get-irx-version +(defmethod inspect sound-rpc-get-irx-version ((obj sound-rpc-get-irx-version)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-get-irx-version) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tmajor: ~D~%" (-> obj major)) + (format #t "~1Tminor: ~D~%" (-> obj minor)) + (format #t "~1Tee-addr: ~D~%" (-> obj ee-addr)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-language +(deftype sound-rpc-set-language (sound-rpc-cmd) + ((lang uint32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type sound-rpc-set-language +(defmethod inspect sound-rpc-set-language ((obj sound-rpc-set-language)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-language) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tlang: ~D~%" (-> obj lang)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-stereo-mode +(deftype sound-rpc-set-stereo-mode (sound-rpc-cmd) + ((mode int32 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type sound-rpc-set-stereo-mode +(defmethod inspect sound-rpc-set-stereo-mode ((obj sound-rpc-set-stereo-mode)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-stereo-mode) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tmode: ~D~%" (-> obj mode)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-reverb +(deftype sound-rpc-set-reverb (sound-rpc-cmd) + ((core uint8 :offset-assert 4) + (reverb int32 :offset-assert 8) + (left uint32 :offset-assert 12) + (right uint32 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type sound-rpc-set-reverb +(defmethod inspect sound-rpc-set-reverb ((obj sound-rpc-set-reverb)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-reverb) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tcore: ~D~%" (-> obj core)) + (format #t "~1Treverb: ~D~%" (-> obj reverb)) + (format #t "~1Tleft: ~D~%" (-> obj left)) + (format #t "~1Tright: ~D~%" (-> obj right)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-ear-trans +(deftype sound-rpc-set-ear-trans (sound-rpc-cmd) + ((ear-trans1 int32 3 :offset-assert 4) + (ear-trans0 int32 3 :offset-assert 16) + (cam-trans int32 3 :offset-assert 28) + (cam-angle int32 :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type sound-rpc-set-ear-trans +(defmethod inspect sound-rpc-set-ear-trans ((obj sound-rpc-set-ear-trans)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-ear-trans) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tear-trans1[3] @ #x~X~%" (-> obj ear-trans1)) + (format #t "~1Tear-trans0[3] @ #x~X~%" (-> obj ear-trans0)) + (format #t "~1Tcam-trans[3] @ #x~X~%" (-> obj cam-trans)) + (format #t "~1Tcam-angle: ~D~%" (-> obj cam-angle)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-flava +(deftype sound-rpc-set-flava (sound-rpc-cmd) + ((flava uint8 :offset-assert 4) + (excitement uint8 :offset-assert 5) + ) + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; definition for method 3 of type sound-rpc-set-flava +(defmethod inspect sound-rpc-set-flava ((obj sound-rpc-set-flava)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-flava) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tflava: ~D~%" (-> obj flava)) + (format #t "~1Texcitement: ~D~%" (-> obj excitement)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-midi-reg +(deftype sound-rpc-set-midi-reg (sound-rpc-cmd) + ((reg int32 :offset-assert 4) + (value int16 :offset-assert 8) + ) + :method-count-assert 9 + :size-assert #xa + :flag-assert #x90000000a + ) + +;; definition for method 3 of type sound-rpc-set-midi-reg +(defmethod inspect sound-rpc-set-midi-reg ((obj sound-rpc-set-midi-reg)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-midi-reg) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Treg: ~D~%" (-> obj reg)) + (format #t "~1Tvalue: ~D~%" (-> obj value)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-shutdown +(deftype sound-rpc-shutdown (sound-rpc-cmd) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type sound-rpc-shutdown +(defmethod inspect sound-rpc-shutdown ((obj sound-rpc-shutdown)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-shutdown) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-set-fps +(deftype sound-rpc-set-fps (sound-rpc-cmd) + ((fps uint8 :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x5 + :flag-assert #x900000005 + ) + +;; definition for method 3 of type sound-rpc-set-fps +(defmethod inspect sound-rpc-set-fps ((obj sound-rpc-set-fps)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-set-fps) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (format #t "~1Tfps: ~D~%" (-> obj fps)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-list-sounds +(deftype sound-rpc-list-sounds (sound-rpc-cmd) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type sound-rpc-list-sounds +(defmethod inspect sound-rpc-list-sounds ((obj sound-rpc-list-sounds)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-list-sounds) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-unload-music +(deftype sound-rpc-unload-music (sound-rpc-cmd) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type sound-rpc-unload-music +(defmethod inspect sound-rpc-unload-music ((obj sound-rpc-unload-music)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-unload-music) + (format #t "~1Trsvd1: ~D~%" (-> obj rsvd1)) + (format #t "~1Tcommand: ~D~%" (-> obj command)) + (label cfg-4) + obj + ) + +;; definition of type sound-rpc-union +(deftype sound-rpc-union (structure) + ((data uint32 20 :offset-assert 0) + (load-bank sound-rpc-load-bank :offset 0) + (unload-bank sound-rpc-unload-bank :offset 0) + (play sound-rpc-play :offset 0) + (pause-sound sound-rpc-pause-sound :offset 0) + (stop-sound sound-rpc-stop-sound :offset 0) + (continue-sound sound-rpc-continue-sound :offset 0) + (set-param sound-rpc-set-param :offset 0) + (set-master-volume sound-rpc-set-master-volume :offset 0) + (pause-group sound-rpc-pause-group :offset 0) + (stop-group sound-rpc-stop-group :offset 0) + (continue-group sound-rpc-continue-group :offset 0) + (get-irx-version sound-rpc-get-irx-version :offset 0) + (set-language sound-rpc-set-language :offset 0) + (set-reverb sound-rpc-set-reverb :offset 0) + (set-ear-trans sound-rpc-set-ear-trans :offset 0) + (set-flava sound-rpc-set-flava :offset 0) + (set-midi-reg sound-rpc-set-midi-reg :offset 0) + (set-fps sound-rpc-set-fps :offset 0) + (shutdown sound-rpc-shutdown :offset 0) + (list-sounds sound-rpc-list-sounds :offset 0) + (unload-music sound-rpc-unload-music :offset 0) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type sound-rpc-union +(defmethod inspect sound-rpc-union ((obj sound-rpc-union)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sound-rpc-union) + (format #t "~1Tdata[20] @ #x~X~%" (-> obj data)) + (format #t "~1Tload-bank: #~%" (-> obj load-bank)) + (format #t "~1Tunload-bank: #~%" (-> obj load-bank)) + (format #t "~1Tplay: #~%" (-> obj load-bank)) + (format #t "~1Tpause-sound: #~%" (-> obj load-bank)) + (format #t "~1Tstop-sound: #~%" (-> obj load-bank)) + (format #t "~1Tcontinue-sound: #~%" (-> obj load-bank)) + (format #t "~1Tset-param: #~%" (-> obj load-bank)) + (format #t "~1Tset-master-volume: #~%" (-> obj load-bank)) + (format #t "~1Tpause-group: #~%" (-> obj load-bank)) + (format #t "~1Tstop-group: #~%" (-> obj load-bank)) + (format #t "~1Tcontinue-group: #~%" (-> obj load-bank)) + (format #t "~1Tget-irx-version: #~%" (-> obj load-bank)) + (format #t "~1Tset-language: #~%" (-> obj load-bank)) + (format #t "~1Tset-reverb: #~%" (-> obj load-bank)) + (format #t "~1Tset-ear-trans: #~%" (-> obj load-bank)) + (format #t "~1Tset-flava: #~%" (-> obj load-bank)) + (format #t "~1Tset-midi-reg: #~%" (-> obj load-bank)) + (format #t "~1Tset-fps: #~%" (-> obj load-bank)) + (format #t "~1Tshutdown: #~%" (-> obj load-bank)) + (format #t "~1Tlist-sounds: #~%" (-> obj load-bank)) + (format #t "~1Tunload-music: #~%" (-> obj load-bank)) + (label cfg-4) + obj + ) + +;; definition of type sound-spec +(deftype sound-spec (basic) + ((mask sound-mask :offset-assert 4) + (num float :offset-assert 8) + (group sound-group :offset-assert 12) + (reg uint8 3 :offset-assert 13) + (sound-name-char uint8 16 :offset-assert 16) + (sound-name sound-name :offset 16) + (trans int32 4 :offset-assert 32) + (volume int32 :offset-assert 48) + (pitch-mod int32 :offset-assert 52) + (bend int32 :offset-assert 56) + (fo-min int16 :offset-assert 60) + (fo-max int16 :offset-assert 62) + (fo-curve int8 :offset-assert 64) + (priority int8 :offset-assert 65) + (auto-time int32 :offset-assert 68) + (auto-from int32 :offset-assert 72) + ) + :method-count-assert 9 + :size-assert #x4c + :flag-assert #x90000004c + ) + +;; definition for method 3 of type sound-spec +;; INFO: Used lq/sq +(defmethod inspect sound-spec ((obj sound-spec)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmask: ~D~%" (-> obj mask)) + (format #t "~1Tnum: ~f~%" (-> obj num)) + (format #t "~1Tgroup: ~D~%" (-> obj group)) + (format #t "~1Treg[3] @ #x~X~%" (-> obj reg)) + (format #t "~1Tsound-name-char: ~g~%" (&-> obj sound-name)) + (format #t "~1Tsound-name: ~D~%" (-> obj sound-name)) + (format #t "~1Ttrans[4] @ #x~X~%" (-> obj trans)) + (format #t "~1Tvolume: ~D~%" (-> obj volume)) + (format #t "~1Tpitch-mod: ~D~%" (-> obj pitch-mod)) + (format #t "~1Tbend: ~D~%" (-> obj bend)) + (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) + (format #t "~1Tpriority: ~D~%" (-> obj priority)) + (format #t "~1Tauto-time: ~D~%" (-> obj auto-time)) + (format #t "~1Tauto-from: ~D~%" (-> obj auto-from)) + (label cfg-4) + obj + ) + +;; definition for symbol *current-sound-id*, type sound-id +(define *current-sound-id* (the-as sound-id #x10000)) + +;; definition of type ambient-sound +(deftype ambient-sound (basic) + ((spec sound-spec :offset-assert 4) + (playing-id sound-id :offset-assert 8) + (trans vector :inline :offset-assert 16) + (name sound-name :offset-assert 32) + (play-time time-frame :offset-assert 48) + (time-base time-frame :offset-assert 56) + (time-random time-frame :offset-assert 64) + (volume int32 :offset-assert 72) + (pitch int32 :offset-assert 76) + (falloff-near int32 :offset-assert 80) + (falloff-far int32 :offset-assert 84) + (falloff-mode int32 :offset-assert 88) + (params (pointer float) :offset-assert 92) + (param-count int32 :offset-assert 96) + (entity entity :offset-assert 100) + (sound-count int32 :offset-assert 104) + ) + :method-count-assert 16 + :size-assert #x6c + :flag-assert #x100000006c + (:methods + (ambient-sound-method-9 () none 9) + (ambient-sound-method-10 () none 10) + (ambient-sound-method-11 () none 11) + (ambient-sound-method-12 () none 12) + (ambient-sound-method-13 () none 13) + (ambient-sound-method-14 () none 14) + (ambient-sound-method-15 () none 15) + ) + ) + +;; definition for method 3 of type ambient-sound +;; INFO: Used lq/sq +(defmethod inspect ambient-sound ((obj ambient-sound)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tspec: ~A~%" (-> obj spec)) + (format #t "~1Tplaying-id: ~D~%" (-> obj playing-id)) + (format #t "~1Ttrans: ~`vector`P~%" (-> obj trans)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tplay-time: ~D~%" (-> obj play-time)) + (format #t "~1Ttime-base: ~D~%" (-> obj time-base)) + (format #t "~1Ttime-random: ~D~%" (-> obj time-random)) + (format #t "~1Tvolume: ~D~%" (-> obj volume)) + (format #t "~1Tpitch: ~D~%" (-> obj pitch)) + (format #t "~1Tfalloff-near: ~D~%" (-> obj falloff-near)) + (format #t "~1Tfalloff-far: ~D~%" (-> obj falloff-far)) + (format #t "~1Tfalloff-mode: ~D~%" (-> obj falloff-mode)) + (format #t "~1Tparams: #x~X~%" (-> obj params)) + (format #t "~1Tparam-count: ~D~%" (-> obj param-count)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tsound-count: ~D~%" (-> obj sound-count)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc b/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc new file mode 100644 index 0000000000..d0aa517be6 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/sound/speech-h_REF.gc @@ -0,0 +1,167 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type speech-type-info +(deftype speech-type-info (structure) + ((channel uint8 :offset-assert 0) + (flags speech-type-flag :offset-assert 1) + (priority int8 :offset-assert 2) + (request-timeout uint16 :offset-assert 4) + (min-delay uint16 :offset-assert 6) + (max-delay uint16 :offset-assert 8) + (delay uint16 :offset-assert 10) + (play-index int16 :offset-assert 12) + (list basic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type speech-type-info +(defmethod inspect speech-type-info ((obj speech-type-info)) + (when (not obj) + (set! obj obj) + (goto cfg-6) + ) + (format #t "[~8x] ~A~%" obj 'speech-type-info) + (format #t "~1Tchannel: ~D~%" (-> obj channel)) + (format #t "~1Tflags: #x~X : (speech-type-flag " (-> obj flags)) + (let ((a0-4 (-> obj flags))) + (if (= (logand a0-4 (speech-type-flag random-order)) (speech-type-flag random-order)) + (format #t "random-order ") + ) + ) + (format #t ")~%") + (format #t "~1Tpriority: ~D~%" (-> obj priority)) + (format #t "~1Trequest-timeout: ~D~%" (-> obj request-timeout)) + (format #t "~1Tmin-delay: ~D~%" (-> obj min-delay)) + (format #t "~1Tmax-delay: ~D~%" (-> obj max-delay)) + (format #t "~1Tdelay: ~D~%" (-> obj delay)) + (format #t "~1Tplay-index: ~D~%" (-> obj play-index)) + (format #t "~1Tlist: ~A~%" (-> obj list)) + (label cfg-6) + obj + ) + +;; definition of type speech-request +(deftype speech-request (structure) + ((handle uint64 :offset-assert 0) + (time time-frame :offset-assert 8) + (priority float :offset-assert 16) + (speech-type int8 :offset-assert 20) + ) + :pack-me + :method-count-assert 9 + :size-assert #x15 + :flag-assert #x900000015 + ) + +;; definition for method 3 of type speech-request +(defmethod inspect speech-request ((obj speech-request)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'speech-request) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Ttime: ~D~%" (-> obj time)) + (format #t "~1Tpriority: ~f~%" (-> obj priority)) + (format #t "~1Tspeech-type: ~D~%" (-> obj speech-type)) + (label cfg-4) + obj + ) + +;; definition of type speech-channel +(deftype speech-channel (structure) + ((flags speech-channel-flag :offset-assert 0) + (gui-channel gui-channel :offset-assert 1) + (delay uint16 :offset-assert 2) + (id uint32 :offset-assert 4) + (update-time time-frame :offset-assert 8) + (start-time time-frame :offset-assert 16) + (end-time time-frame :offset-assert 24) + (request speech-request :inline :offset-assert 32) + (last-request speech-request :inline :offset-assert 56) + (target-pos vector :inline :offset-assert 80) + (speech-table uint32 :offset-assert 96) + ) + :method-count-assert 14 + :size-assert #x64 + :flag-assert #xe00000064 + (:methods + (speech-channel-method-9 () none 9) + (speech-channel-method-10 () none 10) + (speech-channel-method-11 () none 11) + (speech-channel-method-12 () none 12) + (speech-channel-method-13 () none 13) + ) + ) + +;; definition for method 3 of type speech-channel +(defmethod inspect speech-channel ((obj speech-channel)) + (when (not obj) + (set! obj obj) + (goto cfg-6) + ) + (format #t "[~8x] ~A~%" obj 'speech-channel) + (format #t "~1Tflags: #x~X : (speech-channel-flag " (-> obj flags)) + (let ((a0-3 (-> obj flags))) + (if (= (logand a0-3 (speech-channel-flag disable)) (speech-channel-flag disable)) + (format #t "disable ") + ) + ) + (format #t ")~%") + (format #t "~1Tgui-channel: ~D~%" (-> obj gui-channel)) + (format #t "~1Tdelay: ~D~%" (-> obj delay)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tend-time: ~D~%" (-> obj end-time)) + (format #t "~1Trequest: #~%" (-> obj request)) + (format #t "~1Tlast-request: #~%" (-> obj last-request)) + (format #t "~1Ttarget-pos: #~%" (-> obj target-pos)) + (format #t "~1Tspeech-table: #x~X~%" (-> obj speech-table)) + (label cfg-6) + obj + ) + +;; definition of type speech-control +(deftype speech-control (structure) + ((channel-array speech-channel 2 :inline :offset-assert 0) + (speech-table uint32 57 :offset-assert 224) + ) + :method-count-assert 17 + :size-assert #x1c4 + :flag-assert #x11000001c4 + (:methods + (speech-control-method-9 () none 9) + (speech-control-method-10 () none 10) + (speech-control-method-11 () none 11) + (speech-control-method-12 () none 12) + (speech-control-method-13 () none 13) + (speech-control-method-14 () none 14) + (speech-control-method-15 () none 15) + (speech-control-method-16 () none 16) + ) + ) + +;; definition for method 3 of type speech-control +(defmethod inspect speech-control ((obj speech-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'speech-control) + (format #t "~1Tchannel-array[2] @ #x~X~%" (-> obj channel-array)) + (format #t "~1Tspeech-table[57] @ #x~X~%" (-> obj speech-table)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/spatial_hash/actor-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial_hash/actor-hash-h_REF.gc new file mode 100644 index 0000000000..aa4fb59d6b --- /dev/null +++ b/test/decompiler/reference/jak2/engine/spatial_hash/actor-hash-h_REF.gc @@ -0,0 +1,15 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *actor-list*, type pointer +(define *actor-list* (malloc 'global 1024)) + +;; definition for symbol *actor-list-length*, type int +(define *actor-list-length* 0) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/spatial_hash/collide-hash-h_REF.gc b/test/decompiler/reference/jak2/engine/spatial_hash/collide-hash-h_REF.gc new file mode 100644 index 0000000000..8ba9449b98 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/spatial_hash/collide-hash-h_REF.gc @@ -0,0 +1,279 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *collide-list-boxes*, type object +(define *collide-list-boxes* (the-as object #f)) + +;; definition for symbol *collide-hash-fragments*, type object +(define *collide-hash-fragments* (the-as object 0)) + +;; definition for symbol *collide-hash-fragments-tfrag*, type object +(define *collide-hash-fragments-tfrag* (the-as object 0)) + +;; definition for symbol *collide-hash-fragments-instance*, type object +(define *collide-hash-fragments-instance* (the-as object 0)) + +;; definition for symbol *already-printed-exeeded-max-cache-tris*, type symbol +(define *already-printed-exeeded-max-cache-tris* #f) + +;; definition of type collide-hash-scratch +(deftype collide-hash-scratch (structure) + ((collidable-bits uint128 128 :offset-assert 0) + (poly-bits uint64 2 :offset 0) + (id-bits uint32 512 :offset 0) + (tris uint32 :offset-assert 2048) + ) + :method-count-assert 9 + :size-assert #x804 + :flag-assert #x900000804 + ) + +;; definition for method 3 of type collide-hash-scratch +(defmethod inspect collide-hash-scratch ((obj collide-hash-scratch)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-hash-scratch) + (format #t "~1Tcollidable-bits[128] @ #x~X~%" (-> obj collidable-bits)) + (format #t "~1Tpoly-bits[2] @ #x~X~%" (-> obj collidable-bits)) + (format #t "~1Tid-bits[512] @ #x~X~%" (-> obj collidable-bits)) + (format #t "~1Ttris: ~D~%" (-> obj tris)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash-bucket +(deftype collide-hash-bucket (structure) + ((index int16 :offset-assert 0) + (count int16 :offset-assert 2) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type collide-hash-bucket +(defmethod inspect collide-hash-bucket ((obj collide-hash-bucket)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-hash-bucket) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash-item +(deftype collide-hash-item (structure) + ((id uint32 :offset-assert 0) + (collidable basic :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type collide-hash-item +(defmethod inspect collide-hash-item ((obj collide-hash-item)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-hash-item) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tcollidable: ~A~%" (-> obj collidable)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash-poly +(deftype collide-hash-poly (structure) + ((data uint8 4 :offset-assert 0) + (vert-index0 uint8 :offset 0) + (vert-index1 uint8 :offset 1) + (vert-index2 uint8 :offset 2) + (pat-index uint8 :offset 3) + (word uint32 :offset 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type collide-hash-poly +(defmethod inspect collide-hash-poly ((obj collide-hash-poly)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-hash-poly) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj vert-index0)) + (format #t "~1Tvert-index0: ~D~%" (-> obj vert-index0)) + (format #t "~1Tvert-index1: ~D~%" (-> obj vert-index1)) + (format #t "~1Tvert-index2: ~D~%" (-> obj vert-index2)) + (format #t "~1Tpat-index: ~D~%" (-> obj pat-index)) + (format #t "~1Tword: ~D~%" (-> obj word)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash-fragment-stats +(deftype collide-hash-fragment-stats (structure) + ((num-verts uint16 :offset-assert 0) + (num-polys uint8 :offset-assert 2) + (poly-count uint8 :offset-assert 3) + ) + :pack-me + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type collide-hash-fragment-stats +(defmethod inspect collide-hash-fragment-stats ((obj collide-hash-fragment-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'collide-hash-fragment-stats) + (format #t "~1Tnum-verts: ~D~%" (-> obj num-verts)) + (format #t "~1Tnum-polys: ~D~%" (-> obj num-polys)) + (format #t "~1Tpoly-count: ~D~%" (-> obj poly-count)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash-fragment +(deftype collide-hash-fragment (drawable) + ((num-buckets uint16 :offset 4) + (num-indices uint16 :offset 6) + (pat-array uint32 :offset 8) + (bucket-array uint32 :offset 12) + (grid-step vector :inline :offset-assert 32) + (bbox bounding-box :inline :offset-assert 48) + (bbox4w bounding-box4w :inline :offset-assert 80) + (axis-scale vector :inline :offset 64) + (avg-extents vector :inline :offset 80) + (dimension-array uint32 4 :offset 44) + (stats collide-hash-fragment-stats :inline :offset 60) + (num-verts uint16 :offset 60) + (num-polys uint8 :offset 62) + (poly-count uint8 :offset 63) + (poly-array uint32 :offset 76) + (vert-array uint32 :offset 92) + (index-array uint32 :offset 108) + ) + :method-count-assert 17 + :size-assert #x70 + :flag-assert #x1100000070 + ) + +;; definition for method 3 of type collide-hash-fragment +(defmethod inspect collide-hash-fragment ((obj collide-hash-fragment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tnum-buckets: ~D~%" (-> obj num-buckets)) + (format #t "~1Tnum-indices: ~D~%" (-> obj num-indices)) + (format #t "~1Tpat-array: #x~X~%" (-> obj pat-array)) + (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) + (format #t "~1Tgrid-step: #~%" (-> obj grid-step)) + (format #t "~1Tbbox: #~%" (-> obj bbox)) + (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) + (format #t "~1Taxis-scale: #~%" (-> obj bbox max)) + (format #t "~1Tavg-extents: #~%" (-> obj bbox4w)) + (format #t "~1Tdimension-array[4] @ #x~X~%" (&-> obj grid-step w)) + (format #t "~1Tstats: #~%" (&-> obj bbox min w)) + (format #t "~1Tnum-verts: ~D~%" (-> obj stats num-verts)) + (format #t "~1Tnum-polys: ~D~%" (-> obj stats num-polys)) + (format #t "~1Tpoly-count: ~D~%" (-> obj stats poly-count)) + (format #t "~1Tpoly-array: #x~X~%" (-> obj bbox max w)) + (format #t "~1Tvert-array: #x~X~%" (-> obj avg-extents w)) + (format #t "~1Tindex-array: #x~X~%" (-> obj index-array)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash-fragment-array +(deftype collide-hash-fragment-array (array) + () + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type collide-hash-fragment-array +(defmethod inspect collide-hash-fragment-array ((obj collide-hash-fragment-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttype: ~A~%" (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Tcontent-type: ~A~%" (-> obj content-type)) + (label cfg-4) + obj + ) + +;; definition of type collide-hash +(deftype collide-hash (drawable) + ((num-ids uint16 :offset 4) + (id-count uint16 :offset 6) + (num-buckets uint32 :offset 8) + (qwc-id-bits uint32 :offset 12) + (grid-step vector :inline :offset 16) + (bbox bounding-box :inline :offset-assert 32) + (bbox4w bounding-box4w :inline :offset-assert 64) + (axis-scale vector :inline :offset 48) + (avg-extents vector :inline :offset 64) + (bucket-array uint32 :offset 44) + (item-array uint32 :offset 60) + (dimension-array uint32 3 :offset 76) + (num-items uint32 :offset 92) + ) + :method-count-assert 17 + :size-assert #x60 + :flag-assert #x1100000060 + ) + +;; definition for method 3 of type collide-hash +(defmethod inspect collide-hash ((obj collide-hash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Tbsphere: ~`vector`P~%" (-> obj bsphere)) + (format #t "~1Tnum-ids: ~D~%" (-> obj num-ids)) + (format #t "~1Tid-count: ~D~%" (-> obj id-count)) + (format #t "~1Tnum-buckets: ~D~%" (-> obj num-buckets)) + (format #t "~1Tqwc-id-bits: ~D~%" (-> obj qwc-id-bits)) + (format #t "~1Tgrid-step: #~%" (-> obj bsphere)) + (format #t "~1Tbbox: #~%" (-> obj bbox)) + (format #t "~1Tbbox4w: #~%" (-> obj bbox4w)) + (format #t "~1Taxis-scale: #~%" (-> obj bbox max)) + (format #t "~1Tavg-extents: #~%" (-> obj bbox4w)) + (format #t "~1Tbucket-array: #x~X~%" (-> obj bbox min w)) + (format #t "~1Titem-array: #x~X~%" (-> obj bbox max w)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (&-> obj bbox4w min w)) + (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +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 new file mode 100644 index 0000000000..208d425383 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/spatial_hash/spatial-hash-h_REF.gc @@ -0,0 +1,277 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type grid-hash-word +(deftype grid-hash-word (uint8) + () + :method-count-assert 9 + :size-assert #x1 + :flag-assert #x900000001 + ) + +;; definition of type grid-hash-box +(deftype grid-hash-box (structure) + ((min uint8 3 :offset-assert 0) + (max uint8 3 :offset-assert 3) + ) + :pack-me + :method-count-assert 9 + :size-assert #x6 + :flag-assert #x900000006 + ) + +;; definition for method 3 of type grid-hash-box +(defmethod inspect grid-hash-box ((obj grid-hash-box)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'grid-hash-box) + (format #t "~1Tmin[3] @ #x~X~%" (-> obj min)) + (format #t "~1Tmax[3] @ #x~X~%" (-> obj max)) + (label cfg-4) + obj + ) + +;; definition of type grid-hash +(deftype grid-hash (basic) + ((work basic :offset-assert 4) + (search-box grid-hash-box :inline :offset-assert 8) + (bucket-size int16 :offset-assert 14) + (axis-scale uint32 3 :offset-assert 16) + (dimension-array uint8 3 :offset-assert 28) + (vertical-cell-count int8 :offset-assert 31) + (bucket-array uint32 :offset-assert 32) + (box-min uint32 3 :offset-assert 36) + (box-max uint32 3 :offset-assert 48) + (object-count int16 :offset-assert 60) + (bucket-count int16 :offset-assert 62) + (min-cell-size float :offset-assert 64) + (bucket-memory-size int32 :offset-assert 68) + (mem-bucket-array uint32 :offset-assert 72) + (spr-bucket-array uint32 :offset-assert 76) + (debug-draw basic :offset-assert 80) + (use-scratch-ram basic :offset-assert 84) + ) + :method-count-assert 25 + :size-assert #x58 + :flag-assert #x1900000058 + (:methods + (grid-hash-method-9 () none 9) + (grid-hash-method-10 () none 10) + (grid-hash-method-11 () none 11) + (grid-hash-method-12 () none 12) + (grid-hash-method-13 () none 13) + (grid-hash-method-14 () none 14) + (grid-hash-method-15 () none 15) + (grid-hash-method-16 () none 16) + (grid-hash-method-17 () none 17) + (grid-hash-method-18 () none 18) + (grid-hash-method-19 () none 19) + (grid-hash-method-20 () none 20) + (grid-hash-method-21 () none 21) + (grid-hash-method-22 () none 22) + (grid-hash-method-23 () none 23) + (grid-hash-method-24 () none 24) + ) + ) + +;; definition for method 3 of type grid-hash +(defmethod inspect grid-hash ((obj grid-hash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twork: ~A~%" (-> obj work)) + (format #t "~1Tsearch-box: #~%" (-> obj search-box)) + (format #t "~1Tbucket-size: ~D~%" (-> obj bucket-size)) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) + (format #t "~1Tvertical-cell-count: ~D~%" (-> obj vertical-cell-count)) + (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) + (format #t "~1Tbox-min[3] @ #x~X~%" (-> obj box-min)) + (format #t "~1Tbox-max[3] @ #x~X~%" (-> obj box-max)) + (format #t "~1Tobject-count: ~D~%" (-> obj object-count)) + (format #t "~1Tbucket-count: ~D~%" (-> obj bucket-count)) + (format #t "~1Tmin-cell-size: ~f~%" (-> obj min-cell-size)) + (format #t "~1Tbucket-memory-size: ~D~%" (-> obj bucket-memory-size)) + (format #t "~1Tmem-bucket-array: #x~X~%" (-> obj mem-bucket-array)) + (format #t "~1Tspr-bucket-array: #x~X~%" (-> obj spr-bucket-array)) + (format #t "~1Tdebug-draw: ~A~%" (-> obj debug-draw)) + (format #t "~1Tuse-scratch-ram: ~A~%" (-> obj use-scratch-ram)) + (label cfg-4) + obj + ) + +;; definition of type find-nav-sphere-ids-params +(deftype find-nav-sphere-ids-params (structure) + ((bsphere sphere :inline :offset-assert 0) + (y-threshold float :offset-assert 16) + (len int16 :offset-assert 20) + (max-len int16 :offset-assert 22) + (mask uint8 :offset-assert 24) + (array uint32 :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type find-nav-sphere-ids-params +(defmethod inspect find-nav-sphere-ids-params ((obj find-nav-sphere-ids-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'find-nav-sphere-ids-params) + (format #t "~1Tbsphere: #~%" (-> obj bsphere)) + (format #t "~1Ty-threshold: ~f~%" (-> obj y-threshold)) + (format #t "~1Tlen: ~D~%" (-> obj len)) + (format #t "~1Tmax-len: ~D~%" (-> obj max-len)) + (format #t "~1Tmask: ~D~%" (-> obj mask)) + (format #t "~1Tarray: #x~X~%" (-> obj array)) + (label cfg-4) + obj + ) + +;; 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) + ) + :method-count-assert 34 + :size-assert #x68 + :flag-assert #x2200000068 + (:methods + (sphere-hash-method-25 () none 25) + (sphere-hash-method-26 () none 26) + (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-31 () none 31) + (sphere-hash-method-32 () none 32) + (sphere-hash-method-33 () none 33) + ) + ) + +;; definition for method 3 of type sphere-hash +(defmethod inspect sphere-hash ((obj sphere-hash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twork: ~A~%" (-> obj work)) + (format #t "~1Tsearch-box: #~%" (-> obj search-box)) + (format #t "~1Tbucket-size: ~D~%" (-> obj bucket-size)) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) + (format #t "~1Tvertical-cell-count: ~D~%" (-> obj vertical-cell-count)) + (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) + (format #t "~1Tbox-min[3] @ #x~X~%" (-> obj box-min)) + (format #t "~1Tbox-max[3] @ #x~X~%" (-> obj box-max)) + (format #t "~1Tobject-count: ~D~%" (-> obj object-count)) + (format #t "~1Tbucket-count: ~D~%" (-> obj bucket-count)) + (format #t "~1Tmin-cell-size: ~f~%" (-> obj min-cell-size)) + (format #t "~1Tbucket-memory-size: ~D~%" (-> obj bucket-memory-size)) + (format #t "~1Tmem-bucket-array: #x~X~%" (-> obj mem-bucket-array)) + (format #t "~1Tspr-bucket-array: #x~X~%" (-> obj spr-bucket-array)) + (format #t "~1Tdebug-draw: ~A~%" (-> obj debug-draw)) + (format #t "~1Tuse-scratch-ram: ~A~%" (-> obj use-scratch-ram)) + (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) + (format #t "~1Tmax-object-count: ~D~%" (-> obj max-object-count)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "~1Tmem-sphere-array: #x~X~%" (-> obj mem-sphere-array)) + (format #t "~1Tspr-sphere-array: #x~X~%" (-> obj spr-sphere-array)) + (label cfg-4) + obj + ) + +;; definition of type hash-object-info +(deftype hash-object-info (structure) + ((object basic :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type hash-object-info +(defmethod inspect hash-object-info ((obj hash-object-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hash-object-info) + (format #t "~1Tobject: ~A~%" (-> obj object)) + (label cfg-4) + obj + ) + +;; definition of type spatial-hash +(deftype spatial-hash (sphere-hash) + ((object-array uint32 :offset-assert 104) + (mem-object-array uint32 :offset-assert 108) + (spr-object-array uint32 :offset-assert 112) + ) + :method-count-assert 41 + :size-assert #x74 + :flag-assert #x2900000074 + (:methods + (spatial-hash-method-34 () none 34) + (spatial-hash-method-35 () none 35) + (spatial-hash-method-36 () none 36) + (spatial-hash-method-37 () none 37) + (spatial-hash-method-38 () none 38) + (spatial-hash-method-39 () none 39) + (spatial-hash-method-40 () none 40) + ) + ) + +;; definition for method 3 of type spatial-hash +(defmethod inspect spatial-hash ((obj spatial-hash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Twork: ~A~%" (-> obj work)) + (format #t "~1Tsearch-box: #~%" (-> obj search-box)) + (format #t "~1Tbucket-size: ~D~%" (-> obj bucket-size)) + (format #t "~1Taxis-scale[3] @ #x~X~%" (-> obj axis-scale)) + (format #t "~1Tdimension-array[3] @ #x~X~%" (-> obj dimension-array)) + (format #t "~1Tvertical-cell-count: ~D~%" (-> obj vertical-cell-count)) + (format #t "~1Tbucket-array: #x~X~%" (-> obj bucket-array)) + (format #t "~1Tbox-min[3] @ #x~X~%" (-> obj box-min)) + (format #t "~1Tbox-max[3] @ #x~X~%" (-> obj box-max)) + (format #t "~1Tobject-count: ~D~%" (-> obj object-count)) + (format #t "~1Tbucket-count: ~D~%" (-> obj bucket-count)) + (format #t "~1Tmin-cell-size: ~f~%" (-> obj min-cell-size)) + (format #t "~1Tbucket-memory-size: ~D~%" (-> obj bucket-memory-size)) + (format #t "~1Tmem-bucket-array: #x~X~%" (-> obj mem-bucket-array)) + (format #t "~1Tspr-bucket-array: #x~X~%" (-> obj spr-bucket-array)) + (format #t "~1Tdebug-draw: ~A~%" (-> obj debug-draw)) + (format #t "~1Tuse-scratch-ram: ~A~%" (-> obj use-scratch-ram)) + (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) + (format #t "~1Tmax-object-count: ~D~%" (-> obj max-object-count)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (format #t "~1Tmem-sphere-array: #x~X~%" (-> obj mem-sphere-array)) + (format #t "~1Tspr-sphere-array: #x~X~%" (-> obj spr-sphere-array)) + (format #t "~1Tobject-array: #x~X~%" (-> obj object-array)) + (format #t "~1Tmem-object-array: #x~X~%" (-> obj mem-object-array)) + (format #t "~1Tspr-object-array: #x~X~%" (-> obj spr-object-array)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc new file mode 100644 index 0000000000..ca95383cbe --- /dev/null +++ b/test/decompiler/reference/jak2/engine/target/surface-h_REF.gc @@ -0,0 +1,1322 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type surface +(deftype surface (basic) + ((name symbol :offset-assert 4) + (turnv float :offset-assert 8) + (turnvv float :offset-assert 12) + (tiltv float :offset-assert 16) + (tiltvv float :offset-assert 20) + (transv-max float :offset-assert 24) + (target-speed float :offset-assert 28) + (seek0 float :offset-assert 32) + (seek90 float :offset-assert 36) + (seek180 float :offset-assert 40) + (fric float :offset-assert 44) + (nonlin-fric-dist float :offset-assert 48) + (slip-factor float :offset-assert 52) + (slide-factor float :offset-assert 56) + (slope-up-factor float :offset-assert 60) + (slope-down-factor float :offset-assert 64) + (slope-slip-angle float :offset-assert 68) + (impact-fric float :offset-assert 72) + (bend-factor float :offset-assert 76) + (bend-speed float :offset-assert 80) + (alignv float :offset-assert 84) + (slope-up-traction float :offset-assert 88) + (align-speed float :offset-assert 92) + (slope-change-preserve float :offset-assert 96) + (turnvf float :offset-assert 100) + (turnvvf float :offset-assert 104) + (tiltvf float :offset-assert 108) + (tiltvvf float :offset-assert 112) + (vel-turn float :offset-assert 116) + (active-hook (function none) :offset 128) + (touch-hook (function none) :offset-assert 132) + (impact-hook function :offset-assert 136) + (mult-hook (function surface surface surface int none) :offset-assert 140) + (exit-hook function :offset-assert 144) + (mode symbol :offset-assert 148) + (flags surface-flag :offset-assert 152) + (data float 30 :offset 8) + (hook function 4 :offset 128) + (dataw uint32 2 :offset 148) + ) + :method-count-assert 9 + :size-assert #x9c + :flag-assert #x90000009c + ) + +;; definition for method 3 of type surface +(defmethod inspect surface ((obj surface)) + (when (not obj) + (set! obj obj) + (goto cfg-62) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tdata[30] @ #x~X~%" (&-> obj turnv)) + (format #t "~1Tturnv: ~f~%" (-> obj turnv)) + (format #t "~1Tturnvf: ~f~%" (-> obj turnvf)) + (format #t "~1Tturnvv: ~f~%" (-> obj turnvv)) + (format #t "~1Tturnvvf: ~f~%" (-> obj turnvvf)) + (format #t "~1Ttiltv: ~f~%" (-> obj tiltv)) + (format #t "~1Ttiltvf: ~f~%" (-> obj tiltvf)) + (format #t "~1Ttiltvv: ~f~%" (-> obj tiltvv)) + (format #t "~1Ttiltvvf: ~f~%" (-> obj tiltvvf)) + (format #t "~1Tvel-turn: ~f~%" (-> obj vel-turn)) + (format #t "~1Ttransv-max: ~f~%" (-> obj transv-max)) + (format #t "~1Ttarget-speed: ~f~%" (-> obj target-speed)) + (format #t "~1Tseek0: ~f~%" (-> obj seek0)) + (format #t "~1Tseek90: ~f~%" (-> obj seek90)) + (format #t "~1Tseek180: ~f~%" (-> obj seek180)) + (format #t "~1Tfric: ~f~%" (-> obj fric)) + (format #t "~1Tnonlin-fric-dist: ~f~%" (-> obj nonlin-fric-dist)) + (format #t "~1Tslip-factor: ~f~%" (-> obj slip-factor)) + (format #t "~1Tslide-factor: ~f~%" (-> obj slide-factor)) + (format #t "~1Tslope-up-factor: ~f~%" (-> obj slope-up-factor)) + (format #t "~1Tslope-down-factor: ~f~%" (-> obj slope-down-factor)) + (format #t "~1Tslope-slip-angle: ~f~%" (-> obj slope-slip-angle)) + (format #t "~1Timpact-fric: ~f~%" (-> obj impact-fric)) + (format #t "~1Tbend-factor: ~f~%" (-> obj bend-factor)) + (format #t "~1Tbend-speed: ~f~%" (-> obj bend-speed)) + (format #t "~1Talignv: ~f~%" (-> obj alignv)) + (format #t "~1Tslope-up-traction: ~f~%" (-> obj slope-up-traction)) + (format #t "~1Talign-speed: ~f~%" (-> obj align-speed)) + (format #t "~1Tslope-change-preserve: ~f~%" (-> obj slope-change-preserve)) + (format #t "~1Thook[5] @ #x~X~%" (&-> obj active-hook)) + (format #t "~1Tactive-hook: ~A~%" (-> obj active-hook)) + (format #t "~1Ttouch-hook: ~A~%" (-> obj touch-hook)) + (format #t "~1Timpact-hook: ~A~%" (-> obj impact-hook)) + (format #t "~1Tmult-hook: ~A~%" (-> obj mult-hook)) + (format #t "~1Texit-hook: ~A~%" (-> obj exit-hook)) + (format #t "~1Tdataw[2] @ #x~X~%" (&-> obj mode)) + (format #t "~1Tmode: ~A~%" (-> obj mode)) + (format #t "~1Tflags: #x~X : (surface-flag " (-> obj flags)) + (let ((s5-0 (-> obj flags))) + (if (= (logand (surface-flag gun-inactive) s5-0) (surface-flag gun-inactive)) + (format #t "gun-inactive ") + ) + (if (= (logand s5-0 (surface-flag momentum)) (surface-flag momentum)) + (format #t "momentum ") + ) + (if (= (logand (surface-flag no-board) s5-0) (surface-flag no-board)) + (format #t "no-board ") + ) + (if (= (logand s5-0 (surface-flag xz-local)) (surface-flag xz-local)) + (format #t "xz-local ") + ) + (if (= (logand s5-0 (surface-flag no-feet)) (surface-flag no-feet)) + (format #t "no-feet ") + ) + (if (= (logand (surface-flag gun-direct) s5-0) (surface-flag gun-direct)) + (format #t "gun-direct ") + ) + (if (= (logand s5-0 (surface-flag turn-to-vel)) (surface-flag turn-to-vel)) + (format #t "turn-to-vel ") + ) + (if (= (logand (surface-flag gun-strafe) s5-0) (surface-flag gun-strafe)) + (format #t "gun-strafe ") + ) + (if (= (logand (surface-flag gun-fast-exit) s5-0) (surface-flag gun-fast-exit)) + (format #t "gun-fast-exit ") + ) + (if (= (logand s5-0 (surface-flag attack)) (surface-flag attack)) + (format #t "attack ") + ) + (if (= (logand s5-0 (surface-flag turn-to-pad)) (surface-flag turn-to-pad)) + (format #t "turn-to-pad ") + ) + (if (= (logand (surface-flag spin) s5-0) (surface-flag spin)) + (format #t "spin ") + ) + (if (= (logand s5-0 (surface-flag no-jump)) (surface-flag no-jump)) + (format #t "no-jump ") + ) + (if (= (logand s5-0 (surface-flag look-around)) (surface-flag look-around)) + (format #t "look-around ") + ) + (if (= (logand (surface-flag gun-off) s5-0) (surface-flag gun-off)) + (format #t "gun-off ") + ) + (if (= (logand (surface-flag gun-turn-fast) s5-0) (surface-flag gun-turn-fast)) + (format #t "gun-turn-fast ") + ) + (if (= (logand s5-0 (surface-flag turn-when-centered)) (surface-flag turn-when-centered)) + (format #t "turn-when-centered ") + ) + (if (= (logand (surface-flag laser-hide) s5-0) (surface-flag laser-hide)) + (format #t "laser-hide ") + ) + (if (= (logand (surface-flag turn-to-alt) s5-0) (surface-flag turn-to-alt)) + (format #t "turn-to-alt ") + ) + (if (= (logand s5-0 (surface-flag no-attack)) (surface-flag no-attack)) + (format #t "no-attack ") + ) + (if (= (logand (surface-flag gun-no-twist) s5-0) (surface-flag gun-no-twist)) + (format #t "gun-no-twist ") + ) + (if (= (logand s5-0 (surface-flag air)) (surface-flag air)) + (format #t "air ") + ) + (if (= (logand s5-0 (surface-flag duck)) (surface-flag duck)) + (format #t "duck ") + ) + (if (= (logand s5-0 (surface-flag no-turn-around)) (surface-flag no-turn-around)) + (format #t "no-turn-around ") + ) + (if (= (logand s5-0 (surface-flag no-hands)) (surface-flag no-hands)) + (format #t "no-hands ") + ) + (if (= (logand (surface-flag gun-hide) s5-0) (surface-flag gun-hide)) + (format #t "gun-hide ") + ) + (if (= (logand s5-0 (surface-flag check-edge)) (surface-flag check-edge)) + (format #t "check-edge ") + ) + (if (= (logand (surface-flag super) s5-0) (surface-flag super)) + (format #t "super ") + ) + (if (= (logand s5-0 (surface-flag smooth-collision)) (surface-flag smooth-collision)) + (format #t "smooth-collision ") + ) + ) + (format #t ")~%") + (label cfg-62) + obj + ) + +;; definition for function calc-terminal-vel +(defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float)) + (- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1) + ) + +;; definition for function calc-terminal2-vel +(defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float)) + (let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))) + (- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4)))) + ) + ) + +;; definition for function calc-terminal4-vel +(defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float)) + (let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))) + (- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5)))) + ) + ) + +;; definition for method 2 of type surface +;; ERROR: Function may read a register that is not set: t3 +(defmethod print surface ((obj surface)) + (local-vars (t3-0 none)) + (format + #t + "# obj turnv) + (-> obj turnvv) + (-> obj tiltv) + (-> obj tiltvv) + (-> obj transv-max) + t3-0 + ) + (format #t " tm:~m rv:~R rvv:~R @ #x~X>" (-> obj target-speed) (-> obj seek0) (-> obj seek90) obj) + obj + ) + +;; definition for function surface-interp! +(defun surface-interp! ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 float)) + (dotimes (v1-0 30) + (set! (-> arg0 data v1-0) (+ (* (-> arg2 data v1-0) arg3) (* (-> arg1 data v1-0) (- 1.0 arg3)))) + ) + (dotimes (v1-3 5) + (set! (-> arg0 hook v1-3) (cond + ((and (nonzero? (-> arg2 hook v1-3)) (!= (-> arg2 hook v1-3) nothing)) + (-> arg2 hook v1-3) + ) + ((and (nonzero? (-> arg1 hook v1-3)) (!= (-> arg1 hook v1-3) nothing)) + (-> arg1 hook v1-3) + ) + (else + nothing + ) + ) + ) + ) + (dotimes (v1-6 2) + (set! (-> arg0 dataw v1-6) (-> arg2 dataw v1-6)) + ) + arg0 + ) + +;; definition for function surface-mult! +(defun surface-mult! ((arg0 surface) (arg1 surface) (arg2 surface)) + (dotimes (v1-0 30) + (set! (-> arg0 data v1-0) (* (-> arg2 data v1-0) (-> arg1 data v1-0))) + ) + (dotimes (v1-3 5) + (set! (-> arg0 hook v1-3) (cond + ((and (nonzero? (-> arg2 hook v1-3)) (!= (-> arg2 hook v1-3) nothing)) + (-> arg2 hook v1-3) + ) + ((and (nonzero? (-> arg1 hook v1-3)) (!= (-> arg1 hook v1-3) nothing)) + (-> arg1 hook v1-3) + ) + (else + nothing + ) + ) + ) + ) + (dotimes (v1-6 2) + (set! (-> arg0 dataw v1-6) (-> arg2 dataw v1-6)) + ) + (set! (-> arg0 flags) (logior (-> arg1 flags) (-> arg2 flags))) + ((-> arg0 mult-hook) arg0 arg1 arg2 1) + arg0 + ) + +;; definition for function surface-clamp-speed +;; INFO: Return type mismatch float vs none. +(defun surface-clamp-speed ((arg0 surface) (arg1 surface) (arg2 surface) (arg3 int)) + (when (= arg3 1) + (set! (-> arg0 transv-max) (fmin (-> arg0 transv-max) (-> arg1 transv-max))) + (set! (-> arg0 target-speed) (fmin (-> arg0 target-speed) (-> arg1 target-speed))) + ) + (none) + ) + +;; definition for symbol *walk-mods*, type surface +(define *walk-mods* (new 'static 'surface + :name 'run + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :flags (surface-flag look-around) + ) + ) + +;; definition for symbol *walk-no-turn-mods*, type surface +(define *walk-no-turn-mods* (new 'static 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + ) + ) + +;; definition for symbol *turn-around-mods*, type surface +(define *turn-around-mods* (new 'static 'surface + :name 'run + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :fric 0.1 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + ) + ) + +;; definition for symbol *jump-mods*, type surface +(define *jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; definition for symbol *double-jump-mods*, type surface +(define *double-jump-mods* (new 'static 'surface + :name 'jump-double + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 32768.0 + :target-speed 32768.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; definition for symbol *smack-jump-mods*, type surface +(define *smack-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air gun-inactive) + ) + ) + +;; definition for symbol *high-jump-mods*, type surface +(define *high-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 26624.0 + :target-speed 26624.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; definition for symbol *launch-jump-mods*, type surface +(define *launch-jump-mods* (new 'static 'surface + :name 'launch-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 61440.0 + :target-speed 61440.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag no-attack check-edge air) + ) + ) + +;; definition for symbol *forward-high-jump-mods*, type surface +(define *forward-high-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 45056.0 + :target-speed 45056.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; definition for symbol *flip-jump-mods*, type surface +(define *flip-jump-mods* (new 'static 'surface + :name 'high-jump + :turnv 131072.0 + :turnvv 65536.0 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 80281.6 + :target-speed 51200.0 + :seek0 0.9 + :seek90 0.9 + :seek180 0.9 + :fric 0.3 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; definition for symbol *forward-jump-mods*, type surface +(define *forward-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 65536.0 + :target-speed 65536.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air) + ) + ) + +;; definition for symbol *forward-pole-jump-mods*, type surface +(define *forward-pole-jump-mods* (new 'static 'surface + :name 'jump + :turnv 131072.0 + :turnvv 18204.445 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 53248.0 + :target-speed 53248.0 + :seek0 0.3 + :seek90 0.3 + :seek180 0.3 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag check-edge air gun-hide gun-fast-exit) + ) + ) + +;; failed to figure out what this is: +(let ((v1-20 (copy *jump-mods* 'global))) + (set! (-> v1-20 flags) (surface-flag check-edge air super)) + (set! (-> v1-20 name) 'high-jump) + (set! (-> v1-20 target-speed) 245760.0) + (set! (-> v1-20 transv-max) 245760.0) + (set! (-> v1-20 seek0) 0.9) + (set! *dark-jump-mods* v1-20) + ) + +;; definition for symbol *roll-mods*, type surface +(define *roll-mods* (new 'static 'surface + :name 'roll + :turnv 131072.0 + :turnvv 5461.3335 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 91750.4 + :target-speed 11468.8 + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag no-turn-around attack gun-inactive gun-no-twist no-board) + ) + ) + +;; definition for symbol *roll-flip-mods*, type surface +(define *roll-flip-mods* + (new 'static 'surface + :name 'roll-flip + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 91750.4 + :target-speed 103219.195 + :seek90 0.5 + :seek180 0.15 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag no-turn-around check-edge air attack gun-inactive gun-no-twist no-board) + ) + ) + +;; definition for symbol *flop-mods*, type surface +(define *flop-mods* (new 'static 'surface + :name 'flop + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.3 + :seek180 1.5 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'attack + :flags (surface-flag air attack gun-inactive gun-no-twist) + ) + ) + +;; failed to figure out what this is: +(let ((a0-9 (new 'static 'surface + :name 'flop + :turnv 9102.223 + :turnvv 9102.223 + :tiltv 32768.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 0.3 + :seek90 0.1 + :seek180 0.15 + :fric 0.2 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 0.25 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'air + :flags (surface-flag air gun-inactive gun-no-twist) + ) + ) + ) + (set! (-> a0-9 mult-hook) surface-clamp-speed) + (set! *flop-land-mods* a0-9) + ) + +;; definition for symbol *wade-mods*, type surface +(define *wade-mods* (new 'static 'surface + :name 'wade + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :seek0 1.0 + :seek90 0.5 + :seek180 0.5 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'wade + :flags (surface-flag look-around) + ) + ) + +;; definition for symbol *swim-mods*, type surface +(define *swim-mods* (new 'static 'surface + :name 'swim + :turnv 49152.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 28672.0 + :target-speed 28672.0 + :seek0 0.75 + :seek90 0.2 + :seek180 0.2 + :fric 0.05 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'swim + :flags (surface-flag gun-off) + ) + ) + +;; definition for symbol *dive-mods*, type surface +(define *dive-mods* (new 'static 'surface + :name 'swim + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.05 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'dive + :flags (surface-flag xz-local gun-off gun-fast-exit) + ) + ) + +;; definition for symbol *dive-bottom-mods*, type surface +(define *dive-bottom-mods* (new 'static 'surface + :name 'swim-bottom + :turnv 21845.334 + :turnvv 32768.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 20480.0 + :target-speed 20480.0 + :seek0 0.1 + :seek90 0.05 + :seek180 0.05 + :fric 1.0 + :nonlin-fric-dist 1.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + :mode 'dive + :flags (surface-flag xz-local gun-off gun-fast-exit) + ) + ) + +;; failed to figure out what this is: +(let ((v1-30 (copy *walk-mods* 'global))) + (set! (-> v1-30 name) 'pole) + (set! (-> v1-30 flags) (surface-flag gun-hide gun-fast-exit)) + (set! *pole-mods* v1-30) + ) + +;; failed to figure out what this is: +(let ((a0-14 (copy *walk-mods* 'global))) + (set! (-> a0-14 name) 'grab) + (set! (-> a0-14 flags) (surface-flag)) + (set! *grab-mods* a0-14) + ) + +;; failed to figure out what this is: +(let ((v1-34 (copy *walk-mods* 'global))) + (set! (-> v1-34 name) 'edge-grab) + (set! (-> v1-34 flags) (surface-flag gun-inactive gun-no-twist)) + (set! *edge-grab-mods* v1-34) + ) + +;; definition for symbol *empty-mods*, type surface +(define *empty-mods* (new 'static 'surface + :name 'empty + :seek0 1.0 + :seek90 1.0 + :seek180 1.0 + :fric 1.0 + :flags (surface-flag gun-off) + ) + ) + +;; definition for symbol *neutral-mods*, type surface +(define *neutral-mods* (new 'static 'surface + :name 'walk + :turnv 131072.0 + :turnvv 524288.0 + :tiltv 65536.0 + :tiltvv 262144.0 + :transv-max 40960.0 + :target-speed 40960.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-up-factor 1.0 + :slope-down-factor 1.0 + :slope-slip-angle 1.0 + :impact-fric 1.0 + :bend-factor 1.0 + :bend-speed 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 30.0 + :turnvvf 30.0 + :tiltvf 150.0 + :tiltvvf 15.0 + ) + ) + +;; failed to figure out what this is: +(let ((v1-37 (new 'static 'surface + :name '*stone-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (set! *stone-surface* v1-37) + (set! (-> v1-37 exit-hook) nothing) + (set! (-> v1-37 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-37 touch-hook) nothing) + (set! (-> v1-37 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-38 (new 'static 'surface + :name '*gravel-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slide-factor 1.0 + :slope-down-factor 32768.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (set! *gravel-surface* v1-38) + (set! (-> v1-38 exit-hook) nothing) + (set! (-> v1-38 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-38 touch-hook) (lambda () (gravel-surface-touch) (none))) + (set! (-> v1-38 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-39 (new 'static 'surface + :name '*edge-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 30720.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 18432.0 + :slope-slip-angle 8192.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :align-speed 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (set! *edge-surface* v1-39) + (set! (-> v1-39 exit-hook) nothing) + (set! (-> v1-39 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-39 touch-hook) nothing) + (set! (-> v1-39 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-40 (new 'static 'surface + :name '*wade-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.7 + :target-speed 0.7 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.6 + :slope-up-traction 1.0 + :align-speed 0.6 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (set! *wade-surface* v1-40) + (set! (-> v1-40 exit-hook) nothing) + (set! (-> v1-40 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-40 touch-hook) nothing) + (set! (-> v1-40 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-41 (new 'static 'surface + :name '*quicksand-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.5 + :target-speed 0.5 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (set! *quicksand-surface* v1-41) + (set! (-> v1-41 exit-hook) nothing) + (set! (-> v1-41 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-41 touch-hook) nothing) + (set! (-> v1-41 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-42 (new 'static 'surface + :name '*tar-surface* + :turnv 0.25 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 0.4 + :target-speed 0.4 + :seek0 81920.0 + :seek90 83968.0 + :seek180 165888.0 + :fric 329728.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 0.5 + :slope-up-traction 1.0 + :align-speed 0.5 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + ) + ) + ) + (set! *tar-surface* v1-42) + (set! (-> v1-42 exit-hook) nothing) + (set! (-> v1-42 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-42 touch-hook) nothing) + (set! (-> v1-42 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-43 (new 'static 'surface + :name '*ice-surface* + :turnv 0.5 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.5 + :target-speed 1.5 + :seek0 24576.0 + :seek90 24576.0 + :seek180 24576.0 + :fric 23756.8 + :nonlin-fric-dist 4091904.0 + :slip-factor 0.7 + :slope-slip-angle 16384.0 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + :flags (surface-flag no-turn-around turn-to-pad) + ) + ) + ) + (set! *ice-surface* v1-43) + (set! (-> v1-43 exit-hook) nothing) + (set! (-> v1-43 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-43 touch-hook) nothing) + (set! (-> v1-43 active-hook) nothing) + ) + +;; failed to figure out what this is: +(let ((v1-44 (new 'static 'surface + :name '*rail-surface* + :turnv 1.0 + :turnvv 1.0 + :tiltv 1.0 + :tiltvv 1.0 + :transv-max 1.0 + :target-speed 1.0 + :seek0 153600.0 + :seek90 153600.0 + :seek180 256000.0 + :fric 153600.0 + :nonlin-fric-dist 5120.0 + :slip-factor 1.0 + :slope-down-factor 10240.0 + :slope-slip-angle 8192.0 + :impact-fric 1.0 + :bend-factor 0.8 + :bend-speed 4.0 + :alignv 1.0 + :slope-up-traction 1.0 + :align-speed 1.0 + :slope-change-preserve 1.0 + :turnvf 1.0 + :turnvvf 1.0 + :tiltvf 1.0 + :tiltvvf 1.0 + :vel-turn 1.0 + :flags (surface-flag no-attack) + ) + ) + ) + (set! *rail-surface* v1-44) + (set! (-> v1-44 exit-hook) nothing) + (set! (-> v1-44 mult-hook) (the-as (function surface surface surface int none) nothing)) + (set! (-> v1-44 touch-hook) (lambda () (rail-surface-touch) (none))) + (set! (-> v1-44 active-hook) nothing) + ) + +;; definition for symbol *standard-ground-surface*, type surface +(define *standard-ground-surface* *stone-surface*) + +;; definition for symbol *swim-surface*, type surface +(define *swim-surface* *stone-surface*) + +;; failed to figure out what this is: +0 + + + + 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 new file mode 100644 index 0000000000..deaa363a66 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/task/task-control-h_REF.gc @@ -0,0 +1,1528 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition (debug) for function game-task->string +(defun-debug game-task->string ((arg0 game-task)) + (case arg0 + (((game-task forest-protect)) + "forest-protect" + ) + (((game-task strip-drop)) + "strip-drop" + ) + (((game-task fortress-dump)) + "fortress-dump" + ) + (((game-task ruins-tower)) + "ruins-tower" + ) + (((game-task city-burning-bush-race-errol)) + "city-burning-bush-race-errol" + ) + (((game-task canyon-insert-items)) + "canyon-insert-items" + ) + (((game-task city-win)) + "city-win" + ) + (((game-task city-burning-bush-get-to-5)) + "city-burning-bush-get-to-5" + ) + (((game-task tomb-water)) + "tomb-water" + ) + (((game-task stadium-race-class3)) + "stadium-race-class3" + ) + (((game-task city-burning-bush-ring-2)) + "city-burning-bush-ring-2" + ) + (((game-task eco-blue-button)) + "eco-blue-button" + ) + (((game-task stadium-burning-bush-race-class1-r)) + "stadium-burning-bush-race-class1-r" + ) + (((game-task ruins-enemy)) + "ruins-enemy" + ) + (((game-task city-burning-bush-shuttle-1)) + "city-burning-bush-shuttle-1" + ) + (((game-task eco-red-button)) + "eco-red-button" + ) + (((game-task city-burning-bush-ring-1)) + "city-burning-bush-ring-1" + ) + (((game-task city-krew-delivery)) + "city-krew-delivery" + ) + (((game-task stadium-burning-bush-race-class3-r)) + "stadium-burning-bush-race-class3-r" + ) + (((game-task stadium-burning-bush-race-class3)) + "stadium-burning-bush-race-class3" + ) + (((game-task city-burning-bush-get-to-15)) + "city-burning-bush-get-to-15" + ) + (((game-task city-help-kid)) + "city-help-kid" + ) + (((game-task under-mech)) + "under-mech" + ) + (((game-task city-escort-kid)) + "city-escort-kid" + ) + (((game-task mountain-gear)) + "mountain-gear" + ) + (((game-task max)) + "max" + ) + (((game-task city-defend-stadium)) + "city-defend-stadium" + ) + (((game-task city-burning-bush-get-to-12)) + "city-burning-bush-get-to-12" + ) + (((game-task city-burning-bush-bombbot-1)) + "city-burning-bush-bombbot-1" + ) + (((game-task drill-ship)) + "drill-ship" + ) + (((game-task city-yellow-gun-training)) + "city-yellow-gun-training" + ) + (((game-task sewer-enemy)) + "sewer-enemy" + ) + (((game-task palace-cable)) + "palace-cable" + ) + (((game-task city-burning-bush-get-to-10)) + "city-burning-bush-get-to-10" + ) + (((game-task castle-break-in)) + "castle-break-in" + ) + (((game-task tomb-poles)) + "tomb-poles" + ) + (((game-task city-vehicle-training)) + "city-vehicle-training" + ) + (((game-task sewer-escort)) + "sewer-escort" + ) + (((game-task city-errol-challenge)) + "city-errol-challenge" + ) + (((game-task strip-grenade)) + "strip-grenade" + ) + (((game-task atoll-sig)) + "atoll-sig" + ) + (((game-task stadium-burning-bush-race-class1)) + "stadium-burning-bush-race-class1" + ) + (((game-task nest-boss)) + "nest-boss" + ) + (((game-task forest-hunt)) + "forest-hunt" + ) + (((game-task stadium-race-class2)) + "stadium-race-class2" + ) + (((game-task city-play-onin-game)) + "city-play-onin-game" + ) + (((game-task city-burning-bush-collection-2)) + "city-burning-bush-collection-2" + ) + (((game-task none)) + "none" + ) + (((game-task eco-yellow-button)) + "eco-yellow-button" + ) + (((game-task drill-eggs)) + "drill-eggs" + ) + (((game-task city-burning-bush-get-to-2)) + "city-burning-bush-get-to-2" + ) + (((game-task city-burning-bush-racepoint-1)) + "city-burning-bush-racepoint-1" + ) + (((game-task city-burning-bush-get-to-11)) + "city-burning-bush-get-to-11" + ) + (((game-task under-sig)) + "under-sig" + ) + (((game-task stadium-burning-bush-race-class2)) + "stadium-burning-bush-race-class2" + ) + (((game-task stadium-burning-bush-race-board)) + "stadium-burning-bush-race-board" + ) + (((game-task city-burning-bush-race-port)) + "city-burning-bush-race-port" + ) + (((game-task city-burning-bush-get-to-7)) + "city-burning-bush-get-to-7" + ) + (((game-task atoll-battle)) + "atoll-battle" + ) + (((game-task drill-mech)) + "drill-mech" + ) + (((game-task ruins-mech)) + "ruins-mech" + ) + (((game-task city-burning-bush-get-to-13)) + "city-burning-bush-get-to-13" + ) + (((game-task city-destroy-guard-vehicles)) + "city-destroy-guard-vehicles" + ) + (((game-task tomb-boss)) + "tomb-boss" + ) + (((game-task dummy0)) + "dummy0" + ) + (((game-task dig-find-totem)) + "dig-find-totem" + ) + (((game-task dig-knock-down)) + "dig-knock-down" + ) + (((game-task city-protect-water-slums)) + "city-protect-water-slums" + ) + (((game-task city-whack)) + "city-whack" + ) + (((game-task city-burning-bush-ring-3)) + "city-burning-bush-ring-3" + ) + (((game-task city-shuttle)) + "city-shuttle" + ) + (((game-task fortress-save-friends)) + "fortress-save-friends" + ) + (((game-task city-intercept-tanker)) + "city-intercept-tanker" + ) + (((game-task forest-scouts)) + "forest-scouts" + ) + (((game-task nest-get-to-gun)) + "nest-get-to-gun" + ) + (((game-task stadium-race-class)) + "stadium-race-class1" + ) + (((game-task stadium-burning-bush-race-class2-r)) + "stadium-burning-bush-race-class2-r" + ) + (((game-task palace-sneak-in)) + "palace-sneak-in" + ) + (((game-task strip-rescue)) + "strip-rescue" + ) + (((game-task city-burning-bush-get-to-1)) + "city-burning-bush-get-to-1" + ) + (((game-task consite-find-baron)) + "consite-find-baron" + ) + (((game-task city-burning-bush-get-to-3)) + "city-burning-bush-get-to-3" + ) + (((game-task stadium-board1)) + "stadium-board1" + ) + (((game-task city-burning-bush-get-to-4)) + "city-burning-bush-get-to-4" + ) + (((game-task city-burning-bush-collection-3)) + "city-burning-bush-collection-3" + ) + (((game-task city-port-run)) + "city-port-run" + ) + (((game-task sewer-board)) + "sewer-board" + ) + (((game-task city-dark-gun-training)) + "city-dark-gun-training" + ) + (((game-task city-oracle)) + "city-oracle" + ) + (((game-task city-burning-bush-collection-1)) + "city-burning-bush-collection-1" + ) + (((game-task city-keira-delivery)) + "city-keira-delivery" + ) + (((game-task city-burning-bush-get-to-6)) + "city-burning-bush-get-to-6" + ) + (((game-task mountain-lens)) + "mountain-lens" + ) + (((game-task atoll-water)) + "atoll-water" + ) + (((game-task city-stop-bomb-bots)) + "city-stop-bomb-bots" + ) + (((game-task mountain-collection)) + "mountain-collection" + ) + (((game-task nest-enter)) + "nest-enter" + ) + (((game-task city-burning-bush-get-to-9)) + "city-burning-bush-get-to-9" + ) + (((game-task mountain-shard)) + "mountain-shard" + ) + (((game-task city-power)) + "city-power" + ) + (((game-task complete)) + "complete" + ) + (((game-task palace-boss)) + "palace-boss" + ) + (((game-task castle-boss)) + "castle-boss" + ) + (((game-task city-burning-bush-get-to-8)) + "city-burning-bush-get-to-8" + ) + (((game-task city-blue-gun-training)) + "city-blue-gun-training" + ) + (((game-task fortress-escape)) + "fortress-escape" + ) + (((game-task city-red-gun-training)) + "city-red-gun-training" + ) + (((game-task city-save-lurkers)) + "city-save-lurkers" + ) + (((game-task city-krew-collection)) + "city-krew-collection" + ) + (((game-task city-burning-bush-get-to-14)) + "city-burning-bush-get-to-14" + ) + (((game-task city-meet-brutter)) + "city-meet-brutter" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition for function c-string->game-task +;; INFO: Return type mismatch int vs game-task. +(defun c-string->game-task ((arg0 string)) + (the-as game-task (cond + ((string= arg0 "GAME_TASK_FOREST_PROTECT") + 60 + ) + ((string= arg0 "GAME_TASK_STRIP_DROP") + 58 + ) + ((string= arg0 "GAME_TASK_FORTRESS_DUMP") + 11 + ) + ((string= arg0 "GAME_TASK_RUINS_TOWER") + 9 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RACE_ERROL") + 101 + ) + ((string= arg0 "GAME_TASK_CANYON_INSERT_ITEMS") + 48 + ) + ((string= arg0 "GAME_TASK_CITY_WIN") + 75 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_5") + 85 + ) + ((string= arg0 "GAME_TASK_TOMB_WATER") + 50 + ) + ((string= arg0 "GAME_TASK_STADIUM_RACE_CLASS3") + 43 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RING_2") + 84 + ) + ((string= arg0 "GAME_TASK_ECO_BLUE_BUTTON") + 3 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS1_R") + 109 + ) + ((string= arg0 "GAME_TASK_RUINS_ENEMY") + 31 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_SHUTTLE_1") + 87 + ) + ((string= arg0 "GAME_TASK_ECO_RED_BUTTON") + 5 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RING_1") + 77 + ) + ((string= arg0 "GAME_TASK_CITY_KREW_DELIVERY") + 12 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS3_R") + 107 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS3") + 104 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_15") + 99 + ) + ((string= arg0 "GAME_TASK_CITY_HELP_KID") + 7 + ) + ((string= arg0 "GAME_TASK_UNDER_MECH") + 68 + ) + ((string= arg0 "GAME_TASK_CITY_ESCORT_KID") + 34 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_GEAR") + 19 + ) + ((string= arg0 "GAME_TASK_MAX") + 110 + ) + ((string= arg0 "GAME_TASK_CITY_DEFEND_STADIUM") + 70 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_12") + 95 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_BOMBBOT_1") + 96 + ) + ((string= arg0 "GAME_TASK_DRILL_SHIP") + 37 + ) + ((string= arg0 "GAME_TASK_CITY_YELLOW_GUN_TRAINING") + 25 + ) + ((string= arg0 "GAME_TASK_SEWER_ENEMY") + 15 + ) + ((string= arg0 "GAME_TASK_PALACE_CABLE") + 28 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_10") + 92 + ) + ((string= arg0 "GAME_TASK_CASTLE_BREAK_IN") + 65 + ) + ((string= arg0 "GAME_TASK_TOMB_POLES") + 49 + ) + ((string= arg0 "GAME_TASK_CITY_VEHICLE_TRAINING") + 8 + ) + ((string= arg0 "GAME_TASK_SEWER_ESCORT") + 53 + ) + ((string= arg0 "GAME_TASK_CITY_ERROL_CHALLENGE") + 57 + ) + ((string= arg0 "GAME_TASK_STRIP_GRENADE") + 36 + ) + ((string= arg0 "GAME_TASK_ATOLL_SIG") + 14 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS1") + 106 + ) + ((string= arg0 "GAME_TASK_NEST_BOSS") + 74 + ) + ((string= arg0 "GAME_TASK_FOREST_HUNT") + 41 + ) + ((string= arg0 "GAME_TASK_STADIUM_RACE_CLASS2") + 55 + ) + ((string= arg0 "GAME_TASK_CITY_PLAY_ONIN_GAME") + 47 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_COLLECTION_2") + 91 + ) + ((string= arg0 "GAME_TASK_NONE") + 0 + ) + ((string= arg0 "GAME_TASK_ECO_YELLOW_BUTTON") + 4 + ) + ((string= arg0 "GAME_TASK_DRILL_EGGS") + 26 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_2") + 79 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RACEPOINT_1") + 83 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_11") + 93 + ) + ((string= arg0 "GAME_TASK_UNDER_SIG") + 69 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS2") + 105 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_BOARD") + 103 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RACE_PORT") + 102 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_7") + 88 + ) + ((string= arg0 "GAME_TASK_ATOLL_BATTLE") + 17 + ) + ((string= arg0 "GAME_TASK_DRILL_MECH") + 61 + ) + ((string= arg0 "GAME_TASK_RUINS_MECH") + 59 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_13") + 97 + ) + ((string= arg0 "GAME_TASK_CITY_DESTROY_GUARD_VEHICLES") + 46 + ) + ((string= arg0 "GAME_TASK_TOMB_BOSS") + 51 + ) + ((string= arg0 "GAME_TASK_DUMMY0") + 2 + ) + ((string= arg0 "GAME_TASK_DIG_FIND_TOTEM") + 45 + ) + ((string= arg0 "GAME_TASK_DIG_KNOCK_DOWN") + 35 + ) + ((string= arg0 "GAME_TASK_CITY_PROTECT_WATER_SLUMS") + 44 + ) + ((string= arg0 "GAME_TASK_CITY_WHACK") + 67 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_RING_3") + 94 + ) + ((string= arg0 "GAME_TASK_CITY_SHUTTLE") + 30 + ) + ((string= arg0 "GAME_TASK_FORTRESS_SAVE_FRIENDS") + 52 + ) + ((string= arg0 "GAME_TASK_CITY_INTERCEPT_TANKER") + 42 + ) + ((string= arg0 "GAME_TASK_FOREST_SCOUTS") + 33 + ) + ((string= arg0 "GAME_TASK_NEST_GET_TO_GUN") + 72 + ) + ((string= arg0 "GAME_TASK_STADIUM_RACE_CLASS1") + 63 + ) + ((string= arg0 "GAME_TASK_STADIUM_BURNING_BUSH_RACE_CLASS2_R") + 108 + ) + ((string= arg0 "GAME_TASK_PALACE_SNEAK_IN") + 64 + ) + ((string= arg0 "GAME_TASK_STRIP_RESCUE") + 16 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_1") + 78 + ) + ((string= arg0 "GAME_TASK_CONSITE_FIND_BARON") + 71 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_3") + 80 + ) + ((string= arg0 "GAME_TASK_STADIUM_BOARD1") + 23 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_4") + 81 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_COLLECTION_3") + 100 + ) + ((string= arg0 "GAME_TASK_CITY_PORT_RUN") + 38 + ) + ((string= arg0 "GAME_TASK_SEWER_BOARD") + 40 + ) + ((string= arg0 "GAME_TASK_CITY_DARK_GUN_TRAINING") + 54 + ) + ((string= arg0 "GAME_TASK_CITY_ORACLE") + 76 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_COLLECTION_1") + 82 + ) + ((string= arg0 "GAME_TASK_CITY_KEIRA_DELIVERY") + 22 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_6") + 86 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_LENS") + 18 + ) + ((string= arg0 "GAME_TASK_ATOLL_WATER") + 10 + ) + ((string= arg0 "GAME_TASK_CITY_STOP_BOMB_BOTS") + 56 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_COLLECTION") + 21 + ) + ((string= arg0 "GAME_TASK_NEST_ENTER") + 73 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_9") + 90 + ) + ((string= arg0 "GAME_TASK_MOUNTAIN_SHARD") + 20 + ) + ((string= arg0 "GAME_TASK_CITY_POWER") + 27 + ) + ((string= arg0 "GAME_TASK_COMPLETE") + 1 + ) + ((string= arg0 "GAME_TASK_PALACE_BOSS") + 29 + ) + ((string= arg0 "GAME_TASK_CASTLE_BOSS") + 66 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_8") + 89 + ) + ((string= arg0 "GAME_TASK_CITY_BLUE_GUN_TRAINING") + 32 + ) + ((string= arg0 "GAME_TASK_FORTRESS_ESCAPE") + 6 + ) + ((string= arg0 "GAME_TASK_CITY_RED_GUN_TRAINING") + 13 + ) + ((string= arg0 "GAME_TASK_CITY_SAVE_LURKERS") + 62 + ) + ((string= arg0 "GAME_TASK_CITY_KREW_COLLECTION") + 24 + ) + ((string= arg0 "GAME_TASK_CITY_BURNING_BUSH_GET_TO_14") + 98 + ) + ((string= arg0 "GAME_TASK_CITY_MEET_BRUTTER") + 39 + ) + (else + -1 + ) + ) + ) + ) + +;; definition (debug) for function game-task-actor->string +(defun-debug game-task-actor->string ((arg0 game-task-actor)) + (case arg0 + (((game-task-actor burning-bush-genc)) + "burning-bush-genc" + ) + (((game-task-actor minimap)) + "minimap" + ) + (((game-task-actor youngsamos-tomb)) + "youngsamos-tomb" + ) + (((game-task-actor youngsamos-onintent)) + "youngsamos-onintent" + ) + (((game-task-actor baron-consite)) + "baron-consite" + ) + (((game-task-actor burning-bush-markb)) + "burning-bush-markb" + ) + (((game-task-actor keira-garage)) + "keira-garage" + ) + (((game-task-actor burning-bush-genc-2)) + "burning-bush-genc-2" + ) + (((game-task-actor samos-garage)) + "samos-garage" + ) + (((game-task-actor kid-hideout)) + "kid-hideout" + ) + (((game-task-actor krew-hiphog)) + "krew-hiphog" + ) + (((game-task-actor burning-bush-port-2)) + "burning-bush-port-2" + ) + (((game-task-actor none)) + "none" + ) + (((game-task-actor burning-bush-port-3)) + "burning-bush-port-3" + ) + (((game-task-actor brutter-kiosk)) + "brutter-kiosk" + ) + (((game-task-actor tess-alley)) + "tess-alley" + ) + (((game-task-actor whack-a-metal-hiphog)) + "whack-a-metal-hiphog" + ) + (((game-task-actor burning-bush-gena)) + "burning-bush-gena" + ) + (((game-task-actor vin-vinroom)) + "vin-vinroom" + ) + (((game-task-actor kor-hideout)) + "kor-hideout" + ) + (((game-task-actor burning-bush-pal-2)) + "burning-bush-pal-2" + ) + (((game-task-actor kid-alley)) + "kid-alley" + ) + (((game-task-actor burning-bush-stadium)) + "burning-bush-stadium" + ) + (((game-task-actor ashelin-market)) + "ashelin-market" + ) + (((game-task-actor kid-tomb)) + "kid-tomb" + ) + (((game-task-actor burning-bush-farma)) + "burning-bush-farma" + ) + (((game-task-actor baron-tomb)) + "baron-tomb" + ) + (((game-task-actor burning-bush-slumc)) + "burning-bush-slumc" + ) + (((game-task-actor burning-bush-slumb-2)) + "burning-bush-slumb-2" + ) + (((game-task-actor baron-palace)) + "baron-palace" + ) + (((game-task-actor crocadog-alley)) + "crocadog-alley" + ) + (((game-task-actor baron-castle)) + "baron-castle" + ) + (((game-task-actor crocadog-vinroom)) + "crocadog-vinroom" + ) + (((game-task-actor burning-bush-gena-2)) + "burning-bush-gena-2" + ) + (((game-task-actor daxter-tomb)) + "daxter-tomb" + ) + (((game-task-actor burning-bush-port)) + "burning-bush-port" + ) + (((game-task-actor burning-bush-marka)) + "burning-bush-marka" + ) + (((game-task-actor crocadog-tomb)) + "crocadog-tomb" + ) + (((game-task-actor keira-stadium)) + "keira-stadium" + ) + (((game-task-actor sig-hiphog)) + "sig-hiphog" + ) + (((game-task-actor youngsamos-hideout)) + "youngsamos-hideout" + ) + (((game-task-actor burning-bush-genb-2)) + "burning-bush-genb-2" + ) + (((game-task-actor burning-bush-inda)) + "burning-bush-inda" + ) + (((game-task-actor kor-tomb)) + "kor-tomb" + ) + (((game-task-actor kor-consite)) + "kor-consite" + ) + (((game-task-actor torn-hideout)) + "torn-hideout" + ) + (((game-task-actor onin-onintent)) + "onin-onintent" + ) + (((game-task-actor kor-alley)) + "kor-alley" + ) + (((game-task-actor kid-vinroom)) + "kid-vinroom" + ) + (((game-task-actor ashelin-atoll)) + "ashelin-atoll" + ) + (((game-task-actor burning-bush-sluma)) + "burning-bush-sluma" + ) + (((game-task-actor burning-bush-slumb)) + "burning-bush-slumb" + ) + (((game-task-actor youngsamos-alley)) + "youngsamos-alley" + ) + (((game-task-actor youngsamos-forest)) + "youngsamos-forest" + ) + (((game-task-actor samos-hideout)) + "samos-hideout" + ) + (((game-task-actor burning-bush-genb)) + "burning-bush-genb" + ) + (((game-task-actor oracle-oracle)) + "oracle-oracle" + ) + (((game-task-actor torn-alley)) + "torn-alley" + ) + (((game-task-actor kor-onintent)) + "kor-onintent" + ) + (((game-task-actor tess-hiphog)) + "tess-hiphog" + ) + (((game-task-actor burning-bush-markb-2)) + "burning-bush-markb-2" + ) + (((game-task-actor ashelin-throne)) + "ashelin-throne" + ) + (((game-task-actor burning-bush-indb)) + "burning-bush-indb" + ) + (((game-task-actor pecker-onintent)) + "pecker-onintent" + ) + (((game-task-actor kor-vinroom)) + "kor-vinroom" + ) + (((game-task-actor sig-atoll)) + "sig-atoll" + ) + (((game-task-actor burning-bush-pal)) + "burning-bush-pal" + ) + (((game-task-actor burning-bush-farmb)) + "burning-bush-farmb" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition (debug) for function game-task-action->string +(defun-debug game-task-action->string ((arg0 game-task-action)) + (case arg0 + (((game-task-action idle)) + "idle" + ) + (((game-task-action play)) + "play" + ) + (((game-task-action show)) + "show" + ) + (((game-task-action talk)) + "talk" + ) + (((game-task-action hide)) + "hide" + ) + (((game-task-action say)) + "say" + ) + (((game-task-action shade)) + "trade" + ) + (((game-task-action menu)) + "menu" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type game-task-event +(deftype game-task-event (basic) + ((actor game-task-actor :offset-assert 4) + (action game-task-action :offset-assert 5) + (icon game-task-icon :offset 6) + (flags game-task-flags :offset 7) + (scene basic :offset 8) + (distance meters :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type game-task-event +(defmethod inspect game-task-event ((obj game-task-event)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) + (format #t "~1Taction: #x~X : ~S~%" (-> obj action) (game-task-action->string (-> obj action))) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Ticon: ~D~%" (-> obj icon)) + (format #t "~1Tscene: ~A~%" (-> obj scene)) + (format #t "~1Tdistance: (meters ~m)~%" (-> obj distance)) + (label cfg-4) + obj + ) + +;; definition of type task-manager-info +(deftype task-manager-info (structure) + ((mask task-manager-mask :offset-assert 0) + (level basic :offset-assert 4) + (manager handle :offset-assert 8) + (fail-message uint32 :offset-assert 16) + (retry-message uint32 :offset-assert 20) + (intro-scene basic :offset-assert 24) + (resolution-scene basic :offset-assert 28) + (resolution-scene-continue basic :offset-assert 32) + (retry-continue basic :offset-assert 36) + (fail-continue basic :offset-assert 40) + (init-hook basic :offset-assert 44) + (cleanup-hook basic :offset-assert 48) + (update-hook basic :offset-assert 52) + (code-hook basic :offset-assert 56) + (complete-hook basic :offset-assert 60) + (fail-hook basic :offset-assert 64) + (event-hook basic :offset-assert 68) + (final-node uint16 :offset-assert 72) + (time-limit int32 :offset-assert 76) + (sphere-count int8 :offset-assert 80) + (index int8 :offset-assert 81) + (intro-delay uint16 :offset-assert 82) + (sphere-array uint32 :offset-assert 84) + (on-complete basic :offset-assert 88) + (on-fail basic :offset-assert 92) + (begin-sphere sphere :inline :offset-assert 96) + (end-sphere sphere :inline :offset-assert 112) + ) + :method-count-assert 9 + :size-assert #x80 + :flag-assert #x900000080 + ) + +;; definition for method 3 of type task-manager-info +(defmethod inspect task-manager-info ((obj task-manager-info)) + (when (not obj) + (set! obj obj) + (goto cfg-16) + ) + (format #t "[~8x] ~A~%" obj 'task-manager-info) + (format #t "~1Tmask: #x~X : (task-manager-mask " (-> obj mask)) + (let ((s5-0 (-> obj mask))) + (if (= (logand s5-0 (task-manager-mask intro-scene)) (task-manager-mask intro-scene)) + (format #t "intro-scene ") + ) + (if (= (logand s5-0 (task-manager-mask resolution-scene)) (task-manager-mask resolution-scene)) + (format #t "resolution-scene ") + ) + (if (= (logand s5-0 (task-manager-mask fail-message)) (task-manager-mask fail-message)) + (format #t "fail-message ") + ) + (if (= (logand s5-0 (task-manager-mask begin-sphere)) (task-manager-mask begin-sphere)) + (format #t "begin-sphere ") + ) + (if (= (logand s5-0 (task-manager-mask retry-message)) (task-manager-mask retry-message)) + (format #t "retry-message ") + ) + (if (= (logand s5-0 (task-manager-mask end-sphere)) (task-manager-mask end-sphere)) + (format #t "end-sphere ") + ) + ) + (format #t ")~%") + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tmanager: ~`handle`P~%" (-> obj manager)) + (format #t "~1Tfail-message: ~D~%" (-> obj fail-message)) + (format #t "~1Tretry-message: ~D~%" (-> obj retry-message)) + (format #t "~1Tintro-scene: ~A~%" (-> obj intro-scene)) + (format #t "~1Tresolution-scene: ~A~%" (-> obj resolution-scene)) + (format #t "~1Tresolution-scene-continue: ~A~%" (-> obj resolution-scene-continue)) + (format #t "~1Tretry-continue: ~A~%" (-> obj retry-continue)) + (format #t "~1Tfail-continue: ~A~%" (-> obj fail-continue)) + (format #t "~1Tinit-hook: ~A~%" (-> obj init-hook)) + (format #t "~1Tcleanup-hook: ~A~%" (-> obj cleanup-hook)) + (format #t "~1Tupdate-hook: ~A~%" (-> obj update-hook)) + (format #t "~1Tcode-hook: ~A~%" (-> obj code-hook)) + (format #t "~1Tcomplete-hook: ~A~%" (-> obj complete-hook)) + (format #t "~1Tfail-hook: ~A~%" (-> obj fail-hook)) + (format #t "~1Tevent-hook: ~A~%" (-> obj event-hook)) + (format #t "~1Tfinal-node: ~D~%" (-> obj final-node)) + (format #t "~1Ttime-limit: ~D~%" (-> obj time-limit)) + (format #t "~1Tsphere-count: ~D~%" (-> obj sphere-count)) + (format #t "~1Tindex: ~D~%" (-> obj index)) + (format #t "~1Tintro-delay: ~D~%" (-> obj intro-delay)) + (format #t "~1Tsphere-array: #x~X~%" (-> obj sphere-array)) + (format #t "~1Ton-complete: ~A~%" (-> obj on-complete)) + (format #t "~1Ton-fail: ~A~%" (-> obj on-fail)) + (format #t "~1Tbegin-sphere: #~%" (-> obj begin-sphere)) + (format #t "~1Tend-sphere: #~%" (-> obj end-sphere)) + (label cfg-16) + obj + ) + +;; definition (debug) for function game-task-node-flag->string +;; INFO: Return type mismatch object vs none. +(defun-debug game-task-node-flag->string ((arg0 game-task-node-flag)) + (if (= (logand arg0 (game-task-node-flag clear-task-mask)) (game-task-node-flag clear-task-mask)) + (format #t "clear-task-mask ") + ) + (if (= (logand arg0 (game-task-node-flag city-wait)) (game-task-node-flag city-wait)) + (format #t "city-wait ") + ) + (if (= (logand arg0 (game-task-node-flag intro-wait)) (game-task-node-flag intro-wait)) + (format #t "intro-wait ") + ) + (if (= (logand arg0 (game-task-node-flag task-manager)) (game-task-node-flag task-manager)) + (format #t "task-manager ") + ) + (if (= (logand arg0 (game-task-node-flag task-retry)) (game-task-node-flag task-retry)) + (format #t "task-retry ") + ) + (if (= (logand arg0 (game-task-node-flag reset-on-try)) (game-task-node-flag reset-on-try)) + (format #t "reset-on-try ") + ) + (if (= (logand arg0 (game-task-node-flag exclusive)) (game-task-node-flag exclusive)) + (format #t "exclusive ") + ) + (if (= (logand (game-task-node-flag utility-node) arg0) (game-task-node-flag utility-node)) + (format #t "utility-node ") + ) + (if (= (logand arg0 (game-task-node-flag set-task-mask)) (game-task-node-flag set-task-mask)) + (format #t "set-task-mask ") + ) + (if (= (logand arg0 (game-task-node-flag closed)) (game-task-node-flag closed)) + (format #t "closed ") + ) + (if (= (logand arg0 (game-task-node-flag no-fail-on-death)) (game-task-node-flag no-fail-on-death)) + (format #t "no-fail-on-death ") + ) + (if (= (logand arg0 (game-task-node-flag data)) (game-task-node-flag data)) + (format #t "data ") + ) + (if (= (logand arg0 (game-task-node-flag save-on-life)) (game-task-node-flag save-on-life)) + (format #t "save-on-life ") + ) + (if (= (logand arg0 (game-task-node-flag close-task)) (game-task-node-flag close-task)) + (format #t "close-task ") + ) + (if (= (logand arg0 (game-task-node-flag save-on-try)) (game-task-node-flag save-on-try)) + (format #t "save-on-try ") + ) + (if (= (logand arg0 (game-task-node-flag auto-close)) (game-task-node-flag auto-close)) + (format #t "auto-close ") + ) + (if (= (logand (game-task-node-flag no-slow-down) arg0) (game-task-node-flag no-slow-down)) + (format #t "no-slow-down ") + ) + (if (= (logand arg0 (game-task-node-flag abs-task-mask)) (game-task-node-flag abs-task-mask)) + (format #t "abs-task-mask ") + ) + (if (= (logand (game-task-node-flag no-restart) arg0) (game-task-node-flag no-restart)) + (format #t "no-restart ") + ) + (if (= (logand (game-task-node-flag no-audio) arg0) (game-task-node-flag no-audio)) + (format #t "no-audio ") + ) + (none) + ) + +;; definition (debug) for function game-task-node-command->string +(defun-debug game-task-node-command->string ((arg0 game-task-node-command)) + (case arg0 + (((game-task-node-command add-gun-up-1)) + "add-gun-up-1" + ) + (((game-task-node-command add-darkjak-1)) + "add-darkjak-1" + ) + (((game-task-node-command add-pass-yellow)) + "add-pass-yellow" + ) + (((game-task-node-command add-pass-red)) + "add-pass-red" + ) + (((game-task-node-command sub-board)) + "sub-board" + ) + (((game-task-node-command add-board)) + "add-board" + ) + (((game-task-node-command add-darkjak)) + "add-darkjak" + ) + (((game-task-node-command add-darkjak-2)) + "add-darkjak-2" + ) + (((game-task-node-command add-gun-up-3)) + "add-gun-up-3" + ) + (((game-task-node-command add-gun-up-2)) + "add-gun-up-2" + ) + (((game-task-node-command add-darkjak-3)) + "add-darkjak-3" + ) + (((game-task-node-command add-darkjak-0)) + "add-darkjak-0" + ) + (((game-task-node-command add-gun-blue)) + "add-gun-blue" + ) + (((game-task-node-command add-gun-yellow)) + "add-gun-yellow" + ) + (((game-task-node-command none)) + "none" + ) + (((game-task-node-command add-gun-dark)) + "add-gun-dark" + ) + (((game-task-node-command add-pass-green)) + "add-pass-green" + ) + (((game-task-node-command add-board-training)) + "add-board-training" + ) + (((game-task-node-command add-gun-up-4)) + "add-gun-up-4" + ) + (((game-task-node-command add-gun-red)) + "add-gun-red" + ) + (((game-task-node-command add-pass-blue)) + "add-pass-blue" + ) + (((game-task-node-command sub-sidekick)) + "sub-sidekick" + ) + (((game-task-node-command add-sidekick)) + "add-sidekick" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type game-task-node-info +(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) + (flags game-task-node-flag :offset-assert 20) + (parent-node uint16 4 :offset-assert 24) + (task-mask task-mask :offset-assert 32) + (on-open basic :offset-assert 36) + (info task-manager-info :offset-assert 40) + (borrow basic :offset-assert 44) + (open? symbol :offset-assert 48) + (on-close basic :offset-assert 52) + (close-time time-frame :offset-assert 56) + (death-count uint16 :offset-assert 64) + (gem-count uint16 :offset-assert 66) + (skill-count uint16 :offset-assert 68) + (suck-death-count uint8 :offset-assert 70) + (add game-task-node-command :offset-assert 71) + (description uint32 :offset-assert 72) + ) + :method-count-assert 14 + :size-assert #x4c + :flag-assert #xe0000004c + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + (dummy-12 () none 12) + (dummy-13 () none 13) + ) + ) + +;; definition for method 3 of type game-task-node-info +(defmethod inspect game-task-node-info ((obj game-task-node-info)) + (when (not obj) + (set! obj obj) + (goto cfg-45) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Ttask: #x~X : ~S~%" (-> obj task) (game-task->string (-> obj task))) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Twhen-open: ~A~%" (-> obj when-open)) + (format #t "~1Tflags: #x~X : (game-task-node-flag " (-> obj flags)) + (game-task-node-flag->string (-> obj flags)) + (format #t ")~%") + (format #t "~1Tparent-node[4] @ #x~X~%" (-> obj parent-node)) + (dotimes (s5-1 4) + (format #t "~T [~D]~1Tparent-node: ~D~%" s5-1 (-> obj parent-node s5-1)) + ) + (format #t "~1Ttask-mask: #x~X : (task-mask " (-> obj task-mask)) + (let ((s5-2 (-> obj task-mask))) + (if (= (logand s5-2 (task-mask task0)) (task-mask task0)) + (format #t "task0 ") + ) + (if (= (logand s5-2 (task-mask task2)) (task-mask task2)) + (format #t "task2 ") + ) + (if (= (logand s5-2 (task-mask task4)) (task-mask task4)) + (format #t "task4 ") + ) + (if (= (logand s5-2 (task-mask task6)) (task-mask task6)) + (format #t "task6 ") + ) + (if (= (logand s5-2 (task-mask ctywide)) (task-mask ctywide)) + (format #t "ctywide ") + ) + (if (= (logand s5-2 (task-mask never)) (task-mask never)) + (format #t "never ") + ) + (if (= (logand (task-mask movie1) s5-2) (task-mask movie1)) + (format #t "movie1 ") + ) + (if (= (logand s5-2 (task-mask dummy1)) (task-mask dummy1)) + (format #t "dummy1 ") + ) + (if (= (logand s5-2 (task-mask primary0)) (task-mask primary0)) + (format #t "primary0 ") + ) + (if (= (logand s5-2 (task-mask task1)) (task-mask task1)) + (format #t "task1 ") + ) + (if (= (logand s5-2 (task-mask task3)) (task-mask task3)) + (format #t "task3 ") + ) + (if (= (logand s5-2 (task-mask task5)) (task-mask task5)) + (format #t "task5 ") + ) + (if (= (logand s5-2 (task-mask task7)) (task-mask task7)) + (format #t "task7 ") + ) + (if (= (logand (task-mask movie2) s5-2) (task-mask movie2)) + (format #t "movie2 ") + ) + (if (= (logand s5-2 (task-mask dummy2)) (task-mask dummy2)) + (format #t "dummy2 ") + ) + (if (= (logand s5-2 (task-mask done)) (task-mask done)) + (format #t "done ") + ) + (if (= (logand s5-2 (task-mask special)) (task-mask special)) + (format #t "special ") + ) + (if (= (logand (task-mask movie0) s5-2) (task-mask movie0)) + (format #t "movie0 ") + ) + (if (= (logand s5-2 (task-mask dummy0)) (task-mask dummy0)) + (format #t "dummy0 ") + ) + ) + (format #t ")~%") + (format #t "~1Ton-open: ~A~%" (-> obj on-open)) + (format #t "~1Tinfo: #~%" (-> obj info)) + (format #t "~1Tborrow: ~A~%" (-> obj borrow)) + (format #t "~1Topen?: ~A~%" (-> obj open?)) + (format #t "~1Ton-close: ~A~%" (-> obj on-close)) + (format #t "~1Tclose-time: ~D~%" (-> obj close-time)) + (format #t "~1Tdeath-count: ~D~%" (-> obj death-count)) + (format #t "~1Tgem-count: ~D~%" (-> obj gem-count)) + (format #t "~1Tskill-count: ~D~%" (-> obj skill-count)) + (format #t "~1Tsuck-death-count: ~D~%" (-> obj suck-death-count)) + (format #t "~1Tadd: #x~X : ~S~%" (-> obj add) (game-task-node-command->string (-> obj add))) + (format #t "~1Tdescription: ~D~%" (-> obj description)) + (label cfg-45) + obj + ) + +;; definition of type game-task-info +(deftype game-task-info (basic) + ((name basic :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) + (play-node uint16 :offset-assert 20) + (play-continue basic :offset-assert 24) + (kiosk-play-continue basic :offset-assert 28) + ) + :method-count-assert 9 + :size-assert #x20 + :flag-assert #x900000020 + ) + +;; definition for method 3 of type game-task-info +(defmethod inspect game-task-info ((obj game-task-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Ttext-name: ~D~%" (-> obj text-name)) + (format #t "~1Tpre-play-node: ~D~%" (-> obj pre-play-node)) + (format #t "~1Tkiosk-play-node: ~D~%" (-> obj kiosk-play-node)) + (format #t "~1Tpre-play-continue: ~A~%" (-> obj pre-play-continue)) + (format #t "~1Tplay-node: ~D~%" (-> obj play-node)) + (format #t "~1Tplay-continue: ~A~%" (-> obj play-continue)) + (format #t "~1Tkiosk-play-continue: ~A~%" (-> obj kiosk-play-continue)) + (label cfg-4) + obj + ) + +;; definition of type game-task-control +(deftype game-task-control (basic) + ((counter uint32 :offset-assert 4) + (actor game-task-actor :offset-assert 8) + (current-node uint16 :offset-assert 10) + (current-event uint32 :offset-assert 12) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (dummy-9 () none 9) + ) + ) + +;; definition for method 3 of type game-task-control +(defmethod inspect game-task-control ((obj game-task-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcounter: ~D~%" (-> obj counter)) + (format #t "~1Tactor: #x~X : ~S~%" (-> obj actor) (game-task-actor->string (-> obj actor))) + (format #t "~1Tcurrent-node: ~D~%" (-> obj current-node)) + (format #t "~1Tcurrent-event: ~A~%" (-> obj current-event)) + (label cfg-4) + obj + ) + +;; definition of type task-manager +(deftype task-manager (process) + ((node-info basic :offset-assert 128) + (info task-manager-info :offset-assert 132) + (lev-name basic :offset-assert 136) + (fail-on-death? symbol :offset-assert 140) + (fail-now basic :offset-assert 144) + (retry-now basic :offset-assert 148) + (allow-fail basic :offset-assert 152) + (state-time time-frame :offset-assert 160) + (count int16 :offset-assert 168) + (max-count int16 :offset-assert 170) + (sub-state uint32 :offset-assert 172) + (slave uint64 32 :offset-assert 176) + (arrow uint64 :offset-assert 432) + (link uint32 :offset-assert 440) + (start-time time-frame :offset-assert 448) + (total-time time-frame :offset-assert 456) + (beep-time time-frame :offset-assert 464) + (time-limit time-frame :offset-assert 472) + (begin-pos vector :inline :offset-assert 480) + (end-pos vector :inline :offset-assert 496) + (data-int8 int8 32 :offset-assert 512) + (data-int32 int32 32 :offset-assert 544) + (data-float float 32 :offset-assert 672) + (data-vector vector 32 :inline :offset-assert 800) + (actor-group uint32 4 :offset-assert 1312) + (minimap uint32 8 :offset-assert 1328) + (hud uint64 4 :offset-assert 1360) + (hud-timer time-frame :offset 1360) + (hud-counter int64 :offset 1368) + (sound-id uint32 4 :offset-assert 1392) + (intro-time time-frame :offset-assert 1408) + ) + :heap-base #x510 + :method-count-assert 23 + :size-assert #x588 + :flag-assert #x1705100588 + (:methods + (dummy-14 () none 14) + (dummy-15 () none 15) + (dummy-16 () none 16) + (dummy-17 () none 17) + (dummy-18 () none 18) + (dummy-19 () none 19) + (dummy-20 () none 20) + (dummy-21 () none 21) + (dummy-22 () none 22) + ) + ) + +;; definition for method 3 of type task-manager +(defmethod inspect task-manager ((obj task-manager)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Tnode-info: ~A~%" (-> obj node-info)) + (format #t "~2Tinfo: #~%" (-> obj info)) + (format #t "~2Tlev-name: ~A~%" (-> obj lev-name)) + (format #t "~2Tfail-on-death?: ~A~%" (-> obj fail-on-death?)) + (format #t "~2Tfail-now: ~A~%" (-> obj fail-now)) + (format #t "~2Tretry-now: ~A~%" (-> obj retry-now)) + (format #t "~2Tallow-fail: ~A~%" (-> obj allow-fail)) + (format #t "~2Tstate-time: ~D~%" (-> obj state-time)) + (format #t "~2Tcount: ~D~%" (-> obj count)) + (format #t "~2Tmax-count: ~D~%" (-> obj max-count)) + (format #t "~2Tsub-state: ~D~%" (-> obj sub-state)) + (format #t "~2Tslave[32] @ #x~X~%" (-> obj slave)) + (format #t "~2Tarrow: ~D~%" (-> obj arrow)) + (format #t "~2Tlink: ~A~%" (-> obj link)) + (format #t "~2Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~2Ttotal-time: ~D~%" (-> obj total-time)) + (format #t "~2Tbeep-time: ~D~%" (-> obj beep-time)) + (format #t "~2Ttime-limit: ~D~%" (-> obj time-limit)) + (format #t "~2Tbegin-pos: #~%" (-> obj begin-pos)) + (format #t "~2Tend-pos: #~%" (-> obj end-pos)) + (format #t "~2Tdata-int8[32] @ #x~X~%" (-> obj data-int8)) + (format #t "~2Tdata-int32[32] @ #x~X~%" (-> obj data-int32)) + (format #t "~2Tdata-float[32] @ #x~X~%" (-> obj data-float)) + (format #t "~2Tdata-vector[32] @ #x~X~%" (-> obj data-vector)) + (format #t "~2Tactor-group[4] @ #x~X~%" (-> obj actor-group)) + (format #t "~2Tminimap[8] @ #x~X~%" (-> obj minimap)) + (format #t "~2Thud[4] @ #x~X~%" (-> obj hud)) + (format #t "~2Thud-timer: ~D~%" (-> obj hud-timer)) + (format #t "~2Thud-counter: ~D~%" (-> obj hud-counter)) + (format #t "~2Tsound-id[4] @ #x~X~%" (-> obj sound-id)) + (format #t "~2Tintro-time: ~D~%" (-> obj intro-time)) + (label cfg-4) + obj + ) + +;; definition of type ambient-control +(deftype ambient-control (structure) + ((last-ambient-time time-frame :offset-assert 0) + (last-ambient string :offset-assert 8) + (last-ambient-id sound-id :offset-assert 12) + ) + :method-count-assert 12 + :size-assert #x10 + :flag-assert #xc00000010 + (:methods + (dummy-9 () none 9) + (dummy-10 () none 10) + (dummy-11 () none 11) + ) + ) + +;; definition for method 3 of type ambient-control +(defmethod inspect ambient-control ((obj ambient-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'ambient-control) + (format #t "~1Tlast-ambient-time: ~D~%" (-> obj last-ambient-time)) + (format #t "~1Tlast-ambient: ~A~%" (-> obj last-ambient)) + (format #t "~1Tlast-ambient-id: ~D~%" (-> obj last-ambient-id)) + (label cfg-4) + obj + ) + +;; definition for symbol *traffic-engine*, type object +(define *traffic-engine* (the-as object #f)) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc new file mode 100644 index 0000000000..416d5ffb70 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/bigmap-h_REF.gc @@ -0,0 +1,408 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bigmap-bit-mask +(deftype bigmap-bit-mask (structure) + ((data uint8 6656 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x1a00 + :flag-assert #x900001a00 + ) + +;; definition for method 3 of type bigmap-bit-mask +(defmethod inspect bigmap-bit-mask ((obj bigmap-bit-mask)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bigmap-bit-mask) + (format #t "~1Tdata[6656] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type bigmap-layer-mask +(deftype bigmap-layer-mask (structure) + ((data uint8 26624 :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x6800 + :flag-assert #x900006800 + ) + +;; definition for method 3 of type bigmap-layer-mask +(defmethod inspect bigmap-layer-mask ((obj bigmap-layer-mask)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bigmap-layer-mask) + (format #t "~1Tdata[26624] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type bigmap-image +(deftype bigmap-image (structure) + ((clut-offset uint32 :offset-assert 0) + (image-offset uint32 :offset-assert 4) + (pad uint32 2 :offset-assert 8) + (data uint8 1 :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x11 + :flag-assert #x900000011 + ) + +;; definition for method 3 of type bigmap-image +(defmethod inspect bigmap-image ((obj bigmap-image)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bigmap-image) + (format #t "~1Tclut-offset: ~D~%" (-> obj clut-offset)) + (format #t "~1Timage-offset: ~D~%" (-> obj image-offset)) + (format #t "~1Tpad[2] @ #x~X~%" (-> obj pad)) + (format #t "~1Tdata[1] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type bigmap-info +(deftype bigmap-info (vector) + ((scale float :offset 8) + (inv-scale float :offset 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type bigmap-info +;; INFO: Used lq/sq +(defmethod inspect bigmap-info ((obj bigmap-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bigmap-info) + (format #t "~1Tdata[4] @ #x~X~%" (&-> obj x)) + (format #t "~1Tx: ~f~%" (-> obj x)) + (format #t "~1Ty: ~f~%" (-> obj y)) + (format #t "~1Tz: ~f~%" (-> obj scale)) + (format #t "~1Tw: ~f~%" (-> obj inv-scale)) + (format #t "~1Tquad: ~D~%" (-> obj quad)) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "~1Tinv-scale: ~f~%" (-> obj inv-scale)) + (label cfg-4) + obj + ) + +;; definition of type bigmap-info-array +(deftype bigmap-info-array (structure) + ((data bigmap-info 21 :inline :offset-assert 0) + ) + :method-count-assert 9 + :size-assert #x150 + :flag-assert #x900000150 + ) + +;; definition for method 3 of type bigmap-info-array +(defmethod inspect bigmap-info-array ((obj bigmap-info-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bigmap-info-array) + (format #t "~1Tdata[21] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type bigmap-compressed-layers +(deftype bigmap-compressed-layers (structure) + ((data uint32 20 :offset-assert 0) + (layer0 uint32 :offset 0) + (layer1 uint32 :offset 4) + (layer2 uint32 :offset 8) + (layer3 uint32 :offset 12) + (layer4 uint32 :offset 16) + (layer5 uint32 :offset 20) + (layer6 uint32 :offset 24) + (layer7 uint32 :offset 28) + (layer8 uint32 :offset 32) + (layer9 uint32 :offset 36) + (layer10 uint32 :offset 40) + (layer11 uint32 :offset 44) + (layer12 uint32 :offset 48) + (layer13 uint32 :offset 52) + (layer14 uint32 :offset 56) + (layer15 uint32 :offset 60) + (layer16 uint32 :offset 64) + (layer17 uint32 :offset 68) + (layer18 uint32 :offset 72) + (layer19 uint32 :offset 76) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type bigmap-compressed-layers +(defmethod inspect bigmap-compressed-layers ((obj bigmap-compressed-layers)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bigmap-compressed-layers) + (format #t "~1Tdata[20] @ #x~X~%" (&-> obj layer0)) + (format #t "~1Tlayer0: #x~X~%" (-> obj layer0)) + (format #t "~1Tlayer1: #x~X~%" (-> obj layer1)) + (format #t "~1Tlayer2: #x~X~%" (-> obj layer2)) + (format #t "~1Tlayer3: #x~X~%" (-> obj layer3)) + (format #t "~1Tlayer4: #x~X~%" (-> obj layer4)) + (format #t "~1Tlayer5: #x~X~%" (-> obj layer5)) + (format #t "~1Tlayer6: #x~X~%" (-> obj layer6)) + (format #t "~1Tlayer7: #x~X~%" (-> obj layer7)) + (format #t "~1Tlayer8: #x~X~%" (-> obj layer8)) + (format #t "~1Tlayer9: #x~X~%" (-> obj layer9)) + (format #t "~1Tlayer10: #x~X~%" (-> obj layer10)) + (format #t "~1Tlayer11: #x~X~%" (-> obj layer11)) + (format #t "~1Tlayer12: #x~X~%" (-> obj layer12)) + (format #t "~1Tlayer13: #x~X~%" (-> obj layer13)) + (format #t "~1Tlayer14: #x~X~%" (-> obj layer14)) + (format #t "~1Tlayer15: #x~X~%" (-> obj layer15)) + (format #t "~1Tlayer16: #x~X~%" (-> obj layer16)) + (format #t "~1Tlayer17: #x~X~%" (-> obj layer17)) + (format #t "~1Tlayer18: #x~X~%" (-> obj layer18)) + (format #t "~1Tlayer19: #x~X~%" (-> obj layer19)) + (label cfg-4) + obj + ) + +;; definition of type bigmap +(deftype bigmap (basic) + ((drawing-flag symbol :offset-assert 4) + (loading-flag symbol :offset-assert 8) + (recording-flag symbol :offset-assert 12) + (fill-flag symbol :offset-assert 16) + (bigmap-index uint32 :offset-assert 20) + (bigmap-image external-art-buffer :offset-assert 24) + (tpage basic :offset-assert 28) + (progress-minimap basic :offset-assert 32) + (mask-index uint32 :offset-assert 36) + (bit-mask bigmap-bit-mask :offset-assert 40) + (compressed-next-index uint32 :offset-assert 44) + (max-next-index uint32 :offset-assert 48) + (compressed-masks uint32 20 :offset-assert 52) + (compressed-data uint32 :offset-assert 132) + (layer-index uint32 :offset-assert 136) + (layer-mask bigmap-layer-mask :offset-assert 140) + (compressed-layers bigmap-compressed-layers :offset-assert 144) + (layer-mask-enable uint32 :offset-assert 148) + (load-index uint32 :offset-assert 152) + (x0 int32 :offset-assert 156) + (y0 int32 :offset-assert 160) + (x1 int32 :offset-assert 164) + (y1 int32 :offset-assert 168) + (y2 int32 :offset-assert 172) + (goal-time float :offset-assert 176) + (sprite-tmpl dma-gif-packet :inline :offset-assert 192) + (draw-tmpl dma-gif-packet :inline :offset-assert 224) + (adgif-tmpl dma-gif-packet :inline :offset-assert 256) + (offset vector :inline :offset-assert 288) + (size float :offset 296) + (scale float :offset 300) + (draw-offset vector :inline :offset-assert 304) + (draw-size float :offset 312) + (draw-scale float :offset 316) + (scroll vector :inline :offset-assert 320) + (pos vector4w :inline :offset-assert 336) + (color vector4w :inline :offset-assert 352) + (corner vector4w 4 :inline :offset-assert 368) + (auto-save-icon-flag basic :offset-assert 432) + ) + :method-count-assert 28 + :size-assert #x1b4 + :flag-assert #x1c000001b4 + (:methods + (new (symbol type) _type_ 0) + (initialize (_type_) none 9) + (update (_type_) none 10) + (bigmap-method-11 () none 11) + (bigmap-method-12 () none 12) + (bigmap-method-13 () none 13) + (bigmap-method-14 () none 14) + (bigmap-method-15 () none 15) + (bigmap-method-16 () none 16) + (bigmap-method-17 () none 17) + (bigmap-method-18 () none 18) + (bigmap-method-19 () none 19) + (bigmap-method-20 () none 20) + (bigmap-method-21 () none 21) + (bigmap-method-22 () none 22) + (bigmap-method-23 () none 23) + (bigmap-method-24 () none 24) + (bigmap-method-25 () none 25) + (bigmap-method-26 () none 26) + (bigmap-method-27 () none 27) + ) + ) + +;; definition for method 3 of type bigmap +(defmethod inspect bigmap ((obj bigmap)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tdrawing-flag: ~A~%" (-> obj drawing-flag)) + (format #t "~1Tloading-flag: ~A~%" (-> obj loading-flag)) + (format #t "~1Trecording-flag: ~A~%" (-> obj recording-flag)) + (format #t "~1Tfill-flag: ~A~%" (-> obj fill-flag)) + (format #t "~1Tbigmap-index: ~D~%" (-> obj bigmap-index)) + (format #t "~1Tbigmap-image: ~A~%" (-> obj bigmap-image)) + (format #t "~1Ttpage: ~A~%" (-> obj tpage)) + (format #t "~1Tprogress-minimap: ~A~%" (-> obj progress-minimap)) + (format #t "~1Tmask-index: ~D~%" (-> obj mask-index)) + (format #t "~1Tbit-mask: #~%" (-> obj bit-mask)) + (format #t "~1Tcompressed-next-index: ~D~%" (-> obj compressed-next-index)) + (format #t "~1Tmax-next-index: ~D~%" (-> obj max-next-index)) + (format #t "~1Tcompressed-masks[20] @ #x~X~%" (-> obj compressed-masks)) + (format #t "~1Tcompressed-data: #x~X~%" (-> obj compressed-data)) + (format #t "~1Tlayer-index: ~D~%" (-> obj layer-index)) + (format #t "~1Tlayer-mask: #~%" (-> obj layer-mask)) + (format #t "~1Tcompressed-layers: #~%" (-> obj compressed-layers)) + (format #t "~1Tlayer-mask-enable: ~D~%" (-> obj layer-mask-enable)) + (format #t "~1Tload-index: ~D~%" (-> obj load-index)) + (format #t "~1Tx0: ~D~%" (-> obj x0)) + (format #t "~1Ty0: ~D~%" (-> obj y0)) + (format #t "~1Tx1: ~D~%" (-> obj x1)) + (format #t "~1Ty1: ~D~%" (-> obj y1)) + (format #t "~1Ty2: ~D~%" (-> obj y2)) + (format #t "~1Tgoal-time: ~f~%" (-> obj goal-time)) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Toffset: #~%" (-> obj offset)) + (format #t "~1Tsize: ~f~%" (-> obj offset z)) + (format #t "~1Tscale: ~f~%" (-> obj offset w)) + (format #t "~1Tdraw-offset: #~%" (-> obj draw-offset)) + (format #t "~1Tdraw-size: ~f~%" (-> obj draw-offset z)) + (format #t "~1Tdraw-scale: ~f~%" (-> obj draw-offset w)) + (format #t "~1Tscroll: #~%" (-> obj scroll)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tcorner[4] @ #x~X~%" (-> obj corner)) + (format #t "~1Tauto-save-icon-flag: ~A~%" (-> obj auto-save-icon-flag)) + (label cfg-4) + obj + ) + +;; definition for method 0 of type bigmap +(defmethod new bigmap ((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 bigmap-image) + ((method-of-type external-art-buffer new) + allocation + external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((a1-3 (logand -64 (&+ (&+ (-> *display* frames 0 global-buf end) -430144) 63))) + (v1-1 (-> arg0 heap)) + ) + (set! (-> v1-1 base) a1-3) + (set! (-> v1-1 current) (-> v1-1 base)) + (set! (-> v1-1 top-base) (&+ (-> v1-1 base) #x69000)) + (set! (-> v1-1 top) (-> v1-1 top-base)) + ) + 0 + (none) + ) + #f + ) + ) + (set! (-> gp-0 tpage) + ((method-of-type external-art-buffer new) + allocation + external-art-buffer + 0 + (lambda ((arg0 external-art-buffer)) + (let ((a1-3 (logand -64 (&+ (&+ (-> *display* frames 0 global-buf end) -774208) 63))) + (v1-1 (-> arg0 heap)) + ) + (set! (-> v1-1 base) a1-3) + (set! (-> v1-1 current) (-> v1-1 base)) + (set! (-> v1-1 top-base) (&+ (-> v1-1 base) #xbd000)) + (set! (-> v1-1 top) (-> v1-1 top-base)) + ) + 0 + (none) + ) + #f + ) + ) + (set! (-> gp-0 bit-mask) (new 'global 'bigmap-bit-mask)) + (set! (-> gp-0 compressed-data) (the-as uint (malloc 'global #x8000))) + (set! (-> gp-0 layer-mask) (new 'global 'bigmap-layer-mask)) + (set! (-> gp-0 compressed-layers) *bigmap-compressed-layers*) + (set! (-> gp-0 sprite-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> gp-0 sprite-tmpl dma-vif vif0) (new 'static 'vif-tag)) + (set! (-> gp-0 sprite-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> gp-0 sprite-tmpl gif0) (the-as uint #x50ab400000008001)) + (set! (-> gp-0 sprite-tmpl gif1) (the-as uint #x53531)) + (set! (-> gp-0 draw-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) + (set! (-> gp-0 draw-tmpl dma-vif vif0) (new 'static 'vif-tag)) + (set! (-> gp-0 draw-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) + (set! (-> gp-0 draw-tmpl gif0) (the-as uint #x90aa400000008001)) + (set! (-> gp-0 draw-tmpl gif1) (the-as uint #x535353531)) + (set! (-> gp-0 adgif-tmpl dma-vif dma) (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))) + (set! (-> gp-0 adgif-tmpl dma-vif vif0) (new 'static 'vif-tag)) + (set! (-> gp-0 adgif-tmpl dma-vif vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> gp-0 adgif-tmpl gif0) (the-as uint #x1000000000008005)) + (set! (-> gp-0 adgif-tmpl gif1) (the-as uint 14)) + (set-vector! (-> gp-0 offset) 0.0 0.0 0.0 0.0) + (set-vector! (-> gp-0 scroll) 0.0 0.0 0.0 0.0) + (set-vector! (-> gp-0 pos) 0 0 0 0) + (set-vector! (-> gp-0 color) 128 128 128 128) + (set! (-> gp-0 drawing-flag) #f) + (set! (-> gp-0 loading-flag) #f) + (set! (-> gp-0 recording-flag) #f) + (set! (-> gp-0 fill-flag) #t) + (set! (-> gp-0 progress-minimap) #f) + (set! (-> gp-0 auto-save-icon-flag) #f) + (initialize gp-0) + gp-0 + ) + ) + +;; definition for symbol *bigmap-info-array*, type bigmap-info-array +(define *bigmap-info-array* + (new 'static 'bigmap-info-array + :data (new 'static 'inline-array bigmap-info 21 + (new 'static 'bigmap-info :x -251215.88 :y -6390620.0 :scale 7477.334 :inv-scale 0.00006686875) + (new 'static 'bigmap-info :x -68266.805 :y -7629693.0 :scale 4266.668 :inv-scale 0.00011718746) + (new 'static 'bigmap-info :x -1612460.0 :y -7806484.5 :scale 3498.668 :inv-scale 0.00014291154) + (new 'static 'bigmap-info :x 339968.0 :y -8220672.0 :scale 3200.0 :inv-scale 0.00015625) + (new 'static 'bigmap-info :x -602935.3 :y -9531720.0 :scale 6933.332 :inv-scale 0.0000721154) + (new 'static 'bigmap-info :x -1565331.5 :y -1109332.0 :scale 5337.4277 :inv-scale 0.000093678085) + (new 'static 'bigmap-info :x -3681067.0 :y 2179413.2 :scale 4586.668 :inv-scale 0.0001090116) + (new 'static 'bigmap-info :x 1110016.0 :y -20480.0 :scale 4096.0 :inv-scale 0.00012207031) + (new 'static 'bigmap-info :x -4358144.0 :y -581632.0 :scale 5469.09 :inv-scale 0.00009142289) + (new 'static 'bigmap-info :x -1646719.0 :y -1395200.0 :scale 4000.002 :inv-scale 0.00012499993) + (new 'static 'bigmap-info :x -1292161.0 :y -935251.94 :scale 7253.332 :inv-scale 0.000068933834) + (new 'static 'bigmap-info :x -87520.055 :y 1879040.0 :scale 2880.0 :inv-scale 0.00017361112) + (new 'static 'bigmap-info :x -87520.055 :y 1879040.0 :scale 2880.0 :inv-scale 0.00017361112) + (new 'static 'bigmap-info :x 3053472.2 :y -2397868.0 :scale 3946.668 :inv-scale 0.00012668915) + (new 'static 'bigmap-info :x 4027306.8 :y 1112746.8 :scale 4693.332 :inv-scale 0.00010653412) + (new 'static 'bigmap-info :x 4027306.8 :y 1112746.8 :scale 4693.332 :inv-scale 0.00010653412) + (new 'static 'bigmap-info :x 4027306.8 :y 1112746.8 :scale 4693.332 :inv-scale 0.00010653412) + (new 'static 'bigmap-info :x 8574157.0 :y -1033420.8 :scale 5430.231 :inv-scale 0.00009207711) + (new 'static 'bigmap-info :x -787795.94 :y 4102697.0 :scale 5717.332 :inv-scale 0.00008745338) + (new 'static 'bigmap-info :x -1558401.0 :y 6746452.0 :scale 5866.668 :inv-scale 0.00008522726) + (new 'static 'bigmap-info) + ) + ) + ) diff --git a/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc new file mode 100644 index 0000000000..743f01c696 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/gui-h_REF.gc @@ -0,0 +1,279 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gui-connection +(deftype gui-connection (connection) + ((priority float :offset 16) + (action gui-action :offset 20) + (channel gui-channel :offset 21) + (anim-part uint8 :offset 22) + (flags uint8 :offset 23) + (name object :offset 24) + (id uint32 :offset 28) + (handle handle :offset 0) + (time-stamp time-frame :offset 8) + (hold-time time-frame :offset-assert 32) + (fo-min int16 :offset-assert 40) + (fo-max int16 :offset-assert 42) + (fo-curve int8 :offset-assert 44) + (fade uint8 :offset-assert 45) + (pad uint8 2 :offset-assert 46) + ) + :method-count-assert 14 + :size-assert #x30 + :flag-assert #xe00000030 + ) + +;; definition for method 3 of type gui-connection +(defmethod inspect gui-connection ((obj gui-connection)) + (when (not obj) + (set! obj obj) + (goto cfg-116) + ) + (format #t "[~8x] ~A~%" obj 'gui-connection) + (format #t "~1Tnext0: ~`connectable`P~%" (-> obj next0)) + (format #t "~1Tprev0: ~`connectable`P~%" (-> obj prev0)) + (format #t "~1Tnext1: ~`connectable`P~%" (-> obj next1)) + (format #t "~1Tprev1: ~`connectable`P~%" (-> obj prev1)) + (format #t "~1Tparam0: ~A~%" (-> obj priority)) + (format #t "~1Tparam1: ~A~%" (-> obj param1)) + (format #t "~1Tparam2: ~A~%" (-> obj param2)) + (format #t "~1Tparam3: ~A~%" (-> obj param3)) + (format #t "~1Tquad[2] @ #x~X~%" (&-> obj next0)) + (format #t "~1Tpriority: ~f~%" (-> obj priority)) + (let ((t9-11 format) + (a0-12 #t) + (a1-11 "~1Taction: #x~X : ~S~%") + (a2-11 (-> obj action)) + (v1-2 (-> obj action)) + ) + (t9-11 a0-12 a1-11 a2-11 (cond + ((= v1-2 (gui-action queue)) + "queue" + ) + ((= v1-2 (gui-action stop)) + "stop" + ) + ((= v1-2 (gui-action play)) + "play" + ) + ((= v1-2 (gui-action hide)) + "hide" + ) + ((= v1-2 (gui-action fade)) + "fade" + ) + ((= v1-2 (gui-action none)) + "none" + ) + ((= v1-2 (gui-action abort)) + "abort" + ) + ((= v1-2 (gui-action stopping)) + "stopping" + ) + ((= v1-2 (gui-action hidden)) + "hidden" + ) + ((= v1-2 (gui-action playing)) + "playing" + ) + (else + "*unknown*" + ) + ) + ) + ) + (let ((t9-12 format) + (a0-13 #t) + (a1-12 "~1Tchannel: #x~X : ~S~%") + (a2-12 (-> obj channel)) + (v1-3 (-> obj channel)) + ) + (t9-12 a0-13 a1-12 a2-12 (cond + ((= v1-3 (gui-channel hud-lower-left)) + "hud-lower-left" + ) + ((= v1-3 (gui-channel citizen)) + "citizen" + ) + ((= v1-3 (gui-channel ashelin)) + "ashelin" + ) + ((= v1-3 (gui-channel hud-lower-left-1)) + "hud-lower-left-1" + ) + ((= v1-3 (gui-channel message)) + "message" + ) + ((= v1-3 (gui-channel hud-middle-left)) + "hud-middle-left" + ) + ((= v1-3 (gui-channel hud-upper-center-2)) + "hud-upper-center-2" + ) + ((= v1-3 (gui-channel hud-middle-right)) + "hud-middle-right" + ) + ((= v1-3 (gui-channel subtitle)) + "subtitle" + ) + ((= v1-3 (gui-channel notice)) + "notice" + ) + ((= v1-3 (gui-channel voicebox)) + "voicebox" + ) + ((= v1-3 (gui-channel art-load-next)) + "art-load-next" + ) + ((= v1-3 (gui-channel mog)) + "mog" + ) + ((= v1-3 (gui-channel sig)) + "sig" + ) + ((= v1-3 (gui-channel hud-center-left)) + "hud-center-left" + ) + ((= v1-3 (gui-channel hud-upper-right)) + "hud-upper-right" + ) + ((= v1-3 (gui-channel hud-center-right)) + "hud-center-right" + ) + ((= v1-3 (gui-channel alert)) + "alert" + ) + ((= v1-3 (gui-channel jinx)) + "jinx" + ) + ((= v1-3 (gui-channel hud-upper-left)) + "hud-upper-left" + ) + ((= v1-3 (gui-channel query)) + "query" + ) + ((= v1-3 (gui-channel grim)) + "grim" + ) + ((= v1-3 (gui-channel kor)) + "kor" + ) + ((= v1-3 (gui-channel hud-lower-right)) + "hud-lower-right" + ) + ((= v1-3 (gui-channel screen)) + "screen" + ) + ((= v1-3 (gui-channel guard)) + "guard" + ) + ((= v1-3 (gui-channel supertitle)) + "supertitle" + ) + ((= v1-3 (gui-channel hal)) + "hal" + ) + ((= v1-3 (gui-channel hud-upper-center)) + "hud-upper-center" + ) + ((= v1-3 (gui-channel blackout)) + "blackout" + ) + ((= v1-3 (gui-channel bbush)) + "bbush" + ) + ((= v1-3 (gui-channel hud)) + "hud" + ) + ((= v1-3 (gui-channel voice)) + "voice" + ) + ((= v1-3 (gui-channel max)) + "max" + ) + ((= v1-3 (gui-channel none)) + "none" + ) + ((= v1-3 (gui-channel notice-low)) + "notice-low" + ) + ((= v1-3 (gui-channel art-load)) + "art-load" + ) + ((= v1-3 (gui-channel kid)) + "kid" + ) + ((= v1-3 (gui-channel jak)) + "jak" + ) + ((= v1-3 (gui-channel daxter)) + "daxter" + ) + ((= v1-3 (gui-channel krew)) + "krew" + ) + ((= v1-3 (gui-channel hud-lower-left-2)) + "hud-lower-left-2" + ) + ((= v1-3 (gui-channel background)) + "background" + ) + ((= v1-3 (gui-channel crocadog)) + "crocadog" + ) + ((= v1-3 (gui-channel movie)) + "movie" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tanim-part: ~D~%" (-> obj anim-part)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Thandle: ~D~%" (-> obj handle)) + (format #t "~1Ttime-stamp: ~D~%" (-> obj time-stamp)) + (format #t "~1Thold-time: ~D~%" (-> obj hold-time)) + (format #t "~1Tfo-min: ~D~%" (-> obj fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> obj fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> obj fo-curve)) + (format #t "~1Tfade: ~D~%" (-> obj fade)) + (label cfg-116) + obj + ) + +;; definition of type gui-control +(deftype gui-control (basic) + ((engine engine :offset-assert 4) + (data uint8 3272 :offset-assert 8) + ) + :method-count-assert 25 + :size-assert #xcd0 + :flag-assert #x1900000cd0 + (:methods + (gui-control-method-9 () none 9) + (gui-control-method-10 () none 10) + (gui-control-method-11 () none 11) + (gui-control-method-12 () none 12) + (update (_type_ symbol) none 13) + (gui-control-method-14 () none 14) + (gui-control-method-15 () none 15) + (gui-control-method-16 () none 16) + (gui-control-method-17 () none 17) + (gui-control-method-18 () none 18) + (gui-control-method-19 () none 19) + (gui-control-method-20 () none 20) + (gui-control-method-21 () none 21) + (gui-control-method-22 () none 22) + (gui-control-method-23 () none 23) + (gui-control-method-24 () none 24) + ) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc new file mode 100644 index 0000000000..20fd417191 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/hud-h_REF.gc @@ -0,0 +1,1275 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hud-string +(deftype hud-string (basic) + ((text string :offset-assert 4) + (scale float :offset-assert 8) + (color uint32 :offset-assert 12) + (flags uint32 :offset-assert 16) + (pos vector4w :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type hud-string +(defmethod inspect hud-string ((obj hud-string)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ttext: ~A~%" (-> obj text)) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "~1Tcolor: ~D~%" (-> obj color)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (label cfg-4) + obj + ) + +;; definition of type hud-sprite +(deftype hud-sprite (structure) + ((pos vector4w :inline :offset-assert 0) + (color vector4w :inline :offset-assert 16) + (flags uint32 :offset-assert 32) + (scale-x float :offset-assert 36) + (scale-y float :offset-assert 40) + (angle float :offset-assert 44) + (tex basic :offset-assert 48) + ) + :method-count-assert 11 + :size-assert #x34 + :flag-assert #xb00000034 + (:methods + (hud-sprite-method-9 () none 9) + (hud-sprite-method-10 () none 10) + ) + ) + +;; definition for method 3 of type hud-sprite +(defmethod inspect hud-sprite ((obj hud-sprite)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hud-sprite) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) + (format #t "~1Tangle: ~f~%" (-> obj angle)) + (format #t "~1Ttex: ~A~%" (-> obj tex)) + (label cfg-4) + obj + ) + +;; definition of type hud-box +(deftype hud-box (structure) + ((min vector2 :inline :offset-assert 0) + (max vector2 :inline :offset-assert 8) + (color vector4w :inline :offset-assert 16) + ) + :method-count-assert 16 + :size-assert #x20 + :flag-assert #x1000000020 + (:methods + (hud-box-method-9 () none 9) + (hud-box-method-10 () none 10) + (hud-box-method-11 () none 11) + (hud-box-method-12 () none 12) + (hud-box-method-13 () none 13) + (hud-box-method-14 () none 14) + (hud-box-method-15 () none 15) + ) + ) + +;; definition for method 3 of type hud-box +(defmethod inspect hud-box ((obj hud-box)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'hud-box) + (format #t "~1Tmin: #~%" (-> obj min)) + (format #t "~1Tmax: #~%" (-> obj max)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (label cfg-4) + obj + ) + +;; definition of type hud-icon +(deftype hud-icon (basic) + ((icon (pointer manipy) :offset-assert 4) + (pos vector4w :inline :offset-assert 16) + (scale-x float :offset-assert 32) + (scale-y float :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type hud-icon +(defmethod inspect hud-icon ((obj hud-icon)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ticon: #x~X~%" (-> obj icon)) + (format #t "~1Tpos: #~%" (-> obj pos)) + (format #t "~1Tscale-x: ~f~%" (-> obj scale-x)) + (format #t "~1Tscale-y: ~f~%" (-> obj scale-y)) + (label cfg-4) + obj + ) + +;; definition of type hud-value +(deftype hud-value (basic) + ((current int32 :offset-assert 4) + (target int32 :offset-assert 8) + (flags uint16 :offset-assert 12) + (counter uint16 :offset-assert 14) + ) + :pack-me + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type hud-value +(defmethod inspect hud-value ((obj hud-value)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcurrent: ~D~%" (-> obj current)) + (format #t "~1Ttarget: ~D~%" (-> obj target)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tcounter: ~D~%" (-> obj counter)) + (label cfg-4) + obj + ) + +;; definition of type hud +(deftype hud (process) + ((trigger-time time-frame :offset-assert 128) + (last-hide-time time-frame :offset-assert 136) + (offset float :offset-assert 144) + (flags hud-flags :offset-assert 148) + (values hud-value 8 :inline :offset-assert 152) + (strings hud-string 14 :inline :offset-assert 288) + (sprites hud-sprite 30 :inline :offset-assert 960) + (icons hud-icon 2 :inline :offset-assert 2880) + (gui-id uint32 :offset-assert 2976) + ) + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + (:methods + (hud-method-14 () none 14) + (hud-method-15 () none 15) + (hud-method-16 () none 16) + (hud-method-17 () none 17) + (hud-method-18 () none 18) + (hud-method-19 () none 19) + (hud-method-20 () none 20) + (hud-method-21 () none 21) + (hud-method-22 () none 22) + (hud-method-23 () none 23) + (hud-method-24 () none 24) + (hud-method-25 () none 25) + (hud-method-26 () none 26) + ) + ) + +;; definition for method 3 of type hud +(defmethod inspect hud ((obj hud)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 obj) + ) + (format #t "~2Ttrigger-time: ~D~%" (-> obj trigger-time)) + (format #t "~2Tlast-hide-time: ~D~%" (-> obj last-hide-time)) + (format #t "~2Toffset: ~f~%" (-> obj offset)) + (format #t "~2Tflags: ~D~%" (-> obj flags)) + (format #t "~2Tvalues[8] @ #x~X~%" (&-> obj stack 24)) + (format #t "~2Tstrings[14] @ #x~X~%" (&-> obj stack 160)) + (format #t "~2Tsprites[30] @ #x~X~%" (-> obj sprites)) + (format #t "~2Ticons[2] @ #x~X~%" (&-> obj stack 2752)) + (format #t "~2Tgui-id: ~D~%" (-> obj gui-id)) + (label cfg-4) + obj + ) + +;; definition of type hud-ashelin +(deftype hud-ashelin (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-ashelin +(defmethod inspect hud-ashelin ((obj hud-ashelin)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-cargo +(deftype hud-cargo (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-cargo +(defmethod inspect hud-cargo ((obj hud-cargo)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-citizen +(deftype hud-citizen (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-citizen +(defmethod inspect hud-citizen ((obj hud-citizen)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-cpanel +(deftype hud-cpanel (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-cpanel +(defmethod inspect hud-cpanel ((obj hud-cpanel)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-dig-clasp +(deftype hud-dig-clasp (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-dig-clasp +(defmethod inspect hud-dig-clasp ((obj hud-dig-clasp)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-gun +(deftype hud-gun (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-gun +(defmethod inspect hud-gun ((obj hud-gun)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-health +(deftype hud-health (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-health +(defmethod inspect hud-health ((obj hud-health)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-dark-eco-symbol +(deftype hud-dark-eco-symbol (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-dark-eco-symbol +(defmethod inspect hud-dark-eco-symbol ((obj hud-dark-eco-symbol)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-helldog +(deftype hud-helldog (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-helldog +(defmethod inspect hud-helldog ((obj hud-helldog)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-lurker +(deftype hud-lurker (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-lurker +(defmethod inspect hud-lurker ((obj hud-lurker)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-map +(deftype hud-map (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-map +(defmethod inspect hud-map ((obj hud-map)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-moneybag +(deftype hud-moneybag (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-moneybag +(defmethod inspect hud-moneybag ((obj hud-moneybag)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-pegasus +(deftype hud-pegasus (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-pegasus +(defmethod inspect hud-pegasus ((obj hud-pegasus)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-plasmite +(deftype hud-plasmite (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-plasmite +(defmethod inspect hud-plasmite ((obj hud-plasmite)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-dig-button +(deftype hud-dig-button (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-dig-button +(defmethod inspect hud-dig-button ((obj hud-dig-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-predator +(deftype hud-predator (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-predator +(defmethod inspect hud-predator ((obj hud-predator)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-heatmeter +(deftype hud-heatmeter (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-heatmeter +(defmethod inspect hud-heatmeter ((obj hud-heatmeter)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-progress +(deftype hud-progress (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-progress +(defmethod inspect hud-progress ((obj hud-progress)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-rocketsensor +(deftype hud-rocketsensor (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-rocketsensor +(defmethod inspect hud-rocketsensor ((obj hud-rocketsensor)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-ruffians +(deftype hud-ruffians (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-ruffians +(defmethod inspect hud-ruffians ((obj hud-ruffians)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-score +(deftype hud-score (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-score +(defmethod inspect hud-score ((obj hud-score)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-sig +(deftype hud-sig (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-sig +(defmethod inspect hud-sig ((obj hud-sig)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-skill +(deftype hud-skill (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-skill +(defmethod inspect hud-skill ((obj hud-skill)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-skullgem +(deftype hud-skullgem (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-skullgem +(defmethod inspect hud-skullgem ((obj hud-skullgem)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-timer +(deftype hud-timer (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-timer +(defmethod inspect hud-timer ((obj hud-timer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-turret +(deftype hud-turret (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-turret +(defmethod inspect hud-turret ((obj hud-turret)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-squid +(deftype hud-squid (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-squid +(defmethod inspect hud-squid ((obj hud-squid)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-gunturret +(deftype hud-gunturret (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-gunturret +(defmethod inspect hud-gunturret ((obj hud-gunturret)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-gruntegg +(deftype hud-gruntegg (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-gruntegg +(defmethod inspect hud-gruntegg ((obj hud-gruntegg)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-crimsonhover +(deftype hud-crimsonhover (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-crimsonhover +(defmethod inspect hud-crimsonhover ((obj hud-crimsonhover)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-metalkor +(deftype hud-metalkor (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-metalkor +(defmethod inspect hud-metalkor ((obj hud-metalkor)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-big-score +(deftype hud-big-score (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-big-score +(defmethod inspect hud-big-score ((obj hud-big-score)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-goal +(deftype hud-goal (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-goal +(defmethod inspect hud-goal ((obj hud-goal)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-miss +(deftype hud-miss (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-miss +(defmethod inspect hud-miss ((obj hud-miss)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-race-timer +(deftype hud-race-timer (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-race-timer +(defmethod inspect hud-race-timer ((obj hud-race-timer)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-race-lap-counter +(deftype hud-race-lap-counter (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-race-lap-counter +(defmethod inspect hud-race-lap-counter ((obj hud-race-lap-counter)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-race-turbo-counter +(deftype hud-race-turbo-counter (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-race-turbo-counter +(defmethod inspect hud-race-turbo-counter ((obj hud-race-turbo-counter)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-race-position +(deftype hud-race-position (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-race-position +(defmethod inspect hud-race-position ((obj hud-race-position)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-race-map +(deftype hud-race-map (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-race-map +(defmethod inspect hud-race-map ((obj hud-race-map)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-samos-old +(deftype hud-samos-old (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-samos-old +(defmethod inspect hud-samos-old ((obj hud-samos-old)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-samos-young +(deftype hud-samos-young (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-samos-young +(defmethod inspect hud-samos-young ((obj hud-samos-young)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-lurker-button +(deftype hud-lurker-button (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-lurker-button +(defmethod inspect hud-lurker-button ((obj hud-lurker-button)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-widow +(deftype hud-widow (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-widow +(defmethod inspect hud-widow ((obj hud-widow)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-race-final-stats +(deftype hud-race-final-stats (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-race-final-stats +(defmethod inspect hud-race-final-stats ((obj hud-race-final-stats)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-mech-air-tank +(deftype hud-mech-air-tank (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-mech-air-tank +(defmethod inspect hud-mech-air-tank ((obj hud-mech-air-tank)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-homing-beacon +(deftype hud-homing-beacon (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-homing-beacon +(defmethod inspect hud-homing-beacon ((obj hud-homing-beacon)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-dark-eco-pickup +(deftype hud-dark-eco-pickup (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-dark-eco-pickup +(defmethod inspect hud-dark-eco-pickup ((obj hud-dark-eco-pickup)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; definition of type hud-green-eco-pickup +(deftype hud-green-eco-pickup (hud) + () + :heap-base #xb30 + :method-count-assert 27 + :size-assert #xba4 + :flag-assert #x1b0b300ba4 + ) + +;; definition for method 3 of type hud-green-eco-pickup +(defmethod inspect hud-green-eco-pickup ((obj hud-green-eco-pickup)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 obj) + ) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc new file mode 100644 index 0000000000..c30346a2fd --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/minimap-h_REF.gc @@ -0,0 +1,618 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type minimap-class-node +(deftype minimap-class-node (structure) + ((default-position vector :inline :offset-assert 0) + (flags minimap-flag :offset-assert 16) + (class minimap-class :offset-assert 18) + (name basic :offset-assert 20) + (icon-xy vector2ub :inline :offset-assert 24) + (scale float :offset-assert 28) + (color rgba :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x24 + :flag-assert #x900000024 + ) + +;; definition for method 3 of type minimap-class-node +(defmethod inspect minimap-class-node ((obj minimap-class-node)) + (when (not obj) + (set! obj obj) + (goto cfg-179) + ) + (format #t "[~8x] ~A~%" obj 'minimap-class-node) + (format #t "~1Tdefault-position: ~`vector`P~%" (-> obj default-position)) + (format #t "~1Tflags: #x~X : (minimap-flag " (-> obj flags)) + (let ((s5-0 (-> obj flags))) + (if (= (logand s5-0 (minimap-flag active)) (minimap-flag active)) + (format #t "active ") + ) + (if (= (logand s5-0 (minimap-flag bigmap)) (minimap-flag bigmap)) + (format #t "bigmap ") + ) + (if (= (logand s5-0 (minimap-flag fade-in)) (minimap-flag fade-in)) + (format #t "fade-in ") + ) + (if (= (logand s5-0 (minimap-flag racer)) (minimap-flag racer)) + (format #t "racer ") + ) + (if (= (logand s5-0 (minimap-flag task)) (minimap-flag task)) + (format #t "task ") + ) + (if (= (logand s5-0 (minimap-flag enemy)) (minimap-flag enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-0 (minimap-flag clamp)) (minimap-flag clamp)) + (format #t "clamp ") + ) + (if (= (logand s5-0 (minimap-flag minimap)) (minimap-flag minimap)) + (format #t "minimap ") + ) + (if (= (logand s5-0 (minimap-flag flash)) (minimap-flag flash)) + (format #t "flash ") + ) + (if (= (logand s5-0 (minimap-flag task-graph)) (minimap-flag task-graph)) + (format #t "task-graph ") + ) + (if (= (logand s5-0 (minimap-flag trail)) (minimap-flag trail)) + (format #t "trail ") + ) + (if (= (logand s5-0 (minimap-flag frustum)) (minimap-flag frustum)) + (format #t "frustum ") + ) + (if (= (logand s5-0 (minimap-flag background)) (minimap-flag background)) + (format #t "background ") + ) + (if (= (logand s5-0 (minimap-flag goal)) (minimap-flag goal)) + (format #t "goal ") + ) + (if (= (logand s5-0 (minimap-flag fade-out)) (minimap-flag fade-out)) + (format #t "fade-out ") + ) + (if (= (logand s5-0 (minimap-flag city-only)) (minimap-flag city-only)) + (format #t "city-only ") + ) + ) + (format #t ")~%") + (let ((t9-20 format) + (a0-37 #t) + (a1-20 "~1Tclass: #x~X : ~S~%") + (a2-3 (-> obj class)) + (v1-50 (-> obj class)) + ) + (t9-20 a0-37 a1-20 a2-3 (cond + ((= v1-50 (minimap-class onintent)) + "onintent" + ) + ((= v1-50 (minimap-class slumc-seal)) + "slumc-seal" + ) + ((= v1-50 (minimap-class bbush-gena-2)) + "bbush-gena-2" + ) + ((= v1-50 (minimap-class forest-samos)) + "forest-samos" + ) + ((= v1-50 (minimap-class mountain-lens)) + "mountain-lens" + ) + ((= v1-50 (minimap-class atoll)) + "atoll" + ) + ((= v1-50 (minimap-class guard)) + "guard" + ) + ((= v1-50 (minimap-class garage)) + "garage" + ) + ((= v1-50 (minimap-class bbush-slumb-2)) + "bbush-slumb-2" + ) + ((= v1-50 (minimap-class bbush-genb)) + "bbush-genb" + ) + ((= v1-50 (minimap-class ruins-hut)) + "ruins-hut" + ) + ((= v1-50 (minimap-class mountain-gear)) + "mountain-gear" + ) + ((= v1-50 (minimap-class bbush-stadium)) + "bbush-stadium" + ) + ((= v1-50 (minimap-class racer-target)) + "racer-target" + ) + ((= v1-50 (minimap-class bbush-port-3)) + "bbush-port-3" + ) + ((= v1-50 (minimap-class mountain)) + "mountain" + ) + ((= v1-50 (minimap-class none)) + "none" + ) + ((= v1-50 (minimap-class racer-errol)) + "racer-errol" + ) + ((= v1-50 (minimap-class goal)) + "goal" + ) + ((= v1-50 (minimap-class goal-no-trail)) + "goal-no-trail" + ) + ((= v1-50 (minimap-class hideout)) + "hideout" + ) + ((= v1-50 (minimap-class vinroom)) + "vinroom" + ) + ((= v1-50 (minimap-class castle)) + "castle" + ) + ((= v1-50 (minimap-class racer)) + "racer" + ) + ((= v1-50 (minimap-class tanker)) + "tanker" + ) + ((= v1-50 (minimap-class dig)) + "dig" + ) + ((= v1-50 (minimap-class bbush-genb-2)) + "bbush-genb-2" + ) + ((= v1-50 (minimap-class canyon)) + "canyon" + ) + ((= v1-50 (minimap-class consite)) + "consite" + ) + ((= v1-50 (minimap-class bbush-markb)) + "bbush-markb" + ) + ((= v1-50 (minimap-class gungame)) + "gungame" + ) + ((= v1-50 (minimap-class port-turret)) + "port-turret" + ) + ((= v1-50 (minimap-class kiosk)) + "kiosk" + ) + ((= v1-50 (minimap-class bbush-marka)) + "bbush-marka" + ) + ((= v1-50 (minimap-class bbush-inda)) + "bbush-inda" + ) + ((= v1-50 (minimap-class burning-bush)) + "burning-bush" + ) + ((= v1-50 (minimap-class palace-cable)) + "palace-cable" + ) + ((= v1-50 (minimap-class bbush-genc)) + "bbush-genc" + ) + ((= v1-50 (minimap-class atoll-ashelin)) + "atoll-ashelin" + ) + ((= v1-50 (minimap-class forest)) + "forest" + ) + ((= v1-50 (minimap-class bbush-pal)) + "bbush-pal" + ) + ((= v1-50 (minimap-class tomb)) + "tomb" + ) + ((= v1-50 (minimap-class mountain-shard)) + "mountain-shard" + ) + ((= v1-50 (minimap-class ruins)) + "ruins" + ) + ((= v1-50 (minimap-class bbush-farmb)) + "bbush-farmb" + ) + ((= v1-50 (minimap-class kid)) + "kid" + ) + ((= v1-50 (minimap-class atoll-valve)) + "atoll-valve" + ) + ((= v1-50 (minimap-class bbush-farma)) + "bbush-farma" + ) + ((= v1-50 (minimap-class parking-spot)) + "parking-spot" + ) + ((= v1-50 (minimap-class bbush-slumc)) + "bbush-slumc" + ) + ((= v1-50 (minimap-class palace)) + "palace" + ) + ((= v1-50 (minimap-class bbush-genc-2)) + "bbush-genc-2" + ) + ((= v1-50 (minimap-class bbush-markb-2)) + "bbush-markb-2" + ) + ((= v1-50 (minimap-class hiphog)) + "hiphog" + ) + ((= v1-50 (minimap-class gun-dark)) + "gun-dark" + ) + ((= v1-50 (minimap-class flag)) + "flag" + ) + ((= v1-50 (minimap-class guard-frustum)) + "guard-frustum" + ) + ((= v1-50 (minimap-class bbush-port-2)) + "bbush-port-2" + ) + ((= v1-50 (minimap-class bbush-port)) + "bbush-port" + ) + ((= v1-50 (minimap-class bbush-slumb)) + "bbush-slumb" + ) + ((= v1-50 (minimap-class bbush-gena)) + "bbush-gena" + ) + ((= v1-50 (minimap-class fortress)) + "fortress" + ) + ((= v1-50 (minimap-class sewer)) + "sewer" + ) + ((= v1-50 (minimap-class bbush-sluma)) + "bbush-sluma" + ) + ((= v1-50 (minimap-class metalhead)) + "metalhead" + ) + ((= v1-50 (minimap-class underport)) + "underport" + ) + ((= v1-50 (minimap-class bbush-indb)) + "bbush-indb" + ) + ((= v1-50 (minimap-class oracle)) + "oracle" + ) + ((= v1-50 (minimap-class gun-yellow)) + "gun-yellow" + ) + ((= v1-50 (minimap-class bbush-pal-2)) + "bbush-pal-2" + ) + ((= v1-50 (minimap-class stadium)) + "stadium" + ) + (else + "*unknown*" + ) + ) + ) + ) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Ticon-xy: #~%" (-> obj icon-xy)) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (label cfg-179) + obj + ) + +;; definition of type connection-minimap +(deftype connection-minimap (connection-pers) + ((handle handle :offset 8) + (position vector :offset 16) + (alpha float :offset 20) + (class minimap-class-node :offset 24) + (flags minimap-flag :offset 28) + (node uint16 :offset 30) + (edge-ry float :offset-assert 32) + (last-world-pos vector :inline :offset-assert 48) + (last-relative-pos vector :inline :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x50 + :flag-assert #x900000050 + ) + +;; definition for method 3 of type connection-minimap +;; INFO: Used lq/sq +(defmethod inspect connection-minimap ((obj connection-minimap)) + (when (not obj) + (set! obj obj) + (goto cfg-48) + ) + (format #t "[~8x] ~A~%" obj 'connection-minimap) + (format #t "~1Tnext: #~%" (-> obj next)) + (format #t "~1Tkey: ~A~%" (-> obj key)) + (format #t "~1Tupdate-time: ~D~%" (-> obj update-time)) + (format #t "~1Tparam[4] @ #x~X~%" (-> obj param)) + (dotimes (s5-0 4) + (format #t "~T [~D]~1Tparam: ~A~%" s5-0 (-> obj param s5-0)) + ) + (format #t "~1Tparam-int32[4] @ #x~X~%" (-> obj param)) + (dotimes (s5-1 4) + (format #t "~T [~D]~1Tparam-int32: ~D~%" s5-1 (-> obj param s5-1)) + ) + (format #t "~1Tparam-int64[2] @ #x~X~%" (-> obj param)) + (dotimes (s5-2 2) + (format #t "~T [~D]~1Tparam-int64: ~D~%" s5-2 (-> obj param-int64 s5-2)) + ) + (format #t "~1Tparam-float[4] @ #x~X~%" (-> obj param)) + (dotimes (s5-3 4) + (format #t "~T [~D]~1Tparam-float: ~f~%" s5-3 (the-as float (-> obj param s5-3))) + ) + (format #t "~1Tparam-quat: #x~X~%" (-> obj param-quat)) + (format #t "~1Thandle: ~D~%" (-> obj update-time)) + (format #t "~1Tposition: #~%" (-> obj position)) + (format #t "~1Talpha: ~f~%" (-> obj alpha)) + (format #t "~1Tclass: #~%" (-> obj class)) + (format #t "~1Tflags: #x~X : (minimap-flag " (-> obj flags)) + (let ((s5-4 (-> obj flags))) + (if (= (logand s5-4 (minimap-flag active)) (minimap-flag active)) + (format #t "active ") + ) + (if (= (logand s5-4 (minimap-flag bigmap)) (minimap-flag bigmap)) + (format #t "bigmap ") + ) + (if (= (logand s5-4 (minimap-flag fade-in)) (minimap-flag fade-in)) + (format #t "fade-in ") + ) + (if (= (logand s5-4 (minimap-flag racer)) (minimap-flag racer)) + (format #t "racer ") + ) + (if (= (logand s5-4 (minimap-flag task)) (minimap-flag task)) + (format #t "task ") + ) + (if (= (logand s5-4 (minimap-flag enemy)) (minimap-flag enemy)) + (format #t "enemy ") + ) + (if (= (logand s5-4 (minimap-flag clamp)) (minimap-flag clamp)) + (format #t "clamp ") + ) + (if (= (logand s5-4 (minimap-flag minimap)) (minimap-flag minimap)) + (format #t "minimap ") + ) + (if (= (logand s5-4 (minimap-flag flash)) (minimap-flag flash)) + (format #t "flash ") + ) + (if (= (logand s5-4 (minimap-flag task-graph)) (minimap-flag task-graph)) + (format #t "task-graph ") + ) + (if (= (logand s5-4 (minimap-flag trail)) (minimap-flag trail)) + (format #t "trail ") + ) + (if (= (logand s5-4 (minimap-flag frustum)) (minimap-flag frustum)) + (format #t "frustum ") + ) + (if (= (logand s5-4 (minimap-flag background)) (minimap-flag background)) + (format #t "background ") + ) + (if (= (logand s5-4 (minimap-flag goal)) (minimap-flag goal)) + (format #t "goal ") + ) + (if (= (logand s5-4 (minimap-flag fade-out)) (minimap-flag fade-out)) + (format #t "fade-out ") + ) + (if (= (logand s5-4 (minimap-flag city-only)) (minimap-flag city-only)) + (format #t "city-only ") + ) + ) + (format #t ")~%") + (format #t "~1Tnode: ~D~%" (-> obj node)) + (format #t "~1Tedge-ry: ~f~%" (-> obj edge-ry)) + (format #t "~1Tlast-world-pos: ~`vector`P~%" (-> obj last-world-pos)) + (format #t "~1Tlast-relative-pos: ~`vector`P~%" (-> obj last-relative-pos)) + (label cfg-48) + obj + ) + +;; definition of type engine-minimap +(deftype engine-minimap (engine-pers) + ((alive-list-override connection-minimap :offset 24) + (dead-list-override connection-minimap :offset 28) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + ) + +;; definition for method 3 of type engine-minimap +(defmethod inspect engine-minimap ((obj engine-minimap)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tallocated-length: ~D~%" (-> obj allocated-length)) + (format #t "~1Telement-type: ~A~%" (-> obj element-type)) + (format #t "~1Texecute-time: ~D~%" (-> obj execute-time)) + (format #t "~1Talive-list: #~%" (-> obj alive-list)) + (format #t "~1Tdead-list: #~%" (-> obj dead-list)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type minimap-trail +(deftype minimap-trail (structure) + ((used-by connection-minimap :offset-assert 0) + (search-id uint32 :offset-assert 4) + (node-count int16 :offset-assert 8) + (goal-node-id int32 :offset-assert 12) + (node-path-dist float :offset-assert 16) + (last-updated uint64 :offset-assert 24) + (cached-info trail-cached-search-info :inline :offset-assert 32) + (node-id uint16 64 :offset-assert 80) + ) + :method-count-assert 11 + :size-assert #xd0 + :flag-assert #xb000000d0 + (:methods + (minimap-trail-method-9 () none 9) + (minimap-trail-method-10 () none 10) + ) + ) + +;; definition for method 3 of type minimap-trail +(defmethod inspect minimap-trail ((obj minimap-trail)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'minimap-trail) + (format #t "~1Tused-by: ~`connection-minimap`P~%" (-> obj used-by)) + (format #t "~1Tsearch-id: ~D~%" (-> obj search-id)) + (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) + (format #t "~1Tgoal-node-id: ~D~%" (-> obj goal-node-id)) + (format #t "~1Tnode-path-dist: ~f~%" (-> obj node-path-dist)) + (format #t "~1Tlast-updated: ~D~%" (-> obj last-updated)) + (format #t "~1Tcached-info: #~%" (-> obj cached-info)) + (format #t "~1Tnode-id[64] @ #x~X~%" (-> obj node-id)) + (label cfg-4) + obj + ) + +;; definition of type minimap-draw-work +(deftype minimap-draw-work (structure) + ((buf basic :offset-assert 0) + (justify-right basic :offset-assert 4) + (draw-pos vector4w :inline :offset-assert 16) + (mat matrix :inline :offset-assert 32) + (corner vector4w 4 :inline :offset-assert 96) + ) + :method-count-assert 9 + :size-assert #xa0 + :flag-assert #x9000000a0 + ) + +;; definition for method 3 of type minimap-draw-work +(defmethod inspect minimap-draw-work ((obj minimap-draw-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'minimap-draw-work) + (format #t "~1Tbuf: ~A~%" (-> obj buf)) + (format #t "~1Tjustify-right: ~A~%" (-> obj justify-right)) + (format #t "~1Tdraw-pos: #~%" (-> obj draw-pos)) + (format #t "~1Tmat: #~%" (-> obj mat)) + (format #t "~1Tcorner[4] @ #x~X~%" (-> obj corner)) + (label cfg-4) + obj + ) + +;; definition of type minimap +(deftype minimap (structure) + ((draw-tmpl dma-gif-packet :inline :offset-assert 0) + (draw2-tmpl dma-gif-packet :inline :offset-assert 32) + (draw3-tmpl dma-gif-packet :inline :offset-assert 64) + (draw4-tmpl dma-gif-packet :inline :offset-assert 96) + (sprite-tmpl dma-gif-packet :inline :offset-assert 128) + (adgif-tmpl dma-gif-packet :inline :offset-assert 160) + (color vector4w :inline :offset-assert 192) + (offset vector :inline :offset-assert 208) + (minimap-corner vector :inline :offset-assert 224) + (last-name basic :offset-assert 240) + (last-tex basic :offset-assert 244) + (target-inv-scale float :offset-assert 248) + (map-bits uint64 :offset-assert 256) + (level basic :offset-assert 264) + (ctywide basic :offset-assert 268) + (inv-scale float :offset 212) + (fade float :offset 220) + (engine basic :offset-assert 272) + (engine-key uint32 :offset-assert 276) + (trail minimap-trail 6 :inline :offset-assert 288) + (race-tex basic :offset-assert 1536) + (race-scale float :offset-assert 1540) + (race-level basic :offset-assert 1544) + (sprite2-tmpl dma-gif-packet :inline :offset-assert 1552) + (race-corner vector :inline :offset-assert 1584) + (goal-time float :offset-assert 1600) + (frustum-alpha float :offset-assert 1604) + ) + :method-count-assert 28 + :size-assert #x648 + :flag-assert #x1c00000648 + (:methods + (minimap-method-9 () none 9) + (minimap-method-10 () none 10) + (minimap-method-11 () none 11) + (minimap-method-12 () none 12) + (minimap-method-13 () none 13) + (minimap-method-14 () none 14) + (minimap-method-15 () none 15) + (minimap-method-16 () none 16) + (minimap-method-17 () none 17) + (minimap-method-18 () none 18) + (minimap-method-19 () none 19) + (minimap-method-20 () none 20) + (minimap-method-21 () none 21) + (minimap-method-22 () none 22) + (minimap-method-23 () none 23) + (minimap-method-24 () none 24) + (minimap-method-25 () none 25) + (minimap-method-26 () none 26) + (minimap-method-27 () none 27) + ) + ) + +;; definition for method 3 of type minimap +(defmethod inspect minimap ((obj minimap)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'minimap) + (format #t "~1Tdraw-tmpl: #~%" (-> obj draw-tmpl)) + (format #t "~1Tdraw2-tmpl: #~%" (-> obj draw2-tmpl)) + (format #t "~1Tdraw3-tmpl: #~%" (-> obj draw3-tmpl)) + (format #t "~1Tdraw4-tmpl: #~%" (-> obj draw4-tmpl)) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tadgif-tmpl: #~%" (-> obj adgif-tmpl)) + (format #t "~1Tcolor: #~%" (-> obj color)) + (format #t "~1Toffset: #~%" (-> obj offset)) + (format #t "~1Tminimap-corner: #~%" (-> obj minimap-corner)) + (format #t "~1Tlast-name: ~A~%" (-> obj last-name)) + (format #t "~1Tlast-tex: ~A~%" (-> obj last-tex)) + (format #t "~1Ttarget-inv-scale: ~f~%" (-> obj target-inv-scale)) + (format #t "~1Tmap-bits: ~D~%" (-> obj map-bits)) + (format #t "~1Tlevel: ~A~%" (-> obj level)) + (format #t "~1Tctywide: ~A~%" (-> obj ctywide)) + (format #t "~1Tinv-scale: ~f~%" (-> obj offset y)) + (format #t "~1Tfade: ~f~%" (-> obj offset w)) + (format #t "~1Tengine: ~A~%" (-> obj engine)) + (format #t "~1Tengine-key: ~D~%" (-> obj engine-key)) + (format #t "~1Ttrail[6] @ #x~X~%" (-> obj trail)) + (format #t "~1Trace-tex: ~A~%" (-> obj race-tex)) + (format #t "~1Trace-scale: ~f~%" (-> obj race-scale)) + (format #t "~1Trace-level: ~A~%" (-> obj race-level)) + (format #t "~1Tsprite2-tmpl: #~%" (-> obj sprite2-tmpl)) + (format #t "~1Trace-corner: #~%" (-> obj race-corner)) + (format #t "~1Tgoal-time: ~f~%" (-> obj goal-time)) + (format #t "~1Tfrustum-alpha: ~f~%" (-> obj frustum-alpha)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc new file mode 100644 index 0000000000..78712dded7 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/progress/progress-h_REF.gc @@ -0,0 +1,1466 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type progress +(deftype progress (process-drawable) + ((current-options basic :offset-assert 200) + (menu-transition float :offset-assert 204) + (option-index int32 :offset-assert 208) + (want-option-index int32 :offset-assert 212) + (next-option-index int32 :offset-assert 216) + (graphic-index int32 :offset-assert 220) + (selected-option basic :offset-assert 224) + (current basic :offset-assert 228) + (next basic :offset-assert 232) + (ring-angle float :offset-assert 236) + (ring-want-angle float :offset-assert 240) + (init-quat quaternion :inline :offset-assert 256) + (pos-transition float :offset-assert 272) + (anim-frame float :offset-assert 276) + (swing float :offset-assert 280) + (main-menu basic :offset-assert 284) + (state-stack int32 5 :offset-assert 288) + (option-index-stack int32 5 :offset-assert 308) + (state-pos int32 :offset-assert 328) + (secret-buying basic :offset-assert 332) + (secret-buy-choice basic :offset-assert 336) + (sliding float :offset-assert 340) + (sliding-off float :offset-assert 344) + (scanlines-alpha float :offset-assert 348) + (sliding-height float :offset-assert 352) + ) + :heap-base #xf0 + :method-count-assert 33 + :size-assert #x164 + :flag-assert #x2100f00164 + (:methods + (progress-method-20 () none 20) + (progress-method-21 () none 21) + (progress-method-22 () none 22) + (progress-method-23 () none 23) + (progress-method-24 () none 24) + (progress-method-25 () none 25) + (progress-method-26 () none 26) + (progress-method-27 () none 27) + (progress-method-28 () none 28) + (progress-method-29 () none 29) + (progress-method-30 () none 30) + (progress-method-31 () none 31) + (progress-method-32 () none 32) + ) + ) + +;; definition for method 3 of type progress +(defmethod inspect progress ((obj progress)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 obj) + ) + (format #t "~2Tcurrent-options: ~A~%" (-> obj current-options)) + (format #t "~2Tmenu-transition: ~f~%" (-> obj menu-transition)) + (format #t "~2Toption-index: ~D~%" (-> obj option-index)) + (format #t "~2Twant-option-index: ~D~%" (-> obj want-option-index)) + (format #t "~2Tnext-option-index: ~D~%" (-> obj next-option-index)) + (format #t "~2Tgraphic-index: ~D~%" (-> obj graphic-index)) + (format #t "~2Tselected-option: ~A~%" (-> obj selected-option)) + (format #t "~2Tcurrent: ~A~%" (-> obj current)) + (format #t "~2Tnext: ~A~%" (-> obj next)) + (format #t "~2Tring-angle: ~f~%" (-> obj ring-angle)) + (format #t "~2Tring-want-angle: ~f~%" (-> obj ring-want-angle)) + (format #t "~2Tinit-quat: #~%" (-> obj init-quat)) + (format #t "~2Tpos-transition: ~f~%" (-> obj pos-transition)) + (format #t "~2Tanim-frame: ~f~%" (-> obj anim-frame)) + (format #t "~2Tswing: ~f~%" (-> obj swing)) + (format #t "~2Tmain-menu: ~A~%" (-> obj main-menu)) + (format #t "~2Tstate-stack[5] @ #x~X~%" (-> obj state-stack)) + (format #t "~2Toption-index-stack[5] @ #x~X~%" (-> obj option-index-stack)) + (format #t "~2Tstate-pos: ~D~%" (-> obj state-pos)) + (format #t "~2Tsecret-buying: ~A~%" (-> obj secret-buying)) + (format #t "~2Tsecret-buy-choice: ~A~%" (-> obj secret-buy-choice)) + (format #t "~2Tsliding: ~f~%" (-> obj sliding)) + (format #t "~2Tsliding-off: ~f~%" (-> obj sliding-off)) + (format #t "~2Tscanlines-alpha: ~f~%" (-> obj scanlines-alpha)) + (format #t "~2Tsliding-height: ~f~%" (-> obj sliding-height)) + (label cfg-4) + obj + ) + +;; definition of type menu-option +(deftype menu-option (basic) + ((name uint32 :offset-assert 4) + (scale basic :offset-assert 8) + (box bounding-box 1 :inline :offset-assert 16) + ) + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + (:methods + (menu-option-method-9 () none 9) + (menu-option-method-10 () none 10) + (menu-option-method-11 () none 11) + ) + ) + +;; definition for method 3 of type menu-option +(defmethod inspect menu-option ((obj menu-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-on-off-option +(deftype menu-on-off-option (menu-option) + ((value-to-modify uint32 :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +;; definition for method 3 of type menu-on-off-option +(defmethod inspect menu-on-off-option ((obj menu-on-off-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-yes-no-option +(deftype menu-yes-no-option (menu-option) + ((value-to-modify uint32 :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +;; definition for method 3 of type menu-yes-no-option +(defmethod inspect menu-yes-no-option ((obj menu-yes-no-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-language-option +(deftype menu-language-option (menu-option) + ((language-selection uint64 :offset-assert 48) + (language-direction basic :offset-assert 56) + (language-transition basic :offset-assert 60) + (language-x-offset int32 :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +;; definition for method 3 of type menu-language-option +(defmethod inspect menu-language-option ((obj menu-language-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlanguage-selection: ~D~%" (-> obj language-selection)) + (format #t "~1Tlanguage-direction: ~A~%" (-> obj language-direction)) + (format #t "~1Tlanguage-transition: ~A~%" (-> obj language-transition)) + (format #t "~1Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) + (label cfg-4) + obj + ) + +;; definition of type menu-quit-option +(deftype menu-quit-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-quit-option +(defmethod inspect menu-quit-option ((obj menu-quit-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-slider-option +(deftype menu-slider-option (menu-option) + ((value-to-modify uint32 :offset-assert 48) + (sprites hud-sprite 5 :inline :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x180 + :flag-assert #xc00000180 + ) + +;; definition for method 3 of type menu-slider-option +(defmethod inspect menu-slider-option ((obj menu-slider-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tsprites[5] @ #x~X~%" (-> obj sprites)) + (label cfg-4) + obj + ) + +;; definition of type menu-sub-menu-option +(deftype menu-sub-menu-option (menu-option) + ((next-state basic :offset-assert 48) + (pad uint8 44 :offset-assert 52) + ) + :method-count-assert 12 + :size-assert #x60 + :flag-assert #xc00000060 + ) + +;; definition for method 3 of type menu-sub-menu-option +(defmethod inspect menu-sub-menu-option ((obj menu-sub-menu-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-sub-menu-sound-option +(deftype menu-sub-menu-sound-option (menu-option) + ((next-state basic :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +;; definition for method 3 of type menu-sub-menu-sound-option +(defmethod inspect menu-sub-menu-sound-option ((obj menu-sub-menu-sound-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-stereo-mode-sound-option +(deftype menu-stereo-mode-sound-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-stereo-mode-sound-option +(defmethod inspect menu-stereo-mode-sound-option ((obj menu-stereo-mode-sound-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-sub-menu-graphic-option +(deftype menu-sub-menu-graphic-option (menu-option) + ((next-state basic :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +;; definition for method 3 of type menu-sub-menu-graphic-option +(defmethod inspect menu-sub-menu-graphic-option ((obj menu-sub-menu-graphic-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-unlocked-menu-option +(deftype menu-unlocked-menu-option (menu-sub-menu-option) + () + :method-count-assert 12 + :size-assert #x60 + :flag-assert #xc00000060 + ) + +;; definition for method 3 of type menu-unlocked-menu-option +(defmethod inspect menu-unlocked-menu-option ((obj menu-unlocked-menu-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-main-menu-option +(deftype menu-main-menu-option (menu-option) + ((next-state basic :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x34 + :flag-assert #xc00000034 + ) + +;; definition for method 3 of type menu-main-menu-option +(defmethod inspect menu-main-menu-option ((obj menu-main-menu-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-memcard-slot-option +(deftype menu-memcard-slot-option (menu-option) + ((sprites hud-sprite 5 :inline :offset-assert 48) + (pad uint8 32 :offset-assert 368) + ) + :method-count-assert 12 + :size-assert #x190 + :flag-assert #xc00000190 + ) + +;; definition for method 3 of type menu-memcard-slot-option +(defmethod inspect menu-memcard-slot-option ((obj menu-memcard-slot-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tsprites[5] @ #x~X~%" (-> obj sprites)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-loading-option +(deftype menu-loading-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-loading-option +(defmethod inspect menu-loading-option ((obj menu-loading-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-insufficient-space-option +(deftype menu-insufficient-space-option (menu-option) + ((last-move uint64 :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #x38 + :flag-assert #xc00000038 + ) + +;; definition for method 3 of type menu-insufficient-space-option +(defmethod inspect menu-insufficient-space-option ((obj menu-insufficient-space-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (label cfg-4) + obj + ) + +;; definition of type menu-secrets-insufficient-space-option +(deftype menu-secrets-insufficient-space-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-secrets-insufficient-space-option +(defmethod inspect menu-secrets-insufficient-space-option ((obj menu-secrets-insufficient-space-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-insert-card-option +(deftype menu-insert-card-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-insert-card-option +(defmethod inspect menu-insert-card-option ((obj menu-insert-card-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-error-loading-option +(deftype menu-error-loading-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-error-loading-option +(defmethod inspect menu-error-loading-option ((obj menu-error-loading-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-error-auto-saving-option +(deftype menu-error-auto-saving-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-error-auto-saving-option +(defmethod inspect menu-error-auto-saving-option ((obj menu-error-auto-saving-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-card-removed-option +(deftype menu-card-removed-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-card-removed-option +(defmethod inspect menu-card-removed-option ((obj menu-card-removed-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-error-disc-removed-option +(deftype menu-error-disc-removed-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-error-disc-removed-option +(defmethod inspect menu-error-disc-removed-option ((obj menu-error-disc-removed-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-error-reading-option +(deftype menu-error-reading-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-error-reading-option +(defmethod inspect menu-error-reading-option ((obj menu-error-reading-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-icon-info-option +(deftype menu-icon-info-option (menu-option) + ((sprites hud-sprite 2 :inline :offset-assert 48) + ) + :method-count-assert 12 + :size-assert #xb0 + :flag-assert #xc000000b0 + ) + +;; definition for method 3 of type menu-icon-info-option +(defmethod inspect menu-icon-info-option ((obj menu-icon-info-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tsprites[2] @ #x~X~%" (-> obj sprites)) + (label cfg-4) + obj + ) + +;; definition of type menu-format-card-option +(deftype menu-format-card-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-format-card-option +(defmethod inspect menu-format-card-option ((obj menu-format-card-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-already-exists-option +(deftype menu-already-exists-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-already-exists-option +(defmethod inspect menu-already-exists-option ((obj menu-already-exists-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-create-game-option +(deftype menu-create-game-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-create-game-option +(defmethod inspect menu-create-game-option ((obj menu-create-game-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-video-mode-warning-option +(deftype menu-video-mode-warning-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-video-mode-warning-option +(defmethod inspect menu-video-mode-warning-option ((obj menu-video-mode-warning-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-video-mode-ok-option +(deftype menu-video-mode-ok-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-video-mode-ok-option +(defmethod inspect menu-video-mode-ok-option ((obj menu-video-mode-ok-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-progressive-mode-warning-option +(deftype menu-progressive-mode-warning-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-progressive-mode-warning-option +(defmethod inspect menu-progressive-mode-warning-option ((obj menu-progressive-mode-warning-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-progressive-mode-ok-option +(deftype menu-progressive-mode-ok-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-progressive-mode-ok-option +(defmethod inspect menu-progressive-mode-ok-option ((obj menu-progressive-mode-ok-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type menu-select-start-option +(deftype menu-select-start-option (menu-option) + ((task-index int32 :offset-assert 48) + (real-task-index int32 :offset-assert 52) + (last-move uint64 :offset-assert 56) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-select-start-option +(defmethod inspect menu-select-start-option ((obj menu-select-start-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Ttask-index: ~D~%" (-> obj task-index)) + (format #t "~1Treal-task-index: ~D~%" (-> obj real-task-index)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (label cfg-4) + obj + ) + +;; definition of type menu-select-scene-option +(deftype menu-select-scene-option (menu-option) + ((task-index int32 :offset-assert 48) + (last-move uint64 :offset-assert 56) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-select-scene-option +(defmethod inspect menu-select-scene-option ((obj menu-select-scene-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Ttask-index: ~D~%" (-> obj task-index)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (label cfg-4) + obj + ) + +;; definition of type menu-bigmap-option +(deftype menu-bigmap-option (menu-option) + () + :method-count-assert 12 + :size-assert #x30 + :flag-assert #xc00000030 + ) + +;; definition for method 3 of type menu-bigmap-option +(defmethod inspect menu-bigmap-option ((obj menu-bigmap-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (label cfg-4) + obj + ) + +;; definition of type paged-menu-option +(deftype paged-menu-option (menu-option) + ((page-index int32 :offset-assert 48) + (prev-page-index int32 :offset-assert 52) + (num-pages int32 :offset-assert 56) + (slide-dir float :offset-assert 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type paged-menu-option +(defmethod inspect paged-menu-option ((obj paged-menu-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tpage-index: ~D~%" (-> obj page-index)) + (format #t "~1Tprev-page-index: ~D~%" (-> obj prev-page-index)) + (format #t "~1Tnum-pages: ~D~%" (-> obj num-pages)) + (format #t "~1Tslide-dir: ~f~%" (-> obj slide-dir)) + (label cfg-4) + obj + ) + +;; definition of type menu-missions-option +(deftype menu-missions-option (paged-menu-option) + ((task-line-index int32 :offset-assert 64) + (last-move uint64 :offset-assert 72) + ) + :method-count-assert 12 + :size-assert #x50 + :flag-assert #xc00000050 + ) + +;; definition for method 3 of type menu-missions-option +(defmethod inspect menu-missions-option ((obj menu-missions-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tpage-index: ~D~%" (-> obj page-index)) + (format #t "~1Tprev-page-index: ~D~%" (-> obj prev-page-index)) + (format #t "~1Tnum-pages: ~D~%" (-> obj num-pages)) + (format #t "~1Tslide-dir: ~f~%" (-> obj slide-dir)) + (format #t "~1Ttask-line-index: ~D~%" (-> obj task-line-index)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (label cfg-4) + obj + ) + +;; definition of type menu-highscores-option +(deftype menu-highscores-option (paged-menu-option) + ((last-move uint64 :offset-assert 64) + (sprites hud-sprite 2 :inline :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #xd0 + :flag-assert #xc000000d0 + ) + +;; definition for method 3 of type menu-highscores-option +(defmethod inspect menu-highscores-option ((obj menu-highscores-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tpage-index: ~D~%" (-> obj page-index)) + (format #t "~1Tprev-page-index: ~D~%" (-> obj prev-page-index)) + (format #t "~1Tnum-pages: ~D~%" (-> obj num-pages)) + (format #t "~1Tslide-dir: ~f~%" (-> obj slide-dir)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tsprites[2] @ #x~X~%" (-> obj sprites)) + (label cfg-4) + obj + ) + +;; definition of type secret-item-option +(deftype secret-item-option (menu-option) + ((cost int32 :offset-assert 48) + (can-toggle basic :offset-assert 52) + (flag uint32 :offset-assert 56) + (avail-after uint16 :offset-assert 60) + ) + :method-count-assert 12 + :size-assert #x3e + :flag-assert #xc0000003e + ) + +;; definition for method 3 of type secret-item-option +(defmethod inspect secret-item-option ((obj secret-item-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tcost: ~D~%" (-> obj cost)) + (format #t "~1Tcan-toggle: ~A~%" (-> obj can-toggle)) + (format #t "~1Tflag: ~D~%" (-> obj flag)) + (format #t "~1Tavail-after: ~D~%" (-> obj avail-after)) + (label cfg-4) + obj + ) + +;; definition of type menu-secret-option +(deftype menu-secret-option (menu-option) + ((item-index int32 :offset-assert 48) + (prev-item-index int32 :offset-assert 52) + (num-items int32 :offset-assert 56) + (num-hero-items int32 :offset-assert 60) + (secret-items basic :offset-assert 64) + (last-move uint64 :offset-assert 72) + (sprites hud-sprite 2 :inline :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #xd0 + :flag-assert #xc000000d0 + ) + +;; definition for method 3 of type menu-secret-option +(defmethod inspect menu-secret-option ((obj menu-secret-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Titem-index: ~D~%" (-> obj item-index)) + (format #t "~1Tprev-item-index: ~D~%" (-> obj prev-item-index)) + (format #t "~1Tnum-items: ~D~%" (-> obj num-items)) + (format #t "~1Tnum-hero-items: ~D~%" (-> obj num-hero-items)) + (format #t "~1Tsecret-items: ~A~%" (-> obj secret-items)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tsprites[2] @ #x~X~%" (-> obj sprites)) + (label cfg-4) + obj + ) + +;; definition of type menu-option-list +(deftype menu-option-list (basic) + ((y-center int32 :offset-assert 4) + (y-space int32 :offset-assert 8) + (scale float :offset-assert 12) + (options basic :offset-assert 16) + ) + :method-count-assert 9 + :size-assert #x14 + :flag-assert #x900000014 + ) + +;; definition for method 3 of type menu-option-list +(defmethod inspect menu-option-list ((obj menu-option-list)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Ty-center: ~D~%" (-> obj y-center)) + (format #t "~1Ty-space: ~D~%" (-> obj y-space)) + (format #t "~1Tscale: ~f~%" (-> obj scale)) + (format #t "~1Toptions: ~A~%" (-> obj options)) + (label cfg-4) + obj + ) + +;; definition of type menu-qr-option +(deftype menu-qr-option (menu-option) + ((last-move uint64 :offset-assert 48) + (value-to-modify uint32 :offset 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-qr-option +(defmethod inspect menu-qr-option ((obj menu-qr-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-restart-mission-qr-option +(deftype menu-restart-mission-qr-option (menu-qr-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +;; definition for method 3 of type menu-restart-mission-qr-option +(defmethod inspect menu-restart-mission-qr-option ((obj menu-restart-mission-qr-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-quit-qr-option +(deftype menu-quit-qr-option (menu-qr-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +;; definition for method 3 of type menu-quit-qr-option +(defmethod inspect menu-quit-qr-option ((obj menu-quit-qr-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-sub-menu-qr-option +(deftype menu-sub-menu-qr-option (menu-qr-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +;; definition for method 3 of type menu-sub-menu-qr-option +(defmethod inspect menu-sub-menu-qr-option ((obj menu-sub-menu-qr-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-graphic-option +(deftype menu-graphic-option (menu-option) + ((last-move uint64 :offset-assert 48) + (value-to-modify uint32 :offset 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-graphic-option +(defmethod inspect menu-graphic-option ((obj menu-graphic-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-on-off-progressive-scan-graphic-option +(deftype menu-on-off-progressive-scan-graphic-option (menu-graphic-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-on-off-progressive-scan-graphic-option +(defmethod inspect menu-on-off-progressive-scan-graphic-option ((obj menu-on-off-progressive-scan-graphic-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-aspect-ratio-option +(deftype menu-aspect-ratio-option (menu-graphic-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-aspect-ratio-option +(defmethod inspect menu-aspect-ratio-option ((obj menu-aspect-ratio-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-center-screen-graphic-option +(deftype menu-center-screen-graphic-option (menu-graphic-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +;; definition for method 3 of type menu-center-screen-graphic-option +(defmethod inspect menu-center-screen-graphic-option ((obj menu-center-screen-graphic-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-video-mode-option +(deftype menu-video-mode-option (menu-graphic-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-video-mode-option +(defmethod inspect menu-video-mode-option ((obj menu-video-mode-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-game-option +(deftype menu-game-option (menu-option) + ((last-move uint64 :offset-assert 48) + (value-to-modify uint32 :offset 60) + ) + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-game-option +(defmethod inspect menu-game-option ((obj menu-game-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-on-off-game-vibrations-option +(deftype menu-on-off-game-vibrations-option (menu-game-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-on-off-game-vibrations-option +(defmethod inspect menu-on-off-game-vibrations-option ((obj menu-on-off-game-vibrations-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-on-off-game-subtitles-option +(deftype menu-on-off-game-subtitles-option (menu-game-option) + () + :method-count-assert 12 + :size-assert #x40 + :flag-assert #xc00000040 + ) + +;; definition for method 3 of type menu-on-off-game-subtitles-option +(defmethod inspect menu-on-off-game-subtitles-option ((obj menu-on-off-game-subtitles-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (label cfg-4) + obj + ) + +;; definition of type menu-sub-menu-game-option +(deftype menu-sub-menu-game-option (menu-game-option) + ((next-state basic :offset-assert 64) + ) + :method-count-assert 12 + :size-assert #x44 + :flag-assert #xc00000044 + ) + +;; definition for method 3 of type menu-sub-menu-game-option +(defmethod inspect menu-sub-menu-game-option ((obj menu-sub-menu-game-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tnext-state: ~A~%" (-> obj next-state)) + (label cfg-4) + obj + ) + +;; definition of type menu-language-game-option +(deftype menu-language-game-option (menu-game-option) + ((language-selection uint64 :offset-assert 64) + (language-direction basic :offset-assert 72) + (language-transition basic :offset-assert 76) + (language-x-offset int32 :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #x54 + :flag-assert #xc00000054 + ) + +;; definition for method 3 of type menu-language-game-option +(defmethod inspect menu-language-game-option ((obj menu-language-game-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tlanguage-selection: ~D~%" (-> obj language-selection)) + (format #t "~1Tlanguage-direction: ~A~%" (-> obj language-direction)) + (format #t "~1Tlanguage-transition: ~A~%" (-> obj language-transition)) + (format #t "~1Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) + (label cfg-4) + obj + ) + +;; definition of type menu-subtitle-language-game-option +(deftype menu-subtitle-language-game-option (menu-game-option) + ((language-selection uint64 :offset-assert 64) + (language-direction basic :offset-assert 72) + (language-transition basic :offset-assert 76) + (language-x-offset int32 :offset-assert 80) + ) + :method-count-assert 12 + :size-assert #x54 + :flag-assert #xc00000054 + ) + +;; definition for method 3 of type menu-subtitle-language-game-option +(defmethod inspect menu-subtitle-language-game-option ((obj menu-subtitle-language-game-option)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tscale: ~A~%" (-> obj scale)) + (format #t "~1Tbox[1] @ #x~X~%" (-> obj box)) + (format #t "~1Tlast-move: ~D~%" (-> obj last-move)) + (format #t "~1Tname: ~D~%" (-> obj name)) + (format #t "~1Tvalue-to-modify: #x~X~%" (-> obj value-to-modify)) + (format #t "~1Tlanguage-selection: ~D~%" (-> obj language-selection)) + (format #t "~1Tlanguage-direction: ~A~%" (-> obj language-direction)) + (format #t "~1Tlanguage-transition: ~A~%" (-> obj language-transition)) + (format #t "~1Tlanguage-x-offset: ~D~%" (-> obj language-x-offset)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc b/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc new file mode 100644 index 0000000000..299a092517 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/ui/text-h_REF.gc @@ -0,0 +1,72 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type game-text +(deftype game-text (structure) + ((id game-text-id :offset-assert 0) + (text string :offset-assert 4) + ) + :pack-me + :method-count-assert 9 + :size-assert #x8 + :flag-assert #x900000008 + ) + +;; definition for method 3 of type game-text +(defmethod inspect game-text ((obj game-text)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'game-text) + (format #t "~1Tid: ~D~%" (-> obj id)) + (format #t "~1Ttext: ~A~%" (-> obj text)) + (label cfg-4) + obj + ) + +;; definition of type game-text-info +(deftype game-text-info (basic) + ((length int32 :offset-assert 4) + (language-id int32 :offset-assert 8) + (group-name string :offset-assert 12) + (data game-text :dynamic :offset-assert 16) + ) + :method-count-assert 10 + :size-assert #x10 + :flag-assert #xa00000010 + (:methods + (lookup-text! (_type_ game-text-id symbol) string 9) + ) + ) + +;; definition for method 3 of type game-text-info +(defmethod inspect game-text-info ((obj game-text-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tlength: ~D~%" (-> obj length)) + (format #t "~1Tlanguage-id: ~D~%" (-> obj language-id)) + (format #t "~1Tgroup-name: ~A~%" (-> obj group-name)) + (format #t "~1Tdata[0] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for symbol *text-group-names*, type (array string) +(define *text-group-names* (the-as (array string) (new 'static 'boxed-array :type string "common"))) + +;; definition for symbol *common-text-heap*, type kheap +(define *common-text-heap* (new 'global 'kheap)) + +;; definition for symbol *common-text*, type game-text-info +(define *common-text* (the-as game-text-info #f)) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc b/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc new file mode 100644 index 0000000000..678d3f890d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/capture-h_REF.gc @@ -0,0 +1,104 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition of type gs-store-image-packet +(deftype gs-store-image-packet (structure) + ((vifcode vif-tag 4 :offset-assert 0) + (giftag gif-tag :offset-assert 16) + (bitbltbuf gs-bitbltbuf :offset-assert 32) + (bitbltbuf-addr gs-reg64 :offset-assert 40) + (trxpos gs-trxpos :offset-assert 48) + (trxpos-addr gs-reg64 :offset-assert 56) + (trxreg gs-trxreg :offset-assert 64) + (trxreg-addr gs-reg64 :offset-assert 72) + (finish int64 :offset-assert 80) + (finish-addr gs-reg64 :offset-assert 88) + (trxdir gs-trxdir :offset-assert 96) + (trxdir-addr gs-reg64 :offset-assert 104) + ) + :method-count-assert 9 + :size-assert #x70 + :flag-assert #x900000070 + ) + +;; definition for method 3 of type gs-store-image-packet +;; INFO: Used lq/sq +(defmethod inspect gs-store-image-packet ((obj gs-store-image-packet)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'gs-store-image-packet) + (format #t "~1Tvifcode[4] @ #x~X~%" (-> obj vifcode)) + (format #t "~1Tgiftag: ~D~%" (-> obj giftag)) + (format #t "~1Tbitbltbuf: ~D~%" (-> obj bitbltbuf)) + (format #t "~1Tbitbltbuf-addr: ~D~%" (-> obj bitbltbuf-addr)) + (format #t "~1Ttrxpos: ~D~%" (-> obj trxpos)) + (format #t "~1Ttrxpos-addr: ~D~%" (-> obj trxpos-addr)) + (format #t "~1Ttrxreg: ~D~%" (-> obj trxreg)) + (format #t "~1Ttrxreg-addr: ~D~%" (-> obj trxreg-addr)) + (format #t "~1Tfinish: ~D~%" (-> obj finish)) + (format #t "~1Tfinish-addr: ~D~%" (-> obj finish-addr)) + (format #t "~1Ttrxdir: ~D~%" (-> obj trxdir)) + (format #t "~1Ttrxdir-addr: ~D~%" (-> obj trxdir-addr)) + (label cfg-4) + obj + ) + +;; definition of type screen-shot-work +(deftype screen-shot-work (structure) + ((count int16 :offset-assert 0) + (size int16 :offset-assert 2) + (name basic :offset-assert 4) + (highres-enable basic :offset-assert 8) + (hud-enable basic :offset-assert 12) + ) + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type screen-shot-work +(defmethod inspect screen-shot-work ((obj screen-shot-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'screen-shot-work) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tsize: ~D~%" (-> obj size)) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Thighres-enable: ~A~%" (-> obj highres-enable)) + (format #t "~1Thud-enable: ~A~%" (-> obj hud-enable)) + (label cfg-4) + obj + ) + +;; definition for symbol *screen-shot-work*, type screen-shot-work +(define *screen-shot-work* (new 'global 'screen-shot-work)) + +;; failed to figure out what this is: +(set! (-> *screen-shot-work* count) -1) + +;; failed to figure out what this is: +(set! (-> *screen-shot-work* size) -1) + +;; failed to figure out what this is: +(set! (-> *screen-shot-work* highres-enable) #f) + +;; failed to figure out what this is: +(set! (-> *screen-shot-work* hud-enable) #f) + +;; definition for symbol *image-name*, type string +(define *image-name* (new 'global 'string 32 (the-as string #f))) + +;; failed to figure out what this is: +0 + +) + + + diff --git a/test/decompiler/reference/jak2/engine/util/capture_REF.gc b/test/decompiler/reference/jak2/engine/util/capture_REF.gc new file mode 100644 index 0000000000..776c6fad93 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/capture_REF.gc @@ -0,0 +1,61 @@ +;;-*-Lisp-*- +(in-package goal) + +;; this file is debug only +(declare-file (debug)) +(when *debug-segment* +;; definition for function gs-set-default-store-image +;; INFO: Used lq/sq +;; ERROR: Unsupported inline assembly instruction kind - [sync.l] +(defun gs-set-default-store-image ((arg0 gs-store-image-packet) (arg1 int) (arg2 int) (arg3 int) (arg4 int) (arg5 int) (arg6 int) (arg7 int)) + (set! (-> arg0 vifcode 0) (new 'static 'vif-tag)) + (set! (-> arg0 vifcode 1) (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd mskpath3))) + (set! (-> arg0 vifcode 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> arg0 vifcode 3) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> arg0 giftag) (new 'static 'gif-tag :nloop #x5 :eop #x1 :nreg #x1 :regs0 (gif-reg-id a+d))) + (set! (-> arg0 bitbltbuf) (new 'static 'gs-bitbltbuf :sbp arg1 :sbw arg2 :spsm arg3)) + (set! (-> arg0 bitbltbuf-addr) (gs-reg64 bitbltbuf)) + (set! (-> arg0 trxpos) (new 'static 'gs-trxpos :ssax arg4 :ssay arg5)) + (set! (-> arg0 trxpos-addr) (gs-reg64 trxpos)) + (set! (-> arg0 trxreg) (new 'static 'gs-trxreg :rrw arg6 :rrh arg7)) + (set! (-> arg0 trxreg-addr) (gs-reg64 trxreg)) + (set! (-> arg0 finish) 0) + (set! (-> arg0 finish-addr) (gs-reg64 finish)) + (set! (-> arg0 trxdir) (new 'static 'gs-trxdir :xdir #x1)) + (set! (-> arg0 trxdir-addr) (gs-reg64 trxdir)) + (.sync.l) + 7 + ) + +;; definition for function store-image +(defun store-image ((arg0 screen-shot-work)) + (let ((gp-0 512) + (s5-0 416) + ) + (let ((a3-0 (-> arg0 count)) + (a2-0 (-> arg0 name)) + ) + (set! (-> *image-name* data 0) (the-as uint 0)) + (format *image-name* "final/rawshots/~s-~d.raw" a2-0 a3-0) + ) + (format 0 "writing ~s~%" *image-name*) + (let ((s4-0 (new 'stack 'file-stream *image-name* 'write))) + (let ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf data))) + (let ((s2-0 (new 'static 'gs-store-image-packet))) + (gs-set-default-store-image s2-0 #x3300 (/ gp-0 64) 0 0 0 gp-0 s5-0) + (flush-cache 0) + (gs-store-image s2-0 s3-0) + ) + (sync-path 0 0) + (file-stream-write s4-0 s3-0 (the-as uint (* (* s5-0 gp-0) 4))) + ) + (file-stream-close s4-0) + ) + ) + 0 + ) + +) + + + diff --git a/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc b/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc new file mode 100644 index 0000000000..450987ec11 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/profile-h_REF.gc @@ -0,0 +1,255 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type profile-segment +(deftype profile-segment (structure) + ((name symbol :offset-assert 0) + (start-time int16 :offset-assert 4) + (end-time int16 :offset-assert 6) + (count uint8 :offset-assert 8) + (vu-count uint8 :offset-assert 9) + (depth uint16 :offset-assert 10) + (color rgba :offset-assert 12) + (code-time uint16 :offset 4) + (vu-time uint16 :offset 6) + ) + :allow-misaligned + :method-count-assert 9 + :size-assert #x10 + :flag-assert #x900000010 + ) + +;; definition for method 3 of type profile-segment +(defmethod inspect profile-segment ((obj profile-segment)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'profile-segment) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tend-time: ~D~%" (-> obj end-time)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tvu-count: ~D~%" (-> obj vu-count)) + (format #t "~1Tdepth: ~D~%" (-> obj depth)) + (format #t "~1Tcolor: #x~X~%" (-> obj color)) + (format #t "~1Tcode-time: ~D~%" (-> obj code-time)) + (format #t "~1Tvu-time: ~D~%" (-> obj vu-time)) + (label cfg-4) + obj + ) + +;; definition of type profile-collapse +(deftype profile-collapse (structure) + ((count int32 :offset-assert 0) + (data profile-segment 48 :inline :offset-assert 4) + ) + :method-count-assert 9 + :size-assert #x304 + :flag-assert #x900000304 + ) + +;; definition for method 3 of type profile-collapse +(defmethod inspect profile-collapse ((obj profile-collapse)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'profile-collapse) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tdata[48] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type profile-segment-array +(deftype profile-segment-array (basic) + ((count int16 :offset-assert 4) + (depth int8 :offset-assert 6) + (max-depth int8 :offset-assert 7) + (base-time int16 :offset-assert 8) + (segment profile-segment 9 :offset-assert 12) + (data profile-segment 512 :inline :offset-assert 48) + ) + :method-count-assert 13 + :size-assert #x2030 + :flag-assert #xd00002030 + (:methods + (get-total-time (_type_) int 9) + (start-frame! (_type_) none 10) + (start-segment! (_type_ symbol rgba) none 11) + (end-segment! (_type_) none 12) + ) + ) + +;; definition for method 3 of type profile-segment-array +(defmethod inspect profile-segment-array ((obj profile-segment-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcount: ~D~%" (-> obj count)) + (format #t "~1Tdepth: ~D~%" (-> obj depth)) + (format #t "~1Tmax-depth: ~D~%" (-> obj max-depth)) + (format #t "~1Tbase-time: ~D~%" (-> obj base-time)) + (format #t "~1Tsegment[9] @ #x~X~%" (-> obj segment)) + (format #t "~1Tdata[512] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition of type profile-array +(deftype profile-array (structure) + ((data profile-segment-array 2 :offset-assert 0) + ) + :method-count-assert 12 + :size-assert #x8 + :flag-assert #xc00000008 + (:methods + (setup-categories! (_type_) none 9) + (draw-bars! (_type_ dma-buffer int) none 10) + (draw-text! (_type_) none 11) + ) + ) + +;; definition for method 3 of type profile-array +(defmethod inspect profile-array ((obj profile-array)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'profile-array) + (format #t "~1Tdata[2] @ #x~X~%" (-> obj data)) + (label cfg-4) + obj + ) + +;; definition for method 9 of type profile-segment-array +(defmethod get-total-time profile-segment-array ((obj profile-segment-array)) + (- (-> obj data 0 end-time) (-> obj data 0 start-time)) + ) + +;; definition for symbol *profile-gap-color*, type rgba +(define *profile-gap-color* (new 'static 'rgba :r #x30 :g #x30 :b #x30 :a #x80)) + +;; definition for symbol *profile-all-color*, type rgba +(define *profile-all-color* (new 'static 'rgba :r #x55 :g #x55 :b #x55 :a #x80)) + +;; definition for symbol *profile-particles-color*, type rgba +(define *profile-particles-color* (new 'static 'rgba :r #x80 :g #x40 :b #x40 :a #x80)) + +;; definition for symbol *profile-target-color*, type rgba +(define *profile-target-color* (new 'static 'rgba :r #x40 :g #x80 :b #x40 :a #x80)) + +;; definition for symbol *profile-target-post-color*, type rgba +(define *profile-target-post-color* (new 'static 'rgba :r #x40 :g #x40 :b #x80 :a #x80)) + +;; definition for symbol *profile-joints-color*, type rgba +(define *profile-joints-color* (new 'static 'rgba :r #x70 :g #x70 :b #x20 :a #x80)) + +;; definition for symbol *profile-debug-color*, type rgba +(define *profile-debug-color* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *profile-draw-hook-color*, type rgba +(define *profile-draw-hook-color* (new 'static 'rgba :r #x20 :g #x70 :b #x70 :a #x80)) + +;; definition for symbol *profile-sky-color*, type rgba +(define *profile-sky-color* (new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)) + +;; definition for symbol *profile-ocean-color*, type rgba +(define *profile-ocean-color* (new 'static 'rgba :r #x60 :g #x80 :b #x20 :a #x80)) + +;; definition for symbol *profile-background-color*, type rgba +(define *profile-background-color* (new 'static 'rgba :r #x60 :g #x60 :b #x40 :a #x80)) + +;; definition for symbol *profile-bsp-color*, type rgba +(define *profile-bsp-color* (new 'static 'rgba :r #x60 :g #x40 :b #x60 :a #x80)) + +;; definition for symbol *profile-foreground-color*, type rgba +(define *profile-foreground-color* (new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)) + +;; definition for symbol *profile-tfrag-color*, type rgba +(define *profile-tfrag-color* (new 'static 'rgba :r #x80 :g #x80 :a #x80)) + +;; definition for symbol *profile-instance-tie-color*, type rgba +(define *profile-instance-tie-color* (new 'static 'rgba :r #x80 :b #x80 :a #x80)) + +;; definition for symbol *profile-instance-shrubbery-color*, type rgba +(define *profile-instance-shrubbery-color* (new 'static 'rgba :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *profile-generic-tie-color*, type rgba +(define *profile-generic-tie-color* (new 'static 'rgba :r #x80 :g #x20 :b #x60 :a #x80)) + +;; definition for symbol *profile-bones-color*, type rgba +(define *profile-bones-color* (new 'static 'rgba :r #x20 :g #x80 :b #x60 :a #x80)) + +;; definition for symbol *profile-generic-merc-color*, type rgba +(define *profile-generic-merc-color* (new 'static 'rgba :r #x20 :g #x60 :b #x80 :a #x80)) + +;; definition for symbol *profile-shadow-color*, type rgba +(define *profile-shadow-color* (new 'static 'rgba :r #x48 :g #x48 :b #x70 :a #x80)) + +;; definition for symbol *profile-update-actors-color*, type rgba +(define *profile-update-actors-color* (new 'static 'rgba :r #x48 :g #x70 :b #x48 :a #x80)) + +;; definition for symbol *profile-menu-hook-color*, type rgba +(define *profile-menu-hook-color* (new 'static 'rgba :r #x70 :g #x48 :b #x48 :a #x80)) + +;; definition for symbol *profile-texture-color*, type rgba +(define *profile-texture-color* (new 'static 'rgba :r #x80 :g #x70 :b #x10 :a #x80)) + +;; definition for symbol *profile-effects-color*, type rgba +(define *profile-effects-color* (new 'static 'rgba :r #x70 :g #x80 :b #x10 :a #x80)) + +;; definition for symbol *profile-sprite-color*, type rgba +(define *profile-sprite-color* (new 'static 'rgba :r #x70 :g #x10 :b #x80 :a #x80)) + +;; definition for symbol *profile-merc-color*, type rgba +(define *profile-merc-color* (new 'static 'rgba :r #x10 :g #x70 :b #x80 :a #x80)) + +;; definition for symbol *profile-actors-color*, type rgba +(define *profile-actors-color* (new 'static 'rgba :r #x80 :g #x10 :b #x70 :a #x80)) + +;; definition for symbol *profile-collide-color*, type rgba +(define *profile-collide-color* (new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)) + +;; definition for symbol *profile-nav-color*, type rgba +(define *profile-nav-color* (new 'static 'rgba :r #x38 :g #x48 :b #x80 :a #x80)) + +;; definition for symbol *profile-camera-color*, type rgba +(define *profile-camera-color* (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)) + +;; definition for symbol *profile-blit-color*, type rgba +(define *profile-blit-color* (new 'static 'rgba :r #xff :g #xff :b #x80 :a #x80)) + +;; definition for symbol *profile-hud-color*, type rgba +(define *profile-hud-color* (new 'static 'rgba :r #xff :g #x80 :b #xff :a #x80)) + +;; definition for symbol *profile-emerc-color*, type rgba +(define *profile-emerc-color* (new 'static 'rgba :r #x80 :g #xff :b #xff :a #x80)) + +;; this part is debug only +(when *debug-segment* +;; definition for symbol *profile-array*, type profile-array +(define *profile-array* (new 'debug 'profile-array)) + +;; failed to figure out what this is: +(set! (-> *profile-array* data 0) (new 'debug 'profile-segment-array)) + +;; failed to figure out what this is: +(set! (-> *profile-array* data 1) (new 'debug 'profile-segment-array)) + +;; definition for symbol *profile-collapse*, type profile-collapse +(define *profile-collapse* (new 'debug 'profile-collapse)) + +;; definition for symbol *profile-interrupt-segment*, type profile-segment-array +(define *profile-interrupt-segment* (-> *profile-array* data 1)) + +;; definition for symbol *profile-interrupt-start*, type symbol +(define *profile-interrupt-start* #f) + +) + + + diff --git a/test/decompiler/reference/jak2/engine/util/profile_REF.gc b/test/decompiler/reference/jak2/engine/util/profile_REF.gc new file mode 100644 index 0000000000..6d4a85ec93 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/profile_REF.gc @@ -0,0 +1,814 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type profile-work +(deftype profile-work (structure) + ((sprite-tmpl dma-gif-packet :inline :offset-assert 0) + (line-tmpl dma-gif-packet :inline :offset-assert 32) + (last-index int32 :offset-assert 64) + ) + :method-count-assert 9 + :size-assert #x44 + :flag-assert #x900000044 + ) + +;; definition for method 3 of type profile-work +(defmethod inspect profile-work ((obj profile-work)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'profile-work) + (format #t "~1Tsprite-tmpl: #~%" (-> obj sprite-tmpl)) + (format #t "~1Tline-tmpl: #~%" (-> obj line-tmpl)) + (format #t "~1Tlast-index: ~D~%" (-> obj last-index)) + (label cfg-4) + obj + ) + +;; definition for symbol *profile-work*, type profile-work +(define *profile-work* (new 'static 'profile-work + :sprite-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x3023400000008001 #x551) + ) + :line-tmpl (new 'static 'dma-gif-packet + :dma-vif (new 'static 'dma-packet + :dma (new 'static 'dma-tag :qwc #x4 :id (dma-tag-id cnt)) + :vif1 (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd direct) :msk #x1) + ) + :gif (new 'static 'array uint64 2 #x3020c00000008001 #x551) + ) + ) + ) + +;; definition for symbol *profile-x*, type int +(define *profile-x* 1808) + +;; definition for symbol *profile-y*, type int +(define *profile-y* 1848) + +;; definition for symbol *profile-w*, type int +(define *profile-w* 416) + +;; definition for symbol *profile-h*, type int +(define *profile-h* 8) + +;; definition for symbol *profile-ticks*, type symbol +(define *profile-ticks* #f) + +;; definition for method 10 of type profile-segment-array +;; INFO: Return type mismatch int vs none. +(defmethod start-frame! profile-segment-array ((obj profile-segment-array)) + (set! (-> obj count) 0) + (set! (-> obj depth) 0) + (set! (-> obj max-depth) 0) + (set! (-> obj base-time) (the-as int (timer-count (the-as timer-bank #x10000800)))) + (start-segment! obj 'all *profile-all-color*) + 0 + (none) + ) + +;; definition for method 11 of type profile-segment-array +;; INFO: Return type mismatch int vs none. +(defmethod start-segment! profile-segment-array ((obj profile-segment-array) (arg0 symbol) (arg1 rgba)) + (when (and *dproc* *debug-segment*) + (let ((s4-0 (-> obj data (-> obj count)))) + (let ((s3-0 (-> obj base-time))) + (set! (-> s4-0 name) arg0) + (set! (-> s4-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-0)))) + ) + (set! (-> s4-0 depth) (the-as uint (-> obj depth))) + (set! (-> s4-0 color) arg1) + (set! (-> obj segment (-> obj depth)) s4-0) + ) + (+! (-> obj count) 1) + (+! (-> obj depth) 1) + (set! (-> obj max-depth) (max (-> obj max-depth) (-> obj depth))) + ) + 0 + (none) + ) + +;; definition for method 12 of type profile-segment-array +;; INFO: Return type mismatch int vs none. +(defmethod end-segment! profile-segment-array ((obj profile-segment-array)) + (when (and *dproc* *debug-segment*) + (let* ((v1-4 (+ (-> obj depth) -1)) + (s5-0 (-> obj segment v1-4)) + (s4-0 (-> obj base-time)) + ) + (when (>= v1-4 0) + (set! (-> s5-0 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-0)))) + (+! (-> obj depth) -1) + ) + ) + ) + 0 + (none) + ) + +;; definition for function profile-texture-test +(defun profile-texture-test ((arg0 bucket-id)) + (or (= arg0 (bucket-id bucket-4)) + (= arg0 (bucket-id bucket-7)) + (= arg0 (bucket-id bucket-18)) + (= arg0 (bucket-id bucket-29)) + (= arg0 (bucket-id bucket-40)) + (= arg0 (bucket-id bucket-51)) + (= arg0 (bucket-id bucket-62)) + (= arg0 (bucket-id bucket-73)) + (= arg0 (bucket-id bucket-82)) + (= arg0 (bucket-id bucket-91)) + (= arg0 (bucket-id bucket-100)) + (= arg0 (bucket-id bucket-109)) + (= arg0 (bucket-id bucket-118)) + (= arg0 (bucket-id bucket-127)) + (= arg0 (bucket-id bucket-137)) + (= arg0 (bucket-id bucket-147)) + (= arg0 (bucket-id bucket-157)) + (= arg0 (bucket-id bucket-167)) + (= arg0 (bucket-id bucket-177)) + (= arg0 (bucket-id bucket-187)) + (= arg0 (bucket-id bucket-196)) + (= arg0 (bucket-id bucket-200)) + (= arg0 (bucket-id bucket-204)) + (= arg0 (bucket-id bucket-208)) + (= arg0 (bucket-id bucket-212)) + (= arg0 (bucket-id bucket-216)) + (= arg0 (bucket-id bucket-220)) + (= arg0 (bucket-id bucket-252)) + (= arg0 (bucket-id bucket-261)) + (= arg0 (bucket-id bucket-270)) + (= arg0 (bucket-id bucket-279)) + (= arg0 (bucket-id bucket-288)) + (= arg0 (bucket-id bucket-297)) + (= arg0 (bucket-id bucket-306)) + (= arg0 (bucket-id bucket-312)) + (= arg0 (bucket-id bucket-316)) + (= arg0 (bucket-id bucket-319)) + ) + ) + +;; definition for function profile-tfrag-test +(defun profile-tfrag-test ((arg0 bucket-id)) + (or (= arg0 (bucket-id bucket-8)) + (= arg0 (bucket-id bucket-19)) + (= arg0 (bucket-id bucket-30)) + (= arg0 (bucket-id bucket-41)) + (= arg0 (bucket-id bucket-52)) + (= arg0 (bucket-id bucket-63)) + (= arg0 (bucket-id bucket-11)) + (= arg0 (bucket-id bucket-22)) + (= arg0 (bucket-id bucket-33)) + (= arg0 (bucket-id bucket-44)) + (= arg0 (bucket-id bucket-55)) + (= arg0 (bucket-id bucket-66)) + (= arg0 (bucket-id bucket-128)) + (= arg0 (bucket-id bucket-138)) + (= arg0 (bucket-id bucket-148)) + (= arg0 (bucket-id bucket-158)) + (= arg0 (bucket-id bucket-168)) + (= arg0 (bucket-id bucket-178)) + (= arg0 (bucket-id bucket-255)) + (= arg0 (bucket-id bucket-264)) + (= arg0 (bucket-id bucket-273)) + (= arg0 (bucket-id bucket-282)) + (= arg0 (bucket-id bucket-291)) + (= arg0 (bucket-id bucket-300)) + (= arg0 (bucket-id bucket-134)) + (= arg0 (bucket-id bucket-144)) + (= arg0 (bucket-id bucket-154)) + (= arg0 (bucket-id bucket-164)) + (= arg0 (bucket-id bucket-174)) + (= arg0 (bucket-id bucket-184)) + (= arg0 (bucket-id bucket-259)) + (= arg0 (bucket-id bucket-268)) + (= arg0 (bucket-id bucket-277)) + (= arg0 (bucket-id bucket-286)) + (= arg0 (bucket-id bucket-295)) + (= arg0 (bucket-id bucket-304)) + ) + ) + +;; definition for function profile-tie-test +(defun profile-tie-test ((arg0 bucket-id)) + (or (= arg0 (bucket-id bucket-9)) + (= arg0 (bucket-id bucket-20)) + (= arg0 (bucket-id bucket-31)) + (= arg0 (bucket-id bucket-42)) + (= arg0 (bucket-id bucket-53)) + (= arg0 (bucket-id bucket-64)) + (= arg0 (bucket-id bucket-10)) + (= arg0 (bucket-id bucket-21)) + (= arg0 (bucket-id bucket-32)) + (= arg0 (bucket-id bucket-43)) + (= arg0 (bucket-id bucket-54)) + (= arg0 (bucket-id bucket-65)) + (= arg0 (bucket-id bucket-12)) + (= arg0 (bucket-id bucket-23)) + (= arg0 (bucket-id bucket-34)) + (= arg0 (bucket-id bucket-45)) + (= arg0 (bucket-id bucket-56)) + (= arg0 (bucket-id bucket-67)) + (= arg0 (bucket-id bucket-13)) + (= arg0 (bucket-id bucket-24)) + (= arg0 (bucket-id bucket-35)) + (= arg0 (bucket-id bucket-46)) + (= arg0 (bucket-id bucket-57)) + (= arg0 (bucket-id bucket-68)) + (= arg0 (bucket-id bucket-17)) + (= arg0 (bucket-id bucket-28)) + (= arg0 (bucket-id bucket-39)) + (= arg0 (bucket-id bucket-50)) + (= arg0 (bucket-id bucket-61)) + (= arg0 (bucket-id bucket-72)) + (= arg0 (bucket-id bucket-129)) + (= arg0 (bucket-id bucket-139)) + (= arg0 (bucket-id bucket-149)) + (= arg0 (bucket-id bucket-159)) + (= arg0 (bucket-id bucket-169)) + (= arg0 (bucket-id bucket-179)) + (= arg0 (bucket-id bucket-130)) + (= arg0 (bucket-id bucket-140)) + (= arg0 (bucket-id bucket-150)) + (= arg0 (bucket-id bucket-160)) + (= arg0 (bucket-id bucket-170)) + (= arg0 (bucket-id bucket-180)) + (= arg0 (bucket-id bucket-135)) + (= arg0 (bucket-id bucket-145)) + (= arg0 (bucket-id bucket-155)) + (= arg0 (bucket-id bucket-165)) + (= arg0 (bucket-id bucket-175)) + (= arg0 (bucket-id bucket-185)) + (= arg0 (bucket-id bucket-136)) + (= arg0 (bucket-id bucket-146)) + (= arg0 (bucket-id bucket-156)) + (= arg0 (bucket-id bucket-166)) + (= arg0 (bucket-id bucket-176)) + (= arg0 (bucket-id bucket-186)) + ) + ) + +;; definition for function profile-merc-test +(defun profile-merc-test ((arg0 bucket-id)) + (or (= arg0 (bucket-id bucket-14)) + (= arg0 (bucket-id bucket-25)) + (= arg0 (bucket-id bucket-36)) + (= arg0 (bucket-id bucket-47)) + (= arg0 (bucket-id bucket-58)) + (= arg0 (bucket-id bucket-69)) + (= arg0 (bucket-id bucket-79)) + (= arg0 (bucket-id bucket-88)) + (= arg0 (bucket-id bucket-97)) + (= arg0 (bucket-id bucket-106)) + (= arg0 (bucket-id bucket-115)) + (= arg0 (bucket-id bucket-124)) + (= arg0 (bucket-id bucket-131)) + (= arg0 (bucket-id bucket-141)) + (= arg0 (bucket-id bucket-151)) + (= arg0 (bucket-id bucket-161)) + (= arg0 (bucket-id bucket-171)) + (= arg0 (bucket-id bucket-181)) + (= arg0 (bucket-id bucket-188)) + (= arg0 (bucket-id bucket-192)) + (= arg0 (bucket-id bucket-197)) + (= arg0 (bucket-id bucket-201)) + (= arg0 (bucket-id bucket-205)) + (= arg0 (bucket-id bucket-209)) + (= arg0 (bucket-id bucket-213)) + (= arg0 (bucket-id bucket-217)) + (= arg0 (bucket-id bucket-221)) + (= arg0 (bucket-id bucket-225)) + (= arg0 (bucket-id bucket-229)) + (= arg0 (bucket-id bucket-233)) + (= arg0 (bucket-id bucket-237)) + (= arg0 (bucket-id bucket-241)) + (= arg0 (bucket-id bucket-245)) + (= arg0 (bucket-id bucket-249)) + (= arg0 (bucket-id bucket-253)) + (= arg0 (bucket-id bucket-262)) + (= arg0 (bucket-id bucket-271)) + (= arg0 (bucket-id bucket-280)) + (= arg0 (bucket-id bucket-289)) + (= arg0 (bucket-id bucket-298)) + (= arg0 (bucket-id bucket-307)) + ) + ) + +;; definition for function profile-emerc-test +(defun profile-emerc-test ((arg0 bucket-id)) + (or (= arg0 (bucket-id bucket-15)) + (= arg0 (bucket-id bucket-26)) + (= arg0 (bucket-id bucket-37)) + (= arg0 (bucket-id bucket-48)) + (= arg0 (bucket-id bucket-59)) + (= arg0 (bucket-id bucket-70)) + (= arg0 (bucket-id bucket-80)) + (= arg0 (bucket-id bucket-89)) + (= arg0 (bucket-id bucket-98)) + (= arg0 (bucket-id bucket-107)) + (= arg0 (bucket-id bucket-116)) + (= arg0 (bucket-id bucket-125)) + (= arg0 (bucket-id bucket-132)) + (= arg0 (bucket-id bucket-142)) + (= arg0 (bucket-id bucket-152)) + (= arg0 (bucket-id bucket-162)) + (= arg0 (bucket-id bucket-172)) + (= arg0 (bucket-id bucket-182)) + (= arg0 (bucket-id bucket-189)) + (= arg0 (bucket-id bucket-193)) + (= arg0 (bucket-id bucket-198)) + (= arg0 (bucket-id bucket-202)) + (= arg0 (bucket-id bucket-206)) + (= arg0 (bucket-id bucket-210)) + (= arg0 (bucket-id bucket-214)) + (= arg0 (bucket-id bucket-218)) + (= arg0 (bucket-id bucket-222)) + (= arg0 (bucket-id bucket-226)) + (= arg0 (bucket-id bucket-230)) + (= arg0 (bucket-id bucket-234)) + (= arg0 (bucket-id bucket-238)) + (= arg0 (bucket-id bucket-242)) + (= arg0 (bucket-id bucket-246)) + (= arg0 (bucket-id bucket-250)) + ) + ) + +;; definition for function profile-mercneric-test +(defun profile-mercneric-test ((arg0 bucket-id)) + (or (= arg0 (bucket-id bucket-16)) + (= arg0 (bucket-id bucket-27)) + (= arg0 (bucket-id bucket-38)) + (= arg0 (bucket-id bucket-49)) + (= arg0 (bucket-id bucket-60)) + (= arg0 (bucket-id bucket-71)) + (= arg0 (bucket-id bucket-81)) + (= arg0 (bucket-id bucket-90)) + (= arg0 (bucket-id bucket-99)) + (= arg0 (bucket-id bucket-108)) + (= arg0 (bucket-id bucket-117)) + (= arg0 (bucket-id bucket-126)) + (= arg0 (bucket-id bucket-133)) + (= arg0 (bucket-id bucket-143)) + (= arg0 (bucket-id bucket-153)) + (= arg0 (bucket-id bucket-163)) + (= arg0 (bucket-id bucket-173)) + (= arg0 (bucket-id bucket-183)) + (= arg0 (bucket-id bucket-190)) + (= arg0 (bucket-id bucket-194)) + (= arg0 (bucket-id bucket-199)) + (= arg0 (bucket-id bucket-203)) + (= arg0 (bucket-id bucket-207)) + (= arg0 (bucket-id bucket-211)) + (= arg0 (bucket-id bucket-215)) + (= arg0 (bucket-id bucket-219)) + (= arg0 (bucket-id bucket-223)) + (= arg0 (bucket-id bucket-227)) + (= arg0 (bucket-id bucket-231)) + (= arg0 (bucket-id bucket-235)) + (= arg0 (bucket-id bucket-239)) + (= arg0 (bucket-id bucket-243)) + (= arg0 (bucket-id bucket-247)) + (= arg0 (bucket-id bucket-251)) + (= arg0 (bucket-id bucket-254)) + (= arg0 (bucket-id bucket-263)) + (= arg0 (bucket-id bucket-272)) + (= arg0 (bucket-id bucket-281)) + (= arg0 (bucket-id bucket-290)) + (= arg0 (bucket-id bucket-299)) + (= arg0 (bucket-id bucket-308)) + (= arg0 (bucket-id bucket-317)) + ) + ) + +;; definition for method 9 of type profile-array +;; INFO: Return type mismatch int vs none. +(defmethod setup-categories! profile-array ((obj profile-array)) + (dotimes (s5-0 2) + (let ((s3-0 (-> *profile-array* data s5-0)) + (s4-0 *profile-collapse*) + ) + (mem-copy! (&-> s3-0 type) (&-> (-> obj data s5-0) type) 8240) + (cond + ((zero? s5-0) + ((lambda ((arg0 profile-segment-array) (arg1 profile-collapse)) + (let ((v0-0 0)) + (dotimes (v1-0 48) + (set! (-> arg1 data v1-0 name) #f) + (set! (-> arg1 data v1-0 count) (the-as uint 0)) + (set! (-> arg1 data v1-0 vu-count) (the-as uint 0)) + (set! (-> arg1 data v1-0 depth) (the-as uint 0)) + (set! (-> arg1 data v1-0 start-time) 0) + (set! (-> arg1 data v1-0 end-time) 0) + ) + (dotimes (v1-3 (-> arg0 count)) + (let ((a2-15 (- (-> arg0 data v1-3 end-time) (-> arg0 data v1-3 start-time)))) + (let ((t0-0 (-> arg0 data v1-3 name))) + (dotimes (a3-5 v0-0) + (when (= (-> arg1 data a3-5 name) t0-0) + (+! (-> arg1 data a3-5 count) 1) + (set! (-> arg1 data a3-5 start-time) (the-as int (+ (-> arg1 data a3-5 code-time) a2-15))) + (goto cfg-11) + ) + ) + (set! (-> arg1 data v0-0 name) t0-0) + ) + (set! (-> arg1 data v0-0 count) (the-as uint 1)) + (set! (-> arg1 data v0-0 depth) (-> arg0 data v1-3 depth)) + (set! (-> arg1 data v0-0 start-time) a2-15) + ) + (set! (-> arg1 data v0-0 color) (-> arg0 data v1-3 color)) + (set! v0-0 (min 47 (+ v0-0 1))) + (label cfg-11) + ) + (set! (-> arg1 count) v0-0) + ) + (none) + ) + s3-0 + s4-0 + ) + ) + (else + (let ((s2-0 3) + (s1-0 (+ (-> s3-0 count) -1)) + ) + (while (>= s1-0 s2-0) + (let ((s0-0 (-> s3-0 data s2-0))) + (cond + ((= s2-0 3) + (set! (-> s0-0 name) 'blit-displays) + (set! (-> s0-0 color) *profile-blit-color*) + ) + ((= s2-0 5) + (set! (-> s0-0 name) 'sky) + (set! (-> s0-0 color) *profile-sky-color*) + ) + ((or (= s2-0 6) (= s2-0 310)) + (set! (-> s0-0 name) 'ocean) + (set! (-> s0-0 color) *profile-ocean-color*) + ) + ((profile-texture-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'texture) + (set! (-> s0-0 color) *profile-texture-color*) + ) + ((profile-tfrag-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'tfrag) + (set! (-> s0-0 color) *profile-tfrag-color*) + ) + ((profile-tie-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'instance-tie) + (set! (-> s0-0 color) *profile-instance-tie-color*) + ) + ((profile-merc-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'merc) + (set! (-> s0-0 color) *profile-merc-color*) + ) + ((profile-emerc-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'emerc) + (set! (-> s0-0 color) *profile-emerc-color*) + ) + ((profile-mercneric-test (the-as bucket-id s2-0)) + (set! (-> s0-0 name) 'generic-merc) + (set! (-> s0-0 color) *profile-generic-merc-color*) + ) + ((or (and (>= s2-0 74) (>= 78 s2-0)) + (and (>= s2-0 83) (>= 87 s2-0)) + (and (>= s2-0 92) (>= 96 s2-0)) + (and (>= s2-0 101) (>= 105 s2-0)) + (and (>= s2-0 110) (>= 114 s2-0)) + (and (>= s2-0 119) (>= 123 s2-0)) + ) + (set! (-> s0-0 name) 'instance-shrubbery) + (set! (-> s0-0 color) *profile-instance-shrubbery-color*) + ) + ((or (= s2-0 195) (= s2-0 314)) + (set! (-> s0-0 name) 'shadow) + (set! (-> s0-0 color) *profile-shadow-color*) + ) + ((= s2-0 313) + (set! (-> s0-0 name) 'particles) + (set! (-> s0-0 color) *profile-particles-color*) + ) + ((or (= s2-0 324) (= s2-0 325) (= s2-0 318) (= s2-0 326)) + (set! (-> s0-0 name) 'debug) + (set! (-> s0-0 color) *profile-debug-color*) + ) + ((= s2-0 311) + (set! (-> s0-0 name) 'depth-cue) + (set! (-> s0-0 color) *profile-blit-color*) + ) + ((= s2-0 315) + (set! (-> s0-0 name) 'effects) + (set! (-> s0-0 color) *profile-effects-color*) + ) + ((or (= s2-0 320) (= s2-0 321) (= s2-0 322) (= s2-0 323)) + (set! (-> s0-0 name) 'hud) + (set! (-> s0-0 color) *profile-hud-color*) + ) + ) + (let ((v1-87 (- (-> s0-0 end-time) (-> s0-0 start-time))) + (a1-2 (-> s0-0 name)) + ) + (dotimes (a0-29 (-> s4-0 count)) + (when (= (-> s4-0 data a0-29 name) a1-2) + (+! (-> s4-0 data a0-29 vu-count) 1) + (set! (-> s4-0 data a0-29 end-time) (the-as int (+ (-> s4-0 data a0-29 vu-time) v1-87))) + (goto cfg-91) + ) + ) + ) + ) + (label cfg-91) + (+! s2-0 1) + ) + ) + (countdown (v1-94 (-> s3-0 count)) + (when (nonzero? (-> s3-0 data v1-94 end-time)) + (set! (-> s4-0 data 0 vu-count) (the-as uint 1)) + (set! (-> s4-0 data 0 end-time) (- (-> s3-0 data v1-94 end-time) (-> s3-0 data 0 start-time))) + (goto cfg-99) + ) + ) + ) + ) + ) + (label cfg-99) + ) + 0 + (none) + ) + +;; definition for method 10 of type profile-array +;; INFO: Used lq/sq +;; INFO: Return type mismatch int vs none. +(defmethod draw-bars! profile-array ((obj profile-array) (arg0 dma-buffer) (arg1 int)) + (local-vars (sv-16 (function _varargs_ object)) (sv-32 (function _varargs_ object))) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x9)) + (set! (-> (the-as gs-gif-tag a0-3) regs) (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-1 base) (&+ (the-as pointer a0-3) 16)) + ) + (let* ((v1-2 arg0) + (a0-5 (-> v1-2 base)) + ) + (set! (-> (the-as (pointer gs-alpha) a0-5) 0) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 alpha-1)) + (set! (-> (the-as (pointer gs-zbuf) a0-5) 2) (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24) :zmsk #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 3) (gs-reg64 zbuf-1)) + (set! (-> (the-as (pointer gs-test) a0-5) 4) (new 'static 'gs-test :zte #x1 :ztst (gs-ztest always))) + (set! (-> (the-as (pointer gs-reg64) a0-5) 5) (gs-reg64 test-1)) + (set! (-> (the-as (pointer uint64) a0-5) 6) (the-as uint 0)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 7) (gs-reg64 pabe)) + (set! (-> (the-as (pointer gs-clamp) a0-5) 8) + (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-5) 9) (gs-reg64 clamp-1)) + (set! (-> (the-as (pointer gs-tex1) a0-5) 10) (new 'static 'gs-tex1 :mmag #x1 :mmin #x1)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 11) (gs-reg64 tex1-1)) + (set! (-> (the-as (pointer gs-texa) a0-5) 12) (new 'static 'gs-texa :ta1 #x80)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 13) (gs-reg64 texa)) + (set! (-> (the-as (pointer gs-texclut) a0-5) 14) (new 'static 'gs-texclut :cbw #x4)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 15) (gs-reg64 texclut)) + (set! (-> (the-as (pointer uint64) a0-5) 16) (the-as uint *fog-color*)) + (set! (-> (the-as (pointer gs-reg64) a0-5) 17) (gs-reg64 fogcol)) + (set! (-> v1-2 base) (&+ a0-5 144)) + ) + (let ((v1-5 (* (+ *profile-x* (/ *profile-w* 2)) 16)) + (a0-9 (-> arg0 base)) + ) + (set! (-> (the-as (pointer uint128) a0-9) 0) (-> *profile-work* line-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) a0-9) 1) (-> *profile-work* line-tmpl quad 1)) + (set-vector! (the-as vector4w (&+ a0-9 32)) 64 64 64 64) + (set-vector! (the-as vector4w (&+ a0-9 48)) v1-5 #x7340 #xffffff 0) + (set-vector! (the-as vector4w (&+ a0-9 64)) v1-5 #x7580 #xffffff 0) + ) + (&+! (-> arg0 base) 80) + (dotimes (s3-0 2) + (let* ((v1-12 (-> obj data s3-0)) + (a0-11 (-> v1-12 max-depth)) + (s2-1 (max 14 (* a0-11 2))) + ) + (set! *profile-y* (+ arg1 1840)) + (let ((a1-32 (-> arg0 base))) + (set! (-> (the-as (pointer uint128) a1-32) 0) (-> *profile-work* sprite-tmpl dma-vif quad)) + (set! (-> (the-as (pointer uint128) a1-32) 1) (-> *profile-work* sprite-tmpl quad 1)) + (set-vector! (the-as vector4w (&+ a1-32 32)) 64 64 64 64) + (set-vector! (the-as vector4w (&+ a1-32 48)) (* *profile-x* 16) (* *profile-y* 16) #xffffff 0) + (set-vector! + (the-as vector4w (&+ a1-32 64)) + (* (+ *profile-x* *profile-w*) 16) + (* (+ *profile-y* s2-1) 16) + #xffffff + 0 + ) + ) + (&+! (-> arg0 base) 80) + (let ((a0-12 (/ s2-1 a0-11))) + (dotimes (a1-36 (+ (-> v1-12 count) -1)) + (let ((a2-22 (-> v1-12 data a1-36))) + (when (< (-> a2-22 start-time) (-> a2-22 end-time)) + (let* ((t0-1 (* *ticks-per-frame* 2)) + (a3-15 (* (+ *profile-x* (/ (* (-> a2-22 start-time) *profile-w*) t0-1)) 16)) + (t0-4 (* (+ *profile-x* (/ (* (-> a2-22 end-time) *profile-w*) t0-1)) 16)) + (t3-1 (* (+ arg1 1840 (* (-> a2-22 depth) (the-as uint a0-12))) 16)) + (t1-7 (+ t3-1 (* a0-12 16))) + (t2-5 (-> arg0 base)) + ) + (set! (-> (the-as (pointer int128) t2-5) 0) (the-as int128 (-> *profile-work* sprite-tmpl dma-vif quad))) + (set! (-> (the-as (pointer int128) t2-5) 1) (the-as int128 (-> *profile-work* sprite-tmpl quad 1))) + (set-vector! + (the-as vector4w (&+ t2-5 32)) + (the int (* 1.9921875 (the float (-> a2-22 color r)))) + (the int (* 1.9921875 (the float (-> a2-22 color g)))) + (the int (* 1.9921875 (the float (-> a2-22 color b)))) + (the-as int (-> a2-22 color a)) + ) + (set-vector! (the-as vector4w (&+ t2-5 48)) a3-15 t3-1 #xffffff 0) + (set-vector! (the-as vector4w (&+ t2-5 64)) t0-4 t1-7 #xffffff 0) + ) + (&+! (-> arg0 base) 80) + ) + ) + ) + ) + (cond + ((zero? s3-0) + (let* ((s1-0 (-> v1-12 data 0 end-time)) + (f30-0 (* 100.0 (/ (the float s1-0) (the float *ticks-per-frame*)))) + ) + (cond + (*profile-ticks* + (let ((s0-0 draw-string-xy)) + (set! sv-16 format) + (let ((a0-16 (clear *temp-string*)) + (a1-37 "~5D") + ) + (sv-16 a0-16 a1-37 s1-0) + ) + (s0-0 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-0 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + (else + (let ((s1-1 draw-string-xy)) + (format (clear *temp-string*) "~5,,2f" f30-0) + (s1-1 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-0 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + ) + ) + ) + (else + (let ((s1-2 0)) + (countdown (a0-21 (-> v1-12 count)) + (when (nonzero? (-> v1-12 data a0-21 end-time)) + (set! s1-2 (- (-> v1-12 data a0-21 end-time) (-> v1-12 data 0 start-time))) + (goto cfg-23) + ) + ) + (label cfg-23) + (let ((f30-1 (* 100.0 (/ (the float s1-2) (the float *ticks-per-frame*))))) + (cond + (*profile-ticks* + (let ((s0-2 draw-string-xy)) + (set! sv-32 format) + (let ((a0-26 (clear *temp-string*)) + (a1-45 "~5D") + ) + (sv-32 a0-26 a1-45 s1-2) + ) + (s0-2 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-1 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + (else + (let ((s1-3 draw-string-xy)) + (format (clear *temp-string*) "~5,,2f" f30-1) + (s1-3 + *temp-string* + arg0 + 488 + arg1 + (the-as font-color (if (>= f30-1 100.0) + 3 + 0 + ) + ) + (font-flags shadow right) + ) + ) + ) + ) + ) + ) + ) + ) + (set! arg1 (+ s2-1 2 arg1)) + ) + ) + (none) + ) + +;; definition for method 11 of type profile-array +;; INFO: Return type mismatch int vs none. +(defmethod draw-text! profile-array ((obj profile-array)) + (let ((gp-0 *profile-collapse*)) + (dotimes (s5-0 (-> gp-0 count)) + (when (or (nonzero? (-> gp-0 data s5-0 count)) (nonzero? (-> gp-0 data s5-0 vu-count))) + (dotimes (s4-0 (the-as int (-> gp-0 data s5-0 depth))) + (format *stdcon* " ") + ) + (format *stdcon* "~o~s~0k" (-> gp-0 data s5-0 color) (symbol->string (-> gp-0 data s5-0 name))) + (if (nonzero? (-> gp-0 data s5-0 count)) + (format + *stdcon* + "~170h~5d~220h~5d~280h~5,,2f" + (-> gp-0 data s5-0 count) + (-> gp-0 data s5-0 code-time) + (* 100.0 (/ (the float (-> gp-0 data s5-0 code-time)) (the float *ticks-per-frame*))) + ) + ) + (if (nonzero? (-> gp-0 data s5-0 vu-count)) + (format + *stdcon* + "~338h~5d~388h~5d~448h~5,,2f" + (-> gp-0 data s5-0 vu-count) + (-> gp-0 data s5-0 vu-time) + (* 100.0 (/ (the float (-> gp-0 data s5-0 vu-time)) (the float *ticks-per-frame*))) + ) + ) + (format *stdcon* "~1k~%") + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/util/script-h_REF.gc b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc new file mode 100644 index 0000000000..e3952dc8e4 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/script-h_REF.gc @@ -0,0 +1,107 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type script-form +(deftype script-form (structure) + ((name basic :offset-assert 0) + (spec basic :offset-assert 4) + (func basic :offset-assert 8) + ) + :method-count-assert 10 + :size-assert #xc + :flag-assert #xa0000000c + (:methods + (script-form-method-9 () none 9) + ) + ) + +;; definition for method 3 of type script-form +(defmethod inspect script-form ((obj script-form)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'script-form) + (format #t "~1Tname: ~A~%" (-> obj name)) + (format #t "~1Tspec: ~A~%" (-> obj spec)) + (format #t "~1Tfunc: ~A~%" (-> obj func)) + (label cfg-4) + obj + ) + +;; definition of type script-context +(deftype script-context (structure) + ((load-state load-state :offset-assert 0) + (key basic :offset-assert 4) + (process process :offset-assert 8) + (trans vector :offset-assert 12) + (side-effect? symbol :offset-assert 16) + (got-error? symbol :offset-assert 20) + (expr basic :offset-assert 24) + (param-count int32 :offset-assert 28) + (param object 16 :offset-assert 32) + (param-type object 16 :offset-assert 96) + ) + :method-count-assert 12 + :size-assert #xa0 + :flag-assert #xc000000a0 + (:methods + (new (symbol type basic process vector) _type_ 0) + (script-context-method-9 () none 9) + (script-context-method-10 () none 10) + (script-context-method-11 () none 11) + ) + ) + +;; definition for method 3 of type script-context +(defmethod inspect script-context ((obj script-context)) + (when (not obj) + (set! obj obj) + (goto cfg-10) + ) + (format #t "[~8x] ~A~%" obj 'script-context) + (format #t "~1Tload-state: ~A~%" (-> obj load-state)) + (format #t "~1Tkey: ~A~%" (-> obj key)) + (format #t "~1Tprocess: ~A~%" (-> obj process)) + (format #t "~1Ttrans: #~%" (-> obj trans)) + (format #t "~1Tside-effect?: ~A~%" (-> obj side-effect?)) + (format #t "~1Tgot-error?: ~A~%" (-> obj got-error?)) + (format #t "~1Texpr: ~A~%" (-> obj expr)) + (format #t "~1Tparam-count: ~D~%" (-> obj param-count)) + (format #t "~1Tparam[16] @ #x~X~%" (-> obj param)) + (dotimes (s5-0 (-> obj param-count)) + (format #t "~T [~D]~1Tparam: ~`object`P~%" s5-0 (-> obj param s5-0)) + ) + (format #t "~1Tparam-type[16] @ #x~X~%" (-> obj param-type)) + (dotimes (s5-1 (-> obj param-count)) + (format #t "~T [~D]~1Tparam-type: ~`object`P~%" s5-1 (-> obj param-type s5-1)) + ) + (label cfg-10) + obj + ) + +;; definition for method 0 of type script-context +;; INFO: Return type mismatch structure vs script-context. +(defmethod new script-context ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 process) (arg2 vector)) + (let ((t9-0 (method-of-type structure new)) + (v1-1 type-to-make) + ) + (-> type-to-make size) + (let ((v0-0 (t9-0 allocation v1-1))) + (set! (-> (the-as script-context v0-0) key) arg0) + (set! (-> (the-as script-context v0-0) process) arg1) + (set! (-> (the-as script-context v0-0) load-state) *load-state*) + (set! (-> (the-as script-context v0-0) side-effect?) #t) + (set! (-> (the-as script-context v0-0) got-error?) #f) + (set! (-> (the-as script-context v0-0) trans) arg2) + (the-as script-context v0-0) + ) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc new file mode 100644 index 0000000000..31e2fa176f --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/smush-control-h_REF.gc @@ -0,0 +1,138 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type smush-control +(deftype smush-control (structure) + ((start-time time-frame :offset-assert 0) + (period float :offset-assert 8) + (duration float :offset-assert 12) + (amp float :offset-assert 16) + (damp-amp float :offset-assert 20) + (damp-period float :offset-assert 24) + (ticks float :offset-assert 28) + ) + :method-count-assert 15 + :size-assert #x20 + :flag-assert #xf00000020 + (:methods + (set-zero! (_type_) _type_ 9) + (update! (_type_) float 10) + (get-no-update (_type_) float 11) + (activate! (_type_ float int int float float clock) _type_ 12) + (nonzero-amplitude? (_type_) symbol 13) + (die-on-next-update! (_type_) _type_ 14) + ) + ) + +;; definition for method 3 of type smush-control +(defmethod inspect smush-control ((obj smush-control)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'smush-control) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tperiod: ~f~%" (-> obj period)) + (format #t "~1Tduration: ~f~%" (-> obj duration)) + (format #t "~1Tamp: ~f~%" (-> obj amp)) + (format #t "~1Tdamp-amp: ~f~%" (-> obj damp-amp)) + (format #t "~1Tdamp-period: ~f~%" (-> obj damp-period)) + (format #t "~1Tticks: ~f~%" (-> obj ticks)) + (label cfg-4) + obj + ) + +;; definition for method 13 of type smush-control +(defmethod nonzero-amplitude? smush-control ((obj smush-control)) + (!= (-> obj amp) 0.0) + ) + +;; definition for method 9 of type smush-control +(defmethod set-zero! smush-control ((obj smush-control)) + (set! (-> obj period) 0.0) + (set! (-> obj duration) 0.0) + (set! (-> obj amp) 0.0) + (set! (-> obj damp-amp) 0.0) + (set! (-> obj damp-period) 0.0) + (set! (-> obj ticks) 0.0) + obj + ) + +;; definition for method 10 of type smush-control +(defmethod update! smush-control ((obj smush-control)) + (with-pp + (cond + ((!= (-> obj amp) 0.0) + (let* ((f30-0 (the float (- (-> pp clock frame-counter) (-> obj start-time)))) + (f0-2 (-> obj period)) + (f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + ) + (when (>= (- f30-0 (-> obj ticks)) (-> obj period)) + (set! (-> obj amp) (* (-> obj amp) (-> obj damp-amp))) + (set! (-> obj period) (* (-> obj period) (-> obj damp-period))) + (set! (-> obj ticks) f30-0) + (if (< (-> obj damp-period) 0.0) + (set-zero! obj) + ) + ) + (if (>= f30-0 (-> obj duration)) + (set-zero! obj) + ) + (* (sin (/ (* 65536.0 f28-0) (-> obj period))) + (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + ) + ) + ) + (else + 0.0 + ) + ) + ) + ) + +;; definition for method 11 of type smush-control +(defmethod get-no-update smush-control ((obj smush-control)) + (with-pp + (cond + ((!= (-> obj amp) 0.0) + (let* ((f30-0 (the float (- (-> pp clock frame-counter) (-> obj start-time)))) + (f0-2 (-> obj period)) + (f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2))) + ) + (* (sin (/ (* 65536.0 f0-4) (-> obj period))) + (* (-> obj amp) (/ (- (-> obj duration) f30-0) (-> obj duration))) + ) + ) + ) + (else + 0.0 + ) + ) + ) + ) + +;; definition for method 14 of type smush-control +(defmethod die-on-next-update! smush-control ((obj smush-control)) + (if (!= (-> obj amp) 0.0) + (set! (-> obj damp-period) -1.0) + ) + obj + ) + +;; definition for method 12 of type smush-control +(defmethod activate! smush-control ((obj smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock)) + (when (>= (fabs (* 0.2 (-> obj amp))) (fabs (get-no-update obj))) + (set! (-> obj amp) arg0) + (set! (-> obj period) (the float arg1)) + (set! (-> obj duration) (the float arg2)) + (set! (-> obj damp-amp) arg3) + (set! (-> obj damp-period) arg4) + (set! (-> obj ticks) 0.0) + (set! (-> obj start-time) (-> arg5 frame-counter)) + ) + obj + ) + + + + diff --git a/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc b/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc new file mode 100644 index 0000000000..85d538c111 --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/sync-info-h_REF.gc @@ -0,0 +1,345 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type sync-info-params +(deftype sync-info-params (structure) + ((sync-type basic :offset-assert 0) + (sync-flags sync-flags :offset-assert 8) + (entity basic :offset-assert 16) + (period uint32 :offset-assert 20) + (percent float :offset-assert 24) + (ease-in float :offset-assert 28) + (ease-out float :offset-assert 32) + (pause-in float :offset-assert 36) + (pause-out float :offset-assert 40) + ) + :method-count-assert 9 + :size-assert #x2c + :flag-assert #x90000002c + ) + +;; definition for method 3 of type sync-info-params +(defmethod inspect sync-info-params ((obj sync-info-params)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sync-info-params) + (format #t "~1Tsync-type: ~A~%" (-> obj sync-type)) + (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) + (format #t "~1Tentity: ~A~%" (-> obj entity)) + (format #t "~1Tperiod: ~D~%" (-> obj period)) + (format #t "~1Tpercent: ~f~%" (-> obj percent)) + (format #t "~1Tease-in: ~f~%" (-> obj ease-in)) + (format #t "~1Tease-out: ~f~%" (-> obj ease-out)) + (format #t "~1Tpause-in: ~f~%" (-> obj pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> obj pause-out)) + (label cfg-4) + obj + ) + +;; definition of type sync-info +(deftype sync-info (structure) + ((sync-flags sync-flags :offset-assert 0) + (offset float :offset-assert 8) + (period uint32 :offset-assert 12) + ) + :method-count-assert 16 + :size-assert #x10 + :flag-assert #x1000000010 + (:methods + (sync-info-method-9 () none 9) + (sync-info-method-10 () none 10) + (sync-info-method-11 () none 11) + (sync-info-method-12 () none 12) + (sync-info-method-13 () none 13) + (sync-info-method-14 () none 14) + (sync-info-method-15 () none 15) + ) + ) + +;; definition for method 3 of type sync-info +(defmethod inspect sync-info ((obj sync-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sync-info) + (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) + (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "~1Tperiod: ~D~%" (-> obj period)) + (label cfg-4) + obj + ) + +;; definition of type sync-linear +(deftype sync-linear (sync-info) + () + :method-count-assert 16 + :size-assert #x10 + :flag-assert #x1000000010 + ) + +;; definition for method 3 of type sync-linear +(defmethod inspect sync-linear ((obj sync-linear)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sync-linear) + (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) + (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "~1Tperiod: ~D~%" (-> obj period)) + (label cfg-4) + obj + ) + +;; definition of type sync-eased +(deftype sync-eased (sync-info) + ((tlo float :offset-assert 16) + (thi float :offset-assert 20) + (ylo float :offset-assert 24) + (m2 float :offset-assert 28) + (yend float :offset-assert 32) + (pause-in float :offset-assert 36) + (pause-out float :offset-assert 40) + ) + :method-count-assert 16 + :size-assert #x2c + :flag-assert #x100000002c + ) + +;; definition for method 3 of type sync-eased +(defmethod inspect sync-eased ((obj sync-eased)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sync-eased) + (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) + (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "~1Tperiod: ~D~%" (-> obj period)) + (format #t "~1Ttlo: ~f~%" (-> obj tlo)) + (format #t "~1Tthi: ~f~%" (-> obj thi)) + (format #t "~1Tylo: ~f~%" (-> obj ylo)) + (format #t "~1Tm2: ~f~%" (-> obj m2)) + (format #t "~1Tyend: ~f~%" (-> obj yend)) + (format #t "~1Tpause-in: ~f~%" (-> obj pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> obj pause-out)) + (label cfg-4) + obj + ) + +;; definition of type sync-paused +(deftype sync-paused (sync-info) + ((pause-in float :offset-assert 16) + (pause-out float :offset-assert 20) + ) + :method-count-assert 16 + :size-assert #x18 + :flag-assert #x1000000018 + ) + +;; definition for method 3 of type sync-paused +(defmethod inspect sync-paused ((obj sync-paused)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'sync-paused) + (format #t "~1Tsync-flags: ~D~%" (-> obj sync-flags)) + (format #t "~1Toffset: ~f~%" (-> obj offset)) + (format #t "~1Tperiod: ~D~%" (-> obj period)) + (format #t "~1Tpause-in: ~f~%" (-> obj pause-in)) + (format #t "~1Tpause-out: ~f~%" (-> obj pause-out)) + (label cfg-4) + obj + ) + +;; definition of type delayed-rand-float +(deftype delayed-rand-float (structure) + ((min-time int32 :offset-assert 0) + (max-time int32 :offset-assert 4) + (max-val float :offset-assert 8) + (timer int32 :offset-assert 12) + (start-time time-frame :offset-assert 16) + (value float :offset-assert 24) + ) + :method-count-assert 13 + :size-assert #x1c + :flag-assert #xd0000001c + (:methods + (delayed-rand-float-method-9 () none 9) + (delayed-rand-float-method-10 () none 10) + (delayed-rand-float-method-11 () none 11) + (delayed-rand-float-method-12 () none 12) + ) + ) + +;; definition for method 3 of type delayed-rand-float +(defmethod inspect delayed-rand-float ((obj delayed-rand-float)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'delayed-rand-float) + (format #t "~1Tmin-time: ~D~%" (-> obj min-time)) + (format #t "~1Tmax-time: ~D~%" (-> obj max-time)) + (format #t "~1Tmax-val: ~f~%" (-> obj max-val)) + (format #t "~1Ttimer: ~D~%" (-> obj timer)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tvalue: ~f~%" (-> obj value)) + (label cfg-4) + obj + ) + +;; definition of type oscillating-float +(deftype oscillating-float (structure) + ((value float :offset-assert 0) + (target float :offset-assert 4) + (vel float :offset-assert 8) + (max-vel float :offset-assert 12) + (damping float :offset-assert 16) + (accel float :offset-assert 20) + ) + :method-count-assert 11 + :size-assert #x18 + :flag-assert #xb00000018 + (:methods + (oscillating-float-method-9 () none 9) + (oscillating-float-method-10 () none 10) + ) + ) + +;; definition for method 3 of type oscillating-float +(defmethod inspect oscillating-float ((obj oscillating-float)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'oscillating-float) + (format #t "~1Tvalue: ~f~%" (-> obj value)) + (format #t "~1Ttarget: ~f~%" (-> obj target)) + (format #t "~1Tvel: ~f~%" (-> obj vel)) + (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) + (format #t "~1Tdamping: ~f~%" (-> obj damping)) + (format #t "~1Taccel: ~f~%" (-> obj accel)) + (label cfg-4) + obj + ) + +;; definition of type bouncing-float +(deftype bouncing-float (structure) + ((osc oscillating-float :inline :offset-assert 0) + (max-value float :offset-assert 24) + (min-value float :offset-assert 28) + (elasticity float :offset-assert 32) + (state int32 :offset-assert 36) + ) + :method-count-assert 13 + :size-assert #x28 + :flag-assert #xd00000028 + (:methods + (bouncing-float-method-9 () none 9) + (bouncing-float-method-10 () none 10) + (bouncing-float-method-11 () none 11) + (bouncing-float-method-12 () none 12) + ) + ) + +;; definition for method 3 of type bouncing-float +(defmethod inspect bouncing-float ((obj bouncing-float)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'bouncing-float) + (format #t "~1Tosc: #~%" (-> obj osc)) + (format #t "~1Tmax-value: ~f~%" (-> obj max-value)) + (format #t "~1Tmin-value: ~f~%" (-> obj min-value)) + (format #t "~1Telasticity: ~f~%" (-> obj elasticity)) + (format #t "~1Tstate: ~D~%" (-> obj state)) + (label cfg-4) + obj + ) + +;; definition of type delayed-rand-vector +(deftype delayed-rand-vector (structure) + ((min-time int32 :offset-assert 0) + (max-time int32 :offset-assert 4) + (xz-max float :offset-assert 8) + (y-max float :offset-assert 12) + (timer int32 :offset-assert 16) + (start-time time-frame :offset-assert 24) + (value vector :inline :offset-assert 32) + ) + :method-count-assert 13 + :size-assert #x30 + :flag-assert #xd00000030 + (:methods + (delayed-rand-vector-method-9 () none 9) + (delayed-rand-vector-method-10 () none 10) + (delayed-rand-vector-method-11 () none 11) + (delayed-rand-vector-method-12 () none 12) + ) + ) + +;; definition for method 3 of type delayed-rand-vector +(defmethod inspect delayed-rand-vector ((obj delayed-rand-vector)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'delayed-rand-vector) + (format #t "~1Tmin-time: ~D~%" (-> obj min-time)) + (format #t "~1Tmax-time: ~D~%" (-> obj max-time)) + (format #t "~1Txz-max: ~f~%" (-> obj xz-max)) + (format #t "~1Ty-max: ~f~%" (-> obj y-max)) + (format #t "~1Ttimer: ~D~%" (-> obj timer)) + (format #t "~1Tstart-time: ~D~%" (-> obj start-time)) + (format #t "~1Tvalue: #~%" (-> obj value)) + (label cfg-4) + obj + ) + +;; definition of type oscillating-vector +(deftype oscillating-vector (structure) + ((value vector :inline :offset-assert 0) + (target vector :inline :offset-assert 16) + (vel vector :inline :offset-assert 32) + (max-vel float :offset-assert 48) + (damping float :offset-assert 52) + (accel float :offset-assert 56) + ) + :method-count-assert 11 + :size-assert #x3c + :flag-assert #xb0000003c + (:methods + (oscillating-vector-method-9 () none 9) + (oscillating-vector-method-10 () none 10) + ) + ) + +;; definition for method 3 of type oscillating-vector +(defmethod inspect oscillating-vector ((obj oscillating-vector)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'oscillating-vector) + (format #t "~1Tvalue: #~%" (-> obj value)) + (format #t "~1Ttarget: #~%" (-> obj target)) + (format #t "~1Tvel: #~%" (-> obj vel)) + (format #t "~1Tmax-vel: ~f~%" (-> obj max-vel)) + (format #t "~1Tdamping: ~f~%" (-> obj damping)) + (format #t "~1Taccel: ~f~%" (-> obj accel)) + (label cfg-4) + obj + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak2/engine/util/types-h_REF.gc b/test/decompiler/reference/jak2/engine/util/types-h_REF.gc new file mode 100644 index 0000000000..79e969d46d --- /dev/null +++ b/test/decompiler/reference/jak2/engine/util/types-h_REF.gc @@ -0,0 +1,14 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type part-id +(deftype part-id (uint32) + () + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; failed to figure out what this is: +0 + diff --git a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc index be177cc06a..ce8ad86182 100644 --- a/test/decompiler/reference/jak2/kernel/gcommon_REF.gc +++ b/test/decompiler/reference/jak2/kernel/gcommon_REF.gc @@ -147,6 +147,7 @@ ) ;; definition for method 3 of type vector +;; INFO: this function exists in multiple non-identical object files ;; INFO: Used lq/sq (defmethod inspect vector ((obj vector)) (when (not obj) diff --git a/test/decompiler/reference/jak2/levels/city/trail-h_REF.gc b/test/decompiler/reference/jak2/levels/city/trail-h_REF.gc new file mode 100644 index 0000000000..17aa4e1c52 --- /dev/null +++ b/test/decompiler/reference/jak2/levels/city/trail-h_REF.gc @@ -0,0 +1,310 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type trail-node +(deftype trail-node (structure) + ((next-id int16 :offset-assert 0) + (prev-id int16 :offset-assert 2) + (parent-id int16 :offset-assert 4) + (x int16 :offset-assert 6) + (z int16 :offset-assert 8) + (first-conn uint16 :offset-assert 10) + (cost-from-start uint16 :offset-assert 12) + (cost-to-goal uint16 :offset-assert 14) + (flags uint8 :offset-assert 16) + (conn-count uint8 :offset-assert 17) + ) + :method-count-assert 12 + :size-assert #x12 + :flag-assert #xc00000012 + (:methods + (trail-node-method-9 () none 9) + (trail-node-method-10 () none 10) + (trail-node-method-11 () none 11) + ) + ) + +;; definition for method 3 of type trail-node +(defmethod inspect trail-node ((obj trail-node)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trail-node) + (format #t "~1Tnext-id: ~D~%" (-> obj next-id)) + (format #t "~1Tprev-id: ~D~%" (-> obj prev-id)) + (format #t "~1Tparent-id: ~D~%" (-> obj parent-id)) + (format #t "~1Tx: ~D~%" (-> obj x)) + (format #t "~1Tz: ~D~%" (-> obj z)) + (format #t "~1Tfirst-conn: ~D~%" (-> obj first-conn)) + (format #t "~1Tcost-from-start: ~D~%" (-> obj cost-from-start)) + (format #t "~1Tcost-to-goal: ~D~%" (-> obj cost-to-goal)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tconn-count: ~D~%" (-> obj conn-count)) + (label cfg-4) + obj + ) + +;; definition of type trail-visgroup +(deftype trail-visgroup (structure) + ((first-node uint16 :offset-assert 0) + (node-count uint8 :offset-assert 2) + (pad uint8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type trail-visgroup +(defmethod inspect trail-visgroup ((obj trail-visgroup)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trail-visgroup) + (format #t "~1Tfirst-node: ~D~%" (-> obj first-node)) + (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (label cfg-4) + obj + ) + +;; definition of type trail-conn +(deftype trail-conn (structure) + ((head-id uint16 :offset-assert 0) + (tail-id uint16 :offset-assert 2) + (flags uint8 :offset-assert 4) + (visgroup-id uint8 :offset-assert 5) + (cost uint16 :offset-assert 6) + ) + :method-count-assert 10 + :size-assert #x8 + :flag-assert #xa00000008 + (:methods + (trail-conn-method-9 () none 9) + ) + ) + +;; definition for method 3 of type trail-conn +(defmethod inspect trail-conn ((obj trail-conn)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trail-conn) + (format #t "~1Thead-id: ~D~%" (-> obj head-id)) + (format #t "~1Ttail-id: ~D~%" (-> obj tail-id)) + (format #t "~1Tflags: ~D~%" (-> obj flags)) + (format #t "~1Tvisgroup-id: ~D~%" (-> obj visgroup-id)) + (format #t "~1Tcost: ~D~%" (-> obj cost)) + (label cfg-4) + obj + ) + +;; definition of type trail-conn-hash-cell +(deftype trail-conn-hash-cell (structure) + ((first-conn uint16 :offset-assert 0) + (conn-count uint8 :offset-assert 2) + (pad uint8 :offset-assert 3) + ) + :method-count-assert 9 + :size-assert #x4 + :flag-assert #x900000004 + ) + +;; definition for method 3 of type trail-conn-hash-cell +(defmethod inspect trail-conn-hash-cell ((obj trail-conn-hash-cell)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trail-conn-hash-cell) + (format #t "~1Tfirst-conn: ~D~%" (-> obj first-conn)) + (format #t "~1Tconn-count: ~D~%" (-> obj conn-count)) + (format #t "~1Tpad: ~D~%" (-> obj pad)) + (label cfg-4) + obj + ) + +;; definition of type trail-conn-search +(deftype trail-conn-search (structure) + ((best-conn-id int32 :offset-assert 0) + (best-dist float :offset-assert 4) + (src-pos vector :offset-assert 8) + (conn-pos vector :offset-assert 12) + (debug-cells-searched int32 :offset-assert 16) + (debug-conns-searched int32 :offset-assert 20) + (bounds bounding-box4w :inline :offset-assert 32) + (cell-quads qword 2 :inline :offset-assert 64) + (conn-quads qword 7 :inline :offset-assert 96) + (cell-bits vector16ub 2 :inline :offset 64) + ) + :method-count-assert 9 + :size-assert #xd0 + :flag-assert #x9000000d0 + ) + +;; definition for method 3 of type trail-conn-search +(defmethod inspect trail-conn-search ((obj trail-conn-search)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trail-conn-search) + (format #t "~1Tbest-conn-id: ~D~%" (-> obj best-conn-id)) + (format #t "~1Tbest-dist: ~f~%" (-> obj best-dist)) + (format #t "~1Tsrc-pos: #~%" (-> obj src-pos)) + (format #t "~1Tconn-pos: #~%" (-> obj conn-pos)) + (format #t "~1Tdebug-cells-searched: ~D~%" (-> obj debug-cells-searched)) + (format #t "~1Tdebug-conns-searched: ~D~%" (-> obj debug-conns-searched)) + (format #t "~1Tbounds: #~%" (-> obj bounds)) + (format #t "~1Tcell-quads[2] @ #x~X~%" (-> obj cell-quads)) + (format #t "~1Tconn-quads[7] @ #x~X~%" (-> obj conn-quads)) + (format #t "~1Tcell-bits[2] @ #x~X~%" (-> obj cell-quads)) + (format #t "~1Tconn-bits[2] @ #x~X~%" (-> obj conn-quads)) + (label cfg-4) + obj + ) + +;; definition of type trail-conn-hash +(deftype trail-conn-hash (basic) + ((cell-width meters :offset-assert 4) + (origin vector :inline :offset-assert 16) + (cell uint32 :offset-assert 32) + (conn-ids uint32 :offset-assert 36) + ) + :method-count-assert 9 + :size-assert #x28 + :flag-assert #x900000028 + ) + +;; definition for method 3 of type trail-conn-hash +(defmethod inspect trail-conn-hash ((obj trail-conn-hash)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tcell-width: (meters ~m)~%" (-> obj cell-width)) + (format #t "~1Torigin: #~%" (-> obj origin)) + (format #t "~1Tcell: #x~X~%" (-> obj cell)) + (format #t "~1Tconn-ids: #x~X~%" (-> obj conn-ids)) + (label cfg-4) + obj + ) + +;; definition of type trail-cached-search-info +(deftype trail-cached-search-info (structure) + ((goal-conn-id int16 :offset-assert 0) + (orig-goal-pos vector :inline :offset-assert 16) + (conn-goal-pos vector :inline :offset-assert 32) + ) + :method-count-assert 9 + :size-assert #x30 + :flag-assert #x900000030 + ) + +;; definition for method 3 of type trail-cached-search-info +(defmethod inspect trail-cached-search-info ((obj trail-cached-search-info)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj 'trail-cached-search-info) + (format #t "~1Tgoal-conn-id: ~D~%" (-> obj goal-conn-id)) + (format #t "~1Torig-goal-pos: #~%" (-> obj orig-goal-pos)) + (format #t "~1Tconn-goal-pos: #~%" (-> obj conn-goal-pos)) + (label cfg-4) + obj + ) + +;; definition of type trail-graph +(deftype trail-graph (basic) + ((mode uint8 :offset-assert 4) + (search-id uint32 :offset-assert 8) + (open-head-id int16 :offset-assert 12) + (goal-conn-id int16 :offset-assert 14) + (goal-node-id int16 :offset-assert 16) + (node-count uint16 :offset-assert 18) + (conn-count uint16 :offset-assert 20) + (conn-mask uint8 :offset-assert 22) + (node uint32 :offset-assert 24) + (conn uint32 :offset-assert 28) + (conn-ids uint32 :offset-assert 32) + (visgroup uint32 :offset-assert 36) + (visnode-ids uint32 :offset-assert 40) + (conn-hash basic :offset-assert 44) + (orig-start-pos vector :inline :offset-assert 48) + (orig-goal-pos vector :inline :offset-assert 64) + (conn-start-pos vector :inline :offset-assert 80) + (conn-goal-pos vector :inline :offset-assert 96) + (open-quads qword 6 :inline :offset-assert 112) + (closed-quads qword 6 :inline :offset-assert 208) + ) + :method-count-assert 29 + :size-assert #x130 + :flag-assert #x1d00000130 + (:methods + (trail-graph-method-9 () none 9) + (trail-graph-method-10 () none 10) + (trail-graph-method-11 () none 11) + (trail-graph-method-12 () none 12) + (trail-graph-method-13 () none 13) + (trail-graph-method-14 () none 14) + (trail-graph-method-15 () none 15) + (trail-graph-method-16 () none 16) + (trail-graph-method-17 () none 17) + (trail-graph-method-18 () none 18) + (trail-graph-method-19 () none 19) + (trail-graph-method-20 () none 20) + (trail-graph-method-21 () none 21) + (trail-graph-method-22 () none 22) + (trail-graph-method-23 () none 23) + (trail-graph-method-24 () none 24) + (trail-graph-method-25 () none 25) + (trail-graph-method-26 () none 26) + (trail-graph-method-27 () none 27) + (trail-graph-method-28 () none 28) + ) + ) + +;; definition for method 3 of type trail-graph +(defmethod inspect trail-graph ((obj trail-graph)) + (when (not obj) + (set! obj obj) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" obj (-> obj type)) + (format #t "~1Tmode: ~D~%" (-> obj mode)) + (format #t "~1Tsearch-id: ~D~%" (-> obj search-id)) + (format #t "~1Topen-head-id: ~D~%" (-> obj open-head-id)) + (format #t "~1Tgoal-conn-id: ~D~%" (-> obj goal-conn-id)) + (format #t "~1Tgoal-node-id: ~D~%" (-> obj goal-node-id)) + (format #t "~1Tnode-count: ~D~%" (-> obj node-count)) + (format #t "~1Tconn-count: ~D~%" (-> obj conn-count)) + (format #t "~1Tconn-mask: ~D~%" (-> obj conn-mask)) + (format #t "~1Tnode: #x~X~%" (-> obj node)) + (format #t "~1Tconn: #x~X~%" (-> obj conn)) + (format #t "~1Tconn-ids: #x~X~%" (-> obj conn-ids)) + (format #t "~1Tvisgroup: #x~X~%" (-> obj visgroup)) + (format #t "~1Tvisnode-ids: #x~X~%" (-> obj visnode-ids)) + (format #t "~1Tconn-hash: ~A~%" (-> obj conn-hash)) + (format #t "~1Torig-start-pos: #~%" (-> obj orig-start-pos)) + (format #t "~1Torig-goal-pos: #~%" (-> obj orig-goal-pos)) + (format #t "~1Tconn-start-pos: #~%" (-> obj conn-start-pos)) + (format #t "~1Tconn-goal-pos: #~%" (-> obj conn-goal-pos)) + (format #t "~1Topen-quads[6] @ #x~X~%" (-> obj open-quads)) + (format #t "~1Tclosed-quads[6] @ #x~X~%" (-> obj closed-quads)) + (format #t "~1Topen-bits[2] @ #x~X~%" (-> obj open-quads)) + (format #t "~1Tclosed-bits[2] @ #x~X~%" (-> obj closed-quads)) + (label cfg-4) + obj + ) + +;; definition for symbol *trail-graph*, type trail-graph +(define *trail-graph* (the-as trail-graph #f)) + + + +