decomp3: lightning renderer, nav code, texture remap, fix progress menu crash (#3461)

Also adds:

- BLERC
- Minimap (with missing texture for the map, sprites work)
- Eco Mine files
- Precursor robot boss files
- Sewer files
- Vehicle files
This commit is contained in:
Hat Kid
2024-04-13 00:44:38 +02:00
committed by GitHub
parent 5299bc441f
commit 36f1592b90
365 changed files with 230868 additions and 7955 deletions
File diff suppressed because it is too large Load Diff
@@ -562,5 +562,58 @@
[72, "(function object)"],
[73, "(function object :behavior target)"],
[74, "(function object :behavior target)"]
],
"nav-control": [
[0, "(function object nav-control none)"],
[1, "(function object nav-control none)"],
[2, "(function object nav-control none)"],
[3, "(function object nav-control none)"],
[4, "(function object nav-control none)"],
[5, "(function object nav-control none)"],
[6, "(function object nav-control none)"],
[7, "(function object nav-control none)"],
[8, "(function object nav-control none)"],
[9, "(function object nav-control none)"]
],
"nav-enemy": [[7, "(function enemy-jump-info none :behavior nav-enemy)"]],
"task-control": [
[53, "(function game-task-node-info symbol object)"],
[54, "(function game-task-node-info object)"],
[67, "(function pair symbol)"]
],
"merc-death": [[3, "(function time-frame :behavior process-drawable)"]],
"vehicle-states": [
[10, "(function collide-shape-prim none)"],
[12, "(function collide-shape-prim none)"]
],
"prebot-states": [[21, "(function vector :behavior prebot)"]],
"wasall-obs": [
[0, "(function object)"],
[1, "(function object)"],
[2, "(function object)"],
[3, "(function object)"]
],
"roboguard": [
[1, "(function cspace transformq none)"],
[2, "(function cspace transformq none)"],
[25, "(function int int float object :behavior roboguard)"],
[45, "(function roboguard symbol object)"]
],
"vehicle": [
[6, "(function collide-shape-prim none)"],
[7, "(function collide-shape-prim none)"]
],
"wvehicle-wheel": [
[7, "(function collide-shape-prim none)"],
[11, "(function collide-shape-prim none)"],
[17, "(function collide-shape-prim none)"]
],
"wvehicle-states": [
[20, "(function collide-shape-prim none)"],
[22, "(function collide-shape-prim none)"]
],
"wvehicle": [[6, "(function collide-shape-prim none)"]],
"pilot-states": [
[15, "(function surface surface surface int object :behavior target)"]
]
}
+40 -4
View File
@@ -386,7 +386,35 @@
"(anon-function 17 target-ladder)": [0, 1],
"command-get-process": [46],
"foreground-draw-hud": [0, 7, 8, 9, 16, 22],
"target-flut-falling-anim-trans": [8, 9]
"target-flut-falling-anim-trans": [8, 9],
"(method 12 nav-mesh)": [0, 1, 2, 9],
"(method 20 nav-mesh)": [9],
"(method 21 nav-mesh)": [7],
"(method 29 nav-mesh)": [0, 1, 2, 4],
"(method 33 nav-mesh)": [10, 11, 12, 13],
"(method 34 nav-mesh)": [0, 1, 2, 4],
"(method 35 nav-mesh)": [0, 1, 2, 4],
"(method 36 nav-mesh)": [1, 2],
"(method 37 nav-mesh)": [4],
"(method 45 nav-mesh)": [1, 2],
"(method 46 nav-mesh)": [1, 2, 19, 20],
"(method 48 nav-mesh)": [4, 5, 6, 8],
"(method 49 nav-mesh)": [0, 1, 2, 3, 5],
"(method 18 nav-control)": [11, 12, 19, 20, 31, 34],
"(method 19 nav-control)": [9, 10],
"(method 40 nav-state)": [1, 2],
"point-poly-distance-min": [0, 1, 2, 3, 4, 5, 6, 7, 10],
"find-closest-circle-ray-intersection": [0, 4, 15, 16, 17, 18],
"(method 39 vehicle)": [0, 10, 12, 15],
"(anon-function 7 vehicle-states)": [0, 2],
"(method 11 vehicle-hud-requests)": [0, 6, 7, 10],
"(anon-function 12 neo-juicer)": [29, 30],
"(method 160 neo-grenadier)": [1, 2, 3],
"(method 82 spydroid-orig)": [13],
"(method 118 vehicle)": [3, 4, 7, 8, 9, 10, 17, 26, 30, 31, 33],
"(method 25 squad-control)": [0, 4, 5, 7],
"target-pilot-post": [0, 29],
"(method 36 was-squad-control)": [0, 8, 11, 12, 14, 16]
},
// Sometimes the game might use format strings that are fetched dynamically,
@@ -415,7 +443,12 @@
"(method 10 menu-loading-option)": [[113, 1]],
"(method 10 menu-icon-info-option)": [[150, 1]],
"(method 17 hud-goal)": [[71, 0]],
"(method 17 hud-miss)": [[71, 0]]
"(method 17 hud-miss)": [[71, 0]],
"(method 16 resetter)": [
[68, 1],
[101, 1],
[130, 1]
]
},
"mips2c_functions_by_name": [
@@ -546,7 +579,8 @@
"(method 9 font-work)",
"(method 9 prim-strip)",
"live-func-curve",
"birth-func-curve"
"birth-func-curve",
"sparticle-motion-blur-dirt"
],
"mips2c_jump_table_functions": {},
@@ -562,8 +596,10 @@
["lfacctyb", 0, 0],
["intpfall", 0, 0],
["lfaccity", 0, 0],
["lfacctyb-vis", 0, 0],
["ltowcity", 0, 0],
["powergd", 0, 0]
["powergd", 0, 0],
["lcitysml", 0, 0]
],
// some object files have garbage pad data at the end which makes the decompiler
File diff suppressed because it is too large Load Diff
@@ -650,5 +650,312 @@
["L139", "attack-info"],
["L138", "attack-info"],
["L137", "attack-info"]
],
"minimap": [
["L557", "uint64", true],
["L556", "uint64", true],
["L314", "(inline-array minimap-class-node)", 177],
["L522", "uint64", true],
["L521", "uint64", true],
["L518", "uint64", true],
["L523", "uint64", true],
["L517", "uint64", true],
["L524", "uint64", true],
["L519", "uint64", true],
["L520", "uint64", true]
],
"task-control": [
["L1270", "uint64", true],
["L1271", "uint64", true],
["L851", "uint64", true],
["L750", "attack-info"],
["L850", "uint64", true],
["L849", "uint64", true],
["L852", "uint64", true],
["L853", "uint64", true]
],
"nav-mesh": [["L271", "(inline-array vector)", 2]],
"nav-enemy": [
["L458", "uint64", true],
["L459", "uint64", true],
["L464", "uint64", true],
["L463", "uint64", true],
["L462", "uint64", true],
["L461", "uint64", true],
["L460", "uint64", true]
],
"elec-gate": [["L155", "attack-info"]],
"gekko": [
["L544", "uint64", true],
["L541", "uint64", true],
["L542", "uint64", true],
["L543", "uint64", true],
["L479", "uint64", true],
["L478", "uint64", true],
["L474", "uint64", true],
["L477", "uint64", true],
["L476", "uint64", true],
["L468", "(inline-array gekko-ik-setup)", 4],
["L473", "uint64", true],
["L475", "uint64", true]
],
"mine-train": [["L190", "attack-info"]],
"grunt": [
["L204", "vector"],
["L203", "vector"]
],
"merc-blend-shape": [["L71", "(pointer int16)", 40]],
"vehicle-util": [["L245", "attack-info"]],
"prebot-eco-creature": [
["L320", "attack-info"],
["L319", "attack-info"],
["L331", "attack-info"]
],
"prebot-extras": [
["L290", "uint64", true],
["L293", "uint64", true],
["L291", "uint64", true],
["L292", "uint64", true],
["L205", "attack-info"],
["L262", "uint64", true],
["L263", "uint64", true],
["L268", "uint64", true],
["L264", "uint64", true],
["L266", "uint64", true],
["L265", "uint64", true],
["L227", "attack-info"],
["L242", "attack-info"],
["L267", "uint64", true],
["L259", "uint64", true],
["L261", "uint64", true],
["L269", "uint64", true],
["L246", "attack-info"],
["L260", "uint64", true],
["L270", "uint64", true],
["L254", "vector"],
["L255", "vector"],
["L256", "vector"]
],
"prebot-states": [
["L921", "uint64", true],
["L912", "uint64", true],
["L907", "uint64", true],
["L913", "uint64", true],
["L885", "(inline-array vector)", 2],
["L887", "vector"],
["L904", "uint64", true],
["L902", "uint64", true],
["L911", "uint64", true],
["L899", "uint64", true],
["L910", "uint64", true],
["L909", "uint64", true],
["L900", "uint64", true],
["L906", "uint64", true],
["L901", "uint64", true],
["L905", "uint64", true],
["L903", "uint64", true],
["L898", "uint64", true],
["L908", "uint64", true]
],
"wasall-obs": [
["L1352", "uint64", true],
["L1351", "uint64", true],
["L1324", "uint64", true],
["L1323", "uint64", true],
["L1279", "attack-info"]
],
"sew-laser-guard": [
["L75", "attack-info"],
["L78", "attack-info"],
["L81", "attack-info"]
],
"sewer-obs": [
["L496", "uint64", true],
["L495", "uint64", true],
["L493", "uint64", true],
["L497", "uint64", true],
["L491", "uint64", true],
["L494", "uint64", true],
["L498", "uint64", true],
["L490", "uint64", true],
["L487", "uint64", true],
["L488", "uint64", true],
["L492", "uint64", true],
["L489", "uint64", true],
["L252", "attack-info"],
["L390", "uint64", true],
["L391", "uint64", true],
["L397", "uint64", true],
["L323", "attack-info"],
["L396", "uint64", true],
["L395", "uint64", true],
["L331", "vector"],
["L392", "uint64", true],
["L399", "uint64", true],
["L393", "uint64", true],
["L398", "uint64", true],
["L265", "vector"],
["L394", "uint64", true],
["L289", "attack-info"]
],
"sew-laser-turret": [["L127", "attack-info"]],
"sew-whirlpool": [["L14", "attack-info"]],
"saberfish": [
["L749", "uint64", true],
["L750", "uint64", true],
["L752", "uint64", true],
["L751", "uint64", true],
["L667", "uint64", true],
["L666", "uint64", true],
["L668", "uint64", true],
["L665", "uint64", true]
],
"saberfish-spawner": [
["L262", "(pointer int8)", 64],
["L263", "(pointer int8)", 64]
],
"neo-juicer": [
["L270", "vector"],
["L269", "vector"],
["L268", "vector"]
],
"neo-grenadier": [
["L200", "vector"],
["L199", "vector"],
["L206", "(pointer uint64)", 3],
["L205", "(pointer int32)", 4],
["L216", "(pointer uint64)", 2],
["L223", "(pointer uint64)", 2]
],
"spydroid-orig": [
["L247", "attack-info"],
["L246", "attack-info"],
["L231", "vector"],
["L230", "vector"],
["L229", "vector"],
["L228", "vector"],
["L227", "vector"]
],
"roboguard": [
["L305", "uint64", true],
["L272", "uint64", true],
["L271", "uint64", true]
],
"vehicle": [["L204", "vector"]],
"wvehicle": [
["L270", "attack-info"],
["L269", "vector"],
["L268", "vector"]
],
"wvehicle-util": [["L186", "attack-info"]],
"wvehicle-physics": [["L55", "(inline-array vehicle-wheel-surface)", 7]],
"wcar": [
["L175", "(inline-array vehicle-attach-point)", 14],
["L111", "(inline-array vector)", 2],
["L110", "vector"],
["L109", "vector"],
["L108", "vector"],
["L107", "vector"],
["L105", "vector"],
["L104", "vector"],
["L103", "vector"],
["L106", "vector"],
["L102", "vector"],
["L101", "vector"],
["L100", "vector"],
["L99", "vector"]
],
"wcar-turtle": [
["L18", "vector"],
["L17", "vector"],
["L16", "vector"],
["L15", "vector"],
["L14", "vector"],
["L13", "vector"]
],
"race-mesh": [["L112", "(pointer rgba)", 16]],
"wcar-snake": [
["L7", "vector"],
["L6", "vector"],
["L15", "vector"],
["L14", "vector"],
["L13", "vector"],
["L12", "vector"],
["L11", "vector"],
["L10", "vector"],
["L9", "vector"]
],
"wcar-scorpion": [
["L37", "vector"],
["L42", "vector"],
["L41", "vector"],
["L40", "vector"],
["L39", "vector"],
["L51", "vector"],
["L50", "vector"],
["L49", "vector"],
["L48", "vector"],
["L47", "vector"],
["L46", "vector"],
["L45", "vector"]
],
"wcar-toad": [
["L37", "vector"],
["L36", "vector"],
["L46", "attack-info"],
["L45", "vector"],
["L44", "vector"],
["L43", "vector"],
["L42", "vector"],
["L41", "vector"],
["L40", "vector"],
["L39", "vector"],
["L47", "(inline-array vector)", 2],
["L38", "vector"]
],
"wcar-fox": [
["L7", "vector"],
["L6", "vector"],
["L15", "vector"],
["L14", "vector"],
["L13", "vector"],
["L12", "vector"],
["L11", "vector"],
["L10", "vector"],
["L9", "vector"]
],
"wcar-rhino": [
["L30", "vector"],
["L29", "vector"],
["L28", "vector"],
["L27", "vector"],
["L26", "vector"],
["L25", "vector"],
["L24", "vector"],
["L23", "vector"],
["L21", "vector"]
],
"wcar-mirage": [
["L23", "vector"],
["L22", "vector"],
["L21", "vector"],
["L20", "vector"],
["L19", "vector"],
["L18", "vector"],
["L17", "vector"],
["L24", "vector"],
["L15", "vector"],
["L14", "vector"]
],
"wcar-x-ride": [
["L9", "vector"],
["L8", "vector"],
["L17", "vector"],
["L16", "vector"],
["L15", "vector"],
["L14", "vector"],
["L13", "vector"],
["L12", "vector"],
["L11", "vector"]
]
}
@@ -1,5 +1,7 @@
// This overrides the stack size for calls to stack-size-set! in given functions.
{
"(method 29 target)": 2048,
"(method 11 part-spawner)": 64
"(method 11 part-spawner)": 64,
"(method 11 elevator)": 1024,
"scene-player-init": 1024
}
@@ -764,5 +764,416 @@
"(code target-flut-get-on)": [
[16, "vector"],
[32, "vector"]
]
],
"(method 11 minimap)": [[16, ["inline-array", "vector", 4]]],
"(method 15 minimap)": [[16, "minimap-draw-work"]],
"(method 19 minimap)": [
[32, "vector"],
[16, "vector"]
],
"(method 24 minimap)": [[16, "minimap-draw-work"]],
"(method 23 minimap)": [
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "matrix"],
[144, "matrix"]
],
"(method 26 minimap)": [
[32, "vector"],
[48, "vector"],
[64, "matrix"]
],
"(method 17 minimap)": [
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "matrix"],
[144, "matrix"],
[256, "vector"],
[240, "vector"]
],
"(method 18 minimap)": [
[32, "vector"],
[48, "vector"],
[64, "vector"],
[80, "matrix"],
[144, "matrix"],
[240, "vector"],
[256, "vector"]
],
"(method 14 trail-graph)": [[16, ["inline-array", "vector", 2]]],
"(method 15 trail-graph)": [[16, ["inline-array", "vector", 4]]],
"(method 12 lightning-bolt)": [
[80, "vector"],
[112, "matrix"],
[176, "vector"],
[192, "vector"],
[16, "vector"],
[32, "matrix"],
[304, "matrix"],
[272, "vector"],
[368, "vector"],
[384, "vector"]
],
"(method 11 lightning-bolt)": [[48, "vector"]],
"(method 20 lightning-bolt)": [[16, "vector"]],
"(method 16 lightning-bolt)": [[144, ["array", "rgba", 1]]],
"(method 9 nav-mesh)": [[16, "vector"]],
"(method 10 nav-mesh)": [[32, "nav-find-poly-parms"]],
"find-nearest-nav-mesh": [[16, "nav-find-poly-parms"]],
"point-to-poly-boundary": [[16, ["inline-array", "vector", 4]]],
"(method 11 nav-mesh)": [[16, "nav-find-poly-parms"]],
"(method 31 entity-actor)": [[16, "nav-find-poly-parms"]],
"(method 32 entity-actor)": [[32, "nav-find-poly-parms"]],
"(method 15 nav-mesh)": [[16, ["array", "int8", 4]]],
"(method 17 nav-mesh)": [[16, "vector"]],
"(method 20 nav-mesh)": [[16, "nav-ray"]],
"(method 21 nav-mesh)": [
[16, "nav-ray"],
[96, "vector"]
],
"(method 36 nav-mesh)": [[16, "nav-poly"]],
"(method 37 nav-mesh)": [[16, ["inline-array", "nav-poly", 3]]],
"(method 39 nav-mesh)": [[16, ["inline-array", "vector", 3]]],
"(method 43 nav-mesh)": [[16, "vector"]],
"(method 25 nav-mesh)": [[32, "nav-stack-type2"]],
"(method 12 nav-mesh)": [[16, "nav-stack-type"]],
"(anon-function 9 nav-control)": [[16, ["inline-array", "vector", 1]]],
"(anon-function 4 nav-control)": [[16, ["inline-array", "vector", 1]]],
"debug-nav-validate-current-poly": [[16, "vector"]],
"(method 9 nav-control)": [[16, "vector"]],
"circle-tangent-directions": [[48, "vector"]],
"(method 18 nav-control)": [[16, "nav-control-cfs-work"]],
"(method 19 nav-control)": [[16, "nav-control-cfs-work"]],
"(method 11 nav-state)": [
[16, "vector"],
[32, "vector"]
],
"(method 24 nav-state)": [[16, ["inline-array", "vector", 1]]],
"(method 28 nav-state)": [[208, "vector"]],
"(method 31 nav-state)": [
[16, "nav-avoid-spheres-params"],
[112, "nav-ray"]
],
"(method 32 nav-state)": [[16, "nav-control-cfs-work"]],
"(method 34 nav-state)": [[16, ["inline-array", "vector", 1]]],
"(method 37 nav-state)": [[16, ["inline-array", "vector", 1]]],
"(method 50 nav-state)": [[16, "nav-ray"]],
"(method 52 nav-state)": [
[16, "vector"],
[32, "nav-route-portal"],
[80, ["inline-array", "vector", 2]],
[192, "matrix"]
],
"(method 53 nav-state)": [
[16, "nav-avoid-spheres-params"],
[112, "nav-ray"]
],
"(method 91 nav-enemy)": [[16, "vector"]],
"(method 161 nav-enemy)": [[16, "vector"]],
"(method 160 nav-enemy)": [[16, "vector"]],
"(code hostile monster-frog)": [[16, "vector"]],
"(code notice monster-frog)": [[16, "vector"]],
"elec-gate-post": [[48, "vector"]],
"(enter active elec-gate)": [[176, ["inline-array", "vector", 2]]],
"(method 26 min-rat-engine)": [[96, "vector"]],
"(code arrived min-bomb-elevator)": [[16, ["array", "symbol", 3]]],
"(code down-idle min-crane-switch)": [[16, ["array", "symbol", 3]]],
"(method 208 manta)": [
[16, "vector"],
[32, "vector"]
],
"(method 200 manta)": [[16, "vector"]],
"(method 201 manta)": [[16, ["inline-array", "matrix", 2]]],
"(method 109 rat)": [[112, "vector"]],
"(post running-in-wheel rat)": [
[96, "vector"],
[112, "vector"],
[128, "vector"]
],
"(post idle rat-spawner)": [
[96, "vector"],
[112, "enemy-init-by-other-params"]
],
"(method 37 min-bomb-train)": [[144, "vector"]],
"(method 10 game-task-node-info)": [[16, ["array", "game-task-node", 64]]],
"fail-mission": [[96, "resetter-params"]],
"restart-mission": [[96, "resetter-params"]],
"gekko-postbind": [
[576, ["inline-array", "vector", 1]],
[656, "vector"],
[672, "vector"],
[752, "vector"],
[768, "vector"],
[848, "vector"],
[864, "vector"],
[944, "vector"],
[960, "vector"]
],
"(method 202 gekko)": [
[16, "vector"],
[32, "vector"]
],
"merc-blend-shape": [[16, ["array", "int16", 128]]],
"(method 26 battle)": [[16, "vector"]],
"fruit-check-ground-bounce": [[16, "vector"]],
"wascity-cactus-callback": [[16, "vector"]],
"vehicle-draw-thruster": [[16, "vehicle-thruster-work"]],
"(method 30 vehicle)": [[16, ["array", "uint32", 1]]],
"(method 55 vehicle)": [[16, "matrix"]],
"(method 54 vehicle)": [[16, "rigid-body-move-work"]],
"(method 78 vehicle)": [
[16, "vehicle-stack-type3"],
[144, "sprite-glow-data"],
[208, "sprite-glow-data"]
],
"vehicle-explode-post": [[16, ["array", "uint32", 1]]],
"(method 129 vehicle)": [[16, "mystery-vehicle-type0"]],
"(event fly-to-dest prebot-large-eco-creature)": [[96, "vector"]],
"large-eco-creature-split": [
[16, "enemy-init-by-other-params"],
[64, "vector"]
],
"spt-func-pillar-rocks-bounce1": [[16, "vector"]],
"spt-func-pillar-rocks-bounce2": [[16, "vector"]],
"prebot-sword-init-by-other": [[16, "weapon-trail-tracker-spawn-params"]],
"(trans idle prebot-shockwave)": [[560, "bounding-box"]],
"(enter test prebot)": [
[16, "enemy-init-by-other-params"],
[64, "vector"]
],
"prebot-spawn-shockwave": [[16, "vector"]],
"prebot-light-flash": [[16, "vector"]],
"prebot-common": [
[112, "vector"],
[96, "vector"]
],
"prebot-neck-callback": [[144, "vector"]],
"prebot-launch-critter": [
[64, "vector"],
[80, "vector"],
[16, "enemy-init-by-other-params"]
],
"(post attacking-1 tentacle)": [[16, "vector"]],
"(method 155 sew-laser-guard)": [
[32, "vector"],
[160, "vector"]
],
"(trans idle sew-laser-beam)": [[32, "vector"]],
"(method 25 sew-move-turret-shot)": [[32, "vector"]],
"spawn-sew-move-turret-projectile": [
[16, "projectile-init-by-other-params"],
[144, "vector"]
],
"(method 162 sew-laser-turret)": [
[32, ["array", "collide-shape", 384]],
[16, "bounding-box"]
],
"(trans alert sew-laser-turret)": [
[32, ["array", "collide-shape", 384]],
[16, "bounding-box"]
],
"(method 161 sew-laser-turret)": [[64, "rgbaf"]],
"(method 159 sew-laser-turret)": [[32, "vector"]],
"(trans active sew-moving-step-a)": [[16, "vector"]],
"spawn-moving-step-b-step": [[16, "sew-moving-step-b-step-param"]],
"(method 231 saberfish)": [
[16, "vector"],
[32, "vector"],
[48, "vector"]
],
"(method 236 saberfish)": [[16, "saberfish-spawner-query-msg"]],
"(method 237 saberfish)": [[16, "saberfish-spawner-query-msg"]],
"(method 238 saberfish)": [
[16, "saberfish-spawner-query-msg"],
[576, "vector"],
[144, "vector"],
[272, "vector"],
[288, "vector"],
[448, "vector"],
[464, "vector"],
[480, "vector"],
[496, "vector"]
],
"(method 225 saberfish)": [[16, "saberfish-spawner-query-msg"]],
"(code active saberfish-mgr-room1)": [[16, "saberfish-spawner-command"]],
"(code stage-0 saberfish-mgr-room2)": [[16, "saberfish-spawner-command"]],
"(code stage-2 saberfish-mgr-room2)": [[16, "saberfish-spawner-command"]],
"(code stage-1 saberfish-mgr-room2)": [[16, "saberfish-spawner-command"]],
"(method 22 saberfish-spawner)": [[16, "nav-poly"]],
"(method 24 saberfish-spawner)": [
[16, "vector"],
[32, "vector"]
],
"(method 11 saberfish-spawner)": [[32, "vector"]],
"(method 25 saberfish-spawner)": [[16, "saberfish-init-by-other-params"]],
"(method 17 saberfish-spawn-manager-base)": [[16, "saberfish-spawn-query"]],
"(method 18 saberfish-spawn-manager-base)": [[16, "saberfish-spawn-query"]],
"(code active kg-hopper)": [[16, "vector"]],
"(method 191 kg-hopper)": [
[96, "vector"],
[176, "collide-query"]
],
"(method 99 kg-hopper)": [[80, "vector"]],
"spt-func-birth-on-bubble-pop": [
[16, "vector"],
[32, "vector"]
],
"(code turned-off sew-power-switch)": [[16, ["array", "symbol", 10]]],
"(method 18 hfragment)": [
[48, "vector"],
[16, "vector"],
[32, "vector"],
[96, "vector"],
[112, "vector"]
],
"(trans hostile neo-grenadier)": [[48, "vector"]],
"(code flee sewer-frog)": [[16, "vector"]],
"(enter explode spydroid-orig)": [[192, "vector"]],
"(method 196 roboguard)": [
[16, "vector"],
[32, "vector"]
],
"(method 195 roboguard)": [[16, "vector"]],
"(anon-function 1 roboguard)": [
[16, "vector"],
[32, "vector"]
],
"(anon-function 25 roboguard)": [[48, "matrix"]],
"(method 91 vehicle)": [[16, "vehicle-controls"]],
"(method 48 vehicle)": [[16, "matrix"]],
"(method 118 vehicle)": [[16, "vehicle-controls"]],
"(method 32 squad-control)": [[16, "vector"]],
"(method 17 squad-control)": [[16, "primary-target-pos-vel"]],
"(method 16 squad-control)": [
[16, ["inline-array", "primary-target-pos-vel", 2]]
],
"(method 24 squad-control)": [[16, "primary-target-pos-vel"]],
"(method 25 squad-control)": [
[16, ["inline-array", "primary-target-pos-vel", 2]]
],
"(method 50 vehicle)": [[16, ["inline-array", "rigid-body-impact", 2]]],
"(method 93 vehicle)": [[16, "mystery-vehicle-type2"]],
"(method 94 vehicle)": [
[16, "mystery-vehicle-type1"],
[128, ["inline-array", "collide-query", 2]],
[816, ["inline-array", "matrix", 2]]
],
"(method 135 vehicle)": [[16, ["inline-array", "matrix", 2]]],
"(method 13 was-squad-control)": [
[16, ["inline-array", "matrix", 2]],
[192, "matrix"],
[208, ["array", "uint32", 1]]
],
"(method 35 was-squad-control)": [
[16, ["inline-array", "matrix", 2]],
[240, "cquery-with-5vec"]
],
"(method 39 vehicle-wheel)": [[16, "rigid-body-move-work"]],
"(enter explode wvehicle)": [[16, "matrix"]],
"(method 77 wvehicle)": [[16, "vector"]],
"(method 30 wvehicle)": [[16, "matrix"]],
"(method 92 wvehicle)": [[16, "vector"]],
"(method 163 wvehicle)": [[16, "matrix"]],
"(method 165 wvehicle)": [
[16, "vehicle-controls"],
[32, "matrix"]
],
"(method 198 wvehicle)": [[16, "wvehicle-physics-work"]],
"(method 195 wvehicle)": [[16, "light-trail-tracker-spawn-params"]],
"cshape-reaction-scorp-shot": [[16, "vector"]],
"(method 26 v-scorp-shot)": [[32, "vector"]],
"(method 25 v-rhino-shot)": [[32, "vector"]],
"(method 31 v-toad-shot)": [
[32, "light-trail-tracker-spawn-params"],
[16, "vector"]
],
"(method 78 wvehicle)": [
[16, "wvehicle-part-work"],
[624, "wvehicle-draw-thruster-params"]
],
"(method 172 wvehicle)": [[16, ["inline-array", "quaternion", 2]]],
"(method 173 wvehicle)": [[16, "wvehicle-stack-type1"]],
"(method 161 wvehicle)": [[16, "vehicle-wheel-init-params"]],
"(method 31 wvehicle)": [[16, "wvehicle-physics-work"]],
"(method 162 wvehicle)": [[16, "wvehicle-physics-work"]],
"(method 164 wvehicle)": [[16, "wvehicle-stack-type6"]],
"(method 95 vehicle)": [[16, "matrix"]],
"(method 93 wvehicle)": [
[16, ["inline-array", "matrix", 2]],
[112, "wvehicle-physics-work"],
[128, "matrix"]
],
"(method 33 wvehicle)": [
[16, ["inline-array", "quaternion", 2]],
[48, "wvehicle-stack-type4"]
],
"(method 149 wvehicle)": [[16, "wvehicle-stack-type2"]],
"(method 199 wvehicle)": [[16, "wvehicle-stack-type3"]],
"(method 169 wcar-snake-base)": [[16, "wcar-proj-init-by-other-params"]],
"(method 79 wcar-snake-base)": [
[16, ["inline-array", "quaternion", 2]],
[64, "wcar-stack-type1"]
],
"(method 79 v-turtle)": [
[16, ["inline-array", "quaternion", 2]],
[64, "wvehicle-physics-work"],
[128, "wvehicle-jmod-work"]
],
"(method 31 squad-control)": [[48, "squad-control-stack-type0"]],
"target-pilot-post": [
[48, "cquery-with-5vec"],
[640, "matrix"]
],
"(code target-pilot-get-off)": [[96, "matrix"]],
"target-pilot-trans": [[16, "matrix"]],
"(method 34 was-squad-control)": [
[16, "cquery-with-vec"],
[576, ["inline-array", "vector", 2]],
[592, "mystery-traffic-object-spawn-params0"]
],
"(method 9 race-control)": [[16, "race-mesh-slice-query"]],
"(method 9 race-path)": [[16, "vector"]],
"(method 10 race-path)": [[16, ["inline-array", "vector", 4]]],
"(method 11 race-path)": [[16, ["inline-array", "race-path-sample", 6]]],
"(method 16 race-mesh)": [[16, "race-mesh-hash-search"]],
"(method 12 race-path)": [[16, "matrix"]],
"(method 18 race-mesh)": [[16, "race-mesh-slice-query"]],
"(method 17 race-mesh)": [[16, "race-mesh-slice-query"]],
"sparticle-motion-blur-dirt": [[16, "matrix"]],
"check-scorp-shell-level1": [[16, "vector"]],
"check-scorp-shell-level2": [[16, "vector"]],
"(method 22 turbo-pickup)": [[16, "cquery-with-vec"]],
"(method 17 tire-trail)": [[16, "matrix"]],
"(method 200 wvehicle)": [[16, "wvehicle-physics-work"]],
"(method 38 wvehicle)": [
[16, "wvehicle-stack-type5"],
[112, "wvehicle-stack-type7"],
[272, "wvehicle-stack-type5"],
[304, "matrix"]
],
"(method 24 w-parking-spot)": [[16, "cquery-with-5vec"]],
"(method 79 v-scorpion)": [
[32, ["inline-array", "quaternion", 2]],
[16, "vector"],
[80, "wvehicle-physics-work"]
],
"(method 169 v-scorpion)": [[16, "wcar-rhino-proj-params"]],
"(method 169 v-toad)": [[16, "wcar-toad-stack-var0"]],
"(method 79 v-toad)": [
[16, ["inline-array", "quaternion", 2]],
[48, ["inline-array", "quaternion", 1]],
[64, "wvehicle-physics-work"]
],
"(method 203 v-toad)": [[16, "wvehicle-physics-work"]],
"(method 169 v-rhino)": [[16, "wcar-rhino-proj-params"]],
"(method 169 v-mirage)": [[16, "wcar-toad-stack-var0"]],
"(method 79 v-rhino)": [
[16, ["inline-array", "quaternion", 2]],
[48, ["inline-array", "quaternion", 1]],
[64, ["inline-array", "quaternion", 2]]
],
"(method 17 turret-control)": [[16, "turret-control-stack-var0"]],
"(method 9 turret-control)": [[16, "turret-control-stack-var1"]]
}
File diff suppressed because it is too large Load Diff
@@ -1988,5 +1988,28 @@
"vars": {
"t1-2": ["name", "sound-name"]
}
},
"(method 18 level)": {
"vars": {
"s5-0": "mem-mode",
"a0-31": "lev",
"sv-32": "mask",
"sv-20": "memory-unused?"
}
},
"(method 119 nav-enemy)": {
"vars": {
"a1-13": ["cspec", "collide-spec"]
}
},
"(method 216 saberfish)": {
"vars": {
"s4-1": ["s4-1", "saberfish-command"]
}
},
"find-behavior<-in-water?": {
"vars": {
"v0-0": ["v0-0", "saberfish-find-behavior"]
}
}
}
+21
View File
@@ -7,6 +7,7 @@
#include "common/type_system/defenum.h"
#include "common/type_system/deftype.h"
#include "common/util/string_util.h"
#include <common/goos/Printer.h>
#include "decompiler/Disasm/Register.h"
@@ -70,6 +71,26 @@ void DecompilerTypeSystem::parse_type_defs(const std::vector<std::string>& file_
}
symbol_metadata.definition_info = m_reader.db.get_short_info_for(o);
add_symbol(sym_name.as_symbol().name_ptr, parse_typespec(&ts, sym_type), symbol_metadata);
} else if (car(o).as_symbol() == "def-event-handler") {
auto symbol_metadata = DefinitionMetadata();
auto* rest = &cdr(o);
auto sym_name = car(*rest);
rest = &cdr(*rest);
// check for docstring
if (rest->is_pair() && car(*rest).is_string()) {
symbol_metadata.docstring = str_util::trim_newline_indents(car(*rest).as_string()->data);
rest = &cdr(*rest);
}
if (!cdr(*rest).is_empty_list()) {
throw std::runtime_error("malformed def-event-handler");
}
auto behavior_tag = std::string(car(*rest).as_symbol().name_ptr);
std::vector<std::string> signature = {
"function", "process", "int", "symbol", "event-message-block",
"object", ":behavior", behavior_tag};
auto sym_type = pretty_print::build_list(signature);
symbol_metadata.definition_info = m_reader.db.get_short_info_for(o);
add_symbol(sym_name.as_symbol().name_ptr, parse_typespec(&ts, sym_type), symbol_metadata);
} else if (car(o).as_symbol() == "deftype") {
auto dtr = parse_deftype(cdr(o), &ts);
dtr.type_info->m_metadata.definition_info = m_reader.db.get_short_info_for(o);
+18
View File
@@ -994,6 +994,24 @@ const std::unordered_map<
{{"data", ArrayFieldDecompMeta(TypeSpec("actor-cshape-ptr"),
16,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{"nav-mesh",
{{"poly-array", ArrayFieldDecompMeta(TypeSpec("nav-poly"), 64)},
{"nav-control-array", ArrayFieldDecompMeta(TypeSpec("nav-control"), 288)}}},
{"enemy-info",
{{"idle-anim-script",
ArrayFieldDecompMeta(TypeSpec("idle-control-frame"),
32,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{"nav-enemy-info",
{{"idle-anim-script",
ArrayFieldDecompMeta(TypeSpec("idle-control-frame"),
32,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
{"vehicle-rider-info",
{{"attach-point-array",
ArrayFieldDecompMeta(TypeSpec("vehicle-attach-point"),
32,
ArrayFieldDecompMeta::Kind::REF_TO_INLINE_ARR)}}},
}}};
goos::Object decompile_structure(const TypeSpec& type,
+5
View File
@@ -30,6 +30,7 @@ set(RUNTIME_SOURCE
graphics/gfx_test.cpp
graphics/gfx.cpp
graphics/jak2_texture_remap.cpp
graphics/jak3_texture_remap.cpp
graphics/opengl_renderer/background/background_common.cpp
graphics/opengl_renderer/background/Shrub.cpp
graphics/opengl_renderer/background/TFragment.cpp
@@ -203,6 +204,10 @@ set(RUNTIME_SOURCE
mips2c/jak3_functions/spatial_hash.cpp
mips2c/jak3_functions/sparticle.cpp
mips2c/jak3_functions/sparticle_launcher.cpp
mips2c/jak3_functions/nav_control.cpp
mips2c/jak3_functions/nav_engine.cpp
mips2c/jak3_functions/merc_blend_shape.cpp
mips2c/jak3_functions/wvehicle_part.cpp
mips2c/mips2c_table.cpp
overlord/common/dma.cpp
overlord/common/fake_iso.cpp
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
#pragma once
int lookup_jak3_texture_dest_offset(int tpage, int texture_idx);
@@ -818,7 +818,7 @@ void DirectRenderer::handle_ad(const u8* data,
handle_scissor(value);
break;
case GsRegisterAddress::XYOFFSET_1:
ASSERT(render_state->version == GameVersion::Jak2); // hardcoded jak 2 scissor vals in handle
ASSERT(render_state->version >= GameVersion::Jak2); // hardcoded jak 2 scissor vals in handle
handle_xyoffset(value);
break;
case GsRegisterAddress::COLCLAMP:
@@ -277,6 +277,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<TextureUploadHandler>("tex-sprite", BucketCategory::TEX,
BucketId::TEX_SPRITE, texture_animator);
init_bucket_renderer<Sprite3>("particles", BucketCategory::SPRITE, BucketId::PARTICLES);
init_bucket_renderer<Generic2BucketRenderer>("generic-sprite-3", BucketCategory::OTHER,
BucketId::GENERIC_SPRITE_3, m_generic2,
Generic2::Mode::LIGHTNING);
// 575
init_bucket_renderer<TextureUploadHandler>("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP,
texture_animator);
@@ -289,10 +292,14 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
init_bucket_renderer<TextureUploadHandler>("tex-hud-hud-alpha", BucketCategory::TEX,
BucketId::TEX_HUD_HUD_ALPHA, texture_animator);
init_bucket_renderer<ProgressRenderer>("hud-draw-hud-alpha", BucketCategory::OTHER,
BucketId::HUD_DRAW_HUD_ALPHA, 0x8000);
init_bucket_renderer<TextureUploadHandler>("tex-hud-pris2", BucketCategory::TEX,
BucketId::TEX_HUD_PRIS2, texture_animator);
init_bucket_renderer<ProgressRenderer>("hud-draw-hud-alpha", BucketCategory::OTHER,
BucketId::HUD_DRAW_HUD_ALPHA, 0x1000);
init_bucket_renderer<TextureUploadHandler>("hud-draw-pris2", BucketCategory::TEX,
BucketId::HUD_DRAW_PRIS2, texture_animator);
init_bucket_renderer<ProgressRenderer>("progress", BucketCategory::OTHER, BucketId::BUCKET582,
0x8000);
// 583
init_bucket_renderer<DirectRenderer>("debug", BucketCategory::OTHER, BucketId::DEBUG, 0x8000);
+1
View File
@@ -417,6 +417,7 @@ enum class BucketId {
BUCKET_2 = 2,
BLIT_START = 3,
TEX_LCOM_SKY_PRE = 4,
OCEAN_MID_FAR = 6,
TEX_L0_TFRAG = 10,
TFRAG_L0_TFRAG = 11,
+4
View File
@@ -173,6 +173,10 @@ bool file_is_present(int id, int bank = 0) {
*/
void pc_update_card() {
// int highest_save_count = 0;
// TODO handle jak 3
if (g_game_version == GameVersion::Jak3) {
return;
}
mc_last_file = -1;
for (s32 file = 0; file < 4; file++) {
auto bankname = mc_get_filename(g_game_version, 4 + file * 2);
+2 -1
View File
@@ -5,6 +5,7 @@
#include "common/symbols.h"
#include "game/graphics/gfx.h"
#include "game/graphics/jak3_texture_remap.h"
#include "game/graphics/sceGraphicsInterface.h"
#include "game/kernel/common/fileio.h"
#include "game/kernel/common/kdgo.h"
@@ -397,7 +398,7 @@ void InitMachine_PCPort() {
make_function_symbol_from_c("__pc-set-levels", (void*)pc_set_levels);
make_function_symbol_from_c("__pc-set-active-levels", (void*)pc_set_active_levels);
// make_function_symbol_from_c("__pc-get-tex-remap", (void*)lookup_jak2_texture_dest_offset);
make_function_symbol_from_c("__pc-get-tex-remap", (void*)lookup_jak3_texture_dest_offset);
// make_function_symbol_from_c("pc-init-autosplitter-struct", (void*)init_autosplit_struct);
// make_function_symbol_from_c("pc-encode-utf8-string", (void*)encode_utf8_string);
@@ -0,0 +1,598 @@
//--------------------------MIPS2C---------------------
#include <mutex>
#include "common/global_profiler/GlobalProfiler.h"
#include "game/kernel/jak3/kscheme.h"
#include "game/mips2c/mips2c_private.h"
// clang-format off
extern std::mutex g_merc_data_mutex;
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace blerc_execute {
struct Cache {
void* blerc_globals; // *blerc-globals*
void* fake_scratchpad_data; // *fake-scratchpad-data*
void* gsf_buffer; // *gsf-buffer*
void* stats_blerc; // *stats-blerc*
void* flush_cache; // flush-cache
} cache;
u64 execute(void* ctxt) {
[[maybe_unused]] bool hit18 = false;
[[maybe_unused]] bool hit19 = false;
auto pp = scoped_prof("blerc-exec");
std::unique_lock<std::mutex> lk(g_merc_data_mutex);
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
u32 madr, sadr, qwc, tadr;
c->daddiu(sp, sp, -96); // daddiu sp, sp, -96
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s2, 16, sp); // sq s2, 16(sp)
c->sq(s3, 32, sp); // sq s3, 32(sp)
c->sq(s4, 48, sp); // sq s4, 48(sp)
c->sq(s5, 64, sp); // sq s5, 64(sp)
c->sq(gp, 80, sp); // sq gp, 80(sp)
c->load_symbol2(v1, cache.blerc_globals); // lw v1, *blerc-globals*(s7)
c->lwu(s5, 0, v1); // lwu s5, 0(v1)
bc = c->sgpr64(s5) == 0; // beq s5, r0, L55
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_33;} // branch non-likely
c->addiu(v1, r0, 0); // addiu v1, r0, 0
c->addiu(gp, r0, 0); // addiu gp, r0, 0
c->addiu(v1, r0, 0); // addiu v1, r0, 0
c->load_symbol2(v1, cache.gsf_buffer); // lw v1, *gsf-buffer*(s7)
c->load_symbol2(t9, cache.flush_cache); // lw t9, flush-cache(s7)
c->addiu(a0, r0, 0); // addiu a0, r0, 0
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->addiu(v1, r0, 848); // addiu v1, r0, 848
get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672
c->daddu(a1, v1, a0); // daddu a1, v1, a0
c->load_symbol2(v1, cache.blerc_globals); // lw v1, *blerc-globals*(s7)
c->daddu(v1, r0, v1); // daddu v1, r0, v1
// nop // sll r0, r0, 0
c->lui(a0, 4096); // lui a0, 4096
// nop // sll r0, r0, 0
c->ori(a0, a0, 54272); // ori a0, a0, 54272
c->andi(a1, a1, 16383); // andi a1, a1, 16383
// block_2:
// c->lw(a2, 0, a0); // lw a2, 0(a0)
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// c->andi(a2, a2, 256); // andi a2, a2, 256
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a2) != 0; // bne a2, r0, L37
// c->lw(a2, 0, v1); // lw a2, 0(v1)
// if (bc) {goto block_2;} // branch non-likely
c->lw(a2, 0, v1);
bc = c->sgpr64(a2) == 0; // beq a2, r0, L38
// c->sw(a1, 128, a0); // sw a1, 128(a0)
sadr = c->sgpr64(a1);
if (bc) {goto block_5;} // branch non-likely
c->addiu(v1, r0, 324); // addiu v1, r0, 324
// c->sw(a2, 48, a0); // sw a2, 48(a0)
tadr = c->sgpr64(a2);
// c->sw(r0, 32, a0); // sw r0, 32(a0)
// Unknown instr: sync.l
// c->sw(v1, 0, a0); // sw v1, 0(a0)
spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr, tadr);
// Unknown instr: sync.l
block_5:
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
//beq r0, r0, L54 // beq r0, r0, L54
// nop // sll r0, r0, 0
goto block_31; // branch always
block_6:
bc = c->sgpr64(gp) != 0; // bne gp, r0, L40
// nop // sll r0, r0, 0
if (bc) {goto block_8;} // branch non-likely
get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672
c->daddu(a0, r0, v1); // daddu a0, r0, v1
//beq r0, r0, L41 // beq r0, r0, L41
// nop // sll r0, r0, 0
goto block_9; // branch always
block_8:
c->addiu(v1, r0, 8192); // addiu v1, r0, 8192
get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672
c->daddu(a0, v1, a0); // daddu a0, v1, a0
block_9:
bc = c->sgpr64(gp) != 0; // bne gp, r0, L42
// nop // sll r0, r0, 0
if (bc) {goto block_11;} // branch non-likely
c->addiu(v1, r0, 8192); // addiu v1, r0, 8192
get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672
c->daddu(a1, v1, a1); // daddu a1, v1, a1
//beq r0, r0, L43 // beq r0, r0, L43
// nop // sll r0, r0, 0
goto block_12; // branch always
block_11:
get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672
c->daddu(a1, r0, v1); // daddu a1, r0, v1
block_12:
c->daddiu(v1, a0, 848); // daddiu v1, a0, 848
c->daddu(a2, r0, a0); // daddu a2, r0, a0
c->daddiu(a3, a1, 848); // daddiu a3, a1, 848
c->daddiu(a1, v1, 12); // daddiu a1, v1, 12
// nop // sll r0, r0, 0
c->lui(a2, 4096); // lui a2, 4096
// nop // sll r0, r0, 0
c->ori(a2, a2, 54272); // ori a2, a2, 54272
c->andi(a3, a3, 16383); // andi a3, a3, 16383
// block_13:
// c->lw(t0, 0, a2); // lw t0, 0(a2)
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// c->andi(t0, t0, 256); // andi t0, t0, 256
// // nop // sll r0, r0, 0
// bc = c->sgpr64(t0) != 0; // bne t0, r0, L44
// c->lw(t0, 0, a1); // lw t0, 0(a1)
// if (bc) {goto block_13;} // branch non-likely
c->lw(t0, 0, a1);
bc = c->sgpr64(t0) == 0; // beq t0, r0, L45
// c->sw(a3, 128, a2); // sw a3, 128(a2)
sadr = c->sgpr64(a3);
if (bc) {goto block_16;} // branch non-likely
c->addiu(a1, r0, 324); // addiu a1, r0, 324
// c->sw(t0, 48, a2); // sw t0, 48(a2)
tadr = c->sgpr64(t0);
// c->sw(r0, 32, a2); // sw r0, 32(a2)
// Unknown instr: sync.l
// c->sw(a1, 0, a2); // sw a1, 0(a2)
// Unknown instr: sync.l
// tadr here is bogus, it's reading something uploaded by the other transfer.
spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr, tadr);
block_16:
c->gprs[a1].du64[0] = 0; // or a1, r0, r0
c->mov64(a2, a0); // or a2, a0, r0
c->load_symbol2(a3, cache.gsf_buffer); // lw a3, *gsf-buffer*(s7)
// blerc_c(g_ee_main_mem + c->sgpr64(a2), g_ee_main_mem + c->sgpr64(a3));
c->daddiu(t2, a2, 880); // daddiu t2, a2, 880
c->lb(t1, 0, t2); // lb t1, 0(t2)
// nop // sll r0, r0, 0
c->mov64(t0, a2); // or t0, a2, r0
c->lw(a1, 868, a2); // lw a1, 868(a2)
c->daddiu(t3, t1, 1); // daddiu t3, t1, 1
c->mov64(t1, a3); // or t1, a3, r0
c->sll(t8, t3, 4); // sll t8, t3, 4
c->sll(t3, a1, 4); // sll t3, a1, 4
c->daddu(t9, t3, a3); // daddu t9, t3, a3
c->daddu(t3, t2, t8); // daddu t3, t2, t8
bc = c->sgpr64(a1) == 0; // beq a1, r0, L48
c->daddiu(ra, t2, 16); // daddiu ra, t2, 16
if (bc) {goto block_21;} // branch non-likely
c->lh(t5, 12, t3); // lh t5, 12(t3)
c->daddu(t2, t3, t8); // daddu t2, t3, t8
//beq r0, r0, L47 // beq r0, r0, L47
// nop // sll r0, r0, 0
goto block_19; // branch always
block_18:
hit18 = true;
c->lh(t5, 12, t2); // lh t5, 12(t2)
c->daddu(t2, t2, t8); // daddu t2, t2, t8
c->sq(t6, 0, t1); // sq t6, 0(t1)
c->daddiu(t1, t1, 16); // daddiu t1, t1, 16
block_19:
hit19 = true;
c->pcpyh(t5, t5); // pcpyh t5, t5
c->mfc1(r0, f31); // mfc1 r0, f31
bc = c->sgpr64(t1) != c->sgpr64(t9); // bne t1, t9, L46
c->pcpyld(t6, t5, t5); // pcpyld t6, t5, t5
if (bc) {goto block_18;} // branch non-likely
c->dsubu(t3, t2, t8); // dsubu t3, t2, t8
// nop // sll r0, r0, 0
block_21:
c->addiu(t1, r0, 255); // addiu t1, r0, 255
c->addiu(t2, r0, 8192); // addiu t2, r0, 8192
c->lb(s5, 0, t3); // lb s5, 0(t3)
c->daddiu(s4, t3, 16); // daddiu s4, t3, 16
c->pcpyh(t1, t1); // pcpyh t1, t1
c->mfc1(r0, f31); // mfc1 r0, f31
c->pcpyld(t1, t1, t1); // pcpyld t1, t1, t1
c->mfc1(r0, f31); // mfc1 r0, f31
c->pcpyh(t2, t2); // pcpyh t2, t2
c->mfc1(r0, f31); // mfc1 r0, f31
c->pcpyld(t2, t2, t2); // pcpyld t2, t2, t2
c->mfc1(r0, f31); // mfc1 r0, f31
c->mov128_gpr_gpr(t3, t1); // por t3, t1, r0
c->mfc1(r0, f31); // mfc1 r0, f31
c->mov128_gpr_gpr(t4, r0); // por t4, r0, r0
c->mfc1(r0, f31); // mfc1 r0, f31
block_22:
c->ld(t6, 0, ra); // ld t6, 0(ra)
c->daddu(s2, ra, t8); // daddu s2, ra, t8
c->daddiu(ra, ra, 8); // daddiu ra, ra, 8
c->mov64(s3, a3); // or s3, a3, r0
c->pextlb(t6, r0, t6); // pextlb t6, r0, t6
c->mfc1(r0, f31); // mfc1 r0, f31
c->pmulth(t7, t6, t2); // pmulth t7, t6, t2
c->ld(t5, 0, s2); // ld t5, 0(s2)
c->daddiu(s5, s5, -1); // daddiu s5, s5, -1
// nop // sll r0, r0, 0
//beq r0, r0, L51 // beq r0, r0, L51
c->daddu(s2, s2, t8); // daddu s2, s2, t8
goto block_24; // branch always
block_23:
c->pmaddh(t7, t5, t6); // pmaddh t7, t5, t6
c->ld(t5, 0, s2); // ld t5, 0(s2)
c->daddu(s2, s2, t8); // daddu s2, s2, t8
c->daddiu(s3, s3, 16); // daddiu s3, s3, 16
block_24:
c->lq(t6, 0, s3); // lq t6, 0(s3)
c->pextlb(t5, t5, r0); // pextlb t5, t5, r0
bc = c->sgpr64(s3) != c->sgpr64(t9); // bne s3, t9, L50
c->psrah(t5, t5, 8); // psrah t5, t5, 8
if (bc) {goto block_23;} // branch non-likely
// Unknown instr: pmfhl.uw t5
c->gprs[t5].du32[0] = c->lo.du32[1];
c->gprs[t5].du32[1] = c->hi.du32[1];
c->gprs[t5].du32[2] = c->lo.du32[3];
c->gprs[t5].du32[3] = c->hi.du32[3];
c->mfc1(r0, f31); // mfc1 r0, f31
c->psraw(t7, t7, 13); // psraw t7, t7, 13
c->mfc1(r0, f31); // mfc1 r0, f31
c->psraw(t5, t5, 13); // psraw t5, t5, 13
c->mfc1(r0, f31); // mfc1 r0, f31
c->pinteh(t5, t5, t7); // pinteh t5, t5, t7
c->mfc1(r0, f31); // mfc1 r0, f31
c->pminh(t3, t3, t5); // pminh t3, t3, t5
c->mfc1(r0, f31); // mfc1 r0, f31
c->pmaxh(t4, t4, t5); // pmaxh t4, t4, t5
c->mfc1(r0, f31); // mfc1 r0, f31
c->pminh(t5, t5, t1); // pminh t5, t5, t1
c->mfc1(r0, f31); // mfc1 r0, f31
c->pmaxh(t5, t5, r0); // pmaxh t5, t5, r0
c->lq(t7, 0, s4); // lq t7, 0(s4)
c->ppacb(t5, r0, t5); // ppacb t5, r0, t5
c->mfc1(r0, f31); // mfc1 r0, f31
c->ppach(t7, r0, t7); // ppach t7, r0, t7
c->mfc1(r0, f31); // mfc1 r0, f31
c->pextlh(t5, t5, t7); // pextlh t5, t5, t7
c->mfc1(r0, f31); // mfc1 r0, f31
// store modified vertex
c->sq(t5, 0, t0); // sq t5, 0(t0)
c->daddiu(t0, t0, 16); // daddiu t0, t0, 16
bc = c->sgpr64(s5) != 0; // bne s5, r0, L49
c->daddiu(s4, s4, 16); // daddiu s4, s4, 16
if (bc) {goto block_22;} // branch non-likely
// end of blerc_c stuff
c->load_symbol2(a3, cache.stats_blerc); // lw a3, *stats-blerc*(s7)
bc = c->sgpr64(a3) == c->sgpr64(s7); // beq a3, s7, L52
c->load_symbol2(a3, cache.blerc_globals); // lw a3, *blerc-globals*(s7)
if (bc) {goto block_28;} // branch non-likely
c->lw(t2, 12, a3); // lw t2, 12(a3)
c->lw(t1, 16, a3); // lw t1, 16(a3)
c->lw(t0, 20, a3); // lw t0, 20(a3)
c->lw(a2, 864, a2); // lw a2, 864(a2)
c->multu3(a1, a1, a2); // multu3 a1, a1, a2
c->daddiu(t2, t2, 1); // daddiu t2, t2, 1
c->daddu(a2, t1, a2); // daddu a2, t1, a2
c->daddu(a1, t0, a1); // daddu a1, t0, a1
c->sw(t2, 12, a3); // sw t2, 12(a3)
c->sw(a2, 16, a3); // sw a2, 16(a3)
c->sw(a1, 20, a3); // sw a1, 20(a3)
c->pcpyud(a1, t3, r0); // pcpyud a1, t3, r0
c->pminh(t3, t3, a1); // pminh t3, t3, a1
c->dsrl32(a1, t3, 0); // dsrl32 a1, t3, 0
c->pminh(t3, t3, a1); // pminh t3, t3, a1
c->dsrl(t3, t3, 16); // dsrl t3, t3, 16
c->lh(a1, 8, a3); // lh a1, 8(a3)
c->pminh(t3, t3, a1); // pminh t3, t3, a1
c->sh(t3, 8, a3); // sh t3, 8(a3)
c->pcpyud(a1, t4, r0); // pcpyud a1, t4, r0
c->pmaxh(t4, t4, a1); // pmaxh t4, t4, a1
c->dsrl32(a1, t4, 0); // dsrl32 a1, t4, 0
c->pmaxh(t4, t4, a1); // pmaxh t4, t4, a1
c->dsrl(t4, t4, 16); // dsrl t4, t4, 16
c->lh(a1, 10, a3); // lh a1, 10(a3)
c->pmaxh(t4, t4, a1); // pmaxh t4, t4, a1
c->sh(t4, 10, a3); // sh t4, 10(a3)
block_28:
c->gprs[a1].du64[0] = 0; // or a1, r0, r0
c->lwu(a1, 872, a0); // lwu a1, 872(a0)
c->mov64(a3, a0); // or a3, a0, r0
c->lwu(a0, 876, a0); // lwu a0, 876(a0)
c->lui(a2, 4096); // lui a2, 4096
// nop // sll r0, r0, 0
c->ori(a2, a2, 53248); // ori a2, a2, 53248
c->andi(a3, a3, 16383); // andi a3, a3, 16383
// block_29:
// c->lw(t0, 0, a2); // lw t0, 0(a2)
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// c->andi(t0, t0, 256); // andi t0, t0, 256
// // nop // sll r0, r0, 0
// bc = c->sgpr64(t0) != 0; // bne t0, r0, L53
// // nop // sll r0, r0, 0
// if (bc) {goto block_29;} // branch non-likely
// c->sw(a3, 128, a2); // sw a3, 128(a2)
sadr = c->sgpr64(a3);
c->addiu(a3, r0, 256); // addiu a3, r0, 256
// c->sw(a1, 16, a2); // sw a1, 16(a2)
madr = c->sgpr64(a1);
// nop // sll r0, r0, 0
// c->sw(a0, 32, a2); // sw a0, 32(a2)
qwc = c->sgpr64(a0);
// Unknown instr: sync.l
// c->sw(a3, 0, a2); // sw a3, 0(a2)
// fmt::print("blerc download 0x{:x} <- 0x{:x} ({} qwc)\n", madr, sadr, qwc);
{
spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc);
}
// Unknown instr: sync.l
c->gprs[a0].du64[0] = 0; // or a0, r0, r0
c->addiu(a0, r0, 1); // addiu a0, r0, 1
c->dsubu(gp, a0, gp); // dsubu gp, a0, gp
c->lwu(s5, 12, v1); // lwu s5, 12(v1)
c->mov64(v1, s5); // or v1, s5, r0
block_31:
bc = c->sgpr64(s5) != 0; // bne s5, r0, L39
// nop // sll r0, r0, 0
if (bc) {goto block_6;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_33:
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lq(gp, 80, sp); // lq gp, 80(sp)
c->lq(s5, 64, sp); // lq s5, 64(sp)
c->lq(s4, 48, sp); // lq s4, 48(sp)
c->lq(s3, 32, sp); // lq s3, 32(sp)
c->lq(s2, 16, sp); // lq s2, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 96); // daddiu sp, sp, 96
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.blerc_globals = intern_from_c(-1, 0, "*blerc-globals*").c();
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
cache.gsf_buffer = intern_from_c(-1, 0, "*gsf-buffer*").c();
cache.stats_blerc = intern_from_c(-1, 0, "*stats-blerc*").c();
cache.flush_cache = intern_from_c(-1, 0, "flush-cache").c();
gLinkedFunctionTable.reg("blerc-execute", execute, 256);
}
} // namespace blerc_execute
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace setup_blerc_chains_for_one_fragment {
struct Cache {
void* blerc_globals; // *blerc-globals*
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->daddiu(sp, sp, -128); // daddiu sp, sp, -128
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s0, 16, sp); // sq s0, 16(sp)
c->sq(s1, 32, sp); // sq s1, 32(sp)
c->sq(s2, 48, sp); // sq s2, 48(sp)
c->sq(s3, 64, sp); // sq s3, 64(sp)
c->sq(s4, 80, sp); // sq s4, 80(sp)
c->sq(s5, 96, sp); // sq s5, 96(sp)
c->sq(gp, 112, sp); // sq gp, 112(sp)
c->lb(v1, 0, t0); // lb v1, 0(t0)
c->addiu(t2, r0, 0); // addiu t2, r0, 0
c->mov128_gpr_gpr(t7, r0); // por t7, r0, r0
c->load_symbol2(t3, cache.blerc_globals); // lw t3, *blerc-globals*(s7)
c->lw(t3, 4, t3); // lw t3, 4(t3)
c->mov64(t4, v1); // or t4, v1, r0
block_1:
c->lui(t7, 4096); // lui t7, 4096
// nop // sll r0, r0, 0
c->daddiu(t7, t7, 1); // daddiu t7, t7, 1
// nop // sll r0, r0, 0
bc = c->sgpr64(t3) == 0; // beq t3, r0, L11
c->sq(t7, 0, a2); // sq t7, 0(a2)
if (bc) {goto block_3;} // branch non-likely
c->sw(a2, 12, t3); // sw a2, 12(t3)
// nop // sll r0, r0, 0
block_3:
c->mov64(t3, a2); // or t3, a2, r0
c->daddu(t6, t4, t4); // daddu t6, t4, t4
c->daddu(t5, v1, v1); // daddu t5, v1, v1
c->daddu(t6, t6, t4); // daddu t6, t6, t4
c->daddu(t7, t5, v1); // daddu t7, t5, v1
c->daddu(t5, t6, t6); // daddu t5, t6, t6
c->daddu(t6, t7, t7); // daddu t6, t7, t7
c->daddu(t7, t5, t5); // daddu t7, t5, t5
c->daddiu(t6, t6, 15); // daddiu t6, t6, 15
c->daddiu(t5, t5, 15); // daddiu t5, t5, 15
c->andi(t6, t6, 65520); // andi t6, t6, 65520
c->dsrl(t5, t5, 4); // dsrl t5, t5, 4
c->daddu(t8, t2, t2); // daddu t8, t2, t2
c->daddiu(t7, t7, 15); // daddiu t7, t7, 15
c->daddu(t9, t8, t2); // daddu t9, t8, t2
c->dsrl(t8, t7, 4); // dsrl t8, t7, 4
c->daddu(ra, t9, t9); // daddu ra, t9, t9
c->addiu(t9, r0, 0); // addiu t9, r0, 0
c->daddu(t7, ra, ra); // daddu t7, ra, ra
c->daddiu(s3, a2, 32); // daddiu s3, a2, 32
c->daddu(s2, ra, a3); // daddu s2, ra, a3
c->daddu(ra, t7, t1); // daddu ra, t7, t1
c->lui(t7, 12288); // lui t7, 12288
c->daddiu(gp, a0, -1); // daddiu gp, a0, -1
c->daddu(t7, t7, t5); // daddu t7, t7, t5
c->mov64(s5, a1); // or s5, a1, r0
c->sq(t7, 0, s3); // sq t7, 0(s3)
c->daddiu(s4, t0, 2); // daddiu s4, t0, 2
c->sw(s2, 4, s3); // sw s2, 4(s3)
c->daddu(s2, s2, t6); // daddu s2, s2, t6
c->daddiu(s3, s3, 16); // daddiu s3, s3, 16
// nop // sll r0, r0, 0
block_4:
c->lb(s1, 0, s4); // lb s1, 0(s4)
c->daddiu(s4, s4, 1); // daddiu s4, s4, 1
c->lh(s0, 0, s5); // lh s0, 0(s5)
c->daddiu(s5, s5, 2); // daddiu s5, s5, 2
bc = c->sgpr64(s1) == 0; // beq s1, r0, L13
c->sq(t7, 0, s3); // sq t7, 0(s3)
if (bc) {goto block_7;} // branch non-likely
c->sw(s2, 4, s3); // sw s2, 4(s3)
c->daddu(s2, s2, t6); // daddu s2, s2, t6
bc = c->sgpr64(s0) == 0; // beq s0, r0, L13
c->sw(s0, 12, s3); // sw s0, 12(s3)
if (bc) {goto block_7;} // branch non-likely
c->daddiu(s3, s3, 16); // daddiu s3, s3, 16
c->daddiu(t9, t9, 1); // daddiu t9, t9, 1
block_7:
bc = c->sgpr64(gp) != 0; // bne gp, r0, L12
c->daddiu(gp, gp, -1); // daddiu gp, gp, -1
if (bc) {goto block_4;} // branch non-likely
c->sq(t7, 0, s3); // sq t7, 0(s3)
c->mov128_gpr_gpr(t6, r0); // por t6, r0, r0
c->sw(ra, 4, s3); // sw ra, 4(s3)
get_fake_spad_addr2(t6, cache.fake_scratchpad_data, 0, c);// lui t6, 28672
c->sb(t8, 0, s3); // sb t8, 0(s3)
// nop // sll r0, r0, 0
c->sq(t6, 16, s3); // sq t6, 16(s3)
c->daddiu(t6, s3, 32); // daddiu t6, s3, 32
c->sw(t9, 20, a2); // sw t9, 20(a2)
// nop // sll r0, r0, 0
c->sw(t4, 16, a2); // sw t4, 16(a2)
// nop // sll r0, r0, 0
c->sw(ra, 24, a2); // sw ra, 24(a2)
// nop // sll r0, r0, 0
c->sw(t8, 28, a2); // sw t8, 28(a2)
// nop // sll r0, r0, 0
bc = c->sgpr64(t4) != c->sgpr64(v1); // bne t4, v1, L14
c->daddiu(t5, t5, 1); // daddiu t5, t5, 1
if (bc) {goto block_11;} // branch non-likely
c->daddiu(t7, t9, 3); // daddiu t7, t9, 3
c->multu3(t5, t5, t7); // multu3 t5, t5, t7
c->daddiu(t5, t5, -457); // daddiu t5, t5, -457
// nop // sll r0, r0, 0
bc = ((s64)c->sgpr64(t5)) <= 0; // blez t5, L14
// nop // sll r0, r0, 0
if (bc) {goto block_11;} // branch non-likely
//beq r0, r0, L10 // beq r0, r0, L10
c->addiu(t4, r0, 24); // addiu t4, r0, 24
goto block_1; // branch always
block_11:
c->mov64(a2, t6); // or a2, t6, r0
c->daddu(t2, t2, t4); // daddu t2, t2, t4
bc = c->sgpr64(t2) == c->sgpr64(v1); // beq t2, v1, L15
c->daddu(t5, t2, t4); // daddu t5, t2, t4
if (bc) {goto block_14;} // branch non-likely
c->dsubu(t5, t5, v1); // dsubu t5, t5, v1
// nop // sll r0, r0, 0
bc = ((s64)c->sgpr64(t5)) <= 0; // blez t5, L10
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
//beq r0, r0, L10 // beq r0, r0, L10
c->dsubu(t4, v1, t2); // dsubu t4, v1, t2
goto block_1; // branch always
block_14:
c->load_symbol2(v1, cache.blerc_globals); // lw v1, *blerc-globals*(s7)
c->sw(t3, 4, v1); // sw t3, 4(v1)
c->mov64(v0, a2); // or v0, a2, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lq(gp, 112, sp); // lq gp, 112(sp)
c->lq(s5, 96, sp); // lq s5, 96(sp)
c->lq(s4, 80, sp); // lq s4, 80(sp)
c->lq(s3, 64, sp); // lq s3, 64(sp)
c->lq(s2, 48, sp); // lq s2, 48(sp)
c->lq(s1, 32, sp); // lq s1, 32(sp)
c->lq(s0, 16, sp); // lq s0, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 128); // daddiu sp, sp, 128
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.blerc_globals = intern_from_c(-1, 0, "*blerc-globals*").c();
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("setup-blerc-chains-for-one-fragment", execute, 256);
}
} // namespace setup_blerc_chains_for_one_fragment
} // namespace Mips2C
+274
View File
@@ -0,0 +1,274 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_39_nav_state {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
bool cop1_bc = false;
float acc;
c->daddiu(sp, sp, -96); // daddiu sp, sp, -96
c->swc1(f20, 80, sp); // swc1 f20, 80(sp)
c->swc1(f22, 84, sp); // swc1 f22, 84(sp)
c->lwc1(f0, 32, a0); // lwc1 f0, 32(a0)
c->lwu(v1, 4, a0); // lwu v1, 4(a0)
c->lwc1(f1, 28, v1); // lwc1 f1, 28(v1)
c->muls(f1, f0, f1); // mul.s f1, f0, f1
c->daddiu(v1, a0, 48); // daddiu v1, a0, 48
c->lwc1(f0, 0, v1); // lwc1 f0, 0(v1)
c->lwc1(f2, 0, v1); // lwc1 f2, 0(v1)
c->muls(f0, f0, f2); // mul.s f0, f0, f2
c->lwc1(f2, 8, v1); // lwc1 f2, 8(v1)
c->lwc1(f3, 8, v1); // lwc1 f3, 8(v1)
c->muls(f2, f2, f3); // mul.s f2, f2, f3
c->adds(f0, f0, f2); // add.s f0, f0, f2
c->sqrts(f0, f0); // sqrt.s f0, f0
c->mfc1(v1, f0); // mfc1 v1, f0
c->mtc1(f0, v1); // mtc1 f0, v1
c->daddiu(v1, sp, 16); // daddiu v1, sp, 16
c->daddiu(a1, sp, 32); // daddiu a1, sp, 32
c->lwu(a2, 12, a0); // lwu a2, 12(a0)
c->lwu(a3, 0, a2); // lwu a3, 0(a2)
c->lwu(a2, 12, a0); // lwu a2, 12(a0)
c->lwu(a2, 0, a2); // lwu a2, 0(a2)
c->lwc1(f2, 28, a2); // lwc1 f2, 28(a2)
cop1_bc = c->fprs[f2] < c->fprs[f0]; // c.lt.s f2, f0
bc = !cop1_bc; // bc1f L192
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_6;} // branch non-likely
c->mov64(a2, v1); // or a2, v1, r0
c->daddiu(t0, a0, 48); // daddiu t0, a0, 48
c->lui(t1, 16256); // lui t1, 16256
c->mtc1(f2, t1); // mtc1 f2, t1
c->divs(f2, f2, f0); // div.s f2, f2, f0
c->lqc2(vf1, 0, t0); // lqc2 vf1, 0(t0)
c->mfc1(t0, f2); // mfc1 t0, f2
c->mov128_vf_gpr(vf2, t0); // qmtc2.i vf2, t0
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, a2); // sqc2 vf1, 0(a2)
c->mtc1(f2, r0); // mtc1 f2, r0
c->swc1(f2, 4, v1); // swc1 f2, 4(v1)
c->mov64(a2, a1); // or a2, a1, r0
c->lwc1(f2, 16, a3); // lwc1 f2, 16(a3)
c->cvtws(f1, f1); // cvt.w.s f1, f1
c->mfc1(a3, f1); // mfc1 a3, f1
c->dsll32(a3, a3, 16); // dsll32 a3, a3, 16
c->dsra32(a3, a3, 16); // dsra32 a3, a3, 16
c->mtc1(f1, a3); // mtc1 f1, a3
c->cvtsw(f1, f1); // cvt.s.w f1, f1
c->muls(f1, f2, f1); // mul.s f1, f2, f1
c->lui(a3, 16255); // lui a3, 16255
c->lui(t0, -16854); // lui t0, -16854
c->ori(a3, a3, 65502); // ori a3, a3, 65502
c->ori(t0, t0, 43253); // ori t0, t0, 43253
c->subs(f22, f22, f22); // sub.s f22, f22, f22
c->lui(t1, 15368); // lui t1, 15368
c->mtc1(f10, a3); // mtc1 f10, a3
c->ori(a3, t1, 27638); // ori a3, t1, 27638
c->mtc1(f11, t0); // mtc1 f11, t0
c->lui(t0, -18099); // lui t0, -18099
c->muls(f2, f1, f1); // mul.s f2, f1, f1
c->ori(t0, t0, 8306); // ori t0, t0, 8306
c->mtc1(f12, a3); // mtc1 f12, a3
c->lui(a3, 13850); // lui a3, 13850
c->mtc1(f14, t0); // mtc1 f14, t0
c->ori(t0, a3, 41599); // ori t0, a3, 41599
// Unknown instr: mula.s f1, f10
acc = c->fprs[f1] * c->fprs[f10];
c->lui(a3, 16256); // lui a3, 16256
c->muls(f3, f2, f1); // mul.s f3, f2, f1
c->mov64(a3, a3); // or a3, a3, r0
c->muls(f4, f2, f2); // mul.s f4, f2, f2
c->lui(t1, -16641); // lui t1, -16641
c->mtc1(f15, t0); // mtc1 f15, t0
c->lui(t0, -16641); // lui t0, -16641
c->or_(t0, t1, t0); // or t0, t1, t0
c->mtc1(f16, a3); // mtc1 f16, a3
// nop // sll r0, r0, 0
c->mtc1(f17, t0); // mtc1 f17, t0
// nop // sll r0, r0, 0
c->muls(f5, f3, f2); // mul.s f5, f3, f2
// nop // sll r0, r0, 0
c->muls(f6, f3, f3); // mul.s f6, f3, f3
// nop // sll r0, r0, 0
c->muls(f7, f4, f3); // mul.s f7, f4, f3
// nop // sll r0, r0, 0
c->muls(f8, f4, f4); // mul.s f8, f4, f4
// nop // sll r0, r0, 0
c->muls(f9, f5, f4); // mul.s f9, f5, f4
c->lui(a3, 15658); // lui a3, 15658
// Unknown instr: madda.s f3, f11
acc += c->fprs[f3] * c->fprs[f11];
c->ori(a3, a3, 31272); // ori a3, a3, 31272
// Unknown instr: madda.s f5, f12
acc += c->fprs[f5] * c->fprs[f12];
c->lui(t0, -17742); // lui t0, -17742
// Unknown instr: madda.s f7, f14
acc += c->fprs[f7] * c->fprs[f14];
c->ori(t0, t0, 48177); // ori t0, t0, 48177
// Unknown instr: madd.s f21, f9, f15
c->fprs[f21] = acc + (c->fprs[f9] * c->fprs[f15]);
c->lui(t1, 14249); // lui t1, 14249
c->mtc1(f18, a3); // mtc1 f18, a3
c->ori(a3, t1, 13291); // ori a3, t1, 13291
c->mtc1(f19, t0); // mtc1 f19, t0
// nop // sll r0, r0, 0
c->mtc1(f20, a3); // mtc1 f20, a3
// nop // sll r0, r0, 0
// Unknown instr: mula.s f16, f16
acc = c->fprs[f16] * c->fprs[f16];
// nop // sll r0, r0, 0
// Unknown instr: madda.s f2, f17
acc += c->fprs[f2] * c->fprs[f17];
// nop // sll r0, r0, 0
// Unknown instr: madda.s f4, f18
acc += c->fprs[f4] * c->fprs[f18];
// nop // sll r0, r0, 0
// Unknown instr: madda.s f6, f19
acc += c->fprs[f6] * c->fprs[f19];
// nop // sll r0, r0, 0
// Unknown instr: madd.s f22, f8, f20
c->fprs[f22] = acc + (c->fprs[f8] * c->fprs[f20]);
// nop // sll r0, r0, 0
c->swc1(f21, 0, a2); // swc1 f21, 0(a2)
// nop // sll r0, r0, 0
c->swc1(f22, 4, a2); // swc1 f22, 4(a2)
c->gprs[a2].du64[0] = 0; // or a2, r0, r0
c->mov64(a3, v1); // or a3, v1, r0
c->daddiu(a2, a0, 144); // daddiu a2, a0, 144
c->lwc1(f1, 0, a3); // lwc1 f1, 0(a3)
c->lwc1(f2, 4, a3); // lwc1 f2, 4(a3)
c->lwc1(f3, 8, a3); // lwc1 f3, 8(a3)
c->lwc1(f4, 0, a2); // lwc1 f4, 0(a2)
c->lwc1(f5, 4, a2); // lwc1 f5, 4(a2)
c->lwc1(f6, 8, a2); // lwc1 f6, 8(a2)
// Unknown instr: mula.s f1, f4
// Unknown instr: madda.s f2, f5
// Unknown instr: madd.s f1, f3, f6
c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]);
c->mfc1(a2, f1); // mfc1 a2, f1
c->mtc1(f1, a2); // mtc1 f1, a2
c->lwc1(f2, 4, a1); // lwc1 f2, 4(a1)
cop1_bc = c->fprs[f1] < c->fprs[f2]; // c.lt.s f1, f2
bc = !cop1_bc; // bc1f L192
c->mov64(v0, s7); // or v0, s7, r0
if (bc) {goto block_6;} // branch non-likely
c->daddiu(a2, sp, 48); // daddiu a2, sp, 48
c->daddiu(a3, sp, 64); // daddiu a3, sp, 64
c->mov64(t0, a2); // or t0, a2, r0
c->daddiu(t1, a0, 144); // daddiu t1, a0, 144
c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1)
c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1)
c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1)
c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1)
c->muls(f5, f3, f2); // mul.s f5, f3, f2
c->muls(f6, f1, f4); // mul.s f6, f1, f4
c->adds(f5, f5, f6); // add.s f5, f5, f6
c->swc1(f5, 0, t0); // swc1 f5, 0(t0)
c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1)
c->swc1(f5, 4, t0); // swc1 f5, 4(t0)
c->muls(f3, f3, f4); // mul.s f3, f3, f4
c->muls(f1, f1, f2); // mul.s f1, f1, f2
c->subs(f1, f3, f1); // sub.s f1, f3, f1
c->swc1(f1, 8, t0); // swc1 f1, 8(t0)
c->mfc1(t0, f1); // mfc1 t0, f1
c->mov64(t0, a3); // or t0, a3, r0
c->daddiu(t1, a0, 144); // daddiu t1, a0, 144
c->lwc1(f1, 0, a1); // lwc1 f1, 0(a1)
c->negs(f1, f1); // neg.s f1, f1
c->lwc1(f3, 4, a1); // lwc1 f3, 4(a1)
c->lwc1(f2, 0, t1); // lwc1 f2, 0(t1)
c->lwc1(f4, 8, t1); // lwc1 f4, 8(t1)
c->muls(f5, f3, f2); // mul.s f5, f3, f2
c->muls(f6, f1, f4); // mul.s f6, f1, f4
c->adds(f5, f5, f6); // add.s f5, f5, f6
c->swc1(f5, 0, t0); // swc1 f5, 0(t0)
c->lwc1(f5, 4, t1); // lwc1 f5, 4(t1)
c->swc1(f5, 4, t0); // swc1 f5, 4(t0)
c->muls(f3, f3, f4); // mul.s f3, f3, f4
c->muls(f1, f1, f2); // mul.s f1, f1, f2
c->subs(f1, f3, f1); // sub.s f1, f3, f1
c->swc1(f1, 8, t0); // swc1 f1, 8(t0)
c->mfc1(a1, f1); // mfc1 a1, f1
c->mov64(t0, a2); // or t0, a2, r0
c->mov64(a1, v1); // or a1, v1, r0
c->lwc1(f1, 0, t0); // lwc1 f1, 0(t0)
c->lwc1(f2, 4, t0); // lwc1 f2, 4(t0)
c->lwc1(f3, 8, t0); // lwc1 f3, 8(t0)
c->lwc1(f4, 0, a1); // lwc1 f4, 0(a1)
c->lwc1(f5, 4, a1); // lwc1 f5, 4(a1)
c->lwc1(f6, 8, a1); // lwc1 f6, 8(a1)
// Unknown instr: mula.s f1, f4
// Unknown instr: madda.s f2, f5
// Unknown instr: madd.s f1, f3, f6
c->fprs[f1] = (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]) + (c->fprs[f1] * c->fprs[f4]);
c->mfc1(a1, f1); // mfc1 a1, f1
c->mtc1(f1, a1); // mtc1 f1, a1
c->mov64(t0, a3); // or t0, a3, r0
c->mov64(a1, v1); // or a1, v1, r0
c->lwc1(f2, 0, t0); // lwc1 f2, 0(t0)
c->lwc1(f3, 4, t0); // lwc1 f3, 4(t0)
c->lwc1(f4, 8, t0); // lwc1 f4, 8(t0)
c->lwc1(f5, 0, a1); // lwc1 f5, 0(a1)
c->lwc1(f6, 4, a1); // lwc1 f6, 4(a1)
c->lwc1(f7, 8, a1); // lwc1 f7, 8(a1)
// Unknown instr: mula.s f2, f5
// Unknown instr: madda.s f3, f6
// Unknown instr: madd.s f2, f4, f7
c->fprs[f2] = (c->fprs[f4] * c->fprs[f7]) + (c->fprs[f3] * c->fprs[f6]) + (c->fprs[f2] * c->fprs[f5]);
c->mfc1(a1, f2); // mfc1 a1, f2
c->mtc1(f2, a1); // mtc1 f2, a1
cop1_bc = c->fprs[f2] < c->fprs[f1]; // c.lt.s f2, f1
bc = !cop1_bc; // bc1f L190
// nop // sll r0, r0, 0
if (bc) {goto block_4;} // branch non-likely
c->mov64(a1, v1); // or a1, v1, r0
c->lq(a2, 0, a2); // lq a2, 0(a2)
c->sq(a2, 0, a1); // sq a2, 0(a1)
//beq r0, r0, L191 // beq r0, r0, L191
// nop // sll r0, r0, 0
goto block_5; // branch always
block_4:
c->mov64(a1, v1); // or a1, v1, r0
c->lq(a2, 0, a3); // lq a2, 0(a3)
c->sq(a2, 0, a1); // sq a2, 0(a1)
block_5:
c->daddiu(a0, a0, 48); // daddiu a0, a0, 48
c->lqc2(vf1, 0, v1); // lqc2 vf1, 0(v1)
c->mfc1(v1, f0); // mfc1 v1, f0
c->mov128_vf_gpr(vf2, v1); // qmtc2.i vf2, v1
c->vadd_bc(DEST::w, BC::x, vf1, vf0, vf0); // vaddx.w vf1, vf0, vf0
c->vmul_bc(DEST::xyz, BC::x, vf1, vf1, vf2); // vmulx.xyz vf1, vf1, vf2
c->sqc2(vf1, 0, a0); // sqc2 vf1, 0(a0)
c->daddiu(v0, s7, 4); // daddiu v0, s7, #t
block_6:
c->lwc1(f22, 84, sp); // lwc1 f22, 84(sp)
c->lwc1(f20, 80, sp); // lwc1 f20, 80(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 96); // daddiu sp, sp, 96
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 39 nav-state)", execute, 96);
}
} // namespace method_39_nav_state
} // namespace Mips2C
+539
View File
@@ -0,0 +1,539 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_21_nav_engine {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->lwu(v1, 80, a0); // lwu v1, 80(a0)
c->lwu(v1, 4, v1); // lwu v1, 4(v1)
c->lwu(a2, 8, a0); // lwu a2, 8(a0)
c->lwu(a2, 4, a2); // lwu a2, 4(a2)
c->dsubu(v1, v1, a2); // dsubu v1, v1, a2
c->addiu(a2, r0, 0); // addiu a2, r0, 0
//beq r0, r0, L30 // beq r0, r0, L30
// nop // sll r0, r0, 0
goto block_4; // branch always
block_1:
c->lwu(a3, 4, a1); // lwu a3, 4(a1)
c->addiu(t0, r0, 288); // addiu t0, r0, 288
c->mult3(t0, t0, a2); // mult3 t0, t0, a2
c->daddu(a3, a3, t0); // daddu a3, a3, t0
c->daddiu(t0, a3, 112); // daddiu t0, a3, 112
c->lwu(t1, 8, a3); // lwu t1, 8(a3)
bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L29
c->mov64(t1, s7); // or t1, s7, r0
if (bc) {goto block_3;} // branch non-likely
c->lwu(t1, 76, a0); // lwu t1, 76(a0)
c->daddiu(t1, t1, 32); // daddiu t1, t1, 32
c->sw(t1, 56, a3); // sw t1, 56(a3)
c->lwu(t1, 80, a0); // lwu t1, 80(a0)
c->sw(t1, 124, a3); // sw t1, 124(a3)
c->lwu(t1, 0, a1); // lwu t1, 0(a1)
c->addiu(t2, r0, 288); // addiu t2, r0, 288
c->mult3(t2, t2, a2); // mult3 t2, t2, a2
c->daddu(t1, t1, t2); // daddu t1, t1, t2
c->sw(t1, 4, t0); // sw t1, 4(t0)
c->mov64(t1, v1); // or t1, v1, r0
c->lw(t2, 16, t0); // lw t2, 16(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->sltiu(t4, t4, 1); // sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 16, t0); // sw t2, 16(t0)
c->lw(t2, 28, t0); // lw t2, 28(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->sltiu(t4, t4, 1); // sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 28, t0); // sw t2, 28(t0)
c->lw(t2, 24, t0); // lw t2, 24(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->sltiu(t4, t4, 1); // sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 24, t0); // sw t2, 24(t0)
c->lw(t2, 20, t0); // lw t2, 20(t0)
c->daddu(t1, t2, t1); // daddu t1, t2, t1
c->xor_(t3, t2, s7); // xor t3, t2, s7
c->sltiu(t3, t3, 1); // sltiu t3, t3, 1
c->movz(t2, t1, t3); // movz t2, t1, t3
c->sw(t2, 20, t0); // sw t2, 20(t0)
c->gprs[t0].du64[0] = 0; // or t0, r0, r0
c->lwu(t0, 0, a1); // lwu t0, 0(a1)
c->addiu(t1, r0, 288); // addiu t1, r0, 288
c->mult3(t1, t1, a2); // mult3 t1, t1, a2
c->daddu(t1, t0, t1); // daddu t1, t0, t1
c->lwu(a3, 8, a3); // lwu a3, 8(a3)
c->sw(t1, 140, a3); // sw t1, 140(a3)
block_3:
c->daddiu(a2, a2, 1); // daddiu a2, a2, 1
block_4:
c->lb(a3, 14, a1); // lb a3, 14(a1)
c->slt(a3, a2, a3); // slt a3, a2, a3
bc = c->sgpr64(a3) != 0; // bne a3, r0, L28
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 21 nav-engine)", execute, 0);
}
} // namespace method_21_nav_engine
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_20_nav_engine {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->lwu(v1, 8, a0); // lwu v1, 8(a0)
c->lwu(v1, 4, v1); // lwu v1, 4(v1)
c->lwu(a2, 80, a0); // lwu a2, 80(a0)
c->lwu(a2, 4, a2); // lwu a2, 4(a2)
c->dsubu(v1, v1, a2); // dsubu v1, v1, a2
c->addiu(a2, r0, 0); // addiu a2, r0, 0
//beq r0, r0, L35 // beq r0, r0, L35
// nop // sll r0, r0, 0
goto block_6; // branch always
block_1:
c->lwu(a3, 4, a1); // lwu a3, 4(a1)
c->addiu(t0, r0, 288); // addiu t0, r0, 288
c->mult3(t0, t0, a2); // mult3 t0, t0, a2
c->daddu(a3, a3, t0); // daddu a3, a3, t0
c->daddiu(t0, a3, 112); // daddiu t0, a3, 112
c->lwu(t1, 8, a3); // lwu t1, 8(a3)
bc = c->sgpr64(s7) == c->sgpr64(t1); // beq s7, t1, L34
c->mov64(t1, s7); // or t1, s7, r0
if (bc) {goto block_5;} // branch non-likely
c->addiu(t1, r0, -257); // addiu t1, r0, -257
c->lwu(t2, 0, a3); // lwu t2, 0(a3)
c->and_(t1, t1, t2); // and t1, t1, t2
c->sw(t1, 0, a3); // sw t1, 0(a3)
c->lwu(t1, 8, a3); // lwu t1, 8(a3)
c->lwu(t1, 4, t1); // lwu t1, 4(t1)
c->andi(t1, t1, 2048); // andi t1, t1, 2048
bc = c->sgpr64(t1) == 0; // beq t1, r0, L33
c->mov64(t1, s7); // or t1, s7, r0
if (bc) {goto block_4;} // branch non-likely
c->lwu(t1, 0, a3); // lwu t1, 0(a3)
c->ori(t1, t1, 256); // ori t1, t1, 256
c->sw(t1, 0, a3); // sw t1, 0(a3)
block_4:
c->lwu(t1, 4, a0); // lwu t1, 4(a0)
c->daddiu(t1, t1, 32); // daddiu t1, t1, 32
c->sw(t1, 56, a3); // sw t1, 56(a3)
c->lwu(t1, 8, a0); // lwu t1, 8(a0)
c->sw(t1, 124, a3); // sw t1, 124(a3)
c->mov64(t1, v1); // or t1, v1, r0
c->lw(t2, 16, t0); // lw t2, 16(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->slti(t4, t4, 1); // sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 16, t0); // sw t2, 16(t0)
c->lw(t2, 28, t0); // lw t2, 28(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->slti(t4, t4, 1); // sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 28, t0); // sw t2, 28(t0)
c->lw(t2, 24, t0); // lw t2, 24(t0)
c->daddu(t3, t2, t1); // daddu t3, t2, t1
c->xor_(t4, t2, s7); // xor t4, t2, s7
c->slti(t4, t4, 1); // sltiu t4, t4, 1
c->movz(t2, t3, t4); // movz t2, t3, t4
c->sw(t2, 24, t0); // sw t2, 24(t0)
c->lw(t2, 20, t0); // lw t2, 20(t0)
c->daddu(t1, t2, t1); // daddu t1, t2, t1
c->xor_(t3, t2, s7); // xor t3, t2, s7
c->slti(t3, t3, 1); // sltiu t3, t3, 1
c->movz(t2, t1, t3); // movz t2, t1, t3
c->sw(t2, 20, t0); // sw t2, 20(t0)
c->gprs[t0].du64[0] = 0; // or t0, r0, r0
c->lwu(a3, 8, a3); // lwu a3, 8(a3)
c->sw(s7, 140, a3); // sw s7, 140(a3)
c->mov64(t1, s7); // or t1, s7, r0
block_5:
c->daddiu(a2, a2, 1); // daddiu a2, a2, 1
block_6:
c->lb(a3, 14, a1); // lb a3, 14(a1)
c->slt(a3, a2, a3); // slt a3, a2, a3
bc = c->sgpr64(a3) != 0; // bne a3, r0, L32
// nop // sll r0, r0, 0
if (bc) {goto block_1;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 20 nav-engine)", execute, 0);
}
} // namespace method_20_nav_engine
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_18_nav_engine {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->lwu(a2, 0, a1); // lwu a2, 0(a1)
c->lwu(v1, 4, a1); // lwu v1, 4(a1)
c->lwu(a0, 8, a1); // lwu a0, 8(a1)
c->lui(a1, 4096); // lui a1, 4096
c->ori(a1, a1, 53248); // ori a1, a1, 53248
c->addiu(a3, r0, 0); // addiu a3, r0, 0
// block_1:
// c->lw(a3, 0, a1); // lw a3, 0(a1)
// c->andi(a3, a3, 256); // andi a3, a3, 256
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a3) != 0; // bne a3, r0, L43
// // nop // sll r0, r0, 0
// if (bc) {goto block_1;} // branch non-likely
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a2, a3, a2); // and a2, a3, a2
// c->sw(a2, 16, a1); // sw a2, 16(a1)
u32 madr = c->sgpr64(a2);
c->lui(a2, 4095); // lui a2, 4095
c->ori(a2, a2, 65535); // ori a2, a2, 65535
c->and_(v1, a2, v1); // and v1, a2, v1
// c->sw(v1, 128, a1); // sw v1, 128(a1)
u32 sadr = c->sgpr64(v1);
// c->sw(a0, 32, a1); // sw a0, 32(a1)
u32 qwc = c->sgpr64(a0);
// Unknown instr: sync.l
c->addiu(v1, r0, 256); // addiu v1, r0, 256
// c->sw(v1, 0, a1); // sw v1, 0(a1)
spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 18 nav-engine)", execute, 0);
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
}
} // namespace method_18_nav_engine
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_17_nav_engine {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lwu(v1, 4, a1); // lwu v1, 4(a1)
c->lwu(a2, 0, a1); // lwu a2, 0(a1)
c->lwu(a0, 8, a1); // lwu a0, 8(a1)
c->lui(a1, 4096); // lui a1, 4096
c->ori(a1, a1, 54272); // ori a1, a1, 54272
c->addiu(a3, r0, 0); // addiu a3, r0, 0
// block_1:
// c->lw(a3, 0, a1); // lw a3, 0(a1)
// c->andi(a3, a3, 256); // andi a3, a3, 256
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a3) != 0; // bne a3, r0, L45
// // nop // sll r0, r0, 0
// if (bc) {goto block_1;} // branch non-likely
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a2, a3, a2); // and a2, a3, a2
// c->sw(a2, 16, a1); // sw a2, 16(a1)
u32 madr = c->sgpr64(a2);
c->lui(a2, 4095); // lui a2, 4095
c->ori(a2, a2, 65535); // ori a2, a2, 65535
c->and_(v1, a2, v1); // and v1, a2, v1
// c->sw(v1, 128, a1); // sw v1, 128(a1)
u32 sadr = c->sgpr64(v1);
// c->sw(a0, 32, a1); // sw a0, 32(a1)
u32 qwc = c->sgpr64(a0);
// Unknown instr: sync.l
c->addiu(v1, r0, 256); // addiu v1, r0, 256
// c->sw(v1, 0, a1); // sw v1, 0(a1)
spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("(method 17 nav-engine)", execute, 0);
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
}
} // namespace method_17_nav_engine
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace nav_state_patch_pointers {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lw(v1, 16, a0); // lw v1, 16(a0)
c->daddu(a2, v1, a1); // daddu a2, v1, a1
c->xor_(a3, v1, s7); // xor a3, v1, s7
c->sltiu(a3, a3, 1); // sltiu a3, a3, 1
c->movz(v1, a2, a3); // movz v1, a2, a3
c->sw(v1, 16, a0); // sw v1, 16(a0)
c->lw(v1, 28, a0); // lw v1, 28(a0)
c->daddu(a2, v1, a1); // daddu a2, v1, a1
c->xor_(a3, v1, s7); // xor a3, v1, s7
c->sltiu(a3, a3, 1); // sltiu a3, a3, 1
c->movz(v1, a2, a3); // movz v1, a2, a3
c->sw(v1, 28, a0); // sw v1, 28(a0)
c->lw(v1, 24, a0); // lw v1, 24(a0)
c->daddu(a2, v1, a1); // daddu a2, v1, a1
c->xor_(a3, v1, s7); // xor a3, v1, s7
c->sltiu(a3, a3, 1); // sltiu a3, a3, 1
c->movz(v1, a2, a3); // movz v1, a2, a3
c->sw(v1, 24, a0); // sw v1, 24(a0)
c->lw(v1, 20, a0); // lw v1, 20(a0)
c->daddu(a1, v1, a1); // daddu a1, v1, a1
c->xor_(a2, v1, s7); // xor a2, v1, s7
c->sltiu(a2, a2, 1); // sltiu a2, a2, 1
c->movz(v1, a1, a2); // movz v1, a1, a2
c->sw(v1, 20, a0); // sw v1, 20(a0)
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
gLinkedFunctionTable.reg("nav-state-patch-pointers", execute, 0);
}
} // namespace nav_state_patch_pointers
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace nav_dma_send_from_spr_no_flush {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lui(v1, 4096); // lui v1, 4096
c->ori(v1, v1, 53248); // ori v1, v1, 53248
c->addiu(a3, r0, 0); // addiu a3, r0, 0
// block_1:
// c->lw(a3, 0, v1); // lw a3, 0(v1)
// c->andi(a3, a3, 256); // andi a3, a3, 256
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a3) != 0; // bne a3, r0, L49
// // nop // sll r0, r0, 0
// if (bc) {goto block_1;} // branch non-likely
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a0, a3, a0); // and a0, a3, a0
// c->sw(a0, 16, v1); // sw a0, 16(v1)
u32 madr = c->sgpr64(a0);
c->lui(a0, 4095); // lui a0, 4095
c->ori(a0, a0, 65535); // ori a0, a0, 65535
c->and_(a0, a0, a1); // and a0, a0, a1
// c->sw(a0, 128, v1); // sw a0, 128(v1)
u32 sadr = c->sgpr64(a0);
// c->sw(a2, 32, v1); // sw a2, 32(v1)
u32 qwc = c->sgpr64(a2);
// Unknown instr: sync.l
c->addiu(a0, r0, 256); // addiu a0, r0, 256
// c->sw(a0, 0, v1); // sw a0, 0(v1)
spad_from_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("nav-dma-send-from-spr-no-flush", execute, 0);
}
} // namespace nav_dma_send_from_spr_no_flush
} // namespace Mips2C
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace nav_dma_send_to_spr_no_flush {
struct Cache {
void* fake_scratchpad_data; // *fake-scratchpad-data*
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
c->lui(v1, 4096); // lui v1, 4096
c->ori(v1, v1, 54272); // ori v1, v1, 54272
c->addiu(a3, r0, 0); // addiu a3, r0, 0
// block_1:
// c->lw(a3, 0, v1); // lw a3, 0(v1)
// c->andi(a3, a3, 256); // andi a3, a3, 256
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// // nop // sll r0, r0, 0
// bc = c->sgpr64(a3) != 0; // bne a3, r0, L51
// // nop // sll r0, r0, 0
// if (bc) {goto block_1;} // branch non-likely
// Unknown instr: sync.l
c->lui(a3, 4095); // lui a3, 4095
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a1, a3, a1); // and a1, a3, a1
// c->sw(a1, 16, v1); // sw a1, 16(v1)
u32 madr = c->sgpr64(a1);
c->lui(a1, 4095); // lui a1, 4095
c->ori(a1, a1, 65535); // ori a1, a1, 65535
c->and_(a0, a1, a0); // and a0, a1, a0
// c->sw(a0, 128, v1); // sw a0, 128(v1)
u32 sadr = c->sgpr64(a0);
// c->sw(a2, 32, v1); // sw a2, 32(v1)
u32 qwc = c->sgpr64(a2);
// Unknown instr: sync.l
c->addiu(a0, r0, 256); // addiu a0, r0, 256
// c->sw(a0, 0, v1); // sw a0, 0(v1)
spad_to_dma(cache.fake_scratchpad_data, madr, sadr, qwc);
// Unknown instr: sync.l
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
//jr ra // jr ra
c->daddu(sp, sp, r0); // daddu sp, sp, r0
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c();
gLinkedFunctionTable.reg("nav-dma-send-to-spr-no-flush", execute, 0);
}
} // namespace nav_dma_send_to_spr_no_flush
} // namespace Mips2C
@@ -0,0 +1,252 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace sparticle_motion_blur_dirt {
struct Cache {
void* target; // *target*
void* atan; // atan
void* transform_point_qword; // transform-point-qword!
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
bool cop1_bc = false;
c->daddiu(sp, sp, -144); // daddiu sp, sp, -144
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sq(s4, 80, sp); // sq s4, 80(sp)
c->sq(s5, 96, sp); // sq s5, 96(sp)
c->sq(gp, 112, sp); // sq gp, 112(sp)
c->swc1(f26, 128, sp); // swc1 f26, 128(sp)
c->swc1(f28, 132, sp); // swc1 f28, 132(sp)
c->swc1(f30, 136, sp); // swc1 f30, 136(sp)
c->mov64(s4, a1); // or s4, a1, r0
c->mov64(gp, a2); // or gp, a2, r0
c->daddiu(s5, sp, 16); // daddiu s5, sp, 16
c->lwc1(f0, 0, gp); // lwc1 f0, 0(gp)
c->swc1(f0, 0, s5); // swc1 f0, 0(s5)
c->lwc1(f0, 4, gp); // lwc1 f0, 4(gp)
c->swc1(f0, 4, s5); // swc1 f0, 4(s5)
c->lwc1(f0, 8, gp); // lwc1 f0, 8(gp)
c->swc1(f0, 8, s5); // swc1 f0, 8(s5)
c->lui(v1, 16256); // lui v1, 16256
c->mtc1(f0, v1); // mtc1 f0, v1
c->swc1(f0, 12, s5); // swc1 f0, 12(s5)
c->lwc1(f0, 16, s4); // lwc1 f0, 16(s4)
c->mtc1(f1, r0); // mtc1 f1, r0
cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1
bc = !cop1_bc; // bc1f L13
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
if (bc) {goto block_2;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_2:
if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L15
c->mov64(v1, v1); // or v1, v1, r0
goto block_10;
}
block_4:
c->lwc1(f0, 20, s4); // lwc1 f0, 20(s4)
c->mtc1(f1, r0); // mtc1 f1, r0
cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1
bc = !cop1_bc; // bc1f L14
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
if (bc) {goto block_6;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_6:
if (((s64)c->sgpr64(s7)) != ((s64)c->sgpr64(v1))) {// bnel s7, v1, L15
c->mov64(v1, v1); // or v1, v1, r0
goto block_10;
}
block_8:
c->lwc1(f0, 24, s4); // lwc1 f0, 24(s4)
c->mtc1(f1, r0); // mtc1 f1, r0
cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1
bc = !cop1_bc; // bc1f L15
c->daddiu(v1, s7, 4); // daddiu v1, s7, 4
if (bc) {goto block_10;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_10:
if (((s64)c->sgpr64(s7)) == ((s64)c->sgpr64(v1))) {// beql s7, v1, L16
c->mov64(v1, v1); // or v1, v1, r0
goto block_13;
}
block_12:
c->load_symbol2(t9, cache.transform_point_qword); // lw t9, transform-point-qword!(s7)
c->daddiu(a0, s5, 32); // daddiu a0, s5, 32
c->daddu(a1, r0, s5); // daddu a1, r0, s5
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
block_13:
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L19
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_21;} // branch non-likely
c->daddiu(v1, s5, 16); // daddiu v1, s5, 16
c->daddiu(a0, s4, 16); // daddiu a0, s4, 16
c->lq(a0, 0, a0); // lq a0, 0(a0)
c->sq(a0, 0, v1); // sq a0, 0(v1)
c->load_symbol2(v1, cache.target); // lw v1, *target*(s7)
bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L17
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_16;} // branch non-likely
c->daddiu(v1, s5, 16); // daddiu v1, s5, 16
c->daddiu(a0, s5, 16); // daddiu a0, s5, 16
c->load_symbol2(a1, cache.target); // lw a1, *target*(s7)
c->lwu(a1, 124, a1); // lwu a1, 124(a1)
c->daddiu(a1, a1, 60); // daddiu a1, a1, 60
c->lui(a2, 15194); // lui a2, 15194
c->ori(a2, a2, 29710); // ori a2, a2, 29710
c->mtc1(f0, a2); // mtc1 f0, a2
c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1)
c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0)
c->mfc1(a0, f0); // mfc1 a0, f0
c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0
c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0
c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3
c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0
c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1)
block_16:
c->daddu(v1, r0, s5); // daddu v1, r0, s5
c->daddu(a0, r0, s5); // daddu a0, r0, s5
c->daddiu(a1, s5, 16); // daddiu a1, s5, 16
c->lui(a2, 16896); // lui a2, 16896
c->mtc1(f0, a2); // mtc1 f0, a2
c->lqc2(vf2, 0, a1); // lqc2 vf2, 0(a1)
c->lqc2(vf1, 0, a0); // lqc2 vf1, 0(a0)
c->mfc1(a0, f0); // mfc1 a0, f0
c->mov128_vf_gpr(vf3, a0); // qmtc2.i vf3, a0
c->vadd_bc(DEST::w, BC::x, vf4, vf0, vf0); // vaddx.w vf4, vf0, vf0
c->vmula_bc(DEST::xyzw, BC::x, vf2, vf3); // vmulax.xyzw acc, vf2, vf3
c->vmadd_bc(DEST::xyz, BC::w, vf4, vf1, vf0); // vmaddw.xyz vf4, vf1, vf0
c->sqc2(vf4, 0, v1); // sqc2 vf4, 0(v1)
c->load_symbol2(t9, cache.transform_point_qword); // lw t9, transform-point-qword!(s7)
c->daddiu(a0, s5, 48); // daddiu a0, s5, 48
c->daddu(a1, r0, s5); // daddu a1, r0, s5
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
bc = c->sgpr64(s7) == c->sgpr64(v0); // beq s7, v0, L19
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_21;} // branch non-likely
c->lw(v1, 32, s5); // lw v1, 32(s5)
c->daddiu(v1, v1, -28672); // daddiu v1, v1, -28672
c->mtc1(f0, v1); // mtc1 f0, v1
c->cvtsw(f0, f0); // cvt.s.w f0, f0
c->lw(v1, 36, s5); // lw v1, 36(s5)
c->daddiu(v1, v1, -29440); // daddiu v1, v1, -29440
c->mtc1(f1, v1); // mtc1 f1, v1
c->cvtsw(f1, f1); // cvt.s.w f1, f1
c->lw(v1, 48, s5); // lw v1, 48(s5)
c->daddiu(v1, v1, -28672); // daddiu v1, v1, -28672
c->mtc1(f2, v1); // mtc1 f2, v1
c->cvtsw(f2, f2); // cvt.s.w f2, f2
c->lw(v1, 52, s5); // lw v1, 52(s5)
c->daddiu(v1, v1, -29440); // daddiu v1, v1, -29440
c->mtc1(f3, v1); // mtc1 f3, v1
c->cvtsw(f3, f3); // cvt.s.w f3, f3
c->subs(f30, f2, f0); // sub.s f30, f2, f0
c->subs(f28, f3, f1); // sub.s f28, f3, f1
c->lui(v1, -14720); // lui v1, -14720
c->mtc1(f26, v1); // mtc1 f26, v1
c->load_symbol2(t9, cache.atan); // lw t9, atan(s7)
c->mfc1(a0, f30); // mfc1 a0, f30
c->mfc1(a1, f28); // mfc1 a1, f28
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mtc1(f0, v0); // mtc1 f0, v0
c->adds(f0, f26, f0); // add.s f0, f26, f0
c->swc1(f0, 24, gp); // swc1 f0, 24(gp)
c->lwc1(f0, 12, s4); // lwc1 f0, 12(s4)
c->mtc1(f1, r0); // mtc1 f1, r0
cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1
bc = cop1_bc; // bc1t L18
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_19;} // branch non-likely
c->lui(v1, 16580); // lui v1, 16580
c->ori(v1, v1, 39846); // ori v1, v1, 39846
c->mtc1(f0, v1); // mtc1 f0, v1
c->lui(v1, 18804); // lui v1, 18804
c->ori(v1, v1, 9216); // ori v1, v1, 9216
c->mtc1(f1, v1); // mtc1 f1, v1
c->lw(v1, 40, s5); // lw v1, 40(s5)
c->mtc1(f2, v1); // mtc1 f2, v1
c->cvtsw(f2, f2); // cvt.s.w f2, f2
c->divs(f1, f1, f2); // div.s f1, f1, f2
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->muls(f1, f30, f30); // mul.s f1, f30, f30
c->muls(f2, f28, f28); // mul.s f2, f28, f28
c->adds(f1, f1, f2); // add.s f1, f1, f2
c->sqrts(f1, f1); // sqrt.s f1, f1
c->muls(f0, f0, f1); // mul.s f0, f0, f1
c->swc1(f0, 12, gp); // swc1 f0, 12(gp)
c->mfc1(v1, f0); // mfc1 v1, f0
block_19:
c->mov64(v0, s7); // or v0, s7, r0
//beq r0, r0, L21 // beq r0, r0, L21
// nop // sll r0, r0, 0
goto block_24; // branch always
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
block_21:
c->lwc1(f0, 12, s4); // lwc1 f0, 12(s4)
c->mtc1(f1, r0); // mtc1 f1, r0
cop1_bc = c->fprs[f0] == c->fprs[f1]; // c.eq.s f0, f1
bc = cop1_bc; // bc1t L20
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_23;} // branch non-likely
c->mtc1(f0, r0); // mtc1 f0, r0
c->swc1(f0, 12, gp); // swc1 f0, 12(gp)
c->mfc1(v1, f0); // mfc1 v1, f0
block_23:
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
block_24:
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->lwc1(f30, 136, sp); // lwc1 f30, 136(sp)
c->lwc1(f28, 132, sp); // lwc1 f28, 132(sp)
c->lwc1(f26, 128, sp); // lwc1 f26, 128(sp)
c->lq(gp, 112, sp); // lq gp, 112(sp)
c->lq(s5, 96, sp); // lq s5, 96(sp)
c->lq(s4, 80, sp); // lq s4, 80(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 144); // daddiu sp, sp, 144
goto end_of_function; // return
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.target = intern_from_c(-1, 0, "*target*").c();
cache.atan = intern_from_c(-1, 0, "atan").c();
cache.transform_point_qword = intern_from_c(-1, 0, "transform-point-qword!").c();
gLinkedFunctionTable.reg("sparticle-motion-blur-dirt", execute, 256);
}
} // namespace sparticle_motion_blur_dirt
} // namespace Mips2C
+20
View File
@@ -335,6 +335,17 @@ namespace particle_adgif { extern void link(); }
namespace sp_init_fields { extern void link(); }
namespace sp_process_block_2d { extern void link(); }
namespace sp_process_block_3d { extern void link(); }
namespace method_39_nav_state { extern void link(); }
namespace method_21_nav_engine { extern void link(); }
namespace method_20_nav_engine { extern void link(); }
namespace method_18_nav_engine { extern void link(); }
namespace method_17_nav_engine { extern void link(); }
namespace nav_state_patch_pointers { extern void link(); }
namespace nav_dma_send_from_spr_no_flush { extern void link(); }
namespace nav_dma_send_to_spr_no_flush { extern void link(); }
namespace blerc_execute { extern void link(); }
namespace setup_blerc_chains_for_one_fragment { extern void link(); }
namespace sparticle_motion_blur_dirt { extern void link(); }
}
// clang-format on
@@ -562,6 +573,15 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
{jak3::sparticle_motion_blur::link, jak3::sp_launch_particles_var::link,
jak3::particle_adgif::link, jak3::sp_init_fields::link}},
{"sparticle", {jak3::sp_process_block_2d::link, jak3::sp_process_block_3d::link}},
{"nav-engine",
{jak3::method_21_nav_engine::link, jak3::method_20_nav_engine::link,
jak3::method_18_nav_engine::link, jak3::method_17_nav_engine::link,
jak3::nav_state_patch_pointers::link, jak3::nav_dma_send_from_spr_no_flush::link,
jak3::nav_dma_send_to_spr_no_flush::link}},
{"nav-control", {jak3::method_39_nav_state::link}},
{"merc-blend-shape",
{jak3::blerc_execute::link, jak3::setup_blerc_chains_for_one_fragment::link}},
{"wvehicle-part", {jak3::sparticle_motion_blur_dirt::link}},
}};
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {
+4
View File
@@ -273,6 +273,10 @@
`(define-extern ,function-name (function ,@type-info))
)
(defmacro def-event-handler (name type)
`(define-extern ,name (function process int symbol event-message-block object :behavior ,type))
)
(defmacro defun-debug (name bindings &rest body)
"Define a function which is only present in debug mode. Otherwise the function becomes nothing"
`(if *debug-segment*
+13 -5
View File
@@ -58,6 +58,14 @@
(death-start 34)
(auto-death-phase-out 35)
(has-gem 36)
(ef37 37)
(ef38 38)
(ef39 39)
(ef40 40)
(ef41 41)
(ef42 42)
(ef43 43)
(ef44 44)
)
;; ---enemy-flag
@@ -181,7 +189,7 @@
(gem-seg uint32)
(gem-no-seg uint32)
(gem-offset sphere :inline)
(knocked-off basic)
(knocked-off symbol)
)
(:methods
(copy-enemy-info! (_type_ _type_) none)
@@ -349,7 +357,7 @@
(enemy-method-88 (_type_ enemy-knocked-info) symbol)
(within-gspot-range? (_type_) symbol)
(enemy-method-90 (_type_ ragdoll-proc) none)
(enemy-method-91 (_type_) symbol)
(enemy-method-91 (_type_ enemy-jump-info) object)
(init-jump-info! (_type_ enemy-jump-info) none)
(setup-jump! (_type_ enemy-jump-info) none)
(move-to-gspot! (_type_) float)
@@ -359,14 +367,14 @@
(jump-wind-up-anim (_type_ enemy-jump-info) symbol)
(jump-anim-handler (_type_ int enemy-jump-info) symbol)
(in-jump-handler (_type_ int enemy-jump-info) none)
(enemy-method-101 (_type_) none)
(enemy-method-101 (_type_ int enemy-jump-info) none)
(go-directed2 (_type_) object)
(enemy-method-103 (_type_ vector float) symbol)
(enemy-method-104 (_type_ vector float) symbol)
(enemy-method-105 (_type_ float symbol) symbol)
(find-best-focus (_type_) process)
(enemy-method-107 (_type_) symbol)
(enemy-method-108 (_type_) symbol)
(is-pfoc-in-mesh? (_type_ process-focusable vector) symbol)
(enemy-method-108 (_type_ process-focusable) symbol)
(enemy-method-109 (_type_) symbol)
(send-attack (_type_ process touching-shapes-entry uint) symbol)
(on-attack (_type_ process-focusable) none)
+8 -15
View File
@@ -1259,11 +1259,11 @@
)
)
(defmethod enemy-method-107 ((this enemy))
(defmethod is-pfoc-in-mesh? ((this enemy) (arg0 process-focusable) (arg1 vector))
#t
)
(defmethod enemy-method-108 ((this enemy))
(defmethod enemy-method-108 ((this enemy) (arg0 process-focusable))
#f
)
@@ -1432,11 +1432,7 @@
(cond
((< f30-0 (-> this enemy-info proximity-notice-distance))
(set! s3-1 #t)
(let* ((a0-3 this)
(t9-2 (method-of-object a0-3 enemy-method-107))
)
(set! s2-0 (t9-2 a0-3))
)
(set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f)))
)
(else
(let ((f0-1 (the-as float (-> this enemy-info notice-distance))))
@@ -1444,11 +1440,7 @@
(set! f0-1 (+ (the-as meters f0-1) (-> this enemy-info notice-distance-delta)))
)
(when (or (< f30-0 f0-1) (not (logtest? (-> this enemy-flags) (enemy-flag use-notice-distance))))
(let* ((a0-7 this)
(t9-3 (method-of-object a0-7 enemy-method-107))
)
(set! s2-0 (t9-3 a0-7))
)
(set! s2-0 (is-pfoc-in-mesh? this arg0 (the-as vector #f)))
(if s2-0
(set! s3-1 #t)
)
@@ -1459,7 +1451,7 @@
(let ((aware (cond
(s3-1
(cond
((enemy-method-108 this)
((enemy-method-108 this arg0)
(the-as enemy-aware (enemy-aware ea4))
)
(s2-0
@@ -2316,7 +2308,8 @@
(none)
)
(defmethod enemy-method-91 ((this enemy))
;; WARN: Return type mismatch symbol vs object.
(defmethod enemy-method-91 ((this enemy) (arg0 enemy-jump-info))
#f
)
@@ -2366,7 +2359,7 @@
(set! (-> this root transv y) 0.0)
)
(defmethod enemy-method-101 ((this enemy))
(defmethod enemy-method-101 ((this enemy) (arg0 int) (arg1 enemy-jump-info))
0
(none)
)
+35 -1
View File
@@ -55,6 +55,40 @@
(define-extern traffic-kill (function none))
(define-extern ctywide-entity-hack (function none))
;; +++vehicle-type
(defenum vehicle-type
:type int32
(h-bike-a 0)
(h-bike-b 1)
(h-bike-c 2)
(h-car-a 3)
(h-car-b 4)
(h-car-c 5)
(h-bike-d 6)
(h-hellcat 7)
(h-warf 8)
(h-glider 9)
(h-sled 10)
(h-kg-pickup 11)
(v-turtle 12)
(v-snake 13)
(v-scorpion 14)
(v-toad 15)
(v-fox 16)
(v-rhino 17)
(v-mirage 18)
(v-x-ride 19)
(v-marauder 20)
(v-faccar 21)
(v-catapult 22)
(v-marauder-b 23)
(test-car 25)
(wbike-test 26)
(evan-test-bike 29)
)
;; ---vehicle-type
;; DECOMP BEGINS
(define *traffic-manager* (the-as traffic-manager #f))
@@ -117,7 +151,7 @@
(vehicle-level basic)
(race-vehicle-level basic)
(traffic-object-levels level 29)
(vehicle-levels level 44)
(vehicle-levels symbol 44)
(traffic-object-type-from-vehicle-type traffic-type 44)
(restore-speech-callback basic)
)
+1 -4
View File
@@ -253,10 +253,7 @@
)
(cond
(a0-33
(let ((t9-10 (method-of-object a0-33 nav-mesh-method-31)))
self
(t9-10)
)
(add-process-drawable-to-nav-mesh a0-33 self #f)
)
(else
(format 0 "ERROR: fma-sphere-init-by-other: failed to find nearest nav-mesh!~%")
+5 -13
View File
@@ -2279,21 +2279,13 @@
)
(defbehavior clmf-cam-string cam-layout ((arg0 string) (arg1 symbol))
(local-vars (r0-0 uint128) (v1-5 uint128) (sv-16 int))
(local-vars (sv-16 res-tag))
(format arg0 ":")
(set! sv-16 0)
(let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (the-as (pointer res-tag) (& sv-16)))))
(set! sv-16 (new 'static 'res-tag))
(let ((s5-1 (res-lump-data (-> self cam-entity) arg1 pointer :tag-ptr (& sv-16))))
(when s5-1
(let ((s4-0 0))
(while (begin
(let ((v1-4 (the-as uint128 sv-16)))
(.pcpyud v1-5 v1-4 r0-0)
)
(< s4-0 (shr (* (the-as int v1-5) 2) 49))
)
(format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4)))))
(+! s4-0 1)
)
(dotimes (s4-0 (the-as int (-> sv-16 elt-count)))
(format arg0 " ~S" (-> (the-as (pointer uint32) (&+ s5-1 (* s4-0 4)))))
)
)
)
@@ -78,6 +78,24 @@
;; ---collide-status
(defmacro normalized-heading-to-quaternion! (quat heading)
"Modified for PC. This does a clever trick, but it doesn't work if the heading is exactly
[0, 0, -1] because this tries to normalize a quaternion that's all 0's.
I think that, on PS2, something prevents the heading from being exactly 0, 0, -1,
but this doesn't happen on PC. A similar thing happened with Jak 1's punch glitch,
where some trig functions were slightly off from returning exactly 0.0 and 1.0 on PS2
rounding only."
`(begin
(if (and (= (-> ,heading x) 0.0)
(= (+ 1.0 (-> ,heading z)) 0.0)
)
(quaternion-set! ,quat 0.0 1.0 0.0 0.0)
(quaternion-set! ,quat 0.0 (-> ,heading x) 0.0 (+ 1.0 (-> ,heading z)))
)
(quaternion-normalize! ,quat)
)
)
(declare-type collide-shape trsqv)
(declare-type collide-shape-moving collide-shape)
(declare-type control-info collide-shape-moving)
@@ -134,6 +152,17 @@
;; ---cshape-reaction-flags
;; +++nav-flags
(defenum nav-flags
:type uint8
:bitfield #t
(has-root-sphere 0)
(has-extra-sphere 1)
(has-child-spheres 2)
)
;; ---nav-flags
;; DECOMP BEGINS
(deftype collide-rider (structure)
@@ -299,7 +328,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t
((actor-hash-index int16 :offset 12)
(process process-drawable)
(max-iteration-count uint8)
(nav-flags uint8)
(nav-flags nav-flags)
(total-prims uint8)
(num-riders uint8)
(pat-ignore-mask pat-surface)
@@ -455,7 +484,7 @@ Most [[process-drawable]]s have a [[collide-shape]] that represents their root t
(set! (-> s5-0 actor-hash-index) -1)
(set! (-> s5-0 process) arg0)
(set! (-> s5-0 max-iteration-count) (the-as uint 1))
(set! (-> s5-0 nav-flags) (the-as uint 1))
(set! (-> s5-0 nav-flags) (nav-flags has-root-sphere))
(set! (-> s5-0 event-self) #f)
(set! (-> s5-0 event-other) #f)
(set! (-> s5-0 riders) (the-as (inline-array collide-rider) #f))
@@ -5,5 +5,447 @@
;; name in dgo: basebutton
;; dgos: MIA
;; +++button-status
(defenum button-status
:type uint16
:bitfield #t
(pressed)
(button-status-1)
(button-status-2)
(button-status-3)
(button-status-4)
)
;; ---button-status
;; DECOMP BEGINS
(deftype basebutton (process-focusable)
((button-status button-status)
(notify-actor entity)
(actor-group (pointer actor-group))
(actor-group-count int32)
(timeout float)
(button-id int32)
(event-going-down symbol)
(event-down symbol)
(event-going-up symbol)
(event-up symbol)
(anim-speed float)
(move-to-pos vector :inline)
(move-to-quat quaternion :inline)
)
(:state-methods
down-idle
going-down
going-up
up-idle
)
(:methods
(init! (_type_) none)
(idle-state-transition (_type_) object)
(init-skel-and-ja! (_type_) none)
(init-collision! (_type_) none)
(prepare-trigger-event! (_type_) none)
(send-event! (_type_ symbol) none)
(move-to! (_type_ vector quaternion) none)
(press! (_type_ symbol) entity-perm-status)
)
)
(defskelgroup skel-generic-button mtn-dice-button 0 3 ((1 (meters 999999))) :bounds (static-spherem 0 0 0 3))
(defmethod move-to! ((this basebutton) (arg0 vector) (arg1 quaternion))
(logclear! (-> this button-status) (button-status button-status-2))
(if arg0
(set! (-> this move-to-pos quad) (-> arg0 quad))
(set! (-> this move-to-pos quad) (-> this root trans quad))
)
(if arg1
(quaternion-copy! (-> this move-to-quat) arg1)
(quaternion-copy! (-> this move-to-quat) (-> this root quat))
)
0
(none)
)
(defmethod idle-state-transition ((this basebutton))
(if (logtest? (-> this button-status) (button-status pressed))
(go (method-of-object this down-idle))
(go (method-of-object this up-idle))
)
)
(defstate up-idle (basebutton)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(let ((v1-1 (the-as attack-info (-> block param 1))))
(case (-> v1-1 mode)
(('flop 'spin 'punch 'eco-yellow 'eco-red 'eco-blue 'eco-dark)
(when (or (not (or (= (-> v1-1 mode) 'spin) (= (-> v1-1 mode) 'punch)))
(logtest? (-> self button-status) (button-status button-status-3))
)
(send-event! self (-> self event-going-down))
(go-virtual going-down)
)
)
)
)
)
(('trigger)
(sound-play "silo-button")
(go-virtual going-down)
)
(('touch)
(when (logtest? (-> self button-status) (button-status button-status-4))
(send-event! self (-> self event-going-down))
(go-virtual going-down)
)
)
(('move-to)
(move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
)
)
:enter (behavior ()
(press! self #f)
)
:trans (behavior ()
(if (logtest? (-> self button-status) (button-status button-status-2))
(rider-trans)
)
)
:code sleep-code
:post (behavior ()
(when (logtest? (-> self button-status) (button-status button-status-2))
(logclear! (-> self button-status) (button-status button-status-2))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
(rider-post)
)
)
)
(defstate going-down (basebutton)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('untrigger)
(go-virtual going-up)
)
(('move-to)
(move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
)
)
:enter (behavior ()
(press! self #t)
)
:trans rider-trans
:code (behavior ()
(ja-no-eval :num! (seek! max (-> self anim-speed)))
(until (ja-done? 0)
(suspend)
(ja :num! (seek! max (-> self anim-speed)))
)
(send-event! self (-> self event-down))
(let ((gp-0 (res-lump-struct (-> self entity) 'on-activate structure)))
(if gp-0
(script-eval (the-as pair gp-0))
)
)
(go-virtual down-idle)
)
:post (behavior ()
(when (logtest? (-> self button-status) (button-status button-status-2))
(logclear! (-> self button-status) (button-status button-status-2))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
)
(rider-post)
)
)
(defstate down-idle (basebutton)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('untrigger)
(go-virtual going-up)
)
(('move-to)
(move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
)
)
:enter (behavior ()
(press! self #t)
(set-time! (-> self state-time))
)
:trans (behavior ()
(if (logtest? (-> self button-status) (button-status button-status-2))
(rider-trans)
)
)
:code (behavior ()
(cond
((= (-> self timeout) 0.0)
(sleep-code)
)
(else
(until (time-elapsed? (-> self state-time) (the int (* 300.0 (-> self timeout))))
(suspend)
)
(send-event! self (-> self event-going-up))
(sound-play "silo-button")
(go-virtual going-up)
)
)
)
:post (behavior ()
(when (logtest? (-> self button-status) (button-status button-status-2))
(logclear! (-> self button-status) (button-status button-status-2))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
(rider-post)
)
)
)
(defstate going-up (basebutton)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('move-to)
(move-to! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
(('trigger)
(go-virtual going-down)
)
)
)
:enter (behavior ()
(press! self #f)
)
:trans rider-trans
:code (behavior ()
(ja-no-eval :num! (seek! 0.0 (-> self anim-speed)))
(until (ja-done? 0)
(suspend)
(ja :num! (seek! 0.0 (-> self anim-speed)))
)
(send-event! self (-> self event-up))
(go-virtual up-idle)
)
:post (behavior ()
(when (logtest? (-> self button-status) (button-status button-status-2))
(logclear! (-> self button-status) (button-status button-status-2))
(set! (-> self root trans quad) (-> self move-to-pos quad))
(quaternion-copy! (-> self root quat) (-> self move-to-quat))
)
(rider-post)
)
)
(defmethod press! ((this basebutton) (arg0 symbol))
(if arg0
(logior! (-> this button-status) (button-status pressed))
(logclear! (-> this button-status) (button-status pressed))
)
(when (not (logtest? (-> this button-status) (button-status button-status-1)))
(if arg0
(process-entity-status! this (entity-perm-status subtask-complete) #t)
(process-entity-status! this (entity-perm-status subtask-complete) #f)
)
)
)
(defmethod send-event! ((this basebutton) (arg0 symbol))
(with-pp
(when arg0
(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)
(let ((t9-0 send-event-function)
(v1-2 (-> this notify-actor))
)
(t9-0
(if v1-2
(-> v1-2 extra process)
)
a1-1
)
)
)
(dotimes (s4-0 (-> this actor-group-count))
(let ((s3-0 (-> this actor-group s4-0)))
(dotimes (s2-0 (-> s3-0 length))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer pp))
(set! (-> a1-2 num-params) 0)
(set! (-> a1-2 message) arg0)
(let ((t9-1 send-event-function)
(v1-10 (-> s3-0 data s2-0 actor))
)
(t9-1
(if v1-10
(-> v1-10 extra process)
)
a1-2
)
)
)
)
)
)
)
0
(none)
)
)
(defmethod init! ((this basebutton))
(set! (-> this button-status) (button-status))
(set! (-> this notify-actor) #f)
(set! (-> this timeout) 0.0)
(set! (-> this event-going-down) #f)
(set! (-> this event-down) #f)
(set! (-> this event-going-up) #f)
(set! (-> this event-up) #f)
(set! (-> this anim-speed) 1.0)
0
(none)
)
(defmethod prepare-trigger-event! ((this basebutton))
(set! (-> this event-going-down) 'trigger)
0
(none)
)
(defmethod init-skel-and-ja! ((this basebutton))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-generic-button" (the-as (pointer level) #f)))
(the-as pair 0)
)
(ja-channel-set! 1)
(cond
((logtest? (-> this button-status) (button-status pressed))
(let ((s5-1 (-> this skel root-channel 0)))
(joint-control-channel-group-eval!
s5-1
(the-as art-joint-anim (-> this draw art-group data 3))
num-func-identity
)
(set! (-> s5-1 frame-num)
(the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 3)) frames num-frames) -1))
)
)
)
(else
(let ((s5-2 (-> this skel root-channel 0)))
(joint-control-channel-group-eval!
s5-2
(the-as art-joint-anim (-> this draw art-group data 3))
num-func-identity
)
(set! (-> s5-2 frame-num) 0.0)
)
)
)
(set! (-> this anim-speed) 2.0)
(transform-post)
(none)
)
(defmethod init-collision! ((this basebutton))
(let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player))))
(let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> s4-0 prim-core collide-as) (collide-spec obstacle pusher))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> s4-0 prim-core action) (collide-action solid rideable))
(set! (-> s4-0 transform-index) 3)
(set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 12288.0)
(set! (-> s5-0 total-prims) (the-as uint 1))
(set! (-> s5-0 root-prim) s4-0)
)
(pusher-init s5-0)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-12 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
0
(none)
)
(defmethod init-from-entity! ((this basebutton) (arg0 entity-actor))
(local-vars (sv-16 res-tag))
(init! this)
(set! (-> this button-id) -1)
(let ((v1-4 (res-lump-value (-> this entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0)))
(if (>= (the-as int v1-4) 0)
(set! (-> this button-id) (the-as int v1-4))
)
)
(init-collision! this)
(process-drawable-from-entity! this arg0)
(if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
(logior! (-> this button-status) (button-status pressed))
(logclear! (-> this button-status) (button-status pressed))
)
(set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-15 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
(cond
((and v1-15 (nonzero? (-> sv-16 elt-count)))
(set! (-> this actor-group) (the-as (pointer actor-group) v1-15))
(set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count)))
)
(else
(set! (-> this actor-group) (the-as (pointer actor-group) #f))
(set! (-> this actor-group-count) 0)
0
)
)
)
(set! (-> this timeout) (res-lump-float arg0 'timeout))
(if (not (logtest? (-> this button-status) (button-status button-status-1)))
(nav-mesh-connect-from-ent this)
)
(prepare-trigger-event! this)
(init-skel-and-ja! this)
(idle-state-transition this)
)
;; WARN: Return type mismatch object vs none.
(defbehavior basebutton-init-by-other basebutton ((arg0 entity-actor) (arg1 vector) (arg2 quaternion) (arg3 entity-actor) (arg4 symbol) (arg5 float))
(init! self)
(logior! (-> self button-status) (button-status button-status-1))
(set! (-> self button-id) -1)
(if arg4
(logior! (-> self button-status) (button-status pressed))
)
(set! (-> self notify-actor) arg3)
(set! (-> self timeout) arg5)
(if arg0
(process-entity-set! self arg0)
)
(set! (-> self actor-group) (the-as (pointer actor-group) #f))
(set! (-> self actor-group-count) 0)
(init-collision! self)
(set! (-> self root trans quad) (-> arg1 quad))
(quaternion-copy! (-> self root quat) arg2)
(set-vector! (-> self root scale) 1.0 1.0 1.0 1.0)
(prepare-trigger-event! self)
(init-skel-and-ja! self)
(idle-state-transition self)
(none)
)
+4 -2
View File
@@ -642,7 +642,9 @@
(process-grab? *target* #f)
)
(if (and (logtest? (-> self elevator-status) (elevator-status waiting-to-descend)) *target*)
(process-drawable-cloth-command *target* '(set-flags local-space-y))
;; og:preserve-this not-yet-implemented
;; (process-drawable-cloth-command *target* '(set-flags local-space-y))
0
)
(if (>= (+ (current-time) (seconds -1)) (-> self sticky-player-last-ride-time))
(remove-setting! 'board)
@@ -856,7 +858,7 @@
;; WARN: Return type mismatch none vs object.
(defmethod init-from-entity! ((this elevator) (arg0 entity-actor))
(local-vars (sv-32 float) (sv-36 path-control) (sv-40 target))
(stack-size-set! (-> this main-thread) 512)
(stack-size-set! (-> this main-thread) 1024)
(set! (-> this sound-running-loop) #f)
(set! (-> this sound-arrived) #f)
(set! (-> this sound-start) #f)
@@ -7,3 +7,381 @@
;; DECOMP BEGINS
(defpartgroup group-kg-huge-explosion
:id 217
:duration (seconds 2)
:linger-duration (seconds 1)
:flags (sp0 sp5 sp6 sp7)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 0) (degrees 90) (degrees 0))
:scale (4.0 4.0 4.0)
:parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05))
(sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10)
(sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20)
(sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20)
(sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30)
)
)
(defpartgroup group-kg-big-explosion
:id 218
:duration (seconds 2)
:linger-duration (seconds 1)
:flags (sp0 sp5 sp6)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 0) (degrees 90) (degrees 0))
:parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05))
(sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10)
(sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20)
(sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20)
(sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30)
)
)
(defpartgroup group-kg-explosion
:id 219
:duration (seconds 2)
:linger-duration (seconds 1)
:flags (sp0 sp5 sp6 sp7)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 0) (degrees 90) (degrees 0))
:scale (0.75 0.75 0.75)
:parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05))
(sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10)
(sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20)
(sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20)
(sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30)
)
)
(defpartgroup group-kg-mid-explosion
:id 220
:duration (seconds 2)
:linger-duration (seconds 1)
:flags (sp0 sp5 sp6 sp7)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 0) (degrees 90) (degrees 0))
:scale (0.5 0.5 0.5)
:parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05))
(sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10)
(sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20)
(sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20)
(sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30)
)
)
(defpartgroup group-kg-small-explosion
:id 221
:duration (seconds 2)
:linger-duration (seconds 1)
:flags (sp0 sp5 sp6 sp7)
:bounds (static-bspherem 0 0 0 15)
:rotate ((degrees 0) (degrees 90) (degrees 0))
:scale (0.3 0.3 0.3)
:parts ((sp-item 883 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 884 :flags (sp6 sp7) :period (seconds 3) :length (seconds 0.017))
(sp-item 885 :flags (sp7) :period (seconds 3) :length (seconds 0.05))
(sp-item 886 :fade-after (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.035) :offset 10)
(sp-item 887 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7) :period (seconds 3) :length (seconds 0.167) :offset 20)
(sp-item 888 :fade-after (meters 200) :falloff-to (meters 200) :flags (sp7) :period (seconds 3) :length (seconds 0.085) :offset 20)
(sp-item 889 :fade-after (meters 150) :falloff-to (meters 150) :flags (sp7) :period (seconds 3) :length (seconds 0.067) :offset 30)
)
)
(defpart 884
:init-specs ((:texture (glow level-default-sprite))
(:num 1.0)
(:scale-x (meters 2))
(:rot-x (degrees 11.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 24.0)
(:scalevel-x (meters 0.10666667))
(:rotvel-z (degrees 0.3))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -4.266667)
(:fade-b -4.266667)
(:fade-a 0.0)
(:timer (seconds 0.5))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow set-conerot))
(:next-time (seconds 0.25))
(:next-launcher 890)
(:rotate-y (degrees 0))
)
)
(defpart 890
:init-specs ((:scalevel-x (meters 0))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.85333335)
(:fade-g -1.7066667)
(:fade-b -1.7066667)
(:fade-a -0.64)
(:rotate-y (degrees 0))
)
)
(defpart 889
:init-specs ((:texture (explosion-edge level-default-sprite))
(:num 2.0 0.2)
(:scale-x (meters 1) (meters 1))
(:rot-z (degrees 0) (degrees 3600) :store)
(:scale-y (meters 0.8) (meters 0.2))
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 32.0 32.0)
(:scalevel-x (meters 0.01) (meters 0.13333334))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -0.36)
(:fade-b -4.24)
(:fade-a -0.22068965)
(:friction 0.95)
(:timer (seconds 3.335))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot))
(:next-time (seconds 0.085))
(:next-launcher 891)
(:conerot-x '*sp-temp*)
(:conerot-y (degrees 0) (degrees 3600))
(:rotate-y (degrees 0))
)
)
(defpart 888
:init-specs ((:texture (explosion-nebula level-default-sprite))
(:birth-func 'birth-func-texture-group)
(:num 3.0)
(:scale-x (meters 1) (meters 1))
(:rot-z (degrees 0))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 32.0 32.0)
(:vel-y (meters 0.02) (meters 0.01))
(:scalevel-x (meters 0.01) (meters 0.13333334))
(:rotvel-z (degrees -0.12) (degrees 0.24))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -0.36)
(:fade-b -4.24)
(:fade-a -0.22068965)
(:friction 0.95)
(:timer (seconds 3.335))
(:flags (sp-cpuinfo-flag-2 set-conerot))
(:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700))
(:next-time (seconds 0.085))
(:next-launcher 891)
(:conerot-x (degrees 0) (degrees 3600))
(:conerot-y (degrees 0) (degrees 3600))
(:rotate-y (degrees 0))
)
)
(defpart 891
:init-specs ((:fade-r 0.0)
(:fade-g 0.0)
(:fade-b 0.0)
(:next-time (seconds 0.017) (seconds 0.065))
(:next-launcher 892)
(:rotate-y (degrees 0))
)
)
(defpart 892
:init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.44)
(:fade-g -2.36)
(:fade-b -2.64)
(:next-time (seconds 0.117) (seconds 0.047))
(:next-launcher 893)
(:rotate-y (degrees 0))
)
)
(defpart 893
:init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334))
(:scalevel-y :copy scalevel-x)
(:fade-r -1.2944444)
(:fade-g -0.7111111)
(:fade-b -0.094444446)
(:fade-a -0.06545454 -0.06545454)
(:next-time (seconds 0.5) (seconds 0.097))
(:next-launcher 894)
(:rotate-y (degrees 0))
)
)
(defpart 894
:init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125) (:rotate-y (degrees 0)))
)
(defpart 883
:init-specs ((:texture (glow level-default-sprite))
(:num 1.0)
(:scale-x (meters 5))
(:rot-x (degrees 11.25))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 96.0)
(:scalevel-x (meters 0.5))
(:rotvel-z (degrees 0.3))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -1.28)
(:fade-b -5.1)
(:fade-a 0.0)
(:timer (seconds 0.217))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow set-conerot))
(:next-time (seconds 0.1))
(:next-launcher 895)
(:rotate-y (degrees 0))
)
)
(defpart 895
:init-specs ((:scalevel-x (meters -0.2857143))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -3.6571429)
(:fade-b 0.0)
(:fade-a -2.7428572)
(:rotate-y (degrees 0))
)
)
(defpart 887
:init-specs ((:texture (specs level-default-sprite))
(:num 8.0 2.0)
(:x (meters 0.25))
(:scale-x (meters 1) (meters 0.25))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 255.0)
(:g 255.0)
(:b 255.0)
(:a 16.0 48.0)
(:vel-y (meters 0.083333336) (meters 0.083333336))
(:scalevel-x (meters 0.006666667) (meters 0.0016666667))
(:rotvel-z (degrees -0.12) (degrees 0.24))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g -0.18)
(:fade-b -2.12)
(:accel-y (meters -0.00016666666) (meters -0.00033333333))
(:friction 0.87)
(:timer (seconds 3.335))
(:flags (sp-cpuinfo-flag-2 set-conerot))
(:next-time (seconds 0.117) (seconds 0.047))
(:next-launcher 896)
(:conerot-x (degrees 0) (degrees 3600))
(:conerot-y (degrees 0) (degrees 3600))
(:rotate-y (degrees 0))
)
)
(defpart 896
:init-specs ((:scalevel-x (meters 0.0016666667))
(:scalevel-y :copy scalevel-x)
(:fade-r 0.0)
(:fade-g 0.02)
(:fade-b 0.23555556)
(:next-time (seconds 0.15) (seconds 0.047))
(:next-launcher 897)
(:rotate-y (degrees 0))
)
)
(defpart 897
:init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043) (:rotate-y (degrees 0)))
)
(defpart 885
:init-specs ((:texture (bigpuff level-default-sprite))
(:num 8.0 1.0)
(:x (meters 0) (meters 0.6))
(:scale-x (meters 2.5) (meters 2))
(:rot-z (degrees 0) (degrees 360))
(:scale-y :copy scale-x)
(:r 70.0 20.0)
(:g 70.0 20.0)
(:b 70.0 20.0)
(:a 0.0 40.0)
(:vel-y (meters 0) (meters 0.1))
(:scalevel-x (meters 0.033333335) (meters 0.02))
(:rotvel-z (degrees -0.12) (degrees 0.24))
(:scalevel-y :copy scalevel-x)
(:fade-r 3.3)
(:fade-g 3.12)
(:fade-b 1.18)
(:fade-a 1.76)
(:friction 0.88)
(:timer (seconds 2.367))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 set-conerot))
(:next-time (seconds 0.117) (seconds 0.047))
(:next-launcher 898)
(:conerot-x (degrees 0) (degrees 3600))
(:conerot-y (degrees 0) (degrees 3600))
(:rotate-y (degrees 0))
)
)
(defpart 898
:init-specs ((:scalevel-x (meters 0.0033333334))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.53333336)
(:fade-g -1.9666667)
(:fade-b -2.2)
(:fade-a -0.41666666)
(:next-time (seconds 0.15) (seconds 0.047))
(:next-launcher 899)
(:rotate-y (degrees 0))
)
)
(defpart 899
:init-specs ((:scalevel-x (meters 0))
(:scalevel-y :copy scalevel-x)
(:fade-r -0.38833332)
(:fade-g -0.21333334)
(:fade-b -0.028333334)
(:fade-a -0.38833332)
(:rotate-y (degrees 0))
)
)
(defpart 886
:init-specs ((:texture (motion-blur-part level-default-sprite))
(:num 4.0 2.0)
(:scale-x (meters 0.2) (meters 0.5))
(:rot-x 4)
(:rot-z (degrees 0) (degrees 360))
(:scale-y (meters 0.2) (meters 0.1))
(:r 128.0 128.0)
(:g 96.0)
(:b 64.0)
(:a 64.0 64.0)
(:scalevel-x (meters 0.13333334) (meters 0.02))
(:fade-g 1.6)
(:fade-b 3.2)
(:fade-a -1.6)
(:timer (seconds 0.3))
(:flags (sp-cpuinfo-flag-2 set-conerot))
(:rotate-y (degrees 0))
)
)
+11 -11
View File
@@ -65,7 +65,7 @@
:event enemy-event-handler
:enter (behavior ()
((-> (method-of-type enemy idle) enter))
(set! (-> self root nav-flags) (the-as uint 0))
(set! (-> self root nav-flags) (nav-flags))
(let ((v1-4 (-> self root root-prim)))
(set! (-> v1-4 prim-core collide-as) (collide-spec))
(set! (-> v1-4 prim-core collide-with) (collide-spec))
@@ -86,7 +86,7 @@
)
(logclear! (-> self draw status) (draw-control-status no-draw))
(logclear! (-> self enemy-flags) (enemy-flag directed-ready))
(logior! (-> self root nav-flags) 1)
(logior! (-> self root nav-flags) (nav-flags has-root-sphere))
)
:code sleep-code
)
@@ -127,7 +127,7 @@
0
(logior! (-> self draw status) (draw-control-status no-draw))
(logior! (-> self enemy-flags) (enemy-flag directed-ready))
(logand! (-> self root nav-flags) -2)
(logclear! (-> self root nav-flags) (nav-flags has-root-sphere))
)
:exit (behavior ()
((-> (method-of-type enemy dormant) exit))
@@ -427,7 +427,7 @@
(init-jump-info! self gp-0)
(if (and (-> self enemy-info use-jump-blocked)
(logtest? (enemy-flag jump-check-blocked) (-> self enemy-flags))
(enemy-method-91 self)
(enemy-method-91 self gp-0)
)
(go-virtual jump-blocked)
)
@@ -437,7 +437,7 @@
(goto cfg-12)
)
(in-jump-handler self s5-0 gp-0)
(enemy-method-101 self)
(enemy-method-101 self s5-0 gp-0)
(suspend)
(set! s5-0 1)
)
@@ -452,7 +452,7 @@
(+! (-> gp-0 hang-time) (- (current-time) (-> self clock old-frame-counter)))
(jump-anim-handler self s5-1 gp-0)
(in-jump-handler self s5-1 gp-0)
(enemy-method-101 self)
(enemy-method-101 self s5-1 gp-0)
(suspend)
(set! s5-1 3)
)
@@ -465,7 +465,7 @@
(goto cfg-19)
)
(in-jump-handler self s5-2 gp-0)
(enemy-method-101 self)
(enemy-method-101 self s5-2 gp-0)
(suspend)
(set! s5-2 5)
)
@@ -760,7 +760,7 @@
)
(else
(when (and (-> self skel effect) (logtest? (enemy-flag auto-death-phase-out) (-> self enemy-flags)))
(do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
(suspend)
0
)
@@ -842,7 +842,7 @@
((handle->process (-> self ragdoll-proc))
(ja-channel-push! 1 0)
(ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek!) :frame-num 0.0)
(ragdoll-method-25 (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self)
(enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
@@ -985,7 +985,7 @@
)
)
(if (-> self skel effect)
(do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
)
(let ((gp-1 (current-time)))
(until (time-elapsed? gp-1 (seconds 0.8))
@@ -1079,7 +1079,7 @@
)
)
(if (-> self skel effect)
(do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
)
(let ((gp-1 (current-time)))
(until (time-elapsed? gp-1 (seconds 1))
@@ -170,9 +170,9 @@
;; (effect-control-method-9 a0-22)
;; )
;; )
;; (if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
;; (merc-blend-shape self)
;; )
(if (logtest? (-> self skel status) (joint-control-status blend-shape blend-shape-valid))
(merc-blend-shape self)
)
(if (logtest? (-> self skel status) (joint-control-status eye-anim-valid eye-anim))
(merc-eye-anim self)
)
@@ -864,7 +864,7 @@
)
(('do-effect)
(if (and (nonzero? (-> self skel)) (-> self skel effect))
(do-effect (-> self skel effect) (the-as symbol (-> block param 0)) (the-as float (-> block param 1)) -1)
(do-effect (-> self skel effect) (the-as string (-> block param 0)) (the-as float (-> block param 1)) -1)
)
)
(('no-actor-pause)
+12 -2
View File
@@ -477,7 +477,8 @@
)
(logior! (-> self options) (projectile-options po4))
(setup-collision! self)
(let ((s5-0 (-> self root)))
(let ((s5-0 (-> self root))
(parent (-> self parent 0)))
(when (type? s5-0 collide-shape-moving)
(set! (-> self root dynam gravity y) 1228800.0)
(set! (-> self root dynam gravity-length) 1228800.0)
@@ -487,7 +488,16 @@
(logclear! (-> self mask) (process-mask enemy))
(set! (-> s5-0 trans quad) (-> arg0 pos quad))
(set! (-> self starting-pos quad) (-> arg0 pos quad))
(quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat))
;; og:preserve-this
;; some projectiles have their parent set as *rigid-body-queue-manager*,
;; which is not a process-drawable, so we use its own parent
;; (usually the vehicle firing the projectile) to set the quat instead.
;; on original hardware, this would not crash because misaligned qw loads silently mask the lower bits
;; of the address, loading a junk value instead.
(if (= parent *rigid-body-queue-manager*)
(quaternion-copy! (-> s5-0 quat) (-> (the process-drawable (-> parent parent 0)) root quat))
(quaternion-copy! (-> s5-0 quat) (-> self parent 0 root quat))
)
(vector-identity! (-> s5-0 scale))
(set! (-> s5-0 transv quad) (-> arg0 vel quad))
(set! (-> self pre-move-transv quad) (-> arg0 vel quad))
+4 -10
View File
@@ -513,7 +513,7 @@
)
(defmethod new flow-control ((allocation symbol) (type-to-make type) (arg0 process-drawable) (arg1 res-lump))
(local-vars (r0-0 uint128) (v1-16 uint128) (sv-16 int))
(local-vars (sv-16 res-tag))
(if (not arg1)
(set! arg1 (-> arg0 entity))
)
@@ -529,15 +529,9 @@
)
(set! (-> gp-0 speed) (res-lump-float arg1 'speed :default 12288.0))
(set! (-> gp-0 belt-radius) (res-lump-float arg1 'extra-radius :default 16384.0))
(set! sv-16 0)
(let* ((a1-6 (res-lump-data arg1 'scale-factor pointer :tag-ptr (the-as (pointer res-tag) (& sv-16))))
(a0-8 gp-0)
(t9-6 (method-of-object a0-8 setup))
)
(let ((v1-15 (the-as uint128 sv-16)))
(.pcpyud v1-16 v1-15 r0-0)
)
(t9-6 a0-8 (the-as (pointer float) a1-6) (shr (* (the-as int v1-16) 2) 49))
(set! sv-16 (new 'static 'res-tag))
(let ((a1-6 (res-lump-data arg1 'scale-factor pointer :tag-ptr (& sv-16))))
(setup gp-0 (the-as (pointer float) a1-6) (the-as int (-> sv-16 elt-count)))
)
)
(else
+1
View File
@@ -322,6 +322,7 @@ This stores settings like the name of the art-group, shadow/level-of-detail sett
((lod lod-group 6 :inline)
(max-lod int8)
)
:allow-misaligned
(:methods
(setup-lods! (_type_ skeleton-group art-group entity) _type_)
)
+3 -12
View File
@@ -2814,19 +2814,10 @@
(defun dm-task-menu-pick-func ((arg0 game-task) (arg1 debug-menu-msg))
(let ((gp-0 (/ (the-as int arg0) 8)))
(when (= arg1 (debug-menu-msg press))
(cond
((cpad-hold? 0 l1)
(task-node-open! (the-as game-task-node gp-0) 'menu)
)
(else
(let ((t9-1 task-node-close!)
(a0-2 gp-0)
)
'menu
(t9-1 (the-as game-task-node a0-2))
)
(if (cpad-hold? 0 l1)
(task-node-open! (the-as game-task-node gp-0) 'menu)
(task-node-close! (the-as game-task-node gp-0) 'menu)
)
)
)
(if (and (not (task-node-closed? (the-as game-task-node gp-0)))
(not (task-node-open? (the-as game-task-node gp-0)))
+2 -1
View File
@@ -374,7 +374,8 @@
(base pointer)
(end pointer)
(real-buffer-end int32)
(data uint64 1 :offset 32)
(data-buffer uint8 :dynamic :overlay-at real-buffer-end)
(data uint64 1 :offset 32)
)
(:methods
(new (symbol type int) _type_)
+5 -5
View File
@@ -1434,7 +1434,7 @@
;; (generic-merc-execute-all gp-0)
;; (shadow-execute-all gp-0)
)
;; (lightning-draw-all)
(lightning-draw-all)
(prim-engine-execute)
(none)
)
@@ -1589,10 +1589,10 @@
(actors-update *level*)
)
; ;; do navigation math
; (with-profiler 'nav *profile-nav-color*
; (update-nav-meshes-method *level*)
; )
;; do navigation math
(with-profiler 'nav *profile-nav-color*
(update-nav-meshes-method *level*)
)
;; draw the background
(with-profiler 'background *profile-background-color*
+3 -3
View File
@@ -40,12 +40,12 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref w-parking-spot :method-count 0)
:ptype (type-ref w-parking-spot :method-count 27)
:pool '*16k-dead-pool*
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref min-elevator :method-count 0)
:ptype (type-ref min-elevator :method-count 52)
:pool '*16k-dead-pool*
:heap-size #x4000
)
@@ -270,7 +270,7 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref fruit-stand :method-count 0)
:ptype (type-ref fruit-stand :method-count 31)
:pool '*16k-dead-pool*
:heap-size #x4000
)
+5 -22
View File
@@ -245,7 +245,7 @@
(let ((s4-0 (-> v1-4 bsp nav-meshes)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
((method-of-object (-> s4-0 s3-0 nav-mesh) nav-mesh-method-28))
(update-navigation (-> s4-0 s3-0 nav-mesh))
)
)
)
@@ -837,9 +837,6 @@
(defmethod level-group-method-24 ((this level-group))
(local-vars
(r0-0 uint128)
(a0-23 object)
(a1-10 uint128)
(sv-16 (inline-array vector))
(sv-20 vector)
(sv-24 vector)
@@ -847,7 +844,7 @@
(sv-32 float)
(sv-36 vector)
(sv-40 entity)
(sv-48 int)
(sv-48 res-tag)
)
(dotimes (s5-0 (-> this length))
(let ((v1-3 (-> this level s5-0)))
@@ -881,23 +878,9 @@
((string-prefix= "battle" (res-lump-struct sv-40 'name string))
(set! (-> sv-20 quad) (-> sv-36 quad))
(set! (-> sv-24 quad) (-> sv-36 quad))
(set! sv-48 0)
(let ((v1-29
(res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (the-as (pointer res-tag) (& sv-48)))
)
)
(when (and v1-29 (begin
(let ((a0-24 #t))
(let ((a1-9 (the-as uint128 sv-48)))
(.pcpyud a1-10 a1-9 r0-0)
)
(let ((a1-12 (the-as int (shr (* (the-as int a1-10) 2) 49))))
(cmove-#f-zero a0-23 a1-12 a0-24)
)
)
a0-23
)
)
(set! sv-48 (new 'static 'res-tag))
(let ((v1-29 (res-lump-data sv-40 'actor-groups (pointer actor-group) :tag-ptr (& sv-48))))
(when (and v1-29 (nonzero? (-> sv-48 elt-count)))
(let* ((s2-2 (-> v1-29 0))
(s1-1 (-> s2-2 length))
)
@@ -47,7 +47,7 @@
(:methods
(new (symbol type process-drawable) _type_)
(effect-control-method-9 (_type_) none)
(do-effect (_type_ symbol float int) none)
(do-effect (_type_ string float int) none)
(do-effect-for-surface (_type_ symbol float int basic pat-surface) none)
(play-effect-sound (_type_ symbol float int basic sound-name) int)
(set-channel-offset! (_type_ int) none)
+210 -216
View File
@@ -266,7 +266,7 @@
)
(t9-0
a0-1
(the-as symbol (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset)))))
(the-as string (-> (the-as (pointer int32) (&+ (-> v1-7 data-base) (-> a1-1 data-offset)))))
f0-0
-1
)
@@ -281,21 +281,20 @@
)
;; WARN: Function (method 10 effect-control) has a return type of none, but the expression builder found a return statement.
(defmethod do-effect ((this effect-control) (arg0 symbol) (arg1 float) (arg2 int))
(defmethod do-effect ((this effect-control) (arg0 string) (arg1 float) (arg2 int))
(local-vars (sv-288 res-lump))
(let* ((v1-2 (rtype-of arg0))
(s3-0 (the-as string (cond
((= v1-2 symbol)
(symbol->string arg0)
)
((= v1-2 string)
arg0
)
(else
#f
)
)
)
(s3-0 (cond
((= v1-2 symbol)
(symbol->string (the-as symbol arg0))
)
((= v1-2 string)
arg0
)
(else
(the-as string #f)
)
)
)
)
(cond
@@ -470,8 +469,8 @@
(s0-0 (-> (the-as death-info s3-1) sound))
)
(set! sv-288 (-> this res))
(let ((t1-5 (string->sound-name (the-as string (-> (the-as death-info s3-1) sound)))))
(s1-0 s2-3 s0-0 arg1 arg2 sv-288 t1-5)
(let ((t1-5 (string->sound-name (-> (the-as death-info s3-1) sound))))
(s1-0 s2-3 (the-as symbol s0-0) arg1 arg2 sv-288 t1-5)
)
)
)
@@ -553,45 +552,44 @@
((string= (the-as string sv-192) "effect-land-poof")
(do-effect
this
(the-as symbol (-> (new 'static 'boxed-array :type string
"group-land-poof-unk"
"group-land-poof-ice"
"group-land-poof-qsd"
"group-land-poof-wtr"
"group-land-poof-tar"
"group-land-poof-san"
"group-land-poof-wod"
"group-land-poof-grs"
"group-land-poof-pmt"
"group-land-poof-snw"
"group-land-poof-dsn"
"group-land-poof-unk"
"group-land-poof-lav"
"group-land-poof-cwd"
"group-land-poof-grv"
"group-land-poof-drt"
"group-land-poof-mtl"
"group-land-poof-str"
"group-land-poof-pmt"
"group-land-poof-swm"
"group-land-poof-unk"
"group-land-poof-mtl"
"group-land-poof-neu"
"group-land-poof-stn"
"group-land-poof-cmt"
"group-land-poof-car"
"group-land-poof-gmt"
"group-land-poof-smt"
"group-land-poof-hwd"
"group-land-poof-sqi"
"group-land-poof-mhm"
"group-land-poof-for"
"group-land-poof-mhs"
"group-land-poof-dma"
)
(-> arg4 material)
)
)
(-> (new 'static 'boxed-array :type string
"group-land-poof-unk"
"group-land-poof-ice"
"group-land-poof-qsd"
"group-land-poof-wtr"
"group-land-poof-tar"
"group-land-poof-san"
"group-land-poof-wod"
"group-land-poof-grs"
"group-land-poof-pmt"
"group-land-poof-snw"
"group-land-poof-dsn"
"group-land-poof-unk"
"group-land-poof-lav"
"group-land-poof-cwd"
"group-land-poof-grv"
"group-land-poof-drt"
"group-land-poof-mtl"
"group-land-poof-str"
"group-land-poof-pmt"
"group-land-poof-swm"
"group-land-poof-unk"
"group-land-poof-mtl"
"group-land-poof-neu"
"group-land-poof-stn"
"group-land-poof-cmt"
"group-land-poof-car"
"group-land-poof-gmt"
"group-land-poof-smt"
"group-land-poof-hwd"
"group-land-poof-sqi"
"group-land-poof-mhm"
"group-land-poof-for"
"group-land-poof-mhs"
"group-land-poof-dma"
)
(-> arg4 material)
)
arg1
-1
)
@@ -599,45 +597,44 @@
((string= (the-as string sv-192) "effect-run-poof")
(do-effect
this
(the-as symbol (-> (new 'static 'boxed-array :type string
"group-run-poof-unk"
"group-run-poof-ice"
"group-run-poof-qsd"
"group-run-poof-wtr"
"group-run-poof-tar"
"group-run-poof-san"
"group-run-poof-wod"
"group-run-poof-grs"
"group-run-poof-pmt"
"group-run-poof-snw"
"group-run-poof-dsn"
"group-run-poof-unk"
"group-run-poof-lav"
"group-run-poof-cwd"
"group-run-poof-grv"
"group-run-poof-drt"
"group-run-poof-mtl"
"group-run-poof-str"
"group-run-poof-pmt"
"group-run-poof-swm"
"group-run-poof-unk"
"group-run-poof-mtl"
"group-run-poof-neu"
"group-run-poof-stn"
"group-run-poof-cmt"
"group-run-poof-car"
"group-run-poof-gmt"
"group-run-poof-smt"
"group-run-poof-hwd"
"group-run-poof-sqi"
"group-run-poof-mhm"
"group-run-poof-for"
"group-run-poof-mhs"
"group-run-poof-dma"
)
(-> arg4 material)
)
)
(-> (new 'static 'boxed-array :type string
"group-run-poof-unk"
"group-run-poof-ice"
"group-run-poof-qsd"
"group-run-poof-wtr"
"group-run-poof-tar"
"group-run-poof-san"
"group-run-poof-wod"
"group-run-poof-grs"
"group-run-poof-pmt"
"group-run-poof-snw"
"group-run-poof-dsn"
"group-run-poof-unk"
"group-run-poof-lav"
"group-run-poof-cwd"
"group-run-poof-grv"
"group-run-poof-drt"
"group-run-poof-mtl"
"group-run-poof-str"
"group-run-poof-pmt"
"group-run-poof-swm"
"group-run-poof-unk"
"group-run-poof-mtl"
"group-run-poof-neu"
"group-run-poof-stn"
"group-run-poof-cmt"
"group-run-poof-car"
"group-run-poof-gmt"
"group-run-poof-smt"
"group-run-poof-hwd"
"group-run-poof-sqi"
"group-run-poof-mhm"
"group-run-poof-for"
"group-run-poof-mhs"
"group-run-poof-dma"
)
(-> arg4 material)
)
arg1
-1
)
@@ -645,45 +642,44 @@
((string= (the-as string sv-192) "effect-just-footprint")
(do-effect
this
(the-as symbol (-> (new 'static 'boxed-array :type string
"group-just-footprint-unk"
"group-just-footprint-ice"
"group-just-footprint-qsd"
"group-just-footprint-wtr"
"group-just-footprint-tar"
"group-just-footprint-san"
"group-just-footprint-wod"
"group-just-footprint-grs"
"group-just-footprint-pmt"
"group-just-footprint-snw"
"group-just-footprint-dsn"
"group-just-footprint-unk"
"group-just-footprint-lav"
"group-just-footprint-cwd"
"group-just-footprint-grv"
"group-just-footprint-drt"
"group-just-footprint-mtl"
"group-just-footprint-str"
"group-just-footprint-pmt"
"group-just-footprint-swm"
"group-just-footprint-unk"
"group-just-footprint-mtl"
"group-just-footprint-neu"
"group-just-footprint-stn"
"group-just-footprint-cmt"
"group-just-footprint-car"
"group-just-footprint-gmt"
"group-just-footprint-smt"
"group-just-footprint-hwd"
"group-just-footprint-sqi"
"group-just-footprint-mhm"
"group-just-footprint-for"
"group-just-footprint-mhs"
"group-just-footprint-dma"
)
(-> arg4 material)
)
)
(-> (new 'static 'boxed-array :type string
"group-just-footprint-unk"
"group-just-footprint-ice"
"group-just-footprint-qsd"
"group-just-footprint-wtr"
"group-just-footprint-tar"
"group-just-footprint-san"
"group-just-footprint-wod"
"group-just-footprint-grs"
"group-just-footprint-pmt"
"group-just-footprint-snw"
"group-just-footprint-dsn"
"group-just-footprint-unk"
"group-just-footprint-lav"
"group-just-footprint-cwd"
"group-just-footprint-grv"
"group-just-footprint-drt"
"group-just-footprint-mtl"
"group-just-footprint-str"
"group-just-footprint-pmt"
"group-just-footprint-swm"
"group-just-footprint-unk"
"group-just-footprint-mtl"
"group-just-footprint-neu"
"group-just-footprint-stn"
"group-just-footprint-cmt"
"group-just-footprint-car"
"group-just-footprint-gmt"
"group-just-footprint-smt"
"group-just-footprint-hwd"
"group-just-footprint-sqi"
"group-just-footprint-mhm"
"group-just-footprint-for"
"group-just-footprint-mhs"
"group-just-footprint-dma"
)
(-> arg4 material)
)
arg1
-1
)
@@ -691,45 +687,44 @@
((string= (the-as string sv-192) "effect-just-poof")
(do-effect
this
(the-as symbol (-> (new 'static 'boxed-array :type string
"group-just-poof-unk"
"group-just-poof-ice"
"group-just-poof-qsd"
"group-just-poof-wtr"
"group-just-poof-tar"
"group-just-poof-san"
"group-just-poof-wod"
"group-just-poof-grs"
"group-just-poof-pmt"
"group-just-poof-snw"
"group-just-poof-dsn"
"group-just-poof-unk"
"group-just-poof-lav"
"group-just-poof-cwd"
"group-just-poof-grv"
"group-just-poof-drt"
"group-just-poof-mtl"
"group-just-poof-str"
"group-just-poof-pmt"
"group-just-poof-swm"
"group-just-poof-unk"
"group-just-poof-mtl"
"group-just-poof-neu"
"group-just-poof-stn"
"group-just-poof-cmt"
"group-just-poof-car"
"group-just-poof-gmt"
"group-just-poof-smt"
"group-just-poof-hwd"
"group-just-poof-sqi"
"group-just-poof-mhm"
"group-just-poof-for"
"group-just-poof-mhs"
"group-just-poof-dma"
)
(-> arg4 material)
)
)
(-> (new 'static 'boxed-array :type string
"group-just-poof-unk"
"group-just-poof-ice"
"group-just-poof-qsd"
"group-just-poof-wtr"
"group-just-poof-tar"
"group-just-poof-san"
"group-just-poof-wod"
"group-just-poof-grs"
"group-just-poof-pmt"
"group-just-poof-snw"
"group-just-poof-dsn"
"group-just-poof-unk"
"group-just-poof-lav"
"group-just-poof-cwd"
"group-just-poof-grv"
"group-just-poof-drt"
"group-just-poof-mtl"
"group-just-poof-str"
"group-just-poof-pmt"
"group-just-poof-swm"
"group-just-poof-unk"
"group-just-poof-mtl"
"group-just-poof-neu"
"group-just-poof-stn"
"group-just-poof-cmt"
"group-just-poof-car"
"group-just-poof-gmt"
"group-just-poof-smt"
"group-just-poof-hwd"
"group-just-poof-sqi"
"group-just-poof-mhm"
"group-just-poof-for"
"group-just-poof-mhs"
"group-just-poof-dma"
)
(-> arg4 material)
)
arg1
-1
)
@@ -737,45 +732,44 @@
((string= (the-as string sv-192) "effect-slide-poof")
(do-effect
this
(the-as symbol (-> (new 'static 'boxed-array :type string
"group-slide-poof-unk"
"group-slide-poof-ice"
"group-slide-poof-qsd"
"group-slide-poof-wtr"
"group-slide-poof-tar"
"group-slide-poof-san"
"group-slide-poof-wod"
"group-slide-poof-grs"
"group-slide-poof-pmt"
"group-slide-poof-snw"
"group-slide-poof-dsn"
"group-slide-poof-unk"
"group-slide-poof-lav"
"group-slide-poof-cwd"
"group-slide-poof-grv"
"group-slide-poof-drt"
"group-slide-poof-mtl"
"group-slide-poof-str"
"group-slide-poof-pmt"
"group-slide-poof-swm"
"group-slide-poof-unk"
"group-slide-poof-mtl"
"group-slide-poof-neu"
"group-slide-poof-stn"
"group-slide-poof-cmt"
"group-slide-poof-car"
"group-slide-poof-gmt"
"group-slide-poof-smt"
"group-slide-poof-hwd"
"group-slide-poof-sqi"
"group-slide-poof-mhm"
"group-slide-poof-for"
"group-slide-poof-mhs"
"group-slide-poof-dma"
)
(-> arg4 material)
)
)
(-> (new 'static 'boxed-array :type string
"group-slide-poof-unk"
"group-slide-poof-ice"
"group-slide-poof-qsd"
"group-slide-poof-wtr"
"group-slide-poof-tar"
"group-slide-poof-san"
"group-slide-poof-wod"
"group-slide-poof-grs"
"group-slide-poof-pmt"
"group-slide-poof-snw"
"group-slide-poof-dsn"
"group-slide-poof-unk"
"group-slide-poof-lav"
"group-slide-poof-cwd"
"group-slide-poof-grv"
"group-slide-poof-drt"
"group-slide-poof-mtl"
"group-slide-poof-str"
"group-slide-poof-pmt"
"group-slide-poof-swm"
"group-slide-poof-unk"
"group-slide-poof-mtl"
"group-slide-poof-neu"
"group-slide-poof-stn"
"group-slide-poof-cmt"
"group-slide-poof-car"
"group-slide-poof-gmt"
"group-slide-poof-smt"
"group-slide-poof-hwd"
"group-slide-poof-sqi"
"group-slide-poof-mhm"
"group-slide-poof-for"
"group-slide-poof-mhs"
"group-slide-poof-dma"
)
(-> arg4 material)
)
arg1
-1
)
@@ -1059,8 +1053,8 @@
(defbehavior target-land-effect target ()
(cond
((focus-test? self flut)
(do-effect (-> self skel effect) (the-as symbol "effect-land-poof") -1.0 -1)
(do-effect (-> self skel effect) (the-as symbol "effect-flut-land") -1.0 -1)
(do-effect (-> self skel effect) "effect-land-poof" -1.0 -1)
(do-effect (-> self skel effect) "effect-flut-land" -1.0 -1)
)
((focus-test? self pilot)
(sound-play-by-name
@@ -1074,11 +1068,11 @@
)
)
((logtest? (water-flag touch-water) (-> self water flags))
(do-effect (-> self skel effect) (the-as symbol "effect-land-water") -1.0 -1)
(do-effect (-> self skel effect) "effect-land-water" -1.0 -1)
)
(else
(do-effect (-> self skel effect) (the-as symbol "effect-land-poof") -1.0 -1)
(do-effect (-> self skel effect) (the-as symbol "effect-land") -1.0 -1)
(do-effect (-> self skel effect) "effect-land-poof" -1.0 -1)
(do-effect (-> self skel effect) "effect-land" -1.0 -1)
)
)
0
+7 -7
View File
@@ -13,14 +13,14 @@
(amulet0 0)
(amulet1 1)
(amulet2 2)
(pass-wascity 3)
(pass-front-gate 3)
(seal-of-mar 4)
(pass-factory 5)
(cypher-gliph 5)
(artifact-holocube 6)
(artifact-quantum-reflector 7)
(artifact-prism 8)
(artifact-beam-generator 9)
(artifact-time-map 10)
(artifact-av-reflector 7)
(artifact-av-prism 8)
(artifact-av-generator 9)
(artifact-av-map 10)
(light-eco-crystal0 11)
(light-eco-crystal1 12)
(light-eco-crystal2 13)
@@ -352,7 +352,7 @@
(play-list (array game-task-info))
(sub-task-list (array game-task-node-info))
(mission-list (array game-task-node-info))
(task-node-commands (array uint8))
(task-node-commands (array game-task-node-command))
(task-node-exclusive (array uint16))
(task-counter uint32)
(unknown-arr4 (array uint16))
+2 -2
View File
@@ -2150,7 +2150,7 @@
board
sidekick
board-launch
feature39
board-zap
darkjak
darkjak-smack
darkjak-bomb0
@@ -2163,7 +2163,7 @@
lightjak-freeze
lightjak-shield
artifact-invis
feature56
jakc
lighteco
darkeco
)
+26
View File
@@ -62,6 +62,32 @@
(jak-dark-nuke 35)
(jak-dark-blackhole 36)
(emp-blast 37)
(penetrate38 38)
(penetrate39 39)
(penetrate40 40)
(penetrate41 41)
(penetrate42 42)
(penetrate43 43)
(penetrate44 44)
(penetrate45 45)
(penetrate46 46)
(penetrate47 47)
(penetrate48 48)
(penetrate49 49)
(penetrate50 50)
(penetrate51 51)
(penetrate52 52)
(penetrate53 53)
(penetrate54 54)
(penetrate55 55)
(penetrate56 56)
(penetrate57 57)
(penetrate58 58)
(penetrate59 59)
(penetrate60 60)
(penetrate61 61)
(penetrate64 62)
(penetrate63 63)
)
;; ---penetrate
+2 -2
View File
@@ -103,7 +103,7 @@
(feature36 36)
(board-launch 37)
(board-trail 38)
(feature39 39)
(board-zap 39)
(darkjak 40)
(darkjak-smack 41)
(darkjak-bomb0 42)
@@ -120,7 +120,7 @@
(armor1 53)
(armor2 54)
(armor3 55)
(feature56 56)
(jakc 56)
(lighteco 57)
(darkeco 58)
(feature59 59)
+84 -81
View File
@@ -4208,10 +4208,11 @@
:user-count 3
)
:borrow '()
:open? (lambda () (or (not (task-node-closed? (game-task-node wascity-defend-get-to)))
(task-node-closed? (game-task-node wascity-defend-resolution))
)
)
:open? (lambda ()
(or (not (task-node-closed? (game-task-node wascity-defend-get-to)))
(task-node-closed? (game-task-node wascity-defend-resolution))
)
)
:on-close #f
:reset (new 'static 'task-reset-info
:restart-info #f
@@ -23355,83 +23356,85 @@
)
)
(set! (-> game-info mission-list) (new 'global 'boxed-array game-task-node-info 410))
(set! (-> game-info task-node-commands) (new 'static 'boxed-array :type uint8
#x48
#x20
#x1f
#x1
#x5
#x23
#x22
#x19
#x36
#xa
#x3a
#x41
#x48
#x32
#x39
#x3f
#x3a
#x8
#x6
#x37
#xd
#xb
#x3e
#x3a
#x39
#xf
#x40
#x31
#x28
#x27
#x26
#x2f
#x2d
#x3
#x3b
#x29
#x2a
#x33
#x12
#x10
#x1b
#xe
#xc
#x21
#x1a
#x2e
#x34
#x30
#x13
#x11
#x1c
#x9
#x7
#x14
#x1d
#x3c
#x43
#x39
#x44
#x46
#x45
#x39
#x17
#x15
#x2b
#x47
#x38
#x35
#x18
#x16
#x3a
#x1e
#x42
#x4
#x3
)
(set! (-> game-info task-node-commands)
(the-as (array game-task-node-command) (new 'static 'boxed-array :type uint8
#x48
#x20
#x1f
#x1
#x5
#x23
#x22
#x19
#x36
#xa
#x3a
#x41
#x48
#x32
#x39
#x3f
#x3a
#x8
#x6
#x37
#xd
#xb
#x3e
#x3a
#x39
#xf
#x40
#x31
#x28
#x27
#x26
#x2f
#x2d
#x3
#x3b
#x29
#x2a
#x33
#x12
#x10
#x1b
#xe
#xc
#x21
#x1a
#x2e
#x34
#x30
#x13
#x11
#x1c
#x9
#x7
#x14
#x1d
#x3c
#x43
#x39
#x44
#x46
#x45
#x39
#x17
#x15
#x2b
#x47
#x38
#x35
#x18
#x16
#x3a
#x1e
#x42
#x4
#x3
)
)
)
(dotimes (v1-4 (-> game-info sub-task-list length))
(if (-> game-info sub-task-list v1-4 manager)
@@ -43,6 +43,19 @@
)
;; ---task-manager-mask
(declare-type editable-player process)
(define-extern *editable* (pointer editable-player))
;; temporarily forward declared as symbols
(define-extern *cty-faction-manager* symbol)
(define-extern *cty-attack-controller* symbol)
(set! *cty-faction-manager* #f)
(set! *cty-attack-controller* #f)
(define-extern cty-attack-reset (function symbol symbol symbol none))
(define-extern setup-city-task-faction (function object))
(define-extern cty-faction-evaluate-commands (function pair object))
(define-extern update-task-masks (function symbol int))
(define-extern task-resolution-close! (function game-task symbol))
(define-extern task-node-closed? (function game-task-node symbol))
@@ -51,7 +64,7 @@
(define-extern game-task-node->string (function game-task-node string))
(define-extern task-close! (function string symbol))
(define-extern task-node-index-by-name (function string int))
(define-extern task-node-close! (function game-task-node int))
(define-extern task-node-close! (function game-task-node symbol int))
(define-extern task-node-open? (function game-task-node symbol))
(define-extern restart-mission (function int))
@@ -1430,11 +1443,11 @@
(faction-commands pair)
)
(:methods
(game-task-node-info-method-9 () none)
(get-idx-in-task-list (_type_) int)
(open! (_type_ symbol) int)
(game-task-node-info-method-11 (_type_ symbol) none)
(game-task-node-info-method-12 (_type_) symbol)
(game-task-node-info-method-13 () none)
(eval-game-task-cmd! (_type_) none)
)
)
@@ -1486,25 +1499,27 @@
(hud-counter handle :overlay-at (-> hud 1))
(intro-time time-frame)
)
(:state-methods
wait
active
complete
resolution
(fail resetter-params)
(restart symbol)
)
(:methods
(task-manager-method-14 () none)
(task-manager-method-15 () none)
(task-manager-method-16 () none)
(task-manager-method-17 () none)
(task-manager-method-18 () none)
(task-manager-method-19 () none)
(task-manager-method-20 () none)
(task-manager-method-21 () none)
(task-manager-method-22 () none)
(task-manager-method-23 () none)
(task-manager-method-24 () none)
(task-manager-method-25 () none)
(task-manager-method-26 () none)
(task-manager-method-27 () none)
(task-manager-method-28 () none)
(task-manager-method-29 () none)
(task-manager-method-30 () none)
(task-manager-method-31 (_type_ symbol) resetter-spec)
(init! (_type_) none)
(set-time-limit (_type_) none)
(kill-all-children (_type_) none)
(hud-timer-handler (_type_) none)
(ready? (_type_) object)
(task-manager-method-25 (_type_) none)
(task-manager-method-26 (_type_) none)
(task-manager-method-27 (_type_) none)
(task-manager-method-28 (_type_) none)
(go-fail (_type_) object)
(taskman-event-handler (_type_ process int symbol event-message-block) object)
(on-fail (_type_ symbol) resetter-params)
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -51,7 +51,7 @@ These path-controls are typically allocated on a process heap."
(path-control-method-25 (_type_ vector) float)
(path-control-method-26 (_type_ float float) float)
(path-control-method-27 (_type_ vector) vector)
(path-control-method-28 (_type_ vector float float) float)
(path-control-method-28 (_type_ vector vector symbol) float)
(path-control-method-29 (_type_ vector int float) float)
(should-display-marks? (_type_) symbol)
(displacement-between-two-points! (_type_ vector float float) vector)
+4 -4
View File
@@ -336,7 +336,7 @@
)
)
(defmethod path-control-method-28 ((this path-control) (arg0 vector) (arg1 float) (arg2 float))
(defmethod path-control-method-28 ((this path-control) (arg0 vector) (arg1 vector) (arg2 symbol))
(local-vars
(sv-96 vector)
(sv-100 vector)
@@ -364,7 +364,7 @@
(set! sv-112 (vector-vector-distance-squared sv-108 arg0))
)
(let ((s3-1 (new 'stack-no-clear 'vector)))
(vector+! s3-1 arg0 (the-as vector arg1))
(vector+! s3-1 arg0 arg1)
(dotimes (s2-0 (+ (-> this curve num-cverts) -1))
(get-point-in-path! this sv-100 (the float (+ s2-0 1)) 'interp)
(vector-! sv-104 sv-100 sv-96)
@@ -373,12 +373,12 @@
(let ((s1-0 (new 'stack-no-clear 'vector)))
(set! (-> s1-0 x) -1.0)
(set! (-> s1-0 y) -1.0)
(line-line-find-intersection-xz arg0 (the-as vector arg1) sv-96 sv-104 s1-0)
(line-line-find-intersection-xz arg0 arg1 sv-96 sv-104 s1-0)
(when (>= (-> s1-0 x) 0.0)
(if (and (< 0.0 (-> s1-0 y)) (>= 1.0 (-> s1-0 y)))
(set! s0-0 #t)
)
(vector+float*! sv-116 arg0 (the-as vector arg1) (-> s1-0 x))
(vector+float*! sv-116 arg0 arg1 (-> s1-0 x))
(cond
((and s0-0 (not sv-120))
(set! (-> sv-108 quad) (-> sv-116 quad))
@@ -33,7 +33,8 @@
(deftype hfrag-packed-index (uint16)
()
((bit11 uint8 :offset 11 :size 5)
)
)
(deftype hfrag-vertex (structure)
@@ -243,8 +244,8 @@
(buckets-far uint32)
(buckets-mid uint32)
(buckets-near uint32)
(verts uint32)
(pat-array uint32)
(verts (inline-array hfrag-vertex))
(pat-array (pointer pat-surface))
(pat-length uint16)
(num-buckets-far uint16)
(num-buckets-mid uint16)
@@ -254,9 +255,9 @@
(:methods
(hfragment-method-17 (_type_ collide-cache collide-query) none)
(hfragment-method-18 (_type_ collide-cache collide-query) none)
(hfragment-method-19 () none)
(hfragment-method-20 () none)
(hfragment-method-21 () none)
(hfragment-method-19 (_type_ collide-cache collide-query int int int int) none)
(hfragment-method-20 (_type_ collide-cache int int uint uint uint pat-surface) none)
(hfragment-method-21 (_type_ collide-cache int int uint uint uint pat-surface) none)
)
)
@@ -7,3 +7,342 @@
;; DECOMP BEGINS
(defmethod hfragment-method-20 ((this hfragment)
(arg0 collide-cache)
(arg1 int)
(arg2 int)
(arg3 uint)
(arg4 uint)
(arg5 uint)
(arg6 pat-surface)
)
(let ((v1-0 (-> arg0 num-tris)))
(cond
((>= v1-0 460)
(if (= *cheat-mode* 'debug)
(print-exceeded-max-cache-tris)
)
)
(else
(let ((v1-6 (-> arg0 tris v1-0)))
(let ((f0-2 (+ (* 32768.0 (the float arg1)) (-> this start-corner x)))
(f1-5 (+ (* 32768.0 (the float arg2)) (-> this start-corner z)))
)
(set-vector! (-> v1-6 vertex 2) f0-2 (the float (* arg3 8)) f1-5 1.0)
(set-vector! (-> v1-6 vertex 1) (+ 32768.0 f0-2) (the float (* arg4 8)) f1-5 1.0)
(set-vector! (-> v1-6 vertex 0) f0-2 (the float (* arg5 8)) (+ 32768.0 f1-5) 1.0)
)
(set! (-> v1-6 clear-flags) (the-as uint128 0))
(set! (-> v1-6 pat) arg6)
(set! (-> v1-6 collide-ptr) #f)
)
(+! (-> arg0 num-tris) 1)
)
)
)
0
(none)
)
(defmethod hfragment-method-21 ((this hfragment)
(arg0 collide-cache)
(arg1 int)
(arg2 int)
(arg3 uint)
(arg4 uint)
(arg5 uint)
(arg6 pat-surface)
)
(let ((v1-0 (-> arg0 num-tris)))
(cond
((>= v1-0 460)
(if (= *cheat-mode* 'debug)
(print-exceeded-max-cache-tris)
)
)
(else
(let ((v1-6 (-> arg0 tris v1-0)))
(let ((f0-2 (+ (* 32768.0 (the float arg1)) (-> this start-corner x)))
(f1-5 (+ (* 32768.0 (the float arg2)) (-> this start-corner z)))
)
(set-vector! (-> v1-6 vertex 2) f0-2 (the float (* arg4 8)) (+ 32768.0 f1-5) 1.0)
(set-vector! (-> v1-6 vertex 1) (+ 32768.0 f0-2) (the float (* arg3 8)) f1-5 1.0)
(set-vector! (-> v1-6 vertex 0) (+ 32768.0 f0-2) (the float (* arg5 8)) (+ 32768.0 f1-5) 1.0)
)
(set! (-> v1-6 clear-flags) (the-as uint128 0))
(set! (-> v1-6 pat) arg6)
(set! (-> v1-6 collide-ptr) #f)
)
(+! (-> arg0 num-tris) 1)
)
)
)
0
(none)
)
(defmethod hfragment-method-19 ((this hfragment) (arg0 collide-cache) (arg1 collide-query) (arg2 int) (arg3 int) (arg4 int) (arg5 int))
(local-vars
(sv-16 uint)
(sv-24 uint)
(sv-32 uint)
(sv-40 uint)
(sv-48 int)
(sv-56 int)
(sv-64 int)
(sv-72 int)
)
(let ((v1-0 (-> this verts))
(a0-2 (+ (* arg3 512) arg2))
(s2-0 (-> this pat-array 0))
)
(when (not (logtest? (-> arg1 ignore-pat) s2-0))
(when (nonzero? (-> (the-as hfrag-vertex (+ (* a0-2 4) (the-as int v1-0))) packed-index bit11))
(set! sv-16 (-> (the-as (pointer uint16) (+ (* a0-2 4) (the-as int v1-0)))))
(set! sv-24 (-> (the-as (pointer uint16) (+ (* (+ a0-2 1) 4) (the-as int v1-0)))))
(set! sv-32 (-> (the-as (pointer uint16) (+ (* (+ a0-2 512) 4) (the-as int v1-0)))))
(set! sv-40 (-> (the-as (pointer uint16) (+ (* (+ a0-2 513) 4) (the-as int v1-0)))))
(set! sv-48 0)
(set! sv-56 0)
(set! sv-64 0)
(set! sv-72 0)
(if (< (the-as int sv-16) arg4)
(set! sv-48 1)
)
(if (< arg5 (the-as int sv-16))
(set! sv-48 (logior sv-48 2))
)
(if (< (the-as int sv-24) arg4)
(set! sv-56 1)
)
(if (< arg5 (the-as int sv-24))
(set! sv-56 (logior sv-56 2))
)
(if (< (the-as int sv-32) arg4)
(set! sv-64 1)
)
(if (< arg5 (the-as int sv-32))
(set! sv-64 (logior sv-64 2))
)
(if (< (the-as int sv-40) arg4)
(set! sv-72 1)
)
(if (< arg5 (the-as int sv-40))
(set! sv-72 (logior sv-72 2))
)
(if (not (logtest? (logand sv-48 sv-56) sv-64))
(hfragment-method-20 this arg0 arg2 arg3 sv-16 sv-24 sv-32 s2-0)
)
(if (not (logtest? (logand sv-56 sv-64) sv-72))
(hfragment-method-21 this arg0 arg2 arg3 sv-24 sv-32 sv-40 s2-0)
)
)
)
)
0
(none)
)
(defmethod hfragment-method-17 ((this hfragment) (arg0 collide-cache) (arg1 collide-query))
(local-vars (sv-16 int) (sv-24 int) (sv-32 int) (sv-40 int) (sv-48 int) (sv-56 int))
(set! sv-16 (the int (* 0.000030517578 (- (-> arg1 bbox min x) (-> this start-corner x)))))
(set! sv-24 (the int (* 0.000030517578 (- (-> arg1 bbox min z) (-> this start-corner z)))))
(set! sv-32 (the int (* 0.000030517578 (- (-> arg1 bbox max x) (-> this start-corner x)))))
(set! sv-40 (the int (* 0.000030517578 (- (-> arg1 bbox max z) (-> this start-corner z)))))
(set! sv-48 (the int (* 0.125 (-> arg1 bbox min y))))
(set! sv-56 (the int (* 0.125 (-> arg1 bbox max y))))
(set! sv-16 (max 0 (min 511 sv-16)))
(set! sv-32 (max 0 (min 511 sv-32)))
(set! sv-24 (max 0 (min 511 sv-24)))
(set! sv-40 (max 0 (min 511 sv-40)))
(let ((s3-0 sv-24)
(s2-0 sv-40)
)
(while (>= s2-0 s3-0)
(let ((s1-0 sv-16)
(s0-0 sv-32)
)
(while (>= s0-0 s1-0)
(hfragment-method-19 this arg0 arg1 s1-0 s3-0 sv-48 sv-56)
(+! s1-0 1)
)
)
(+! s3-0 1)
)
)
0
(none)
)
(defmethod hfragment-method-18 ((this hfragment) (arg0 collide-cache) (arg1 collide-query))
(local-vars
(v1-30 int)
(v1-31 int)
(v1-57 int)
(v1-58 int)
(a0-16 int)
(a0-17 int)
(a0-35 int)
(a0-36 int)
(s3-0 int)
(s3-2 int)
(sv-64 vector)
(sv-68 vector)
(sv-72 vector)
(sv-76 float)
(sv-80 float)
(sv-128 int)
(sv-144 int)
(sv-160 int)
(sv-176 int)
(sv-192 int)
(sv-208 int)
)
(set! sv-64 (new 'stack-no-clear 'vector))
(set! sv-68 (new 'stack-no-clear 'vector))
(set! sv-72 (new 'stack-no-clear 'vector))
(set! sv-76 (the-as float 0.000030517578))
(set! sv-80 (* 0.000030517578 (-> arg1 radius)))
(vector-! sv-64 (-> arg1 start-pos) (-> this start-corner))
(vector-float*! sv-64 sv-64 sv-76)
(vector-float*! sv-72 (-> arg1 move-dist) sv-76)
(vector+! sv-68 sv-64 sv-72)
(cond
((< (fabs (-> sv-72 z)) (fabs (-> sv-72 x)))
(when (< (-> sv-72 x) 0.0)
(let ((v1-15 (new 'stack-no-clear 'vector)))
(set! (-> v1-15 quad) (-> sv-64 quad))
(set! (-> sv-64 quad) (-> sv-68 quad))
(set! (-> sv-68 quad) (-> v1-15 quad))
)
(vector-negate! sv-72 sv-72)
)
(let* ((a0-9 (the int (- (-> sv-64 x) sv-80)))
(v1-20 (the int (+ (-> sv-68 x) sv-80)))
(f0-15 (fmax 1.0 (the float (- v1-20 a0-9))))
(f30-0 (/ (-> sv-72 y) f0-15))
(f28-0 (/ (-> sv-72 z) f0-15))
(f26-0 (+ sv-80 (* 0.5 (fabs f30-0))))
(f24-0 (+ sv-80 (* 0.5 (fabs f28-0))))
)
(cond
((< a0-9 0)
(+! (-> sv-64 y) (* f30-0 (- (the float a0-9))))
(+! (-> sv-64 z) (* f28-0 (- (the float a0-9))))
(set! s3-0 0)
)
(else
(set! s3-0 (min 511 a0-9))
)
)
(let ((s2-1 (max 0 (min 511 v1-20)))
(s1-0 s3-0)
)
(while (>= s2-1 s1-0)
(let* ((f0-23 (the float (- s1-0 s3-0)))
(f1-23 (+ (-> sv-64 y) (* f30-0 f0-23)))
(f0-25 (+ (-> sv-64 z) (* f28-0 f0-23)))
(s0-0 (the int (* 4096.0 (+ (- -0.5 f26-0) f1-23))))
)
(set! sv-128 (the int (* 4096.0 (+ 0.5 f26-0 f1-23))))
(let ((a0-15 (the int (- f0-25 f24-0)))
(v1-29 (the int (+ f0-25 f24-0)))
)
(set! sv-144 0)
(let ((a2-1 sv-144)
(a1-21 (min 511 a0-15))
)
(set-on-less-than a0-16 a2-1 a1-21)
(move-if-not-zero a0-17 a1-21 a0-16 a0-16)
)
(set! sv-144 a0-17)
(set! sv-160 0)
(let ((a1-22 sv-160)
(a0-20 (min 511 v1-29))
)
(set-on-less-than v1-30 a1-22 a0-20)
(move-if-not-zero v1-31 a0-20 v1-30 v1-30)
)
)
(set! sv-160 v1-31)
(while (>= sv-160 sv-144)
(hfragment-method-19 this arg0 arg1 s1-0 sv-144 s0-0 sv-128)
(set! sv-144 (+ sv-144 1))
)
)
(+! s1-0 1)
)
)
)
)
(else
(when (< (-> sv-72 z) 0.0)
(let ((v1-42 (new 'stack-no-clear 'vector)))
(set! (-> v1-42 quad) (-> sv-64 quad))
(set! (-> sv-64 quad) (-> sv-68 quad))
(set! (-> sv-68 quad) (-> v1-42 quad))
)
(vector-negate! sv-72 sv-72)
)
(let* ((a0-27 (the int (- (-> sv-64 z) sv-80)))
(v1-47 (the int (+ (-> sv-68 z) sv-80)))
(f0-36 (fmax 1.0 (the float (- v1-47 a0-27))))
(f30-1 (/ (-> sv-72 y) f0-36))
(f28-1 (/ (-> sv-72 x) f0-36))
(f26-1 (+ sv-80 (* 0.5 (fabs f30-1))))
(f24-1 (+ sv-80 (* 0.5 (fabs f28-1))))
)
(cond
((< a0-27 0)
(+! (-> sv-64 y) (* f30-1 (the float (- a0-27))))
(+! (-> sv-64 x) (* f28-1 (the float (- a0-27))))
(set! s3-2 0)
)
(else
(set! s3-2 (min 511 a0-27))
)
)
(let ((s2-3 (max 0 (min 511 v1-47)))
(s1-1 s3-2)
)
(while (>= s2-3 s1-1)
(let* ((f0-44 (the float (- s1-1 s3-2)))
(f1-47 (+ (-> sv-64 y) (* f30-1 f0-44)))
(f0-46 (+ (-> sv-64 x) (* f28-1 f0-44)))
(s0-1 (the int (* 4096.0 (+ (- -0.5 f26-1) f1-47))))
)
(set! sv-176 (the int (* 4096.0 (+ 0.5 f26-1 f1-47))))
(let ((a0-34 (the int (- f0-46 f24-1)))
(v1-56 (the int (+ f0-46 f24-1)))
)
(set! sv-192 0)
(let ((a2-3 sv-192)
(a1-41 (min 511 a0-34))
)
(set-on-less-than a0-35 a2-3 a1-41)
(move-if-not-zero a0-36 a1-41 a0-35 a0-35)
)
(set! sv-192 a0-36)
(set! sv-208 0)
(let ((a1-42 sv-208)
(a0-39 (min 511 v1-56))
)
(set-on-less-than v1-57 a1-42 a0-39)
(move-if-not-zero v1-58 a0-39 v1-57 v1-57)
)
)
(set! sv-208 v1-58)
(while (>= sv-208 sv-192)
(hfragment-method-19 this arg0 arg1 sv-192 s1-1 s0-1 sv-176)
(set! sv-192 (+ sv-192 1))
)
)
(+! s1-1 1)
)
)
)
)
)
0
(none)
)
@@ -90,5 +90,9 @@
(none)
)
(defmethod blit-displays-work-method-17 ((this blit-displays-work) (arg0 vector) (arg1 int) (arg2 float) (arg3 symbol))
(none)
)
;; DECOMP BEGINS
@@ -1541,11 +1541,14 @@
"
(when (or (not (-> pd skel))
(zero? (-> pd skel))
;; types such as debris-group are not actually proper process-drawables and
;; don't have a joint-control.
(symbol-member? (-> pd type symbol) '(debris-group))
)
(return #f)
)
;; grab the currently playing animatoin
;; grab the currently playing animation
(let* ((jc-channel (-> pd skel root-channel 0))
(anim (-> jc-channel frame-group))
(got-weights #f)
@@ -1637,8 +1640,6 @@
)
)
(define *use-fp-blerc* #f)
(defun pc-merc-draw-request ((dc draw-control) (dma-buf pointer) (matrix-buf pointer) (tex-idx int) (update-verts symbol) (blercs (pointer float)))
"Send a request to PC Merc2 to draw the given object.
Only draws the effects which match this texture index.
@@ -5,8 +5,314 @@
;; name in dgo: merc-blend-shape
;; dgos: GAME
(define-extern blerc-init (function none))
(define-extern blerc-execute (function none))
(define-extern setup-blerc-chains (function merc-ctrl (pointer int16) dma-buffer none))
;; when true, uses the PC float blerc implementation.
(define *use-fp-blerc* #t)
(defun process-drawable-might-need-blerc? ((pd process-drawable))
"Annoyingly, some warp object have blend shape anims, like the hiphog mirror.
These are never drawn with PC-merc (it doesn't support warp), so we still
need to the PS2-style blerc for generic. This function sees if this process-drawable
might be warp."
(let ((draw (-> pd draw)))
(if (or (zero? draw) (not draw))
(return #f)
)
(let ((geo (-> draw mgeo)))
(if (or (zero? geo) (not geo))
(return #f)
)
(dotimes (effect-idx (-> geo header effect-count))
(when (= (-> geo effect effect-idx texture-index) (tpage-category warp))
(return #t)
)
)
)
)
#f
)
;; DECOMP BEGINS
(define *stats-blerc* #f)
(deftype blerc-block-header (structure)
((tag generic-merc-tag :inline)
(vtx-count uint32)
(overlap uint32)
(lump-dest uint32)
(lump-qwc uint32)
)
)
(deftype blerc-block (structure)
((output uint8 848)
(header blerc-block-header :inline)
)
)
(deftype blerc-dcache (structure)
((repl-mult vector 40 :inline)
)
)
(deftype blerc-globals (structure)
((first uint32)
(next uint32)
(min-val int16)
(max-val int16)
(fragment-count int32)
(vtx-count int32)
(target-vtx-count int32)
)
)
(define *blerc-globals* (new 'global 'blerc-globals))
(deftype blerc-context (structure)
((block-a blerc-block :inline)
(dummy uint8 7312)
(block-b blerc-block :inline)
)
)
(defun-debug blerc-stats-init ()
(when *stats-blerc*
(when (nonzero? (-> *blerc-globals* fragment-count))
(format *stdcon* "~%BLERC (merc blend target) STATS~%")
(format
*stdcon*
" ~D fragments, ~D vertices~%"
(-> *blerc-globals* fragment-count)
(-> *blerc-globals* vtx-count)
)
(format
*stdcon*
" ~D blend target computations (~F average)~%"
(-> *blerc-globals* target-vtx-count)
(/ (the float (-> *blerc-globals* target-vtx-count)) (the float (-> *blerc-globals* vtx-count)))
)
(if (< (-> *blerc-globals* min-val) 0)
(format *stdcon* "MINIMUM OUT OF RANGE: ~D~%" (-> *blerc-globals* min-val))
)
(if (< 255 (-> *blerc-globals* max-val))
(format *stdcon* "MAXIMUM OUT OF RANGE: ~D~%" (-> *blerc-globals* max-val))
)
)
(let ((a0-7 *blerc-globals*))
(set! (-> a0-7 min-val) 255)
(set! (-> a0-7 max-val) 0)
(set! (-> a0-7 fragment-count) 0)
(set! (-> a0-7 vtx-count) 0)
(set! (-> a0-7 target-vtx-count) 0)
)
)
0
(none)
)
(defun blerc-init ()
(blerc-stats-init)
(let ((v1-0 *blerc-globals*))
(set! (-> v1-0 first) (the-as uint 0))
(set! (-> v1-0 next) (the-as uint 0))
)
0
(none)
)
;; ERROR: function was not converted to expressions. Cannot decompile.
;; ERROR: function has no type analysis. Cannot decompile.
;; ERROR: function has no type analysis. Cannot decompile.
(def-mips2c blerc-execute (function none))
;; WARN: Return type mismatch int vs object.
(defun merc-blend-shape ((arg0 process-drawable))
(with-profiler 'merc *profile-merc-color*
(let* ((v1-1 (-> arg0 skel float-channels))
(a2-0 (cond
((> v1-1 0)
(-> arg0 skel channel (+ v1-1 -1 (-> arg0 skel active-channels)))
)
(else
(let ((v1-7 (-> arg0 skel root-channel))
(a0-5 (-> arg0 skel effect))
)
(-> v1-7 (if a0-5
(-> a0-5 channel-offset)
0
)
)
)
)
)
)
(a3-0 (-> a2-0 frame-group))
(a1-0 (new 'stack-no-clear 'array 'int16 128))
(disable-blerc? (and *use-fp-blerc* (not (process-drawable-might-need-blerc? arg0))))
)
(when (and a3-0 (and (> (-> arg0 skel active-channels) 0)
(zero? (-> arg0 draw cur-lod))
(logtest? (-> arg0 skel status) (joint-control-status blend-shape))
)
)
(cond
((and (-> arg0 skel override) (!= (-> arg0 skel override 0) 0.0))
(let* ((a0-12 (-> arg0 draw mgeo))
(v1-20 (-> a0-12 header blend-target-count))
(a2-2 (-> arg0 skel override))
)
(when (nonzero? v1-20)
(dotimes (a3-1 (the-as int v1-20))
(set! (-> a1-0 a3-1) (the int (* 8192.0 (-> a2-2 (+ a3-1 1)))))
)
(when (not disable-blerc?)
(setup-blerc-chains a0-12 a1-0 (-> *display* frames (-> *display* on-screen) global-buf))
)
(logior! (-> arg0 skel status) (joint-control-status blend-shape-valid))
;; og:preserve-this changed so we don't skip the profiler bar end
; (return (the-as object #f))
(goto end)
)
)
)
(else
(let ((t2-0 (-> a3-0 blend-shape-anim)))
(when t2-0
(let ((a0-14 (-> arg0 draw mgeo)))
(let* ((v1-33 (-> a0-14 header blend-target-count))
(t0-8 (-> a2-0 frame-num))
(t1-2 (the int t0-8))
(a2-6 (&+ t2-0 (* (the-as uint t1-2) v1-33)))
)
(cond
((< t1-2 (the-as int (+ (-> a3-0 frames num-frames) -1)))
(let* ((a3-6 (&+ a2-6 v1-33))
(t0-9 (* 64.0 (- t0-8 (the float t1-2))))
(t1-4 (- 64.0 t0-9))
)
(dotimes (t2-2 (the-as int v1-33))
(set! (-> a1-0 t2-2) (the int (+ 0.5
(* (the float (+ (-> (the-as (pointer uint8) (&+ a3-6 t2-2))) -64)) t0-9)
(* (the float (+ (-> (the-as (pointer uint8) (&+ a2-6 t2-2))) -64)) t1-4)
)
)
)
)
)
)
(else
(dotimes (a3-7 (the-as int v1-33))
(set! (-> a1-0 a3-7) (the-as int (* (+ (-> (the-as (pointer uint8) (&+ a2-6 a3-7))) -64) 64)))
)
)
)
)
(when (not disable-blerc?)
(setup-blerc-chains a0-14 a1-0 (-> *display* frames (-> *display* on-screen) global-buf))
)
)
(logior! (-> arg0 skel status) (joint-control-status blend-shape-valid))
;; og:preserve-this changed so we don't skip the profiler bar end
;; (return (the-as object #f))
(goto end)
)
)
)
)
)
(when (logtest? (-> arg0 skel status) (joint-control-status blend-shape-valid))
(logclear! (-> arg0 skel status) (joint-control-status blend-shape-valid))
(when (not disable-blerc?)
(setup-blerc-chains
(-> arg0 draw lod-set lod 0 geo)
(new 'static 'array int16 40 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
(-> *display* frames (-> *display* on-screen) global-buf)
)
)
)
)
(label end)
)
0
)
(def-mips2c setup-blerc-chains-for-one-fragment (function object object object object object object object))
(defun setup-blerc-chains ((arg0 merc-ctrl) (arg1 (pointer int16)) (arg2 dma-buffer))
(local-vars
(sv-16 uint)
(sv-20 pointer)
(sv-24 merc-effect)
(sv-28 uint)
(sv-32 object)
(sv-48 int)
(sv-64 int)
)
(set! sv-16 (-> arg0 header effect-count))
(let ((s3-0 (-> arg0 header blend-target-count))
(v1-1 (-> arg2 base))
)
(set! sv-20 (&+ v1-1 0))
(let ((a2-1 (the-as object (&+ v1-1 16))))
(if (zero? (-> *blerc-globals* first))
(set! (-> *blerc-globals* first) (the-as uint a2-1))
)
(dotimes (s2-0 (the-as int sv-16))
(set! sv-24 (-> arg0 effect s2-0))
(set! sv-28 (-> sv-24 blend-frag-count))
(when (nonzero? sv-28)
(let ((v1-15 (the-as object (-> sv-24 frag-geo)))
(s1-0 (the-as structure (-> sv-24 frag-ctrl)))
(s0-0 (the-as object (-> sv-24 blend-data)))
)
(set! sv-32 (-> sv-24 blend-ctrl))
(set! sv-48 0)
(while (< sv-48 (the-as int sv-28))
(set! sv-64 (+ (the-as int v1-15)
(logand (* (+ (-> (the-as merc-fragment-control s1-0) unsigned-four-count) 3) 4) #xfff0)
)
)
(if (nonzero? (-> (the-as (pointer uint8) sv-32) 0))
(set! a2-1 (setup-blerc-chains-for-one-fragment s3-0 arg1 a2-1 s0-0 sv-32 sv-64))
)
(let ((a0-14 (logand (+ (* (the-as uint 6) (-> (the-as merc-blend-ctrl sv-32) blend-vtx-count)) 15) #xfff0)))
(set! v1-15
(+ sv-64
(logand (* (+ (-> (the-as merc-fragment-control s1-0) lump-four-count) 3) 4) #xfff0)
(* (-> (the-as merc-fragment-control s1-0) fp-qwc) 16)
)
)
;; og:preserve-this
(set! s1-0 (&+ s1-0 (* (-> (the-as merc-fragment-control s1-0) mat-xfer-count) 2) 4))
(set! s0-0
(+ (the-as int s0-0) (* (the-as uint a0-14) (+ (-> (the-as merc-blend-ctrl sv-32) nonzero-index-count) 1)))
)
)
(set! sv-32 (+ (the-as int sv-32) s3-0 2))
(the-as int sv-32)
(set! sv-48 (+ sv-48 1))
)
)
)
)
(set! (-> (the-as (pointer int64) sv-20)) (logior #x20000000 (shr (shl (the-as int a2-1) 33) 1)))
(set! (-> (the-as (pointer uint32) sv-20) 2) (the-as uint 0))
(set! (-> (the-as (pointer uint32) sv-20) 3) (the-as uint 0))
(set! (-> arg2 base) (the-as pointer a2-1))
)
)
0
(none)
)
@@ -7,3 +7,145 @@
;; DECOMP BEGINS
(define *merc-death-globals* (new 'global 'vector))
(defun birth-func-death-sparks ()
0
(none)
)
(define death-seed
(new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x34 :sound "temp-enemy-die")
)
(defun start-seed-effect ((arg0 process-drawable) (arg1 vector) (arg2 cspace))
(let ((v1-0 (-> arg0 draw))
(a1-1 death-seed)
)
(set! (-> v1-0 death-vertex-skip) (-> a1-1 vertex-skip))
(set! (-> v1-0 death-effect) (-> a1-1 effect))
(set! (-> v1-0 death-timer) (+ (-> a1-1 timer) 1))
(set! (-> v1-0 death-timer-org) (-> v1-0 death-timer))
(set! (-> v1-0 death-draw-overlap) (-> a1-1 overlap))
)
(send-event
arg0
'trans-hook
(lambda :behavior process-drawable () (let ((v0-0 200))
(set! (-> self draw death-timer) (the-as uint v0-0))
(the-as time-frame v0-0)
)
)
)
0
(none)
)
(defpart 52
:init-specs ((:scale-x (meters 1))
(:rot-x (degrees 2.25))
(:scale-y :copy scale-x)
(:r 64.0 196.0)
(:g 196.0 64.0)
(:b 0.0)
(:a 4.0 2.0)
(:timer (seconds 0.017))
(:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow))
(:func 'sparticle-texture-glow-soft)
)
)
(define death-default
(new 'static 'death-info :vertex-skip #xa :timer #x4b :overlap #x4 :effect #x35 :sound "enemy-fizz")
)
(define death-warp-in
(new 'static 'death-info :vertex-skip #x96 :timer #x4b :effect #x36 :sound "warpgate-tele")
)
(define death-warp-out
(new 'static 'death-info :vertex-skip #x96 :timer #x96 :effect #x36 :sound "warpgate-tele")
)
(defun sparticle-texture-glow-soft ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector))
(particle-adgif-callback (-> arg1 adgif) (new 'static 'texture-id :index #xf :page #x4))
(set! (-> arg1 sp-func) (the-as (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none) 0))
0
(none)
)
(defpart 54
:init-specs ((:scale-x (meters 0.5) (meters 0.5))
(:scale-y :copy scale-x)
(:r 32.0 32.0)
(:g 32.0 64.0)
(:b 128.0 128.0)
(:a 128.0)
(:scalevel-x (meters 0.02) (meters 0.02))
(:scalevel-y :copy scalevel-x)
(:fade-a 0.0 -1.28)
(:friction 0.92 0.02)
(:timer (seconds 1.667))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13))
(:next-time (seconds 0.1) (seconds 0.065))
(:next-launcher 55)
)
)
(defpart 55
:init-specs ((:scale-x (meters 0.3) (meters 0.2))
(:scale-y :copy scale-x)
(:a 64.0 32.0)
(:omega (degrees 0.045) (degrees 0.03375))
(:vel-x (meters -0.053333335) (meters 0.10666667))
(:vel-y (meters -0.026666667) (meters 0.093333334))
(:vel-z (meters -0.053333335) (meters 0.10666667))
(:scalevel-x (meters -0.001) (meters -0.008))
(:scalevel-y :copy scalevel-x)
(:fade-a 0.0)
(:func 'sparticle-motion-blur)
)
)
(defpart 53
:init-specs ((:scale-x (meters 0.5) (meters 0.5))
(:scale-y :copy scale-x)
(:r 96.0 150.0)
(:g 32.0 64.0)
(:b 128.0 128.0)
(:a 128.0)
(:scalevel-x (meters 0.02) (meters 0.02))
(:scalevel-y :copy scalevel-x)
(:fade-a 0.0 -1.28)
(:friction 0.92 0.02)
(:timer (seconds 1.667))
(:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13))
(:next-time (seconds 0.1) (seconds 0.065))
(:next-launcher 56)
)
)
(defpart 56
:init-specs ((:scale-x (meters 0.3) (meters 0.2))
(:scale-y :copy scale-x)
(:a 64.0 32.0)
(:omega (degrees 0.045) (degrees 0.03375))
(:vel-x (meters -0.053333335) (meters 0.10666667))
(:vel-y (meters -0.026666667) (meters 0.093333334))
(:vel-z (meters -0.053333335) (meters 0.10666667))
(:scalevel-x (meters -0.001) (meters -0.008))
(:scalevel-y :copy scalevel-x)
(:fade-a 0.0)
(:func 'sparticle-motion-blur)
)
)
(defun merc-death-spawn ((arg0 int) (arg1 vector) (arg2 vector))
(let ((v1-2 (-> *part-id-table* arg0)))
(if (and (nonzero? v1-2) (= (-> v1-2 type) sparticle-launcher))
(sp-launch-particles-death *sp-particle-system-2d* v1-2 arg1)
)
)
0
(none)
)
@@ -408,6 +408,6 @@ Consists of a header and a list of [[merc-effect]]s."
(timer uint8)
(overlap uint8)
(effect uint32)
(sound symbol)
(sound string)
)
)
@@ -7,3 +7,8 @@
;; DECOMP BEGINS
;; stub
(format 0 "shadow-cpu: stubbed shadow-control::14~%")
(defmethod shadow-control-method-14 ((this shadow-control) (arg0 vector) (arg1 vector) (arg2 float) (arg3 float) (arg4 float))
(none)
)
@@ -43,6 +43,10 @@
(declare-type lightning-spec basic)
(define-extern *lightning-spec-id-table* (array lightning-spec))
(define-extern lightning-fractal-gen (function (inline-array vector) int int float lightning-spec none))
(define-extern lightning-uniform-gen (function (inline-array vector) int int float lightning-spec none))
(define-extern lightning-trail-uniform-gen (function (inline-array vector) (inline-array vector) float int symbol))
(define-extern lightning-trail-fractal-gen (function (inline-array vector) (inline-array vector) int int float lightning-spec none))
(define-extern process-drawable-art-error (state string process-drawable))
(define-extern unlink-lightning-spec-by-heap (function kheap none))
(define-extern lightning-draw-all (function none))
@@ -100,20 +100,20 @@
(base-color rgba)
)
(:methods
(lightning-bolt-method-9 (_type_ int int lightning-appearance) none)
(lightning-bolt-method-10 () none)
(init! (_type_ int int lightning-appearance) none)
(reset-spans! (_type_) none)
(lightning-bolt-method-11 (_type_) none)
(lightning-bolt-method-12 (_type_) none)
(lightning-bolt-method-13 (_type_ int) none)
(lightning-bolt-method-14 (_type_) int)
(lightning-bolt-method-15 () none)
(lightning-bolt-method-16 () none)
(lightning-bolt-method-17 () none)
(lightning-bolt-method-18 () none)
(lightning-bolt-method-19 () none)
(lightning-bolt-method-20 () none)
(lightning-bolt-method-21 () none)
(lightning-bolt-method-22 () none)
(lightning-bolt-method-15 (_type_ object int lightning-span-internal) none)
(lightning-bolt-method-16 (_type_ vector float float vector matrix) none)
(lightning-bolt-method-17 (_type_ uint float float curve2d-fast float) float)
(lightning-bolt-method-18 (_type_ prim-strip vector rgba float float) none)
(lightning-bolt-method-19 (_type_ vector int int matrix float float) none)
(lightning-bolt-method-20 (_type_ int lightning-span-internal) vector)
(lightning-bolt-method-21 (_type_ int int float) none)
(lightning-bolt-method-22 (_type_) none)
)
)
@@ -123,9 +123,9 @@
(lifetime time-frame)
(state-time time-frame)
)
(:methods
(lightning-new-tracker-method-14 () none)
(lightning-new-tracker-method-15 () none)
(:state-methods
active
die
)
)
@@ -7,3 +7,840 @@
;; DECOMP BEGINS
(define *lightning-alpha-additive* (new 'static 'gs-alpha :b #x2 :d #x1))
(define *lightning-alpha-blend* (new 'static 'gs-alpha :b #x1 :d #x1))
(define *lightning-alpha-subtractive* (new 'static 'gs-alpha :a #x2 :d #x1))
(defmethod init! ((this lightning-bolt) (arg0 int) (arg1 int) (arg2 lightning-appearance))
(set! (-> this num-spans) arg0)
(set! (-> this spans) (new 'process 'lightning-spans-array arg0))
(set! (-> this num-active-spans) 0)
(set! (-> this span-pts-start) (new 'process 'vector-array arg0))
(let ((s3-0 (* arg1 arg0)))
(let ((s2-1 (+ (* arg1 (+ arg0 -1)) 1)))
(set! (-> this current-points) (new 'process 'vector-array s2-1))
(set! (-> this desired-points) (new 'process 'vector-array s2-1))
)
(let ((f30-0 (* 2.0 (the float s3-0))))
(set! (-> this strip1)
(new 'process 'prim-strip (the int f30-0) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f))
)
(set! (-> this strip2)
(new 'process 'prim-strip (the int f30-0) (new 'static 'texture-id :index #x3 :page #x1) (the-as string #f))
)
)
)
(set! (-> this appearance) arg2)
(set! (-> this spans-internal) (new 'process 'lightning-spans-internal-array arg0))
(set! (-> this current-uv-shift) 0.0)
(set! (-> this strip1 clamp) (new 'static 'gs-clamp))
(set! (-> this strip2 clamp) (new 'static 'gs-clamp))
(when (-> this appearance use-sprite-bucket?)
(set! (-> this strip1 bucket) (bucket-id generic-sprite-1))
(set! (-> this strip1 sink) (the-as uint 65))
(set! (-> this strip1 texture-index) (the-as uint 7))
(set! (-> this strip2 bucket) (bucket-id generic-sprite-1))
(set! (-> this strip2 sink) (the-as uint 65))
(set! (-> this strip2 texture-index) (the-as uint 7))
)
(set! (-> this new-inner-point-generate-time)
(rand-vu-int-range
(the-as int (-> this appearance regenerate-time-start))
(the-as int (-> this appearance regenerate-time-end))
)
)
(set! (-> this base-width)
(rand-vu-float-range (-> this appearance width-range-start) (-> this appearance width-range-end))
)
(set! (-> this fade-mode) (the-as uint 0))
(set! (-> this current-fade-scalar) 1.0)
(when (-> this appearance uv-shift?)
(let* ((v1-31 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-32 (the-as number (logior #x3f800000 v1-31)))
)
(set! (-> this current-uv-shift) (+ -1.0 (the-as float v1-32)))
)
)
(dotimes (v1-35 (-> this num-spans))
(logand! (-> this spans-internal data v1-35 span-flags) -2)
(set! (-> this spans-internal data v1-35 index) v1-35)
)
(set! (-> this base-color) *color-gray*)
0
(none)
)
(defmethod reset-spans! ((this lightning-bolt))
(set! (-> this num-active-spans) 0)
0
(none)
)
(defmethod lightning-bolt-method-20 ((this lightning-bolt) (arg0 int) (arg1 lightning-span-internal))
(let ((s3-0 (new 'stack-no-clear 'vector)))
(let* ((f30-0 -0.5)
(v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-3 (the-as number (logior #x3f800000 v1-2)))
)
(set! (-> s3-0 x) (+ f30-0 (+ -1.0 (the-as float v1-3))))
)
(let* ((f30-1 -0.5)
(v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-8 (the-as number (logior #x3f800000 v1-7)))
)
(set! (-> s3-0 y) (+ f30-1 (+ -1.0 (the-as float v1-8))))
)
(set! (-> s3-0 z) (the float (-> arg1 index)))
(set! (-> s3-0 w) 1.0)
(set! (-> this desired-points data arg0 quad) (-> s3-0 quad))
)
(set! (-> this current-points data arg0 z) (the float (-> arg1 index)))
(-> this desired-points data arg0)
)
(defmethod lightning-bolt-method-21 ((this lightning-bolt) (arg0 int) (arg1 int) (arg2 float))
(local-vars (sv-16 int) (sv-24 vector) (sv-28 vector) (sv-32 float))
(let ((v1-0 (-> this desired-points)))
(when (< 1 (- arg1 arg0))
(set! sv-16 (/ (+ arg0 arg1) 2))
(set! sv-24 (-> v1-0 data arg0))
(set! sv-28 (-> v1-0 data arg1))
(set! sv-32 (the-as float 1.0))
(set! sv-32 (-> sv-28 z))
(let ((s2-0 (-> v1-0 data sv-16)))
(let* ((f30-0 (* 0.5 (+ (-> sv-24 x) (-> sv-28 x))))
(f28-0 arg2)
(f26-0 -0.5)
(v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-7 (the-as number (logior #x3f800000 v1-6)))
)
(set! (-> s2-0 x) (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-7))))))
)
(let* ((f30-1 (* 0.5 (+ (-> sv-24 y) (-> sv-28 y))))
(f28-1 arg2)
(f26-1 -0.5)
(v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-15 (the-as number (logior #x3f800000 v1-14)))
)
(set! (-> s2-0 y) (+ f30-1 (* f28-1 (+ f26-1 (+ -1.0 (the-as float v1-15))))))
)
(set! (-> s2-0 z) (lerp (-> sv-24 z) sv-32 0.5))
)
(lightning-bolt-method-21 this arg0 sv-16 (* arg2 (-> this fractal-reduction)))
(lightning-bolt-method-21 this sv-16 arg1 (* arg2 (-> this fractal-reduction)))
)
)
0
(none)
)
(defmethod lightning-bolt-method-15 ((this lightning-bolt) (arg0 object) (arg1 int) (arg2 lightning-span-internal))
(let ((v1-0 (-> this generate-mode)))
(cond
((zero? v1-0)
(let ((f30-0 (the float (-> arg2 index)))
(f28-0 (the float (+ (-> arg2 index) 1)))
(f26-0 (/ 1.0 (the float (+ (-> arg2 num-inner-points) 1))))
)
0.0
(let ((f24-0 (+ 0.0 f26-0)))
(dotimes (s3-0 (-> arg2 num-inner-points))
(let ((f22-0 (lerp f30-0 f28-0 f24-0)))
(let ((s2-0 (-> this desired-points data (+ s3-0 1 arg1))))
(let* ((f20-0 -0.5)
(v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-14 (the-as number (logior #x3f800000 v1-13)))
)
(set! (-> s2-0 x) (+ f20-0 (+ -1.0 (the-as float v1-14))))
)
(let* ((f20-1 -0.5)
(v1-18 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-19 (the-as number (logior #x3f800000 v1-18)))
)
(set! (-> s2-0 y) (+ f20-1 (+ -1.0 (the-as float v1-19))))
)
(set! (-> s2-0 z) f22-0)
(set! (-> s2-0 w) 1.0)
)
(set! (-> this current-points data (+ s3-0 1 arg1) z) f22-0)
)
(+! f24-0 f26-0)
)
)
)
)
((= v1-0 1)
(lightning-bolt-method-21 this arg1 (+ (-> arg2 num-inner-points) 1 arg1) 1.0)
)
)
)
(none)
)
;; WARN: Return type mismatch uint vs int.
(defmethod lightning-bolt-method-14 ((this lightning-bolt))
(the-as int (-> this fade-mode))
)
(defmethod lightning-bolt-method-13 ((this lightning-bolt) (arg0 int))
(when (!= (-> this fade-mode) arg0)
(let ((v1-1 arg0))
(cond
((zero? v1-1)
(set! (-> this current-fade-scalar) 1.0)
(set-time! (-> this start-fade-time))
)
((= v1-1 2)
(set-time! (-> this start-fade-time))
(set! (-> this current-fade-scalar) 1.0)
)
((= v1-1 1)
(set! (-> this current-fade-scalar) 0.0)
(set-time! (-> this start-fade-time))
)
((= v1-1 3)
(dotimes (v1-12 (-> this num-spans))
(logand! (-> this spans-internal data v1-12 span-flags) -2)
)
)
)
)
(set! (-> this fade-mode) (the-as uint arg0))
)
(none)
)
;; WARN: Function (method 11 lightning-bolt) has a return type of none, but the expression builder found a return statement.
(defmethod lightning-bolt-method-11 ((this lightning-bolt))
(local-vars
(sv-16 time-frame)
(sv-24 float)
(sv-32 time-frame)
(sv-40 float)
(sv-64 vector)
(sv-68 float)
(sv-72 float)
)
(with-pp
(case (-> this fade-mode)
((2)
(let* ((f1-2 (/ (the float (- (current-time) (-> this start-fade-time))) (the float (-> this appearance fade-time))))
(f0-3 (fmax 0.0 (fmin 1.0 f1-2)))
)
(set! (-> this current-fade-scalar) (lerp 1.0 0.0 f0-3))
)
(if (>= 0.0 (-> this current-fade-scalar))
(lightning-bolt-method-13 this 3)
)
)
((1)
(let* ((f1-7 (/ (the float (- (current-time) (-> this start-fade-time))) (the float (-> this appearance fade-time))))
(f0-9 (fmax 0.0 (fmin 1.0 f1-7)))
)
(set! (-> this current-fade-scalar) (lerp 0.0 1.0 f0-9))
)
(if (>= (-> this current-fade-scalar) 1.0)
(lightning-bolt-method-13 this 0)
)
)
)
(if (= (-> this fade-mode) 3)
(return 0)
)
(if (zero? (-> this fade-mode))
(set! (-> this current-fade-scalar) 1.0)
)
(set! (-> this num-active-spans) (min (-> this num-active-spans) (+ (-> this num-spans) -1)))
(let ((v1-31 (-> this num-active-spans))
(a0-14 (+ (-> this num-spans) -1))
)
(while (>= a0-14 v1-31)
(let ((a1-6 (-> this spans-internal data v1-31)))
(logand! (-> a1-6 span-flags) -2)
)
(+! v1-31 1)
)
)
(let ((v1-37 (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time))))
(dotimes (a0-17 (-> this num-active-spans))
(-> this spans data a0-17)
(let ((a1-12 (-> this spans-internal data a0-17)))
(if (or v1-37 (not (logtest? (-> a1-12 span-flags) 1)))
(logior! (-> a1-12 span-flags) 2)
(logand! (-> a1-12 span-flags) -3)
)
)
)
)
(let ((s5-0 0))
(dotimes (s4-0 (-> this num-active-spans))
(-> this spans data s4-0)
(let* ((a2-13 (-> this spans-internal data s4-0))
(s3-0 (+ (-> a2-13 num-inner-points) 1))
)
(when (logtest? (-> a2-13 span-flags) 2)
(when (or (-> this snap-inner-points?)
(and (logtest? (-> a2-13 span-flags) 2) (not (logtest? (-> a2-13 span-flags) 1)))
)
(dotimes (v1-55 s3-0)
(set! (-> this current-points data (+ v1-55 s5-0) quad) (-> this desired-points data (+ v1-55 s5-0) quad))
)
)
(lightning-bolt-method-20 this s5-0 a2-13)
)
(+! s5-0 s3-0)
)
)
(when (time-elapsed? (-> this last-generate-time) (-> this new-inner-point-generate-time))
(lightning-bolt-method-20 this s5-0 (-> this spans-internal data (-> this num-active-spans)))
(if (-> this snap-inner-points?)
(set! (-> this current-points data s5-0 quad) (-> this desired-points data s5-0 quad))
)
(set-time! (-> this last-generate-time))
(set! (-> this new-inner-point-generate-time) (rand-vu-int-range
(the-as int (-> this appearance regenerate-time-start))
(the-as int (-> this appearance regenerate-time-end))
)
)
)
)
(let ((s5-1 0))
(dotimes (s4-1 (-> this num-active-spans))
(let* ((a1-24 (-> this spans data s4-1))
(a3-5 (-> this spans-internal data s4-1))
(s3-1 (+ (-> a3-5 num-inner-points) 1))
)
(if (logtest? (-> a3-5 span-flags) 2)
(lightning-bolt-method-15 this a1-24 s5-1 a3-5)
)
(+! s5-1 s3-1)
)
)
)
(let ((s5-2 0))
(dotimes (s4-2 (+ (-> this num-active-spans) 1))
(-> this spans data s4-2)
(let* ((v1-102 (-> this spans-internal data s4-2))
(s3-2 (+ (-> v1-102 num-inner-points) 1))
)
(if (= s4-2 (-> this num-active-spans))
(set! s3-2 1)
)
(cond
((not (-> this appearance use-accurate-interp?))
(let ((a0-49 (the-as int (- (current-time) (-> pp clock old-frame-counter)))))
0.0
(if (logtest? (-> v1-102 span-flags) 2)
(set! a0-49 0)
)
(let* ((f1-12 (/ (the float a0-49) (the float (-> this inner-point-travel-time))))
(f30-0 (fmax 0.0 (fmin 1.0 f1-12)))
)
(dotimes (s2-0 s3-2)
(vector-lerp!
(-> this current-points data (+ s2-0 s5-2))
(-> this current-points data (+ s2-0 s5-2))
(-> this desired-points data (+ s2-0 s5-2))
f30-0
)
)
)
)
)
(else
(set! sv-16 (- (current-time) (- (current-time) (-> pp clock old-frame-counter))))
(set! sv-24 (the-as float 0.0))
(set! sv-32 (current-time))
(set! sv-40 (the-as float 0.0))
(set! sv-24
(/ (the float (- sv-16 (-> this last-generate-time))) (the float (-> this inner-point-travel-time)))
)
(set! sv-40
(/ (the float (- sv-32 (-> this last-generate-time))) (the float (-> this inner-point-travel-time)))
)
(set! sv-24 (fmax 0.0 (fmin 1.0 sv-24)))
(set! sv-40 (fmax 0.0 (fmin 1.0 sv-40)))
(let ((f30-1 (- 1.0 sv-24)))
(dotimes (s2-1 s3-2)
(set! sv-64 (new 'stack-no-clear 'vector))
(set! sv-68 (the-as float 0.0))
(set! sv-72 (the-as float 0.0))
(set-vector!
sv-64
(- (-> this desired-points data (+ s2-1 s5-2) x) (-> this current-points data (+ s2-1 s5-2) x))
(- (-> this desired-points data (+ s2-1 s5-2) y) (-> this current-points data (+ s2-1 s5-2) y))
0.0
1.0
)
(set! sv-68 (vector-normalize-ret-len! sv-64 1.0))
(when (< 0.0 f30-1)
(set! sv-72 (/ sv-68 f30-1))
(vector-float*! sv-64 sv-64 (* sv-72 (- sv-40 sv-24)))
(vector+! (-> this current-points data (+ s2-1 s5-2)) (-> this current-points data (+ s2-1 s5-2)) sv-64)
(set! (-> this current-points data (+ s2-1 s5-2) z) (-> this desired-points data (+ s2-1 s5-2) z))
)
)
)
)
)
(+! s5-2 s3-2)
)
)
)
(dotimes (v1-156 (-> this num-active-spans))
(-> this spans data v1-156)
(let ((a0-82 (-> this spans-internal data v1-156)))
(logior! (-> a0-82 span-flags) 1)
)
)
(none)
)
)
;; WARN: Return type mismatch vector vs none.
(defmethod lightning-bolt-method-19 ((this lightning-bolt) (arg0 vector) (arg1 int) (arg2 int) (arg3 matrix) (arg4 float) (arg5 float))
(let ((a1-2
(vector-! (new 'stack-no-clear 'vector) (-> this current-points data arg2) (-> this current-points data arg1))
)
)
(set! (-> a1-2 x) (* (-> a1-2 x) arg4))
(set! (-> a1-2 y) (* (-> a1-2 y) arg4))
(set! (-> a1-2 z) (* (-> a1-2 z) arg5))
(vector-rotate*! arg0 a1-2 arg3)
)
(none)
)
(defun matrix<-vector-yz2! ((arg0 matrix) (arg1 vector) (arg2 vector))
(set! (-> arg0 fvec quad) (-> arg1 quad))
(vector-cross! (-> arg0 rvec) arg2 arg1)
(vector-normalize! (-> arg0 rvec) 1.0)
(vector-cross! (-> arg0 uvec) arg1 (-> arg0 rvec))
(vector-normalize! (-> arg0 uvec) 1.0)
(set! (-> arg0 rvec w) 1.0)
(set! (-> arg0 uvec w) 1.0)
(set! (-> arg0 fvec w) 1.0)
arg0
)
;; WARN: Return type mismatch number vs none.
;; WARN: Function (method 22 lightning-bolt) has a return type of none, but the expression builder found a return statement.
(defmethod lightning-bolt-method-22 ((this lightning-bolt))
(with-pp
(set! (-> this strip1 num-verts) (the-as uint 0))
(set! (-> this strip2 num-verts) (the-as uint 0))
(set! (-> this strip1 adnops 0 cmds) (gs-reg64 test-1))
(set! (-> this strip1 data0)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
)
(set! (-> this strip2 adnops 0 cmds) (gs-reg64 test-1))
(set! (-> this strip2 data0)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
)
(set! (-> this strip1 adnops 1 cmds) (gs-reg64 alpha-1))
(set! (-> this strip2 adnops 1 cmds) (gs-reg64 alpha-1))
(let ((v1-9 (-> this appearance blend-mode)))
(cond
((= v1-9 1)
(set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-additive*))
(set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-additive*))
)
((zero? v1-9)
(set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-blend*))
(set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-blend*))
)
((= v1-9 2)
(set! (-> this strip1 data1) (the-as gs-test *lightning-alpha-subtractive*))
(set! (-> this strip2 data1) (the-as gs-test *lightning-alpha-subtractive*))
)
)
)
(set! (-> this strip1 tex-id) (the-as texture-id (-> this appearance tex-id)))
(set! (-> this strip2 tex-id) (the-as texture-id (-> this appearance tex-id)))
(if (= (-> this fade-mode) 3)
(return 0)
)
(when (-> this appearance uv-shift?)
(let ((f0-2 (/ (the float (- (current-time) (-> pp clock old-frame-counter)))
(the float (-> this appearance uv-shift-speed))
)
)
)
(+! (-> this current-uv-shift) f0-2)
)
(let ((f0-4 (-> this current-uv-shift)))
(set! (-> this current-uv-shift) (- f0-4 (the float (the int f0-4))))
)
(if (< (-> this current-uv-shift) 1.0)
(+! (-> this current-uv-shift) 1.0)
)
)
(none)
)
)
(defun choose-nice-perp ((arg0 vector))
(let* ((f0-0 (-> arg0 x))
(f0-2 (* f0-0 f0-0))
(f1-0 (-> arg0 z))
)
(if (< (+ f0-2 (* f1-0 f1-0)) 0.01)
*x-vector*
*up-vector*
)
)
)
;; WARN: Function (method 12 lightning-bolt) has a return type of none, but the expression builder found a return statement.
(defmethod lightning-bolt-method-12 ((this lightning-bolt))
(local-vars
(sv-48 int)
(sv-56 float)
(sv-60 vector)
(sv-64 matrix)
(sv-96 lightning-span)
(sv-100 lightning-span-internal)
(sv-104 vector)
(sv-224 matrix)
(sv-228 vector)
(sv-232 vector)
(sv-236 float)
(sv-240 vector)
(sv-244 float)
(sv-248 float)
(sv-256 int)
(sv-288 lightning-span)
(sv-292 lightning-span-internal)
(sv-296 vector)
(sv-416 matrix)
(sv-420 vector)
(sv-424 vector)
(sv-428 vector)
(sv-432 float)
)
(when (= (-> this fade-mode) 3)
(set! (-> this strip1 num-verts) (the-as uint 0))
(set! (-> this strip2 num-verts) (the-as uint 0))
(return 0)
)
(set! sv-48 0)
(set! sv-56 (the-as float 0.0))
(set! sv-60 (new 'stack-no-clear 'vector))
(set! sv-64 (new 'stack-no-clear 'matrix))
(lightning-bolt-method-22 this)
(set! (-> sv-60 x) 0.0)
(set! (-> sv-60 y) 0.0)
(dotimes (s5-0 (-> this num-active-spans))
(set! sv-96 (-> this spans data s5-0))
(set! sv-100 (-> this spans-internal data s5-0))
(set! sv-104 (new 'stack-no-clear 'vector))
(set! sv-224 (new 'stack-no-clear 'matrix))
(set! sv-228 (new 'stack-no-clear 'vector))
(set! sv-232 (new 'stack-no-clear 'vector))
(set! sv-236 (the-as float 0.0))
(set! sv-240
(vector-!
(new 'stack-no-clear 'vector)
(-> this span-pts-start data (+ s5-0 1))
(-> this span-pts-start data s5-0)
)
)
(set! sv-244 (the float (-> sv-100 index)))
(vector-normalize! sv-240 1.0)
(set! sv-236
(vector-vector-distance (-> this span-pts-start data s5-0) (-> this span-pts-start data (+ s5-0 1)))
)
(matrix<-vector-yz2! sv-224 sv-240 (choose-nice-perp sv-240))
(let ((f30-0 (-> sv-96 random-offset-size-start)))
(lightning-bolt-method-19 this sv-104 sv-48 (+ sv-48 1) sv-224 f30-0 sv-236)
(set! (-> sv-232 quad) (-> this current-points data sv-48 quad))
(set! (-> sv-232 x) (* (-> sv-232 x) f30-0))
(set! (-> sv-232 y) (* (-> sv-232 y) f30-0))
)
(set! (-> sv-232 z) (- (-> sv-232 z) sv-244))
(set! (-> sv-232 z) (* (-> sv-232 z) sv-236))
(vector-rotate*! sv-228 sv-232 sv-224)
(vector+! sv-228 sv-228 (-> this span-pts-start data s5-0))
(lightning-bolt-method-16 this sv-228 (vector-length sv-232) sv-56 sv-60 (the-as matrix sv-104))
(set! sv-248 (-> sv-96 inner-random-offset-size))
(dotimes (s4-1 (-> sv-100 num-inner-points))
(set! sv-256 (+ sv-48 1 s4-1))
(lightning-bolt-method-19 this sv-104 (+ sv-256 -1) sv-256 sv-224 sv-248 sv-236)
(set! (-> sv-232 quad) (-> this current-points data sv-256 quad))
(set! (-> sv-232 x) (* (-> sv-232 x) sv-248))
(set! (-> sv-232 y) (* (-> sv-232 y) sv-248))
(set! (-> sv-232 z) (- (-> sv-232 z) sv-244))
(set! (-> sv-232 z) (* (-> sv-232 z) sv-236))
(vector-rotate*! sv-228 sv-232 sv-224)
(vector+! sv-228 sv-228 (-> this span-pts-start data s5-0))
(lightning-bolt-method-16 this sv-228 (vector-length sv-232) sv-56 sv-60 (the-as matrix sv-104))
)
(set! sv-56 (+ sv-56 sv-236))
(set! sv-48 (+ (-> sv-100 num-inner-points) 1 sv-48))
(set! (-> sv-64 rvec quad) (-> sv-104 quad))
)
(let ((s5-1 (-> this num-active-spans)))
(set! sv-288 (-> this spans data s5-1))
(set! sv-292 (-> this spans-internal data s5-1))
(set! sv-296 (new 'stack-no-clear 'vector))
(set! sv-416 (new 'stack-no-clear 'matrix))
(set! sv-420 (new 'stack-no-clear 'vector))
(set! sv-424 (new 'stack-no-clear 'vector))
(set! sv-428 (vector-!
(new 'stack-no-clear 'vector)
(-> this span-pts-start data s5-1)
(-> this span-pts-start data (+ s5-1 -1))
)
)
(set! sv-432 (the float (-> sv-292 index)))
(vector-normalize! sv-428 1.0)
(matrix<-vector-yz2! sv-416 sv-428 (choose-nice-perp sv-428))
(let ((f0-33 (-> sv-288 random-offset-size-start)))
(set! (-> sv-424 quad) (-> this current-points data sv-48 quad))
(set! (-> sv-424 x) (* (-> sv-424 x) f0-33))
(set! (-> sv-424 y) (* (-> sv-424 y) f0-33))
)
(set! (-> sv-424 z) (- (-> sv-424 z) sv-432))
(vector-rotate*! sv-420 sv-424 sv-416)
(vector+! sv-420 sv-420 (-> this span-pts-start data s5-1))
)
(lightning-bolt-method-16 this sv-420 0.0 sv-56 sv-60 sv-64)
0
(none)
)
(defmethod relocate ((this lightning-bolt) (offset int))
(if (nonzero? (-> this spans))
(&+! (-> this spans) offset)
)
(if (nonzero? (-> this strip1))
(&+! (-> this strip1) offset)
)
(if (nonzero? (-> this strip2))
(&+! (-> this strip2) offset)
)
(dotimes (v1-12 (+ (-> this num-spans) -1))
)
(if (nonzero? (-> this spans-internal))
(&+! (-> this spans-internal) offset)
)
(if (nonzero? (-> this current-points))
(&+! (-> this current-points) offset)
)
(if (nonzero? (-> this desired-points))
(&+! (-> this desired-points) offset)
)
(if (nonzero? (-> this span-pts-start))
(&+! (-> this span-pts-start) offset)
)
(call-parent-method this offset)
)
(defmethod lightning-bolt-method-17 ((this lightning-bolt) (arg0 uint) (arg1 float) (arg2 float) (arg3 curve2d-fast) (arg4 float))
(if (not arg3)
(return 1.0)
)
(let ((v1-2 arg0))
(cond
((zero? v1-2)
(curve2d-method-9 arg3 (/ arg2 arg4) 3)
)
((= v1-2 1)
(curve2d-method-9 arg3 arg1 3)
)
((= v1-2 2)
(let* ((v1-6 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-7 (the-as number (logior #x3f800000 v1-6)))
)
(+ -1.0 (the-as float v1-7))
)
)
(else
1.0
)
)
)
)
(defmethod lightning-bolt-method-16 ((this lightning-bolt) (arg0 vector) (arg1 float) (arg2 float) (arg3 vector) (arg4 matrix))
(local-vars (sv-160 vector) (sv-164 vector) (sv-168 vector) (sv-172 vector) (sv-176 rgba))
0.0
0.0
0.0
(let ((f28-0
(/ (the float (- (current-time) (-> this last-generate-time))) (the float (-> this inner-point-travel-time)))
)
(f30-0 (+ arg2 arg1))
)
(math-camera-pos)
(let* ((s2-0 (-> this appearance))
(f24-0 (* (lightning-bolt-method-17
this
(-> s2-0 alpha-1-mode)
f28-0
f30-0
(-> s2-0 alpha-1-curve)
(-> s2-0 alpha-1-repeat-dist)
)
(lightning-bolt-method-17
this
(-> s2-0 alpha-2-mode)
f28-0
f30-0
(-> s2-0 alpha-2-curve)
(-> s2-0 alpha-2-repeat-dist)
)
(-> s2-0 base-alpha)
(-> this current-fade-scalar)
)
)
(f22-0 (* (lightning-bolt-method-17
this
(-> s2-0 width-mode)
f28-0
f30-0
(-> s2-0 width-curve)
(-> s2-0 width-repeat-dist)
)
(-> this base-width)
)
)
(f0-14 (/ f30-0 (-> s2-0 uv-repeat-dist)))
(f28-1 (+ (- f0-14 (* (the float (the int (/ f0-14 6.0))) 6.0)) (-> this current-uv-shift)))
)
(vector-normalize! (the-as vector arg4) 1.0)
(let* ((a2-4 (-> (camera-matrix) uvec))
(v1-13 (matrix-f-u-compose (new 'stack-no-clear 'matrix) (the-as vector arg4) a2-4))
(f26-1 6.0)
)
(set! sv-160 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* 0.5 f22-0)))
(set! sv-164 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 rvec) (* -0.5 f22-0)))
(set! sv-168 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* 0.5 f22-0)))
(set! sv-172 (vector+float*! (new 'stack-no-clear 'vector) arg0 (-> v1-13 uvec) (* -0.5 f22-0)))
(set! sv-176 (the-as rgba (new 'stack-no-clear 'array 'rgba 1)))
(set! sv-176 (-> this base-color))
(set! sv-176 (copy-and-set-field sv-176 a (the int (* 128.0 f24-0))))
(when (< f28-1 (-> arg3 x))
(let ((s3-1 (new 'stack-no-clear 'vector))
(s4-1 (new 'stack-no-clear 'vector))
)
(let ((f24-1 (/ (- (+ f26-1 f28-1) (-> arg3 x)) f26-1)))
(let ((a1-10 (+ (the-as uint (-> this strip1 data 0 pos)) (* (+ (-> this strip1 num-verts) -2) 32)))
(s2-1 (+ (the-as uint (-> this strip1 data 0 pos)) (* (+ (-> this strip1 num-verts) -1) 32)))
)
(vector-lerp! s3-1 (the-as vector a1-10) sv-160 f24-1)
(vector-lerp! s4-1 (the-as vector s2-1) sv-164 f24-1)
)
(lightning-bolt-method-18 this (-> this strip1) s3-1 sv-176 0.0 f26-1)
(lightning-bolt-method-18 this (-> this strip1) s4-1 sv-176 1.0 f26-1)
(lightning-bolt-method-18 this (-> this strip1) s3-1 sv-176 0.0 0.0)
(lightning-bolt-method-18 this (-> this strip1) s4-1 sv-176 1.0 0.0)
(let ((a1-16 (+ (the-as uint (-> this strip2 data 0 pos)) (* (+ (-> this strip2 num-verts) -2) 32)))
(s2-2 (+ (the-as uint (-> this strip2 data 0 pos)) (* (+ (-> this strip2 num-verts) -1) 32)))
)
(vector-lerp! s3-1 (the-as vector a1-16) sv-168 f24-1)
(vector-lerp! s4-1 (the-as vector s2-2) sv-172 f24-1)
)
)
(lightning-bolt-method-18 this (-> this strip2) s3-1 sv-176 1.0 f26-1)
(lightning-bolt-method-18 this (-> this strip2) s4-1 sv-176 0.0 f26-1)
(lightning-bolt-method-18 this (-> this strip2) s3-1 sv-176 1.0 0.0)
(lightning-bolt-method-18 this (-> this strip2) s4-1 sv-176 0.0 0.0)
)
)
)
(lightning-bolt-method-18 this (-> this strip1) sv-160 sv-176 0.0 f28-1)
(lightning-bolt-method-18 this (-> this strip1) sv-164 sv-176 1.0 f28-1)
(lightning-bolt-method-18 this (-> this strip2) sv-168 sv-176 1.0 f28-1)
(lightning-bolt-method-18 this (-> this strip2) sv-172 sv-176 0.0 f28-1)
(set! (-> arg3 y) f30-0)
(set! (-> arg3 x) f28-1)
)
)
0
(none)
)
(defmethod lightning-bolt-method-18 ((this lightning-bolt) (arg0 prim-strip) (arg1 vector) (arg2 rgba) (arg3 float) (arg4 float))
(when (< (-> arg0 num-verts) (-> arg0 allocated-num-verts))
(let ((v1-5 (-> arg0 data (-> arg0 num-verts))))
(set! (-> v1-5 pos quad) (-> arg1 quad))
(set! (-> v1-5 col) arg2)
(set! (-> v1-5 stq x) arg3)
(set! (-> v1-5 stq y) arg4)
)
(+! (-> arg0 num-verts) 1)
)
0
(none)
)
(defbehavior lightning-new-tracker-init-by-other lightning-new-tracker ((arg0 lightning-tracker-init-params))
(set! (-> self bolt) (new 'process 'lightning-bolt))
(init! (-> self bolt) 2 (+ (-> arg0 num-inner-points) 2) (-> arg0 appearance))
(set! (-> self lifetime) (-> arg0 lifetime))
(set! (-> self bolt span-pts-start data 0 quad) (-> arg0 start-pt quad))
(set! (-> self bolt span-pts-start data 1 quad) (-> arg0 end-pt quad))
(set! (-> self bolt spans-internal data 0 num-inner-points) (-> arg0 num-inner-points))
(set! (-> self bolt spans data 0 inner-random-offset-size) (-> arg0 inner-random-offset-size))
(set! (-> self bolt spans data 0 random-offset-size-start) (-> arg0 random-offset-size-start))
(set! (-> self bolt inner-point-travel-time) (seconds 0.017))
(set! (-> self bolt snap-inner-points?) #t)
(set! (-> self bolt appearance) (-> arg0 appearance))
(set! (-> self bolt fractal-reduction) 0.4)
(set! (-> self bolt generate-mode) (the-as uint 1))
(go-virtual active)
)
;; WARN: Return type mismatch process vs lightning-new-tracker.
(defun create-lightning-tracker-new ((arg0 lightning-tracker-init-params))
(let ((v1-1 (process-spawn lightning-new-tracker arg0 :name "lightning-new-tracker" :stack-size #x8000)))
(if v1-1
(return (the-as lightning-new-tracker (-> v1-1 0)))
)
)
(the-as lightning-new-tracker #f)
)
(defmethod relocate ((this lightning-new-tracker) (offset int))
(if (nonzero? (-> this bolt))
(&+! (-> this bolt) offset)
)
(call-parent-method this offset)
)
(defstate active (lightning-new-tracker)
:virtual #t
:enter (behavior ()
(set-time! (-> self state-time))
(set! (-> self bolt num-active-spans) 1)
(lightning-bolt-method-13 (-> self bolt) 0)
)
:trans (behavior ()
(if (time-elapsed? (-> self state-time) (-> self lifetime))
(go-virtual die)
)
(lightning-bolt-method-11 (-> self bolt))
(lightning-bolt-method-12 (-> self bolt))
)
:code sleep-code
)
(defstate die (lightning-new-tracker)
:virtual #t
:enter (behavior ()
(lightning-bolt-method-13 (-> self bolt) 2)
(set-time! (-> self state-time))
)
:trans (behavior ()
(lightning-bolt-method-11 (-> self bolt))
(lightning-bolt-method-12 (-> self bolt))
)
:code (behavior ()
(until (= (lightning-bolt-method-14 (-> self bolt)) 3)
(suspend)
)
)
)
@@ -7,3 +7,830 @@
;; DECOMP BEGINS
(kmemopen global "part-tables")
(define *lightning-spec-id-table* (new 'global 'boxed-array lightning-spec 128))
(kmemclose)
(define *lightning-gcf*
(new 'static 'gcf-control
:giftag (new 'static 'generic-gif-tag
:fan-prim (new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1)
:nreg #x3
)
:str-prim (new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1)
:nreg #x3
)
:regs (new 'static 'gif-tag-regs-32 :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
:adnops (new 'static 'inline-array gs-adcmd 2
(new 'static 'gs-adcmd :cmds (gs-reg64 hack))
(new 'static 'gs-adcmd :cmds (gs-reg64 hack))
)
)
)
(defun lightning-fractal-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec))
(local-vars (sv-16 vector) (sv-32 vector))
(when (< 1 (- arg2 arg1))
(let ((s1-0 (/ (+ arg1 arg2) 2)))
(set! sv-16 (-> arg0 arg1))
(set! sv-32 (-> arg0 arg2))
(let ((s0-0 (-> arg0 s1-0)))
(let* ((f30-0 (* 0.5 (+ (-> sv-16 x) (-> sv-32 x))))
(f28-0 arg3)
(f26-0 -0.5)
(v1-12 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-13 (the-as number (logior #x3f800000 v1-12)))
)
(set! (-> s0-0 x) (+ f30-0 (* f28-0 (+ f26-0 (+ -1.0 (the-as float v1-13))))))
)
(let* ((f30-1 (* 0.5 (+ (-> sv-16 y) (-> sv-32 y))))
(f28-1 arg3)
(f26-1 -0.5)
(v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-20 (the-as number (logior #x3f800000 v1-19)))
)
(set! (-> s0-0 y) (+ f30-1 (* f28-1 (+ f26-1 (+ -1.0 (the-as float v1-20))))))
)
(let* ((f30-2 (* 0.5 (+ (-> sv-16 z) (-> sv-32 z))))
(f28-2 arg3)
(f26-2 -0.5)
(v1-26 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-27 (the-as number (logior #x3f800000 v1-26)))
)
(set! (-> s0-0 z) (+ f30-2 (* f28-2 (+ f26-2 (+ -1.0 (the-as float v1-27))))))
)
)
(lightning-fractal-gen arg0 arg1 s1-0 (* arg3 (-> arg4 reduction)) arg4)
(lightning-fractal-gen arg0 s1-0 arg2 (* arg3 (-> arg4 reduction)) arg4)
)
)
0
(none)
)
(defun lightning-uniform-gen ((arg0 (inline-array vector)) (arg1 int) (arg2 int) (arg3 float) (arg4 lightning-spec))
(local-vars (sv-32 vector))
(let ((s4-0 (-> arg0 arg1))
(s3-0 (-> arg0 arg2))
(f30-0 (/ 1.0 (the float (- arg2 arg1))))
(f28-0 0.0)
(s2-0 (new-stack-vector0))
(s1-0 arg1)
(s0-0 arg2)
)
(while (>= s0-0 s1-0)
(vector-lerp! (-> arg0 s1-0) s4-0 s3-0 f28-0)
(set! sv-32 s2-0)
(let* ((f26-0 0.4)
(f24-0 -0.5)
(v1-7 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-8 (the-as number (logior #x3f800000 v1-7)))
)
(set! (-> sv-32 x) (* f26-0 (+ f24-0 (+ -1.0 (the-as float v1-8))) arg3))
)
(let* ((f26-1 0.4)
(f24-1 -0.5)
(v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-14 (the-as number (logior #x3f800000 v1-13)))
)
(set! (-> sv-32 y) (* f26-1 (+ f24-1 (+ -1.0 (the-as float v1-14))) arg3))
)
(let* ((f26-2 0.4)
(f24-2 -0.5)
(v1-19 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-20 (the-as number (logior #x3f800000 v1-19)))
)
(set! (-> sv-32 z) (* f26-2 (+ f24-2 (+ -1.0 (the-as float v1-20))) arg3))
)
(set! (-> sv-32 w) 1.0)
(vector+! (-> arg0 s1-0) (-> arg0 s1-0) s2-0)
(+! f28-0 f30-0)
(+! s1-0 1)
)
)
0
(none)
)
(defun lightning-trail-uniform-gen ((arg0 (inline-array vector)) (arg1 (inline-array vector)) (arg2 float) (arg3 int))
(let ((s2-0 (new 'stack-no-clear 'vector)))
(dotimes (s1-0 arg3)
(let ((s0-0 s2-0))
(let* ((f30-0 0.4)
(f28-0 -0.5)
(v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-4 (the-as number (logior #x3f800000 v1-3)))
)
(set! (-> s0-0 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-4))) arg2))
)
(let* ((f30-1 0.4)
(f28-1 -0.5)
(v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-10 (the-as number (logior #x3f800000 v1-9)))
)
(set! (-> s0-0 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-10))) arg2))
)
(let* ((f30-2 0.4)
(f28-2 -0.5)
(v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-16 (the-as number (logior #x3f800000 v1-15)))
)
(set! (-> s0-0 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-16))) arg2))
)
(set! (-> s0-0 w) 1.0)
)
(vector+! (-> arg0 s1-0) (-> arg1 s1-0) s2-0)
)
)
#f
)
(defun lightning-trail-fractal-gen ((arg0 (inline-array vector))
(arg1 (inline-array vector))
(arg2 int)
(arg3 int)
(arg4 float)
(arg5 lightning-spec)
)
(local-vars (sv-80 vector) (sv-96 vector) (sv-112 vector) (sv-128 vector) (sv-144 vector))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(when (< 1 (- arg3 arg2))
(let ((s0-0 (/ (+ arg2 arg3) 2)))
(set! sv-96 (new 'stack-no-clear 'vector))
(let ((v1-5 (-> arg0 arg2))
(a0-3 (-> arg1 arg2))
)
(.lvf vf4 (&-> v1-5 quad))
(.lvf vf5 (&-> a0-3 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-96 quad) vf6)
(set! sv-112 (new 'stack-no-clear 'vector))
(let ((v1-9 (-> arg0 arg3))
(a0-5 (-> arg1 arg3))
)
(.lvf vf4 (&-> v1-9 quad))
(.lvf vf5 (&-> a0-5 quad))
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-112 quad) vf6)
(set! sv-144 (new 'stack-no-clear 'vector))
(set! sv-128 (new 'stack-no-clear 'vector))
(set! sv-80 sv-144)
(let* ((f30-0 arg4)
(f28-0 -0.5)
(v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-16 (the-as number (logior #x3f800000 v1-15)))
)
(set! (-> sv-80 x) (* f30-0 (+ f28-0 (+ -1.0 (the-as float v1-16)))))
)
(let* ((f30-1 arg4)
(f28-1 -0.5)
(v1-20 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-21 (the-as number (logior #x3f800000 v1-20)))
)
(set! (-> sv-80 y) (* f30-1 (+ f28-1 (+ -1.0 (the-as float v1-21)))))
)
(let* ((f30-2 arg4)
(f28-2 -0.5)
(v1-25 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-26 (the-as number (logior #x3f800000 v1-25)))
)
(set! (-> sv-80 z) (* f30-2 (+ f28-2 (+ -1.0 (the-as float v1-26)))))
)
(set! (-> sv-80 w) 1.0)
(let ((v1-31 sv-128)
(a0-15 sv-128)
)
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> sv-96 quad))
(.lvf vf5 (&-> sv-112 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> a0-15 quad) vf6)
(vector-float*! v1-31 a0-15 0.5)
)
(let ((v1-33 sv-144))
(let ((a0-16 sv-144))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-16 quad))
)
(.lvf vf5 (&-> sv-128 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-33 quad) vf6)
)
(let ((v1-35 (-> arg0 s0-0)))
(let ((a0-19 (-> arg1 s0-0)))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-19 quad))
)
(.lvf vf5 (&-> sv-144 quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-35 quad) vf6)
)
(lightning-trail-fractal-gen arg0 arg1 arg2 s0-0 (* arg4 (-> arg5 reduction)) arg5)
(lightning-trail-fractal-gen arg0 arg1 s0-0 arg3 (* arg4 (-> arg5 reduction)) arg5)
)
)
0
(none)
)
)
(deftype lightning-globals (structure)
((gcf-buf uint16)
(vtx-buf uint16)
)
)
(defun gs-packed-rgba-lerp! ((arg0 gs-packed-rgba) (arg1 rgba) (arg2 rgba) (arg3 float))
(local-vars (v1-0 uint128) (v1-1 uint128) (a1-1 uint128) (a1-2 uint128))
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf2 :class vf)
(vf3 :class vf)
)
(init-vf0-vector)
(.pextlb v1-0 0 arg1)
(.pextlb a1-1 0 arg2)
(.pextlh v1-1 0 v1-0)
(.pextlh a1-2 0 a1-1)
(.mov vf1 v1-1)
(.mov vf2 a1-2)
(.mov vf3 arg3)
(.itof.vf vf1 vf1)
(.itof.vf vf2 vf2)
(.mul.w.vf acc vf1 vf0)
(.add.mul.x.vf acc vf2 vf3 acc)
(.sub.mul.x.vf vf1 vf1 vf3 acc)
(.ftoi.vf vf1 vf1)
(.svf (&-> arg0 quad) vf1)
arg0
)
)
(defbehavior lightning-fade process ((arg0 lightning-control))
(local-vars (v0-1 int) (sv-16 rgba))
(let ((f0-0 (-> arg0 spec fade-time)))
(-> arg0 process 0 clock)
(cond
((< (-> arg0 state counter) f0-0)
(+! (-> arg0 state counter) (* 300.0 (seconds-per-frame)))
(let ((gp-0 (-> arg0 state)))
(let* ((s5-0 (-> arg0 spec))
(f30-0 (fmax 0.0 (fmin 1.0 (* (- 1.0 (/ (-> gp-0 counter) f0-0)) (-> s5-0 fade-start-factor)))))
)
(set! sv-16 (-> s5-0 fade-to-color))
(set! (-> gp-0 start-color) (rgba-lerp sv-16 (-> s5-0 start-color) (the-as rgba f30-0)))
(set! v0-1 (the-as int (rgba-lerp sv-16 (-> s5-0 end-color) (the-as rgba f30-0))))
)
(set! (-> gp-0 end-color) (the-as rgba v0-1))
)
)
(else
(let ((v1-9 arg0))
(set! v0-1 0)
(let ((a0-4 (!= v0-1 (-> v1-9 state mode))))
(case v0-1
((3)
(if a0-4
(set! (-> v1-9 state counter) 0.0)
)
)
((1)
(set! (-> v1-9 state start-color) (-> v1-9 spec start-color))
(set! (-> v1-9 state end-color) (-> v1-9 spec end-color))
)
)
)
(set! (-> v1-9 state mode) (the-as uint v0-1))
)
)
)
)
v0-1
)
(defun lightning-update ((arg0 lightning-control))
(local-vars
(sv-16 lightning-spec)
(sv-20 vector-array)
(sv-24 vector-array)
(sv-28 vector-array)
(sv-32 symbol)
(sv-36 clock)
)
(let* ((gp-0 (-> arg0 state points-to-draw))
(s4-0 (+ gp-0 -1))
(s5-0 (-> arg0 state))
)
(set! sv-16 (-> arg0 spec))
(set! sv-20 (-> s5-0 line))
(set! sv-24 (-> s5-0 meet))
(set! sv-28 (-> s5-0 path))
(set! sv-32 (= (-> s5-0 mode) 1))
(set! sv-36 (-> arg0 process 0 clock))
(when (not (or (= (-> sv-36 time-adjust-ratio) 0.0) (< gp-0 2)))
(when (logtest? (-> sv-16 flags) (lightning-spec-flags lsf4))
(let ((f1-1 (vector-vector-distance (the-as vector (-> sv-24 data)) (-> sv-24 data s4-0))))
(set! (-> s5-0 box-size)
(* (-> sv-16 box-size) (fmax 1.0 (fmin 5.0 (/ f1-1 (* 4096.0 (the float (-> sv-16 adjust-distance)))))))
)
)
)
(set! (-> s5-0 counter) (fmax 0.0 (- (-> s5-0 counter) (-> sv-36 time-adjust-ratio))))
(when sv-32
(set! (-> s5-0 mode) (the-as uint 2))
(set! (-> s5-0 counter) 0.0)
)
(when (>= 0.0 (-> s5-0 counter))
(let ((v1-33 (-> sv-16 rand-func)))
(cond
((or (zero? v1-33) (= v1-33 1))
(let ((v1-35 (-> sv-16 rand-func)))
(cond
((zero? v1-35)
(lightning-fractal-gen (-> sv-24 data) 0 s4-0 (-> s5-0 box-size) sv-16)
)
((= v1-35 1)
(lightning-uniform-gen (-> sv-24 data) 0 s4-0 (-> s5-0 box-size) sv-16)
)
)
)
(when sv-32
(dotimes (v1-43 gp-0)
(set! (-> sv-20 data v1-43 quad) (-> sv-24 data v1-43 quad))
)
)
)
((or (= v1-33 2) (= v1-33 3))
(case (-> sv-16 rand-func)
((2)
(set! (-> sv-24 data 0 quad) (-> sv-28 data 0 quad))
(set! (-> sv-24 data s4-0 quad) (-> sv-28 data s4-0 quad))
(lightning-trail-fractal-gen (-> sv-24 data) (-> sv-28 data) 0 s4-0 (-> s5-0 box-size) sv-16)
)
(else
(lightning-trail-uniform-gen (-> sv-24 data) (-> sv-28 data) (-> s5-0 box-size) gp-0)
)
)
(when sv-32
(dotimes (v1-63 gp-0)
(set! (-> sv-20 data v1-63 quad) (-> sv-28 data v1-63 quad))
)
)
)
)
)
(set! (-> s5-0 counter) (the float (-> sv-16 merge-count)))
)
(let ((f0-14 (fmax 0.0 (fmin 1.0 (* (-> sv-16 merge-factor) (-> sv-36 time-adjust-ratio))))))
(dotimes (v1-72 gp-0)
(let* ((a1-21 (-> sv-20 data v1-72))
(a2-7 (-> sv-24 data v1-72))
(a0-31 a1-21)
)
(set! (-> a0-31 x) (+ (-> a1-21 x) (* f0-14 (- (-> a2-7 x) (-> a1-21 x)))))
(set! (-> a0-31 y) (+ (-> a1-21 y) (* f0-14 (- (-> a2-7 y) (-> a1-21 y)))))
(set! (-> a0-31 z) (+ (-> a1-21 z) (* f0-14 (- (-> a2-7 z) (-> a1-21 z)))))
)
)
)
#f
)
)
)
(defun lightning-draw ((arg0 dma-buffer) (arg1 lightning-control) (arg2 lightning-globals))
(local-vars
(sv-16 math-camera)
(sv-20 (inline-array gcf-vertex))
(sv-24 lightning-spec)
(sv-28 float)
(sv-32 texture)
(sv-48 vector-array)
(sv-64 int)
(sv-80 int)
(sv-96 int)
(sv-112 int)
(sv-128 int)
(sv-144 int)
(sv-160 int)
(sv-176 gcf-control)
)
(rlet ((acc :class vf)
(vf0 :class vf)
(vf1 :class vf)
(vf17 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(vf8 :class vf)
(vf9 :class vf)
)
(init-vf0-vector)
(set! sv-16 *math-camera*)
(set! sv-20 (the-as (inline-array gcf-vertex) *gsf-buffer*))
(let* ((s3-0 (-> arg1 state points-to-draw))
(s2-0 (+ s3-0 -1))
(s1-0 *lightning-gcf*)
(s0-0 (-> sv-16 camera-rot))
)
(set! sv-32 (lookup-texture-by-id (-> arg1 spec texture)))
(set! sv-48 (-> arg1 state line))
(set! sv-24 (-> arg1 spec))
(when (< 1 s3-0)
(set! sv-64 0)
(while (< sv-64 2)
(set! sv-28 (/ 1.0 (the float s2-0)))
(cond
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf0))
(set! sv-80 0)
(while (< sv-80 (* s3-0 2))
(cond
((not (logtest? sv-80 1))
(gs-packed-rgba-lerp!
(-> sv-20 sv-80 clr)
(-> arg1 state start-color)
(-> arg1 state end-color)
(* (the float (/ sv-80 2)) sv-28)
)
(let ((v1-24 (-> sv-20 sv-80)))
(set! (-> v1-24 tex x) 0)
(set! (-> v1-24 tex y) (* (/ 4096 s3-0) (/ sv-80 2)))
(set! (-> v1-24 tex z) 4096)
(set! (-> v1-24 tex w) 0)
)
)
(else
(gs-packed-rgba-lerp!
(-> sv-20 sv-80 clr)
(-> arg1 state start-color)
(-> arg1 state end-color)
(* (the float (/ sv-80 2)) sv-28)
)
(let ((v1-33 (-> sv-20 sv-80)))
(set! (-> v1-33 tex x) 4096)
(set! (-> v1-33 tex y) (* (/ 4096 s3-0) (/ sv-80 2)))
(set! (-> v1-33 tex z) 4096)
(set! (-> v1-33 tex w) 0)
)
)
)
(set! sv-80 (+ sv-80 1))
)
)
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf1))
(dotimes (v1-43 (* s3-0 2))
(cond
((not (logtest? v1-43 1))
(let ((a0-26 (-> sv-20 v1-43)))
(set! (-> a0-26 tex x) 0)
(set! (-> a0-26 tex y) (* (/ 4096 s3-0) (/ v1-43 2)))
(set! (-> a0-26 tex z) 4096)
(set! (-> a0-26 tex w) 0)
)
)
(else
(let ((a0-30 (-> sv-20 v1-43)))
(set! (-> a0-30 tex x) 4096)
(set! (-> a0-30 tex y) (* (/ 4096 s3-0) (/ v1-43 2)))
(set! (-> a0-30 tex z) 4096)
(set! (-> a0-30 tex w) 0)
)
)
)
)
(dotimes (v1-46 (* s2-0 2))
(set! (-> sv-20 v1-46 clr x) (the-as int (-> arg1 state start-color r)))
(set! (-> sv-20 v1-46 clr y) (the-as int (-> arg1 state start-color g)))
(set! (-> sv-20 v1-46 clr z) (the-as int (-> arg1 state start-color b)))
(set! (-> sv-20 v1-46 clr w) (the-as int (-> arg1 state start-color a)))
)
(dotimes (v1-49 2)
(let ((a0-45 (+ v1-49 (* s2-0 2))))
(set! (-> sv-20 a0-45 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-45 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-45 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-45 clr w) (the-as int (-> arg1 state end-color a)))
)
)
)
((logtest? (-> sv-24 flags) (lightning-spec-flags lsf2))
(dotimes (v1-56 (* s3-0 2))
(cond
((not (logtest? v1-56 1))
(let ((a0-52 (-> sv-20 v1-56)))
(set! (-> a0-52 tex x) 0)
(set! (-> a0-52 tex y) (* (/ 4096 s3-0) (/ v1-56 2)))
(set! (-> a0-52 tex z) 4096)
(set! (-> a0-52 tex w) 0)
)
)
(else
(let ((a0-56 (-> sv-20 v1-56)))
(set! (-> a0-56 tex x) 4096)
(set! (-> a0-56 tex y) (* (/ 4096 s3-0) (/ v1-56 2)))
(set! (-> a0-56 tex z) 4096)
(set! (-> a0-56 tex w) 0)
)
)
)
)
(dotimes (v1-59 (* (+ s3-0 -2) 2))
(let ((a0-58 (+ v1-59 2)))
(set! (-> sv-20 a0-58 clr x) (the-as int (-> arg1 state start-color r)))
(set! (-> sv-20 a0-58 clr y) (the-as int (-> arg1 state start-color g)))
(set! (-> sv-20 a0-58 clr z) (the-as int (-> arg1 state start-color b)))
(set! (-> sv-20 a0-58 clr w) (the-as int (-> arg1 state start-color a)))
)
)
(dotimes (v1-62 2)
(let ((a0-63 v1-62))
(set! (-> sv-20 a0-63 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-63 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-63 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-63 clr w) (the-as int (-> arg1 state end-color a)))
)
)
(dotimes (v1-65 2)
(let ((a0-67 (+ v1-65 (* s2-0 2))))
(set! (-> sv-20 a0-67 clr x) (the-as int (-> arg1 state end-color r)))
(set! (-> sv-20 a0-67 clr y) (the-as int (-> arg1 state end-color g)))
(set! (-> sv-20 a0-67 clr z) (the-as int (-> arg1 state end-color b)))
(set! (-> sv-20 a0-67 clr w) (the-as int (-> arg1 state end-color a)))
)
)
)
)
(let ((f0-8 (-> sv-24 radius))
(f1-4 0.5)
(v1-71 (-> sv-48 data))
(a0-71 (the-as object (-> sv-20 0)))
(a1-82 (the-as object (-> sv-20 1)))
)
1
(.lvf vf1 (&-> s0-0 rvec quad))
(.lvf vf2 (&-> s0-0 uvec quad))
(.lvf vf3 (&-> s0-0 fvec quad))
(.lvf vf4 (&-> s0-0 trans quad))
(let ((a2-44 f0-8))
(.mov vf8 a2-44)
)
(let ((a2-45 f1-4))
(.mov vf17 a2-45)
)
(.add.x.vf vf17 vf0 vf8 :mask #b10)
(.add.w.vf vf17 vf0 vf0 :mask #b100)
(.add.w.vf vf17 vf17 vf0 :mask #b100)
(dotimes (a2-46 s3-0)
(.lvf vf8 (&-> v1-71 0 quad))
(.mul.w.vf acc vf4 vf0 :mask #b111)
(.add.mul.x.vf acc vf1 vf8 acc :mask #b111)
(.add.mul.y.vf acc vf2 vf8 acc :mask #b111)
(.add.mul.z.vf vf8 vf3 vf8 acc :mask #b111)
(.add.x.vf vf6 vf8 vf0)
(b! (zero? sv-64) cfg-44 :delay (.add.x.vf vf7 vf8 vf0))
(.add.y.vf vf6 vf6 vf17 :mask #b10)
(b! #t cfg-45 :delay (.sub.y.vf vf7 vf7 vf17 :mask #b10))
(label cfg-44)
(.add.y.vf vf6 vf6 vf17 :mask #b1)
(.sub.y.vf vf7 vf7 vf17 :mask #b1)
(label cfg-45)
(.svf (&-> (the-as (pointer uint128) a1-82) 2) vf6)
(.svf (&-> (the-as (pointer uint128) a0-71) 2) vf7)
(set! a1-82 (&-> (the-as (pointer uint128) a1-82) 6))
(set! a0-71 (&-> (the-as (pointer uint128) a0-71) 6))
(.add.x.vf vf9 vf8 vf0)
(set! v1-71 (the-as (inline-array vector) (-> v1-71 1)))
)
)
(set! sv-96 s2-0)
(set! sv-112 0)
(while (> sv-96 0)
(if (< 40 sv-96)
(set! sv-128 40)
(set! sv-128 sv-96)
)
(set! sv-144 (+ sv-128 1))
(set! sv-160 12)
(let* ((v1-81 arg0)
(a0-73 (the-as object (-> v1-81 base)))
)
(set! (-> (the-as dma-packet a0-73) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc sv-160))
(set! (-> (the-as dma-packet a0-73) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-73) vif1)
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 gcf-buf) 54) 54) :num sv-160)
)
(set! (-> v1-81 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-73) 16))))
)
(set! sv-176 (the-as gcf-control (-> arg0 base)))
(let* ((v1-84 (-> sv-176 matrix))
(a3-31 (-> sv-16 perspective))
(a0-76 (-> a3-31 rvec quad))
(a1-88 (-> a3-31 uvec quad))
(a2-58 (-> a3-31 fvec quad))
(a3-32 (-> a3-31 trans quad))
)
(set! (-> v1-84 rvec quad) a0-76)
(set! (-> v1-84 uvec quad) a1-88)
(set! (-> v1-84 fvec quad) a2-58)
(set! (-> v1-84 trans quad) a3-32)
)
(quad-copy! (the-as pointer (-> sv-176 giftag)) (the-as pointer (-> s1-0 giftag)) 3)
(set! (-> sv-176 giftag num-strips) (the-as uint 1))
(set! (-> sv-176 num-dps) (the-as uint (* sv-144 2)))
(set! (-> sv-176 kick-offset) (the-as uint 0))
(when sv-32
(adgif-shader<-texture-simple! (the-as adgif-shader (-> sv-176 shader)) sv-32)
(adgif-shader-update! (the-as adgif-shader (-> sv-176 shader)) sv-32)
)
(set! (-> sv-176 shader 0 shader alpha) (new 'static 'gs-miptbp :tbp1 #x48 :tbw2 #x20))
(set! (-> sv-176 shader 0 shader tex0 tfx) 0)
(set! (-> sv-176 shader 0 pos) (the-as uint 0))
(set! (-> sv-176 shader 0 num) (the-as uint (+ #x8000 (* sv-144 2))))
(&+! (-> arg0 base) (* sv-160 16))
(let* ((v1-104 arg0)
(a0-90 (the-as object (-> v1-104 base)))
)
(set! (-> (the-as dma-packet a0-90) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc (* 6 sv-144)))
(set! (-> (the-as dma-packet a0-90) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-90) vif1)
(new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32) :imm (shr (shl (-> arg2 vtx-buf) 54) 54) :num (* 6 sv-144))
)
(set! (-> v1-104 base) (the-as pointer (&+ (the-as dma-packet a0-90) 16)))
)
(quad-copy! (-> arg0 base) (the-as pointer (-> sv-20 sv-112)) (* 6 sv-144))
(&+! (-> arg0 base) (* 96 sv-144))
(let* ((v1-109 arg0)
(a0-95 (the-as object (-> v1-109 base)))
)
(set! (-> (the-as dma-packet a0-95) dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> (the-as dma-packet a0-95) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet a0-95) vif1) (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1))
(set! (-> v1-109 base) (the-as pointer (&+ (the-as dma-packet a0-95) 16)))
)
(set! (-> arg2 gcf-buf) (- 1704 (the-as int (-> arg2 gcf-buf))))
(+! (-> arg2 vtx-buf) 279)
(if (< (the-as uint 567) (-> arg2 vtx-buf))
(set! (-> arg2 vtx-buf) (the-as uint 9))
)
(set! sv-96 (- sv-96 sv-128))
(set! sv-112 (+ sv-112 (* sv-128 2)))
sv-112
)
(set! sv-64 (+ sv-64 1))
)
#f
)
)
)
)
(defun-debug lightning-start ((arg0 float) (arg1 float))
(let ((gp-0 (get-process *default-dead-pool* lightning-tracker #x4000 0)))
(when gp-0
(let ((t9-1 (method-of-type lightning-tracker activate)))
(t9-1 (the-as lightning-tracker gp-0) *entity-pool* "lightning-tracker" (the-as pointer #x70004000))
)
(let ((t9-2 run-function-in-process)
(a0-3 gp-0)
(a1-3 lightning-tracker-init)
(a2-2 (new 'static 'lightning-spec
:name #f
:flags (lightning-spec-flags lsf1)
:start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
:end-color (new 'static 'rgba :r #x80 :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 0.2
:fade-time 120.0
:texture (new 'static 'texture-id :index #x3f :page #x4)
:reduction 0.42
:num-points 16
:box-size 32768.0
:merge-factor 0.5
:merge-count 2
:radius 2048.0
:duration 18000.0
:sound #f
)
)
(a3-2 0)
(t0-0 #f)
(t1-0 #f)
(t2-0 (new 'stack-no-clear 'vector))
)
(set! (-> t2-0 x) arg0)
(set! (-> t2-0 y) 0.0)
(set! (-> t2-0 z) arg1)
(set! (-> t2-0 w) 1.0)
(let ((t3-0 (new 'stack-no-clear 'vector)))
(set! (-> t3-0 x) arg0)
(set! (-> t3-0 y) 262144.0)
(set! (-> t3-0 z) arg1)
(set! (-> t3-0 w) 1.0)
((the-as (function object object object object object object object object none) t9-2)
a0-3
a1-3
a2-2
a3-2
t0-0
t1-0
t2-0
t3-0
)
)
)
(-> gp-0 ppointer)
)
)
)
(define *lightning-globals* (new 'global 'lightning-globals))
(define *lightning* #t)
(defun lightning-draw-all ()
(when (and *lightning* (not (get-menu-mode *blit-displays-work*)))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic))
(let ((s5-0 *lightning-engine*))
(when (> (length s5-0) 0)
(with-dma-buffer-add-bucket ((s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(bucket-id generic-sprite-3)
)
(let ((s3-0 *lightning-globals*))
(let ((v1-17 s3-0))
(set! (-> v1-17 gcf-buf) (the-as uint 837))
(set! (-> v1-17 vtx-buf) (the-as uint 9))
)
(let* ((v1-19 (-> s5-0 alive-list next0))
(s2-0 (-> v1-19 next0))
)
(while (!= v1-19 (-> s5-0 alive-list-end))
(let* ((s1-0 (-> (the-as connection v1-19) param1))
(s0-0 (-> (the-as dma-buffer s1-0) data-buffer 0))
)
(when (not (paused?))
(case s0-0
((1 2)
(lightning-update (the-as lightning-control s1-0))
)
((3)
(lightning-fade (the-as lightning-control s1-0))
)
)
)
(if (or (= s0-0 2) (= s0-0 3))
(lightning-draw s4-0 (the-as lightning-control s1-0) s3-0)
)
)
(set! v1-19 s2-0)
(set! s2-0 (-> s2-0 next0))
)
)
)
)
)
)
)
)
0
(none)
)
(defun unlink-lightning-spec-by-heap ((arg0 kheap))
(let* ((v1-0 *lightning-spec-id-table*)
(a2-0 (-> v1-0 length))
(a1-0 (-> arg0 base))
(a0-1 (-> arg0 top-base))
)
(while (nonzero? a2-0)
(+! a2-0 -1)
(let ((a3-2 (-> v1-0 a2-0)))
(when (and (>= (the-as int a3-2) (the-as int a1-0)) (< (the-as int a3-2) (the-as int a0-1)))
(set! (-> v1-0 a2-0) (the-as lightning-spec 0))
0
)
)
)
)
0
(none)
)
+1
View File
@@ -154,6 +154,7 @@
((value float)
(scale float)
)
:pack-me
)
+8
View File
@@ -7,3 +7,11 @@
;; DECOMP BEGINS
;; stub
(defmethod get-height ((this ocean) (arg0 vector) (arg1 symbol))
0.0
)
(defmethod get-base-height ((this ocean-map))
0.0
)
@@ -437,6 +437,7 @@
(sym symbol :overlay-at initial-valuef)
(sound sound-spec :overlay-at initial-valuef)
)
:allow-misaligned
)
@@ -2480,7 +2480,7 @@
(none)
)
(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo))
(defun birth-func-texture-group-2d ((arg0 object) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object))
(birth-func-texture-group (the-as int arg0) arg1 arg2)
0
(none)
@@ -235,7 +235,8 @@
)
)
(define sprite-glow-vu1-block (new 'static 'vu-function :length #x86 :qlength 67))
;; og:preserve-this
(define sprite-glow-vu1-block (new 'static 'vu-function #|:length #x86 :qlength 67|#))
;; WARN: Return type mismatch vector vs none.
(defun sprite-glow-init-consts ((arg0 sprite-glow-consts))
+12 -1
View File
@@ -1903,7 +1903,18 @@
(set! (-> this segment 1 dest) (-> this segment 0 size))
(set! (-> this segment 2 dest) (+ (-> this segment 0 size) (-> this segment 1 size)))
;; todo, if needed, pc texture remaps (__pc-get-tex-remap)
;; og:preserve-this added texture remap
(dotimes (texture-idx (-> this length))
(let ((tex (-> this data texture-idx)))
(when (and tex (nonzero? tex))
(let ((offset (__pc-get-tex-remap (the int (-> this id)) texture-idx)))
(when (nonzero? offset)
)
(+! (-> tex dest 0) offset)
)
)
)
)
(set! (-> this vram-size) (-> this size))
(let* ((a3-0 (-> this id))
+1 -1
View File
@@ -431,7 +431,7 @@
(login-begin (_type_) _type_)
(debug-print-region-splitbox (_type_ vector object) none)
(get-art-group-by-name (_type_ string) art-group)
(level-method-22 () none)
(set-proto-vis! (_type_ symbol) int)
(lookup-text (_type_ text-id symbol) string)
(level-method-24 () none)
(birth (_type_) _type_)
File diff suppressed because it is too large Load Diff
+76 -76
View File
@@ -100,53 +100,53 @@
(user-position vector :inline :overlay-at virtual-current-pos-local)
)
(:methods
(nav-state-method-9 () none)
(nav-state-method-10 () none)
(nav-state-method-11 () none)
(nav-state-method-12 () none)
(nav-state-method-13 () none)
(nav-state-method-14 () none)
(nav-state-method-15 () none)
(nav-state-method-16 () none)
(nav-state-method-17 () none)
(nav-state-method-18 () none)
(nav-state-method-19 () none)
(nav-state-method-20 () none)
(debug-draw (_type_) none)
(nav-state-method-10 (_type_) none)
(plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol)
(get-velocity (_type_ vector) vector)
(get-travel (_type_ vector) vector)
(get-heading (_type_ vector) vector)
(get-target-pos (_type_ vector) vector)
(get-speed (_type_) meters)
(get-rotation-rate (_type_) float)
(try-projecting-to-current-poly (_type_ vector vector vector) symbol)
(get-current-poly (_type_) nav-poly)
(copy-nav-state! (_type_ (pointer nav-state)) none)
(nav-state-method-21 () none)
(nav-state-method-22 () none)
(nav-state-method-23 () none)
(nav-state-method-24 () none)
(nav-state-method-25 () none)
(nav-state-method-26 () none)
(nav-state-method-27 () none)
(nav-state-method-28 () none)
(nav-state-method-29 () none)
(nav-state-method-30 () none)
(nav-state-method-31 () none)
(nav-state-method-32 () none)
(nav-state-method-33 () none)
(turn-and-navigate-to-destination (_type_) none)
(navigate-using-route-portals-wrapper (_type_) none)
(navigate-using-best-dir-recompute-avoid-spheres-1-wrapper (_type_) none)
(navigate-within-poly-wrapper (_type_) none)
(compute-travel-speed (_type_) none)
(nav-state-method-29 (_type_) none)
(nav-state-method-30 (_type_) none)
(navigate-using-best-dir-recompute-avoid-spheres-2 (_type_) none)
(update-travel-dir-from-spheres (_type_) none)
(compute-speed-simple (_type_) none)
(navigate-v1! (_type_) none)
(nav-state-method-35 () none)
(nav-state-method-36 () none)
(nav-state-method-37 () none)
(nav-state-method-38 () none)
(nav-state-method-39 () none)
(reset-target! (_type_) none)
(add-offset-to-target! (_type_ vector) none)
(navigate-v2! (_type_) none)
(set-current-poly! (_type_ nav-poly) none)
(nav-state-method-39 (_type_) symbol)
(do-navigation-to-destination (_type_ vector) none)
(nav-state-method-41 () none)
(nav-state-method-42 () none)
(nav-state-method-43 () none)
(nav-state-method-44 () none)
(nav-state-method-45 () none)
(nav-state-method-46 () none)
(nav-state-method-47 () none)
(nav-state-method-48 () none)
(clamp-vector-to-mesh-cross-gaps (_type_ vector) symbol)
(set-target-pos! (_type_ vector) none)
(set-virtual-cur-pos! (_type_ vector) none)
(set-travel! (_type_ vector) none)
(set-velocity! (_type_ vector) none)
(set-heading! (_type_ vector) none)
(set-speed! (_type_ meters) none)
(reset! (_type_ nav-control) none)
(nav-state-method-49 () none)
(nav-state-method-50 () none)
(nav-state-method-51 () none)
(nav-state-method-52 () none)
(nav-state-method-53 () none)
(nav-state-method-54 () none)
(nav-state-method-55 () none)
(navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none)
(nav-state-method-51 (_type_) none)
(navigate-using-route-portals (_type_) none)
(navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none)
(navigate-within-poly (_type_) none)
(clamp-travel-vector (_type_) none)
)
)
@@ -178,42 +178,42 @@
)
(:methods
(debug-draw (_type_) none)
(nav-control-method-10 () none)
(point-in-bsphere? (_type_ vector) symbol)
(find-poly-containing-point-1 (_type_ vector) nav-poly)
(cloest-point-on-mesh (_type_ vector vector nav-poly) nav-poly)
(nav-control-method-13 () none)
(nav-control-method-14 () none)
(nav-control-method-15 () none)
(nav-control-method-16 () none)
(nav-control-method-17 () none)
(nav-control-method-18 () none)
(nav-control-method-19 () none)
(nav-control-method-20 () none)
(nav-control-method-21 () none)
(nav-control-method-22 () none)
(nav-control-method-23 () none)
(nav-control-method-24 () none)
(nav-control-method-25 () none)
(nav-control-method-26 () none)
(nav-control-method-27 () none)
(nav-control-method-28 () none)
(nav-control-method-29 () none)
(nav-control-method-30 () none)
(nav-control-method-31 () none)
(nav-control-method-32 () none)
(nav-control-method-33 () none)
(nav-control-method-34 () none)
(nav-control-method-35 () none)
(nav-control-method-36 () none)
(nav-control-method-37 () none)
(nav-control-method-38 () none)
(nav-control-method-39 () none)
(nav-control-method-40 () none)
(nav-control-method-41 () none)
(nav-control-method-42 () none)
(nav-control-method-43 () none)
(closest-point-on-mesh (_type_ vector vector nav-poly) nav-poly)
(find-nearest-poly-to-point (_type_ vector) nav-poly)
(project-point-onto-plane-of-poly (_type_ nav-poly vector vector vector) none)
(find-poly-containing-point-2 (_type_ vector) nav-poly)
(is-above-poly-max-height? (_type_ vector float) symbol)
(is-in-mesh? (_type_ vector float) symbol)
(avoid-spheres-1! (_type_ nav-avoid-spheres-params) symbol)
(avoid-spheres-2! (_type_ nav-avoid-spheres-params) symbol)
(clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none)
(clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none)
(find-first-sphere-and-update-avoid-params (_type_ vector nav-avoid-spheres-params) float)
(set-spheres-from-nav-ids (_type_) none)
(add-root-sphere-to-hash! (_type_ vector int) symbol)
(get-max-rotation-rate (_type_) float)
(get-sphere-mask (_type_) uint)
(get-target-speed (_type_) meters)
(enable-extra-sphere! (_type_) none)
(disable-extra-sphere! (_type_) none)
(copy-extra-nav-sphere! (_type_ sphere) none)
(set-extra-nav-sphere-xyz! (_type_ sphere) none)
(set-extra-nav-sphere-radius! (_type_ float) none)
(set-nearest-y-thres! (_type_ float) none)
(set-nav-cull-radius! (_type_ meters) none)
(set-speed-scale! (_type_ float) none)
(set-target-speed! (_type_ meters) none)
(set-acceleration! (_type_ meters) none)
(set-turning-acceleration! (_type_ meters) none)
(set-max-rotation-rate! (_type_ float) none)
(set-sphere-mask! (_type_ uint) none)
(remove! (_type_) none)
(init! (_type_ collide-shape) none)
(display-marks? (_type_) symbol)
(nav-control-method-44 () none)
(nav-control-method-45 () none)
(nav-control-method-46 () none)
(find-first-sphere-intersecting-ray (_type_ vector vector vector) sphere)
(find-sphere-ids-from-sphere-hash (_type_ symbol) none)
)
)
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -57,36 +57,36 @@
debug-control
)
(:methods
(nav-enemy-method-160 (_type_) none)
(nav-enemy-method-161 (_type_) none)
(normalize-heading! (_type_ nav-control) none)
(nav-enemy-method-161 (_type_ nav-control) none)
(nav-enemy-method-162 (_type_) none)
(nav-enemy-method-163 (_type_) none)
(nav-enemy-method-164 (_type_) none)
(nav-enemy-method-165 (_type_) none)
(nav-enemy-method-166 (_type_) none)
(nav-enemy-method-167 (_type_) none)
(nav-enemy-method-168 (_type_) none)
(nav-enemy-method-169 (_type_) none)
(nav-enemy-method-170 (_type_) none)
(nav-enemy-method-165 (_type_ vector vector) none)
(nav-enemy-method-166 (_type_ vector vector) vector)
(nav-enemy-method-167 (_type_) vector)
(nav-enemy-method-168 (_type_ vector) nav-poly)
(nav-enemy-method-169 (_type_ vector) object)
(is-notice-point-in-mesh? (_type_ vector) symbol)
(nav-enemy-method-171 (_type_) none)
(nav-enemy-method-172 (_type_) none)
(nav-enemy-method-173 (_type_) none)
(nav-enemy-method-174 (_type_) none)
(nav-enemy-method-174 (_type_) symbol)
(nav-enemy-method-175 (_type_) none)
(nav-enemy-method-176 (_type_) none)
(nav-enemy-method-177 (_type_) none)
(nav-enemy-method-178 (_type_) none)
(nav-enemy-method-179 (_type_) none)
(nav-enemy-method-180 (_type_) none)
(nav-enemy-method-180 (_type_ float float) none)
(nav-enemy-method-181 (_type_) none)
(nav-enemy-method-182 (_type_) none)
(nav-enemy-method-183 (_type_) none)
(nav-enemy-method-184 (_type_) none)
(nav-enemy-method-185 (_type_) none)
(nav-enemy-method-186 (_type_) none)
(nav-enemy-method-185 (_type_) symbol)
(nav-enemy-method-186 (_type_) symbol)
(nav-enemy-method-187 (_type_) none)
(nav-enemy-method-188 (_type_) none)
(nav-enemy-method-189 (_type_) none)
(copy-nav-state-vel! (_type_ vector) none)
)
)
File diff suppressed because it is too large Load Diff
+529
View File
@@ -7,3 +7,532 @@
;; DECOMP BEGINS
(deftype nav-engine-spr-buffer (structure)
((mem-addr (pointer nav-mesh))
(mem-nav uint32 :overlay-at mem-addr)
(spr-addr (inline-array nav-control))
(spr-nav uint32 :overlay-at spr-addr)
(q-size uint32)
(i-nav uint8)
(done int8)
(nav-count int8)
(i-pass int8)
)
:pack-me
)
(deftype nav-engine (structure)
((spr-addr uint32)
(nav-work-addr uint32)
(nav-mesh-addr nav-mesh)
(poly-array-addr uint32)
(hash-sphere-addr uint32)
(hash-buckets-addr uint32)
(buf-nav-control-count int8)
(max-pass-count int8)
(output-sphere-hash uint8)
(work-buf-array nav-engine-spr-buffer 3 :inline)
(spr-work nav-mesh-work :overlay-at nav-work-addr)
(mem-work nav-mesh-work)
(spr-mesh nav-mesh :overlay-at nav-mesh-addr)
(mem-mesh nav-mesh)
(spr-poly-array uint32 :overlay-at poly-array-addr)
(mem-poly-array (inline-array nav-poly))
(hash-sphere-list uint32 :overlay-at hash-sphere-addr)
(hash-buckets uint32 :overlay-at hash-buckets-addr)
(to-spr-wait uint32)
(from-spr-wait uint32)
)
(:methods
(inc-spr-addr! (_type_ uint) uint)
(lay-out-spad-memory (_type_ nav-mesh) none)
(set-up-mem-work (_type_) none)
(add-spheres-from-mesh-user-list (_type_ sphere-hash nav-mesh) none)
(add-all-spheres (_type_) none)
(do-sphere-lookups (_type_) none)
(update-nav-controls-pipelined-in-spr (_type_) none)
(update-nav-controls-in-spr (_type_) none)
(upload-nav-to-spr (_type_ nav-engine-spr-buffer) none)
(download-nav-from-spr (_type_ nav-engine-spr-buffer) none)
(do-callbacks (_type_ nav-engine-spr-buffer) none)
(reloc-ptrs-to-spad (_type_ nav-engine-spr-buffer) none)
(reloc-ptrs-to-mem (_type_ nav-engine-spr-buffer) none)
)
)
(defmethod inc-spr-addr! ((this nav-engine) (arg0 uint))
(let ((v0-0 (-> this spr-addr)))
(+! (-> this spr-addr) arg0)
v0-0
)
)
(defmethod lay-out-spad-memory ((this nav-engine) (arg0 nav-mesh))
(let ((s5-0 0))
;; og:preserve-this
(set! (-> this spr-addr) (scratchpad-object uint :offset #x60))
(let* ((v1-1 this)
(a1-1 320)
(a0-1 (-> v1-1 spr-addr))
)
(+! (-> v1-1 spr-addr) a1-1)
(set! (-> this nav-work-addr) a0-1)
)
(let* ((v1-2 this)
(a1-3 112)
(a0-2 (-> v1-2 spr-addr))
)
(+! (-> v1-2 spr-addr) a1-3)
(set! (-> this nav-mesh-addr) (the-as nav-mesh a0-2))
)
(if (and (= (-> arg0 work polys-in-scratch) 1) (< (-> arg0 poly-count) (the-as uint 64)))
(set! s5-0 (the-as int (-> arg0 poly-count)))
)
(let* ((v1-10 this)
(a1-5 (* s5-0 64))
(a0-4 (-> v1-10 spr-addr))
)
(+! (-> v1-10 spr-addr) a1-5)
(set! (-> this poly-array-addr) a0-4)
)
(let* ((v1-11 this)
(a1-7 (* (-> arg0 sphere-hash max-object-count) 16))
(a0-7 (-> v1-11 spr-addr))
)
(+! (-> v1-11 spr-addr) a1-7)
(set! (-> this hash-sphere-addr) a0-7)
)
(let* ((v1-12 this)
(a1-9 0)
(a0-8 (-> v1-12 spr-addr))
)
(+! (-> v1-12 spr-addr) a1-9)
(set! (-> this hash-buckets-addr) a0-8)
)
(set! (-> this buf-nav-control-count) 7)
(dotimes (v1-14 3)
(let ((a0-11 (-> this work-buf-array v1-14)))
(let* ((a1-11 this)
(a3-0 2048)
(a2-5 (-> a1-11 spr-addr))
)
(+! (-> a1-11 spr-addr) a3-0)
(set! (-> a0-11 spr-addr) (the-as (inline-array nav-control) a2-5))
)
(set! (-> a0-11 mem-addr) (the-as (pointer nav-mesh) 0))
(set! (-> a0-11 q-size) (the-as uint 0))
(set! (-> a0-11 nav-count) 0)
(set! (-> a0-11 i-pass) -1)
)
)
(set! (-> this output-sphere-hash) (the-as uint 0))
(set! (-> this mem-mesh) arg0)
(cond
((= (-> arg0 work mesh-struct-in-scratch) 1)
(set! (-> this nav-mesh-addr) (the-as nav-mesh (&-> (-> this nav-mesh-addr) poly-array)))
(mem-copy! (&-> (-> this nav-mesh-addr) type) (&-> arg0 type) 112)
)
(else
(set! (-> this nav-mesh-addr) arg0)
)
)
(set! (-> this mem-work) (-> arg0 work))
(if (= (-> arg0 work work-struct-in-scratch) 1)
(quad-copy! (the-as pointer (-> this nav-work-addr)) (the-as pointer (-> this mem-work)) 20)
(set! (-> this nav-work-addr) (the-as uint (-> arg0 work)))
)
(set! (-> this nav-mesh-addr work) (the-as nav-mesh-work (-> this nav-work-addr)))
(set! (-> this mem-poly-array) (-> arg0 poly-array))
(when (> s5-0 0)
(quad-copy! (the-as pointer (-> this poly-array-addr)) (the-as pointer (-> this mem-poly-array)) (* s5-0 4))
(set! (-> this nav-mesh-addr poly-array) (the-as (inline-array nav-poly) (-> this poly-array-addr)))
)
)
0
(none)
)
(defmethod set-up-mem-work ((this nav-engine))
(let ((v1-0 (-> this mem-mesh)))
(set! (-> v1-0 poly-array) (-> this mem-poly-array))
(set! (-> v1-0 work) (-> this mem-work))
)
0
(none)
)
(defmethod add-spheres-from-mesh-user-list ((this nav-engine) (arg0 sphere-hash) (arg1 nav-mesh))
(countdown (s3-0 (-> arg1 static-sphere-count))
(add-a-sphere-with-flag arg0 (-> arg1 static-sphere s3-0) 64)
)
(let* ((s4-1 (-> arg1 user-list))
(v1-6 (-> s4-1 alive-list next0))
(s3-1 (-> (the-as connection v1-6) next0))
)
(while (!= v1-6 (-> s4-1 alive-list-end))
(let ((a0-4 (-> (the-as connection v1-6) param1))
(s2-0 (the-as object (-> (the-as connection v1-6) param3)))
)
(cond
((-> (the-as connection v1-6) param2)
(let ((s1-0 (-> (the-as process-focusable a0-4) nav)))
(set! (-> s1-0 sec-per-frame) (-> (the-as process-focusable a0-4) clock seconds-per-frame))
(set! (-> s1-0 root-nav-sphere quad) (-> (the-as collide-shape s2-0) trans quad))
(set! (-> s1-0 root-nav-sphere w) (-> (the-as collide-shape s2-0) nav-radius))
(if (logtest? (-> s1-0 flags) (nav-control-flag output-sphere-hash))
(set! (-> this output-sphere-hash) (the-as uint 1))
)
(if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere))
(set! (-> s1-0 root-sphere-id)
(the-as uint (add-a-sphere-with-flag
arg0
(-> s1-0 root-nav-sphere)
(the-as int (-> (the-as collide-shape s2-0) backup-collide-as))
)
)
)
)
(if (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-extra-sphere))
(add-a-sphere-with-flag
arg0
(-> s1-0 extra-nav-sphere)
(the-as int (-> (the-as collide-shape s2-0) backup-collide-as))
)
)
)
)
(else
(when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-root-sphere))
(let ((a1-5 (new 'stack-no-clear 'vector)))
(set! (-> a1-5 quad) (-> (the-as collide-shape s2-0) trans quad))
(set! (-> a1-5 w) (-> (the-as collide-shape s2-0) nav-radius))
(add-a-sphere-with-flag arg0 a1-5 (the-as int (-> (the-as collide-shape s2-0) backup-collide-as)))
)
)
)
)
(when (logtest? (-> (the-as collide-shape s2-0) nav-flags) (nav-flags has-child-spheres))
(let ((s2-1 (-> (the-as collide-shape s2-0) root-prim))
(s1-1 1)
)
(when (zero? (-> s2-1 prim-core prim-type))
(let ((v1-35 s2-1))
(set! s2-1 (-> (the-as collide-shape-prim-group v1-35) child 0))
(set! s1-1 (the-as int (-> v1-35 specific 0)))
)
)
(while (nonzero? s1-1)
(+! s1-1 -1)
(when (and (logtest? (collide-action nav-sphere) (-> s2-1 prim-core action)) (= (-> s2-1 prim-core prim-type) -1))
(let ((a1-6 (new 'stack-no-clear 'vector)))
(set! (-> a1-6 quad) (-> s2-1 prim-core world-sphere quad))
(set! (-> a1-6 w) (-> (the-as collide-shape-prim-sphere s2-1) nav-radius))
(add-a-sphere-with-flag arg0 a1-6 (the-as int (-> s2-1 prim-core collide-as)))
)
)
(&+! s2-1 80)
)
)
)
)
(set! v1-6 s3-1)
(set! s3-1 (-> s3-1 next0))
)
)
0
(none)
)
(defmethod add-all-spheres ((this nav-engine))
(let ((s4-0 (-> this nav-mesh-addr))
(gp-0 (-> this nav-mesh-addr sphere-hash))
)
(clear-objects! gp-0)
(set! (-> gp-0 bucket-array) (the-as (pointer grid-hash-word) (-> this hash-buckets-addr)))
(set! (-> gp-0 sphere-array) (the-as (inline-array sphere) (-> this hash-sphere-addr)))
(when *target*
(let ((a1-0 (new 'stack-no-clear 'vector)))
(let ((v1-8 (-> *target* control)))
(set! (-> a1-0 quad) (-> v1-8 trans quad))
(set! (-> a1-0 w) (-> v1-8 nav-radius))
)
(add-a-sphere-with-flag gp-0 a1-0 2)
)
)
(add-spheres-from-mesh-user-list this gp-0 s4-0)
(let ((s3-0 (the-as nav-mesh (-> s4-0 next-nav-mesh))))
(while (and s3-0 (nonzero? s3-0))
(add-spheres-from-mesh-user-list this gp-0 s3-0)
(set! s3-0 (the-as nav-mesh (-> s3-0 next-nav-mesh)))
)
)
(let ((s4-1 (the-as nav-mesh (-> s4-0 prev-nav-mesh))))
(while (and s4-1 (nonzero? s4-1))
(add-spheres-from-mesh-user-list this gp-0 s4-1)
(set! s4-1 (the-as nav-mesh (-> s4-1 prev-nav-mesh)))
)
)
(update-from-spheres gp-0)
)
0
(none)
)
(defmethod do-sphere-lookups ((this nav-engine))
(let ((s5-0 (-> this nav-mesh-addr)))
(dotimes (s4-0 (the-as int (-> s5-0 nav-control-count)))
(let ((a0-3 (-> s5-0 nav-control-array s4-0)))
(when (-> a0-3 process)
(set! (-> a0-3 sphere-count) 0)
(set! (-> a0-3 state mesh) (-> this nav-mesh-addr))
(set! (-> this mem-work nav) (the-as basic a0-3))
(find-sphere-ids-from-sphere-hash a0-3 #f)
(set! (-> this mem-work nav) #f)
)
)
)
)
0
(none)
)
(def-mips2c nav-dma-send-to-spr-no-flush (function pointer pointer int none))
(def-mips2c nav-dma-send-from-spr-no-flush (function pointer pointer int none))
(defun inc-mod3 ((arg0 int))
(local-vars (v0-1 int) (v1-1 int))
(let ((v0-0 (+ arg0 1)))
(let ((v1-0 2))
(set-on-less-than v1-1 v1-0 v0-0)
)
(move-if-not-zero v0-1 0 v1-1 v0-0)
)
v0-1
)
(def-mips2c nav-state-patch-pointers (function nav-state int none))
(defmethod-mips2c "(method 17 nav-engine)" 17 nav-engine)
(defmethod-mips2c "(method 18 nav-engine)" 18 nav-engine)
(defmethod do-callbacks ((this nav-engine) (arg0 nav-engine-spr-buffer))
(local-vars (sv-16 nav-callback-info))
(with-pp
(dotimes (s4-0 (-> arg0 nav-count))
(let* ((a1-1 (-> arg0 spr-addr s4-0))
(a0-3 (-> a1-1 process))
)
(set! sv-16 (-> a1-1 callback-info))
(when a0-3
(set! (-> a1-1 state nav) a1-1)
(when (and (logtest? (-> a1-1 flags) (nav-control-flag kernel-run)) sv-16)
(let ((s3-0 pp))
(set! pp a0-3)
(set! (-> this mem-mesh work nav) (the-as basic a1-1))
(let ((v1-10 (-> sv-16 callback-count)))
(set! (-> this max-pass-count) (max (-> this max-pass-count) v1-10))
(if (< (-> arg0 i-pass) v1-10)
((-> sv-16 callback-array (-> arg0 i-pass)) a0-3 a1-1)
)
)
(set! pp s3-0)
)
(set! (-> this mem-mesh work nav) #f)
)
)
)
)
0
(none)
)
)
(defmethod-mips2c "(method 20 nav-engine)" 20 nav-engine)
(defmethod-mips2c "(method 21 nav-engine)" 21 nav-engine)
(defmethod update-nav-controls-pipelined-in-spr ((this nav-engine))
(local-vars
(v1-33 int)
(v1-45 int)
(v1-66 int)
(a0-14 int)
(a0-19 int)
(a0-26 int)
(sv-16 symbol)
(sv-24 int)
(sv-32 int)
(sv-40 uint)
(sv-44 (inline-array nav-control))
(sv-48 nav-engine-spr-buffer)
)
(flush-cache 0)
(set! (-> this max-pass-count) 3)
(set! sv-16 (the-as symbol #f))
(set! sv-24 0)
(set! sv-32 0)
(set! sv-40 (-> this nav-mesh-addr nav-control-count))
(set! sv-44 (-> this nav-mesh-addr nav-control-array))
(let ((s5-0 2)
(s3-0 1)
(s4-0 0)
)
(while (not sv-16)
(let ((s2-0 (-> this work-buf-array s5-0)))
(set! (-> s2-0 i-nav) (the-as uint sv-32))
(set! (-> s2-0 nav-count) (min (-> this buf-nav-control-count) (the-as int (- sv-40 (the-as uint sv-32)))))
(set! (-> s2-0 i-pass) sv-24)
(set! (-> s2-0 mem-addr) (the-as (pointer nav-mesh) (-> sv-44 sv-32)))
(set! (-> s2-0 q-size) (the-as uint (* 18 (-> s2-0 nav-count))))
(set! (-> s2-0 done) 0)
(when (>= sv-24 (-> this max-pass-count))
(set! (-> s2-0 nav-count) 0)
0
)
(if (> (-> s2-0 nav-count) 0)
(upload-nav-to-spr this s2-0)
(dma-sync (the-as pointer #x1000d400) 0 0)
)
(set! sv-32 (+ sv-32 (-> s2-0 nav-count)))
(when (>= sv-32 (the-as int sv-40))
(set! sv-32 0)
(set! sv-24 (+ sv-24 1))
(if (= sv-24 (-> this max-pass-count))
(set! (-> s2-0 done) 1)
)
)
)
(let ((v1-32 (+ s5-0 1)))
(let ((a0-13 2))
(set-on-less-than a0-14 a0-13 v1-32)
)
(move-if-not-zero v1-33 0 a0-14 v1-32)
)
(set! s5-0 v1-33)
(let ((s2-1 (-> this work-buf-array s4-0)))
(when (> (-> s2-1 nav-count) 0)
(download-nav-from-spr this s2-1)
(when (= (-> s2-1 done) 1)
(dma-sync (the-as pointer #x1000d000) 0 0)
(set! sv-16 #t)
)
)
)
(let ((v1-44 (+ s4-0 1)))
(let ((a0-18 2))
(set-on-less-than a0-19 a0-18 v1-44)
)
(move-if-not-zero v1-45 0 a0-19 v1-44)
)
(set! s4-0 v1-45)
(set! sv-48 (-> this work-buf-array s3-0))
(when (> (-> sv-48 nav-count) 0)
(if (zero? (-> sv-48 i-pass))
(reloc-ptrs-to-spad this sv-48)
)
(do-callbacks this sv-48)
(if (= (-> sv-48 i-pass) (+ (-> this max-pass-count) -1))
(reloc-ptrs-to-mem this sv-48)
)
)
(let ((v1-65 (+ s3-0 1)))
(let ((a0-25 2))
(set-on-less-than a0-26 a0-25 v1-65)
)
(move-if-not-zero v1-66 0 a0-26 v1-65)
)
(set! s3-0 v1-66)
)
)
0
(none)
)
(defmethod update-nav-controls-in-spr ((this nav-engine))
(flush-cache 0)
(set! (-> this max-pass-count) 1)
(let ((gp-0 (-> this work-buf-array)))
(set! (-> gp-0 0 i-nav) (the-as uint 0))
(set! (-> gp-0 0 nav-count) (the-as int (-> this nav-mesh-addr nav-control-count)))
(set! (-> gp-0 0 i-pass) 0)
(set! (-> gp-0 0 mem-addr) (the-as (pointer nav-mesh) (-> this nav-mesh-addr nav-control-array)))
(set! (-> gp-0 0 q-size) (the-as uint (* 18 (-> gp-0 0 nav-count))))
(set! (-> gp-0 0 done) 0)
(when (> (-> gp-0 0 nav-count) 0)
(upload-nav-to-spr this (the-as nav-engine-spr-buffer gp-0))
(dma-sync (the-as pointer #x1000d400) 0 0)
(reloc-ptrs-to-spad this (the-as nav-engine-spr-buffer gp-0))
(while (< (-> gp-0 0 i-pass) (-> this max-pass-count))
(do-callbacks this (the-as nav-engine-spr-buffer gp-0))
(+! (-> gp-0 0 i-pass) 1)
)
(reloc-ptrs-to-mem this (the-as nav-engine-spr-buffer gp-0))
(dotimes (s4-0 (-> gp-0 0 nav-count))
(let ((a2-1 (-> gp-0 0 spr-addr s4-0 state mesh)))
;; og:preserve-this
(when (in-scratchpad? a2-1)
(format 0 "nav-engine::update-nav-controls-in-spr: (pre-dma) bad mesh pointer found (#x0~x)~%" a2-1)
(break!)
0
)
)
)
(download-nav-from-spr this (the-as nav-engine-spr-buffer gp-0))
(dma-sync (the-as pointer #x1000d000) 0 0)
(dotimes (s5-1 (-> gp-0 0 nav-count))
(let ((a2-3 (-> (&+ (-> gp-0 0 mem-addr) (* 288 s5-1)) 31)))
;; og:preserve-this
(when (in-scratchpad? a2-3)
(format 0 "nav-engine::update-nav-controls-in-spr: (post-dma) bad mesh pointer found (#x0~x)~%" a2-3)
(break!)
0
)
)
)
)
)
0
(none)
)
(defmethod update-navigation ((this nav-mesh))
(local-vars (sp-0 int))
(when (zero? (-> this next-nav-mesh))
(set! (-> this next-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'next-actor 0)))
(set! (-> this prev-nav-mesh) (the-as surface (nav-mesh-from-res-tag (-> this entity) 'prev-actor 0)))
)
(when (> (-> this nav-control-count) 0)
(the-as none sp-0)
(set! sp-0 #x70003fc0)
(set! (-> this work mesh) this)
;; og:preserve-this
(let ((s4-0 (scratchpad-object nav-engine)))
(lay-out-spad-memory s4-0 this)
(add-all-spheres s4-0)
(do-sphere-lookups s4-0)
(when (nonzero? (-> s4-0 output-sphere-hash))
(let ((s3-0 (-> s4-0 nav-mesh-addr sphere-hash)))
(quad-copy! (-> s3-0 mem-bucket-array) (-> s3-0 bucket-array) (/ (-> s3-0 bucket-memory-size) 16))
(quad-copy!
(the-as pointer (-> s3-0 mem-sphere-array))
(the-as pointer (-> s3-0 sphere-array))
(-> s3-0 object-count)
)
(set! (-> s3-0 bucket-array) (-> s3-0 mem-bucket-array))
(set! (-> s3-0 sphere-array) (the-as (inline-array sphere) (-> s3-0 mem-sphere-array)))
)
)
(if (< (the-as uint (* 3 (-> s4-0 buf-nav-control-count))) (-> this nav-control-count))
(update-nav-controls-pipelined-in-spr s4-0)
(update-nav-controls-in-spr s4-0)
)
(set-up-mem-work s4-0)
)
)
0
(none)
)
+47 -36
View File
@@ -20,6 +20,17 @@
(define-extern find-nearest-nav-mesh (function vector float nav-mesh))
(define-extern get-nav-mesh (function actor-id nav-mesh))
(deftype nav-stack-type2 (structure)
"nav-mesh::25"
((float00 float :offset 0)
(float01 float :offset 8)
(word00 int32 :offset 16)
(word01 int32 :offset 20)
(word02 int32 :offset 24)
(word03 int32 :offset 28)
)
)
;; DECOMP BEGINS
(deftype nav-mesh-work-debug (structure)
@@ -195,47 +206,47 @@ Based on the implementation of point-poly-intersection?, these should likely be
(pad2 uint32 7)
)
(:methods
(nav-mesh-method-9 () none)
(nav-mesh-method-10 () none)
(nav-mesh-method-11 () none)
(nav-mesh-method-12 () none)
(nav-mesh-method-13 () none)
(nav-mesh-method-14 () none)
(nav-mesh-method-15 () none)
(nav-mesh-method-16 () none)
(nav-mesh-method-17 () none)
(debug-draw (_type_) none)
(nav-mesh-method-10 (_type_ vector vector nav-poly) nav-poly)
(nav-mesh-method-11 (_type_ vector) none)
(nav-mesh-method-12 (_type_ vector float nav-poly) symbol)
(poly-centroid (_type_ nav-poly vector) vector)
(poly-centroid-local (_type_ nav-poly vector) vector)
(lookup-poly-on-route-to-target (_type_ nav-poly nav-poly) nav-poly)
(get-route-portal (_type_ nav-poly nav-poly nav-route-portal) (inline-array nav-vertex))
(initialize-mesh! (_type_) none)
(advance-ray-to-nearest-poly-edge-or-dest! (_type_ nav-ray) none)
(nav-mesh-method-19 () none)
(nav-mesh-method-20 () none)
(nav-mesh-method-21 () none)
(nav-mesh-method-22 () none)
(nav-mesh-method-23 () none)
(try-move-along-ray (_type_ nav-poly vector vector float) meters)
(clamp-vector-to-mesh-cross-gaps (_type_ vector nav-poly vector float symbol clamp-travel-vector-to-mesh-return-info) none)
(clamp-vector-to-mesh-no-gaps (_type_ vector nav-poly vector clamp-travel-vector-to-mesh-return-info) none)
(set-normals-from-adjacent-bounds (_type_ clamp-travel-vector-to-mesh-return-info) none)
(find-adjacent-bounds-one (_type_ vector nav-poly int int) none)
(compute-bounding-box-from-vertices (_type_ vector vector) none)
(nav-mesh-method-25 () none)
(nav-mesh-method-26 () none)
(nav-mesh-method-27 () none)
(nav-mesh-method-28 () none)
(nav-mesh-method-29 () none)
(nav-mesh-method-30 () none)
(nav-mesh-method-31 () none)
(nav-mesh-method-32 () none)
(nav-mesh-method-33 () none)
(nav-mesh-method-34 () none)
(nav-mesh-method-35 () none)
(nav-mesh-method-36 () none)
(nav-mesh-method-37 () none)
(nav-mesh-method-38 () none)
(nav-mesh-method-39 () none)
(init-from-entity (_type_ entity-nav-mesh) none)
(handle-birth (_type_) none)
(handle-kill (_type_) none)
(update-navigation (_type_) none)
(new-nav-control (_type_) nav-control)
(remove-nav-control (_type_ nav-control) none)
(add-process-drawable-to-nav-mesh (_type_ process-drawable symbol) none)
(remove-process-drawable (_type_ process-drawable) none)
(change-to (_type_ process-drawable) none)
(link-by-id (_type_ uint) symbol)
(unlink-by-id (_type_ uint) symbol)
(nav-mesh-method-36 (_type_ vector vector float) float)
(nav-mesh-method-37 (_type_ vector vector float) float)
(nav-mesh-method-38 (_type_ nav-poly) none)
(debug-draw-poly (_type_ nav-poly rgba) none)
(point-in-poly? (_type_ nav-poly vector) symbol)
(nav-mesh-method-41 () none)
(nav-mesh-method-41 (_type_ nav-poly vector vector vector (pointer nav-poly)) vector)
(closest-point-on-boundary (_type_ nav-poly vector vector) vector)
(nav-mesh-method-43 () none)
(project-point-onto-plane-of-poly-local (_type_ nav-poly vector vector vector) none)
(project-point-into-poly-2d (_type_ nav-poly vector vector) vector)
(nav-mesh-method-45 () none)
(nav-mesh-method-46 () none)
(nav-mesh-method-47 () none)
(nav-mesh-method-48 () none)
(nav-mesh-method-49 () none)
(nav-mesh-method-45 (_type_ nav-poly) nav-poly)
(nav-mesh-method-46 (_type_ nav-poly) nav-poly)
(is-in-mesh-local? (_type_ vector float float) symbol)
(link-to-other-mesh (_type_ nav-mesh-link) symbol)
(unlink-mesh (_type_ nav-mesh-link) none)
)
)
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -199,7 +199,7 @@
(get-max-angle-for-joint-idx (_type_ int) degrees)
(ragdoll-method-23 (_type_ vector vector float symbol) none)
(ragdoll-method-24 (_type_ vector int) none)
(ragdoll-method-25 (_type_ process-drawable) none)
(enable-ragdoll! (_type_ process-drawable) none)
)
)
+1 -1
View File
@@ -438,7 +438,7 @@
)
)
(defmethod ragdoll-method-25 ((this ragdoll) (proc process-drawable))
(defmethod enable-ragdoll! ((this ragdoll) (proc process-drawable))
(let ((s4-0 (-> this ragdoll-joints)))
(logior! (-> proc skel status) (joint-control-status no-joint-callbacks))
(do-joint-math (-> proc draw) (-> proc node-list) (-> proc skel))
+3 -3
View File
@@ -227,9 +227,9 @@
(rigid-body-object-method-43 (_type_) none)
(impulse-handler (_type_) none)
(go-active (_type_) object)
(rigid-body-object-method-46 (_type_) none)
(apply-damage (_type_ float rigid-body-impact) none)
(impulse-force<-penetrate (_type_ rigid-body-impact attack-info penetrate) none)
(rigid-body-object-method-48 (_type_) none)
(on-impact (_type_ rigid-body-impact) none)
(rbody-event-handler (_type_ process int symbol event-message-block) object)
(attack-handler (_type_ process-drawable attack-info touching-shapes-entry penetrate) symbol)
(touch-handler (_type_ process-focusable touching-shapes-entry) symbol)
@@ -249,7 +249,7 @@
(:methods
(init-queue! (_type_ process) none)
(rigid-body-queue-method-10 (_type_) none)
(rigid-body-queue-method-11 (_type_ process int) none)
(rigid-body-queue-method-11 (_type_ process) none)
(rigid-body-queue-method-12 (_type_ int int) none)
(rigid-body-queue-method-13 (_type_ int process) none)
(rigid-body-queue-method-14 (_type_ int) none)
@@ -122,18 +122,18 @@
)
)
(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 process) (arg1 int))
(defmethod rigid-body-queue-method-11 ((this rigid-body-queue) (arg0 process))
(let ((v1-0 -1))
(let ((a2-1 0))
(let ((a2-0 0))
(b! #t cfg-9 :delay (nop!))
(label cfg-1)
(b! (handle->process (-> this array a2-1)) cfg-8 :delay (empty-form))
(set! v1-0 a2-1)
(b! (handle->process (-> this array a2-0)) cfg-8 :delay (empty-form))
(set! v1-0 a2-0)
(b! #t cfg-11 :delay (nop!))
(label cfg-8)
(+! a2-1 1)
(+! a2-0 1)
(label cfg-9)
(b! (< a2-1 (-> this count)) cfg-1)
(b! (< a2-0 (-> this count)) cfg-1)
)
(label cfg-11)
(cond
+11 -10
View File
@@ -1084,12 +1084,12 @@
0
)
(defmethod rigid-body-object-method-46 ((this rigid-body-object))
(defmethod apply-damage ((this rigid-body-object) (arg0 float) (arg1 rigid-body-impact))
0
(none)
)
(defmethod rigid-body-object-method-48 ((this rigid-body-object))
(defmethod on-impact ((this rigid-body-object) (arg0 rigid-body-impact))
0
(none)
)
@@ -1155,7 +1155,7 @@
)
(set! (-> arg0 impulse) (* f0-1 (-> this info extra attack-force-scale)))
)
(rigid-body-object-method-46 this)
(apply-damage this f1-1 arg0)
0
(none)
)
@@ -1187,8 +1187,8 @@
(add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s5-0 point) s4-1 (meters 0.00024414062) *color-blue*)
)
)
(on-impact this s5-0)
)
(rigid-body-object-method-48 this)
(if (and (-> this next-state) (= (-> this next-state name) 'idle))
(go-active this)
)
@@ -1240,7 +1240,7 @@
*color-blue*
)
)
(rigid-body-object-method-48 this)
(on-impact this s5-0)
(if (and (-> this next-state) (= (-> this next-state name) 'idle))
(go-active this)
)
@@ -1254,11 +1254,12 @@
(defmethod rbody-event-handler ((this rigid-body-object) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
(('impact-impulse)
(-> arg3 param 0)
(if (!= this arg0)
(impulse-handler this)
)
(rigid-body-object-method-48 this)
(let ((s5-1 (-> arg3 param 0)))
(if (!= this arg0)
(impulse-handler this)
)
(on-impact this (the-as rigid-body-impact s5-1))
)
(if (and (-> this next-state) (= (-> this next-state name) 'idle))
(go-active this)
)
+13 -10
View File
@@ -319,16 +319,19 @@
)
)
(when s4-1
(cond
(((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1)
(let ((t9-4 (method-of-type nav-control nav-control-method-20)))
#x45000000
(t9-4)
)
)
(else
(set! (-> arg0 quad) (the-as uint128 0))
)
(let ((a2-3 ((method-of-type nav-control find-poly-containing-point-1) (the-as nav-control s4-1) arg1)))
(if a2-3
((method-of-type nav-control clamp-vector-to-mesh-cross-gaps)
(the-as nav-control s4-1)
arg1
a2-3
arg0
2048.0
#f
(the-as clamp-travel-vector-to-mesh-return-info #f)
)
(set! (-> arg0 quad) (the-as uint128 0))
)
)
)
)
@@ -622,7 +622,7 @@
)
(let ((a0-3 (-> this nav)))
(if (and a0-3 (nonzero? a0-3))
((method-of-type nav-control nav-control-method-41))
(remove! a0-3)
)
)
(let* ((s5-0 (-> this root))
@@ -1512,9 +1512,9 @@
(if (or (zero? s4-0) (or (not (-> gp-0 root-channel 0 frame-group)) (zero? (-> gp-0 active-channels))))
(logior! (-> this draw status) (draw-control-status no-draw-temp))
)
;; (if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid))
;; (merc-blend-shape this)
;; )
(if (logtest? (-> this skel status) (joint-control-status blend-shape blend-shape-valid))
(merc-blend-shape this)
)
(if (logtest? (-> this skel status) (joint-control-status eye-anim-valid eye-anim))
(merc-eye-anim this)
)
@@ -375,7 +375,7 @@
)
:code (behavior ()
(if (-> self skel effect)
(do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
)
(let ((gp-0 (current-time)))
(until (time-elapsed? gp-0 (seconds 1))
@@ -119,17 +119,10 @@
)
(logclear! (-> self mask) (process-mask actor-pause enemy))
(set! (-> self event-hook) simple-nav-sphere-event-handler)
(cond
(arg2
(let ((t9-5 (method-of-object arg2 nav-mesh-method-31)))
self
(t9-5)
)
)
(else
(if arg2
(add-process-drawable-to-nav-mesh arg2 self #f)
(nav-mesh-connect-from-ent self)
)
)
(if (>= (-> self track-joint) 0)
(go-virtual active)
(go-virtual idle)
+3 -1
View File
@@ -905,6 +905,8 @@
(defstate wait (scene-player)
:virtual #t
:enter (behavior ((arg0 symbol))
(format 0 "scene-player: skipping scene~%")
(go-virtual release)
(set-time! (-> self state-time))
(if (= (-> *game-info* demo-state) 101)
(set-setting! 'audio-language #f 0.0 5)
@@ -1880,7 +1882,7 @@
;; WARN: Return type mismatch object vs none.
(defbehavior scene-player-init scene-player ((arg0 object) (arg1 symbol) (arg2 string))
(process-entity-set! self (the-as entity #f))
(stack-size-set! (-> self main-thread) 512)
(stack-size-set! (-> self main-thread) 1024)
(set! (-> self root) (new 'process 'trsqv))
(case (rtype-of arg0)
((array)
+1
View File
@@ -108,6 +108,7 @@
(reg1)
(reg2)
(unk)
(unk2)
)
(defenum stream-status
@@ -76,6 +76,24 @@ O(n^2) 'check everybody against everybody' collision loop."
)
)
;; og:preserve-this added
(deftype nav-stack-type (structure)
"nav-mesh::12"
((nav-id-params find-nav-sphere-ids-params :inline :offset 0)
(vec1 vector :inline :offset 32)
(vec2 vector :inline :offset 48)
(vec3 vector :inline :offset 64)
(byte01 int8 :offset 64)
(byte02 int8 :offset 65)
(byte03 int8 :offset 66)
(byte04 int8 :offset 67)
(vec4 vector :inline :offset 80)
(vec5 vector :inline :offset 96)
(vec6 vector :inline :offset 112)
(byte-arr uint8 20 :offset 128)
)
)
(deftype sphere-hash (grid-hash)
"An extension of grid hash that holds spheres inside of the grid."
@@ -91,8 +109,8 @@ O(n^2) 'check everybody against everybody' collision loop."
(add-a-sphere (_type_ vector) int)
(add-a-sphere-with-flag (_type_ vector int) int)
(update-from-spheres (_type_) none)
(sphere-hash-method-29 (_type_ find-nav-sphere-ids-params int int int) none)
(find-nav-sphere-ids (_type_ find-nav-sphere-ids-params) none)
(sphere-hash-method-29 (_type_ find-nav-sphere-ids-params) none)
(find-nav-sphere-ids (_type_ find-nav-sphere-ids-params int int) symbol)
(add-sphere-with-mask-and-id (_type_ vector int int) symbol)
(sphere-hash-method-32 (_type_ sphere int) symbol)
)
@@ -1459,9 +1459,9 @@
)
)
(spawn (-> self board effect-part) (-> self control trans))
(do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1)
(do-effect (-> self skel effect) "effect-board-poof" 0.0 -1)
(if (< (-> self board shock-offset) -2048.0)
(do-effect (-> self skel effect) (the-as symbol "effect-board-poof") 0.0 -1)
(do-effect (-> self skel effect) "effect-board-poof" 0.0 -1)
)
)
(vector-lerp! (-> self board slow-transv) (-> self board slow-transv) (-> self control transv) 0.2)
+1 -1
View File
@@ -491,7 +491,7 @@
)
)
)
(do-effect (-> self skel effect) (the-as symbol "death-default") 0.0 -1)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
(ja-no-eval :num! (seek!))
(while (not (ja-done? 0))
(suspend)
@@ -2612,7 +2612,7 @@
(set! (-> self control last-attack-end-time) 0)
(set! (-> self control mod-surface) *flut-air-attack-mods*)
(sound-play "flop-land" :pitch -0.4)
(do-effect (-> self skel effect) (the-as symbol "group-flut-attack-strike-ground") (ja-frame-num 0) 0)
(do-effect (-> self skel effect) "group-flut-attack-strike-ground" (ja-frame-num 0) 0)
(let ((gp-2
(process-spawn
touch-tracker
@@ -44,47 +44,46 @@
(none)
)
(format 0 "SKIP: gun-blue-shot removed lightning specs~%")
;; (set! (-> *lightning-spec-id-table* 12) (new 'static 'lightning-spec
;; :name "lightning-blue-shot-attack-explode"
;; :flags (lightning-spec-flags lsf0)
;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
;; :fade-start-factor 1.0
;; :fade-time 30.0
;; :texture (new 'static 'texture-id :index #x8f :page #x4)
;; :reduction 0.42
;; :num-points 16
;; :box-size 8192.0
;; :merge-factor 0.6
;; :merge-count 2
;; :radius 3276.8
;; :duration 45.0
;; :duration-rand 60.0
;; :sound #f
;; )
;; )
(set! (-> *lightning-spec-id-table* 12) (new 'static 'lightning-spec
:name "lightning-blue-shot-attack-explode"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 1.0
:fade-time 30.0
:texture (new 'static 'texture-id :index #x8f :page #x4)
:reduction 0.42
:num-points 16
:box-size 8192.0
:merge-factor 0.6
:merge-count 2
:radius 3276.8
:duration 45.0
:duration-rand 60.0
:sound #f
)
)
;; (set! (-> *lightning-spec-id-table* 13) (new 'static 'lightning-spec
;; :name "lightning-blue-shot-terminal"
;; :flags (lightning-spec-flags lsf0)
;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10)
;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10)
;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
;; :fade-start-factor 1.0
;; :fade-time 30.0
;; :texture (new 'static 'texture-id :index #x8f :page #x4)
;; :reduction 0.42
;; :num-points 16
;; :box-size 8192.0
;; :merge-factor 0.6
;; :merge-count 2
;; :radius 3276.8
;; :duration 75.0
;; :sound #f
;; )
;; )
(set! (-> *lightning-spec-id-table* 13) (new 'static 'lightning-spec
:name "lightning-blue-shot-terminal"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x10)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 1.0
:fade-time 30.0
:texture (new 'static 'texture-id :index #x8f :page #x4)
:reduction 0.42
:num-points 16
:box-size 8192.0
:merge-factor 0.6
:merge-count 2
:radius 3276.8
:duration 75.0
:sound #f
)
)
;; WARN: Return type mismatch (pointer process) vs object.
(defbehavior gun-fire-blue-1 target ()
@@ -1600,12 +1599,12 @@
)
(dotimes (gp-1 4)
(set! (-> self lt-array gp-1) (new 'process 'lightning-bolt))
(lightning-bolt-method-9 (-> self lt-array gp-1) 12 6 *blue-light-test*)
(init! (-> self lt-array gp-1) 12 6 *blue-light-test*)
)
(set! (-> self lt-array 4) (new 'process 'lightning-bolt))
(lightning-bolt-method-9 (-> self lt-array 4) 12 5 *blue-light-test-big*)
(init! (-> self lt-array 4) 12 5 *blue-light-test-big*)
(set! (-> self lt-array 5) (new 'process 'lightning-bolt))
(lightning-bolt-method-9 (-> self lt-array 5) 12 5 *blue-light-test-big*)
(init! (-> self lt-array 5) 12 5 *blue-light-test-big*)
(set! (-> self revolve-angle) 0.0)
(set! (-> self sway-angle) 0.0)
(set! (-> self part) (create-launch-control (-> *part-group-id-table* 107) self))
@@ -2347,26 +2346,26 @@
()
)
(format 0 "SKIP: gun-blue-shot removed lightning spec 14~%")
;; (set! (-> *lightning-spec-id-table* 14) (new 'static 'lightning-spec
;; :name "lightning-blue-2-impact-shot-attack-thick"
;; :flags (lightning-spec-flags lsf0)
;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
;; :fade-start-factor 1.0
;; :fade-time 30.0
;; :texture (new 'static 'texture-id :index #x3f :page #x4)
;; :reduction 0.42
;; :num-points 16
;; :box-size 8192.0
;; :merge-factor 0.6
;; :merge-count 2
;; :radius 3276.8
;; :duration 60.0
;; :sound (static-sound-spec "stretched-zap" :group 1)
;; )
;; )
(set! (-> *lightning-spec-id-table* 14) (new 'static 'lightning-spec
:name "lightning-blue-2-impact-shot-attack-thick"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 1.0
:fade-time 30.0
:texture (new 'static 'texture-id :index #x3f :page #x4)
:reduction 0.42
:num-points 16
:box-size 8192.0
:merge-factor 0.6
:merge-count 2
:radius 3276.8
:duration 60.0
:sound (static-sound-spec "stretched-zap" :group 1)
)
)
(defmethod deal-damage! ((this gun-blue-shot-2) (arg0 process) (arg1 event-message-block))
(if (and (logtest? (process-mask guard) (-> arg0 mask))
@@ -12,47 +12,46 @@
;; DECOMP BEGINS
(format 0 "SKIP: gun-dark-shot removed lightning specs~%")
;; (set! (-> *lightning-spec-id-table* 15) (new 'static 'lightning-spec
;; :name "lightning-dark-shot-attack"
;; :flags (lightning-spec-flags lsf0)
;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
;; :fade-start-factor 1.0
;; :fade-time 30.0
;; :texture (new 'static 'texture-id :index #x8f :page #x4)
;; :reduction 0.42
;; :num-points 16
;; :box-size 8192.0
;; :merge-factor 0.6
;; :merge-count 2
;; :radius 3276.8
;; :duration 45.0
;; :duration-rand 60.0
;; :sound (static-sound-spec "stretched-zap" :group 1)
;; )
;; )
(set! (-> *lightning-spec-id-table* 15) (new 'static 'lightning-spec
:name "lightning-dark-shot-attack"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 1.0
:fade-time 30.0
:texture (new 'static 'texture-id :index #x8f :page #x4)
:reduction 0.42
:num-points 16
:box-size 8192.0
:merge-factor 0.6
:merge-count 2
:radius 3276.8
:duration 45.0
:duration-rand 60.0
:sound (static-sound-spec "stretched-zap" :group 1)
)
)
;; (set! (-> *lightning-spec-id-table* 16) (new 'static 'lightning-spec
;; :name "lightning-dark-shot-attack-thick"
;; :flags (lightning-spec-flags lsf0)
;; :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
;; :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
;; :fade-start-factor 1.0
;; :fade-time 30.0
;; :texture (new 'static 'texture-id :index #x3f :page #x4)
;; :reduction 0.42
;; :num-points 16
;; :box-size 8192.0
;; :merge-factor 0.6
;; :merge-count 2
;; :radius 3276.8
;; :duration 60.0
;; :sound (static-sound-spec "stretched-zap" :group 1)
;; )
;; )
(set! (-> *lightning-spec-id-table* 16) (new 'static 'lightning-spec
:name "lightning-dark-shot-attack-thick"
:flags (lightning-spec-flags lsf0)
:start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
:fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5)
:fade-start-factor 1.0
:fade-time 30.0
:texture (new 'static 'texture-id :index #x3f :page #x4)
:reduction 0.42
:num-points 16
:box-size 8192.0
:merge-factor 0.6
:merge-count 2
:radius 3276.8
:duration 60.0
:sound (static-sound-spec "stretched-zap" :group 1)
)
)
(defpartgroup group-lightning-dark-shot-tip-hit
:id 183
+1 -1
View File
@@ -3008,7 +3008,7 @@
(set! (-> this game) *game-info*)
(set! (-> this ext-geo-control) *target-geo-control*)
(set! (-> this pending-ext-geo)
(if (and (logtest? (game-feature feature56) (-> this game features))
(if (and (logtest? (game-feature jakc) (-> this game features))
(not (logtest? (game-secrets commentary) (-> *game-info* secrets)))
)
(target-geo jakc)

Some files were not shown because too many files have changed in this diff Show More