;;-*-Lisp-*-
(in-package goal)

;; name: video-h.gc
;; name in dgo: video-h
;; dgos: ENGINE, GAME

(define-extern set-aspect-ratio (function symbol none))
(define-extern set-video-mode (function symbol none))

;; DECOMP BEGINS

;; very basic settings for video output.
(deftype video-params (structure)
  ((set-video-mode               symbol)
   (reset-video-mode             symbol)
   (display-fbp                  int32)
   (relative-x-scale             float  :offset  16)
   (display-dx                   int32)
   (display-dy                   int32)
   (display-sy                   int32)
   (relative-x-scale-reciprical  float)
   (screen-pages-high            int32)
   )
  )


(define *video-params* (new 'static 'video-params
                         :set-video-mode #f
                         :reset-video-mode #f
                         :display-fbp #xa4
                         :relative-x-scale 1.0
                         :display-dy 8
                         :display-sy #xe0
                         :relative-x-scale-reciprical 1.0
                         :screen-pages-high 13 ;; full size framebuffer in jak 2.
                         )
        )



(define-extern set-graphics-mode (function none))
(define-extern get-video-mode (function symbol))

(defmacro correct-x-int (pos)
  `(the int (* (-> *video-params* relative-x-scale) (the float ,pos)))
  )
