[decomp] most of level and some game loop functions + couple decomp… (#651)

* [decomp] most of `level` and some game loop functions + couple decompiler fixes

* add ART.CGO to fake-iso
This commit is contained in:
ManDude 2021-06-30 01:30:52 +01:00 committed by GitHub
parent 9433724bbd
commit 1af0f4a1a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
85 changed files with 3037 additions and 1072 deletions

View file

@ -161,7 +161,7 @@ void TypeSystem::forward_declare_type_as(const std::string& new_type,
auto old_parent_it = m_types.find(fwd_it->second);
auto new_parent_it = m_types.find(parent_type);
auto old_ts = TypeSpec(old_parent_it->second->get_name());
auto old_ts = TypeSpec(fwd_it->second);
if (old_parent_it != m_types.end() && new_parent_it != m_types.end()) {
auto new_ts = TypeSpec(new_parent_it->second->get_name());

View file

@ -13,7 +13,7 @@ namespace Reg {
// clang-format off
const bool allowed_local_gprs[Reg::MAX_GPR] = {
false /*R0*/, false /*AT*/, true /*V0*/, true /*V1*/,
false /*R0*/, true /*AT*/, true /*V0*/, true /*V1*/,
true /*A0*/, true /*A1*/, true /*A2*/, true /*A3*/,
true /*T0*/, true /*T1*/, true /*T2*/, true /*T3*/,
true /*T4*/, true /*T5*/, true /*T6*/, true /*T7*/,
@ -273,4 +273,4 @@ bool Register::allowed_local_gpr() const {
}
return Reg::allowed_local_gprs[get_gpr()];
}
} // namespace decompiler
} // namespace decompiler

View file

@ -126,7 +126,7 @@ bool run_type_analysis_ir2(const TypeSpec& my_type, DecompilerTypeSystem& dts, F
} catch (std::runtime_error& e) {
lg::warn("Function {} failed type prop at op {}: {}", func.guessed_name.to_string(),
op_id, e.what());
func.warnings.type_prop_warning("Failed type prop at op {} ({})\n:{}", op_id,
func.warnings.type_prop_warning("Failed type prop at op {} ({}): {}", op_id,
op->to_string(func.ir2.env), e.what());
func.ir2.env.set_types(block_init_types, op_types, *func.ir2.atomic_ops, my_type);
return false;

File diff suppressed because it is too large Load diff

View file

@ -14,5 +14,9 @@
"main":[
[4, "(function none)"]
],
"process-drawable":[
[29, "(function string symbol)"]
]
}

View file

@ -410,7 +410,7 @@
// ropebridge BUG
"(method 27 ropebridge)",
// all unchecked.and in level DGO code
// all unchecked and in level DGO code
"(anon-function 11 robotboss)",
"(anon-function 18 robotboss)",
"(anon-function 49 robotboss)",
@ -466,6 +466,9 @@
"nassoce",
"lookup-level-info",
"(method 21 level-group)",
"(method 12 level)",
"update-sound-banks",
"(method 16 level-group)",
"bg"
]
}

View file

@ -78,8 +78,6 @@
"display-h": [["L6", "rgba", true]],
"level-h": [["L3", "level-group", true]],
"level-h": [
["L3", "level-group", true],
["L3", "_auto_", true]
@ -595,5 +593,33 @@
"geometry": [
["L125", "float", true]
]
],
"level": [
["L452", "_auto_", true],
["L482", "float", true],
["L483", "uint64", true],
["L484", "uint64", true],
["L485", "uint64", true]
],
"process-drawable": [
["L257", "float", true],
["L262", "float", true],
["L260", "float", true],
["L259", "float", true]
],
"logic-target": [
["L264", "float", true],
["L253", "float", true],
["L255", "float", true]
],
"load-boundary": [
["L327", "(inline-array lbvtx)", true, 3]
],
// please do not add things after this entry! git is dumb.
"object-file-that-doesnt-actually-exist-and-i-just-put-this-here-to-prevent-merge-conflicts-with-this-file":[]
}

View file

@ -385,7 +385,12 @@
"draw-ocean-transition": [
[16, "sphere"]
]
],
"(method 22 level)": [[16, "event-message-block"]],
"(method 9 level)": [[16, "event-message-block"]],
"(method 10 load-state)": [[16, "event-message-block"]],
"draw-joint-spheres": [[16, "vector"]],
"(method 16 process-drawable)": [[16, "matrix"], [80, "matrix"], [144, "vector"], [160, "vector"]]
}

View file

@ -219,9 +219,7 @@
// LEVEL
"lookup-level-info": [
[3, "a1", "symbol"],
[4, "a1", "level-load-info"],
[8, "a1", "level-load-info"],
[12, "a1", "level-load-info"]
[[4, 16], "a1", "level-load-info"]
],
// DISPLAY
@ -702,9 +700,13 @@
"bg": [
[37, "a0", "symbol"]
],
"start": [
[27, "t9", "(function process function symbol object)"]
],
"level-update-after-load": [
[[29, 55], "s2", "drawable-tree-tfrag"],
[[29, 55], "s2", "drawable-tree"],
[[121, 146], "s1", "drawable-inline-array-tfrag"],
[[150, 151], "s1", "drawable-tree-instance-tie"]
],
@ -769,5 +771,42 @@
[[330, 333], "v1", "symbol"],
[[334, 337], "a0", "int"],
[[341, 344], "a0", "uint"]
]
],
"(method 12 level)": [
[151, "a0", "symbol"]
],
"(method 26 level-group)": [[[65, 96], "v0", "level"]],
"update-sound-banks": [[[21, 52], "t0", "symbol"]],
"(method 16 level-group)": [
[[122, 146], "s1", "continue-point"],
[[115, 154], "s3", "continue-point"]
],
"(method 20 level)": [
[[43, 45], "s3", "ramdisk-rpc-fill"]
],
//"bg": [[[25, 52], "a0", "string"]],
"(anon-function 29 process-drawable)": [[[0, 99999], "s6", "process-drawable"]],
"ja-done?": [[[0, 99999], "s6", "process-drawable"]],
"ja-min?": [[[0, 99999], "s6", "process-drawable"]],
"ja-max?": [[[0, 99999], "s6", "process-drawable"]],
"ja-num-frames": [[[0, 99999], "s6", "process-drawable"]],
"ja-frame-num": [[[0, 99999], "s6", "process-drawable"]],
"ja-aframe-num": [[[0, 99999], "s6", "process-drawable"]],
"ja-aframe": [[[0, 99999], "s6", "process-drawable"]],
"ja-step": [[[0, 99999], "s6", "process-drawable"]],
"ja-channel-set!": [[[0, 99999], "s6", "process-drawable"]],
"ja-channel-push!": [[[0, 99999], "s6", "process-drawable"]],
"ja-group-size": [[[0, 99999], "s6", "process-drawable"]],
"ja-eval": [[[0, 99999], "s6", "process-drawable"]],
"ja-blend-eval": [[[0, 99999], "s6", "process-drawable"]],
"ja-post": [[[0, 99999], "s6", "process-drawable"], [54, "a1", "process"]],
"transform-post": [[[0, 99999], "s6", "process-drawable"]],
"rider-trans": [[[0, 99999], "s6", "process-drawable"]],
"rider-post": [[[0, 99999], "s6", "process-drawable"]],
"pusher-post": [[[0, 99999], "s6", "process-drawable"]],
"process-drawable-delay-player": [[[0, 99999], "s6", "process-drawable"]],
"init-target": [[[0, 99999], "s6", "target"]]
}

View file

@ -2092,7 +2092,7 @@
"v1-4":"current-timer",
"v1-5":"elapsed-timer",
"s2-0":"current-login-pos",
"s2-1":"current-drawable",
"s2-1":["current-drawable", "drawable-tree"],
"s1-0":"idx-in-drawable"
}
},
@ -2101,5 +2101,29 @@
"vars": {
"s3-0": ["conn", "connection"]
}
},
"(method 12 level)": {
"vars": {
"s5-3": ["s5-3", "pair"]
}
},
"update-sound-banks": {
"vars": {
"t0-0": ["t0-0", "symbol"]
}
},
"(method 16 level-group)": {
"vars": {
"s1-0": ["s1-0", "continue-point"]
}
},
"(method 20 level)": {
"vars": {
"s3-0": ["s3-0", "ramdisk-rpc-fill"]
}
}
}

View file

@ -409,6 +409,11 @@ int DecompilerTypeSystem::get_format_arg_count(const std::string& str) const {
if (i + 1 < str.length() && (str.at(i) == '1') && str.at(i + 1) == 'K') {
continue;
}
// ~2j
if (i + 1 < str.length() && (str.at(i) == '2') && str.at(i + 1) == 'j') {
continue;
}
arg_count++;
}
}

View file

@ -5,6 +5,7 @@
KERNEL.CGO out/iso/KERNEL.CGO
GAME.CGO out/iso/GAME.CGO
TEST.CGO resources/TEST.CGO
ART.CGO out/iso/ART.CGO
TWEAKVAL.MUS resources/TWEAKVAL.MUS
VAGDIR.AYB resources/VAGDIR.AYB
SCREEN1.USA resources/SCREEN1.USA

View file

@ -31,7 +31,7 @@
(deftype joint-control (basic)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel joint-control-channel :offset 16)
(root-channel (inline-array joint-control-channel) :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
@ -54,7 +54,7 @@
:flag-assert #xb000000c0
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-9 (_type_) none 9)
(dummy-10 (_type_ symbol) int 10)
)
)

View file

@ -93,8 +93,8 @@
(fov-correction-factor float :offset-assert 1056)
)
(:methods
(new (symbol type) _type_ 0)
)
(new (symbol type) _type_ 0)
)
:method-count-assert 9
:size-assert #x424
:flag-assert #x900000424

View file

@ -302,36 +302,37 @@
:size-assert #xb8
:flag-assert #x38000000b8
(:methods
(new (symbol type process collide-list-enum) _type_)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-34 () none 34)
(dummy-35 () none 35)
(dummy-36 () none 36)
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 () none 40)
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
(dummy-44 () none 44)
(dummy-45 () none 45)
(dummy-46 () none 46)
(dummy-47 () none 47)
(dummy-48 () none 48)
(dummy-49 () none 49)
(dummy-50 () none 50)
(dummy-51 () none 51)
(dummy-52 () none 52)
(dummy-53 () none 53)
(dummy-54 () none 54)
(dummy-55 () none 55)
)
(new (symbol type process collide-list-enum) _type_)
(dummy-26 () none 26)
(dummy-28 () none 28)
(dummy-29 () none 29)
(dummy-30 () none 30)
(dummy-31 () none 31)
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-34 () none 34)
(dummy-35 (_type_) none 35)
(dummy-36 () none 36)
(dummy-37 () none 37)
(dummy-38 () none 38)
(dummy-39 () none 39)
(dummy-40 () none 40)
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
(dummy-44 (_type_) none 44)
(dummy-45 (_type_) none 45)
(dummy-46 () none 46)
(dummy-47 (_type_) none 47)
(dummy-48 (_type_) none 48)
(dummy-49 () none 49)
(dummy-50 () none 50)
(dummy-51 () none 51)
(dummy-52 () none 52)
(dummy-53 () none 53)
(dummy-54 () none 54)
(dummy-55 () none 55)
)
)
;; More complicated collide-shape?

View file

@ -32,13 +32,19 @@
(deftype control-info (collide-shape-moving)
(
(unknown-vector00 vector :inline :offset 576)
(unknown-surface surface :offset 660)
(unknown-symbol symbol :offset 664)
(unknown-qword uint128 :offset 1136)
(unknown-vector10 vector :inline :offset 1216)
(unknown-vector11 vector :inline :offset 1232)
(unknown-vector12 vector :inline :offset 1248)
(unknown-vector13 vector :inline :offset 1264)
;; these were determined from racer-collision-reaction.
(array-size int16 :offset 2490)
(history-array collide-history 128 :inline :offset-assert 2496)
;; what's on the end?
(history-length int16 :offset 2490)
(history-data collide-history 128 :inline :offset-assert 2496)
(pad uint32 27)
)
:size-assert #x4a2c
:method-count-assert 65
:flag-assert #x4100004a2c

View file

@ -119,7 +119,6 @@
)
(declare-type art-element basic)
(declare-type entity basic)
(deftype art (basic)
((name string :offset 8)
(length int32 :offset-assert 12)
@ -180,8 +179,8 @@
:size-assert #x20
:flag-assert #xf00000020
(:methods
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-13 (_type_) int 13)
(dummy-14 (_type_) int 14)
)
)
@ -242,7 +241,7 @@
:size-assert #x21
:flag-assert #xa00000021
(:methods
(dummy-9 () none 9)
(dummy-9 (_type_) _type_ 9)
)
)
@ -250,54 +249,55 @@
(declare-type shadow-geo basic)
(declare-type shadow-control basic)
(deftype draw-control (basic)
((status uint8 :offset-assert 4)
(matrix-type uint8 :offset-assert 5)
(data-format uint8 :offset-assert 6)
(global-effect uint8 :offset-assert 7)
(art-group art-group :offset-assert 8)
(jgeo art-joint-geo :offset-assert 12)
(mgeo merc-ctrl :offset-assert 16)
(dma-add-func function :offset-assert 20)
(skeleton skeleton-group :offset-assert 24)
(lod-set lod-set :inline :offset-assert 28)
(lod lod-group 4 :inline :offset 28)
(max-lod int8 :offset 60)
(force-lod int8 :offset-assert 61)
(cur-lod int8 :offset-assert 62)
(desired-lod int8 :offset-assert 63)
(ripple ripple-control :offset-assert 64)
(longest-edge float :offset-assert 68) ;; meters
(longest-edge? uint32 :offset 68)
(light-index uint8 :offset-assert 72)
(dummy uint8 2 :offset-assert 73)
(death-draw-overlap uint8 :offset-assert 75)
(death-timer uint8 :offset-assert 76)
(death-timer-org uint8 :offset-assert 77)
(death-vertex-skip uint16 :offset-assert 78)
(death-effect uint32 :offset-assert 80)
(sink-group dma-foreground-sink-group :offset-assert 84)
(process process :offset-assert 88)
(shadow shadow-geo :offset-assert 92)
(shadow-ctrl shadow-control :offset-assert 96)
(origin vector :inline :offset-assert 112)
(bounds vector :inline :offset-assert 128)
(radius float :offset 140) ;; meters
(color-mult rgbaf :inline :offset-assert 144)
(color-emissive rgbaf :inline :offset-assert 160)
(secondary-interp float :offset-assert 176)
(current-secondary-interp float :offset-assert 180)
(shadow-mask uint8 :offset-assert 184)
(level-index uint8 :offset-assert 185)
(origin-joint-index uint8 :offset-assert 186)
(shadow-joint-index uint8 :offset-assert 187)
((status uint8 :offset-assert 4)
(matrix-type uint8 :offset-assert 5)
(data-format uint8 :offset-assert 6)
(global-effect uint8 :offset-assert 7)
(art-group art-group :offset-assert 8)
(jgeo art-joint-geo :offset-assert 12)
(mgeo merc-ctrl :offset-assert 16)
(dma-add-func function :offset-assert 20)
(skeleton skeleton-group :offset-assert 24) ;; or cspace-array or shadow-control
(lod-set lod-set :inline :offset-assert 28)
(lod lod-group 4 :inline :offset 28)
(max-lod int8 :offset 60)
(force-lod int8 :offset-assert 61)
(cur-lod int8 :offset-assert 62)
(desired-lod int8 :offset-assert 63)
(ripple ripple-control :offset-assert 64)
(longest-edge float :offset-assert 68) ;; meters
(longest-edge? uint32 :offset 68)
(light-index uint8 :offset-assert 72)
(dummy uint8 2 :offset-assert 73)
(death-draw-overlap uint8 :offset-assert 75)
(death-timer uint8 :offset-assert 76)
(death-timer-org uint8 :offset-assert 77)
(death-vertex-skip uint16 :offset-assert 78)
(death-effect uint32 :offset-assert 80)
(sink-group dma-foreground-sink-group :offset-assert 84) ;; dma-foreground-sink-group?
(process process :offset-assert 88)
(shadow shadow-geo :offset-assert 92)
(shadow-ctrl shadow-control :offset-assert 96)
(origin vector :inline :offset-assert 112)
(bounds vector :inline :offset-assert 128)
(radius float :offset 140) ;; meters
(color-mult rgbaf :inline :offset-assert 144)
(color-emissive rgbaf :inline :offset-assert 160)
(secondary-interp float :offset-assert 176)
(current-secondary-interp float :offset-assert 180)
(shadow-mask uint8 :offset-assert 184)
(level-index uint8 :offset-assert 185)
(origin-joint-index uint8 :offset-assert 186)
(shadow-joint-index uint8 :offset-assert 187)
)
:method-count-assert 12
:size-assert #xbc
:flag-assert #xc000000bc
(:methods
(new (symbol type process art-joint-geo) _type_ 0)
(dummy-9 (_type_) (pointer int8) 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-10 (_type_ int int) int 10)
(dummy-11 (_type_ pointer) int 11)
)
)

View file

@ -31,7 +31,7 @@
(data-base pointer :offset-assert 12)
(data-top pointer :offset-assert 16)
(data-size int32 :offset-assert 20)
(extra basic :offset-assert 24)
(extra entity-links :offset-assert 24)
(tag (pointer res-tag) :offset-assert 28)
)

View file

@ -15,21 +15,19 @@
:size-assert #x8
:flag-assert #xb00000008
(:methods
(set-private-assert-info (_type_ string uint16 uint16) int 9)
(print-private-assert-info (_type_) int 10)
(set-pos (_type_ string uint uint) int 9)
(print-pos (_type_) int 10)
)
)
(defmethod set-private-assert-info __assert-info-private-struct ((obj __assert-info-private-struct)
(filename string) (line-num uint16) (column-num uint16))
(defmethod set-pos __assert-info-private-struct ((obj __assert-info-private-struct) (filename string) (line-num uint) (column-num uint))
(set! (-> obj filename) filename)
(set! (-> obj line-num) line-num)
(set! (-> obj column-num) column-num)
0
)
(defmethod print-private-assert-info __assert-info-private-struct ((obj __assert-info-private-struct))
(defmethod print-pos __assert-info-private-struct ((obj __assert-info-private-struct))
(format #t "file ~S.gc, line ~D, col ~D.~%" (-> obj filename) (-> obj line-num) (-> obj column-num))
0
)

View file

@ -6,46 +6,53 @@
;; dgos: GAME, ENGINE
(define *run-time-assert-enable* #t) ;; where is this used?
(define *run-time-assert-enable* #t)
(defun __assert ((exp symbol) (msg string))
"Assert that exp is truthy, print assert information otherwise"
(when (not exp)
;; TODO macros
(defun __assert ((expr symbol) (msg string))
"Assert that expr is truthy, print assert information otherwise"
(when (not expr)
(format #t "(ASSERT ~S) FAILED in "
msg)
(print-private-assert-info *__private-assert-info*)
(print-pos *__private-assert-info*)
)
0
)
(defun __assert-min-max-range-float
((exp float) (minimum float) (maximum float) (msg-exp string) (msg-min string) (msg-max string))
"Assert that float exp is a larger value than minimum and smaller than maximum, print assert information otherwise"
(when (or (< exp minimum) (< maximum exp))
(defun __assert-min-max-range-float ((expr float) (minimum float) (maximum float) (msg-expr string) (msg-min string) (msg-max string))
"Assert that float expr is a larger value than minimum and smaller than maximum, print assert information otherwise"
(when (or (< expr minimum) (< maximum expr))
(format #t "(ASSERT_MIN_MAX_RANGE_FLOAT ~S ~S ~S) FAILED (values ~F ~F ~F) in "
msg-exp msg-min msg-max exp minimum maximum)
(print-private-assert-info *__private-assert-info*)
msg-expr msg-min msg-max
expr minimum maximum)
(print-pos *__private-assert-info*)
)
0
)
(defun __assert-min-max-range-int
((exp int) (minimum int) (maximum int) (msg-exp string) (msg-min string) (msg-max string))
"Assert that integer exp is a larger value than minimum and smaller than maximum, print assert information otherwise"
(when (or (< exp minimum) (< maximum exp))
(defun __assert-min-max-range-int ((expr int) (minimum int) (maximum int) (msg-expr string) (msg-min string) (msg-max string))
"Assert that integer expr is a larger value than minimum and smaller than maximum, print assert information otherwise"
(when (or (< expr minimum) (< maximum expr))
(format #t "(ASSERT_MIN_MAX_RANGE_INT ~S ~S ~S) FAILED (values ~D ~D ~D) in "
msg-exp msg-min msg-max exp minimum maximum)
(print-private-assert-info *__private-assert-info*)
msg-expr msg-min msg-max
expr minimum maximum)
(print-pos *__private-assert-info*)
)
0
)
(defun __assert-zero-lim-range-int ((exp int) (maximum int) (msg-exp string) (msg-max string))
"Assert that integer exp is a larger value than zero and smaller than maximum, print assert information otherwise"
(when (or (< exp 0) (>= exp max))
(defun __assert-zero-lim-range-int ((expr int) (maximum int) (msg-expr string) (msg-max string))
"Assert that integer expr is a larger value than zero and smaller than maximum, print assert information otherwise"
(when (or (< expr 0) (>= expr max))
(format #t "(ASSERT_ZERO_LIM_RANGE_INT ~S ~S) FAILED (values ~D ~D) in "
msg-exp msg-max exp maximum)
(print-private-assert-info *__private-assert-info*)
msg-expr msg-max
expr maximum)
(print-pos *__private-assert-info*)
)
0
)

View file

@ -5,8 +5,9 @@
;; name in dgo: drawable-actor-h
;; dgos: GAME, ENGINE
(declare-type entity-actor basic)
(deftype drawable-actor (drawable)
((actor basic :offset 8)
((actor entity-actor :offset 8)
)
:method-count-assert 18
:size-assert #x20

View file

@ -5,12 +5,10 @@
;; name in dgo: drawable-ambient-h
;; dgos: GAME, ENGINE
;;-*-Lisp-*-
(in-package goal)
;; definition of type drawable-ambient
(declare-type entity-ambient basic)
(deftype drawable-ambient (drawable)
((ambient basic :offset 8)
((ambient entity-ambient :offset 8)
)
:method-count-assert 19
:size-assert #x20
@ -20,7 +18,6 @@
)
)
;; definition for method 3 of type drawable-ambient
(defmethod inspect drawable-ambient ((obj drawable-ambient))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tid: ~D~%" (-> obj id))
@ -29,7 +26,6 @@
obj
)
;; definition of type drawable-tree-ambient
(deftype drawable-tree-ambient (drawable-tree)
()
:method-count-assert 18
@ -37,24 +33,20 @@
:flag-assert #x1200000024
)
;; definition of type drawable-inline-array-ambient
(deftype drawable-inline-array-ambient (drawable-inline-array)
((data drawable-ambient 1 :inline)
(pad uint8 4))
:flag-assert #x1200000044
)
;; definition for method 10 of type drawable-tree-ambient
(defmethod dummy-10 drawable-tree-ambient ((obj _type_) (arg0 drawable) (arg1 display-frame))
0
)
;; definition for method 16 of type drawable-tree-ambient
(defmethod dummy-16 drawable-tree-ambient ((obj drawable-tree-ambient) (arg0 object) (arg1 object))
arg1
)
;; definition of type level-hint
(deftype level-hint (process)
((text-id-to-display uint32 :offset-assert 112)
(sound-to-play basic :offset-assert 116)
@ -76,7 +68,6 @@
)
)
;; definition for method 3 of type level-hint
(defmethod inspect level-hint ((obj level-hint))
(let ((t9-0 (method-of-type process inspect)))
(t9-0 obj)
@ -93,7 +84,6 @@
obj
)
;; definition of type ambient-list
(deftype ambient-list (structure)
((num-items int32 :offset-assert 0)
(items uint32 2048 :offset-assert 4)

View file

@ -21,7 +21,7 @@
(dummy-12 (_type_ int) none 12) ; int - length
(dummy-13 (_type_ int) none 13) ; int - length
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-15 (_type_) none 15)
(dummy-16 (_type_ object object) object 16)
(dummy-17 () none 17)
)

View file

@ -191,9 +191,9 @@
;; NOTE - this is a strange pattern...this symbol isn't defined until a later file 'navigate'
;; But this seems to be setting the symbol to nothing if it's not found, but of course, our compiler freaks out
(define-extern entity-nav-login (function basic none))
(define-extern entity-nav-login (function entity-actor none))
(if (zero? entity-nav-login)
(set! entity-nav-login (the-as (function basic none) nothing))
(set! entity-nav-login (the-as (function entity-actor none) nothing))
)
;; definition of type actor-bank
@ -217,4 +217,5 @@
)
(defun-extern entity-by-name string entity)
(defun-extern entity-by-type type entity-actor)
(defun-extern entity-by-aid uint entity)

View file

@ -92,3 +92,28 @@
)
(the-as entity #f)
)
(defun entity-by-type ((arg0 type))
(dotimes (s5-0 (-> *level* length))
(let ((v1-3 (-> *level* level s5-0)))
(when (= (-> v1-3 status) 'active)
(let ((s4-0 (-> v1-3 bsp actors)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(let ((s2-0 (-> s4-0 data s3-0 actor)))
(if
(and
(type-type? (-> s2-0 type) entity-actor)
(= (-> s2-0 etype) arg0)
)
(return s2-0)
)
)
)
)
)
)
)
)
(the-as entity-actor #f)
)

View file

@ -6,9 +6,11 @@
;; dgos: GAME, ENGINE
(declare-type collide-shape basic)
(declare-type water-control basic)
(declare-type sparticle-launch-control basic)
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel joint-control :offset-assert 124)
@ -18,7 +20,7 @@
(vol basic :offset-assert 140)
(fact fact-info :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(part sparticle-launch-control :offset-assert 152)
(water water-control :offset-assert 156)
(sound ambient-sound :offset-assert 160)
(state-flags uint32 :offset-assert 164)
@ -28,13 +30,15 @@
:method-count-assert 20
:size-assert #xb0
:flag-assert #x14004000b0
;; inherited inspect of process
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(deactivate (_type_) none 10)
(dummy-14 (_type_ skeleton-group object) none 14)
(dummy-15 (_type_ string object) _type_ 15)
(dummy-16 (_type_ int (inline-array vector) vector) collide-shape 16)
(dummy-17 (_type_) none 17)
(dummy-18 (_type_) symbol 18)
(dummy-19 (_type_) none 19)
)
)

View file

@ -33,9 +33,9 @@
(deftype level-buffer-state (structure)
((name basic :offset-assert 0)
(display? basic :offset-assert 4)
(force-vis? basic :offset-assert 8)
(force-inside? basic :offset-assert 12)
(display? symbol :offset-assert 4)
(force-vis? symbol :offset-assert 8)
(force-inside? symbol :offset-assert 12)
)
:pack-me
:method-count-assert 9
@ -45,29 +45,29 @@
(deftype load-state (basic)
((want level-buffer-state 2 :inline :offset-assert 4)
(vis-nick basic :offset-assert 36)
(command-list pair :offset-assert 40)
(object-name basic 256 :offset-assert 44)
(object-status basic 256 :offset-assert 1068)
(vis-nick symbol :offset-assert 36)
(command-list pair :offset-assert 40)
(object-name symbol 256 :offset-assert 44)
(object-status basic 256 :offset-assert 1068)
)
:method-count-assert 21
:size-assert #x82c
:flag-assert #x150000082c
(:methods
(new (symbol type) _type_ 0)
(reset! (_type_) _type_ 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
)
(new (symbol type) _type_ 0)
(reset! (_type_) _type_ 9)
(update! (_type_) int 10)
(want-levels (_type_ symbol symbol) int 11)
(want-display-level (_type_ symbol symbol) int 12)
(want-vis (_type_ symbol) int 13)
(want-force-vis (_type_ symbol symbol) int 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
)
)
(defmethod new load-state ((allocation symbol) (type-to-make type))
@ -149,19 +149,19 @@
:method-count-assert 29
:size-assert #x144
:flag-assert #x1d00000144
;; field dummy is a basic loaded with a signed load
;; field dummy is a basic loaded with a signed load
(:methods
(dummy-9 (_type_ symbol symbol string) none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-17 (_type_) continue-point 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-19 (_type_ continue-point) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)

View file

@ -28,14 +28,6 @@
:size-assert #x114
:flag-assert #x1400b00114
;; inherited inspect of process-drawable
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
)
)
(deftype part-spawner (process-drawable)

View file

@ -5,3 +5,10 @@
;; name in dgo: generic-obs
;; dgos: GAME, ENGINE
(deftype camera-start (process-hidden)
()
:method-count-assert 15
:size-assert #x70
:flag-assert #xf00000070
)

View file

@ -128,3 +128,6 @@
)
(defun-extern movie? symbol)
(defun-extern set-blackout-frames int uint)
(defun-extern on symbol process)
(defun-extern off int)

View file

@ -10,5 +10,80 @@
(nonzero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie)))
)
(defun set-blackout-frames ((arg0 int))
(cond
((zero? arg0)
(set! (-> *game-info* blackout-time) (-> *display* base-frame-counter))
)
(else
(set! (-> *game-info* blackout-time) (max (-> *game-info* blackout-time) (+ (-> *display* base-frame-counter) arg0)))
)
)
)
(defun display-loop ()
;; this function doesnt decompile right now
0
)
(defun on ((release-mode symbol))
"Turn the game on."
(when (not *dproc*)
(unless release-mode
(if (= (-> *level* level0 status) 'inactive)
(bg 'halfpipe)
)
)
(set! *run* #t)
;; this is actually a macro (see logic-target.gc)
(let ((new-dproc (swhen (get-process *4k-dead-pool* process (* 16 1024))
((method-of-type process activate) bc *display-pool* 'display *kernel-dram-stack*)
((the (function cpu-thread function object) set-to-run) (-> bc main-thread) display-loop)
(-> bc ppointer)
))
)
(set! *dproc* (the process (if new-dproc (-> new-dproc 0 self))))
)
(cond
((or (level-get-with-status *level* 'loaded)
(level-get-with-status *level* 'alive)
(level-get-with-status *level* 'active)
)
(activate-levels! *level*)
(when (not release-mode)
(let ((entity-cam (entity-by-type camera-start)))
(if (and entity-cam (type-type? (-> entity-cam type) entity-actor))
(camera-teleport-to-entity entity-cam)
)
)
)
)
(else
(kill-by-name 'display *active-pool*)
(set! *dproc* #f)
)
)
*dproc*
)
)
(defun off ()
"Turn the game off."
;; stop the game and set the mode to debug
(stop 'debug)
;; deactivate the levels
(dotimes (i (-> *level* length))
(let ((lev (-> *level* level i)))
(if (= (-> lev status) 'active)
(deactivate lev)
)
)
)
(set! *run* #f)
0
)
;; TODO - for credits
(define-extern scf-get-territory (function int))

View file

@ -145,10 +145,10 @@
(far-color vector :inline :offset-assert 32)
(ocean-spheres ocean-spheres :offset-assert 48)
(ocean-colors ocean-colors :offset-assert 52)
(ocean-mid-indices basic :offset-assert 56)
(ocean-trans-indices basic :offset-assert 60)
(ocean-near-indices basic :offset-assert 64)
(ocean-mid-masks basic :offset-assert 68)
(ocean-mid-indices ocean-mid-indices :offset-assert 56)
(ocean-trans-indices ocean-trans-indices :offset-assert 60)
(ocean-near-indices ocean-near-indices :offset-assert 64)
(ocean-mid-masks ocean-mid-masks :offset-assert 68)
)
:method-count-assert 9
:size-assert #x48

View file

@ -98,8 +98,8 @@
(default-vu-lights vu-lights :inline :offset-assert 1136)
)
(:methods
(new (symbol type) _type_ 0)
)
(new (symbol type) _type_ 0)
)
:method-count-assert 9
:size-assert #x4e0
:flag-assert #x9000004e0

View file

@ -76,7 +76,7 @@
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-20 (_type_ texture-page) int 20)
(upload-one-common! (_type_) symbol 21)
(lookup-boot-common-id (_type_ int) int 22)
)
@ -93,7 +93,7 @@
(dest uint16 7 :offset-assert 14)
(clutdest uint16 :offset-assert 28)
(width uint8 7 :offset-assert 30)
(name basic :offset-assert 40)
(name string :offset-assert 40)
(size uint32 :offset-assert 44)
(uv-dist float :offset-assert 48)
(masks uint32 3 :offset-assert 52)
@ -171,15 +171,16 @@
(deftype texture-page-dir (basic)
((length int32)
(entries texture-page-dir-entry 1 :inline))
(:methods
(dummy-9 () none 9)
(entries texture-page-dir-entry 1 :inline)
)
(:methods
(dummy-9 (_type_ kheap) int 9)
)
:flag-assert #xa00000014
)
(deftype texture-relocate-later (basic)
((memcpy basic :offset-assert 4)
((memcpy symbol :offset-assert 4)
(dest uint32 :offset-assert 8)
(source uint32 :offset-assert 12)
(move uint32 :offset-assert 16)
@ -214,7 +215,8 @@
)
(deftype adgif-shader-array (inline-array-class)
()
((data adgif-shader :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010

View file

@ -1264,7 +1264,7 @@
(set! (-> *texture-pool* allocate-func) texture-page-common-allocate)
;; in the level data, there is always code, then TFRAG texture,
;; so mark the code memory end as the start of this page.
(set! (-> *level* unknown-level-2 code-memory-end) (the-as uint page))
(set! (-> *level* unknown-level-2 code-memory-end) (the pointer page))
page
)
@ -1310,7 +1310,7 @@
)
)
(set! (-> *texture-pool* allocate-func) texture-page-common-allocate)
(set! (-> *level* unknown-level-2 code-memory-end) (the-as uint page))
(set! (-> *level* unknown-level-2 code-memory-end) (the pointer page))
page
)

View file

@ -5,3 +5,5 @@
;; name in dgo: subdivide
;; dgos: GAME, ENGINE
(define *subdivide-settings* (new 'global 'subdivide-settings (meters 30.0) (meters 70.0)))

View file

@ -53,8 +53,10 @@
:size-assert #x190
:flag-assert #x1400000190
(:methods
(dummy-18 () none 18)
(dummy-19 () none 19)
(relocate (_type_ int) _type_ 7)
(dummy-17 () none 17)
(dummy-18 (_type_) none 18)
(dummy-19 (_type_) none 19)
)
)

View file

@ -7,40 +7,40 @@
;; definition of type water-control
(deftype water-control (basic)
((flags uint32 :offset-assert 4)
(process basic :offset-assert 8)
(joint-index int32 :offset-assert 12)
(top-y-offset float :offset-assert 16)
(ripple-size float :offset-assert 20)
(enter-water-time uint64 :offset-assert 24)
(wade-time uint64 :offset-assert 32)
(on-water-time uint64 :offset-assert 40)
(enter-swim-time uint64 :offset-assert 48)
(swim-time uint64 :offset-assert 56)
(base-height float :offset-assert 64)
(wade-height float :offset-assert 68)
(swim-height float :offset-assert 72)
(surface-height float :offset-assert 76)
(bottom-height float :offset-assert 80)
(height float :offset-assert 84)
(height-offset float 4 :offset-assert 88)
(real-ocean-offset float :offset 88)
(ocean-offset float :offset 92)
(bob-offset float :offset 96)
(align-offset float :offset 100)
(swim-depth float :offset-assert 104)
(bob smush-control :inline :offset-assert 112)
(volume uint64 :offset-assert 144)
(bottom vector 2 :inline :offset-assert 160)
(top vector 2 :inline :offset-assert 192)
(enter-water-pos vector :inline :offset-assert 224)
(drip-old-pos vector :inline :offset-assert 240)
(drip-joint-index int32 :offset-assert 256)
(drip-wetness float :offset-assert 260)
(drip-time uint64 :offset-assert 264)
(drip-speed float :offset-assert 272)
(drip-height float :offset-assert 276)
(drip-mult float :offset-assert 280)
((flags uint32 :offset-assert 4)
(process process :offset-assert 8)
(joint-index int32 :offset-assert 12)
(top-y-offset float :offset-assert 16)
(ripple-size float :offset-assert 20) ; meters
(enter-water-time uint64 :offset-assert 24)
(wade-time uint64 :offset-assert 32)
(on-water-time uint64 :offset-assert 40)
(enter-swim-time uint64 :offset-assert 48)
(swim-time uint64 :offset-assert 56)
(base-height float :offset-assert 64) ; meters
(wade-height float :offset-assert 68) ; meters
(swim-height float :offset-assert 72) ; meters
(surface-height float :offset-assert 76) ; meters
(bottom-height float :offset-assert 80) ; meters
(height float :offset-assert 84) ; meters
(height-offset float 4 :offset-assert 88)
(real-ocean-offset float :offset 88) ; meters
(ocean-offset float :offset 92) ; meters
(bob-offset float :offset 96) ; meters
(align-offset float :offset 100) ; meters
(swim-depth float :offset-assert 104) ; meters
(bob smush-control :inline :offset-assert 112)
(volume uint64 :offset-assert 144) ;; handle?
(bottom vector 2 :inline :offset-assert 160)
(top vector 2 :inline :offset-assert 192)
(enter-water-pos vector :inline :offset-assert 224)
(drip-old-pos vector :inline :offset-assert 240)
(drip-joint-index int32 :offset-assert 256)
(drip-wetness float :offset-assert 260)
(drip-time uint64 :offset-assert 264)
(drip-speed float :offset-assert 272)
(drip-height float :offset-assert 276) ; meters
(drip-mult float :offset-assert 280)
)
:method-count-assert 17
:size-assert #x11c
@ -58,23 +58,11 @@
)
)
;; definition for method 14 of type water-control
(defmethod display-water-marks? water-control ((obj water-control))
(and *display-water-marks* (nonzero? (logand (-> obj flags) 1)))
)
;; definition for method 0 of type water-control
(defmethod
new
water-control
((allocation symbol)
(type-to-make type)
(arg0 process)
(arg1 int)
(arg2 float)
(arg3 float)
(arg4 float)
)
(defmethod new water-control ((allocation symbol) (type-to-make type) (arg0 process) (arg1 int) (arg2 float) (arg3 float) (arg4 float))
(let
((v0-0
(object-new allocation type-to-make (the-as int (-> type-to-make size)))
@ -93,12 +81,10 @@
)
)
;; definition for method 12 of type water-control
(defmethod distance-from-surface water-control ((obj water-control))
(- (-> obj top 0 y) (-> obj height))
)
;; definition of type water-vol
(deftype water-vol (process-drawable)
((water-height float :offset-assert 176)
(wade-height float :offset-assert 180)

View file

@ -6,14 +6,17 @@
;; dgos: GAME, ENGINE
(defconstant LEVEL_COUNT 2) ;; there are two levels in memory!
;; Information related to visibility data for a level.
;; Unclear why there are 8 of these per level.
;; Perhaps there are up to 8 "chunks" of the visibility loaded at a single time?
;; The full visibility data lives on the IOP.
(declare-type bsp-header basic)
(deftype level-vis-info (basic)
((level basic :offset-assert 4)
(from-level basic :offset-assert 8)
(from-bsp basic :offset-assert 12)
((level symbol :offset-assert 4)
(from-level symbol :offset-assert 8)
(from-bsp bsp-header :offset-assert 12)
(flags uint32 :offset-assert 16)
(length uint32 :offset-assert 20)
(allocated-length uint32 :offset-assert 24)
@ -21,9 +24,9 @@
(dictionary uint32 :offset-assert 32)
(string-block uint32 :offset-assert 36)
(ramdisk uint32 :offset-assert 40)
(vis-bits uint32 :offset-assert 44)
(vis-bits pointer :offset-assert 44)
(current-vis-string uint32 :offset-assert 48)
(vis-string uint8 :dynamic :offset-assert 52)
(vis-string uint8 :dynamic :offset-assert 52)
)
:method-count-assert 9
:size-assert #x34
@ -84,83 +87,81 @@
:flag-assert #x900000050
)
(declare-type bsp-header basic)
(declare-type engine basic)
(declare-type entity-links-array basic)
(declare-type entity-ambient-data-array basic)
(declare-type mood-context basic)
;; Per level-buffer info about the current loaded level.
(deftype level (basic)
((name symbol :offset-assert 4)
(load-name symbol :offset-assert 8)
(nickname symbol :offset-assert 12)
((name symbol :offset-assert 4)
(load-name symbol :offset-assert 8)
(nickname symbol :offset-assert 12)
(index int32 :offset-assert 16)
(status symbol :offset-assert 20)
(status symbol :offset-assert 20)
(other level :offset-assert 24)
(heap kheap :inline :offset-assert 32)
(bsp bsp-header :offset-assert 48)
(art-group load-dir-art-group :offset-assert 52)
(info level-load-info :offset-assert 56)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
(art-group load-dir-art-group :offset-assert 52)
(info level-load-info :offset-assert 56)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page texture-page 16 :offset-assert 96)
(loaded-texture-page-count int32 :offset-assert 160)
; (foreground-sink-group-0 dma-foreground-sink-group :inline :offset-assert 176)
; (foreground-sink-group-1 dma-foreground-sink-group :inline :offset-assert 208)
; (foreground-sink-group-2 dma-foreground-sink-group :inline :offset-assert 240)
; (array-pad uint8 12)
(foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176) ;; inline basic
(foreground-draw-engine engine 3 :offset-assert 272)
(foreground-draw-engine engine 3 :offset-assert 272)
(entity entity-links-array :offset-assert 284)
(ambient entity-ambient-data-array :offset-assert 288)
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364) ; meters
(inside-sphere? symbol :offset-assert 368)
(inside-boxes? symbol :offset-assert 372)
(display? symbol :offset-assert 376)
(meta-inside? symbol :offset-assert 380)
(mood mood-context :offset-assert 384)
(closest-object float 9 :offset-assert 292)
(upload-size int32 9 :offset-assert 328)
(level-distance float :offset-assert 364) ; meters
(inside-sphere? symbol :offset-assert 368)
(inside-boxes? symbol :offset-assert 372)
(display? symbol :offset-assert 376)
(meta-inside? symbol :offset-assert 380)
(mood mood-context :offset-assert 384)
(mood-func function :offset-assert 388)
(vis-bits uint32 :offset-assert 392)
(all-visible? symbol :offset-assert 396)
(force-all-visible? symbol :offset-assert 400)
(vis-bits pointer :offset-assert 392)
(all-visible? symbol :offset-assert 396)
(force-all-visible? symbol :offset-assert 400)
(linking basic :offset-assert 404)
(vis-info level-vis-info 8 :offset-assert 408)
(vis-self-index int32 :offset-assert 440)
(vis-adj-index int32 :offset-assert 444)
(vis-buffer uint8 2048 :offset-assert 448)
(vis-buffer uint8 2048 :offset-assert 448)
(mem-usage-block basic :offset-assert 2496)
(mem-usage int32 :offset-assert 2500)
(code-memory-start uint32 :offset-assert 2504)
(code-memory-end uint32 :offset-assert 2508)
(texture-mask uint32 9 :offset-assert 2512)
(force-inside? symbol :offset-assert 2548)
(code-memory-start pointer :offset-assert 2504)
(code-memory-end pointer :offset-assert 2508)
(texture-mask uint32 9 :offset-assert 2512)
(force-inside? symbol :offset-assert 2548)
(pad uint8 56)
)
:method-count-assert 29
:size-assert #xa30
:flag-assert #x1d00000a30
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(deactivate (_type_) _type_ 9)
(dummy-10 (_type_ int) symbol 10)
(dummy-11 (_type_) none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 (_type_ symbol) none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 (_type_ string) symbol 28)
(unload! (_type_) _type_ 12)
(bsp-name (_type_) symbol 13)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_ vector) symbol 15)
(dummy-16 (_type_) none 16)
(load-continue (_type_) _type_ 17)
(load-begin (_type_) _type_ 18)
(login (_type_) _type_ 19)
(vis-load (_type_) uint 20)
(dummy-21 (_type_) none 21)
(activate (_type_) _type_ 22)
(level-status-set! (_type_ symbol) _type_ 23)
(dummy-24 (_type_) _type_ 24)
(dummy-25 (_type_) int 25)
(vis-clear (_type_) int 26)
(dummy-27 (_type_ vector string) none 27)
(art-group-get-by-name (_type_ string) art-group 28)
)
)
@ -174,49 +175,53 @@
((length int32 :offset-assert 4)
(unknown-level-1 level :offset-assert 8)
(unknown-level-2 level :offset-assert 12)
(entity-link entity-links :offset 16) ;; not sure what's going on here
(entity-link entity-links :offset-assert 16) ;; not sure what's going on here
(border? basic :offset-assert 20)
(vis? basic :offset-assert 24)
(want-level basic :offset-assert 28)
(receiving-level basic :offset-assert 32)
(load-commands pair :offset-assert 36)
(play? basic :offset-assert 40)
;; there's something? from 40 -> 96.
(hack-pad uint8 :offset 90)
;(level level 3 :inline :offset-assert 96)
;(data level 3 :inline :offset-assert 100)
(level0 level :inline :offset-assert 96) ;; inline basic
(level1 level :inline :offset-assert 2704) ;; inline basic
(level-default level :inline :offset-assert 5312) ;; inline basic
(play? symbol :offset-assert 40)
;; there's something? from 40 -> 96.
(_hack-pad uint8 :offset 90)
(level0 level :inline :offset-assert 96)
(level1 level :inline :offset-assert 2704)
(level-default level :inline :offset-assert 5312)
;; this actually went earlier,
(level level 3 :inline :offset 96)
;; and this one too. why another one?
(data level 3 :score -1 :inline :offset 96)
(pad uint32)
)
:method-count-assert 27
:size-assert #x1ef4
:flag-assert #x1b00001ef4
(:methods
(dummy-9 (_type_ symbol) level 9)
(dummy-10 (_type_ symbol) symbol 10)
(dummy-11 (_type_ symbol symbol) level 11)
(dummy-12 (_type_) none 12)
(level-get (_type_ symbol) level 9)
(level-get-with-status (_type_ symbol) level 10)
(level-get-for-use (_type_ symbol symbol) level 11)
(activate-levels! (_type_) int 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-18 (_type_ symbol) none 18)
(dummy-19 (_type_ pair) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ level-group int) pair 21)
(dummy-16 (_type_) int 16)
(level-get-target-inside (_type_) level 17)
(alloc-levels! (_type_ symbol) int 18)
(load-commands-set! (_type_ pair) pair 19)
(art-group-get-by-name (_type_ string) art-group 20)
(load-command-get-index (_type_ symbol int) pair 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(level-status (_type_ symbol) symbol 25)
(level-get-most-disposable (_type_) level 26)
)
)
(defun-extern level-update-after-load level login-state level)
(define-extern *level* level-group)
(if (zero? *level*)
(set! *level*

View file

@ -7,7 +7,9 @@
(define training
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'training 'training-vis 'tra)
:name 'training
:visname 'training-vis
:nickname 'tra
:index 1
:packages '(training)
:sound-banks '(training)
@ -114,7 +116,9 @@
;; definition for symbol village1, type level-load-info
(define village1
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'village1 'village1-vis 'vi1)
:name 'village1
:visname 'village1-vis
:nickname 'vi1
:index 2
:packages '(village1)
:sound-banks '(village1)
@ -233,7 +237,9 @@
;; definition for symbol beach, type level-load-info
(define beach
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'beach 'beach-vis 'bea)
:name 'beach
:visname 'beach-vis
:nickname 'bea
:index 3
:packages '(beach)
:sound-banks '(beach)
@ -276,7 +282,9 @@
;; definition for symbol jungle, type level-load-info
(define jungle
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'jungle 'jungle-vis 'jun)
:name 'jungle
:visname 'jungle-vis
:nickname 'jun
:index 4
:packages '(jungle)
:sound-banks '(jungle)
@ -319,7 +327,9 @@
;; definition for symbol jungleb, type level-load-info
(define jungleb
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'jungleb 'jungleb-vis 'jub)
:name 'jungleb
:visname 'jungleb-vis
:nickname 'jub
:index 5
:packages '(jungleb)
:sound-banks '(jungleb)
@ -360,7 +370,9 @@
;; definition for symbol misty, type level-load-info
(define misty
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'misty 'misty-vis 'mis)
:name 'misty
:visname 'misty-vis
:nickname 'mis
:index 6
:packages '(misty)
:sound-banks '(misty)
@ -524,7 +536,9 @@
;; definition for symbol firecanyon, type level-load-info
(define firecanyon
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'firecanyon 'firecanyon-vis 'fic)
:name 'firecanyon
:visname 'firecanyon-vis
:nickname 'fic
:index 7
:packages '(firecanyon)
:sound-banks '(firecanyon)
@ -580,7 +594,9 @@
;; definition for symbol village2, type level-load-info
(define village2
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'village2 'village2-vis 'vi2)
:name 'village2
:visname 'village2-vis
:nickname 'vi2
:index 8
:packages '(village2)
:sound-banks '(village2)
@ -651,7 +667,9 @@
;; definition for symbol sunken, type level-load-info
(define sunken
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'sunken 'sunken-vis 'sun)
:name 'sunken
:visname 'sunken-vis
:nickname 'sun
:index 9
:packages '(sunken)
:sound-banks '(sunken)
@ -735,7 +753,9 @@
;; definition for symbol sunkenb, type level-load-info
(define sunkenb
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'sunkenb 'sunkenb-vis 'sub)
:name 'sunkenb
:visname 'sunkenb-vis
:nickname 'sub
:index 10
:packages '()
:sound-banks '(sunken)
@ -791,7 +811,9 @@
;; definition for symbol swamp, type level-load-info
(define swamp
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'swamp 'swamp-vis 'swa)
:name 'swamp
:visname 'swamp-vis
:nickname 'swa
:index 11
:packages '(swamp)
:sound-banks '(swamp)
@ -966,7 +988,9 @@
;; definition for symbol rolling, type level-load-info
(define rolling
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'rolling 'rolling-vis 'rol)
:name 'rolling
:visname 'rolling-vis
:nickname 'rol
:index 12
:packages '(rolling)
:sound-banks '(rolling)
@ -1009,7 +1033,9 @@
;; definition for symbol ogre, type level-load-info
(define ogre
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'ogre 'ogre-vis 'ogr)
:name 'ogre
:visname 'ogre-vis
:nickname 'ogr
:index 13
:packages '(ogre)
:sound-banks '(ogre)
@ -1079,7 +1105,9 @@
;; definition for symbol village3, type level-load-info
(define village3
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'village3 'village3-vis 'vi3)
:name 'village3
:visname 'village3-vis
:nickname 'vi3
:index 14
:packages '(village3)
:sound-banks '(village3)
@ -1151,7 +1179,9 @@
;; definition for symbol snow, type level-load-info
(define snow
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'snow 'snow-vis 'sno)
:name 'snow
:visname 'snow-vis
:nickname 'sno
:index 15
:packages '(snow)
:sound-banks '(snow)
@ -1306,7 +1336,9 @@
;; definition for symbol maincave, type level-load-info
(define maincave
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'maincave 'maincave-vis 'mai)
:name 'maincave
:visname 'maincave-vis
:nickname 'mai
:index 16
:packages '(maincave)
:sound-banks '(maincave)
@ -1376,7 +1408,9 @@
;; definition for symbol darkcave, type level-load-info
(define darkcave
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'darkcave 'darkcave-vis 'dar)
:name 'darkcave
:visname 'darkcave-vis
:nickname 'dar
:index 17
:packages '(darkcave)
:sound-banks '(darkcave)
@ -1477,7 +1511,9 @@
;; definition for symbol lavatube, type level-load-info
(define lavatube
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'lavatube 'lavatube-vis 'lav)
:name 'lavatube
:visname 'lavatube-vis
:nickname 'lav
:index 19
:packages '(lavatube)
:sound-banks '(lavatube)
@ -1565,7 +1601,9 @@
;; definition for symbol citadel, type level-load-info
(define citadel
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'citadel 'citadel-vis 'cit)
:name 'citadel
:visname 'citadel-vis
:nickname 'cit
:index 20
:packages '(citadel)
:sound-banks '(citadel)
@ -1744,7 +1782,9 @@
;; definition for symbol finalboss, type level-load-info
(define finalboss
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'finalboss 'finalboss-vis 'fin)
:name 'finalboss
:visname 'finalboss-vis
:nickname 'fin
:index 21
:packages '(finalboss)
:sound-banks '(finalboss)
@ -1806,7 +1846,9 @@
;; definition for symbol intro, type level-load-info
(define intro
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'intro 'intro-vis 'int)
:name 'intro
:visname 'intro-vis
:nickname 'int
:index 22
:packages '(intro)
:sound-banks '()
@ -1832,7 +1874,9 @@
;; definition for symbol demo, type level-load-info
(define demo
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'demo 'demo-vis 'dem)
:name 'demo
:visname 'demo-vis
:nickname 'dem
:index 23
:packages '()
:sound-banks '(village1)
@ -1874,7 +1918,9 @@
;; definition for symbol title, type level-load-info
(define title
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'title 'title-vis 'tit)
:name 'title
:visname 'title-vis
:nickname 'tit
:index 24
:packages '()
:sound-banks '()
@ -1959,7 +2005,9 @@
;; definition for symbol default-level, type level-load-info
(define default-level
(new 'static 'level-load-info
:name-list (new 'static 'array symbol 3 'default-level 'default-level-vis 'none)
:name 'default-level
:visname 'default-level-vis
:nickname 'none
:index 26
:packages '()
:sound-banks '()

File diff suppressed because it is too large Load diff

View file

@ -5,3 +5,5 @@
;; name in dgo: load-boundary-h
;; dgos: GAME, ENGINE
(define-extern *load-state* load-state)

View file

@ -7,7 +7,6 @@
(defmethod reset! load-state ((obj load-state))
(local-vars (v1-1 int))
(set! (-> obj want 0 name) #f)
(set! (-> obj want 0 display?) #f)
(set! (-> obj want 0 force-vis?) #f)
@ -17,11 +16,100 @@
(set! (-> obj want 1 force-vis?) #f)
(set! (-> obj want 1 force-inside?) #f)
(set! (-> obj command-list) '())
(set! v1-1 0)
(while (< v1-1 256)
(dotimes (v1-1 256)
(set! (-> obj object-name v1-1) #f)
(set! (-> obj object-status v1-1) (the basic 0))
(+! v1-1 1)
(set! (-> obj object-status v1-1) (the-as basic 0))
)
obj
)
(defmethod want-levels load-state ((obj load-state) (arg0 symbol) (arg1 symbol))
(dotimes (v1-0 LEVEL_COUNT)
(cond
((= (-> obj want v1-0 name) arg0)
(set! arg0 #f)
)
((= (-> obj want v1-0 name) arg1)
(set! arg1 #f)
)
(else
(set! (-> obj want v1-0 name) #f)
)
)
)
(when arg0
(dotimes (v1-4 LEVEL_COUNT)
(when (not (-> obj want v1-4 name))
(set! (-> obj want v1-4 name) arg0)
(set! (-> obj want v1-4 display?) #f)
(set! (-> obj want v1-4 force-vis?) #f)
(set! (-> obj want v1-4 force-inside?) #f)
(set! v1-4 LEVEL_COUNT)
)
)
)
(when arg1
(dotimes (v1-10 LEVEL_COUNT)
(when (not (-> obj want v1-10 name))
(set! (-> obj want v1-10 name) arg1)
(set! (-> obj want v1-10 display?) #f)
(set! (-> obj want v1-10 force-vis?) #f)
(set! (-> obj want v1-10 force-inside?) #f)
(set! v1-10 LEVEL_COUNT)
)
)
)
0
)
(defmethod want-display-level load-state ((obj load-state) (arg0 symbol) (arg1 symbol))
(dotimes (v1-0 LEVEL_COUNT)
(when (= (-> obj want v1-0 name) arg0)
(set! (-> obj want v1-0 display?) arg1)
(return 0)
)
)
(if arg1
(format 0 "ERROR: can't display ~A because it isn't loaded~%" arg0)
)
0
)
(defmethod want-vis load-state ((obj load-state) (arg0 symbol))
(set! (-> obj vis-nick) arg0)
0
)
(defmethod want-force-vis load-state ((obj load-state) (arg0 symbol) (arg1 symbol))
(dotimes (v1-0 LEVEL_COUNT)
(if (= (-> obj want v1-0 name) arg0)
(set! (-> obj want v1-0 force-vis?) arg1)
(return 0)
)
)
(format 0 "ERROR: can't force vis on ~A because it isn't loaded~%" arg0)
0
)
(defun load-state-want-levels ((arg0 symbol) (arg1 symbol))
(want-levels *load-state* arg0 arg1)
)
(defun load-state-want-display-level ((arg0 symbol) (arg1 symbol))
(want-display-level *load-state* arg0 arg1)
)
(defun load-state-want-vis ((arg0 symbol))
(want-vis *load-state* arg0)
)
(defun load-state-want-force-vis ((arg0 symbol) (arg1 symbol))
(want-force-vis *load-state* arg0 arg1)
)
(define *display-load-commands* #f)
(define *backup-load-state* (new 'global 'load-state))
(define-perm *load-state* load-state (new 'global 'load-state))

View file

@ -94,14 +94,15 @@
(defconstant LEVEL_VS_FILE_VERSION 30)
(defconstant TX_FILE_VERSION 1)
(defun make-file-name ((kind file-kind) (name string) (art-group-version int))
(defun make-file-name ((kind file-kind) (name string) (art-group-version int) (arg3 symbol))
"Get a file name to open a file with the given kind and name.
The art-group-version argument can be used to override the version
of the art-group. Set it to 0 or less to use the default version
Similar to MakeFileName in C.
Note: file type enum is different between C and GOAL.
File versions should match those in versions.h.
Uses a single *file-temp-string* buffer, shared with make-vfile-name"
Uses a single *file-temp-string* buffer, shared with make-vfile-name.
arg3 is unused."
(clear *file-temp-string*)
(cond
((= kind (file-kind dir-tpage))

View file

@ -25,11 +25,11 @@
;; The OVERLORD responds with the same message.
(deftype load-dgo-msg (structure)
((rsvd uint16 :offset-assert 0) ;; unused?
(result load-msg-result :offset-assert 2) ;; status from OVERLORD
(b1 uint32 :offset-assert 4) ;; EE -> OVERLORD, first temp load buffer
(b2 uint32 :offset-assert 8) ;; EE -> OVERLORD, second temp load buffer
(bt uint32 :offset-assert 12) ;; EE -> OVERLORD, location of heap
(name uint128 :offset-assert 16) ;; EE -> OVERLORD, name of file.
(result load-msg-result :offset-assert 2) ;; status from OVERLORD
(b1 pointer :offset-assert 4) ;; EE -> OVERLORD, first temp load buffer
(b2 pointer :offset-assert 8) ;; EE -> OVERLORD, second temp load buffer
(bt pointer :offset-assert 12) ;; EE -> OVERLORD, location of heap
(name uint128 :offset-assert 16) ;; EE -> OVERLORD, name of file.
(name-chars uint8 16 :offset 16) ;; name of file (as chars)
(address uint32 :offset 4) ;; OVERLORD -> EE, location of loaded file.
)
@ -268,7 +268,7 @@ struct DgoHeader {
(define *dgo-time* (the-as uint 0))
(defun dgo-load-begin ((name string) (buffer1 int) (buffer2 int) (current-heap int))
(defun dgo-load-begin ((name string) (buffer1 pointer) (buffer2 pointer) (buffer-top pointer))
"Send a DGO load RPC!"
;; remember when we started
@ -282,9 +282,9 @@ struct DgoHeader {
(let ((cmd (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
;; set parameters
(set! (-> cmd result) (load-msg-result invalid))
(set! (-> cmd b1) (the-as uint buffer1))
(set! (-> cmd b2) (the-as uint buffer2))
(set! (-> cmd bt) (the-as uint current-heap))
(set! (-> cmd b1) buffer1)
(set! (-> cmd b2) buffer2)
(set! (-> cmd bt) buffer-top)
;; modified due to OpenGOAL not supporting uint128 return values yet
(set! (-> cmd name) (string->sound-name name))
;; call now!
@ -333,13 +333,13 @@ struct DgoHeader {
)
)
(defun dgo-load-continue ((current-heap pointer))
(defun dgo-load-continue ((buffer-top pointer))
"Send a command to to the IOP to continue loading a DGO"
(let ((cmd (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> cmd result) (load-msg-result invalid))
(set! (-> cmd b1) (the-as uint 0))
(set! (-> cmd b2) (the-as uint 0))
(set! (-> cmd bt) (the-as uint current-heap))
(set! (-> cmd b1) (the pointer 0))
(set! (-> cmd b2) (the pointer 0))
(set! (-> cmd bt) buffer-top)
(set! (-> cmd name) (the-as uint128 0))
(call *load-dgo-rpc* (the-as uint 1) (the-as pointer cmd) (the-as uint 32))
(the-as int cmd)

View file

@ -8,25 +8,27 @@
;; This type didn't have an inspect method, so these field names are made up.
(declare-type art-group basic)
(deftype load-dir (basic)
((unknown basic)
(string-array (array string)) ;; these are the names
(data-array (array art-group)) ;; this is the file data.
((unknown basic :offset-assert 4)
(string-array (array string) :offset-assert 8) ;; these are the names
(data-array (array basic) :offset-assert 12) ;; this is the file data.
)
:flag-assert #xb00000010
(:methods
(new (symbol type int basic) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
)
(new (symbol type int basic) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
)
)
;; specialization of load-dir where the data-array holds art-groups.
(declare-type art-group basic)
(deftype load-dir-art-group (load-dir)
()
(:methods
(new (symbol type int basic) _type_ 0)
((art-group-array (array art-group) :offset 12)
)
:flag-assert #xb00000010
(:methods
(new (symbol type int basic) _type_ 0)
)
)
@ -65,35 +67,35 @@
(deftype external-art-buffer (basic)
((index int32 :offset-assert 4)
(other external-art-buffer :offset-assert 8)
(status basic :offset-assert 12)
(locked? basic :offset-assert 16)
(frame-lock basic :offset-assert 20)
(status symbol :offset-assert 12)
(locked? symbol :offset-assert 16)
(frame-lock symbol :offset-assert 20)
(heap kheap :inline :offset-assert 32)
(pending-load-file basic :offset-assert 48)
(pending-load-file string :offset-assert 48)
(pending-load-file-part int32 :offset-assert 52)
(pending-load-file-owner uint64 :offset-assert 56)
(pending-load-file-priority float :offset-assert 64)
(load-file basic :offset-assert 68)
(load-file string :offset-assert 68)
(load-file-part int32 :offset-assert 72)
(load-file-owner uint64 :offset-assert 80)
(load-file-priority float :offset-assert 88)
(buf uint32 :offset-assert 92)
(len int32 :offset-assert 96)
(art-group basic :offset-assert 100)
(art-group art-group :offset-assert 100)
)
:method-count-assert 16
:size-assert #x68
:flag-assert #x1000000068
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
)
(new (symbol type int) _type_ 0)
(dummy-9 (_type_ symbol int symbol float) none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
)
)
(defmethod new external-art-buffer ((allocation symbol) (type-to-make type) (idx int))
@ -117,7 +119,7 @@
)
(deftype spool-anim (basic)
((name basic :offset 16) ;; why?
((name string :offset 16) ;; why?
(index int32 :offset-assert 20)
(parts int32 :offset-assert 24)
(priority float :offset-assert 28)
@ -145,16 +147,16 @@
:size-assert #x118
:flag-assert #x1100000118
(:methods
(new (symbol type) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
)
(new (symbol type) _type_ 0)
(dummy-9 (_type_ symbol) none 9)
(dummy-10 (_type_) none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
)
)
(defmethod new external-art-control ((allocation symbol) (type-to-make type))

View file

@ -408,7 +408,8 @@
)
(deftype box8s-array (inline-array-class)
()
((data box8s :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010

View file

@ -372,7 +372,6 @@
(define *current-sound-id* (the sound-id 65536))
(declare-type entity basic)
(deftype ambient-sound (basic)
((spec sound-spec :offset-assert 4)
(playing-id sound-id :offset-assert 8)

View file

@ -5,3 +5,44 @@
;; name in dgo: logic-target
;; dgos: GAME, ENGINE
;; temp, this function is massive and a whole can of worms. Just do nothing for now, it's fine.
(defun init-target ((cont continue-point))
"NOTHING11!!!!"
(the object 0)
)
(defun stop ((game-mode symbol))
"Stop the target system"
(when *target*
(kill-by-name 'target *active-pool*)
(set! *target* #f)
)
(set! (-> *game-info* mode) game-mode)
0
)
(defun start ((game-mode symbol) (cont continue-point))
"Start the target system"
(set! (-> *level* border?) #f)
(set! (-> *setting-control* default border-mode) #f)
(stop game-mode)
;; this is also that same macro... i just have no idea how to write it.
(let* ((s5-0 (the target (get-process *target-dead-pool* target #x4000)))
(v1-3 (when s5-0
((method-of-type target activate) s5-0 *target-pool* 'target *kernel-dram-stack*)
((the (function object object object object) run-function-in-process) s5-0 init-target cont)
(-> s5-0 ppointer)
))
)
(if v1-3
(set! *target* (the target (-> v1-3 0 self)))
(set! *target* #f)
)
)
*target*
)

View file

@ -7,51 +7,57 @@
;; definition of type target
(deftype target (process-drawable)
((control basic :offset 112)
(skel2 basic :offset-assert 176)
(racer basic :offset-assert 180)
(game basic :offset-assert 184)
(neck basic :offset-assert 188)
(state-hook-time uint64 :offset-assert 192)
(state-hook basic :offset-assert 200)
(cam-user-mode basic :offset-assert 204)
(sidekick uint32 :offset-assert 208)
(manipy uint32 :offset-assert 212)
(attack-info attack-info :inline :offset-assert 224)
(attack-info-rec attack-info :inline :offset-assert 336)
(anim-seed uint64 :offset-assert 440)
(alt-cam-pos vector :inline :offset-assert 448)
(snowball basic :offset-assert 464)
(tube basic :offset-assert 468)
(flut basic :offset-assert 472)
(current-level basic :offset-assert 476)
(saved-pos transformq :inline :offset-assert 480)
(saved-owner uint64 :offset-assert 528)
(alt-neck-pos vector :inline :offset-assert 544)
(fp-hud uint64 :offset-assert 560)
(no-load-wait uint64 :offset-assert 568)
(no-look-around-wait uint64 :offset-assert 576)
((control control-info :score 100 :offset 112)
(skel2 basic :offset-assert 176)
(racer basic :offset-assert 180)
(game game-info :offset-assert 184)
(neck joint-mod :offset-assert 188)
(state-hook-time uint64 :offset-assert 192)
(state-hook function :offset-assert 200)
(cam-user-mode symbol :offset-assert 204)
(sidekick uint32 :offset-assert 208)
(manipy uint32 :offset-assert 212)
(attack-info attack-info :inline :offset-assert 224)
(attack-info-rec attack-info :inline :offset-assert 336)
(anim-seed uint64 :offset-assert 440)
(alt-cam-pos vector :inline :offset-assert 448)
(snowball basic :offset-assert 464)
(tube basic :offset-assert 468)
(flut basic :offset-assert 472)
(current-level level :offset-assert 476)
(saved-pos transformq :inline :offset-assert 480)
(saved-owner uint64 :offset-assert 528)
(alt-neck-pos vector :inline :offset-assert 544)
(fp-hud uint64 :offset-assert 560)
(no-load-wait uint64 :offset-assert 568)
(no-look-around-wait uint64 :offset-assert 576)
)
:heap-base #x1e0
:method-count-assert 21
:size-assert #x248
:flag-assert #x1501e00248
;; inherited inspect of process-drawable
(:methods
(dummy-20 () none 20)
)
)
;; definition of type sidekick
(deftype sidekick (process-drawable)
((control basic :offset 112)
(anim-seed uint64 :offset 192)
(shadow-in-movie? basic :offset-assert 200)
((control control-info :offset 112)
(anim-seed uint64 :offset 192)
(shadow-in-movie? basic :offset-assert 200)
)
:heap-base #x60
:method-count-assert 20
:size-assert #xcc
:flag-assert #x14006000cc
;; inherited inspect of process-drawable
)
(define-perm *target* target #f)
(define-perm *sidekick* sidekick #f)
(defun-extern stop symbol int)
(defun-extern start symbol continue-point target)

View file

@ -322,6 +322,7 @@
;; Backup some values, and restore after executing body.
;; Non-dynamic (nonlocal jumps out of body will skip restore)
;; NOTE : GOAL protected defs in a FIFO manner (this is FILO/LIFO), this should be fixed at some point
(defmacro protect (defs &rest body)
(if (null? defs)
;; nothing to backup, just insert body (base case)
@ -510,7 +511,7 @@
)
(defmacro align64 (value)
`(logand -64 (+ (the-as int ,value) 63))
`(logand -64 (&+ (the-as pointer ,value) 63))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -172,7 +172,7 @@
;; *stack-top*
;; *stack-base*
;; *stack-size*
;; *kernel-boot-message*
(define-extern *kernel-boot-message* symbol)
;; *kernel-boot-mode*
;; *kernel-boot-level*

View file

@ -223,13 +223,15 @@
;; A GOAL process. A GOAL process contains memory and a suspendable main-thread.
(declare-type res-lump basic)
(declare-type entity res-lump)
(deftype process (process-tree)
((pool dead-pool :offset-assert #x20)
(status basic :offset-assert #x24)
(pid int32 :offset-assert #x28)
(main-thread cpu-thread :offset-assert #x2c)
(top-thread thread :offset-assert #x30)
(entity basic :offset-assert #x34)
(entity entity :offset-assert #x34)
(state state :offset-assert #x38)
(trans-hook function :offset-assert #x3c)
(post-hook function :offset-assert #x40)

View file

@ -95,13 +95,13 @@
)
;; the main stack for running GOAL code!
;; all user code (that I know of) runs using *dram-stack*
;; most user code runs using *dram-stack*
(define *dram-stack* (new 'global 'array 'uint8 DPROCESS_STACK_SIZE))
;; note - this name is a bit confusing. The kernel-dram-stack is not the stack that the kernel runs in.
;; I think it refers to the fact that it's _not_ the scratchpad stack
(defconstant *kernel-dram-stack* (&+ *dram-stack* DPROCESS_STACK_SIZE))
;; I don't think this stack is used, but I'm not sure.
;; another stack for running GOAL processes, this one uses the scratchpad (fast memory).
(set! (-> *kernel-context* fast-stack-top) *scratch-memory-top*)
;; A context with all process masks set to 0. This can be used to iterate through a process tree
@ -959,7 +959,7 @@
;; they actually need. To avoid heap fragmentation, the dead-pool-heap system will relocate
;; processes. This requires that you implement the relocate method on your process.
;; DANGER: the dead pool heap is _not_ a proper process tree. Do not attempt to treat it like on.
;; DANGER: the dead pool heap is _not_ a proper process tree. Do not attempt to treat it like one.
;; If you get-process, you should immediately activate it. The activate method will (change-parent)
;; and this will get stuck in an endless loop if you do it on a process that wasn't the most recent one.
@ -1645,8 +1645,7 @@
(define-extern *active-pool* process-tree)
(defun kernel-dispatcher ()
"Run the kernel!
"
"Run the kernel!"
(when *listener-function*
(let ((result (reset-and-call (-> *listener-process* main-thread) *listener-function*)))

View file

@ -332,6 +332,20 @@ There are several ways to "go"
)
)
(defmacro send-event (proc msg &rest params)
`(with-pp
(let ((event-data (new 'stack-no-clear 'event-message-block)))
(set! (-> event-data from) pp)
(set! (-> event-data num-params) ,(length params))
(set! (-> event-data message) ,msg)
,@(let ((ep 0))
(apply (lambda (x) `(set! (-> event-data param ep) ,x) (inc! ep)) params)
)
(send-event-function ,proc event-data)
)
)
)
(defun looping-code ()
"Loop."
(while #t

View file

@ -248,7 +248,11 @@ Val* Compiler::compile_cond(const goos::Object& form, const goos::Object& rest,
env->emit(std::move(get_false));
}
result->set_type(coerce_to_reg_type(m_ts.lowest_common_ancestor(case_result_types)));
if (case_result_types.empty()) {
result->set_type(TypeSpec("none"));
} else {
result->set_type(coerce_to_reg_type(m_ts.lowest_common_ancestor(case_result_types)));
}
// PATCH END
end_label->idx = fenv->code().size();
@ -323,4 +327,4 @@ Val* Compiler::compile_and_or(const goos::Object& form, const goos::Object& rest
result->set_type(m_ts.lowest_common_ancestor(case_result_types));
return result;
}
}

View file

@ -44,32 +44,32 @@
;; definition of type joint-control
(deftype joint-control (basic)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel joint-control-channel :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
(prebind-function basic :offset-assert 32)
(postbind-function basic :offset-assert 36)
(effect basic :offset-assert 40)
(channel joint-control-channel 3 :inline :offset-assert 48)
(frame-group0 art-joint-anim :offset 60)
(frame-num0 float :offset 64)
(frame-interp0 float :offset 56)
(frame-group1 art-joint-anim :offset 108)
(frame-num1 float :offset 112)
(frame-interp1 float :offset 104)
(frame-group2 art-joint-anim :offset 156)
(frame-num2 float :offset 160)
(frame-interp2 float :offset 152)
((status uint16 :offset-assert 4)
(allocated-length int16 :offset-assert 6)
(root-channel (inline-array joint-control-channel) :offset 16)
(blend-index int32 :offset-assert 20)
(active-channels int32 :offset-assert 24)
(generate-frame-function basic :offset-assert 28)
(prebind-function basic :offset-assert 32)
(postbind-function basic :offset-assert 36)
(effect basic :offset-assert 40)
(channel joint-control-channel 3 :inline :offset-assert 48)
(frame-group0 art-joint-anim :offset 60)
(frame-num0 float :offset 64)
(frame-interp0 float :offset 56)
(frame-group1 art-joint-anim :offset 108)
(frame-num1 float :offset 112)
(frame-interp1 float :offset 104)
(frame-group2 art-joint-anim :offset 156)
(frame-num2 float :offset 160)
(frame-interp2 float :offset 152)
)
:method-count-assert 11
:size-assert #xc0
:flag-assert #xb000000c0
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-9 (_type_) none 9)
(dummy-10 (_type_ symbol) int 10)
)
)

View file

@ -135,7 +135,7 @@
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (-> obj _data))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)

View file

@ -413,7 +413,7 @@
(dummy-32 () none 32)
(dummy-33 () none 33)
(dummy-34 () none 34)
(dummy-35 () none 35)
(dummy-35 (_type_) none 35)
(dummy-36 () none 36)
(dummy-37 () none 37)
(dummy-38 () none 38)
@ -422,11 +422,11 @@
(dummy-41 () none 41)
(dummy-42 () none 42)
(dummy-43 () none 43)
(dummy-44 () none 44)
(dummy-45 () none 45)
(dummy-44 (_type_) none 44)
(dummy-45 (_type_) none 45)
(dummy-46 () none 46)
(dummy-47 () none 47)
(dummy-48 () none 48)
(dummy-47 (_type_) none 47)
(dummy-48 (_type_) none 48)
(dummy-49 () none 49)
(dummy-50 () none 50)
(dummy-51 () none 51)

View file

@ -40,9 +40,17 @@
;; definition of type control-info
(deftype control-info (collide-shape-moving)
((array-size int16 :offset 2490)
(history-array collide-history 128 :inline :offset-assert 2496)
(pad uint32 27 :offset-assert 18880)
((unknown-vector00 vector :inline :offset 576)
(unknown-surface surface :offset 660)
(unknown-symbol symbol :offset 664)
(unknown-qword uint128 :offset 1136)
(unknown-vector10 vector :inline :offset 1216)
(unknown-vector11 vector :inline :offset 1232)
(unknown-vector12 vector :inline :offset 1248)
(unknown-vector13 vector :inline :offset 1264)
(history-length int16 :offset 2490)
(history-data collide-history 128 :inline :offset-assert 2496)
(pad uint32 27 :offset-assert 18880)
)
:method-count-assert 65
:size-assert #x4a2c

View file

@ -295,8 +295,8 @@
:size-assert #x20
:flag-assert #xf00000020
(:methods
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-13 (_type_) int 13)
(dummy-14 (_type_) int 14)
)
)
@ -388,7 +388,7 @@
:size-assert #x21
:flag-assert #xa00000021
(:methods
(dummy-9 () none 9)
(dummy-9 (_type_) _type_ 9)
)
)
@ -447,9 +447,10 @@
:size-assert #xbc
:flag-assert #xc000000bc
(:methods
(new (symbol type process art-joint-geo) _type_ 0)
(dummy-9 (_type_) (pointer int8) 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-10 (_type_ int int) int 10)
(dummy-11 (_type_ pointer) int 11)
)
)

View file

@ -22,7 +22,7 @@
(data-base pointer :offset-assert 12)
(data-top pointer :offset-assert 16)
(data-size int32 :offset-assert 20)
(extra basic :offset-assert 24)
(extra entity-links :offset-assert 24)
(tag (pointer res-tag) :offset-assert 28)
)
:method-count-assert 22

View file

@ -3,7 +3,7 @@
;; definition of type drawable-actor
(deftype drawable-actor (drawable)
((actor basic :offset 8)
((actor entity-actor :offset 8)
)
:method-count-assert 18
:size-assert #x20

View file

@ -3,7 +3,7 @@
;; definition of type drawable-ambient
(deftype drawable-ambient (drawable)
((ambient basic :offset 8)
((ambient entity-ambient :offset 8)
)
:method-count-assert 19
:size-assert #x20

View file

@ -16,7 +16,7 @@
(dummy-12 (_type_ int) none 12)
(dummy-13 (_type_ int) none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-15 (_type_) none 15)
(dummy-16 (_type_ object object) object 16)
(dummy-17 () none 17)
)

View file

@ -12,7 +12,7 @@
)
(else
(format 0 "no cspace (~A)~%" arg1)
(the-as cspace (-> arg0 node-list _data))
(the-as cspace (-> arg0 node-list data))
)
)
)

View file

@ -120,16 +120,10 @@
)
(set! (-> obj process) proc)
(let ((ent (-> proc entity)))
(set!
(-> obj next)
(entity-actor-lookup (the-as res-lump ent) 'next-actor 0)
)
(set! (-> obj next) (entity-actor-lookup ent 'next-actor 0))
)
(let ((a0-2 (-> proc entity)))
(set!
(-> obj prev)
(entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0)
)
(set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0))
)
obj
)
@ -166,16 +160,10 @@
;; definition for method 11 of type actor-link-info
(defmethod link actor-link-info ((obj actor-link-info))
(let ((a0-1 (-> obj process entity)))
(set!
(-> obj next)
(entity-actor-lookup (the-as res-lump a0-1) 'next-actor 0)
)
(set! (-> obj next) (entity-actor-lookup a0-1 'next-actor 0))
)
(let ((a0-2 (-> obj process entity)))
(set!
(-> obj prev)
(entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0)
)
(set! (-> obj prev) (entity-actor-lookup a0-2 'prev-actor 0))
)
(-> obj next)
)
@ -228,16 +216,16 @@
)
(let ((s4-0 (-> obj process entity)))
(while (let ((a0-2 s4-0))
(entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0)
(entity-actor-lookup a0-2 'prev-actor 0)
)
(set! s4-0 (entity-actor-lookup (the-as res-lump s4-0) 'prev-actor 0))
(set! s4-0 (entity-actor-lookup s4-0 'prev-actor 0))
)
(while s4-0
(if (arg0 (the-as entity-actor s4-0) arg1)
(return (the-as int #f))
)
(let ((a0-4 s4-0))
(set! s4-0 (entity-actor-lookup (the-as res-lump a0-4) 'next-actor 0))
(set! s4-0 (entity-actor-lookup a0-4 'next-actor 0))
)
)
)
@ -318,14 +306,14 @@
(count 0)
)
(while (let ((a0-2 actor))
(entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0)
(entity-actor-lookup a0-2 'prev-actor 0)
)
(set! actor (entity-actor-lookup (the-as res-lump actor) 'prev-actor 0))
(set! actor (entity-actor-lookup actor 'prev-actor 0))
)
(while actor
(+! count 1)
(let ((a0-3 actor))
(set! actor (entity-actor-lookup (the-as res-lump a0-3) 'next-actor 0))
(set! actor (entity-actor-lookup a0-3 'next-actor 0))
)
)
count
@ -367,14 +355,14 @@
(count 0)
)
(while (let ((a0-2 actor))
(entity-actor-lookup (the-as res-lump a0-2) 'prev-actor 0)
(entity-actor-lookup a0-2 'prev-actor 0)
)
(set! actor (entity-actor-lookup (the-as res-lump actor) 'prev-actor 0))
(set! actor (entity-actor-lookup actor 'prev-actor 0))
)
(while (!= actor this-actor)
(+! count 1)
(let ((a0-3 actor))
(set! actor (entity-actor-lookup (the-as res-lump a0-3) 'next-actor 0))
(set! actor (entity-actor-lookup a0-3 'next-actor 0))
)
)
count
@ -423,22 +411,12 @@
;; definition for function alt-actor-list-subtask-incomplete-count
(defun alt-actor-list-subtask-incomplete-count ((arg0 process-drawable))
(let
((alt-actor-count
(entity-actor-count (the-as res-lump (-> arg0 entity)) 'alt-actor)
)
(incomplete-count 0)
)
(let ((alt-actor-count (entity-actor-count (-> arg0 entity) 'alt-actor))
(incomplete-count 0)
)
(dotimes (alt-actor-idx alt-actor-count)
(let
((a0-3
(entity-actor-lookup
(the-as res-lump (-> arg0 entity))
'alt-actor
alt-actor-idx
)
)
)
((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor alt-actor-idx)))
(if
(or
(not a0-3)

View file

@ -276,7 +276,7 @@
;; failed to figure out what this is:
(if (zero? entity-nav-login)
(set! entity-nav-login (the-as (function basic none) nothing))
(set! entity-nav-login (the-as (function entity-actor none) nothing))
)
;; definition of type actor-bank

View file

@ -271,7 +271,7 @@
(the-as
(pointer int32)
((method-of-type res-lump get-property-data)
(the-as res-lump ent)
ent
'eco-info
'interp
0.0
@ -310,7 +310,7 @@
(the-as
uint
((method-of-type res-lump get-property-value)
(the-as res-lump ent)
ent
'options
'interp
-1000000000.0
@ -332,7 +332,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump ent)
ent
'timeout
'interp
-1000000000.0
@ -382,7 +382,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'speed
'interp
-1000000000.0
@ -397,7 +397,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'idle-distance
'interp
-1000000000.0
@ -412,7 +412,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'notice-top
'interp
-1000000000.0
@ -427,7 +427,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'notice-bottom
'interp
-1000000000.0
@ -442,7 +442,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'cam-horz
'interp
-1000000000.0
@ -457,7 +457,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'cam-vert
'interp
-1000000000.0
@ -472,7 +472,7 @@
(the-as
float
((method-of-type res-lump get-property-value-float)
(the-as res-lump entity)
entity
'cam-notice-dist
'interp
-1000000000.0

View file

@ -3,33 +3,33 @@
;; definition of type process-drawable
(deftype process-drawable (process)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel joint-control :offset-assert 124)
(nav basic :offset-assert 128)
(align align-control :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact fact-info :offset-assert 144)
(link basic :offset-assert 148)
(part basic :offset-assert 152)
(water water-control :offset-assert 156)
(sound ambient-sound :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
((root trsqv :offset-assert 112)
(node-list cspace-array :offset-assert 116)
(draw draw-control :offset-assert 120)
(skel joint-control :offset-assert 124)
(nav basic :offset-assert 128)
(align align-control :offset-assert 132)
(path basic :offset-assert 136)
(vol basic :offset-assert 140)
(fact fact-info :offset-assert 144)
(link basic :offset-assert 148)
(part sparticle-launch-control :offset-assert 152)
(water water-control :offset-assert 156)
(sound ambient-sound :offset-assert 160)
(state-flags uint32 :offset-assert 164)
(state-time uint64 :offset-assert 168)
)
:heap-base #x40
:method-count-assert 20
:size-assert #xb0
:flag-assert #x14004000b0
(:methods
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-14 (_type_ skeleton-group object) none 14)
(dummy-15 (_type_ string object) _type_ 15)
(dummy-16 (_type_ int (inline-array vector) vector) collide-shape 16)
(dummy-17 (_type_) none 17)
(dummy-18 (_type_) symbol 18)
(dummy-19 (_type_) none 19)
)
)

View file

@ -49,10 +49,10 @@
;; definition of type level-buffer-state
(deftype level-buffer-state (structure)
((name basic :offset-assert 0)
(display? basic :offset-assert 4)
(force-vis? basic :offset-assert 8)
(force-inside? basic :offset-assert 12)
((name basic :offset-assert 0)
(display? symbol :offset-assert 4)
(force-vis? symbol :offset-assert 8)
(force-inside? symbol :offset-assert 12)
)
:pack-me
:method-count-assert 9
@ -73,9 +73,9 @@
;; definition of type load-state
(deftype load-state (basic)
((want level-buffer-state 2 :inline :offset-assert 4)
(vis-nick basic :offset-assert 36)
(vis-nick symbol :offset-assert 36)
(command-list pair :offset-assert 40)
(object-name basic 256 :offset-assert 44)
(object-name symbol 256 :offset-assert 44)
(object-status basic 256 :offset-assert 1068)
)
:method-count-assert 21
@ -84,11 +84,11 @@
(:methods
(new (symbol type) _type_ 0)
(reset! (_type_) _type_ 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(update! (_type_) int 10)
(want-levels (_type_ symbol symbol) int 11)
(want-display-level (_type_ symbol symbol) int 12)
(want-vis (_type_ symbol) int 13)
(want-force-vis (_type_ symbol symbol) int 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
@ -215,12 +215,12 @@
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_) none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-17 (_type_) continue-point 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-19 (_type_ continue-point) none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)

View file

@ -100,29 +100,20 @@
)
)
(set! (-> (the-as vol-control gp-0) process) arg0)
(let* ((s5-1 (-> (the-as vol-control gp-0) process entity))
(s4-0
(->
((method-of-type res-lump lookup-tag-idx)
(the-as res-lump s5-1)
'vol
'exact
0.0
)
lo
)
)
)
(let*
((s5-1 (the-as res-lump (-> (the-as vol-control gp-0) process entity)))
(s4-0 (-> (lookup-tag-idx (the-as entity s5-1) 'vol 'exact 0.0) lo))
)
(when (>= s4-0 0)
(let ((s3-0 s4-0)
(s2-0 (-> (the-as res-lump s5-1) tag s4-0))
(s2-0 (-> s5-1 tag s4-0))
)
0
(while (= (-> s2-0 name) (-> (the-as res-lump s5-1) tag s4-0 name))
(while (= (-> s2-0 name) (-> s5-1 tag s4-0 name))
(let
((v1-12
(make-property-data
(the-as res-lump s5-1)
s5-1
0.0
(the-as res-tag-pair s3-0)
(the-as pointer #f)
@ -144,34 +135,25 @@
(+ (-> (the-as vol-control gp-0) pos-vol-count) 1)
)
(+! s3-0 1)
(set! s2-0 (-> (the-as res-lump s5-1) tag s3-0))
(set! s2-0 (-> s5-1 tag s3-0))
)
)
)
)
(let* ((s5-2 (-> (the-as vol-control gp-0) process entity))
(s4-1
(->
((method-of-type res-lump lookup-tag-idx)
(the-as res-lump s5-2)
'cutoutvol
'exact
0.0
)
lo
)
)
)
(let*
((s5-2 (the-as res-lump (-> (the-as vol-control gp-0) process entity)))
(s4-1 (-> (lookup-tag-idx (the-as entity s5-2) 'cutoutvol 'exact 0.0) lo))
)
(when (>= s4-1 0)
(let ((s3-1 s4-1)
(s2-1 (-> (the-as res-lump s5-2) tag s4-1))
(s2-1 (-> s5-2 tag s4-1))
)
0
(while (= (-> s2-1 name) (-> (the-as res-lump s5-2) tag s4-1 name))
(while (= (-> s2-1 name) (-> s5-2 tag s4-1 name))
(let
((v1-31
(make-property-data
(the-as res-lump s5-2)
s5-2
0.0
(the-as res-tag-pair s3-1)
(the-as pointer #f)
@ -193,7 +175,7 @@
(+ (-> (the-as vol-control gp-0) neg-vol-count) 1)
)
(+! s3-1 1)
(set! s2-1 (-> (the-as res-lump s5-2) tag s3-1))
(set! s2-1 (-> s5-2 tag s3-1))
)
)
)

View file

@ -268,14 +268,14 @@
;; definition of type ocean-map
(deftype ocean-map (basic)
((start-corner vector :inline :offset-assert 16)
(far-color vector :inline :offset-assert 32)
(ocean-spheres ocean-spheres :offset-assert 48)
(ocean-colors ocean-colors :offset-assert 52)
(ocean-mid-indices basic :offset-assert 56)
(ocean-trans-indices basic :offset-assert 60)
(ocean-near-indices basic :offset-assert 64)
(ocean-mid-masks basic :offset-assert 68)
((start-corner vector :inline :offset-assert 16)
(far-color vector :inline :offset-assert 32)
(ocean-spheres ocean-spheres :offset-assert 48)
(ocean-colors ocean-colors :offset-assert 52)
(ocean-mid-indices ocean-mid-indices :offset-assert 56)
(ocean-trans-indices ocean-trans-indices :offset-assert 60)
(ocean-near-indices ocean-near-indices :offset-assert 64)
(ocean-mid-masks ocean-mid-masks :offset-assert 68)
)
:method-count-assert 9
:size-assert #x48

View file

@ -73,7 +73,7 @@
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-20 (_type_ texture-page) int 20)
(upload-one-common! (_type_) symbol 21)
(lookup-boot-common-id (_type_ int) int 22)
)
@ -115,7 +115,7 @@
(dest uint16 7 :offset-assert 14)
(clutdest uint16 :offset-assert 28)
(width uint8 7 :offset-assert 30)
(name basic :offset-assert 40)
(name string :offset-assert 40)
(size uint32 :offset-assert 44)
(uv-dist float :offset-assert 48)
(masks uint32 3 :offset-assert 52)
@ -271,13 +271,13 @@
:size-assert #x14
:flag-assert #xa00000014
(:methods
(dummy-9 () none 9)
(dummy-9 (_type_ kheap) int 9)
)
)
;; definition of type texture-relocate-later
(deftype texture-relocate-later (basic)
((memcpy basic :offset-assert 4)
((memcpy symbol :offset-assert 4)
(dest uint32 :offset-assert 8)
(source uint32 :offset-assert 12)
(move uint32 :offset-assert 16)
@ -348,7 +348,8 @@
;; definition of type adgif-shader-array
(deftype adgif-shader-array (inline-array-class)
()
((data adgif-shader :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
@ -359,7 +360,7 @@
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (-> obj _data))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)

View file

@ -60,8 +60,8 @@
:size-assert #x190
:flag-assert #x1400000190
(:methods
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-18 (_type_) none 18)
(dummy-19 (_type_) none 19)
)
)

View file

@ -4,7 +4,7 @@
;; definition of type water-control
(deftype water-control (basic)
((flags uint32 :offset-assert 4)
(process basic :offset-assert 8)
(process process :offset-assert 8)
(joint-index int32 :offset-assert 12)
(top-y-offset float :offset-assert 16)
(ripple-size float :offset-assert 20)

View file

@ -3,19 +3,19 @@
;; definition of type level-vis-info
(deftype level-vis-info (basic)
((level basic :offset-assert 4)
(from-level basic :offset-assert 8)
(from-bsp basic :offset-assert 12)
(flags uint32 :offset-assert 16)
(length uint32 :offset-assert 20)
(allocated-length uint32 :offset-assert 24)
(dictionary-length uint32 :offset-assert 28)
(dictionary uint32 :offset-assert 32)
(string-block uint32 :offset-assert 36)
(ramdisk uint32 :offset-assert 40)
(vis-bits uint32 :offset-assert 44)
(current-vis-string uint32 :offset-assert 48)
(vis-string uint8 :dynamic :offset-assert 52)
((level symbol :offset-assert 4)
(from-level symbol :offset-assert 8)
(from-bsp bsp-header :offset-assert 12)
(flags uint32 :offset-assert 16)
(length uint32 :offset-assert 20)
(allocated-length uint32 :offset-assert 24)
(dictionary-length uint32 :offset-assert 28)
(dictionary uint32 :offset-assert 32)
(string-block uint32 :offset-assert 36)
(ramdisk uint32 :offset-assert 40)
(vis-bits pointer :offset-assert 44)
(current-vis-string uint32 :offset-assert 48)
(vis-string uint8 :dynamic :offset-assert 52)
)
:method-count-assert 9
:size-assert #x34
@ -85,7 +85,7 @@
;; definition for method 3 of type level-load-info
(defmethod inspect level-load-info ((obj level-load-info))
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tname-list[3] @ #x~X~%" (-> obj name-list))
(format #t "~Tname-list[3] @ #x~X~%" (&-> obj name))
(format #t "~Tindex: ~D~%" (-> obj index))
(format #t "~Tname: ~A~%" (-> obj name))
(format #t "~Tvisname: ~A~%" (-> obj visname))
@ -150,7 +150,7 @@
(art-group load-dir-art-group :offset-assert 52)
(info level-load-info :offset-assert 56)
(texture-page texture-page 9 :offset-assert 60)
(loaded-texture-page basic 16 :offset-assert 96)
(loaded-texture-page texture-page 16 :offset-assert 96)
(loaded-texture-page-count int32 :offset-assert 160)
(foreground-sink-group dma-foreground-sink-group 3 :inline :offset-assert 176)
(foreground-draw-engine engine 3 :offset-assert 272)
@ -165,7 +165,7 @@
(meta-inside? symbol :offset-assert 380)
(mood mood-context :offset-assert 384)
(mood-func function :offset-assert 388)
(vis-bits uint32 :offset-assert 392)
(vis-bits pointer :offset-assert 392)
(all-visible? symbol :offset-assert 396)
(force-all-visible? symbol :offset-assert 400)
(linking basic :offset-assert 404)
@ -175,8 +175,8 @@
(vis-buffer uint8 2048 :offset-assert 448)
(mem-usage-block basic :offset-assert 2496)
(mem-usage int32 :offset-assert 2500)
(code-memory-start uint32 :offset-assert 2504)
(code-memory-end uint32 :offset-assert 2508)
(code-memory-start pointer :offset-assert 2504)
(code-memory-end pointer :offset-assert 2508)
(texture-mask uint32 9 :offset-assert 2512)
(force-inside? symbol :offset-assert 2548)
(pad uint8 56 :offset-assert 2552)
@ -185,26 +185,26 @@
:size-assert #xa30
:flag-assert #x1d00000a30
(:methods
(dummy-9 () none 9)
(dummy-10 () none 10)
(deactivate (_type_) _type_ 9)
(dummy-10 (_type_ int) symbol 10)
(dummy-11 (_type_) none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 () none 17)
(dummy-18 () none 18)
(dummy-19 () none 19)
(dummy-20 () none 20)
(dummy-21 () none 21)
(dummy-22 () none 22)
(dummy-23 (_type_ symbol) none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(dummy-27 () none 27)
(dummy-28 (_type_ string) symbol 28)
(unload! (_type_) _type_ 12)
(bsp-name (_type_) symbol 13)
(dummy-14 (_type_) none 14)
(dummy-15 (_type_ vector) symbol 15)
(dummy-16 (_type_) none 16)
(load-continue (_type_) _type_ 17)
(load-begin (_type_) _type_ 18)
(login (_type_) _type_ 19)
(vis-load (_type_) uint 20)
(dummy-21 (_type_) none 21)
(activate (_type_) _type_ 22)
(level-status-set! (_type_ symbol) _type_ 23)
(dummy-24 (_type_) _type_ 24)
(dummy-25 (_type_) int 25)
(vis-clear (_type_) int 26)
(dummy-27 (_type_ vector string) none 27)
(art-group-get-by-name (_type_ string) art-group 28)
)
)
@ -271,42 +271,43 @@
((length int32 :offset-assert 4)
(unknown-level-1 level :offset-assert 8)
(unknown-level-2 level :offset-assert 12)
(entity-link entity-links :offset 16)
(entity-link entity-links :offset-assert 16)
(border? basic :offset-assert 20)
(vis? basic :offset-assert 24)
(want-level basic :offset-assert 28)
(receiving-level basic :offset-assert 32)
(load-commands pair :offset-assert 36)
(play? basic :offset-assert 40)
(hack-pad uint8 :offset 90)
(play? symbol :offset-assert 40)
(_hack-pad uint8 :offset 90)
(level0 level :inline :offset-assert 96)
(level1 level :inline :offset-assert 2704)
(level-default level :inline :offset-assert 5312)
(level level 3 :inline :offset 96)
(data level 3 :inline :offset 96)
(pad uint32 :offset-assert 7920)
)
:method-count-assert 27
:size-assert #x1ef4
:flag-assert #x1b00001ef4
(:methods
(dummy-9 (_type_ symbol) level 9)
(dummy-10 (_type_ symbol) symbol 10)
(dummy-11 (_type_ symbol symbol) level 11)
(dummy-12 (_type_) none 12)
(level-get (_type_ symbol) level 9)
(level-get-with-status (_type_ symbol) level 10)
(level-get-for-use (_type_ symbol symbol) level 11)
(activate-levels! (_type_) int 12)
(dummy-13 () none 13)
(dummy-14 () none 14)
(dummy-15 () none 15)
(dummy-16 () none 16)
(dummy-17 (_type_) none 17)
(dummy-18 (_type_ symbol) none 18)
(dummy-19 (_type_ pair) none 19)
(dummy-20 () none 20)
(dummy-21 (_type_ level-group int) pair 21)
(dummy-16 (_type_) int 16)
(level-get-target-inside (_type_) level 17)
(alloc-levels! (_type_ symbol) int 18)
(load-commands-set! (_type_ pair) pair 19)
(art-group-get-by-name (_type_ string) art-group 20)
(load-command-get-index (_type_ symbol int) pair 21)
(dummy-22 () none 22)
(dummy-23 () none 23)
(dummy-24 () none 24)
(dummy-25 () none 25)
(dummy-26 () none 26)
(level-status (_type_ symbol) symbol 25)
(level-get-most-disposable (_type_) level 26)
)
)

View file

@ -5,9 +5,10 @@
(define
training
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'training 'training-vis 'tra)
:index 1
:name 'training
:visname 'training-vis
:nickname 'tra
:packages '(training)
:sound-banks '(training)
:music-bank 'village1
@ -232,9 +233,10 @@
(define
village1
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'village1 'village1-vis 'vi1)
:index 2
:name 'village1
:visname 'village1-vis
:nickname 'vi1
:packages '(village1)
:sound-banks '(village1)
:music-bank 'village1
@ -461,9 +463,10 @@
(define
beach
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'beach 'beach-vis 'bea)
:index 3
:name 'beach
:visname 'beach-vis
:nickname 'bea
:packages '(beach)
:sound-banks '(beach)
:music-bank 'beach
@ -525,9 +528,10 @@
(define
jungle
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'jungle 'jungle-vis 'jun)
:index 4
:name 'jungle
:visname 'jungle-vis
:nickname 'jun
:packages '(jungle)
:sound-banks '(jungle)
:music-bank 'jungle
@ -592,9 +596,10 @@
(define
jungleb
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'jungleb 'jungleb-vis 'jub)
:index 5
:name 'jungleb
:visname 'jungleb-vis
:nickname 'jub
:packages '(jungleb)
:sound-banks '(jungleb)
:music-bank 'jungleb
@ -651,9 +656,10 @@
(define
misty
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'misty 'misty-vis 'mis)
:index 6
:name 'misty
:visname 'misty-vis
:nickname 'mis
:packages '(misty)
:sound-banks '(misty)
:music-bank 'misty
@ -1042,9 +1048,10 @@
(define
firecanyon
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'firecanyon 'firecanyon-vis 'fic)
:index 7
:name 'firecanyon
:visname 'firecanyon-vis
:nickname 'fic
:packages '(firecanyon)
:sound-banks '(firecanyon)
:music-bank 'firecanyon
@ -1133,9 +1140,10 @@
(define
village2
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'village2 'village2-vis 'vi2)
:index 8
:name 'village2
:visname 'village2-vis
:nickname 'vi2
:packages '(village2)
:sound-banks '(village2)
:music-bank 'village2
@ -1253,9 +1261,10 @@
(define
sunken
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'sunken 'sunken-vis 'sun)
:index 9
:name 'sunken
:visname 'sunken-vis
:nickname 'sun
:packages '(sunken)
:sound-banks '(sunken)
:music-bank 'sunken
@ -1397,9 +1406,10 @@
(define
sunkenb
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'sunkenb 'sunkenb-vis 'sub)
:index 10
:name 'sunkenb
:visname 'sunkenb-vis
:nickname 'sub
:packages '()
:sound-banks '(sunken)
:music-bank 'sunken
@ -1484,9 +1494,10 @@
(define
swamp
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'swamp 'swamp-vis 'swa)
:index 11
:name 'swamp
:visname 'swamp-vis
:nickname 'swa
:packages '(swamp)
:sound-banks '(swamp)
:music-bank 'swamp
@ -1848,9 +1859,10 @@
(define
rolling
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'rolling 'rolling-vis 'rol)
:index 12
:name 'rolling
:visname 'rolling-vis
:nickname 'rol
:packages '(rolling)
:sound-banks '(rolling)
:music-bank 'rolling
@ -1911,9 +1923,10 @@
(define
ogre
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'ogre 'ogre-vis 'ogr)
:index 13
:name 'ogre
:visname 'ogre-vis
:nickname 'ogr
:packages '(ogre)
:sound-banks '(ogre)
:music-bank 'ogre
@ -2030,9 +2043,10 @@
(define
village3
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'village3 'village3-vis 'vi3)
:index 14
:name 'village3
:visname 'village3-vis
:nickname 'vi3
:packages '(village3)
:sound-banks '(village3)
:music-bank 'village3
@ -2150,9 +2164,10 @@
(define
snow
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'snow 'snow-vis 'sno)
:index 15
:name 'snow
:visname 'snow-vis
:nickname 'sno
:packages '(snow)
:sound-banks '(snow)
:music-bank 'snow
@ -2438,9 +2453,10 @@
(define
maincave
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'maincave 'maincave-vis 'mai)
:index 16
:name 'maincave
:visname 'maincave-vis
:nickname 'mai
:packages '(maincave)
:sound-banks '(maincave)
:music-bank 'maincave
@ -2557,9 +2573,10 @@
(define
darkcave
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'darkcave 'darkcave-vis 'dar)
:index 17
:name 'darkcave
:visname 'darkcave-vis
:nickname 'dar
:packages '(darkcave)
:sound-banks '(darkcave)
:music-bank 'maincave
@ -2617,9 +2634,10 @@
(define
robocave
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'robocave 'robocave-vis 'rob)
:index 18
:name 'robocave
:visname 'robocave-vis
:nickname 'rob
:packages '(robocave)
:sound-banks '(robocave)
:music-bank 'maincave
@ -2705,9 +2723,10 @@
(define
lavatube
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'lavatube 'lavatube-vis 'lav)
:index 19
:name 'lavatube
:visname 'lavatube-vis
:nickname 'lav
:packages '(lavatube)
:sound-banks '(lavatube)
:music-bank 'lavatube
@ -2852,9 +2871,10 @@
(define
citadel
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'citadel 'citadel-vis 'cit)
:index 20
:name 'citadel
:visname 'citadel-vis
:nickname 'cit
:packages '(citadel)
:sound-banks '(citadel)
:music-bank 'citadel
@ -3168,9 +3188,10 @@
(define
finalboss
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'finalboss 'finalboss-vis 'fin)
:index 21
:name 'finalboss
:visname 'finalboss-vis
:nickname 'fin
:packages '(finalboss)
:sound-banks '(finalboss)
:music-bank 'finalboss
@ -3263,9 +3284,10 @@
(define
intro
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'intro 'intro-vis 'int)
:index 22
:name 'intro
:visname 'intro-vis
:nickname 'int
:packages '(intro)
:sound-banks '()
:music-bank #f
@ -3291,9 +3313,10 @@
(define
demo
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'demo 'demo-vis 'dem)
:index 23
:name 'demo
:visname 'demo-vis
:nickname 'dem
:packages '()
:sound-banks '(village1)
:music-bank 'village1
@ -3349,9 +3372,10 @@
(define
title
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'title 'title-vis 'tit)
:index 24
:name 'title
:visname 'title-vis
:nickname 'tit
:packages '()
:sound-banks '()
:music-bank 'village1
@ -3409,9 +3433,10 @@
(define
halfpipe
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'halfpipe 'halfpipe-vis 'none)
:index 25
:name 'halfpipe
:visname 'halfpipe-vis
:nickname 'none
:packages '()
:sound-banks '()
:music-bank #f
@ -3468,9 +3493,10 @@
(define
default-level
(new 'static 'level-load-info
:name-list
(new 'static 'array symbol 3 'default-level 'default-level-vis 'none)
:index 26
:name 'default-level
:visname 'default-level-vis
:nickname 'none
:packages '()
:sound-banks '()
:music-bank #f

View file

@ -96,7 +96,9 @@
(define *file-temp-string* (new 'global 'string 128 (the-as string #f)))
;; definition for function make-file-name
(defun make-file-name ((kind file-kind) (name string) (art-group-version int))
(defun
make-file-name
((kind file-kind) (name string) (art-group-version int) (arg3 symbol))
(clear *file-temp-string*)
(cond
((= kind (file-kind dir-tpage))

View file

@ -5,9 +5,9 @@
(deftype load-dgo-msg (structure)
((rsvd uint16 :offset-assert 0)
(result load-msg-result :offset-assert 2)
(b1 uint32 :offset-assert 4)
(b2 uint32 :offset-assert 8)
(bt uint32 :offset-assert 12)
(b1 pointer :offset-assert 4)
(b2 pointer :offset-assert 8)
(bt pointer :offset-assert 12)
(name uint128 :offset-assert 16)
(name-chars uint8 16 :offset 16)
(address uint32 :offset 4)
@ -233,15 +233,15 @@
;; Used lq/sq
(defun
dgo-load-begin
((name string) (buffer1 int) (buffer2 int) (current-heap int))
((name string) (buffer1 pointer) (buffer2 pointer) (current-heap pointer))
(set! *dgo-time* (-> *display* real-integral-frame-counter))
(format 0 "Starting level load clock~%")
(sync *load-dgo-rpc* #t)
(let ((cmd (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> cmd result) (load-msg-result invalid))
(set! (-> cmd b1) (the-as uint buffer1))
(set! (-> cmd b2) (the-as uint buffer2))
(set! (-> cmd bt) (the-as uint current-heap))
(set! (-> cmd b1) buffer1)
(set! (-> cmd b2) buffer2)
(set! (-> cmd bt) current-heap)
(set! (-> cmd name) (string->sound-name name))
(call *load-dgo-rpc* (the-as uint 0) (the-as pointer cmd) (the-as uint 32))
cmd
@ -249,7 +249,6 @@
)
;; definition for function dgo-load-get-next
;; INFO: Return type mismatch uint vs pointer.
(defun dgo-load-get-next ((last-object (pointer symbol)))
(set! (-> last-object 0) #t)
(let ((load-location (the-as pointer #f)))
@ -261,7 +260,7 @@
(= (-> response result) (load-msg-result done))
(= (-> response result) (load-msg-result more))
)
(set! load-location (the-as pointer (-> response b1)))
(set! load-location (-> response b1))
)
(if (= (-> response result) (load-msg-result more))
(set! (-> last-object 0) #f)
@ -279,7 +278,7 @@
)
)
)
(the-as pointer load-location)
load-location
)
)
@ -289,9 +288,9 @@
(defun dgo-load-continue ((current-heap pointer))
(let ((cmd (the-as load-dgo-msg (add-element *load-dgo-rpc*))))
(set! (-> cmd result) (load-msg-result invalid))
(set! (-> cmd b1) (the-as uint 0))
(set! (-> cmd b2) (the-as uint 0))
(set! (-> cmd bt) (the-as uint current-heap))
(set! (-> cmd b1) (the-as pointer 0))
(set! (-> cmd b2) (the-as pointer 0))
(set! (-> cmd bt) current-heap)
(set! (-> cmd name) (the-as uint128 0))
(call *load-dgo-rpc* (the-as uint 1) (the-as pointer cmd) (the-as uint 32))
(the-as int cmd)

View file

@ -3,9 +3,9 @@
;; definition of type load-dir
(deftype load-dir (basic)
((unknown basic :offset-assert 4)
(string-array (array string) :offset-assert 8)
(data-array (array art-group) :offset-assert 12)
((unknown basic :offset-assert 4)
(string-array (array string) :offset-assert 8)
(data-array (array basic) :offset-assert 12)
)
:method-count-assert 11
:size-assert #x10
@ -19,7 +19,8 @@
;; definition of type load-dir-art-group
(deftype load-dir-art-group (load-dir)
()
((art-group-array (array art-group) :offset 12)
)
:method-count-assert 11
:size-assert #x10
:flag-assert #xb00000010
@ -50,7 +51,7 @@
(set!
(-> obj data-array)
(the-as
(array art-group)
(array basic)
((method-of-type array new) allocation array basic length)
)
)
@ -76,28 +77,28 @@
(deftype external-art-buffer (basic)
((index int32 :offset-assert 4)
(other external-art-buffer :offset-assert 8)
(status basic :offset-assert 12)
(locked? basic :offset-assert 16)
(frame-lock basic :offset-assert 20)
(status symbol :offset-assert 12)
(locked? symbol :offset-assert 16)
(frame-lock symbol :offset-assert 20)
(heap kheap :inline :offset-assert 32)
(pending-load-file basic :offset-assert 48)
(pending-load-file string :offset-assert 48)
(pending-load-file-part int32 :offset-assert 52)
(pending-load-file-owner uint64 :offset-assert 56)
(pending-load-file-priority float :offset-assert 64)
(load-file basic :offset-assert 68)
(load-file string :offset-assert 68)
(load-file-part int32 :offset-assert 72)
(load-file-owner uint64 :offset-assert 80)
(load-file-priority float :offset-assert 88)
(buf uint32 :offset-assert 92)
(len int32 :offset-assert 96)
(art-group basic :offset-assert 100)
(art-group art-group :offset-assert 100)
)
:method-count-assert 16
:size-assert #x68
:flag-assert #x1000000068
(:methods
(new (symbol type int) _type_ 0)
(dummy-9 () none 9)
(dummy-9 (_type_ symbol int symbol float) none 9)
(dummy-10 () none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
@ -163,7 +164,7 @@
;; definition of type spool-anim
(deftype spool-anim (basic)
((name basic :offset 16)
((name string :offset 16)
(index int32 :offset-assert 20)
(parts int32 :offset-assert 24)
(priority float :offset-assert 28)
@ -205,8 +206,8 @@
:flag-assert #x1100000118
(:methods
(new (symbol type) _type_ 0)
(dummy-9 () none 9)
(dummy-10 () none 10)
(dummy-9 (_type_ symbol) none 9)
(dummy-10 (_type_) none 10)
(dummy-11 () none 11)
(dummy-12 () none 12)
(dummy-13 () none 13)

View file

@ -661,7 +661,8 @@
;; definition of type box8s-array
(deftype box8s-array (inline-array-class)
()
((data box8s :inline :dynamic :offset 16)
)
:method-count-assert 9
:size-assert #x10
:flag-assert #x900000010
@ -672,7 +673,7 @@
(format #t "[~8x] ~A~%" obj (-> obj type))
(format #t "~Tlength: ~D~%" (-> obj length))
(format #t "~Tallocated-length: ~D~%" (-> obj allocated-length))
(format #t "~Tdata[0] @ #x~X~%" (-> obj _data))
(format #t "~Tdata[0] @ #x~X~%" (-> obj data))
obj
)

View file

@ -453,7 +453,11 @@
(when (zero? (-> (the-as entity-actor ent) nav-mesh))
(let
((lookup-entity
(entity-actor-lookup (the-as res-lump ent) 'nav-mesh-actor 0)
(entity-actor-lookup
(the-as entity-actor ent)
'nav-mesh-actor
0
)
)
)
(if lookup-entity
@ -484,7 +488,7 @@
(let
((a3-1
((method-of-type res-lump get-property-value)
(the-as res-lump ent)
ent
'nav-max-users
'interp
-1000000000.0
@ -585,7 +589,7 @@
(set!
(-> obj nearest-y-threshold)
((method-of-type res-lump get-property-value-float)
(the-as res-lump ent)
ent
'nearest-y-threshold
'interp
-1000000000.0

View file

@ -100,11 +100,7 @@
(set! (-> obj name) name)
(let ((ent (-> proc entity)))
(when (= name 'path)
(let
((lookup-entity
(entity-actor-lookup (the-as res-lump ent) 'path-actor 0)
)
)
(let ((lookup-entity (entity-actor-lookup ent 'path-actor 0)))
(if lookup-entity
(set! ent lookup-entity)
)
@ -114,7 +110,7 @@
(let
((data
((method-of-type res-lump get-property-data)
(the-as res-lump ent)
ent
name
'interp
time
@ -182,7 +178,7 @@
)
(set! (-> obj process) proc)
(set! (-> obj name) name)
(let* ((ent (the-as entity (-> proc entity)))
(let* ((ent (-> proc entity))
(v1-2 name)
(s2-0 (cond
((= v1-2 'path)

View file

@ -3,30 +3,30 @@
;; definition of type target
(deftype target (process-drawable)
((control basic :offset 112)
(skel2 basic :offset-assert 176)
(racer basic :offset-assert 180)
(game basic :offset-assert 184)
(neck basic :offset-assert 188)
(state-hook-time uint64 :offset-assert 192)
(state-hook basic :offset-assert 200)
(cam-user-mode basic :offset-assert 204)
(sidekick uint32 :offset-assert 208)
(manipy uint32 :offset-assert 212)
(attack-info attack-info :inline :offset-assert 224)
(attack-info-rec attack-info :inline :offset-assert 336)
(anim-seed uint64 :offset-assert 440)
(alt-cam-pos vector :inline :offset-assert 448)
(snowball basic :offset-assert 464)
(tube basic :offset-assert 468)
(flut basic :offset-assert 472)
(current-level basic :offset-assert 476)
(saved-pos transformq :inline :offset-assert 480)
(saved-owner uint64 :offset-assert 528)
(alt-neck-pos vector :inline :offset-assert 544)
(fp-hud uint64 :offset-assert 560)
(no-load-wait uint64 :offset-assert 568)
(no-look-around-wait uint64 :offset-assert 576)
((control control-info :offset 112)
(skel2 basic :offset-assert 176)
(racer basic :offset-assert 180)
(game game-info :offset-assert 184)
(neck joint-mod :offset-assert 188)
(state-hook-time uint64 :offset-assert 192)
(state-hook function :offset-assert 200)
(cam-user-mode symbol :offset-assert 204)
(sidekick uint32 :offset-assert 208)
(manipy uint32 :offset-assert 212)
(attack-info attack-info :inline :offset-assert 224)
(attack-info-rec attack-info :inline :offset-assert 336)
(anim-seed uint64 :offset-assert 440)
(alt-cam-pos vector :inline :offset-assert 448)
(snowball basic :offset-assert 464)
(tube basic :offset-assert 468)
(flut basic :offset-assert 472)
(current-level level :offset-assert 476)
(saved-pos transformq :inline :offset-assert 480)
(saved-owner uint64 :offset-assert 528)
(alt-neck-pos vector :inline :offset-assert 544)
(fp-hud uint64 :offset-assert 560)
(no-load-wait uint64 :offset-assert 568)
(no-look-around-wait uint64 :offset-assert 576)
)
:heap-base #x1e0
:method-count-assert 21
@ -42,7 +42,7 @@
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tcontrol: ~A~%" (-> obj root))
(format #t "~T~Tcontrol: ~A~%" (-> obj control))
(format #t "~T~Tskel2: ~A~%" (-> obj skel2))
(format #t "~T~Tracer: ~A~%" (-> obj racer))
(format #t "~T~Tgame: ~A~%" (-> obj game))
@ -78,9 +78,9 @@
;; definition of type sidekick
(deftype sidekick (process-drawable)
((control basic :offset 112)
(anim-seed uint64 :offset 192)
(shadow-in-movie? basic :offset-assert 200)
((control control-info :offset 112)
(anim-seed uint64 :offset 192)
(shadow-in-movie? basic :offset-assert 200)
)
:heap-base #x60
:method-count-assert 20