Compare commits

...

17 Commits

Author SHA1 Message Date
Ziemas 9b7aed053d
Merge d114ca8309 into a61f24a168 2024-05-17 09:19:20 +02:00
Hat Kid a61f24a168
jak3: custom level support (#3522) 2024-05-16 21:15:54 +02:00
Hat Kid c12a5d777c
decomp3: decompile remaining mission code (#3515)
This should make all missions playable with the exception of the end of
`precursor-destroy-ship` because `precurd` asserts on level extraction.

- `trail`
- `trail-graph`
- `wastrail-graph`
- `cty-protect`
- `protect-gunship`
- `protect-path`
- `protect-script`
- `assault-cams`
- `assault-enemies`
- `assault-path`
- `assault-script`
- `assault-shared`
- `assault-task`
- `hover-nav-precura`
- `precura-mood`
- `precura-obs`
- `precura-obs2`
- `precura-part`
- `precurc-mood`
- `precurc-obs`
- `precurc-part`
- `precurd-obs`
- `precurd-part`
- `precurd-scenes`
2024-05-16 16:21:44 +02:00
Ziemas d114ca8309 queue load single messages 2024-05-12 19:58:31 +02:00
Ziemas 6628fc3600 pagemanager: mostly map out structs 2024-05-03 18:17:00 +02:00
Ziemas 78917bd96e wip 2024-05-02 13:24:58 +02:00
Ziemas b5b45b2c99 wip 2024-05-02 07:45:15 +02:00
Ziemas 1c034c97bf Add no-op Suspend/Resume intr 2024-05-02 06:48:56 +02:00
Ziemas fdb439e014 wip 2024-05-02 06:23:29 +02:00
Ziemas 3c73063940 iop: Support wating on message boxes 2024-05-02 06:20:37 +02:00
Ziemas 38fe4161d0 wip 2024-05-01 23:57:09 +02:00
Ziemas 541815f809 start all rpc threads 2024-05-01 23:57:09 +02:00
Ziemas 379622b70b set up fake iso system class 2024-05-01 23:57:09 +02:00
Ziemas 7661301b5f overlrd2: ctz 2024-05-01 23:57:09 +02:00
Ziemas bea9e6a1e3 wip 2024-05-01 23:57:09 +02:00
Ziemas 8c1948db68 overlrd2: angle lookup table 2024-05-01 03:56:56 +02:00
Ziemas 413e214d2c overlrd2: start 2024-05-01 03:56:56 +02:00
178 changed files with 76881 additions and 1759 deletions

View File

@ -0,0 +1,90 @@
{
// The "in-game" name of the level. Should be lower case, with dashes (GOAL symbol name)
// the name of this file, and the folder this file is in must have the same name.
"long_name": "test-zone",
// The file name, should be upper case and 8 characters or less.
"iso_name": "TESTZONE",
// The nickname, should be exactly 3 characters
"nickname": "tsz", // 3 char name, all lowercase
// Background mesh file.
// Must have vertex colors. Use the blender cycles renderer, bake, diffuse, uncheck color,
// and bake to vertex colors. For now, only the first vertex color group is used, so make sure you
// only have 1.
"gltf_file": "custom_levels/jak3/test-zone/test-zone2.glb",
// automatically set wall vs. ground based on angle. Useful if you don't want to assign this yourself
"automatic_wall_detection": true,
"automatic_wall_angle": 45.0,
// if your mesh has triangles with incorrect orientation, set this to make all collision mesh triangles double sided
// this makes collision 2x slower and bigger, so only use if really needed
"double_sided_collide": false,
// available res-lump tag types:
// integer types: int32, uint32, enum-int32, enum-uint32
// float types: float, meters (1 meter = 4096.0 units), degrees (65536.0 = 360°)
// vector types: vector (normal floats), vector4m (meters), vector3m (meters with w set to 1.0), vector-vol (normal floats with w in meters), movie-pos (meters with w in degrees)
// special types: symbol, type, string, eco-info, cell-info, buzzer-info, water-height
//
// examples:
//
// adds a float tag 'spring-height' with value of 200 meters (1 meter = 4096.0 units):
// "spring-height": ["meters", 200.0]
//
// adds a degrees tag 'rotoffset':
// "rotoffset": ["degrees", -45.0]
//
// adds a movie-pos tag:
// "movie-pos": ["movie-pos", [100.22, -25.3, 99.5, 180.0]]
//
// adds an enum tag 'options':
// "options": ["enum-int32", "(fact-options large)"]
//
// adds a water-height tag:
// "water-height": ["water-height", 25.0, 0.5, 2.0, "(water-flags can-swim can-wade)"]
//
// adds an eco-info tag:
// "eco-info": ["eco-info", "(pickup-type health)", 2]
//
// adds a 'type' tag (using the "symbol" and "string" lump types works the same way):
// "spawn-types": ["type", "spyder", "juicer"]
// The base actor id for your custom level. If you have multiple levels, this should be unique!
"base_id": 100,
// All art groups you want to use in your custom level. Will add their models and corresponding textures to the FR3 file.
// "art_groups": [],
// Any textures you want to include in your custom level.
// This is mainly useful for textures which are not in the common level files and have no art group associated with them.
// To get a list of all the textures, you can extract all of the game's textures
// by setting "save_texture_pngs" to true in the decompiler config.
// "textures": [],
"actors" : [
{
"trans": [-15.2818, 15.2461, 17.1360], // translation
"etype": "crate", // actor type
"game_task": "(game-task none)", // associated game task (for powercells, etc)
"kill_mask": 0,
"quat": [0, 0, 0, 1], // quaternion
"bsphere": [-15.2818, 15.2461, 17.1360, 10], // bounding sphere
"lump": {
"name": "test-crate",
"eco-info": ["eco-info", "(pickup-type gem)", 1]
}
},
{
"trans": [-5.4630, 17.4553, 1.6169], // translation
"etype": "eco-yellow", // actor type
"game_task": "(game-task none)", // associated game task (for powercells, etc)
"kill_mask": 0,
"quat": [0, 0, 0, 1], // quaternion
"bsphere": [-5.4630, 17.4553, 1.6169, 10], // bounding sphere
"lump": {
"name": "test-eco"
}
}
]
}

Binary file not shown.

View File

@ -0,0 +1,8 @@
;; DGO definition file for Awful Village level
;; We use the convention of having a longer DGO name for levels without precomputed visibility.
;; the actual file name still needs to be 8.3
("TSZ.DGO"
("test-zone.go"
)
)

File diff suppressed because it is too large Load Diff

View File

@ -978,5 +978,27 @@
[27, "(function process symbol)"],
[46, "(function collide-shape-prim none)"],
[69, "(function process object)"]
],
"assault-enemies": [
[36, "(function assault-crimson-guard city-attacker-info int)"]
],
"assault-task": [[11, "(function symbol :behavior process)"]],
"precura-obs": [[98, "(function symbol :behavior process)"]],
"precurd-scenes": [
[0, "(function none :behavior scene-player)"],
[1, "(function none :behavior scene-player)"],
[2, "(function none :behavior scene-player)"],
[3, "(function none :behavior scene-player)"],
[4, "(function none :behavior scene-player)"],
[5, "(function none :behavior scene-player)"],
[6, "(function none :behavior scene-player)"],
[7, "(function none :behavior scene-player)"],
[8, "(function none :behavior scene-player)"],
[9, "(function none :behavior scene-player)"],
[10, "(function none :behavior scene-player)"],
[11, "(function none :behavior scene-player)"],
[12, "(function none :behavior scene-player)"],
[13, "(function none :behavior scene-player)"],
[14, "(function none :behavior scene-player)"]
]
}

View File

@ -35,7 +35,11 @@
"power-game-chaser": "flitter-ag",
"power-game-zapper": "grunt-head-ag",
"gungame-door": "fort-entry-gate-ag",
"bt-mh-flyer": "bt-wasp-ag"
"bt-mh-flyer": "bt-wasp-ag",
"gunship-exploder": "kg-robot-transport-break",
"gunship-engine": "kg-robot-transport-bomb",
"protect-gunship": "kg-robot-transport",
"gunship-missile": "cty-homing-missile"
},
// remap names for types in an entire file (higher priority)

View File

@ -581,7 +581,8 @@
[346, 0],
[378, 0],
[413, 0]
]
],
"(trans carry precur-bomb)": [[60, 0]]
},
"mips2c_functions_by_name": [
@ -711,7 +712,6 @@
"(method 21 cloth-system)",
"debug-line-clip?",
"(method 9 font-work)",
"(method 9 prim-strip)",
"live-func-curve",
"birth-func-curve",
"sparticle-motion-blur-dirt",

View File

@ -182,7 +182,7 @@
"DGO/RAILE.DGO",
"DGO/RAILF.DGO",
"DGO/RAILX.DGO",
// // precursor
// precursor
"DGO/PRECA.DGO",
"DGO/PRECB.DGO",
"DGO/PRECC.DGO",

View File

@ -2132,5 +2132,333 @@
["L1047", "uint64", true],
["L1056", "uint64", true],
["L1044", "uint64", true]
],
"protect-gunship": [
["L786", "uint64", true],
["L783", "uint64", true],
["L780", "uint64", true],
["L784", "uint64", true],
["L779", "uint64", true],
["L778", "uint64", true],
["L785", "uint64", true],
["L782", "uint64", true],
["L776", "uint64", true],
["L781", "uint64", true],
["L777", "uint64", true],
["L604", "uint64", true],
["L599", "uint64", true],
["L510", "(inline-array gunship-info)", 2],
["L608", "uint64", true],
["L603", "uint64", true],
["L614", "uint64", true],
["L464", "attack-info"],
["L463", "attack-info"],
["L612", "uint64", true],
["L615", "uint64", true],
["L601", "uint64", true],
["L598", "uint64", true],
["L602", "uint64", true],
["L610", "uint64", true],
["L606", "uint64", true],
["L611", "uint64", true],
["L600", "uint64", true],
["L609", "uint64", true],
["L607", "uint64", true],
["L613", "uint64", true],
["L605", "uint64", true],
["L456", "attack-info"]
],
"cty-protect": [["L142", "attack-info"]],
"assault-shared": [["L1", "(inline-array talker-speech-class)", 22]],
"assault-path": [
["L34", "assault-room"],
["L33", "assault-room-collision"],
["L29", "assault-room"],
["L28", "assault-room-collision"],
["L23", "assault-room"],
["L22", "assault-room-collision"],
["L17", "assault-room"],
["L16", "assault-room-collision"],
["L11", "assault-room"],
["L10", "assault-room-collision"]
],
"assault-enemies": [
["L333", "attack-info"],
["L332", "attack-info"]
],
"precurd-obs": [
["L610", "uint64", true],
["L612", "uint64", true],
["L613", "uint64", true],
["L611", "uint64", true],
["L544", "uint64", true],
["L543", "uint64", true],
["L547", "uint64", true],
["L542", "uint64", true],
["L541", "uint64", true],
["L548", "uint64", true],
["L356", "attack-info"],
["L549", "uint64", true],
["L550", "uint64", true],
["L545", "uint64", true],
["L546", "uint64", true]
],
"precura-obs": [
["L734", "uint64", true],
["L728", "uint64", true],
["L729", "uint64", true],
["L732", "uint64", true],
["L731", "uint64", true],
["L730", "uint64", true],
["L725", "uint64", true],
["L735", "uint64", true],
["L726", "uint64", true],
["L727", "uint64", true],
["L733", "uint64", true],
["L608", "uint64", true],
["L620", "uint64", true],
["L618", "uint64", true],
["L617", "uint64", true],
["L623", "uint64", true],
["L610", "uint64", true],
["L605", "uint64", true],
["L611", "uint64", true],
["L621", "uint64", true],
["L614", "uint64", true],
["L613", "uint64", true],
["L606", "uint64", true],
["L619", "uint64", true],
["L607", "uint64", true],
["L577", "attack-info"],
["L576", "attack-info"],
["L622", "uint64", true],
["L432", "vector"],
["L431", "vector"],
["L430", "vector"],
["L609", "uint64", true],
["L612", "uint64", true],
["L615", "uint64", true],
["L616", "uint64", true]
],
"precura-obs2": [
["L499", "uint64", true],
["L489", "uint64", true],
["L603", "uint64", true],
["L602", "uint64", true],
["L597", "uint64", true],
["L596", "uint64", true],
["L598", "uint64", true],
["L601", "uint64", true],
["L595", "uint64", true],
["L600", "uint64", true],
["L599", "uint64", true],
["L484", "uint64", true],
["L488", "uint64", true],
["L491", "uint64", true],
["L496", "uint64", true],
["L494", "uint64", true],
["L498", "uint64", true],
["L394", "attack-info"],
["L495", "uint64", true],
["L493", "uint64", true],
["L492", "uint64", true],
["L486", "uint64", true],
["L497", "uint64", true],
["L487", "uint64", true],
["L485", "uint64", true],
["L490", "uint64", true],
["L446", "vector"],
["L416", "attack-info"],
["L415", "attack-info"]
],
"neon-baron-part": [
["L592", "uint64", true],
["L579", "(pointer uint64)", 1],
["L83", "(pointer uint32)", 40],
["L384", "vector4w"],
["L385", "vector4w"],
["L386", "vector4w"],
["L387", "vector4w"],
["L388", "vector4w"],
["L389", "vector4w"],
["L390", "vector4w"],
["L391", "vector4w"],
["L392", "vector4w"],
["L393", "vector4w"],
["L394", "vector4w"],
["L395", "vector4w"],
["L396", "vector4w"],
["L397", "vector4w"],
["L398", "vector4w"],
["L399", "vector4w"],
["L400", "vector4w"],
["L401", "vector4w"],
["L402", "vector4w"],
["L403", "vector4w"],
["L404", "vector4w"],
["L405", "vector4w"],
["L406", "vector4w"],
["L407", "vector4w"],
["L408", "vector4w"],
["L409", "vector4w"],
["L410", "vector4w"],
["L411", "vector4w"],
["L412", "vector4w"],
["L413", "vector4w"],
["L414", "vector4w"],
["L415", "vector4w"],
["L416", "vector4w"],
["L417", "vector4w"],
["L418", "vector4w"],
["L419", "vector4w"],
["L420", "vector4w"],
["L421", "vector4w"],
["L422", "vector4w"],
["L423", "vector4w"],
["L424", "vector4w"],
["L425", "vector4w"],
["L426", "vector4w"],
["L427", "vector4w"],
["L428", "vector4w"],
["L429", "vector4w"],
["L430", "vector4w"],
["L431", "vector4w"],
["L432", "vector4w"],
["L433", "vector4w"],
["L434", "vector4w"],
["L435", "vector4w"],
["L436", "vector4w"],
["L437", "vector4w"],
["L438", "vector4w"],
["L439", "vector4w"],
["L440", "vector4w"],
["L441", "vector4w"],
["L442", "vector4w"],
["L443", "vector4w"],
["L444", "vector4w"],
["L445", "vector4w"],
["L446", "vector4w"],
["L447", "vector4w"],
["L448", "vector4w"],
["L449", "vector4w"],
["L450", "vector4w"],
["L451", "vector4w"],
["L452", "vector4w"],
["L453", "vector4w"],
["L454", "vector4w"],
["L455", "vector4w"],
["L456", "vector4w"],
["L457", "vector4w"],
["L458", "vector4w"],
["L459", "vector4w"],
["L460", "vector4w"],
["L461", "vector4w"],
["L462", "vector4w"],
["L463", "vector4w"],
["L464", "vector4w"],
["L465", "vector4w"],
["L466", "vector4w"],
["L467", "vector4w"],
["L468", "vector4w"],
["L469", "vector4w"],
["L470", "vector4w"],
["L471", "vector4w"],
["L472", "vector4w"],
["L473", "vector4w"],
["L474", "vector4w"],
["L475", "vector4w"],
["L476", "vector4w"],
["L477", "vector4w"],
["L478", "vector4w"],
["L479", "vector4w"],
["L480", "vector4w"],
["L481", "vector4w"],
["L482", "vector4w"],
["L483", "vector4w"],
["L484", "vector4w"],
["L485", "vector4w"],
["L486", "vector4w"],
["L487", "vector4w"],
["L488", "vector4w"],
["L489", "vector4w"],
["L490", "vector4w"],
["L491", "vector4w"],
["L492", "vector4w"],
["L493", "vector4w"],
["L494", "vector4w"],
["L495", "vector4w"],
["L496", "vector4w"],
["L497", "vector4w"],
["L498", "vector4w"],
["L499", "vector4w"],
["L500", "vector4w"],
["L501", "vector4w"],
["L502", "vector4w"],
["L503", "vector4w"],
["L505", "vector4w"],
["L507", "vector4w"],
["L509", "vector4w"],
["L511", "vector4w"],
["L513", "vector4w"],
["L514", "vector4w"],
["L515", "vector4w"],
["L516", "vector4w"],
["L517", "vector4w"],
["L518", "vector4w"],
["L519", "vector4w"],
["L520", "vector4w"],
["L521", "vector4w"],
["L522", "vector4w"],
["L523", "vector4w"],
["L524", "vector4w"],
["L526", "vector4w"],
["L527", "vector4w"],
["L528", "vector4w"],
["L529", "vector4w"],
["L530", "vector4w"],
["L531", "vector4w"],
["L532", "vector4w"],
["L533", "vector4w"],
["L534", "vector4w"],
["L535", "vector4w"],
["L536", "vector4w"],
["L537", "vector4w"],
["L538", "vector4w"],
["L539", "vector4w"],
["L540", "vector4w"],
["L541", "vector4w"],
["L542", "vector4w"],
["L543", "vector4w"],
["L544", "vector4w"],
["L545", "vector4w"],
["L546", "vector4w"],
["L547", "vector4w"],
["L548", "vector4w"],
["L549", "vector4w"],
["L550", "vector4w"],
["L551", "vector4w"],
["L552", "vector4w"],
["L554", "vector4w"],
["L556", "vector4w"],
["L558", "vector4w"],
["L559", "vector4w"],
["L560", "vector4w"],
["L561", "vector4w"],
["L562", "vector4w"],
["L563", "vector4w"],
["L564", "vector4w"],
["L565", "vector4w"],
["L566", "vector4w"],
["L567", "vector4w"],
["L568", "vector4w"],
["L569", "vector4w"],
["L570", "vector4w"],
["L571", "vector4w"],
["L572", "vector4w"],
["L573", "vector4w"],
["L574", "vector4w"],
["L575", "vector4w"],
["L576", "vector4w"],
["L577", "vector4w"]
]
}

View File

@ -2438,5 +2438,74 @@
[320, "collide-query"],
[160, "vector"]
],
"draw-path-blow-curve": [[16, "matrix"]]
"draw-path-blow-curve": [[16, "matrix"]],
"(method 22 trail-graph)": [[16, "trail-vis-work"]],
"(method 13 trail-graph)": [[16, ["inline-array", "vector", 3]]],
"(method 16 trail-graph)": [[16, ["inline-array", "vector", 2]]],
"(method 17 trail-graph)": [[16, "trail-conn-search"]],
"(trans explode gunship-missile)": [[32, ["array", "collide-shape", 384]]],
"(trans spinning-laser protect-gunship)": [
[32, "vector"],
[64, "vector"]
],
"find-reposition-pt": [
[16, "vector"],
[96, "vector"],
[112, "vector"]
],
"(method 50 protect-gunship)": [[16, "vector"]],
"find-nearest-nav-mesh-protect": [[16, "nav-poly"]],
"(method 37 protect-gunship)": [[752, "vector"]],
"(method 36 protect-gunship)": [[16, "gunship-missile-init-params"]],
"(method 39 protect-gunship)": [[16, "protect-gunship-enemy-spawn-params"]],
"(method 55 protect-gunship)": [[16, "collide-query"]],
"(method 21 prot-crate)": [[16, "vector"]],
"(method 36 task-manager-protect-hq)": [[16, "protect-gunship-init-params"]],
"spawn-protect-enemy": [[16, "traffic-object-spawn-params"]],
"(method 35 task-manager-protect-hq)": [[16, "traffic-object-spawn-params"]],
"(trans hostile assault-bombbot)": [[32, "vector"]],
"(enter explode assault-bombbot)": [[112, ["array", "collide-shape", 384]]],
"(code roll-initial assault-roboguard)": [[16, "vector"]],
"(method 31 assault-bombbot-shot)": [
[16, "light-trail-tracker-spawn-params"]
],
"(code active task-manager-city-port-assault)": [
[16, "player-controller-init-params"]
],
"(method 40 task-manager-city-port-assault)": [[16, ["array", "symbol", 10]]],
"(enter combat task-manager-city-port-assault)": [
[16, "player-controller-init-params"]
],
"(code player-entrance task-manager-city-port-assault)": [
[16, "player-controller-init-params"]
],
"(enter transition task-manager-city-port-assault)": [
[16, "player-controller-init-params"]
],
"(method 47 task-manager-city-port-assault)": [[64, "vector"]],
"(method 48 task-manager-city-port-assault)": [[64, "vector"]],
"(method 41 task-manager-city-port-assault)": [[48, "vector"]],
"(trans idle precur-generator)": [[112, "vector"]],
"(method 23 precur-generator-d)": [[16, "vector"]],
"(event idle precur-door-d)": [[16, "attack-info"]],
"(method 23 precur-door-c)": [[112, "vector"]],
"(method 11 precur-path)": [[16, "vector"]],
"precur-bomb-handler": [[16, "attack-info"]],
"(event idle precur-bomb-spawner)": [[16, "attack-info"]],
"(method 21 precur-bomb-spawner)": [[16, "vector"]],
"precur-bomb-init-by-other": [[16, "vector"]],
"(method 25 precur-laser-beam)": [[16, "collide-query"]],
"(method 24 precur-laser-beam)": [[16, "collide-query"]],
"process-drawable-shock-wave-effect": [
[16, "matrix"],
[80, "collide-query"]
],
"(method 22 precur-path)": [[16, "collide-query"]],
"precur-bridge-path-2nd-trigger": [[16, "vector"]],
"precur-bridge-blocks-trigger": [[16, "vector"]],
"precur-bridge-path-trigger": [[16, "vector"]],
"(post idle precur-bridge-blocks-break)": [
[16, "vector"],
[32, "vector"]
]
}

View File

@ -2671,7 +2671,12 @@
[224, "t0", "int"],
[226, "t1", "int"],
[226, "a3", "int"],
[[190, 231], "a1", "(inline-array prim-vertex)"]
[[190, 231], "a1", "(inline-array prim-vertex)"],
[[148, 164], "a1", "(inline-array prim-vertex)"],
[[192, 230], "a2", "(inline-array prim-vertex)"],
[147, "a1", "(pointer uint128)"],
[[278, 281], "v1", "dma-packet"],
[230, "a2", "(pointer uint128)"]
],
"prim-engine-execute": [
[[15, 21], "v1", "connection"],
@ -10846,7 +10851,6 @@
["_stack_", 76, "float"],
["_stack_", 100, "float"]
],
"real-wang-texture-anim-func": [[[3, 31], "v1", "mood-context"]],
"(method 24 sky-work)": [
[256, "s4", "(pointer int32)"],
[261, "s4", "(pointer int32)"]
@ -10869,5 +10873,234 @@
[65, "v1", "(pointer uint128)"],
[[70, 77], "a0", "vector4w"],
[[78, 84], "v1", "vector4w"]
]
],
"(method 10 trail-graph)": [[16, "v1", "trail-conn-hash-cell"]],
"(method 24 trail-graph)": [[19, "a1", "trail-conn-hash-cell"]],
"(method 28 trail-graph)": [[36, "a1", "int"]],
"(method 30 trail-graph)": [[67, "a2", "int"]],
"(event idle gunship-engine)": [[[4, 19], "v1", "attack-info"]],
"(post hover protect-gunship)": [[5, "t9", "(function none)"]],
"(enter landed protect-gunship)": [[10, "t9", "(function none)"]],
"(enter raising protect-gunship)": [[29, "t9", "(function none)"]],
"(enter lowering protect-gunship)": [[23, "t9", "(function none)"]],
"(post lowering protect-gunship)": [[10, "t9", "(function none)"]],
"(enter enemy-spawning protect-gunship)": [[5, "t9", "(function none)"]],
"(code explode gunship-exploder)": [[10, "v1", "art-joint-anim"]],
"(post enemy-spawning protect-gunship)": [[5, "t9", "(function none)"]],
"(event launch gunship-missile)": [[5, "a0", "vector"]],
"(trans explode gunship-missile)": [
[75, "s3", "process-focusable"],
[79, "s3", "process-focusable"],
[85, "s3", "process-focusable"]
],
"(method 44 protect-gunship)": [
[[228, 239], "s3", "particle-local-space-info"]
],
"(enter hover protect-gunship)": [[6, "t9", "(function none)"]],
"(post spinning-laser protect-gunship)": [[5, "t9", "(function none)"]],
"(trans spinning-laser protect-gunship)": [[113, "v1", "float"]],
"(enter spinning-laser protect-gunship)": [[8, "t9", "(function none)"]],
"find-reposition-pt": [
[[35, 40], "v1", "protect-gunship"],
[[113, 119], "v1", "protect-gunship"],
["_stack_", 44, "float"],
["_stack_", 56, "float"],
["_stack_", 76, "float"],
["_stack_", 80, "float"]
],
"(method 53 protect-gunship)": [
[52, "v1", "float"],
[67, "v1", "float"],
[83, "v1", "float"],
[34, "v0", "int"]
],
"(method 50 protect-gunship)": [[126, "v1", "float"]],
"(method 49 protect-gunship)": [[19, "v1", "float"]],
"(method 52 protect-gunship)": [[[104, 111], "a0", "protect-gunship"]],
"(method 41 protect-gunship)": [
[[395, 398], "v1", "gunship-engine"],
[467, "v1", "float"]
],
"(method 37 protect-gunship)": [
[358, "v1", "float"],
[378, "v1", "float"]
],
"(method 38 protect-gunship)": [[20, "v1", "float"]],
"gunship-missile-init-by-other": [[136, "v1", "float"]],
"(method 55 protect-gunship)": [[127, "v1", "collide-shape-prim-sphere"]],
"(method 21 prot-crate)": [
[72, "v1", "float"],
[97, "v1", "float"]
],
"(method 45 protect-gunship)": [[7, "a1", "int"]],
"(enter fail task-manager-protect-hq)": [
[26, "v0", "(state resetter-params task-manager-protect-hq)"]
],
"(trans hostile assault-bombbot)": [[[76, 125], "v1", "process-focusable"]],
"(method 209 assault-bombbot)": [[48, "v1", "process-focusable"]],
"(code wait-for-enemies assault-crimson-guard)": [
[22, "v1", "art-joint-anim"]
],
"(trans wait-for-enemies assault-crimson-guard)": [
[[15, 23], "a0", "process-focusable"]
],
"(trans active assault-crimson-guard)": [
[[27, 35], "a0", "process-focusable"]
],
"(anon-function 36 assault-enemies)": [[[17, 26], "s4", "process-focusable"]],
"(method 212 assault-crimson-guard)": [[4, "a0", "vector"]],
"(code tracking assault-cleanup)": [[[28, 43], "v1", "process-focusable"]],
"(code cower-ground assault-citizen-norm)": [
[22, "v1", "art-joint-anim"],
[161, "v1", "art-joint-anim"],
[180, "v1", "float"],
[225, "v1", "float"]
],
"(trans flee-madly assault-citizen-norm)": [
[41, "v1", "float"],
[68, "v1", "float"]
],
"(code exit-transport assault-metalhead-flitter)": [
[14, "v1", "art-joint-anim"]
],
"(code exit-transport assault-metalhead-grunt)": [
[14, "v1", "art-joint-anim"]
],
"(method 212 assault-citizen-norm)": [[28, "a0", "vector"]],
"(method 212 assault-roboguard)": [[16, "a1", "vector"]],
"(method 46 task-manager-city-port-assault)": [[17, "v1", "float"]],
"(method 45 task-manager-city-port-assault)": [[15, "v1", "float"]],
"(enter combat task-manager-city-port-assault)": [
[[33, 39], "a0", "assault-player-controller"]
],
"(method 47 task-manager-city-port-assault)": [[31, "v1", "float"]],
"(method 48 task-manager-city-port-assault)": [
[32, "v1", "float"],
[191, "v1", "float"]
],
"(method 40 task-manager-city-port-assault)": [
[[168, 174], "v1", "assault-player-controller"]
],
"(method 42 task-manager-city-port-assault)": [
[33, "v1", "float"],
[83, "v1", "float"]
],
"(method 43 task-manager-city-port-assault)": [
[[17, 69], "s4", "assault-spawn-cmd"]
],
"(method 24 prim-beam-tracker)": [
[[10, 19], "v1", "process-drawable"],
[[31, 40], "v1", "process-drawable"]
],
"(method 24 prim-beam)": [
[100, "v1", "prim-vertex"],
[[112, 114], "v1", "prim-vertex"],
[99, "v1", "prim-vertex"]
],
"(code going-down precur-switch)": [[10, "v1", "art-joint-anim"]],
"(event idle precur-generator-d-gem)": [
[6, "a0", "vector"],
[10, "v1", "vector"]
],
"(code idle precur-generator-d)": [[10, "v1", "art-joint-anim"]],
"(trans idle precur-generator)": [[181, "v1", "float"]],
"(method 23 precur-generator-d)": [
[61, "a3", "float"],
[28, "a3", "float"],
[94, "a3", "float"]
],
"(method 11 precur-platform-round)": [
[[169, 180], "s3", "particle-local-space-info"]
],
"(event idle precur-door-d)": [
[[5, 34], "s4", "attack-info"],
[[19, 38], "s3", "attack-info"]
],
"precur-door-c-handler": [[[3, 5], "v1", "attack-info"]],
"set-precura-generator-light!": [[10, "v1", "precura-states"]],
"update-mood-precura": [[[74, 113], "gp", "precura-states"]],
"set-precura-laser-light!": [
[[13, 17], "v1", "precura-states"],
[23, "v1", "precura-states"],
[22, "v1", "precura-states"]
],
"set-precura-bomb-light!": [[[11, 14], "v1", "precura-states"]],
"(post carry precur-bomb)": [[4, "t9", "(function none)"]],
"(post fall precur-bomb)": [[4, "t9", "(function none)"]],
"(enter explode precur-bomb)": [[51, "a0", "process"]],
"(code idle precur-bomb-spawner)": [
[53, "v1", "art-joint-anim"],
[111, "v1", "art-joint-anim"]
],
"(method 11 precur-path)": [
[[141, 145], "a0", "precur-spot-shadow-effect"],
[[130, 141], "v1", "(pointer precur-spot-shadow-effect)"]
],
"precur-bomb-handler": [
[[5, 34], "s4", "attack-info"],
[[19, 38], "s3", "attack-info"]
],
"(enter fall mechblock)": [
[42, "v0", "carry-info"],
[[43, 47], "a0", "carry-info"]
],
"(event drag-object mechblock)": [
[48, "v0", "carry-info"],
[[49, 53], "a0", "carry-info"],
[57, "a0", "vector"],
[79, "a0", "vector"]
],
"(event carry mechblock)": [[23, "a0", "vector"]],
"(event idle mechblock)": [
[[20, 27], "a0", "carry-info"],
[[34, 39], "a0", "carry-info"]
],
"(event idle precur-bomb-spawner)": [
[[10, 39], "s4", "attack-info"],
[[24, 43], "s3", "attack-info"]
],
"(enter idle precur-bomb-spawner)": [[15, "v1", "art-joint-anim"]],
"(method 25 precur-laser-beam)": [[5, "v1", "float"]],
"(method 24 precur-laser-beam)": [[6, "v1", "float"]],
"process-drawable-shock-wave-effect": [
["_stack_", 624, "(pointer lightning-tracker)"]
],
"(method 23 precur-path)": [[[35, 58], "a0", "precur-spot-shadow-effect"]],
"init-mood-precurc": [[[3, 10], "v1", "precurc-states"]],
"(post idle precur-bridge-blocks-break)": [
[53, "gp", "collide-shape-prim-group"],
[61, "gp", "collide-shape-prim-group"]
],
"(code dormant precur-laser-beam)": [["_stack_", 16, "res-tag"]],
"(method 11 precur-generator-c)": [["_stack_", 16, "res-tag"]],
"(method 11 precur-generator-d)": [["_stack_", 16, "res-tag"]],
"(method 11 precur-bridge-path-break)": [["_stack_", 16, "res-tag"]],
"(method 11 precura-door-a)": [
[141, "v0", "pair"],
[129, "v0", "pair"]
],
"(trans idle precur-generator-d)": [
[33, "v1", "object"],
[[33, 66], "v1", "object"]
],
"(method 21 lfaccity-pparticle-mover)": [
[[32, 39], "a1", "process-drawable"]
],
"update-mood-lfaccity": [[[32, 200], "gp", "lfaccity-states"]],
"(method 11 lfaccity-pparticle-mover)": [["_stack_", 16, "res-tag"]],
"(code idle neon-baron)": [
[248, "a0", "(array object)"],
[250, "a0", "(array object)"],
[282, "a0", "(array object)"],
[284, "a0", "(array object)"],
[316, "a0", "(array object)"],
[318, "a0", "(array object)"],
[350, "a0", "(array object)"],
[352, "a0", "(array object)"],
[384, "a0", "(array object)"],
[386, "a0", "(array object)"]
],
"(method 10 neon-baron)": [[11, "s5", "uint"]],
"(method 15 neon-baron)": [[29, "s5", "int"]],
"(method 16 neon-baron)": [[5, "a1", "int"]]
}

View File

@ -2115,5 +2115,25 @@
"f0-0": "total-time",
"v1-0": "curr-frame"
}
},
"symbol->gun-pickup-type": {
"vars": {
"v0-0": ["type", "pickup-type"]
}
},
"symbol->faction-type": {
"vars": {
"v0-0": ["type", "assault-cmd-faction-type"]
}
},
"symbol->speech-type": {
"vars": {
"v0-0": ["type", "assault-cmd-speech-type"]
}
},
"symbol->assault-target-type": {
"vars": {
"v0-0": ["type", "assault-target-type"]
}
}
}

View File

@ -201,7 +201,7 @@ level_tools::BspHeader extract_bsp_from_level(const ObjectFileDB& db,
expected_missing_textures = it->second;
}
bool atest_disable_flag = false;
if (db.version() == GameVersion::Jak2) {
if (db.version() >= GameVersion::Jak2) {
if (bsp_header.texture_flags[0] & 1) {
atest_disable_flag = true;
}

View File

@ -1044,9 +1044,29 @@ const std::unordered_map<
{"anim2", ArrayFieldDecompMeta(TypeSpec("tpath-control-frame"), 16)},
{"anim3", ArrayFieldDecompMeta(TypeSpec("tpath-control-frame"), 16)}}},
{"blow-tower-path",
// TODO - should be able to just decompile the `anims` field
{{"pts", ArrayFieldDecompMeta(TypeSpec("vector"), 16)},
{"node-info", ArrayFieldDecompMeta(TypeSpec("blow-tower-node-info"), 32)}}},
{"trail-conn-hash",
{{"cell", ArrayFieldDecompMeta(TypeSpec("trail-conn-hash-cell"), 6)},
{"conn-ids", ArrayFieldDecompMeta(TypeSpec("uint16"),
2,
ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}},
{"trail-graph",
{{"node", ArrayFieldDecompMeta(TypeSpec("trail-node"), 20)},
{"conn", ArrayFieldDecompMeta(TypeSpec("trail-conn"), 8)},
{"conn-ids", ArrayFieldDecompMeta(TypeSpec("uint16"),
2,
ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)},
{"visgroup", ArrayFieldDecompMeta(TypeSpec("trail-conn-hash-cell"), 6)},
{"blocker", ArrayFieldDecompMeta(TypeSpec("trail-blocker"), 32)},
{"visnode-ids",
ArrayFieldDecompMeta(TypeSpec("uint16"),
2,
ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)},
{"cell-pov-bit-arrays",
ArrayFieldDecompMeta(TypeSpec("uint64"),
8,
ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}},
}}};
goos::Object decompile_structure(const TypeSpec& type,

View File

@ -197,7 +197,6 @@ set(RUNTIME_SOURCE
mips2c/jak3_functions/generic_effect.cpp
mips2c/jak3_functions/joint.cpp
mips2c/jak3_functions/lights.cpp
mips2c/jak3_functions/prim.cpp
mips2c/jak3_functions/sky.cpp
mips2c/jak3_functions/texture.cpp
mips2c/jak3_functions/particle_curves.cpp
@ -253,6 +252,19 @@ set(RUNTIME_SOURCE
overlord/jak2/streamlfo.cpp
overlord/jak2/streamlist.cpp
overlord/jak2/vag.cpp
overlord/jak3/start.cpp
overlord/jak3/iso_api.cpp
overlord/jak3/iso_fake.cpp
overlord/jak3/iso_queue.cpp
overlord/jak3/iso.cpp
overlord/jak3/overlord.cpp
overlord/jak3/pagemanager.cpp
overlord/jak3/ramdisk.cpp
overlord/jak3/sbank.cpp
overlord/jak3/srpc.cpp
overlord/jak3/ssound.cpp
overlord/jak3/stream.cpp
overlord/jak3/vblank_handler.cpp
runtime.cpp
sce/deci2.cpp
sce/iop.cpp

View File

@ -40,8 +40,8 @@ struct RPC_Dgo_Cmd {
uint32_t buffer2;
uint32_t buffer_heap_top;
char name[16];
uint16_t cgo_id;
uint8_t pad[30];
uint32_t cgo_id;
uint8_t pad[28];
};
static_assert(sizeof(RPC_Dgo_Cmd) == 0x40);
} // namespace jak3

View File

@ -83,6 +83,14 @@ const char* filename_jak2[12] = {
"BASCUS-97265AYBABTU!/bank4.bin", "BASCUS-97265AYBABTU!/bank5.bin",
"BASCUS-97265AYBABTU!/bank6.bin", "BASCUS-97265AYBABTU!/bank7.bin"};
const char* filename_jak3[12] = {
"BASCUS-97330AYBABTU!", "BASCUS-97330AYBABTU!/icon.sys",
"BASCUS-97330AYBABTU!/icon.ico", "BASCUS-97330AYBABTU!/BASCUS-97330AYBABTU!",
"BASCUS-97330AYBABTU!/bank0.bin", "BASCUS-97330AYBABTU!/bank1.bin",
"BASCUS-97330AYBABTU!/bank2.bin", "BASCUS-97330AYBABTU!/bank3.bin",
"BASCUS-97330AYBABTU!/bank4.bin", "BASCUS-97330AYBABTU!/bank5.bin",
"BASCUS-97330AYBABTU!/bank6.bin", "BASCUS-97330AYBABTU!/bank7.bin"};
const char* mc_get_filename_no_dir(GameVersion version, int ndx) {
const char** filenames = nullptr;
switch (version) {
@ -92,6 +100,9 @@ const char* mc_get_filename_no_dir(GameVersion version, int ndx) {
case GameVersion::Jak2:
filenames = filename_jak2;
break;
case GameVersion::Jak3:
filenames = filename_jak3;
break;
}
return filenames[ndx];
}
@ -173,10 +184,6 @@ 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);

View File

@ -1,479 +0,0 @@
//--------------------------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_9_prim_strip {
struct Cache {
void* display; // *display*
void* prim_work; // *prim-work*
void* stdcon; // *stdcon*
void* adgif_shader_texture_simple; // adgif-shader<-texture-simple!
void* dma_bucket_insert_tag; // dma-bucket-insert-tag
void* format; // format
void* lookup_texture_by_id; // lookup-texture-by-id
void* paused; // paused?
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
c->daddiu(sp, sp, -112); // daddiu sp, sp, -112
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sd(fp, 8, sp); // sd fp, 8(sp)
c->mov64(fp, t9); // or fp, t9, r0
c->sq(s1, 16, sp); // sq s1, 16(sp)
c->sq(s2, 32, sp); // sq s2, 32(sp)
c->sq(s3, 48, sp); // sq s3, 48(sp)
c->sq(s4, 64, sp); // sq s4, 64(sp)
c->sq(s5, 80, sp); // sq s5, 80(sp)
c->sq(gp, 96, sp); // sq gp, 96(sp)
c->mov64(gp, a0); // or gp, a0, r0
c->mov64(s1, a1); // or s1, a1, r0
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lw(v1, 0, v1); // lw v1, 0(v1)
c->dsll(v1, v1, 2); // dsll v1, v1, 2
c->load_symbol2(a0, cache.display); // lw a0, *display*(s7)
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->lwu(v1, 8, v1); // lwu v1, 8(v1)
c->lwu(v1, 36, v1); // lwu v1, 36(v1)
c->lhu(a0, 8, gp); // lhu a0, 8(gp)
c->daddiu(a0, a0, 79); // daddiu a0, a0, 79
c->addiu(a1, r0, 80); // addiu a1, r0, 80
// Unknown instr: divu a0, a1
// Unknown instr: mflo a0
c->gprs[a0].du64[0] = c->gprs[a0].du32[0] / c->gprs[a1].du32[0];
c->addiu(a1, r0, 144); // addiu a1, r0, 144
c->lhu(a2, 8, gp); // lhu a2, 8(gp)
c->multu3(a1, a1, a2); // multu3 a1, a1, a2
c->dsll(a0, a0, 7); // dsll a0, a0, 7
c->daddu(a0, a1, a0); // daddu a0, a1, a0
c->lwu(a1, 8, v1); // lwu a1, 8(v1)
c->lwu(v1, 4, v1); // lwu v1, 4(v1)
c->dsubu(v1, a1, v1); // dsubu v1, a1, v1
c->sltu(v1, a0, v1); // sltu v1, a0, v1
bc = c->sgpr64(v1) == 0; // beq v1, r0, L23
// nop // sll r0, r0, 0
if (bc) {goto block_28;} // branch non-likely
c->load_symbol2(t9, cache.lookup_texture_by_id); // lw t9, lookup-texture-by-id(s7)
c->lwu(a0, 12, gp); // lwu a0, 12(gp)
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(a1, v0); // or a1, v0, r0
c->load_symbol2(s3, cache.prim_work); // lw s3, *prim-work*(s7)
c->lwu(v1, 80, gp); // lwu v1, 80(gp)
c->dsll(v1, v1, 4); // dsll v1, v1, 4
c->daddiu(v1, v1, 236); // daddiu v1, v1, 236
c->daddu(s2, v1, s3); // daddu s2, v1, s3
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lw(v1, 0, v1); // lw v1, 0(v1)
c->dsll(v1, v1, 2); // dsll v1, v1, 2
c->load_symbol2(a0, cache.display); // lw a0, *display*(s7)
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->lwu(v1, 8, v1); // lwu v1, 8(v1)
c->lwu(s4, 36, v1); // lwu s4, 36(v1)
c->lwu(s5, 4, s4); // lwu s5, 4(s4)
c->lhu(v1, 8, gp); // lhu v1, 8(gp)
c->sw(v1, 224, s3); // sw v1, 224(s3)
c->daddiu(v1, gp, 92); // daddiu v1, gp, 92
c->sw(v1, 232, s3); // sw v1, 232(s3)
c->lwu(v1, 0, gp); // lwu v1, 0(gp)
c->andi(v1, v1, 1); // andi v1, v1, 1
bc = c->sgpr64(v1) == 0; // beq v1, r0, L8
// nop // sll r0, r0, 0
if (bc) {goto block_3;} // branch non-likely
c->addiu(v1, r0, 1); // addiu v1, r0, 1
//beq r0, r0, L9 // beq r0, r0, L9
// nop // sll r0, r0, 0
goto block_4; // branch always
block_3:
c->addiu(v1, r0, 0); // addiu v1, r0, 0
block_4:
c->lwu(a0, 0, gp); // lwu a0, 0(gp)
c->andi(a0, a0, 2); // andi a0, a0, 2
bc = c->sgpr64(a0) == 0; // beq a0, r0, L10
// nop // sll r0, r0, 0
if (bc) {goto block_6;} // branch non-likely
c->addiu(a0, r0, 1); // addiu a0, r0, 1
//beq r0, r0, L11 // beq r0, r0, L11
// nop // sll r0, r0, 0
goto block_7; // branch always
block_6:
c->addiu(a0, r0, 0); // addiu a0, r0, 0
block_7:
c->lwu(a2, 0, gp); // lwu a2, 0(gp)
c->andi(a2, a2, 4); // andi a2, a2, 4
bc = c->sgpr64(a2) == 0; // beq a2, r0, L12
// nop // sll r0, r0, 0
if (bc) {goto block_9;} // branch non-likely
c->addiu(a2, r0, 1); // addiu a2, r0, 1
//beq r0, r0, L13 // beq r0, r0, L13
// nop // sll r0, r0, 0
goto block_10; // branch always
block_9:
c->addiu(a2, r0, 0); // addiu a2, r0, 0
block_10:
c->lui(a3, 12288); // lui a3, 12288
c->ori(a3, a3, 16384); // ori a3, a3, 16384
c->dsll32(t0, a2, 31); // dsll32 t0, a2, 31
c->dsrl32(t0, t0, 26); // dsrl32 t0, t0, 26
c->ori(t0, t0, 13); // ori t0, t0, 13
c->dsll32(t1, a0, 31); // dsll32 t1, a0, 31
c->dsrl32(t1, t1, 27); // dsrl32 t1, t1, 27
c->or_(t0, t0, t1); // or t0, t0, t1
c->dsll32(t1, v1, 31); // dsll32 t1, v1, 31
c->dsrl32(t1, t1, 25); // dsrl32 t1, t1, 25
c->or_(t0, t0, t1); // or t0, t0, t1
c->dsll32(t0, t0, 21); // dsll32 t0, t0, 21
c->dsrl32(t0, t0, 6); // dsrl32 t0, t0, 6
c->or_(a3, a3, t0); // or a3, a3, t0
c->sw(a3, 80, s3); // sw a3, 80(s3)
c->lui(a3, 12288); // lui a3, 12288
c->ori(a3, a3, 16384); // ori a3, a3, 16384
c->dsll32(a2, a2, 31); // dsll32 a2, a2, 31
c->dsrl32(a2, a2, 26); // dsrl32 a2, a2, 26
c->ori(a2, a2, 12); // ori a2, a2, 12
c->dsll32(a0, a0, 31); // dsll32 a0, a0, 31
c->dsrl32(a0, a0, 27); // dsrl32 a0, a0, 27
c->or_(a0, a2, a0); // or a0, a2, a0
c->dsll32(v1, v1, 31); // dsll32 v1, v1, 31
c->dsrl32(v1, v1, 25); // dsrl32 v1, v1, 25
c->or_(v1, a0, v1); // or v1, a0, v1
c->dsll32(v1, v1, 21); // dsll32 v1, v1, 21
c->dsrl32(v1, v1, 6); // dsrl32 v1, v1, 6
c->or_(v1, a3, v1); // or v1, a3, v1
c->sw(v1, 84, s3); // sw v1, 84(s3)
bc = c->sgpr64(s7) == c->sgpr64(a1); // beq s7, a1, L19
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_20;} // branch non-likely
c->lwu(v1, 84, gp); // lwu v1, 84(gp)
c->lwu(a0, 88, gp); // lwu a0, 88(gp)
c->lwu(a0, 88, gp); // lwu a0, 88(gp)
c->daddiu(a0, a0, 12); // daddiu a0, a0, 12
c->addiu(a2, r0, 0); // addiu a2, r0, 0
//beq r0, r0, L15 // beq r0, r0, L15
// nop // sll r0, r0, 0
goto block_13; // branch always
block_12:
c->dsll(a3, a0, 4); // dsll a3, a0, 4
c->daddu(a3, v1, a3); // daddu a3, v1, a3
c->lq(a3, 4828, a3); // lq a3, 4828(a3)
c->dsll(t0, a2, 4); // dsll t0, a2, 4
c->daddu(t0, a1, t0); // daddu t0, a1, t0
c->lq(t0, 60, t0); // lq t0, 60(t0)
c->por(a3, a3, t0); // por a3, a3, t0
c->dsll(t0, a0, 4); // dsll t0, a0, 4
c->daddu(t0, v1, t0); // daddu t0, v1, t0
c->sq(a3, 4828, t0); // sq a3, 4828(t0)
c->daddiu(a2, a2, 1); // daddiu a2, a2, 1
block_13:
c->slti(a3, a2, 3); // slti a3, a2, 3
bc = c->sgpr64(a3) != 0; // bne a3, r0, L14
// nop // sll r0, r0, 0
if (bc) {goto block_12;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->load_symbol2(t9, cache.adgif_shader_texture_simple);// lw t9, adgif-shader<-texture-simple!(s7)
c->daddiu(a0, s3, 128); // daddiu a0, s3, 128
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->ld(v1, 60, gp); // ld v1, 60(gp)
c->sd(v1, 176, s3); // sd v1, 176(s3)
c->addiu(v1, r0, 8); // addiu v1, r0, 8
c->sd(v1, 184, s3); // sd v1, 184(s3)
c->ld(v1, 68, gp); // ld v1, 68(gp)
c->sd(v1, 192, s3); // sd v1, 192(s3)
c->addiu(v1, r0, 66); // addiu v1, r0, 66
c->sb(v1, 200, s3); // sb v1, 200(s3)
c->lqc2(vf1, 0, s1); // lqc2 vf1, 0(s1)
c->lqc2(vf2, 16, s1); // lqc2 vf2, 16(s1)
c->lqc2(vf3, 32, s1); // lqc2 vf3, 32(s1)
c->lqc2(vf4, 48, s1); // lqc2 vf4, 48(s1)
c->lqc2(vf5, 128, s3); // lqc2 vf5, 128(s3)
c->lqc2(vf6, 144, s3); // lqc2 vf6, 144(s3)
c->lqc2(vf7, 160, s3); // lqc2 vf7, 160(s3)
c->lqc2(vf8, 176, s3); // lqc2 vf8, 176(s3)
c->lqc2(vf9, 192, s3); // lqc2 vf9, 192(s3)
c->lqc2(vf10, 80, s3); // lqc2 vf10, 80(s3)
c->lqc2(vf11, 28, gp); // lqc2 vf11, 28(gp)
c->lqc2(vf12, 44, gp); // lqc2 vf12, 44(gp)
//beq r0, r0, L18 // beq r0, r0, L18
// nop // sll r0, r0, 0
goto block_18; // branch always
block_15:
c->addiu(v1, r0, 80); // addiu v1, r0, 80
c->lw(a0, 224, s3); // lw a0, 224(s3)
c->slt(a1, v1, a0); // slt a1, v1, a0
c->movz(v1, a0, a1); // movz v1, a0, a1
c->sw(v1, 228, s3); // sw v1, 228(s3)
c->lbu(v1, 1, s2); // lbu v1, 1(s2)
c->andi(v1, v1, 1); // andi v1, v1, 1
c->dsll(v1, v1, 4); // dsll v1, v1, 4
c->daddiu(v1, v1, 48); // daddiu v1, v1, 48
c->daddu(a0, v1, s3); // daddu a0, v1, s3
c->lw(v1, 4, s4); // lw v1, 4(s4)
c->lq(a0, 0, a0); // lq a0, 0(a0)
c->daddiu(a1, v1, 16); // daddiu a1, v1, 16
c->lw(v1, 228, s3); // lw v1, 228(s3)
c->sq(a0, -16, a1); // sq a0, -16(a1)
c->sqc2(vf1, 0, a1); // sqc2 vf1, 0(a1)
c->sqc2(vf2, 16, a1); // sqc2 vf2, 16(a1)
c->sqc2(vf3, 32, a1); // sqc2 vf3, 32(a1)
c->sqc2(vf4, 48, a1); // sqc2 vf4, 48(a1)
c->sqc2(vf10, 64, a1); // sqc2 vf10, 64(a1)
c->sqc2(vf11, 80, a1); // sqc2 vf11, 80(a1)
c->sqc2(vf12, 96, a1); // sqc2 vf12, 96(a1)
c->sw(v1, 92, a1); // sw v1, 92(a1)
c->sqc2(vf5, 112, a1); // sqc2 vf5, 112(a1)
c->sqc2(vf6, 128, a1); // sqc2 vf6, 128(a1)
c->sqc2(vf7, 144, a1); // sqc2 vf7, 144(a1)
c->sqc2(vf8, 160, a1); // sqc2 vf8, 160(a1)
c->sqc2(vf9, 176, a1); // sqc2 vf9, 176(a1)
c->ori(a0, v1, 32768); // ori a0, v1, 32768
c->sw(a0, 140, a1); // sw a0, 140(a1)
c->daddiu(a0, a1, 192); // daddiu a0, a1, 192
c->sw(a0, 4, s4); // sw a0, 4(s4)
c->lbu(a0, 0, s2); // lbu a0, 0(s2)
c->addiu(a1, r0, 3); // addiu a1, r0, 3
// Unknown instr: divu a0, a1
// Unknown instr: mfhi a0
c->gprs[a0].du64[0] = c->gprs[a0].du32[0] % c->gprs[a1].du32[0];
c->dsll(a0, a0, 4); // dsll a0, a0, 4
c->daddu(a0, r0, a0); // daddu a0, r0, a0
c->daddu(a0, a0, s3); // daddu a0, a0, s3
c->addiu(a1, r0, 3); // addiu a1, r0, 3
c->mult3(a1, a1, v1); // mult3 a1, a1, v1
c->ld(a2, 0, a0); // ld a2, 0(a0)
c->lui(a3, -1); // lui a3, -1
c->and_(a2, a2, a3); // and a2, a2, a3
c->dsll32(a3, a1, 16); // dsll32 a3, a1, 16
c->dsrl32(a3, a3, 16); // dsrl32 a3, a3, 16
c->or_(a2, a2, a3); // or a2, a2, a3
c->sd(a2, 0, a0); // sd a2, 0(a0)
c->lwu(a2, 12, a0); // lwu a2, 12(a0)
c->lui(a3, -256); // lui a3, -256
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a2, a2, a3); // and a2, a2, a3
c->dsll32(a1, a1, 24); // dsll32 a1, a1, 24
c->dsrl32(a1, a1, 8); // dsrl32 a1, a1, 8
c->or_(a1, a2, a1); // or a1, a2, a1
c->sw(a1, 12, a0); // sw a1, 12(a0)
c->lw(a2, 4, s4); // lw a2, 4(s4)
c->lq(a3, 0, a0); // lq a3, 0(a0)
c->lq(a0, 208, s3); // lq a0, 208(s3)
c->lw(a1, 232, s3); // lw a1, 232(s3)
// nop // sll r0, r0, 0
c->sq(a3, 0, a2); // sq a3, 0(a2)
c->daddiu(a2, a2, 16); // daddiu a2, a2, 16
c->sw(a2, 4, s4); // sw a2, 4(s4)
// nop // sll r0, r0, 0
block_16:
// nop // sll r0, r0, 0
c->lw(t0, 12, a1); // lw t0, 12(a1)
// nop // sll r0, r0, 0
c->lw(a3, 44, a1); // lw a3, 44(a1)
c->pextlb(t0, r0, t0); // pextlb t0, r0, t0
c->lqc2(vf15, 0, a1); // lqc2 vf15, 0(a1)
c->pextlh(t0, r0, t0); // pextlh t0, r0, t0
c->lqc2(vf16, 32, a1); // lqc2 vf16, 32(a1)
c->pextlb(a3, r0, a3); // pextlb a3, r0, a3
c->lqc2(vf13, 16, a1); // lqc2 vf13, 16(a1)
c->pextlh(a3, r0, a3); // pextlh a3, r0, a3
c->lqc2(vf14, 48, a1); // lqc2 vf14, 48(a1)
c->vftoi12(DEST::xyzw, vf15, vf15); // vftoi12.xyzw vf15, vf15
c->sq(t0, 16, a2); // sq t0, 16(a2)
c->vftoi12(DEST::xyzw, vf16, vf16); // vftoi12.xyzw vf16, vf16
c->sq(a3, 64, a2); // sq a3, 64(a2)
// nop // sll r0, r0, 0
c->lw(t0, 8, a1); // lw t0, 8(a1)
// nop // sll r0, r0, 0
c->lw(a3, 40, a1); // lw a3, 40(a1)
c->daddiu(a1, a1, 64); // daddiu a1, a1, 64
c->mov128_gpr_vf(t2, vf15); // qmfc2.i t2, vf15
c->daddiu(v1, v1, -2); // daddiu v1, v1, -2
c->mov128_gpr_vf(t1, vf16); // qmfc2.i t1, vf16
c->pand(t2, t2, a0); // pand t2, t2, a0
c->sqc2(vf13, 32, a2); // sqc2 vf13, 32(a2)
c->pand(t1, t1, a0); // pand t1, t1, a0
c->sqc2(vf14, 80, a2); // sqc2 vf14, 80(a2)
c->or_(t0, t2, t0); // or t0, t2, t0
// nop // sll r0, r0, 0
c->or_(a3, t1, a3); // or a3, t1, a3
// nop // sll r0, r0, 0
c->sq(t0, 0, a2); // sq t0, 0(a2)
c->daddiu(a2, a2, 96); // daddiu a2, a2, 96
bc = ((s64)c->sgpr64(v1)) > 0; // bgtz v1, L17
c->sq(a3, -48, a2); // sq a3, -48(a2)
if (bc) {goto block_16;} // branch non-likely
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->addiu(a0, r0, 48); // addiu a0, r0, 48
c->lw(a1, 228, s3); // lw a1, 228(s3)
c->mult3(a0, a0, a1); // mult3 a0, a0, a1
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->sw(v1, 4, s4); // sw v1, 4(s4)
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->lq(a0, 96, s3); // lq a0, 96(s3)
c->sq(a0, 0, v1); // sq a0, 0(v1)
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->daddiu(v1, v1, 16); // daddiu v1, v1, 16
c->sw(v1, 4, s4); // sw v1, 4(s4)
c->lw(v1, 224, s3); // lw v1, 224(s3)
c->daddiu(v1, v1, -78); // daddiu v1, v1, -78
c->sw(v1, 224, s3); // sw v1, 224(s3)
c->lwu(v1, 232, s3); // lwu v1, 232(s3)
c->daddiu(v1, v1, 2496); // daddiu v1, v1, 2496
c->sw(v1, 232, s3); // sw v1, 232(s3)
c->lbu(v1, 0, s2); // lbu v1, 0(s2)
c->daddiu(v1, v1, 1); // daddiu v1, v1, 1
c->sb(v1, 0, s2); // sb v1, 0(s2)
c->lbu(v1, 1, s2); // lbu v1, 1(s2)
c->daddiu(v1, v1, 1); // daddiu v1, v1, 1
c->sb(v1, 1, s2); // sb v1, 1(s2)
block_18:
c->addiu(v1, r0, 2); // addiu v1, r0, 2
c->lw(a0, 224, s3); // lw a0, 224(s3)
c->slt(v1, v1, a0); // slt v1, v1, a0
bc = c->sgpr64(v1) != 0; // bne v1, r0, L16
// nop // sll r0, r0, 0
if (bc) {goto block_15;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_20:
c->load_symbol2(t9, cache.paused); // lw t9, paused?(s7)
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); // bne s7, v0, L21
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_25;} // branch non-likely
c->lwu(v1, 0, gp); // lwu v1, 0(gp)
c->andi(v1, v1, 8); // andi v1, v1, 8
bc = c->sgpr64(v1) == 0; // beq v1, r0, L21
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_25;} // branch non-likely
c->lwu(v1, 0, gp); // lwu v1, 0(gp)
c->andi(v1, v1, 16); // andi v1, v1, 16
bc = c->sgpr64(v1) != 0; // bne v1, r0, L20
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_24;} // branch non-likely
c->sh(r0, 8, gp); // sh r0, 8(gp)
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
block_24:
c->addiu(v1, r0, -17); // addiu v1, r0, -17
c->lwu(a0, 0, gp); // lwu a0, 0(gp)
c->and_(v1, v1, a0); // and v1, v1, a0
c->sw(v1, 0, gp); // sw v1, 0(gp)
block_25:
c->lwu(a3, 4, s4); // lwu a3, 4(s4)
bc = c->sgpr64(s5) == c->sgpr64(a3); // beq s5, a3, L22
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_27;} // branch non-likely
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->lui(a0, 8192); // lui a0, 8192
c->sd(a0, 0, v1); // sd a0, 0(v1)
c->sw(r0, 8, v1); // sw r0, 8(v1)
c->sw(r0, 12, v1); // sw r0, 12(v1)
c->daddiu(v1, v1, 16); // daddiu v1, v1, 16
c->sw(v1, 4, s4); // sw v1, 4(s4)
c->load_symbol2(t9, cache.dma_bucket_insert_tag); // lw t9, dma-bucket-insert-tag(s7)
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lw(v1, 0, v1); // lw v1, 0(v1)
c->dsll(v1, v1, 2); // dsll v1, v1, 2
c->load_symbol2(a0, cache.display); // lw a0, *display*(s7)
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->lwu(v1, 8, v1); // lwu v1, 8(v1)
c->lwu(a0, 40, v1); // lwu a0, 40(v1)
c->lw(a1, 76, gp); // lw a1, 76(gp)
c->mov64(a2, s5); // or a2, s5, r0
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_27:
//beq r0, r0, L24 // beq r0, r0, L24
// nop // sll r0, r0, 0
goto block_29; // branch always
block_28:
c->load_symbol2(t9, cache.format); // lw t9, format(s7)
c->load_symbol2(a0, cache.stdcon); // lw a0, *stdcon*(s7)
// daddiu a1, fp, L29 // daddiu a1, fp, L29
ASSERT_NOT_REACHED(); // ran out of memory error print.
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_29:
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->ld(fp, 8, sp); // ld fp, 8(sp)
c->lq(gp, 96, sp); // lq gp, 96(sp)
c->lq(s5, 80, sp); // lq s5, 80(sp)
c->lq(s4, 64, sp); // lq s4, 64(sp)
c->lq(s3, 48, sp); // lq s3, 48(sp)
c->lq(s2, 32, sp); // lq s2, 32(sp)
c->lq(s1, 16, sp); // lq s1, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 112); // daddiu sp, sp, 112
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.display = intern_from_c(-1, 0, "*display*").c();
cache.prim_work = intern_from_c(-1, 0, "*prim-work*").c();
cache.stdcon = intern_from_c(-1, 0, "*stdcon*").c();
cache.adgif_shader_texture_simple = intern_from_c(-1, 0, "adgif-shader<-texture-simple!").c();
cache.dma_bucket_insert_tag = intern_from_c(-1, 0, "dma-bucket-insert-tag").c();
cache.format = intern_from_c(-1, 0, "format").c();
cache.lookup_texture_by_id = intern_from_c(-1, 0, "lookup-texture-by-id").c();
cache.paused = intern_from_c(-1, 0, "paused?").c();
gLinkedFunctionTable.reg("(method 9 prim-strip)", execute, 256);
}
} // namespace method_9_prim_strip
} // namespace Mips2C
// add method_9_prim_strip::link to the link callback table for the object file.
// FWD DEC:

View File

@ -281,7 +281,6 @@ namespace generic_no_light_proc { extern void link(); }
namespace method_9_font_work { extern void link(); }
namespace draw_string_asm { extern void link(); }
namespace get_string_length { extern void link(); }
namespace method_9_prim_strip { extern void link(); }
namespace adgif_shader_texture_with_update { extern void link(); }
namespace moving_sphere_triangle_intersect { extern void link(); }
namespace collide_do_primitives { extern void link(); }
@ -566,7 +565,6 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
{"texture", {jak3::adgif_shader_texture_with_update::link}},
{"collide-func",
{jak3::moving_sphere_triangle_intersect::link, jak3::collide_do_primitives::link}},
{"prim", {jak3::method_9_prim_strip::link}},
{"joint", {jak3::cspace_parented_transformq_joint::link}},
{"foreground",
{jak3::foreground_check_longest_edge_asm::link, jak3::foreground_generic_merc::link,

View File

@ -0,0 +1,18 @@
#pragma once
#include "game/overlord/jak3/iso_structs.h"
#include "game/overlord/jak3/overlord.h"
namespace jak3 {
class CBaseFile {
public:
CBaseFile(const ISOFileDef*);
virtual EIsoStatus BeginRead(ISOBuffer*) = 0;
virtual EIsoStatus SyncRead() = 0;
virtual void Close() = 0;
/* unk return values */
virtual void Unk1() = 0;
virtual void Unk2() = 0;
};
} // namespace jak3

View File

@ -0,0 +1,24 @@
#pragma once
#include "game/overlord/jak3/basefile.h"
#include "game/overlord/jak3/iso_structs.h"
namespace jak3 {
class CBaseFileSystem {
public:
virtual int Init() = 0;
virtual void PollDrive() = 0;
virtual const ISOFileDef* Find(const char* name) = 0;
virtual const ISOFileDef* FindIN(const char* name) = 0;
virtual int GetLength(const ISOFileDef* def) = 0;
virtual CBaseFile* Open(const ISOFileDef* def, int offset, EFileComp mode) = 0;
virtual CBaseFile* OpenWad(const ISOFileDef* def, int offset) = 0;
virtual VagDirEntryJak3* FindVagFile(const char* name) = 0;
u8* CheckForPageBoundaryCrossing();
private:
ISOBuffer m_Buffer;
};
} // namespace jak3

366
game/overlord/jak3/iso.cpp Normal file
View File

@ -0,0 +1,366 @@
#include "iso.h"
#include <cstring>
#include "common/log/log.h"
#include "common/util/Assert.h"
#include "game/common/dgo_rpc_types.h"
#include "game/overlord/jak3/basefilesystem.h"
#include "game/overlord/jak3/iso_api.h"
#include "game/overlord/jak3/iso_fake.h"
#include "game/overlord/jak3/iso_queue.h"
#include "game/overlord/jak3/stream.h"
namespace jak3 {
using namespace iop;
CBaseFileSystem* g_pFileSystem;
int g_nISOThreadID;
int g_nDGOThreadID;
int g_nSTRThreadID;
int g_nPlayThreadID;
int g_nISOMbx;
VagDirJak3 g_VagDir;
char g_szCurrentMusicName[16];
char g_szTargetMusicName[16];
static int s_nISOInitFlag;
static ISO_LoadDGO s_LoadDGO;
static int s_nSyncMbx;
static MsgPacket s_MsgPacket_NotOnStackSync[2];
static RPC_Dgo_Cmd s_aISO_RPCBuf[1];
static int s_nDGOMbx;
static u32 DGOThread();
u32 ISOThread();
int NullCallback(ISO_Hdr* msg);
int CopyDataToEE(ISO_Hdr*);
int CopyDataToIOP(ISO_Hdr*);
int CopyDataTo989snd(ISO_Hdr*);
int CopyData(ISO_LoadSingle*, int);
/* COMPLETE */
void InitDriver() {
if (g_pFileSystem->Init() == 0) {
s_nISOInitFlag = 0;
}
SendMbx(s_nSyncMbx, &s_MsgPacket_NotOnStackSync[0]);
}
/* TODO unfinished */
static int LookMbx() {
MsgPacket* pkt;
int ret = PollMbx(&pkt, s_nSyncMbx);
if (ret != KE_MBOX_NOMSG) {
// FIXME
}
return ret != KE_MBOX_NOMSG;
}
/* COMPLETE */
static void WaitMbx(int mbx) {
MsgPacket* pkt;
ReceiveMbx(&pkt, mbx);
}
/* TODO unfinished */
int InitISOFS(const char* fs_mode, const char* loading_sceeen) {
const ISOFileDef* fd;
ThreadParam thp;
MbxParam mbx;
memset(&s_LoadDGO, 0, sizeof(s_LoadDGO));
/* TODO INIT s_LoadDgo fields */
s_nISOInitFlag = 1;
g_pFileSystem = &g_FakeISOCDFileSystem;
/* Lets not bother error checking the Create* calls */
mbx.attr = 0;
mbx.option = 0;
g_nISOMbx = CreateMbx(&mbx);
mbx.attr = 0;
mbx.option = 0;
s_nDGOMbx = CreateMbx(&mbx);
mbx.attr = 0;
mbx.option = 0;
s_nSyncMbx = CreateMbx(&mbx);
thp.attr = TH_C;
thp.entry = ISOThread;
thp.initPriority = 0x37;
thp.option = 0;
thp.stackSize = 0x1100;
g_nISOThreadID = CreateThread(&thp);
thp.attr = TH_C;
thp.entry = DGOThread;
thp.initPriority = 0x38;
thp.option = 0;
thp.stackSize = 0x900;
g_nDGOThreadID = CreateThread(&thp);
thp.attr = TH_C;
thp.entry = STRThread;
thp.initPriority = 0x39;
thp.option = 0;
thp.stackSize = 0x900;
g_nSTRThreadID = CreateThread(&thp);
thp.attr = TH_C;
thp.entry = PLAYThread;
thp.initPriority = 0x35;
thp.option = 0;
thp.stackSize = 0x900;
g_nPlayThreadID = CreateThread(&thp);
StartThread(g_nISOThreadID, 0);
StartThread(g_nDGOThreadID, 0);
StartThread(g_nSTRThreadID, 0);
StartThread(g_nPlayThreadID, 0);
WaitMbx(s_nSyncMbx);
/* Originally VAGDIR is only loaded for the CD filesystem
* Presumably there was different mechanism for fakeiso,
* but we need it regardless */
fd = FindIsoFile("VAGDIR.AYB");
LoadISOFileToIOP(fd, &g_VagDir, sizeof(g_VagDir));
/* Skip getting the loading screen thing? */
return s_nISOInitFlag;
}
const ISOFileDef* FindIsoFile(const char* name) {
return g_pFileSystem->Find(name);
}
u32 ISOThread() {
ISO_Msg* msg;
g_szCurrentMusicName[0] = '\0';
g_szTargetMusicName[0] = '\0';
InitBuffers();
// InitVagCmds();
InitDriver();
while (true) {
int res = PollMbx((MsgPacket**)&msg, g_nISOMbx);
if (res == KE_OK) {
msg->SetActive(false);
msg->SetUnk1(false);
msg->SetUnk2(false);
msg->file = nullptr;
msg->callback = NullCallback;
/* LoadSingle messages */
if (msg->msg_kind >= LOAD_TO_EE_CMD_ID && msg->msg_kind <= LOAD_TO_989SND) {
auto* ls = static_cast<ISO_LoadSingle*>(msg);
int pri = 0;
if (ls->unk40 == 2) {
pri = 2;
}
if (ls->unk40 == 10) {
pri = 4;
}
if (!QueueMessage(msg, pri)) {
break;
}
msg->file = nullptr;
if (msg->msg_kind == LOAD_TO_EE_OFFSET_CMD_ID) {
msg->file = g_pFileSystem->Open(ls->fd, ls->offset, EFileComp::MODE1);
} else if (msg->msg_kind == LOAD_TO_989SND) {
char name[16] = {0};
if (ls->filename) {
strncpy(name, ls->filename, 12);
name[8] = 0;
strcat(name, ".sbk");
auto fd = g_pFileSystem->Find(name);
if (fd) {
msg->file = g_pFileSystem->Open(ls->fd, -1, EFileComp::MODE1);
}
}
} else {
msg->file = g_pFileSystem->Open(ls->fd, -1, EFileComp::MODE1);
}
if (!msg->file) {
msg->m_nStatus = 8;
UnqueueMessage(msg);
ReturnMessage(msg);
break;
}
ls->unk44 = ls->address;
ls->unk48 = 0;
ls->length_to_copy = g_pFileSystem->GetLength(ls->fd);
if (msg->msg_kind == LOAD_TO_989SND) {
ls->length = ls->length_to_copy;
} else {
if (!ls->length_to_copy || ls->length < ls->length_to_copy) {
ls->length_to_copy = ls->length;
}
}
switch (msg->msg_kind) {
case LOAD_TO_EE_CMD_ID:
msg->callback = CopyDataToEE;
break;
case LOAD_TO_IOP_CMD_ID:
msg->callback = CopyDataToIOP;
break;
case LOAD_TO_EE_OFFSET_CMD_ID:
msg->callback = CopyDataToEE;
break;
case LOAD_TO_989SND:
msg->callback = CopyDataTo989snd;
break;
default:
ASSERT_NOT_REACHED();
}
msg->m_nStatus = 2;
msg->SetActive(true);
} else if (msg->msg_kind == 0xADEADBEE) {
ReturnMessage(msg);
ExitThread();
}
}
DelayThread(4000);
}
return 0;
}
static void ISO_LoadDGO(RPC_Dgo_Cmd* msg);
static void ISO_LoadNextDGO(RPC_Dgo_Cmd* msg);
static void ISO_CancelDGO(RPC_Dgo_Cmd* msg);
static void* RPC_DGO(u32 fno, void* data, int size) {
auto* msg = static_cast<RPC_Dgo_Cmd*>(data);
switch (fno) {
case 0:
ISO_LoadDGO(msg);
break;
case 1:
ISO_LoadNextDGO(msg);
break;
case 2:
ISO_CancelDGO(msg);
break;
default:
msg->result = 1;
break;
}
return data;
}
static u32 DGOThread() {
sceSifQueueData dq;
sceSifServeData serve;
CpuDisableIntr();
sceSifInitRpc(0);
sceSifSetRpcQueue(&dq, GetThreadId());
sceSifRegisterRpc(&serve, 0xfab3, RPC_DGO, s_aISO_RPCBuf, sizeof(s_aISO_RPCBuf), nullptr, nullptr,
&dq);
CpuEnableIntr();
sceSifRpcLoop(&dq);
return 0;
}
static void ISO_LoadDGO(RPC_Dgo_Cmd* msg) {
auto* def = g_pFileSystem->Find(msg->name);
if (def == nullptr) {
msg->result = 1;
return;
}
ASSERT_NOT_REACHED();
msg->buffer1 = msg->buffer_heap_top;
msg->result = 0;
}
static void ISO_LoadNextDGO(RPC_Dgo_Cmd* msg) {
ASSERT_NOT_REACHED();
}
static void ISO_CancelDGO(RPC_Dgo_Cmd* msg) {
ASSERT_NOT_REACHED();
}
/* COMPLETE */
const ISOFileDef* FindISOFile(char* name) {
return g_pFileSystem->Find(name);
}
/* COMPLETE */
s32 GetISOFileLength(const ISOFileDef* fd) {
return g_pFileSystem->GetLength(fd);
}
int CopyDataToEE(ISO_Hdr* msg) {
return CopyData((ISO_LoadSingle*)msg, 0);
}
int CopyDataToIOP(ISO_Hdr* msg) {
return CopyData((ISO_LoadSingle*)msg, 1);
}
int CopyDataTo989snd(ISO_Hdr* msg) {
return CopyData((ISO_LoadSingle*)msg, 2);
}
int CopyData(ISO_LoadSingle*, int) {
ASSERT_NOT_REACHED();
return 0;
}
int NullCallback(ISO_Hdr* msg) {
return 7;
}
void ISO_Hdr::SetActive(bool b) {
m_bActive = b;
}
void ISO_Hdr::SetUnk1(bool b) {
unk1 = b;
}
void ISO_Hdr::SetUnk2(bool b) {
unk2 = b;
}
void ISOBuffer::AdjustDataLength(int size) {
int state;
CpuSuspendIntr(&state);
decompressed_size -= size;
CpuResumeIntr(state);
}
void ISOBuffer::AdvanceCurrentData(int size) {
int state;
CpuSuspendIntr(&state);
decomp_buffer += size;
decompressed_size -= size;
CpuResumeIntr(state);
}
} // namespace jak3

59
game/overlord/jak3/iso.h Normal file
View File

@ -0,0 +1,59 @@
#pragma once
#include "game/overlord/jak3/basefile.h"
#include "game/sce/iop.h"
namespace jak3 {
constexpr int LOAD_TO_EE_CMD_ID = 0x100; // command to load file to ee
constexpr int LOAD_TO_IOP_CMD_ID = 0x101; // command to load to iop
constexpr int LOAD_TO_EE_OFFSET_CMD_ID = 0x102; // command to load file to ee with offset.
constexpr int LOAD_TO_989SND = 0x103;
constexpr int PAUSE_VAG_STREAM = 0x403; // Command to pause a vag stream
constexpr int CONTINUE_VAG_STREAM = 0x404; // Command to continue a vag stream
constexpr int SET_DIALOG_VOLUME = 0x406; // Command to set the volume of vag playback
extern int g_nISOMbx;
struct ISO_Hdr {
iop::MsgPacket m_Pkt;
int m_nStatus;
bool m_bActive;
bool unk1;
bool unk2;
void SetActive(bool b);
void SetUnk1(bool b);
void SetUnk2(bool b);
};
struct ISO_Msg : ISO_Hdr {
u32 msg_kind;
int mbx_to_reply;
int thread_id;
int (*callback)(ISO_Hdr*);
CBaseFile* file;
u32 priority;
};
struct ISO_LoadDGO : ISO_Msg {
ISOFileDef* fd;
};
struct ISO_LoadSingle : ISO_Msg {
const ISOFileDef* fd;
void* address;
u32 length;
u32 length_to_copy;
u32 offset;
char* filename;
u32 unk40;
void* unk44;
u32 unk48;
u32 unk4c;
};
int InitISOFS(const char* fs_mode, const char* loading_sceeen);
const ISOFileDef* FindIsoFile(const char* name);
} // namespace jak3

View File

@ -0,0 +1,31 @@
#include "iso_api.h"
#include "common/common_types.h"
#include "game/overlord/jak3/iso.h"
#include "game/overlord/jak3/iso_structs.h"
namespace jak3 {
using namespace iop;
u32 LoadISOFileToIOP(const ISOFileDef* file, void* addr, u32 length) {
ISO_LoadSingle msg;
msg.msg_kind = 0x101;
msg.mbx_to_reply = 0;
msg.thread_id = GetThreadId();
msg.fd = file;
msg.address = addr;
msg.length = length;
SendMbx(g_nISOMbx, &msg);
SleepThread();
u32 ret = 0;
if (msg.m_nStatus == 0) {
ret = msg.length_to_copy;
}
return ret;
}
} // namespace jak3

View File

@ -0,0 +1,12 @@
#ifndef ISO_API_H_
#define ISO_API_H_
#include "common/common_types.h"
#include "game/overlord/jak3/iso_structs.h"
namespace jak3 {
u32 LoadISOFileToIOP(const ISOFileDef* file, void* addr, u32 length);
}
#endif // ISO_API_H_

View File

@ -0,0 +1,36 @@
#include "iso_fake.h"
namespace jak3 {
CFakeISOCDFileSystem g_FakeISOCDFileSystem;
int CFakeISOCDFileSystem::Init() {
return 0;
}
void CFakeISOCDFileSystem::PollDrive() {}
const ISOFileDef* CFakeISOCDFileSystem::Find(const char* name) {
return nullptr;
}
const ISOFileDef* CFakeISOCDFileSystem::FindIN(const char* name) {
return nullptr;
}
int CFakeISOCDFileSystem::GetLength(const ISOFileDef* def) {
return 0;
}
CBaseFile* CFakeISOCDFileSystem::Open(const ISOFileDef* def, int offset, EFileComp mode) {
return nullptr;
}
CBaseFile* CFakeISOCDFileSystem::OpenWad(const ISOFileDef* def, int offset) {
return nullptr;
}
VagDirEntryJak3* CFakeISOCDFileSystem::FindVagFile(const char* name) {
return nullptr;
}
} // namespace jak3

View File

@ -0,0 +1,35 @@
#ifndef ISO_FAKE_H_
#define ISO_FAKE_H_
#include "basefile.h"
#include "basefilesystem.h"
#include "game/overlord/jak3/iso.h"
namespace jak3 {
class CFakeISOCDFileSystem : public CBaseFileSystem {
int Init() override;
void PollDrive() override;
const ISOFileDef* Find(const char* name) override;
const ISOFileDef* FindIN(const char* name) override;
int GetLength(const ISOFileDef* def) override;
CBaseFile* Open(const ISOFileDef* def, int offset, EFileComp mode) override;
CBaseFile* OpenWad(const ISOFileDef* def, int offset) override;
VagDirEntryJak3* FindVagFile(const char* name) override;
};
class CFakeISOCDFile : public CBaseFile {
EIsoStatus BeginRead(ISOBuffer*) override;
EIsoStatus SyncRead() override;
void Close() override;
/* unk return values */
void Unk1() override;
void Unk2() override;
};
extern CFakeISOCDFileSystem g_FakeISOCDFileSystem;
} // namespace jak3
#endif // ISO_FAKE_H_

View File

@ -0,0 +1,78 @@
#include "iso_queue.h"
#include "common/log/log.h"
#include "common/util/Assert.h"
#include "game/overlord/jak3/pagemanager.h"
#include "game/overlord/jak3/util.h"
#include "game/sce/iop.h"
namespace jak3 {
using namespace iop;
constexpr int N_VAG_CMDS = 6;
u32 g_auStreamSRAM[N_VAG_CMDS];
u32 g_auTrapSRAM[N_VAG_CMDS];
int g_nPriQueueSema;
int g_nISOSema;
PriStackEntry gPriStack[N_PRIORITIES];
CPageManager g_PageManager;
void InitBuffers() {
SemaParam semap;
semap.init_count = 1;
semap.max_count = 1;
semap.attr = 0;
semap.option = 0;
g_nPriQueueSema = CreateSema(&semap);
g_PageManager.Initialize();
semap.init_count = 1;
semap.max_count = 1;
semap.attr = SA_THPRI;
semap.option = 0;
g_nISOSema = CreateSema(&semap);
}
bool QueueMessage(ISO_Msg* msg, int priority) {
msg->m_nStatus = 2;
msg->priority = priority;
int level = priority == 5;
{
ScopedLock l(g_nPriQueueSema);
if (gPriStack[level].count != 8) {
gPriStack[level].entries[gPriStack[level].count] = msg;
gPriStack[level].count++;
return true;
}
}
msg->m_nStatus = 4;
ReturnMessage(msg);
return false;
}
void UnqueueMessage(ISO_Msg* msg) {}
void ReturnMessage(ISO_Msg* msg) {
if (msg->mbx_to_reply) {
SendMbx(msg->mbx_to_reply, msg);
} else if (msg->thread_id) {
WakeupThread(msg->thread_id);
} else {
// FreeVAGCommand(msg);
ASSERT_NOT_REACHED_MSG("unimplemented");
}
}
} // namespace jak3

View File

@ -0,0 +1,21 @@
#ifndef ISO_QUEUE_H_
#define ISO_QUEUE_H_
#include "game/overlord/jak3/iso.h"
namespace jak3 {
constexpr int N_PRIORITIES = 2;
constexpr int PRI_STACK_LENGTH = 8;
struct PriStackEntry {
ISO_Msg* entries[PRI_STACK_LENGTH];
int count;
};
void InitBuffers();
bool QueueMessage(ISO_Msg* msg, int priority);
void ReturnMessage(ISO_Msg* msg);
void UnqueueMessage(ISO_Msg* msg);
} // namespace jak3
#endif // ISO_QUEUE_H_

View File

@ -0,0 +1,50 @@
#pragma once
#include "common/common_types.h"
#include "game/overlord/jak3/pagemanager.h"
namespace jak3 {
/* TODO check values */
enum class EFileComp { MODE0, MODE1, KNOWN_NOT_BLZO };
struct ISOBuffer {
public:
void AdjustDataLength(int);
void AdvanceCurrentData(int);
void SetDataLength(int length) { m_nDataLength = length; }
int GetDataLength() { return m_nDataLength; }
private:
CPageManager::CPageList* m_pActivePages;
u8* decomp_buffer;
int decompressed_size;
int m_nDataLength;
};
struct VagDirEntryJak3 {
union {
u64 data;
struct {
u64 name : 42;
bool stereo : 1;
bool international : 1;
u8 param : 4;
u64 offset : 16;
};
};
};
static constexpr int MAX_VAGDIR_ENTRIES = 4096;
struct VagDirJak3 {
u32 id[2];
u32 version;
u32 count;
VagDirEntryJak3 entries[MAX_VAGDIR_ENTRIES];
};
struct VagDirEntry {};
struct ISOFileDef {};
} // namespace jak3

View File

@ -0,0 +1,30 @@
#include "overlord.h"
#include <cstdint>
#include <cstdio>
#include <cstring>
namespace jak3 {
extern int start_overlord(int, const char* const*);
void Panic() {
printf(
"IOP: *** Overlord panic at 0x%08lx (rel. address 0x%08lx)\n"
"IOP: *** Check mapfile to determine function name.\n"
"IOP: *** Thread halted.\n",
(intptr_t)__builtin_return_address(0),
(intptr_t)__builtin_return_address(0) - (intptr_t)start_overlord);
while (true)
;
}
char* strncpyz(char* dst, const char* src, size_t sz) {
if (sz) {
strncpy(dst, src, sz);
dst[sz - 1] = '\0';
}
return dst;
}
} // namespace jak3

View File

@ -0,0 +1,22 @@
#pragma once
#include <cstddef>
#include "common/common_types.h"
namespace jak3 {
struct Vec3 {
s32 x, y, z;
};
enum class EIsoStatus { Unk };
int start_overlord_wrapper(int argc, const char* const* argv, bool* signal);
void Panic();
char* strncpyz(char* dst, const char* src, size_t sz);
void InitSound();
int VBlank_Initialize();
} // namespace jak3

View File

@ -0,0 +1,191 @@
#include "pagemanager.h"
#include <cstring>
#include "common/util/Assert.h"
#include "game/sce/iop.h"
namespace jak3 {
using namespace iop;
static constexpr u32 PAGE_SIZE = 0x8010;
static constexpr u32 NUM_PAGES = 29;
CPageManager::CPage::CPage(u8* start, u8* end, int page_id) {
m_pNextPage = nullptr;
m_uPageBit = 1 << (page_id & 0x1f);
m_nPageState = 0;
m_pData = start;
m_pDataEnd = end;
m_nPageRefCount = 0;
m_nPageID = page_id;
m_nPageDmaRefCount = 0;
m_nAllocState = 0;
m_nPageState = 0;
}
int CPageManager::CPage::AddRef() {
int state, ret = -1;
CpuSuspendIntr(&state);
if (m_nAllocState == 1 && m_pPageList != nullptr) {
m_pPageList->m_nListRefCount++;
m_nPageRefCount++;
ret = m_nPageRefCount;
}
CpuResumeIntr(state);
return ret;
}
int CPageManager::CPage::ReleaseRef() {
int state, ret = -1;
CpuSuspendIntr(&state);
if (m_nAllocState == 1 && m_pPageList != nullptr) {
m_pPageList->m_nListRefCount--;
m_nPageRefCount--;
ret = m_nPageRefCount;
}
CpuResumeIntr(state);
return ret;
}
int CPageManager::CPage::AddDmaRef() {
int state, ret = -1;
CpuSuspendIntr(&state);
if (m_nAllocState == 1 && m_pPageList != nullptr) {
m_pPageList->m_nListDmaRefCount++;
m_nPageDmaRefCount++;
ret = m_nPageDmaRefCount;
}
CpuResumeIntr(state);
return ret;
}
int CPageManager::CPage::ReleaseDmaRef() {
int state, ret = -1;
CpuSuspendIntr(&state);
if (m_nAllocState == 1 && m_pPageList != nullptr) {
m_pPageList->m_nListDmaRefCount--;
m_nPageDmaRefCount--;
ret = m_nPageDmaRefCount;
}
CpuResumeIntr(state);
return ret;
}
void CPageManager::CPage::FromPagesCopy(u8* pInPageData, u8* pDest, int nNumBytes) {
int nInputPageLengthLeft;
CPage* page = this;
if (nNumBytes <= 0) {
return;
}
for (;;) {
nInputPageLengthLeft = (uintptr_t)page->m_pDataEnd + (1 - (uintptr_t)pInPageData);
if (nInputPageLengthLeft <= nNumBytes) {
break;
}
if (nNumBytes <= 0) {
nNumBytes -= nInputPageLengthLeft;
return;
}
ASSERT(m_pNextPage != nullptr);
page = page->m_pNextPage;
pInPageData = page->m_pData;
}
memcpy(pDest, pInPageData, nNumBytes);
}
CPageManager::CCache::CCache() {
m_paCache = nullptr;
m_uAllocatedPageMap = 0;
m_Unk = (1 << NUM_PAGES) - 1;
}
int CPageManager::CCache::Initialize() {
m_paCache = AllocSysMemory(0, PAGE_SIZE * NUM_PAGES, nullptr);
if (!m_paCache) {
return 1;
}
m_nNumFree = 29;
for (auto& pl : m_aPageLists) {
pl = {};
}
int page_idx = 0;
u8* page_start = (u8*)m_paCache;
for (auto& page : m_aPages) {
page = CPage(page_start, page_start + 0x7fff, page_idx);
page_start += PAGE_SIZE;
page_idx++;
}
return 0;
}
void CPageManager::Initialize() {
m_Cache.Initialize();
}
int CPageManager::TryFreePages(int nPages) {
return 0;
}
CPageManager::CPageList* CPageManager::AllocPageList(int nPages, char unk) {
CPageList* pList = nullptr;
CPage* apCollectedPages[29];
int nPageCount;
if (nPages <= 0) {
return nullptr;
}
if (m_Cache.m_nNumFree < nPages) {
if (nPages >= 29) {
return nullptr;
}
int nFreed = TryFreePages(nPages);
if (nFreed < nPages) {
return nullptr;
}
}
int nPageListID = std::countr_one(m_Cache.m_uAllocatedListMap);
if (nPages >= 29) {
return nullptr;
}
m_Cache.m_uAllocatedListMap |= 1u << nPageListID;
nPageCount = 0;
while (nPageCount < nPages) {
int nPageID = std::countr_one(m_Cache.m_uAllocatedPageMap);
}
}
} // namespace jak3

View File

@ -0,0 +1,104 @@
#pragma once
#include "common/common_types.h"
namespace jak3 {
class CPageManager {
public:
class CPageList;
enum class AllocState {
EPLAS_FREE,
EPLAS_ALLOCATED,
};
class CPage {
public:
CPage() = default;
CPage(u8*, u8*, int);
int AddRef();
int ReleaseRef();
int AddDmaRef();
int ReleaseDmaRef();
void FromPagesCopy(u8* pInPageData, u8* pDest, int nNumBytes);
u8* GetStart() const;
u8* GetEnd() const;
bool IsReferenced() { return m_nPageRefCount != 0 || m_nPageDmaRefCount != 0; }
bool IsFilled() const; // Exists as string in july version, not sure on impl
bool IsAllocated() const;
void SetPageInputState(int state); // enum
int GetPageCacheIndex() const;
CPage* GetNextPage() const;
CPage* GetPrevPage() const;
private:
CPage* m_pNextPage;
CPage* m_pPrevPage;
CPageList* m_pPageList;
int m_nPageRefCount;
int m_nPageDmaRefCount;
int m_nAllocState;
u32 m_nPageState; // 3: filled otherwise unk?
u8* m_pData;
u8* m_pDataEnd;
int m_nPageID;
u32 m_uPageBit;
};
class CPageList {
friend class CPage;
public:
int AddActivePages(int);
int CancelActivePages();
CPage* StepActivePage();
void GarbageCollect();
CPage* GetCurrentActivePage() const;
int GetNumRawPages() const;
int GetFirstRawPage() const;
int GetNumUnsteppedPages() const;
bool IsReferenced() { return m_nListRefCount != 0 || m_nListDmaRefCount != 0; }
int GetNumActivePages() const;
private:
CPage* m_pFirstPage;
CPage* m_pLastPage;
CPage* m_pFirstACtivePage;
CPage* m_pLastActivePage;
CPage* m_pCurrentActivePage;
int m_nNumPages;
int m_nNumActivePages;
int m_nNumUnsteppedPages;
int m_nListRefCount;
int m_nListDmaRefCount;
int m_nAllocState;
};
void Initialize();
CPageList* AllocPageListBytes(int nBytes, char unk);
CPageList* AllocPageList(int nPages, char unk);
CPageList* GrowPageList(CPageList* list, char nPages);
int FreePageList(CPageList* list);
int TryFreePages(int nUnk);
void GarbageCollect();
private:
class CCache {
public:
CCache();
int Initialize();
void* m_paCache;
CPageList m_aPageLists[29];
CPage m_aPages[29];
int m_nNumFree;
u32 m_uAllocatedPageMap;
u32 m_uAllocatedListMap;
int m_nEventFlag;
u32 m_Unk;
};
CCache m_Cache;
};
} // namespace jak3

View File

@ -0,0 +1,34 @@
#include "ramdisk.h"
#include "common/log/log.h"
#include "game/sce/iop.h"
namespace jak3 {
using namespace iop;
static u8 gRamDisk_RPCBUF[40];
static void* RPC_Ramdisk(u32 fno, void* data, int size) {
lg::error("RPC_RAMDISK UNIMPLEMENTED");
return nullptr;
}
void InitRamdisk() {}
u32 Thread_Server() {
sceSifQueueData dq;
sceSifServeData serve;
CpuDisableIntr();
sceSifInitRpc(0);
sceSifSetRpcQueue(&dq, GetThreadId());
sceSifRegisterRpc(&serve, 0xfab2, RPC_Ramdisk, gRamDisk_RPCBUF, sizeof(gRamDisk_RPCBUF), nullptr,
nullptr, &dq);
CpuEnableIntr();
sceSifRpcLoop(&dq);
return 0;
}
} // namespace jak3

View File

@ -0,0 +1,9 @@
#pragma once
#include "common/common_types.h"
namespace jak3 {
u32 Thread_Server();
}

View File

@ -0,0 +1,49 @@
#include "sbank.h"
#include "overlord.h"
namespace jak3 {
SoundBankInfo gCommonBank, gModeBank;
SoundBankInfo gLevelBanks[6];
SoundBankInfo* gBanks[8] = {
&gCommonBank, &gModeBank, &gLevelBanks[0], &gLevelBanks[1],
&gLevelBanks[2], &gLevelBanks[3], &gLevelBanks[4], &gLevelBanks[5],
};
void InitBanks() {
for (int i = 0; i < 8; i++) {
gBanks[i]->in_use = false;
gBanks[i]->unk = 0;
gBanks[i]->unk2 = 0;
gBanks[i]->index = i;
}
strncpyz(gBanks[0]->slot_name, "common", 16);
gBanks[0]->spu_size = 0xbbe40;
gBanks[0]->spu_loc = 0x1d1c0;
strncpyz(gBanks[1]->slot_name, "mode", 16);
gBanks[1]->spu_size = 0x25400;
gBanks[1]->spu_loc = 0xe0000;
strncpyz(gBanks[2]->slot_name, "level0", 16);
gBanks[2]->spu_size = 0x51400;
gBanks[2]->spu_loc = 0x105400;
strncpyz(gBanks[3]->slot_name, "level0h", 16);
gBanks[3]->spu_size = 0x28a00;
gBanks[3]->spu_loc = 0x12de00;
strncpyz(gBanks[4]->slot_name, "level1", 16);
gBanks[4]->spu_size = 0x51400;
gBanks[4]->spu_loc = 0x156800;
strncpyz(gBanks[5]->slot_name, "level1h", 16);
gBanks[5]->spu_size = 0x28a00;
gBanks[5]->spu_loc = 0x17f200;
strncpyz(gBanks[6]->slot_name, "level2", 16);
gBanks[6]->spu_size = 0x51400;
gBanks[6]->spu_loc = 0x1a7c00;
strncpyz(gBanks[7]->slot_name, "level2h", 16);
gBanks[7]->spu_size = 0x28a00;
gBanks[7]->spu_loc = 0x1d0600;
}
} // namespace jak3

View File

@ -0,0 +1,19 @@
#pragma once
#include "common/common_types.h"
namespace jak3 {
struct SoundBankInfo {
char bank_name[16];
char slot_name[16];
u32 spu_loc;
u32 spu_size;
u32 unk;
bool in_use;
u8 unk2;
u8 unk3;
u8 index;
u32 unk4;
};
void InitBanks();
} // namespace jak3

View File

@ -0,0 +1,56 @@
#include "srpc.h"
#include "common/log/log.h"
#include "game/sce/iop.h"
namespace jak3 {
using namespace iop;
constexpr int SRPC_MESSAGE_SIZE = 0x50;
constexpr int SRPC_MESSAGE_COUNT = 128;
static u8 s_anSRPC_PlayerBuf[SRPC_MESSAGE_SIZE * SRPC_MESSAGE_COUNT];
static u8 s_anSRPC_LoaderBuf[SRPC_MESSAGE_SIZE];
static void* RPC_Player(u32 fno, void* data, int size) {
lg::error("RPC_PLAYER UNIMPLEMENTED");
return nullptr;
}
static void* RPC_Loader(u32 fno, void* data, int size) {
lg::error("RPC_LOADER UNIMPLEMENTED");
return nullptr;
}
u32 Thread_Player() {
sceSifQueueData dq;
sceSifServeData serve;
CpuDisableIntr();
sceSifInitRpc(0);
sceSifSetRpcQueue(&dq, GetThreadId());
sceSifRegisterRpc(&serve, 0xfab0, RPC_Player, s_anSRPC_PlayerBuf, sizeof(s_anSRPC_PlayerBuf),
nullptr, nullptr, &dq);
CpuEnableIntr();
sceSifRpcLoop(&dq);
return 0;
}
u32 Thread_Loader() {
sceSifQueueData dq;
sceSifServeData serve;
CpuDisableIntr();
sceSifInitRpc(0);
sceSifSetRpcQueue(&dq, GetThreadId());
sceSifRegisterRpc(&serve, 0xfab1, RPC_Loader, s_anSRPC_LoaderBuf, sizeof(s_anSRPC_LoaderBuf),
nullptr, nullptr, &dq);
CpuEnableIntr();
sceSifRpcLoop(&dq);
return 0;
}
} // namespace jak3

10
game/overlord/jak3/srpc.h Normal file
View File

@ -0,0 +1,10 @@
#pragma once
#include "common/common_types.h"
namespace jak3 {
u32 Thread_Player();
u32 Thread_Loader();
} // namespace jak3

View File

@ -0,0 +1,115 @@
#include "overlord.h"
#include "common/common_types.h"
namespace jak3 {
static s16 angle_table[2056] = {
180, 0, 180, 0, 90, 90, 270, 270, 180, 0, 180, 0, 90, 90, 270, 270, 180, 0, 180, 0,
90, 90, 270, 270, 180, 0, 180, 0, 90, 90, 270, 270, 180, 0, 180, 0, 90, 90, 270, 270,
179, 1, 181, 359, 91, 89, 269, 271, 179, 1, 181, 359, 91, 89, 269, 271, 179, 1, 181, 359,
91, 89, 269, 271, 179, 1, 181, 359, 91, 89, 269, 271, 178, 2, 182, 358, 92, 88, 268, 272,
178, 2, 182, 358, 92, 88, 268, 272, 178, 2, 182, 358, 92, 88, 268, 272, 178, 2, 182, 358,
92, 88, 268, 272, 178, 2, 182, 358, 92, 88, 268, 272, 177, 3, 183, 357, 93, 87, 267, 273,
177, 3, 183, 357, 93, 87, 267, 273, 177, 3, 183, 357, 93, 87, 267, 273, 177, 3, 183, 357,
93, 87, 267, 273, 176, 4, 184, 356, 94, 86, 266, 274, 176, 4, 184, 356, 94, 86, 266, 274,
176, 4, 184, 356, 94, 86, 266, 274, 176, 4, 184, 356, 94, 86, 266, 274, 176, 4, 184, 356,
94, 86, 266, 274, 175, 5, 185, 355, 95, 85, 265, 275, 175, 5, 185, 355, 95, 85, 265, 275,
175, 5, 185, 355, 95, 85, 265, 275, 175, 5, 185, 355, 95, 85, 265, 275, 174, 6, 186, 354,
96, 84, 264, 276, 174, 6, 186, 354, 96, 84, 264, 276, 174, 6, 186, 354, 96, 84, 264, 276,
174, 6, 186, 354, 96, 84, 264, 276, 174, 6, 186, 354, 96, 84, 264, 276, 173, 7, 187, 353,
97, 83, 263, 277, 173, 7, 187, 353, 97, 83, 263, 277, 173, 7, 187, 353, 97, 83, 263, 277,
173, 7, 187, 353, 97, 83, 263, 277, 172, 8, 188, 352, 98, 82, 262, 278, 172, 8, 188, 352,
98, 82, 262, 278, 172, 8, 188, 352, 98, 82, 262, 278, 172, 8, 188, 352, 98, 82, 262, 278,
172, 8, 188, 352, 98, 82, 262, 278, 171, 9, 189, 351, 99, 81, 261, 279, 171, 9, 189, 351,
99, 81, 261, 279, 171, 9, 189, 351, 99, 81, 261, 279, 171, 9, 189, 351, 99, 81, 261, 279,
171, 9, 189, 351, 99, 81, 261, 279, 170, 10, 190, 350, 100, 80, 260, 280, 170, 10, 190, 350,
100, 80, 260, 280, 170, 10, 190, 350, 100, 80, 260, 280, 170, 10, 190, 350, 100, 80, 260, 280,
169, 11, 191, 349, 101, 79, 259, 281, 169, 11, 191, 349, 101, 79, 259, 281, 169, 11, 191, 349,
101, 79, 259, 281, 169, 11, 191, 349, 101, 79, 259, 281, 169, 11, 191, 349, 101, 79, 259, 281,
168, 12, 192, 348, 102, 78, 258, 282, 168, 12, 192, 348, 102, 78, 258, 282, 168, 12, 192, 348,
102, 78, 258, 282, 168, 12, 192, 348, 102, 78, 258, 282, 168, 12, 192, 348, 102, 78, 258, 282,
167, 13, 193, 347, 103, 77, 257, 283, 167, 13, 193, 347, 103, 77, 257, 283, 167, 13, 193, 347,
103, 77, 257, 283, 167, 13, 193, 347, 103, 77, 257, 283, 166, 14, 194, 346, 104, 76, 256, 284,
166, 14, 194, 346, 104, 76, 256, 284, 166, 14, 194, 346, 104, 76, 256, 284, 166, 14, 194, 346,
104, 76, 256, 284, 166, 14, 194, 346, 104, 76, 256, 284, 165, 15, 195, 345, 105, 75, 255, 285,
165, 15, 195, 345, 105, 75, 255, 285, 165, 15, 195, 345, 105, 75, 255, 285, 165, 15, 195, 345,
105, 75, 255, 285, 165, 15, 195, 345, 105, 75, 255, 285, 164, 16, 196, 344, 106, 74, 254, 286,
164, 16, 196, 344, 106, 74, 254, 286, 164, 16, 196, 344, 106, 74, 254, 286, 164, 16, 196, 344,
106, 74, 254, 286, 164, 16, 196, 344, 106, 74, 254, 286, 163, 17, 197, 343, 107, 73, 253, 287,
163, 17, 197, 343, 107, 73, 253, 287, 163, 17, 197, 343, 107, 73, 253, 287, 163, 17, 197, 343,
107, 73, 253, 287, 163, 17, 197, 343, 107, 73, 253, 287, 162, 18, 198, 342, 108, 72, 252, 288,
162, 18, 198, 342, 108, 72, 252, 288, 162, 18, 198, 342, 108, 72, 252, 288, 162, 18, 198, 342,
108, 72, 252, 288, 162, 18, 198, 342, 108, 72, 252, 288, 161, 19, 199, 341, 109, 71, 251, 289,
161, 19, 199, 341, 109, 71, 251, 289, 161, 19, 199, 341, 109, 71, 251, 289, 161, 19, 199, 341,
109, 71, 251, 289, 161, 19, 199, 341, 109, 71, 251, 289, 160, 20, 200, 340, 110, 70, 250, 290,
160, 20, 200, 340, 110, 70, 250, 290, 160, 20, 200, 340, 110, 70, 250, 290, 160, 20, 200, 340,
110, 70, 250, 290, 160, 20, 200, 340, 110, 70, 250, 290, 159, 21, 201, 339, 111, 69, 249, 291,
159, 21, 201, 339, 111, 69, 249, 291, 159, 21, 201, 339, 111, 69, 249, 291, 159, 21, 201, 339,
111, 69, 249, 291, 159, 21, 201, 339, 111, 69, 249, 291, 158, 22, 202, 338, 112, 68, 248, 292,
158, 22, 202, 338, 112, 68, 248, 292, 158, 22, 202, 338, 112, 68, 248, 292, 158, 22, 202, 338,
112, 68, 248, 292, 158, 22, 202, 338, 112, 68, 248, 292, 157, 23, 203, 337, 113, 67, 247, 293,
157, 23, 203, 337, 113, 67, 247, 293, 157, 23, 203, 337, 113, 67, 247, 293, 157, 23, 203, 337,
113, 67, 247, 293, 157, 23, 203, 337, 113, 67, 247, 293, 157, 23, 203, 337, 113, 67, 247, 293,
156, 24, 204, 336, 114, 66, 246, 294, 156, 24, 204, 336, 114, 66, 246, 294, 156, 24, 204, 336,
114, 66, 246, 294, 156, 24, 204, 336, 114, 66, 246, 294, 156, 24, 204, 336, 114, 66, 246, 294,
155, 25, 205, 335, 115, 65, 245, 295, 155, 25, 205, 335, 115, 65, 245, 295, 155, 25, 205, 335,
115, 65, 245, 295, 155, 25, 205, 335, 115, 65, 245, 295, 155, 25, 205, 335, 115, 65, 245, 295,
154, 26, 206, 334, 116, 64, 244, 296, 154, 26, 206, 334, 116, 64, 244, 296, 154, 26, 206, 334,
116, 64, 244, 296, 154, 26, 206, 334, 116, 64, 244, 296, 154, 26, 206, 334, 116, 64, 244, 296,
154, 26, 206, 334, 116, 64, 244, 296, 153, 27, 207, 333, 117, 63, 243, 297, 153, 27, 207, 333,
117, 63, 243, 297, 153, 27, 207, 333, 117, 63, 243, 297, 153, 27, 207, 333, 117, 63, 243, 297,
153, 27, 207, 333, 117, 63, 243, 297, 153, 27, 207, 333, 117, 63, 243, 297, 152, 28, 208, 332,
118, 62, 242, 298, 152, 28, 208, 332, 118, 62, 242, 298, 152, 28, 208, 332, 118, 62, 242, 298,
152, 28, 208, 332, 118, 62, 242, 298, 152, 28, 208, 332, 118, 62, 242, 298, 151, 29, 209, 331,
119, 61, 241, 299, 151, 29, 209, 331, 119, 61, 241, 299, 151, 29, 209, 331, 119, 61, 241, 299,
151, 29, 209, 331, 119, 61, 241, 299, 151, 29, 209, 331, 119, 61, 241, 299, 151, 29, 209, 331,
119, 61, 241, 299, 150, 30, 210, 330, 120, 60, 240, 300, 150, 30, 210, 330, 120, 60, 240, 300,
150, 30, 210, 330, 120, 60, 240, 300, 150, 30, 210, 330, 120, 60, 240, 300, 150, 30, 210, 330,
120, 60, 240, 300, 150, 30, 210, 330, 120, 60, 240, 300, 149, 31, 211, 329, 121, 59, 239, 301,
149, 31, 211, 329, 121, 59, 239, 301, 149, 31, 211, 329, 121, 59, 239, 301, 149, 31, 211, 329,
121, 59, 239, 301, 149, 31, 211, 329, 121, 59, 239, 301, 149, 31, 211, 329, 121, 59, 239, 301,
148, 32, 212, 328, 122, 58, 238, 302, 148, 32, 212, 328, 122, 58, 238, 302, 148, 32, 212, 328,
122, 58, 238, 302, 148, 32, 212, 328, 122, 58, 238, 302, 148, 32, 212, 328, 122, 58, 238, 302,
148, 32, 212, 328, 122, 58, 238, 302, 148, 32, 212, 328, 122, 58, 238, 302, 147, 33, 213, 327,
123, 57, 237, 303, 147, 33, 213, 327, 123, 57, 237, 303, 147, 33, 213, 327, 123, 57, 237, 303,
147, 33, 213, 327, 123, 57, 237, 303, 147, 33, 213, 327, 123, 57, 237, 303, 147, 33, 213, 327,
123, 57, 237, 303, 146, 34, 214, 326, 124, 56, 236, 304, 146, 34, 214, 326, 124, 56, 236, 304,
146, 34, 214, 326, 124, 56, 236, 304, 146, 34, 214, 326, 124, 56, 236, 304, 146, 34, 214, 326,
124, 56, 236, 304, 146, 34, 214, 326, 124, 56, 236, 304, 146, 34, 214, 326, 124, 56, 236, 304,
145, 35, 215, 325, 125, 55, 235, 305, 145, 35, 215, 325, 125, 55, 235, 305, 145, 35, 215, 325,
125, 55, 235, 305, 145, 35, 215, 325, 125, 55, 235, 305, 145, 35, 215, 325, 125, 55, 235, 305,
145, 35, 215, 325, 125, 55, 235, 305, 145, 35, 215, 325, 125, 55, 235, 305, 144, 36, 216, 324,
126, 54, 234, 306, 144, 36, 216, 324, 126, 54, 234, 306, 144, 36, 216, 324, 126, 54, 234, 306,
144, 36, 216, 324, 126, 54, 234, 306, 144, 36, 216, 324, 126, 54, 234, 306, 144, 36, 216, 324,
126, 54, 234, 306, 143, 37, 217, 323, 127, 53, 233, 307, 143, 37, 217, 323, 127, 53, 233, 307,
143, 37, 217, 323, 127, 53, 233, 307, 143, 37, 217, 323, 127, 53, 233, 307, 143, 37, 217, 323,
127, 53, 233, 307, 143, 37, 217, 323, 127, 53, 233, 307, 143, 37, 217, 323, 127, 53, 233, 307,
143, 37, 217, 323, 127, 53, 233, 307, 142, 38, 218, 322, 128, 52, 232, 308, 142, 38, 218, 322,
128, 52, 232, 308, 142, 38, 218, 322, 128, 52, 232, 308, 142, 38, 218, 322, 128, 52, 232, 308,
142, 38, 218, 322, 128, 52, 232, 308, 142, 38, 218, 322, 128, 52, 232, 308, 142, 38, 218, 322,
128, 52, 232, 308, 141, 39, 219, 321, 129, 51, 231, 309, 141, 39, 219, 321, 129, 51, 231, 309,
141, 39, 219, 321, 129, 51, 231, 309, 141, 39, 219, 321, 129, 51, 231, 309, 141, 39, 219, 321,
129, 51, 231, 309, 141, 39, 219, 321, 129, 51, 231, 309, 141, 39, 219, 321, 129, 51, 231, 309,
140, 40, 220, 320, 130, 50, 230, 310, 140, 40, 220, 320, 130, 50, 230, 310, 140, 40, 220, 320,
130, 50, 230, 310, 140, 40, 220, 320, 130, 50, 230, 310, 140, 40, 220, 320, 130, 50, 230, 310,
140, 40, 220, 320, 130, 50, 230, 310, 140, 40, 220, 320, 130, 50, 230, 310, 140, 40, 220, 320,
130, 50, 230, 310, 139, 41, 221, 319, 131, 49, 229, 311, 139, 41, 221, 319, 131, 49, 229, 311,
139, 41, 221, 319, 131, 49, 229, 311, 139, 41, 221, 319, 131, 49, 229, 311, 139, 41, 221, 319,
131, 49, 229, 311, 139, 41, 221, 319, 131, 49, 229, 311, 139, 41, 221, 319, 131, 49, 229, 311,
139, 41, 221, 319, 131, 49, 229, 311, 138, 42, 222, 318, 132, 48, 228, 312, 138, 42, 222, 318,
132, 48, 228, 312, 138, 42, 222, 318, 132, 48, 228, 312, 138, 42, 222, 318, 132, 48, 228, 312,
138, 42, 222, 318, 132, 48, 228, 312, 138, 42, 222, 318, 132, 48, 228, 312, 138, 42, 222, 318,
132, 48, 228, 312, 138, 42, 222, 318, 132, 48, 228, 312, 137, 43, 223, 317, 133, 47, 227, 313,
137, 43, 223, 317, 133, 47, 227, 313, 137, 43, 223, 317, 133, 47, 227, 313, 137, 43, 223, 317,
133, 47, 227, 313, 137, 43, 223, 317, 133, 47, 227, 313, 137, 43, 223, 317, 133, 47, 227, 313,
137, 43, 223, 317, 133, 47, 227, 313, 137, 43, 223, 317, 133, 47, 227, 313, 137, 43, 223, 317,
133, 47, 227, 313, 136, 44, 224, 316, 134, 46, 226, 314, 136, 44, 224, 316, 134, 46, 226, 314,
136, 44, 224, 316, 134, 46, 226, 314, 136, 44, 224, 316, 134, 46, 226, 314, 136, 44, 224, 316,
134, 46, 226, 314, 136, 44, 224, 316, 134, 46, 226, 314, 136, 44, 224, 316, 134, 46, 226, 314,
136, 44, 224, 316, 134, 46, 226, 314, 135, 45, 225, 315, 135, 45, 225, 315,
};
void InitSound() {}
} // namespace jak3

View File

@ -0,0 +1,39 @@
#pragma once
#include "common/common_types.h"
#include "game/overlord/jak3/overlord.h"
namespace jak3 {
struct Curve {
s32 p1;
s32 p2;
s32 p3;
s32 p4;
};
struct SoundPlayParams {
u16 mask;
s16 pitch_mod;
s16 bend;
s16 fo_min;
s16 fo_max;
s8 fo_curve;
s8 priority;
s32 volume;
Vec3 trans;
u8 group;
u8 reg[3];
};
struct SoundInfo {
char name[16];
s32 id;
u32 sound_handle;
s32 auto_volume;
s32 auto_time;
SoundPlayParams params;
};
} // namespace jak3

View File

@ -0,0 +1,124 @@
#include <cstdio>
#include <cstring>
#include "iso.h"
#include "overlord.h"
#include "ramdisk.h"
#include "sbank.h"
#include "game/overlord/jak3/srpc.h"
#include "game/sce/iop.h"
namespace jak3 {
using namespace iop;
int g_nServerThreadID;
int g_nPlayerThreadID;
int g_nLoaderThreadID;
int start_overlord(int argc, const char* const* argp) {
ThreadParam thp;
if (argc < 0) {
Panic();
}
if (sceSifCheckInit() == 0) {
sceSifInit();
}
sceSifInitRpc(0);
printf("======== overlrd2.irx startup ========\n");
// printf(" mem size: %lu\n", QueryMemSize());
// printf("total mem free: %lu\n", QueryTotalFreeMemSize());
// printf(" max mem free: %lu\n", QueryMaxFreeMemSize());
// printf(" used: %lu\n", QueryMemSize() - QueryTotalFreeMemSize());
// printf(" start() addr: 0x%08x\n", start_overlord);
//__do_global_ctors();
InitBanks();
InitSound();
VBlank_Initialize();
thp.attr = TH_C;
thp.option = 0;
thp.entry = Thread_Server;
thp.stackSize = 0x800;
thp.initPriority = 59;
g_nServerThreadID = CreateThread(&thp);
if (g_nServerThreadID < 0) {
Panic();
return 1;
}
thp.attr = TH_C;
thp.option = 0;
thp.entry = Thread_Player;
thp.stackSize = 0xb00;
thp.initPriority = 54;
g_nPlayerThreadID = CreateThread(&thp);
if (g_nPlayerThreadID < 0) {
Panic();
return 1;
}
thp.attr = TH_C;
thp.option = 0;
thp.entry = Thread_Loader;
thp.stackSize = 0x900;
thp.initPriority = 58;
g_nLoaderThreadID = CreateThread(&thp);
if (g_nPlayerThreadID < 0) {
Panic();
return 1;
}
// CDvdDriver::Initialize(&g_DvdDriver);
InitISOFS(argp[1], argp[2]);
StartThread(g_nServerThreadID, 0);
StartThread(g_nPlayerThreadID, 0);
StartThread(g_nLoaderThreadID, 0);
printf("======== overlrd2.irx post-startup ========\n");
// printf(" mem size: %lu\n", QueryMemSize());
// printf("total mem free: %lu\n", QueryTotalFreeMemSize());
// printf(" max mem free: %lu\n", QueryMaxFreeMemSize());
// printf(" used: %lu\n", QueryMemSize() - QueryTotalFreeMemSize());
return 0;
}
static s32 gargc;
static const char* const* gargv;
static bool* init_complete;
static u32 call_start() {
start_overlord(gargc, gargv);
*init_complete = true;
while (true) {
SleepThread();
}
return 0;
}
int start_overlord_wrapper(int argc, const char* const* argv, bool* signal) {
ThreadParam param = {};
gargc = argc;
gargv = argv;
init_complete = signal;
param.attr = TH_C;
param.initPriority = 0;
param.stackSize = 0x800;
param.option = 0;
strcpy(param.name, "start"); // added for debug
param.entry = call_start;
auto start_thread = CreateThread(&param);
StartThread(start_thread, 0);
return 0;
}
} // namespace jak3

View File

@ -0,0 +1,54 @@
#include "common/common_types.h"
#include "common/log/log.h"
#include "game/common/str_rpc_types.h"
#include "game/sce/iop.h"
namespace jak3 {
using namespace iop;
static RPC_Str_Cmd_Jak2 sRPCBuf[1];
static RPC_Str_Cmd_Jak2 sRPCBuf2[4];
static void* RPC_STR(unsigned int /*fno*/, void* _cmd, int /*y*/);
static void* RPC_PLAY(unsigned int /*fno*/, void* _cmd, int size);
u32 STRThread() {
sceSifQueueData dq;
sceSifServeData serve;
CpuDisableIntr();
sceSifInitRpc(0);
sceSifSetRpcQueue(&dq, GetThreadId());
sceSifRegisterRpc(&serve, 0xfab4, RPC_STR, sRPCBuf, sizeof(sRPCBuf), nullptr, nullptr, &dq);
CpuEnableIntr();
sceSifRpcLoop(&dq);
return 0;
}
u32 PLAYThread() {
sceSifQueueData dq;
sceSifServeData serve;
CpuDisableIntr();
sceSifInitRpc(0);
sceSifSetRpcQueue(&dq, GetThreadId());
sceSifRegisterRpc(&serve, 0xfab5, RPC_PLAY, sRPCBuf2, sizeof(sRPCBuf2), nullptr, nullptr, &dq);
CpuEnableIntr();
sceSifRpcLoop(&dq);
return 0;
}
static void* RPC_STR(unsigned int /*fno*/, void* _cmd, int /*y*/) {
lg::error("RPC_STR UNIMPLEMENTED");
return nullptr;
}
static void* RPC_PLAY(unsigned int /*fno*/, void* _cmd, int size) {
lg::error("RPC_PLAY UNIMPLEMENTED");
return nullptr;
}
} // namespace jak3

View File

@ -0,0 +1,11 @@
#ifndef STREAM_H_
#define STREAM_H_
#include "common/common_types.h"
namespace jak3 {
u32 STRThread();
u32 PLAYThread();
} // namespace jak3
#endif // STREAM_H_

View File

@ -0,0 +1,9 @@
#include "overlord.h"
namespace jak3 {
int VBlank_Initialize() {
return 0;
}
} // namespace jak3

View File

@ -4,6 +4,7 @@
*/
#include "common/common_types.h"
#ifdef OS_POSIX
#include <unistd.h>
@ -78,6 +79,7 @@
#include "game/overlord/jak2/stream.h"
#include "game/overlord/jak2/streamlist.h"
#include "game/overlord/jak2/vag.h"
#include "game/overlord/jak3/overlord.h"
#include "game/system/Deci2Server.h"
#include "game/system/iop_thread.h"
#include "sce/deci2.h"
@ -323,9 +325,11 @@ void iop_runner(SystemThreadInterface& iface, GameVersion version) {
jak1::start_overlord_wrapper(iop.overlord_argc, iop.overlord_argv, &complete);
break;
case GameVersion::Jak2:
case GameVersion::Jak3: // TODO: jak3 using jak2's overlord.
jak2::start_overlord_wrapper(iop.overlord_argc, iop.overlord_argv, &complete);
break;
case GameVersion::Jak3:
jak3::start_overlord_wrapper(iop.overlord_argc, iop.overlord_argv, &complete);
break;
default:
ASSERT_NOT_REACHED();
}

View File

@ -195,6 +195,10 @@ s32 SendMbx(s32 mbxid, void* sendmsg) {
return iop->kernel.SendMbx(mbxid, sendmsg);
}
s32 ReceiveMbx(MsgPacket** recvmsg, int mbxid) {
return iop->kernel.ReceiveMbx((void**)recvmsg, mbxid);
}
s32 PollMbx(MsgPacket** recvmsg, int mbxid) {
return iop->kernel.PollMbx((void**)recvmsg, mbxid);
}
@ -247,4 +251,14 @@ s32 RegisterVblankHandler(int edge, int priority, int (*handler)(void*), void* /
return iop->kernel.RegisterVblankHandler(handler);
}
s32 CpuSuspendIntr(int* old_state) {
(void)old_state;
return KE_OK;
}
s32 CpuResumeIntr(int old_state) {
(void)old_state;
return KE_OK;
}
} // namespace iop

View File

@ -30,6 +30,12 @@
#define SA_THFIFO 0
#define SA_THPRI 1
// Message box attributes
#define MBA_THFIFO 0x000
#define MBA_THPRI 0x001
#define MBA_MSFIFO 0x000
#define MBA_MSPRI 0x004
class IOP;
namespace iop {
@ -134,6 +140,7 @@ int sceCdDiskReady(int mode);
u32 sceSifSetDma(sceSifDmaData* sdd, int len);
s32 SendMbx(int mbxid, void* sendmsg);
s32 ReceiveMbx(MsgPacket** recvmsg, int mbxid);
s32 PollMbx(MsgPacket** recvmsg, int mbxid);
s32 PeekMbx(s32 mbx);
s32 CreateMbx(MbxParam* param);
@ -152,6 +159,9 @@ void FlushDcache();
u32 sceSifCheckInit();
void sceSifInit();
s32 CpuSuspendIntr(int* old_state);
s32 CpuResumeIntr(int old_state);
void LIBRARY_INIT();
void LIBRARY_register(::IOP* i);
void LIBRARY_kill();

View File

@ -103,6 +103,12 @@ void IOP_Kernel::iWakeupThread(s32 id) {
wakeup_queue.push(id);
}
s32 IOP_Kernel::CreateSema(s32 attr, s32 option, s32 init_count, s32 max_count) {
s32 id = semas.size();
semas.emplace_back((Semaphore::attribute)attr, option, init_count, max_count);
return id;
}
s32 IOP_Kernel::WaitSema(s32 id) {
auto& sema = semas.at(id);
if (sema.count > 0) {
@ -159,6 +165,81 @@ s32 IOP_Kernel::PollSema(s32 id) {
return KE_SEMA_ZERO;
}
/*!
* Create a message box
*/
s32 IOP_Kernel::CreateMbx() {
s32 id = mbxs.size();
mbxs.emplace_back();
return id;
}
s32 IOP_Kernel::ReceiveMbx(void** msg, s32 mbx) {
ASSERT(mbx < (s32)mbxs.size());
s32 gotSomething = mbxs[mbx].messages.empty() ? 0 : 1;
if (!gotSomething) {
/* Was empty, wait until there's messages */
mbxs[mbx].wait_list.push_back(_currentThread);
_currentThread->state = IopThread::State::Wait;
_currentThread->waitType = IopThread::Wait::MsgBox;
leaveThread();
}
ASSERT(mbxs[mbx].messages.empty() == false);
void* thing = mbxs[mbx].messages.front();
if (msg) {
*msg = thing;
}
mbxs[mbx].messages.pop();
return KE_OK;
}
/*!
* Set msg to thing if its there and pop it.
* Returns if it got something.
*/
s32 IOP_Kernel::PollMbx(void** msg, s32 mbx) {
ASSERT(mbx < (s32)mbxs.size());
s32 gotSomething = mbxs[mbx].messages.empty() ? 0 : 1;
if (gotSomething) {
void* thing = mbxs[mbx].messages.front();
if (msg) {
*msg = thing;
}
mbxs[mbx].messages.pop();
}
return gotSomething ? KE_OK : KE_MBOX_NOMSG;
}
s32 IOP_Kernel::PeekMbx(s32 mbx) {
return !mbxs[mbx].messages.empty();
}
/*!
* Push something into a mbx
*/
s32 IOP_Kernel::SendMbx(s32 mbx, void* value) {
ASSERT(mbx < (s32)mbxs.size());
mbxs[mbx].messages.push(value);
IopThread* to_run = nullptr;
if (!mbxs[mbx].wait_list.empty()) {
to_run = mbxs[mbx].wait_list.front();
mbxs[mbx].wait_list.pop_front();
to_run->waitType = IopThread::Wait::None;
to_run->state = IopThread::State::Ready;
}
return KE_OK;
}
/*!
* Return to kernel from a thread, not to be called from the kernel thread.
*/

View File

@ -57,6 +57,7 @@ struct IopThread {
None,
Semaphore,
Delay,
MsgBox,
};
IopThread(std::string n, void (*f)(), s32 ID, u32 priority)
@ -91,6 +92,11 @@ struct Semaphore {
std::list<IopThread*> wait_list;
};
struct MsgBox {
std::queue<void*> messages;
std::list<IopThread*> wait_list;
};
class IOP_Kernel {
public:
IOP_Kernel() {
@ -122,52 +128,13 @@ class IOP_Kernel {
return _currentThread->thID;
}
/*!
* Create a message box
*/
s32 CreateMbx() {
s32 id = mbxs.size();
mbxs.emplace_back();
return id;
}
/*!
* Set msg to thing if its there and pop it.
* Returns if it got something.
*/
s32 PollMbx(void** msg, s32 mbx) {
ASSERT(mbx < (s32)mbxs.size());
s32 gotSomething = mbxs[mbx].empty() ? 0 : 1;
if (gotSomething) {
void* thing = mbxs[mbx].front();
if (msg) {
*msg = thing;
}
mbxs[mbx].pop();
}
return gotSomething ? KE_OK : KE_MBOX_NOMSG;
}
s32 PeekMbx(s32 mbx) { return !mbxs[mbx].empty(); }
/*!
* Push something into a mbx
*/
s32 SendMbx(s32 mbx, void* value) {
ASSERT(mbx < (s32)mbxs.size());
mbxs[mbx].push(value);
return 0;
}
s32 CreateSema(s32 attr, s32 option, s32 init_count, s32 max_count) {
s32 id = semas.size();
semas.emplace_back((Semaphore::attribute)attr, option, init_count, max_count);
return id;
}
s32 CreateMbx();
s32 ReceiveMbx(void** msg, s32 mbx);
s32 PollMbx(void** msg, s32 mbx);
s32 PeekMbx(s32 mbx);
s32 SendMbx(s32 mbx, void* value);
s32 CreateSema(s32 attr, s32 option, s32 init_count, s32 max_count);
s32 WaitSema(s32 id);
s32 SignalSema(s32 id);
s32 PollSema(s32 id);
@ -205,7 +172,7 @@ class IOP_Kernel {
s32 _nextThID = 0;
IopThread* _currentThread = nullptr;
std::vector<IopThread> threads;
std::vector<std::queue<void*>> mbxs;
std::vector<MsgBox> mbxs;
std::vector<SifRecord> sif_records;
std::vector<Semaphore> semas;
std::queue<int> wakeup_queue;

View File

@ -1171,11 +1171,11 @@
)
(target-eco-process)
(target-color-effect-process)
(if (logtest? (-> self target-effect) 7)
(if (logtest? (-> self target-effect) (target-effect te0 te1 te2))
(logior! (-> self draw global-effect) (draw-control-global-effect no-textures))
(logclear! (-> self draw global-effect) (draw-control-global-effect no-textures))
)
(if (logtest? (-> self target-effect) 56)
(if (logtest? (-> self target-effect) (target-effect te3 te4 te5))
(logior! (-> self draw global-effect) (draw-control-global-effect rim-lights))
(logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights))
)

View File

@ -58,7 +58,7 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
(alpha gs-alpha)
(bucket bucket-id)
(sink uint32)
(level basic)
(level level)
(texture-index uint32)
(data prim-vertex :inline :dynamic)
)

View File

@ -77,7 +77,243 @@
(none)
)
(defmethod-mips2c "(method 9 prim-strip)" 9 prim-strip)
(defmethod generate-dma! ((this prim-strip) (arg0 matrix))
"Generate DMA for prim rendering."
(local-vars
(a3-6 uint128)
(a3-13 uint128)
(a3-14 uint128)
(t0-13 uint128)
(t0-14 uint128)
(t1-4 uint128)
(t1-5 uint128)
(t2-0 uint128)
(t2-1 uint128)
)
(rlet ((vf1 :class vf)
(vf10 :class vf)
(vf11 :class vf)
(vf12 :class vf)
(vf13 :class vf)
(vf14 :class vf)
(vf15 :class vf)
(vf16 :class vf)
(vf2 :class vf)
(vf3 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(vf8 :class vf)
(vf9 :class vf)
)
(let ((v1-5 (-> *display* frames (-> *display* on-screen) global-buf))
(a0-4 (/ (+ (-> this num-verts) 79) (the-as uint 80)))
)
(cond
((< (the-as uint (+ (* (the-as uint 144) (-> this num-verts)) (* a0-4 128)))
(the-as uint (&- (-> v1-5 end) (the-as uint (-> v1-5 base))))
)
(let* ((a1-5 (lookup-texture-by-id (-> this tex-id)))
(s3-0 *prim-work*)
(s2-0 (-> s3-0 sinks (-> this sink)))
(s4-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s5-0 (-> s4-0 base))
)
(set! (-> s3-0 in-verts) (the-as int (-> this num-verts)))
(set! (-> s3-0 vert-ptr) (-> this data))
(let ((v1-20 (if (logtest? (-> this flags) (prim-flags alpha-blend-enable))
1
0
)
)
(a0-11 (if (logtest? (-> this flags) (prim-flags texture-enable))
1
0
)
)
(a2-3 (if (logtest? (-> this flags) (prim-flags fog-enable))
1
0
)
)
)
(set! (-> s3-0 giftag fan-prim)
(new 'static 'gif-tag-prim
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe v1-20 :tme a0-11 :fge a2-3)
)
)
(set! (-> s3-0 giftag str-prim)
(new 'static 'gif-tag-prim
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe v1-20 :tme a0-11 :fge a2-3)
)
)
)
(when a1-5
(let ((v1-28 (-> this level)))
(-> this texture-index)
(let ((a0-17 (+ (-> this texture-index) 12)))
(dotimes (a2-7 3)
(let ((a3-5 (-> v1-28 texture-mask a0-17 mask quad))
(t0-9 (-> a1-5 masks data a2-7 mask quad))
)
(.por a3-6 a3-5 t0-9)
)
(set! (-> v1-28 texture-mask a0-17 mask quad) a3-6)
)
)
)
(adgif-shader<-texture-simple! (-> s3-0 shader) a1-5)
(set! (-> s3-0 shader clamp) (-> this clamp))
(set! (-> s3-0 shader clamp-reg) (gs-reg64 clamp-1))
(set! (-> s3-0 shader alpha) (the-as gs-miptbp (-> this alpha)))
(set! (-> s3-0 shader reg-4) (gs-reg alpha-1))
(.lvf vf1 (&-> arg0 rvec quad))
(.lvf vf2 (&-> arg0 uvec quad))
(.lvf vf3 (&-> arg0 fvec quad))
(.lvf vf4 (&-> arg0 trans quad))
(.lvf vf5 (&-> s3-0 shader quad 0 quad))
(.lvf vf6 (&-> s3-0 shader quad 1 quad))
(.lvf vf7 (&-> s3-0 shader quad 2 quad))
(.lvf vf8 (&-> s3-0 shader quad 3 quad))
(.lvf vf9 (&-> s3-0 shader quad 4 quad))
(.lvf vf10 (&-> s3-0 giftag qword quad))
(.lvf vf11 (&-> this adnops 0 quad))
(.lvf vf12 (&-> this adnops 1 quad))
(while (< 2 (-> s3-0 in-verts))
(set! (-> s3-0 num-verts) (min 80 (-> s3-0 in-verts)))
(let* ((a0-20 (-> s3-0 control-tmpl (logand (-> s2-0 control-count) 1)))
(v1-41 (-> s4-0 base))
(a0-21 (-> a0-20 quad))
(a1-6 (the-as object (&+ v1-41 16)))
(v1-42 (-> s3-0 num-verts))
)
(set! (-> (the-as (pointer uint128) a1-6) -1) a0-21)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 0 stq quad) vf1)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 0 pos quad) vf2)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 1 stq quad) vf3)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 1 pos quad) vf4)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 2 stq quad) vf10)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 2 pos quad) vf11)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 3 stq quad) vf12)
(set! (-> (the-as (inline-array prim-vertex) a1-6) 2 pos w) (the-as float v1-42))
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 3 pos quad) vf5)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 4 stq quad) vf6)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 4 pos quad) vf7)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 5 stq quad) vf8)
(.svf (&-> (the-as (inline-array prim-vertex) a1-6) 5 pos quad) vf9)
(set! (-> (the-as (inline-array prim-vertex) a1-6) 4 col) (the-as rgba (logior v1-42 #x8000)))
(set! (-> s4-0 base) (the-as pointer (-> (the-as (inline-array prim-vertex) a1-6) 6)))
(let ((a0-28 (-> s3-0 vertex-tmpl (mod (-> s2-0 vertex-count) (the-as uint 3)))))
(let ((a1-9 (* 3 v1-42)))
(set! (-> a0-28 dma qwc) a1-9)
(set! (-> a0-28 vif1 num) a1-9)
)
(let ((a2-13 (the-as object (-> s4-0 base)))
(a3-11 (-> a0-28 quad))
(a0-29 (-> s3-0 mask quad))
(a1-13 (-> s3-0 vert-ptr))
)
(nop!)
(set! (-> (the-as (inline-array prim-vertex) a2-13) 0 stq quad) a3-11)
(let ((a2-14 (the-as (object object) (-> (the-as (inline-array prim-vertex) a2-13) 0 pos))))
(set! (-> s4-0 base) (the-as pointer a2-14))
(nop!)
(label cfg-16)
(nop!)
(let ((t0-12 (the-as uint128 (-> a1-13 0 stq w))))
(nop!)
(let ((a3-12 (the-as uint128 (-> a1-13 1 stq w))))
(.pextlb t0-13 0 t0-12)
(.lvf vf15 (&-> a1-13 0 stq quad))
(.pextlh t0-14 0 t0-13)
(.lvf vf16 (&-> a1-13 1 stq quad))
(.pextlb a3-13 0 a3-12)
)
)
(.lvf vf13 (&-> a1-13 0 pos quad))
(.pextlh a3-14 0 a3-13)
(.lvf vf14 (&-> a1-13 1 pos quad))
(vftoi12.xyzw vf15 vf15)
(set! (-> (the-as (inline-array prim-vertex) a2-14) 0 pos quad) t0-14)
(vftoi12.xyzw vf16 vf16)
(set! (-> (the-as (inline-array prim-vertex) a2-14) 2 stq quad) a3-14)
(nop!)
(let ((t0-15 (the-as number (-> a1-13 0 stq z))))
(nop!)
(let ((a3-15 (the-as number (-> a1-13 1 stq z))))
(set! a1-13 (the-as (inline-array prim-vertex) (-> a1-13 2)))
(.mov t2-0 vf15)
(+! v1-42 -2)
(.mov t1-4 vf16)
(.pand t2-1 t2-0 a0-29)
(.svf (&-> (the-as (inline-array prim-vertex) a2-14) 1 stq quad) vf13)
(.pand t1-5 t1-4 a0-29)
(.svf (&-> (the-as (inline-array prim-vertex) a2-14) 2 pos quad) vf14)
(let ((t0-16 (logior (the-as int t2-1) (the-as int t0-15))))
(nop!)
(let ((a3-16 (logior (the-as int t1-5) (the-as int a3-15))))
(nop!)
(set! (-> (the-as (inline-array prim-vertex) a2-14) 0 stq quad) (the-as uint128 t0-16))
(set! a2-14 (the-as (object object) (-> (the-as (inline-array prim-vertex) a2-14) 3)))
(b! (> v1-42 0) cfg-16 :delay (set! (-> (the-as (pointer uint128) a2-14) -3) (the-as uint128 a3-16)))
)
)
)
)
)
)
)
)
(&+! (-> s4-0 base) (* 48 (-> s3-0 num-verts)))
(set! (-> (the-as (pointer uint128) (-> s4-0 base))) (-> s3-0 call-scissor quad))
(&+! (-> s4-0 base) 16)
(+! (-> s3-0 in-verts) -78)
(set! (-> s3-0 vert-ptr) (the-as (inline-array prim-vertex) (-> s3-0 vert-ptr 78)))
(+! (-> s2-0 vertex-count) 1)
(+! (-> s2-0 control-count) 1)
)
)
(when (not (paused?))
(when (logtest? (-> this flags) (prim-flags pf3))
(when (not (logtest? (-> this flags) (prim-flags pf4)))
(set! (-> this num-verts) (the-as uint 0))
0
)
(logclear! (-> this flags) (prim-flags pf4))
)
)
(let ((a3-17 (-> s4-0 base)))
(when (!= s5-0 a3-17)
(let ((v1-69 (the-as object (-> s4-0 base))))
(set! (-> (the-as dma-packet v1-69) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-69) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-69) vif1) (new 'static 'vif-tag))
(set! (-> s4-0 base) (&+ (the-as pointer v1-69) 16))
)
(dma-bucket-insert-tag
(-> *display* frames (-> *display* on-screen) bucket-group)
(-> this bucket)
s5-0
(the-as (pointer dma-tag) a3-17)
)
)
)
)
)
(else
(format *stdcon* "Out of DMA buffer for prim rendering~%")
)
)
)
0
(none)
)
)
(defmethod setup-dma-and-tex ((this prim-strip) (arg0 draw-control))
"Set up the bucket, prim sink, and texture."

View File

@ -1593,13 +1593,14 @@
(debug-draw-actors *level* *display-actor-marks*)
(collide-shape-draw-debug-marks)
)
; (when *display-trail-graph*
; (let ((a0-67 *trail-graph*))
; (if a0-67
; (debug-draw a0-67)
; )
; )
; )
(when *display-trail-graph*
(let ((a0-67 *trail-graph*))
(if a0-67
(debug-draw a0-67)
)
)
)
;; dispatch collision events
(send-events-for-touching-shapes *touching-list*)

View File

@ -270,7 +270,7 @@
:heap-size #x4000
)
(new 'static 'entity-info
:ptype (type-ref neon-baron :method-count 0)
:ptype (type-ref neon-baron :method-count 17)
:pool '*16k-dead-pool*
:heap-size #x4000
)

View File

@ -2306,10 +2306,32 @@
(dotimes (s1-1 s2-3)
(set! sv-48 (-> s3-4 data s1-1))
(cond
((and (is-object-visible? s4-1 (-> sv-48 vis-id))
;; og:preserve-this entity blacklist
((and (#if PC_PORT (or (with-pc (and (not (-> *pc-settings* ps2-actor-vis?))
;; ban specific entities
; (not (let ((name (res-lump-struct (-> sv-48 entity) 'name string)))
; (nmember name '("fort-entry-gate-11"
; "fort-elec-gate-11"
; "fort-elec-gate-12"
; "com-airlock-outer-13"
; "com-airlock-inner-41"
; "under-lift-4"
; "under-locking-1"
; "under-locking-2"))))
))
(is-object-visible? s4-1 (-> sv-48 vis-id)))
(is-object-visible? s4-1 (-> sv-48 vis-id)))
(not (logtest? (-> sv-48 perm status) (entity-perm-status bit-9 bit-10)))
(not (logtest? (-> sv-48 kill-mask) sv-32))
(or (-> s4-1 vis-info 0) (< (vector-vector-distance (-> sv-48 trans) sv-16) (-> sv-48 vis-dist)))
;; og:preserve-this PC port note: added this extra check to fix level types being used after deload because of bad entity placement
(#if PC_PORT
(or (not (type-type? (-> sv-48 entity type) entity-actor)) (and (valid? (-> (the-as entity-actor (-> sv-48 entity)) etype) type "entity-type-check etype" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol) symbol "entity-type-check symbol" #f *stdcon*)
(valid? (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value) type "entity-type-check value" #f *stdcon*)
(= (-> (the-as entity-actor (-> sv-48 entity)) etype) (-> (the-as entity-actor (-> sv-48 entity)) etype symbol value))
))
#f)
)
(when (not (or (-> sv-48 process) (logtest? (-> sv-48 perm status) (entity-perm-status bit-0 dead)) s0-0))
(birth! (-> sv-48 entity))

View File

@ -1436,16 +1436,16 @@
)
; ;; modify vertices for merc face animation. I believe this is somewhat racing DMA of merc data to VU1.
; (with-profiler 'merc *profile-merc-color*
; (blerc-execute)
; (blerc-init)
; )
(with-profiler 'merc *profile-merc-color*
(blerc-execute)
(blerc-init)
)
; ;; modify merc vertices for texture scrolling effect. Again, racing DMA.
; (texscroll-execute)
(texscroll-execute)
; ;; modify merc vertices for water ripple effect. Again, racing DMA.
; (ripple-execute)
(ripple-execute)
; ;; detect player/camera entering/exiting regions, and run callbacks for those.
(region-execute)
@ -1542,6 +1542,9 @@
)
)
;; send alp to C++ for blackout
(put-display-env (-> *display* pmode alp))
;; update blackout settings
(when (-> *setting-control* user-current render)
(if (< (-> *display* base-clock frame-counter) (-> *game-info* blackout-time))
@ -1620,10 +1623,10 @@
(level-update *level*)
;; update memory card
; (mc-run)
(mc-run)
;; check for memory card errors.
; (auto-save-check)
(auto-save-check)
0
(none)
)

View File

@ -52,6 +52,15 @@
(define-extern remap-all-particles (function none))
(define-extern process-particles (function none))
;; +++sp-cpuinfo-flag-s32
(defenum sp-cpuinfo-flag-s32
:bitfield #t
:type int32
:copy-entries sp-cpuinfo-flag
)
;; ---sp-cpuinfo-flag-s32
;; DECOMP BEGINS
(define *sp-60-hz* #t)
@ -62,25 +71,25 @@
(adgif adgif-shader)
(radius float)
(omega float)
(vel-sxvel vector :inline)
(rot-syvel vector :inline)
(fade rgbaf :inline)
(acc vector :inline)
(rotvel3d quaternion :inline)
(vel vector3s :inline :overlay-at (-> vel-sxvel data 0))
(accel vector3s :inline :overlay-at (-> acc data 0))
(scalevelx float :overlay-at (-> vel-sxvel data 3))
(scalevely float :overlay-at (-> rot-syvel data 3))
(vel-sxvel vector :inline)
(rot-syvel vector :inline)
(fade rgbaf :inline)
(acc vector :inline)
(rotvel3d quaternion :inline)
(vel vector3s :inline :overlay-at (-> vel-sxvel data 0))
(accel vector3s :inline :overlay-at (-> acc data 0))
(scalevelx float :overlay-at (-> vel-sxvel data 3))
(scalevely float :overlay-at (-> rot-syvel data 3))
(friction float)
(timer int32)
(flags sp-cpuinfo-flag)
(flags-s32 int32 :overlay-at flags)
(flags-s32 sp-cpuinfo-flag-s32 :overlay-at flags)
(user-int32 int32)
(user-uint32 uint32 :overlay-at user-int32)
(user-float float :overlay-at user-int32)
(user-pntr uint32 :overlay-at user-int32)
(user-object basic :overlay-at user-int32)
(user-sprite sprite-vec-data-2d :overlay-at user-int32)
(user-uint32 uint32 :overlay-at user-int32)
(user-float float :overlay-at user-int32)
(user-pntr uint32 :overlay-at user-int32)
(user-object basic :overlay-at user-int32)
(user-sprite sprite-vec-data-2d :overlay-at user-int32)
(sp-func (function sparticle-system sparticle-cpuinfo sprite-vec-data-3d uint none))
(next-time uint32)
(next-launcher basic)
@ -90,10 +99,10 @@
(user1-int16 uint16)
(key sparticle-launch-control)
(binding sparticle-launch-state)
(data uint32 1 :overlay-at omega)
(datab int8 4 :overlay-at omega)
(dataf float 1 :overlay-at omega)
(datac uint8 1 :overlay-at omega)
(data uint32 1 :overlay-at omega)
(datab int8 4 :overlay-at omega)
(dataf float 1 :overlay-at omega)
(datac uint8 1 :overlay-at omega)
)
)

View File

@ -697,9 +697,8 @@
(sp-relaunch-setup-fields arg0 arg1 arg2 arg3)
(let* ((a1-1 (-> arg2 flags-s32))
(v1-1 -2)
;; og:preserve-this
(a0-1 (the-as uint (-> arg3 r-g-b-a x)))
(a1-2 (logand a1-1 #x4000))
(a1-2 (logand a1-1 (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14)))
)
1
(let ((a1-3 (sar a1-2 14)))
@ -1196,16 +1195,11 @@
(let* ((f30-0 (vector-vector-distance arg0 (math-camera-pos)))
(v1-38 1)
(a0-12 *time-of-day*)
;; og:preserve-this added check
(s3-1 (if (nonzero? *time-of-day*)
(ash v1-38
(if a0-12
(-> a0-12 0 hours)
0
(s3-1 (ash v1-38 (if a0-12
(-> a0-12 0 hours)
0
)
)
)
0
)
)
)
(if (nonzero? (-> this matrix))
@ -1415,16 +1409,11 @@
(let* ((s5-1 (camera-pos))
(v1-12 1)
(a0-14 *time-of-day*)
;; og:preserve-this added check
(s4-1 (if (nonzero? *time-of-day*)
(ash v1-12
(if a0-14
(-> a0-14 0 hours)
0
)
(s4-1 (ash v1-12 (if a0-14
(-> a0-14 0 hours)
0
)
)
0
)
)
)
(dotimes (s3-1 (-> *level* length))
@ -1892,124 +1881,87 @@
;; ERROR: Bad vector register dependency: vf1
;; ERROR: Bad vector register dependency: vf2
(defun sparticle-texture-day-night ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d))
(local-vars
(v1-9 uint128)
(v1-10 uint128)
(v1-13 uint128)
(v1-14 uint128)
(v1-23 uint128)
(v1-24 uint128)
(v1-27 uint128)
(v1-28 uint128)
(v1-33 float)
(a0-5 float)
(a0-11 float)
(t7-0 int) ;; og:preserve-this float -> int
(t7-3 int) ;; og:preserve-this float -> int
(s3-0 float)
(s4-0 float)
)
(rlet ((vf1 :class vf)
(vf2 :class vf)
)
(let ((s2-0 (the-as (array int32) (-> arg1 user-float))))
(when (nonzero? s2-0)
(let* ((v1-1 *time-of-day*)
(s1-0 (if v1-1
(-> v1-1 0 hours)
0
)
)
(f0-0 (rand-vu))
)
(.mov s4-0 vf1)
(.mov s3-0 vf2)
(cond
((or (< s1-0 6) (< 18 s1-0))
(let ((a1-1 (-> s2-0 7)))
(when (nonzero? a1-1)
(let ((v1-6 f0-0))
(.mov vf2 v1-6)
)
(let ((v1-8 (the-as uint128 (make-u128 0 (-> s2-0 9)))))
(.pextlb v1-9 0 v1-8)
)
(.pextlb v1-10 0 v1-9)
(.mov vf1 v1-10)
(.itof.vf vf1 vf1)
(.mul.x.vf vf1 vf1 vf2)
(let ((v1-12 (the-as uint128 (make-u128 0 (-> s2-0 8)))))
(.pextlb v1-13 0 v1-12)
)
(.pextlb v1-14 0 v1-13)
(.mov vf2 v1-14)
(.itof.vf vf2 vf2)
(.add.vf vf1 vf1 vf2)
(let ((v1-15 (-> arg1 flags-s32)))
(when (nonzero? (-> s2-0 10))
(.lvf vf2 (&-> *time-of-day-context* current-prt-color quad))
(.mul.vf vf1 vf1 vf2)
(.mov a0-5 vf1)
)
(let ((v1-16 (logand v1-15 #x4000)))
(.mov t7-0 vf1)
(let ((v1-17 (sar v1-16 14)))
;; og:preserve-this
(set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand (the-as uint t7-0) (the-as uint -2)) v1-17)))
)
)
)
(particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-1))
)
)
)
(else
(let ((a1-2 (-> s2-0 3)))
(when (nonzero? a1-2)
(let ((v1-20 f0-0))
(.mov vf2 v1-20)
)
(let ((v1-22 (the-as uint128 (make-u128 0 (-> s2-0 5)))))
(.pextlb v1-23 0 v1-22)
)
(.pextlb v1-24 0 v1-23)
(.mov vf1 v1-24)
(.itof.vf vf1 vf1)
(.mul.x.vf vf1 vf1 vf2)
(let ((v1-26 (the-as uint128 (make-u128 0 (-> s2-0 4)))))
(.pextlb v1-27 0 v1-26)
)
(.pextlb v1-28 0 v1-27)
(.mov vf2 v1-28)
(.itof.vf vf2 vf2)
(.add.vf vf1 vf1 vf2)
(let ((v1-29 (-> arg1 flags-s32)))
(when (nonzero? (-> s2-0 6))
(.lvf vf2 (&-> *time-of-day-context* current-prt-color quad))
(.mul.vf vf1 vf1 vf2)
(.mov a0-11 vf1)
)
(let ((v1-30 (logand v1-29 #x4000)))
(.mov t7-3 vf1)
(let ((v1-31 (sar v1-30 14)))
;; og:preserve-this
(set! (-> arg2 r-g-b-a quad) (the-as uint128 (logior (logand (the-as uint t7-3) (the-as uint -2)) v1-31)))
;; og:preserve-this this was rewritten from assembly!
(let ((s2-0 (the-as (array int32) (-> arg1 user-object))))
(when (nonzero? s2-0)
(let* ((v1-1 *time-of-day*)
(s1-0 (if v1-1
(-> v1-1 0 hours)
0
)
)
)
(particle-adgif-callback (-> arg1 adgif) (the-as texture-id a1-2))
(f0-0 (rand-vu))
)
(cond
((or (< s1-0 6) (< 18 s1-0))
(let ((night-tex (the texture-id (-> s2-0 7))))
(when (nonzero? night-tex)
;; they use two consecutive pextlb with zeros to expand each 8-bit value in the rgba
;; to a 32-bit value with no sign extension (i believe) and then itof it. very fast!
;; 8 -> 32 expand to vf1
;; multiply by f0-0 (in vf2)
;; 8 -> 32 expand to vf2
;; to float
;; vf1 += vf2
(let ((rgba-rand (the rgba (-> s2-0 9)))
(rgba-base (the rgba (-> s2-0 8))))
(set-vector! (-> arg2 r-g-b-a)
(* f0-0 (-> rgba-rand r))
(* f0-0 (-> rgba-rand g))
(* f0-0 (-> rgba-rand b))
(* f0-0 (-> rgba-rand a)))
(+! (-> arg2 r-g-b-a x) (-> rgba-base r))
(+! (-> arg2 r-g-b-a y) (-> rgba-base g))
(+! (-> arg2 r-g-b-a z) (-> rgba-base b))
(+! (-> arg2 r-g-b-a w) (-> rgba-base a))
)
(when (nonzero? (-> s2-0 10))
(*! (-> arg2 r-g-b-a x) (-> *time-of-day-context* current-prt-color x))
(*! (-> arg2 r-g-b-a y) (-> *time-of-day-context* current-prt-color y))
(*! (-> arg2 r-g-b-a z) (-> *time-of-day-context* current-prt-color z))
(*! (-> arg2 r-g-b-a w) (-> *time-of-day-context* current-prt-color w))
)
;; sneak in a flag here for... some reason
(if (logtest? (-> arg1 flags) (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14))
(set! (-> arg2 r-g-b-a x) (the-as float (logior 1 (the-as int (-> arg2 r-g-b-a x)))))
(set! (-> arg2 r-g-b-a x) (the-as float (logand (lognot 1) (the-as int (-> arg2 r-g-b-a x))))))
(particle-adgif-callback (-> arg1 adgif) night-tex)
)
)
)
(else
(let ((day-tex (the texture-id (-> s2-0 3))))
(when (nonzero? day-tex)
(let ((rgba-rand (the rgba (-> s2-0 5)))
(rgba-base (the rgba (-> s2-0 4))))
(set-vector! (-> arg2 r-g-b-a)
(* f0-0 (-> rgba-rand r))
(* f0-0 (-> rgba-rand g))
(* f0-0 (-> rgba-rand b))
(* f0-0 (-> rgba-rand a)))
(+! (-> arg2 r-g-b-a x) (-> rgba-base r))
(+! (-> arg2 r-g-b-a y) (-> rgba-base g))
(+! (-> arg2 r-g-b-a z) (-> rgba-base b))
(+! (-> arg2 r-g-b-a w) (-> rgba-base a))
)
(when (nonzero? (-> s2-0 6))
(*! (-> arg2 r-g-b-a x) (-> *time-of-day-context* current-prt-color x))
(*! (-> arg2 r-g-b-a y) (-> *time-of-day-context* current-prt-color y))
(*! (-> arg2 r-g-b-a z) (-> *time-of-day-context* current-prt-color z))
(*! (-> arg2 r-g-b-a w) (-> *time-of-day-context* current-prt-color w))
)
(if (logtest? (-> arg1 flags) (sp-cpuinfo-flag-s32 sp-cpuinfo-flag-14))
(set! (-> arg2 r-g-b-a x) (the-as float (logior 1 (the-as int (-> arg2 r-g-b-a x)))))
(set! (-> arg2 r-g-b-a x) (the-as float (logand (lognot 1) (the-as int (-> arg2 r-g-b-a x))))))
(particle-adgif-callback (-> arg1 adgif) day-tex)
)
)
)
)
(.mov vf1 s4-0)
(.mov vf2 s3-0)
(.mov v1-33 vf2)
)
)
(none)
)
(none)
)
(defun sparticle-mode-animate ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d))

View File

@ -20658,3 +20658,60 @@
4amy
)
)
;; og:preserve-this added test-zone level
(define test-zone
(new 'static 'level-load-info
:name 'test-zone
:visname 'test-zone-vis
:nickname 'tsz
:dbname 'test-zone
:taskname 'default
:index #x128
:master-level #f
:level-flags (level-flags lf8 lf9 lf11 lf12)
:packages '()
:run-packages '("common")
:memory-mode (level-memory-mode large)
:music-bank #f
:extra-sound-bank #f
:mood-func 'update-mood-default
:special-mood #f
:ocean #f
:ocean-alpha 1.0
:priority 100
:draw-priority 10.0
:base-task-mask (task-mask task0)
:bigmap-id (bigmap-id no-map)
:continues '((new 'static 'continue-point
:name "test-zone-start"
:level 'test-zone
:trans (static-vectorm 0 10 10)
:camera-trans (static-vectorm 0 1 0)
:quat (new 'static 'vector4h :data (new 'static 'array int16 4 0 #x7f9f 0 -2460))
:camera-rot (new 'static 'array int16 9 -32717 0 -1749 #xd1 #x7f0c -3954 #x6c8 -3958 -32478)
:on-goto #f
:vis-nick 'tsz
:vehicle-type #x1b
:want-count 3
:want (new 'static 'inline-array level-buffer-state-small 3
(new 'static 'level-buffer-state-small :name 'wasall :display? 'display)
(new 'static 'level-buffer-state-small :name 'waswide :display? 'display)
(new 'static 'level-buffer-state-small :name 'test-zone :display? 'display)
)
:want-sound (new 'static 'array symbol 3 #f #f #f)
)
)
:callback-list '()
:borrow #f
:bottom-height (meters -150)
:fog-height (meters 80)
:max-rain 1.0
:fog-mult 1.0
:mood-range (new 'static 'mood-range :max-cloud 1.0 :min-fog 0.5 :max-fog 1.0)
)
)
(#when PC_PORT
(cons! *level-load-list* 'test-zone)
)

View File

@ -105,13 +105,14 @@
)
(defun drawable-load ((arg0 drawable) (arg1 kheap))
(local-vars (sp-0 pointer))
;; og:preserve-this
; (local-vars (sp-0 pointer))
(cond
((type? arg0 string)
(the-as none sp-0)
(if (< (the-as uint sp-0) (the-as uint *stack-top*))
(set! sp-0 (&+ *kernel-sp* -1024))
)
; (the-as none sp-0)
; (if (< (the-as uint sp-0) (the-as uint *stack-top*))
; (set! sp-0 (&+ *kernel-sp* -1024))
; )
(let ((s5-1 (the-as drawable (loado (the-as string arg0) arg1))))
(if (and s5-1 (type? s5-1 drawable))
(login s5-1)
@ -125,11 +126,12 @@
)
(defun art-load ((arg0 string) (arg1 kheap))
(local-vars (sp-0 pointer))
(the-as none sp-0)
(if (< (the-as uint sp-0) (the-as uint *stack-top*))
(set! sp-0 (&+ *kernel-sp* -1024))
)
;; og:preserve-this
; (local-vars (sp-0 pointer))
; (the-as none sp-0)
; (if (< (the-as uint sp-0) (the-as uint *stack-top*))
; (set! sp-0 (&+ *kernel-sp* -1024))
; )
(let ((s5-0 (the-as art (loado arg0 arg1))))
(if (type? s5-0 art)
(login s5-0)
@ -139,12 +141,13 @@
)
(defun art-group-load-check ((arg0 string) (arg1 kheap) (arg2 int))
(local-vars (sp-0 pointer))
;; og:preserve-this
; (local-vars (sp-0 pointer))
(when *debug-segment*
(the-as none sp-0)
(if (< (the-as uint sp-0) (the-as uint *stack-top*))
(set! sp-0 (&+ *kernel-sp* -1024))
)
; (the-as none sp-0)
; (if (< (the-as uint sp-0) (the-as uint *stack-top*))
; (set! sp-0 (&+ *kernel-sp* -1024))
; )
(let ((s3-1 (the-as art-group (loado (make-file-name (file-kind art-group) arg0 arg2 #f) arg1))))
(cond
((not s3-1)
@ -1861,7 +1864,8 @@
)
(else
(set! (-> (the-as gui-connection s1-0) action) sv-16)
(if (and (= sv-16 'play)
;; og:preserve-this fixed naughty dog bug here. was 'play instead of (gui-action play)
(if (and (= sv-16 (gui-action play))
(handle-command-list this (-> (the-as gui-connection s1-0) channel) (the-as gui-connection s1-0))
)
(channel-id-set! this (the-as gui-connection s1-0) (-> (the-as gui-connection s1-0) id))

View File

@ -38,6 +38,7 @@
(momentum-ignore-heading 6) ;; 64
(output-sphere-hash 7) ;; 128
(kernel-run 8) ;; 256
(ncf9 9)
)
;; DECOMP BEGINS

View File

@ -54,7 +54,7 @@
)
)
(if (or (logtest? (-> v1-0 draw status) (draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2))
(or (logtest? (-> v1-0 target-effect) 1) (zero? (-> v1-0 skel active-channels)))
(or (logtest? (-> v1-0 target-effect) (target-effect te0)) (zero? (-> v1-0 skel active-channels)))
)
(logior! (-> self draw status) (draw-control-status no-draw))
(logclear! (-> self draw status) (draw-control-status no-draw))
@ -63,11 +63,11 @@
(logior! (-> self draw status) (draw-control-status force-fade))
(logclear! (-> self draw status) (draw-control-status force-fade))
)
(if (logtest? (-> v1-0 target-effect) 7)
(if (logtest? (-> v1-0 target-effect) (target-effect te0 te1 te2))
(logior! (-> self draw global-effect) (draw-control-global-effect no-textures))
(logclear! (-> self draw global-effect) (draw-control-global-effect no-textures))
)
(if (logtest? (-> v1-0 target-effect) 56)
(if (logtest? (-> v1-0 target-effect) (target-effect te3 te4 te5))
(logior! (-> self draw global-effect) (draw-control-global-effect rim-lights))
(logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights))
)

View File

@ -325,7 +325,7 @@
(if (or (logtest? (-> (the-as target gp-0) draw status)
(draw-control-status no-draw no-draw-temp no-draw-bounds no-draw-bounds2)
)
(or (logtest? (-> (the-as target gp-0) target-effect) 1)
(or (logtest? (-> (the-as target gp-0) target-effect) (target-effect te0))
(zero? (-> (the-as target gp-0) skel active-channels))
)
)
@ -336,11 +336,11 @@
(logior! (-> self draw status) (draw-control-status force-fade))
(logclear! (-> self draw status) (draw-control-status force-fade))
)
(if (logtest? (-> (the-as target gp-0) target-effect) 7)
(if (logtest? (-> (the-as target gp-0) target-effect) (target-effect te0 te1 te2))
(logior! (-> self draw global-effect) (draw-control-global-effect no-textures))
(logclear! (-> self draw global-effect) (draw-control-global-effect no-textures))
)
(if (logtest? (-> (the-as target gp-0) target-effect) 56)
(if (logtest? (-> (the-as target gp-0) target-effect) (target-effect te3 te4 te5))
(logior! (-> self draw global-effect) (draw-control-global-effect rim-lights))
(logclear! (-> self draw global-effect) (draw-control-global-effect rim-lights))
)

View File

@ -402,7 +402,7 @@
(target-indax-reset)
(cloth-post)
(set! (-> self major-mode-exit-hook) target-indax-exit)
(set! (-> self major-mode-event-hook) (the-as (function none :behavior target) target-indax-handler))
(set! (-> self major-mode-event-hook) target-indax-handler)
(set! (-> self major-mode-exit-hook) target-indax-reset)
(set! (-> self indax pad) (add-setting! 'mode-sound-bank 'modeidax 0.0 0))
(remove-exit)

View File

@ -1785,7 +1785,7 @@
(logtest? (-> self control mod-surface flags) (surface-flag look-around))
(not (focus-test? self edge-grab pole flut tube light board pilot dark))
(-> *setting-control* user-current allow-look-around)
(time-elapsed? (the-as int (-> self no-look-around-wait)) (seconds 0.05))
(time-elapsed? (-> self no-look-around-wait) (seconds 0.05))
(not (and (= (-> self control ground-pat material) (pat-material ice)) (< 4096.0 (-> self control ctrl-xz-vel)))
)
)

View File

@ -272,7 +272,7 @@
(set! (-> self anim-seed) (-> self parent 0 anim-seed))
(set! (-> self draw status) (-> self parent 0 draw status))
(cond
((logtest? (-> self parent 0 target-effect) 1)
((logtest? (-> self parent 0 target-effect) (target-effect te0))
(logior! (-> self draw status) (draw-control-status no-draw))
(logior! (-> self draw global-effect) (draw-control-global-effect no-textures))
)

View File

@ -900,7 +900,7 @@
)
)
)
(set-darkjak-texture-morph! (if (logtest? (-> self target-effect) 64)
(set-darkjak-texture-morph! (if (logtest? (-> self target-effect) (target-effect te6))
1.0
f30-0
)

View File

@ -188,7 +188,7 @@
)
)
((and (logtest? (continue-flags race) (-> arg0 flags)) (!= (-> arg0 vehicle-type) 27))
(set! (-> self mode-cache) (the-as basic 'pilot))
(set! (-> self mode-cache) 'pilot)
(set! (-> self mode-param1) (the-as handle #f))
(set! (-> self mode-param2) (-> arg0 vehicle-type))
(when (= (-> arg0 vehicle-type) 28)
@ -483,7 +483,7 @@
#f
)
(else
(set! (-> self mode-cache) (the-as basic (-> block param 0)))
(set! (-> self mode-cache) (the-as symbol (-> block param 0)))
(set! (-> self mode-param1) (if (>= argc 2)
(process->handle (the-as process (-> block param 1)))
(the-as handle #f)
@ -760,7 +760,8 @@
)
)
(let ((s5-5 (level-get *level* (-> arg0 level))))
(when s5-5
;; og:preserve-this don't wait for vis if level doesn't have it
(when (and s5-5 (-> s5-5 vis-info 0))
(while (and (-> *level* vis?) (-> s5-5 vis-info 0) (= (-> s5-5 all-visible?) 'loading))
(suspend)
)

View File

@ -258,6 +258,21 @@
;; ---target-anim
;; +++target-effect
(defenum target-effect
:type uint64
:bitfield #t
(te0 0)
(te1 1)
(te2 2)
(te3 3)
(te4 4)
(te5 5)
(te6 6)
)
;; ---target-effect
;; DECOMP BEGINS
(deftype target (process-focusable)
@ -304,18 +319,18 @@
(spool-anim spool-anim)
(ambient-time time-frame)
(fp-hud handle)
(no-load-wait uint64)
(no-look-around-wait uint64)
(no-load-wait time-frame)
(no-look-around-wait time-frame)
(burn-proc handle)
(pre-joint-hook (function none :behavior target))
(notify handle)
(death-resetter resetter-spec :inline)
(mode-cache basic)
(mode-cache symbol)
(mode-param1 handle)
(mode-param2 uint64)
(mode-param3 uint64)
(major-mode-exit-hook (function none :behavior target))
(major-mode-event-hook (function none :behavior target))
(major-mode-event-hook (function process int symbol event-message-block object :behavior target))
(sub-mode-exit-hook (function none :behavior target))
(ext-geo-control external-art-buffer)
(pending-ext-geo target-geo)
@ -326,8 +341,8 @@
(tobot-state state)
(tobot? symbol)
(tobot-recorder basic)
(target-effect uint64)
(color-effect basic)
(target-effect target-effect)
(color-effect symbol)
(color-effect-start-time time-frame)
(color-effect-duration time-frame)
(racer racer-info)

View File

@ -404,7 +404,7 @@
;; og:preserve-this process cast
(set! arg0 (the process (and (and (focus-test? self dark)
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) (darkjak-stage bomb0))
(logtest? (-> self darkjak stage) (darkjak-stage active))
)
arg0
)
@ -879,7 +879,7 @@
(target-powerup-effect (the-as symbol (-> arg3 param 0)))
)
(('color-effect)
(set! (-> self color-effect) (the-as basic (-> arg3 param 0)))
(set! (-> self color-effect) (the-as symbol (-> arg3 param 0)))
(set-time! (-> self color-effect-start-time))
(set! v0-0 (-> arg3 param 1))
(set! (-> self color-effect-duration) (the-as time-frame v0-0))
@ -1098,11 +1098,11 @@
)
(('no-load-wait)
(set! v0-0 (+ (current-time) (the-as time-frame (-> arg3 param 0))))
(set! (-> self no-load-wait) (the-as uint v0-0))
(set! (-> self no-load-wait) (the-as time-frame v0-0))
v0-0
)
(('no-look-around)
(set! (-> self no-look-around-wait) (the-as uint (+ (current-time) (the-as time-frame (-> arg3 param 0)))))
(set! (-> self no-look-around-wait) (+ (current-time) (the-as time-frame (-> arg3 param 0))))
(if (and (-> self next-state) (= (-> self next-state name) 'target-look-around))
(send-event self 'end-mode 'in-head)
)
@ -1250,7 +1250,7 @@
)
(or (logtest? (-> self target-flags) (target-flags tf1))
(focus-test? self dead dangerous hit grabbed in-head edge-grab pole flut tube board pilot mech)
(>= (the-as time-frame (-> self no-load-wait)) (current-time))
(>= (-> self no-load-wait) (current-time))
)
)
)

View File

@ -195,18 +195,18 @@
(-> self invisible-interp)
)
(set! (-> self draw shadow-ctrl settings shadow-dir w) (-> self invisible-shadow-dir-backup w))
(logand! (-> self target-effect) -2)
(logclear! (-> self target-effect) (target-effect te0))
(if (= (-> self invisible-interp) 1.0)
(logior! (-> self target-effect) 1)
(logior! (-> self target-effect) (target-effect te0))
)
(if (and (time-elapsed? (-> self invisible-start-time) (+ (-> self invisible-duration) (seconds -2)))
(< (mod (- (current-time) (-> self invisible-start-time)) 60) 30)
)
(logand! (-> self target-effect) -2)
(logclear! (-> self target-effect) (target-effect te0))
)
)
((!= (-> self invisible-interp) 0.0)
(logand! (-> self target-effect) -2)
(logclear! (-> self target-effect) (target-effect te0))
(seek! (-> self invisible-interp) 0.0 (* 0.5 (seconds-per-frame)))
)
)
@ -523,9 +523,9 @@
(the-as skeleton-group (art-group-get-by-name *level* "skel-dark-maker-idol" (the-as (pointer level) #f)))
(the-as pair 0)
)
;; (if (task-node-closed? (game-task-node volcano-darkeco-resolution))
;; (set! (-> this part) (create-launch-control (-> *part-group-id-table* 82) this))
;; )
(if (task-node-closed? (game-task-node volcano-darkeco-resolution))
(set! (-> this part) (create-launch-control (-> *part-group-id-table* 82) this))
)
(set! (-> this humming-sound) (new 'process 'ambient-sound "dark-maker-amb" (-> this root trans) 0.0))
(set-falloff-far! (-> this humming-sound) 122880.0)
(update-vol! (-> this humming-sound) 0.8)

View File

@ -1123,8 +1123,8 @@
(let ((f30-0 (-> self lightjak-interp)))
(cond
((< 0.0 f30-0)
(logior! (-> self target-effect) 2)
(logior! (-> self target-effect) 16)
(logior! (-> self target-effect) (target-effect te1))
(logior! (-> self target-effect) (target-effect te4))
(sound-play-by-name
(static-sound-name "ltjak-chill")
(the-as sound-id (-> self lightjak tone))
@ -1136,7 +1136,7 @@
)
)
(else
(when (logtest? (-> self target-effect) 2)
(when (logtest? (-> self target-effect) (target-effect te1))
(let ((v1-14 (get-status *gui-control* (the-as sound-id (-> self lightjak on-off)))))
(cond
((= v1-14 (gui-status ready))
@ -1205,8 +1205,8 @@
(part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 176) :target self :mat-joint 6)
)
)
(logand! (-> self target-effect) -3)
(logand! (-> self target-effect) -17)
(logclear! (-> self target-effect) (target-effect te1))
(logclear! (-> self target-effect) (target-effect te4))
)
)
(when (and (< 0.0 f30-0) (and (not (focus-test? self in-head))

View File

@ -461,7 +461,7 @@
)
)
((-> self major-mode-event-hook)
((-> self major-mode-event-hook))
((-> self major-mode-event-hook) proc argc message block)
)
(else
(target-generic-event-handler proc argc message block)

View File

@ -379,7 +379,6 @@
(go target-demo)
)
(('title)
enter-state
(go target-title #f)
)
(('grab)
@ -1219,7 +1218,7 @@
(defstate target-eco-powerup (target)
:event target-standard-event-handler
:exit (behavior ()
(logand! (-> self target-effect) -101)
(logclear! (-> self target-effect) (target-effect te2 te5 te6))
(target-exit)
)
:trans (behavior ()
@ -1228,10 +1227,10 @@
:code (behavior ((arg0 int) (arg1 float))
(case arg0
((8)
(logior! (-> self target-effect) 36)
(logior! (-> self target-effect) (target-effect te2 te5))
)
((7)
(logior! (-> self target-effect) 64)
(logior! (-> self target-effect) (target-effect te6))
)
)
(set! (-> self neck flex-blend) 0.0)

View File

@ -1710,13 +1710,7 @@
)
)
(when s3-0
(let* ((s2-2 s5-0)
(s1-0 (method-of-object s2-2 trail-graph-method-29))
)
(target-pos 0)
(-> s4-0 cached-info)
(s1-0 s2-2)
)
(trail-graph-method-29 s5-0 (target-pos 0) s3-0 (-> s4-0 cached-info))
(set! (-> s4-0 search-id) (-> s5-0 search-id))
)
)
@ -1726,15 +1720,9 @@
(countdown (v1-33 6)
(let ((s4-1 (-> this trail v1-33)))
(when (and (= (-> s4-1 search-id) (-> s5-0 search-id)) (-> s4-1 used-by))
(let* ((a0-29 s5-0)
(t9-5 (method-of-object a0-29 trail-graph-method-21))
)
(-> s4-1 node-id)
64
(&-> s4-1 goal-node-id)
(&-> s4-1 node-path-dist)
(set! (-> s4-1 node-count) (the-as int (t9-5 a0-29)))
)
(set! (-> s4-1 node-count)
(trail-graph-method-21 s5-0 (-> s4-1 node-id) 64 (&-> s4-1 goal-node-id) (&-> s4-1 node-path-dist))
)
(set! (-> s4-1 last-updated) (the-as uint (current-time)))
(goto cfg-64)
)
@ -1745,6 +1733,8 @@
)
)
)
;; og:preserve-this added in PC port: they timed stuff, we just allow it to run a fixed number of iterations.
(+! v1-1 100)
(.mfc0 v1-1 Count)
)
)

View File

@ -268,10 +268,11 @@
(cgo-file "railf.gd" common-dep)
(cgo-file "railx.gd" common-dep)
; ;; precursor
(cgo-file "lmech.gd" common-dep)
(cgo-file "preca.gd" common-dep)
(cgo-file "precb.gd" common-dep)
(cgo-file "precc.gd" common-dep)
;; (cgo-file "precd.gd" common-dep)
(cgo-file "precd.gd" common-dep)
; ;; title/intro
(cgo-file "win.gd" common-dep) ;; wasintro
(cgo-file "title.gd" common-dep)
@ -357,7 +358,6 @@
(cgo-file "ljndklev.gd" common-dep)
(cgo-file "lkeira.gd" common-dep)
(cgo-file "lkleever.gd" common-dep)
(cgo-file "lmech.gd" common-dep)
(cgo-file "lmhca.gd" common-dep)
(cgo-file "lmhcb.gd" common-dep)
(cgo-file "lnstcst.gd" common-dep)
@ -394,6 +394,17 @@
(cgo-file "lwlandm.gd" common-dep)
(cgo-file "lwstdpck.gd" common-dep)
;;;;;;;;;;;;;;;;;;;;;;;;;
;; Example Custom Level
;;;;;;;;;;;;;;;;;;;;;;;;;
;; Set up the build system to build the level geometry
;; this path is relative to the custom_levels/jak3 folder
;; it should point to the .jsonc file that specifies the level.
(build-custom-level "test-zone")
;; the DGO file
(custom-level-cgo "TSZ.DGO" "test-zone/testzone.gd")
;;;;;;;;;;;;;;;;;;;;;
;; ANIMATIONS
;;;;;;;;;;;;;;;;;;;;;

View File

@ -2245,6 +2245,8 @@
(the (state process) (new 'static 'state
:name 'dead-state
:next #f
;; og:preserve-this added parent
:parent #f
:exit #f
:code #f
:trans #f

View File

@ -3722,7 +3722,6 @@
)
;; WARN: Return type mismatch object vs none.
(defbehavior bombbot-init-by-other bombbot ((arg0 bombbot-spawn-params))
(stack-size-set! (-> self main-thread) 512)
(set! (-> self city-path) (-> arg0 path))
@ -3744,7 +3743,6 @@
(set! (-> self shoot-duration) 1.0)
(set! (-> self draw light-index) (the-as uint 10))
(go-virtual hostile)
(none)
)
(defmethod send-attack-on-jump-or-knocked ((this bombbot) (arg0 process) (arg1 event-message-block))

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@
;; name in dgo: trail-h
;; dgos: GAME
;; +++trail-node-flag
(defenum trail-node-flag
:type uint8
:bitfield #t
@ -12,7 +13,10 @@
(tnf1 1)
(tnf2 2)
)
;; ---trail-node-flag
;; +++conn-flag
(defenum conn-flag
:type uint8
:bitfield #t
@ -20,7 +24,12 @@
(cf1 1)
(cf2 2)
(cf3 3)
(cf4 4)
(cf5 5)
(cf6 6)
)
;; ---conn-flag
(declare-type trail-graph basic)
@ -42,7 +51,7 @@
:pack-me
(:methods
(get-dist-score (_type_ vector) uint)
(debug-draw (_type_ int) none)
(debug-draw (_type_ int) symbol)
(get-position (_type_ vector) vector)
)
)
@ -122,7 +131,7 @@
(deftype trail-cached-start-pov (structure)
((last-updated uint64)
((last-updated time-frame)
(pov-can-see-start uint64)
(next-node-id int32)
(start-pos vector :inline)
@ -146,12 +155,12 @@
(conn-mask uint8)
(node (inline-array trail-node))
(conn (inline-array trail-conn))
(blocker uint32)
(blocker (inline-array trail-blocker))
(conn-ids (pointer uint16))
(visgroup (inline-array trail-conn-hash-cell))
(visnode-ids (pointer uint16))
(conn-hash trail-conn-hash)
(cell-pov-bit-arrays uint32)
(cell-pov-bit-arrays (pointer uint64))
(pov-can-see-goal uint64)
(cached-start-pov trail-cached-start-pov :inline)
(orig-start-pos vector :inline)
@ -164,31 +173,31 @@
(closed-bits vector16ub 2 :inline :overlay-at closed-quads)
)
(:methods
(trail-graph-method-9 (_type_ int) none)
(trail-graph-method-10 (_type_ int) none)
(trail-graph-method-9 (_type_ int) int)
(trail-graph-method-10 (_type_ int) symbol)
(trail-graph-method-11 (_type_ int int) trail-node)
(trail-graph-method-12 (_type_) none)
(trail-graph-method-13 (_type_ vector vector) none)
(debug-draw (_type_) none)
(trail-graph-method-15 (_type_ int) none)
(trail-graph-method-16 (_type_ int (pointer uint16) vector vector rgba float) none)
(trail-graph-method-17 (_type_) none)
(trail-graph-method-12 (_type_ trail-node vector) symbol)
(trail-graph-method-13 (_type_ vector vector) symbol)
(debug-draw (_type_) symbol)
(trail-graph-method-15 (_type_ int) symbol)
(trail-graph-method-16 (_type_ int (pointer uint16) vector vector rgba float) symbol)
(trail-graph-method-17 (_type_ vector vector) int)
(trail-graph-method-18 (_type_ vector) int)
(trail-graph-method-19 (_type_) none)
(trail-graph-method-20 (_type_ uint vector) none)
(trail-graph-method-21 (_type_) none)
(trail-graph-method-22 (_type_) none)
(trail-graph-method-23 (_type_) none)
(trail-graph-method-24 (_type_) none)
(trail-graph-method-25 (_type_ int) none)
(trail-graph-method-26 (_type_) none)
(trail-graph-method-27 (_type_) none)
(trail-graph-method-28 (_type_) none)
(trail-graph-method-29 (_type_) none)
(trail-graph-method-30 (_type_) none)
(trail-graph-method-20 (_type_ uint vector) vector)
(trail-graph-method-21 (_type_ (pointer uint16) int (pointer int32) (pointer float)) int)
(trail-graph-method-22 (_type_ int int) symbol)
(trail-graph-method-23 (_type_) symbol)
(trail-graph-method-24 (_type_ uint vector int int) symbol)
(trail-graph-method-25 (_type_ int) int)
(trail-graph-method-26 (_type_) int)
(trail-graph-method-27 (_type_) int)
(trail-graph-method-28 (_type_ trail-conn-search int int) symbol)
(trail-graph-method-29 (_type_ vector vector trail-cached-search-info) int)
(trail-graph-method-30 (_type_) int)
(trail-graph-method-31 (_type_ int) none)
(trail-graph-method-32 (_type_) none)
(trail-graph-method-33 (_type_) none)
(trail-graph-method-32 (_type_) uint)
(trail-graph-method-33 (_type_ int) symbol)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,51 @@
;; DECOMP BEGINS
(define *assault-cams* (new 'static 'boxed-array :type assault-cam-info
(new 'static 'assault-cam-info
:pos (new 'static 'vector :x -190874.02 :y 106024.96 :z 5588420.0 :w 1.0)
:mat (new 'static 'matrix
:rvec (new 'static 'vector :x -0.80696344 :z 0.5906011)
:uvec (new 'static 'vector :x -0.36253208 :y 0.7894338 :z -0.49534297)
:fvec (new 'static 'vector :x -0.46624056 :y -0.61383563 :z -0.63704425)
:trans (new 'static 'vector :w 1.0)
)
)
(new 'static 'assault-cam-info
:pos (new 'static 'vector :x 423746.34 :y 149545.38 :z 7161433.5 :w 1.0)
:mat (new 'static 'matrix
:rvec (new 'static 'vector :x -0.0033539534 :z 0.9999943)
:uvec (new 'static 'vector :x -0.8762458 :y 0.4818552 :z -0.0029389048)
:fvec (new 'static 'vector :x -0.4818526 :y -0.87625074 :z -0.0016161203)
:trans (new 'static 'vector :w 1.0)
)
)
(new 'static 'assault-cam-info
:pos (new 'static 'vector :x 754367.3 :y 136453.73 :z 5612391.0 :w 1.0)
:mat (new 'static 'matrix
:rvec (new 'static 'vector :x -0.91507846 :z -0.4032754)
:uvec (new 'static 'vector :x 0.34681395 :y 0.51030624 :z -0.7869609)
:fvec (new 'static 'vector :x 0.20579405 :y -0.8599926 :z -0.46697044)
:trans (new 'static 'vector :w 1.0)
)
)
(new 'static 'assault-cam-info
:pos (new 'static 'vector :x 1701028.2 :y 180959.23 :z 5565024.5 :w 1.0)
:mat (new 'static 'matrix
:rvec (new 'static 'vector :x -0.80724764 :z -0.59021246)
:uvec (new 'static 'vector :x 0.4939913 :y 0.54724586 :z -0.67564356)
:fvec (new 'static 'vector :x 0.32299143 :y -0.8369716 :z -0.44176307)
:trans (new 'static 'vector :w 1.0)
)
)
(new 'static 'assault-cam-info
:pos (new 'static 'vector :x -311586.8 :y 110921.73 :z 5417229.0 :w 1.0)
:mat (new 'static 'matrix
:rvec (new 'static 'vector :x -0.8088231 :z 0.58805186)
:uvec (new 'static 'vector :x -0.42552334 :y 0.69020355 :z -0.5852767)
:fvec (new 'static 'vector :x -0.4058755 :y -0.7236152 :z -0.5582527)
:trans (new 'static 'vector :w 1.0)
)
)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,145 @@
;; DECOMP BEGINS
(define *assault-rooms* (new 'static 'boxed-array :type assault-room :length 0 :allocated-length 5))
(set! (-> *assault-rooms* length) (-> *assault-rooms* allocated-length))
(set! (-> *assault-rooms* 0)
(new 'static 'assault-room :center-pos (new 'static 'vector :x -240257.03 :y 36409.344 :z 5520792.5 :w 1.0))
)
(set! (-> *assault-rooms* 0 cam-info) (-> *assault-cams* 0))
(set! (-> *assault-rooms* 0 collision) (new 'static 'assault-room-collision
:cam-matrix (new 'static 'matrix
:rvec (new 'static 'vector :x -0.80696344 :z 0.5906011)
:uvec (new 'static 'vector :x -0.36253208 :y 0.7894338 :z -0.49534297)
:fvec (new 'static 'vector :x -0.46624056 :y -0.61383563 :z -0.63704425)
:trans (new 'static 'vector :w 1.0)
)
:cam-pos (new 'static 'vector :x -190874.02 :y 106024.96 :z 5588420.0 :w 1.0)
:clip-dists (new 'static 'triangle-dists :dist0 30608.953 :dist1 40000.055)
:hoz-clip-dist 75502.086
)
)
(set! (-> *assault-rooms* 0 node-positions)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -320432.12 :y 39460.863 :z 5583748.0 :w 1.0)
(new 'static 'vector :x -157367.1 :y 35726.54 :z 5467749.0 :w 1.0)
)
)
(set! (-> *assault-rooms* 1)
(new 'static 'assault-room :center-pos (new 'static 'vector :x 371519.1 :y 35597.105 :z 7164435.0 :w 1.0))
)
(set! (-> *assault-rooms* 1 cam-info) (-> *assault-cams* 1))
(set! (-> *assault-rooms* 1 collision)
(new 'static 'assault-room-collision
:cam-matrix (new 'static 'matrix
:rvec (new 'static 'vector :x -0.0033539534 :z 0.9999943)
:uvec (new 'static 'vector :x -0.8762458 :y 0.4818552 :z -0.0029389048)
:fvec (new 'static 'vector :x -0.4818526 :y -0.87625074 :z -0.0016161203)
:trans (new 'static 'vector :w 1.0)
)
:cam-pos (new 'static 'vector :x 423746.75 :y 149545.38 :z 7161433.5 :w 1.0)
:clip-dists (new 'static 'triangle-dists :dist0 38132.883 :dist1 60766.504)
:hoz-clip-dist 84132.84
)
)
(set! (-> *assault-rooms* 1 node-positions)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 451624.56 :y 37709.004 :z 7164598.5 :w 1.0)
(new 'static 'vector :x 314352.03 :y 35603.25 :z 7283629.0 :w 1.0)
(new 'static 'vector :x 319363.06 :y 35609.395 :z 7031069.5 :w 1.0)
)
)
(set! (-> *assault-rooms* 2)
(new 'static 'assault-room :center-pos (new 'static 'vector :x 785399.4 :y 35733.504 :z 5553110.0 :w 1.0))
)
(set! (-> *assault-rooms* 2 cam-info) (-> *assault-cams* 2))
(set! (-> *assault-rooms* 2 collision) (new 'static 'assault-room-collision
:cam-matrix (new 'static 'matrix
:rvec (new 'static 'vector :x -0.91507846 :z -0.4032754)
:uvec (new 'static 'vector :x 0.34681395 :y 0.51030624 :z -0.7869609)
:fvec (new 'static 'vector :x 0.20579405 :y -0.8599926 :z -0.46697044)
:trans (new 'static 'vector :w 1.0)
)
:cam-pos (new 'static 'vector :x 754367.3 :y 136454.14 :z 5612391.5 :w 1.0)
:clip-dists (new 'static 'triangle-dists :dist0 34730.176 :dist1 57014.51)
:hoz-clip-dist 76124.41
)
)
(set! (-> *assault-rooms* 2 node-positions)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 784477.8 :y 35810.508 :z 5431458.0 :w 1.0)
(new 'static 'vector :x 684347.0 :y 35715.89 :z 5563923.0 :w 1.0)
(new 'static 'vector :x 882867.8 :y 36161.125 :z 5581003.0 :w 1.0)
)
)
(set! (-> *assault-rooms* 3)
(new 'static 'assault-room :center-pos (new 'static 'vector :x 1754726.0 :y 35726.95 :z 5489334.5 :w 1.0))
)
(set! (-> *assault-rooms* 3 cam-info) (-> *assault-cams* 3))
(set! (-> *assault-rooms* 3 collision) (new 'static 'assault-room-collision
:cam-matrix (new 'static 'matrix
:rvec (new 'static 'vector :x -0.80724764 :z -0.59021246)
:uvec (new 'static 'vector :x 0.4939913 :y 0.54724586 :z -0.67564356)
:fvec (new 'static 'vector :x 0.32299143 :y -0.8369716 :z -0.44176307)
:trans (new 'static 'vector :w 1.0)
)
:cam-pos (new 'static 'vector :x 1701028.2 :y 180959.23 :z 5565024.5 :w 1.0)
:clip-dists (new 'static 'triangle-dists :dist0 51394.637 :dist1 87897.0)
:hoz-clip-dist 111438.664
)
)
(set! (-> *assault-rooms* 3 node-positions)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x 1655123.5 :y 35728.18 :z 5430803.0 :w 1.0)
(new 'static 'vector :x 1852997.2 :y 35795.76 :z 5552741.0 :w 1.0)
(new 'static 'vector :x 1711406.8 :y 42685.234 :z 5560278.0 :w 1.0)
)
)
(set! (-> *assault-rooms* 4)
(new 'static 'assault-room :center-pos (new 'static 'vector :x -359565.3 :y 41573.17 :z 5346835.0 :w 1.0))
)
(set! (-> *assault-rooms* 4 cam-info) (-> *assault-cams* 4))
(set! (-> *assault-rooms* 4 collision) (new 'static 'assault-room-collision
:cam-matrix (new 'static 'matrix
:rvec (new 'static 'vector :x -0.8088231 :z 0.58805186)
:uvec (new 'static 'vector :x -0.42552334 :y 0.69020355 :z -0.5852767)
:fvec (new 'static 'vector :x -0.4058755 :y -0.7236152 :z -0.5582527)
:trans (new 'static 'vector :w 1.0)
)
:cam-pos (new 'static 'vector :x -311586.9 :y 110922.0 :z 5417229.5 :w 1.0)
:clip-dists (new 'static 'triangle-dists :dist0 29167.535 :dist1 61501.04)
:hoz-clip-dist 59058.156
)
)
(set! (-> *assault-rooms* 4 node-positions)
(new 'static 'boxed-array :type vector
(new 'static 'vector :x -318851.9 :y 40452.914 :z 5403400.5 :w 1.0)
(new 'static 'vector :x -350418.94 :y 43542.938 :z 5425846.5 :w 1.0)
(new 'static 'vector :x -292352.4 :y 42613.145 :z 5385706.5 :w 1.0)
(new 'static 'vector :x -426024.56 :y 43729.305 :z 5323487.5 :w 1.0)
(new 'static 'vector :x -350490.22 :y 43717.02 :z 5272411.0 :w 1.0)
(new 'static 'vector :x -326335.7 :y 43717.02 :z 5312429.0 :w 1.0)
(new 'static 'vector :x -406911.38 :y 43717.02 :z 5361293.5 :w 1.0)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,216 @@
;; DECOMP BEGINS
(deftype assault-cam-info (structure)
((pos vector :inline)
(mat matrix :inline)
)
)
(deftype triangle-dists (structure)
((dist0 float)
(dist1 float)
)
)
(deftype assault-room-collision (structure)
((cam-matrix matrix :inline)
(cam-pos vector :inline)
(clip-dists triangle-dists :inline)
(hoz-clip-dist float)
)
)
(deftype assault-room (structure)
((center-pos vector :inline)
(cam-info assault-cam-info)
(collision assault-room-collision)
(node-positions (array vector))
)
)
(define *assault-speech-list* (new 'static 'inline-array talker-speech-class 22
(new 'static 'talker-speech-class :name "none")
(new 'static 'talker-speech-class
:name "torn102"
:channel (gui-channel voicebox)
:speech #x1
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn202"
:channel (gui-channel voicebox)
:speech #x2
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn122"
:channel (gui-channel voicebox)
:speech #x3
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn133"
:channel (gui-channel voicebox)
:speech #x4
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn203"
:channel (gui-channel voicebox)
:speech #x5
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn116"
:channel (gui-channel voicebox)
:speech #x6
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn192"
:channel (gui-channel voicebox)
:speech #x7
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn205"
:channel (gui-channel voicebox)
:speech #x8
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn198"
:channel (gui-channel voicebox)
:speech #x9
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn154"
:channel (gui-channel voicebox)
:speech #xa
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn194"
:channel (gui-channel rider)
:speech #xb
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "torn117"
:channel (gui-channel rider)
:speech #xc
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "assault-protect-civilians"
:channel (gui-channel message)
:speech #xd
:text-duration (seconds 4)
:neg #x1
:text-message (text-id text-06de)
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "dax238"
:channel (gui-channel daxter)
:flags (talker-flags tf0)
:speech #xe
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "dax353"
:channel (gui-channel daxter)
:speech #xf
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "dax330"
:channel (gui-channel daxter)
:speech #x10
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "dax577"
:channel (gui-channel daxter)
:speech #x11
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "tor001"
:channel (gui-channel voicebox)
:speech #x12
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "grds178a"
:channel (gui-channel guard)
:flags (talker-flags tf0)
:speech #x13
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "grds178b"
:channel (gui-channel guard)
:flags (talker-flags tf0)
:speech #x14
:neg #x1
:on-close #f
:camera #f
)
(new 'static 'talker-speech-class
:name "grds103a"
:channel (gui-channel guard)
:speech #x15
:neg #x1
:on-close #f
:camera #f
)
)
)
(deftype assault-speech-instance (speech-instance)
()
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,571 @@
;; DECOMP BEGINS
(deftype task-manager-protect-hq (task-manager)
((gunships handle 2)
(spawn-records (array proc-focusable-spawner))
(spawn-index int8)
(death-count int8)
)
(:state-methods
fight-gunship
fight-gunship-2
wait-finish
)
(:methods
(gunship-spawn (_type_ protect-gunship-enemy-spawn-params) object)
(spawn-gunship (_type_ vector int float) handle)
(get-spawn-pos-for-ship (_type_ vector vector symbol) vector)
)
)
(define *protect-object-count*
(new 'static 'boxed-array :type int32 :length 13 :allocated-length 17 0 0 0 0 0 0 0 0 0 8 8 8 0)
)
(defmethod init! ((this task-manager-protect-hq))
(set-setting! 'music 'factoryb 0.0 0)
(set-setting! 'gun-target-guards? #f 0.0 0)
(set! (-> this spawn-records) (new 'process 'boxed-array proc-focusable-spawner 17))
(set-setting! 'disable-parking-spots? #t 0.0 0)
(dotimes (v1-7 2)
(set! (-> this gunships v1-7) (the-as handle #f))
(set! (-> *active-gunships* v1-7 proc) (the-as handle #f))
)
(dotimes (s5-0 17)
(set! (-> this spawn-records s5-0) (new 'process 'proc-focusable-spawner))
(alloc-records! (-> this spawn-records s5-0) (-> *protect-object-count* s5-0) 'process)
)
(set-setting! 'extra-bank '((cityhq3 citykg)) 0.0 0)
(set! (-> this spawn-index) 0)
(set-cloud-and-fog-interp! *mood-control* 1.0 1.0 50.0 50.0)
(set-time-for-random-weather! *mood-control* 100000000.0 100000000.0)
(send-event (ppointer->process *time-of-day*) 'change 'hour 16)
(send-event (ppointer->process *time-of-day*) 'change 'ratio 2.0)
(call-parent-method this)
(none)
)
(defmethod relocate ((this task-manager-protect-hq) (offset int))
(dotimes (v1-0 17)
(if (nonzero? (-> this spawn-records v1-0))
(&+! (-> this spawn-records v1-0) offset)
)
)
(if (nonzero? (-> this spawn-records))
(&+! (-> this spawn-records) offset)
)
(call-parent-method this offset)
)
(defun protect-type->type ((arg0 gunship-cmd-spawn-type))
(case arg0
(((gunship-cmd-spawn-type guard-tazer)
(gunship-cmd-spawn-type guard-rifle)
(gunship-cmd-spawn-type guard-grenade)
)
crimson-guard
)
(((gunship-cmd-spawn-type grunt))
metalhead-grunt
)
(((gunship-cmd-spawn-type flitter))
metalhead-flitter
)
(((gunship-cmd-spawn-type unknown))
metalhead-predator
)
(((gunship-cmd-spawn-type roboguard))
roboguard-city
)
(((gunship-cmd-spawn-type turret))
flying-turret
)
(((gunship-cmd-spawn-type spydroid))
spydroid
)
(else
(the-as type #f)
)
)
)
(define *protect-levels* (new 'static 'boxed-array :type symbol :length 12 :allocated-length 17
'#f
'ctypepa
'ctypepa
'ctypesa
'ctypesa
'ctypesa
'ctypesb
'ctypesb
'ctypepb
'ctypesc
'ctypesc
'ctypesc
)
)
;; WARN: Return type mismatch int vs handle.
(defun spawn-protect-enemy ((arg0 int) (arg1 process))
(if (logtest? (process-mask enemy guard) (-> *kernel-context* prevent-from-run))
(return (the-as handle #f))
)
(let ((s4-0 (new 'stack-no-clear 'traffic-object-spawn-params)))
(set! (-> s4-0 velocity quad) (the-as uint128 0))
(set! (-> s4-0 behavior) (the-as uint 1))
(set! (-> s4-0 object-type) (city-target-type->traffic-object-type (the-as city-target-type arg0)))
(set! (-> s4-0 flags) (traffic-spawn-flags))
(logior! (-> s4-0 flags) (traffic-spawn-flags tsf7))
(set! (-> s4-0 nav-branch) #f)
(set! (-> s4-0 guard-type) (the-as uint 0))
(let ((s5-1 (get-process *default-dead-pool* (protect-type->type (the-as gunship-cmd-spawn-type arg0)) #x4000 1)))
(the-as handle (ppointer->handle (when s5-1
(let ((t9-3 (method-of-type process activate)))
(t9-3 s5-1 arg1 "protect-enemy" (the-as pointer #x70004000))
)
(run-now-in-process s5-1 citizen-init-by-other s4-0)
(-> s5-1 ppointer)
)
)
)
)
)
)
(defstate wait (task-manager-protect-hq)
:virtual #t
:enter (behavior ()
(set-blackout-frames (seconds 10))
(let ((t9-2 (-> (find-parent-state) enter)))
(if t9-2
(t9-2)
)
)
)
)
(defstate active (task-manager-protect-hq)
:virtual #t
:enter (behavior ()
(set-setting! 'city-sound '(cityprot) 0.0 2)
(set-setting! 'exclusive-task #f 0.0 (-> self node-info task))
(set-setting! 'airlock #f 0.0 0)
(let ((v1-8 (get-hatred-at-idx *cty-attack-controller* 9 0)))
(set! (-> v1-8 hatred) 1.0)
(set! (-> v1-8 hatred-dist) 245760.0)
(set! (-> v1-8 dist-scale) 0.25)
(set! (-> v1-8 attacker-scale) 0.0)
(set! (-> v1-8 max-consider-dist) 12288000.0)
)
(set! (-> *cty-attack-controller* target-attacker max-num-attackers) (the-as uint 100))
(let ((gp-0 (push-back-hatred *cty-attack-controller*)))
(set! (-> gp-0 hatred) 0.3)
(set! (-> gp-0 hatred-dist) 491520.0)
(set! (-> gp-0 dist-scale) 0.25)
(set! (-> gp-0 attacker-scale) 0.01)
(set! (-> gp-0 max-consider-dist) 12288000.0)
(set-hatred-indices *cty-attack-controller* gp-0 4 13)
(set-hatred-indices *cty-attack-controller* gp-0 3 13)
(set-hatred-indices *cty-attack-controller* gp-0 5 13)
)
)
:trans (behavior ()
((-> (method-of-type task-manager active) trans))
)
:code (behavior ()
(while (< (-> self spawn-index) (-> self spawn-records length))
(dotimes (gp-0 (-> self spawn-records (-> self spawn-index) records length))
(set! (-> self spawn-records (-> self spawn-index) records data gp-0 proc)
(spawn-protect-enemy (-> self spawn-index) self)
)
)
(+! (-> self spawn-index) 1)
(suspend)
)
(go-virtual fight-gunship)
)
)
(define *gunship-start-positions*
(new 'static 'boxed-array :type vector (new 'static 'vector :x 2304696.2 :y 40345.6 :z -2179358.8 :w 1.0))
)
(defstate fight-gunship (task-manager-protect-hq)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('gunship-destroyed)
(go-virtual fight-gunship-2)
)
(else
(task-manager-event-handler proc argc message block)
)
)
)
:enter (behavior ()
(ff-squad-control-method-56 *ff-squad-control* 0 0 0)
(ff-squad-control-method-56 *ff-squad-control* 1 4 4)
(let ((a1-3 (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) *zero-vector* #t)))
(set! (-> self gunships 0) (spawn-gunship self a1-3 0 0.0))
)
)
:trans (behavior ()
(if (< 1228800.0 (vector-vector-xz-distance (target-pos 0) (-> *gunship-start-positions* 0)))
(send-event self 'fail)
)
((-> (method-of-type task-manager active) trans))
(dotimes (gp-1 (-> self spawn-records length))
(check-inactive (-> self spawn-records gp-1))
)
)
:code (behavior ()
(suspend)
(set-blackout-frames 0)
(sleep-code)
)
)
(define *fountain-center-pos* (new 'static 'vector :x 2298060.8 :y 31825.92 :z -2276925.5 :w 1.0))
(defmethod get-spawn-pos-for-ship ((this task-manager-protect-hq) (arg0 vector) (arg1 vector) (arg2 symbol))
(let ((s5-0 0))
(let ((f30-0 409600000.0))
(dotimes (s2-0 (-> *protect-path* length))
(let ((s1-0 (-> *protect-path* s2-0)))
0.0
(when (and (< 122880.0 (vector-vector-xz-distance (target-pos 0) s1-0))
(or (< (vector-length arg1) 4096.0) (< 122880.0 (vector-vector-xz-distance arg1 s1-0)))
)
(let ((a0-6 (new 'stack 'sphere)))
(set! (-> a0-6 quad) (-> s1-0 quad))
(+! (-> a0-6 y) 36864.0)
(set! (-> a0-6 r) 61440.0)
(when (or arg2 (not (sphere-in-view-frustum? a0-6)))
(let ((f0-7 (vector-vector-xz-distance s1-0 *fountain-center-pos*)))
(when (and (< 81920.0 f0-7) (< f0-7 f30-0))
(set! f30-0 f0-7)
(set! s5-0 s2-0)
)
)
)
)
)
)
)
)
(set! (-> arg0 quad) (-> *protect-path* s5-0 quad))
)
arg0
)
(defun get-protect-suck-t ()
(lerp-scale-clamp
0.0
1.0
(the float (-> *game-info* sub-task-list (game-task-node city-protect-hq-resolution) death-count))
3.0
10.0
)
)
;; WARN: Return type mismatch int vs handle.
(defmethod spawn-gunship ((this task-manager-protect-hq) (arg0 vector) (arg1 int) (arg2 float))
(let ((s5-0 (new 'stack-no-clear 'protect-gunship-init-params)))
(set! (-> s5-0 task-man) (process->handle this))
(set! (-> s5-0 script) *gunship-0-script*)
(set! (-> s5-0 num-stages) 2)
(set! (-> s5-0 self-index) arg1)
(set! (-> s5-0 difficulty) arg2)
(set! (-> s5-0 pos quad) (-> arg0 quad))
(quaternion-identity! (-> s5-0 quat))
(let ((f0-1 (get-protect-suck-t)))
(set! (-> s5-0 difficulty-scalar) (lerp 0.29 1.0 (- 1.0 f0-1)))
)
(the-as handle (ppointer->handle (process-spawn protect-gunship s5-0 :name "protect-gunship" :to this)))
)
)
(defstate wait-finish (task-manager-protect-hq)
:virtual #t
:event task-manager-event-handler
:enter (behavior ()
(dotimes (gp-0 17)
(dotimes (s5-0 (-> self spawn-records gp-0 records length))
(send-event
(handle->process (-> self spawn-records gp-0 records data s5-0 proc))
'attack
#f
(static-attack-info
:mask (vehicle-impulse-factor)
((id (new-attack-id)) (damage 16.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'explode))
)
)
)
)
)
:trans (behavior ()
((-> (method-of-type task-manager active) trans))
)
:code (behavior ()
(let ((gp-0 (current-time)))
(until (time-elapsed? gp-0 (seconds 1))
(suspend)
)
)
(talker-spawn-func (-> *talker-speech* 337) *entity-pool* (target-pos 0) (the-as region #f))
(let ((gp-2 (current-time)))
(until (time-elapsed? gp-2 (seconds 2.5))
(suspend)
)
)
(talker-spawn-func (-> *talker-speech* 336) *entity-pool* (target-pos 0) (the-as region #f))
(send-event self 'complete)
(sleep-code)
)
)
(defstate fight-gunship-2 (task-manager-protect-hq)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('gunship-destroyed)
(+! (-> self death-count) 1)
(if (= (-> self death-count) 2)
(go-virtual wait-finish)
)
)
(else
(task-manager-event-handler proc argc message block)
)
)
)
:enter (behavior ()
(ff-squad-control-method-56 *ff-squad-control* 0 0 0)
(ff-squad-control-method-56 *ff-squad-control* 1 7 7)
(let ((gp-0 (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) *zero-vector* #f)))
(dotimes (s5-0 2)
(set! (-> self gunships s5-0) (spawn-gunship self gp-0 s5-0 1.0))
(set! (-> gp-0 quad) (-> (get-spawn-pos-for-ship self (new 'stack-no-clear 'vector) gp-0 #f) quad))
)
)
)
:trans (behavior ()
(if (< 1228800.0 (vector-vector-xz-distance (target-pos 0) (-> *gunship-start-positions* 0)))
(send-event self 'fail)
)
((-> (method-of-type task-manager active) trans))
(dotimes (gp-1 (-> self spawn-records length))
(check-inactive (-> self spawn-records gp-1))
)
)
:code (behavior ()
(let ((gp-0 (current-time)))
(until (time-elapsed? gp-0 (seconds 1))
(suspend)
)
)
(talker-spawn-func (-> *talker-speech* 334) *entity-pool* (target-pos 0) (the-as region #f))
(sleep-code)
)
)
(defmethod gunship-spawn ((this task-manager-protect-hq) (arg0 protect-gunship-enemy-spawn-params))
(let ((gp-0 (new 'stack-no-clear 'traffic-object-spawn-params)))
(set! (-> gp-0 velocity quad) (the-as uint128 0))
(set! (-> gp-0 position quad) (-> arg0 pos quad))
(quaternion-copy! (-> gp-0 rotation) (-> arg0 quat))
(set! (-> gp-0 behavior) (the-as uint 6))
(set! (-> gp-0 object-type)
(city-target-type->traffic-object-type (the-as city-target-type (-> arg0 spawn-type)))
)
(set! (-> gp-0 flags) (traffic-spawn-flags))
(set! (-> gp-0 handle) (-> arg0 parent))
(set! (-> gp-0 user-data) (the-as uint 0))
(set! (-> gp-0 proc) #f)
(logior! (-> gp-0 flags) (traffic-spawn-flags tsf7))
(set! (-> gp-0 nav-branch) #f)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(let ((s2-0 (new 'stack-no-clear 'collide-query)))
(set! (-> s3-0 quad) (-> arg0 pos quad))
(vector+float*! (-> s2-0 start-pos) (-> arg0 pos) *up-vector* 24576.0)
(set! (-> s2-0 move-dist quad) (the-as uint128 0))
(set! (-> s2-0 move-dist y) -81920.0)
(let ((v1-11 s2-0))
(set! (-> v1-11 radius) 40.96)
(set! (-> v1-11 collide-with) (collide-spec backgnd))
(set! (-> v1-11 ignore-process0) #f)
(set! (-> v1-11 ignore-process1) #f)
(set! (-> v1-11 ignore-pat)
(new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1)
)
(set! (-> v1-11 action-mask) (collide-action solid))
)
(if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0)
(set! (-> s3-0 quad) (-> s2-0 best-other-tri intersect quad))
)
)
(set! (-> gp-0 nav-mesh) (find-nearest-nav-mesh-protect s3-0 (the-as float #x7f800000)))
)
(let ((v1-21 (get-last-unused-handle! (-> this spawn-records (-> arg0 spawn-type)))))
(send-event (handle->process v1-21) 'traffic-activate gp-0 *traffic-engine*)
)
)
)
(defmethod taskman-event-handler ((this task-manager-protect-hq) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-1 object))
(case arg2
(('count-active)
(let ((s5-1 0))
(dotimes (s4-1 (-> this spawn-records length))
(case (city-target-type->cty-faction (the-as city-target-type s4-1))
(((cty-faction mh) (cty-faction kg))
(+! s5-1
(- (-> this spawn-records s4-1 unused-list allocated-length) (-> this spawn-records s4-1 unused-list length))
)
)
)
)
(return s5-1)
)
v0-1
)
(('gunship-spawn)
(let ((a1-3 (-> arg3 param 0)))
(gunship-spawn this (the-as protect-gunship-enemy-spawn-params a1-3))
)
)
(else
(call-parent-method this arg0 arg1 arg2 arg3)
)
)
)
(deftype prot-crate (process-drawable)
((h-crate handle :offset 208)
(dummy-ent entity-actor)
)
(:state-methods
active
)
(:methods
(spawn-crate (_type_) handle)
)
)
(defmethod init-from-entity! ((this prot-crate) (arg0 entity-actor))
(set! (-> this root) (new 'process 'trsqv))
(process-drawable-from-entity! this arg0)
(set! (-> this entity) arg0)
(set! (-> this h-crate) (the-as handle #f))
(set! (-> this dummy-ent) (the-as entity-actor (entity-by-name "crate-1148")))
(go (method-of-object this active))
)
(defstate active (prot-crate)
:virtual #t
:trans (behavior ()
(if (handle->process (-> self h-crate))
(set-time! (-> self state-time))
)
(when (and (time-elapsed? (-> self state-time) (seconds 15)) (not (handle->process (-> self h-crate))))
(let ((a0-11 (new 'stack 'sphere)))
(set! (-> a0-11 quad) (-> self root trans quad))
(set! (-> a0-11 r) 8192.0)
(if (not (sphere-in-view-frustum? a0-11))
(spawn-crate self)
)
)
)
)
:code sleep-code
)
;; WARN: Return type mismatch int vs handle.
(defmethod spawn-crate ((this prot-crate))
(let ((s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'static 'fact-info))
)
(set! (-> s5-0 quad) (-> this root trans quad))
(set! (-> s5-0 w) 1.0)
(set! (-> s4-0 pickup-type) (pickup-type ammo-random))
(let ((f30-0 (get-protect-suck-t)))
(set! (-> s4-0 pickup-spawn-amount) (the float (the int (lerp 1.0 3.0 f30-0))))
(set! (-> s4-0 pickup-amount) 10.0)
(format 0 "Suck t is ~f, pickup spawn ~f~%" f30-0 (-> s4-0 pickup-spawn-amount))
(when *target*
(let ((f28-0 (/ (-> *target* fact health) (-> *target* fact health-max))))
0.0
(let* ((f0-9 (lerp 0.3 0.5 f30-0))
(f1-2 (- 1.0 f28-0))
(f1-3 (* f1-2 f1-2))
(f30-1 (lerp 0.0 f0-9 f1-3))
(v1-13 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-14 (the-as number (logior #x3f800000 v1-13)))
)
(when (< (+ -1.0 (the-as float v1-14)) f30-1)
(set! (-> s4-0 pickup-type) (pickup-type health))
(set! (-> s4-0 pickup-spawn-amount) (-> *FACT-bank* health-small-inc))
(if (and (< 0.9 f30-1) (let* ((v1-23 (/ (the-as int (rand-uint31-gen *random-generator*)) 256))
(v1-24 (the-as number (logior #x3f800000 v1-23)))
)
(< (+ -1.0 (the-as float v1-24)) 0.5)
)
)
(set! (-> s4-0 pickup-spawn-amount) (-> *FACT-bank* health-default-inc))
)
)
)
)
)
)
(let* ((s4-1
(ppointer->process (process-spawn crate (-> this entity) s5-0 'blue s4-0 :name "crate" :to *entity-pool*))
)
(s5-1 (if (type? s4-1 process-focusable)
s4-1
)
)
)
(let ((a0-18 s5-1))
(if a0-18
(process-entity-set! a0-18 (-> this dummy-ent))
)
)
(let ((v0-12 (process->handle s5-1)))
(set! (-> this h-crate) (the-as handle v0-12))
(the-as handle v0-12)
)
)
)
)
(defstate fail (task-manager-protect-hq)
:virtual #t
:enter (behavior ((arg0 resetter-params))
(let ((v1-0 *game-info*))
(set! (-> v1-0 gun-ammo 0) (fmax (-> v1-0 gun-ammo 0) (-> *FACT-bank* ammo-yellow-start)))
(set! (-> v1-0 gun-ammo 1) (fmax (-> v1-0 gun-ammo 1) (-> *FACT-bank* ammo-red-start)))
(set! (-> v1-0 gun-ammo 2) (fmax (-> v1-0 gun-ammo 2) (-> *FACT-bank* ammo-blue-start)))
(set! (-> v1-0 gun-ammo 3) (fmax (-> v1-0 gun-ammo 3) (-> *FACT-bank* ammo-dark-start)))
)
(let* ((t9-0 find-parent-method)
(a0-5 task-manager-protect-hq)
(t9-1 (-> (the-as (state resetter-params task-manager-protect-hq) (t9-0 a0-5 18)) enter))
)
(if t9-1
(t9-1 (the-as resetter-params a0-5))
)
)
)
)
;; WARN: Return type mismatch object vs none.
(defmethod task-manager-method-25 ((this task-manager-protect-hq))
(set-time-for-random-weather! *mood-control* 0.0 0.0)
(send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0)
(none)
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,37 @@
;; DECOMP BEGINS
(define *protect-path* (new 'static 'boxed-array :type vector
(new 'static 'vector :x 2211630.2 :y 22453.863 :z -2517228.8 :w 1.0)
(new 'static 'vector :x 2295778.5 :y 22453.863 :z -2456190.2 :w 1.0)
(new 'static 'vector :x 2446499.0 :y 22453.453 :z -2412481.8 :w 1.0)
(new 'static 'vector :x 2310667.5 :y 21837.004 :z -2087288.4 :w 1.0)
(new 'static 'vector :x 2148552.0 :y 22453.863 :z -2113359.0 :w 1.0)
(new 'static 'vector :x 2152553.8 :y 22453.863 :z -2376441.0 :w 1.0)
(new 'static 'vector :x 2515651.8 :y 21837.004 :z -2508594.5 :w 1.0)
(new 'static 'vector :x 2602777.8 :y 22453.863 :z -2511727.8 :w 1.0)
(new 'static 'vector :x 2831592.8 :y 21837.004 :z -1880559.2 :w 1.0)
(new 'static 'vector :x 2487184.5 :y 21837.004 :z -1848802.9 :w 1.0)
(new 'static 'vector :x 2380442.8 :y 21837.004 :z -1984007.8 :w 1.0)
(new 'static 'vector :x 2432462.0 :y 21837.004 :z -1985765.0 :w 1.0)
(new 'static 'vector :x 2299293.0 :y 21836.596 :z -2372226.2 :w 1.0)
(new 'static 'vector :x 2080341.6 :y 22453.453 :z -2027671.1 :w 1.0)
(new 'static 'vector :x 2017324.6 :y 22453.863 :z -2045197.9 :w 1.0)
(new 'static 'vector :x 2351111.2 :y 22453.863 :z -2034216.5 :w 1.0)
(new 'static 'vector :x 2449616.0 :y 22453.863 :z -2154450.0 :w 1.0)
(new 'static 'vector :x 2448837.8 :y 22453.863 :z -2273426.8 :w 1.0)
(new 'static 'vector :x 2518544.0 :y 22453.863 :z -2397093.0 :w 1.0)
(new 'static 'vector :x 2314292.5 :y 22453.863 :z -2181963.0 :w 1.0)
(new 'static 'vector :x 2300230.8 :y 22453.863 :z -2519006.5 :w 1.0)
(new 'static 'vector :x 2557939.0 :y 22453.863 :z -1909649.0 :w 1.0)
(new 'static 'vector :x 2473258.2 :y 22453.863 :z -1937055.4 :w 1.0)
(new 'static 'vector :x 2541858.0 :y 22453.863 :z -1848254.0 :w 1.0)
(new 'static 'vector :x 2211847.2 :y 22453.863 :z -2048368.2 :w 1.0)
(new 'static 'vector :x 2186792.2 :y 21836.596 :z -2284154.0 :w 1.0)
(new 'static 'vector :x 2247048.5 :y 21836.596 :z -2196921.5 :w 1.0)
(new 'static 'vector :x 2281217.2 :y 21836.596 :z -2032336.5 :w 1.0)
(new 'static 'vector :x 2398612.8 :y 21836.596 :z -2275601.5 :w 1.0)
(new 'static 'vector :x 2336705.8 :y 21836.596 :z -2370383.0 :w 1.0)
(new 'static 'vector :x 2144562.5 :y 22453.863 :z -2027876.0 :w 1.0)
)
)

View File

@ -5,5 +5,169 @@
;; name in dgo: protect-script
;; dgos: LCTYPROT
;; +++gunship-command
(defenum gunship-command
:type uint8
(spawn)
(wait)
(missiles)
(script-set-jump)
(script-jump)
(no-op)
(other)
)
;; ---gunship-command
;; +++gunship-cmd-spawn-type
(defenum gunship-cmd-spawn-type
:type uint16
:copy-entries city-target-type
)
;; ---gunship-cmd-spawn-type
;; +++gunship-cmd-wait-type
(defenum gunship-cmd-wait-type
:type uint8
(time)
(total)
)
;; ---gunship-cmd-wait-type
;; DECOMP BEGINS
(deftype gunship-cmd (structure)
((command gunship-command)
(spawn-type gunship-cmd-spawn-type)
(count int8)
(wait-type gunship-cmd-wait-type :overlay-at spawn-type)
(difficulty float)
(wait-time time-frame)
(timeout-period time-frame)
)
:pack-me
)
(deftype gunship-cmd-context (structure)
((start-time time-frame)
(current-command gunship-cmd :inline)
(script pair)
(script-jump-point basic)
)
)
;; WARN: Return type mismatch int vs object.
(defun parse-protect-command ((arg0 gunship-cmd-context))
(let ((s5-0 (-> arg0 script car))
(gp-0 (-> arg0 current-command))
)
(case (ref s5-0 0)
(('spawn)
(set! (-> gp-0 command) (gunship-command spawn))
0
)
(('wait)
(set! (-> gp-0 command) (gunship-command wait))
)
(('missiles)
(set! (-> gp-0 command) (gunship-command missiles))
)
(('script-set-jump)
(set! (-> gp-0 command) (gunship-command script-set-jump))
(return (the-as object 0))
)
(('no-op)
(set! (-> gp-0 command) (gunship-command no-op))
(return (the-as object 0))
)
(('script-jump)
(set! (-> gp-0 command) (gunship-command script-jump))
(set! (-> gp-0 count) (the-as int (/ (the-as int (ref s5-0 1)) 8)))
(return (the-as object 0))
)
(else
(set! (-> gp-0 command) (gunship-command other))
(return (the-as object 0))
)
)
(case (-> gp-0 command)
(((gunship-command spawn))
(let ((a0-11 (ref s5-0 1)))
(set! (-> gp-0 spawn-type) (the-as gunship-cmd-spawn-type (symbol->city-target-type (the-as symbol a0-11))))
)
(let ((a0-12 s5-0))
(if (>= ((method-of-type (rtype-of a0-12) length) a0-12) 3)
(set! (-> gp-0 count) (the-as int (/ (the-as int (ref s5-0 2)) 8)))
(set! (-> gp-0 count) 1)
)
)
)
(((gunship-command missiles))
(set! (-> gp-0 count) (max 0 (min 16 (the-as int (/ (the-as int (ref s5-0 1)) 8)))))
(set! (-> gp-0 difficulty) 1.0)
(let ((a0-17 s5-0))
(if (>= ((method-of-type (rtype-of a0-17) length) a0-17) 3)
(set! (-> gp-0 difficulty) (command-get-float (ref s5-0 2) 0.0))
)
)
)
(((gunship-command wait))
(case (ref s5-0 1)
(('time)
(set! (-> gp-0 wait-type) (gunship-cmd-wait-type time))
(let ((f0-2 (command-get-float (ref s5-0 2) 0.0)))
(set! (-> gp-0 wait-time) (the-as time-frame (the int (* 300.0 f0-2))))
)
)
(('total)
(set! (-> gp-0 wait-type) (gunship-cmd-wait-type total))
(set! (-> gp-0 count) (the-as int (/ (the-as int (ref s5-0 2)) 8)))
)
)
)
)
(let* ((a0-28 s5-0)
(s3-2 ((method-of-type (rtype-of a0-28) length) a0-28))
(s4-4 (ref s5-0 (+ s3-2 -2)))
(a0-31 (ref s5-0 (+ s3-2 -1)))
(v0-1 6000)
)
(if (= s4-4 'timeout)
(set! v0-1 (the int (* 300.0 (command-get-float a0-31 0.0))))
)
(set! (-> gp-0 timeout-period) (the-as time-frame v0-1))
v0-1
)
)
)
(define *gunship-0-script* '((no-op)
(spawn roboguard 1)
(missiles 16)
(spawn turret 1)
(wait total 0)
(missiles 10 (new 'static 'bfloat :data 0.5))
(spawn roboguard 1)
(missiles 16)
(wait time (new 'static 'bfloat :data 5.0))
(script-set-jump)
(spawn roboguard 2)
(wait time (new 'static 'bfloat :data 5.0))
(missiles 16)
(spawn spydroid 5)
(wait time (new 'static 'bfloat :data 2.0))
(missiles 8)
(wait time (new 'static 'bfloat :data 3.0))
(spawn spydroid 2)
(wait time (new 'static 'bfloat :data 5.0))
(spawn roboguard 1)
(missiles 16)
(wait time (new 'static 'bfloat :data 10.0))
(script-jump 1)
(end)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,188 @@
;; DECOMP BEGINS
(deftype combx-elevator (process-drawable)
((root collide-shape :override)
)
(:state-methods
idle
)
(:methods
(init-collision! (_type_) none)
(setup-skel-and-draw-masks (_type_) none)
)
)
(defstate idle (combx-elevator)
:virtual #t
:code (behavior ()
(until #f
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
(until (ja-done? 0)
(suspend)
(ja :num! (seek!))
)
)
#f
)
:post ja-post
)
(defskelgroup skel-combx-elevator tpl-elevator tpl-elevator-lod0-jg tpl-elevator-idle-ja
((tpl-elevator-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 11)
)
;; WARN: Return type mismatch collide-shape-moving vs none.
(defmethod init-collision! ((this combx-elevator))
(let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player))))
(set! (-> s5-0 dynam) (copy *standard-dynamics* 'process))
(set! (-> s5-0 reaction) cshape-reaction-default)
(set! (-> s5-0 no-reaction)
(the-as (function collide-shape-moving collide-query vector vector object) nothing)
)
(let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0)))
(set! (-> s5-0 total-prims) (the-as uint 3))
(set! (-> s4-0 prim-core collide-as) (collide-spec pusher))
(set! (-> s4-0 prim-core collide-with) (collide-spec jak 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 45056.0)
(set! (-> s5-0 root-prim) s4-0)
)
(pusher-init s5-0)
(let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0))))
(set! (-> v1-15 prim-core collide-as) (collide-spec pusher))
(set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list))
(set! (-> v1-15 prim-core action) (collide-action solid rideable))
(set! (-> v1-15 transform-index) 3)
(set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0)
)
(let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint (shl #xfe00 16)))))
(set! (-> v1-18 prim-core action) (collide-action solid))
(set! (-> v1-18 transform-index) 3)
(set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 45056.0)
)
(set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w)))
(let ((v1-21 (-> s5-0 root-prim)))
(set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as))
(set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with))
)
(set! (-> this root) s5-0)
)
(none)
)
(defmethod setup-skel-and-draw-masks ((this combx-elevator))
(initialize-skeleton
this
(the-as skeleton-group (art-group-get-by-name *level* "skel-combx-elevator" (the-as (pointer level) #f)))
(the-as pair 0)
)
(setup-masks (-> this draw) 1 2)
(update-transforms (-> this root))
0
(none)
)
(defmethod init-from-entity! ((this combx-elevator) (arg0 entity-actor))
(init-collision! this)
(process-drawable-from-entity! this arg0)
(setup-skel-and-draw-masks this)
(set! (-> this draw light-index) (the-as uint 1))
(go (method-of-object this idle))
)
(deftype combx-states (structure)
()
)
(defun init-mood-combx ((arg0 mood-context))
(let ((v1-0 (-> arg0 light-group 1)))
(let ((a0-1 (-> v1-0 dir0)))
(set! (-> a0-1 direction x) 0.0)
(set! (-> a0-1 direction y) 1.0)
(set! (-> a0-1 direction z) 0.0)
(set! (-> a0-1 direction w) 0.0)
)
(set-vector! (-> v1-0 dir0 color) 0.667 0.667 0.667 1.0)
(set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0)
(set! (-> v1-0 dir0 extra x) 0.75)
(set! (-> v1-0 dir1 extra x) 0.0)
(set! (-> v1-0 dir2 extra x) 0.0)
(set! (-> v1-0 ambi extra x) 0.25)
)
)
(defbehavior update-mood-combx time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int))
(update-mood-interior arg0 #f)
(let* ((s5-0 (camera-pos))
(f0-1 (fmin
(vector-vector-distance s5-0 (new 'static 'vector :x 368640.0 :z 40960.0 :w 1.0))
(vector-vector-distance s5-0 (new 'static 'vector :x 14274560.0 :y -167936.0 :z 614400.0 :w 1.0))
)
)
)
(when (< f0-1 716800.0)
(let ((f30-1 (fmax 0.0 (fmin 1.0 (* 0.000009765625 (- 819200.0 f0-1)))))
(a1-4 (-> arg0 current-fog))
(s5-1 (-> arg0 current-fog fog-dists))
)
(vector4-lerp!
(the-as vector a1-4)
(the-as vector a1-4)
(new 'static 'vector :x 30.0 :y 80.0 :z 150.0 :w 128.0)
f30-1
)
(vector4-lerp! s5-1 s5-1 (new 'static 'vector :x 262144.0 :y 937984.0 :z 255.0 :w 200.0) f30-1)
)
)
)
(cond
((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode)))
(palette-select-special arg0)
)
(else
(-> arg0 state)
(let* ((s5-2 (-> *display* part-clock frame-counter))
(f0-6 (* 1310.72 (the float (mod s5-2 25))))
(f30-2 (sin f0-6))
(f0-8 (* 109.22667 (the float (mod s5-2 600))))
(s5-3 (/ (mod s5-2 125) 25))
)
(set! (-> arg0 times 0 w) 1.0)
(set! (-> arg0 times 1 w) f30-2)
(set! (-> arg0 times 2 w) (+ 0.85 (* 0.15 (cos f0-8))))
(set! (-> arg0 times 3 w) (if (zero? s5-3)
f30-2
0.0
)
)
(set! (-> arg0 times 4 w) (if (= s5-3 1)
f30-2
0.0
)
)
(set! (-> arg0 times 5 w) (if (= s5-3 2)
f30-2
0.0
)
)
(set! (-> arg0 times 6 w) (if (= s5-3 3)
f30-2
0.0
)
)
(set! (-> arg0 times 7 w) (if (= s5-3 4)
f30-2
0.0
)
)
)
)
)
0
(none)
)

View File

@ -5,5 +5,212 @@
;; name in dgo: lfaccity-mood
;; dgos: LFACB, LFACCITY
(declare-type lfaccity-pparticle-mover process-drawable)
;; DECOMP BEGINS
(define *faccity-part-updater* (the-as lfaccity-pparticle-mover #f))
(deftype lfaccity-states (structure)
((light light-state :inline)
(roty float)
(rotz float)
(rot-bob float)
(wobble float)
(bob float)
(zero-test int32)
)
)
;; WARN: Return type mismatch object vs none.
(defbehavior update-mood-lfaccity time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int))
(copy-mood-exterior arg0)
(when (and (= (-> *level* level arg2 status) 'active)
(< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9))
)
(let ((gp-1 (the-as object (-> arg0 state))))
(cond
((level-get *level* 'factoryb)
(set-vector! (-> *math-camera* trans-other) 1228800.0 (-> (the-as lfaccity-states gp-1) bob) 1228800.0 1.0)
(let ((s3-0 (new 'stack-no-clear 'vector)))
(set-vector! s3-0 -409600.0 0.0 0.0 1.0)
(vector-rotate-y! s3-0 s3-0 (-> (the-as lfaccity-states gp-1) roty))
(vector+! (-> *math-camera* trans-other) (-> *math-camera* trans-other) s3-0)
)
)
((or (level-get *level* 'factoryc) (level-get *level* 'factoryd))
(set-vector!
(-> *math-camera* trans-other)
696320.0
(+ -614400.0 (-> (the-as lfaccity-states gp-1) bob))
-368640.0
1.0
)
)
)
(update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0)
(let ((s5-1 *math-camera*))
(when (not (paused?))
(let ((s3-1 (new 'stack-no-clear 'quaternion))
(s4-1 (new 'stack-no-clear 'quaternion))
)
(quaternion-vector-angle! s3-1 *y-vector* (-> (the-as lfaccity-states gp-1) roty))
(quaternion-vector-angle! s4-1 *z-vector* (-> (the-as lfaccity-states gp-1) wobble))
(quaternion*! (-> s5-1 quat-other) s4-1 s3-1)
)
(let ((f0-17 (+ (-> (the-as lfaccity-states gp-1) roty) (* 910.2222 (seconds-per-frame)))))
(set! (-> (the-as lfaccity-states gp-1) roty) (- f0-17 (* (the float (the int (/ f0-17 65536.0))) 65536.0)))
)
(let ((f0-20 (+ (-> (the-as lfaccity-states gp-1) rotz) (* 8192.0 (seconds-per-frame)))))
(set! (-> (the-as lfaccity-states gp-1) rotz) (- f0-20 (* (the float (the int (/ f0-20 65536.0))) 65536.0)))
)
(set! (-> (the-as lfaccity-states gp-1) wobble) (* 910.2222 (sin (-> (the-as lfaccity-states gp-1) rotz))))
(let ((f0-26 (+ (-> (the-as lfaccity-states gp-1) rot-bob) (* 16384.0 (seconds-per-frame)))))
(set! (-> (the-as lfaccity-states gp-1) rot-bob)
(- f0-26 (* (the float (the int (/ f0-26 65536.0))) 65536.0))
)
)
(set! (-> (the-as lfaccity-states gp-1) bob)
(+ -40960.0 (* 40960.0 (sin (-> (the-as lfaccity-states gp-1) rot-bob))))
)
(send-event *faccity-part-updater* 'mood-update)
)
)
)
)
(none)
)
(deftype faccity-pparticle-info (structure)
((original-pos vector :inline)
(inited? symbol)
)
)
(deftype faccity-pparticle-array (inline-array-class)
((data faccity-pparticle-info :inline :dynamic)
)
)
(set! (-> faccity-pparticle-array heap-base) (the-as uint 32))
(deftype lfaccity-pparticle-mover (process-drawable)
((actor-group (pointer actor-group))
(actor-group-count int32)
(particles faccity-pparticle-array)
)
(:state-methods
active
)
(:methods
(mood-update (_type_) symbol)
)
)
(defmethod init-from-entity! ((this lfaccity-pparticle-mover) (arg0 entity-actor))
(local-vars (sv-16 res-tag))
(set! sv-16 (new 'static 'res-tag))
(let ((v1-1 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16))))
(cond
((and v1-1 (nonzero? (-> sv-16 elt-count)))
(set! (-> this actor-group) (the-as (pointer actor-group) v1-1))
(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 root) (new 'process 'trsqv))
(if (<= (-> this actor-group-count) 0)
(go process-drawable-art-error "actor group")
)
(set! (-> this entity extra vis-dist) 40960000000000.0)
(set! (-> this particles) (new 'process 'faccity-pparticle-array (-> this actor-group 0 length)))
(dotimes (v1-18 (-> this particles length))
(set! (-> this particles data v1-18 inited?) #f)
)
(set! *faccity-part-updater* this)
(go (method-of-object this active))
)
(defbehavior lfaccity-pparticle-mover-init-by-other lfaccity-pparticle-mover ((arg0 entity-actor))
(init-from-entity! self arg0)
)
(defstate active (lfaccity-pparticle-mover)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('mood-update)
(mood-update self)
)
)
)
:code sleep-code
)
(defmethod run-logic? ((this lfaccity-pparticle-mover))
"Should this process be run? Checked by execute-process-tree."
#t
)
(defmethod deactivate ((this lfaccity-pparticle-mover))
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
(set! *faccity-part-updater* #f)
(call-parent-method this)
(none)
)
(defmethod mood-update ((this lfaccity-pparticle-mover))
(let ((s5-0 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> *math-camera* quat-other))))
(dotimes (s4-0 (-> this particles length))
(cond
((-> this particles data s4-0 inited?)
(let ((v1-6 (vector-matrix*! (new 'stack-no-clear 'vector) (the-as vector (-> this particles data s4-0)) s5-0))
(a1-4 (-> this actor-group 0 data s4-0 actor))
)
(when a1-4
(let ((a1-5 (-> a1-4 extra process)))
(when a1-5
(set! (-> (the-as process-drawable a1-5) root trans quad) (-> v1-6 quad))
(vector+!
(-> (the-as process-drawable a1-5) root trans)
(-> (the-as process-drawable a1-5) root trans)
(-> *math-camera* trans-other)
)
)
)
)
)
)
(else
(let ((v1-14 (-> this actor-group 0 data s4-0 actor)))
(when v1-14
(set! (-> this particles data s4-0 original-pos quad) (-> v1-14 extra trans quad))
(set! (-> this particles data s4-0 inited?) #t)
)
)
)
)
)
)
#f
)
(defmethod relocate ((this lfaccity-pparticle-mover) (offset int))
(set! *faccity-part-updater* this)
(if *faccity-part-updater*
(set! *faccity-part-updater* (&+ *faccity-part-updater* offset))
)
(if (nonzero? (-> this particles))
(&+! (-> this particles) offset)
)
(call-parent-method this offset)
)

View File

@ -7,3 +7,637 @@
;; DECOMP BEGINS
(define *precura-adjacency*
(new 'static 'nav-network-data
:node-array (new 'static 'boxed-array :type nav-network-info
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :parent #f)
:pos (new 'static 'vector :x 155320.31 :y 2275000.2 :z -253829.12 :w 1.0)
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 3 :dist 97320.96)
(new 'static 'nav-network-adjacency :index 23 :dist 81141.76)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f)
:pos (new 'static 'vector :x 173219.84 :y 2275000.2 :z -149340.16 :w 1.0)
:index 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 2 :dist 103505.92)
(new 'static 'nav-network-adjacency :index 24 :dist 83312.64)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f)
:pos (new 'static 'vector :x 184770.56 :y 2180259.8 :z -189399.05 :w 1.0)
:index 2
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 1 :dist 103505.92)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f)
:pos (new 'static 'vector :x 175063.05 :y 2180259.8 :z -263946.25 :w 1.0)
:index 3
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1 (new 'static 'nav-network-adjacency :dist 97320.96))
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f)
:pos (new 'static 'vector :x 153722.88 :y 2289991.8 :z 150568.95 :w 1.0)
:index 4
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 5 :dist 86548.48)
(new 'static 'nav-network-adjacency :index 26 :dist 136929.28)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f)
:pos (new 'static 'vector :x 152453.12 :y 2247188.5 :z 225812.48 :w 1.0)
:index 5
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 4 :dist 86548.48)
(new 'static 'nav-network-adjacency :index 6 :dist 99409.92)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f)
:pos (new 'static 'vector :x 232693.77 :y 2190991.2 :z 242606.08 :w 1.0)
:index 6
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 5 :dist 99409.92)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f)
:pos (new 'static 'vector :x 632709.1 :y 2243788.8 :z -189972.48 :w 1.0)
:index 7
:sub-graph 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 8 :dist 39198.72)
(new 'static 'nav-network-adjacency :index 16 :dist 110510.08)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f)
:pos (new 'static 'vector :x 593551.4 :y 2243788.8 :z -192307.2 :w 1.0)
:index 8
:sub-graph 1
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 7 :dist 39198.72)
(new 'static 'nav-network-adjacency :index 9 :dist 47308.8)
(new 'static 'nav-network-adjacency :index 17 :dist 110387.2)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f)
:pos (new 'static 'vector :x 546693.1 :y 2243788.8 :z -198656.0 :w 1.0)
:index 9
:sub-graph 1
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 8 :dist 47308.8)
(new 'static 'nav-network-adjacency :index 10 :dist 93020.16)
(new 'static 'nav-network-adjacency :index 18 :dist 109363.2)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f)
:pos (new 'static 'vector :x 483450.88 :y 2243788.8 :z -266895.38 :w 1.0)
:index 10
:sub-graph 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 9 :dist 93020.16)
(new 'static 'nav-network-adjacency :index 11 :dist 105594.88)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f)
:pos (new 'static 'vector :x 484024.3 :y 2272174.0 :z -368599.03 :w 1.0)
:index 11
:sub-graph 1
:count 4
:adjacency (new 'static 'inline-array nav-network-adjacency 4
(new 'static 'nav-network-adjacency :index 10 :dist 105594.88)
(new 'static 'nav-network-adjacency :index 12 :dist 71106.56)
(new 'static 'nav-network-adjacency :index 19 :dist 97812.48)
(new 'static 'nav-network-adjacency :index 20 :dist 107069.44)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f)
:pos (new 'static 'vector :x 555130.9 :y 2272174.0 :z -367861.75 :w 1.0)
:index 12
:sub-graph 1
:count 4
:adjacency (new 'static 'inline-array nav-network-adjacency 4
(new 'static 'nav-network-adjacency :index 11 :dist 71106.56)
(new 'static 'nav-network-adjacency :index 13 :dist 48906.24)
(new 'static 'nav-network-adjacency :index 20 :dist 103464.96)
(new 'static 'nav-network-adjacency :index 21 :dist 104120.32)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f)
:pos (new 'static 'vector :x 570736.6 :y 2272174.0 :z -321495.03 :w 1.0)
:index 13
:sub-graph 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 12 :dist 48906.24)
(new 'static 'nav-network-adjacency :index 14 :dist 49233.92)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f)
:pos (new 'static 'vector :x 568074.25 :y 2272174.0 :z -272343.03 :w 1.0)
:index 14
:sub-graph 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 13 :dist 49233.92)
(new 'static 'nav-network-adjacency :index 15 :dist 62709.76)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f)
:pos (new 'static 'vector :x 607887.4 :y 2272174.0 :z -223846.4 :w 1.0)
:index 15
:sub-graph 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 14 :dist 62709.76)
(new 'static 'nav-network-adjacency :index 22 :dist 111329.28)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f)
:pos (new 'static 'vector :x 611205.1 :y 2137948.2 :z -166584.31 :w 1.0)
:index 16
:sub-graph 1
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 7 :dist 110510.08)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f)
:pos (new 'static 'vector :x 577331.2 :y 2137948.2 :z -165478.4 :w 1.0)
:index 17
:sub-graph 1
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 8 :dist 110387.2)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f)
:pos (new 'static 'vector :x 542105.6 :y 2137948.2 :z -171540.48 :w 1.0)
:index 18
:sub-graph 1
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 9 :dist 109363.2)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f)
:pos (new 'static 'vector :x 480256.0 :y 2178048.0 :z -394936.3 :w 1.0)
:index 19
:sub-graph 1
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 11 :dist 97812.48)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f)
:pos (new 'static 'vector :x 525189.1 :y 2178048.0 :z -398704.62 :w 1.0)
:index 20
:sub-graph 1
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 11 :dist 107069.44)
(new 'static 'nav-network-adjacency :index 12 :dist 103464.96)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f)
:pos (new 'static 'vector :x 591872.0 :y 2178048.0 :z -392847.38 :w 1.0)
:index 21
:sub-graph 1
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 12 :dist 104120.32)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f)
:pos (new 'static 'vector :x 631521.25 :y 2178048.0 :z -278446.1 :w 1.0)
:index 22
:sub-graph 1
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 15 :dist 111329.28)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f)
:pos (new 'static 'vector :x 236093.44 :y 2270126.0 :z -259768.31 :w 1.0)
:index 23
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :dist 81141.76)
(new 'static 'nav-network-adjacency :index 24 :dist 63242.24)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f)
:pos (new 'static 'vector :x 241541.12 :y 2270126.0 :z -196730.88 :w 1.0)
:index 24
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 1 :dist 83312.64)
(new 'static 'nav-network-adjacency :index 23 :dist 63242.24)
(new 'static 'nav-network-adjacency :index 25 :dist 73809.92)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f)
:pos (new 'static 'vector :x 263168.0 :y 2270126.0 :z -126197.76 :w 1.0)
:index 25
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 24 :dist 73809.92)
(new 'static 'nav-network-adjacency :index 26 :dist 193863.69)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f)
:pos (new 'static 'vector :x 260874.23 :y 2270126.0 :z 67665.92 :w 1.0)
:index 26
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 4 :dist 136929.28)
(new 'static 'nav-network-adjacency :index 25 :dist 193863.69)
(new 'static 'nav-network-adjacency :index 27 :dist 129720.32)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f)
:pos (new 'static 'vector :x 258252.8 :y 2323169.2 :z 185999.36 :w 1.0)
:index 27
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 26 :dist 129720.32)
(new 'static 'nav-network-adjacency :index 28 :dist 40427.52)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f)
:pos (new 'static 'vector :x 232939.52 :y 2323169.2 :z 217497.6 :w 1.0)
:index 28
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 27 :dist 40427.52)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f)
:pos (new 'static 'vector :x 876871.7 :y 2194350.0 :z -19251.2 :w 1.0)
:index 29
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 30 :dist 37724.16)
(new 'static 'nav-network-adjacency :index 34 :dist 91299.84)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 30 :parent #f)
:pos (new 'static 'vector :x 914595.8 :y 2194350.0 :z -19660.8 :w 1.0)
:index 30
:sub-graph 2
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 29 :dist 37724.16)
(new 'static 'nav-network-adjacency :index 31 :dist 39936.0)
(new 'static 'nav-network-adjacency :index 34 :dist 86179.84)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 31 :parent #f)
:pos (new 'static 'vector :x 954531.8 :y 2194350.0 :z -19496.96 :w 1.0)
:index 31
:sub-graph 2
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 30 :dist 39936.0)
(new 'static 'nav-network-adjacency :index 32 :dist 37642.24)
(new 'static 'nav-network-adjacency :index 33 :dist 89292.8)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 32 :parent #f)
:pos (new 'static 'vector :x 992092.2 :y 2194350.0 :z -21667.84 :w 1.0)
:index 32
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 31 :dist 37642.24)
(new 'static 'nav-network-adjacency :index 33 :dist 88350.72)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 33 :parent #f)
:pos (new 'static 'vector :x 977551.4 :y 2274304.0 :z 12943.36 :w 1.0)
:index 33
:sub-graph 2
:count 5
:adjacency (new 'static 'inline-array nav-network-adjacency 5
(new 'static 'nav-network-adjacency :index 31 :dist 89292.8)
(new 'static 'nav-network-adjacency :index 32 :dist 88350.72)
(new 'static 'nav-network-adjacency :index 34 :dist 69427.2)
(new 'static 'nav-network-adjacency :index 35 :dist 87531.52)
(new 'static 'nav-network-adjacency :index 39 :dist 87244.8)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 34 :parent #f)
:pos (new 'static 'vector :x 908124.2 :y 2274304.0 :z 11837.44 :w 1.0)
:index 34
:sub-graph 2
:count 5
:adjacency (new 'static 'inline-array nav-network-adjacency 5
(new 'static 'nav-network-adjacency :index 29 :dist 91299.84)
(new 'static 'nav-network-adjacency :index 30 :dist 86179.84)
(new 'static 'nav-network-adjacency :index 33 :dist 69427.2)
(new 'static 'nav-network-adjacency :index 35 :dist 84500.48)
(new 'static 'nav-network-adjacency :index 39 :dist 81756.16)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 35 :parent #f)
:pos (new 'static 'vector :x 940277.75 :y 2279997.5 :z -66068.48 :w 1.0)
:index 35
:sub-graph 2
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 33 :dist 87531.52)
(new 'static 'nav-network-adjacency :index 34 :dist 84500.48)
(new 'static 'nav-network-adjacency :index 36 :dist 210984.95)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 36 :parent #f)
:pos (new 'static 'vector :x 935976.94 :y 2279997.5 :z -277012.47 :w 1.0)
:index 36
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 35 :dist 210984.95)
(new 'static 'nav-network-adjacency :index 37 :dist 73359.36)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 37 :parent #f)
:pos (new 'static 'vector :x 876789.75 :y 2279997.5 :z -320430.1 :w 1.0)
:index 37
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 36 :dist 73359.36)
(new 'static 'nav-network-adjacency :index 38 :dist 64471.04)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 38 :parent #f)
:pos (new 'static 'vector :x 812728.3 :y 2279997.5 :z -327311.38 :w 1.0)
:index 38
:sub-graph 2
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 37 :dist 64471.04)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 39 :parent #f)
:pos (new 'static 'vector :x 934993.94 :y 2252636.2 :z 85975.04 :w 1.0)
:index 39
:sub-graph 2
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 33 :dist 87244.8)
(new 'static 'nav-network-adjacency :index 34 :dist 81756.16)
(new 'static 'nav-network-adjacency :index 40 :dist 131072.0)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 40 :parent #f)
:pos (new 'static 'vector :x 1011507.2 :y 2215198.8 :z 185630.72 :w 1.0)
:index 40
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 39 :dist 131072.0)
(new 'static 'nav-network-adjacency :index 41 :dist 179691.52)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 41 :parent #f)
:pos (new 'static 'vector :x 1152450.5 :y 2198446.0 :z 295854.1 :w 1.0)
:index 41
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 40 :dist 179691.52)
(new 'static 'nav-network-adjacency :index 42 :dist 135741.44)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 42 :parent #f)
:pos (new 'static 'vector :x 1048125.44 :y 2184806.5 :z 381665.28 :w 1.0)
:index 42
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 41 :dist 135741.44)
(new 'static 'nav-network-adjacency :index 43 :dist 183541.77)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 43 :parent #f)
:pos (new 'static 'vector :x 917012.5 :y 2120540.2 :z 492830.72 :w 1.0)
:index 43
:sub-graph 2
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 42 :dist 183541.77)
(new 'static 'nav-network-adjacency :index 44 :dist 160808.95)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 44 :parent #f)
:pos (new 'static 'vector :x 985210.9 :y 2077532.1 :z 631971.8 :w 1.0)
:index 44
:sub-graph 2
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 43 :dist 160808.95)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 45 :parent #f)
:pos (new 'static 'vector :x 992419.8 :y 2083635.2 :z 907796.5 :w 1.0)
:index 45
:sub-graph 3
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 46 :dist 127754.24)
(new 'static 'nav-network-adjacency :index 47 :dist 117800.96)
(new 'static 'nav-network-adjacency :index 50 :dist 116244.48)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 46 :parent #f)
:pos (new 'static 'vector :x 993730.56 :y 2083635.2 :z 780001.25 :w 1.0)
:index 46
:sub-graph 3
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 45 :dist 127754.24)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 47 :parent #f)
:pos (new 'static 'vector :x 995328.0 :y 1966202.9 :z 899112.94 :w 1.0)
:index 47
:sub-graph 3
:count 3
:adjacency (new 'static 'inline-array nav-network-adjacency 3
(new 'static 'nav-network-adjacency :index 45 :dist 117800.96)
(new 'static 'nav-network-adjacency :index 48 :dist 68853.76)
(new 'static 'nav-network-adjacency :index 49 :dist 70082.56)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 48 :parent #f)
:pos (new 'static 'vector :x 1031454.75 :y 1966202.9 :z 840458.25 :w 1.0)
:index 48
:sub-graph 3
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 47 :dist 68853.76)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 49 :parent #f)
:pos (new 'static 'vector :x 952811.5 :y 1966202.9 :z 843407.4 :w 1.0)
:index 49
:sub-graph 3
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 47 :dist 70082.56)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 50 :parent #f)
:pos (new 'static 'vector :x 991232.0 :y 2083635.2 :z 1024040.94 :w 1.0)
:index 50
:sub-graph 3
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 45 :dist 116244.48)
(new 'static 'nav-network-adjacency :index 51 :dist 122675.2)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 51 :parent #f)
:pos (new 'static 'vector :x 946298.9 :y 2083635.2 :z 1138196.5 :w 1.0)
:index 51
:sub-graph 3
:count 2
:adjacency (new 'static 'inline-array nav-network-adjacency 2
(new 'static 'nav-network-adjacency :index 50 :dist 122675.2)
(new 'static 'nav-network-adjacency :index 52 :dist 104857.6)
)
)
(new 'static 'nav-network-info
:path-node (new 'static 'nav-network-path-node :row-index 52 :parent #f)
:pos (new 'static 'vector :x 866672.6 :y 2083635.2 :z 1206435.9 :w 1.0)
:index 52
:sub-graph 3
:count 1
:adjacency (new 'static 'inline-array nav-network-adjacency 1
(new 'static 'nav-network-adjacency :index 51 :dist 104857.6)
)
)
)
:edge-array (new 'static 'boxed-array :type nav-network-edge
(new 'static 'nav-network-edge :start-index 2 :end-index 1 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 3 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 5 :end-index 4 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 6 :end-index 5 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 7 :end-index 8 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 8 :end-index 9 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 9 :end-index 10 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 10 :end-index 11 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 11 :end-index 12 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 12 :end-index 13 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 13 :end-index 14 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 14 :end-index 15 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 16 :end-index 7 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 17 :end-index 8 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 18 :end-index 9 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 19 :end-index 11 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 20 :end-index 11 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 20 :end-index 12 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 21 :end-index 12 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 22 :end-index 15 :radius 16384.0 :sub-graph 1)
(new 'static 'nav-network-edge :start-index 23 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 23 :end-index 24 :radius 20889.6)
(new 'static 'nav-network-edge :start-index 24 :end-index 1 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 24 :end-index 25 :radius 35553.28)
(new 'static 'nav-network-edge :start-index 25 :end-index 26 :radius 46694.4)
(new 'static 'nav-network-edge :start-index 26 :end-index 4 :radius 16384.0)
(new 'static 'nav-network-edge :start-index 26 :end-index 27 :radius 24780.8)
(new 'static 'nav-network-edge :start-index 27 :end-index 28 :radius 18841.6)
(new 'static 'nav-network-edge :start-index 29 :end-index 30 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 29 :end-index 34 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 30 :end-index 31 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 31 :end-index 33 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 32 :end-index 31 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 33 :end-index 32 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 33 :end-index 34 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 34 :end-index 30 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 34 :end-index 35 :radius 19456.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 35 :end-index 33 :radius 19251.2 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 35 :end-index 36 :radius 22118.4 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 36 :end-index 37 :radius 19988.48 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 37 :end-index 38 :radius 21299.2 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 39 :end-index 33 :radius 29941.76 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 39 :end-index 34 :radius 33013.76 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 40 :end-index 39 :radius 25968.64 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 41 :end-index 40 :radius 16384.0 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 42 :end-index 41 :radius 38215.68 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 43 :end-index 42 :radius 45875.2 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 44 :end-index 43 :radius 17203.2 :sub-graph 2)
(new 'static 'nav-network-edge :start-index 45 :end-index 46 :radius 25804.8 :sub-graph 3)
(new 'static 'nav-network-edge :start-index 45 :end-index 50 :radius 36945.92 :sub-graph 3)
(new 'static 'nav-network-edge :start-index 47 :end-index 45 :radius 17612.8 :sub-graph 3)
(new 'static 'nav-network-edge :start-index 47 :end-index 48 :radius 22937.6 :sub-graph 3)
(new 'static 'nav-network-edge :start-index 47 :end-index 49 :radius 19251.2 :sub-graph 3)
(new 'static 'nav-network-edge :start-index 50 :end-index 51 :radius 23961.6 :sub-graph 3)
(new 'static 'nav-network-edge :start-index 51 :end-index 52 :radius 35553.28 :sub-graph 3)
)
)
)

View File

@ -7,3 +7,256 @@
;; DECOMP BEGINS
(deftype precura-states (structure)
((pulse pulse-state :inline)
(generator pulse-state :inline)
(main float)
(target-laser float 2)
(current-laser float 2)
(speed-laser float)
(target-bomb float)
(current-bomb float)
(speed-bomb float)
)
)
(defun init-mood-precura ((arg0 mood-context))
(let ((v1-0 (-> arg0 state)))
(set! (-> v1-0 1) (the-as uint 1.0))
(set! (-> v1-0 2) (the-as uint 1.0))
(set! (-> v1-0 3) (the-as uint 1.0))
(set! (-> v1-0 5) (the-as uint 1.0))
(set! (-> v1-0 6) (the-as uint 1.0))
(let ((f0-5 2.0))
(set! (-> v1-0 7) (the-as uint f0-5))
f0-5
)
)
)
;; WARN: Return type mismatch float vs none.
(defun update-precura-lights ((arg0 mood-context))
(let ((v1-0 (-> arg0 light-group)))
(let ((a0-1 (-> v1-0 0)))
(set! (-> a0-1 dir0 direction x) 0.0)
(set! (-> a0-1 dir0 direction y) 1.0)
(set! (-> a0-1 dir0 direction z) 0.0)
(set! (-> a0-1 dir0 direction w) 0.0)
)
(set-vector! (-> v1-0 0 dir0 color) 0.5 0.667 0.667 1.0)
(set-vector! (-> v1-0 0 ambi color) 0.25 0.333 0.333 1.0)
(set! (-> v1-0 0 dir0 extra x) 1.0)
(set! (-> v1-0 0 dir1 extra x) 0.0)
(set! (-> v1-0 0 dir2 extra x) 0.0)
(set! (-> v1-0 0 ambi extra x) 1.0)
)
(none)
)
(defbehavior update-mood-precura time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int))
(update-mood-interior arg0 #f)
(update-precura-lights arg0)
(cond
((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode)))
(palette-select-special arg0)
)
(else
(let ((gp-0 (the-as object (-> arg0 state))))
(set! (-> arg0 times 0 w) 1.0)
(update-mood-pulse arg0 1 0 1.0 0.25 (* 65536.0 (seconds-per-frame)) 0.0)
(update-mood-pulse arg0 4 16 1.0 0.125 (* 65536.0 (seconds-per-frame)) 0.0)
(set! (-> arg0 times 2 w) 1.0)
(let* ((v1-10 (-> *display* part-clock frame-counter))
(f0-7 (* 218.45334 (the float (mod v1-10 300))))
)
(set! (-> arg0 times 3 w) (+ 0.875 (* 0.175 (cos f0-7))))
)
(set! (-> arg0 times 5 w) (-> (the-as precura-states gp-0) current-bomb))
(set! (-> arg0 times 6 w) (-> (the-as precura-states gp-0) current-laser 0))
(set! (-> arg0 times 7 w) (-> (the-as precura-states gp-0) current-laser 1))
(when (not (paused?))
(seek!
(-> (the-as precura-states gp-0) current-bomb)
(-> (the-as precura-states gp-0) target-bomb)
(-> (the-as precura-states gp-0) speed-bomb)
)
(seek!
(-> (the-as precura-states gp-0) current-laser 0)
(-> (the-as precura-states gp-0) target-laser 0)
(-> (the-as precura-states gp-0) speed-laser)
)
(seek!
(-> (the-as precura-states gp-0) current-laser 1)
(-> (the-as precura-states gp-0) target-laser 1)
(-> (the-as precura-states gp-0) speed-laser)
)
)
)
)
)
0
(none)
)
;; WARN: Return type mismatch float vs none.
(defun set-precura-generator-light! ((arg0 float))
(let ((v1-1 (level-get *level* 'precura)))
(when v1-1
(let ((v1-2 (the-as object (-> v1-1 mood-context state))))
(set! (-> (the-as precura-states v1-2) generator target-brightness) arg0)
)
)
)
(none)
)
;; WARN: Return type mismatch float vs none.
(defun set-precura-laser-light! ((arg0 float) (arg1 float) (arg2 int))
(let ((v1-1 (level-get *level* 'precura)))
(when v1-1
(let ((v1-2 (the-as object (-> v1-1 mood-context state))))
(set! (-> (the-as precura-states v1-2) target-laser arg2) arg0)
(set! (-> (the-as precura-states v1-2) speed-laser) arg1)
(if (= arg1 0.0)
(set! (-> (the-as precura-states (+ (* arg2 4) (the-as int v1-2))) current-laser 0) arg0)
)
)
)
)
(none)
)
;; WARN: Return type mismatch float vs none.
(defun set-precura-bomb-light! ((arg0 float) (arg1 float))
(let ((v1-1 (level-get *level* 'precura)))
(when v1-1
(let ((v1-2 (the-as object (-> v1-1 mood-context state))))
(set! (-> (the-as precura-states v1-2) target-bomb) arg0)
(set! (-> (the-as precura-states v1-2) speed-bomb) arg1)
)
)
)
(none)
)
(deftype precurb-states (structure)
((pulse pulse-state :inline)
(main float)
)
)
(defun init-mood-precurb ((arg0 mood-context))
(let ((v1-0 (-> arg0 state)))
(set! (-> v1-0 1) (the-as uint 1.0))
(set! (-> v1-0 2) (the-as uint 1.0))
(let ((f0-2 1.0))
(set! (-> v1-0 3) (the-as uint f0-2))
f0-2
)
)
)
(defbehavior update-mood-precurb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int))
(update-mood-interior arg0 #f)
(update-precura-lights arg0)
(cond
((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode)))
(palette-select-special arg0)
)
(else
(-> arg0 state)
(set! (-> arg0 times 0 w) 1.0)
(update-mood-pulse arg0 1 0 1.0 0.25 (* 65536.0 (seconds-per-frame)) 0.0)
(set! (-> arg0 times 2 w) 1.0)
(let* ((v1-9 (-> *display* part-clock frame-counter))
(f0-5 (* 218.45334 (the float (mod v1-9 300))))
)
(set! (-> arg0 times 3 w) (+ 0.875 (* 0.175 (cos f0-5))))
)
(set! (-> arg0 times 4 w) 1.0)
(set! (-> arg0 times 5 w) 1.0)
(set! (-> arg0 times 6 w) 1.0)
(set! (-> arg0 times 7 w) 1.0)
)
)
0
(none)
)
(deftype lprecurc-loader (process)
()
(:state-methods
idle
die
)
)
(defstate idle (lprecurc-loader)
:virtual #t
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('deactivate)
(go-virtual die)
)
)
)
:enter (behavior ()
(set-setting! 'borrow '((precurc 0 lprecurc copy)) 0.0 0)
(apply-settings *setting-control*)
)
:exit (behavior ()
(remove-setting! 'borrow)
(apply-settings *setting-control*)
)
:code sleep-code
)
(defstate die (lprecurc-loader)
:virtual #t
:code (behavior ()
'()
)
)
(defbehavior lprecurc-loader-init-by-other lprecurc-loader ((arg0 level))
(set! (-> self level) arg0)
(go-virtual idle)
)
(defun precura-login ((arg0 level))
(set! *nav-network* (new 'loading-level 'nav-network))
(alloc-nav-network-for-level! *nav-network* 64 10)
0
(none)
)
(defun precura-activate ((arg0 level))
(persist-with-delay
*setting-control*
'precur-activate
(the-as time-frame (the-as uint #xb2d05e00))
'sky-type
'star-field
0.0
0
)
(process-spawn lprecurc-loader arg0 :name "lprecurc-loader" :to *entity-pool*)
(if (and (nonzero? *nav-network*) *nav-network*)
(init-by-other! *nav-network* arg0 *precura-adjacency*)
)
(none)
)
(defun precura-deactivate ((arg0 level))
(persist-with-delay *setting-control* 'precur-activate 0 'sky-type #f 0.0 0)
(none)
)
(defun precura-logout ((arg0 level))
(set! *nav-network* (the-as nav-network 0))
0
(none)
)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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