diff --git a/decompiler/VuDisasm/VuDisassembler.cpp b/decompiler/VuDisasm/VuDisassembler.cpp index 67c071c41e..786a1c4c4a 100644 --- a/decompiler/VuDisasm/VuDisassembler.cpp +++ b/decompiler/VuDisasm/VuDisassembler.cpp @@ -221,6 +221,7 @@ VuDisassembler::VuDisassembler(VuKind kind) : m_kind(kind) { 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(); add_op(VuInstrK::ERLENG, "erleng").dst_mask().vft_zero().src_vfs().dst_p(); + add_op(VuInstrK::ELENG, "eleng").dst_mask().vft_zero().src_vfs().dst_p(); add_op(VuInstrK::MFP, "mfp").dst_mask().dst_vft().src_p(); } @@ -289,6 +290,8 @@ VuInstrK VuDisassembler::lower_kind(u32 in) { return VuInstrK::XTOP; case 0b11011'1111'00: return VuInstrK::XGKICK; + case 0b11100'1111'10: + return VuInstrK::ELENG; case 0b11100'1111'11: return VuInstrK::ERLENG; case 0b11110'1111'11: @@ -830,7 +833,6 @@ std::string VuDisassembler::to_cpp(const VuInstruction& instr, bool mips2c_forma vi_src(instr.src.at(1).to_string(m_label_names), mips2c_format)); case VuInstrK::IOR: if (instr.src.at(1).is_int_reg(0)) { - fmt::print("instr: {}\n", to_string(instr)); if (instr.src.at(0).is_int_reg(0) && instr.src.at(1).is_int_reg(0)) { return fmt::format("vu.{} = 0;", instr.dst->to_string(m_label_names)); } else { @@ -873,6 +875,8 @@ std::string VuDisassembler::to_cpp(const VuInstruction& instr, bool mips2c_forma case VuInstrK::ERLENG: return fmt::format("vu.P = erleng(vu.{});", instr.src.at(0).to_string(m_label_names)); + case VuInstrK::ELENG: + return fmt::format("vu.P = eleng(vu.{});", instr.src.at(0).to_string(m_label_names)); case VuInstrK::RSQRT: return fmt::format( "c->Q = c->vf_src({}).vf.{}() / std::sqrt(c->vf_src({}).vf.{}());", @@ -976,6 +980,14 @@ std::string VuDisassembler::to_cpp(const VuInstruction& instr, bool mips2c_forma mask_to_string(*instr.mask), instr.dst->to_string(m_label_names), instr.src.at(0).to_string(m_label_names), instr.src.at(1).to_string(m_label_names), bc_to_part(*instr.bc)); + case VuInstrK::MSUBbc: + return fmt::format( + mips2c_format + ? "c->acc.vf.msub(Mask::{}, c->vfs[{}].vf, c->vf_src({}).vf, c->vf_src({}).vf.{}());" + : "vu.acc.msub(Mask::{}, vu.{}, vu.{}, vu.{}.{}());", + mask_to_string(*instr.mask), instr.dst->to_string(m_label_names), + instr.src.at(0).to_string(m_label_names), instr.src.at(1).to_string(m_label_names), + bc_to_part(*instr.bc)); case VuInstrK::MULA: return fmt::format("vu.acc.mula(Mask::{}, vu.{}, vu.{});", mask_to_string(*instr.mask), instr.src.at(0).to_string(m_label_names), diff --git a/decompiler/VuDisasm/VuInstruction.h b/decompiler/VuDisasm/VuInstruction.h index 19cc12b447..7169928260 100644 --- a/decompiler/VuDisasm/VuInstruction.h +++ b/decompiler/VuDisasm/VuInstruction.h @@ -127,7 +127,7 @@ enum class VuInstrK { WAITP, // ESADD, // ERSADD, - // ELENG, + ELENG, ERLENG, // EATANxy, // EATANxz, diff --git a/decompiler/config/all-types.gc b/decompiler/config/all-types.gc index 87b6941ea0..d82f0ac16c 100644 --- a/decompiler/config/all-types.gc +++ b/decompiler/config/all-types.gc @@ -7307,23 +7307,23 @@ (constants2 vector :inline :offset-assert 80) (constants3 vector :inline :offset-assert 96) (constants4 vector :inline :offset-assert 112) - (drw-fan qword :inline :offset-assert 128) - (drw2-fan qword :inline :offset-assert 144) - (env-fan qword :inline :offset-assert 160) - (drw-adgif qword :inline :offset-assert 176) + (drw-fan gs-gif-tag :inline :offset-assert 128) ;; was qword + (drw2-fan gs-gif-tag :inline :offset-assert 144) ;; was qword + (env-fan gs-gif-tag :inline :offset-assert 160) ;; was qword + (drw-adgif gs-gif-tag :inline :offset-assert 176) ;; was qword (drw-texture adgif-shader :inline :offset-assert 192) - (drw-strip qword :inline :offset-assert 272) - (env-adgif qword :inline :offset-assert 288) - (env-texture adgif-shader :inline :offset-assert 304) - (env-strip qword :inline :offset-assert 384) + (drw-strip gs-gif-tag :inline :offset-assert 272) ;; was qword + (env-adgif gs-gif-tag :inline :offset-assert 288) ;; was qword + (env-texture adgif-shader :inline :offset-assert 304) ;; was qword + (env-strip gs-gif-tag :inline :offset-assert 384) (env-color vector :inline :offset-assert 400) - (drw2-adgif qword :inline :offset-assert 416) + (drw2-adgif gs-gif-tag :inline :offset-assert 416) (drw2-tex0 qword :inline :offset-assert 432) (drw2-frame qword :inline :offset-assert 448) - (drw2-strip qword :inline :offset-assert 464) - (drw3-adgif qword :inline :offset-assert 480) + (drw2-strip gs-gif-tag :inline :offset-assert 464) + (drw3-adgif gs-gif-tag :inline :offset-assert 480) (drw3-frame qword :inline :offset-assert 496) - (index-table uint128 4 :offset-assert 512) + (index-table vector4w 4 :inline :offset-assert 512) ) :method-count-assert 9 :size-assert #x240 @@ -21708,7 +21708,7 @@ (define-extern draw-ocean-far (function dma-buffer profile-frame)) (define-extern draw-ocean-mid (function dma-buffer none)) ; not confirmed (define-extern ocean-end-buffer (function dma-buffer pointer)) -(define-extern draw-ocean-near (function dma-buffer none)) ; not confirmed +(define-extern draw-ocean-near (function dma-buffer none)) (define-extern init-ocean-far-regs (function none)) (define-extern render-ocean-far (function dma-buffer int none)) (define-extern render-ocean-quad (function (inline-array ocean-vertex) dma-buffer symbol)) @@ -21822,11 +21822,11 @@ ;; - Functions (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-heights (function dma-buffer none)) (define-extern ocean-near-add-call (function dma-buffer int none)) -(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-upload (function dma-buffer uint uint none)) +(define-extern ocean-near-add-matrices (function dma-buffer vector none)) +(define-extern ocean-near-setup-constants (function ocean-near-constants none)) (define-extern ocean-near-add-call-flush (function dma-buffer int none)) ;; - Unknowns diff --git a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc index 6bf38f1926..fd8d8f55a3 100644 --- a/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/stack_structures.jsonc @@ -5470,7 +5470,7 @@ [48, "eye"] ], - "ocean-near-add-matrices": [[16, "matrix"]], + "ocean-near-add-matrices": [[16, "vector"]], "ocean-near-add-upload": [ [16, "vector"] diff --git a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc index d79316288c..20fc420f43 100644 --- a/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc +++ b/decompiler/config/jak1_ntsc_black_label/type_casts.jsonc @@ -7272,11 +7272,12 @@ [20, "a0", "vector"], [22, "s4", "matrix"], [23, "s4", "matrix"], - [47, "v1", "matrix"] + [47, "v1", "matrix"], + [[40, 46], "s3", "vector"] ], "ocean-near-add-constants": [ - [3, "a0", "dma-packet"] + [[8, 16], "a0", "dma-packet"] ], "draw-ocean-near": [ @@ -7600,5 +7601,11 @@ [[8, 16], "a0", "dma-packet"] ], + "ocean-near-add-heights" : [ + [26, "a1", "int"], + [[11, 19], "a3", "dma-packet"], + [[30, 38], "a2", "dma-packet"] + ], + "placeholder-do-not-add-below": [] } diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index b235764ac4..d01c86bcac 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -87,6 +87,8 @@ set(RUNTIME_SOURCE graphics/opengl_renderer/ocean/OceanMid.cpp graphics/opengl_renderer/ocean/OceanMid_PS2.cpp graphics/opengl_renderer/ocean/OceanMidAndFar.cpp + graphics/opengl_renderer/ocean/OceanNear.cpp + graphics/opengl_renderer/ocean/OceanNear_PS2.cpp graphics/opengl_renderer/ocean/OceanTexture.cpp graphics/opengl_renderer/ocean/OceanTexture_PC.cpp graphics/opengl_renderer/ocean/OceanTexture_PS2.cpp diff --git a/game/graphics/opengl_renderer/DirectRenderer.cpp b/game/graphics/opengl_renderer/DirectRenderer.cpp index b18d695cce..d6d1d5caeb 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.cpp +++ b/game/graphics/opengl_renderer/DirectRenderer.cpp @@ -113,6 +113,7 @@ void DirectRenderer::reset_state() { } void DirectRenderer::draw_debug_window() { + ImGui::SliderFloat("debug", &m_debug_tune, 0., 1.); ImGui::Checkbox("Wireframe", &m_debug_state.wireframe); ImGui::SameLine(); ImGui::Checkbox("No-texture", &m_debug_state.disable_texture); @@ -265,6 +266,9 @@ void DirectRenderer::update_gl_prim(SharedRenderState* render_state) { glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::DIRECT_BASIC_TEXTURED].id(), "color_mult"), m_ogl.color_mult); + glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::DIRECT_BASIC_TEXTURED].id(), + "alpha_mult"), + m_ogl.alpha_mult); glUniform4f(glGetUniformLocation(render_state->shaders[ShaderId::DIRECT_BASIC_TEXTURED].id(), "fog_color"), render_state->fog_color[0], render_state->fog_color[1], render_state->fog_color[2], @@ -344,12 +348,14 @@ void DirectRenderer::update_gl_texture(SharedRenderState* render_state, int unit void DirectRenderer::update_gl_blend() { const auto& state = m_blend_state; m_ogl.color_mult = 1.f; + m_ogl.alpha_mult = 1.f; m_prim_gl_state_needs_gl_update = true; if (!state.alpha_blend_enable) { glDisable(GL_BLEND); } else { glEnable(GL_BLEND); glBlendColor(1, 1, 1, 1); + if (state.a == GsAlpha::BlendMode::SOURCE && state.b == GsAlpha::BlendMode::DEST && state.c == GsAlpha::BlendMode::SOURCE && state.d == GsAlpha::BlendMode::DEST) { // (Cs - Cd) * As + Cd @@ -401,6 +407,24 @@ void DirectRenderer::update_gl_blend() { // ASSERT(false); } } + + if (m_my_id == BucketId::OCEAN_NEAR) { + if (state.a == GsAlpha::BlendMode::SOURCE && state.b == GsAlpha::BlendMode::DEST && + state.c == GsAlpha::BlendMode::SOURCE && state.d == GsAlpha::BlendMode::DEST) { + if (m_prim_gl_state.fogging_enable) { + // first draw. + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + m_ogl.alpha_mult = .5f; + glBlendEquation(GL_FUNC_ADD); + } else { + // second draw. + m_ogl.alpha_mult = 2.f; + glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_ALPHA, GL_ZERO); + glBlendEquation(GL_FUNC_ADD); + } + } + } } void DirectRenderer::update_gl_test() { @@ -674,6 +698,8 @@ void DirectRenderer::handle_ad(const u8* data, break; case GsRegisterAddress::TEXFLUSH: break; + case GsRegisterAddress::FRAME_1: + break; default: fmt::print("Address {} is not supported\n", register_address_name(addr)); ASSERT(false); diff --git a/game/graphics/opengl_renderer/DirectRenderer.h b/game/graphics/opengl_renderer/DirectRenderer.h index 21686b3739..ed404e27d8 100644 --- a/game/graphics/opengl_renderer/DirectRenderer.h +++ b/game/graphics/opengl_renderer/DirectRenderer.h @@ -153,6 +153,7 @@ class DirectRenderer : public BucketRenderer { static constexpr int TEXTURE_STATE_COUNT = 1; + float m_debug_tune = 1; struct TextureState { GsTex0 current_register; u32 texture_base_ptr = 0; @@ -243,6 +244,7 @@ class DirectRenderer : public BucketRenderer { u32 vertex_buffer_bytes = 0; u32 vertex_buffer_max_verts = 0; float color_mult = 1.0; + float alpha_mult = 1.0; } m_ogl; struct { diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 432c47dde8..41e21037cf 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -15,6 +15,7 @@ #include "game/graphics/opengl_renderer/EyeRenderer.h" #include "game/graphics/opengl_renderer/GenericRenderer.h" #include "game/graphics/opengl_renderer/ocean/OceanMidAndFar.h" +#include "game/graphics/opengl_renderer/ocean/OceanNear.h" // for the vif callback #include "game/kernel/kmachine.h" @@ -233,7 +234,7 @@ void OpenGLRenderer::init_bucket_renderers() { init_bucket_renderer("l1-water-generic", BucketCategory::GENERIC_MERC, BucketId::GENERIC_WATER_LEVEL1); // 62 - // 63? + init_bucket_renderer("ocean-near", BucketCategory::OCEAN, BucketId::OCEAN_NEAR); // 63 // 64? //----------------------- diff --git a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp index 9135f637f4..8c0c1af026 100644 --- a/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanMidAndFar.cpp @@ -2,7 +2,7 @@ #include "third-party/imgui/imgui.h" OceanMidAndFar::OceanMidAndFar(const std::string& name, BucketId my_id) - : BucketRenderer(name, my_id), m_direct(name, my_id, 4096) {} + : BucketRenderer(name, my_id), m_direct(name, my_id, 4096), m_texture_renderer(true) {} void OceanMidAndFar::draw_debug_window() { m_texture_renderer.draw_debug_window(); diff --git a/game/graphics/opengl_renderer/ocean/OceanNear.cpp b/game/graphics/opengl_renderer/ocean/OceanNear.cpp new file mode 100644 index 0000000000..0a8ce68cd9 --- /dev/null +++ b/game/graphics/opengl_renderer/ocean/OceanNear.cpp @@ -0,0 +1,117 @@ +#include "OceanNear.h" + +OceanNear::OceanNear(const std::string& name, BucketId my_id) + : BucketRenderer(name, my_id), m_texture_renderer(false), m_direct(name, my_id, 0x4000) { + for (auto& a : m_vu_data) { + a.fill(0); + } +} + +void OceanNear::draw_debug_window() { + m_direct.draw_debug_window(); +} + +void OceanNear::init_textures(TexturePool& pool) { + m_texture_renderer.init_textures(pool); +} + +static bool is_end_tag(const DmaTag& tag, const VifCode& v0, const VifCode& v1) { + return tag.qwc == 2 && tag.kind == DmaTag::Kind::CNT && v0.kind == VifCode::Kind::NOP && + v1.kind == VifCode::Kind::DIRECT; +} + +void OceanNear::render(DmaFollower& dma, + SharedRenderState* render_state, + ScopedProfilerNode& prof) { + // skip if disabled + if (!m_enabled) { + while (dma.current_tag_offset() != render_state->next_bucket) { + dma.read_and_advance(); + } + return; + } + + // jump to bucket + auto data0 = dma.read_and_advance(); + ASSERT(data0.vif1() == 0); + ASSERT(data0.vif0() == 0); + ASSERT(data0.size_bytes == 0); + + // see if bucket is empty or not + if (dma.current_tag().kind == DmaTag::Kind::CALL) { + // renderer didn't run, let's just get out of here. + for (int i = 0; i < 4; i++) { + dma.read_and_advance(); + } + ASSERT(dma.current_tag_offset() == render_state->next_bucket); + return; + } + + { + auto p = prof.make_scoped_child("texture"); + // TODO: this looks the same as the previous ocean renderer to me... why do it again? + m_texture_renderer.handle_ocean_texture(dma, render_state, p); + } + + if (dma.current_tag().qwc != 2) { + fmt::print("abort!\n"); + while (dma.current_tag_offset() != render_state->next_bucket) { + dma.read_and_advance(); + } + return; + } + + // direct setup + m_direct.reset_state(); + { + auto setup = dma.read_and_advance(); + ASSERT(setup.vifcode0().kind == VifCode::Kind::NOP); + ASSERT(setup.vifcode1().kind == VifCode::Kind::DIRECT); + ASSERT(setup.size_bytes == 32); + m_direct.render_gif(setup.data, 32, render_state, prof); + } + + // oofset and base + { + auto ob = dma.read_and_advance(); + ASSERT(ob.size_bytes == 0); + auto base = ob.vifcode0(); + auto off = ob.vifcode1(); + ASSERT(base.kind == VifCode::Kind::BASE); + ASSERT(off.kind == VifCode::Kind::OFFSET); + ASSERT(base.immediate == VU1_INPUT_BUFFER_BASE); + ASSERT(off.immediate == VU1_INPUT_BUFFER_OFFSET); + } + + while (!is_end_tag(dma.current_tag(), dma.current_tag_vif0(), dma.current_tag_vif1())) { + auto data = dma.read_and_advance(); + auto v0 = data.vifcode0(); + auto v1 = data.vifcode1(); + + if (v0.kind == VifCode::Kind::STCYCL && v1.kind == VifCode::Kind::UNPACK_V4_32) { + ASSERT(v0.immediate == 0x404); + auto up = VifCodeUnpack(v1); + u16 addr = up.addr_qw + (up.use_tops_flag ? get_upload_buffer() : 0); + ASSERT(addr + v1.num <= 1024); + memcpy(m_vu_data + addr, data.data, 16 * v1.num); + } else if (v0.kind == VifCode::Kind::MSCALF && v1.kind == VifCode::Kind::STMOD) { + ASSERT(v1.immediate == 0); + switch (v0.immediate) { + case 0: + run_call0_vu2c(); + break; + case 39: + run_call39_vu2c(render_state, prof); + break; + default: + fmt::print("unknown ocean near call: {}\n", v0.immediate); + ASSERT(false); + } + } + } + + while (dma.current_tag_offset() != render_state->next_bucket) { + dma.read_and_advance(); + } + m_direct.flush_pending(render_state, prof); +} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/ocean/OceanNear.h b/game/graphics/opengl_renderer/ocean/OceanNear.h new file mode 100644 index 0000000000..ae2a53e102 --- /dev/null +++ b/game/graphics/opengl_renderer/ocean/OceanNear.h @@ -0,0 +1,128 @@ +#pragma once + +#include "game/graphics/opengl_renderer/BucketRenderer.h" +#include "game/graphics/opengl_renderer/ocean/OceanTexture.h" +#include "game/common/vu.h" + +class OceanNear : public BucketRenderer { + public: + OceanNear(const std::string& name, BucketId my_id); + void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override; + void draw_debug_window() override; + void init_textures(TexturePool& pool) override; + + private: + void run_call0_vu2c(); + void run_call39_vu2c(SharedRenderState* render_state, ScopedProfilerNode& prof); + void run_L15_vu2c(); + void run_L21_vu2c(); + void run_L23_vu2c(); + void run_L25_vu2c(SharedRenderState* render_state, ScopedProfilerNode& prof); + void run_L30_vu2c(); + void run_L32_vu2c(); + + OceanTexture m_texture_renderer; + DirectRenderer m_direct; + + bool m_buffer_toggle = false; + static constexpr int VU1_INPUT_BUFFER_BASE = 0; + static constexpr int VU1_INPUT_BUFFER_OFFSET = 0x10; + + void xgkick(u16 addr, SharedRenderState* render_state, ScopedProfilerNode& prof); + + u16 xtop() { + m_buffer_toggle = !m_buffer_toggle; + return get_vu_buffer(); + } + + u16 get_upload_buffer() { + if (m_buffer_toggle) { + return VU1_INPUT_BUFFER_OFFSET; + } else { + return VU1_INPUT_BUFFER_BASE; + } + } + + u16 get_vu_buffer() { + if (!m_buffer_toggle) { + return VU1_INPUT_BUFFER_OFFSET; + } else { + return VU1_INPUT_BUFFER_BASE; + } + } + + void lq_buffer(Mask mask, Vf& dest, u16 addr) { + ASSERT(addr < 1024); + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + dest[i] = m_vu_data[addr].data[i]; + } + } + } + + void sq_buffer(Mask mask, const Vf& val, u16 addr) { + ASSERT(addr < 1024); + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + m_vu_data[addr].data[i] = val[i]; + } + } + } + + void ilw_buffer(Mask mask, u16& dest, u16 addr) { + ASSERT(addr < 1024); + switch (mask) { + case Mask::x: + dest = m_vu_data[addr].x_as_u16(); + break; + case Mask::y: + dest = m_vu_data[addr].y_as_u16(); + break; + case Mask::z: + dest = m_vu_data[addr].z_as_u16(); + break; + case Mask::w: + dest = m_vu_data[addr].w_as_u16(); + break; + default: + ASSERT(false); + } + } + + void isw_buffer(Mask mask, u16 src, u16 addr) { + ASSERT(addr < 1024); + u32 val32 = src; + switch (mask) { + case Mask::x: + memcpy(&m_vu_data[addr].data[0], &val32, 4); + break; + case Mask::y: + memcpy(&m_vu_data[addr].data[1], &val32, 4); + break; + case Mask::z: + memcpy(&m_vu_data[addr].data[2], &val32, 4); + break; + case Mask::w: + memcpy(&m_vu_data[addr].data[3], &val32, 4); + break; + default: + ASSERT(false); + } + } + + Vf m_vu_data[1024]; + + struct Vu { + const Vf vf00; + + Accumulator acc; + Vf vf01, vf02, vf03, vf04, vf05, vf06, vf07, vf08, vf09, vf10, vf11, vf12, vf13, vf14, vf15, + vf16, vf17, vf18, vf19, vf20, vf21, vf22, vf23, vf24, vf25, vf26, vf27, vf28, vf29, vf30, + vf31; + u16 vi01, vi02, vi03, vi04, vi05, vi06, vi07, vi08, vi09, vi10, vi11, vi12, vi13, vi14; + + float P, Q; + Vu() : vf00(0, 0, 0, 1) {} + + } vu; +}; diff --git a/game/graphics/opengl_renderer/ocean/OceanNear_PS2.cpp b/game/graphics/opengl_renderer/ocean/OceanNear_PS2.cpp new file mode 100644 index 0000000000..02fbc25ef0 --- /dev/null +++ b/game/graphics/opengl_renderer/ocean/OceanNear_PS2.cpp @@ -0,0 +1,2754 @@ +#include "OceanNear.h" + +void OceanNear::xgkick(u16 addr, SharedRenderState* render_state, ScopedProfilerNode& prof) { + m_direct.render_gif((const u8*)&m_vu_data[addr], UINT32_MAX, render_state, prof); +} + +void OceanNear::run_call0_vu2c() { + bool bc; + // lq.xyzw vf01, 951(vi00) | nop 0 + lq_buffer(Mask::xyzw, vu.vf01, 951); + // lq.xyzw vf02, 953(vi00) | nop 1 + lq_buffer(Mask::xyzw, vu.vf02, 953); + // lq.xyzw vf03, 954(vi00) | nop 2 + lq_buffer(Mask::xyzw, vu.vf03, 954); + // lq.xyzw vf05, 955(vi00) | nop 3 + lq_buffer(Mask::xyzw, vu.vf05, 955); + // lq.xyzw vf06, 956(vi00) | nop 4 + lq_buffer(Mask::xyzw, vu.vf06, 956); + // iaddiu vi09, vi00, 0x213 | nop 5 + vu.vi09 = 0x213; /* 531 */ + // iaddi vi01, vi00, 0x6 | nop 6 + vu.vi01 = 6; +L1: + // lq.xyzw vf12, 962(vi01) | nop 7 + lq_buffer(Mask::xyzw, vu.vf12, vu.vi01 + 962); + // lq.xyzw vf13, 969(vi01) | nop 8 + lq_buffer(Mask::xyzw, vu.vf13, vu.vi01 + 969); + // sq.xyzw vf12, 531(vi01) | nop 9 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi01 + 531); + // sq.xyzw vf12, 671(vi01) | nop 10 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi01 + 671); + // sq.xyzw vf13, 592(vi01) | nop 11 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi01 + 592); + // sq.xyzw vf13, 732(vi01) | nop 12 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi01 + 732); + // sq.xyzw vf12, 811(vi01) | nop 13 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi01 + 811); + // sq.xyzw vf12, 881(vi01) | nop 14 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi01 + 881); + // sq.xyzw vf13, 846(vi01) | nop 15 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi01 + 846); + // sq.xyzw vf13, 916(vi01) | nop 16 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi01 + 916); + // BRANCH! + // ibgtz vi01, L1 | nop 17 + bc = ((s16)vu.vi01) > 0; + // iaddi vi01, vi01, -0x1 | nop 18 + vu.vi01 = vu.vi01 + -1; + if (bc) { + goto L1; + } + + // lq.xyzw vf08, 976(vi00) | nop 19 + lq_buffer(Mask::xyzw, vu.vf08, 976); + // iaddi vi04, vi00, 0x8 | nop 20 + vu.vi04 = 8; + // iaddiu vi06, vi00, 0x11 | ftoi0.xyzw vf08, vf08 21 + vu.vf08.ftoi0(Mask::xyzw, vu.vf08); + vu.vi06 = 0x11; /* 17 */ +L2: + // sq.xyzw vf08, 592(vi04) | nop 22 + sq_buffer(Mask::xyzw, vu.vf08, vu.vi04 + 592); + // sq.xyzw vf08, 732(vi04) | nop 23 + sq_buffer(Mask::xyzw, vu.vf08, vu.vi04 + 732); + // iaddi vi04, vi04, 0x3 | nop 24 + vu.vi04 = vu.vi04 + 3; + // BRANCH! + // ibgtz vi06, L2 | nop 25 + bc = ((s16)vu.vi06) > 0; + // iaddi vi06, vi06, -0x1 | nop 26 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L2; + } + + // lq.xyzw vf07, 957(vi00) | nop 27 + lq_buffer(Mask::xyzw, vu.vf07, 957); + // iaddi vi05, vi00, 0x0 | mul.xyzw vf16, vf00, vf00 28 + vu.vf16.mul(Mask::xyzw, vu.vf00, vu.vf00); + vu.vi05 = 0; + // iaddi vi07, vi00, 0x8 | nop 29 + vu.vi07 = 8; +L3: + // iaddi vi06, vi00, 0x8 | mul.x vf16, vf00, vf00 30 + vu.vf16.mul(Mask::x, vu.vf00, vu.vf00); + vu.vi06 = 8; +L4: + // sq.xyzw vf16, 290(vi05) | nop 31 + sq_buffer(Mask::xyzw, vu.vf16, vu.vi05 + 290); + // iaddi vi05, vi05, 0x3 | addx.x vf16, vf16, vf07 32 + vu.vf16.add(Mask::x, vu.vf16, vu.vf07.x()); + vu.vi05 = vu.vi05 + 3; + // BRANCH! + // ibgtz vi06, L4 | nop 33 + bc = ((s16)vu.vi06) > 0; + // iaddi vi06, vi06, -0x1 | nop 34 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L4; + } + + // BRANCH! + // ibgtz vi07, L3 | addx.z vf16, vf16, vf07 35 + vu.vf16.add(Mask::z, vu.vf16, vu.vf07.x()); + bc = ((s16)vu.vi07) > 0; + // iaddi vi07, vi07, -0x1 | nop 36 + vu.vi07 = vu.vi07 + -1; + if (bc) { + goto L3; + } + + // nop | nop :e 37 + + // nop | nop 38 +} + +void OceanNear::run_call39_vu2c(SharedRenderState* render_state, ScopedProfilerNode& prof) { + bool bc; + // xtop vi02 | nop 39 + vu.vi02 = xtop(); + // ilw.x vi03, 10(vi02) | nop 40 + ilw_buffer(Mask::x, vu.vi03, vu.vi02 + 10); + // ilw.y vi04, 10(vi02) | nop 41 + ilw_buffer(Mask::y, vu.vi04, vu.vi02 + 10); + // iaddi vi05, vi00, 0x0 | nop 42 + vu.vi05 = 0; + // iaddi vi07, vi00, 0x7 | nop 43 + vu.vi07 = 7; +L6: + // lq.xyzw vf28, 32(vi03) | nop 44 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 32); + // lq.xyzw vf29, 33(vi03) | nop 45 + lq_buffer(Mask::xyzw, vu.vf29, vu.vi03 + 33); + // lq.xyzw vf30, 32(vi04) | nop 46 + lq_buffer(Mask::xyzw, vu.vf30, vu.vi04 + 32); + // lq.xyzw vf24, 290(vi05) | nop 47 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // lq.xyzw vf25, 293(vi05) | nop 48 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi05 + 293); + // lq.xyzw vf26, 296(vi05) | nop 49 + lq_buffer(Mask::xyzw, vu.vf26, vu.vi05 + 296); + // lq.xyzw vf27, 299(vi05) | nop 50 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi05 + 299); + // lq.xyzw vf12, 302(vi05) | addx.y vf24, vf00, vf28 51 + vu.vf24.add(Mask::y, vu.vf00, vu.vf28.x()); + lq_buffer(Mask::xyzw, vu.vf12, vu.vi05 + 302); + // lq.xyzw vf13, 305(vi05) | addy.y vf25, vf00, vf28 52 + vu.vf25.add(Mask::y, vu.vf00, vu.vf28.y()); + lq_buffer(Mask::xyzw, vu.vf13, vu.vi05 + 305); + // lq.xyzw vf14, 308(vi05) | addz.y vf26, vf00, vf28 53 + vu.vf26.add(Mask::y, vu.vf00, vu.vf28.z()); + lq_buffer(Mask::xyzw, vu.vf14, vu.vi05 + 308); + // lq.xyzw vf15, 311(vi05) | addw.y vf27, vf00, vf28 54 + vu.vf27.add(Mask::y, vu.vf00, vu.vf28.w()); + lq_buffer(Mask::xyzw, vu.vf15, vu.vi05 + 311); + // lq.xyzw vf08, 314(vi05) | addx.y vf12, vf00, vf29 55 + vu.vf12.add(Mask::y, vu.vf00, vu.vf29.x()); + lq_buffer(Mask::xyzw, vu.vf08, vu.vi05 + 314); + // sq.xyzw vf24, 290(vi05) | addy.y vf13, vf00, vf29 56 + vu.vf13.add(Mask::y, vu.vf00, vu.vf29.y()); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // sq.xyzw vf25, 293(vi05) | addz.y vf14, vf00, vf29 57 + vu.vf14.add(Mask::y, vu.vf00, vu.vf29.z()); + sq_buffer(Mask::xyzw, vu.vf25, vu.vi05 + 293); + // sq.xyzw vf26, 296(vi05) | addw.y vf15, vf00, vf29 58 + vu.vf15.add(Mask::y, vu.vf00, vu.vf29.w()); + sq_buffer(Mask::xyzw, vu.vf26, vu.vi05 + 296); + // sq.xyzw vf27, 299(vi05) | addx.y vf08, vf00, vf30 59 + vu.vf08.add(Mask::y, vu.vf00, vu.vf30.x()); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi05 + 299); + // sq.xyzw vf12, 302(vi05) | nop 60 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi05 + 302); + // sq.xyzw vf13, 305(vi05) | nop 61 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi05 + 305); + // sq.xyzw vf14, 308(vi05) | nop 62 + sq_buffer(Mask::xyzw, vu.vf14, vu.vi05 + 308); + // sq.xyzw vf15, 311(vi05) | nop 63 + sq_buffer(Mask::xyzw, vu.vf15, vu.vi05 + 311); + // sq.xyzw vf08, 314(vi05) | nop 64 + sq_buffer(Mask::xyzw, vu.vf08, vu.vi05 + 314); + // iaddi vi03, vi03, 0x8 | nop 65 + vu.vi03 = vu.vi03 + 8; + // iaddi vi04, vi04, 0x8 | nop 66 + vu.vi04 = vu.vi04 + 8; + // iaddiu vi05, vi05, 0x1b | nop 67 + vu.vi05 = vu.vi05 + 0x1b; /* 27 */ + // BRANCH! + // ibgtz vi07, L6 | nop 68 + bc = ((s16)vu.vi07) > 0; + // iaddi vi07, vi07, -0x1 | nop 69 + vu.vi07 = vu.vi07 + -1; + if (bc) { + goto L6; + } + + // ilw.z vi03, 10(vi02) | nop 70 + ilw_buffer(Mask::z, vu.vi03, vu.vi02 + 10); + // ilw.w vi04, 10(vi02) | nop 71 + ilw_buffer(Mask::w, vu.vi04, vu.vi02 + 10); + // lq.xyzw vf28, 32(vi03) | nop 72 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 32); + // lq.xyzw vf29, 33(vi03) | nop 73 + lq_buffer(Mask::xyzw, vu.vf29, vu.vi03 + 33); + // lq.xyzw vf30, 32(vi04) | nop 74 + lq_buffer(Mask::xyzw, vu.vf30, vu.vi04 + 32); + // lq.xyzw vf24, 290(vi05) | nop 75 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // lq.xyzw vf25, 293(vi05) | nop 76 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi05 + 293); + // lq.xyzw vf26, 296(vi05) | nop 77 + lq_buffer(Mask::xyzw, vu.vf26, vu.vi05 + 296); + // lq.xyzw vf27, 299(vi05) | nop 78 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi05 + 299); + // lq.xyzw vf12, 302(vi05) | addx.y vf24, vf00, vf28 79 + vu.vf24.add(Mask::y, vu.vf00, vu.vf28.x()); + lq_buffer(Mask::xyzw, vu.vf12, vu.vi05 + 302); + // lq.xyzw vf13, 305(vi05) | addy.y vf25, vf00, vf28 80 + vu.vf25.add(Mask::y, vu.vf00, vu.vf28.y()); + lq_buffer(Mask::xyzw, vu.vf13, vu.vi05 + 305); + // lq.xyzw vf14, 308(vi05) | addz.y vf26, vf00, vf28 81 + vu.vf26.add(Mask::y, vu.vf00, vu.vf28.z()); + lq_buffer(Mask::xyzw, vu.vf14, vu.vi05 + 308); + // lq.xyzw vf15, 311(vi05) | addw.y vf27, vf00, vf28 82 + vu.vf27.add(Mask::y, vu.vf00, vu.vf28.w()); + lq_buffer(Mask::xyzw, vu.vf15, vu.vi05 + 311); + // lq.xyzw vf08, 314(vi05) | addx.y vf12, vf00, vf29 83 + vu.vf12.add(Mask::y, vu.vf00, vu.vf29.x()); + lq_buffer(Mask::xyzw, vu.vf08, vu.vi05 + 314); + // sq.xyzw vf24, 290(vi05) | addy.y vf13, vf00, vf29 84 + vu.vf13.add(Mask::y, vu.vf00, vu.vf29.y()); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // sq.xyzw vf25, 293(vi05) | addz.y vf14, vf00, vf29 85 + vu.vf14.add(Mask::y, vu.vf00, vu.vf29.z()); + sq_buffer(Mask::xyzw, vu.vf25, vu.vi05 + 293); + // sq.xyzw vf26, 296(vi05) | addw.y vf15, vf00, vf29 86 + vu.vf15.add(Mask::y, vu.vf00, vu.vf29.w()); + sq_buffer(Mask::xyzw, vu.vf26, vu.vi05 + 296); + // sq.xyzw vf27, 299(vi05) | addx.y vf08, vf00, vf30 87 + vu.vf08.add(Mask::y, vu.vf00, vu.vf30.x()); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi05 + 299); + // sq.xyzw vf12, 302(vi05) | nop 88 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi05 + 302); + // sq.xyzw vf13, 305(vi05) | nop 89 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi05 + 305); + // sq.xyzw vf14, 308(vi05) | nop 90 + sq_buffer(Mask::xyzw, vu.vf14, vu.vi05 + 308); + // sq.xyzw vf15, 311(vi05) | nop 91 + sq_buffer(Mask::xyzw, vu.vf15, vu.vi05 + 311); + // sq.xyzw vf08, 314(vi05) | nop 92 + sq_buffer(Mask::xyzw, vu.vf08, vu.vi05 + 314); + // lq.xyzw vf07, 957(vi00) | nop 93 + lq_buffer(Mask::xyzw, vu.vf07, 957); + // lq.xyzw vf12, 11(vi02) | nop 94 + lq_buffer(Mask::xyzw, vu.vf12, vu.vi02 + 11); + // lq.xyzw vf13, 11(vi02) | nop 95 + lq_buffer(Mask::xyzw, vu.vf13, vu.vi02 + 11); + // lq.xyzw vf22, 12(vi02) | nop 96 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi02 + 12); + // lq.xyzw vf23, 13(vi02) | nop 97 + lq_buffer(Mask::xyzw, vu.vf23, vu.vi02 + 13); + // lq.xyzw vf16, 14(vi02) | nop 98 + lq_buffer(Mask::xyzw, vu.vf16, vu.vi02 + 14); + // lq.xyzw vf17, 15(vi02) | nop 99 + lq_buffer(Mask::xyzw, vu.vf17, vu.vi02 + 15); + // nop | sub.xyzw vf09, vf16, vf22 100 + vu.vf09.sub(Mask::xyzw, vu.vf16, vu.vf22); + // nop | sub.xyzw vf11, vf17, vf23 101 + vu.vf11.sub(Mask::xyzw, vu.vf17, vu.vf23); + // nop | muly.xyzw vf09, vf09, vf07 102 + vu.vf09.mul(Mask::xyzw, vu.vf09, vu.vf07.y()); + // nop | muly.xyzw vf11, vf11, vf07 103 + vu.vf11.mul(Mask::xyzw, vu.vf11, vu.vf07.y()); + // iaddi vi05, vi00, 0x0 | nop 104 + vu.vi05 = 0; + // iaddi vi07, vi00, 0x8 | nop 105 + vu.vi07 = 8; +L7: + // nop | sub.xyzw vf08, vf23, vf22 106 + vu.vf08.sub(Mask::xyzw, vu.vf23, vu.vf22); + // nop | mulw.xyzw vf16, vf22, vf00 107 + vu.vf16.mul(Mask::xyzw, vu.vf22, vu.vf00.w()); + // iaddi vi06, vi00, 0x8 | mulw.x vf12, vf13, vf00 108 + vu.vf12.mul(Mask::x, vu.vf13, vu.vf00.w()); + vu.vi06 = 8; + // nop | muly.xyzw vf08, vf08, vf07 109 + vu.vf08.mul(Mask::xyzw, vu.vf08, vu.vf07.y()); +L8: + // sq.xyzw vf12, 288(vi05) | nop 110 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi05 + 288); + // sq.xyzw vf16, 289(vi05) | nop 111 + sq_buffer(Mask::xyzw, vu.vf16, vu.vi05 + 289); + // iaddi vi05, vi05, 0x3 | addw.x vf12, vf12, vf07 112 + vu.vf12.add(Mask::x, vu.vf12, vu.vf07.w()); + vu.vi05 = vu.vi05 + 3; + // BRANCH! + // ibgtz vi06, L8 | add.xyzw vf16, vf16, vf08 113 + vu.vf16.add(Mask::xyzw, vu.vf16, vu.vf08); + bc = ((s16)vu.vi06) > 0; + // iaddi vi06, vi06, -0x1 | nop 114 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L8; + } + + // nop | add.xyzw vf22, vf22, vf09 115 + vu.vf22.add(Mask::xyzw, vu.vf22, vu.vf09); + // nop | add.xyzw vf23, vf23, vf11 116 + vu.vf23.add(Mask::xyzw, vu.vf23, vu.vf11); + // BRANCH! + // ibgtz vi07, L7 | addw.y vf12, vf12, vf07 117 + vu.vf12.add(Mask::y, vu.vf12, vu.vf07.w()); + bc = ((s16)vu.vi07) > 0; + // iaddi vi07, vi07, -0x1 | nop 118 + vu.vi07 = vu.vi07 + -1; + if (bc) { + goto L7; + } + + // lq.xyzw vf08, 0(vi02) | nop 119 + lq_buffer(Mask::xyzw, vu.vf08, vu.vi02); + // lq.xyzw vf09, 1(vi02) | nop 120 + lq_buffer(Mask::xyzw, vu.vf09, vu.vi02 + 1); + // lq.xyzw vf10, 2(vi02) | nop 121 + lq_buffer(Mask::xyzw, vu.vf10, vu.vi02 + 2); + // lq.xyzw vf04, 8(vi02) | nop 122 + lq_buffer(Mask::xyzw, vu.vf04, vu.vi02 + 8); + // iaddi vi07, vi00, 0x3 | nop 123 + vu.vi07 = 3; +L9: + // mtir vi10, vf04.x | nop 124 + vu.vi10 = vu.vf04.x_as_u16(); + // iaddiu vi11, vi00, 0xff | nop 125 + vu.vi11 = 0xff; /* 255 */ + // mr32.xyzw vf04, vf04 | nop 126 + vu.vf04.mr32(Mask::xyzw, vu.vf04); + // BRANCH! + // ibeq vi11, vi10, L11 | nop 127 + bc = (vu.vi11 == vu.vi10); + // lq.xyzw vf11, 3(vi02) | nop 128 + lq_buffer(Mask::xyzw, vu.vf11, vu.vi02 + 3); + if (bc) { + goto L11; + } + + // lq.xyzw vf12, 4(vi02) | nop 129 + lq_buffer(Mask::xyzw, vu.vf12, vu.vi02 + 4); + // lq.xyzw vf13, 5(vi02) | nop 130 + lq_buffer(Mask::xyzw, vu.vf13, vu.vi02 + 5); + // lq.xyzw vf14, 6(vi02) | nop 131 + lq_buffer(Mask::xyzw, vu.vf14, vu.vi02 + 6); + // lq.xyzw vf15, 7(vi02) | nop 132 + lq_buffer(Mask::xyzw, vu.vf15, vu.vi02 + 7); + // ilw.x vi05, 983(vi07) | nop 133 + ilw_buffer(Mask::x, vu.vi05, vu.vi07 + 983); + // BRANCH! + // bal vi15, L15 | nop 134 + // ASSERT(false); + // iaddi vi08, vi09, 0x7 | nop 135 + vu.vi08 = vu.vi09 + 7; + // if (bc) { goto L15; } + run_L15_vu2c(); + + // lq.xyzw vf07, 968(vi00) | nop 136 + lq_buffer(Mask::xyzw, vu.vf07, 968); + // iaddiu vi08, vi00, 0x3d1 | nop 137 + vu.vi08 = 0x3d1; /* 977 */ + // sq.xyzw vf07, 6(vi09) | nop 138 + sq_buffer(Mask::xyzw, vu.vf07, vu.vi09 + 6); + // xgkick vi09 | nop 139 + xgkick(vu.vi09, render_state, prof); + // lq.xyzw vf07, 980(vi00) | nop 140 + lq_buffer(Mask::xyzw, vu.vf07, 980); + // xgkick vi08 | nop 141 + xgkick(vu.vi08, render_state, prof); + // sq.xyzw vf07, 6(vi09) | nop 142 + sq_buffer(Mask::xyzw, vu.vf07, vu.vi09 + 6); + // iaddi vi08, vi09, 0x6 | nop 143 + vu.vi08 = vu.vi09 + 6; + // nop | nop 144 + + // xgkick vi08 | nop 145 + xgkick(vu.vi08, render_state, prof); + // iaddiu vi08, vi00, 0x3d5 | nop 146 + vu.vi08 = 0x3d5; /* 981 */ + // nop | nop 147 + + // xgkick vi08 | nop 148 + xgkick(vu.vi08, render_state, prof); + // BRANCH! + // bal vi15, L21 | nop 149 + // ASSERT(false); + // iaddiu vi08, vi09, 0x44 | nop 150 + vu.vi08 = vu.vi09 + 0x44; /* 68 */ + // if (bc) { goto L21; } + run_L21_vu2c(); + + // BRANCH! + // ibeq vi00, vi14, L10 | nop 151 + bc = (vu.vi14 == 0); + // nop | nop 152 + + if (bc) { + goto L10; + } + + // BRANCH! + // bal vi15, L25 | nop 153 + // ASSERT(false); + // nop | nop 154 + + // if (bc) { goto L25; } + run_L25_vu2c(render_state, prof); + +L10: + // BRANCH! + // bal vi15, L23 | nop 155 + // ASSERT(false); + // iaddiu vi08, vi09, 0x44 | nop 156 + vu.vi08 = vu.vi09 + 0x44; /* 68 */ + // if (bc) { goto L23; } + run_L23_vu2c(); + + // iaddiu vi08, vi09, 0x3d | nop 157 + vu.vi08 = vu.vi09 + 0x3d; /* 61 */ + // iaddiu vi01, vi00, 0x4b2 | nop 158 + vu.vi01 = 0x4b2; /* 1202 */ + // xgkick vi08 | nop 159 + xgkick(vu.vi08, render_state, prof); + // isub vi09, vi01, vi09 | nop 160 + vu.vi09 = vu.vi01 - vu.vi09; +L11: + // BRANCH! + // ibgtz vi07, L9 | nop 161 + bc = ((s16)vu.vi07) > 0; + // iaddi vi07, vi07, -0x1 | nop 162 + vu.vi07 = vu.vi07 + -1; + if (bc) { + goto L9; + } + + // lq.xyzw vf04, 9(vi02) | nop 163 + lq_buffer(Mask::xyzw, vu.vf04, vu.vi02 + 9); + // iaddi vi07, vi00, 0x3 | nop 164 + vu.vi07 = 3; +L12: + // mtir vi10, vf04.x | nop 165 + vu.vi10 = vu.vf04.x_as_u16(); + // iaddiu vi11, vi00, 0xff | nop 166 + vu.vi11 = 0xff; /* 255 */ + // mr32.xyzw vf04, vf04 | nop 167 + vu.vf04.mr32(Mask::xyzw, vu.vf04); + // BRANCH! + // ibeq vi11, vi10, L14 | nop 168 + bc = (vu.vi11 == vu.vi10); + // lq.xyzw vf11, 3(vi02) | nop 169 + lq_buffer(Mask::xyzw, vu.vf11, vu.vi02 + 3); + if (bc) { + goto L14; + } + + // lq.xyzw vf12, 4(vi02) | nop 170 + lq_buffer(Mask::xyzw, vu.vf12, vu.vi02 + 4); + // lq.xyzw vf13, 5(vi02) | nop 171 + lq_buffer(Mask::xyzw, vu.vf13, vu.vi02 + 5); + // lq.xyzw vf14, 6(vi02) | nop 172 + lq_buffer(Mask::xyzw, vu.vf14, vu.vi02 + 6); + // lq.xyzw vf15, 7(vi02) | nop 173 + lq_buffer(Mask::xyzw, vu.vf15, vu.vi02 + 7); + // ilw.y vi05, 983(vi07) | nop 174 + ilw_buffer(Mask::y, vu.vi05, vu.vi07 + 983); + // BRANCH! + // bal vi15, L15 | nop 175 + // ASSERT(false); + // iaddi vi08, vi09, 0x7 | nop 176 + vu.vi08 = vu.vi09 + 7; + // if (bc) { goto L15; } + run_L15_vu2c(); + + // lq.xyzw vf07, 968(vi00) | nop 177 + lq_buffer(Mask::xyzw, vu.vf07, 968); + // iaddiu vi08, vi00, 0x3d1 | nop 178 + vu.vi08 = 0x3d1; /* 977 */ + // sq.xyzw vf07, 6(vi09) | nop 179 + sq_buffer(Mask::xyzw, vu.vf07, vu.vi09 + 6); + // xgkick vi09 | nop 180 + xgkick(vu.vi09, render_state, prof); + // lq.xyzw vf07, 980(vi00) | nop 181 + lq_buffer(Mask::xyzw, vu.vf07, 980); + // xgkick vi08 | nop 182 + xgkick(vu.vi08, render_state, prof); + // sq.xyzw vf07, 6(vi09) | nop 183 + sq_buffer(Mask::xyzw, vu.vf07, vu.vi09 + 6); + // iaddi vi08, vi09, 0x6 | nop 184 + vu.vi08 = vu.vi09 + 6; + // nop | nop 185 + + // xgkick vi08 | nop 186 + xgkick(vu.vi08, render_state, prof); + // iaddiu vi08, vi00, 0x3d5 | nop 187 + vu.vi08 = 0x3d5; /* 981 */ + // nop | nop 188 + + // xgkick vi08 | nop 189 + xgkick(vu.vi08, render_state, prof); + // BRANCH! + // bal vi15, L21 | nop 190 + // ASSERT(false); + // iaddiu vi08, vi09, 0x44 | nop 191 + vu.vi08 = vu.vi09 + 0x44; /* 68 */ + // if (bc) { goto L21; } + run_L21_vu2c(); + + // BRANCH! + // ibeq vi00, vi14, L13 | nop 192 + bc = (vu.vi14 == 0); + // nop | nop 193 + + if (bc) { + goto L13; + } + + // BRANCH! + // bal vi15, L25 | nop 194 + // ASSERT(false); + // nop | nop 195 + + // if (bc) { goto L25; } + run_L25_vu2c(render_state, prof); + +L13: + // BRANCH! + // bal vi15, L23 | nop 196 + // ASSERT(false); + // iaddiu vi08, vi09, 0x44 | nop 197 + vu.vi08 = vu.vi09 + 0x44; /* 68 */ + // if (bc) { goto L23; } + run_L23_vu2c(); + + // iaddiu vi08, vi09, 0x3d | nop 198 + vu.vi08 = vu.vi09 + 0x3d; /* 61 */ + // iaddiu vi01, vi00, 0x4b2 | nop 199 + vu.vi01 = 0x4b2; /* 1202 */ + // nop | nop 200 + + // xgkick vi08 | nop 201 + xgkick(vu.vi08, render_state, prof); + // isub vi09, vi01, vi09 | nop 202 + vu.vi09 = vu.vi01 - vu.vi09; +L14: + // BRANCH! + // ibgtz vi07, L12 | nop 203 + bc = ((s16)vu.vi07) > 0; + // iaddi vi07, vi07, -0x1 | nop 204 + vu.vi07 = vu.vi07 + -1; + if (bc) { + goto L12; + } + + // nop | nop :e 205 + + // nop | nop 206 +} + +static inline REALLY_INLINE float eleng(const Vf& in) { + float len = in.x() * in.x() + in.y() * in.y() + in.z() * in.z(); + return std::sqrt(len); +} + +namespace { +u32 clip(const Vf& vector, float val, u32 old_clip) { + u32 result = (old_clip << 6); + float plus = std::abs(val); + float minus = -plus; + + if (vector.x() > plus) { + result |= 0b1; + } + if (vector.x() < minus) { + result |= 0b10; + } + + if (vector.y() > plus) { + result |= 0b100; + } + if (vector.y() < minus) { + result |= 0b1000; + } + + if (vector.z() > plus) { + result |= 0b10000; + } + if (vector.z() < minus) { + result |= 0b100000; + } + return result & 0xffffff; // only 24 bits +} + +void fcand(u16& dest, u32 imm, u32 cf) { + // dest = (cf & imm) ? 1 : 0; + if ((cf & 0xFFFFFF) & (imm & 0xFFFFFF)) + dest = 1; + else + dest = 0; + // dest = cf & imm; // wrong +} + +void fcor(u16& dest, u32 imm, u32 cf) { + // dest = ((0xffffff & (cf | imm)) == 0xffffff) ? 1 : 0; + u32 hold = (cf & 0xFFFFFF) | (imm & 0xFFFFFF); + if (hold == 0xFFFFFF) + dest = 1; + else + dest = 0; + + // dest = cf | imm; +} +} // namespace + +void OceanNear::run_L15_vu2c() { + u32 cf; + bool bc; + // iaddi vi01, vi05, 0x9 | nop 207 + vu.vi01 = vu.vi05 + 9; + // lq.xyzw vf24, 290(vi05) | nop 208 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // lq.xyzw vf25, 317(vi05) | nop 209 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi05 + 317); + // lq.xyzw vf07, 958(vi00) | mulax.xyzw ACC, vf08, vf24 210 + vu.acc.mula(Mask::xyzw, vu.vf08, vu.vf24.x()); + lq_buffer(Mask::xyzw, vu.vf07, 958); + // iaddi vi05, vi05, 0x3 | madday.xyzw ACC, vf09, vf24 211 + vu.acc.madda(Mask::xyzw, vu.vf09, vu.vf24.y()); + vu.vi05 = vu.vi05 + 3; + // isw.x vi01, 987(vi00) | nop 212 + isw_buffer(Mask::x, vu.vi01, 987); + // iaddi vi01, vi00, 0x0 | maddaz.xyzw ACC, vf10, vf24 213 + vu.acc.madda(Mask::xyzw, vu.vf10, vu.vf24.z()); + vu.vi01 = 0; + // iaddi vi13, vi00, 0x0 | maddw.xyzw vf26, vf11, vf00 214 + vu.acc.madd(Mask::xyzw, vu.vf26, vu.vf11, vu.vf00.w()); + vu.vi13 = 0; + // iaddi vi11, vi00, 0x0 | mulax.xyzw ACC, vf08, vf25 215 + vu.acc.mula(Mask::xyzw, vu.vf08, vu.vf25.x()); + vu.vi11 = 0; + // fcset 0x0 | madday.xyzw ACC, vf09, vf25 216 + vu.acc.madda(Mask::xyzw, vu.vf09, vu.vf25.y()); + cf = 0x0; + + // lq.xyzw vf28, 287(vi05) | maddaz.xyzw ACC, vf10, vf25 217 + vu.acc.madda(Mask::xyzw, vu.vf10, vu.vf25.z()); + lq_buffer(Mask::xyzw, vu.vf28, vu.vi05 + 287); + // eleng.xyz P, vf26 | maddw.xyzw vf27, vf11, vf00 218 + vu.acc.madd(Mask::xyzw, vu.vf27, vu.vf11, vu.vf00.w()); + vu.P = eleng(vu.vf26); + // iaddi vi14, vi00, 0x0 | mulw.xyzw vf20, vf26, vf00 219 + vu.vf20.mul(Mask::xyzw, vu.vf26, vu.vf00.w()); + vu.vi14 = 0; + // lq.xyzw vf22, 286(vi05) | nop 220 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi05 + 286); + // waitp | nop 221 + // ASSERT(false); + // mfp.w vf20, P | nop 222 + vu.vf20.mfp(Mask::w, vu.P); + // eleng.xyz P, vf27 | mulw.xyzw vf21, vf27, vf00 223 + vu.vf21.mul(Mask::xyzw, vu.vf27, vu.vf00.w()); + vu.P = eleng(vu.vf27); + // nop | nop 224 + + // nop | nop 225 + + // iaddi vi12, vi00, 0x1 | mulw.w vf22, vf20, vf05 226 + vu.vf22.mul(Mask::w, vu.vf20, vu.vf05.w()); + vu.vi12 = 1; + // nop | nop 227 + + // nop | nop 228 + + // nop | nop 229 + + // nop | miniw.w vf22, vf22, vf00 230 + vu.vf22.mini(Mask::w, vu.vf22, vu.vf00.w()); + // nop | nop 231 + + // nop | nop 232 + + // nop | nop 233 + + // nop | subw.w vf28, vf00, vf22 234 + vu.vf28.sub(Mask::w, vu.vf00, vu.vf22.w()); + // nop | maxx.w vf22, vf22, vf05 235 + vu.vf22.max(Mask::w, vu.vf22, vu.vf05.x()); + // nop | nop 236 + + // nop | mulaz.w ACC, vf00, vf07 237 + vu.acc.mula(Mask::w, vu.vf00, vu.vf07.z()); + // nop | mulw.y vf28, vf28, vf28 238 + vu.vf28.mul(Mask::y, vu.vf28, vu.vf28.w()); + // lq.xyzw vf24, 290(vi05) | msubx.w vf07, vf22, vf07 239 + vu.acc.msub(Mask::w, vu.vf07, vu.vf22, vu.vf07.x()); + lq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // nop | mulax.xyzw ACC, vf12, vf28 240 + vu.acc.mula(Mask::xyzw, vu.vf12, vu.vf28.x()); + // nop | madday.xyzw ACC, vf13, vf28 241 + vu.acc.madda(Mask::xyzw, vu.vf13, vu.vf28.y()); + // nop | maddaz.xyzw ACC, vf14, vf28 242 + vu.acc.madda(Mask::xyzw, vu.vf14, vu.vf28.z()); + // nop | maddw.xyzw vf30, vf15, vf00 243 + vu.acc.madd(Mask::xyzw, vu.vf30, vu.vf15, vu.vf00.w()); + // nop | mulax.xyzw ACC, vf08, vf24 244 + vu.acc.mula(Mask::xyzw, vu.vf08, vu.vf24.x()); + // nop | madday.xyzw ACC, vf09, vf24 245 + vu.acc.madda(Mask::xyzw, vu.vf09, vu.vf24.y()); + // nop | maddaz.xyzw ACC, vf10, vf24 246 + vu.acc.madda(Mask::xyzw, vu.vf10, vu.vf24.z()); + // nop | maddw.xyzw vf26, vf11, vf00 247 + vu.acc.madd(Mask::xyzw, vu.vf26, vu.vf11, vu.vf00.w()); + // div Q, vf03.x, vf30.w | mul.xyzw vf18, vf30, vf01 248 + vu.vf18.mul(Mask::xyzw, vu.vf30, vu.vf01); + vu.Q = vu.vf03.x() / vu.vf30.w(); + // lq.xyzw vf23, 313(vi05) | mulw.w vf22, vf22, vf06 249 + vu.vf22.mul(Mask::w, vu.vf22, vu.vf06.w()); + lq_buffer(Mask::xyzw, vu.vf23, vu.vi05 + 313); + // waitp | mulw.xyz vf22, vf22, vf07 250 + vu.vf22.mul(Mask::xyz, vu.vf22, vu.vf07.w()); + // mfp.w vf21, P | nop 251 + vu.vf21.mfp(Mask::w, vu.P); + // eleng.xyz P, vf26 | nop 252 + vu.P = eleng(vu.vf26); + // nop | clipw.xyz vf18, vf18 253 + cf = clip(vu.vf18, vu.vf18.w(), cf); + // nop | mulaw.w ACC, vf30, vf00 254 + vu.acc.mula(Mask::w, vu.vf30, vu.vf00.w()); + // lq.xyzw vf29, 314(vi05) | mulw.w vf23, vf21, vf05 255 + vu.vf23.mul(Mask::w, vu.vf21, vu.vf05.w()); + lq_buffer(Mask::xyzw, vu.vf29, vu.vi05 + 314); + // nop | mula.xyz ACC, vf30, Q 256 + vu.acc.mula(Mask::xyz, vu.vf30, vu.Q); + // nop | maddw.xyzw vf16, vf02, vf00 257 + vu.acc.madd(Mask::xyzw, vu.vf16, vu.vf02, vu.vf00.w()); + // nop | miniy.xyzw vf22, vf22, vf07 258 + vu.vf22.mini(Mask::xyzw, vu.vf22, vu.vf07.y()); + // nop | miniw.w vf23, vf23, vf00 259 + vu.vf23.mini(Mask::w, vu.vf23, vu.vf00.w()); + // nop | nop 260 + + // nop | miniz.w vf16, vf16, vf03 261 + vu.vf16.mini(Mask::w, vu.vf16, vu.vf03.z()); + // nop | ftoi0.xyzw vf22, vf22 262 + vu.vf22.ftoi0(Mask::xyzw, vu.vf22); + // waitp | subw.w vf29, vf00, vf23 263 + vu.vf29.sub(Mask::w, vu.vf00, vu.vf23.w()); + // BRANCH! + // b L18 | maxx.w vf23, vf23, vf05 264 + vu.vf23.max(Mask::w, vu.vf23, vu.vf05.x()); + bc = true; + // iaddi vi06, vi00, 0x8 | maxy.w vf16, vf16, vf03 265 + vu.vf16.max(Mask::w, vu.vf16, vu.vf03.y()); + vu.vi06 = 8; + if (bc) { + goto L18; + } + +L16: + // BRANCH! + // ibeq vi00, vi01, L17 | nop 266 + bc = (vu.vi01 == 0); + // lq.xyzw vf26, 309(vi05) | nop 267 + lq_buffer(Mask::xyzw, vu.vf26, vu.vi05 + 309); + if (bc) { + goto L17; + } + + // BRANCH! + // ibne vi00, vi13, L17 | addw.w vf17, vf17, vf03 268 + vu.vf17.add(Mask::w, vu.vf17, vu.vf03.w()); + bc = (vu.vi13 != 0); + // fcor vi01, 0xfdf7df | nop 269 + fcor(vu.vi01, 0xfdf7df, cf); + + if (bc) { + goto L17; + } + + // isw.x vi12, 988(vi14) | nop 270 + isw_buffer(Mask::x, vu.vi12, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L17 | nop 271 + bc = (vu.vi01 != 0); + // fcor vi01, 0xff7df7 | nop 272 + fcor(vu.vi01, 0xff7df7, cf); + + if (bc) { + goto L17; + } + + // isw.y vi05, 988(vi14) | nop 273 + isw_buffer(Mask::y, vu.vi05, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L17 | nop 274 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffbefb | nop 275 + fcor(vu.vi01, 0xffbefb, cf); + + if (bc) { + goto L17; + } + + // ilw.x vi11, 987(vi00) | nop 276 + ilw_buffer(Mask::x, vu.vi11, 987); + // BRANCH! + // ibne vi00, vi01, L17 | nop 277 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffdf7d | nop 278 + fcor(vu.vi01, 0xffdf7d, cf); + + if (bc) { + goto L17; + } + + // isw.z vi08, 988(vi14) | nop 279 + isw_buffer(Mask::z, vu.vi08, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L17 | nop 280 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffefbe | nop 281 + fcor(vu.vi01, 0xffefbe, cf); + + if (bc) { + goto L17; + } + + // isub vi11, vi05, vi11 | nop 282 + vu.vi11 = vu.vi05 - vu.vi11; + // BRANCH! + // ibne vi00, vi01, L17 | nop 283 + bc = (vu.vi01 != 0); + // nop | nop 284 + + if (bc) { + goto L17; + } + + // BRANCH! + // ibltz vi11, L17 | nop 285 + bc = ((s16)vu.vi11) < 0; + // nop | nop 286 + + if (bc) { + goto L17; + } + + // iaddi vi14, vi14, 0x1 | nop 287 + vu.vi14 = vu.vi14 + 1; +L17: + // nop | mulw.y vf28, vf28, vf28 288 + vu.vf28.mul(Mask::y, vu.vf28, vu.vf28.w()); + // nop | mulaz.w ACC, vf00, vf07 289 + vu.acc.mula(Mask::w, vu.vf00, vu.vf07.z()); + // nop | msubx.w vf07, vf22, vf07 290 + vu.acc.msub(Mask::w, vu.vf07, vu.vf22, vu.vf07.x()); + // nop | ftoi4.xyzw vf17, vf17 291 + vu.vf17.ftoi4(Mask::xyzw, vu.vf17); + // lq.xyzw vf24, 290(vi05) | mul.xyzw vf26, vf26, Q 292 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + lq_buffer(Mask::xyzw, vu.vf24, vu.vi05 + 290); + // sq.xyzw vf21, 64(vi08) | mulax.xyzw ACC, vf12, vf28 293 + vu.acc.mula(Mask::xyzw, vu.vf12, vu.vf28.x()); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 64); + // sq.xyzw vf23, 4(vi08) | madday.xyzw ACC, vf13, vf28 294 + vu.acc.madda(Mask::xyzw, vu.vf13, vu.vf28.y()); + sq_buffer(Mask::xyzw, vu.vf23, vu.vi08 + 4); + // sq.xyzw vf17, 5(vi08) | maddaz.xyzw ACC, vf14, vf28 295 + vu.acc.madda(Mask::xyzw, vu.vf14, vu.vf28.z()); + sq_buffer(Mask::xyzw, vu.vf17, vu.vi08 + 5); + // sq.xyzw vf19, 66(vi08) | maddw.xyzw vf30, vf15, vf00 296 + vu.acc.madd(Mask::xyzw, vu.vf30, vu.vf15, vu.vf00.w()); + sq_buffer(Mask::xyzw, vu.vf19, vu.vi08 + 66); + // sq.xyzw vf26, 3(vi08) | mulax.xyzw ACC, vf08, vf24 297 + vu.acc.mula(Mask::xyzw, vu.vf08, vu.vf24.x()); + sq_buffer(Mask::xyzw, vu.vf26, vu.vi08 + 3); + // nop | madday.xyzw ACC, vf09, vf24 298 + vu.acc.madda(Mask::xyzw, vu.vf09, vu.vf24.y()); + // nop | maddaz.xyzw ACC, vf10, vf24 299 + vu.acc.madda(Mask::xyzw, vu.vf10, vu.vf24.z()); + // nop | maddw.xyzw vf26, vf11, vf00 300 + vu.acc.madd(Mask::xyzw, vu.vf26, vu.vf11, vu.vf00.w()); + // div Q, vf03.x, vf30.w | mul.xyzw vf18, vf30, vf01 301 + vu.vf18.mul(Mask::xyzw, vu.vf30, vu.vf01); + vu.Q = vu.vf03.x() / vu.vf30.w(); + // lq.xyzw vf23, 313(vi05) | mulw.xyz vf21, vf27, vf00 302 + vu.vf21.mul(Mask::xyz, vu.vf27, vu.vf00.w()); + lq_buffer(Mask::xyzw, vu.vf23, vu.vi05 + 313); + // mfp.w vf21, P | mulw.w vf22, vf22, vf06 303 + vu.vf22.mul(Mask::w, vu.vf22, vu.vf06.w()); + vu.vf21.mfp(Mask::w, vu.P); + // eleng.xyz P, vf26 | mulw.xyz vf22, vf22, vf07 304 + vu.vf22.mul(Mask::xyz, vu.vf22, vu.vf07.w()); + vu.P = eleng(vu.vf26); + // iaddi vi08, vi08, 0x6 | clipw.xyz vf18, vf18 305 + cf = clip(vu.vf18, vu.vf18.w(), cf); + vu.vi08 = vu.vi08 + 6; + // nop | mulaw.w ACC, vf30, vf00 306 + vu.acc.mula(Mask::w, vu.vf30, vu.vf00.w()); + // nop | mulw.w vf23, vf21, vf05 307 + vu.vf23.mul(Mask::w, vu.vf21, vu.vf05.w()); + // iand vi13, vi10, vi12 | mula.xyz ACC, vf30, Q 308 + vu.acc.mula(Mask::xyz, vu.vf30, vu.Q); + vu.vi13 = vu.vi10 & vu.vi12; + // fcand vi01, 0x3ffff | maddw.xyzw vf16, vf02, vf00 309 + vu.acc.madd(Mask::xyzw, vu.vf16, vu.vf02, vu.vf00.w()); + fcand(vu.vi01, 0x3ffff, cf); + + // iadd vi12, vi12, vi12 | miniy.xyzw vf22, vf22, vf07 310 + vu.vf22.mini(Mask::xyzw, vu.vf22, vu.vf07.y()); + vu.vi12 = vu.vi12 + vu.vi12; + // lq.xyzw vf29, 314(vi05) | miniw.w vf23, vf23, vf00 311 + vu.vf23.mini(Mask::w, vu.vf23, vu.vf00.w()); + lq_buffer(Mask::xyzw, vu.vf29, vu.vi05 + 314); + // nop | nop 312 + + // ior vi01, vi01, vi13 | miniz.w vf16, vf16, vf03 313 + vu.vf16.mini(Mask::w, vu.vf16, vu.vf03.z()); + vu.vi01 = vu.vi01 | vu.vi13; + // nop | ftoi0.xyzw vf22, vf22 314 + vu.vf22.ftoi0(Mask::xyzw, vu.vf22); + // nop | subw.w vf29, vf00, vf23 315 + vu.vf29.sub(Mask::w, vu.vf00, vu.vf23.w()); + // nop | maxx.w vf23, vf23, vf05 316 + vu.vf23.max(Mask::w, vu.vf23, vu.vf05.x()); + // nop | maxy.w vf16, vf16, vf03 317 + vu.vf16.max(Mask::w, vu.vf16, vu.vf03.y()); + // nop | nop 318 + +L18: + // BRANCH! + // ibeq vi00, vi01, L19 | nop 319 + bc = (vu.vi01 == 0); + // lq.xyzw vf27, 285(vi05) | nop 320 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi05 + 285); + if (bc) { + goto L19; + } + + // BRANCH! + // ibne vi00, vi13, L19 | addw.w vf16, vf16, vf03 321 + vu.vf16.add(Mask::w, vu.vf16, vu.vf03.w()); + bc = (vu.vi13 != 0); + // fcor vi01, 0xfdf7df | nop 322 + fcor(vu.vi01, 0xfdf7df, cf); + + if (bc) { + goto L19; + } + + // isw.x vi00, 988(vi14) | nop 323 + isw_buffer(Mask::x, 0, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L19 | nop 324 + bc = (vu.vi01 != 0); + // fcor vi01, 0xff7df7 | nop 325 + fcor(vu.vi01, 0xff7df7, cf); + + if (bc) { + goto L19; + } + + // isw.y vi05, 988(vi14) | nop 326 + isw_buffer(Mask::y, vu.vi05, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L19 | nop 327 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffbefb | nop 328 + fcor(vu.vi01, 0xffbefb, cf); + + if (bc) { + goto L19; + } + + // isw.z vi08, 988(vi14) | nop 329 + isw_buffer(Mask::z, vu.vi08, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L19 | nop 330 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffdf7d | nop 331 + fcor(vu.vi01, 0xffdf7d, cf); + + if (bc) { + goto L19; + } + + // nop | nop 332 + + // BRANCH! + // ibne vi00, vi01, L19 | nop 333 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffefbe | nop 334 + fcor(vu.vi01, 0xffefbe, cf); + + if (bc) { + goto L19; + } + + // nop | nop 335 + + // BRANCH! + // ibne vi00, vi01, L19 | nop 336 + bc = (vu.vi01 != 0); + // nop | nop 337 + + if (bc) { + goto L19; + } + + // iaddi vi14, vi14, 0x1 | nop 338 + vu.vi14 = vu.vi14 + 1; +L19: + // nop | mulw.y vf29, vf29, vf29 339 + vu.vf29.mul(Mask::y, vu.vf29, vu.vf29.w()); + // nop | mulaz.w ACC, vf00, vf07 340 + vu.acc.mula(Mask::w, vu.vf00, vu.vf07.z()); + // nop | msubx.w vf07, vf23, vf07 341 + vu.acc.msub(Mask::w, vu.vf07, vu.vf23, vu.vf07.x()); + // nop | ftoi4.xyzw vf16, vf16 342 + vu.vf16.ftoi4(Mask::xyzw, vu.vf16); + // lq.xyzw vf25, 317(vi05) | mul.xyzw vf27, vf27, Q 343 + vu.vf27.mul(Mask::xyzw, vu.vf27, vu.Q); + lq_buffer(Mask::xyzw, vu.vf25, vu.vi05 + 317); + // sq.xyzw vf20, 61(vi08) | mulax.xyzw ACC, vf12, vf29 344 + vu.acc.mula(Mask::xyzw, vu.vf12, vu.vf29.x()); + sq_buffer(Mask::xyzw, vu.vf20, vu.vi08 + 61); + // sq.xyzw vf22, 1(vi08) | madday.xyzw ACC, vf13, vf29 345 + vu.acc.madda(Mask::xyzw, vu.vf13, vu.vf29.y()); + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 1); + // sq.xyzw vf16, 2(vi08) | maddaz.xyzw ACC, vf14, vf29 346 + vu.acc.madda(Mask::xyzw, vu.vf14, vu.vf29.z()); + sq_buffer(Mask::xyzw, vu.vf16, vu.vi08 + 2); + // sq.xyzw vf18, 63(vi08) | maddw.xyzw vf31, vf15, vf00 347 + vu.acc.madd(Mask::xyzw, vu.vf31, vu.vf15, vu.vf00.w()); + sq_buffer(Mask::xyzw, vu.vf18, vu.vi08 + 63); + // sq.xyzw vf27, 0(vi08) | mulax.xyzw ACC, vf08, vf25 348 + vu.acc.mula(Mask::xyzw, vu.vf08, vu.vf25.x()); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi08); + // nop | madday.xyzw ACC, vf09, vf25 349 + vu.acc.madda(Mask::xyzw, vu.vf09, vu.vf25.y()); + // iaddi vi05, vi05, 0x3 | maddaz.xyzw ACC, vf10, vf25 350 + vu.acc.madda(Mask::xyzw, vu.vf10, vu.vf25.z()); + vu.vi05 = vu.vi05 + 3; + // nop | maddw.xyzw vf27, vf11, vf00 351 + vu.acc.madd(Mask::xyzw, vu.vf27, vu.vf11, vu.vf00.w()); + // div Q, vf03.x, vf31.w | mul.xyzw vf19, vf31, vf01 352 + vu.vf19.mul(Mask::xyzw, vu.vf31, vu.vf01); + vu.Q = vu.vf03.x() / vu.vf31.w(); + // lq.xyzw vf22, 286(vi05) | mulw.xyz vf20, vf26, vf00 353 + vu.vf20.mul(Mask::xyz, vu.vf26, vu.vf00.w()); + lq_buffer(Mask::xyzw, vu.vf22, vu.vi05 + 286); + // mfp.w vf20, P | mulw.w vf23, vf23, vf06 354 + vu.vf23.mul(Mask::w, vu.vf23, vu.vf06.w()); + vu.vf20.mfp(Mask::w, vu.P); + // eleng.xyz P, vf27 | mulw.xyz vf23, vf23, vf07 355 + vu.vf23.mul(Mask::xyz, vu.vf23, vu.vf07.w()); + vu.P = eleng(vu.vf27); + // nop | clipw.xyz vf19, vf19 356 + cf = clip(vu.vf19, vu.vf19.w(), cf); + // nop | mulaw.w ACC, vf31, vf00 357 + vu.acc.mula(Mask::w, vu.vf31, vu.vf00.w()); + // nop | mulw.w vf22, vf20, vf05 358 + vu.vf22.mul(Mask::w, vu.vf20, vu.vf05.w()); + // nop | mula.xyz ACC, vf31, Q 359 + vu.acc.mula(Mask::xyz, vu.vf31, vu.Q); + // fcand vi01, 0x3ffff | maddw.xyzw vf17, vf02, vf00 360 + vu.acc.madd(Mask::xyzw, vu.vf17, vu.vf02, vu.vf00.w()); + fcand(vu.vi01, 0x3ffff, cf); + + // nop | miniy.xyzw vf23, vf23, vf07 361 + vu.vf23.mini(Mask::xyzw, vu.vf23, vu.vf07.y()); + // lq.xyzw vf28, 287(vi05) | miniw.w vf22, vf22, vf00 362 + vu.vf22.mini(Mask::w, vu.vf22, vu.vf00.w()); + lq_buffer(Mask::xyzw, vu.vf28, vu.vi05 + 287); + // nop | nop 363 + + // ior vi01, vi01, vi13 | miniz.w vf17, vf17, vf03 364 + vu.vf17.mini(Mask::w, vu.vf17, vu.vf03.z()); + vu.vi01 = vu.vi01 | vu.vi13; + // nop | ftoi0.xyzw vf23, vf23 365 + vu.vf23.ftoi0(Mask::xyzw, vu.vf23); + // nop | subw.w vf28, vf00, vf22 366 + vu.vf28.sub(Mask::w, vu.vf00, vu.vf22.w()); + // nop | maxx.w vf22, vf22, vf05 367 + vu.vf22.max(Mask::w, vu.vf22, vu.vf05.x()); + // BRANCH! + // ibgtz vi06, L16 | maxy.w vf17, vf17, vf03 368 + vu.vf17.max(Mask::w, vu.vf17, vu.vf03.y()); + bc = ((s16)vu.vi06) > 0; + // iaddi vi06, vi06, -0x1 | nop 369 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L16; + } + + // BRANCH! + // ibeq vi00, vi01, L20 | nop 370 + bc = (vu.vi01 == 0); + // lq.xyzw vf26, 309(vi05) | nop 371 + lq_buffer(Mask::xyzw, vu.vf26, vu.vi05 + 309); + if (bc) { + goto L20; + } + + // BRANCH! + // ibne vi00, vi13, L20 | addw.w vf17, vf17, vf03 372 + vu.vf17.add(Mask::w, vu.vf17, vu.vf03.w()); + bc = (vu.vi13 != 0); + // fcor vi01, 0xfdf7df | nop 373 + fcor(vu.vi01, 0xfdf7df, cf); + + if (bc) { + goto L20; + } + + // isw.x vi12, 988(vi14) | nop 374 + isw_buffer(Mask::x, vu.vi12, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L20 | nop 375 + bc = (vu.vi01 != 0); + // fcor vi01, 0xff7df7 | nop 376 + fcor(vu.vi01, 0xff7df7, cf); + + if (bc) { + goto L20; + } + + // isw.y vi05, 988(vi14) | nop 377 + isw_buffer(Mask::y, vu.vi05, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L20 | nop 378 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffbefb | nop 379 + fcor(vu.vi01, 0xffbefb, cf); + + if (bc) { + goto L20; + } + + // isw.z vi08, 988(vi14) | nop 380 + isw_buffer(Mask::z, vu.vi08, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi01, L20 | nop 381 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffdf7d | nop 382 + fcor(vu.vi01, 0xffdf7d, cf); + + if (bc) { + goto L20; + } + + // nop | nop 383 + + // BRANCH! + // ibne vi00, vi01, L20 | nop 384 + bc = (vu.vi01 != 0); + // fcor vi01, 0xffefbe | nop 385 + fcor(vu.vi01, 0xffefbe, cf); + + if (bc) { + goto L20; + } + + // nop | nop 386 + + // BRANCH! + // ibne vi00, vi01, L20 | nop 387 + bc = (vu.vi01 != 0); + // nop | nop 388 + + if (bc) { + goto L20; + } + + // iaddi vi14, vi14, 0x1 | nop 389 + vu.vi14 = vu.vi14 + 1; +L20: + // isw.y vi14, 987(vi00) | ftoi4.xyzw vf17, vf17 390 + vu.vf17.ftoi4(Mask::xyzw, vu.vf17); + isw_buffer(Mask::y, vu.vi14, 987); + // sq.xyzw vf21, 64(vi08) | mul.xyzw vf26, vf26, Q 391 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 64); + // sq.xyzw vf23, 4(vi08) | nop 392 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi08 + 4); + // sq.xyzw vf17, 5(vi08) | nop 393 + sq_buffer(Mask::xyzw, vu.vf17, vu.vi08 + 5); + // sq.xyzw vf19, 66(vi08) | nop 394 + sq_buffer(Mask::xyzw, vu.vf19, vu.vi08 + 66); + // sq.xyzw vf26, 3(vi08) | nop 395 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi08 + 3); + // jr vi15 | nop 396 + // nop | nop 397 +} + +void OceanNear::run_L21_vu2c() { + bool bc; + // iaddi vi06, vi00, 0x5 | nop 398 + vu.vi06 = 5; +L22: + // lq.xyzw vf20, 0(vi08) | nop 399 + lq_buffer(Mask::xyzw, vu.vf20, vu.vi08); + // lq.xyzw vf21, 3(vi08) | nop 400 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 3); + // lq.xyzw vf18, 6(vi08) | nop 401 + lq_buffer(Mask::xyzw, vu.vf18, vu.vi08 + 6); + // lq.xyzw vf19, 9(vi08) | maxw.xyzw vf11, vf00, vf00 402 + vu.vf11.max(Mask::xyzw, vu.vf00, vu.vf00.w()); + lq_buffer(Mask::xyzw, vu.vf19, vu.vi08 + 9); + // div Q, vf00.w, vf20.w | nop 403 + vu.Q = vu.vf00.w() / vu.vf20.w(); + // nop | addz.y vf20, vf00, vf20 404 + vu.vf20.add(Mask::y, vu.vf00, vu.vf20.z()); + // nop | addz.y vf21, vf00, vf21 405 + vu.vf21.add(Mask::y, vu.vf00, vu.vf21.z()); + // nop | addz.y vf18, vf00, vf18 406 + vu.vf18.add(Mask::y, vu.vf00, vu.vf18.z()); + // nop | addz.y vf19, vf00, vf19 407 + vu.vf19.add(Mask::y, vu.vf00, vu.vf19.z()); + // nop | nop 408 + + // nop | nop 409 + + // div Q, vf00.w, vf21.w | mul.xy vf20, vf20, Q 410 + vu.vf20.mul(Mask::xy, vu.vf20, vu.Q); + vu.Q = vu.vf00.w() / vu.vf21.w(); + // nop | nop 411 + + // nop | nop 412 + + // nop | nop 413 + + // nop | nop 414 + + // nop | nop 415 + + // nop | nop 416 + + // div Q, vf00.w, vf18.w | mul.xy vf21, vf21, Q 417 + vu.vf21.mul(Mask::xy, vu.vf21, vu.Q); + vu.Q = vu.vf00.w() / vu.vf18.w(); + // nop | mula.xyzw ACC, vf20, vf05 418 + vu.acc.mula(Mask::xyzw, vu.vf20, vu.vf05); + // nop | maddw.xyzw vf20, vf06, vf00 419 + vu.acc.madd(Mask::xyzw, vu.vf20, vu.vf06, vu.vf00.w()); + // nop | nop 420 + + // nop | mula.xyzw ACC, vf21, vf05 421 + vu.acc.mula(Mask::xyzw, vu.vf21, vu.vf05); + // nop | maddw.xyzw vf21, vf06, vf00 422 + vu.acc.madd(Mask::xyzw, vu.vf21, vu.vf06, vu.vf00.w()); + // nop | nop 423 + + // div Q, vf00.w, vf19.w | mul.xy vf18, vf18, Q 424 + vu.vf18.mul(Mask::xy, vu.vf18, vu.Q); + vu.Q = vu.vf00.w() / vu.vf19.w(); + // nop | nop 425 + + // nop | nop 426 + + // nop | nop 427 + + // nop | nop 428 + + // nop | nop 429 + + // nop | nop 430 + + // sq.xyz vf20, 0(vi08) | mul.xy vf19, vf19, Q 431 + vu.vf19.mul(Mask::xy, vu.vf19, vu.Q); + sq_buffer(Mask::xyz, vu.vf20, vu.vi08); + // sq.xyz vf21, 3(vi08) | mula.xyzw ACC, vf18, vf05 432 + vu.acc.mula(Mask::xyzw, vu.vf18, vu.vf05); + sq_buffer(Mask::xyz, vu.vf21, vu.vi08 + 3); + // nop | maddw.xyzw vf18, vf06, vf00 433 + vu.acc.madd(Mask::xyzw, vu.vf18, vu.vf06, vu.vf00.w()); + // nop | nop 434 + + // nop | mula.xyzw ACC, vf19, vf05 435 + vu.acc.mula(Mask::xyzw, vu.vf19, vu.vf05); + // iaddi vi08, vi08, 0xc | maddw.xyzw vf19, vf06, vf00 436 + vu.acc.madd(Mask::xyzw, vu.vf19, vu.vf06, vu.vf00.w()); + vu.vi08 = vu.vi08 + 12; + // iaddi vi06, vi06, -0x1 | nop 437 + vu.vi06 = vu.vi06 + -1; + // sq.xyz vf18, -6(vi08) | nop 438 + sq_buffer(Mask::xyz, vu.vf18, vu.vi08 + -6); + // BRANCH! + // ibgtz vi06, L22 | nop 439 + bc = ((s16)vu.vi06) > 0; + // sq.xyz vf19, -3(vi08) | nop 440 + sq_buffer(Mask::xyz, vu.vf19, vu.vi08 + -3); + if (bc) { + goto L22; + } + + // jr vi15 | nop 441 + // nop | nop 442 +} + +void OceanNear::run_L23_vu2c() { + bool bc; + // iaddi vi06, vi00, 0x4 | nop 443 + vu.vi06 = 4; +L24: + // lq.xyzw vf12, 0(vi08) | nop 444 + lq_buffer(Mask::xyzw, vu.vf12, vu.vi08); + // lq.xyzw vf13, 3(vi08) | nop 445 + lq_buffer(Mask::xyzw, vu.vf13, vu.vi08 + 3); + // lq.xyzw vf14, 6(vi08) | nop 446 + lq_buffer(Mask::xyzw, vu.vf14, vu.vi08 + 6); + // lq.xyzw vf15, 9(vi08) | nop 447 + lq_buffer(Mask::xyzw, vu.vf15, vu.vi08 + 9); + // lq.xyzw vf24, -59(vi08) | nop 448 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08 + -59); + // lq.xyzw vf25, -56(vi08) | nop 449 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi08 + -56); + // lq.xyzw vf26, -53(vi08) | nop 450 + lq_buffer(Mask::xyzw, vu.vf26, vu.vi08 + -53); + // lq.xyzw vf27, -50(vi08) | nop 451 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + -50); + // lq.xyzw vf28, -61(vi08) | nop 452 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi08 + -61); + // lq.xyzw vf29, -58(vi08) | nop 453 + lq_buffer(Mask::xyzw, vu.vf29, vu.vi08 + -58); + // lq.xyzw vf30, -55(vi08) | nop 454 + lq_buffer(Mask::xyzw, vu.vf30, vu.vi08 + -55); + // lq.xyzw vf31, -52(vi08) | nop 455 + lq_buffer(Mask::xyzw, vu.vf31, vu.vi08 + -52); + // iaddi vi08, vi08, 0xc | mulz.xyzw vf12, vf12, vf28 456 + vu.vf12.mul(Mask::xyzw, vu.vf12, vu.vf28.z()); + vu.vi08 = vu.vi08 + 12; + // sq.xyzw vf24, -10(vi08) | mulz.xyzw vf13, vf13, vf29 457 + vu.vf13.mul(Mask::xyzw, vu.vf13, vu.vf29.z()); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi08 + -10); + // sq.xyzw vf25, -7(vi08) | mulz.xyzw vf14, vf14, vf30 458 + vu.vf14.mul(Mask::xyzw, vu.vf14, vu.vf30.z()); + sq_buffer(Mask::xyzw, vu.vf25, vu.vi08 + -7); + // sq.xyzw vf26, -4(vi08) | mulz.xyzw vf15, vf15, vf31 459 + vu.vf15.mul(Mask::xyzw, vu.vf15, vu.vf31.z()); + sq_buffer(Mask::xyzw, vu.vf26, vu.vi08 + -4); + // sq.xyzw vf27, -1(vi08) | nop 460 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + -1); + // sq.xyzw vf12, -12(vi08) | nop 461 + sq_buffer(Mask::xyzw, vu.vf12, vu.vi08 + -12); + // sq.xyzw vf13, -9(vi08) | nop 462 + sq_buffer(Mask::xyzw, vu.vf13, vu.vi08 + -9); + // sq.xyzw vf14, -6(vi08) | nop 463 + sq_buffer(Mask::xyzw, vu.vf14, vu.vi08 + -6); + // sq.xyzw vf15, -3(vi08) | nop 464 + sq_buffer(Mask::xyzw, vu.vf15, vu.vi08 + -3); + // BRANCH! + // ibgtz vi06, L24 | nop 465 + bc = ((s16)vu.vi06) > 0; + // iaddi vi06, vi06, -0x1 | nop 466 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L24; + } + + // jr vi15 | nop 467 + // nop | nop 468 +} + +void OceanNear::run_L25_vu2c(SharedRenderState* render_state, ScopedProfilerNode& prof) { + bool bc; + // lq.xyzw vf31, 952(vi00) | nop 469 + lq_buffer(Mask::xyzw, vu.vf31, 952); + // iaddiu vi10, vi00, 0x32b | nop 470 + vu.vi10 = 0x32b; /* 811 */ +L26: + // iaddi vi14, vi14, -0x1 | nop 471 + vu.vi14 = vu.vi14 + -1; + // iaddi vi08, vi10, 0x7 | nop 472 + vu.vi08 = vu.vi10 + 7; + // ilw.x vi12, 988(vi14) | nop 473 + ilw_buffer(Mask::x, vu.vi12, vu.vi14 + 988); + // ilw.y vi05, 988(vi14) | nop 474 + ilw_buffer(Mask::y, vu.vi05, vu.vi14 + 988); + // BRANCH! + // ibne vi00, vi12, L27 | nop 475 + bc = (vu.vi12 != 0); + // ilw.z vi03, 988(vi14) | nop 476 + ilw_buffer(Mask::z, vu.vi03, vu.vi14 + 988); + if (bc) { + goto L27; + } + + // lq.xyzw vf20, 282(vi05) | nop 477 + lq_buffer(Mask::xyzw, vu.vf20, vu.vi05 + 282); + // lq.xyzw vf21, 309(vi05) | nop 478 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi05 + 309); + // lq.xyzw vf18, 285(vi05) | nop 479 + lq_buffer(Mask::xyzw, vu.vf18, vu.vi05 + 285); + // lq.xyzw vf22, -5(vi03) | nop 480 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + -5); + // lq.xyzw vf23, -2(vi03) | nop 481 + lq_buffer(Mask::xyzw, vu.vf23, vu.vi03 + -2); + // lq.xyzw vf16, 1(vi03) | nop 482 + lq_buffer(Mask::xyzw, vu.vf16, vu.vi03 + 1); + // lq.xyzw vf08, 55(vi03) | nop 483 + lq_buffer(Mask::xyzw, vu.vf08, vu.vi03 + 55); + // lq.xyzw vf09, 58(vi03) | nop 484 + lq_buffer(Mask::xyzw, vu.vf09, vu.vi03 + 58); + // lq.xyzw vf10, 61(vi03) | nop 485 + lq_buffer(Mask::xyzw, vu.vf10, vu.vi03 + 61); + // lq.xyzw vf28, 57(vi03) | nop 486 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 57); + // lq.xyzw vf29, 60(vi03) | nop 487 + lq_buffer(Mask::xyzw, vu.vf29, vu.vi03 + 60); + // BRANCH! + // b L28 | nop 488 + bc = true; + // lq.xyzw vf30, 63(vi03) | nop 489 + lq_buffer(Mask::xyzw, vu.vf30, vu.vi03 + 63); + if (bc) { + goto L28; + } + +L27: + // lq.xyzw vf20, 306(vi05) | nop 490 + lq_buffer(Mask::xyzw, vu.vf20, vu.vi05 + 306); + // lq.xyzw vf21, 282(vi05) | nop 491 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi05 + 282); + // lq.xyzw vf18, 309(vi05) | nop 492 + lq_buffer(Mask::xyzw, vu.vf18, vu.vi05 + 309); + // lq.xyzw vf22, -2(vi03) | nop 493 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + -2); + // lq.xyzw vf23, 1(vi03) | nop 494 + lq_buffer(Mask::xyzw, vu.vf23, vu.vi03 + 1); + // lq.xyzw vf16, 4(vi03) | nop 495 + lq_buffer(Mask::xyzw, vu.vf16, vu.vi03 + 4); + // lq.xyzw vf08, 58(vi03) | nop 496 + lq_buffer(Mask::xyzw, vu.vf08, vu.vi03 + 58); + // lq.xyzw vf09, 61(vi03) | nop 497 + lq_buffer(Mask::xyzw, vu.vf09, vu.vi03 + 61); + // lq.xyzw vf10, 64(vi03) | nop 498 + lq_buffer(Mask::xyzw, vu.vf10, vu.vi03 + 64); + // lq.xyzw vf28, 60(vi03) | nop 499 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 60); + // lq.xyzw vf29, 63(vi03) | nop 500 + lq_buffer(Mask::xyzw, vu.vf29, vu.vi03 + 63); + // lq.xyzw vf30, 66(vi03) | nop 501 + lq_buffer(Mask::xyzw, vu.vf30, vu.vi03 + 66); +L28: + // sq.xyzw vf20, 0(vi08) | itof0.xyzw vf22, vf22 502 + vu.vf22.itof0(Mask::xyzw, vu.vf22); + sq_buffer(Mask::xyzw, vu.vf20, vu.vi08); + // sq.xyzw vf21, 3(vi08) | itof0.xyzw vf23, vf23 503 + vu.vf23.itof0(Mask::xyzw, vu.vf23); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 3); + // sq.xyzw vf18, 6(vi08) | itof0.xyzw vf16, vf16 504 + vu.vf16.itof0(Mask::xyzw, vu.vf16); + sq_buffer(Mask::xyzw, vu.vf18, vu.vi08 + 6); + // sq.xyzw vf20, 9(vi08) | nop 505 + sq_buffer(Mask::xyzw, vu.vf20, vu.vi08 + 9); + // sq.xyzw vf22, 1(vi08) | nop 506 + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 1); + // sq.xyzw vf23, 4(vi08) | nop 507 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi08 + 4); + // sq.xyzw vf16, 7(vi08) | nop 508 + sq_buffer(Mask::xyzw, vu.vf16, vu.vi08 + 7); + // sq.xyzw vf22, 10(vi08) | nop 509 + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 10); + // sq.xyzw vf28, 2(vi08) | nop 510 + sq_buffer(Mask::xyzw, vu.vf28, vu.vi08 + 2); + // sq.xyzw vf29, 5(vi08) | nop 511 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi08 + 5); + // sq.xyzw vf30, 8(vi08) | nop 512 + sq_buffer(Mask::xyzw, vu.vf30, vu.vi08 + 8); + // sq.xyzw vf28, 11(vi08) | nop 513 + sq_buffer(Mask::xyzw, vu.vf28, vu.vi08 + 11); + // lq.xyzw vf22, 976(vi00) | nop 514 + lq_buffer(Mask::xyzw, vu.vf22, 976); + // sq.xyzw vf08, 35(vi08) | nop 515 + sq_buffer(Mask::xyzw, vu.vf08, vu.vi08 + 35); + // sq.xyzw vf09, 38(vi08) | nop 516 + sq_buffer(Mask::xyzw, vu.vf09, vu.vi08 + 38); + // sq.xyzw vf10, 41(vi08) | nop 517 + sq_buffer(Mask::xyzw, vu.vf10, vu.vi08 + 41); + // sq.xyzw vf08, 44(vi08) | nop 518 + sq_buffer(Mask::xyzw, vu.vf08, vu.vi08 + 44); + // sq.xyzw vf22, 36(vi08) | nop 519 + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 36); + // sq.xyzw vf22, 39(vi08) | nop 520 + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 39); + // sq.xyzw vf22, 42(vi08) | nop 521 + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 42); + // sq.xyzw vf22, 45(vi08) | nop 522 + sq_buffer(Mask::xyzw, vu.vf22, vu.vi08 + 45); + // sq.xyzw vf28, 37(vi08) | nop 523 + sq_buffer(Mask::xyzw, vu.vf28, vu.vi08 + 37); + // sq.xyzw vf29, 40(vi08) | nop 524 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi08 + 40); + // sq.xyzw vf30, 43(vi08) | nop 525 + sq_buffer(Mask::xyzw, vu.vf30, vu.vi08 + 43); + // sq.xyzw vf28, 46(vi08) | nop 526 + sq_buffer(Mask::xyzw, vu.vf28, vu.vi08 + 46); + // lq.xyzw vf07, 959(vi00) | maddw.xyzw vf26, vf06, vf00 527 + vu.acc.madd(Mask::xyzw, vu.vf26, vu.vf06, vu.vf00.w()); + lq_buffer(Mask::xyzw, vu.vf07, 959); + // ior vi03, vi08, vi00 | nop 528 + vu.vi03 = vu.vi08; + // BRANCH! + // bal vi13, L32 | nop 529 + // ASSERT(false); + // iaddi vi05, vi00, 0x3 | nop 530 + vu.vi05 = 3; + // if (bc) { goto L32; } + run_L32_vu2c(); + + // BRANCH! + // ibeq vi00, vi05, L29 | nop 531 + bc = (vu.vi05 == 0); + // iaddiu vi06, vi05, 0x4000 | nop 532 + vu.vi06 = vu.vi05 + 0x4000; /* 16384 */ + if (bc) { + goto L29; + } + + // BRANCH! + // bal vi13, L30 | nop 533 + // ASSERT(false); + // iaddiu vi06, vi06, 0x4000 | nop 534 + vu.vi06 = vu.vi06 + 0x4000; /* 16384 */ + // if (bc) { goto L30; } + run_L30_vu2c(); + + // iaddiu vi08, vi00, 0x3d1 | nop 535 + vu.vi08 = 0x3d1; /* 977 */ + // xgkick vi10 | nop 536 + xgkick(vu.vi10, render_state, prof); + // lq.xyzw vf07, 960(vi00) | nop 537 + lq_buffer(Mask::xyzw, vu.vf07, 960); + // xgkick vi08 | nop 538 + xgkick(vu.vi08, render_state, prof); + // iaddi vi08, vi10, 0x6 | nop 539 + vu.vi08 = vu.vi10 + 6; + // sq.xyzw vf07, 6(vi10) | nop 540 + sq_buffer(Mask::xyzw, vu.vf07, vu.vi10 + 6); + // isw.x vi06, 6(vi10) | nop 541 + isw_buffer(Mask::x, vu.vi06, vu.vi10 + 6); + // xgkick vi08 | nop 542 + xgkick(vu.vi08, render_state, prof); + // iaddiu vi08, vi00, 0x3d5 | nop 543 + vu.vi08 = 0x3d5; /* 981 */ + // nop | nop 544 + + // xgkick vi08 | nop 545 + xgkick(vu.vi08, render_state, prof); + // iaddiu vi08, vi10, 0x2a | nop 546 + vu.vi08 = vu.vi10 + 0x2a; /* 42 */ + // iaddiu vi03, vi10, 0x2a | nop 547 + vu.vi03 = vu.vi10 + 0x2a; /* 42 */ + // iaddi vi05, vi00, 0x3 | nop 548 + vu.vi05 = 3; + // BRANCH! + // bal vi13, L32 | nop 549 + // ASSERT(false); + // lq.xyzw vf07, 961(vi00) | nop 550 + lq_buffer(Mask::xyzw, vu.vf07, 961); + // if (bc) { goto L32; } + run_L32_vu2c(); + + // iaddiu vi06, vi05, 0x4000 | nop 551 + vu.vi06 = vu.vi05 + 0x4000; /* 16384 */ + // BRANCH! + // bal vi13, L30 | nop 552 + // ASSERT(false); + // iaddiu vi06, vi06, 0x4000 | nop 553 + vu.vi06 = vu.vi06 + 0x4000; /* 16384 */ + // if (bc) { goto L30; } + run_L30_vu2c(); + + // iaddiu vi08, vi10, 0x23 | nop 554 + vu.vi08 = vu.vi10 + 0x23; /* 35 */ + // iaddiu vi01, vi00, 0x69c | nop 555 + vu.vi01 = 0x69c; /* 1692 */ + // xgkick vi08 | nop 556 + xgkick(vu.vi08, render_state, prof); + // isub vi10, vi01, vi10 | nop 557 + vu.vi10 = vu.vi01 - vu.vi10; +L29: + // BRANCH! + // ibgtz vi14, L26 | nop 558 + bc = ((s16)vu.vi14) > 0; + // nop | nop 559 + + if (bc) { + goto L26; + } + + // lq.xyzw vf08, 0(vi02) | nop 560 + lq_buffer(Mask::xyzw, vu.vf08, vu.vi02); + // lq.xyzw vf09, 1(vi02) | nop 561 + lq_buffer(Mask::xyzw, vu.vf09, vu.vi02 + 1); + // jr vi15 | nop 562 + // ASSERT(false); + // lq.xyzw vf10, 2(vi02) | nop 563 + lq_buffer(Mask::xyzw, vu.vf10, vu.vi02 + 2); +} + +void OceanNear::run_L30_vu2c() { + bool bc; + // sq.xyzw vf07, -1(vi08) | nop 564 + sq_buffer(Mask::xyzw, vu.vf07, vu.vi08 + -1); + // isw.x vi06, -1(vi08) | nop 565 + isw_buffer(Mask::x, vu.vi06, vu.vi08 + -1); +L31: + // lqi.xyzw vf24, vi08 | nop 566 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08++); + // lqi.xyzw vf27, vi08 | nop 567 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08++); + // lqi.xyzw vf21, vi08 | nop 568 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08++); + // nop | nop 569 + + // nop | nop 570 + + // nop | nop 571 + + // div Q, vf00.w, vf21.w | mul.xyzw vf21, vf21, vf31 572 + // SWAP here + vu.Q = vu.vf00.w() / vu.vf21.w(); + vu.vf21.mul(Mask::xyzw, vu.vf21, vu.vf31); + // nop | nop 573 + + // nop | nop 574 + + // nop | nop 575 + + // nop | nop 576 + + // nop | nop 577 + + // nop | nop 578 + + // nop | mul.xyz vf21, vf21, Q 579 + vu.vf21.mul(Mask::xyz, vu.vf21, vu.Q); + // nop | mul.xyzw vf24, vf24, Q 580 + vu.vf24.mul(Mask::xyzw, vu.vf24, vu.Q); + // nop | nop 581 + + // nop | nop 582 + + // nop | add.xyzw vf21, vf21, vf02 583 + vu.vf21.add(Mask::xyzw, vu.vf21, vu.vf02); + // nop | nop 584 + + // nop | nop 585 + + // nop | nop 586 + + // nop | maxy.w vf21, vf21, vf03 587 + vu.vf21.max(Mask::w, vu.vf21, vu.vf03.y()); + // nop | nop 588 + + // nop | nop 589 + + // nop | nop 590 + + // nop | miniz.w vf21, vf21, vf03 591 + vu.vf21.mini(Mask::w, vu.vf21, vu.vf03.z()); + // nop | nop 592 + + // nop | nop 593 + + // nop | ftoi0.xyzw vf27, vf27 594 + vu.vf27.ftoi0(Mask::xyzw, vu.vf27); + // nop | ftoi4.xyzw vf21, vf21 595 + vu.vf21.ftoi4(Mask::xyzw, vu.vf21); + // nop | nop 596 + + // sq.xyzw vf24, -3(vi08) | nop 597 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi08 + -3); + // sq.xyzw vf27, -2(vi08) | nop 598 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + -2); + // sq.xyzw vf21, -1(vi08) | nop 599 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + -1); + // iaddi vi05, vi05, -0x1 | nop 600 + vu.vi05 = vu.vi05 + -1; + // nop | nop 601 + + // BRANCH! + // ibne vi00, vi05, L31 | nop 602 + bc = (vu.vi05 != 0); + // nop | nop 603 + + if (bc) { + goto L31; + } + + // jr vi13 | nop 604 + // nop | nop 605 +} + +void OceanNear::run_L32_vu2c() { + bool bc; + u32 cf = 0; + // ior vi04, vi03, vi00 | nop 606 + vu.vi04 = vu.vi03; + // lq.xyzw vf21, 2(vi03) | nop 607 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi03 + 2); + // ior vi06, vi05, vi00 | nop 608 + vu.vi06 = vu.vi05; + // lq.xyzw vf24, 0(vi03) | nop 609 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi03); + // lq.xyzw vf27, 1(vi03) | nop 610 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 611 + cf = clip(vu.vf21, vu.vf21.w(), cf); + vu.vi03 = vu.vi03 + 3; +L33: + // lq.xyzw vf22, 2(vi03) | nop 612 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + 2); + // lq.xyzw vf25, 0(vi03) | nop 613 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi03); + // lq.xyzw vf28, 1(vi03) | nop 614 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | nop 615 + vu.vi03 = vu.vi03 + 3; + // nop | clipw.xyz vf22, vf22 616 + cf = clip(vu.vf22, vu.vf22.w(), cf); + // nop | nop 617 + + // nop | nop 618 + + // nop | nop 619 + + // fcor vi01, 0xfff7df | nop 620 + fcor(vu.vi01, 0xfff7df, cf); + + // BRANCH! + // ibne vi00, vi01, L44 | nop 621 + bc = (vu.vi01 != 0); + // fcand vi01, 0x20 | nop 622 + fcand(vu.vi01, 0x20, cf); + + if (bc) { + goto L44; + } + + // BRANCH! + // ibne vi00, vi01, L45 | nop 623 + bc = (vu.vi01 != 0); + // fcand vi01, 0x800 | nop 624 + fcand(vu.vi01, 0x800, cf); + + if (bc) { + goto L45; + } + + // BRANCH! + // ibne vi00, vi01, L46 | nop 625 + bc = (vu.vi01 != 0); + // nop | nop 626 + + if (bc) { + goto L46; + } + + // sqi.xyzw vf24, vi04 | nop 627 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 628 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 629 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); +L34: + // move.xyzw vf24, vf25 | nop 630 + vu.vf24.move(Mask::xyzw, vu.vf25); + // iaddi vi05, vi05, -0x1 | nop 631 + vu.vi05 = vu.vi05 + -1; + // move.xyzw vf27, vf28 | nop 632 + vu.vf27.move(Mask::xyzw, vu.vf28); + // BRANCH! + // ibne vi00, vi05, L33 | nop 633 + bc = (vu.vi05 != 0); + // move.xyzw vf21, vf22 | nop 634 + vu.vf21.move(Mask::xyzw, vu.vf22); + if (bc) { + goto L33; + } + + // lq.xyzw vf24, 0(vi08) | nop 635 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08); + // lq.xyzw vf27, 1(vi08) | nop 636 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + 1); + // lq.xyzw vf21, 2(vi08) | nop 637 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 2); + // ior vi03, vi08, vi00 | nop 638 + vu.vi03 = vu.vi08; + // sqi.xyzw vf24, vi04 | nop 639 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 640 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 641 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi00, vi06, L43 | nop 642 + bc = (vu.vi06 == 0); + // ior vi05, vi06, vi00 | nop 643 + vu.vi05 = vu.vi06; + if (bc) { + goto L43; + } + + // ior vi04, vi03, vi00 | nop 644 + vu.vi04 = vu.vi03; + // lq.xyzw vf21, 2(vi03) | nop 645 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi03 + 2); + // ior vi06, vi05, vi00 | nop 646 + vu.vi06 = vu.vi05; + // lq.xyzw vf24, 0(vi03) | nop 647 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi03); + // lq.xyzw vf27, 1(vi03) | nop 648 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 649 + cf = clip(vu.vf21, vu.vf21.w(), cf); + vu.vi03 = vu.vi03 + 3; +L35: + // lq.xyzw vf22, 2(vi03) | nop 650 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + 2); + // lq.xyzw vf25, 0(vi03) | nop 651 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi03); + // lq.xyzw vf28, 1(vi03) | nop 652 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | nop 653 + vu.vi03 = vu.vi03 + 3; + // nop | clipw.xyz vf22, vf22 654 + cf = clip(vu.vf22, vu.vf22.w(), cf); + // nop | nop 655 + + // nop | nop 656 + + // nop | nop 657 + + // fcor vi01, 0xfffdf7 | nop 658 + fcor(vu.vi01, 0xfffdf7, cf); + + // BRANCH! + // ibne vi00, vi01, L47 | nop 659 + bc = (vu.vi01 != 0); + // fcand vi01, 0x8 | nop 660 + fcand(vu.vi01, 0x8, cf); + + if (bc) { + goto L47; + } + + // BRANCH! + // ibne vi00, vi01, L48 | nop 661 + bc = (vu.vi01 != 0); + // fcand vi01, 0x200 | nop 662 + fcand(vu.vi01, 0x200, cf); + + if (bc) { + goto L48; + } + + // BRANCH! + // ibne vi00, vi01, L49 | nop 663 + bc = (vu.vi01 != 0); + // nop | nop 664 + + if (bc) { + goto L49; + } + + // sqi.xyzw vf24, vi04 | nop 665 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 666 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 667 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); +L36: + // move.xyzw vf24, vf25 | nop 668 + vu.vf24.move(Mask::xyzw, vu.vf25); + // iaddi vi05, vi05, -0x1 | nop 669 + vu.vi05 = vu.vi05 + -1; + // move.xyzw vf27, vf28 | nop 670 + vu.vf27.move(Mask::xyzw, vu.vf28); + // BRANCH! + // ibne vi00, vi05, L35 | nop 671 + bc = (vu.vi05 != 0); + // move.xyzw vf21, vf22 | nop 672 + vu.vf21.move(Mask::xyzw, vu.vf22); + if (bc) { + goto L35; + } + + // lq.xyzw vf24, 0(vi08) | nop 673 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08); + // lq.xyzw vf27, 1(vi08) | nop 674 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + 1); + // lq.xyzw vf21, 2(vi08) | nop 675 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 2); + // ior vi03, vi08, vi00 | nop 676 + vu.vi03 = vu.vi08; + // sqi.xyzw vf24, vi04 | nop 677 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 678 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 679 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi00, vi06, L43 | nop 680 + bc = (vu.vi06 == 0); + // ior vi05, vi06, vi00 | nop 681 + vu.vi05 = vu.vi06; + if (bc) { + goto L43; + } + + // ior vi04, vi03, vi00 | nop 682 + vu.vi04 = vu.vi03; + // lq.xyzw vf21, 2(vi03) | nop 683 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi03 + 2); + // ior vi06, vi05, vi00 | nop 684 + vu.vi06 = vu.vi05; + // lq.xyzw vf24, 0(vi03) | nop 685 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi03); + // lq.xyzw vf27, 1(vi03) | nop 686 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 687 + cf = clip(vu.vf21, vu.vf21.w(), cf); + vu.vi03 = vu.vi03 + 3; +L37: + // lq.xyzw vf22, 2(vi03) | nop 688 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + 2); + // lq.xyzw vf25, 0(vi03) | nop 689 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi03); + // lq.xyzw vf28, 1(vi03) | nop 690 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | nop 691 + vu.vi03 = vu.vi03 + 3; + // nop | clipw.xyz vf22, vf22 692 + cf = clip(vu.vf22, vu.vf22.w(), cf); + // nop | nop 693 + + // nop | nop 694 + + // nop | nop 695 + + // fcor vi01, 0xfffefb | nop 696 + fcor(vu.vi01, 0xfffefb, cf); + + // BRANCH! + // ibne vi00, vi01, L50 | nop 697 + bc = (vu.vi01 != 0); + // fcand vi01, 0x4 | nop 698 + fcand(vu.vi01, 0x4, cf); + + if (bc) { + goto L50; + } + + // BRANCH! + // ibne vi00, vi01, L51 | nop 699 + bc = (vu.vi01 != 0); + // fcand vi01, 0x100 | nop 700 + fcand(vu.vi01, 0x100, cf); + + if (bc) { + goto L51; + } + + // BRANCH! + // ibne vi00, vi01, L52 | nop 701 + bc = (vu.vi01 != 0); + // nop | nop 702 + + if (bc) { + goto L52; + } + + // sqi.xyzw vf24, vi04 | nop 703 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 704 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 705 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); +L38: + // move.xyzw vf24, vf25 | nop 706 + vu.vf24.move(Mask::xyzw, vu.vf25); + // iaddi vi05, vi05, -0x1 | nop 707 + vu.vi05 = vu.vi05 + -1; + // move.xyzw vf27, vf28 | nop 708 + vu.vf27.move(Mask::xyzw, vu.vf28); + // BRANCH! + // ibne vi00, vi05, L37 | nop 709 + bc = (vu.vi05 != 0); + // move.xyzw vf21, vf22 | nop 710 + vu.vf21.move(Mask::xyzw, vu.vf22); + if (bc) { + goto L37; + } + + // lq.xyzw vf24, 0(vi08) | nop 711 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08); + // lq.xyzw vf27, 1(vi08) | nop 712 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + 1); + // lq.xyzw vf21, 2(vi08) | nop 713 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 2); + // ior vi03, vi08, vi00 | nop 714 + vu.vi03 = vu.vi08; + // sqi.xyzw vf24, vi04 | nop 715 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 716 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 717 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi00, vi06, L43 | nop 718 + bc = (vu.vi06 == 0); + // ior vi05, vi06, vi00 | nop 719 + vu.vi05 = vu.vi06; + if (bc) { + goto L43; + } + + // ior vi04, vi03, vi00 | nop 720 + vu.vi04 = vu.vi03; + // lq.xyzw vf21, 2(vi03) | nop 721 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi03 + 2); + // ior vi06, vi05, vi00 | nop 722 + vu.vi06 = vu.vi05; + // lq.xyzw vf24, 0(vi03) | nop 723 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi03); + // lq.xyzw vf27, 1(vi03) | nop 724 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 725 + cf = clip(vu.vf21, vu.vf21.w(), cf); + vu.vi03 = vu.vi03 + 3; +L39: + // lq.xyzw vf22, 2(vi03) | nop 726 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + 2); + // lq.xyzw vf25, 0(vi03) | nop 727 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi03); + // lq.xyzw vf28, 1(vi03) | nop 728 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | nop 729 + vu.vi03 = vu.vi03 + 3; + // nop | clipw.xyz vf22, vf22 730 + cf = clip(vu.vf22, vu.vf22.w(), cf); + // nop | nop 731 + + // nop | nop 732 + + // nop | nop 733 + + // fcor vi01, 0xffff7d | nop 734 + fcor(vu.vi01, 0xffff7d, cf); + + // BRANCH! + // ibne vi00, vi01, L53 | nop 735 + bc = (vu.vi01 != 0); + // fcand vi01, 0x2 | nop 736 + fcand(vu.vi01, 0x2, cf); + + if (bc) { + goto L53; + } + + // BRANCH! + // ibne vi00, vi01, L54 | nop 737 + bc = (vu.vi01 != 0); + // fcand vi01, 0x80 | nop 738 + fcand(vu.vi01, 0x80, cf); + + if (bc) { + goto L54; + } + + // BRANCH! + // ibne vi00, vi01, L55 | nop 739 + bc = (vu.vi01 != 0); + // nop | nop 740 + + if (bc) { + goto L55; + } + + // sqi.xyzw vf24, vi04 | nop 741 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 742 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 743 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); +L40: + // move.xyzw vf24, vf25 | nop 744 + vu.vf24.move(Mask::xyzw, vu.vf25); + // iaddi vi05, vi05, -0x1 | nop 745 + vu.vi05 = vu.vi05 + -1; + // move.xyzw vf27, vf28 | nop 746 + vu.vf27.move(Mask::xyzw, vu.vf28); + // BRANCH! + // ibne vi00, vi05, L39 | nop 747 + bc = (vu.vi05 != 0); + // move.xyzw vf21, vf22 | nop 748 + vu.vf21.move(Mask::xyzw, vu.vf22); + if (bc) { + goto L39; + } + + // lq.xyzw vf24, 0(vi08) | nop 749 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08); + // lq.xyzw vf27, 1(vi08) | nop 750 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + 1); + // lq.xyzw vf21, 2(vi08) | nop 751 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 2); + // ior vi03, vi08, vi00 | nop 752 + vu.vi03 = vu.vi08; + // sqi.xyzw vf24, vi04 | nop 753 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 754 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 755 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi00, vi06, L43 | nop 756 + bc = (vu.vi06 == 0); + // ior vi05, vi06, vi00 | nop 757 + vu.vi05 = vu.vi06; + if (bc) { + goto L43; + } + + // ior vi04, vi03, vi00 | nop 758 + vu.vi04 = vu.vi03; + // lq.xyzw vf21, 2(vi03) | nop 759 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi03 + 2); + // ior vi06, vi05, vi00 | nop 760 + vu.vi06 = vu.vi05; + // lq.xyzw vf24, 0(vi03) | nop 761 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi03); + // lq.xyzw vf27, 1(vi03) | nop 762 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 763 + cf = clip(vu.vf21, vu.vf21.w(), cf); + vu.vi03 = vu.vi03 + 3; +L41: + // lq.xyzw vf22, 2(vi03) | nop 764 + lq_buffer(Mask::xyzw, vu.vf22, vu.vi03 + 2); + // lq.xyzw vf25, 0(vi03) | nop 765 + lq_buffer(Mask::xyzw, vu.vf25, vu.vi03); + // lq.xyzw vf28, 1(vi03) | nop 766 + lq_buffer(Mask::xyzw, vu.vf28, vu.vi03 + 1); + // iaddi vi03, vi03, 0x3 | nop 767 + vu.vi03 = vu.vi03 + 3; + // nop | clipw.xyz vf22, vf22 768 + cf = clip(vu.vf22, vu.vf22.w(), cf); + // nop | nop 769 + + // nop | nop 770 + + // nop | nop 771 + + // fcor vi01, 0xffffbe | nop 772 + fcor(vu.vi01, 0xffffbe, cf); + + // BRANCH! + // ibne vi00, vi01, L56 | nop 773 + bc = (vu.vi01 != 0); + // fcand vi01, 0x1 | nop 774 + fcand(vu.vi01, 0x1, cf); + + if (bc) { + goto L56; + } + + // BRANCH! + // ibne vi00, vi01, L57 | nop 775 + bc = (vu.vi01 != 0); + // fcand vi01, 0x40 | nop 776 + fcand(vu.vi01, 0x40, cf); + + if (bc) { + goto L57; + } + + // BRANCH! + // ibne vi00, vi01, L58 | nop 777 + bc = (vu.vi01 != 0); + // nop | nop 778 + + if (bc) { + goto L58; + } + + // sqi.xyzw vf24, vi04 | nop 779 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 780 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 781 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); +L42: + // move.xyzw vf24, vf25 | nop 782 + vu.vf24.move(Mask::xyzw, vu.vf25); + // iaddi vi05, vi05, -0x1 | nop 783 + vu.vi05 = vu.vi05 + -1; + // move.xyzw vf27, vf28 | nop 784 + vu.vf27.move(Mask::xyzw, vu.vf28); + // BRANCH! + // ibne vi00, vi05, L41 | nop 785 + bc = (vu.vi05 != 0); + // move.xyzw vf21, vf22 | nop 786 + vu.vf21.move(Mask::xyzw, vu.vf22); + if (bc) { + goto L41; + } + + // lq.xyzw vf24, 0(vi08) | nop 787 + lq_buffer(Mask::xyzw, vu.vf24, vu.vi08); + // lq.xyzw vf27, 1(vi08) | nop 788 + lq_buffer(Mask::xyzw, vu.vf27, vu.vi08 + 1); + // lq.xyzw vf21, 2(vi08) | nop 789 + lq_buffer(Mask::xyzw, vu.vf21, vu.vi08 + 2); + // ior vi03, vi08, vi00 | nop 790 + vu.vi03 = vu.vi08; + // sqi.xyzw vf24, vi04 | nop 791 + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | nop 792 + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | nop 793 + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi00, vi06, L43 | nop 794 + bc = (vu.vi06 == 0); + // ior vi05, vi06, vi00 | nop 795 + vu.vi05 = vu.vi06; + if (bc) { + goto L43; + } + +L43: + // jr vi13 | nop 796 + // ASSERT(false); + return; + // nop | nop 797 + +L44: + // BRANCH! + // b L34 | nop 798 + bc = true; + // iaddi vi06, vi06, -0x1 | nop 799 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L34; + } + +L45: + // sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 800 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf21); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 801 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf24); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 802 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf27); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi03, vi04, L34 | nop 803 + bc = (vu.vi03 == vu.vi04); + // nop | addz.w vf30, vf23, vf23 804 + vu.vf30.add(Mask::w, vu.vf23, vu.vf23.z()); + if (bc) { + goto L34; + } + + // nop | addw.z vf30, vf21, vf21 805 + vu.vf30.add(Mask::z, vu.vf21, vu.vf21.w()); + // div Q, vf30.z, vf30.w | nop 806 + vu.Q = vu.vf30.z() / vu.vf30.w(); + // waitq | nop 807 + + // nop | mul.xyzw vf26, vf26, Q 808 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 809 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 810 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | sub.xyzw vf26, vf24, vf26 811 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf26); + // nop | sub.xyzw vf29, vf27, vf29 812 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf29); + // nop | sub.xyzw vf23, vf21, vf23 813 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf23); + // iaddi vi06, vi06, 0x1 | nop 814 + vu.vi06 = vu.vi06 + 1; + // sqi.xyzw vf26, vi04 | nop 815 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 816 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L34 | nop 817 + bc = true; + // sqi.xyzw vf23, vi04 | nop 818 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L34; + } + +L46: + // nop | sub.xyzw vf23, vf21, vf22 819 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf22); + // nop | sub.xyzw vf26, vf24, vf25 820 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf25); + // nop | sub.xyzw vf29, vf27, vf28 821 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf28); + // nop | addz.w vf30, vf23, vf23 822 + vu.vf30.add(Mask::w, vu.vf23, vu.vf23.z()); + // nop | addw.z vf30, vf22, vf22 823 + vu.vf30.add(Mask::z, vu.vf22, vu.vf22.w()); + // div Q, vf30.z, vf30.w | nop 824 + vu.Q = vu.vf30.z() / vu.vf30.w(); + // waitq | nop 825 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 826 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 827 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 828 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | sub.xyzw vf26, vf25, vf26 829 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf26); + // nop | sub.xyzw vf29, vf28, vf29 830 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf29); + // nop | sub.xyzw vf23, vf22, vf23 831 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf23); + // sqi.xyzw vf26, vi04 | nop 832 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 833 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L34 | nop 834 + bc = true; + // sqi.xyzw vf23, vi04 | nop 835 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L34; + } + +L47: + // BRANCH! + // b L36 | nop 836 + bc = true; + // iaddi vi06, vi06, -0x1 | nop 837 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L36; + } + +L48: + // sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 838 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf21); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 839 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf24); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 840 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf27); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi03, vi04, L36 | nop 841 + bc = (vu.vi03 == vu.vi04); + // nop | addy.w vf30, vf23, vf23 842 + vu.vf30.add(Mask::w, vu.vf23, vu.vf23.y()); + if (bc) { + goto L36; + } + + // nop | addw.y vf30, vf21, vf21 843 + vu.vf30.add(Mask::y, vu.vf21, vu.vf21.w()); + // div Q, vf30.y, vf30.w | nop 844 + vu.Q = vu.vf30.y() / vu.vf30.w(); + // waitq | nop 845 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 846 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 847 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 848 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | sub.xyzw vf26, vf24, vf26 849 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf26); + // nop | sub.xyzw vf29, vf27, vf29 850 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf29); + // nop | sub.xyzw vf23, vf21, vf23 851 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf23); + // iaddi vi06, vi06, 0x1 | nop 852 + vu.vi06 = vu.vi06 + 1; + // sqi.xyzw vf26, vi04 | nop 853 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 854 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L36 | nop 855 + bc = true; + // sqi.xyzw vf23, vi04 | nop 856 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L36; + } + +L49: + // nop | sub.xyzw vf23, vf21, vf22 857 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf22); + // nop | sub.xyzw vf26, vf24, vf25 858 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf25); + // nop | sub.xyzw vf29, vf27, vf28 859 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf28); + // nop | addy.w vf30, vf23, vf23 860 + vu.vf30.add(Mask::w, vu.vf23, vu.vf23.y()); + // nop | addw.y vf30, vf22, vf22 861 + vu.vf30.add(Mask::y, vu.vf22, vu.vf22.w()); + // div Q, vf30.y, vf30.w | nop 862 + vu.Q = vu.vf30.y() / vu.vf30.w(); + // waitq | nop 863 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 864 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 865 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 866 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | sub.xyzw vf26, vf25, vf26 867 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf26); + // nop | sub.xyzw vf29, vf28, vf29 868 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf29); + // nop | sub.xyzw vf23, vf22, vf23 869 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf23); + // sqi.xyzw vf26, vi04 | nop 870 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 871 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L36 | nop 872 + bc = true; + // sqi.xyzw vf23, vi04 | nop 873 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L36; + } + +L50: + // BRANCH! + // b L38 | nop 874 + bc = true; + // iaddi vi06, vi06, -0x1 | nop 875 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L38; + } + +L51: + // sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 876 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf21); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 877 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf24); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 878 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf27); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi03, vi04, L38 | nop 879 + bc = (vu.vi03 == vu.vi04); + // nop | suby.w vf30, vf23, vf23 880 + vu.vf30.sub(Mask::w, vu.vf23, vu.vf23.y()); + if (bc) { + goto L38; + } + + // nop | subw.y vf30, vf21, vf21 881 + vu.vf30.sub(Mask::y, vu.vf21, vu.vf21.w()); + // div Q, vf30.y, vf30.w | nop 882 + vu.Q = vu.vf30.y() / vu.vf30.w(); + // waitq | nop 883 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 884 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 885 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 886 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | add.xyzw vf26, vf24, vf26 887 + vu.vf26.add(Mask::xyzw, vu.vf24, vu.vf26); + // nop | add.xyzw vf29, vf27, vf29 888 + vu.vf29.add(Mask::xyzw, vu.vf27, vu.vf29); + // nop | add.xyzw vf23, vf21, vf23 889 + vu.vf23.add(Mask::xyzw, vu.vf21, vu.vf23); + // iaddi vi06, vi06, 0x1 | nop 890 + vu.vi06 = vu.vi06 + 1; + // sqi.xyzw vf26, vi04 | nop 891 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 892 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L38 | nop 893 + bc = true; + // sqi.xyzw vf23, vi04 | nop 894 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L38; + } + +L52: + // nop | sub.xyzw vf23, vf21, vf22 895 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf22); + // nop | sub.xyzw vf26, vf24, vf25 896 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf25); + // nop | sub.xyzw vf29, vf27, vf28 897 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf28); + // nop | suby.w vf30, vf23, vf23 898 + vu.vf30.sub(Mask::w, vu.vf23, vu.vf23.y()); + // nop | subw.y vf30, vf22, vf22 899 + vu.vf30.sub(Mask::y, vu.vf22, vu.vf22.w()); + // div Q, vf30.y, vf30.w | nop 900 + vu.Q = vu.vf30.y() / vu.vf30.w(); + // waitq | nop 901 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 902 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 903 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 904 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | add.xyzw vf26, vf25, vf26 905 + vu.vf26.add(Mask::xyzw, vu.vf25, vu.vf26); + // nop | add.xyzw vf29, vf28, vf29 906 + vu.vf29.add(Mask::xyzw, vu.vf28, vu.vf29); + // nop | add.xyzw vf23, vf22, vf23 907 + vu.vf23.add(Mask::xyzw, vu.vf22, vu.vf23); + // sqi.xyzw vf26, vi04 | nop 908 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 909 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L38 | nop 910 + bc = true; + // sqi.xyzw vf23, vi04 | nop 911 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L38; + } + +L53: + // BRANCH! + // b L40 | nop 912 + bc = true; + // iaddi vi06, vi06, -0x1 | nop 913 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L40; + } + +L54: + // sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 914 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf21); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 915 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf24); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 916 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf27); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi03, vi04, L40 | nop 917 + bc = (vu.vi03 == vu.vi04); + // nop | addx.w vf30, vf23, vf23 918 + vu.vf30.add(Mask::w, vu.vf23, vu.vf23.x()); + if (bc) { + goto L40; + } + + // nop | addw.x vf30, vf21, vf21 919 + vu.vf30.add(Mask::x, vu.vf21, vu.vf21.w()); + // div Q, vf30.x, vf30.w | nop 920 + vu.Q = vu.vf30.x() / vu.vf30.w(); + // waitq | nop 921 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 922 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 923 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 924 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | sub.xyzw vf26, vf24, vf26 925 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf26); + // nop | sub.xyzw vf29, vf27, vf29 926 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf29); + // nop | sub.xyzw vf23, vf21, vf23 927 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf23); + // iaddi vi06, vi06, 0x1 | nop 928 + vu.vi06 = vu.vi06 + 1; + // sqi.xyzw vf26, vi04 | nop 929 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 930 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L40 | nop 931 + bc = true; + // sqi.xyzw vf23, vi04 | nop 932 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L40; + } + +L55: + // nop | sub.xyzw vf23, vf21, vf22 933 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf22); + // nop | sub.xyzw vf26, vf24, vf25 934 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf25); + // nop | sub.xyzw vf29, vf27, vf28 935 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf28); + // nop | addx.w vf30, vf23, vf23 936 + vu.vf30.add(Mask::w, vu.vf23, vu.vf23.x()); + // nop | addw.x vf30, vf22, vf22 937 + vu.vf30.add(Mask::x, vu.vf22, vu.vf22.w()); + // div Q, vf30.x, vf30.w | nop 938 + vu.Q = vu.vf30.x() / vu.vf30.w(); + // waitq | nop 939 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 940 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 941 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 942 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | sub.xyzw vf26, vf25, vf26 943 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf26); + // nop | sub.xyzw vf29, vf28, vf29 944 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf29); + // nop | sub.xyzw vf23, vf22, vf23 945 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf23); + // sqi.xyzw vf26, vi04 | nop 946 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 947 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L40 | nop 948 + bc = true; + // sqi.xyzw vf23, vi04 | nop 949 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L40; + } + +L56: + // BRANCH! + // b L42 | nop 950 + bc = true; + // iaddi vi06, vi06, -0x1 | nop 951 + vu.vi06 = vu.vi06 + -1; + if (bc) { + goto L42; + } + +L57: + // sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 952 + vu.vf23.sub(Mask::xyzw, vu.vf22, vu.vf21); + sq_buffer(Mask::xyzw, vu.vf24, vu.vi04++); + // sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 953 + vu.vf26.sub(Mask::xyzw, vu.vf25, vu.vf24); + sq_buffer(Mask::xyzw, vu.vf27, vu.vi04++); + // sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 954 + vu.vf29.sub(Mask::xyzw, vu.vf28, vu.vf27); + sq_buffer(Mask::xyzw, vu.vf21, vu.vi04++); + // BRANCH! + // ibeq vi03, vi04, L42 | nop 955 + bc = (vu.vi03 == vu.vi04); + // nop | subx.w vf30, vf23, vf23 956 + vu.vf30.sub(Mask::w, vu.vf23, vu.vf23.x()); + if (bc) { + goto L42; + } + + // nop | subw.x vf30, vf21, vf21 957 + vu.vf30.sub(Mask::x, vu.vf21, vu.vf21.w()); + // div Q, vf30.x, vf30.w | nop 958 + vu.Q = vu.vf30.x() / vu.vf30.w(); + // waitq | nop 959 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 960 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 961 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 962 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | add.xyzw vf26, vf24, vf26 963 + vu.vf26.add(Mask::xyzw, vu.vf24, vu.vf26); + // nop | add.xyzw vf29, vf27, vf29 964 + vu.vf29.add(Mask::xyzw, vu.vf27, vu.vf29); + // nop | add.xyzw vf23, vf21, vf23 965 + vu.vf23.add(Mask::xyzw, vu.vf21, vu.vf23); + // iaddi vi06, vi06, 0x1 | nop 966 + vu.vi06 = vu.vi06 + 1; + // sqi.xyzw vf26, vi04 | nop 967 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 968 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L42 | nop 969 + bc = true; + // sqi.xyzw vf23, vi04 | nop 970 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L42; + } + +L58: + // nop | sub.xyzw vf23, vf21, vf22 971 + vu.vf23.sub(Mask::xyzw, vu.vf21, vu.vf22); + // nop | sub.xyzw vf26, vf24, vf25 972 + vu.vf26.sub(Mask::xyzw, vu.vf24, vu.vf25); + // nop | sub.xyzw vf29, vf27, vf28 973 + vu.vf29.sub(Mask::xyzw, vu.vf27, vu.vf28); + // nop | subx.w vf30, vf23, vf23 974 + vu.vf30.sub(Mask::w, vu.vf23, vu.vf23.x()); + // nop | subw.x vf30, vf22, vf22 975 + vu.vf30.sub(Mask::x, vu.vf22, vu.vf22.w()); + // div Q, vf30.x, vf30.w | nop 976 + vu.Q = vu.vf30.x() / vu.vf30.w(); + // waitq | nop 977 + // ASSERT(false); + // nop | mul.xyzw vf26, vf26, Q 978 + vu.vf26.mul(Mask::xyzw, vu.vf26, vu.Q); + // nop | mul.xyzw vf29, vf29, Q 979 + vu.vf29.mul(Mask::xyzw, vu.vf29, vu.Q); + // nop | mul.xyzw vf23, vf23, Q 980 + vu.vf23.mul(Mask::xyzw, vu.vf23, vu.Q); + // nop | add.xyzw vf26, vf25, vf26 981 + vu.vf26.add(Mask::xyzw, vu.vf25, vu.vf26); + // nop | add.xyzw vf29, vf28, vf29 982 + vu.vf29.add(Mask::xyzw, vu.vf28, vu.vf29); + // nop | add.xyzw vf23, vf22, vf23 983 + vu.vf23.add(Mask::xyzw, vu.vf22, vu.vf23); + // sqi.xyzw vf26, vi04 | nop 984 + sq_buffer(Mask::xyzw, vu.vf26, vu.vi04++); + // sqi.xyzw vf29, vi04 | nop 985 + sq_buffer(Mask::xyzw, vu.vf29, vu.vi04++); + // BRANCH! + // b L42 | nop 986 + bc = true; + // sqi.xyzw vf23, vi04 | nop 987 + sq_buffer(Mask::xyzw, vu.vf23, vu.vi04++); + if (bc) { + goto L42; + } +} \ No newline at end of file diff --git a/game/graphics/opengl_renderer/ocean/OceanTexture.cpp b/game/graphics/opengl_renderer/ocean/OceanTexture.cpp index c3341fa7b9..6d8eb413a7 100644 --- a/game/graphics/opengl_renderer/ocean/OceanTexture.cpp +++ b/game/graphics/opengl_renderer/ocean/OceanTexture.cpp @@ -3,10 +3,14 @@ #include "third-party/imgui/imgui.h" constexpr int OCEAN_TEX_TBP = 8160; // todo -OceanTexture::OceanTexture() - : m_result_texture(TEX0_SIZE, TEX0_SIZE, GL_UNSIGNED_INT_8_8_8_8_REV, 8), +OceanTexture::OceanTexture(bool generate_mipmaps) + : m_generate_mipmaps(generate_mipmaps), + m_result_texture(TEX0_SIZE, + TEX0_SIZE, + GL_UNSIGNED_INT_8_8_8_8_REV, + m_generate_mipmaps ? NUM_MIPS : 1), m_temp_texture(TEX0_SIZE, TEX0_SIZE, GL_UNSIGNED_INT_8_8_8_8_REV), - m_hack_renderer("burp", BucketId::BUCKET0, 0x8000) { + m_hack_renderer("ocean-tex-unoptimized", BucketId::BUCKET0, 0x8000) { m_dbuf_x = m_dbuf_a; m_dbuf_y = m_dbuf_b; @@ -54,7 +58,7 @@ void OceanTexture::init_textures(TexturePool& pool) { in.w = TEX0_SIZE; in.h = TEX0_SIZE; in.page_name = "PC-OCEAN"; - in.name = "pc-ocean"; + in.name = fmt::format("pc-ocean-mip-{}", m_generate_mipmaps); m_tex0_gpu = pool.give_texture_and_load_to_vram(in, OCEAN_TEX_TBP); } @@ -101,7 +105,9 @@ void OceanTexture::handle_tex_call_rest(SharedRenderState* render_state, ScopedP void OceanTexture::handle_ocean_texture(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) { - FramebufferTexturePairContext ctxt(m_temp_texture); + // if we're doing mipmaps, render to temp. + // otherwise, render directly to target. + FramebufferTexturePairContext ctxt(m_generate_mipmaps ? m_temp_texture : m_result_texture); // render to the first texture { // (set-display-gs-state arg0 ocean-tex-page-0 128 128 0 0) @@ -262,7 +268,14 @@ void OceanTexture::handle_ocean_texture(DmaFollower& dma, } flush(render_state, prof); - make_mipmaps(render_state, prof); + if (m_generate_mipmaps) { + // if we did mipmaps, the above code rendered to temp, and now we need to generate mipmaps + // in the real output + make_texture_with_mipmaps(render_state, prof); + } + + // give to gpu! + render_state->texture_pool->move_existing_to_vram(m_tex0_gpu, OCEAN_TEX_TBP); } /*! @@ -270,7 +283,8 @@ void OceanTexture::handle_ocean_texture(DmaFollower& dma, * There's a trick here - we reduce the intensity of alpha on the lower lods. This lets texture * filtering slowly fade the alpha value out to 0 with distance. */ -void OceanTexture::make_mipmaps(SharedRenderState* render_state, ScopedProfilerNode& prof) { +void OceanTexture::make_texture_with_mipmaps(SharedRenderState* render_state, + ScopedProfilerNode& prof) { glBindVertexArray(m_mipmap.vao); render_state->shaders[ShaderId::OCEAN_TEXTURE_MIPMAP].activate(); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::OCEAN_TEXTURE_MIPMAP].id(), @@ -287,11 +301,11 @@ void OceanTexture::make_mipmaps(SharedRenderState* render_state, ScopedProfilerN 0); glBindBuffer(GL_ARRAY_BUFFER, m_mipmap.vtx_buffer); - for (int i = 0; i < 8; i++) { + for (int i = 0; i < NUM_MIPS; i++) { FramebufferTexturePairContext ctxt(m_result_texture, i); glUniform1f(glGetUniformLocation(render_state->shaders[ShaderId::OCEAN_TEXTURE_MIPMAP].id(), "alpha_intensity"), - std::max(0.f, 1.f - 0.5f * i)); + std::max(0.f, 1.f - 0.4f * i)); glUniform1f( glGetUniformLocation(render_state->shaders[ShaderId::OCEAN_TEXTURE_MIPMAP].id(), "scale"), 1.f / (1 << i)); @@ -299,6 +313,5 @@ void OceanTexture::make_mipmaps(SharedRenderState* render_state, ScopedProfilerN prof.add_draw_call(); prof.add_tri(2); } - render_state->texture_pool->move_existing_to_vram(m_tex0_gpu, OCEAN_TEX_TBP); glBindVertexArray(0); -} \ No newline at end of file +} diff --git a/game/graphics/opengl_renderer/ocean/OceanTexture.h b/game/graphics/opengl_renderer/ocean/OceanTexture.h index dddfbb313c..52ebb7c18e 100644 --- a/game/graphics/opengl_renderer/ocean/OceanTexture.h +++ b/game/graphics/opengl_renderer/ocean/OceanTexture.h @@ -7,7 +7,7 @@ class OceanTexture { public: - OceanTexture(); + OceanTexture(bool generate_mipmaps); void handle_ocean_texture(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof); @@ -39,11 +39,13 @@ class OceanTexture { void init_pc(); void destroy_pc(); - void make_mipmaps(SharedRenderState* render_state, ScopedProfilerNode& prof); + void make_texture_with_mipmaps(SharedRenderState* render_state, ScopedProfilerNode& prof); bool m_use_ocean_specific = true; + bool m_generate_mipmaps; static constexpr int TEX0_SIZE = 128; + static constexpr int NUM_MIPS = 8; FramebufferTexturePair m_result_texture; FramebufferTexturePair m_temp_texture; GpuTexture* m_tex0_gpu = nullptr; diff --git a/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag b/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag index a75012c3fa..01dc44c7e8 100644 --- a/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag +++ b/game/graphics/opengl_renderer/shaders/direct_basic_textured.frag @@ -6,6 +6,9 @@ in vec4 fragment_color; in vec3 tex_coord; uniform float alpha_reject; uniform float color_mult; +uniform float alpha_mult; +uniform float alpha_sub; + uniform vec4 fog_color; in flat uvec4 tex_info; @@ -65,10 +68,12 @@ void main() { } color *= 2; color.xyz *= color_mult; + color.w *= alpha_mult; if (color.a < alpha_reject) { discard; } if (tex_info.w == 1) { color.xyz = mix(color.xyz, fog_color.xyz / 255., clamp(fog_color.w * (1 - fog), 0, 1)); } + } diff --git a/goal_src/engine/gfx/ocean/ocean-h.gc b/goal_src/engine/gfx/ocean/ocean-h.gc index 1716ebb049..e7d8779358 100644 --- a/goal_src/engine/gfx/ocean/ocean-h.gc +++ b/goal_src/engine/gfx/ocean/ocean-h.gc @@ -12,6 +12,8 @@ (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)) +(define-extern draw-ocean-near (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. @@ -365,23 +367,23 @@ (constants2 vector :inline :offset-assert 80) (constants3 vector :inline :offset-assert 96) (constants4 vector :inline :offset-assert 112) - (drw-fan qword :inline :offset-assert 128) - (drw2-fan qword :inline :offset-assert 144) - (env-fan qword :inline :offset-assert 160) - (drw-adgif qword :inline :offset-assert 176) + (drw-fan gs-gif-tag :inline :offset-assert 128) ;; was qword + (drw2-fan gs-gif-tag :inline :offset-assert 144) ;; was qword + (env-fan gs-gif-tag :inline :offset-assert 160) ;; was qword + (drw-adgif gs-gif-tag :inline :offset-assert 176) ;; was qword (drw-texture adgif-shader :inline :offset-assert 192) - (drw-strip qword :inline :offset-assert 272) - (env-adgif qword :inline :offset-assert 288) - (env-texture adgif-shader :inline :offset-assert 304) - (env-strip qword :inline :offset-assert 384) + (drw-strip gs-gif-tag :inline :offset-assert 272) ;; was qword + (env-adgif gs-gif-tag :inline :offset-assert 288) ;; was qword + (env-texture adgif-shader :inline :offset-assert 304) ;; was qword + (env-strip gs-gif-tag :inline :offset-assert 384) (env-color vector :inline :offset-assert 400) - (drw2-adgif qword :inline :offset-assert 416) + (drw2-adgif gs-gif-tag :inline :offset-assert 416) (drw2-tex0 qword :inline :offset-assert 432) (drw2-frame qword :inline :offset-assert 448) - (drw2-strip qword :inline :offset-assert 464) - (drw3-adgif qword :inline :offset-assert 480) + (drw2-strip gs-gif-tag :inline :offset-assert 464) + (drw3-adgif gs-gif-tag :inline :offset-assert 480) (drw3-frame qword :inline :offset-assert 496) - (index-table uint128 4 :offset-assert 512) + (index-table vector4w 4 :inline :offset-assert 512) ) :method-count-assert 9 :size-assert #x240 diff --git a/goal_src/engine/gfx/ocean/ocean-near.gc b/goal_src/engine/gfx/ocean/ocean-near.gc index 0c09b2facb..d179872e17 100644 --- a/goal_src/engine/gfx/ocean/ocean-near.gc +++ b/goal_src/engine/gfx/ocean/ocean-near.gc @@ -5,3 +5,715 @@ ;; name in dgo: ocean-near ;; dgos: GAME, ENGINE +(define ocean-near-block (new 'static 'vu-function #|:length #x3dc :qlength #x1ee|#)) + +(defun ocean-near-add-call ((arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (none) + ) + +(defun ocean-near-add-call-flush ((arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (none) + ) + +(defun ocean-near-setup-constants ((arg0 ocean-near-constants)) + (let ((v1-0 *math-camera*)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + ) + (set-vector! (-> arg0 constants) 0.5 0.5 0.0 0.000010172526) + (set-vector! (-> arg0 constants2) 0.5 0.5 1.0 128.0) + (set-vector! (-> arg0 constants3) 12288.0 0.125 2.0 0.03125) + (set-vector! (-> arg0 constants4) 2.0 255.0 3.0 0.0078125) + (let ((v1-5 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-5) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-5 1) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-5 2) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (let ((v1-14 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-14) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-14 1) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-14 2) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw2-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (let ((v1-23 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-23) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-23 1) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-23 2) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 env-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (let* ((v1-34 *ocean-base-page*) + (s4-0 *ocean-base-block*) + (s2-0 (* (+ v1-34 8) 32)) + (s3-0 (* (+ v1-34 10) 32)) + (a0-18 (-> *display* on-screen)) + (s5-0 (-> *display* frames a0-18 draw frame1 fbp)) + ) + (set! (-> arg0 drw-texture tex0) (new 'static 'gs-tex0 :tbw #x2 :th (log2 128) :tw (log2 128) :tbp0 s4-0)) + (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 drw-texture tex1) (new 'static 'gs-tex1 :mxl #x1 :mmag #x1 :mmin #x5 :l #x1 :k #xeed)) + (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 drw-texture miptbp1) + (new 'static 'gs-miptbp :tbw1 #x1 :tbw2 #x1 :tbw3 #x1 :tbp3 (+ s3-0 16) :tbp2 s3-0 :tbp1 s2-0) + ) + (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 drw-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 drw-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 drw-texture alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> arg0 drw-texture prims 9) (gs-reg64 alpha-1)) + (let ((v1-60 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-60) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-60 1) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-60 2) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 env-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (let ((s3-1 (-> arg0 env-texture))) + (adgif-shader<-texture-simple! s3-1 (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x100))) + (set! (-> s3-1 alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + ) + (let ((v1-72 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-72) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-72 1) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-72 2) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 env-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-color quad) (-> *time-of-day-context* current-sun env-color quad)) + (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw2-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw2-tex0 dword 0) + (logior (logior (logior (the-as uint #x400008000) (shr (shl s4-0 50) 50)) (shr (shl (log2 128) 60) 34)) + (shr (shl (log2 128) 60) 30) + ) + ) + (set! (-> arg0 drw2-tex0 dword 1) (the-as uint 6)) + (set! (-> arg0 drw2-frame dword 0) (logior (the-as uint #xffffff00080000) (shr (shl s5-0 55) 55))) + (set! (-> arg0 drw2-frame dword 1) (the-as uint 76)) + (let ((v1-94 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-94) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-94 1) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-94 2) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw2-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw3-adgif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw3-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw3-frame dword 0) (logior #x80000 (shr (shl s5-0 55) 55))) + ) + (set! (-> arg0 drw3-frame dword 1) (the-as uint 76)) + (set-vector! (-> arg0 index-table 0) 81 189 0 0) + (set-vector! (-> arg0 index-table 1) 54 162 0 0) + (set-vector! (-> arg0 index-table 2) 27 135 0 0) + (set-vector! (-> arg0 index-table 3) 0 108 0 0) + (none) + ) + +(defun ocean-near-add-constants ((arg0 dma-buffer)) + (let* ((a1-0 36) + (v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x3b7 :cmd (vif-cmd unpack-v4-32) :num a1-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (ocean-near-setup-constants (the-as ocean-near-constants (-> arg0 base))) + (&+! (-> arg0 base) 576) + (none) + ) + +(defun ocean-near-add-heights ((arg0 dma-buffer)) + (let ((v1-0 128) + (a1-0 (the-as object *ocean-heights*)) + ) + (let* ((a2-0 arg0) + (a3-0 (the-as object (-> a2-0 base))) + ) + (set! (-> (the-as dma-packet a3-0) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int a1-0) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a3-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a3-0) vif1) + (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> a2-0 base) (&+ (the-as pointer a3-0) 16)) + ) + (let ((a2-1 (the-as object (-> arg0 base)))) + (set! (-> (the-as dma-packet a2-1) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (+ (the-as int a1-0) 2048) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a2-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a2-1) vif1) + (new 'static 'vif-tag :imm #xa0 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> arg0 base) (&+ (the-as pointer a2-1) 16)) + ) + ) + (none) + ) + +(defun ocean-near-add-matrices ((arg0 dma-buffer) (arg1 vector)) + (let ((s5-0 (new-stack-vector0))) + (-> *math-camera* camera-rot) + (let* ((a2-0 8) + (v1-2 arg0) + (a0-1 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-2 base) (the-as pointer (&+ (the-as vector a0-1) 16))) + ) + (let ((s4-0 (the-as object (-> arg0 base)))) + (let* ((v1-3 (the-as matrix s4-0)) + (t0-2 (-> *math-camera* camera-rot)) + (a0-4 (-> t0-2 vector 0 quad)) + (a2-4 (-> t0-2 vector 1 quad)) + (a3-4 (-> t0-2 vector 2 quad)) + (t0-3 (-> t0-2 vector 3 quad)) + ) + (set! (-> v1-3 vector 0 quad) a0-4) + (set! (-> v1-3 vector 1 quad) a2-4) + (set! (-> v1-3 vector 2 quad) a3-4) + (set! (-> v1-3 vector 3 quad) t0-3) + ) + (let ((s3-0 (the-as object (&+ (the-as pointer s4-0) 48)))) + (vector-matrix*! s5-0 arg1 (-> *math-camera* camera-rot)) + (set! (-> (the-as vector s3-0) x) (-> s5-0 x)) + (set! (-> (the-as vector s3-0) y) (-> s5-0 y)) + (set! (-> (the-as vector s3-0) z) (-> s5-0 z)) + ) + (let ((a0-6 (&+ (-> arg0 base) 64))) + (ocean-matrix*! (the-as matrix a0-6) (the-as matrix s4-0) (-> *math-camera* perspective)) + ) + ) + ) + (&+! (-> arg0 base) 128) + (none) + ) + +(defun ocean-near-add-upload ((arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (r0-3 int) + (r0-4 int) + (v1-17 uint128) + (v1-18 uint128) + (v1-19 float) + (a0-18 uint128) + (a0-19 uint128) + (a0-20 uint128) + (a2-23 float) + (a2-30 uint128) + (a2-31 uint128) + (a3-27 uint128) + (f31-0 none) + ) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :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 ((s2-0 (-> *ocean-work* mid-minx)) + (s3-0 (-> *ocean-work* mid-minz)) + ) + (let ((a1-1 (new-stack-vector0))) + (let ((v1-3 (-> *ocean-map* start-corner))) + (set! (-> a1-1 x) (+ (-> v1-3 x) (* 98304.0 (the float arg2)))) + (set! (-> a1-1 y) (-> v1-3 y)) + (set! (-> a1-1 z) (+ (-> v1-3 z) (* 98304.0 (the float arg1)))) + ) + (set! (-> a1-1 w) 1.0) + (ocean-near-add-matrices arg0 a1-1) + ) + (let* ((a1-2 8) + (v1-5 arg0) + (a0-2 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-2)) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-2) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-2) + ) + (set! (-> v1-5 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-6 (-> arg0 base)) + (a0-5 (- arg2 (* s2-0 4))) + (a1-7 (- arg1 (* s3-0 4))) + (a2-5 (shr a0-5 2)) + (a3-2 (shr a1-7 2)) + (a0-6 (logand a0-5 3)) + (a1-8 (logand a1-7 3)) + (a2-9 (-> (the-as (pointer int16) (+ (* (+ (* a3-2 4) a2-5) 2) (the-as uint *ocean-work*))) 1550)) + (a3-8 (-> *ocean-map* ocean-near-indices data a2-9)) + (a0-12 + (-> *ocean-map* + ocean-mid-masks + data + (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-6) 2) (the-as uint a3-8)))) + ) + ) + ) + (set-vector! + (the-as vector4w (&+ v1-6 0)) + (the-as int (-> a0-12 mask 0)) + (the-as int (-> a0-12 mask 1)) + (the-as int (-> a0-12 mask 2)) + (the-as int (-> a0-12 mask 3)) + ) + (set-vector! + (the-as vector4w (&+ v1-6 16)) + (the-as int (-> a0-12 mask 4)) + (the-as int (-> a0-12 mask 5)) + (the-as int (-> a0-12 mask 6)) + (the-as int (-> a0-12 mask 7)) + ) + ) + ) + (&+! (-> arg0 base) 32) + (let ((a0-14 (/ (the-as int arg2) 4)) + (v1-10 (/ (the-as int arg1) 4)) + (a2-18 (logand arg2 3)) + (a3-9 (logand arg1 3)) + ) + (let ((t0-0 (-> arg0 base)) + (a1-15 (logand (+ arg2 1) 3)) + (t1-1 (logand (+ arg1 1) 3)) + ) + (set-vector! + (the-as vector4w (&+ t0-0 0)) + (the-as int (+ (* a3-9 64) (* a2-18 2))) + (the-as int (+ (* a3-9 64) (* a1-15 2))) + (the-as int (+ (* t1-1 64) (* a2-18 2))) + (the-as int (+ (* t1-1 64) (* a1-15 2))) + ) + ) + (&+! (-> arg0 base) 16) + (set-vector! + (the-as vector (&+ (-> arg0 base) 0)) + (* 0.25 (the float a2-18)) + (* 0.25 (the float a3-9)) + 1.0 + 0.0 + ) + (&+! (-> arg0 base) 16) + (let ((a1-24 (the-as object (-> arg0 base)))) + (let ((a2-19 (+ (* 5 (the-as int a3-9)) a2-18))) + (.lvf vf5 (&-> (&-> *ocean-trans-corner-table* 0 quad a2-19) 0)) + (.lvf vf6 (&-> (&-> *ocean-trans-corner-table* 0 quad (+ a2-19 1)) 0)) + (.lvf vf7 (&-> (&-> *ocean-trans-corner-table* 0 quad (+ a2-19 5)) 0)) + (.lvf vf8 (&-> (&-> *ocean-trans-corner-table* 0 quad (+ a2-19 6)) 0)) + ) + (.mov a2-23 vf8) + (let ((a2-29 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ (* 52 v1-10) a0-14)))) + (a3-26 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ a0-14 1 (* 52 v1-10))))) + (t0-15 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ (* 52 (+ v1-10 1)) a0-14)))) + (v1-16 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ a0-14 1 (* 52 (+ v1-10 1)))))) + ) + (.pextlb a0-18 0 a2-29) + (.mov r0-0 f31-0) + (.pextlb a2-30 0 a3-26) + (.mov r0-1 f31-0) + (.pextlb a3-27 0 t0-15) + (.mov r0-2 f31-0) + (.pextlb v1-17 0 v1-16) + ) + (.mov r0-3 f31-0) + (.pextlh a0-19 0 a0-18) + (.mov r0-4 f31-0) + (.pextlh a2-31 0 a2-30) + (.mov vf1 a0-19) + (.pextlh a0-20 0 a3-27) + (.mov vf2 a2-31) + (.pextlh v1-18 0 v1-17) + (.mov vf3 a0-20) + (nop!) + (.mov vf4 v1-18) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> (the-as (inline-array vector) a1-24) 0 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> (the-as (inline-array vector) a1-24) 1 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> (the-as (inline-array vector) a1-24) 2 quad) vf11) + (nop!) + (.svf (&-> (the-as (inline-array vector) a1-24) 3 quad) vf12) + ) + ) + (.mov v1-19 vf12) + (&+! (-> arg0 base) 64) + (none) + ) + ) + +(defun draw-ocean-near ((arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ (the-as dma-packet a0-1) 16))) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) + (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-1 base) (the-as pointer (the-as dma-packet (&+ (the-as pointer a0-3) 16)))) + ) + (let* ((v1-2 arg0) + (a0-5 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as (pointer gs-test) a0-5) 0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 test-1)) + (set! (-> v1-2 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-5) 16)))) + ) + (dma-buffer-add-vu-function arg0 ocean-near-block 1) + (let* ((v1-3 arg0) + (a0-8 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-8) vif1) (new 'static 'vif-tag :imm #x10 :cmd (vif-cmd offset))) + (set! (-> v1-3 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-8) 16)))) + ) + (ocean-near-add-constants arg0) + (ocean-near-add-heights arg0) + (ocean-near-add-call arg0 0) + (let ((s5-0 (-> *ocean-work* near-minx)) + (s4-0 (-> *ocean-work* near-maxx)) + (s3-0 (-> *ocean-work* near-minz)) + (s2-0 (-> *ocean-work* near-maxz)) + ) + (when (and (< s5-0 s4-0) (< s3-0 s2-0)) + (while (>= s2-0 s3-0) + (let ((s1-0 s5-0) + (s0-0 s4-0) + ) + (while (>= s0-0 s1-0) + (when (ocean-trans-camera-masks-bit? s3-0 s1-0) + (let* ((a1-13 (- (shr s1-0 2) (-> *ocean-work* mid-minx))) + (a2-1 (- (shr s3-0 2) (-> *ocean-work* mid-minz))) + (v1-13 (logand s1-0 3)) + (a0-19 (logand s3-0 3)) + (a1-17 (-> (the-as (pointer int16) (+ (* (+ (* a2-1 4) a1-13) 2) (the-as uint *ocean-work*))) 1550)) + ) + (when (>= a1-17 0) + (let ((a1-19 (-> *ocean-map* ocean-near-indices data a1-17))) + (when (>= (-> (the-as (pointer int16) (+ (* (+ (* a0-19 4) v1-13) 2) (the-as uint a1-19)))) 0) + (ocean-near-add-upload arg0 s3-0 s1-0) + (ocean-near-add-call arg0 39) + ) + ) + ) + ) + ) + (+! s1-0 1) + ) + ) + (+! s3-0 1) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/goal_src/engine/gfx/ocean/ocean.gc b/goal_src/engine/gfx/ocean/ocean.gc index affbb05562..8d27c5bea0 100644 --- a/goal_src/engine/gfx/ocean/ocean.gc +++ b/goal_src/engine/gfx/ocean/ocean.gc @@ -668,28 +668,27 @@ ) ) (when (not (or *ocean-near-off* (or *ocean-mid-off* (< 196608.0 (fabs (-> *math-camera* trans y)))))) - ; (format *stdcon* "draw near~%") - ; (let* ((s5-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) - ; (gp-2 (-> s5-1 base)) - ; ) - ; (draw-ocean-texture s5-1 *ocean-verts* #f) - ; (draw-ocean-near s5-1) - ; (ocean-end-buffer s5-1) - ; (let ((a3-1 (-> s5-1 base))) - ; (let ((v1-46 (the-as object (-> s5-1 base)))) - ; (set! (-> (the-as dma-packet v1-46) dma) (new 'static 'dma-tag :id (dma-tag-id next))) - ; (set! (-> (the-as dma-packet v1-46) vif0) (new 'static 'vif-tag)) - ; (set! (-> (the-as dma-packet v1-46) vif1) (new 'static 'vif-tag)) - ; (set! (-> s5-1 base) (&+ (the-as pointer v1-46) 16)) - ; ) - ; (dma-bucket-insert-tag - ; (-> *display* frames (-> *display* on-screen) frame bucket-group) - ; (bucket-id bucket-63) - ; gp-2 - ; (the-as (pointer dma-tag) a3-1) - ; ) - ; ) - ; ) + (let* ((s5-1 (-> *display* frames (-> *display* on-screen) frame global-buf)) + (gp-2 (-> s5-1 base)) + ) + (draw-ocean-texture s5-1 *ocean-verts* #f) + (draw-ocean-near s5-1) + (ocean-end-buffer s5-1) + (let ((a3-1 (-> s5-1 base))) + (let ((v1-46 (the-as object (-> s5-1 base)))) + (set! (-> (the-as dma-packet v1-46) dma) (new 'static 'dma-tag :id (dma-tag-id next))) + (set! (-> (the-as dma-packet v1-46) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet v1-46) vif1) (new 'static 'vif-tag)) + (set! (-> s5-1 base) (&+ (the-as pointer v1-46) 16)) + ) + (dma-bucket-insert-tag + (-> *display* frames (-> *display* on-screen) frame bucket-group) + (bucket-id bucket-63) + gp-2 + (the-as (pointer dma-tag) a3-1) + ) + ) + ) ) ) ) diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-h_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-h_REF.gc index 0f8042316e..661f55b220 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-h_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-h_REF.gc @@ -684,31 +684,31 @@ ;; definition of type ocean-near-constants (deftype ocean-near-constants (structure) - ((hmge-scale vector :inline :offset-assert 0) - (inv-hmge-scale vector :inline :offset-assert 16) - (hvdf-offset vector :inline :offset-assert 32) - (fog vector :inline :offset-assert 48) - (constants vector :inline :offset-assert 64) - (constants2 vector :inline :offset-assert 80) - (constants3 vector :inline :offset-assert 96) - (constants4 vector :inline :offset-assert 112) - (drw-fan qword :inline :offset-assert 128) - (drw2-fan qword :inline :offset-assert 144) - (env-fan qword :inline :offset-assert 160) - (drw-adgif qword :inline :offset-assert 176) - (drw-texture adgif-shader :inline :offset-assert 192) - (drw-strip qword :inline :offset-assert 272) - (env-adgif qword :inline :offset-assert 288) - (env-texture adgif-shader :inline :offset-assert 304) - (env-strip qword :inline :offset-assert 384) - (env-color vector :inline :offset-assert 400) - (drw2-adgif qword :inline :offset-assert 416) - (drw2-tex0 qword :inline :offset-assert 432) - (drw2-frame qword :inline :offset-assert 448) - (drw2-strip qword :inline :offset-assert 464) - (drw3-adgif qword :inline :offset-assert 480) - (drw3-frame qword :inline :offset-assert 496) - (index-table uint128 4 :offset-assert 512) + ((hmge-scale vector :inline :offset-assert 0) + (inv-hmge-scale vector :inline :offset-assert 16) + (hvdf-offset vector :inline :offset-assert 32) + (fog vector :inline :offset-assert 48) + (constants vector :inline :offset-assert 64) + (constants2 vector :inline :offset-assert 80) + (constants3 vector :inline :offset-assert 96) + (constants4 vector :inline :offset-assert 112) + (drw-fan gs-gif-tag :inline :offset-assert 128) + (drw2-fan gs-gif-tag :inline :offset-assert 144) + (env-fan gs-gif-tag :inline :offset-assert 160) + (drw-adgif gs-gif-tag :inline :offset-assert 176) + (drw-texture adgif-shader :inline :offset-assert 192) + (drw-strip gs-gif-tag :inline :offset-assert 272) + (env-adgif gs-gif-tag :inline :offset-assert 288) + (env-texture adgif-shader :inline :offset-assert 304) + (env-strip gs-gif-tag :inline :offset-assert 384) + (env-color vector :inline :offset-assert 400) + (drw2-adgif gs-gif-tag :inline :offset-assert 416) + (drw2-tex0 qword :inline :offset-assert 432) + (drw2-frame qword :inline :offset-assert 448) + (drw2-strip gs-gif-tag :inline :offset-assert 464) + (drw3-adgif gs-gif-tag :inline :offset-assert 480) + (drw3-frame qword :inline :offset-assert 496) + (index-table vector4w 4 :inline :offset-assert 512) ) :method-count-assert 9 :size-assert #x240 diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc new file mode 100644 index 0000000000..159b9b2b7c --- /dev/null +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-near_REF.gc @@ -0,0 +1,736 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol ocean-near-block, type vu-function +(define ocean-near-block (new 'static 'vu-function :length #x3dc :qlength #x1ee)) + +;; definition for function ocean-near-add-call +;; INFO: Return type mismatch pointer vs none. +(defun ocean-near-add-call ((arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd stmod))) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (none) + ) + +;; definition for function ocean-near-add-call-flush +;; INFO: Return type mismatch pointer vs none. +(defun ocean-near-add-call-flush ((arg0 dma-buffer) (arg1 int)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :cmd (vif-cmd mscalf) :msk #x1 :imm arg1)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1)) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (none) + ) + +;; definition for function ocean-near-setup-constants +;; INFO: Return type mismatch vector4w vs none. +;; Used lq/sq +(defun ocean-near-setup-constants ((arg0 ocean-near-constants)) + (let ((v1-0 *math-camera*)) + (set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad)) + (set! (-> arg0 inv-hmge-scale quad) (-> v1-0 inv-hmge-scale quad)) + (set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad)) + (set-vector! (-> arg0 fog) (-> v1-0 pfog0) (-> v1-0 fog-min) (-> v1-0 fog-max) 3072.0) + ) + (set-vector! (-> arg0 constants) 0.5 0.5 0.0 0.000010172526) + (set-vector! (-> arg0 constants2) 0.5 0.5 1.0 128.0) + (set-vector! (-> arg0 constants3) 12288.0 0.125 2.0 0.03125) + (set-vector! (-> arg0 constants4) 2.0 255.0 3.0 0.0078125) + (let ((v1-5 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-5) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-5 1) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-5 2) + (set! (-> arg0 drw-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (let ((v1-14 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-14) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-14 1) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-14 2) + (set! (-> arg0 drw2-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw2-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (let ((v1-23 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-23) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-23 1) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-23 2) + (set! (-> arg0 env-fan tag) + (new 'static 'gif-tag64 + :nloop #x4 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 env-fan regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 drw-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (let* ((v1-34 *ocean-base-page*) + (s4-0 *ocean-base-block*) + (s2-0 (* (+ v1-34 8) 32)) + (s3-0 (* (+ v1-34 10) 32)) + (a0-18 (-> *display* on-screen)) + (s5-0 (-> *display* frames a0-18 draw frame1 fbp)) + ) + (set! (-> arg0 drw-texture tex0) (new 'static 'gs-tex0 :tbw #x2 :th (log2 128) :tw (log2 128) :tbp0 s4-0)) + (set! (-> arg0 drw-texture prims 1) (gs-reg64 tex0-1)) + (set! (-> arg0 drw-texture tex1) (new 'static 'gs-tex1 :mxl #x1 :mmag #x1 :mmin #x5 :l #x1 :k #xeed)) + (set! (-> arg0 drw-texture prims 3) (gs-reg64 tex1-1)) + (set! (-> arg0 drw-texture miptbp1) + (new 'static 'gs-miptbp :tbw1 #x1 :tbw2 #x1 :tbw3 #x1 :tbp3 (+ s3-0 16) :tbp2 s3-0 :tbp1 s2-0) + ) + (set! (-> arg0 drw-texture prims 5) (gs-reg64 miptbp1-1)) + (set! (-> arg0 drw-texture clamp) (new 'static 'gs-clamp)) + (set! (-> arg0 drw-texture clamp-reg) (gs-reg64 clamp-1)) + (set! (-> arg0 drw-texture alpha) (new 'static 'gs-alpha :b #x1 :d #x1)) + (set! (-> arg0 drw-texture prims 9) (gs-reg64 alpha-1)) + (let ((v1-60 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-60) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-60 1) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-60 2) + (set! (-> arg0 drw-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1)) + (set! (-> arg0 env-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (let ((s3-1 (-> arg0 env-texture))) + (adgif-shader<-texture-simple! s3-1 (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #x100))) + (set! (-> s3-1 alpha) (new 'static 'gs-alpha :b #x2 :c #x1 :d #x1)) + ) + (let ((v1-72 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-72) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-72 1) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-72 2) + (set! (-> arg0 env-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 env-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 env-color quad) (-> *time-of-day-context* current-sun env-color quad)) + (set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw2-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw2-tex0 dword 0) + (logior (logior (logior (the-as uint #x400008000) (shr (shl s4-0 50) 50)) (shr (shl (log2 128) 60) 34)) + (shr (shl (log2 128) 60) 30) + ) + ) + (set! (-> arg0 drw2-tex0 dword 1) (the-as uint 6)) + (set! (-> arg0 drw2-frame dword 0) (logior (the-as uint #xffffff00080000) (shr (shl s5-0 55) 55))) + (set! (-> arg0 drw2-frame dword 1) (the-as uint 76)) + (let ((v1-94 *ocean-subdivide-draw-mode*)) + (cond + ((zero? v1-94) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-94 1) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ((= v1-94 2) + (set! (-> arg0 drw2-strip tag) + (new 'static 'gif-tag64 + :nloop #x12 + :eop #x1 + :pre #x1 + :prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :abe #x1) + :nreg #x3 + ) + ) + ) + ) + ) + (set! (-> arg0 drw2-strip regs) + (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2)) + ) + (set! (-> arg0 drw3-adgif tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> arg0 drw3-adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))) + (set! (-> arg0 drw3-frame dword 0) (logior #x80000 (shr (shl s5-0 55) 55))) + ) + (set! (-> arg0 drw3-frame dword 1) (the-as uint 76)) + (set-vector! (-> arg0 index-table 0) 81 189 0 0) + (set-vector! (-> arg0 index-table 1) 54 162 0 0) + (set-vector! (-> arg0 index-table 2) 27 135 0 0) + (set-vector! (-> arg0 index-table 3) 0 108 0 0) + (none) + ) + +;; definition for function ocean-near-add-constants +;; INFO: Return type mismatch pointer vs none. +(defun ocean-near-add-constants ((arg0 dma-buffer)) + (let* ((a1-0 36) + (v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x3b7 :cmd (vif-cmd unpack-v4-32) :num a1-0) + ) + (set! (-> v1-0 base) (&+ (the-as pointer a0-1) 16)) + ) + (ocean-near-setup-constants (the-as ocean-near-constants (-> arg0 base))) + (&+! (-> arg0 base) 576) + (none) + ) + +;; definition for function ocean-near-add-heights +;; INFO: Return type mismatch pointer vs none. +(defun ocean-near-add-heights ((arg0 dma-buffer)) + (let ((v1-0 128) + (a1-0 (the-as object *ocean-heights*)) + ) + (let* ((a2-0 arg0) + (a3-0 (the-as object (-> a2-0 base))) + ) + (set! (-> (the-as dma-packet a3-0) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (the-as int a1-0) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a3-0) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a3-0) vif1) + (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> a2-0 base) (&+ (the-as pointer a3-0) 16)) + ) + (let ((a2-1 (the-as object (-> arg0 base)))) + (set! (-> (the-as dma-packet a2-1) dma) + (new 'static 'dma-tag :id (dma-tag-id ref) :addr (+ (the-as int a1-0) 2048) :qwc v1-0) + ) + (set! (-> (the-as dma-packet a2-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a2-1) vif1) + (new 'static 'vif-tag :imm #xa0 :cmd (vif-cmd unpack-v4-32) :num v1-0) + ) + (set! (-> arg0 base) (&+ (the-as pointer a2-1) 16)) + ) + ) + (none) + ) + +;; definition for function ocean-near-add-matrices +;; INFO: Return type mismatch pointer vs none. +;; Used lq/sq +(defun ocean-near-add-matrices ((arg0 dma-buffer) (arg1 vector)) + (let ((s5-0 (new-stack-vector0))) + (-> *math-camera* camera-rot) + (let* ((a2-0 8) + (v1-2 arg0) + (a0-1 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0)) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-1) vif1) + (new 'static 'vif-tag :imm #x8000 :cmd (vif-cmd unpack-v4-32) :num a2-0) + ) + (set! (-> v1-2 base) (the-as pointer (&+ (the-as vector a0-1) 16))) + ) + (let ((s4-0 (the-as object (-> arg0 base)))) + (let* ((v1-3 (the-as matrix s4-0)) + (t0-2 (-> *math-camera* camera-rot)) + (a0-4 (-> t0-2 vector 0 quad)) + (a2-4 (-> t0-2 vector 1 quad)) + (a3-4 (-> t0-2 vector 2 quad)) + (t0-3 (-> t0-2 vector 3 quad)) + ) + (set! (-> v1-3 vector 0 quad) a0-4) + (set! (-> v1-3 vector 1 quad) a2-4) + (set! (-> v1-3 vector 2 quad) a3-4) + (set! (-> v1-3 vector 3 quad) t0-3) + ) + (let ((s3-0 (the-as object (&+ (the-as pointer s4-0) 48)))) + (vector-matrix*! s5-0 arg1 (-> *math-camera* camera-rot)) + (set! (-> (the-as vector s3-0) x) (-> s5-0 x)) + (set! (-> (the-as vector s3-0) y) (-> s5-0 y)) + (set! (-> (the-as vector s3-0) z) (-> s5-0 z)) + ) + (let ((a0-6 (&+ (-> arg0 base) 64))) + (ocean-matrix*! (the-as matrix a0-6) (the-as matrix s4-0) (-> *math-camera* perspective)) + ) + ) + ) + (&+! (-> arg0 base) 128) + (none) + ) + +;; definition for function ocean-near-add-upload +;; INFO: Return type mismatch pointer vs none. +;; WARN: Function may read a register that is not set: f31 +;; Used lq/sq +(defun ocean-near-add-upload ((arg0 dma-buffer) (arg1 uint) (arg2 uint)) + (local-vars + (r0-0 int) + (r0-1 int) + (r0-2 int) + (r0-3 int) + (r0-4 int) + (v1-17 uint128) + (v1-18 uint128) + (v1-19 float) + (a0-18 uint128) + (a0-19 uint128) + (a0-20 uint128) + (a2-23 float) + (a2-30 uint128) + (a2-31 uint128) + (a3-27 uint128) + (f31-0 none) + ) + (rlet ((acc :class vf) + (vf1 :class vf) + (vf10 :class vf) + (vf11 :class vf) + (vf12 :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 ((s2-0 (-> *ocean-work* mid-minx)) + (s3-0 (-> *ocean-work* mid-minz)) + ) + (let ((a1-1 (new-stack-vector0))) + (let ((v1-3 (-> *ocean-map* start-corner))) + (set! (-> a1-1 x) (+ (-> v1-3 x) (* 98304.0 (the float arg2)))) + (set! (-> a1-1 y) (-> v1-3 y)) + (set! (-> a1-1 z) (+ (-> v1-3 z) (* 98304.0 (the float arg1)))) + ) + (set! (-> a1-1 w) 1.0) + (ocean-near-add-matrices arg0 a1-1) + ) + (let* ((a1-2 8) + (v1-5 arg0) + (a0-2 (the-as object (-> v1-5 base))) + ) + (set! (-> (the-as dma-packet a0-2) dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a1-2)) + (set! (-> (the-as dma-packet a0-2) vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))) + (set! (-> (the-as dma-packet a0-2) vif1) + (new 'static 'vif-tag :imm #x8008 :cmd (vif-cmd unpack-v4-32) :num a1-2) + ) + (set! (-> v1-5 base) (&+ (the-as pointer a0-2) 16)) + ) + (let* ((v1-6 (-> arg0 base)) + (a0-5 (- arg2 (* s2-0 4))) + (a1-7 (- arg1 (* s3-0 4))) + (a2-5 (shr a0-5 2)) + (a3-2 (shr a1-7 2)) + (a0-6 (logand a0-5 3)) + (a1-8 (logand a1-7 3)) + (a2-9 (-> (the-as (pointer int16) (+ (* (+ (* a3-2 4) a2-5) 2) (the-as uint *ocean-work*))) 1550)) + (a3-8 (-> *ocean-map* ocean-near-indices data a2-9)) + (a0-12 + (-> *ocean-map* + ocean-mid-masks + data + (-> (the-as (pointer int16) (+ (* (+ (* a1-8 4) a0-6) 2) (the-as uint a3-8)))) + ) + ) + ) + (set-vector! + (the-as vector4w (&+ v1-6 0)) + (the-as int (-> a0-12 mask 0)) + (the-as int (-> a0-12 mask 1)) + (the-as int (-> a0-12 mask 2)) + (the-as int (-> a0-12 mask 3)) + ) + (set-vector! + (the-as vector4w (&+ v1-6 16)) + (the-as int (-> a0-12 mask 4)) + (the-as int (-> a0-12 mask 5)) + (the-as int (-> a0-12 mask 6)) + (the-as int (-> a0-12 mask 7)) + ) + ) + ) + (&+! (-> arg0 base) 32) + (let ((a0-14 (/ (the-as int arg2) 4)) + (v1-10 (/ (the-as int arg1) 4)) + (a2-18 (logand arg2 3)) + (a3-9 (logand arg1 3)) + ) + (let ((t0-0 (-> arg0 base)) + (a1-15 (logand (+ arg2 1) 3)) + (t1-1 (logand (+ arg1 1) 3)) + ) + (set-vector! + (the-as vector4w (&+ t0-0 0)) + (the-as int (+ (* a3-9 64) (* a2-18 2))) + (the-as int (+ (* a3-9 64) (* a1-15 2))) + (the-as int (+ (* t1-1 64) (* a2-18 2))) + (the-as int (+ (* t1-1 64) (* a1-15 2))) + ) + ) + (&+! (-> arg0 base) 16) + (set-vector! + (the-as vector (&+ (-> arg0 base) 0)) + (* 0.25 (the float a2-18)) + (* 0.25 (the float a3-9)) + 1.0 + 0.0 + ) + (&+! (-> arg0 base) 16) + (let ((a1-24 (the-as object (-> arg0 base)))) + (let ((a2-19 (+ (* 5 (the-as int a3-9)) a2-18))) + (.lvf vf5 (&-> (&-> *ocean-trans-corner-table* 0 quad a2-19) 0)) + (.lvf vf6 (&-> (&-> *ocean-trans-corner-table* 0 quad (+ a2-19 1)) 0)) + (.lvf vf7 (&-> (&-> *ocean-trans-corner-table* 0 quad (+ a2-19 5)) 0)) + (.lvf vf8 (&-> (&-> *ocean-trans-corner-table* 0 quad (+ a2-19 6)) 0)) + ) + (.mov a2-23 vf8) + (let ((a2-29 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ (* 52 v1-10) a0-14)))) + (a3-26 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ a0-14 1 (* 52 v1-10))))) + (t0-15 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ (* 52 (+ v1-10 1)) a0-14)))) + (v1-16 (the-as uint128 (-> *ocean-map* ocean-colors colors (+ a0-14 1 (* 52 (+ v1-10 1)))))) + ) + (.pextlb a0-18 0 a2-29) + (.mov r0-0 f31-0) + (.pextlb a2-30 0 a3-26) + (.mov r0-1 f31-0) + (.pextlb a3-27 0 t0-15) + (.mov r0-2 f31-0) + (.pextlb v1-17 0 v1-16) + ) + (.mov r0-3 f31-0) + (.pextlh a0-19 0 a0-18) + (.mov r0-4 f31-0) + (.pextlh a2-31 0 a2-30) + (.mov vf1 a0-19) + (.pextlh a0-20 0 a3-27) + (.mov vf2 a2-31) + (.pextlh v1-18 0 v1-17) + (.mov vf3 a0-20) + (nop!) + (.mov vf4 v1-18) + (.itof.vf vf1 vf1) + (nop!) + (.itof.vf vf2 vf2) + (nop!) + (.itof.vf vf3 vf3) + (nop!) + (.itof.vf vf4 vf4) + (nop!) + (.mul.x.vf acc vf1 vf5) + (nop!) + (.add.mul.y.vf acc vf2 vf5 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf5 acc) + (nop!) + (.add.mul.w.vf vf9 vf4 vf5 acc) + (nop!) + (.mul.x.vf acc vf1 vf6) + (nop!) + (.add.mul.y.vf acc vf2 vf6 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf6 acc) + (nop!) + (.add.mul.w.vf vf10 vf4 vf6 acc) + (.svf (&-> (the-as (inline-array vector) a1-24) 0 quad) vf9) + (.mul.x.vf acc vf1 vf7) + (nop!) + (.add.mul.y.vf acc vf2 vf7 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf7 acc) + (nop!) + (.add.mul.w.vf vf11 vf4 vf7 acc) + (.svf (&-> (the-as (inline-array vector) a1-24) 1 quad) vf10) + (.mul.x.vf acc vf1 vf8) + (nop!) + (.add.mul.y.vf acc vf2 vf8 acc) + (nop!) + (.add.mul.z.vf acc vf3 vf8 acc) + (nop!) + (.add.mul.w.vf vf12 vf4 vf8 acc) + (.svf (&-> (the-as (inline-array vector) a1-24) 2 quad) vf11) + (nop!) + (.svf (&-> (the-as (inline-array vector) a1-24) 3 quad) vf12) + ) + ) + (.mov v1-19 vf12) + (&+! (-> arg0 base) 64) + (none) + ) + ) + +;; definition for function draw-ocean-near +;; INFO: Return type mismatch int vs none. +(defun draw-ocean-near ((arg0 dma-buffer)) + (let* ((v1-0 arg0) + (a0-1 (the-as object (-> v1-0 base))) + ) + (set! (-> (the-as dma-packet a0-1) dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-1) vif0) (new 'static 'vif-tag)) + (set! (-> (the-as dma-packet a0-1) vif1) (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)) + (set! (-> v1-0 base) (the-as pointer (&+ (the-as dma-packet a0-1) 16))) + ) + (let* ((v1-1 arg0) + (a0-3 (the-as object (-> v1-1 base))) + ) + (set! (-> (the-as gs-gif-tag a0-3) tag) (new 'static 'gif-tag64 :nloop #x1 :eop #x1 :nreg #x1)) + (set! (-> (the-as gs-gif-tag a0-3) regs) + (new 'static 'gif-tag-regs + :regs0 (gif-reg-id a+d) + :regs1 (gif-reg-id a+d) + :regs2 (gif-reg-id a+d) + :regs3 (gif-reg-id a+d) + :regs4 (gif-reg-id a+d) + :regs5 (gif-reg-id a+d) + :regs6 (gif-reg-id a+d) + :regs7 (gif-reg-id a+d) + :regs8 (gif-reg-id a+d) + :regs9 (gif-reg-id a+d) + :regs10 (gif-reg-id a+d) + :regs11 (gif-reg-id a+d) + :regs12 (gif-reg-id a+d) + :regs13 (gif-reg-id a+d) + :regs14 (gif-reg-id a+d) + :regs15 (gif-reg-id a+d) + ) + ) + (set! (-> v1-1 base) (the-as pointer (the-as dma-packet (&+ (the-as pointer a0-3) 16)))) + ) + (let* ((v1-2 arg0) + (a0-5 (the-as object (-> v1-2 base))) + ) + (set! (-> (the-as (pointer gs-test) a0-5) 0) + (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal)) + ) + (set! (-> (the-as (pointer gs-reg64) a0-5) 1) (gs-reg64 test-1)) + (set! (-> v1-2 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-5) 16)))) + ) + (dma-buffer-add-vu-function arg0 ocean-near-block 1) + (let* ((v1-3 arg0) + (a0-8 (the-as object (-> v1-3 base))) + ) + (set! (-> (the-as dma-packet a0-8) dma) (new 'static 'dma-tag :id (dma-tag-id cnt))) + (set! (-> (the-as dma-packet a0-8) vif0) (new 'static 'vif-tag :cmd (vif-cmd base))) + (set! (-> (the-as dma-packet a0-8) vif1) (new 'static 'vif-tag :imm #x10 :cmd (vif-cmd offset))) + (set! (-> v1-3 base) (the-as pointer (the-as dma-packet (&+ (the-as dma-packet a0-8) 16)))) + ) + (ocean-near-add-constants arg0) + (ocean-near-add-heights arg0) + (ocean-near-add-call arg0 0) + (let ((s5-0 (-> *ocean-work* near-minx)) + (s4-0 (-> *ocean-work* near-maxx)) + (s3-0 (-> *ocean-work* near-minz)) + (s2-0 (-> *ocean-work* near-maxz)) + ) + (when (and (< s5-0 s4-0) (< s3-0 s2-0)) + (while (>= s2-0 s3-0) + (let ((s1-0 s5-0) + (s0-0 s4-0) + ) + (while (>= s0-0 s1-0) + (when (ocean-trans-camera-masks-bit? s3-0 s1-0) + (let* ((a1-13 (- (shr s1-0 2) (-> *ocean-work* mid-minx))) + (a2-1 (- (shr s3-0 2) (-> *ocean-work* mid-minz))) + (v1-13 (logand s1-0 3)) + (a0-19 (logand s3-0 3)) + (a1-17 (-> (the-as (pointer int16) (+ (* (+ (* a2-1 4) a1-13) 2) (the-as uint *ocean-work*))) 1550)) + ) + (when (>= a1-17 0) + (let ((a1-19 (-> *ocean-map* ocean-near-indices data a1-17))) + (when (>= (-> (the-as (pointer int16) (+ (* (+ (* a0-19 4) v1-13) 2) (the-as uint a1-19)))) 0) + (ocean-near-add-upload arg0 s3-0 s1-0) + (ocean-near-add-call arg0 39) + ) + ) + ) + ) + ) + (+! s1-0 1) + ) + ) + (+! s3-0 1) + ) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/test_VuDisasm.cpp b/test/decompiler/test_VuDisasm.cpp index 54910c9c8b..7dcbf8d892 100644 --- a/test/decompiler/test_VuDisasm.cpp +++ b/test/decompiler/test_VuDisasm.cpp @@ -108,17 +108,27 @@ TEST(VuDisasm, OceanTexture) { TEST(VuDisasm, OceanMid) { auto data = get_test_data("ocean-mid"); VuDisassembler disasm(VuDisassembler::VuKind::VU1); + /* + disasm.add_label_with_name(41, "JUMP_41"); + disasm.add_label_with_name(43, "JUMP_43"); + disasm.add_label_with_name(46, "JUMP_46"); + disasm.add_label_with_name(73, "JUMP_73"); + disasm.add_label_with_name(107, "JUMP_107"); + disasm.add_label_with_name(275, "JUMP_275"); + */ + 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, OceanNear) { + auto data = get_test_data("ocean-near"); + VuDisassembler disasm(VuDisassembler::VuKind::VU1); + // disasm.add_label_with_name(39, "JUMP_39"); + auto prog = disasm.disassemble(data.data(), data.size() * 4, false); + // fmt::print("{}\n", disasm.to_string_with_cpp(prog, false)); + EXPECT_EQ(disasm.to_string(prog), get_expected("ocean-near")); +} TEST(VuDisasm, Sky) { auto data = get_test_data("sky"); diff --git a/test/decompiler/vu_reference/ocean-near-result.txt b/test/decompiler/vu_reference/ocean-near-result.txt new file mode 100644 index 0000000000..0aaa96e532 --- /dev/null +++ b/test/decompiler/vu_reference/ocean-near-result.txt @@ -0,0 +1,1045 @@ + lq.xyzw vf01, 951(vi00) | nop + lq.xyzw vf02, 953(vi00) | nop + lq.xyzw vf03, 954(vi00) | nop + lq.xyzw vf05, 955(vi00) | nop + lq.xyzw vf06, 956(vi00) | nop + iaddiu vi09, vi00, 0x213 | nop + iaddi vi01, vi00, 0x6 | nop +L1: + lq.xyzw vf12, 962(vi01) | nop + lq.xyzw vf13, 969(vi01) | nop + sq.xyzw vf12, 531(vi01) | nop + sq.xyzw vf12, 671(vi01) | nop + sq.xyzw vf13, 592(vi01) | nop + sq.xyzw vf13, 732(vi01) | nop + sq.xyzw vf12, 811(vi01) | nop + sq.xyzw vf12, 881(vi01) | nop + sq.xyzw vf13, 846(vi01) | nop + sq.xyzw vf13, 916(vi01) | nop + ibgtz vi01, L1 | nop + iaddi vi01, vi01, -0x1 | nop + lq.xyzw vf08, 976(vi00) | nop + iaddi vi04, vi00, 0x8 | nop + iaddiu vi06, vi00, 0x11 | ftoi0.xyzw vf08, vf08 +L2: + sq.xyzw vf08, 592(vi04) | nop + sq.xyzw vf08, 732(vi04) | nop + iaddi vi04, vi04, 0x3 | nop + ibgtz vi06, L2 | nop + iaddi vi06, vi06, -0x1 | nop + lq.xyzw vf07, 957(vi00) | nop + iaddi vi05, vi00, 0x0 | mul.xyzw vf16, vf00, vf00 + iaddi vi07, vi00, 0x8 | nop +L3: + iaddi vi06, vi00, 0x8 | mul.x vf16, vf00, vf00 +L4: + sq.xyzw vf16, 290(vi05) | nop + iaddi vi05, vi05, 0x3 | addx.x vf16, vf16, vf07 + ibgtz vi06, L4 | nop + iaddi vi06, vi06, -0x1 | nop + ibgtz vi07, L3 | addx.z vf16, vf16, vf07 + iaddi vi07, vi07, -0x1 | nop + nop | nop :e + nop | nop + xtop vi02 | nop + ilw.x vi03, 10(vi02) | nop + ilw.y vi04, 10(vi02) | nop + iaddi vi05, vi00, 0x0 | nop + iaddi vi07, vi00, 0x7 | nop +L5: + lq.xyzw vf28, 32(vi03) | nop + lq.xyzw vf29, 33(vi03) | nop + lq.xyzw vf30, 32(vi04) | nop + lq.xyzw vf24, 290(vi05) | nop + lq.xyzw vf25, 293(vi05) | nop + lq.xyzw vf26, 296(vi05) | nop + lq.xyzw vf27, 299(vi05) | nop + lq.xyzw vf12, 302(vi05) | addx.y vf24, vf00, vf28 + lq.xyzw vf13, 305(vi05) | addy.y vf25, vf00, vf28 + lq.xyzw vf14, 308(vi05) | addz.y vf26, vf00, vf28 + lq.xyzw vf15, 311(vi05) | addw.y vf27, vf00, vf28 + lq.xyzw vf08, 314(vi05) | addx.y vf12, vf00, vf29 + sq.xyzw vf24, 290(vi05) | addy.y vf13, vf00, vf29 + sq.xyzw vf25, 293(vi05) | addz.y vf14, vf00, vf29 + sq.xyzw vf26, 296(vi05) | addw.y vf15, vf00, vf29 + sq.xyzw vf27, 299(vi05) | addx.y vf08, vf00, vf30 + sq.xyzw vf12, 302(vi05) | nop + sq.xyzw vf13, 305(vi05) | nop + sq.xyzw vf14, 308(vi05) | nop + sq.xyzw vf15, 311(vi05) | nop + sq.xyzw vf08, 314(vi05) | nop + iaddi vi03, vi03, 0x8 | nop + iaddi vi04, vi04, 0x8 | nop + iaddiu vi05, vi05, 0x1b | nop + ibgtz vi07, L5 | nop + iaddi vi07, vi07, -0x1 | nop + ilw.z vi03, 10(vi02) | nop + ilw.w vi04, 10(vi02) | nop + lq.xyzw vf28, 32(vi03) | nop + lq.xyzw vf29, 33(vi03) | nop + lq.xyzw vf30, 32(vi04) | nop + lq.xyzw vf24, 290(vi05) | nop + lq.xyzw vf25, 293(vi05) | nop + lq.xyzw vf26, 296(vi05) | nop + lq.xyzw vf27, 299(vi05) | nop + lq.xyzw vf12, 302(vi05) | addx.y vf24, vf00, vf28 + lq.xyzw vf13, 305(vi05) | addy.y vf25, vf00, vf28 + lq.xyzw vf14, 308(vi05) | addz.y vf26, vf00, vf28 + lq.xyzw vf15, 311(vi05) | addw.y vf27, vf00, vf28 + lq.xyzw vf08, 314(vi05) | addx.y vf12, vf00, vf29 + sq.xyzw vf24, 290(vi05) | addy.y vf13, vf00, vf29 + sq.xyzw vf25, 293(vi05) | addz.y vf14, vf00, vf29 + sq.xyzw vf26, 296(vi05) | addw.y vf15, vf00, vf29 + sq.xyzw vf27, 299(vi05) | addx.y vf08, vf00, vf30 + sq.xyzw vf12, 302(vi05) | nop + sq.xyzw vf13, 305(vi05) | nop + sq.xyzw vf14, 308(vi05) | nop + sq.xyzw vf15, 311(vi05) | nop + sq.xyzw vf08, 314(vi05) | nop + lq.xyzw vf07, 957(vi00) | nop + lq.xyzw vf12, 11(vi02) | nop + lq.xyzw vf13, 11(vi02) | nop + lq.xyzw vf22, 12(vi02) | nop + lq.xyzw vf23, 13(vi02) | nop + lq.xyzw vf16, 14(vi02) | nop + lq.xyzw vf17, 15(vi02) | nop + nop | sub.xyzw vf09, vf16, vf22 + nop | sub.xyzw vf11, vf17, vf23 + nop | muly.xyzw vf09, vf09, vf07 + nop | muly.xyzw vf11, vf11, vf07 + iaddi vi05, vi00, 0x0 | nop + iaddi vi07, vi00, 0x8 | nop +L6: + nop | sub.xyzw vf08, vf23, vf22 + nop | mulw.xyzw vf16, vf22, vf00 + iaddi vi06, vi00, 0x8 | mulw.x vf12, vf13, vf00 + nop | muly.xyzw vf08, vf08, vf07 +L7: + sq.xyzw vf12, 288(vi05) | nop + sq.xyzw vf16, 289(vi05) | nop + iaddi vi05, vi05, 0x3 | addw.x vf12, vf12, vf07 + ibgtz vi06, L7 | add.xyzw vf16, vf16, vf08 + iaddi vi06, vi06, -0x1 | nop + nop | add.xyzw vf22, vf22, vf09 + nop | add.xyzw vf23, vf23, vf11 + ibgtz vi07, L6 | addw.y vf12, vf12, vf07 + iaddi vi07, vi07, -0x1 | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + lq.xyzw vf10, 2(vi02) | nop + lq.xyzw vf04, 8(vi02) | nop + iaddi vi07, vi00, 0x3 | nop +L8: + mtir vi10, vf04.x | nop + iaddiu vi11, vi00, 0xff | nop + mr32.xyzw vf04, vf04 | nop + ibeq vi11, vi10, L10 | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop + ilw.x vi05, 983(vi07) | nop + bal vi15, L14 | nop + iaddi vi08, vi09, 0x7 | nop + lq.xyzw vf07, 968(vi00) | nop + iaddiu vi08, vi00, 0x3d1 | nop + sq.xyzw vf07, 6(vi09) | nop + xgkick vi09 | nop + lq.xyzw vf07, 980(vi00) | nop + xgkick vi08 | nop + sq.xyzw vf07, 6(vi09) | nop + iaddi vi08, vi09, 0x6 | nop + nop | nop + xgkick vi08 | nop + iaddiu vi08, vi00, 0x3d5 | nop + nop | nop + xgkick vi08 | nop + bal vi15, L20 | nop + iaddiu vi08, vi09, 0x44 | nop + ibeq vi00, vi14, L9 | nop + nop | nop + bal vi15, L24 | nop + nop | nop +L9: + bal vi15, L22 | nop + iaddiu vi08, vi09, 0x44 | nop + iaddiu vi08, vi09, 0x3d | nop + iaddiu vi01, vi00, 0x4b2 | nop + xgkick vi08 | nop + isub vi09, vi01, vi09 | nop +L10: + ibgtz vi07, L8 | nop + iaddi vi07, vi07, -0x1 | nop + lq.xyzw vf04, 9(vi02) | nop + iaddi vi07, vi00, 0x3 | nop +L11: + mtir vi10, vf04.x | nop + iaddiu vi11, vi00, 0xff | nop + mr32.xyzw vf04, vf04 | nop + ibeq vi11, vi10, L13 | nop + lq.xyzw vf11, 3(vi02) | nop + lq.xyzw vf12, 4(vi02) | nop + lq.xyzw vf13, 5(vi02) | nop + lq.xyzw vf14, 6(vi02) | nop + lq.xyzw vf15, 7(vi02) | nop + ilw.y vi05, 983(vi07) | nop + bal vi15, L14 | nop + iaddi vi08, vi09, 0x7 | nop + lq.xyzw vf07, 968(vi00) | nop + iaddiu vi08, vi00, 0x3d1 | nop + sq.xyzw vf07, 6(vi09) | nop + xgkick vi09 | nop + lq.xyzw vf07, 980(vi00) | nop + xgkick vi08 | nop + sq.xyzw vf07, 6(vi09) | nop + iaddi vi08, vi09, 0x6 | nop + nop | nop + xgkick vi08 | nop + iaddiu vi08, vi00, 0x3d5 | nop + nop | nop + xgkick vi08 | nop + bal vi15, L20 | nop + iaddiu vi08, vi09, 0x44 | nop + ibeq vi00, vi14, L12 | nop + nop | nop + bal vi15, L24 | nop + nop | nop +L12: + bal vi15, L22 | nop + iaddiu vi08, vi09, 0x44 | nop + iaddiu vi08, vi09, 0x3d | nop + iaddiu vi01, vi00, 0x4b2 | nop + nop | nop + xgkick vi08 | nop + isub vi09, vi01, vi09 | nop +L13: + ibgtz vi07, L11 | nop + iaddi vi07, vi07, -0x1 | nop + nop | nop :e + nop | nop +L14: + iaddi vi01, vi05, 0x9 | nop + lq.xyzw vf24, 290(vi05) | nop + lq.xyzw vf25, 317(vi05) | nop + lq.xyzw vf07, 958(vi00) | mulax.xyzw ACC, vf08, vf24 + iaddi vi05, vi05, 0x3 | madday.xyzw ACC, vf09, vf24 + isw.x vi01, 987(vi00) | nop + iaddi vi01, vi00, 0x0 | maddaz.xyzw ACC, vf10, vf24 + iaddi vi13, vi00, 0x0 | maddw.xyzw vf26, vf11, vf00 + iaddi vi11, vi00, 0x0 | mulax.xyzw ACC, vf08, vf25 + fcset 0x0 | madday.xyzw ACC, vf09, vf25 + lq.xyzw vf28, 287(vi05) | maddaz.xyzw ACC, vf10, vf25 + eleng.xyz P, vf26 | maddw.xyzw vf27, vf11, vf00 + iaddi vi14, vi00, 0x0 | mulw.xyzw vf20, vf26, vf00 + lq.xyzw vf22, 286(vi05) | nop + waitp | nop + mfp.w vf20, P | nop + eleng.xyz P, vf27 | mulw.xyzw vf21, vf27, vf00 + nop | nop + nop | nop + iaddi vi12, vi00, 0x1 | mulw.w vf22, vf20, vf05 + nop | nop + nop | nop + nop | nop + nop | miniw.w vf22, vf22, vf00 + nop | nop + nop | nop + nop | nop + nop | subw.w vf28, vf00, vf22 + nop | maxx.w vf22, vf22, vf05 + nop | nop + nop | mulaz.w ACC, vf00, vf07 + nop | mulw.y vf28, vf28, vf28 + lq.xyzw vf24, 290(vi05) | msubx.w vf07, vf22, vf07 + nop | mulax.xyzw ACC, vf12, vf28 + nop | madday.xyzw ACC, vf13, vf28 + nop | maddaz.xyzw ACC, vf14, vf28 + nop | maddw.xyzw vf30, vf15, vf00 + nop | mulax.xyzw ACC, vf08, vf24 + nop | madday.xyzw ACC, vf09, vf24 + nop | maddaz.xyzw ACC, vf10, vf24 + nop | maddw.xyzw vf26, vf11, vf00 + div Q, vf03.x, vf30.w | mul.xyzw vf18, vf30, vf01 + lq.xyzw vf23, 313(vi05) | mulw.w vf22, vf22, vf06 + waitp | mulw.xyz vf22, vf22, vf07 + mfp.w vf21, P | nop + eleng.xyz P, vf26 | nop + nop | clipw.xyz vf18, vf18 + nop | mulaw.w ACC, vf30, vf00 + lq.xyzw vf29, 314(vi05) | mulw.w vf23, vf21, vf05 + nop | mula.xyz ACC, vf30, Q + nop | maddw.xyzw vf16, vf02, vf00 + nop | miniy.xyzw vf22, vf22, vf07 + nop | miniw.w vf23, vf23, vf00 + nop | nop + nop | miniz.w vf16, vf16, vf03 + nop | ftoi0.xyzw vf22, vf22 + waitp | subw.w vf29, vf00, vf23 + b L17 | maxx.w vf23, vf23, vf05 + iaddi vi06, vi00, 0x8 | maxy.w vf16, vf16, vf03 +L15: + ibeq vi00, vi01, L16 | nop + lq.xyzw vf26, 309(vi05) | nop + ibne vi00, vi13, L16 | addw.w vf17, vf17, vf03 + fcor vi01, 0xfdf7df | nop + isw.x vi12, 988(vi14) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xff7df7 | nop + isw.y vi05, 988(vi14) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xffbefb | nop + ilw.x vi11, 987(vi00) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xffdf7d | nop + isw.z vi08, 988(vi14) | nop + ibne vi00, vi01, L16 | nop + fcor vi01, 0xffefbe | nop + isub vi11, vi05, vi11 | nop + ibne vi00, vi01, L16 | nop + nop | nop + ibltz vi11, L16 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L16: + nop | mulw.y vf28, vf28, vf28 + nop | mulaz.w ACC, vf00, vf07 + nop | msubx.w vf07, vf22, vf07 + nop | ftoi4.xyzw vf17, vf17 + lq.xyzw vf24, 290(vi05) | mul.xyzw vf26, vf26, Q + sq.xyzw vf21, 64(vi08) | mulax.xyzw ACC, vf12, vf28 + sq.xyzw vf23, 4(vi08) | madday.xyzw ACC, vf13, vf28 + sq.xyzw vf17, 5(vi08) | maddaz.xyzw ACC, vf14, vf28 + sq.xyzw vf19, 66(vi08) | maddw.xyzw vf30, vf15, vf00 + sq.xyzw vf26, 3(vi08) | mulax.xyzw ACC, vf08, vf24 + nop | madday.xyzw ACC, vf09, vf24 + nop | maddaz.xyzw ACC, vf10, vf24 + nop | maddw.xyzw vf26, vf11, vf00 + div Q, vf03.x, vf30.w | mul.xyzw vf18, vf30, vf01 + lq.xyzw vf23, 313(vi05) | mulw.xyz vf21, vf27, vf00 + mfp.w vf21, P | mulw.w vf22, vf22, vf06 + eleng.xyz P, vf26 | mulw.xyz vf22, vf22, vf07 + iaddi vi08, vi08, 0x6 | clipw.xyz vf18, vf18 + nop | mulaw.w ACC, vf30, vf00 + nop | mulw.w vf23, vf21, vf05 + iand vi13, vi10, vi12 | mula.xyz ACC, vf30, Q + fcand vi01, 0x3ffff | maddw.xyzw vf16, vf02, vf00 + iadd vi12, vi12, vi12 | miniy.xyzw vf22, vf22, vf07 + lq.xyzw vf29, 314(vi05) | miniw.w vf23, vf23, vf00 + nop | nop + ior vi01, vi01, vi13 | miniz.w vf16, vf16, vf03 + nop | ftoi0.xyzw vf22, vf22 + nop | subw.w vf29, vf00, vf23 + nop | maxx.w vf23, vf23, vf05 + nop | maxy.w vf16, vf16, vf03 + nop | nop +L17: + ibeq vi00, vi01, L18 | nop + lq.xyzw vf27, 285(vi05) | nop + ibne vi00, vi13, L18 | addw.w vf16, vf16, vf03 + fcor vi01, 0xfdf7df | nop + isw.x vi00, 988(vi14) | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xff7df7 | nop + isw.y vi05, 988(vi14) | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xffbefb | nop + isw.z vi08, 988(vi14) | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xffdf7d | nop + nop | nop + ibne vi00, vi01, L18 | nop + fcor vi01, 0xffefbe | nop + nop | nop + ibne vi00, vi01, L18 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L18: + nop | mulw.y vf29, vf29, vf29 + nop | mulaz.w ACC, vf00, vf07 + nop | msubx.w vf07, vf23, vf07 + nop | ftoi4.xyzw vf16, vf16 + lq.xyzw vf25, 317(vi05) | mul.xyzw vf27, vf27, Q + sq.xyzw vf20, 61(vi08) | mulax.xyzw ACC, vf12, vf29 + sq.xyzw vf22, 1(vi08) | madday.xyzw ACC, vf13, vf29 + sq.xyzw vf16, 2(vi08) | maddaz.xyzw ACC, vf14, vf29 + sq.xyzw vf18, 63(vi08) | maddw.xyzw vf31, vf15, vf00 + sq.xyzw vf27, 0(vi08) | mulax.xyzw ACC, vf08, vf25 + nop | madday.xyzw ACC, vf09, vf25 + iaddi vi05, vi05, 0x3 | maddaz.xyzw ACC, vf10, vf25 + nop | maddw.xyzw vf27, vf11, vf00 + div Q, vf03.x, vf31.w | mul.xyzw vf19, vf31, vf01 + lq.xyzw vf22, 286(vi05) | mulw.xyz vf20, vf26, vf00 + mfp.w vf20, P | mulw.w vf23, vf23, vf06 + eleng.xyz P, vf27 | mulw.xyz vf23, vf23, vf07 + nop | clipw.xyz vf19, vf19 + nop | mulaw.w ACC, vf31, vf00 + nop | mulw.w vf22, vf20, vf05 + nop | mula.xyz ACC, vf31, Q + fcand vi01, 0x3ffff | maddw.xyzw vf17, vf02, vf00 + nop | miniy.xyzw vf23, vf23, vf07 + lq.xyzw vf28, 287(vi05) | miniw.w vf22, vf22, vf00 + nop | nop + ior vi01, vi01, vi13 | miniz.w vf17, vf17, vf03 + nop | ftoi0.xyzw vf23, vf23 + nop | subw.w vf28, vf00, vf22 + nop | maxx.w vf22, vf22, vf05 + ibgtz vi06, L15 | maxy.w vf17, vf17, vf03 + iaddi vi06, vi06, -0x1 | nop + ibeq vi00, vi01, L19 | nop + lq.xyzw vf26, 309(vi05) | nop + ibne vi00, vi13, L19 | addw.w vf17, vf17, vf03 + fcor vi01, 0xfdf7df | nop + isw.x vi12, 988(vi14) | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xff7df7 | nop + isw.y vi05, 988(vi14) | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xffbefb | nop + isw.z vi08, 988(vi14) | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xffdf7d | nop + nop | nop + ibne vi00, vi01, L19 | nop + fcor vi01, 0xffefbe | nop + nop | nop + ibne vi00, vi01, L19 | nop + nop | nop + iaddi vi14, vi14, 0x1 | nop +L19: + isw.y vi14, 987(vi00) | ftoi4.xyzw vf17, vf17 + sq.xyzw vf21, 64(vi08) | mul.xyzw vf26, vf26, Q + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf17, 5(vi08) | nop + sq.xyzw vf19, 66(vi08) | nop + sq.xyzw vf26, 3(vi08) | nop + jr vi15 | nop + nop | nop +L20: + iaddi vi06, vi00, 0x5 | nop +L21: + lq.xyzw vf20, 0(vi08) | nop + lq.xyzw vf21, 3(vi08) | nop + lq.xyzw vf18, 6(vi08) | nop + lq.xyzw vf19, 9(vi08) | maxw.xyzw vf11, vf00, vf00 + div Q, vf00.w, vf20.w | nop + nop | addz.y vf20, vf00, vf20 + nop | addz.y vf21, vf00, vf21 + nop | addz.y vf18, vf00, vf18 + nop | addz.y vf19, vf00, vf19 + nop | nop + nop | nop + div Q, vf00.w, vf21.w | mul.xy vf20, vf20, Q + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + div Q, vf00.w, vf18.w | mul.xy vf21, vf21, Q + nop | mula.xyzw ACC, vf20, vf05 + nop | maddw.xyzw vf20, vf06, vf00 + nop | nop + nop | mula.xyzw ACC, vf21, vf05 + nop | maddw.xyzw vf21, vf06, vf00 + nop | nop + div Q, vf00.w, vf19.w | mul.xy vf18, vf18, Q + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + sq.xyz vf20, 0(vi08) | mul.xy vf19, vf19, Q + sq.xyz vf21, 3(vi08) | mula.xyzw ACC, vf18, vf05 + nop | maddw.xyzw vf18, vf06, vf00 + nop | nop + nop | mula.xyzw ACC, vf19, vf05 + iaddi vi08, vi08, 0xc | maddw.xyzw vf19, vf06, vf00 + iaddi vi06, vi06, -0x1 | nop + sq.xyz vf18, -6(vi08) | nop + ibgtz vi06, L21 | nop + sq.xyz vf19, -3(vi08) | nop + jr vi15 | nop + nop | nop +L22: + iaddi vi06, vi00, 0x4 | nop +L23: + lq.xyzw vf12, 0(vi08) | nop + lq.xyzw vf13, 3(vi08) | nop + lq.xyzw vf14, 6(vi08) | nop + lq.xyzw vf15, 9(vi08) | nop + lq.xyzw vf24, -59(vi08) | nop + lq.xyzw vf25, -56(vi08) | nop + lq.xyzw vf26, -53(vi08) | nop + lq.xyzw vf27, -50(vi08) | nop + lq.xyzw vf28, -61(vi08) | nop + lq.xyzw vf29, -58(vi08) | nop + lq.xyzw vf30, -55(vi08) | nop + lq.xyzw vf31, -52(vi08) | nop + iaddi vi08, vi08, 0xc | mulz.xyzw vf12, vf12, vf28 + sq.xyzw vf24, -10(vi08) | mulz.xyzw vf13, vf13, vf29 + sq.xyzw vf25, -7(vi08) | mulz.xyzw vf14, vf14, vf30 + sq.xyzw vf26, -4(vi08) | mulz.xyzw vf15, vf15, vf31 + sq.xyzw vf27, -1(vi08) | nop + sq.xyzw vf12, -12(vi08) | nop + sq.xyzw vf13, -9(vi08) | nop + sq.xyzw vf14, -6(vi08) | nop + sq.xyzw vf15, -3(vi08) | nop + ibgtz vi06, L23 | nop + iaddi vi06, vi06, -0x1 | nop + jr vi15 | nop + nop | nop +L24: + lq.xyzw vf31, 952(vi00) | nop + iaddiu vi10, vi00, 0x32b | nop +L25: + iaddi vi14, vi14, -0x1 | nop + iaddi vi08, vi10, 0x7 | nop + ilw.x vi12, 988(vi14) | nop + ilw.y vi05, 988(vi14) | nop + ibne vi00, vi12, L26 | nop + ilw.z vi03, 988(vi14) | nop + lq.xyzw vf20, 282(vi05) | nop + lq.xyzw vf21, 309(vi05) | nop + lq.xyzw vf18, 285(vi05) | nop + lq.xyzw vf22, -5(vi03) | nop + lq.xyzw vf23, -2(vi03) | nop + lq.xyzw vf16, 1(vi03) | nop + lq.xyzw vf08, 55(vi03) | nop + lq.xyzw vf09, 58(vi03) | nop + lq.xyzw vf10, 61(vi03) | nop + lq.xyzw vf28, 57(vi03) | nop + lq.xyzw vf29, 60(vi03) | nop + b L27 | nop + lq.xyzw vf30, 63(vi03) | nop +L26: + lq.xyzw vf20, 306(vi05) | nop + lq.xyzw vf21, 282(vi05) | nop + lq.xyzw vf18, 309(vi05) | nop + lq.xyzw vf22, -2(vi03) | nop + lq.xyzw vf23, 1(vi03) | nop + lq.xyzw vf16, 4(vi03) | nop + lq.xyzw vf08, 58(vi03) | nop + lq.xyzw vf09, 61(vi03) | nop + lq.xyzw vf10, 64(vi03) | nop + lq.xyzw vf28, 60(vi03) | nop + lq.xyzw vf29, 63(vi03) | nop + lq.xyzw vf30, 66(vi03) | nop +L27: + sq.xyzw vf20, 0(vi08) | itof0.xyzw vf22, vf22 + sq.xyzw vf21, 3(vi08) | itof0.xyzw vf23, vf23 + sq.xyzw vf18, 6(vi08) | itof0.xyzw vf16, vf16 + sq.xyzw vf20, 9(vi08) | nop + sq.xyzw vf22, 1(vi08) | nop + sq.xyzw vf23, 4(vi08) | nop + sq.xyzw vf16, 7(vi08) | nop + sq.xyzw vf22, 10(vi08) | nop + sq.xyzw vf28, 2(vi08) | nop + sq.xyzw vf29, 5(vi08) | nop + sq.xyzw vf30, 8(vi08) | nop + sq.xyzw vf28, 11(vi08) | nop + lq.xyzw vf22, 976(vi00) | nop + sq.xyzw vf08, 35(vi08) | nop + sq.xyzw vf09, 38(vi08) | nop + sq.xyzw vf10, 41(vi08) | nop + sq.xyzw vf08, 44(vi08) | nop + sq.xyzw vf22, 36(vi08) | nop + sq.xyzw vf22, 39(vi08) | nop + sq.xyzw vf22, 42(vi08) | nop + sq.xyzw vf22, 45(vi08) | nop + sq.xyzw vf28, 37(vi08) | nop + sq.xyzw vf29, 40(vi08) | nop + sq.xyzw vf30, 43(vi08) | nop + sq.xyzw vf28, 46(vi08) | nop + lq.xyzw vf07, 959(vi00) | maddw.xyzw vf26, vf06, vf00 + ior vi03, vi08, vi00 | nop + bal vi13, L31 | nop + iaddi vi05, vi00, 0x3 | nop + ibeq vi00, vi05, L28 | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L29 | nop + iaddiu vi06, vi06, 0x4000 | nop + iaddiu vi08, vi00, 0x3d1 | nop + xgkick vi10 | nop + lq.xyzw vf07, 960(vi00) | nop + xgkick vi08 | nop + iaddi vi08, vi10, 0x6 | nop + sq.xyzw vf07, 6(vi10) | nop + isw.x vi06, 6(vi10) | nop + xgkick vi08 | nop + iaddiu vi08, vi00, 0x3d5 | nop + nop | nop + xgkick vi08 | nop + iaddiu vi08, vi10, 0x2a | nop + iaddiu vi03, vi10, 0x2a | nop + iaddi vi05, vi00, 0x3 | nop + bal vi13, L31 | nop + lq.xyzw vf07, 961(vi00) | nop + iaddiu vi06, vi05, 0x4000 | nop + bal vi13, L29 | nop + iaddiu vi06, vi06, 0x4000 | nop + iaddiu vi08, vi10, 0x23 | nop + iaddiu vi01, vi00, 0x69c | nop + xgkick vi08 | nop + isub vi10, vi01, vi10 | nop +L28: + ibgtz vi14, L25 | nop + nop | nop + lq.xyzw vf08, 0(vi02) | nop + lq.xyzw vf09, 1(vi02) | nop + jr vi15 | nop + lq.xyzw vf10, 2(vi02) | nop +L29: + sq.xyzw vf07, -1(vi08) | nop + isw.x vi06, -1(vi08) | nop +L30: + lqi.xyzw vf24, vi08 | nop + lqi.xyzw vf27, vi08 | nop + lqi.xyzw vf21, vi08 | nop + nop | nop + nop | nop + nop | nop + div Q, vf00.w, vf21.w | mul.xyzw vf21, vf21, vf31 + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | nop + nop | mul.xyz vf21, vf21, Q + nop | mul.xyzw vf24, vf24, Q + nop | nop + nop | nop + nop | add.xyzw vf21, vf21, vf02 + nop | nop + nop | nop + nop | nop + nop | maxy.w vf21, vf21, vf03 + nop | nop + nop | nop + nop | nop + nop | miniz.w vf21, vf21, vf03 + nop | nop + nop | nop + nop | ftoi0.xyzw vf27, vf27 + nop | ftoi4.xyzw vf21, vf21 + nop | nop + sq.xyzw vf24, -3(vi08) | nop + sq.xyzw vf27, -2(vi08) | nop + sq.xyzw vf21, -1(vi08) | nop + iaddi vi05, vi05, -0x1 | nop + nop | nop + ibne vi00, vi05, L30 | nop + nop | nop + jr vi13 | nop + nop | nop +L31: + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L32: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfff7df | nop + ibne vi00, vi01, L43 | nop + fcand vi01, 0x20 | nop + ibne vi00, vi01, L44 | nop + fcand vi01, 0x800 | nop + ibne vi00, vi01, L45 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L33: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L32 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L34: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfffdf7 | nop + ibne vi00, vi01, L46 | nop + fcand vi01, 0x8 | nop + ibne vi00, vi01, L47 | nop + fcand vi01, 0x200 | nop + ibne vi00, vi01, L48 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L35: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L34 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L36: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xfffefb | nop + ibne vi00, vi01, L49 | nop + fcand vi01, 0x4 | nop + ibne vi00, vi01, L50 | nop + fcand vi01, 0x100 | nop + ibne vi00, vi01, L51 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L37: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L36 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L38: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xffff7d | nop + ibne vi00, vi01, L52 | nop + fcand vi01, 0x2 | nop + ibne vi00, vi01, L53 | nop + fcand vi01, 0x80 | nop + ibne vi00, vi01, L54 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L39: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L38 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop + ior vi04, vi03, vi00 | nop + lq.xyzw vf21, 2(vi03) | nop + ior vi06, vi05, vi00 | nop + lq.xyzw vf24, 0(vi03) | nop + lq.xyzw vf27, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | clipw.xyz vf21, vf21 +L40: + lq.xyzw vf22, 2(vi03) | nop + lq.xyzw vf25, 0(vi03) | nop + lq.xyzw vf28, 1(vi03) | nop + iaddi vi03, vi03, 0x3 | nop + nop | clipw.xyz vf22, vf22 + nop | nop + nop | nop + nop | nop + fcor vi01, 0xffffbe | nop + ibne vi00, vi01, L55 | nop + fcand vi01, 0x1 | nop + ibne vi00, vi01, L56 | nop + fcand vi01, 0x40 | nop + ibne vi00, vi01, L57 | nop + nop | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop +L41: + move.xyzw vf24, vf25 | nop + iaddi vi05, vi05, -0x1 | nop + move.xyzw vf27, vf28 | nop + ibne vi00, vi05, L40 | nop + move.xyzw vf21, vf22 | nop + lq.xyzw vf24, 0(vi08) | nop + lq.xyzw vf27, 1(vi08) | nop + lq.xyzw vf21, 2(vi08) | nop + ior vi03, vi08, vi00 | nop + sqi.xyzw vf24, vi04 | nop + sqi.xyzw vf27, vi04 | nop + sqi.xyzw vf21, vi04 | nop + ibeq vi00, vi06, L42 | nop + ior vi05, vi06, vi00 | nop +L42: + jr vi13 | nop + nop | nop +L43: + b L33 | nop + iaddi vi06, vi06, -0x1 | nop +L44: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L33 | nop + nop | addz.w vf30, vf23, vf23 + nop | addw.z vf30, vf21, vf21 + div Q, vf30.z, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L33 | nop + sqi.xyzw vf23, vi04 | nop +L45: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addz.w vf30, vf23, vf23 + nop | addw.z vf30, vf22, vf22 + div Q, vf30.z, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L33 | nop + sqi.xyzw vf23, vi04 | nop +L46: + b L35 | nop + iaddi vi06, vi06, -0x1 | nop +L47: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L35 | nop + nop | addy.w vf30, vf23, vf23 + nop | addw.y vf30, vf21, vf21 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L35 | nop + sqi.xyzw vf23, vi04 | nop +L48: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addy.w vf30, vf23, vf23 + nop | addw.y vf30, vf22, vf22 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L35 | nop + sqi.xyzw vf23, vi04 | nop +L49: + b L37 | nop + iaddi vi06, vi06, -0x1 | nop +L50: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L37 | nop + nop | suby.w vf30, vf23, vf23 + nop | subw.y vf30, vf21, vf21 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf24, vf26 + nop | add.xyzw vf29, vf27, vf29 + nop | add.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L37 | nop + sqi.xyzw vf23, vi04 | nop +L51: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | suby.w vf30, vf23, vf23 + nop | subw.y vf30, vf22, vf22 + div Q, vf30.y, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf25, vf26 + nop | add.xyzw vf29, vf28, vf29 + nop | add.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L37 | nop + sqi.xyzw vf23, vi04 | nop +L52: + b L39 | nop + iaddi vi06, vi06, -0x1 | nop +L53: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L39 | nop + nop | addx.w vf30, vf23, vf23 + nop | addw.x vf30, vf21, vf21 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf24, vf26 + nop | sub.xyzw vf29, vf27, vf29 + nop | sub.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L39 | nop + sqi.xyzw vf23, vi04 | nop +L54: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | addx.w vf30, vf23, vf23 + nop | addw.x vf30, vf22, vf22 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | sub.xyzw vf26, vf25, vf26 + nop | sub.xyzw vf29, vf28, vf29 + nop | sub.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L39 | nop + sqi.xyzw vf23, vi04 | nop +L55: + b L41 | nop + iaddi vi06, vi06, -0x1 | nop +L56: + sqi.xyzw vf24, vi04 | sub.xyzw vf23, vf22, vf21 + sqi.xyzw vf27, vi04 | sub.xyzw vf26, vf25, vf24 + sqi.xyzw vf21, vi04 | sub.xyzw vf29, vf28, vf27 + ibeq vi03, vi04, L41 | nop + nop | subx.w vf30, vf23, vf23 + nop | subw.x vf30, vf21, vf21 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf24, vf26 + nop | add.xyzw vf29, vf27, vf29 + nop | add.xyzw vf23, vf21, vf23 + iaddi vi06, vi06, 0x1 | nop + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L41 | nop + sqi.xyzw vf23, vi04 | nop +L57: + nop | sub.xyzw vf23, vf21, vf22 + nop | sub.xyzw vf26, vf24, vf25 + nop | sub.xyzw vf29, vf27, vf28 + nop | subx.w vf30, vf23, vf23 + nop | subw.x vf30, vf22, vf22 + div Q, vf30.x, vf30.w | nop + waitq | nop + nop | mul.xyzw vf26, vf26, Q + nop | mul.xyzw vf29, vf29, Q + nop | mul.xyzw vf23, vf23, Q + nop | add.xyzw vf26, vf25, vf26 + nop | add.xyzw vf29, vf28, vf29 + nop | add.xyzw vf23, vf22, vf23 + sqi.xyzw vf26, vi04 | nop + sqi.xyzw vf29, vi04 | nop + b L41 | nop + sqi.xyzw vf23, vi04 | nop diff --git a/test/decompiler/vu_reference/ocean-near.txt b/test/decompiler/vu_reference/ocean-near.txt new file mode 100644 index 0000000000..f960bfc9b0 --- /dev/null +++ b/test/decompiler/vu_reference/ocean-near.txt @@ -0,0 +1,1976 @@ +.word 0x1e103b7 +.word 0x2ff +.word 0x1e203b9 +.word 0x2ff +.word 0x1e303ba +.word 0x2ff +.word 0x1e503bb +.word 0x2ff +.word 0x1e603bc +.word 0x2ff +.word 0x10090213 +.word 0x2ff +.word 0x800101b2 +.word 0x2ff +.word 0x1ec0bc2 +.word 0x2ff +.word 0x1ed0bc9 +.word 0x2ff +.word 0x3e16213 +.word 0x2ff +.word 0x3e1629f +.word 0x2ff +.word 0x3e16a50 +.word 0x2ff +.word 0x3e16adc +.word 0x2ff +.word 0x3e1632b +.word 0x2ff +.word 0x3e16371 +.word 0x2ff +.word 0x3e16b4e +.word 0x2ff +.word 0x3e16b94 +.word 0x2ff +.word 0x5a000ff5 +.word 0x2ff +.word 0x80010ff2 +.word 0x2ff +.word 0x1e803d0 +.word 0x2ff +.word 0x80040232 +.word 0x2ff +.word 0x10060011 +.word 0x1e8417c +.word 0x3e44250 +.word 0x2ff +.word 0x3e442dc +.word 0x2ff +.word 0x800420f2 +.word 0x2ff +.word 0x5a0037fc +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x1e703bd +.word 0x2ff +.word 0x80050032 +.word 0x1e0042a +.word 0x80070232 +.word 0x2ff +.word 0x80060232 +.word 0x100042a +.word 0x3e58122 +.word 0x2ff +.word 0x800528f2 +.word 0x1078400 +.word 0x5a0037fd +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x5a003ffa +.word 0x478400 +.word 0x80073ff2 +.word 0x2ff +.word 0x80000030 +.word 0x400002ff +.word 0x80000030 +.word 0x2ff +.word 0x800206bc +.word 0x2ff +.word 0x903100a +.word 0x2ff +.word 0x884100a +.word 0x2ff +.word 0x80050032 +.word 0x2ff +.word 0x800701f2 +.word 0x2ff +.word 0x1fc1820 +.word 0x2ff +.word 0x1fd1821 +.word 0x2ff +.word 0x1fe2020 +.word 0x2ff +.word 0x1f82922 +.word 0x2ff +.word 0x1f92925 +.word 0x2ff +.word 0x1fa2928 +.word 0x2ff +.word 0x1fb292b +.word 0x2ff +.word 0x1ec292e +.word 0x9c0600 +.word 0x1ed2931 +.word 0x9c0641 +.word 0x1ee2934 +.word 0x9c0682 +.word 0x1ef2937 +.word 0x9c06c3 +.word 0x1e8293a +.word 0x9d0300 +.word 0x3e5c122 +.word 0x9d0341 +.word 0x3e5c925 +.word 0x9d0382 +.word 0x3e5d128 +.word 0x9d03c3 +.word 0x3e5d92b +.word 0x9e0200 +.word 0x3e5612e +.word 0x2ff +.word 0x3e56931 +.word 0x2ff +.word 0x3e57134 +.word 0x2ff +.word 0x3e57937 +.word 0x2ff +.word 0x3e5413a +.word 0x2ff +.word 0x80031a32 +.word 0x2ff +.word 0x80042232 +.word 0x2ff +.word 0x1005281b +.word 0x2ff +.word 0x5a003fe7 +.word 0x2ff +.word 0x80073ff2 +.word 0x2ff +.word 0x843100a +.word 0x2ff +.word 0x824100a +.word 0x2ff +.word 0x1fc1820 +.word 0x2ff +.word 0x1fd1821 +.word 0x2ff +.word 0x1fe2020 +.word 0x2ff +.word 0x1f82922 +.word 0x2ff +.word 0x1f92925 +.word 0x2ff +.word 0x1fa2928 +.word 0x2ff +.word 0x1fb292b +.word 0x2ff +.word 0x1ec292e +.word 0x9c0600 +.word 0x1ed2931 +.word 0x9c0641 +.word 0x1ee2934 +.word 0x9c0682 +.word 0x1ef2937 +.word 0x9c06c3 +.word 0x1e8293a +.word 0x9d0300 +.word 0x3e5c122 +.word 0x9d0341 +.word 0x3e5c925 +.word 0x9d0382 +.word 0x3e5d128 +.word 0x9d03c3 +.word 0x3e5d92b +.word 0x9e0200 +.word 0x3e5612e +.word 0x2ff +.word 0x3e56931 +.word 0x2ff +.word 0x3e57134 +.word 0x2ff +.word 0x3e57937 +.word 0x2ff +.word 0x3e5413a +.word 0x2ff +.word 0x1e703bd +.word 0x2ff +.word 0x1ec100b +.word 0x2ff +.word 0x1ed100b +.word 0x2ff +.word 0x1f6100c +.word 0x2ff +.word 0x1f7100d +.word 0x2ff +.word 0x1f0100e +.word 0x2ff +.word 0x1f1100f +.word 0x2ff +.word 0x80000030 +.word 0x1f6826c +.word 0x80000030 +.word 0x1f78aec +.word 0x80000030 +.word 0x1e74a59 +.word 0x80000030 +.word 0x1e75ad9 +.word 0x80050032 +.word 0x2ff +.word 0x80070232 +.word 0x2ff +.word 0x80000030 +.word 0x1f6ba2c +.word 0x80000030 +.word 0x1e0b41b +.word 0x80060232 +.word 0x1006b1b +.word 0x80000030 +.word 0x1e74219 +.word 0x3e56120 +.word 0x2ff +.word 0x3e58121 +.word 0x2ff +.word 0x800528f2 +.word 0x1076303 +.word 0x5a0037fc +.word 0x1e88428 +.word 0x800637f2 +.word 0x2ff +.word 0x80000030 +.word 0x1e9b5a8 +.word 0x80000030 +.word 0x1ebbde8 +.word 0x5a003ff4 +.word 0x876303 +.word 0x80073ff2 +.word 0x2ff +.word 0x1e81000 +.word 0x2ff +.word 0x1e91001 +.word 0x2ff +.word 0x1ea1002 +.word 0x2ff +.word 0x1e41008 +.word 0x2ff +.word 0x800700f2 +.word 0x2ff +.word 0x800a23fc +.word 0x2ff +.word 0x100b00ff +.word 0x2ff +.word 0x81e4233d +.word 0x2ff +.word 0x500b5021 +.word 0x2ff +.word 0x1eb1003 +.word 0x2ff +.word 0x1ec1004 +.word 0x2ff +.word 0x1ed1005 +.word 0x2ff +.word 0x1ee1006 +.word 0x2ff +.word 0x1ef1007 +.word 0x2ff +.word 0x9053bd7 +.word 0x2ff +.word 0x420f0048 +.word 0x2ff +.word 0x800849f2 +.word 0x2ff +.word 0x1e703c8 +.word 0x2ff +.word 0x100803d1 +.word 0x2ff +.word 0x3e93806 +.word 0x2ff +.word 0x80004efc +.word 0x2ff +.word 0x1e703d4 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x3e93806 +.word 0x2ff +.word 0x800849b2 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x100803d5 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x420f00f8 +.word 0x2ff +.word 0x10084844 +.word 0x2ff +.word 0x50007003 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x420f013b +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x420f011f +.word 0x2ff +.word 0x10084844 +.word 0x2ff +.word 0x1008483d +.word 0x2ff +.word 0x100104b2 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x80090a71 +.word 0x2ff +.word 0x5a003fda +.word 0x2ff +.word 0x80073ff2 +.word 0x2ff +.word 0x1e41009 +.word 0x2ff +.word 0x800700f2 +.word 0x2ff +.word 0x800a23fc +.word 0x2ff +.word 0x100b00ff +.word 0x2ff +.word 0x81e4233d +.word 0x2ff +.word 0x500b5022 +.word 0x2ff +.word 0x1eb1003 +.word 0x2ff +.word 0x1ec1004 +.word 0x2ff +.word 0x1ed1005 +.word 0x2ff +.word 0x1ee1006 +.word 0x2ff +.word 0x1ef1007 +.word 0x2ff +.word 0x8853bd7 +.word 0x2ff +.word 0x420f001f +.word 0x2ff +.word 0x800849f2 +.word 0x2ff +.word 0x1e703c8 +.word 0x2ff +.word 0x100803d1 +.word 0x2ff +.word 0x3e93806 +.word 0x2ff +.word 0x80004efc +.word 0x2ff +.word 0x1e703d4 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x3e93806 +.word 0x2ff +.word 0x800849b2 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x100803d5 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x420f00cf +.word 0x2ff +.word 0x10084844 +.word 0x2ff +.word 0x50007003 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x420f0112 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x420f00f6 +.word 0x2ff +.word 0x10084844 +.word 0x2ff +.word 0x1008483d +.word 0x2ff +.word 0x100104b2 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x80090a71 +.word 0x2ff +.word 0x5a003fd9 +.word 0x2ff +.word 0x80073ff2 +.word 0x2ff +.word 0x80000030 +.word 0x400002ff +.word 0x80000030 +.word 0x2ff +.word 0x80012a72 +.word 0x2ff +.word 0x1f82922 +.word 0x2ff +.word 0x1f9293d +.word 0x2ff +.word 0x1e703be +.word 0x1f841bc +.word 0x800528f2 +.word 0x1f848bd +.word 0xb0103db +.word 0x2ff +.word 0x80010032 +.word 0x1f850be +.word 0x800d0032 +.word 0x1e05e8b +.word 0x800b0032 +.word 0x1f941bc +.word 0x22000000 +.word 0x1f948bd +.word 0x1fc291f +.word 0x1f950be +.word 0x81c0d73e +.word 0x1e05ecb +.word 0x800e0032 +.word 0x1e0d51b +.word 0x1f6291e +.word 0x2ff +.word 0x800007bf +.word 0x2ff +.word 0x8034067c +.word 0x2ff +.word 0x81c0df3e +.word 0x1e0dd5b +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800c0072 +.word 0x25a59b +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x20b597 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x360707 +.word 0x80000030 +.word 0x25b590 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2701be +.word 0x80000030 +.word 0x9ce71b +.word 0x1f82922 +.word 0x27b1cc +.word 0x80000030 +.word 0x1fc61bc +.word 0x80000030 +.word 0x1fc68bd +.word 0x80000030 +.word 0x1fc70be +.word 0x80000030 +.word 0x1e07f8b +.word 0x80000030 +.word 0x1f841bc +.word 0x80000030 +.word 0x1f848bd +.word 0x80000030 +.word 0x1f850be +.word 0x80000030 +.word 0x1e05e8b +.word 0x819e1bbc +.word 0x1e1f4aa +.word 0x1f72939 +.word 0x26b59b +.word 0x800007bf +.word 0x1c7b59b +.word 0x8035067c +.word 0x2ff +.word 0x81c0d73e +.word 0x2ff +.word 0x80000030 +.word 0x1d291ff +.word 0x80000030 +.word 0x20f1bf +.word 0x1fd293a +.word 0x25addb +.word 0x80000030 +.word 0x1c0f1fc +.word 0x80000030 +.word 0x1e0140b +.word 0x80000030 +.word 0x1e7b595 +.word 0x80000030 +.word 0x20bdd7 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x238416 +.word 0x80000030 +.word 0x1f6b17c +.word 0x800007bf +.word 0x370747 +.word 0x40000036 +.word 0x25bdd0 +.word 0x80060232 +.word 0x238411 +.word 0x50000815 +.word 0x2ff +.word 0x1fa2935 +.word 0x2ff +.word 0x52006813 +.word 0x238c43 +.word 0x26fdf7df +.word 0x2ff +.word 0xb0c73dc +.word 0x2ff +.word 0x52000810 +.word 0x2ff +.word 0x26ff7df7 +.word 0x2ff +.word 0xa8573dc +.word 0x2ff +.word 0x5200080d +.word 0x2ff +.word 0x26ffbefb +.word 0x2ff +.word 0x90b03db +.word 0x2ff +.word 0x5200080a +.word 0x2ff +.word 0x26ffdf7d +.word 0x2ff +.word 0xa4873dc +.word 0x2ff +.word 0x52000807 +.word 0x2ff +.word 0x26ffefbe +.word 0x2ff +.word 0x800b2af1 +.word 0x2ff +.word 0x52000804 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x58005802 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800e7072 +.word 0x2ff +.word 0x80000030 +.word 0x9ce71b +.word 0x80000030 +.word 0x2701be +.word 0x80000030 +.word 0x27b1cc +.word 0x80000030 +.word 0x1f1897d +.word 0x1f82922 +.word 0x1e0d69c +.word 0x3e8a840 +.word 0x1fc61bc +.word 0x3e8b804 +.word 0x1fc68bd +.word 0x3e88805 +.word 0x1fc70be +.word 0x3e89842 +.word 0x1e07f8b +.word 0x3e8d003 +.word 0x1f841bc +.word 0x80000030 +.word 0x1f848bd +.word 0x80000030 +.word 0x1f850be +.word 0x80000030 +.word 0x1e05e8b +.word 0x819e1bbc +.word 0x1e1f4aa +.word 0x1f72939 +.word 0x1c0dd5b +.word 0x8035067c +.word 0x26b59b +.word 0x81c0d73e +.word 0x1c7b59b +.word 0x800841b2 +.word 0x1d291ff +.word 0x80000030 +.word 0x20f1bf +.word 0x80000030 +.word 0x25addb +.word 0x800c5374 +.word 0x1c0f1fc +.word 0x2403ffff +.word 0x1e0140b +.word 0x800c6330 +.word 0x1e7b595 +.word 0x1fd293a +.word 0x20bdd7 +.word 0x80000030 +.word 0x2ff +.word 0x800d0875 +.word 0x238416 +.word 0x80000030 +.word 0x1f6b17c +.word 0x80000030 +.word 0x370747 +.word 0x80000030 +.word 0x25bdd0 +.word 0x80000030 +.word 0x238411 +.word 0x80000030 +.word 0x2ff +.word 0x50000813 +.word 0x2ff +.word 0x1fb291d +.word 0x2ff +.word 0x52006811 +.word 0x238403 +.word 0x26fdf7df +.word 0x2ff +.word 0xb0073dc +.word 0x2ff +.word 0x5200080e +.word 0x2ff +.word 0x26ff7df7 +.word 0x2ff +.word 0xa8573dc +.word 0x2ff +.word 0x5200080b +.word 0x2ff +.word 0x26ffbefb +.word 0x2ff +.word 0xa4873dc +.word 0x2ff +.word 0x52000808 +.word 0x2ff +.word 0x26ffdf7d +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x52000805 +.word 0x2ff +.word 0x26ffefbe +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x52000802 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800e7072 +.word 0x2ff +.word 0x80000030 +.word 0x9def5b +.word 0x80000030 +.word 0x2701be +.word 0x80000030 +.word 0x27b9cc +.word 0x80000030 +.word 0x1f0817d +.word 0x1f9293d +.word 0x1e0dedc +.word 0x3e8a03d +.word 0x1fd61bc +.word 0x3e8b001 +.word 0x1fd68bd +.word 0x3e88002 +.word 0x1fd70be +.word 0x3e8903f +.word 0x1e07fcb +.word 0x3e8d800 +.word 0x1f941bc +.word 0x80000030 +.word 0x1f948bd +.word 0x800528f2 +.word 0x1f950be +.word 0x80000030 +.word 0x1e05ecb +.word 0x819f1bbc +.word 0x1e1fcea +.word 0x1f6291e +.word 0x1c0d51b +.word 0x8034067c +.word 0x26bddb +.word 0x81c0df3e +.word 0x1c7bddb +.word 0x80000030 +.word 0x1d399ff +.word 0x80000030 +.word 0x20f9bf +.word 0x80000030 +.word 0x25a59b +.word 0x80000030 +.word 0x1c0f9fc +.word 0x2403ffff +.word 0x1e0144b +.word 0x80000030 +.word 0x1e7bdd5 +.word 0x1fc291f +.word 0x20b597 +.word 0x80000030 +.word 0x2ff +.word 0x800d0875 +.word 0x238c56 +.word 0x80000030 +.word 0x1f7b97c +.word 0x80000030 +.word 0x360707 +.word 0x80000030 +.word 0x25b590 +.word 0x5a003799 +.word 0x238c51 +.word 0x800637f2 +.word 0x2ff +.word 0x50000813 +.word 0x2ff +.word 0x1fa2935 +.word 0x2ff +.word 0x52006811 +.word 0x238c43 +.word 0x26fdf7df +.word 0x2ff +.word 0xb0c73dc +.word 0x2ff +.word 0x5200080e +.word 0x2ff +.word 0x26ff7df7 +.word 0x2ff +.word 0xa8573dc +.word 0x2ff +.word 0x5200080b +.word 0x2ff +.word 0x26ffbefb +.word 0x2ff +.word 0xa4873dc +.word 0x2ff +.word 0x52000808 +.word 0x2ff +.word 0x26ffdf7d +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x52000805 +.word 0x2ff +.word 0x26ffefbe +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x52000802 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800e7072 +.word 0x2ff +.word 0xa8e03db +.word 0x1f1897d +.word 0x3e8a840 +.word 0x1e0d69c +.word 0x3e8b804 +.word 0x2ff +.word 0x3e88805 +.word 0x2ff +.word 0x3e89842 +.word 0x2ff +.word 0x3e8d003 +.word 0x2ff +.word 0x48007800 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80060172 +.word 0x2ff +.word 0x1f44000 +.word 0x2ff +.word 0x1f54003 +.word 0x2ff +.word 0x1f24006 +.word 0x2ff +.word 0x1f34009 +.word 0x1e002d3 +.word 0x81f403bc +.word 0x2ff +.word 0x80000030 +.word 0x940502 +.word 0x80000030 +.word 0x950542 +.word 0x80000030 +.word 0x920482 +.word 0x80000030 +.word 0x9304c2 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81f503bc +.word 0x180a51c +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81f203bc +.word 0x180ad5c +.word 0x80000030 +.word 0x1e5a2be +.word 0x80000030 +.word 0x1e0350b +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x1e5aabe +.word 0x80000030 +.word 0x1e0354b +.word 0x80000030 +.word 0x2ff +.word 0x81f303bc +.word 0x180949c +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x3c8a000 +.word 0x1809cdc +.word 0x3c8a803 +.word 0x1e592be +.word 0x80000030 +.word 0x1e0348b +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x1e59abe +.word 0x80084332 +.word 0x1e034cb +.word 0x800637f2 +.word 0x2ff +.word 0x3c897fa +.word 0x2ff +.word 0x5a0037d7 +.word 0x2ff +.word 0x3c89ffd +.word 0x2ff +.word 0x48007800 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80060132 +.word 0x2ff +.word 0x1ec4000 +.word 0x2ff +.word 0x1ed4003 +.word 0x2ff +.word 0x1ee4006 +.word 0x2ff +.word 0x1ef4009 +.word 0x2ff +.word 0x1f847c5 +.word 0x2ff +.word 0x1f947c8 +.word 0x2ff +.word 0x1fa47cb +.word 0x2ff +.word 0x1fb47ce +.word 0x2ff +.word 0x1fc47c3 +.word 0x2ff +.word 0x1fd47c6 +.word 0x2ff +.word 0x1fe47c9 +.word 0x2ff +.word 0x1ff47cc +.word 0x2ff +.word 0x80084332 +.word 0x1fc631a +.word 0x3e8c7f6 +.word 0x1fd6b5a +.word 0x3e8cff9 +.word 0x1fe739a +.word 0x3e8d7fc +.word 0x1ff7bda +.word 0x3e8dfff +.word 0x2ff +.word 0x3e867f4 +.word 0x2ff +.word 0x3e86ff7 +.word 0x2ff +.word 0x3e877fa +.word 0x2ff +.word 0x3e87ffd +.word 0x2ff +.word 0x5a0037ea +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x48007800 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x1ff03b8 +.word 0x2ff +.word 0x100a032b +.word 0x2ff +.word 0x800e77f2 +.word 0x2ff +.word 0x800851f2 +.word 0x2ff +.word 0x90c73dc +.word 0x2ff +.word 0x88573dc +.word 0x2ff +.word 0x5200600e +.word 0x2ff +.word 0x84373dc +.word 0x2ff +.word 0x1f4291a +.word 0x2ff +.word 0x1f52935 +.word 0x2ff +.word 0x1f2291d +.word 0x2ff +.word 0x1f61ffb +.word 0x2ff +.word 0x1f71ffe +.word 0x2ff +.word 0x1f01801 +.word 0x2ff +.word 0x1e81837 +.word 0x2ff +.word 0x1e9183a +.word 0x2ff +.word 0x1ea183d +.word 0x2ff +.word 0x1fc1839 +.word 0x2ff +.word 0x1fd183c +.word 0x2ff +.word 0x4000000d +.word 0x2ff +.word 0x1fe183f +.word 0x2ff +.word 0x1f42932 +.word 0x2ff +.word 0x1f5291a +.word 0x2ff +.word 0x1f22935 +.word 0x2ff +.word 0x1f61ffe +.word 0x2ff +.word 0x1f71801 +.word 0x2ff +.word 0x1f01804 +.word 0x2ff +.word 0x1e8183a +.word 0x2ff +.word 0x1e9183d +.word 0x2ff +.word 0x1ea1840 +.word 0x2ff +.word 0x1fc183c +.word 0x2ff +.word 0x1fd183f +.word 0x2ff +.word 0x1fe1842 +.word 0x2ff +.word 0x3e8a000 +.word 0x1f6b13c +.word 0x3e8a803 +.word 0x1f7b93c +.word 0x3e89006 +.word 0x1f0813c +.word 0x3e8a009 +.word 0x2ff +.word 0x3e8b001 +.word 0x2ff +.word 0x3e8b804 +.word 0x2ff +.word 0x3e88007 +.word 0x2ff +.word 0x3e8b00a +.word 0x2ff +.word 0x3e8e002 +.word 0x2ff +.word 0x3e8e805 +.word 0x2ff +.word 0x3e8f008 +.word 0x2ff +.word 0x3e8e00b +.word 0x2ff +.word 0x1f603d0 +.word 0x2ff +.word 0x3e84023 +.word 0x2ff +.word 0x3e84826 +.word 0x2ff +.word 0x3e85029 +.word 0x2ff +.word 0x3e8402c +.word 0x2ff +.word 0x3e8b024 +.word 0x2ff +.word 0x3e8b027 +.word 0x2ff +.word 0x3e8b02a +.word 0x2ff +.word 0x3e8b02d +.word 0x2ff +.word 0x3e8e025 +.word 0x2ff +.word 0x3e8e828 +.word 0x2ff +.word 0x3e8f02b +.word 0x2ff +.word 0x3e8e02e +.word 0x2ff +.word 0x1e703bf +.word 0x1e0368b +.word 0x800040f5 +.word 0x2ff +.word 0x420d004c +.word 0x2ff +.word 0x800500f2 +.word 0x2ff +.word 0x5000281a +.word 0x2ff +.word 0x11062800 +.word 0x2ff +.word 0x420d001e +.word 0x2ff +.word 0x11063000 +.word 0x2ff +.word 0x100803d1 +.word 0x2ff +.word 0x800056fc +.word 0x2ff +.word 0x1e703c0 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x800851b2 +.word 0x2ff +.word 0x3ea3806 +.word 0x2ff +.word 0xb065006 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x100803d5 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x1008502a +.word 0x2ff +.word 0x1003502a +.word 0x2ff +.word 0x800500f2 +.word 0x2ff +.word 0x420d0038 +.word 0x2ff +.word 0x1e703c1 +.word 0x2ff +.word 0x11062800 +.word 0x2ff +.word 0x420d000b +.word 0x2ff +.word 0x11063000 +.word 0x2ff +.word 0x10085023 +.word 0x2ff +.word 0x1001069c +.word 0x2ff +.word 0x800046fc +.word 0x2ff +.word 0x800a0ab1 +.word 0x2ff +.word 0x5a0077a8 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x1e81000 +.word 0x2ff +.word 0x1e91001 +.word 0x2ff +.word 0x48007800 +.word 0x2ff +.word 0x1ea1002 +.word 0x2ff +.word 0x3e83fff +.word 0x2ff +.word 0xb0647ff +.word 0x2ff +.word 0x81f8437c +.word 0x2ff +.word 0x81fb437c +.word 0x2ff +.word 0x81f5437c +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81f503bc +.word 0x1ffad6a +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x1c0ad5c +.word 0x80000030 +.word 0x1e0c61c +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x1e2ad68 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x23ad51 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x23ad56 +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x1fbd97c +.word 0x80000030 +.word 0x1f5a97d +.word 0x80000030 +.word 0x2ff +.word 0x3e8c7fd +.word 0x2ff +.word 0x3e8dffe +.word 0x2ff +.word 0x3e8afff +.word 0x2ff +.word 0x80052ff2 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x52002fdb +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x48006800 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80001935 +.word 0x2ff +.word 0x1f51802 +.word 0x2ff +.word 0x800029b5 +.word 0x2ff +.word 0x1f81800 +.word 0x2ff +.word 0x1fb1801 +.word 0x2ff +.word 0x800318f2 +.word 0x1d5a9ff +.word 0x1f61802 +.word 0x2ff +.word 0x1f91800 +.word 0x2ff +.word 0x1fc1801 +.word 0x2ff +.word 0x800318f2 +.word 0x2ff +.word 0x80000030 +.word 0x1d6b1ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x26fff7df +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000020 +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000800 +.word 0x2ff +.word 0x520008c1 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x81f8cb3c +.word 0x2ff +.word 0x80052ff2 +.word 0x2ff +.word 0x81fbe33c +.word 0x2ff +.word 0x52002fea +.word 0x2ff +.word 0x81f5b33c +.word 0x2ff +.word 0x1f84000 +.word 0x2ff +.word 0x1fb4001 +.word 0x2ff +.word 0x1f54002 +.word 0x2ff +.word 0x800040f5 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x50003099 +.word 0x2ff +.word 0x80003175 +.word 0x2ff +.word 0x80001935 +.word 0x2ff +.word 0x1f51802 +.word 0x2ff +.word 0x800029b5 +.word 0x2ff +.word 0x1f81800 +.word 0x2ff +.word 0x1fb1801 +.word 0x2ff +.word 0x800318f2 +.word 0x1d5a9ff +.word 0x1f61802 +.word 0x2ff +.word 0x1f91800 +.word 0x2ff +.word 0x1fc1801 +.word 0x2ff +.word 0x800318f2 +.word 0x2ff +.word 0x80000030 +.word 0x1d6b1ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x26fffdf7 +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000008 +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000200 +.word 0x2ff +.word 0x520008c1 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x81f8cb3c +.word 0x2ff +.word 0x80052ff2 +.word 0x2ff +.word 0x81fbe33c +.word 0x2ff +.word 0x52002fea +.word 0x2ff +.word 0x81f5b33c +.word 0x2ff +.word 0x1f84000 +.word 0x2ff +.word 0x1fb4001 +.word 0x2ff +.word 0x1f54002 +.word 0x2ff +.word 0x800040f5 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x50003073 +.word 0x2ff +.word 0x80003175 +.word 0x2ff +.word 0x80001935 +.word 0x2ff +.word 0x1f51802 +.word 0x2ff +.word 0x800029b5 +.word 0x2ff +.word 0x1f81800 +.word 0x2ff +.word 0x1fb1801 +.word 0x2ff +.word 0x800318f2 +.word 0x1d5a9ff +.word 0x1f61802 +.word 0x2ff +.word 0x1f91800 +.word 0x2ff +.word 0x1fc1801 +.word 0x2ff +.word 0x800318f2 +.word 0x2ff +.word 0x80000030 +.word 0x1d6b1ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x26fffefb +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000004 +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000100 +.word 0x2ff +.word 0x520008c1 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x81f8cb3c +.word 0x2ff +.word 0x80052ff2 +.word 0x2ff +.word 0x81fbe33c +.word 0x2ff +.word 0x52002fea +.word 0x2ff +.word 0x81f5b33c +.word 0x2ff +.word 0x1f84000 +.word 0x2ff +.word 0x1fb4001 +.word 0x2ff +.word 0x1f54002 +.word 0x2ff +.word 0x800040f5 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x5000304d +.word 0x2ff +.word 0x80003175 +.word 0x2ff +.word 0x80001935 +.word 0x2ff +.word 0x1f51802 +.word 0x2ff +.word 0x800029b5 +.word 0x2ff +.word 0x1f81800 +.word 0x2ff +.word 0x1fb1801 +.word 0x2ff +.word 0x800318f2 +.word 0x1d5a9ff +.word 0x1f61802 +.word 0x2ff +.word 0x1f91800 +.word 0x2ff +.word 0x1fc1801 +.word 0x2ff +.word 0x800318f2 +.word 0x2ff +.word 0x80000030 +.word 0x1d6b1ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x26ffff7d +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000002 +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000080 +.word 0x2ff +.word 0x520008c1 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x81f8cb3c +.word 0x2ff +.word 0x80052ff2 +.word 0x2ff +.word 0x81fbe33c +.word 0x2ff +.word 0x52002fea +.word 0x2ff +.word 0x81f5b33c +.word 0x2ff +.word 0x1f84000 +.word 0x2ff +.word 0x1fb4001 +.word 0x2ff +.word 0x1f54002 +.word 0x2ff +.word 0x800040f5 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x50003027 +.word 0x2ff +.word 0x80003175 +.word 0x2ff +.word 0x80001935 +.word 0x2ff +.word 0x1f51802 +.word 0x2ff +.word 0x800029b5 +.word 0x2ff +.word 0x1f81800 +.word 0x2ff +.word 0x1fb1801 +.word 0x2ff +.word 0x800318f2 +.word 0x1d5a9ff +.word 0x1f61802 +.word 0x2ff +.word 0x1f91800 +.word 0x2ff +.word 0x1fc1801 +.word 0x2ff +.word 0x800318f2 +.word 0x2ff +.word 0x80000030 +.word 0x1d6b1ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x26ffffbe +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000001 +.word 0x2ff +.word 0x520008b0 +.word 0x2ff +.word 0x24000040 +.word 0x2ff +.word 0x520008c1 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x81f8cb3c +.word 0x2ff +.word 0x80052ff2 +.word 0x2ff +.word 0x81fbe33c +.word 0x2ff +.word 0x52002fea +.word 0x2ff +.word 0x81f5b33c +.word 0x2ff +.word 0x1f84000 +.word 0x2ff +.word 0x1fb4001 +.word 0x2ff +.word 0x1f54002 +.word 0x2ff +.word 0x800040f5 +.word 0x2ff +.word 0x81e4c37d +.word 0x2ff +.word 0x81e4db7d +.word 0x2ff +.word 0x81e4ab7d +.word 0x2ff +.word 0x50003001 +.word 0x2ff +.word 0x80003175 +.word 0x2ff +.word 0x48006800 +.word 0x2ff +.word 0x80000030 +.word 0x2ff +.word 0x40000757 +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x81e4c37d +.word 0x1f5b5ec +.word 0x81e4db7d +.word 0x1f8ceac +.word 0x81e4ab7d +.word 0x1fbe76c +.word 0x50032752 +.word 0x2ff +.word 0x80000030 +.word 0x37bf82 +.word 0x80000030 +.word 0x55af83 +.word 0x81def3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1fac6ac +.word 0x80000030 +.word 0x1fddf6c +.word 0x80000030 +.word 0x1f7adec +.word 0x80063072 +.word 0x2ff +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000744 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x80000030 +.word 0x1f6adec +.word 0x80000030 +.word 0x1f9c6ac +.word 0x80000030 +.word 0x1fcdf6c +.word 0x80000030 +.word 0x37bf82 +.word 0x80000030 +.word 0x56b783 +.word 0x81def3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1faceac +.word 0x80000030 +.word 0x1fde76c +.word 0x80000030 +.word 0x1f7b5ec +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000733 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x40000757 +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x81e4c37d +.word 0x1f5b5ec +.word 0x81e4db7d +.word 0x1f8ceac +.word 0x81e4ab7d +.word 0x1fbe76c +.word 0x50032752 +.word 0x2ff +.word 0x80000030 +.word 0x37bf81 +.word 0x80000030 +.word 0x95af83 +.word 0x81bef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1fac6ac +.word 0x80000030 +.word 0x1fddf6c +.word 0x80000030 +.word 0x1f7adec +.word 0x80063072 +.word 0x2ff +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000744 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x80000030 +.word 0x1f6adec +.word 0x80000030 +.word 0x1f9c6ac +.word 0x80000030 +.word 0x1fcdf6c +.word 0x80000030 +.word 0x37bf81 +.word 0x80000030 +.word 0x96b783 +.word 0x81bef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1faceac +.word 0x80000030 +.word 0x1fde76c +.word 0x80000030 +.word 0x1f7b5ec +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000733 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x40000757 +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x81e4c37d +.word 0x1f5b5ec +.word 0x81e4db7d +.word 0x1f8ceac +.word 0x81e4ab7d +.word 0x1fbe76c +.word 0x50032752 +.word 0x2ff +.word 0x80000030 +.word 0x37bf85 +.word 0x80000030 +.word 0x95af87 +.word 0x81bef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1fac6a8 +.word 0x80000030 +.word 0x1fddf68 +.word 0x80000030 +.word 0x1f7ade8 +.word 0x80063072 +.word 0x2ff +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000744 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x80000030 +.word 0x1f6adec +.word 0x80000030 +.word 0x1f9c6ac +.word 0x80000030 +.word 0x1fcdf6c +.word 0x80000030 +.word 0x37bf85 +.word 0x80000030 +.word 0x96b787 +.word 0x81bef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1facea8 +.word 0x80000030 +.word 0x1fde768 +.word 0x80000030 +.word 0x1f7b5e8 +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000733 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x40000757 +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x81e4c37d +.word 0x1f5b5ec +.word 0x81e4db7d +.word 0x1f8ceac +.word 0x81e4ab7d +.word 0x1fbe76c +.word 0x50032752 +.word 0x2ff +.word 0x80000030 +.word 0x37bf80 +.word 0x80000030 +.word 0x115af83 +.word 0x819ef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1fac6ac +.word 0x80000030 +.word 0x1fddf6c +.word 0x80000030 +.word 0x1f7adec +.word 0x80063072 +.word 0x2ff +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000744 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x80000030 +.word 0x1f6adec +.word 0x80000030 +.word 0x1f9c6ac +.word 0x80000030 +.word 0x1fcdf6c +.word 0x80000030 +.word 0x37bf80 +.word 0x80000030 +.word 0x116b783 +.word 0x819ef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1faceac +.word 0x80000030 +.word 0x1fde76c +.word 0x80000030 +.word 0x1f7b5ec +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000733 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x40000757 +.word 0x2ff +.word 0x800637f2 +.word 0x2ff +.word 0x81e4c37d +.word 0x1f5b5ec +.word 0x81e4db7d +.word 0x1f8ceac +.word 0x81e4ab7d +.word 0x1fbe76c +.word 0x50032752 +.word 0x2ff +.word 0x80000030 +.word 0x37bf84 +.word 0x80000030 +.word 0x115af87 +.word 0x819ef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1fac6a8 +.word 0x80000030 +.word 0x1fddf68 +.word 0x80000030 +.word 0x1f7ade8 +.word 0x80063072 +.word 0x2ff +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000744 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff +.word 0x80000030 +.word 0x1f6adec +.word 0x80000030 +.word 0x1f9c6ac +.word 0x80000030 +.word 0x1fcdf6c +.word 0x80000030 +.word 0x37bf84 +.word 0x80000030 +.word 0x116b787 +.word 0x819ef3bc +.word 0x2ff +.word 0x800003bf +.word 0x2ff +.word 0x80000030 +.word 0x1e0d69c +.word 0x80000030 +.word 0x1e0ef5c +.word 0x80000030 +.word 0x1e0bddc +.word 0x80000030 +.word 0x1facea8 +.word 0x80000030 +.word 0x1fde768 +.word 0x80000030 +.word 0x1f7b5e8 +.word 0x81e4d37d +.word 0x2ff +.word 0x81e4eb7d +.word 0x2ff +.word 0x40000733 +.word 0x2ff +.word 0x81e4bb7d +.word 0x2ff \ No newline at end of file