mirror of
https://github.com/open-goal/jak-project
synced 2026-07-07 14:13:45 -04:00
jak3: add missing files and implement pexcw (#3084)
Some files were in the `banned_objects` list and were thus excluded from the `all_objs` file. Also implements the `pexcw` instruction which is only used in `hfrag` code.
This commit is contained in:
@@ -556,8 +556,10 @@ static InstructionKind decode_mmi3(OpcodeFields fields) {
|
||||
case 0b11011:
|
||||
ASSERT(fields.rs() == 0);
|
||||
return IK::PCPYH;
|
||||
case 0b11110:
|
||||
return IK::PEXCW;
|
||||
default:
|
||||
ASSERT(false);
|
||||
ASSERT_MSG(false, fmt::format("unknown mmi3: 0b{:b}\n", fields.MMI_func()));
|
||||
return IK::UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,6 +317,10 @@ void init_opcode_info() {
|
||||
drd_srs_srt(def(IK::PXOR, "pxor").gpr128()); // Parallel Exclusive Or
|
||||
|
||||
def(IK::PEXEW, "pexew").gpr128().dst_gpr(FT::RD).src_gpr(FT::RT); // Parallel Exchange Even Word
|
||||
def(IK::PEXCW, "pexcw")
|
||||
.gpr128()
|
||||
.dst_gpr(FT::RD)
|
||||
.src_gpr(FT::RT); // Parallel Exchange Center Word
|
||||
|
||||
drd_srt_ssa(def(IK::PSLLW, "psllw").gpr128()); // Parallel Shift Left Logical Word
|
||||
drd_srt_ssa(def(IK::PSLLH, "psllh").gpr128()); // Parallel Shift Left Logical Halfword
|
||||
|
||||
@@ -182,6 +182,7 @@ enum class InstructionKind {
|
||||
PNOR,
|
||||
PCPYH,
|
||||
PINTEH,
|
||||
PEXCW,
|
||||
|
||||
// COP1 / FPU
|
||||
ADDS,
|
||||
|
||||
@@ -364,6 +364,7 @@ std::unique_ptr<AtomicOp> make_asm_op(const Instruction& i0, int idx) {
|
||||
case InstructionKind::PMADDH:
|
||||
case InstructionKind::PMULTH:
|
||||
case InstructionKind::PEXEW:
|
||||
case InstructionKind::PEXCW:
|
||||
case InstructionKind::PNOR:
|
||||
case InstructionKind::PCPYH:
|
||||
case InstructionKind::PINTEH:
|
||||
|
||||
@@ -1176,6 +1176,8 @@ Mips2C_Line handle_normal_instr(Mips2C_Output& output,
|
||||
return handle_generic_op2(i0, instr_str, "cvtsw");
|
||||
case InstructionKind::PEXEW:
|
||||
return handle_generic_op2(i0, instr_str, "pexew");
|
||||
case InstructionKind::PEXCW:
|
||||
return handle_generic_op2(i0, instr_str, "pexcw");
|
||||
case InstructionKind::SQRTS:
|
||||
return handle_generic_op2(i0, instr_str, "sqrts");
|
||||
case InstructionKind::PLZCW:
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// if you want to filter to only some object names.
|
||||
// it will make the decompiler much faster.
|
||||
"allowed_objects": [],
|
||||
"banned_objects": ["script", "ragdoll-edit", "gun-states", "manipulator", "hfrag", "hfrag-vu1", "ff-squad-control"],
|
||||
"banned_objects": [],
|
||||
|
||||
////////////////////////////
|
||||
// CODE ANALYSIS OPTIONS
|
||||
|
||||
@@ -108,6 +108,11 @@
|
||||
"adgif-shader<-texture!",
|
||||
|
||||
// jak 3
|
||||
"command-get-process",
|
||||
"(method 16 ragdoll-edit-info)",
|
||||
"(anon-function 4 gun-states)",
|
||||
"(method 10 manipulator)",
|
||||
"(method 46 ff-squad-control)",
|
||||
"borrow-city-expansion",
|
||||
"(method 26 level-group)",
|
||||
"(anon-function 65 temple-obs)",
|
||||
|
||||
@@ -482,6 +482,14 @@ struct ExecutionContext {
|
||||
gprs[dst].du32[3] = s.du32[3];
|
||||
}
|
||||
|
||||
void pexcw(int dst, int src) {
|
||||
auto s = gpr_src(src);
|
||||
gprs[dst].du32[0] = s.du32[0];
|
||||
gprs[dst].du32[1] = s.du32[2];
|
||||
gprs[dst].du32[2] = s.du32[1];
|
||||
gprs[dst].du32[3] = s.du32[3];
|
||||
}
|
||||
|
||||
void pcgtw(int rd, int rs, int rt) {
|
||||
auto s = gpr_src(rs);
|
||||
auto t = gpr_src(rt);
|
||||
|
||||
@@ -291,6 +291,7 @@
|
||||
["region", "region", 5, ["GAME"], "engine/level"],
|
||||
["fma-sphere", "fma-sphere", 5, ["GAME"], "engine/anim"],
|
||||
["prim-beam-h", "prim-beam-h", 5, ["GAME"], "engine/common-obs"],
|
||||
["script", "script", 5, ["GAME"], "engine/util"],
|
||||
["generic-obs", "generic-obs", 5, ["GAME"], "engine/common-obs"],
|
||||
["lightning", "lightning", 5, ["GAME"], "engine/gfx/generic/lightning"],
|
||||
["light-trails-h", "light-trails-h", 5, ["GAME"], "engine/gfx/sprite/particles"],
|
||||
@@ -319,6 +320,7 @@
|
||||
["task-arrow", "task-arrow", 5, ["GAME"], "engine/game/task"],
|
||||
["projectile", "projectile", 5, ["GAME"], "engine/common-obs"],
|
||||
["ragdoll", "ragdoll", 5, ["GAME"], "engine/physics"],
|
||||
["ragdoll-edit", "ragdoll-edit", 5, ["GAME"], "engine/physics"],
|
||||
["lightjak-wings", "lightjak-wings", 5, ["GAME"], "engine/target"],
|
||||
["target-handler", "target-handler", 5, ["GAME"], "engine/target"],
|
||||
["target-anim", "target-anim", 5, ["GAME"], "engine/target"],
|
||||
@@ -336,6 +338,7 @@
|
||||
["gun-yellow-shot", "gun-yellow-shot", 5, ["GAME"], "engine/target/gun"],
|
||||
["gun-red-shot", "gun-red-shot", 5, ["GAME"], "engine/target/gun"],
|
||||
["gun-dark-shot", "gun-dark-shot", 5, ["GAME"], "engine/target/gun"],
|
||||
["gun-states", "gun-states", 5, ["GAME"], "engine/target/gun"],
|
||||
["board-util", "board-util", 5, ["GAME"], "engine/target/board"],
|
||||
["target-board", "target-board", 5, ["GAME"], "engine/target/board"],
|
||||
["board-part", "board-part", 5, ["GAME"], "engine/target/board"],
|
||||
@@ -393,6 +396,7 @@
|
||||
["anim-tester", "anim-tester", 5, ["GAME"], "engine/debug"],
|
||||
["viewer", "viewer", 5, ["GAME"], "engine/debug"],
|
||||
["part-tester", "part-tester", 5, ["GAME"], "engine/debug"],
|
||||
["manipulator", "manipulator", 5, ["GAME"], "engine/debug"],
|
||||
["editable-h", "editable-h", 5, ["GAME"], "engine/debug"],
|
||||
["editable", "editable", 5, ["GAME"], "engine/debug"],
|
||||
["editable-player", "editable-player", 5, ["GAME"], "engine/debug"],
|
||||
@@ -943,6 +947,8 @@
|
||||
["towerb-vis", "towerb-vis", 5, ["TOWB"], "levels/tower"],
|
||||
["hfrag-vu1-h", "hfrag-vu1-h", 5, ["HGA", "WIN", "DST"], "engine/gfx/background/hfrag"],
|
||||
["hfrag-common", "hfrag-common", 5, ["HGA", "WIN", "DST"], "engine/gfx/background/hfrag"],
|
||||
["hfrag-vu1", "hfrag-vu1", 5, ["HGA", "WIN", "DST"], "engine/gfx/background/hfrag"],
|
||||
["hfrag", "hfrag", 5, ["HGA", "WIN", "DST"], "engine/gfx/background/hfrag"],
|
||||
["hfrag-work", "hfrag-work", 5, ["HGA", "WIN", "DST"], "engine/gfx/background/hfrag"],
|
||||
["hfrag-texture-anim", "hfrag-texture-anim", 5, ["HGA", "WIN", "DST"], "engine/gfx/background/hfrag"],
|
||||
["desert-mood", "desert-mood", 5, ["HGA", "WIN", "DST"], "levels/desert"],
|
||||
@@ -2409,6 +2415,7 @@
|
||||
["mh-squad-member", "mh-squad-member", 5, ["CWI"], "levels/city/common"],
|
||||
["metalhead-flitter", "metalhead-flitter", 5, ["CWI"], "levels/city/traffic/citizen"],
|
||||
["kg-squad-control", "kg-squad-control", 5, ["CWI"], "levels/city/common"],
|
||||
["ff-squad-control", "ff-squad-control", 5, ["CWI"], "levels/city/common"],
|
||||
["mh-squad-control", "mh-squad-control", 5, ["CWI"], "levels/city/common"],
|
||||
["cty-borrow-manager", "cty-borrow-manager", 5, ["CWI"], "levels/city/common"],
|
||||
["ctywide-init", "ctywide-init", 5, ["CWI"], "levels/city/common"],
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: manipulator.gc
|
||||
;; name in dgo: manipulator
|
||||
;; dgos: GAME
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: hfrag-vu1.gc
|
||||
;; name in dgo: hfrag-vu1
|
||||
;; dgos: HGA, WIN, DST
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: hfrag.gc
|
||||
;; name in dgo: hfrag
|
||||
;; dgos: HGA, WIN, DST
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: ragdoll-edit.gc
|
||||
;; name in dgo: ragdoll-edit
|
||||
;; dgos: GAME
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: gun-states.gc
|
||||
;; name in dgo: gun-states
|
||||
;; dgos: GAME
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: script.gc
|
||||
;; name in dgo: script
|
||||
;; dgos: GAME
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; name: ff-squad-control.gc
|
||||
;; name in dgo: ff-squad-control
|
||||
;; dgos: CWI
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -175,7 +175,9 @@ engine_files = {
|
||||
"light-trails": "gfx/sprite/particles",
|
||||
"lightning-new": "gfx/generic/lightning",
|
||||
|
||||
"hfrag": "gfx/background/hfrag",
|
||||
"hfrag-h": "gfx/background/hfrag",
|
||||
"hfrag-vu1": "gfx/background/hfrag",
|
||||
"hfrag-vu1-h": "gfx/background/hfrag",
|
||||
"hfrag-common": "gfx/background/hfrag",
|
||||
"hfrag-work": "gfx/background/hfrag",
|
||||
@@ -376,7 +378,9 @@ path_overrides = {
|
||||
"jak-pilot-hcar+0-ag": "engine/target",
|
||||
"rapid-gunner": "levels/stadium",
|
||||
"spydroid": "levels/common/enemy",
|
||||
"credits": "levels/title"
|
||||
"credits": "levels/title",
|
||||
"ragdoll-edit": "engine/physics",
|
||||
"manipulator": "engine/debug"
|
||||
}
|
||||
|
||||
# i can be smarter than this...i swear....refactor eventually!
|
||||
|
||||
Reference in New Issue
Block a user