Skip to content

Commit

Permalink
5/13 update (#82)
Browse files Browse the repository at this point in the history
* Intro palace DGOs (#3512)

Now needed to extract and compile from scratch

* decomp3: more misc files (#3513)

4 missions to go!

- `ctygenb-part`
- `power-game`
- `vinroom-part`
- `vinroom-scenes`
- `gungame-part`
- `gungame-scenes`
- `hiphog-obs`
- `hiphog-part`
- `hiphog-scenes`
- `hover-nav-lpattack`
- `king-rider`
- `rubble-attack`
- `rubble-obs`
- `rubble-part`
- `rubblea-init`
- `rublcst-scenes`
- `mood-funcs2`
- `gun-dummy-art`
- `gun-dummy-part`
- `gun-dummy`
- `gungame-data`
- `gungame-manager`
- `gungame-obs`
- `blow-tower-data`
- `blow-tower-extra`
- `blow-tower-obs2`
- `blow-tower-obs`
- `blow-tower-part`
- `blow-tower-script`
- `blow-tower-shared`
- `blow-tower-speech`
- `cty-blow-tower`

* Jak3 sky (#3514)

* binaries update

---------

Co-authored-by: BreakPoints <JackHooley7@gmail.com>
Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
Co-authored-by: water111 <48171810+water111@users.noreply.github.com>
  • Loading branch information
4 people authored May 12, 2024
1 parent 7d28ab8 commit 77db0d2
Show file tree
Hide file tree
Showing 28 changed files with 4,835 additions and 202 deletions.
98 changes: 64 additions & 34 deletions decompiler/config/jak3/all-types.gc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -4234,7 +4234,7 @@
(rn0)
(rn1)
(rn2)
(rn3)
(sky)
(rn4)
(rn5)
(hfrag)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
)
)

Expand Down Expand Up @@ -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 ;;
Expand Down
7 changes: 4 additions & 3 deletions decompiler/config/jak3/ntsc_v1/hacks.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 9 additions & 0 deletions decompiler/config/jak3/ntsc_v1/label_types.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
31 changes: 30 additions & 1 deletion decompiler/config/jak3/ntsc_v1/type_casts.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -10565,7 +10565,6 @@
[[135, 141], "v1", "dma-packet"],
[143, "v1", "(pointer uint32)"]
],
"real-wang-texture-anim-func": [[[3, 31], "v1", "mood-context"]],
"hiphog-mirror-sheen-func": [
[[50, 64], "a2", "ripple-wave"],
[48, "a2", "ripple-wave"],
Expand Down Expand Up @@ -10845,5 +10844,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"]
]
}
1 change: 1 addition & 0 deletions game/graphics/opengl_renderer/OpenGLRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions game/graphics/opengl_renderer/buckets.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit 77db0d2

Please sign in to comment.