mirror of
https://github.com/open-goal/jak-project
synced 2026-07-28 15:18:47 -04:00
f48fda692e
* docs for ee merc code * 150fps support but it replaces 60fps * oops switched wrong mode * oops 50.0 not 50 * formatting * fix cutscene speed * oops * Replace latest merc.md, not sure what happened * Automatically switch between video modes (ntsc or 150fps) based on refresh rate. Cleanup particle timing * cleanup * fix idle animation * linter * fix village2 crash * can load all levels again * update loader output and replace sparticle time with formula * Add 100fps support, add some comments, fix build * formatting Co-authored-by: water <awaterford111445@gmail.com>
113 lines
4.0 KiB
Common Lisp
113 lines
4.0 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: video.gc
|
|
;; name in dgo: video
|
|
;; dgos: GAME, ENGINE
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(defun set-video-mode ((arg0 symbol))
|
|
(case arg0
|
|
(('ntsc)
|
|
(set! (-> *video-parms* screen-sy) 224)
|
|
(set! (-> *setting-control* default screenx) 0)
|
|
(set! (-> *setting-control* default screeny) 8)
|
|
(set! (-> *video-parms* screen-pages-high) 7)
|
|
(set! (-> *video-parms* relative-y-scale) 1.0)
|
|
(set! *ticks-per-frame* 9765) ;; 585900 total?
|
|
(set! (-> *math-camera* isometric vector 1 y) 0.5)
|
|
(set! (-> *math-camera* y-pix) 112.0)
|
|
(set! (-> *math-camera* y-clip) 448.0)
|
|
(set! (-> *shadow-data* texoffset y) 112.5)
|
|
)
|
|
(('pal)
|
|
(set! (-> *video-parms* screen-sy) 256)
|
|
(set! (-> *setting-control* default screenx) 0)
|
|
(set! (-> *setting-control* default screeny) 24)
|
|
(set! (-> *video-parms* screen-pages-high) 8)
|
|
(set! (-> *video-parms* relative-y-scale) 1.1428572)
|
|
(set! *ticks-per-frame* 11718)
|
|
(set! (-> *math-camera* isometric vector 1 y) 0.4375)
|
|
(set! (-> *math-camera* y-pix) 128.0)
|
|
(set! (-> *math-camera* y-clip) 512.0)
|
|
(set! (-> *shadow-data* texoffset y) 128.5)
|
|
)
|
|
(('100fps)
|
|
(set! (-> *video-parms* screen-sy) 224)
|
|
(set! (-> *setting-control* default screenx) 0)
|
|
(set! (-> *setting-control* default screeny) 8)
|
|
(set! (-> *video-parms* screen-pages-high) 7)
|
|
(set! (-> *video-parms* relative-y-scale) 1.0)
|
|
(set! *ticks-per-frame* 5859)
|
|
(set! (-> *math-camera* isometric vector 1 y) 0.5)
|
|
(set! (-> *math-camera* y-pix) 112.0)
|
|
(set! (-> *math-camera* y-clip) 448.0)
|
|
(set! (-> *shadow-data* texoffset y) 112.5)
|
|
)
|
|
(('150fps)
|
|
(set! (-> *video-parms* screen-sy) 224)
|
|
(set! (-> *setting-control* default screenx) 0)
|
|
(set! (-> *setting-control* default screeny) 8)
|
|
(set! (-> *video-parms* screen-pages-high) 7)
|
|
(set! (-> *video-parms* relative-y-scale) 1.0)
|
|
(set! *ticks-per-frame* 3906)
|
|
(set! (-> *math-camera* isometric vector 1 y) 0.5)
|
|
(set! (-> *math-camera* y-pix) 112.0)
|
|
(set! (-> *math-camera* y-clip) 448.0)
|
|
(set! (-> *shadow-data* texoffset y) 112.5)
|
|
)
|
|
)
|
|
(set-time-ratios *display* (-> *display* time-ratio))
|
|
(set! (-> *video-parms* reset-video-mode) #t)
|
|
(set! (-> *video-parms* screen-hy) (/ (-> *video-parms* screen-sy) 2))
|
|
(set! (-> *video-parms* screen-miny) (- 2048 (-> *video-parms* screen-hy)))
|
|
(set! (-> *video-parms* screen-maxy) (+ (-> *video-parms* screen-hy) 2048))
|
|
(set! (-> *video-parms* screen-masky) (+ (-> *video-parms* screen-sy) -1))
|
|
(set! (-> *pause-context* origin y) (the float (+ (-> *video-parms* screen-sy) -54)))
|
|
(set! (-> *pause-context* height) (the float (-> *video-parms* screen-sy)))
|
|
(set! (-> *font-default-matrix* vector 1 y) (-> *video-parms* relative-y-scale))
|
|
(set! (-> *font-default-matrix* vector 3 y) (- (the float (-> *video-parms* screen-hy))))
|
|
(set! (-> *video-parms* relative-y-scale-reciprical) 1.0)
|
|
(set! *profile-y* (+ (-> *video-parms* screen-miny) 8))
|
|
(set! (-> *video-parms* set-video-mode) #t)
|
|
(set-hud-aspect-ratio (get-aspect-ratio) arg0)
|
|
(if *progress-process*
|
|
(adjust-ratios (-> *progress-process* 0) (get-aspect-ratio) arg0)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defun get-video-mode ()
|
|
(-> *setting-control* current video-mode)
|
|
)
|
|
|
|
(defun set-aspect-ratio ((arg0 symbol))
|
|
(case arg0
|
|
(('aspect4x3)
|
|
(set! (-> *video-parms* relative-x-scale) 1.0)
|
|
(set! (-> *video-parms* relative-x-scale-reciprical) 1.0)
|
|
)
|
|
(('aspect16x9)
|
|
(set! (-> *video-parms* relative-x-scale) 0.75)
|
|
(set! (-> *video-parms* relative-x-scale-reciprical) 1.3333334)
|
|
)
|
|
)
|
|
(set! (-> *font-default-matrix* vector 0 x) (-> *video-parms* relative-x-scale))
|
|
(set-hud-aspect-ratio arg0 (get-video-mode))
|
|
(if *progress-process*
|
|
(adjust-ratios (-> *progress-process* 0) arg0 (get-video-mode))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
(defun get-aspect-ratio ()
|
|
(-> *setting-control* current aspect-ratio)
|
|
)
|
|
|
|
|
|
|
|
|