jak-project
jak-project copied to clipboard
[jak 2] First pass at new type pass
It makes it through KERNEL.CGO on jak 1 and 2, correctly solving all the jak 2 float issues.
Unlike previous hacks, it also works for jak 2 smooth-step:
(defun smooth-step ((arg0 float))
(cond
((>= 0.0 arg0)
0.0
)
((>= arg0 1.0)
1.0
)
(else
(* arg0 arg0 (+ 3.0 (* -2.0 arg0)))
)
)
)
which is confusing to figure out that the 0.0 and 1.0 are floats. It has to see that the return type is float, and propagate this back to the blocks in the cond.
Remaining to-dos:
- fix some missing stuff for stack slots
- fix some missing stuff for enter-state
- go through more of jak 1
- label guessing
I plan to merge after that. We'll want to handle stack structures in a similar way to labels, but I'd like to rewrite some other stack structure stuff first.