mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
d/jak2: add missing ref tests for files that can be added to ref tests (#2061)
This commit is contained in:
@@ -2409,8 +2409,7 @@
|
||||
[74, "a1", "connection"],
|
||||
[73, "a0", "connection"],
|
||||
[77, "a2", "game-task-node-info"],
|
||||
[97, "v1", "connection"],
|
||||
[94, "v1", "connection"],
|
||||
[[93, 98], "v1", "connection"],
|
||||
[162, "s3", "process-drawable"]
|
||||
],
|
||||
"command-get-float": [[20, "gp", "bfloat"]],
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
from utils import get_gsrc_path_from_filename, get_ref_path_from_filename, get_file_list
|
||||
import os
|
||||
|
||||
# TODO - hard-coded to jak 2
|
||||
|
||||
# Get all the gsrc files, if they aren't empty -- log if they aren't added to the reference tests as well
|
||||
file_list = get_file_list("jak2")
|
||||
|
||||
# TODO - function for getting just the names
|
||||
missing_files = []
|
||||
for file in file_list:
|
||||
file_name = ""
|
||||
if file[2] != 3:
|
||||
continue
|
||||
else:
|
||||
file_name = file[0]
|
||||
|
||||
# check gsrc
|
||||
gsrc_path = get_gsrc_path_from_filename("jak2", file_name)
|
||||
if gsrc_path:
|
||||
gsrc_length = 0
|
||||
with open(gsrc_path, 'r') as fp:
|
||||
gsrc_length = len(fp.readlines())
|
||||
|
||||
if gsrc_length > 15:
|
||||
if file_name == "enemy-h":
|
||||
print(file_name)
|
||||
# check if ref exists
|
||||
ref_path = get_ref_path_from_filename("jak2", file_name, "./test/decompiler/reference/")
|
||||
if not os.path.exists(ref_path):
|
||||
missing_files.append(file_name)
|
||||
|
||||
print(missing_files)
|
||||
@@ -1,6 +1,5 @@
|
||||
import re
|
||||
import argparse
|
||||
import os
|
||||
from utils import get_gsrc_path_from_filename
|
||||
|
||||
parser = argparse.ArgumentParser("lint-gsrc-file")
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
|
||||
|
||||
|
||||
+5898
File diff suppressed because it is too large
Load Diff
+2184
File diff suppressed because it is too large
Load Diff
+310
@@ -0,0 +1,310 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type trail-node
|
||||
(deftype trail-node (structure)
|
||||
((next-id int16 :offset-assert 0)
|
||||
(prev-id int16 :offset-assert 2)
|
||||
(parent-id int16 :offset-assert 4)
|
||||
(x int16 :offset-assert 6)
|
||||
(z int16 :offset-assert 8)
|
||||
(first-conn uint16 :offset-assert 10)
|
||||
(cost-from-start uint16 :offset-assert 12)
|
||||
(cost-to-goal uint16 :offset-assert 14)
|
||||
(flags uint8 :offset-assert 16)
|
||||
(conn-count uint8 :offset-assert 17)
|
||||
)
|
||||
:method-count-assert 12
|
||||
:size-assert #x12
|
||||
:flag-assert #xc00000012
|
||||
(:methods
|
||||
(trail-node-method-9 () none 9)
|
||||
(trail-node-method-10 () none 10)
|
||||
(trail-node-method-11 () none 11)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-node
|
||||
(defmethod inspect trail-node ((obj trail-node))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'trail-node)
|
||||
(format #t "~1Tnext-id: ~D~%" (-> obj next-id))
|
||||
(format #t "~1Tprev-id: ~D~%" (-> obj prev-id))
|
||||
(format #t "~1Tparent-id: ~D~%" (-> obj parent-id))
|
||||
(format #t "~1Tx: ~D~%" (-> obj x))
|
||||
(format #t "~1Tz: ~D~%" (-> obj z))
|
||||
(format #t "~1Tfirst-conn: ~D~%" (-> obj first-conn))
|
||||
(format #t "~1Tcost-from-start: ~D~%" (-> obj cost-from-start))
|
||||
(format #t "~1Tcost-to-goal: ~D~%" (-> obj cost-to-goal))
|
||||
(format #t "~1Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~1Tconn-count: ~D~%" (-> obj conn-count))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-visgroup
|
||||
(deftype trail-visgroup (structure)
|
||||
((first-node uint16 :offset-assert 0)
|
||||
(node-count uint8 :offset-assert 2)
|
||||
(pad uint8 :offset-assert 3)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-visgroup
|
||||
(defmethod inspect trail-visgroup ((obj trail-visgroup))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'trail-visgroup)
|
||||
(format #t "~1Tfirst-node: ~D~%" (-> obj first-node))
|
||||
(format #t "~1Tnode-count: ~D~%" (-> obj node-count))
|
||||
(format #t "~1Tpad: ~D~%" (-> obj pad))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-conn
|
||||
(deftype trail-conn (structure)
|
||||
((head-id uint16 :offset-assert 0)
|
||||
(tail-id uint16 :offset-assert 2)
|
||||
(flags uint8 :offset-assert 4)
|
||||
(visgroup-id uint8 :offset-assert 5)
|
||||
(cost uint16 :offset-assert 6)
|
||||
)
|
||||
:method-count-assert 10
|
||||
:size-assert #x8
|
||||
:flag-assert #xa00000008
|
||||
(:methods
|
||||
(trail-conn-method-9 () none 9)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-conn
|
||||
(defmethod inspect trail-conn ((obj trail-conn))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'trail-conn)
|
||||
(format #t "~1Thead-id: ~D~%" (-> obj head-id))
|
||||
(format #t "~1Ttail-id: ~D~%" (-> obj tail-id))
|
||||
(format #t "~1Tflags: ~D~%" (-> obj flags))
|
||||
(format #t "~1Tvisgroup-id: ~D~%" (-> obj visgroup-id))
|
||||
(format #t "~1Tcost: ~D~%" (-> obj cost))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-conn-hash-cell
|
||||
(deftype trail-conn-hash-cell (structure)
|
||||
((first-conn uint16 :offset-assert 0)
|
||||
(conn-count uint8 :offset-assert 2)
|
||||
(pad uint8 :offset-assert 3)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x4
|
||||
:flag-assert #x900000004
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-conn-hash-cell
|
||||
(defmethod inspect trail-conn-hash-cell ((obj trail-conn-hash-cell))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'trail-conn-hash-cell)
|
||||
(format #t "~1Tfirst-conn: ~D~%" (-> obj first-conn))
|
||||
(format #t "~1Tconn-count: ~D~%" (-> obj conn-count))
|
||||
(format #t "~1Tpad: ~D~%" (-> obj pad))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-conn-search
|
||||
(deftype trail-conn-search (structure)
|
||||
((best-conn-id int32 :offset-assert 0)
|
||||
(best-dist float :offset-assert 4)
|
||||
(src-pos vector :offset-assert 8)
|
||||
(conn-pos vector :offset-assert 12)
|
||||
(debug-cells-searched int32 :offset-assert 16)
|
||||
(debug-conns-searched int32 :offset-assert 20)
|
||||
(bounds bounding-box4w :inline :offset-assert 32)
|
||||
(cell-quads qword 2 :inline :offset-assert 64)
|
||||
(conn-quads qword 7 :inline :offset-assert 96)
|
||||
(cell-bits vector16ub 2 :inline :offset 64)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #xd0
|
||||
:flag-assert #x9000000d0
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-conn-search
|
||||
(defmethod inspect trail-conn-search ((obj trail-conn-search))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'trail-conn-search)
|
||||
(format #t "~1Tbest-conn-id: ~D~%" (-> obj best-conn-id))
|
||||
(format #t "~1Tbest-dist: ~f~%" (-> obj best-dist))
|
||||
(format #t "~1Tsrc-pos: #<vector @ #x~X>~%" (-> obj src-pos))
|
||||
(format #t "~1Tconn-pos: #<vector @ #x~X>~%" (-> obj conn-pos))
|
||||
(format #t "~1Tdebug-cells-searched: ~D~%" (-> obj debug-cells-searched))
|
||||
(format #t "~1Tdebug-conns-searched: ~D~%" (-> obj debug-conns-searched))
|
||||
(format #t "~1Tbounds: #<bounding-box4w @ #x~X>~%" (-> obj bounds))
|
||||
(format #t "~1Tcell-quads[2] @ #x~X~%" (-> obj cell-quads))
|
||||
(format #t "~1Tconn-quads[7] @ #x~X~%" (-> obj conn-quads))
|
||||
(format #t "~1Tcell-bits[2] @ #x~X~%" (-> obj cell-quads))
|
||||
(format #t "~1Tconn-bits[2] @ #x~X~%" (-> obj conn-quads))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-conn-hash
|
||||
(deftype trail-conn-hash (basic)
|
||||
((cell-width meters :offset-assert 4)
|
||||
(origin vector :inline :offset-assert 16)
|
||||
(cell uint32 :offset-assert 32)
|
||||
(conn-ids uint32 :offset-assert 36)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x28
|
||||
:flag-assert #x900000028
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-conn-hash
|
||||
(defmethod inspect trail-conn-hash ((obj trail-conn-hash))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~1Tcell-width: (meters ~m)~%" (-> obj cell-width))
|
||||
(format #t "~1Torigin: #<vector @ #x~X>~%" (-> obj origin))
|
||||
(format #t "~1Tcell: #x~X~%" (-> obj cell))
|
||||
(format #t "~1Tconn-ids: #x~X~%" (-> obj conn-ids))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-cached-search-info
|
||||
(deftype trail-cached-search-info (structure)
|
||||
((goal-conn-id int16 :offset-assert 0)
|
||||
(orig-goal-pos vector :inline :offset-assert 16)
|
||||
(conn-goal-pos vector :inline :offset-assert 32)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x30
|
||||
:flag-assert #x900000030
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-cached-search-info
|
||||
(defmethod inspect trail-cached-search-info ((obj trail-cached-search-info))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'trail-cached-search-info)
|
||||
(format #t "~1Tgoal-conn-id: ~D~%" (-> obj goal-conn-id))
|
||||
(format #t "~1Torig-goal-pos: #<vector @ #x~X>~%" (-> obj orig-goal-pos))
|
||||
(format #t "~1Tconn-goal-pos: #<vector @ #x~X>~%" (-> obj conn-goal-pos))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition of type trail-graph
|
||||
(deftype trail-graph (basic)
|
||||
((mode uint8 :offset-assert 4)
|
||||
(search-id uint32 :offset-assert 8)
|
||||
(open-head-id int16 :offset-assert 12)
|
||||
(goal-conn-id int16 :offset-assert 14)
|
||||
(goal-node-id int16 :offset-assert 16)
|
||||
(node-count uint16 :offset-assert 18)
|
||||
(conn-count uint16 :offset-assert 20)
|
||||
(conn-mask uint8 :offset-assert 22)
|
||||
(node uint32 :offset-assert 24)
|
||||
(conn uint32 :offset-assert 28)
|
||||
(conn-ids uint32 :offset-assert 32)
|
||||
(visgroup uint32 :offset-assert 36)
|
||||
(visnode-ids uint32 :offset-assert 40)
|
||||
(conn-hash basic :offset-assert 44)
|
||||
(orig-start-pos vector :inline :offset-assert 48)
|
||||
(orig-goal-pos vector :inline :offset-assert 64)
|
||||
(conn-start-pos vector :inline :offset-assert 80)
|
||||
(conn-goal-pos vector :inline :offset-assert 96)
|
||||
(open-quads qword 6 :inline :offset-assert 112)
|
||||
(closed-quads qword 6 :inline :offset-assert 208)
|
||||
)
|
||||
:method-count-assert 29
|
||||
:size-assert #x130
|
||||
:flag-assert #x1d00000130
|
||||
(:methods
|
||||
(trail-graph-method-9 () none 9)
|
||||
(trail-graph-method-10 () none 10)
|
||||
(trail-graph-method-11 () none 11)
|
||||
(trail-graph-method-12 () none 12)
|
||||
(trail-graph-method-13 () none 13)
|
||||
(trail-graph-method-14 () none 14)
|
||||
(trail-graph-method-15 () none 15)
|
||||
(trail-graph-method-16 () none 16)
|
||||
(trail-graph-method-17 () none 17)
|
||||
(trail-graph-method-18 () none 18)
|
||||
(trail-graph-method-19 () none 19)
|
||||
(trail-graph-method-20 () none 20)
|
||||
(trail-graph-method-21 () none 21)
|
||||
(trail-graph-method-22 () none 22)
|
||||
(trail-graph-method-23 () none 23)
|
||||
(trail-graph-method-24 () none 24)
|
||||
(trail-graph-method-25 () none 25)
|
||||
(trail-graph-method-26 () none 26)
|
||||
(trail-graph-method-27 () none 27)
|
||||
(trail-graph-method-28 () none 28)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type trail-graph
|
||||
(defmethod inspect trail-graph ((obj trail-graph))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj (-> obj type))
|
||||
(format #t "~1Tmode: ~D~%" (-> obj mode))
|
||||
(format #t "~1Tsearch-id: ~D~%" (-> obj search-id))
|
||||
(format #t "~1Topen-head-id: ~D~%" (-> obj open-head-id))
|
||||
(format #t "~1Tgoal-conn-id: ~D~%" (-> obj goal-conn-id))
|
||||
(format #t "~1Tgoal-node-id: ~D~%" (-> obj goal-node-id))
|
||||
(format #t "~1Tnode-count: ~D~%" (-> obj node-count))
|
||||
(format #t "~1Tconn-count: ~D~%" (-> obj conn-count))
|
||||
(format #t "~1Tconn-mask: ~D~%" (-> obj conn-mask))
|
||||
(format #t "~1Tnode: #x~X~%" (-> obj node))
|
||||
(format #t "~1Tconn: #x~X~%" (-> obj conn))
|
||||
(format #t "~1Tconn-ids: #x~X~%" (-> obj conn-ids))
|
||||
(format #t "~1Tvisgroup: #x~X~%" (-> obj visgroup))
|
||||
(format #t "~1Tvisnode-ids: #x~X~%" (-> obj visnode-ids))
|
||||
(format #t "~1Tconn-hash: ~A~%" (-> obj conn-hash))
|
||||
(format #t "~1Torig-start-pos: #<vector @ #x~X>~%" (-> obj orig-start-pos))
|
||||
(format #t "~1Torig-goal-pos: #<vector @ #x~X>~%" (-> obj orig-goal-pos))
|
||||
(format #t "~1Tconn-start-pos: #<vector @ #x~X>~%" (-> obj conn-start-pos))
|
||||
(format #t "~1Tconn-goal-pos: #<vector @ #x~X>~%" (-> obj conn-goal-pos))
|
||||
(format #t "~1Topen-quads[6] @ #x~X~%" (-> obj open-quads))
|
||||
(format #t "~1Tclosed-quads[6] @ #x~X~%" (-> obj closed-quads))
|
||||
(format #t "~1Topen-bits[2] @ #x~X~%" (-> obj open-quads))
|
||||
(format #t "~1Tclosed-bits[2] @ #x~X~%" (-> obj closed-quads))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for symbol *trail-graph*, type trail-graph
|
||||
(define *trail-graph* (the-as trail-graph #f))
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -89,6 +89,8 @@
|
||||
"ja-play-spooled-anim",
|
||||
// sampler - asm function, has to be manually re-written
|
||||
"timer0-handler",
|
||||
// script
|
||||
"command-get-process",
|
||||
|
||||
// default menu
|
||||
// - weird array accessing pattern, we never fixed it in jak 1
|
||||
|
||||
Reference in New Issue
Block a user