jak-project/goal_src/jak2/engine/gfx/font-h.gc
ManDude 4b8b2abbed
port pckernel to Jak 2 (#2248)
Adds the `pckernel` system to Jak 2, allowing you to do the PC-specific
things that Jak 1 lets you do like change game resolution, etc.

In other to reduce the amount of code duplication for something that
we're gonna be changing a lot over time, I split it into a few more code
files. In this new system, `pckernel-h.gc`, `pckernel-common.gc`
(previously `pckernel.gc`) and `pc-debug-common.gc` are the files that
should be shared across all games (I hacked the Jak 2 project to pull
these files from the Jak 1 folder), while `pckernel-impl.gc`,
`pckernel.gc` and `pc-debug-methods.gc` are their respective
game-specific counterparts that should be loaded after. I'm not fully
happy with this, I think it's slightly messy, but it cleanly separates
code that should be game-specific and not accidentally copied around and
code that should be the same for all games anyway.
2023-02-25 10:19:32 -05:00

734 lines
35 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: font-h.gc
;; name in dgo: font-h
;; dgos: ENGINE, GAME
;; TODO: figure out what's weird with set-font-color
;; The font system draws all of the strings.
;; +++font-color
(defenum font-color
:type uint32
(default 0)
(#dadada 1)
(#ededed 2)
(red 3)
(gold-#ba9200 4)
(yellow-#f3f300 5)
(green-#3df23d 6)
(blue-#003cf1 7)
(cyan-#00fefe 8)
(magenta-#f87df8 9)
(#a0d5d5 10)
(#7cbaba 11)
(white-#ffffff 12)
(#959595 13)
(#f9a400 14)
(#daf95e 15)
(#8aa81f 16)
(#a6b5a6 17)
(#757f75 18)
(#5e3f5e 19)
(flat-yellow 20)
(#3fbaed 21)
(#3a3a3a 22)
(#5c5c5c 23)
(#f298c8 24)
(#f46868 25)
(#20ca98 26)
(#8289de 27)
(#a8f3f6 28)
(#fef666 29)
(#f1f104 30)
(#8ed0f4 31)
(#7efbfb 32)
(#7ffcfc 33)
(#f9f9f9 34)
(#408080 35)
(#e0f0e0 36)
(#c00000 37)
(#ffc040 38)
(#000000 39)
)
;; ---font-color
;; copied from jak1, not completely confirmed.
(defenum font-flags
:type uint32
:bitfield #t
(shadow 0)
(kerning 1)
(middle 2)
(left 3)
(right 4)
(large 5)
(pc-hack 6)
)
;; added type
(deftype draw-string-result (uint64)
((length float :offset 0)
(b float :offset 32))
)
(define-extern draw-string-xy (function string dma-buffer int int font-color font-flags draw-string-result))
;; DECOMP BEGINS
(deftype char-verts (structure)
((pos vector 4 :inline :offset-assert 0)
(color vector 4 :inline :offset-assert 64)
(tex-st vector 4 :inline :offset-assert 128)
)
:method-count-assert 9
:size-assert #xc0
:flag-assert #x9000000c0
)
(deftype char-color (structure)
((color rgba 4 :offset-assert 0)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
)
(define *font-default-matrix*
(new 'static 'matrix
:data (new 'static 'array float 16 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 -256.0 -208.0 0.0 1.0)
)
)
;; font settings that can be passed to draw-string
(deftype font-context (basic)
((origin vector :inline :offset-assert 16)
(strip-gif vector :inline :offset-assert 32)
(width float :offset-assert 48)
(height float :offset-assert 52)
(projection float :offset-assert 56)
(scale float :offset-assert 60)
(color font-color :offset-assert 64)
(flags font-flags :offset-assert 68)
(mat matrix :offset-assert 72)
(start-line uint32 :offset-assert 76)
(alpha float :offset-assert 80)
)
:method-count-assert 21
:size-assert #x54
:flag-assert #x1500000054
(:methods
(new (symbol type matrix int int float font-color font-flags) _type_ 0)
(set-mat! (font-context matrix) font-context 9)
(set-origin! (font-context int int) font-context 10)
(set-depth! (font-context int) font-context 11)
(set-w! (font-context float) font-context 12)
(set-width! (font-context int) font-context 13)
(set-height! (font-context int) font-context 14)
(set-projection! (font-context float) font-context 15)
(set-color! (font-context font-color) font-context 16)
(set-flags! (font-context font-flags) font-context 17)
(set-start-line! (font-context uint) font-context 18)
(set-scale! (font-context float) font-context 19)
(set-alpha! (font-context float) font-context 20)
)
)
(defmethod set-mat! font-context ((obj font-context) (arg0 matrix))
(set! (-> obj mat) arg0)
obj
)
(defmethod set-origin! font-context ((obj font-context) (arg0 int) (arg1 int))
(set! (-> obj origin x) (the float arg0))
(set! (-> obj origin y) (the float arg1))
obj
)
(defmethod set-depth! font-context ((obj font-context) (arg0 int))
(set! (-> obj origin z) (the float arg0))
obj
)
(defmethod set-w! font-context ((obj font-context) (arg0 float))
(set! (-> obj origin w) arg0)
obj
)
(defmethod set-width! font-context ((obj font-context) (arg0 int))
(set! (-> obj width) (the float arg0))
obj
)
(defmethod set-height! font-context ((obj font-context) (arg0 int))
(set! (-> obj height) (the float arg0))
obj
)
(defmethod set-projection! font-context ((obj font-context) (arg0 float))
(set! (-> obj projection) arg0)
obj
)
(defmethod set-color! font-context ((obj font-context) (arg0 font-color))
(set! (-> obj color) arg0)
obj
)
(defmethod set-flags! font-context ((obj font-context) (arg0 font-flags))
(set! (-> obj flags) arg0)
obj
)
(defmethod set-start-line! font-context ((obj font-context) (arg0 uint))
(set! (-> obj start-line) arg0)
obj
)
(defmethod set-scale! font-context ((obj font-context) (arg0 float))
(set! (-> obj scale) arg0)
obj
)
(defmethod set-alpha! font-context ((obj font-context) (arg0 float))
(set! (-> obj alpha) arg0)
obj
)
(defmethod new font-context ((allocation symbol)
(type-to-make type)
(arg0 matrix)
(arg1 int)
(arg2 int)
(arg3 float)
(arg4 font-color)
(arg5 font-flags)
)
(let ((v0-0 (object-new allocation type-to-make (the-as int (-> type-to-make size)))))
(set! (-> v0-0 mat) arg0)
(let ((v1-3 v0-0))
(set! (-> v1-3 origin x) (the float arg1))
(set! (-> v1-3 origin y) (the float arg2))
)
(cond
((= arg3 0.0)
(let ((v1-4 v0-0))
(set! (-> v1-4 origin z) (-> *math-camera* isometric trans z))
)
)
(else
(let ((v1-5 v0-0))
(set! (-> v1-5 origin z) arg3)
)
)
)
(let ((v1-6 v0-0))
(set! (-> v1-6 origin w) 1.0)
)
(let ((v1-7 v0-0))
(set! (-> v1-7 width) (the float #x200))
)
(let ((v1-8 v0-0))
(set! (-> v1-8 height) (the float #x1a0))
)
(let ((v1-9 v0-0))
(set! (-> v1-9 projection) 1.0)
)
(set! (-> v0-0 color) arg4)
(set! (-> v0-0 flags) arg5)
(let ((a0-6 v0-0))
(set! (-> a0-6 start-line) (the-as uint 0))
)
(let ((v1-13 v0-0))
(set! (-> v1-13 scale) 1.0)
)
(let ((v1-14 v0-0))
(set! (-> v1-14 alpha) 1.0)
)
v0-0
)
)
(deftype font-work (structure)
((font-tmpl dma-gif-packet :inline :offset-assert 0)
(char-tmpl dma-gif-packet :inline :offset-assert 32)
(tex1-tmpl uint64 2 :offset-assert 64)
(small-font-0-tmpl uint64 2 :offset-assert 80)
(small-font-1-tmpl uint64 2 :offset-assert 96)
(small-font-2-tmpl uint64 2 :offset-assert 112)
(small-font-3-tmpl uint64 2 :offset-assert 128)
(large-font-0-tmpl uint64 2 :offset-assert 144)
(large-font-1-tmpl uint64 2 :offset-assert 160)
(large-font-2-tmpl uint64 2 :offset-assert 176)
(large-font-3-tmpl uint64 2 :offset-assert 192)
(size1-small vector :inline :offset-assert 208)
(size2-small vector :inline :offset-assert 224)
(size3-small vector :inline :offset-assert 240)
(size1-large vector :inline :offset-assert 256)
(size2-large-0 vector :inline :offset-assert 272)
(size2-large-1 vector :inline :offset-assert 288)
(size2-large-2 vector :inline :offset-assert 304)
(size2-large-3 vector :inline :offset-assert 320)
(size3-large vector :inline :offset-assert 336)
(size2-0 vector :inline :offset-assert 352)
(size2-1 vector :inline :offset-assert 368)
(size2-2 vector :inline :offset-assert 384)
(size2-3 vector :inline :offset-assert 400)
(size-st1 vector :inline :offset-assert 416)
(size-st2 vector :inline :offset-assert 432)
(size-st3 vector :inline :offset-assert 448)
(save vector :inline :offset-assert 464)
(save-color vector 4 :inline :offset-assert 480)
(current-verts char-verts :inline :offset-assert 544)
(src-verts char-verts :inline :offset-assert 736)
(dest-verts char-verts :inline :offset-assert 928)
(justify vector 64 :inline :offset-assert 1120)
(color-shadow vector4w :inline :offset-assert 2144)
(color-table char-color 40 :inline :offset-assert 2160)
(current-font-0-tmpl uint64 2 :offset-assert 2800)
(current-font-1-tmpl uint64 2 :offset-assert 2816)
(current-font-2-tmpl uint64 2 :offset-assert 2832)
(current-font-3-tmpl uint64 2 :offset-assert 2848)
(last-color font-color :offset-assert 2864)
(save-last-color font-color :offset-assert 2868)
(buf basic :offset-assert 2872)
(str-ptr uint32 :offset-assert 2876)
(flags font-flags :offset-assert 2880)
(reg-save uint32 5 :offset-assert 2884)
)
:method-count-assert 9
:size-assert #xb58
:flag-assert #x900000b58
)
(define *font-work*
(new 'static 'font-work
:font-tmpl (new 'static 'dma-gif-packet
:dma-vif (new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x2 :cmd (vif-cmd direct) :msk #x1)
)
:gif (new 'static 'array uint64 2 #x102e400000008001 #xe)
)
:char-tmpl (new 'static 'dma-gif-packet
:dma-vif (new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #xe :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #xe :cmd (vif-cmd direct) :msk #x1)
)
:gif (new 'static 'array uint64 2 #xd02e400000008001 #x412412412412e)
)
:tex1-tmpl (new 'static 'array uint64 2 #x60 #x14)
:small-font-0-tmpl (new 'static 'array uint64 2 #x0 #x6)
:small-font-1-tmpl (new 'static 'array uint64 2 #x0 #x6)
:small-font-2-tmpl (new 'static 'array uint64 2 #x0 #x6)
:small-font-3-tmpl (new 'static 'array uint64 2 #x0 #x6)
:large-font-0-tmpl (new 'static 'array uint64 2 #x0 #x6)
:large-font-1-tmpl (new 'static 'array uint64 2 #x0 #x6)
:large-font-2-tmpl (new 'static 'array uint64 2 #x0 #x6)
:large-font-3-tmpl (new 'static 'array uint64 2 #x0 #x6)
:size1-small (new 'static 'vector :x 12.0 :w 0.5)
:size2-small (new 'static 'vector :y 14.857 :w 8.0)
:size3-small (new 'static 'vector :x 12.0 :y 14.857 :w 14.857)
:size1-large (new 'static 'vector :x 24.0 :w 1.0)
:size2-large-0 (new 'static 'vector :y 29.714 :w 24.0)
:size2-large-1 (new 'static 'vector :y 29.714 :w 24.0)
:size2-large-2 (new 'static 'vector :y 29.714 :w 24.0)
:size2-large-3 (new 'static 'vector :y 29.714 :w 24.0)
:size3-large (new 'static 'vector :x 24.0 :y 29.714 :w 29.714)
:size-st1 (new 'static 'vector :x 0.08985 :w 0.5)
:size-st2 (new 'static 'vector :y 0.031007752 :w 0.5)
:size-st3 (new 'static 'vector :x 0.08985 :y 0.031007752 :w 0.5)
:current-verts (new 'static 'char-verts
:pos (new 'static 'inline-array vector 4
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
)
:tex-st (new 'static 'inline-array vector 4
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
)
)
:src-verts (new 'static 'char-verts
:pos (new 'static 'inline-array vector 4
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
)
:tex-st (new 'static 'inline-array vector 4
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
)
)
:dest-verts (new 'static 'char-verts
:pos (new 'static 'inline-array vector 4
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
(new 'static 'vector :w 1.0)
)
:tex-st (new 'static 'inline-array vector 4
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
(new 'static 'vector :z 1.0)
)
)
:color-shadow (new 'static 'vector4w :data (new 'static 'array int32 4 #x0 #x0 #x0 #x80))
:color-table (new 'static 'inline-array char-color 40
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x40)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x20 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x64 :a #x80)
(new 'static 'rgba :r #x80 :g #x64 :a #x80)
(new 'static 'rgba :r #x80 :g #x64 :a #x80)
(new 'static 'rgba :r #x80 :g #x64 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80)
(new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80)
(new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80)
(new 'static 'rgba :r #x20 :g #x80 :b #x20 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :g #x20 :b #x80 :a #x80)
(new 'static 'rgba :g #x20 :b #x80 :a #x80)
(new 'static 'rgba :g #x20 :b #x80 :a #x80)
(new 'static 'rgba :g #x20 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x40 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x60 :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)
(new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)
(new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)
(new 'static 'rgba :r #x40 :g #x60 :b #x60 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
(new 'static 'rgba :r #x50 :g #x50 :b #x50 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x54 :a #x80)
(new 'static 'rgba :r #x80 :g #x54 :a #x80)
(new 'static 'rgba :r #x80 :g #x54 :a #x80)
(new 'static 'rgba :r #x80 :g #x54 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80)
(new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80)
(new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80)
(new 'static 'rgba :r #x70 :g #x80 :b #x30 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80)
(new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80)
(new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80)
(new 'static 'rgba :r #x48 :g #x58 :b #x10 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80)
(new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80)
(new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80)
(new 'static 'rgba :r #x58 :g #x60 :b #x58 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x48 :b #x40 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
(new 'static 'rgba :r #x30 :g #x20 :b #x30 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
(new 'static 'rgba :r #x80 :g #x79 :b #x48 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80)
(new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80)
(new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80)
(new 'static 'rgba :r #x20 :g #x5e :b #x78 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
(new 'static 'rgba :r #x1d :g #x1d :b #x1d :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
(new 'static 'rgba :r #x40 :g #x40 :b #x40 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
(new 'static 'rgba :r #x7a :g #x4d :b #x65 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
(new 'static 'rgba :r #x7a :g #x34 :b #x34 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
(new 'static 'rgba :r #x10 :g #x65 :b #x4c :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
(new 'static 'rgba :r #x46 :g #x4a :b #x78 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80)
(new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80)
(new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80)
(new 'static 'rgba :r #x57 :g #x7e :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80)
(new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80)
(new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80)
(new 'static 'rgba :r #x7f :g #x7b :b #x33 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80)
(new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80)
(new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80)
(new 'static 'rgba :r #x79 :g #x79 :b #x2 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80)
(new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80)
(new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80)
(new 'static 'rgba :r #x47 :g #x68 :b #x7a :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x40 :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
(new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60)
(new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60)
(new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60)
(new 'static 'rgba :r #x20 :g #x40 :b #x40 :a #x60)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
(new 'static 'rgba :r #x70 :g #x78 :b #x70 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
(new 'static 'rgba :r #x60 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
(new 'static 'rgba :r #x80 :g #x60 :b #x20 :a #x80)
)
)
(new 'static 'char-color :color (new 'static 'array rgba 4
(new 'static 'rgba :b #x1 :a #x80)
(new 'static 'rgba :b #x1 :a #x80)
(new 'static 'rgba :b #x1 :a #x80)
(new 'static 'rgba :b #x1 :a #x80)
)
)
)
)
)
(defun font-set-tex0 ((arg0 (pointer gs-tex0)) (arg1 texture) (arg2 int) (arg3 int) (arg4 int))
"Write the TEX0 parameters for a font"
(set! (-> arg0 0) (new 'static 'gs-tex0
:tcc #x1
:cld #x1
:cbp (the-as uint arg4)
:th (+ (log2 (+ (-> arg1 h) -1)) 1)
:tw (log2 (-> arg1 w))
:tbw (-> arg1 width 0)
:tbp0 (/ arg2 64)
:psm (the-as uint arg3)
)
)
(none)
)
(defun set-font-color ((arg0 int) (arg1 int) (arg2 int) (arg3 int) (arg4 int))
"I have no idea what is happening here."
(let ((v1-6 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -256)
(shr (shl arg2 56) 56)
)
)
(a2-6 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-6 2160) v1-6)
)
(let ((v1-13 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -65281)
(shr (shl arg3 56) 48)
)
)
(a2-15 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-15 2160) v1-13)
)
(let ((v1-20 (logior (logand (l.wu (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -16711681)
(shr (shl arg4 56) 40)
)
)
(a2-24 (+ (+ (* (* arg1 2) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-24 2160) v1-20)
)
(let ((v1-28
(logior (logand (l.wu (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -65281)
(shr (shl arg3 56) 48)
)
)
(a2-34 (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a2-34 2160) v1-28)
)
(let ((v1-36
(logior (logand (l.wu (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*) 2160)) -16711681)
(shr (shl arg4 56) 40)
)
)
(a0-3 (+ (+ (* (+ (* arg1 2) 1) 4) (* arg0 16)) (the-as int *font-work*)))
)
(s.w! (+ a0-3 2160) v1-36)
)
0
(none)
)