Files
jak-project/goal_src/jak2/engine/gfx/font.gc
T

171 lines
5.6 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: font.gc
;; name in dgo: font
;; dgos: ENGINE, GAME
(def-mips2c draw-string-asm (function string dma-buffer font-context uint))
(def-mips2c draw-string (function string dma-buffer font-context draw-string-result))
(def-mips2c get-string-length (function string font-context draw-string-result))
;; DECOMP BEGINS
;; WARN: Return type mismatch object vs none.
(defun gen-font-12 ((arg0 string))
(format #t "(define ~s~%" arg0)
(format #t " (new 'static 'inline-array 'vector 0~%")
(dotimes (gp-0 250)
(let ((f0-1 (+ 0.0009765625 (* 0.03125 (the float (/ (mod gp-0 250) 10)))))
(f1-3 (+ 0.00390625 (* 0.09375 (the float (mod gp-0 10)))))
(v1-10 (if (< gp-0 250)
gp-0
(+ gp-0 6)
)
)
)
(cond
((zero? v1-10)
(format
#t
"~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x 'upside down ~c'~%"
f1-3
f0-1
(+ v1-10 6)
94
)
)
((= v1-10 1)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '`'~%" f1-3 f0-1 (+ v1-10 6))
)
((= v1-10 2)
(let ((t9-4 format)
(a0-8 #t)
(a1-4 "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x ''~%")
(a2-3 f1-3)
(a3-2 f0-1)
(t0-2 (+ v1-10 6))
)
180
(t9-4 a0-8 a1-4 a2-3 a3-2 t0-2)
)
)
((= v1-10 3)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 94)
)
((= v1-10 4)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 126)
)
((= v1-10 5)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 168)
)
((= v1-10 6)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 176)
)
((= v1-10 7)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 161)
)
((= v1-10 8)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 191)
)
((= v1-10 9)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 186)
)
((= v1-10 10)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 174)
)
((= v1-10 11)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 198)
)
((= v1-10 12)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 230)
)
((= v1-10 13)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 199)
)
((= v1-10 14)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 231)
)
((= v1-10 15)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%" f1-3 f0-1 (+ v1-10 6) 223)
)
((and (< 15 v1-10) (< v1-10 78))
(format
#t
"~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%"
f1-3
f0-1
(+ v1-10 6)
(+ v1-10 16)
)
)
((= v1-10 78)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x 'oe'~%" f1-3 f0-1 (+ v1-10 6))
)
((and (< 78 v1-10) (< v1-10 108))
(format
#t
"~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%"
f1-3
f0-1
(+ v1-10 6)
(+ v1-10 16)
)
)
((= v1-10 108)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x 'OE'~%" f1-3 f0-1 (+ v1-10 6))
)
((and (< 108 v1-10) (< v1-10 111))
(format
#t
"~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x '~c'~%"
f1-3
f0-1
(+ v1-10 6)
(+ v1-10 16)
)
)
((= v1-10 111)
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x 'TM'~%" f1-3 f0-1 (+ v1-10 6))
)
(else
(format #t "~t (new 'static 'vector :x ~f :y ~f :z 1.0 :w 16.0) ; $~2x~%" f1-3 f0-1 (+ v1-10 6))
)
)
)
(when (= (mod gp-0 10) 9)
(if (!= gp-0 419)
(format #t "~%")
)
)
)
(format #t "~t)~%")
(format #t " )~%")
(none)
)
;; ERROR: function was not converted to expressions. Cannot decompile.
;; ERROR: function was not converted to expressions. Cannot decompile.
;; ERROR: function was not converted to expressions. Cannot decompile.
(defun draw-string-xy ((arg0 string) (arg1 dma-buffer) (arg2 int) (arg3 int) (arg4 font-color) (arg5 font-flags))
(let ((a2-2 (new 'stack 'font-context *font-default-matrix* arg2 arg3 0.0 arg4 arg5)))
(draw-string arg0 arg1 a2-2)
)
)
;; WARN: Return type mismatch float vs none.
(defun draw-string-adv ((arg0 string) (arg1 dma-buffer) (arg2 font-context))
(let ((v1-0 (draw-string arg0 arg1 arg2)))
(+! (-> arg2 origin x) (-> v1-0 length))
)
(none)
)