mirror of
https://github.com/open-goal/jak-project.git
synced 2024-11-27 16:31:14 +00:00
clean up display-h (#392)
This commit is contained in:
parent
3d2ca71fe3
commit
53a70d8e43
@ -2156,6 +2156,7 @@
|
|||||||
:size-assert #x4010
|
:size-assert #x4010
|
||||||
:flag-assert #xe00004010
|
:flag-assert #xe00004010
|
||||||
(:methods
|
(:methods
|
||||||
|
(new (symbol type) _type_)
|
||||||
(get-last-frame-time-stamp (_type_) uint 9)
|
(get-last-frame-time-stamp (_type_) uint 9)
|
||||||
(reset (_type_) _type_ 10)
|
(reset (_type_) _type_ 10)
|
||||||
(add-frame (_type_ symbol rgba) profile-frame 11)
|
(add-frame (_type_ symbol rgba) profile-frame 11)
|
||||||
@ -3513,7 +3514,7 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(define-extern *post-draw-hook* (function none)) ;; unknown type
|
(define-extern *post-draw-hook* (function none)) ;; unknown type
|
||||||
(define-extern put-draw-env (function dma-packet none))
|
(define-extern put-draw-env (function (pointer gif-tag) none))
|
||||||
(define-extern *pre-draw-hook* (function none)) ;; unknown type
|
(define-extern *pre-draw-hook* (function none)) ;; unknown type
|
||||||
|
|
||||||
(deftype display-frame (basic)
|
(deftype display-frame (basic)
|
||||||
|
@ -128,6 +128,8 @@
|
|||||||
["L51", "gif-tag-regs", true],
|
["L51", "gif-tag-regs", true],
|
||||||
["L52", "uint64", true]],
|
["L52", "uint64", true]],
|
||||||
|
|
||||||
|
"display-h": [["L6", "rgba", true]],
|
||||||
|
|
||||||
"loader-h": [["L10", "float", true]],
|
"loader-h": [["L10", "float", true]],
|
||||||
|
|
||||||
"level-h": [["L3", "level-group", true]],
|
"level-h": [["L3", "level-group", true]],
|
||||||
|
@ -779,6 +779,10 @@
|
|||||||
"vars": { "v1-0": "tag" }
|
"vars": { "v1-0": "tag" }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"(method 0 display-frame)": {
|
||||||
|
"vars": {"gp-0": "obj"}
|
||||||
|
},
|
||||||
|
|
||||||
"(method 0 draw-context)": {
|
"(method 0 draw-context)": {
|
||||||
"args": [
|
"args": [
|
||||||
"allocation",
|
"allocation",
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
;; name in dgo: display-h
|
;; name in dgo: display-h
|
||||||
;; dgos: GAME, ENGINE
|
;; dgos: GAME, ENGINE
|
||||||
|
|
||||||
|
;; display-env stores the GS settings for displaying a framebuffer on screen.
|
||||||
(deftype display-env (structure)
|
(deftype display-env (structure)
|
||||||
((pmode gs-pmode :offset-assert 0)
|
((pmode gs-pmode :offset-assert 0)
|
||||||
(smode2 gs-smode2 :offset-assert 8)
|
(smode2 gs-smode2 :offset-assert 8)
|
||||||
@ -18,6 +19,7 @@
|
|||||||
:flag-assert #x900000028
|
:flag-assert #x900000028
|
||||||
)
|
)
|
||||||
|
|
||||||
|
;; draw-env stores the GS settings for drawing to somewhere in VRAM.
|
||||||
;; the "addr" fields represent GS register addresses
|
;; the "addr" fields represent GS register addresses
|
||||||
(deftype draw-env (structure)
|
(deftype draw-env (structure)
|
||||||
((frame1 gs-frame :offset-assert 0)
|
((frame1 gs-frame :offset-assert 0)
|
||||||
@ -42,10 +44,17 @@
|
|||||||
:flag-assert #x900000080
|
:flag-assert #x900000080
|
||||||
)
|
)
|
||||||
|
|
||||||
(defun put-draw-env ((packet dma-packet))
|
(defun put-draw-env ((packet (pointer gif-tag)))
|
||||||
"Uses the qwc stored in the packet."
|
"Begin DMA transfer to the GIF/GS to send a draw env packet.
|
||||||
;; TODO - good spot to patch for PC, or maybe just exclude.
|
The length of the transfer is taken from the nloop field of the tag."
|
||||||
(dma-send GIF_DMA_BANK (the uint packet) (+ (the uint 1) (-> packet dma qwc)))
|
;; this is a workaround for OpenGOAL not supporting 128-bitfield access yet.
|
||||||
|
(let ((packet64 (the-as (pointer gif-tag64) packet)))
|
||||||
|
(dma-send GIF_DMA_BANK
|
||||||
|
(the-as uint packet)
|
||||||
|
(the-as uint (+ (the-as uint (-> packet64 0 nloop)) (the-as uint 1)))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(none)
|
||||||
)
|
)
|
||||||
|
|
||||||
(deftype display-frame (basic)
|
(deftype display-frame (basic)
|
||||||
@ -67,17 +76,18 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(defmethod new display-frame ((allocation symbol) (type-to-make type))
|
(defmethod new display-frame ((allocation symbol) (type-to-make type))
|
||||||
"Allocate a new display-frame"
|
"Allocate a new display frame"
|
||||||
(local-vars (obj display-frame))
|
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||||
(set! obj (object-new allocation type-to-make (the-as int (-> type-to-make size))))
|
(set! (-> obj calc-buf) (the-as dma-buffer 0))
|
||||||
(set! (-> obj buffer 1) 0)
|
(set! (-> obj global-buf) (the-as dma-buffer 0))
|
||||||
(set! (-> obj buffer 9) 0)
|
(set! (-> obj debug-buf) (the-as dma-buffer 0))
|
||||||
(set! (-> obj buffer 8) 0)
|
;; allocate profile-bars in the debug heap, if we're debugging.
|
||||||
(when *debug-segment*
|
(when *debug-segment*
|
||||||
(set! (-> obj profile-bar 0) (new 'debug 'profile-bar))
|
(set! (-> obj profile-bar 0) (new 'debug 'profile-bar))
|
||||||
(set! (-> obj profile-bar 1) (new 'debug 'profile-bar))
|
(set! (-> obj profile-bar 1) (new 'debug 'profile-bar))
|
||||||
)
|
)
|
||||||
obj
|
obj
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(deftype virtual-frame (structure)
|
(deftype virtual-frame (structure)
|
||||||
@ -141,50 +151,60 @@
|
|||||||
)
|
)
|
||||||
|
|
||||||
(define-extern *display* display)
|
(define-extern *display* display)
|
||||||
|
|
||||||
(define-extern set-display (function display int int int int int display))
|
(define-extern set-display (function display int int int int int display))
|
||||||
|
|
||||||
(defmethod new display ((allocation symbol) (type-to-make type) (psm int) (w int) (h int) (ztest int) (zpsm int))
|
(defmethod new display ((allocation symbol) (type-to-make type) (psm int) (w int) (h int) (ztest int) (zpsm int))
|
||||||
(local-vars (obj display))
|
(let ((obj (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
|
||||||
(set! obj
|
;; set the display size, texture format, zbuffer format, etc.
|
||||||
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
(set-display obj psm w h ztest zpsm)
|
||||||
)
|
;; set up frames.
|
||||||
(set-display obj psm w h ztest zpsm)
|
(set! (-> obj frames 0 display) (-> obj display-env0))
|
||||||
(set! (-> obj frames 0 display) (-> obj display-env0))
|
(set! (-> obj frames 1 display) (-> obj display-env1))
|
||||||
(set! (-> obj frames 1 display) (-> obj display-env1))
|
(set! (-> obj frames 2 display) (-> obj display-env2))
|
||||||
(set! (-> obj frames 2 display) (-> obj display-env2))
|
(set! (-> obj frames 3 display) (-> obj display-env0))
|
||||||
(set! (-> obj frames 3 display) (-> obj display-env0))
|
(set! (-> obj frames 4 display) (-> obj display-env1))
|
||||||
(set! (-> obj frames 4 display) (-> obj display-env1))
|
(set! (-> obj frames 5 display) (-> obj display-env2))
|
||||||
(set! (-> obj frames 5 display) (-> obj display-env2))
|
(set! (-> obj frames 0 display-last) (-> obj display-env2))
|
||||||
(set! (-> obj frames 0 display-last) (-> obj display-env2))
|
(set! (-> obj frames 1 display-last) (-> obj display-env0))
|
||||||
(set! (-> obj frames 1 display-last) (-> obj display-env0))
|
(set! (-> obj frames 2 display-last) (-> obj display-env1))
|
||||||
(set! (-> obj frames 2 display-last) (-> obj display-env1))
|
(set! (-> obj frames 3 display-last) (-> obj display-env2))
|
||||||
(set! (-> obj frames 3 display-last) (-> obj display-env2))
|
(set! (-> obj frames 4 display-last) (-> obj display-env0))
|
||||||
(set! (-> obj frames 4 display-last) (-> obj display-env0))
|
(set! (-> obj frames 5 display-last) (-> obj display-env1))
|
||||||
(set! (-> obj frames 5 display-last) (-> obj display-env1))
|
(set! (-> obj frames 0 gif) (&-> obj gif-tag0))
|
||||||
(set! (-> obj frames 0 gif) (&-> obj gif-tag0))
|
(set! (-> obj frames 1 gif) (&-> obj gif-tag1))
|
||||||
(set! (-> obj frames 1 gif) (&-> obj gif-tag1))
|
(set! (-> obj frames 2 gif) (&-> obj gif-tag2))
|
||||||
(set! (-> obj frames 2 gif) (&-> obj gif-tag2))
|
(set! (-> obj frames 3 gif) (&-> obj gif-tag0))
|
||||||
(set! (-> obj frames 3 gif) (&-> obj gif-tag0))
|
(set! (-> obj frames 4 gif) (&-> obj gif-tag1))
|
||||||
(set! (-> obj frames 4 gif) (&-> obj gif-tag1))
|
(set! (-> obj frames 5 gif) (&-> obj gif-tag2))
|
||||||
(set! (-> obj frames 5 gif) (&-> obj gif-tag2))
|
(set! (-> obj frames 0 draw) (-> obj draw0))
|
||||||
(set! (-> obj frames 0 draw) (-> obj draw0))
|
(set! (-> obj frames 1 draw) (-> obj draw1))
|
||||||
(set! (-> obj frames 1 draw) (-> obj draw1))
|
(set! (-> obj frames 2 draw) (-> obj draw2))
|
||||||
(set! (-> obj frames 2 draw) (-> obj draw2))
|
(set! (-> obj frames 3 draw) (-> obj draw0))
|
||||||
(set! (-> obj frames 3 draw) (-> obj draw0))
|
(set! (-> obj frames 4 draw) (-> obj draw1))
|
||||||
(set! (-> obj frames 4 draw) (-> obj draw1))
|
(set! (-> obj frames 5 draw) (-> obj draw2))
|
||||||
(set! (-> obj frames 5 draw) (-> obj draw2))
|
(set! (-> obj frames 0 frame) (new 'global 'display-frame))
|
||||||
(set! (-> obj frames 0 frame) (new 'global 'display-frame))
|
(set! (-> obj frames 1 frame) (new 'global 'display-frame))
|
||||||
(set! (-> obj frames 1 frame) (new 'global 'display-frame))
|
(set! (-> obj frames 2 frame) (-> obj frames 0 frame))
|
||||||
(set! (-> obj frames 2 frame) (-> obj frames 0 frame))
|
(set! (-> obj frames 3 frame) (-> obj frames 1 frame))
|
||||||
(set! (-> obj frames 3 frame) (-> obj frames 1 frame))
|
(set! (-> obj frames 4 frame) (-> obj frames 0 frame))
|
||||||
(set! (-> obj frames 4 frame) (-> obj frames 0 frame))
|
(set! (-> obj frames 5 frame) (-> obj frames 1 frame))
|
||||||
(set! (-> obj frames 5 frame) (-> obj frames 1 frame))
|
;; do this again. just in case.
|
||||||
(default-buffer-init *default-regs-buffer*)
|
(default-buffer-init *default-regs-buffer*)
|
||||||
(set! (-> obj bg-clear-color 0) (new-rgba #x80 #x80 #x80 #x80))
|
;; set the default gray color.
|
||||||
(set! (-> obj bg-clear-color 1) (new-rgba #x80 #x80 #x80 #x80))
|
(set! (-> obj bg-clear-color 0)
|
||||||
(set! (-> obj bg-clear-color 2) (new-rgba #x80 #x80 #x80 #x80))
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
(set! (-> obj bg-clear-color 3) (new-rgba #x80 #x80 #x80 #x80))
|
)
|
||||||
obj
|
(set! (-> obj bg-clear-color 1)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
(set! (-> obj bg-clear-color 2)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
(set! (-> obj bg-clear-color 3)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
obj
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(define *pre-draw-hook* nothing)
|
(define *pre-draw-hook* nothing)
|
||||||
|
@ -121,6 +121,7 @@
|
|||||||
:size-assert #x4010
|
:size-assert #x4010
|
||||||
:flag-assert #xe00004010
|
:flag-assert #xe00004010
|
||||||
(:methods
|
(:methods
|
||||||
|
(new (symbol type) _type_ 0)
|
||||||
(get-last-frame-time-stamp (_type_) uint 9)
|
(get-last-frame-time-stamp (_type_) uint 9)
|
||||||
(reset (_type_) _type_ 10)
|
(reset (_type_) _type_ 10)
|
||||||
(add-frame (_type_ symbol rgba) profile-frame 11)
|
(add-frame (_type_ symbol rgba) profile-frame 11)
|
||||||
|
@ -284,101 +284,7 @@
|
|||||||
|
|
||||||
|
|
||||||
;; display-h
|
;; display-h
|
||||||
(deftype display-env (structure)
|
(declare-type display basic)
|
||||||
((pmode uint64 :offset-assert 0)
|
(define-extern set-display (function display int int int int int display))
|
||||||
(smode2 uint64 :offset-assert 8)
|
|
||||||
(dspfb uint64 :offset-assert 16)
|
|
||||||
(display uint64 :offset-assert 24)
|
|
||||||
(bgcolor uint64 :offset-assert 32)
|
|
||||||
)
|
|
||||||
:pack-me
|
|
||||||
:method-count-assert 9
|
|
||||||
:size-assert #x28
|
|
||||||
:flag-assert #x900000028
|
|
||||||
)
|
|
||||||
|
|
||||||
(deftype draw-env (structure)
|
|
||||||
((frame1 uint64 :offset-assert 0)
|
|
||||||
(frame1addr uint64 :offset-assert 8)
|
|
||||||
(zbuf1 uint64 :offset-assert 16)
|
|
||||||
(zbuf1addr uint64 :offset-assert 24)
|
|
||||||
(xyoffset1 uint64 :offset-assert 32)
|
|
||||||
(xyoffset1addr uint64 :offset-assert 40)
|
|
||||||
(scissor1 uint64 :offset-assert 48)
|
|
||||||
(scissor1addr uint64 :offset-assert 56)
|
|
||||||
(prmodecont uint64 :offset-assert 64)
|
|
||||||
(prmodecontaddr uint64 :offset-assert 72)
|
|
||||||
(colclamp uint64 :offset-assert 80)
|
|
||||||
(colclampaddr uint64 :offset-assert 88)
|
|
||||||
(dthe uint64 :offset-assert 96)
|
|
||||||
(dtheaddr uint64 :offset-assert 104)
|
|
||||||
(test1 uint64 :offset-assert 112)
|
|
||||||
(test1addr uint64 :offset-assert 120)
|
|
||||||
)
|
|
||||||
:method-count-assert 9
|
|
||||||
:size-assert #x80
|
|
||||||
:flag-assert #x900000080
|
|
||||||
)
|
|
||||||
|
|
||||||
(declare-type display-frame basic)
|
|
||||||
|
|
||||||
(deftype virtual-frame (structure)
|
|
||||||
((display display-env :offset-assert 0)
|
|
||||||
(display-last display-env :offset-assert 4)
|
|
||||||
(gif pointer :offset-assert 8)
|
|
||||||
(draw draw-env :offset-assert 12)
|
|
||||||
(frame display-frame :offset-assert 16)
|
|
||||||
)
|
|
||||||
|
|
||||||
:allow-misaligned
|
|
||||||
:method-count-assert 9
|
|
||||||
:size-assert #x14
|
|
||||||
:flag-assert #x900000014
|
|
||||||
)
|
|
||||||
|
|
||||||
(deftype display (basic)
|
|
||||||
((display-env0 display-env :inline :offset-assert 8)
|
|
||||||
(display-env1 display-env :inline :offset-assert 48)
|
|
||||||
(display-env2 display-env :inline :offset-assert 88)
|
|
||||||
(gif-tag0 uint128 :offset-assert 128)
|
|
||||||
(draw0 draw-env :inline :offset-assert 144)
|
|
||||||
(gif-tag1 uint128 :offset-assert 272)
|
|
||||||
(draw1 draw-env :inline :offset-assert 288)
|
|
||||||
(gif-tag2 uint128 :offset-assert 416)
|
|
||||||
(draw2 draw-env :inline :offset-assert 432)
|
|
||||||
(on-screen int32 :offset-assert 560)
|
|
||||||
(last-screen int32 :offset-assert 564)
|
|
||||||
(frames virtual-frame 6 :inline :offset-assert 568)
|
|
||||||
(bg-clear-color uint32 4 :offset-assert 760)
|
|
||||||
(real-frame-counter uint64 :offset-assert 776)
|
|
||||||
(base-frame-counter uint64 :offset-assert 784)
|
|
||||||
(game-frame-counter uint64 :offset-assert 792)
|
|
||||||
(integral-frame-counter uint64 :offset-assert 800)
|
|
||||||
(real-integral-frame-counter uint64 :offset-assert 808)
|
|
||||||
(actual-frame-counter uint64 :offset-assert 816)
|
|
||||||
(real-actual-frame-counter uint64 :offset-assert 824)
|
|
||||||
(part-frame-counter uint64 :offset-assert 832)
|
|
||||||
(old-real-frame-counter uint64 :offset-assert 840)
|
|
||||||
(old-base-frame-counter uint64 :offset-assert 848)
|
|
||||||
(old-game-frame-counter uint64 :offset-assert 856)
|
|
||||||
(old-integral-frame-counter uint64 :offset-assert 864)
|
|
||||||
(old-real-integral-frame-counter uint64 :offset-assert 872)
|
|
||||||
(old-actual-frame-counter uint64 :offset-assert 880)
|
|
||||||
(old-real-actual-frame-counter uint64 :offset-assert 888)
|
|
||||||
(old-part-frame-counter uint64 :offset-assert 896)
|
|
||||||
(time-ratio float :offset-assert 904)
|
|
||||||
(seconds-per-frame float :offset-assert 908)
|
|
||||||
(frames-per-second float :offset-assert 912)
|
|
||||||
(time-factor float :offset-assert 916)
|
|
||||||
(time-adjust-ratio float :offset-assert 920)
|
|
||||||
)
|
|
||||||
:method-count-assert 10
|
|
||||||
:size-assert #x39c
|
|
||||||
:flag-assert #xa0000039c
|
|
||||||
(:methods
|
|
||||||
(new (symbol type int int int int int) _type_ 0)
|
|
||||||
(dummy-9 () none 9)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
(define-extern *display* display)
|
(define-extern *display* display)
|
||||||
|
350
test/decompiler/reference/display-h_REF.gc
Normal file
350
test/decompiler/reference/display-h_REF.gc
Normal file
@ -0,0 +1,350 @@
|
|||||||
|
;;-*-Lisp-*-
|
||||||
|
(in-package goal)
|
||||||
|
|
||||||
|
;; definition of type display-env
|
||||||
|
(deftype display-env (structure)
|
||||||
|
((pmode gs-pmode :offset-assert 0)
|
||||||
|
(smode2 gs-smode2 :offset-assert 8)
|
||||||
|
(dspfb gs-display-fb :offset-assert 16)
|
||||||
|
(display gs-display :offset-assert 24)
|
||||||
|
(bgcolor gs-bgcolor :offset-assert 32)
|
||||||
|
)
|
||||||
|
:pack-me
|
||||||
|
:method-count-assert 9
|
||||||
|
:size-assert #x28
|
||||||
|
:flag-assert #x900000028
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 3 of type display-env
|
||||||
|
(defmethod inspect display-env ((obj display-env))
|
||||||
|
(format #t "[~8x] ~A~%" obj 'display-env)
|
||||||
|
(format #t "~Tpmode: #x~X~%" (-> obj pmode))
|
||||||
|
(format #t "~Tsmode2: #x~X~%" (-> obj smode2))
|
||||||
|
(format #t "~Tdspfb: #x~X~%" (-> obj dspfb))
|
||||||
|
(format #t "~Tdisplay: #x~X~%" (-> obj display))
|
||||||
|
(format #t "~Tbgcolor: #x~X~%" (-> obj bgcolor))
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition of type draw-env
|
||||||
|
(deftype draw-env (structure)
|
||||||
|
((frame1 gs-frame :offset-assert 0)
|
||||||
|
(frame1addr int64 :offset-assert 8)
|
||||||
|
(zbuf1 gs-zbuf :offset-assert 16)
|
||||||
|
(zbuf1addr int64 :offset-assert 24)
|
||||||
|
(xyoffset1 gs-xy-offset :offset-assert 32)
|
||||||
|
(xyoffset1addr int64 :offset-assert 40)
|
||||||
|
(scissor1 gs-scissor :offset-assert 48)
|
||||||
|
(scissor1addr int64 :offset-assert 56)
|
||||||
|
(prmodecont gs-prmode-cont :offset-assert 64)
|
||||||
|
(prmodecontaddr int64 :offset-assert 72)
|
||||||
|
(colclamp gs-color-clamp :offset-assert 80)
|
||||||
|
(colclampaddr int64 :offset-assert 88)
|
||||||
|
(dthe gs-dthe :offset-assert 96)
|
||||||
|
(dtheaddr int64 :offset-assert 104)
|
||||||
|
(test1 gs-test :offset-assert 112)
|
||||||
|
(test1addr int64 :offset-assert 120)
|
||||||
|
)
|
||||||
|
:method-count-assert 9
|
||||||
|
:size-assert #x80
|
||||||
|
:flag-assert #x900000080
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 3 of type draw-env
|
||||||
|
(defmethod inspect draw-env ((obj draw-env))
|
||||||
|
(format #t "[~8x] ~A~%" obj 'draw-env)
|
||||||
|
(format #t "~Tframe1: #x~X~%" (-> obj frame1))
|
||||||
|
(format #t "~Tframe1addr: #x~X~%" (-> obj frame1addr))
|
||||||
|
(format #t "~Tzbuf1: #x~X~%" (-> obj zbuf1))
|
||||||
|
(format #t "~Tzbuf1addr: #x~X~%" (-> obj zbuf1addr))
|
||||||
|
(format #t "~Txyoffset1: #x~X~%" (-> obj xyoffset1))
|
||||||
|
(format #t "~Txyoffset1addr: #x~X~%" (-> obj xyoffset1addr))
|
||||||
|
(format #t "~Tscissor1: #x~X~%" (-> obj scissor1))
|
||||||
|
(format #t "~Tscissor1addr: #x~X~%" (-> obj scissor1addr))
|
||||||
|
(format #t "~Tprmodecont: #x~X~%" (-> obj prmodecont))
|
||||||
|
(format #t "~Tprmodecontaddr: #x~X~%" (-> obj prmodecontaddr))
|
||||||
|
(format #t "~Tcolclamp: #x~X~%" (-> obj colclamp))
|
||||||
|
(format #t "~Tcolclampaddr: #x~X~%" (-> obj colclampaddr))
|
||||||
|
(format #t "~Tdthe: #x~X~%" (-> obj dthe))
|
||||||
|
(format #t "~Tdtheaddr: #x~X~%" (-> obj dtheaddr))
|
||||||
|
(format #t "~Ttest1: #x~X~%" (-> obj test1))
|
||||||
|
(format #t "~Ttest1addr: #x~X~%" (-> obj test1addr))
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for function put-draw-env
|
||||||
|
;; Used lq/sq
|
||||||
|
(defun put-draw-env ((arg0 (pointer gif-tag)))
|
||||||
|
(dma-send
|
||||||
|
(the-as dma-bank #x1000a000)
|
||||||
|
(the-as uint arg0)
|
||||||
|
(the-as uint (+ (the-as uint (-> arg0 0 nloop)) (the-as uint 1)))
|
||||||
|
)
|
||||||
|
(none)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition of type display-frame
|
||||||
|
(deftype display-frame (basic)
|
||||||
|
((calc-buf dma-buffer :offset 8)
|
||||||
|
(vu1-buf dma-buffer :offset 8)
|
||||||
|
(debug-buf dma-buffer :offset 36)
|
||||||
|
(global-buf dma-buffer :offset 40)
|
||||||
|
(buffer uint32 11 :offset 4)
|
||||||
|
(bucket-group dma-bucket :offset 44)
|
||||||
|
(profile-bar profile-bar 2 :offset 48)
|
||||||
|
(run-time uint64 :offset 56)
|
||||||
|
)
|
||||||
|
:method-count-assert 9
|
||||||
|
:size-assert #x40
|
||||||
|
:flag-assert #x900000040
|
||||||
|
(:methods
|
||||||
|
(new (symbol type) _type_ 0)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 3 of type display-frame
|
||||||
|
(defmethod inspect display-frame ((obj display-frame))
|
||||||
|
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||||
|
(format #t "~Tbuffer[11] @ #x~X~%" (-> obj buffer))
|
||||||
|
(format #t "~Tcalc-buf: ~A~%" (-> obj calc-buf))
|
||||||
|
(format #t "~Tvu1-buf: ~A~%" (-> obj calc-buf))
|
||||||
|
(format #t "~Tdebug-buf: ~A~%" (-> obj debug-buf))
|
||||||
|
(format #t "~Tglobal-buf: ~A~%" (-> obj global-buf))
|
||||||
|
(format #t "~Tbucket-group: #<dma-bucket @ #x~X>~%" (-> obj buffer 10))
|
||||||
|
(format #t "~Tprofile-bar[2] @ #x~X~%" (-> obj profile-bar))
|
||||||
|
(format #t "~Trun-time: ~D~%" (-> obj run-time))
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 0 of type display-frame
|
||||||
|
(defmethod new display-frame ((allocation symbol) (type-to-make type))
|
||||||
|
(let
|
||||||
|
((obj
|
||||||
|
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(set! (-> obj calc-buf) (the-as dma-buffer 0))
|
||||||
|
(set! (-> obj global-buf) (the-as dma-buffer 0))
|
||||||
|
(set! (-> obj debug-buf) (the-as dma-buffer 0))
|
||||||
|
(when *debug-segment*
|
||||||
|
(set! (-> obj profile-bar 0) (new 'debug 'profile-bar))
|
||||||
|
(set! (-> obj profile-bar 1) (new 'debug 'profile-bar))
|
||||||
|
)
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition of type virtual-frame
|
||||||
|
(deftype virtual-frame (structure)
|
||||||
|
((display display-env :offset-assert 0)
|
||||||
|
(display-last display-env :offset-assert 4)
|
||||||
|
(gif pointer :offset-assert 8)
|
||||||
|
(draw draw-env :offset-assert 12)
|
||||||
|
(frame display-frame :offset-assert 16)
|
||||||
|
)
|
||||||
|
:allow-misaligned :method-count-assert 9
|
||||||
|
:size-assert #x14
|
||||||
|
:flag-assert #x900000014
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 3 of type virtual-frame
|
||||||
|
(defmethod inspect virtual-frame ((obj virtual-frame))
|
||||||
|
(format #t "[~8x] ~A~%" obj 'virtual-frame)
|
||||||
|
(format #t "~Tdisplay: #<display-env @ #x~X>~%" (-> obj display))
|
||||||
|
(format #t "~Tdisplay-last: #<display-env @ #x~X>~%" (-> obj display-last))
|
||||||
|
(format #t "~Tgif: #x~X~%" (-> obj gif))
|
||||||
|
(format #t "~Tdraw: #<draw-env @ #x~X>~%" (-> obj draw))
|
||||||
|
(format #t "~Tframe: ~A~%" (-> obj frame))
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition of type display
|
||||||
|
(deftype display (basic)
|
||||||
|
((display-env0 display-env :inline :offset-assert 8)
|
||||||
|
(display-env1 display-env :inline :offset-assert 48)
|
||||||
|
(display-env2 display-env :inline :offset-assert 88)
|
||||||
|
(gif-tag0 uint128 :offset-assert 128)
|
||||||
|
(draw0 draw-env :inline :offset-assert 144)
|
||||||
|
(gif-tag1 uint128 :offset-assert 272)
|
||||||
|
(draw1 draw-env :inline :offset-assert 288)
|
||||||
|
(gif-tag2 uint128 :offset-assert 416)
|
||||||
|
(draw2 draw-env :inline :offset-assert 432)
|
||||||
|
(on-screen int32 :offset-assert 560)
|
||||||
|
(last-screen int32 :offset-assert 564)
|
||||||
|
(frames virtual-frame 6 :inline :offset-assert 568)
|
||||||
|
(bg-clear-color rgba 4 :offset-assert 760)
|
||||||
|
(real-frame-counter uint64 :offset-assert 776)
|
||||||
|
(base-frame-counter uint64 :offset-assert 784)
|
||||||
|
(game-frame-counter uint64 :offset-assert 792)
|
||||||
|
(integral-frame-counter uint64 :offset-assert 800)
|
||||||
|
(real-integral-frame-counter uint64 :offset-assert 808)
|
||||||
|
(actual-frame-counter uint64 :offset-assert 816)
|
||||||
|
(real-actual-frame-counter uint64 :offset-assert 824)
|
||||||
|
(part-frame-counter uint64 :offset-assert 832)
|
||||||
|
(old-real-frame-counter uint64 :offset-assert 840)
|
||||||
|
(old-base-frame-counter uint64 :offset-assert 848)
|
||||||
|
(old-game-frame-counter uint64 :offset-assert 856)
|
||||||
|
(old-integral-frame-counter uint64 :offset-assert 864)
|
||||||
|
(old-real-integral-frame-counter uint64 :offset-assert 872)
|
||||||
|
(old-actual-frame-counter uint64 :offset-assert 880)
|
||||||
|
(old-real-actual-frame-counter uint64 :offset-assert 888)
|
||||||
|
(old-part-frame-counter uint64 :offset-assert 896)
|
||||||
|
(time-ratio float :offset-assert 904)
|
||||||
|
(seconds-per-frame float :offset-assert 908)
|
||||||
|
(frames-per-second float :offset-assert 912)
|
||||||
|
(time-factor float :offset-assert 916)
|
||||||
|
(time-adjust-ratio float :offset-assert 920)
|
||||||
|
)
|
||||||
|
:method-count-assert 10
|
||||||
|
:size-assert #x39c
|
||||||
|
:flag-assert #xa0000039c
|
||||||
|
(:methods
|
||||||
|
(new (symbol type int int int int int) _type_ 0)
|
||||||
|
(set-video-time-params (_type_ float) float 9)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 3 of type display
|
||||||
|
;; Used lq/sq
|
||||||
|
(defmethod inspect display ((obj display))
|
||||||
|
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||||
|
(format #t "~Tdisplay-env0: #<display-env @ #x~X>~%" (-> obj display-env0))
|
||||||
|
(format #t "~Tdisplay-env1: #<display-env @ #x~X>~%" (-> obj display-env1))
|
||||||
|
(format #t "~Tdisplay-env2: #<display-env @ #x~X>~%" (-> obj display-env2))
|
||||||
|
(format #t "~Tgif-tag0: #x~X~%" (-> obj gif-tag0))
|
||||||
|
(format #t "~Tdraw0: #<draw-env @ #x~X>~%" (-> obj draw0))
|
||||||
|
(format #t "~Tgif-tag1: #x~X~%" (-> obj gif-tag1))
|
||||||
|
(format #t "~Tdraw1: #<draw-env @ #x~X>~%" (-> obj draw1))
|
||||||
|
(format #t "~Tgif-tag2: #x~X~%" (-> obj gif-tag2))
|
||||||
|
(format #t "~Tdraw2: #<draw-env @ #x~X>~%" (-> obj draw2))
|
||||||
|
(format #t "~Ton-screen: ~D~%" (-> obj on-screen))
|
||||||
|
(format #t "~Tlast-screen: ~D~%" (-> obj last-screen))
|
||||||
|
(format #t "~Tframes[6] @ #x~X~%" (-> obj frames))
|
||||||
|
(format #t "~Tbg-clear-color[4] @ #x~X~%" (-> obj bg-clear-color))
|
||||||
|
(format #t "~Treal-frame-counter: ~D~%" (-> obj real-frame-counter))
|
||||||
|
(format #t "~Tbase-frame-counter: ~D~%" (-> obj base-frame-counter))
|
||||||
|
(format #t "~Tgame-frame-counter: ~D~%" (-> obj game-frame-counter))
|
||||||
|
(format #t "~Tintegral-frame-counter: ~D~%" (-> obj integral-frame-counter))
|
||||||
|
(format
|
||||||
|
#t
|
||||||
|
"~Treal-integral-frame-counter: ~D~%"
|
||||||
|
(-> obj real-integral-frame-counter)
|
||||||
|
)
|
||||||
|
(format #t "~Tactual-frame-counter: ~D~%" (-> obj actual-frame-counter))
|
||||||
|
(format
|
||||||
|
#t
|
||||||
|
"~Treal-actual-frame-counter: ~D~%"
|
||||||
|
(-> obj real-actual-frame-counter)
|
||||||
|
)
|
||||||
|
(format #t "~Tpart-frame-counter: ~D~%" (-> obj part-frame-counter))
|
||||||
|
(format #t "~Told-real-frame-counter: ~D~%" (-> obj old-real-frame-counter))
|
||||||
|
(format #t "~Told-base-frame-counter: ~D~%" (-> obj old-base-frame-counter))
|
||||||
|
(format #t "~Told-game-frame-counter: ~D~%" (-> obj old-game-frame-counter))
|
||||||
|
(format
|
||||||
|
#t
|
||||||
|
"~Told-integral-frame-counter: ~D~%"
|
||||||
|
(-> obj old-integral-frame-counter)
|
||||||
|
)
|
||||||
|
(format
|
||||||
|
#t
|
||||||
|
"~Told-real-integral-frame-counter: ~D~%"
|
||||||
|
(-> obj old-real-integral-frame-counter)
|
||||||
|
)
|
||||||
|
(format
|
||||||
|
#t
|
||||||
|
"~Told-actual-frame-counter: ~D~%"
|
||||||
|
(-> obj old-actual-frame-counter)
|
||||||
|
)
|
||||||
|
(format
|
||||||
|
#t
|
||||||
|
"~Told-real-actual-frame-counter: ~D~%"
|
||||||
|
(-> obj old-real-actual-frame-counter)
|
||||||
|
)
|
||||||
|
(format #t "~Told-part-frame-counter: ~D~%" (-> obj old-part-frame-counter))
|
||||||
|
(format #t "~Ttime-ratio: ~f~%" (-> obj time-ratio))
|
||||||
|
(format #t "~Tseconds-per-frame: ~f~%" (-> obj seconds-per-frame))
|
||||||
|
(format #t "~Tframes-per-second: ~f~%" (-> obj frames-per-second))
|
||||||
|
(format #t "~Ttime-factor: ~f~%" (-> obj time-factor))
|
||||||
|
(format #t "~Ttime-adjust-ratio: ~f~%" (-> obj time-adjust-ratio))
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for method 0 of type display
|
||||||
|
(defmethod
|
||||||
|
new
|
||||||
|
display
|
||||||
|
((allocation symbol)
|
||||||
|
(type-to-make type)
|
||||||
|
(psm int)
|
||||||
|
(w int)
|
||||||
|
(h int)
|
||||||
|
(ztest int)
|
||||||
|
(zpsm int)
|
||||||
|
)
|
||||||
|
(let
|
||||||
|
((obj
|
||||||
|
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(set-display obj psm w h ztest zpsm)
|
||||||
|
(set! (-> obj frames 0 display) (-> obj display-env0))
|
||||||
|
(set! (-> obj frames 1 display) (-> obj display-env1))
|
||||||
|
(set! (-> obj frames 2 display) (-> obj display-env2))
|
||||||
|
(set! (-> obj frames 3 display) (-> obj display-env0))
|
||||||
|
(set! (-> obj frames 4 display) (-> obj display-env1))
|
||||||
|
(set! (-> obj frames 5 display) (-> obj display-env2))
|
||||||
|
(set! (-> obj frames 0 display-last) (-> obj display-env2))
|
||||||
|
(set! (-> obj frames 1 display-last) (-> obj display-env0))
|
||||||
|
(set! (-> obj frames 2 display-last) (-> obj display-env1))
|
||||||
|
(set! (-> obj frames 3 display-last) (-> obj display-env2))
|
||||||
|
(set! (-> obj frames 4 display-last) (-> obj display-env0))
|
||||||
|
(set! (-> obj frames 5 display-last) (-> obj display-env1))
|
||||||
|
(set! (-> obj frames 0 gif) (&-> obj gif-tag0))
|
||||||
|
(set! (-> obj frames 1 gif) (&-> obj gif-tag1))
|
||||||
|
(set! (-> obj frames 2 gif) (&-> obj gif-tag2))
|
||||||
|
(set! (-> obj frames 3 gif) (&-> obj gif-tag0))
|
||||||
|
(set! (-> obj frames 4 gif) (&-> obj gif-tag1))
|
||||||
|
(set! (-> obj frames 5 gif) (&-> obj gif-tag2))
|
||||||
|
(set! (-> obj frames 0 draw) (-> obj draw0))
|
||||||
|
(set! (-> obj frames 1 draw) (-> obj draw1))
|
||||||
|
(set! (-> obj frames 2 draw) (-> obj draw2))
|
||||||
|
(set! (-> obj frames 3 draw) (-> obj draw0))
|
||||||
|
(set! (-> obj frames 4 draw) (-> obj draw1))
|
||||||
|
(set! (-> obj frames 5 draw) (-> obj draw2))
|
||||||
|
(set! (-> obj frames 0 frame) (new 'global 'display-frame))
|
||||||
|
(set! (-> obj frames 1 frame) (new 'global 'display-frame))
|
||||||
|
(set! (-> obj frames 2 frame) (-> obj frames 0 frame))
|
||||||
|
(set! (-> obj frames 3 frame) (-> obj frames 1 frame))
|
||||||
|
(set! (-> obj frames 4 frame) (-> obj frames 0 frame))
|
||||||
|
(set! (-> obj frames 5 frame) (-> obj frames 1 frame))
|
||||||
|
(default-buffer-init *default-regs-buffer*)
|
||||||
|
(set!
|
||||||
|
(-> obj bg-clear-color 0)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
(set!
|
||||||
|
(-> obj bg-clear-color 1)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
(set!
|
||||||
|
(-> obj bg-clear-color 2)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
(set!
|
||||||
|
(-> obj bg-clear-color 3)
|
||||||
|
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
|
||||||
|
)
|
||||||
|
obj
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
;; definition for symbol *pre-draw-hook*, type (function none)
|
||||||
|
(define *pre-draw-hook* nothing)
|
||||||
|
|
||||||
|
;; definition for symbol *post-draw-hook*, type (function none)
|
||||||
|
(define *post-draw-hook* nothing)
|
||||||
|
|
||||||
|
;; failed to figure out what this is:
|
||||||
|
(let ((v0-5 0))
|
||||||
|
)
|
||||||
|
|
@ -138,6 +138,7 @@
|
|||||||
:size-assert #x4010
|
:size-assert #x4010
|
||||||
:flag-assert #xe00004010
|
:flag-assert #xe00004010
|
||||||
(:methods
|
(:methods
|
||||||
|
(new (symbol type) _type_ 0)
|
||||||
(get-last-frame-time-stamp (_type_) uint 9)
|
(get-last-frame-time-stamp (_type_) uint 9)
|
||||||
(reset (_type_) _type_ 10)
|
(reset (_type_) _type_ 10)
|
||||||
(add-frame (_type_ symbol rgba) profile-frame 11)
|
(add-frame (_type_ symbol rgba) profile-frame 11)
|
||||||
|
@ -17,7 +17,7 @@ const std::unordered_set<std::string> g_object_files_to_decompile = {
|
|||||||
"trigonometry-h", /* transformq-h */ "matrix", "transform", "quaternion",
|
"trigonometry-h", /* transformq-h */ "matrix", "transform", "quaternion",
|
||||||
"euler", /* geometry, trigonometry, */
|
"euler", /* geometry, trigonometry, */
|
||||||
"gsound-h", "timer-h", "timer", "vif-h", "dma-h", "video-h", "vu1-user-h", "dma", "dma-buffer",
|
"gsound-h", "timer-h", "timer", "vif-h", "dma-h", "video-h", "vu1-user-h", "dma", "dma-buffer",
|
||||||
"dma-bucket", "dma-disasm", "pad", "gs",
|
"dma-bucket", "dma-disasm", "pad", "gs", "display-h",
|
||||||
/* gap */
|
/* gap */
|
||||||
"bounding-box",
|
"bounding-box",
|
||||||
/* gap */
|
/* gap */
|
||||||
@ -32,7 +32,7 @@ const std::vector<std::string> g_object_files_to_check_against_reference = {
|
|||||||
/* transformq-h, */
|
/* transformq-h, */
|
||||||
"matrix", "transform", "quaternion", "euler", /* geometry, trigonometry */
|
"matrix", "transform", "quaternion", "euler", /* geometry, trigonometry */
|
||||||
"gsound-h", "timer-h", /* timer, */ "vif-h", "dma-h", "video-h", "vu1-user-h", "dma",
|
"gsound-h", "timer-h", /* timer, */ "vif-h", "dma-h", "video-h", "vu1-user-h", "dma",
|
||||||
"dma-buffer", "dma-bucket", "dma-disasm", "pad", "gs",
|
"dma-buffer", "dma-bucket", "dma-disasm", "pad", "gs", "display-h",
|
||||||
/* gap */ "bounding-box",
|
/* gap */ "bounding-box",
|
||||||
/* gap */
|
/* gap */
|
||||||
"sync-info-h", "sync-info"};
|
"sync-info-h", "sync-info"};
|
||||||
@ -123,6 +123,9 @@ const std::unordered_set<std::string> skip_in_compiling = {
|
|||||||
// gs
|
// gs
|
||||||
"(method 3 gif-tag)", // inspect for a 128-bit type.
|
"(method 3 gif-tag)", // inspect for a 128-bit type.
|
||||||
|
|
||||||
|
// display-h
|
||||||
|
"put-draw-env",
|
||||||
|
|
||||||
// sync-info
|
// sync-info
|
||||||
"(method 15 sync-info)", // needs display stuff first
|
"(method 15 sync-info)", // needs display stuff first
|
||||||
"(method 15 sync-info-eased)", // needs display stuff first
|
"(method 15 sync-info-eased)", // needs display stuff first
|
||||||
|
Loading…
Reference in New Issue
Block a user