mirror of
https://github.com/open-goal/jak-project
synced 2026-08-16 13:17:34 -04:00
66e48195cb
Fixes #2167 Reduces test flakiness if ran on multiple threads and gets rid of a few hundred files from the source tree I believe this also makes #1434 irrelevant and it can be closed. --------- Co-authored-by: ManDude <7569514+ManDude@users.noreply.github.com>
48 lines
1.1 KiB
Common Lisp
48 lines
1.1 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))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;; 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))
|
|
)
|
|
)
|