Files
jak-project/test/decompiler/reference/jak2/engine/game/main-h_REF.gc
T
ManDude cd68cb671e deftype and defmethod syntax major changes (#3094)
Major change to how `deftype` shows up in our code:
- the decompiler will no longer emit the `offset-assert`,
`method-count-assert`, `size-assert` and `flag-assert` parameters. There
are extremely few cases where having this in the decompiled code is
helpful, as the types there come from `all-types` which already has
those parameters. This also doesn't break type consistency because:
  - the asserts aren't compared.
- the first step of the test uses `all-types`, which has the asserts,
which will throw an error if they're bad.
- the decompiler won't emit the `heap-base` parameter unless necessary
now.
- the decompiler will try its hardest to turn a fixed-offset field into
an `overlay-at` field. It falls back to the old offset if all else
fails.
- `overlay-at` now supports field "dereferencing" to specify the offset
that's within a field that's a structure, e.g.:
```lisp
(deftype foobar (structure)
  ((vec    vector  :inline)
   (flags  int32   :overlay-at (-> vec w))
   )
  )
```
in this structure, the offset of `flags` will be 12 because that is the
final offset of `vec`'s `w` field within this structure.
- **removed ID from all method declarations.** IDs are only ever
automatically assigned now. Fixes #3068.
- added an `:overlay` parameter to method declarations, in order to
declare a new method that goes on top of a previously-defined method.
Syntax is `:overlay <method-name>`. Please do not ever use this.
- added `state-methods` list parameter. This lets you quickly specify a
list of states to be put in the method table. Same syntax as the
`states` list parameter. The decompiler will try to put as many states
in this as it can without messing with the method ID order.

Also changes `defmethod` to make the first type definition (before the
arguments) optional. The type can now be inferred from the first
argument. Fixes #3093.

---------

Co-authored-by: Hat Kid <6624576+Hat-Kid@users.noreply.github.com>
2023-10-30 03:20:02 +00:00

463 lines
14 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *stats-poly*, type symbol
(define *stats-poly* #f)
;; definition for symbol *stats-memory*, type symbol
(define *stats-memory* #f)
;; definition for symbol *stats-memory-short*, type symbol
(define *stats-memory-short* #f)
;; definition for symbol *stats-memory-level-index*, type int
(define *stats-memory-level-index* 0)
;; definition for symbol *stats-collide*, type symbol
(define *stats-collide* #f)
;; definition for symbol *stats-bsp*, type symbol
(define *stats-bsp* #f)
;; definition for symbol *stats-buffer*, type symbol
(define *stats-buffer* #f)
;; definition for symbol *stats-target*, type symbol
(define *stats-target* #f)
;; definition for symbol *stats-profile-bars*, type symbol
(define *stats-profile-bars* #f)
;; definition for symbol *stats-perf*, type symbol
(define *stats-perf* #f)
;; definition for symbol *artist-all-visible*, type symbol
(define *artist-all-visible* #f)
;; definition for symbol *artist-flip-visible*, type symbol
(define *artist-flip-visible* #f)
;; definition for symbol *artist-fix-visible*, type symbol
(define *artist-fix-visible* #f)
;; definition for symbol *artist-fix-frustum*, type symbol
(define *artist-fix-frustum* #f)
;; definition for symbol *artist-error-spheres*, type symbol
(define *artist-error-spheres* #f)
;; definition for symbol *artist-use-menu-subdiv*, type symbol
(define *artist-use-menu-subdiv* #f)
;; definition for symbol *display-profile*, type symbol
(define *display-profile* #t)
;; definition for symbol *display-sidekick-stats*, type symbol
(define *display-sidekick-stats* #f)
;; definition for symbol *display-quad-stats*, type symbol
(define *display-quad-stats* #f)
;; definition for symbol *display-tri-stats*, type symbol
(define *display-tri-stats* #f)
;; definition for symbol *display-ground-stats*, type symbol
(define *display-ground-stats* #f)
;; definition for symbol *display-collision-marks*, type symbol
(define *display-collision-marks* #f)
;; definition for symbol *display-collide-cache*, type symbol
(define *display-collide-cache* #f)
;; definition for symbol *display-render-collision*, type symbol
(define *display-render-collision* #f)
;; definition for symbol *display-hipri-collision-marks*, type symbol
(define *display-hipri-collision-marks* #f)
;; definition for symbol *display-edge-collision-marks*, type symbol
(define *display-edge-collision-marks* #f)
;; definition for symbol *display-geo-marks*, type symbol
(define *display-geo-marks* #f)
;; definition for symbol *display-target-marks*, type symbol
(define *display-target-marks* #f)
;; definition for symbol *target-rc-board-controls*, type symbol
(define *target-rc-board-controls* #f)
;; definition for symbol *display-collide-history*, type int
(define *display-collide-history* 0)
;; definition for symbol *display-xyz-axes*, type symbol
(define *display-xyz-axes* #f)
;; definition for symbol *display-cam-collide-history*, type symbol
(define *display-cam-collide-history* #f)
;; definition for symbol *record-cam-collide-history*, type symbol
(define *record-cam-collide-history* #f)
;; definition for symbol *display-cam-master-marks*, type symbol
(define *display-cam-master-marks* #f)
;; definition for symbol *display-cam-other*, type symbol
(define *display-cam-other* #f)
;; definition for symbol *display-camera-marks*, type symbol
(define *display-camera-marks* #f)
;; definition for symbol *camera-no-mip-correction*, type symbol
(define *camera-no-mip-correction* #f)
;; definition for symbol *display-cam-los-info*, type symbol
(define *display-cam-los-info* #f)
;; definition for symbol *display-cam-los-debug*, type symbol
(define *display-cam-los-debug* #f)
;; definition for symbol *display-cam-los-marks*, type symbol
(define *display-cam-los-marks* #f)
;; definition for symbol *display-cam-coll-marks*, type symbol
(define *display-cam-coll-marks* #f)
;; definition for symbol *display-camera-info*, type symbol
(define *display-camera-info* #f)
;; definition for symbol *display-camera-old-stats*, type symbol
(define *display-camera-old-stats* #f)
;; definition for symbol *display-camera-last-attacker*, type symbol
(define *display-camera-last-attacker* #f)
;; definition for symbol *display-file-info*, type symbol
(define *display-file-info* #f)
;; definition for symbol *display-actor-marks*, type symbol
(define *display-actor-marks* #f)
;; definition for symbol *display-sprite-info*, type symbol
(define *display-sprite-info* #f)
;; definition for symbol *display-sprite-marks*, type symbol
(define *display-sprite-marks* #f)
;; definition for symbol *display-sprite-spheres*, type symbol
(define *display-sprite-spheres* #f)
;; definition for symbol *display-entity-errors*, type symbol
(define *display-entity-errors* #t)
;; definition for symbol *display-instance-info*, type symbol
(define *display-instance-info* #f)
;; definition for symbol *display-deci-count*, type symbol
(define *display-deci-count* #f)
;; definition for symbol *sync-dma*, type symbol
(define *sync-dma* #f)
;; definition for symbol *display-strip-lines*, type strip-lines-controls
(define *display-strip-lines* (the-as strip-lines-controls 0))
;; definition for symbol *display-battle-marks*, type symbol
(define *display-battle-marks* #f)
;; definition for symbol *display-joint-axes*, type symbol
(define *display-joint-axes* #f)
;; definition for symbol *display-nav-marks*, type symbol
(define *display-nav-marks* #f)
;; definition for symbol *display-nav-network*, type symbol
(define *display-nav-network* #f)
;; definition for symbol *display-path-marks*, type symbol
(define *display-path-marks* #f)
;; definition for symbol *display-vol-marks*, type symbol
(define *display-vol-marks* #f)
;; definition for symbol *display-water-marks*, type symbol
(define *display-water-marks* #f)
;; definition for symbol *display-nav-mesh*, type symbol
(define *display-nav-mesh* #f)
;; definition for symbol *display-actor-pointer*, type symbol
(define *display-actor-pointer* #f)
;; definition for symbol *display-actor-vis*, type symbol
(define *display-actor-vis* #f)
;; definition for symbol *display-actor-graph*, type symbol
(define *display-actor-graph* #f)
;; definition for symbol *display-traffic-height-map*, type symbol
(define *display-traffic-height-map* #f)
;; definition for symbol *display-trail-graph*, type symbol
(define *display-trail-graph* #f)
;; definition for symbol *display-color-bars*, type symbol
(define *display-color-bars* #f)
;; definition for symbol *display-bug-report*, type symbol
(define *display-bug-report* #f)
;; definition for symbol *display-level-border*, type symbol
(define *display-level-border* #f)
;; definition for symbol *display-memcard-info*, type symbol
(define *display-memcard-info* #f)
;; definition for symbol *display-split-boxes*, type symbol
(define *display-split-boxes* #f)
;; definition for symbol *display-split-box-info*, type symbol
(define *display-split-box-info* #f)
;; definition for symbol *display-texture-distances*, type symbol
(define *display-texture-distances* #f)
;; definition for symbol *display-texture-download*, type symbol
(define *display-texture-download* #f)
;; definition for symbol *display-art-control*, type symbol
(define *display-art-control* #f)
;; definition for symbol *display-gui-control*, type symbol
(define *display-gui-control* #f)
;; definition for symbol *display-level-spheres*, type symbol
(define *display-level-spheres* #f)
;; definition for symbol *time-of-day-fast*, type symbol
(define *time-of-day-fast* #f)
;; definition for symbol *display-iop-info*, type symbol
(define *display-iop-info* #f)
;; definition for symbol *ambient-sound-class*, type symbol
(define *ambient-sound-class* #t)
;; definition for symbol *slow-frame-rate*, type symbol
(define *slow-frame-rate* #f)
;; definition for symbol *display-region-marks*, type symbol
(define *display-region-marks* #f)
;; definition for symbol *execute-regions*, type symbol
(define *execute-regions* #t)
;; definition for symbol *debug-pause*, type symbol
(define *debug-pause* #f)
;; definition for symbol *debug-view-anims*, type symbol
(define *debug-view-anims* #f)
;; definition for symbol *debug-unkillable*, type symbol
(define *debug-unkillable* #f)
;; definition for symbol *debug-actor*, type object
(define *debug-actor* (the-as object #f))
;; definition for symbol *gun-marks*, type symbol
(define *gun-marks* #f)
;; definition for symbol *bug-report-output-mode*, type symbol
(define *bug-report-output-mode* (if *debug-segment*
'file-stream
'*stdcon*
)
)
;; definition for symbol *display-scene-control*, type scene-controls
(define *display-scene-control* (the-as scene-controls 0))
;; definition for symbol *display-bot-marks*, type bot-marks-controls
(define *display-bot-marks* (the-as bot-marks-controls 0))
;; definition for symbol *display-race-marks*, type race-marks-controls
(define *display-race-marks* (the-as race-marks-controls 0))
;; definition for symbol *race-record-path*, type symbol
(define *race-record-path* #f)
;; definition for symbol *select-race*, type race-selection
(define *select-race* (the-as race-selection 0))
;; definition for symbol *select-race-path*, type int
(define *select-race-path* 0)
;; definition for symbol *bot-record-path*, type int
(define *bot-record-path* -1)
;; definition for symbol *subdivide-draw-mode*, type subdivide-setting
(define *subdivide-draw-mode* (the-as subdivide-setting 0))
;; definition for symbol *subdivide-scissor-draw-mode*, type subdivide-setting
(define *subdivide-scissor-draw-mode* (the-as subdivide-setting 0))
;; definition for symbol *subdivide-foreground-draw-mode*, type subdivide-setting
(define *subdivide-foreground-draw-mode* (the-as subdivide-setting 0))
;; definition for symbol *subdivide-ocean-draw-mode*, type subdivide-setting
(define *subdivide-ocean-draw-mode* (the-as subdivide-setting 0))
;; definition for symbol *ocean-height-hack*, type ocean-height-hack
(define *ocean-height-hack* (the-as ocean-height-hack 0))
;; definition (perm) for symbol *dproc*, type process
(define-perm *dproc* process #f)
;; definition for symbol *run*, type symbol
(define *run* #f)
;; definition for symbol *teleport*, type symbol
(define *teleport* #f)
;; definition for symbol *teleport-count*, type int
(define *teleport-count* 0)
;; definition for symbol *draw-hook*, type (function none)
(define *draw-hook* nothing)
;; definition for symbol *debug-hook*, type pair
(define *debug-hook* '())
;; definition for symbol *menu-hook*, type (function debug-menu-context)
(define *menu-hook* (the-as (function debug-menu-context) nothing))
;; definition for symbol *progress-hook*, type (function none)
(define *progress-hook* nothing)
;; definition for symbol *dma-timeout-hook*, type (function none)
(define *dma-timeout-hook* nothing)
;; definition of type frame-stats
(deftype frame-stats (structure)
((field-time time-frame 2)
(field int32)
)
)
;; definition for method 3 of type frame-stats
(defmethod inspect ((this frame-stats))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'frame-stats)
(format #t "~1Tfield-time[2] @ #x~X~%" (-> this field-time))
(format #t "~1Tfield: ~D~%" (-> this field))
(label cfg-4)
this
)
;; definition for symbol *frame-stats*, type frame-stats
(define *frame-stats* (new 'static 'frame-stats))
;; definition of type screen-filter
(deftype screen-filter (basic)
((draw? symbol)
(bucket bucket-id)
(color vector :inline)
(color-src vector :inline)
(color-dest vector :inline)
(extra vector :inline)
(speed float :overlay-at (-> extra data 0))
(current-interp float :overlay-at (-> extra data 1))
)
(:methods
(draw (_type_) none)
(setup (_type_ vector vector float bucket-id) none)
(disable (_type_) none)
)
)
;; definition for method 3 of type screen-filter
(defmethod inspect ((this screen-filter))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~1Tdraw?: ~A~%" (-> this draw?))
(format #t "~1Tbucket: ~D~%" (-> this bucket))
(format #t "~1Tcolor: #<vector @ #x~X>~%" (-> this color))
(format #t "~1Tcolor-src: #<vector @ #x~X>~%" (-> this color-src))
(format #t "~1Tcolor-dest: #<vector @ #x~X>~%" (-> this color-dest))
(format #t "~1Textra: #<vector @ #x~X>~%" (-> this extra))
(format #t "~1Tspeed: ~f~%" (-> this extra x))
(format #t "~1Tcurrent-interp: ~f~%" (-> this extra y))
(label cfg-4)
this
)
;; definition of type col-rend
(deftype col-rend (basic)
((draw? symbol)
(outline? symbol)
(show-back-faces? symbol)
(show-normals? symbol)
(ghost-hidden? symbol)
(show-only uint32)
(cspec collide-spec)
(track uint8)
(bbox-radius float)
(bbox-center vector :inline)
(camera-to-bbox-dist float)
)
(:methods
(col-rend-method-9 (_type_) none)
)
)
;; definition for method 3 of type col-rend
(defmethod inspect ((this col-rend))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~1Tdraw?: ~A~%" (-> this draw?))
(format #t "~1Toutline?: ~A~%" (-> this outline?))
(format #t "~1Tshow-back-faces?: ~A~%" (-> this show-back-faces?))
(format #t "~1Tshow-normals?: ~A~%" (-> this show-normals?))
(format #t "~1Tghost-hidden?: ~A~%" (-> this ghost-hidden?))
(format #t "~1Tshow-only: ~D~%" (-> this show-only))
(format #t "~1Tcspec: ~D~%" (-> this cspec))
(format #t "~1Ttrack: ~D~%" (-> this track))
(format #t "~1Tbbox-radius: ~f~%" (-> this bbox-radius))
(format #t "~1Tbbox-center: #<vector @ #x~X>~%" (-> this bbox-center))
(format #t "~1Tcamera-to-bbox-dist: ~f~%" (-> this camera-to-bbox-dist))
(label cfg-4)
this
)
;; definition for symbol *col-rend*, type col-rend
(define *col-rend* (new 'static 'col-rend
:draw? #f
:outline? #t
:show-back-faces? #t
:show-normals? #f
:ghost-hidden? #t
:cspec (collide-spec crate civilian enemy)
:track #x1
:bbox-radius 24576.0
:camera-to-bbox-dist 65536.0
)
)
;; definition (debug) for function debug-actor?
(defun-debug debug-actor? ((arg0 object))
(= arg0 *debug-actor*)
)
;; failed to figure out what this is:
0