mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
26f19e8b14
* use `game-text-id->string` function here * small cleanup to pc progress code * better way to handle "locked" texts * this is better * fix potential incompatibilities with merc & ocean renderers * show cheat requirements in menu + change requirements * increase size of money starburst * split some more subtitles * potentially fix a vsync bug? * change territory encoding logic * pass game territory to compiler * ugh LOL
50 lines
1.2 KiB
Common Lisp
50 lines
1.2 KiB
Common Lisp
;;
|
|
;; Compiler Setup for Jak 1
|
|
;;
|
|
|
|
;; load kernel type definitions.
|
|
;; these types/functions are provided by Jak 1's runtime.
|
|
(asm-file "goal_src/jak1/kernel-defs.gc")
|
|
|
|
;; load jak 1 project
|
|
(load-project "goal_src/jak1/game.gp")
|
|
|
|
;; jak 1 - specific library stuff.
|
|
|
|
(defmacro __get_jak1_full_game () *jak1-full-game*)
|
|
(defconstant *jak1-full-game* (__get_jak1_full_game))
|
|
(defmacro __get_jak1_territory () *jak1-territory*)
|
|
(defconstant *jak1-territory* (__get_jak1_territory))
|
|
|
|
(defmacro load-art-import (name)
|
|
`(asm-file ,(string-append "goal_src/jak1/import/" (symbol->string name) "-ag.gc") :no-code :no-throw))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;; TYPE STUFF
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(defmacro basic? (obj)
|
|
;; todo, make this more efficient
|
|
`(= 4 (logand (the integer ,obj) #b111))
|
|
)
|
|
|
|
(defmacro pair? (obj)
|
|
;; todo, make this more efficient
|
|
;`(= 2 (logand (the integer ,obj) #b111))
|
|
`(< (shl (the-as int ,obj) 62) 0)
|
|
)
|
|
|
|
(defmacro not-pair? (obj)
|
|
`(>= (shl (the-as int ,obj) 62) 0)
|
|
)
|
|
|
|
(defmacro binteger? (obj)
|
|
`(zero? (logand (the integer ,obj) #b111))
|
|
)
|
|
|
|
(defmacro rtype-of (obj)
|
|
`(cond ((binteger? ,obj) binteger)
|
|
((pair? ,obj) pair)
|
|
(else (-> (the basic ,obj) type))
|
|
)
|
|
) |