jak-project/goal_src/engine/gfx/hw/video-h.gc
water111 1898c7c52a
[decomp] texture (#684)
* temp

* more cleanup

* fix merge issue

* handle no texture correctly
2021-07-09 22:20:37 -04:00

65 lines
2.5 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: video-h.gc
;; name in dgo: video-h
;; dgos: GAME, ENGINE
;; The "video" system manages PAL vs. NTSC and aspect ratio settings
;; (not including timing difference between PAL/NTSC)
;; These are stored in the *video-parms* global.
;; The game is interlaced, meaning each framebuffer is half height.
;; There are two
(deftype video-parms (structure)
((set-video-mode basic :offset-assert 0)
(reset-video-mode basic :offset-assert 4)
(screen-sy int32 :offset-assert 8) ;; height of framebuffer (1/2 of output resolution)
(screen-hy int32 :offset-assert 12) ;; half of fb height (1/4 of output resolution)
(screen-miny int32 :offset-assert 16) ;; min y in WCS (pixels), centered around 2048 (1/2)
(screen-maxy int32 :offset-assert 20) ;; max y in WCS (pixels)
(screen-masky int32 :offset-assert 24) ;; mask of bits that actually change in height (sy -1)
(display-dx int32 :offset-assert 28) ;; offset for displaying framebuffer
(display-dy int32 :offset-assert 32)
(screen-pages-high int32 :offset-assert 36) ;; GS pages
(_pad int64)
(relative-x-scale float :offset-assert 48) ;; x scale for 4x3 / 16x9
(relative-y-scale float :offset-assert 52) ;; y scale for NTSC/PAL
(_pad2 int64)
(relative-x-scale-reciprical float :offset-assert 64) ;; reciprocal of the above scales
(relative-y-scale-reciprical float :offset-assert 68)
)
:method-count-assert 9
:size-assert #x48
:flag-assert #x900000048
)
;; default to NTSC
(define *video-parms*
(new 'static 'video-parms
:set-video-mode #f
:reset-video-mode #f
:screen-sy 224
:screen-hy 112
:screen-miny 1824
:screen-maxy 2272
:screen-masky #xdf
:display-dx 0
:display-dy 8
:screen-pages-high 7
:relative-x-scale 1.0
:relative-y-scale 1.0
:relative-x-scale-reciprical 1.0
:relative-y-scale-reciprical 0.0 ;; wrong.
)
)
(define-extern get-video-mode (function symbol))
(define-extern get-aspect-ratio (function symbol))
(define-extern set-hud-aspect-ratio (function symbol symbol none))
(define-extern set-aspect-ratio (function symbol none))
(define-extern set-video-mode (function symbol none))