mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-23 14:20:07 +00:00
decompile goal code for ocean mid (#1231)
This commit is contained in:
parent
bb85eaf167
commit
b2131d43e3
@ -143,6 +143,7 @@ VuDisassembler::VuDisassembler(VuKind kind) : m_kind(kind) {
|
||||
add_op(VuInstrK::ADDq, "addq").iemdt().dst_mask().vft_zero().dst_vfd().src_vfs().src_q();
|
||||
add_op(VuInstrK::MULi, "muli").iemdt().dst_mask().vft_zero().dst_vfd().src_vfs().src_i();
|
||||
add_op(VuInstrK::ADDi, "addi").iemdt().dst_mask().vft_zero().dst_vfd().src_vfs().src_i();
|
||||
add_op(VuInstrK::MULAq, "mula").iemdt().dst_mask().dst_acc().vft_zero().src_vfs().src_q();
|
||||
|
||||
m_lower_op6_table[0b000000].set(VuInstrK::LQ);
|
||||
m_lower_op6_table[0b000001].set(VuInstrK::SQ);
|
||||
@ -214,7 +215,8 @@ VuDisassembler::VuDisassembler(VuKind kind) : m_kind(kind) {
|
||||
add_op(VuInstrK::IBGEZ, "ibgez").dst_mask_zero().vit_zero().src_vis().rel_branch11();
|
||||
add_op(VuInstrK::ISWR, "iswr").dst_mask().src_vit().src_vis();
|
||||
add_op(VuInstrK::JALR, "jalr").dst_mask_zero().dst_vit().src_vis().imm11_zero();
|
||||
add_op(VuInstrK::WAITQ, "waitq").dst_mask_zero().vft_zero().vis_zero();
|
||||
add_op(VuInstrK::WAITP, "waitp").dst_mask_zero().vft_zero().vfs_zero();
|
||||
add_op(VuInstrK::WAITQ, "waitq").dst_mask_zero().vft_zero().vfs_zero();
|
||||
add_op(VuInstrK::IBLEZ, "iblez").dst_mask_zero().vit_zero().src_vis().rel_branch11();
|
||||
add_op(VuInstrK::SQRT, "sqrt").fsf_zero().ftf_0().vis_zero().dst_q().src_vft();
|
||||
add_op(VuInstrK::SQD, "sqd").dst_mask().src_vfs().src_vit();
|
||||
@ -289,6 +291,8 @@ VuInstrK VuDisassembler::lower_kind(u32 in) {
|
||||
return VuInstrK::XGKICK;
|
||||
case 0b11100'1111'11:
|
||||
return VuInstrK::ERLENG;
|
||||
case 0b11110'1111'11:
|
||||
return VuInstrK::WAITP;
|
||||
}
|
||||
fmt::print("Unknown lower special: 0b{:b}\n", in);
|
||||
ASSERT(false);
|
||||
@ -343,6 +347,8 @@ VuInstrK VuDisassembler::upper_kind(u32 in) {
|
||||
case 0b00110'1111'10:
|
||||
case 0b00110'1111'11:
|
||||
return VuInstrK::MULAbc;
|
||||
case 0b00111'1111'00:
|
||||
return VuInstrK::MULAq;
|
||||
case 0b00111'1111'11:
|
||||
return VuInstrK::CLIP;
|
||||
case 0b01010'1111'00:
|
||||
|
@ -148,6 +148,10 @@ class VuDisassembler {
|
||||
return step({VuDecodeStep::FieldK::FS, VuDecodeStep::AtomK::ASSERT_ZERO});
|
||||
}
|
||||
|
||||
OpInfo& vfs_zero() {
|
||||
return step({VuDecodeStep::FieldK::FS, VuDecodeStep::AtomK::ASSERT_ZERO});
|
||||
}
|
||||
|
||||
OpInfo& ftf_zero() {
|
||||
return step({VuDecodeStep::FieldK::FTF, VuDecodeStep::AtomK::ASSERT_ZERO});
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ enum class VuInstrK {
|
||||
MULbc, // 20
|
||||
MULA,
|
||||
// MULAi,
|
||||
// MULAq,
|
||||
MULAq,
|
||||
MULAbc,
|
||||
MADD,
|
||||
// MADDi,
|
||||
@ -124,7 +124,7 @@ enum class VuInstrK {
|
||||
JR, // 110
|
||||
JALR,
|
||||
MFP,
|
||||
// WAITP,
|
||||
WAITP,
|
||||
// ESADD,
|
||||
// ERSADD,
|
||||
// ELENG,
|
||||
|
@ -7156,7 +7156,7 @@
|
||||
(corner-array ocean-corner 25 :inline :offset-assert 80)
|
||||
(corner-count int32 :offset-assert 2080)
|
||||
(temp-vecs vector 4 :inline :offset-assert 2096)
|
||||
(mid-mask-ptrs (pointer int32) 36 :offset-assert 2160)
|
||||
(mid-mask-ptrs (pointer int64) 36 :offset-assert 2160)
|
||||
(mid-camera-masks uint64 36 :offset-assert 2304)
|
||||
(trans-mask-ptrs (pointer int32) 64 :offset-assert 2592)
|
||||
(trans-camera-masks ocean-trans-mask 16 :inline :offset-assert 2848)
|
||||
@ -7233,17 +7233,17 @@
|
||||
(fog vector :inline :offset-assert 48)
|
||||
(constants vector :inline :offset-assert 64)
|
||||
(constants2 vector :inline :offset-assert 80)
|
||||
(drw-fan qword :inline :offset-assert 96)
|
||||
(env-fan qword :inline :offset-assert 112)
|
||||
(drw-adgif qword :inline :offset-assert 128)
|
||||
(drw-fan gs-gif-tag :inline :offset-assert 96) ;; was qword
|
||||
(env-fan gs-gif-tag :inline :offset-assert 112) ;; was qword
|
||||
(drw-adgif gs-gif-tag :inline :offset-assert 128);; was qword
|
||||
(drw-texture adgif-shader :inline :offset-assert 144)
|
||||
(drw-strip-0 qword :inline :offset-assert 224)
|
||||
(drw-strip-1 qword :inline :offset-assert 240)
|
||||
(env-adgif qword :inline :offset-assert 256)
|
||||
(drw-strip-0 gs-gif-tag :inline :offset-assert 224) ;; was qword
|
||||
(drw-strip-1 gs-gif-tag :inline :offset-assert 240) ;; was qword
|
||||
(env-adgif gs-gif-tag :inline :offset-assert 256) ;; was qword
|
||||
(env-texture adgif-shader :inline :offset-assert 272)
|
||||
(env-strip qword :inline :offset-assert 352)
|
||||
(env-strip gs-gif-tag :inline :offset-assert 352) ;; was qword
|
||||
(env-color vector :inline :offset-assert 368)
|
||||
(index-table uint128 8 :offset-assert 384)
|
||||
(index-table vector4w 8 :inline :offset-assert 384)
|
||||
(pos0 vector :inline :offset-assert 512)
|
||||
(pos1 vector :inline :offset-assert 528)
|
||||
(pos2 vector :inline :offset-assert 544)
|
||||
@ -21768,25 +21768,25 @@
|
||||
|
||||
;; - Functions
|
||||
|
||||
(define-extern ocean-mid-add-constants function)
|
||||
(define-extern ocean-mid-add-constants (function dma-buffer none))
|
||||
(define-extern ocean-mid-add-call (function dma-buffer int none))
|
||||
(define-extern ocean-mid-add-upload function)
|
||||
(define-extern ocean-mid-add-upload (function dma-buffer int int int int float symbol))
|
||||
(define-extern ocean-mid-add-call-flush (function dma-buffer uint none))
|
||||
(define-extern draw-ocean-transition (function dma-buffer none))
|
||||
(define-extern draw-ocean-mid-seams function)
|
||||
(define-extern ocean-seams-add-constants function)
|
||||
(define-extern ocean-mid-add-upload-top function)
|
||||
(define-extern ocean-mid-add-upload-bottom function)
|
||||
(define-extern ocean-mid-add-upload-middle function)
|
||||
(define-extern ocean-mid-camera-masks-bit? (function uint uint))
|
||||
(define-extern ocean-mid-mask-ptrs-bit? (function uint uint))
|
||||
(define-extern ocean-mid-add-upload-table function)
|
||||
(define-extern ocean-mid-camera-masks-set! function)
|
||||
(define-extern ocean-mid-add-matrices (function dma-buffer none)) ;; not verified
|
||||
(define-extern ocean-mid-check function)
|
||||
(define-extern draw-ocean-mid-seams (function dma-buffer none))
|
||||
(define-extern ocean-seams-add-constants (function dma-buffer none))
|
||||
(define-extern ocean-mid-add-upload-top (function dma-buffer uint uint none))
|
||||
(define-extern ocean-mid-add-upload-bottom (function dma-buffer uint uint none))
|
||||
(define-extern ocean-mid-add-upload-middle (function dma-buffer uint uint none))
|
||||
(define-extern ocean-mid-camera-masks-bit? (function uint uint symbol))
|
||||
(define-extern ocean-mid-mask-ptrs-bit? (function uint uint symbol))
|
||||
(define-extern ocean-mid-add-upload-table (function dma-buffer uint uint (pointer float) int symbol none))
|
||||
(define-extern ocean-mid-camera-masks-set! (function uint uint symbol))
|
||||
(define-extern ocean-mid-add-matrices (function dma-buffer vector none)) ;; not verified
|
||||
(define-extern ocean-mid-check (function pointer int int vector symbol))
|
||||
(define-extern ocean-matrix*! (function matrix matrix matrix matrix))
|
||||
(define-extern ocean-mid-setup-constants function)
|
||||
(define-extern ocean-vector-matrix*! function)
|
||||
(define-extern ocean-mid-setup-constants (function ocean-mid-constants none))
|
||||
(define-extern ocean-vector-matrix*! (function vector vector matrix vector))
|
||||
|
||||
;; - Unknowns
|
||||
|
||||
@ -21824,7 +21824,7 @@
|
||||
(define-extern ocean-near-add-constants (function dma-buffer none))
|
||||
(define-extern ocean-near-add-heights (function dma-buffer ocean-wave-info))
|
||||
(define-extern ocean-near-add-call (function dma-buffer int none))
|
||||
(define-extern ocean-near-add-upload (function dma-buffer float float ocean-near-upload))
|
||||
(define-extern ocean-near-add-upload (function dma-buffer uint uint ocean-near-upload))
|
||||
(define-extern ocean-near-add-matrices (function dma-buffer matrix none))
|
||||
(define-extern ocean-near-setup-constants (function (inline-array vector) vector))
|
||||
(define-extern ocean-near-add-call-flush (function dma-buffer int none))
|
||||
|
@ -5472,5 +5472,33 @@
|
||||
|
||||
"ocean-near-add-matrices": [[16, "matrix"]],
|
||||
|
||||
"ocean-near-add-upload": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"draw-ocean-mid": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"draw-ocean-mid-seams": [
|
||||
[16, "sphere"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-upload-table": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-upload": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"ocean-mid-check": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-matrices": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below!": []
|
||||
}
|
||||
|
@ -4023,7 +4023,9 @@
|
||||
[251, "a0", "process-drawable"]
|
||||
],
|
||||
|
||||
"(anon-function 46 racer-states)": [[[4, 32], "v1", "target"]],
|
||||
"(anon-function 46 racer-states)": [
|
||||
[[4, 32], "v1", "target"]
|
||||
],
|
||||
|
||||
"(anon-function 45 racer-states)": [
|
||||
[19, "a0", "target"],
|
||||
@ -7261,7 +7263,7 @@
|
||||
[8, "a0", "dma-packet"],
|
||||
[10, "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
|
||||
"ocean-near-add-matrices": [
|
||||
[7, "a0", "dma-packet"],
|
||||
[12, "a0", "dma-packet"],
|
||||
@ -7273,7 +7275,9 @@
|
||||
[47, "v1", "matrix"]
|
||||
],
|
||||
|
||||
"ocean-near-add-constants": [[3, "a0", "dma-packet"]],
|
||||
"ocean-near-add-constants": [
|
||||
[3, "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
"draw-ocean-near": [
|
||||
[2, "a0", "dma-packet"],
|
||||
@ -7282,20 +7286,22 @@
|
||||
[7, "a0", "dma-packet"],
|
||||
[8, "a0", "dma-packet"],
|
||||
[11, "a0", "dma-packet"],
|
||||
[14, "a0", "dma-packet"],
|
||||
[16, "a0", "dma-packet"],
|
||||
[17, "a0", "dma-packet"],
|
||||
[[14, 17], "a0", "gs-gif-tag"],
|
||||
// [14, "a0", "dma-packet"],
|
||||
// [16, "a0", "dma-packet"],
|
||||
// [17, "a0", "dma-packet"],
|
||||
[18, "a0", "dma-packet"],
|
||||
[20, "a0", "dma-packet"],
|
||||
[22, "a0", "dma-packet"],
|
||||
[24, "a0", "dma-packet"],
|
||||
[22, "a0", "(pointer gs-test)"],
|
||||
[24, "a0", "(pointer gs-reg64)"],
|
||||
[25, "a0", "dma-packet"],
|
||||
[26, "a0", "dma-packet"],
|
||||
[35, "a0", "dma-packet"],
|
||||
[37, "a0", "dma-packet"],
|
||||
[39, "a0", "dma-packet"],
|
||||
[40, "a0", "dma-packet"],
|
||||
[41, "a0", "dma-packet"]
|
||||
[41, "a0", "dma-packet"],
|
||||
[89, "a1", "(pointer int16)"]
|
||||
],
|
||||
|
||||
"generic-reset-buffers": [
|
||||
@ -7338,7 +7344,7 @@
|
||||
[24, "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
"draw-bones-generic-merc": [
|
||||
"draw-bones-generic-merc":[
|
||||
[11, "v1", "generic-merc-ctrl"],
|
||||
[198, "v1", "generic-merc-ctrl"],
|
||||
[274, "a0", "generic-merc-ctrl"],
|
||||
@ -7352,7 +7358,7 @@
|
||||
],
|
||||
|
||||
"generic-merc-execute-all": [
|
||||
[[165, 170], "v1", "terrain-context"],
|
||||
[[165,170], "v1", "terrain-context"],
|
||||
[92, "a0", "terrain-context"],
|
||||
[96, "v1", "terrain-context"],
|
||||
[100, "v1", "terrain-context"],
|
||||
@ -7370,7 +7376,7 @@
|
||||
[32, "a0", "terrain-context"]
|
||||
],
|
||||
|
||||
"generic-work-init": [
|
||||
"generic-work-init":[
|
||||
[10, "a0", "terrain-context"],
|
||||
[13, "a0", "terrain-context"],
|
||||
[16, "a0", "terrain-context"],
|
||||
@ -7525,5 +7531,74 @@
|
||||
[57, "v1", "(inline-array vector)"]
|
||||
],
|
||||
|
||||
"ocean-near-add-upload":[
|
||||
[[40, 48], "a0", "dma-packet"],
|
||||
[64, "a2", "(pointer int16)"],
|
||||
[[81, 89], "a1", "vector4w"],
|
||||
[[90, 98], "v1", "vector4w"],
|
||||
[[111, 127], "t0", "vector4w"],
|
||||
[[132, 146], "a1", "vector"],
|
||||
[[250, 272], "a1", "(inline-array vector)"]
|
||||
],
|
||||
|
||||
"draw-ocean-mid": [
|
||||
[169, "t3", "(pointer uint8)"],
|
||||
[[23, 28], "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
"ocean-seams-add-constants": [
|
||||
[[7, 15], "a1", "dma-packet"],
|
||||
[[19, 27], "a1", "vector"],
|
||||
[[28, 36], "a1", "vector"],
|
||||
[[37, 45], "a1", "vector"],
|
||||
[[46, 55], "v1", "vector"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-upload-table": [
|
||||
[[44, 52], "a0", "dma-packet"],
|
||||
[[54, 59], "v1", "vector4w"],
|
||||
[[62, 75], "v1", "(pointer uint128)"],
|
||||
[[158, 166], "a0", "dma-packet"],
|
||||
[[138, 145], "v1", "(pointer uint128)"]
|
||||
],
|
||||
|
||||
"ocean-mid-camera-masks-set!": [
|
||||
[30, "a2", "(pointer uint8)"],
|
||||
[41, "a2", "(pointer uint8)"],
|
||||
[49, "v1", "(pointer uint8)"]
|
||||
],
|
||||
|
||||
"ocean-mid-mask-ptrs-bit?": [
|
||||
[31, "a0", "(pointer uint8)"]
|
||||
],
|
||||
|
||||
"ocean-mid-camera-masks-bit?": [
|
||||
[25, "a0", "(pointer uint8)"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-upload": [
|
||||
[[48, 62], "a2", "dma-packet"],
|
||||
[[76, 81], "a0", "dma-packet"],
|
||||
[95, "v1", "(pointer uint64)"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-call-flush": [
|
||||
[[3, 11], "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-call": [
|
||||
[[3, 11], "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-matrices": [
|
||||
[[12, 20], "a0", "dma-packet"],
|
||||
[[30, 34], "v1", "matrix"],
|
||||
[[41, 46], "s3", "vector"]
|
||||
],
|
||||
|
||||
"ocean-mid-add-constants": [
|
||||
[[8, 16], "a0", "dma-packet"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below": []
|
||||
}
|
||||
|
@ -48,6 +48,8 @@ void OceanMidAndFar::render(DmaFollower& dma,
|
||||
|
||||
handle_ocean_far(dma, render_state, prof);
|
||||
|
||||
handle_ocean_mid(dma, render_state, prof);
|
||||
|
||||
auto final_next = dma.read_and_advance();
|
||||
ASSERT(final_next.vifcode0().kind == VifCode::Kind::NOP &&
|
||||
final_next.vifcode1().kind == VifCode::Kind::NOP && final_next.size_bytes == 0);
|
||||
@ -74,11 +76,24 @@ void OceanMidAndFar::handle_ocean_far(DmaFollower& dma,
|
||||
memcpy(init_data_buffer + 80, &val, 1);
|
||||
m_direct.render_gif(init_data_buffer, 160, render_state, prof);
|
||||
|
||||
while (dma.current_tag().kind == DmaTag::Kind::CNT) {
|
||||
while (dma.current_tag().kind == DmaTag::Kind::CNT &&
|
||||
dma.current_tag_vifcode0().kind == VifCode::Kind::NOP) {
|
||||
auto data = dma.read_and_advance();
|
||||
ASSERT(data.vifcode0().kind == VifCode::Kind::NOP);
|
||||
ASSERT(data.vifcode1().kind == VifCode::Kind::DIRECT);
|
||||
ASSERT(data.size_bytes / 16 == data.vifcode1().immediate);
|
||||
m_direct.render_gif(data.data, data.size_bytes, render_state, prof);
|
||||
}
|
||||
}
|
||||
|
||||
bool is_end_tag(const DmaTag& tag, const VifCode& v0, const VifCode& v1) {
|
||||
return tag.qwc == 0 && tag.kind == DmaTag::Kind::NEXT && v0.kind == VifCode::Kind::NOP &&
|
||||
v1.kind == VifCode::Kind::NOP;
|
||||
}
|
||||
void OceanMidAndFar::handle_ocean_mid(DmaFollower& dma,
|
||||
SharedRenderState* render_state,
|
||||
ScopedProfilerNode& prof) {
|
||||
while (!is_end_tag(dma.current_tag(), dma.current_tag_vifcode0(), dma.current_tag_vifcode1())) {
|
||||
dma.read_and_advance();
|
||||
}
|
||||
}
|
@ -20,6 +20,9 @@ class OceanMidAndFar : public BucketRenderer {
|
||||
void handle_ocean_far(DmaFollower& dma,
|
||||
SharedRenderState* render_state,
|
||||
ScopedProfilerNode& prof);
|
||||
void handle_ocean_mid(DmaFollower& dma,
|
||||
SharedRenderState* render_state,
|
||||
ScopedProfilerNode& prof);
|
||||
|
||||
DirectRenderer m_direct;
|
||||
OceanTexture m_texture_renderer;
|
||||
|
@ -10,6 +10,8 @@
|
||||
(define-extern update-ocean (function none))
|
||||
(define-extern draw-ocean (function none))
|
||||
(define-extern draw-ocean-texture (function dma-buffer (inline-array vector) symbol none))
|
||||
(define-extern draw-ocean-transition (function dma-buffer none))
|
||||
(define-extern draw-ocean-mid (function dma-buffer none))
|
||||
|
||||
;; The "ocean" renderer is used to render the infinite water.
|
||||
;; It doesn't draw the rivers in FJ or the water near the farmer.
|
||||
@ -204,7 +206,7 @@
|
||||
(corner-array ocean-corner 25 :inline :offset-assert 80)
|
||||
(corner-count int32 :offset-assert 2080)
|
||||
(temp-vecs vector 4 :inline :offset-assert 2096)
|
||||
(mid-mask-ptrs (pointer int32) 36 :offset-assert 2160)
|
||||
(mid-mask-ptrs (pointer int64) 36 :offset-assert 2160)
|
||||
(mid-camera-masks uint64 36 :offset-assert 2304)
|
||||
(trans-mask-ptrs (pointer int32) 64 :offset-assert 2592)
|
||||
(trans-camera-masks ocean-trans-mask 16 :inline :offset-assert 2848)
|
||||
@ -289,17 +291,17 @@
|
||||
(fog vector :inline :offset-assert 48)
|
||||
(constants vector :inline :offset-assert 64)
|
||||
(constants2 vector :inline :offset-assert 80)
|
||||
(drw-fan qword :inline :offset-assert 96)
|
||||
(env-fan qword :inline :offset-assert 112)
|
||||
(drw-adgif qword :inline :offset-assert 128)
|
||||
(drw-fan gs-gif-tag :inline :offset-assert 96) ;; was qword
|
||||
(env-fan gs-gif-tag :inline :offset-assert 112) ;; was qword
|
||||
(drw-adgif gs-gif-tag :inline :offset-assert 128);; was qword
|
||||
(drw-texture adgif-shader :inline :offset-assert 144)
|
||||
(drw-strip-0 qword :inline :offset-assert 224)
|
||||
(drw-strip-1 qword :inline :offset-assert 240)
|
||||
(env-adgif qword :inline :offset-assert 256)
|
||||
(drw-strip-0 gs-gif-tag :inline :offset-assert 224) ;; was qword
|
||||
(drw-strip-1 gs-gif-tag :inline :offset-assert 240) ;; was qword
|
||||
(env-adgif gs-gif-tag :inline :offset-assert 256) ;; was qword
|
||||
(env-texture adgif-shader :inline :offset-assert 272)
|
||||
(env-strip qword :inline :offset-assert 352)
|
||||
(env-strip gs-gif-tag :inline :offset-assert 352) ;; was qword
|
||||
(env-color vector :inline :offset-assert 368)
|
||||
(index-table uint128 8 :offset-assert 384)
|
||||
(index-table vector4w 8 :inline :offset-assert 384)
|
||||
(pos0 vector :inline :offset-assert 512)
|
||||
(pos1 vector :inline :offset-assert 528)
|
||||
(pos2 vector :inline :offset-assert 544)
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -648,9 +648,9 @@
|
||||
(draw-ocean-texture s5-0 *ocean-verts* #t)
|
||||
(ocean-init-buffer s5-0)
|
||||
(draw-ocean-far s5-0)
|
||||
; (if (not *ocean-mid-off*)
|
||||
; (draw-ocean-mid s5-0)
|
||||
; )
|
||||
(when (not *ocean-mid-off*)
|
||||
(draw-ocean-mid s5-0)
|
||||
)
|
||||
(ocean-end-buffer s5-0)
|
||||
(let ((a3-0 (-> s5-0 base)))
|
||||
(let ((v1-32 (the-as object (-> s5-0 base))))
|
||||
|
44
test/decompiler/reference/engine/gfx/ocean/ocean-h_REF.gc
generated
vendored
44
test/decompiler/reference/engine/gfx/ocean/ocean-h_REF.gc
generated
vendored
@ -370,7 +370,7 @@
|
||||
(corner-array ocean-corner 25 :inline :offset-assert 80)
|
||||
(corner-count int32 :offset-assert 2080)
|
||||
(temp-vecs vector 4 :inline :offset-assert 2096)
|
||||
(mid-mask-ptrs (pointer int32) 36 :offset-assert 2160)
|
||||
(mid-mask-ptrs (pointer int64) 36 :offset-assert 2160)
|
||||
(mid-camera-masks uint64 36 :offset-assert 2304)
|
||||
(trans-mask-ptrs (pointer int32) 64 :offset-assert 2592)
|
||||
(trans-camera-masks ocean-trans-mask 16 :inline :offset-assert 2848)
|
||||
@ -540,27 +540,27 @@
|
||||
|
||||
;; definition of type ocean-mid-constants
|
||||
(deftype ocean-mid-constants (structure)
|
||||
((hmge-scale vector :inline :offset-assert 0)
|
||||
(inv-hmge-scale vector :inline :offset-assert 16)
|
||||
(hvdf-offset vector :inline :offset-assert 32)
|
||||
(fog vector :inline :offset-assert 48)
|
||||
(constants vector :inline :offset-assert 64)
|
||||
(constants2 vector :inline :offset-assert 80)
|
||||
(drw-fan qword :inline :offset-assert 96)
|
||||
(env-fan qword :inline :offset-assert 112)
|
||||
(drw-adgif qword :inline :offset-assert 128)
|
||||
(drw-texture adgif-shader :inline :offset-assert 144)
|
||||
(drw-strip-0 qword :inline :offset-assert 224)
|
||||
(drw-strip-1 qword :inline :offset-assert 240)
|
||||
(env-adgif qword :inline :offset-assert 256)
|
||||
(env-texture adgif-shader :inline :offset-assert 272)
|
||||
(env-strip qword :inline :offset-assert 352)
|
||||
(env-color vector :inline :offset-assert 368)
|
||||
(index-table uint128 8 :offset-assert 384)
|
||||
(pos0 vector :inline :offset-assert 512)
|
||||
(pos1 vector :inline :offset-assert 528)
|
||||
(pos2 vector :inline :offset-assert 544)
|
||||
(pos3 vector :inline :offset-assert 560)
|
||||
((hmge-scale vector :inline :offset-assert 0)
|
||||
(inv-hmge-scale vector :inline :offset-assert 16)
|
||||
(hvdf-offset vector :inline :offset-assert 32)
|
||||
(fog vector :inline :offset-assert 48)
|
||||
(constants vector :inline :offset-assert 64)
|
||||
(constants2 vector :inline :offset-assert 80)
|
||||
(drw-fan gs-gif-tag :inline :offset-assert 96)
|
||||
(env-fan gs-gif-tag :inline :offset-assert 112)
|
||||
(drw-adgif gs-gif-tag :inline :offset-assert 128)
|
||||
(drw-texture adgif-shader :inline :offset-assert 144)
|
||||
(drw-strip-0 gs-gif-tag :inline :offset-assert 224)
|
||||
(drw-strip-1 gs-gif-tag :inline :offset-assert 240)
|
||||
(env-adgif gs-gif-tag :inline :offset-assert 256)
|
||||
(env-texture adgif-shader :inline :offset-assert 272)
|
||||
(env-strip gs-gif-tag :inline :offset-assert 352)
|
||||
(env-color vector :inline :offset-assert 368)
|
||||
(index-table vector4w 8 :inline :offset-assert 384)
|
||||
(pos0 vector :inline :offset-assert 512)
|
||||
(pos1 vector :inline :offset-assert 528)
|
||||
(pos2 vector :inline :offset-assert 544)
|
||||
(pos3 vector :inline :offset-assert 560)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x240
|
||||
|
1164
test/decompiler/reference/engine/gfx/ocean/ocean-mid_REF.gc
generated
vendored
Normal file
1164
test/decompiler/reference/engine/gfx/ocean/ocean-mid_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
test/decompiler/reference/engine/gfx/ocean/ocean-transition_REF.gc
generated
vendored
12
test/decompiler/reference/engine/gfx/ocean/ocean-transition_REF.gc
generated
vendored
@ -142,8 +142,8 @@
|
||||
(set! (-> a1-2 z) (+ (-> v1-1 z) (* 98304.0 (the float arg1))))
|
||||
)
|
||||
(set! (-> a1-2 w) 1.0)
|
||||
(ocean-mid-add-matrices arg0 a1-2)
|
||||
)
|
||||
(ocean-mid-add-matrices arg0)
|
||||
(let* ((a1-3 9)
|
||||
(v1-3 arg0)
|
||||
(a0-3 (the-as object (-> v1-3 base)))
|
||||
@ -333,8 +333,8 @@
|
||||
(set! (-> a1-1 z) (+ (-> v1-1 z) (* 393216.0 (the float arg1))))
|
||||
)
|
||||
(set! (-> a1-1 w) 1.0)
|
||||
(ocean-mid-add-matrices arg0 a1-1)
|
||||
)
|
||||
(ocean-mid-add-matrices arg0)
|
||||
(let* ((a1-2 9)
|
||||
(v1-3 arg0)
|
||||
(a0-2 (the-as object (-> v1-3 base)))
|
||||
@ -756,8 +756,8 @@
|
||||
(s2-0 sv-33)
|
||||
)
|
||||
(while (>= s2-0 s3-0)
|
||||
(when (not (ocean-mid-mask-ptrs-bit? s5-0))
|
||||
(when (ocean-mid-camera-masks-bit? s5-0)
|
||||
(when (not (ocean-mid-mask-ptrs-bit? s5-0 s3-0))
|
||||
(when (ocean-mid-camera-masks-bit? s5-0 s3-0)
|
||||
(set! (-> sv-36 x) (+ 196608.0 (* 393216.0 (the float s3-0)) (-> *ocean-map* start-corner x)))
|
||||
(set! (-> sv-36 z) (+ 196608.0 (* 393216.0 (the float s5-0)) (-> *ocean-map* start-corner z)))
|
||||
(if (sphere-cull sv-36)
|
||||
@ -835,8 +835,8 @@
|
||||
(s2-1 sv-33)
|
||||
)
|
||||
(while (>= s2-1 s3-1)
|
||||
(when (not (ocean-mid-mask-ptrs-bit? s5-1))
|
||||
(when (ocean-mid-camera-masks-bit? s5-1)
|
||||
(when (not (ocean-mid-mask-ptrs-bit? s5-1 s3-1))
|
||||
(when (ocean-mid-camera-masks-bit? s5-1 s3-1)
|
||||
(let ((v1-43 (-> *ocean-map* ocean-trans-indices data (+ (* (the-as uint 48) s5-1) s3-1))))
|
||||
(when (>= (-> v1-43 parent) 0)
|
||||
(set! sv-44 (+ (* (- s5-1 sv-34) 4) (- s3-1 sv-32)))
|
||||
|
@ -105,6 +105,21 @@ TEST(VuDisasm, OceanTexture) {
|
||||
EXPECT_EQ(disasm.to_string(prog), get_expected("ocean-texture"));
|
||||
}
|
||||
|
||||
TEST(VuDisasm, OceanMid) {
|
||||
auto data = get_test_data("ocean-mid");
|
||||
VuDisassembler disasm(VuDisassembler::VuKind::VU1);
|
||||
auto prog = disasm.disassemble(data.data(), data.size() * 4, false);
|
||||
EXPECT_EQ(disasm.to_string(prog), get_expected("ocean-mid"));
|
||||
}
|
||||
|
||||
// TEST(VuDisasm, OceanNear) {
|
||||
// auto data = get_test_data("ocean-near");
|
||||
// VuDisassembler disasm(VuDisassembler::VuKind::VU1);
|
||||
// auto prog = disasm.disassemble(data.data(), data.size() * 4, false);
|
||||
// fmt::print("{}\n", disasm.to_string(prog));
|
||||
// // EXPECT_EQ(disasm.to_string(prog), get_expected("ocean-mid"));
|
||||
// }
|
||||
|
||||
TEST(VuDisasm, Sky) {
|
||||
auto data = get_test_data("sky");
|
||||
VuDisassembler disasm(VuDisassembler::VuKind::VU1);
|
||||
@ -152,7 +167,7 @@ TEST(VuDisasm, Generic) {
|
||||
VuDisassembler disasm(VuDisassembler::VuKind::VU1);
|
||||
auto prog = disasm.disassemble(data.data(), data.size() * 4, false);
|
||||
EXPECT_EQ(disasm.to_string(prog), get_expected("generic"));
|
||||
fmt::print("{}\n", disasm.to_string_with_cpp(prog, false));
|
||||
// fmt::print("{}\n", disasm.to_string_with_cpp(prog, false));
|
||||
}
|
||||
|
||||
TEST(VuDisasm, TieNear) {
|
||||
|
1240
test/decompiler/vu_reference/ocean-mid-result.txt
Normal file
1240
test/decompiler/vu_reference/ocean-mid-result.txt
Normal file
File diff suppressed because it is too large
Load Diff
2350
test/decompiler/vu_reference/ocean-mid.txt
Normal file
2350
test/decompiler/vu_reference/ocean-mid.txt
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user