;;-*-Lisp-*- (in-package goal) ;; name: sky-h.gc ;; name in dgo: sky-h ;; dgos: ENGINE, GAME (define-extern close-sky-buffer (function dma-buffer none)) ;; DECOMP BEGINS (deftype sky-color-hour (structure) ((snapshot1 int32) (snapshot2 int32) (morph-start float) (morph-end float) ) ) (deftype sky-color-day (structure) ((hour sky-color-hour 24 :inline) ) ) (deftype sky-sun-data (structure) ((data uint128 4) (pos vector :inline :overlay-at (-> data 0)) (r-sun float :overlay-at (-> data 1)) (r-halo float :offset 20) (r-aurora float :offset 24) (c-sun-start rgba :overlay-at (-> data 2)) (c-sun-end rgba :overlay-at (-> data 3)) (c-halo-start rgba :offset 36) (c-halo-end rgba :offset 52) (c-aurora-start rgba :offset 40) (c-aurora-end rgba :offset 56) ) ) (deftype sky-moon-data (structure) ((data uint128 2) (pos vector :inline :overlay-at (-> data 0)) (scale vector :inline :overlay-at (-> data 1)) ) ) (deftype sky-orbit (structure) ((high-noon float) (tilt float) (rise float) (dist float) (min-halo float) (max-halo float) ) :allow-misaligned ) (deftype sky-upload-data (structure) ((data uint128 10) (sun sky-sun-data 2 :inline :overlay-at (-> data 0)) (moon sky-moon-data :inline :overlay-at (-> data 8)) ) ) (deftype sky-vertex (structure) ((pos vector :inline) (stq vector :inline) (col vector :inline) ) ) (deftype cloud-vertex (structure) ((pos vector :inline) (stq vector :inline) (col vector :inline) (nrm vector :inline) (stq2 vector :inline) (col2 vector :inline) (nrm2 vector :inline) ) ) (deftype cloud-vert-array (structure) ((data cloud-vertex 100 :inline) ) ) (deftype haze-vertex (structure) ((pos vector :inline) (nrm vector :inline) (col vector :inline) ) ) (deftype haze-vert-array (structure) ((data haze-vertex 36 :inline) ) ) (deftype cloud-lights (structure) ((sun0-normal vector :inline) (sun1-normal vector :inline) (moon-normal vector :inline) (ambi-color vector :inline) (ambi-color-lower vector :inline) (sun0-color vector :inline) (sun1-color vector :inline) (moon-color vector :inline) (sun0-color-lower vector :inline) (sun0-scale float) (sun1-scale float) (moon-scale float) ) ) (deftype haze-lights (structure) ((sun0-normal vector :inline) (sun1-normal vector :inline) (moon-normal vector :inline) (ambi-color vector :inline) (sun0-color vector :inline) (sun1-color vector :inline) (moon-color vector :inline) (sun0-scale float) (sun1-scale float) (moon-scale float) ) ) (deftype sky-work (structure) ((adgif-tmpl dma-gif-packet :inline) (draw-tmpl dma-gif-packet :inline) (draw-tmpl2 dma-gif-packet :inline) (fog-tmpl dma-gif-packet :inline) (blend-tmpl dma-gif-packet :inline) (sprite-tmpl dma-gif-packet :inline) (sprite-tmpl2 dma-gif-packet :inline) (sun-coords vector 2 :inline) (green-coords vector 2 :inline) (moon0-coords vector 2 :inline) (moon1-coords vector 2 :inline) (moon2-coords vector 2 :inline) (star-coords vector 2 :inline) (sun-colors vector4w 2 :inline) (green-colors vector4w 2 :inline) (moon-colors vector4w 3 :inline) (star-colors vector4w 16 :inline) (st-coords vector 2 :inline) (random vector4w 8 :inline) (giftag-base dma-gif :inline) (giftag-haze dma-gif :inline) (giftag-roof dma-gif :inline) (giftag-ocean dma-gif :inline) (fog vector :inline) (sky float 8) (time float) (off-s uint16) (off-t uint16) (orbit sky-orbit 3 :inline) (upload-data sky-upload-data :inline) (ambi-color vector4w :inline) (ambi-color-lower vector4w :inline) (sun0-color vector4w :inline) (sun1-color vector4w :inline) (moon-color vector4w :inline) (sun0-color-lower vector4w :inline) (cam-mat matrix :inline) (star-mat matrix :inline) (vec0 vector4w :inline) (vec1 vector4w :inline) (cloud-lights cloud-lights :inline) (haze-lights haze-lights :inline) (buf dma-buffer) (draw-vortex basic) (stars vector 512 :inline) ) (:methods (init-sun-data! (_type_ int float float float) none) (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) (draw (_type_) none) (update-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) 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) (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) ) ) (define-extern *sky-work* sky-work)