mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 18:44:15 -04:00
Jak3 sky (#3514)
This commit is contained in:
@@ -3540,7 +3540,7 @@
|
||||
(bucket2 2) ;; pc vis stuff
|
||||
(bucket3 3) ;; blit?
|
||||
(tex-lcom-sky-pre 4)
|
||||
(bucket5 5) ;; sky
|
||||
(sky 5) ;; sky
|
||||
(bucket6 6) ;; ocean
|
||||
(bucket7 7) ;; unknown new jak 3 texture upload, for all levels.
|
||||
(hfrag 8) ;; hfrag
|
||||
@@ -4234,7 +4234,7 @@
|
||||
(rn0)
|
||||
(rn1)
|
||||
(rn2)
|
||||
(rn3)
|
||||
(sky)
|
||||
(rn4)
|
||||
(rn5)
|
||||
(hfrag)
|
||||
@@ -4468,6 +4468,8 @@
|
||||
(deftype dma-gif (structure)
|
||||
"Believed unused GIF header type."
|
||||
((gif uint64 2 :offset-assert 0) ;; guessed by decompiler
|
||||
(gif0 uint64 :overlay-at (-> gif 0) :score 1)
|
||||
(gif1 uint64 :overlay-at (-> gif 1) :score 1)
|
||||
(quad uint128 :offset-assert 0 :overlay-at gif)
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -4479,6 +4481,8 @@
|
||||
"The header for a DMA transfer that goes directly to GIF, containing DMA, VIF, GIF tags."
|
||||
((dma-vif dma-packet :inline :offset-assert 0)
|
||||
(gif uint64 2 :offset-assert 16) ;; guessed by decompiler
|
||||
(gif0 uint64 :offset 16 :score -1)
|
||||
(gif1 uint64 :offset 24 :score -1)
|
||||
(quad uint128 2 :offset-assert 0 :overlay-at dma-vif) ;; guessed by decompiler
|
||||
)
|
||||
:method-count-assert 9
|
||||
@@ -5519,6 +5523,32 @@
|
||||
:flag-assert #x900000010
|
||||
)
|
||||
|
||||
; (deftype dma-gif-packet (structure)
|
||||
; "The header for a DMA transfer that goes directly to GIF, containing DMA, VIF, GIF tags."
|
||||
; ((dma-vif dma-packet :inline :offset-assert 0)
|
||||
; ;;(gif uint64 2 :offset-assert 16) ;; guessed by decompiler
|
||||
; (gif0 gif-tag64 :offset 16 :score 1)
|
||||
; (gif1 gif-tag-regs :offset 24 :score 1)
|
||||
; (quad uint128 2 :offset-assert 0 :overlay-at dma-vif) ;; guessed by decompiler
|
||||
; )
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x20
|
||||
; :flag-assert #x900000020
|
||||
; )
|
||||
|
||||
; (deftype dma-gif (structure)
|
||||
; "Believed unused GIF header type."
|
||||
; ((gif uint64 2 :offset-assert 0) ;; guessed by decompiler
|
||||
; (gif0 gif-tag64 :overlay-at (-> gif 0) :score 1)
|
||||
; (gif1 gif-tag-regs :overlay-at (-> gif 1) :score 1)
|
||||
; (quad uint128 :offset-assert 0 :overlay-at gif)
|
||||
; )
|
||||
; :method-count-assert 9
|
||||
; :size-assert #x10
|
||||
; :flag-assert #x900000010
|
||||
; )
|
||||
|
||||
|
||||
(deftype gif-packet (basic)
|
||||
"Unused type for building a dynamically sized gif packet."
|
||||
((reg-count int32 :offset-assert 4)
|
||||
@@ -11484,7 +11514,7 @@
|
||||
(blit-displays-work-method-17 (_type_ vector int float symbol) none) ;; 17
|
||||
(blit-displays-work-method-18 () none) ;; 18
|
||||
(blit-displays-work-method-19 (_type_) none) ;; 19 (called from main.gc)
|
||||
(blit-displays-work-method-20 () none) ;; 20
|
||||
(blit-displays-work-method-20 (_type_) none) ;; 20
|
||||
(get-menu-mode (_type_) symbol) ;; 21
|
||||
(get-screen-copied (_type_) symbol) ;; 22
|
||||
(get-horizontal-flip-flag (_type_) symbol) ;; 23
|
||||
@@ -11715,33 +11745,33 @@
|
||||
(init-sun-data! (_type_ int float float float) none) ;; 9
|
||||
(init-orbit-settings! (_type_ int float float float float float float) none) ;; 10
|
||||
(update-colors-for-time (_type_ float) none) ;; 11
|
||||
(update-time-and-speed (_type_ float float) none) ;; 12
|
||||
(sky-work-method-13 () none) ;; 13
|
||||
(draw (_type_) none) ;; 14 ;; (update-matrix (_type_ matrix) none)
|
||||
(sky-work-method-15 () none) ;; 15 ;; (update-template-colors (_type_) none)
|
||||
(sky-work-method-16 () none) ;; 16 ;; (init-regs-for-large-polygon-draw (_type_) none)
|
||||
(sky-work-method-17 () none) ;; 17 ;; (init-regs-for-sky-asm (_type_) none)
|
||||
(sky-work-method-18 () none) ;; 18 ;; (cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none)
|
||||
(sky-work-method-19 () none) ;; 19 ;; (cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none)
|
||||
(sky-work-method-20 () none) ;; 20 ;; (adjust-cloud-lighting (_type_) none)
|
||||
(sky-work-method-21 () none) ;; 21 ;; (cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none)
|
||||
(sky-work-method-22 () none) ;; 22 ;; (cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none)
|
||||
(sky-work-method-23 () none) ;; 23 ;; (draw-clouds (_type_ dma-buffer) none)
|
||||
(sky-work-method-24 () none) ;; 24 ;; (apply-haze-light (_type_ vector vector haze-lights) none)
|
||||
(sky-work-method-25 () none) ;; 25 ;; (adjust-haze-lighting (_type_) none)
|
||||
(sky-work-method-26 () none) ;; 26 ;; (haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none)
|
||||
(sky-work-method-27 () none) ;; 27 ;; (draw-haze (_type_ dma-buffer) none)
|
||||
(sky-work-method-28 () none) ;; 28 ;; (sun-dma (_type_ dma-buffer) none)
|
||||
(sky-work-method-29 () none) ;; 29 ;; (green-sun-dma (_type_ dma-buffer) none)
|
||||
(sky-work-method-30 () none) ;; 30 ;; (moon-dma (_type_ dma-buffer) none)
|
||||
(sky-work-method-31 () none) ;; 31 ;; (setup-stars (_type_ matrix sky-upload-data) none)
|
||||
(sky-work-method-32 () none) ;; 32 ;; (stars-transform-asm (_type_) none)
|
||||
(sky-work-method-33 () none) ;; 33 ;; (stars-dma (_type_ dma-buffer) none)
|
||||
(sky-work-method-34 () none) ;; 34 ;; (draw-roof (_type_ dma-buffer) none)
|
||||
(sky-work-method-35 () none) ;; 35 ;; (draw-base (_type_ dma-buffer) none)
|
||||
(sky-work-method-36 () none) ;; 36 ;; (draw-fog (_type_ dma-buffer) none)
|
||||
(sky-work-method-37 () none) ;; 37
|
||||
(sky-work-method-38 () none) ;; 38
|
||||
(update-time-and-speed "Update cloud sroll and sun/moon position for the time." (_type_ float float) none) ;; 12
|
||||
(draw-erase (_type_ dma-buffer vector) none) ;; 13
|
||||
(draw (_type_) none) ;; 14
|
||||
(update-camera-matrix "Set the camera matrix (no perspective) for sky drawing." (_type_ matrix) none) ;; 15
|
||||
(update-template-colors "Update work with sky/erase colors from time-of-day/level." (_type_) none) ;; 16
|
||||
(init-regs-for-large-polygon-draw (_type_) none) ;; 17
|
||||
(init-regs-for-sky-asm (_type_) none) ;; 18
|
||||
(cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none) ;; 19
|
||||
(cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none) ;; 20
|
||||
(adjust-cloud-lighting (_type_) none) ;; 21
|
||||
(cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none) ;; 22
|
||||
(cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none) ;; 23
|
||||
(draw-clouds (_type_ dma-buffer) none) ;; 24
|
||||
(apply-haze-light (_type_ vector vector haze-lights float) none) ;; 25
|
||||
(adjust-haze-lighting (_type_) none) ;; 26
|
||||
(haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none) ;; 27
|
||||
(draw-haze (_type_ dma-buffer) none) ;; 28
|
||||
(sun-dma (_type_ dma-buffer) none) ;; 29
|
||||
(green-sun-dma (_type_ dma-buffer) none) ;; 30
|
||||
(moon-dma (_type_ dma-buffer) none) ;; 31
|
||||
(day-star-dma (_type_ dma-buffer) none) ;; 32
|
||||
(setup-stars (_type_ matrix sky-upload-data) none) ;; 33
|
||||
(stars-transform-asm (_type_) none) ;; 34
|
||||
(stars-dma (_type_ dma-buffer) none) ;; 35
|
||||
(draw-roof (_type_ dma-buffer) none) ;; 36
|
||||
(draw-base (_type_ dma-buffer) none) ;; 37
|
||||
(draw-fog (_type_ dma-buffer) none) ;; 38
|
||||
)
|
||||
)
|
||||
|
||||
@@ -32458,13 +32488,13 @@
|
||||
;; sky-tng ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (define-extern set-tex-offset function) ;; (function int int none)
|
||||
(define-extern set-tex-offset (function int int none))
|
||||
;; (define-extern draw-large-polygon function)
|
||||
;; (define-extern clip-polygon-against-positive-hyperplane function)
|
||||
;; (define-extern clip-polygon-against-negative-hyperplane function)
|
||||
;; (define-extern render-sky-quad function) ;; (function (inline-array sky-vertex) dma-buffer none)
|
||||
;; (define-extern render-sky-tri function) ;; (function (inline-array sky-vertex) dma-buffer none)
|
||||
(define-extern close-sky-buffer (function dma-buffer none))
|
||||
(define-extern render-sky-quad (function (inline-array sky-vertex) dma-buffer none))
|
||||
(define-extern render-sky-tri (function (inline-array sky-vertex) dma-buffer none))
|
||||
(define-extern close-sky-buffer "Close DMA buffer for large polygon drawing." (function dma-buffer none))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; load-state ;;
|
||||
|
||||
@@ -608,13 +608,14 @@
|
||||
"draw-large-polygon",
|
||||
"render-sky-quad",
|
||||
"render-sky-tri",
|
||||
"(method 16 sky-work)",
|
||||
"(method 17 sky-work)",
|
||||
"(method 18 sky-work)",
|
||||
"(method 32 sky-work)",
|
||||
"(method 33 sky-work)",
|
||||
// "(method 28 sky-work)",
|
||||
"(method 31 sky-work)",
|
||||
"(method 34 sky-work)",
|
||||
"(method 29 sky-work)",
|
||||
"(method 30 sky-work)",
|
||||
"(method 35 sky-work)",
|
||||
"(method 11 collide-hash)",
|
||||
"(method 12 collide-hash)",
|
||||
"fill-bg-using-box-new",
|
||||
|
||||
@@ -575,6 +575,15 @@
|
||||
["L23", "(inline-array sky-vertex)", 648],
|
||||
["L21", "(inline-array sky-vertex)", 144]
|
||||
],
|
||||
"sky-tng": [
|
||||
["L130", "vector"],
|
||||
["L131", "uint64", true],
|
||||
["L132", "uint64", true],
|
||||
["L133", "uint64", true],
|
||||
["L134", "uint64", true],
|
||||
["L135", "uint64", true],
|
||||
["L136", "uint64", true]
|
||||
],
|
||||
"mood-funcs": [
|
||||
["L198", "uint64", true],
|
||||
["L197", "uint64", true],
|
||||
|
||||
@@ -10845,5 +10845,35 @@
|
||||
"(method 32 bt-vehicle)": [
|
||||
["_stack_", 76, "float"],
|
||||
["_stack_", 100, "float"]
|
||||
],
|
||||
"real-wang-texture-anim-func": [
|
||||
[[3, 31], "v1", "mood-context"]
|
||||
],
|
||||
"(method 24 sky-work)": [
|
||||
[256, "s4", "(pointer int32)"],
|
||||
[261, "s4", "(pointer int32)"]
|
||||
],
|
||||
"(method 28 sky-work)": [
|
||||
[143, "s4", "(pointer int32)"],
|
||||
[148, "s4", "(pointer int32)"]
|
||||
],
|
||||
"(method 36 sky-work)": [
|
||||
[81, "s5", "(pointer int32)"],
|
||||
[86, "s5", "(pointer int32)"]
|
||||
],
|
||||
"(method 37 sky-work)": [
|
||||
[67, "s5", "(pointer int32)"],
|
||||
[72, "s5", "(pointer int32)"]
|
||||
],
|
||||
"(method 38 sky-work)": [
|
||||
[[83, 179], "v1", "(inline-array qword)"]
|
||||
],
|
||||
"(method 14 sky-work)": [
|
||||
[[80, 256], "s4", "sky-work"]
|
||||
],
|
||||
"(method 13 sky-work)": [
|
||||
[65, "v1", "(pointer uint128)"],
|
||||
[[70, 77], "a0", "vector4w"],
|
||||
[[78, 84], "v1", "vector4w"]
|
||||
]
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ void OpenGLRenderer::init_bucket_renderers_jak3() {
|
||||
// 4
|
||||
init_bucket_renderer<TextureUploadHandler>("tex-lcom-sky-pre", BucketCategory::TEX,
|
||||
BucketId::TEX_LCOM_SKY_PRE, texture_animator);
|
||||
init_bucket_renderer<DirectRenderer>("sky", BucketCategory::OTHER, BucketId::SKY, 1024 * 8);
|
||||
|
||||
init_bucket_renderer<OceanMidAndFar>("ocean-mid-far", BucketCategory::OCEAN,
|
||||
BucketId::OCEAN_MID_FAR);
|
||||
|
||||
@@ -417,6 +417,7 @@ enum class BucketId {
|
||||
BUCKET_2 = 2,
|
||||
BLIT_START = 3,
|
||||
TEX_LCOM_SKY_PRE = 4,
|
||||
SKY = 5,
|
||||
OCEAN_MID_FAR = 6,
|
||||
|
||||
HFRAG = 8,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -365,6 +365,19 @@ namespace generic_translucent { extern void link(); }
|
||||
namespace high_speed_reject { extern void link(); }
|
||||
namespace mercneric_convert { extern void link(); }
|
||||
namespace generic_merc_init_asm { extern void link(); }
|
||||
namespace set_tex_offset { extern void link(); }
|
||||
namespace draw_large_polygon { extern void link(); }
|
||||
namespace render_sky_quad { extern void link(); }
|
||||
namespace render_sky_tri { extern void link(); }
|
||||
namespace method_17_sky_work { extern void link(); }
|
||||
namespace method_18_sky_work { extern void link(); }
|
||||
namespace method_29_sky_work { extern void link(); }
|
||||
namespace method_30_sky_work { extern void link(); }
|
||||
namespace method_31_sky_work { extern void link(); }
|
||||
namespace method_34_sky_work { extern void link(); }
|
||||
namespace method_35_sky_work { extern void link(); }
|
||||
namespace method_32_sky_work { extern void link(); }
|
||||
namespace set_sky_vf23_value { extern void link(); }
|
||||
|
||||
}
|
||||
// clang-format on
|
||||
@@ -535,86 +548,90 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
|
||||
jak2::shadow_scissor_top::link, jak2::shadow_scissor_edges::link,
|
||||
jak2::shadow_calc_dual_verts::link, jak2::shadow_xform_verts::link}}},
|
||||
/////////// JAK 3
|
||||
{
|
||||
{"lights",
|
||||
{jak3::light_hash_get_bucket_index::link, jak3::add_light_sphere_to_light_group::link,
|
||||
jak3::light_hash_count_items::link, jak3::light_hash_add_items::link}},
|
||||
{"debug",
|
||||
{jak3::debug_line_clip::link, jak3::init_boundary_regs::link,
|
||||
jak3::draw_boundary_polygon::link, jak3::render_boundary_quad::link,
|
||||
jak3::render_boundary_tri::link, jak3::set_sky_vf27::link}},
|
||||
{"generic-effect",
|
||||
{jak3::generic_light_proc::link, jak3::generic_envmap_proc::link,
|
||||
jak3::generic_prepare_dma_double::link, jak3::generic_prepare_dma_single::link,
|
||||
jak3::generic_warp_source_proc::link, jak3::generic_warp_dest_proc::link,
|
||||
jak3::generic_warp_dest::link, jak3::generic_warp_envmap_dest::link,
|
||||
jak3::generic_no_light_proc::link}},
|
||||
{"font",
|
||||
{jak3::method_9_font_work::link, jak3::draw_string_asm::link,
|
||||
jak3::get_string_length::link}},
|
||||
{"texture", {jak3::adgif_shader_texture_with_update::link}},
|
||||
{"collide-func",
|
||||
{jak3::moving_sphere_triangle_intersect::link, jak3::collide_do_primitives::link}},
|
||||
{"prim", {jak3::method_9_prim_strip::link}},
|
||||
{"joint", {jak3::cspace_parented_transformq_joint::link}},
|
||||
{"foreground",
|
||||
{jak3::foreground_check_longest_edge_asm::link, jak3::foreground_generic_merc::link,
|
||||
jak3::foreground_merc::link, jak3::foreground_draw_hud::link}},
|
||||
{"particle-curves", {jak3::live_func_curve::link, jak3::birth_func_curve::link}},
|
||||
{"collide-hash",
|
||||
{jak3::method_11_collide_hash::link, jak3::method_12_collide_hash::link,
|
||||
jak3::fill_bg_using_box_new::link, jak3::fill_bg_using_line_sphere_new::link}},
|
||||
{"collide-mesh",
|
||||
{jak3::method_12_collide_mesh::link, jak3::method_14_collide_mesh::link,
|
||||
jak3::method_15_collide_mesh::link, jak3::method_10_collide_shape_prim_mesh::link}},
|
||||
{"collide-cache",
|
||||
{jak3::method_10_collide_shape_prim_mesh::link,
|
||||
jak3::method_10_collide_shape_prim_sphere::link,
|
||||
jak3::method_10_collide_shape_prim_group::link,
|
||||
jak3::method_11_collide_shape_prim_mesh::link,
|
||||
jak3::method_11_collide_shape_prim_sphere::link,
|
||||
jak3::method_11_collide_shape_prim_group::link, jak3::method_9_collide_cache_prim::link,
|
||||
jak3::method_10_collide_cache_prim::link, jak3::method_17_collide_cache::link,
|
||||
jak3::method_9_collide_puss_work::link, jak3::method_10_collide_puss_work::link}},
|
||||
{"collide-edge-grab",
|
||||
{jak3::method_10_collide_edge_hold_list::link, jak3::method_19_collide_edge_work::link,
|
||||
jak3::method_9_edge_grab_info::link, jak3::method_17_collide_edge_work::link,
|
||||
jak3::method_16_collide_edge_work::link, jak3::method_18_collide_edge_work::link}},
|
||||
{"spatial-hash",
|
||||
{jak3::method_18_grid_hash::link, jak3::method_19_grid_hash::link,
|
||||
jak3::method_20_grid_hash::link, jak3::method_22_grid_hash::link,
|
||||
jak3::method_28_sphere_hash::link, jak3::method_32_sphere_hash::link,
|
||||
jak3::method_29_sphere_hash::link, jak3::method_30_sphere_hash::link,
|
||||
jak3::method_31_sphere_hash::link, jak3::method_32_spatial_hash::link,
|
||||
jak3::method_38_spatial_hash::link, jak3::method_35_spatial_hash::link,
|
||||
jak3::method_36_spatial_hash::link, jak3::method_34_spatial_hash::link}},
|
||||
{"sparticle-launcher",
|
||||
{jak3::sparticle_motion_blur::link, jak3::sp_launch_particles_var::link,
|
||||
jak3::particle_adgif::link, jak3::sp_init_fields::link}},
|
||||
{"sparticle", {jak3::sp_process_block_2d::link, jak3::sp_process_block_3d::link}},
|
||||
{"nav-engine",
|
||||
{jak3::method_21_nav_engine::link, jak3::method_20_nav_engine::link,
|
||||
jak3::method_18_nav_engine::link, jak3::method_17_nav_engine::link,
|
||||
jak3::nav_state_patch_pointers::link, jak3::nav_dma_send_from_spr_no_flush::link,
|
||||
jak3::nav_dma_send_to_spr_no_flush::link}},
|
||||
{"nav-control", {jak3::method_39_nav_state::link}},
|
||||
{"merc-blend-shape",
|
||||
{jak3::blerc_execute::link, jak3::setup_blerc_chains_for_one_fragment::link}},
|
||||
{"wvehicle-part", {jak3::sparticle_motion_blur_dirt::link}},
|
||||
{"ripple",
|
||||
{jak3::ripple_matrix_scale::link, jak3::ripple_apply_wave_table::link,
|
||||
jak3::ripple_create_wave_table::link, jak3::ripple_execute_init::link}},
|
||||
{"ocean-vu0",
|
||||
{jak3::method_14_ocean::link, jak3::method_15_ocean::link, jak3::method_16_ocean::link}},
|
||||
{"ocean",
|
||||
{jak3::init_ocean_far_regs::link, jak3::draw_large_polygon_ocean::link,
|
||||
jak3::render_ocean_quad::link}},
|
||||
{"generic-merc",
|
||||
{jak3::generic_merc_do_chain::link, jak3::generic_merc_execute_asm::link,
|
||||
jak3::generic_merc_death::link, jak3::generic_merc_query::link,
|
||||
jak3::generic_translucent::link, jak3::high_speed_reject::link,
|
||||
jak3::mercneric_convert::link, jak3::generic_merc_init_asm::link}},
|
||||
}};
|
||||
{{"lights",
|
||||
{jak3::light_hash_get_bucket_index::link, jak3::add_light_sphere_to_light_group::link,
|
||||
jak3::light_hash_count_items::link, jak3::light_hash_add_items::link}},
|
||||
{"debug",
|
||||
{jak3::debug_line_clip::link, jak3::init_boundary_regs::link,
|
||||
jak3::draw_boundary_polygon::link, jak3::render_boundary_quad::link,
|
||||
jak3::render_boundary_tri::link, jak3::set_sky_vf27::link}},
|
||||
{"generic-effect",
|
||||
{jak3::generic_light_proc::link, jak3::generic_envmap_proc::link,
|
||||
jak3::generic_prepare_dma_double::link, jak3::generic_prepare_dma_single::link,
|
||||
jak3::generic_warp_source_proc::link, jak3::generic_warp_dest_proc::link,
|
||||
jak3::generic_warp_dest::link, jak3::generic_warp_envmap_dest::link,
|
||||
jak3::generic_no_light_proc::link}},
|
||||
{"font",
|
||||
{jak3::method_9_font_work::link, jak3::draw_string_asm::link, jak3::get_string_length::link}},
|
||||
{"texture", {jak3::adgif_shader_texture_with_update::link}},
|
||||
{"collide-func",
|
||||
{jak3::moving_sphere_triangle_intersect::link, jak3::collide_do_primitives::link}},
|
||||
{"prim", {jak3::method_9_prim_strip::link}},
|
||||
{"joint", {jak3::cspace_parented_transformq_joint::link}},
|
||||
{"foreground",
|
||||
{jak3::foreground_check_longest_edge_asm::link, jak3::foreground_generic_merc::link,
|
||||
jak3::foreground_merc::link, jak3::foreground_draw_hud::link}},
|
||||
{"particle-curves", {jak3::live_func_curve::link, jak3::birth_func_curve::link}},
|
||||
{"collide-hash",
|
||||
{jak3::method_11_collide_hash::link, jak3::method_12_collide_hash::link,
|
||||
jak3::fill_bg_using_box_new::link, jak3::fill_bg_using_line_sphere_new::link}},
|
||||
{"collide-mesh",
|
||||
{jak3::method_12_collide_mesh::link, jak3::method_14_collide_mesh::link,
|
||||
jak3::method_15_collide_mesh::link, jak3::method_10_collide_shape_prim_mesh::link}},
|
||||
{"collide-cache",
|
||||
{jak3::method_10_collide_shape_prim_mesh::link,
|
||||
jak3::method_10_collide_shape_prim_sphere::link,
|
||||
jak3::method_10_collide_shape_prim_group::link,
|
||||
jak3::method_11_collide_shape_prim_mesh::link,
|
||||
jak3::method_11_collide_shape_prim_sphere::link,
|
||||
jak3::method_11_collide_shape_prim_group::link, jak3::method_9_collide_cache_prim::link,
|
||||
jak3::method_10_collide_cache_prim::link, jak3::method_17_collide_cache::link,
|
||||
jak3::method_9_collide_puss_work::link, jak3::method_10_collide_puss_work::link}},
|
||||
{"collide-edge-grab",
|
||||
{jak3::method_10_collide_edge_hold_list::link, jak3::method_19_collide_edge_work::link,
|
||||
jak3::method_9_edge_grab_info::link, jak3::method_17_collide_edge_work::link,
|
||||
jak3::method_16_collide_edge_work::link, jak3::method_18_collide_edge_work::link}},
|
||||
{"spatial-hash",
|
||||
{jak3::method_18_grid_hash::link, jak3::method_19_grid_hash::link,
|
||||
jak3::method_20_grid_hash::link, jak3::method_22_grid_hash::link,
|
||||
jak3::method_28_sphere_hash::link, jak3::method_32_sphere_hash::link,
|
||||
jak3::method_29_sphere_hash::link, jak3::method_30_sphere_hash::link,
|
||||
jak3::method_31_sphere_hash::link, jak3::method_32_spatial_hash::link,
|
||||
jak3::method_38_spatial_hash::link, jak3::method_35_spatial_hash::link,
|
||||
jak3::method_36_spatial_hash::link, jak3::method_34_spatial_hash::link}},
|
||||
{"sparticle-launcher",
|
||||
{jak3::sparticle_motion_blur::link, jak3::sp_launch_particles_var::link,
|
||||
jak3::particle_adgif::link, jak3::sp_init_fields::link}},
|
||||
{"sparticle", {jak3::sp_process_block_2d::link, jak3::sp_process_block_3d::link}},
|
||||
{"nav-engine",
|
||||
{jak3::method_21_nav_engine::link, jak3::method_20_nav_engine::link,
|
||||
jak3::method_18_nav_engine::link, jak3::method_17_nav_engine::link,
|
||||
jak3::nav_state_patch_pointers::link, jak3::nav_dma_send_from_spr_no_flush::link,
|
||||
jak3::nav_dma_send_to_spr_no_flush::link}},
|
||||
{"nav-control", {jak3::method_39_nav_state::link}},
|
||||
{"merc-blend-shape",
|
||||
{jak3::blerc_execute::link, jak3::setup_blerc_chains_for_one_fragment::link}},
|
||||
{"wvehicle-part", {jak3::sparticle_motion_blur_dirt::link}},
|
||||
{"ripple",
|
||||
{jak3::ripple_matrix_scale::link, jak3::ripple_apply_wave_table::link,
|
||||
jak3::ripple_create_wave_table::link, jak3::ripple_execute_init::link}},
|
||||
{"ocean-vu0",
|
||||
{jak3::method_14_ocean::link, jak3::method_15_ocean::link, jak3::method_16_ocean::link}},
|
||||
{"ocean",
|
||||
{jak3::init_ocean_far_regs::link, jak3::draw_large_polygon_ocean::link,
|
||||
jak3::render_ocean_quad::link}},
|
||||
{"generic-merc",
|
||||
{jak3::generic_merc_do_chain::link, jak3::generic_merc_execute_asm::link,
|
||||
jak3::generic_merc_death::link, jak3::generic_merc_query::link,
|
||||
jak3::generic_translucent::link, jak3::high_speed_reject::link,
|
||||
jak3::mercneric_convert::link, jak3::generic_merc_init_asm::link}},
|
||||
{"sky-tng",
|
||||
{jak3::set_tex_offset::link, jak3::render_sky_quad::link, jak3::render_sky_tri::link,
|
||||
jak3::method_17_sky_work::link, jak3::method_18_sky_work::link,
|
||||
jak3::method_29_sky_work::link, jak3::method_30_sky_work::link,
|
||||
jak3::method_31_sky_work::link, jak3::method_34_sky_work::link,
|
||||
jak3::method_35_sky_work::link, jak3::method_32_sky_work::link,
|
||||
jak3::set_sky_vf23_value::link, jak3::draw_large_polygon::link}}}};
|
||||
|
||||
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {
|
||||
const auto& it = m_executes.insert({name, {exec, Ptr<u8>()}});
|
||||
|
||||
@@ -354,6 +354,8 @@
|
||||
(deftype dma-gif (structure)
|
||||
"Believed unused GIF header type."
|
||||
((gif uint64 2)
|
||||
(gif0 uint64 :overlay-at (-> gif 0))
|
||||
(gif1 uint64 :overlay-at (-> gif 1))
|
||||
(quad uint128 :overlay-at (-> gif 0))
|
||||
)
|
||||
)
|
||||
@@ -363,6 +365,8 @@
|
||||
"The header for a DMA transfer that goes directly to GIF, containing DMA, VIF, GIF tags."
|
||||
((dma-vif dma-packet :inline)
|
||||
(gif uint64 2)
|
||||
(gif0 uint64 :overlay-at (-> gif 0))
|
||||
(gif1 uint64 :overlay-at (-> gif 1))
|
||||
(quad uint128 2 :overlay-at (-> dma-vif dma))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1536,14 +1536,14 @@
|
||||
(set! (-> pp clock) gp-2)
|
||||
)
|
||||
|
||||
; ;; draw sky
|
||||
; (with-profiler 'sky *profile-sky-color*
|
||||
; (if (-> *sky-work* draw-vortex)
|
||||
; (draw-vortex)
|
||||
; (draw *sky-work*)
|
||||
; )
|
||||
; (flush-cache 0)
|
||||
; )
|
||||
;; draw sky
|
||||
(with-profiler 'sky *profile-sky-color*
|
||||
(if (-> *sky-work* draw-vortex)
|
||||
(draw-vortex)
|
||||
(draw *sky-work*)
|
||||
)
|
||||
(flush-cache 0)
|
||||
)
|
||||
|
||||
|
||||
; ;; draw ocean
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
(blit-displays-work-method-17 (_type_ vector int float symbol) none)
|
||||
(blit-displays-work-method-18 () none)
|
||||
(blit-displays-work-method-19 (_type_) none)
|
||||
(blit-displays-work-method-20 () none)
|
||||
(blit-displays-work-method-20 (_type_) none)
|
||||
(get-menu-mode (_type_) symbol)
|
||||
(get-screen-copied (_type_) symbol)
|
||||
(get-horizontal-flip-flag (_type_) symbol)
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
(bucket-id-16 gmerc-l5-tfrag)
|
||||
(bucket-id-16 tex-l5-tfrag)
|
||||
(bucket-id-16 gmerc2-l5-tfrag)
|
||||
(bucket-id-16 bucket5)
|
||||
(bucket-id-16 sky)
|
||||
(bucket-id-16 merc-l5-pris)
|
||||
(bucket-id-16 emerc-l5-pris)
|
||||
(bucket-id-16 gmerc-l5-pris)
|
||||
|
||||
@@ -114,7 +114,7 @@ At any point in time, there are 3 frames in progress:
|
||||
(set! (-> gp-0 pmode) (new 'static 'gs-pmode :en1 #x1 :crtmd #x1 :mmod #x1 :slbg #x1))
|
||||
(set! (-> gp-0 run-half-speed) #f)
|
||||
(set! (-> gp-0 vu1-enable-user-menu) (vu1-renderer-mask
|
||||
rn3
|
||||
sky
|
||||
rn4
|
||||
rn5
|
||||
hfrag
|
||||
@@ -150,7 +150,7 @@ At any point in time, there are 3 frames in progress:
|
||||
)
|
||||
)
|
||||
(set! (-> gp-0 vu1-enable-user) (vu1-renderer-mask
|
||||
rn3
|
||||
sky
|
||||
rn4
|
||||
rn5
|
||||
hfrag
|
||||
|
||||
@@ -14,49 +14,120 @@
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x1000000000008005 #xe)
|
||||
:gif0 (new 'static 'gif-tag64 :nloop #x5 :eop #x1 :nreg #x1)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d))
|
||||
)
|
||||
:draw-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x502b400000008001 #x42421)
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1)
|
||||
:nreg #x5
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs
|
||||
:regs0 (gif-reg-id rgbaq)
|
||||
:regs1 (gif-reg-id st)
|
||||
:regs2 (gif-reg-id xyzf2)
|
||||
:regs3 (gif-reg-id st)
|
||||
:regs4 (gif-reg-id xyzf2)
|
||||
)
|
||||
)
|
||||
:draw-tmpl2 (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x50ab400000008001 #x43431)
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1)
|
||||
:nreg #x5
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs
|
||||
:regs0 (gif-reg-id rgbaq)
|
||||
:regs1 (gif-reg-id uv)
|
||||
:regs2 (gif-reg-id xyzf2)
|
||||
:regs3 (gif-reg-id uv)
|
||||
:regs4 (gif-reg-id xyzf2)
|
||||
)
|
||||
)
|
||||
:fog-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #xa :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #xa :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x902a400000008001 #x424242421)
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :tme #x1 :abe #x1)
|
||||
:nreg #x9
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs
|
||||
:regs0 (gif-reg-id rgbaq)
|
||||
:regs1 (gif-reg-id st)
|
||||
:regs2 (gif-reg-id xyzf2)
|
||||
:regs3 (gif-reg-id st)
|
||||
:regs4 (gif-reg-id xyzf2)
|
||||
:regs5 (gif-reg-id st)
|
||||
:regs6 (gif-reg-id xyzf2)
|
||||
:regs7 (gif-reg-id st)
|
||||
:regs8 (gif-reg-id xyzf2)
|
||||
)
|
||||
)
|
||||
:blend-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x50ab400000008001 #x43431)
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type sprite) :tme #x1 :abe #x1 :fst #x1)
|
||||
:nreg #x5
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs
|
||||
:regs0 (gif-reg-id rgbaq)
|
||||
:regs1 (gif-reg-id uv)
|
||||
:regs2 (gif-reg-id xyzf2)
|
||||
:regs3 (gif-reg-id uv)
|
||||
:regs4 (gif-reg-id xyzf2)
|
||||
)
|
||||
)
|
||||
:sprite-tmpl (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x3 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x2003400000008001 #x55)
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type sprite))
|
||||
:nreg #x2
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id xyz2) :regs1 (gif-reg-id xyz2))
|
||||
)
|
||||
:sprite-tmpl2 (new 'static 'dma-gif-packet
|
||||
:dma-vif (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x21 :id (dma-tag-id cnt))
|
||||
:vif1 (new 'static 'vif-tag :imm #x21 :cmd (vif-cmd direct) :msk #x1)
|
||||
)
|
||||
:gif (new 'static 'array uint64 2 #x2003400000008010 #x55)
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x10
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type sprite))
|
||||
:nreg #x2
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id xyz2) :regs1 (gif-reg-id xyz2))
|
||||
)
|
||||
:sun-coords (new 'static 'inline-array vector 2
|
||||
(new 'static 'vector :x -267.0 :y -267.0 :w 1.0)
|
||||
@@ -112,10 +183,46 @@
|
||||
(new 'static 'vector4w :x #x387528 :y #x723099 :z #x140983 :w #x874310)
|
||||
(new 'static 'vector4w :x #x2387 :y #x129818 :z #x219810 :w #x623790)
|
||||
)
|
||||
:giftag-base (new 'static 'dma-gif :gif (new 'static 'array uint64 2 #x3002c00000008001 #x412))
|
||||
:giftag-haze (new 'static 'dma-gif :gif (new 'static 'array uint64 2 #x3026c00000008001 #x412))
|
||||
:giftag-roof (new 'static 'dma-gif :gif (new 'static 'array uint64 2 #x302ec00000008001 #x412))
|
||||
:giftag-ocean (new 'static 'dma-gif :gif (new 'static 'array uint64 2 #x301ec00000008001 #x412))
|
||||
:giftag-base (new 'static 'dma-gif
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan))
|
||||
:nreg #x3
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
|
||||
)
|
||||
:giftag-haze (new 'static 'dma-gif
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :abe #x1)
|
||||
:nreg #x3
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
|
||||
)
|
||||
:giftag-roof (new 'static 'dma-gif
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :abe #x1)
|
||||
:nreg #x3
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
|
||||
)
|
||||
:giftag-ocean (new 'static 'dma-gif
|
||||
:gif0 (new 'static 'gif-tag64
|
||||
:nloop #x1
|
||||
:eop #x1
|
||||
:pre #x1
|
||||
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1)
|
||||
:nreg #x3
|
||||
)
|
||||
:gif1 (new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
|
||||
)
|
||||
:draw-vortex #f
|
||||
:day-star-scale 1.0
|
||||
:disable-day-star #f
|
||||
|
||||
@@ -198,32 +198,32 @@
|
||||
(init-orbit-settings! (_type_ int float float float float float float) none)
|
||||
(update-colors-for-time (_type_ float) none)
|
||||
(update-time-and-speed (_type_ float float) none)
|
||||
(sky-work-method-13 () none)
|
||||
(draw-erase (_type_ dma-buffer vector) none)
|
||||
(draw (_type_) none)
|
||||
(sky-work-method-15 () none)
|
||||
(sky-work-method-16 () none)
|
||||
(sky-work-method-17 () none)
|
||||
(sky-work-method-18 () none)
|
||||
(sky-work-method-19 () none)
|
||||
(sky-work-method-20 () none)
|
||||
(sky-work-method-21 () none)
|
||||
(sky-work-method-22 () none)
|
||||
(sky-work-method-23 () none)
|
||||
(sky-work-method-24 () none)
|
||||
(sky-work-method-25 () none)
|
||||
(sky-work-method-26 () none)
|
||||
(sky-work-method-27 () none)
|
||||
(sky-work-method-28 () none)
|
||||
(sky-work-method-29 () none)
|
||||
(sky-work-method-30 () none)
|
||||
(sky-work-method-31 () none)
|
||||
(sky-work-method-32 () none)
|
||||
(sky-work-method-33 () none)
|
||||
(sky-work-method-34 () none)
|
||||
(sky-work-method-35 () none)
|
||||
(sky-work-method-36 () none)
|
||||
(sky-work-method-37 () none)
|
||||
(sky-work-method-38 () none)
|
||||
(update-camera-matrix (_type_ matrix) none)
|
||||
(update-template-colors (_type_) none)
|
||||
(init-regs-for-large-polygon-draw (_type_) none)
|
||||
(init-regs-for-sky-asm (_type_) none)
|
||||
(cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none)
|
||||
(cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none)
|
||||
(adjust-cloud-lighting (_type_) none)
|
||||
(cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none)
|
||||
(cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none)
|
||||
(draw-clouds (_type_ dma-buffer) none)
|
||||
(apply-haze-light (_type_ vector vector haze-lights float) none)
|
||||
(adjust-haze-lighting (_type_) none)
|
||||
(haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none)
|
||||
(draw-haze (_type_ dma-buffer) none)
|
||||
(sun-dma (_type_ dma-buffer) none)
|
||||
(green-sun-dma (_type_ dma-buffer) none)
|
||||
(moon-dma (_type_ dma-buffer) none)
|
||||
(day-star-dma (_type_ dma-buffer) none)
|
||||
(setup-stars (_type_ matrix sky-upload-data) none)
|
||||
(stars-transform-asm (_type_) none)
|
||||
(stars-dma (_type_ dma-buffer) none)
|
||||
(draw-roof (_type_ dma-buffer) none)
|
||||
(draw-base (_type_ dma-buffer) none)
|
||||
(draw-fog (_type_ dma-buffer) none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -5,16 +5,31 @@
|
||||
;; name in dgo: sky-tng
|
||||
;; dgos: GAME
|
||||
|
||||
(def-mips2c set-sky-vf23-value (function int none))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(def-mips2c set-tex-offset (function int int none))
|
||||
|
||||
;; these can't be called directly from GOAL
|
||||
;; (def-mips2c draw-large-polygon function)
|
||||
;; (def-mips2c clip-polygon-against-positive-hyperplane function)
|
||||
;; (def-mips2c clip-polygon-against-negative-hyperplane function)
|
||||
|
||||
(def-mips2c render-sky-quad (function (inline-array sky-vertex) dma-buffer none))
|
||||
(def-mips2c render-sky-tri (function (inline-array sky-vertex) dma-buffer none))
|
||||
|
||||
;; WARN: Return type mismatch pointer vs none.
|
||||
;; ERROR: Function may read a register that is not set: ra
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [jr ra]
|
||||
(defun close-sky-buffer ((arg0 dma-buffer))
|
||||
"Terminate dma from large polygon renderer. This should be called after the last
|
||||
call to render-sky-tri/quad."
|
||||
"Close DMA buffer for large polygon drawing."
|
||||
(local-vars (ra-0 none))
|
||||
(nop!)
|
||||
(let ((v1-0 #x8000)
|
||||
(v0-0 (-> arg0 base))
|
||||
)
|
||||
(set! (-> (the-as (pointer uint128) v0-0)) (the uint128 0))
|
||||
(set! (-> (the-as (pointer int128) v0-0)) (the int128 0))
|
||||
(nop!)
|
||||
(set! (-> (the-as (pointer int32) v0-0)) v1-0)
|
||||
(let ((v0-1 (&+ v0-0 16)))
|
||||
@@ -26,7 +41,47 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod update-camera-matrix ((this sky-work) (arg0 matrix))
|
||||
"Set the camera matrix (no perspective) for sky drawing."
|
||||
(rlet ((vf0 :class vf))
|
||||
(init-vf0-vector)
|
||||
(let ((v1-0 (-> this cam-mat)))
|
||||
(let* ((a0-1 v1-0)
|
||||
(t0-0 arg0)
|
||||
(a1-1 (-> t0-0 rvec quad))
|
||||
(a2-0 (-> t0-0 uvec quad))
|
||||
(a3-0 (-> t0-0 fvec quad))
|
||||
(t0-1 (-> t0-0 trans quad))
|
||||
)
|
||||
(set! (-> a0-1 rvec quad) a1-1)
|
||||
(set! (-> a0-1 uvec quad) a2-0)
|
||||
(set! (-> a0-1 fvec quad) a3-0)
|
||||
(set! (-> a0-1 trans quad) t0-1)
|
||||
)
|
||||
(.svf (&-> v1-0 trans quad) vf0)
|
||||
(matrix*! v1-0 v1-0 (-> *math-camera* perspective))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod update-template-colors ((this sky-work))
|
||||
"Update work with sky/erase colors from time-of-day/level."
|
||||
(let ((v1-1 (-> *time-of-day-context* current-fog erase-color))
|
||||
(a0-2 (-> *level* level-default mood-context current-sky-color))
|
||||
)
|
||||
(dotimes (a1-1 12)
|
||||
(set! (-> sky-base-polygons a1-1 col quad) (-> v1-1 quad))
|
||||
(set! (-> sky-roof-polygons a1-1 col quad) (-> a0-2 quad))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod update-time-and-speed ((this sky-work) (arg0 float) (arg1 float))
|
||||
"Update cloud sroll and sun/moon position for the time."
|
||||
(if (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest))
|
||||
(set! arg1 (* 10.0 arg1))
|
||||
)
|
||||
@@ -40,6 +95,10 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod-mips2c "(method 17 sky-work)" 17 sky-work)
|
||||
|
||||
(defmethod-mips2c "(method 18 sky-work)" 18 sky-work)
|
||||
|
||||
(defmethod update-colors-for-time ((this sky-work) (arg0 float))
|
||||
0
|
||||
0
|
||||
@@ -82,3 +141,618 @@
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod cloud-vtx-light-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector4)))
|
||||
(let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1))
|
||||
(f1-1 (vector-dot (-> arg2 sun1-normal) arg1))
|
||||
(f2-1 (vector-dot (-> arg2 moon-normal) arg1))
|
||||
(f0-2 (fmax 0.0 f0-1))
|
||||
(f30-0 (fmax 0.0 f1-1))
|
||||
(f28-0 (fmax 0.0 f2-1))
|
||||
)
|
||||
(set! (-> s5-0 quad) (-> arg4 quad))
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 arg3) f0-2)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 sun1-color)) f30-0)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 moon-color)) f28-0)
|
||||
)
|
||||
(vector4-scale! s5-0 s5-0 128.0)
|
||||
(set! (-> arg0 x) (fmax 0.0 (fmin 255.0 (-> s5-0 x))))
|
||||
(set! (-> arg0 y) (fmax 0.0 (fmin 255.0 (-> s5-0 y))))
|
||||
(set! (-> arg0 z) (fmax 0.0 (fmin 255.0 (-> s5-0 z))))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod cloud-vtx-tex-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector4))
|
||||
(s2-0 (new 'stack-no-clear 'vector4))
|
||||
(s4-0 (new 'stack-no-clear 'vector4))
|
||||
(f28-0 0.00390625)
|
||||
(f30-0 0.015625)
|
||||
)
|
||||
(set! (-> arg0 quad) (-> arg1 quad))
|
||||
(vector--float*! (the-as vector s5-0) arg2 (-> arg3 sun0-normal) 9.0)
|
||||
(vector--float*! (the-as vector s2-0) arg2 (-> arg3 sun1-normal) 9.0)
|
||||
(vector--float*! (the-as vector s4-0) arg2 (-> arg3 moon-normal) 9.0)
|
||||
(vector4-scale! s5-0 s5-0 (* (-> arg3 sun0-scale) f28-0))
|
||||
(vector4-madd! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> arg3 sun1-scale)))
|
||||
(vector4-madd! s5-0 s5-0 s4-0 (* (-> arg3 moon-scale) f28-0))
|
||||
(+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0)))
|
||||
(+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0)))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod adjust-cloud-lighting ((this sky-work))
|
||||
(let ((s5-0 *cloud-vert-array*)
|
||||
(s4-0 (-> this cloud-lights))
|
||||
)
|
||||
(set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0))
|
||||
(set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0))
|
||||
(set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad))
|
||||
(vector-normalize! (-> s4-0 sun0-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 sun1-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 moon-normal) 1.0)
|
||||
(set! (-> s4-0 sun0-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun0-normal y))))))
|
||||
(set! (-> s4-0 sun1-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun1-normal y))))))
|
||||
(set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y))))))
|
||||
(let ((s1-0 (-> s4-0 ambi-color))
|
||||
(s2-0 (-> s4-0 ambi-color-lower))
|
||||
(s3-0 (-> this sun0-color-lower))
|
||||
)
|
||||
(let ((f30-0 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y))))))
|
||||
(f28-0 (* 0.3333 (fmax 0.0 (fmin 1.0 (+ -1.0 (* 8.0 (-> s4-0 sun0-normal y)))))))
|
||||
)
|
||||
(vector4-scale! (the-as vector4 s2-0) (the-as vector4 (-> this ambi-color-lower)) f30-0)
|
||||
(vector4-madd! (the-as vector4 s2-0) (the-as vector4 s2-0) (the-as vector4 s3-0) f28-0)
|
||||
(vector4-scale! (the-as vector4 s1-0) (the-as vector4 (-> this ambi-color)) f30-0)
|
||||
(vector4-madd! (the-as vector4 s1-0) (the-as vector4 s1-0) (the-as vector4 s3-0) f28-0)
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 sun0-color))
|
||||
(the-as vector4 (-> this sun0-color))
|
||||
(-> s4-0 sun0-scale)
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 sun1-color))
|
||||
(the-as vector4 (-> this sun1-color))
|
||||
(* 0.5 (-> s4-0 sun1-scale))
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 moon-color))
|
||||
(the-as vector4 (-> this moon-color))
|
||||
(-> s4-0 moon-scale)
|
||||
)
|
||||
(vector4-scale! (the-as vector4 (-> s4-0 sun0-color-lower)) (the-as vector4 s3-0) (-> s4-0 sun0-scale))
|
||||
)
|
||||
(dotimes (s3-1 100)
|
||||
(let ((s2-1 (-> s5-0 data s3-1)))
|
||||
(cloud-vtx-light-update this (-> s2-1 col) (-> s2-1 nrm) s4-0 (-> s4-0 sun0-color) (-> s4-0 ambi-color))
|
||||
(cloud-vtx-light-update
|
||||
this
|
||||
(-> s2-1 col2)
|
||||
(-> s2-1 nrm2)
|
||||
s4-0
|
||||
(-> s4-0 sun0-color-lower)
|
||||
(-> s4-0 ambi-color-lower)
|
||||
)
|
||||
(cloud-vtx-tex-update this (-> s2-1 stq2) (-> s2-1 stq) (-> s2-1 pos) s4-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod cloud-vtx1-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex))
|
||||
(set! (-> arg0 pos quad) (-> arg1 pos quad))
|
||||
(set! (-> arg0 stq quad) (-> arg1 stq quad))
|
||||
(set! (-> arg0 col quad) (-> arg1 col quad))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod cloud-vtx2-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex))
|
||||
(set! (-> arg0 pos quad) (-> arg1 pos quad))
|
||||
(set! (-> arg0 stq quad) (-> arg1 stq2 quad))
|
||||
(set! (-> arg0 col quad) (-> arg1 col2 quad))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod draw-clouds ((this sky-work) (arg0 dma-buffer))
|
||||
(local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int))
|
||||
|
||||
(when (zero? *sky-texture-anim-array*) ;; added
|
||||
(return #f)
|
||||
)
|
||||
|
||||
(rlet ((vf23 :class vf)
|
||||
(vf27 :class vf)
|
||||
)
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(test-1 (new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x50
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
)
|
||||
(tex0-1 (new 'static 'gs-tex0
|
||||
:tbp0 #x100
|
||||
:tbw #x2
|
||||
:psm #x1b
|
||||
:tcc #x1
|
||||
:cbp #x300
|
||||
:cld #x1
|
||||
:th (log2 128)
|
||||
:tw (log2 128)
|
||||
)
|
||||
)
|
||||
(tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(clamp-1 (new 'static 'gs-clamp))
|
||||
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
|
||||
(texflush 0)
|
||||
)
|
||||
; (.lvf vf27 (&-> this giftag-roof quad))
|
||||
; (let ((v1-18 #x43c80000))
|
||||
; (.mov vf23 v1-18)
|
||||
; )
|
||||
; (.mov v1-19 vf23)
|
||||
;; og:preserve-this
|
||||
(set-sky-vf27 (&-> this giftag-roof quad))
|
||||
(set-sky-vf23-value #x43c80000)
|
||||
(set-tex-offset (the-as int (-> this off-s)) (the-as int (-> this off-t)))
|
||||
(let ((s4-1 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(set! sv-16 *cloud-vert-array*)
|
||||
(set! sv-20 *cloud-poly*)
|
||||
(dotimes (s3-1 9)
|
||||
(dotimes (s2-2 9)
|
||||
(let ((s1-0 (+ (* 10 s3-1) s2-2)))
|
||||
(set! sv-32 (+ (* 9 s3-1) s2-2))
|
||||
(let ((s0-0 (+ s2-2 81 (* 9 s3-1))))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1)))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11)))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 3)) (-> sv-16 data (+ s1-0 10)))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (* s0-0 4)) (-> sv-16 data s1-0))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 1)) (-> sv-16 data (+ s1-0 1)))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 2)) (-> sv-16 data (+ s1-0 11)))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 3)) (-> sv-16 data (+ s1-0 10)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(dotimes (s5-1 162)
|
||||
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
|
||||
)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-81 (/ (the-as int (+ (- -16 (the-as int s4-1)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s4-1)) (logior #x10000000 (shr (shl v1-81 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s4-1) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s4-1) 3) (the-as int (logior #x50000000 (shr (shl v1-81 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod apply-haze-light ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights) (arg3 float))
|
||||
(let* ((s5-0 (new 'stack-no-clear 'vector4))
|
||||
(f0-1 (vector-dot (-> arg2 sun0-normal) arg1))
|
||||
(f1-1 (vector-dot (-> arg2 sun1-normal) arg1))
|
||||
(f2-1 (vector-dot (-> arg2 moon-normal) arg1))
|
||||
(s3-0 (* arg3 (fmax 0.0 (fmin 1.0 (- 1.0 f0-1)))))
|
||||
)
|
||||
(let ((f0-2 (fmax 0.0 f0-1))
|
||||
(f30-0 (fmax 0.0 f1-1))
|
||||
(f28-0 (fmax 0.0 f2-1))
|
||||
)
|
||||
(set! (-> s5-0 quad) (-> arg2 ambi-color quad))
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 sun0-color)) f0-2)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 sun1-color)) f30-0)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 moon-color)) f28-0)
|
||||
)
|
||||
(vector4-scale! s5-0 s5-0 128.0)
|
||||
(set! (-> arg0 x) (fmax (fmin 255.0 (-> s5-0 x)) s3-0))
|
||||
(set! (-> arg0 y) (fmax (fmin 255.0 (-> s5-0 y)) s3-0))
|
||||
(set! (-> arg0 z) (fmax (fmin 255.0 (-> s5-0 z)) s3-0))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod adjust-haze-lighting ((this sky-work))
|
||||
(let ((s5-0 *haze-vert-array*)
|
||||
(s4-0 (-> this haze-lights))
|
||||
)
|
||||
(set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0))
|
||||
(set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0))
|
||||
(set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad))
|
||||
(vector-normalize! (-> s4-0 sun0-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 sun1-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 moon-normal) 1.0)
|
||||
(set! (-> s4-0 sun0-scale) (fmax 0.0 (fmin 1.0 (* 4.0 (+ 0.25 (-> s4-0 sun0-normal y))))))
|
||||
(set! (-> s4-0 sun1-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun1-normal y))))))
|
||||
(set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y))))))
|
||||
(let ((s3-0 (-> s4-0 ambi-color)))
|
||||
(-> this sun0-color-lower)
|
||||
(let ((f30-0 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y))))))
|
||||
(f0-8 (fmax 0.0 (fmin 1.0 (* 5.0 (+ 0.125 (-> s4-0 sun0-normal y))))))
|
||||
(s2-0 (new 'stack-no-clear 'vector4))
|
||||
)
|
||||
(set-vector! s2-0 1.15 0.0 0.5 1.0)
|
||||
(vector4-lerp! (the-as vector s2-0) (the-as vector s2-0) (-> this sun0-color) f0-8)
|
||||
(vector4-scale! (the-as vector4 s3-0) (the-as vector4 (-> this ambi-color)) f30-0)
|
||||
(vector4-scale! (the-as vector4 (-> s4-0 sun0-color)) s2-0 (-> s4-0 sun0-scale))
|
||||
)
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 sun1-color))
|
||||
(the-as vector4 (-> this sun1-color))
|
||||
(* 0.5 (-> s4-0 sun1-scale))
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 moon-color))
|
||||
(the-as vector4 (-> this moon-color))
|
||||
(-> s4-0 moon-scale)
|
||||
)
|
||||
(let ((f30-1 (* 144.0 (fmax 0.0 (fmin 1.0 (* 16.0 (-> s4-0 sun0-normal y)))))))
|
||||
(dotimes (s3-1 36)
|
||||
(let ((v1-28 (-> s5-0 data s3-1)))
|
||||
(apply-haze-light this (-> v1-28 col) (-> v1-28 nrm) s4-0 f30-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod haze-vtx-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex))
|
||||
(set! (-> arg0 pos quad) (-> arg2 pos quad))
|
||||
(set! (-> arg0 col quad) (-> arg2 col quad))
|
||||
(set! (-> arg0 col w) 128.0)
|
||||
(set! (-> arg1 pos quad) (-> arg2 pos quad))
|
||||
(set! (-> arg1 col quad) (-> arg2 col quad))
|
||||
(set! (-> arg1 pos y) 3.0)
|
||||
(set! (-> arg1 col w) 0.0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod draw-haze ((this sky-work) (arg0 dma-buffer))
|
||||
(local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex)))
|
||||
(rlet ((vf27 :class vf))
|
||||
(dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)))
|
||||
(init-regs-for-large-polygon-draw this)
|
||||
;; (.lvf vf27 (&-> this giftag-haze quad))
|
||||
(set-sky-vf27 (&-> this giftag-haze quad))
|
||||
(let ((s4-0 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(set! sv-16 *haze-vert-array*)
|
||||
(set! sv-20 *haze-poly*)
|
||||
(dotimes (s3-0 35)
|
||||
(haze-vtx-to-sky this (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0))
|
||||
(haze-vtx-to-sky this (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1)))
|
||||
)
|
||||
(haze-vtx-to-sky this (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35))
|
||||
(haze-vtx-to-sky this (-> sv-20 143) (-> sv-20 142) (the-as haze-vertex (-> sv-16 data)))
|
||||
(dotimes (s5-1 36)
|
||||
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
|
||||
)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-41 (/ (the-as int (+ (- -16 (the-as int s4-0)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s4-0)) (logior #x10000000 (shr (shl v1-41 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s4-0) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s4-0) 3) (the-as int (logior #x50000000 (shr (shl v1-41 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod-mips2c "(method 29 sky-work)" 29 sky-work)
|
||||
|
||||
(defmethod-mips2c "(method 30 sky-work)" 30 sky-work)
|
||||
|
||||
(defmethod-mips2c "(method 31 sky-work)" 31 sky-work)
|
||||
|
||||
(defmethod setup-stars ((this sky-work) (arg0 matrix) (arg1 sky-upload-data))
|
||||
(set! (-> arg0 fvec quad) (-> arg1 data 0))
|
||||
(vector-normalize! (-> arg0 fvec) 1.0)
|
||||
(vector-cross! (-> arg0 rvec) *z-vector* (-> arg0 fvec))
|
||||
(vector-normalize! (-> arg0 rvec) 1.0)
|
||||
(vector-cross! (-> arg0 uvec) (-> arg0 fvec) (-> arg0 rvec))
|
||||
(vector-normalize! (-> arg0 uvec) 1.0)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s4-1 quad) (-> arg1 data 0))
|
||||
(vector-normalize! s4-1 -1.0)
|
||||
(let ((f0-1 (fmax 0.0 (fmin 1.0 (* 20.0 (+ 0.05 (-> s4-1 y)))))))
|
||||
(if (= (-> *setting-control* user-current sky-type) 'star-field)
|
||||
(set! f0-1 1.0)
|
||||
)
|
||||
(dotimes (v1-11 16)
|
||||
(let ((f1-4 (* (- 128.0 (* 8.0 (the float v1-11))) f0-1)))
|
||||
(set-vector! (-> this star-colors v1-11) (the int f1-4) (the int f1-4) (the int f1-4) 128)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod-mips2c "(method 34 sky-work)" 34 sky-work)
|
||||
|
||||
(defmethod-mips2c "(method 35 sky-work)" 35 sky-work)
|
||||
|
||||
(defmethod draw-roof ((this sky-work) (arg0 dma-buffer))
|
||||
(rlet ((vf27 :class vf))
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
|
||||
(test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)))
|
||||
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
|
||||
)
|
||||
(init-regs-for-large-polygon-draw this)
|
||||
;; (.lvf vf27 (&-> this giftag-base quad))
|
||||
(set-sky-vf27 (&-> this giftag-base quad))
|
||||
(let ((s5-1 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 0)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 3)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 6)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 9)) arg0)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-14 (/ (the-as int (+ (- -16 (the-as int s5-1)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s5-1)) (logior #x10000000 (shr (shl v1-14 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s5-1) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s5-1) 3) (the-as int (logior #x50000000 (shr (shl v1-14 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod draw-base ((this sky-work) (arg0 dma-buffer))
|
||||
(rlet ((vf27 :class vf))
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)))
|
||||
)
|
||||
(let ((s5-0 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
;; (.lvf vf27 (&-> this giftag-base quad))
|
||||
(set-sky-vf27 (&-> this giftag-base quad))
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 0)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 3)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 6)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 9)) arg0)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-12 (/ (the-as int (+ (- -16 (the-as int s5-0)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s5-0)) (logior #x10000000 (shr (shl v1-12 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s5-0) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s5-0) 3) (the-as int (logior #x50000000 (shr (shl v1-12 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod draw-fog ((this sky-work) (arg0 dma-buffer))
|
||||
(when (zero? *sky-texture-anim-array*) ;; added
|
||||
(return #f)
|
||||
)
|
||||
(let ((s4-0 (-> *sky-texture-anim-array* array-data 8 tex)))
|
||||
(if s4-0
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(tex0-1 (new 'static 'gs-tex0
|
||||
:tcc #x1
|
||||
:cld #x1
|
||||
:psm (the-as int (-> s4-0 psm))
|
||||
:cpsm (-> s4-0 clutpsm)
|
||||
:cbp (-> s4-0 clutdest)
|
||||
:th (log2 (-> s4-0 h))
|
||||
:tw (log2 (-> s4-0 w))
|
||||
:tbw (-> s4-0 width 0)
|
||||
:tbp0 (-> s4-0 dest 0)
|
||||
)
|
||||
)
|
||||
(tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(test-1 (new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x70
|
||||
:afail #x3
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
)
|
||||
(clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
|
||||
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(let* ((v1-26 (the-as (inline-array qword) (-> arg0 base)))
|
||||
(a0-22 *fog-texture-work*)
|
||||
(f0-0 (-> a0-22 min-corner y))
|
||||
(f4-0 (- (-> a0-22 max-corner y) f0-0))
|
||||
(f3-0 (/ (- (-> a0-22 corner 1 y) f0-0) f4-0))
|
||||
(f2-0 (/ (- (-> a0-22 corner 0 y) f0-0) f4-0))
|
||||
(f1-7 (/ (- (-> a0-22 corner 3 y) f0-0) f4-0))
|
||||
(f0-2 (/ (- (-> a0-22 corner 2 y) f0-0) f4-0))
|
||||
(a0-23 6400)
|
||||
)
|
||||
(set! (-> v1-26 0 quad) (-> this fog-tmpl dma-vif quad))
|
||||
(set! (-> v1-26 1 quad) (-> this fog-tmpl quad 1))
|
||||
(set-vector! (-> v1-26 2 vector4w) 128 128 128 128)
|
||||
(set-vector! (-> v1-26 3 vector4w) (the-as int f3-0) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(set-vector! (-> v1-26 4 vector4w) #x7000 #x7300 a0-23 0)
|
||||
(set-vector! (-> v1-26 5 vector4w) (the-as int f2-0) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(set-vector! (-> v1-26 6 vector4w) #x9000 #x7300 a0-23 0)
|
||||
(set-vector! (-> v1-26 7 vector4w) (the-as int f1-7) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(set-vector! (-> v1-26 8 vector4w) #x7000 #x8d00 a0-23 0)
|
||||
(set-vector! (-> v1-26 9 vector4w) (the-as int f0-2) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(let ((v1-27 (the-as (inline-array qword) (-> v1-26 10))))
|
||||
(set! (-> v1-27 0 vector4w x) #x9000)
|
||||
(set! (-> v1-27 0 vector4w y) #x8d00)
|
||||
(set! (-> v1-27 0 vector4w z) a0-23)
|
||||
(set! (-> v1-27 0 vector4w w) 0)
|
||||
)
|
||||
)
|
||||
(&+! (-> arg0 base) 176)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod-mips2c "(method 32 sky-work)" 32 sky-work)
|
||||
|
||||
(defmethod draw-erase ((this sky-work) (arg0 dma-buffer) (arg1 vector))
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
|
||||
(test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)))
|
||||
(rgbaq (new 'static 'gs-rgbaq
|
||||
:q 1.0
|
||||
:a (the int (-> arg1 w))
|
||||
:b (the int (-> arg1 z))
|
||||
:g (the int (-> arg1 y))
|
||||
:r (the int (-> arg1 x))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-3 (-> arg0 base)))
|
||||
(set! (-> (the-as (pointer uint128) v1-3)) (-> this sprite-tmpl dma-vif quad))
|
||||
(set! (-> (the-as (pointer uint128) v1-3) 1) (-> this sprite-tmpl quad 1))
|
||||
)
|
||||
(&+! (-> arg0 base) 32)
|
||||
(let ((v1-6 (-> arg0 base)))
|
||||
(set-vector! (the-as vector4w (&+ v1-6 0)) #x7000 #x7300 0 0)
|
||||
(set-vector! (the-as vector4w (&+ v1-6 16)) #x9000 #x8d00 0 0)
|
||||
)
|
||||
(&+! (-> arg0 base) 32)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod draw ((this sky-work))
|
||||
(let ((s4-0 *time-of-day-context*)
|
||||
(v1-0 #f)
|
||||
)
|
||||
(dotimes (a0-1 (-> *level* length))
|
||||
(let ((a1-3 (-> *level* level a0-1)))
|
||||
(when (= (-> a1-3 status) 'active)
|
||||
(if (and (= (-> a1-3 display?) 'display) (logtest? (-> a1-3 info level-flags) (level-flags lf9)))
|
||||
(set! v1-0 #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((and v1-0
|
||||
(logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask sky))
|
||||
(logtest? (-> *texture-pool* texture-enable-user) (texture-enable-mask sky))
|
||||
)
|
||||
(let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf base)))
|
||||
(let ((a1-9 (if (-> s4-0 use-camera-other)
|
||||
(-> *math-camera* camera-rot-other)
|
||||
(-> *math-camera* camera-rot)
|
||||
)
|
||||
)
|
||||
)
|
||||
(update-camera-matrix this a1-9)
|
||||
)
|
||||
(update-template-colors this)
|
||||
(adjust-haze-lighting this)
|
||||
(adjust-cloud-lighting this)
|
||||
(let ((s4-1 (the-as sky-work *fake-scratchpad-data*)))
|
||||
(mem-copy! (the-as pointer s4-1) (the-as pointer this) #x2814)
|
||||
(setup-stars s4-1 (-> s4-1 star-mat) (-> this upload-data))
|
||||
(when (nonzero? (-> s4-1 star-colors 0 x))
|
||||
(format *stdcon* "doing stars asm!~%")
|
||||
(format *stdcon* "~`matrix`I~%" (-> s4-1 star-mat))
|
||||
(stars-transform-asm s4-1)
|
||||
)
|
||||
(cond
|
||||
((= (-> *setting-control* user-current sky-type) 'star-field)
|
||||
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(draw-erase s4-1 s3-0 (new 'static 'vector :w 128.0))
|
||||
(init-regs-for-sky-asm s4-1)
|
||||
(stars-dma s4-1 s3-0)
|
||||
(sun-dma s4-1 s3-0)
|
||||
(green-sun-dma s4-1 s3-0)
|
||||
(moon-dma s4-1 s3-0)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(draw-roof s4-1 s2-0)
|
||||
(init-regs-for-sky-asm s4-1)
|
||||
(if (nonzero? (-> s4-1 star-colors 0 x))
|
||||
(stars-dma s4-1 s2-0)
|
||||
)
|
||||
(sun-dma s4-1 s2-0)
|
||||
(green-sun-dma s4-1 s2-0)
|
||||
(moon-dma s4-1 s2-0)
|
||||
(cond
|
||||
((or (task-node-closed? (game-task-node precursor-destroy-ship-resolution)) (-> this disable-day-star))
|
||||
(set! (-> *time-of-day* 0 day-star-enable) #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> *time-of-day* 0 day-star-enable) #t)
|
||||
(day-star-dma s4-1 s2-0)
|
||||
)
|
||||
)
|
||||
(draw-haze s4-1 s2-0)
|
||||
(draw-clouds s4-1 s2-0)
|
||||
(draw-base s4-1 s2-0)
|
||||
(draw-fog s4-1 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-45 *dma-mem-usage*))
|
||||
(when (nonzero? a0-45)
|
||||
(set! (-> a0-45 length) (max 90 (-> a0-45 length)))
|
||||
(set! (-> a0-45 data 89 name) "sky")
|
||||
(+! (-> a0-45 data 89 count) 1)
|
||||
(+! (-> a0-45 data 89 used)
|
||||
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint gp-0))
|
||||
)
|
||||
(set! (-> a0-45 data 89 total) (-> a0-45 data 89 used))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((get-menu-mode *blit-displays-work*)
|
||||
(with-dma-buffer-add-bucket ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(blit-displays-work-method-20 *blit-displays-work*)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(with-dma-buffer-add-bucket ((s3-2 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(draw-erase this s3-2 (-> s4-0 current-fog erase-color))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
(bucket2 2) ;; pc vis stuff
|
||||
(bucket3 3) ;; blit?
|
||||
(tex-lcom-sky-pre 4)
|
||||
(bucket5 5) ;; sky
|
||||
(sky 5) ;; sky
|
||||
(bucket6 6) ;; ocean
|
||||
(bucket7 7) ;; unknown new jak 3 texture upload, for all levels.
|
||||
(hfrag 8) ;; hfrag
|
||||
@@ -700,7 +700,7 @@
|
||||
(rn0)
|
||||
(rn1)
|
||||
(rn2)
|
||||
(rn3)
|
||||
(sky)
|
||||
(rn4)
|
||||
(rn5)
|
||||
(hfrag)
|
||||
|
||||
+5
-1
@@ -55,6 +55,8 @@
|
||||
(deftype dma-gif (structure)
|
||||
"Believed unused GIF header type."
|
||||
((gif uint64 2)
|
||||
(gif0 uint64 :overlay-at (-> gif 0))
|
||||
(gif1 uint64 :overlay-at (-> gif 1))
|
||||
(quad uint128 :overlay-at (-> gif 0))
|
||||
)
|
||||
)
|
||||
@@ -67,7 +69,7 @@
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" this 'dma-gif)
|
||||
(format #t "~1Tgif[2] @ #x~X~%" (-> this gif))
|
||||
(format #t "~1Tgif[2] @ #x~X~%" (&-> this gif0))
|
||||
(format #t "~1Tquad: ~D~%" (-> this quad))
|
||||
(label cfg-4)
|
||||
this
|
||||
@@ -78,6 +80,8 @@
|
||||
"The header for a DMA transfer that goes directly to GIF, containing DMA, VIF, GIF tags."
|
||||
((dma-vif dma-packet :inline)
|
||||
(gif uint64 2)
|
||||
(gif0 uint64 :overlay-at (-> gif 0))
|
||||
(gif1 uint64 :overlay-at (-> gif 1))
|
||||
(quad uint128 2 :overlay-at (-> dma-vif dma))
|
||||
)
|
||||
)
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@
|
||||
(blit-displays-work-method-17 (_type_ vector int float symbol) none)
|
||||
(blit-displays-work-method-18 () none)
|
||||
(blit-displays-work-method-19 (_type_) none)
|
||||
(blit-displays-work-method-20 () none)
|
||||
(blit-displays-work-method-20 (_type_) none)
|
||||
(get-menu-mode (_type_) symbol)
|
||||
(get-screen-copied (_type_) symbol)
|
||||
(get-horizontal-flip-flag (_type_) symbol)
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@
|
||||
(bucket-id-16 gmerc-l5-tfrag)
|
||||
(bucket-id-16 tex-l5-tfrag)
|
||||
(bucket-id-16 gmerc2-l5-tfrag)
|
||||
(bucket-id-16 bucket5)
|
||||
(bucket-id-16 sky)
|
||||
(bucket-id-16 merc-l5-pris)
|
||||
(bucket-id-16 emerc-l5-pris)
|
||||
(bucket-id-16 gmerc-l5-pris)
|
||||
|
||||
+2
-2
@@ -157,7 +157,7 @@
|
||||
(set! (-> gp-0 pmode) (new 'static 'gs-pmode :en1 #x1 :crtmd #x1 :mmod #x1 :slbg #x1))
|
||||
(set! (-> gp-0 run-half-speed) #f)
|
||||
(set! (-> gp-0 vu1-enable-user-menu) (vu1-renderer-mask
|
||||
rn3
|
||||
sky
|
||||
rn4
|
||||
rn5
|
||||
hfrag
|
||||
@@ -193,7 +193,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> gp-0 vu1-enable-user) (vu1-renderer-mask
|
||||
rn3
|
||||
sky
|
||||
rn4
|
||||
rn5
|
||||
hfrag
|
||||
|
||||
+1163
File diff suppressed because it is too large
Load Diff
+25
-25
@@ -410,32 +410,32 @@
|
||||
(init-orbit-settings! (_type_ int float float float float float float) none)
|
||||
(update-colors-for-time (_type_ float) none)
|
||||
(update-time-and-speed (_type_ float float) none)
|
||||
(sky-work-method-13 () none)
|
||||
(draw-erase (_type_ dma-buffer vector) none)
|
||||
(draw (_type_) none)
|
||||
(sky-work-method-15 () none)
|
||||
(sky-work-method-16 () none)
|
||||
(sky-work-method-17 () none)
|
||||
(sky-work-method-18 () none)
|
||||
(sky-work-method-19 () none)
|
||||
(sky-work-method-20 () none)
|
||||
(sky-work-method-21 () none)
|
||||
(sky-work-method-22 () none)
|
||||
(sky-work-method-23 () none)
|
||||
(sky-work-method-24 () none)
|
||||
(sky-work-method-25 () none)
|
||||
(sky-work-method-26 () none)
|
||||
(sky-work-method-27 () none)
|
||||
(sky-work-method-28 () none)
|
||||
(sky-work-method-29 () none)
|
||||
(sky-work-method-30 () none)
|
||||
(sky-work-method-31 () none)
|
||||
(sky-work-method-32 () none)
|
||||
(sky-work-method-33 () none)
|
||||
(sky-work-method-34 () none)
|
||||
(sky-work-method-35 () none)
|
||||
(sky-work-method-36 () none)
|
||||
(sky-work-method-37 () none)
|
||||
(sky-work-method-38 () none)
|
||||
(update-camera-matrix (_type_ matrix) none)
|
||||
(update-template-colors (_type_) none)
|
||||
(init-regs-for-large-polygon-draw (_type_) none)
|
||||
(init-regs-for-sky-asm (_type_) none)
|
||||
(cloud-vtx-light-update (_type_ vector vector cloud-lights vector vector) none)
|
||||
(cloud-vtx-tex-update (_type_ vector vector vector cloud-lights) none)
|
||||
(adjust-cloud-lighting (_type_) none)
|
||||
(cloud-vtx1-to-sky (_type_ sky-vertex cloud-vertex) none)
|
||||
(cloud-vtx2-to-sky (_type_ sky-vertex cloud-vertex) none)
|
||||
(draw-clouds (_type_ dma-buffer) none)
|
||||
(apply-haze-light (_type_ vector vector haze-lights float) none)
|
||||
(adjust-haze-lighting (_type_) none)
|
||||
(haze-vtx-to-sky (_type_ sky-vertex sky-vertex haze-vertex) none)
|
||||
(draw-haze (_type_ dma-buffer) none)
|
||||
(sun-dma (_type_ dma-buffer) none)
|
||||
(green-sun-dma (_type_ dma-buffer) none)
|
||||
(moon-dma (_type_ dma-buffer) none)
|
||||
(day-star-dma (_type_ dma-buffer) none)
|
||||
(setup-stars (_type_ matrix sky-upload-data) none)
|
||||
(stars-transform-asm (_type_) none)
|
||||
(stars-dma (_type_ dma-buffer) none)
|
||||
(draw-roof (_type_ dma-buffer) none)
|
||||
(draw-base (_type_ dma-buffer) none)
|
||||
(draw-fog (_type_ dma-buffer) none)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+819
@@ -0,0 +1,819 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for function set-tex-offset
|
||||
;; INFO: function output is handled by mips2c
|
||||
(def-mips2c set-tex-offset (function int int none))
|
||||
|
||||
;; definition for function draw-large-polygon
|
||||
;; INFO: function output is handled by mips2c
|
||||
(def-mips2c draw-large-polygon function)
|
||||
|
||||
;; definition for function clip-polygon-against-positive-hyperplane
|
||||
;; INFO: function output is handled by mips2c
|
||||
(def-mips2c clip-polygon-against-positive-hyperplane function)
|
||||
|
||||
;; definition for function clip-polygon-against-negative-hyperplane
|
||||
;; INFO: function output is handled by mips2c
|
||||
(def-mips2c clip-polygon-against-negative-hyperplane function)
|
||||
|
||||
;; definition for function render-sky-quad
|
||||
;; INFO: function output is handled by mips2c
|
||||
(def-mips2c render-sky-quad (function (inline-array sky-vertex) dma-buffer none))
|
||||
|
||||
;; definition for function render-sky-tri
|
||||
;; INFO: function output is handled by mips2c
|
||||
(def-mips2c render-sky-tri (function (inline-array sky-vertex) dma-buffer none))
|
||||
|
||||
;; definition for function close-sky-buffer
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch pointer vs none.
|
||||
;; ERROR: Function may read a register that is not set: ra
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [jr ra]
|
||||
(defun close-sky-buffer ((arg0 dma-buffer))
|
||||
"Close DMA buffer for large polygon drawing."
|
||||
(local-vars (ra-0 none))
|
||||
(nop!)
|
||||
(let ((v1-0 #x8000)
|
||||
(v0-0 (-> arg0 base))
|
||||
)
|
||||
(set! (-> (the-as (pointer int128) v0-0)) 0)
|
||||
(nop!)
|
||||
(set! (-> (the-as (pointer int32) v0-0)) v1-0)
|
||||
(let ((v0-1 (&+ v0-0 16)))
|
||||
(.jr ra-0)
|
||||
(set! (-> arg0 base) v0-1)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 15 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update-camera-matrix ((this sky-work) (arg0 matrix))
|
||||
"Set the camera matrix (no perspective) for sky drawing."
|
||||
(rlet ((vf0 :class vf))
|
||||
(init-vf0-vector)
|
||||
(let ((v1-0 (-> this cam-mat)))
|
||||
(let* ((a0-1 v1-0)
|
||||
(t0-0 arg0)
|
||||
(a1-1 (-> t0-0 rvec quad))
|
||||
(a2-0 (-> t0-0 uvec quad))
|
||||
(a3-0 (-> t0-0 fvec quad))
|
||||
(t0-1 (-> t0-0 trans quad))
|
||||
)
|
||||
(set! (-> a0-1 rvec quad) a1-1)
|
||||
(set! (-> a0-1 uvec quad) a2-0)
|
||||
(set! (-> a0-1 fvec quad) a3-0)
|
||||
(set! (-> a0-1 trans quad) t0-1)
|
||||
)
|
||||
(.svf (&-> v1-0 trans quad) vf0)
|
||||
(matrix*! v1-0 v1-0 (-> *math-camera* perspective))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 16 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update-template-colors ((this sky-work))
|
||||
"Update work with sky/erase colors from time-of-day/level."
|
||||
(let ((v1-1 (-> *time-of-day-context* current-fog erase-color))
|
||||
(a0-2 (-> *level* level-default mood-context current-sky-color))
|
||||
)
|
||||
(dotimes (a1-1 12)
|
||||
(set! (-> sky-base-polygons a1-1 col quad) (-> v1-1 quad))
|
||||
(set! (-> sky-roof-polygons a1-1 col quad) (-> a0-2 quad))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type sky-work
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update-time-and-speed ((this sky-work) (arg0 float) (arg1 float))
|
||||
"Update cloud sroll and sun/moon position for the time."
|
||||
(if (and (level-get-target-inside *level*) (= (-> (level-get-target-inside *level*) info taskname) 'nest))
|
||||
(set! arg1 (* 10.0 arg1))
|
||||
)
|
||||
(sky-make-sun-data this 0 arg0)
|
||||
(sky-make-sun-data this 1 arg0)
|
||||
(sky-make-moon-data this arg0)
|
||||
(+! (-> this off-s) (the int (* -8.0 arg1)))
|
||||
(+! (-> this off-t) (the int (* 2.0 arg1)))
|
||||
(set! (-> this time) arg0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 17 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 17 sky-work)" 17 sky-work)
|
||||
|
||||
;; definition for method 18 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 18 sky-work)" 18 sky-work)
|
||||
|
||||
;; definition for method 11 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod update-colors-for-time ((this sky-work) (arg0 float))
|
||||
0
|
||||
0
|
||||
0.0
|
||||
(let ((s5-0 *no-cloud-mood-color-table*))
|
||||
(let ((s3-0 (-> *level* level-default mood-context))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(let* ((v1-3 (the int arg0))
|
||||
(f0-4 (- arg0 (the float v1-3)))
|
||||
(f1-3 (- 1.0 f0-4))
|
||||
(a0-4 (/ v1-3 24))
|
||||
(a1-2 (-> *mood-interp-table* hour (- v1-3 (* 24 a0-4))))
|
||||
(a0-7 (-> a1-2 snapshot1))
|
||||
(v1-7 (-> a1-2 snapshot2))
|
||||
(f0-6 (+ (* f1-3 (-> a1-2 morph-start)) (* f0-4 (-> a1-2 morph-end))))
|
||||
)
|
||||
(cond
|
||||
((= a0-7 v1-7)
|
||||
(set! (-> this sun0-color quad) (-> s5-0 data a0-7 lgt-color quad))
|
||||
)
|
||||
(else
|
||||
(let ((a1-5 (-> s5-0 data a0-7))
|
||||
(v1-11 (-> s5-0 data v1-7))
|
||||
)
|
||||
(vector4-lerp! (-> this sun0-color) (-> a1-5 lgt-color) (-> v1-11 lgt-color) f0-6)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> this sun0-color-lower quad) (-> s3-0 times 1 quad))
|
||||
(set! (-> this ambi-color-lower quad) (-> s3-0 times 0 quad))
|
||||
(set-vector! s4-0 1.9921875 1.9921875 1.9921875 1.0)
|
||||
(vector4-lerp! (-> this ambi-color) (-> this ambi-color-lower) s4-0 (-> *mood-control* lightning-flash))
|
||||
)
|
||||
(set! (-> this sun0-color quad) (-> this sun0-color quad))
|
||||
(set! (-> this sun1-color quad) (-> s5-0 data 7 lgt-color quad))
|
||||
(set! (-> this moon-color quad) (-> s5-0 data 6 lgt-color quad))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 19 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod cloud-vtx-light-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 cloud-lights) (arg3 vector) (arg4 vector))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector4)))
|
||||
(let* ((f0-1 (vector-dot (-> arg2 sun0-normal) arg1))
|
||||
(f1-1 (vector-dot (-> arg2 sun1-normal) arg1))
|
||||
(f2-1 (vector-dot (-> arg2 moon-normal) arg1))
|
||||
(f0-2 (fmax 0.0 f0-1))
|
||||
(f30-0 (fmax 0.0 f1-1))
|
||||
(f28-0 (fmax 0.0 f2-1))
|
||||
)
|
||||
(set! (-> s5-0 quad) (-> arg4 quad))
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 arg3) f0-2)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 sun1-color)) f30-0)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 moon-color)) f28-0)
|
||||
)
|
||||
(vector4-scale! s5-0 s5-0 128.0)
|
||||
(set! (-> arg0 x) (fmax 0.0 (fmin 255.0 (-> s5-0 x))))
|
||||
(set! (-> arg0 y) (fmax 0.0 (fmin 255.0 (-> s5-0 y))))
|
||||
(set! (-> arg0 z) (fmax 0.0 (fmin 255.0 (-> s5-0 z))))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 20 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod cloud-vtx-tex-update ((this sky-work) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 cloud-lights))
|
||||
(let ((s5-0 (new 'stack-no-clear 'vector4))
|
||||
(s2-0 (new 'stack-no-clear 'vector4))
|
||||
(s4-0 (new 'stack-no-clear 'vector4))
|
||||
(f28-0 0.00390625)
|
||||
(f30-0 0.015625)
|
||||
)
|
||||
(set! (-> arg0 quad) (-> arg1 quad))
|
||||
(vector--float*! (the-as vector s5-0) arg2 (-> arg3 sun0-normal) 9.0)
|
||||
(vector--float*! (the-as vector s2-0) arg2 (-> arg3 sun1-normal) 9.0)
|
||||
(vector--float*! (the-as vector s4-0) arg2 (-> arg3 moon-normal) 9.0)
|
||||
(vector4-scale! s5-0 s5-0 (* (-> arg3 sun0-scale) f28-0))
|
||||
(vector4-madd! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> arg3 sun1-scale)))
|
||||
(vector4-madd! s5-0 s5-0 s4-0 (* (-> arg3 moon-scale) f28-0))
|
||||
(+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0)))
|
||||
(+! (-> arg0 y) (fmax (fmin (-> s5-0 z) f30-0) (- f30-0)))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 21 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod adjust-cloud-lighting ((this sky-work))
|
||||
(let ((s5-0 *cloud-vert-array*)
|
||||
(s4-0 (-> this cloud-lights))
|
||||
)
|
||||
(set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0))
|
||||
(set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0))
|
||||
(set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad))
|
||||
(vector-normalize! (-> s4-0 sun0-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 sun1-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 moon-normal) 1.0)
|
||||
(set! (-> s4-0 sun0-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun0-normal y))))))
|
||||
(set! (-> s4-0 sun1-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun1-normal y))))))
|
||||
(set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y))))))
|
||||
(let ((s1-0 (-> s4-0 ambi-color))
|
||||
(s2-0 (-> s4-0 ambi-color-lower))
|
||||
(s3-0 (-> this sun0-color-lower))
|
||||
)
|
||||
(let ((f30-0 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y))))))
|
||||
(f28-0 (* 0.3333 (fmax 0.0 (fmin 1.0 (+ -1.0 (* 8.0 (-> s4-0 sun0-normal y)))))))
|
||||
)
|
||||
(vector4-scale! (the-as vector4 s2-0) (the-as vector4 (-> this ambi-color-lower)) f30-0)
|
||||
(vector4-madd! (the-as vector4 s2-0) (the-as vector4 s2-0) (the-as vector4 s3-0) f28-0)
|
||||
(vector4-scale! (the-as vector4 s1-0) (the-as vector4 (-> this ambi-color)) f30-0)
|
||||
(vector4-madd! (the-as vector4 s1-0) (the-as vector4 s1-0) (the-as vector4 s3-0) f28-0)
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 sun0-color))
|
||||
(the-as vector4 (-> this sun0-color))
|
||||
(-> s4-0 sun0-scale)
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 sun1-color))
|
||||
(the-as vector4 (-> this sun1-color))
|
||||
(* 0.5 (-> s4-0 sun1-scale))
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 moon-color))
|
||||
(the-as vector4 (-> this moon-color))
|
||||
(-> s4-0 moon-scale)
|
||||
)
|
||||
(vector4-scale! (the-as vector4 (-> s4-0 sun0-color-lower)) (the-as vector4 s3-0) (-> s4-0 sun0-scale))
|
||||
)
|
||||
(dotimes (s3-1 100)
|
||||
(let ((s2-1 (-> s5-0 data s3-1)))
|
||||
(cloud-vtx-light-update this (-> s2-1 col) (-> s2-1 nrm) s4-0 (-> s4-0 sun0-color) (-> s4-0 ambi-color))
|
||||
(cloud-vtx-light-update
|
||||
this
|
||||
(-> s2-1 col2)
|
||||
(-> s2-1 nrm2)
|
||||
s4-0
|
||||
(-> s4-0 sun0-color-lower)
|
||||
(-> s4-0 ambi-color-lower)
|
||||
)
|
||||
(cloud-vtx-tex-update this (-> s2-1 stq2) (-> s2-1 stq) (-> s2-1 pos) s4-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 22 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod cloud-vtx1-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex))
|
||||
(set! (-> arg0 pos quad) (-> arg1 pos quad))
|
||||
(set! (-> arg0 stq quad) (-> arg1 stq quad))
|
||||
(set! (-> arg0 col quad) (-> arg1 col quad))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 23 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod cloud-vtx2-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 cloud-vertex))
|
||||
(set! (-> arg0 pos quad) (-> arg1 pos quad))
|
||||
(set! (-> arg0 stq quad) (-> arg1 stq2 quad))
|
||||
(set! (-> arg0 col quad) (-> arg1 col2 quad))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 24 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-clouds ((this sky-work) (arg0 dma-buffer))
|
||||
(local-vars (v1-19 float) (sv-16 cloud-vert-array) (sv-20 (inline-array sky-vertex)) (sv-32 int))
|
||||
(rlet ((vf23 :class vf)
|
||||
(vf27 :class vf)
|
||||
)
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(test-1 (new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x50
|
||||
:afail #x1
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
)
|
||||
(tex0-1 (new 'static 'gs-tex0
|
||||
:tbp0 #x100
|
||||
:tbw #x2
|
||||
:psm #x1b
|
||||
:tcc #x1
|
||||
:cbp #x300
|
||||
:cld #x1
|
||||
:th (log2 128)
|
||||
:tw (log2 128)
|
||||
)
|
||||
)
|
||||
(tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(clamp-1 (new 'static 'gs-clamp))
|
||||
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
|
||||
(texflush 0)
|
||||
)
|
||||
(.lvf vf27 (&-> this giftag-roof quad))
|
||||
(let ((v1-18 #x43c80000))
|
||||
(.mov vf23 v1-18)
|
||||
)
|
||||
(.mov v1-19 vf23)
|
||||
(set-tex-offset (the-as int (-> this off-s)) (the-as int (-> this off-t)))
|
||||
(let ((s4-1 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(set! sv-16 *cloud-vert-array*)
|
||||
(set! sv-20 *cloud-poly*)
|
||||
(dotimes (s3-1 9)
|
||||
(dotimes (s2-2 9)
|
||||
(let ((s1-0 (+ (* 10 s3-1) s2-2)))
|
||||
(set! sv-32 (+ (* 9 s3-1) s2-2))
|
||||
(let ((s0-0 (+ s2-2 81 (* 9 s3-1))))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (* sv-32 4)) (-> sv-16 data s1-0))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 1)) (-> sv-16 data (+ s1-0 1)))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 2)) (-> sv-16 data (+ s1-0 11)))
|
||||
(cloud-vtx1-to-sky this (-> sv-20 (+ (* sv-32 4) 3)) (-> sv-16 data (+ s1-0 10)))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (* s0-0 4)) (-> sv-16 data s1-0))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 1)) (-> sv-16 data (+ s1-0 1)))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 2)) (-> sv-16 data (+ s1-0 11)))
|
||||
(cloud-vtx2-to-sky this (-> sv-20 (+ (* s0-0 4) 3)) (-> sv-16 data (+ s1-0 10)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(dotimes (s5-1 162)
|
||||
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
|
||||
)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-81 (/ (the-as int (+ (- -16 (the-as int s4-1)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s4-1)) (logior #x10000000 (shr (shl v1-81 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s4-1) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s4-1) 3) (the-as int (logior #x50000000 (shr (shl v1-81 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 25 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod apply-haze-light ((this sky-work) (arg0 vector) (arg1 vector) (arg2 haze-lights) (arg3 float))
|
||||
(let* ((s5-0 (new 'stack-no-clear 'vector4))
|
||||
(f0-1 (vector-dot (-> arg2 sun0-normal) arg1))
|
||||
(f1-1 (vector-dot (-> arg2 sun1-normal) arg1))
|
||||
(f2-1 (vector-dot (-> arg2 moon-normal) arg1))
|
||||
(s3-0 (* arg3 (fmax 0.0 (fmin 1.0 (- 1.0 f0-1)))))
|
||||
)
|
||||
(let ((f0-2 (fmax 0.0 f0-1))
|
||||
(f30-0 (fmax 0.0 f1-1))
|
||||
(f28-0 (fmax 0.0 f2-1))
|
||||
)
|
||||
(set! (-> s5-0 quad) (-> arg2 ambi-color quad))
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 sun0-color)) f0-2)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 sun1-color)) f30-0)
|
||||
(vector4-madd! s5-0 s5-0 (the-as vector4 (-> arg2 moon-color)) f28-0)
|
||||
)
|
||||
(vector4-scale! s5-0 s5-0 128.0)
|
||||
(set! (-> arg0 x) (fmax (fmin 255.0 (-> s5-0 x)) s3-0))
|
||||
(set! (-> arg0 y) (fmax (fmin 255.0 (-> s5-0 y)) s3-0))
|
||||
(set! (-> arg0 z) (fmax (fmin 255.0 (-> s5-0 z)) s3-0))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 26 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod adjust-haze-lighting ((this sky-work))
|
||||
(let ((s5-0 *haze-vert-array*)
|
||||
(s4-0 (-> this haze-lights))
|
||||
)
|
||||
(set! (-> s4-0 sun0-normal quad) (-> this upload-data data 0))
|
||||
(set! (-> s4-0 sun1-normal quad) (-> (&-> this upload-data data 4) 0))
|
||||
(set! (-> s4-0 moon-normal quad) (-> this upload-data moon pos quad))
|
||||
(vector-normalize! (-> s4-0 sun0-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 sun1-normal) 1.0)
|
||||
(vector-normalize! (-> s4-0 moon-normal) 1.0)
|
||||
(set! (-> s4-0 sun0-scale) (fmax 0.0 (fmin 1.0 (* 4.0 (+ 0.25 (-> s4-0 sun0-normal y))))))
|
||||
(set! (-> s4-0 sun1-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 sun1-normal y))))))
|
||||
(set! (-> s4-0 moon-scale) (fmax 0.0 (fmin 1.0 (* 8.0 (+ 0.125 (-> s4-0 moon-normal y))))))
|
||||
(let ((s3-0 (-> s4-0 ambi-color)))
|
||||
(-> this sun0-color-lower)
|
||||
(let ((f30-0 (- 1.0 (fmax 0.0 (fmin 0.75 (* 4.0 (-> s4-0 moon-normal y))))))
|
||||
(f0-8 (fmax 0.0 (fmin 1.0 (* 5.0 (+ 0.125 (-> s4-0 sun0-normal y))))))
|
||||
(s2-0 (new 'stack-no-clear 'vector4))
|
||||
)
|
||||
(set-vector! s2-0 1.15 0.0 0.5 1.0)
|
||||
(vector4-lerp! (the-as vector s2-0) (the-as vector s2-0) (-> this sun0-color) f0-8)
|
||||
(vector4-scale! (the-as vector4 s3-0) (the-as vector4 (-> this ambi-color)) f30-0)
|
||||
(vector4-scale! (the-as vector4 (-> s4-0 sun0-color)) s2-0 (-> s4-0 sun0-scale))
|
||||
)
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 sun1-color))
|
||||
(the-as vector4 (-> this sun1-color))
|
||||
(* 0.5 (-> s4-0 sun1-scale))
|
||||
)
|
||||
(vector4-scale!
|
||||
(the-as vector4 (-> s4-0 moon-color))
|
||||
(the-as vector4 (-> this moon-color))
|
||||
(-> s4-0 moon-scale)
|
||||
)
|
||||
(let ((f30-1 (* 144.0 (fmax 0.0 (fmin 1.0 (* 16.0 (-> s4-0 sun0-normal y)))))))
|
||||
(dotimes (s3-1 36)
|
||||
(let ((v1-28 (-> s5-0 data s3-1)))
|
||||
(apply-haze-light this (-> v1-28 col) (-> v1-28 nrm) s4-0 f30-1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 27 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod haze-vtx-to-sky ((this sky-work) (arg0 sky-vertex) (arg1 sky-vertex) (arg2 haze-vertex))
|
||||
(set! (-> arg0 pos quad) (-> arg2 pos quad))
|
||||
(set! (-> arg0 col quad) (-> arg2 col quad))
|
||||
(set! (-> arg0 col w) 128.0)
|
||||
(set! (-> arg1 pos quad) (-> arg2 pos quad))
|
||||
(set! (-> arg1 col quad) (-> arg2 col quad))
|
||||
(set! (-> arg1 pos y) 3.0)
|
||||
(set! (-> arg1 col w) 0.0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 28 of type sky-work
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-haze ((this sky-work) (arg0 dma-buffer))
|
||||
(local-vars (sv-16 haze-vert-array) (sv-20 (inline-array sky-vertex)))
|
||||
(rlet ((vf27 :class vf))
|
||||
(dma-buffer-add-gs-set arg0 (alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1)))
|
||||
(init-regs-for-large-polygon-draw this)
|
||||
(.lvf vf27 (&-> this giftag-haze quad))
|
||||
(let ((s4-0 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(set! sv-16 *haze-vert-array*)
|
||||
(set! sv-20 *haze-poly*)
|
||||
(dotimes (s3-0 35)
|
||||
(haze-vtx-to-sky this (-> sv-20 (* s3-0 4)) (-> sv-20 (+ (* s3-0 4) 1)) (-> sv-16 data s3-0))
|
||||
(haze-vtx-to-sky this (-> sv-20 (+ (* s3-0 4) 3)) (-> sv-20 (+ (* s3-0 4) 2)) (-> sv-16 data (+ s3-0 1)))
|
||||
)
|
||||
(haze-vtx-to-sky this (-> sv-20 140) (-> sv-20 141) (-> sv-16 data 35))
|
||||
(haze-vtx-to-sky this (-> sv-20 143) (-> sv-20 142) (the-as haze-vertex (-> sv-16 data)))
|
||||
(dotimes (s5-1 36)
|
||||
(render-sky-quad (the-as (inline-array sky-vertex) (-> sv-20 (* s5-1 4))) arg0)
|
||||
)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-41 (/ (the-as int (+ (- -16 (the-as int s4-0)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s4-0)) (logior #x10000000 (shr (shl v1-41 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s4-0) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s4-0) 3) (the-as int (logior #x50000000 (shr (shl v1-41 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 29 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 29 sky-work)" 29 sky-work)
|
||||
|
||||
;; definition for method 30 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 30 sky-work)" 30 sky-work)
|
||||
|
||||
;; definition for method 31 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 31 sky-work)" 31 sky-work)
|
||||
|
||||
;; definition for method 33 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod setup-stars ((this sky-work) (arg0 matrix) (arg1 sky-upload-data))
|
||||
(set! (-> arg0 fvec quad) (-> arg1 data 0))
|
||||
(vector-normalize! (-> arg0 fvec) 1.0)
|
||||
(vector-cross! (-> arg0 rvec) *z-vector* (-> arg0 fvec))
|
||||
(vector-normalize! (-> arg0 rvec) 1.0)
|
||||
(vector-cross! (-> arg0 uvec) (-> arg0 fvec) (-> arg0 rvec))
|
||||
(vector-normalize! (-> arg0 uvec) 1.0)
|
||||
(let ((s4-1 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s4-1 quad) (-> arg1 data 0))
|
||||
(vector-normalize! s4-1 -1.0)
|
||||
(let ((f0-1 (fmax 0.0 (fmin 1.0 (* 20.0 (+ 0.05 (-> s4-1 y)))))))
|
||||
(if (= (-> *setting-control* user-current sky-type) 'star-field)
|
||||
(set! f0-1 1.0)
|
||||
)
|
||||
(dotimes (v1-11 16)
|
||||
(let ((f1-4 (* (- 128.0 (* 8.0 (the float v1-11))) f0-1)))
|
||||
(set-vector! (-> this star-colors v1-11) (the int f1-4) (the int f1-4) (the int f1-4) 128)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 34 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 34 sky-work)" 34 sky-work)
|
||||
|
||||
;; definition for method 35 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 35 sky-work)" 35 sky-work)
|
||||
|
||||
;; definition for method 36 of type sky-work
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-roof ((this sky-work) (arg0 dma-buffer))
|
||||
(rlet ((vf27 :class vf))
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
|
||||
(test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)))
|
||||
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
|
||||
)
|
||||
(init-regs-for-large-polygon-draw this)
|
||||
(.lvf vf27 (&-> this giftag-base quad))
|
||||
(let ((s5-1 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 0)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 3)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 6)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-roof-polygons 9)) arg0)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-14 (/ (the-as int (+ (- -16 (the-as int s5-1)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s5-1)) (logior #x10000000 (shr (shl v1-14 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s5-1) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s5-1) 3) (the-as int (logior #x50000000 (shr (shl v1-14 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 37 of type sky-work
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-base ((this sky-work) (arg0 dma-buffer))
|
||||
(rlet ((vf27 :class vf))
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)))
|
||||
)
|
||||
(let ((s5-0 (-> arg0 base)))
|
||||
(&+! (-> arg0 base) 16)
|
||||
(.lvf vf27 (&-> this giftag-base quad))
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 0)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 3)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 6)) arg0)
|
||||
(render-sky-tri (the-as (inline-array sky-vertex) (-> sky-base-polygons 9)) arg0)
|
||||
(close-sky-buffer arg0)
|
||||
(let ((v1-12 (/ (the-as int (+ (- -16 (the-as int s5-0)) (the-as int (-> arg0 base)))) 16)))
|
||||
(set! (-> (the-as (pointer uint64) s5-0)) (logior #x10000000 (shr (shl v1-12 48) 48)))
|
||||
(set! (-> (the-as (pointer int32) s5-0) 2) 0)
|
||||
(set! (-> (the-as (pointer int32) s5-0) 3) (the-as int (logior #x50000000 (shr (shl v1-12 48) 48))))
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 38 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-fog ((this sky-work) (arg0 dma-buffer))
|
||||
(let ((s4-0 (-> *sky-texture-anim-array* array-data 8 tex)))
|
||||
(if s4-0
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(tex0-1 (new 'static 'gs-tex0
|
||||
:tcc #x1
|
||||
:cld #x1
|
||||
:psm (the-as int (-> s4-0 psm))
|
||||
:cpsm (-> s4-0 clutpsm)
|
||||
:cbp (-> s4-0 clutdest)
|
||||
:th (log2 (-> s4-0 h))
|
||||
:tw (log2 (-> s4-0 w))
|
||||
:tbw (-> s4-0 width 0)
|
||||
:tbp0 (-> s4-0 dest 0)
|
||||
)
|
||||
)
|
||||
(tex1-1 (new 'static 'gs-tex1 :mmag #x1 :mmin #x1))
|
||||
(test-1 (new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x70
|
||||
:afail #x3
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
)
|
||||
(clamp-1 (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)))
|
||||
(alpha-1 (new 'static 'gs-alpha :b #x1 :d #x1))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((v1-26 (the-as (inline-array qword) (-> arg0 base)))
|
||||
(a0-22 *fog-texture-work*)
|
||||
(f0-0 (-> a0-22 min-corner y))
|
||||
(f4-0 (- (-> a0-22 max-corner y) f0-0))
|
||||
(f3-0 (/ (- (-> a0-22 corner 1 y) f0-0) f4-0))
|
||||
(f2-0 (/ (- (-> a0-22 corner 0 y) f0-0) f4-0))
|
||||
(f1-7 (/ (- (-> a0-22 corner 3 y) f0-0) f4-0))
|
||||
(f0-2 (/ (- (-> a0-22 corner 2 y) f0-0) f4-0))
|
||||
(a0-23 6400)
|
||||
)
|
||||
(set! (-> v1-26 0 quad) (-> this fog-tmpl dma-vif quad))
|
||||
(set! (-> v1-26 1 quad) (-> this fog-tmpl quad 1))
|
||||
(set-vector! (-> v1-26 2 vector4w) 128 128 128 128)
|
||||
(set-vector! (-> v1-26 3 vector4w) (the-as int f3-0) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(set-vector! (-> v1-26 4 vector4w) #x7000 #x7300 a0-23 0)
|
||||
(set-vector! (-> v1-26 5 vector4w) (the-as int f2-0) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(set-vector! (-> v1-26 6 vector4w) #x9000 #x7300 a0-23 0)
|
||||
(set-vector! (-> v1-26 7 vector4w) (the-as int f1-7) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(set-vector! (-> v1-26 8 vector4w) #x7000 #x8d00 a0-23 0)
|
||||
(set-vector! (-> v1-26 9 vector4w) (the-as int f0-2) (the-as int 0.0) (the-as int 1.0) (the-as int 0.0))
|
||||
(let ((v1-27 (the-as (inline-array qword) (-> v1-26 10))))
|
||||
(set! (-> v1-27 0 vector4w x) #x9000)
|
||||
(set! (-> v1-27 0 vector4w y) #x8d00)
|
||||
(set! (-> v1-27 0 vector4w z) a0-23)
|
||||
(set! (-> v1-27 0 vector4w w) 0)
|
||||
)
|
||||
)
|
||||
(&+! (-> arg0 base) 176)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 32 of type sky-work
|
||||
;; INFO: function output is handled by mips2c
|
||||
(defmethod-mips2c "(method 32 sky-work)" 32 sky-work)
|
||||
|
||||
;; definition for method 13 of type sky-work
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw-erase ((this sky-work) (arg0 dma-buffer) (arg1 vector))
|
||||
(dma-buffer-add-gs-set arg0
|
||||
(zbuf-1 (new 'static 'gs-zbuf :zbp #x130 :psm (gs-psm ct24)))
|
||||
(test-1 (new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest always)))
|
||||
(rgbaq (new 'static 'gs-rgbaq
|
||||
:q 1.0
|
||||
:a (the int (-> arg1 w))
|
||||
:b (the int (-> arg1 z))
|
||||
:g (the int (-> arg1 y))
|
||||
:r (the int (-> arg1 x))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((v1-3 (-> arg0 base)))
|
||||
(set! (-> (the-as (pointer uint128) v1-3)) (-> this sprite-tmpl dma-vif quad))
|
||||
(set! (-> (the-as (pointer uint128) v1-3) 1) (-> this sprite-tmpl quad 1))
|
||||
)
|
||||
(&+! (-> arg0 base) 32)
|
||||
(let ((v1-6 (-> arg0 base)))
|
||||
(set-vector! (the-as vector4w (&+ v1-6 0)) #x7000 #x7300 0 0)
|
||||
(set-vector! (the-as vector4w (&+ v1-6 16)) #x9000 #x8d00 0 0)
|
||||
)
|
||||
(&+! (-> arg0 base) 32)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 14 of type sky-work
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw ((this sky-work))
|
||||
(let ((s4-0 *time-of-day-context*)
|
||||
(v1-0 #f)
|
||||
)
|
||||
(dotimes (a0-1 (-> *level* length))
|
||||
(let ((a1-3 (-> *level* level a0-1)))
|
||||
(when (= (-> a1-3 status) 'active)
|
||||
(if (and (= (-> a1-3 display?) 'display) (logtest? (-> a1-3 info level-flags) (level-flags lf9)))
|
||||
(set! v1-0 #t)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(cond
|
||||
((and v1-0
|
||||
(logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask sky))
|
||||
(logtest? (-> *texture-pool* texture-enable-user) (texture-enable-mask sky))
|
||||
)
|
||||
(let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf base)))
|
||||
(let ((a1-9 (if (-> s4-0 use-camera-other)
|
||||
(-> *math-camera* camera-rot-other)
|
||||
(-> *math-camera* camera-rot)
|
||||
)
|
||||
)
|
||||
)
|
||||
(update-camera-matrix this a1-9)
|
||||
)
|
||||
(update-template-colors this)
|
||||
(adjust-haze-lighting this)
|
||||
(adjust-cloud-lighting this)
|
||||
(let ((s4-1 (the-as sky-work #x70000000)))
|
||||
(mem-copy! (the-as pointer s4-1) (the-as pointer this) #x2814)
|
||||
(setup-stars s4-1 (-> s4-1 star-mat) (-> this upload-data))
|
||||
(if (nonzero? (-> s4-1 star-colors 0 x))
|
||||
(stars-transform-asm s4-1)
|
||||
)
|
||||
(cond
|
||||
((= (-> *setting-control* user-current sky-type) 'star-field)
|
||||
(with-dma-buffer-add-bucket ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(draw-erase s4-1 s3-0 (new 'static 'vector :w 128.0))
|
||||
(init-regs-for-sky-asm s4-1)
|
||||
(stars-dma s4-1 s3-0)
|
||||
(sun-dma s4-1 s3-0)
|
||||
(green-sun-dma s4-1 s3-0)
|
||||
(moon-dma s4-1 s3-0)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(draw-roof s4-1 s2-0)
|
||||
(init-regs-for-sky-asm s4-1)
|
||||
(if (nonzero? (-> s4-1 star-colors 0 x))
|
||||
(stars-dma s4-1 s2-0)
|
||||
)
|
||||
(sun-dma s4-1 s2-0)
|
||||
(green-sun-dma s4-1 s2-0)
|
||||
(moon-dma s4-1 s2-0)
|
||||
(cond
|
||||
((or (task-node-closed? (game-task-node precursor-destroy-ship-resolution)) (-> this disable-day-star))
|
||||
(set! (-> *time-of-day* 0 day-star-enable) #f)
|
||||
)
|
||||
(else
|
||||
(set! (-> *time-of-day* 0 day-star-enable) #t)
|
||||
(day-star-dma s4-1 s2-0)
|
||||
)
|
||||
)
|
||||
(draw-haze s4-1 s2-0)
|
||||
(draw-clouds s4-1 s2-0)
|
||||
(draw-base s4-1 s2-0)
|
||||
(draw-fog s4-1 s2-0)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((a0-45 *dma-mem-usage*))
|
||||
(when (nonzero? a0-45)
|
||||
(set! (-> a0-45 length) (max 90 (-> a0-45 length)))
|
||||
(set! (-> a0-45 data 89 name) "sky")
|
||||
(+! (-> a0-45 data 89 count) 1)
|
||||
(+! (-> a0-45 data 89 used)
|
||||
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint gp-0))
|
||||
)
|
||||
(set! (-> a0-45 data 89 total) (-> a0-45 data 89 used))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((get-menu-mode *blit-displays-work*)
|
||||
(with-dma-buffer-add-bucket ((s5-2 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(blit-displays-work-method-20 *blit-displays-work*)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(with-dma-buffer-add-bucket ((s3-2 (-> *display* frames (-> *display* on-screen) global-buf))
|
||||
(bucket-id sky)
|
||||
)
|
||||
(draw-erase this s3-2 (-> s4-0 current-fog erase-color))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -373,7 +373,9 @@
|
||||
"grunt-part-callback",
|
||||
// cty-blow-tower
|
||||
"(method 47 bt-hellcat)",
|
||||
"(method 19 bt-gun-manager)"
|
||||
"(method 19 bt-gun-manager)",
|
||||
// asm
|
||||
"close-sky-buffer"
|
||||
],
|
||||
|
||||
"skip_compile_states": {
|
||||
|
||||
Reference in New Issue
Block a user