mirror of
https://github.com/open-goal/jak-project
synced 2026-08-31 17:43:06 -04:00
[decompile] subdivide, wind-work, tie-work, bsp, focus (#1897)
- decompile `subdivide`, `wind-work`, `tie-work`, `bsp`, `focus` - support `ppacb` in compiler - don't assert when bitfield stuff fails due to constant propgataion weirdness - finish up history - div/mod unsigned assert fix in decompiler - empty assert fix in decompiler for failed `add` type prop - make jak 1 performance counters "work" (just measure time) - fix cast/typos on pcgtb/vftoi15
This commit is contained in:
@@ -31,12 +31,13 @@ const std::map<InstructionKind, OpenGOALAsm::Function> MIPS_ASM_TO_OPEN_GOAL_FUN
|
||||
|
||||
// Parallel Pack
|
||||
{InstructionKind::PPACH, {".ppach", {MOD::QWORD_CAST}}},
|
||||
{InstructionKind::PPACB, {".ppacb", {MOD::QWORD_CAST}}},
|
||||
|
||||
// Parallel Compares
|
||||
{InstructionKind::PCEQB, {".pceqb", {}}},
|
||||
// {InstructionKind::PCEQH, {".pceqh", {}}},
|
||||
{InstructionKind::PCEQW, {".pceqw", {}}},
|
||||
// {InstructionKind::PCGTB, {".pcgtb", {}}},
|
||||
{InstructionKind::PCGTB, {".pcgtb", {}}},
|
||||
// {InstructionKind::PCGTH, {".pcgth", {}}},
|
||||
{InstructionKind::PCGTW, {".pcgtw", {}}},
|
||||
|
||||
@@ -151,6 +152,7 @@ const std::map<InstructionKind, OpenGOALAsm::Function> MIPS_ASM_TO_OPEN_GOAL_FUN
|
||||
{InstructionKind::VITOF12, {"vitof12.xyzw", {MOD::DEST_MASK}}},
|
||||
{InstructionKind::VFTOI12, {"vftoi12.xyzw", {MOD::DEST_MASK}}},
|
||||
{InstructionKind::VITOF15, {"vitof15.xyzw", {MOD::DEST_MASK}}},
|
||||
{InstructionKind::VFTOI15, {"vftoi15.xyzw", {MOD::DEST_MASK}}},
|
||||
|
||||
//// Status Checks
|
||||
{InstructionKind::VCLIP, {"TODO.VCLIP", {}}},
|
||||
|
||||
@@ -320,10 +320,13 @@ std::optional<BitFieldDef> get_bitfield_initial_set(Form* form,
|
||||
int right = 0;
|
||||
int size = 64 - left;
|
||||
int offset = left - right;
|
||||
auto f = find_field(ts, type, offset + offset_in_bitfield, size, {});
|
||||
auto f = try_find_field(ts, type, offset + offset_in_bitfield, size, {});
|
||||
if (!f) {
|
||||
return {};
|
||||
}
|
||||
BitFieldDef def;
|
||||
def.value = value;
|
||||
def.field_name = f.name();
|
||||
def.field_name = f->name();
|
||||
def.is_signed = false; // we don't know.
|
||||
return def;
|
||||
}
|
||||
|
||||
@@ -7484,9 +7484,13 @@
|
||||
|
||||
(res 48)
|
||||
|
||||
(bsp-leaf-vis-self 62)
|
||||
(bsp-leaf-vis-adj 63)
|
||||
(bsp-main 58)
|
||||
(bsp-misc 59)
|
||||
(bsp-node 60)
|
||||
(bsp-leaf-vis-self 61)
|
||||
(bsp-leaf-vis-adj 62)
|
||||
|
||||
(pat 64)
|
||||
(level-code 65)
|
||||
(entity-links 66)
|
||||
|
||||
@@ -7495,14 +7499,19 @@
|
||||
(joint-anim-compressed-control 69)
|
||||
(joint-anim-fixed 70)
|
||||
(joint-anim-frame 71)
|
||||
|
||||
(subtitle 72)
|
||||
(art-group 73)
|
||||
(art-mesh-anim 74)
|
||||
(art-mesh-geo 75)
|
||||
(art-joint-geo 76)
|
||||
(art-joint-anim 77)
|
||||
(merc-ctrl 78)
|
||||
(joint-anim-drawable 79)
|
||||
(blend-shape 80)
|
||||
|
||||
(joint-anim-drawable 78)
|
||||
(texture 82)
|
||||
|
||||
(array 84)
|
||||
|
||||
(eye-anim 111)
|
||||
)
|
||||
@@ -12268,9 +12277,19 @@
|
||||
;; prototype-h ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defenum prototype-flags
|
||||
:bitfield #t
|
||||
:type uint16
|
||||
(disable 0)
|
||||
(tpage-alpha 2)
|
||||
(vanish 3)
|
||||
(tpage-water 7)
|
||||
|
||||
)
|
||||
|
||||
(deftype prototype-bucket (basic)
|
||||
((name string :offset-assert 4) ;; guessed by decompiler
|
||||
(flags uint16 :offset-assert 8) ;; uint32
|
||||
(flags prototype-flags :offset-assert 8) ;; uint32
|
||||
(texture-masks-index uint16 :offset-assert 10)
|
||||
(in-level uint16 :offset-assert 12)
|
||||
(utextures uint16 :offset-assert 14)
|
||||
@@ -16793,6 +16812,7 @@
|
||||
:method-count-assert 14
|
||||
:size-assert #x34
|
||||
:flag-assert #xe00000034
|
||||
:pack-me
|
||||
(:methods
|
||||
(perf-stat-method-9 () none 9) ;; (dummy-9 (_type_) none 9)
|
||||
(print-to-stream (_type_ string basic) none 10)
|
||||
@@ -16880,6 +16900,7 @@
|
||||
(back-box-min vector4b :inline :offset-assert 12)
|
||||
(back-box-max vector4b :inline :offset-assert 16)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
@@ -16938,24 +16959,25 @@
|
||||
(texture-remap-table-len int32 :offset-assert 56)
|
||||
(texture-ids (pointer texture-id) :offset-assert 60)
|
||||
(texture-page-count int32 :offset-assert 64)
|
||||
;; 0 68
|
||||
(name symbol :offset 72)
|
||||
(unknown-basic basic :offset-assert 68) ;; seems to be 0 everywhere.
|
||||
(name symbol :offset-assert 72)
|
||||
(nickname symbol :offset-assert 76)
|
||||
(vis-info level-vis-info 8 :offset-assert 80)
|
||||
(actors drawable-inline-array-actor :offset-assert 112)
|
||||
(cameras (array entity-camera) :offset-assert 116)
|
||||
(nodes (inline-array bsp-node) :offset-assert 120)
|
||||
(level level :offset-assert 124)
|
||||
;; 0 (maybe current-leaf-idx?) 128
|
||||
(texture-flags texture-page-flag 10 :offset 130)
|
||||
;; 0 (maybe padding) 150
|
||||
(require-force-inside uint8 :offset 152)
|
||||
(ambients symbol :offset 156) ;; now just #t?
|
||||
(subdivide-close float :offset 160)
|
||||
(current-leaf-idx uint16 :offset-assert 128)
|
||||
(texture-flags texture-page-flag 10 :offset-assert 130)
|
||||
(cam-outside-bsp uint8 :offset 152)
|
||||
(cam-using-back uint8 :offset-assert 153)
|
||||
(cam-box-idx uint16 :offset-assert 154)
|
||||
(ambients symbol :offset-assert 156) ;; now just #t?
|
||||
(subdivide-close float :offset-assert 160)
|
||||
(subdivide-far float :offset-assert 164)
|
||||
(race-meshes (array entity-race-mesh) :offset-assert 168)
|
||||
(actor-birth-order (pointer uint32) :offset 172)
|
||||
(light-hash light-hash :offset 176)
|
||||
(actor-birth-order (pointer uint32) :offset-assert 172)
|
||||
(light-hash light-hash :offset-assert 176)
|
||||
(nav-meshes (array entity-nav-mesh) :offset-assert 180)
|
||||
(actor-groups (array actor-group) :offset-assert 184)
|
||||
(region-trees (array drawable-tree-region-prim) :offset-assert 188)
|
||||
@@ -16965,16 +16987,21 @@
|
||||
;; 204 is maybe that array's length
|
||||
;; 216 is a vector array
|
||||
;; (vec-array (pointer vector) :offset 216) ; TODO see - `update-visible` hits assertion
|
||||
(region-tree drawable-tree-region-prim :offset 252)
|
||||
(tfrag-masks texture-masks-array :offset-assert 256)
|
||||
(tfrag-mask-count uint32 :offset-assert 260)
|
||||
(shrub-masks texture-masks-array :offset-assert 264)
|
||||
(shrub-mask-count uint32 :offset-assert 268)
|
||||
(alpha-masks texture-masks-array :offset-assert 272)
|
||||
(alpha-mask-count uint32 :offset-assert 276)
|
||||
(water-masks texture-masks-array :offset-assert 280)
|
||||
(water-mask-count uint32 :offset-assert 284)
|
||||
|
||||
(region-tree drawable-tree-region-prim :offset 252)
|
||||
(bsp-scale vector :inline :offset-assert 288)
|
||||
(bsp-offset vector :inline :offset-assert 304)
|
||||
|
||||
; (actor-birth-order (pointer uint32) :offset-assert 172)
|
||||
; (split-box-indices (pointer uint16) :offset-assert 176)
|
||||
(unk-data uint32 18 :offset 180)
|
||||
(tfrag-texture-masks-array texture-masks-array)
|
||||
|
||||
(tmask0 texture-masks-array :offset 272)
|
||||
(tmask2 texture-masks-array :offset 280)
|
||||
(unk-data uint32 18 :offset 180)
|
||||
|
||||
(end uint8 :offset 399)
|
||||
)
|
||||
@@ -17573,7 +17600,7 @@
|
||||
(translucent-flag uint32 :offset-assert 520)
|
||||
(wait-from-spr uint32 :offset-assert 524)
|
||||
(wait-to-spr uint32 :offset-assert 528)
|
||||
(use-etie basic :offset-assert 532)
|
||||
(use-etie symbol :offset-assert 532)
|
||||
(buffer-start uint32 :offset-assert 536)
|
||||
(buffer-end uint32 :offset-assert 540)
|
||||
(tfrag-dists uint32 :offset-assert 544)
|
||||
@@ -21675,9 +21702,9 @@
|
||||
;; bsp ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;; (define-extern mem-usage-bsp-tree function) ;; (function bsp-header bsp-node memory-usage-block int none)
|
||||
;; (define-extern *test-shrub* object) ;; int
|
||||
(define-extern bsp-camera-asm (function bsp-header vector none)) ;;
|
||||
(define-extern mem-usage-bsp-tree (function bsp-header bsp-node memory-usage-block int none))
|
||||
(define-extern *test-shrub* int)
|
||||
(define-extern bsp-camera-asm (function bsp-header vector none))
|
||||
(define-extern print-collide-stats (function none))
|
||||
(define-extern level-remap-texture (function texture-id texture-id))
|
||||
(define-extern build-masks (function bsp-header none))
|
||||
@@ -21687,15 +21714,15 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-extern *merc-global-stats* merc-global-stats)
|
||||
;; (define-extern clear-tr-stat function) ;; (function tr-stat none)
|
||||
(define-extern clear-tr-stat (function tr-stat none))
|
||||
(define-extern *stat-string-tfrag* string)
|
||||
(define-extern *stat-string-tfrag-scissor* string)
|
||||
(define-extern *stat-string-total* string)
|
||||
;; (define-extern print-tr-stat function) ;; (function tr-stat string string none)
|
||||
(define-extern print-tr-stat (function tr-stat string string none))
|
||||
(define-extern print-terrain-stats (function none))
|
||||
;; (define-extern update-subdivide-settings! function) ;; (function subdivide-settings math-camera int none)
|
||||
(define-extern update-subdivide-settings! (function subdivide-settings math-camera int none))
|
||||
(define-extern *subdivide-settings* subdivide-settings)
|
||||
;; (define-extern set-tfrag-dists! function) ;; (function tfrag-dists none)
|
||||
(define-extern set-tfrag-dists! (function tfrag-dists none))
|
||||
(define-extern *terrain-context* terrain-context)
|
||||
(define-extern GSH_ENABLE symbol)
|
||||
(define-extern GSH_BUCKET bucket-id)
|
||||
@@ -22174,9 +22201,8 @@
|
||||
- If the `timestamp` on the elt, minus the current framecounter exceeds `max-age`, we are also done, return #f
|
||||
- However if we find an elt who's `owner` matches the iterator's, break out early returning that `elt`"
|
||||
(_type_) history-elt 10)
|
||||
(history-iterator-method-11
|
||||
"TODO - Unsure of the purpose
|
||||
`min(1.0, ((history-elt.timestamp - 1) + frame-counter) / (max-age + 1)) - 1.0`"
|
||||
(get-age
|
||||
"Get the age of a history element"
|
||||
(_type_ history-elt) float 11)
|
||||
)
|
||||
)
|
||||
@@ -23175,7 +23201,7 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(define-extern *instance-tie-work* instance-tie-work) ;;
|
||||
;; (define-extern *prototype-tie-work* object) ;; prototype-tie-work
|
||||
(define-extern *prototype-tie-work* prototype-tie-work)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; tie-methods ;;
|
||||
@@ -26230,7 +26256,7 @@
|
||||
;; (define-extern swingpole-init function)
|
||||
;; (define-extern manipy-post function)
|
||||
(define-extern manipy-init (function vector entity-actor skeleton-group vector none :behavior manipy)) ;; (function vector entity-actor skeleton-group vector none :behavior manipy)
|
||||
(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process collide-prim-core none :behavior part-tracker)) ;;
|
||||
(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process collide-prim-core none :behavior part-tracker)) ;;
|
||||
;; (define-extern part-tracker-track-root function) ;; (function sparticle-system sparticle-cpuinfo vector none)
|
||||
;; (define-extern part-tracker-move-to-target function) ;; (function part-tracker vector)
|
||||
;; (define-extern part-tracker-track-target function) ;; (function part-tracker vector)
|
||||
@@ -28547,7 +28573,7 @@
|
||||
;; (define-extern *collectable-dummy-shadow-control* shadow-control)
|
||||
;; (define-extern initialize-ammo-by-other function)
|
||||
;; (define-extern initialize-upgrade-by-other function)
|
||||
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process)) ;;
|
||||
(define-extern birth-pickup-at-point (function vector pickup-type float symbol process-tree fact-info (pointer process) :behavior process)) ;;
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; task-control ;;
|
||||
@@ -28794,7 +28820,7 @@
|
||||
;; (define-extern hide-hud function) ;; (function none)
|
||||
;; (define-extern enable-hud function) ;; (function none)
|
||||
;; (define-extern hide-hud-quick function) ;; (function none)
|
||||
(define-extern show-hud (function object none)) ;;
|
||||
(define-extern show-hud (function object none)) ;;
|
||||
;; (define-extern hud-hidden? function) ;; (function symbol)
|
||||
;; (define-extern set-hud-piece-position! function)
|
||||
;; (define-extern set-as-offset-from! function)
|
||||
|
||||
@@ -270,7 +270,9 @@
|
||||
"(method 35 nav-mesh)": [2, 4],
|
||||
"(method 18 mysql-nav-graph)": [0, 1, 3, 4, 5, 9],
|
||||
"draw-actor-marks": [8],
|
||||
"find-nearest-entity": [7, 9, 10, 11, 12, 13, 14]
|
||||
"find-nearest-entity": [7, 9, 10, 11, 12, 13, 14],
|
||||
"start-perf-stat-collection": [26],
|
||||
"end-perf-stat-collection": [0]
|
||||
},
|
||||
|
||||
// Sometimes the game might use format strings that are fetched dynamically,
|
||||
|
||||
@@ -2264,6 +2264,35 @@
|
||||
|
||||
[[690, 694], "a0", "drawable-region-prim"]
|
||||
],
|
||||
"build-masks": [
|
||||
[[18, 22], "a1", "drawable-tree-tfrag"],
|
||||
[24, "a2", "drawable-inline-array-tfrag"],
|
||||
[[27, 31], "a2", "(inline-array tfragment)"],
|
||||
|
||||
[[38, 42], "a1", "drawable-tree-tfrag-trans"],
|
||||
[44, "a2", "drawable-inline-array-tfrag"],
|
||||
[[47, 51], "a2", "(inline-array tfragment)"],
|
||||
|
||||
|
||||
[[58, 62], "a1", "drawable-tree-tfrag-water"],
|
||||
[64, "a2", "drawable-inline-array-tfrag"],
|
||||
[[67, 71], "a2", "(inline-array tfragment)"],
|
||||
|
||||
|
||||
[[78, 79], "a1", "drawable-tree-instance-tie"],
|
||||
[123, "a1", "drawable-tree-instance-shrub"],
|
||||
[[129, 133], "a2", "(inline-array prototype-bucket-shrub)"]
|
||||
],
|
||||
|
||||
"(method 10 bsp-header)": [
|
||||
[43, "a1", "terrain-context"],
|
||||
[31, "a0", "terrain-context"]
|
||||
],
|
||||
|
||||
"history-draw": [
|
||||
[151, "a0", "uint"],
|
||||
["_stack_", 24, "pat-surface"]
|
||||
],
|
||||
|
||||
// placeholder
|
||||
"placeholder-do-not-add-below": []
|
||||
|
||||
@@ -1063,5 +1063,34 @@
|
||||
"v1-122":"lev-for-vis",
|
||||
"a0-53":"num-vis-levs"
|
||||
}
|
||||
},
|
||||
|
||||
"bsp-camera-asm": {
|
||||
"vars": {
|
||||
"a3-0":"cam-pos-i1",
|
||||
"a3-1":"cam-pos-32",
|
||||
"a3-2":"cam-pos-16",
|
||||
"a3-3":"cam-pos-8",
|
||||
"a3-4":"cam-pos-8m",
|
||||
"v1-0":"nodes",
|
||||
"a2-0":"nidx",
|
||||
"t1-1":"node",
|
||||
"t3-0":"front-min",
|
||||
"t6-0":"front-min-compare",
|
||||
"t0-2":"front-max",
|
||||
"t4-0":"front-max-compare",
|
||||
"t2-0":"back-min",
|
||||
"t7-0":"back-min-compare",
|
||||
"t0-3":"back-max",
|
||||
"t5-0":"back-max-compare",
|
||||
"t0-4":"front-idx",
|
||||
"t6-1":"not-f-min",
|
||||
"t7-1":"not-b-min",
|
||||
"t3-1":"f-flag",
|
||||
"t4-2":"f-in-box",
|
||||
"t5-2":"b-in-box",
|
||||
"t2-1":"b-flag",
|
||||
"t1-2":"back-idx"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -856,6 +856,10 @@ void types2_for_div_mod_signed(types2::Type& type_out,
|
||||
expr.to_string(env), arg0_type.print(), arg1_type.print()));
|
||||
}
|
||||
|
||||
void types2_for_div_mod_unsigned(types2::Type& type_out) {
|
||||
type_out.type = TP_Type::make_from_ts("uint");
|
||||
}
|
||||
|
||||
void types2_for_pcpyld(types2::Type& type_out,
|
||||
const SimpleExpression& expr,
|
||||
const Env& env,
|
||||
@@ -1214,7 +1218,7 @@ void types2_for_add(types2::Type& type_out,
|
||||
type_out.type =
|
||||
TP_Type::make_from_ts(coerce_to_reg_type(filtered_results.front().result_type));
|
||||
return;
|
||||
} else {
|
||||
} else if (!filtered_results.empty()) {
|
||||
types2_from_ambiguous_deref(output_instr, type_out, filtered_results, extras.tags_locked);
|
||||
return;
|
||||
}
|
||||
@@ -1241,7 +1245,7 @@ void types2_for_add(types2::Type& type_out,
|
||||
type_out.type =
|
||||
TP_Type::make_from_ts(coerce_to_reg_type(filtered_results.front().result_type));
|
||||
return;
|
||||
} else {
|
||||
} else if (!filtered_results.empty()) {
|
||||
types2_from_ambiguous_deref(output_instr, type_out, filtered_results, extras.tags_locked);
|
||||
return;
|
||||
}
|
||||
@@ -1532,6 +1536,10 @@ void types2_for_expr(types2::Type& type_out,
|
||||
case SimpleExpression::Kind::MOD_SIGNED:
|
||||
types2_for_div_mod_signed(type_out, expr, env, input_types, dts);
|
||||
break;
|
||||
case SimpleExpression::Kind::DIV_UNSIGNED:
|
||||
case SimpleExpression::Kind::MOD_UNSIGNED:
|
||||
types2_for_div_mod_unsigned(type_out);
|
||||
break;
|
||||
case SimpleExpression::Kind::NEG:
|
||||
case SimpleExpression::Kind::MIN_SIGNED:
|
||||
case SimpleExpression::Kind::MAX_SIGNED:
|
||||
|
||||
@@ -92,7 +92,7 @@ u32 Thread_Loader() {
|
||||
|
||||
void* RPC_Player(unsigned int /*fno*/, void* data, int size) {
|
||||
if (g_game_version == GameVersion::Jak2) {
|
||||
printf("RPC_Player skip\n");
|
||||
printf("RPC_Player skip %d\n", (int)((SoundRpcCommand*)data)->command);
|
||||
return nullptr;
|
||||
}
|
||||
if (gSoundEnable) {
|
||||
@@ -358,7 +358,7 @@ void* RPC_Player(unsigned int /*fno*/, void* data, int size) {
|
||||
|
||||
void* RPC_Loader(unsigned int /*fno*/, void* data, int size) {
|
||||
if (g_game_version == GameVersion::Jak2) {
|
||||
printf("RPC_Loader skip\n");
|
||||
printf("RPC_Loader skip %d\n", (int)((SoundRpcCommand*)data)->command);
|
||||
return nullptr;
|
||||
}
|
||||
int n_messages = size / SRPC_MESSAGE_SIZE;
|
||||
|
||||
@@ -69,9 +69,14 @@
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> perf-stat-array heap-base) (the-as uint 52))
|
||||
|
||||
(define *pc-perf-stat-counter* (the-as uint 0))
|
||||
|
||||
(defmethod reset! perf-stat ((obj perf-stat))
|
||||
"Perfomance counters are not implemented, so this does nothing."
|
||||
"Perfomance counters are partially implemented, they just count cycles."
|
||||
(+! (-> obj count) 1)
|
||||
(when (nonzero? (-> obj ctrl))
|
||||
(set! *pc-perf-stat-counter* (get-cpu-clock))
|
||||
)
|
||||
#|
|
||||
(let ((v1-0 (-> obj ctrl)))
|
||||
(+! (-> obj count) 1)
|
||||
@@ -93,7 +98,12 @@
|
||||
)
|
||||
|
||||
(defmethod read! perf-stat ((obj perf-stat))
|
||||
"Perfomance counters are not implemented, so this does nothing."
|
||||
"Perfomance counters are partially implemented, they just count cycles."
|
||||
(when (nonzero? (-> obj ctrl))
|
||||
(+! (-> obj accum0) (- (get-cpu-clock) *pc-perf-stat-counter*))
|
||||
(set! (-> obj accum1) 0)
|
||||
)
|
||||
|
||||
#|
|
||||
(b! (zero? (-> obj ctrl)) cfg-2)
|
||||
(.mtc0 Perf r0-0)
|
||||
|
||||
@@ -191,8 +191,8 @@
|
||||
(-> obj count)
|
||||
(-> obj cycles)
|
||||
(-> obj instructions)
|
||||
(-> obj icache)
|
||||
(-> obj dcache)
|
||||
0 ;; (-> obj icache) removed, doesn't work on pc
|
||||
0 ;; (-> obj dcache) removed, doesn't work on pc
|
||||
)
|
||||
(format *stdcon* " ~2d ~2d ~2d"
|
||||
(-> obj to-vu0-waits)
|
||||
@@ -331,6 +331,8 @@
|
||||
)
|
||||
(+! (-> v1-31 0 count) 1)
|
||||
(b! (zero? a0-76) cfg-28)
|
||||
(set! *pc-perf-stat-counter* (get-cpu-clock)) ;; patched
|
||||
|
||||
#|
|
||||
(.mtc0 Perf r0-0)
|
||||
(.sync.l)
|
||||
@@ -358,9 +360,13 @@
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
;;(.mfpc a0-1 pcr0)
|
||||
(+! (-> v1-1 0 accum0) (the-as uint a0-1))
|
||||
;; (+! (-> v1-1 0 accum0) (the-as uint a0-1))
|
||||
(+! (-> v1-1 0 accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) ;; patched
|
||||
|
||||
;;(.mfpc a0-3 pcr1)
|
||||
(+! (-> v1-1 0 accum1) (the-as uint a0-3))
|
||||
;; (+! (-> v1-1 0 accum1) (the-as uint a0-3))
|
||||
(set! (-> v1-1 0 accum1) 0) ;; ;; patched
|
||||
|
||||
)
|
||||
(label cfg-2)
|
||||
0
|
||||
|
||||
@@ -34,6 +34,16 @@
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(.lvf vf5 (&-> in quad))
|
||||
|
||||
;; PC patch: get regis from init-for-transform.
|
||||
(.lvf vf1 (&-> *transform-regs* vf1))
|
||||
(.lvf vf2 (&-> *transform-regs* vf2))
|
||||
(.lvf vf3 (&-> *transform-regs* vf3))
|
||||
(.lvf vf4 (&-> *transform-regs* vf4))
|
||||
(.lvf vf8 (&-> *transform-regs* vf8))
|
||||
(.lvf vf9 (&-> *transform-regs* vf9))
|
||||
(.lvf vf6 (&-> *transform-regs* vf6))
|
||||
|
||||
(.mul.w.vf acc vf4 vf5)
|
||||
(.add.mul.x.vf acc vf1 vf5 acc)
|
||||
(.add.mul.y.vf acc vf2 vf5 acc)
|
||||
|
||||
@@ -909,7 +909,7 @@
|
||||
)
|
||||
(let ((f2-1 (-> (the-as prototype-bucket-tie gp-0) dists w)))
|
||||
(when (= arg1 (debug-menu-msg press))
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) 8)
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) (prototype-flags vanish))
|
||||
(set! f1-2 (fmax (fmin (* 4096.0 arg2) f0-0) (+ 4096.0 f2-1)))
|
||||
(let ((f0-1 (fmax f0-0 (+ 4096.0 f1-2))))
|
||||
(set! (-> (the-as prototype-bucket-tie gp-0) tie-rvanish) (/ 128.0 (- f0-1 f1-2)))
|
||||
@@ -946,7 +946,7 @@
|
||||
(f1-2 (-> (the-as prototype-bucket-tie gp-0) dists w))
|
||||
)
|
||||
(when (= arg1 (debug-menu-msg press))
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) 8)
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) (prototype-flags vanish))
|
||||
(set! f0-0 (fmax (* 4096.0 arg2) (+ 4096.0 f2-1)))
|
||||
(let ((f1-4 (fmax (fmin f2-1 f0-0) (+ 4096.0 f1-2))))
|
||||
(set! (-> (the-as prototype-bucket-tie gp-0) tie-rvanish) (/ 128.0 (- f0-0 f1-4)))
|
||||
@@ -1053,9 +1053,9 @@
|
||||
(cond
|
||||
(v1-0
|
||||
(if (= arg1 (debug-menu-msg press))
|
||||
(logxor! (-> v1-0 flags) 1)
|
||||
(logxor! (-> v1-0 flags) (prototype-flags disable))
|
||||
)
|
||||
(zero? (logand (-> v1-0 flags) 1))
|
||||
(zero? (logand (-> v1-0 flags) (prototype-flags disable)))
|
||||
)
|
||||
(else
|
||||
#f
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
(new (symbol type uint) _type_ 0)
|
||||
(frame-counter-delta (_type_ history-elt) time-frame 9)
|
||||
(update-entries! (_type_) history-elt 10)
|
||||
(history-iterator-method-11 (_type_ history-elt) float 11)
|
||||
(get-age (_type_ history-elt) float 11)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -265,9 +265,8 @@
|
||||
(the-as history-elt #f)
|
||||
)
|
||||
|
||||
(defmethod history-iterator-method-11 history-iterator ((obj history-iterator) (arg0 history-elt))
|
||||
"TODO - Unsure of the purpose
|
||||
`min(1.0, ((history-elt.timestamp - 1) + frame-counter) / (max-age + 1)) - 1.0`"
|
||||
(defmethod get-age history-iterator ((obj history-iterator) (arg0 history-elt))
|
||||
"Get the age of a history element"
|
||||
(- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter)))
|
||||
(the float (+ (-> obj max-age) 1))
|
||||
)
|
||||
@@ -434,4 +433,123 @@
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun history-draw ((arg0 history-iterator))
|
||||
(local-vars (sv-16 vector) (sv-20 vector) (sv-24 pat-surface))
|
||||
(set! sv-16 (the-as vector #f))
|
||||
(set! sv-20 (the-as vector #f))
|
||||
(set! sv-24 (new 'static 'pat-surface))
|
||||
(until #f
|
||||
(let ((s5-0 (update-entries! arg0)))
|
||||
(if (not s5-0)
|
||||
(goto cfg-34)
|
||||
)
|
||||
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
|
||||
(let* ((f0-0 (get-age arg0 s5-0))
|
||||
(v1-8 (the int (lerp 4.0 128.0 f0-0)))
|
||||
)
|
||||
(case (-> s5-0 channel)
|
||||
(((history-channel trans))
|
||||
(if sv-16
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
sv-16
|
||||
(-> s5-0 vector)
|
||||
(the-as rgba (logior #xffff00 (shl v1-8 24)))
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24))))
|
||||
)
|
||||
(set! sv-16 (-> s5-0 vector))
|
||||
)
|
||||
(((history-channel intersect))
|
||||
(if sv-20
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
sv-20
|
||||
(-> s5-0 vector)
|
||||
(the-as rgba (logior #xffffff (shl v1-8 24)))
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24))))
|
||||
)
|
||||
(set! sv-20 (-> s5-0 vector))
|
||||
)
|
||||
(((history-channel transv))
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 0.000024414063)
|
||||
(the-as rgba (logior (shl v1-8 24) #xff00))
|
||||
)
|
||||
)
|
||||
(((history-channel transv-in))
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 0.000024414063)
|
||||
(the-as rgba (logior #x408040 (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
(((history-channel transv-out))
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 0.000024414063)
|
||||
(the-as rgba (logior #x404080 (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
(((history-channel local-normal) (history-channel surface-normal))
|
||||
(let ((t1-7
|
||||
(logand (the-as uint (-> *pat-mode-info* (-> sv-24 mode) hilite-color)) (the-as uint #xffffffff00ffffff))
|
||||
)
|
||||
)
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 1.0)
|
||||
(the-as rgba (logior t1-7 (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(((history-channel pat))
|
||||
(set! sv-24 (the-as pat-surface (-> s5-0 vector x)))
|
||||
)
|
||||
(((history-channel friction))
|
||||
(let ((f0-3 (-> s5-0 vector x))
|
||||
(a3-10 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0)
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
a3-10
|
||||
(meters 0.00024414062)
|
||||
(the-as rgba (logior #xffffff (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
(label cfg-34)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -13,9 +13,13 @@
|
||||
|
||||
(res 48)
|
||||
|
||||
(bsp-leaf-vis-self 62)
|
||||
(bsp-leaf-vis-adj 63)
|
||||
(bsp-main 58)
|
||||
(bsp-misc 59)
|
||||
(bsp-node 60)
|
||||
(bsp-leaf-vis-self 61)
|
||||
(bsp-leaf-vis-adj 62)
|
||||
|
||||
(pat 64)
|
||||
(level-code 65)
|
||||
(entity-links 66)
|
||||
|
||||
@@ -24,14 +28,19 @@
|
||||
(joint-anim-compressed-control 69)
|
||||
(joint-anim-fixed 70)
|
||||
(joint-anim-frame 71)
|
||||
|
||||
(subtitle 72)
|
||||
(art-group 73)
|
||||
(art-mesh-anim 74)
|
||||
(art-mesh-geo 75)
|
||||
(art-joint-geo 76)
|
||||
(art-joint-anim 77)
|
||||
(merc-ctrl 78)
|
||||
(joint-anim-drawable 79)
|
||||
(blend-shape 80)
|
||||
|
||||
(joint-anim-drawable 78)
|
||||
(texture 82)
|
||||
|
||||
(array 84)
|
||||
|
||||
(eye-anim 111)
|
||||
)
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
(to-spr-waits uint32 :offset-assert 44)
|
||||
(from-spr-waits uint32 :offset-assert 48)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 14
|
||||
:size-assert #x34
|
||||
:flag-assert #xe00000034
|
||||
@@ -299,10 +300,14 @@
|
||||
)
|
||||
(set! (-> perf-stat-array heap-base) (the-as uint 52))
|
||||
|
||||
(define *pc-perf-stat-counter* (the-as uint 0))
|
||||
|
||||
(defmethod reset! perf-stat ((obj perf-stat))
|
||||
; (let ((v1-0 (-> obj ctrl)))
|
||||
(+! (-> obj count) 1)
|
||||
(+! (-> obj count) 1)
|
||||
(when (nonzero? (-> obj ctrl))
|
||||
(set! *pc-perf-stat-counter* (get-cpu-clock))
|
||||
)
|
||||
; (b! (zero? v1-0) cfg-2 :delay (nop!))
|
||||
; (.mtc0 Perf r0)
|
||||
; (.sync.l)
|
||||
@@ -324,13 +329,16 @@
|
||||
(defmethod read! perf-stat ((obj perf-stat))
|
||||
; (local-vars (v1-1 int) (v1-3 int))
|
||||
; (b! (zero? (-> obj ctrl)) cfg-2 :delay (nop!))
|
||||
; (.mtc0 Perf r0)
|
||||
; (.sync.l)
|
||||
; (.sync.p)
|
||||
; (.mfpc v1-1 pcr0)
|
||||
; (+! (-> obj accum0) v1-1)
|
||||
; (.mfpc v1-3 pcr1)
|
||||
; (+! (-> obj accum1) v1-3)
|
||||
(when (nonzero? (-> obj ctrl))
|
||||
; (.mtc0 Perf r0)
|
||||
; (.sync.l)
|
||||
; (.sync.p)
|
||||
; (.mfpc v1-1 pcr0)
|
||||
(+! (-> obj accum0) (- (get-cpu-clock) *pc-perf-stat-counter*))
|
||||
; (.mfpc v1-3 pcr1)
|
||||
; (+! (-> obj accum1) v1-3)
|
||||
(set! (-> obj accum1) 0)
|
||||
)
|
||||
; (label cfg-2)
|
||||
; 0
|
||||
(none)
|
||||
|
||||
@@ -392,7 +392,7 @@
|
||||
; (send-events-for-touching-shapes *touching-list*)
|
||||
; (free-nodes *touching-list*)
|
||||
; (prepare *collide-rider-pool*)
|
||||
; (send-all! *event-queue*)
|
||||
(send-all! *event-queue*)
|
||||
|
||||
;; spawn/update actors
|
||||
(with-profiler 'update-actors *profile-update-actors-color*
|
||||
@@ -404,85 +404,23 @@
|
||||
;; ((method-of-object *level* level-group-method-18))
|
||||
)
|
||||
|
||||
#|
|
||||
(when *debug-segment*
|
||||
(let ((gp-11 (-> *display* frames (-> *display* on-screen) profile-array data 0))
|
||||
(v1-255 'background)
|
||||
(s5-9 *profile-background-color*)
|
||||
)
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let ((s4-8 (-> gp-11 data (-> gp-11 count))))
|
||||
(let ((s3-5 (-> gp-11 base-time)))
|
||||
(set! (-> s4-8 name) v1-255)
|
||||
(set! (-> s4-8 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-5))))
|
||||
)
|
||||
(set! (-> s4-8 depth) (the-as uint (-> gp-11 depth)))
|
||||
(set! (-> s4-8 color) s5-9)
|
||||
(set! (-> gp-11 segment (-> gp-11 depth)) s4-8)
|
||||
)
|
||||
(+! (-> gp-11 count) 1)
|
||||
(+! (-> gp-11 depth) 1)
|
||||
(set! (-> gp-11 max-depth) (max (-> gp-11 max-depth) (-> gp-11 depth)))
|
||||
)
|
||||
)
|
||||
0
|
||||
|
||||
|
||||
(with-profiler 'background *profile-background-color*
|
||||
;; (init-background)
|
||||
;; (execute-connections *background-draw-engine* (-> *display* frames (-> *display* on-screen)))
|
||||
(reset! (-> *perf-stats* data (perf-stat-bucket background)))
|
||||
;; (finish-background)
|
||||
(read! (-> *perf-stats* data (perf-stat-bucket background)))
|
||||
; (update-wait-stats (-> *perf-stats* data (perf-stat-bucket background))
|
||||
; (-> *background-work* wait-to-vu0)
|
||||
; (the-as uint 0)
|
||||
; (the-as uint 0)
|
||||
; )
|
||||
)
|
||||
(init-background)
|
||||
(execute-connections *background-draw-engine* (-> *display* frames (-> *display* on-screen)))
|
||||
(let* ((v1-275 (&-> *perf-stats* data 32 accum0))
|
||||
(a0-94 (-> v1-275 7))
|
||||
)
|
||||
(+! (-> v1-275 1) 1)
|
||||
(b! (zero? a0-94) cfg-116 :delay (nop!))
|
||||
(.mtc0 Perf r0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtpc pcr0 r0)
|
||||
(.mtpc pcr1 r0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-94)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-116)
|
||||
0
|
||||
(finish-background)
|
||||
(let ((v1-278 (&-> *perf-stats* data 32 accum0)))
|
||||
(b! (zero? (-> v1-278 7)) cfg-118 :delay (nop!))
|
||||
(.mtc0 Perf r0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mfpc a0-96 pcr0)
|
||||
(+! (-> v1-278 8) a0-96)
|
||||
(.mfpc a0-98 pcr1)
|
||||
(+! (-> v1-278 9) a0-98)
|
||||
)
|
||||
(label cfg-118)
|
||||
0
|
||||
((method-of-type perf-stat update-wait-stats)
|
||||
(the-as perf-stat (&-> *perf-stats* data 32 accum0))
|
||||
(-> *background-work* wait-to-vu0)
|
||||
(the-as uint 0)
|
||||
(the-as uint 0)
|
||||
)
|
||||
(b! (not *debug-segment*) cfg-126 :delay (empty-form))
|
||||
(let ((gp-12 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let* ((v1-295 (+ (-> gp-12 depth) -1))
|
||||
(s5-10 (-> gp-12 segment v1-295))
|
||||
(s4-9 (-> gp-12 base-time))
|
||||
)
|
||||
(when (>= v1-295 0)
|
||||
(set! (-> s5-10 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-9))))
|
||||
(+! (-> gp-12 depth) -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(label cfg-126)
|
||||
|
||||
(end-perf-stat-collection)
|
||||
|
||||
(when (and (!= *master-mode* 'menu) *stats-poly*)
|
||||
(dotimes (gp-13 (-> *level* length))
|
||||
(let ((v1-307 (-> *level* level gp-13)))
|
||||
@@ -493,6 +431,7 @@
|
||||
)
|
||||
(print-terrain-stats)
|
||||
)
|
||||
|
||||
(when (not (paused?))
|
||||
(if (and (!= *master-mode* 'menu) *stats-perf*)
|
||||
(print-perf-stats)
|
||||
@@ -502,7 +441,7 @@
|
||||
)
|
||||
)
|
||||
(start-perf-stat-collection)
|
||||
|#
|
||||
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -355,7 +355,7 @@
|
||||
;; debug draw, profile bars, deci count, file info
|
||||
(when *debug-segment*
|
||||
;; do all debug drawing.
|
||||
; (debug-draw-buffers)
|
||||
(debug-draw-buffers)
|
||||
(with-dma-buffer-add-bucket ((s3-0 (-> arg0 frames (-> arg0 on-screen) debug-buf)) (bucket-id debug-no-zbuf2))
|
||||
(when (or *display-profile* *stats-profile-bars*)
|
||||
(setup-categories! (-> arg0 frames (-> arg0 on-screen) profile-array))
|
||||
@@ -515,9 +515,9 @@
|
||||
; (update *bigmap*)
|
||||
|
||||
;; continue loading level
|
||||
; (if (-> *level* loading-level)
|
||||
; (load-continue (-> *level* loading-level))
|
||||
; )
|
||||
(if (-> *level* loading-level)
|
||||
(load-continue (-> *level* loading-level))
|
||||
)
|
||||
|
||||
;; drawing - this runs foreground/background drawing.
|
||||
(with-profiler 'draw-hook *profile-draw-hook-color*
|
||||
@@ -589,7 +589,7 @@
|
||||
)
|
||||
)
|
||||
0
|
||||
;(read! (-> *perf-stats* data (perf-stat-bucket all-code)))
|
||||
(read! (-> *perf-stats* data (perf-stat-bucket all-code)))
|
||||
)
|
||||
|
||||
;; now wait for the previous frame to finish rendering...
|
||||
@@ -738,10 +738,10 @@
|
||||
; (the-as uint (/ (-> *collide-vif0-init* length) 4))
|
||||
; )
|
||||
(suspend)
|
||||
; (set! (-> *setting-control* user-default bg-a) 0.0)
|
||||
; (set! (-> gp-1 frames 0 start-time) (the-as time-frame (timer-count (the-as timer-bank #x10000800))))
|
||||
; (set! (-> gp-1 frames 1 start-time) (the-as time-frame (timer-count (the-as timer-bank #x10000800))))
|
||||
; (set! (-> gp-1 dog-ratio) 1.0)
|
||||
(set! (-> *setting-control* user-default bg-a) 0.0)
|
||||
(set! (-> gp-1 frames 0 start-time) (the-as time-frame (timer-count (the-as timer-bank #x10000800))))
|
||||
(set! (-> gp-1 frames 1 start-time) (the-as time-frame (timer-count (the-as timer-bank #x10000800))))
|
||||
(set! (-> gp-1 dog-ratio) 1.0)
|
||||
(while *run*
|
||||
(display-loop-main gp-1)
|
||||
(with-profiler 'actors *profile-actors-color*
|
||||
|
||||
@@ -31,3 +31,7 @@
|
||||
:size-assert #x19c
|
||||
:flag-assert #x90000019c
|
||||
)
|
||||
|
||||
;; DECOMP ENDS
|
||||
|
||||
(define-extern *background-work* background-work)
|
||||
@@ -7,11 +7,21 @@
|
||||
|
||||
(declare-type prototype-tie drawable)
|
||||
|
||||
(defenum prototype-flags
|
||||
:bitfield #t
|
||||
:type uint16
|
||||
(disable 0)
|
||||
(tpage-alpha 2)
|
||||
(vanish 3)
|
||||
(tpage-water 7)
|
||||
|
||||
)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype prototype-bucket (basic)
|
||||
((name string :offset-assert 4)
|
||||
(flags uint16 :offset-assert 8)
|
||||
(flags prototype-flags :offset-assert 8)
|
||||
(texture-masks-index uint16 :offset-assert 10)
|
||||
(in-level uint16 :offset-assert 12)
|
||||
(utextures uint16 :offset-assert 14)
|
||||
|
||||
@@ -5,12 +5,14 @@
|
||||
;; name in dgo: subdivide-h
|
||||
;; dgos: ENGINE, GAME
|
||||
|
||||
;; NOTE - for default-menu
|
||||
(declare-type subdivide-settings basic)
|
||||
(define-extern *subdivide-settings* subdivide-settings)
|
||||
(define-extern *stat-string-tfrag* string)
|
||||
(define-extern *stat-string-tfrag-scissor* string)
|
||||
(define-extern *stat-string-total* string)
|
||||
(define-extern update-subdivide-settings! (function subdivide-settings math-camera int none))
|
||||
|
||||
(define-extern *perf-stats* perf-stat-array)
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
|
||||
@@ -7,4 +7,375 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(define *subdivide-settings* (new 'global 'subdivide-settings (meters 30.0) (meters 70.0)))
|
||||
|
||||
(define *merc-global-stats* (new 'global 'merc-global-stats))
|
||||
|
||||
(defun clear-tr-stat ((arg0 tr-stat))
|
||||
(set! (-> arg0 groups) (the-as uint 0))
|
||||
(set! (-> arg0 fragments) (the-as uint 0))
|
||||
(set! (-> arg0 tris) (the-as uint 0))
|
||||
(set! (-> arg0 dverts) (the-as uint 0))
|
||||
(set! (-> arg0 instances) (the-as uint 0))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(define *stat-string-tfrag* (new 'global 'string 128 (the-as string #f)))
|
||||
(define *stat-string-tfrag-scissor* (new 'global 'string 128 (the-as string #f)))
|
||||
(define *stat-string-total* (new 'global 'string 128 (the-as string #f)))
|
||||
|
||||
(defun-debug print-tr-stat ((arg0 tr-stat) (arg1 string) (arg2 string))
|
||||
(clear arg2)
|
||||
(when (nonzero? (+ (-> arg0 groups) (-> arg0 fragments) (-> arg0 tris) (-> arg0 dverts) (-> arg0 instances)))
|
||||
(format arg2 "~0k~4d ~5d ~6d ~6d" (-> arg0 groups) (-> arg0 fragments) (-> arg0 tris) (-> arg0 dverts))
|
||||
(format arg2 "~0k ~7f ~5d ~s"
|
||||
(/ (* 2.0 (the float (-> arg0 tris))) (the float (- (-> arg0 dverts) (-> arg0 tris))))
|
||||
(-> arg0 instances)
|
||||
arg1
|
||||
)
|
||||
(format *stdcon* "~S~%" arg2)
|
||||
(+! (-> *terrain-stats* total groups) (-> arg0 groups))
|
||||
(+! (-> *terrain-stats* total fragments) (-> arg0 fragments))
|
||||
(+! (-> *terrain-stats* total tris) (-> arg0 tris))
|
||||
(+! (-> *terrain-stats* total dverts) (-> arg0 dverts))
|
||||
(+! (-> *terrain-stats* total instances) (-> arg0 instances))
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun-debug print-terrain-stats ()
|
||||
(dotimes (gp-0 (-> *level* length))
|
||||
(let ((s5-0 (-> *level* level gp-0)))
|
||||
(when (= (-> s5-0 status) 'active)
|
||||
(compute-memory-usage s5-0 #f)
|
||||
(format
|
||||
*stdcon*
|
||||
"~0k~D ~A ~,,2fK + textures~%"
|
||||
(-> s5-0 index)
|
||||
(-> s5-0 name)
|
||||
(* 0.0009765625 (the float (-> s5-0 mem-usage)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format *stdcon* "~0k~%grps frags tris dverts strip insts~%")
|
||||
(print-tr-stat (-> *terrain-stats* pris) "pris" *temp-string*)
|
||||
(print-tr-stat (-> *merc-global-stats* merc) "merc" *temp-string*)
|
||||
(print-tr-stat (-> *merc-global-stats* emerc) "emerc" *temp-string*)
|
||||
(print-tr-stat (-> *merc-global-stats* mercneric) "mercneric" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-generic) "tie-generic" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-vanish) "tie-vanish" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie) "tie" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-scissor) "tie-scissor" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-envmap) "tie-envmap" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-envmap-scissor) "tie-envmap-scissor" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-trans) "tie-trans" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-scissor-trans) "tie-scissor-trans" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-envmap-trans) "tie-envmap-trans" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-envmap-scissor-trans) "tie-envmap-scissor-trans" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-water) "tie-water" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-scissor-water) "tie-scissor-water" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-envmap-water) "tie-envmap-water" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tie-envmap-scissor-water) "tie-envmap-scissor-water" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* shrub-near) "shrub-near" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* shrub) "shrub" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tfrag-scissor) "tfrag-scissor" *stat-string-tfrag-scissor*)
|
||||
(print-tr-stat (-> *terrain-stats* tfrag) "tfrag" *stat-string-tfrag*)
|
||||
(print-tr-stat (-> *terrain-stats* tfrag-trans) "tfrag-trans" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tfrag-scissor-trans) "tfrag-scissor-trans" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tfrag-water) "tfrag-water" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* tfrag-scissor-water) "tfrag-scissor-water" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* trans-pris) "trans-pris" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* billboard) "billboard" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* trans-shrub) "trans-shrub" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* ocean-mid) "ocean-mid" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* ocean-near) "ocean-near" *temp-string*)
|
||||
(print-tr-stat (-> *terrain-stats* shadow) "shadow" *temp-string*)
|
||||
(format *stdcon* "~0k---------------------------------------------------------------~%")
|
||||
(print-tr-stat (-> *terrain-stats* total) "total" *stat-string-total*)
|
||||
(clear-tr-stat (-> *terrain-stats* pris))
|
||||
(clear-tr-stat (-> *merc-global-stats* merc))
|
||||
(clear-tr-stat (-> *merc-global-stats* emerc))
|
||||
(clear-tr-stat (-> *merc-global-stats* mercneric))
|
||||
(clear-tr-stat (-> *terrain-stats* shrub-near))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-generic))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-vanish))
|
||||
(clear-tr-stat (-> *terrain-stats* tie))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-scissor))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-envmap))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-envmap-scissor))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-trans))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-scissor-trans))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-envmap-trans))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-envmap-scissor-trans))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-water))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-scissor-water))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-envmap-water))
|
||||
(clear-tr-stat (-> *terrain-stats* tie-envmap-scissor-water))
|
||||
(clear-tr-stat (-> *terrain-stats* shrub))
|
||||
(clear-tr-stat (-> *terrain-stats* tfrag-scissor))
|
||||
(clear-tr-stat (-> *terrain-stats* tfrag))
|
||||
(clear-tr-stat (-> *terrain-stats* tfrag-trans))
|
||||
(clear-tr-stat (-> *terrain-stats* tfrag-scissor-trans))
|
||||
(clear-tr-stat (-> *terrain-stats* tfrag-water))
|
||||
(clear-tr-stat (-> *terrain-stats* tfrag-scissor-water))
|
||||
(clear-tr-stat (-> *terrain-stats* trans-pris))
|
||||
(clear-tr-stat (-> *terrain-stats* billboard))
|
||||
(clear-tr-stat (-> *terrain-stats* trans-shrub))
|
||||
(clear-tr-stat (-> *terrain-stats* ocean-mid))
|
||||
(clear-tr-stat (-> *terrain-stats* ocean-near))
|
||||
(clear-tr-stat (-> *terrain-stats* shadow))
|
||||
(clear-tr-stat (-> *terrain-stats* total))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun update-subdivide-settings! ((arg0 subdivide-settings) (arg1 math-camera) (arg2 int))
|
||||
(set! (-> arg0 meters 0) (-> arg0 far arg2))
|
||||
(set! (-> arg0 meters 4) (-> arg0 close arg2))
|
||||
(let ((f0-3 (* 0.14285715 (- (-> arg0 meters 0) (-> arg0 meters 4)))))
|
||||
(set! (-> arg0 meters 3) (+ (-> arg0 meters 4) (* 0.5 f0-3)))
|
||||
(set! (-> arg0 meters 2) (+ (-> arg0 meters 3) f0-3))
|
||||
(set! (-> arg0 meters 1) (+ (-> arg0 meters 2) (* 2.0 f0-3)))
|
||||
)
|
||||
(let ((f0-7 (* (-> arg1 fov-correction-factor) (/ (-> arg1 inv-hmge-scale w) (-> arg1 d)))))
|
||||
(dotimes (v1-8 5)
|
||||
(set! (-> arg0 dist v1-8) (* f0-7 (-> arg0 meters v1-8)))
|
||||
)
|
||||
)
|
||||
(set! (-> *tfrag-work* frag-dists x) (- (-> arg0 meters 0)))
|
||||
(set! (-> *tfrag-work* frag-dists y) (- (-> arg0 meters 1)))
|
||||
(set! (-> *tfrag-work* frag-dists z) (- (-> arg0 meters 2)))
|
||||
(set! (-> *tfrag-work* frag-dists w) (- (-> arg0 meters 4)))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(define *subdivide-settings* (new 'global 'subdivide-settings (meters 30.0) (meters 70.0)))
|
||||
|
||||
(defun set-tfrag-dists! ((arg0 tfrag-dists))
|
||||
(let ((f2-0 (-> *subdivide-settings* dist 0))
|
||||
(f1-0 (-> *subdivide-settings* dist 1))
|
||||
(f0-0 (-> *subdivide-settings* dist 2))
|
||||
)
|
||||
(set! (-> arg0 k0s 0 w) f2-0)
|
||||
(set! (-> arg0 k0s 1 w) f1-0)
|
||||
(let ((f4-1 (/ 1.0 (- f2-0 f1-0)))
|
||||
(f3-2 (/ 1.0 (- f1-0 f0-0)))
|
||||
)
|
||||
(set! (-> arg0 k0s 0 y) (- f4-1))
|
||||
(set! (-> arg0 k0s 1 y) (- f3-2))
|
||||
(set! (-> arg0 k0s 0 x) (* 0.5 f4-1))
|
||||
(set! (-> arg0 k0s 1 x) (* 0.5 f3-2))
|
||||
(let ((f2-1 (* f2-0 f4-1))
|
||||
(f5-7 (* f1-0 f3-2))
|
||||
)
|
||||
(set! (-> arg0 k1s 0 y) f2-1)
|
||||
(set! (-> arg0 k1s 1 y) f5-7)
|
||||
)
|
||||
(set! (-> arg0 k1s 0 x) (* -0.5 f4-1 f1-0))
|
||||
(set! (-> arg0 k1s 1 x) (* -0.5 f3-2 f0-0))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(kmemopen global "terrain-context")
|
||||
(define *terrain-context* (new 'global 'terrain-context))
|
||||
(kmemclose)
|
||||
|
||||
(defmethod print-to-stream perf-stat ((obj perf-stat) (arg0 string) (arg1 basic))
|
||||
(format *stdcon* "~3d ~8d ~8d ~6d ~6d"
|
||||
(-> obj count)
|
||||
(-> obj cycles)
|
||||
(-> obj instructions)
|
||||
0 ;; (-> obj icache) removed, doesn't work on pc
|
||||
0 ;; (-> obj dcache) removed, doesn't work on pc
|
||||
)
|
||||
(format *stdcon* " ~2d ~2d ~2d" (-> obj to-vu0-waits) (-> obj to-spr-waits) (-> obj from-spr-waits))
|
||||
(format *stdcon* " ~s~%" arg0)
|
||||
(none)
|
||||
)
|
||||
|
||||
(define GSH_ENABLE #f)
|
||||
(define GSH_BUCKET (bucket-id bucket-3))
|
||||
(define GSH_WHICH_STAT 1)
|
||||
(define GSH_MAX_DISPLAY (the-as basic #f))
|
||||
(define GSH_TIME 64)
|
||||
|
||||
(define *perf-stats* (new 'debug 'perf-stat-array 51))
|
||||
|
||||
(when *debug-segment*
|
||||
(define *gomi-stats-hack* (the-as (inline-array perf-stat) (malloc 'debug (* 52 (+ GSH_TIME 1)))))
|
||||
)
|
||||
|
||||
|
||||
(defun-debug start-perf-stat-collection ()
|
||||
(let ((v1-2 (+ (-> *perf-stats* data 0 frame-number) 1)))
|
||||
(set! (-> *perf-stats* data 0 frame-number) v1-2)
|
||||
(let ((gp-0 (mod v1-2 (the-as uint 102))))
|
||||
(when GSH_ENABLE
|
||||
(let ((v1-5 GSH_BUCKET))
|
||||
(let ((a0-2 GSH_WHICH_STAT))
|
||||
(set! gp-0 (+ (* (the-as uint v1-5) 2) a0-2))
|
||||
)
|
||||
(when GSH_MAX_DISPLAY
|
||||
(let ((a0-7 (logand (-> *perf-stats* data 0 frame-number) (+ GSH_TIME -1))))
|
||||
(set! (-> *gomi-stats-hack* a0-7 cycles) (-> *perf-stats* data (the-as int v1-5) cycles))
|
||||
(set! (-> *gomi-stats-hack* a0-7 instructions) (-> *perf-stats* data (the-as int v1-5) instructions))
|
||||
(set! (-> *gomi-stats-hack* a0-7 icache) (-> *perf-stats* data (the-as int v1-5) icache))
|
||||
(set! (-> *gomi-stats-hack* a0-7 dcache) (-> *perf-stats* data (the-as int v1-5) dcache))
|
||||
(when (zero? a0-7)
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME cycles) (the-as uint 0))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME instructions) (the-as uint 0))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME icache) (the-as uint 0))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME dcache) (the-as uint 0))
|
||||
(dotimes (v1-22 GSH_TIME)
|
||||
(if (< (-> *gomi-stats-hack* GSH_TIME cycles) (-> *gomi-stats-hack* v1-22 cycles))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME cycles) (-> *gomi-stats-hack* v1-22 cycles))
|
||||
)
|
||||
(if (< (-> *gomi-stats-hack* GSH_TIME instructions) (-> *gomi-stats-hack* v1-22 instructions))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME instructions) (-> *gomi-stats-hack* v1-22 instructions))
|
||||
)
|
||||
(if (< (-> *gomi-stats-hack* GSH_TIME icache) (-> *gomi-stats-hack* v1-22 icache))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME icache) (-> *gomi-stats-hack* v1-22 icache))
|
||||
)
|
||||
(if (< (-> *gomi-stats-hack* GSH_TIME dcache) (-> *gomi-stats-hack* v1-22 dcache))
|
||||
(set! (-> *gomi-stats-hack* GSH_TIME dcache) (-> *gomi-stats-hack* v1-22 dcache))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(format *stdcon* "~%")
|
||||
(print-to-stream (-> *gomi-stats-hack* GSH_TIME) "max-value" *stdcon*)
|
||||
)
|
||||
)
|
||||
)
|
||||
(dotimes (v1-27 51)
|
||||
(set! (-> *perf-stats* data v1-27 count) (the-as uint 0))
|
||||
(cond
|
||||
((!= v1-27 (shr gp-0 1))
|
||||
(set! (-> *perf-stats* data v1-27 ctrl) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
(else
|
||||
(let ((a1-63 (logand gp-0 1))
|
||||
(a0-64 #x80004010)
|
||||
)
|
||||
(cond
|
||||
((zero? a1-63)
|
||||
(set! a0-64 (+ #x60020 a0-64))
|
||||
)
|
||||
((= a1-63 1)
|
||||
(set! a0-64 (+ #x300c0 a0-64))
|
||||
)
|
||||
)
|
||||
(set! (-> *perf-stats* data v1-27 select) a1-63)
|
||||
(set! (-> *perf-stats* data v1-27 ctrl) (the-as uint a0-64))
|
||||
)
|
||||
(set! (-> *perf-stats* data v1-27 accum0) (the-as uint 0))
|
||||
(set! (-> *perf-stats* data v1-27 accum1) (the-as uint 0))
|
||||
(set! (-> *perf-stats* data v1-27 to-vu0-waits) (the-as uint 0))
|
||||
(set! (-> *perf-stats* data v1-27 to-spr-waits) (the-as uint 0))
|
||||
(set! (-> *perf-stats* data v1-27 from-spr-waits) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((v1-31 (-> *perf-stats* data))
|
||||
(a0-76 (-> v1-31 0 ctrl))
|
||||
)
|
||||
(+! (-> v1-31 0 count) 1)
|
||||
(b! (zero? a0-76) cfg-28 :delay (nop!))
|
||||
(.mtc0 Perf r0)
|
||||
(set! *pc-perf-stat-counter* (get-cpu-clock)) ;; patched
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
;(.mtpc pcr0 r0)
|
||||
;(.mtpc pcr1 r0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(.mtc0 Perf a0-76)
|
||||
)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
(label cfg-28)
|
||||
0
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; this part is patched
|
||||
(if (not *debug-segment*)
|
||||
(set! start-perf-stat-collection
|
||||
(lambda ()
|
||||
(dotimes (v1-0 51)
|
||||
(set! (-> *perf-stats* data v1-0 count) (the-as uint 0))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defun-debug end-perf-stat-collection ()
|
||||
(local-vars (a0-1 int) (a0-3 int))
|
||||
(let ((v1-1 (-> *perf-stats* data)))
|
||||
(b! (zero? (-> v1-1 0 ctrl)) cfg-2 :delay (nop!))
|
||||
(.mtc0 Perf r0)
|
||||
(.sync.l)
|
||||
(.sync.p)
|
||||
;(.mfpc a0-1 pcr0)
|
||||
;(+! (-> v1-1 0 accum0) a0-1)
|
||||
(+! (-> v1-1 0 accum0) (- (get-cpu-clock) *pc-perf-stat-counter*)) ;; patched
|
||||
|
||||
;(.mfpc a0-3 pcr1)
|
||||
;(+! (-> v1-1 0 accum1) a0-3)
|
||||
(set! (-> v1-1 0 accum1) 0) ;; ;; patched
|
||||
)
|
||||
(label cfg-2)
|
||||
0
|
||||
(dotimes (v1-3 51)
|
||||
(when (nonzero? (-> *perf-stats* data v1-3 ctrl))
|
||||
(let ((a2-0 (-> *perf-stats* data v1-3 select))
|
||||
(a1-8 (-> *perf-stats* data v1-3 accum0))
|
||||
(a0-15 (-> *perf-stats* data v1-3 accum1))
|
||||
)
|
||||
(cond
|
||||
((zero? a2-0)
|
||||
(set! (-> *perf-stats* data v1-3 cycles) a1-8)
|
||||
(set! (-> *perf-stats* data v1-3 instructions) a0-15)
|
||||
)
|
||||
((= a2-0 1)
|
||||
(set! (-> *perf-stats* data v1-3 icache) a1-8)
|
||||
(set! (-> *perf-stats* data v1-3 dcache) a0-15)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun-debug print-perf-stats ()
|
||||
(format *stdcon* "~0k~%count cycles instr icache dcache vu0/to/from~%")
|
||||
(dotimes (gp-0 51)
|
||||
;(if (and (nonzero? (-> *perf-stats* data gp-0 count)) (< (the-as uint 10000) (-> *perf-stats* data gp-0 cycles)))
|
||||
(if (nonzero? (-> *perf-stats* data gp-0 count))
|
||||
(print-to-stream
|
||||
(-> *perf-stats* data gp-0)
|
||||
(perf-stat-bucket->string (the-as perf-stat-bucket gp-0))
|
||||
*stdcon*
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -7,3 +7,11 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(define *wind-work*
|
||||
(new 'static 'wind-work :wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0))
|
||||
)
|
||||
|
||||
(set! (-> *wind-work* to-ptrs 0) (the-as uint (&+ *fake-scratchpad-data* 8192)))
|
||||
(set! (-> *wind-work* to-ptrs 1) (the-as uint (&+ *fake-scratchpad-data* 4096)))
|
||||
(set! (-> *wind-work* to-ptrs 2) (the-as uint *fake-scratchpad-data*))
|
||||
|
||||
|
||||
@@ -5,14 +5,9 @@
|
||||
;; name in dgo: merc
|
||||
;; dgos: ENGINE, GAME
|
||||
|
||||
;; TODO uncomment usages of adgif-shader-login and get-eye-block once their respective files are finished
|
||||
;; (define-extern adgif-shader-login (function adgif-shader texture))
|
||||
;; (define-extern get-eye-block (function int int int))
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(format 0 "SKIP: calls to adgif-shader-login and get-eye-block in merc~%")
|
||||
|
||||
(deftype texture-login-data (structure)
|
||||
((default-texture-index int32 :offset-assert 0)
|
||||
(current-texture-index int32 :offset-assert 4)
|
||||
|
||||
@@ -7,7 +7,10 @@
|
||||
|
||||
;; NOTE - for cam-update
|
||||
(declare-type instance-tie-work structure)
|
||||
(declare-type prototype-tie-work structure)
|
||||
(define-extern *instance-tie-work* instance-tie-work)
|
||||
(define-extern *prototype-tie-work* prototype-tie-work)
|
||||
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
@@ -136,7 +139,7 @@
|
||||
(translucent-flag uint32 :offset-assert 520)
|
||||
(wait-from-spr uint32 :offset-assert 524)
|
||||
(wait-to-spr uint32 :offset-assert 528)
|
||||
(use-etie basic :offset-assert 532)
|
||||
(use-etie symbol :offset-assert 532)
|
||||
(buffer-start uint32 :offset-assert 536)
|
||||
(buffer-end uint32 :offset-assert 540)
|
||||
(tfrag-dists uint32 :offset-assert 544)
|
||||
|
||||
@@ -7,3 +7,163 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(define *instance-tie-work* (new 'static 'instance-tie-work
|
||||
:wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0)
|
||||
:constant (new 'static 'vector :x 4096.0 :y 128.0)
|
||||
:far-morph (new 'static 'vector :x 1.0 :w 256.0)
|
||||
:upload-color-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x80c6 :num #x6 :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-color-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #xc0cc :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-color-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id next))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
)
|
||||
:upload-color-ret (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ret))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
)
|
||||
:generic-color-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x3)
|
||||
)
|
||||
:generic-color-1 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref)))
|
||||
:generic-color-end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end)))
|
||||
:envmap-color-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x8000 :num #x8 :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:envmap-color-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #xc008 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:refl-fade-fac -0.000625
|
||||
:refl-fade-end 409600.0
|
||||
:use-etie #t
|
||||
)
|
||||
)
|
||||
|
||||
(set! (-> *instance-tie-work* upload-color-2 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
|
||||
|
||||
(set! (-> *instance-tie-work* upload-color-ret vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
|
||||
|
||||
(define *prototype-tie-work* (new 'static 'prototype-tie-work
|
||||
:upload-flushe (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd flushe) :msk #x1)
|
||||
)
|
||||
:upload-palette (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x1 :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4346 :num #x80 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-model-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16))
|
||||
)
|
||||
:upload-model-3 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call)))
|
||||
:upload-model-near-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-model-near-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-near-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x1e :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-near-3 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16))
|
||||
)
|
||||
:upload-model-near-4 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call)))
|
||||
:envmap-palette (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x1 :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4302 :num #x80 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:envmap-shader (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #x387 :num #x5 :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-envmap-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #xb8 :cmd (vif-cmd base))
|
||||
:vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-envmap-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd offset))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-envmap-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd unpack-v4-16))
|
||||
)
|
||||
:upload-envmap-3 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x84 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-envmap-4 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call)))
|
||||
:upload-envmap-scissor-4 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #xac :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:generic-palette (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x1)
|
||||
)
|
||||
:generic-model-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x2)
|
||||
)
|
||||
:generic-model-1 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref)))
|
||||
:generic-model-2 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref)))
|
||||
:model-next (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
:clamp #x8000ff00ff00ff
|
||||
)
|
||||
)
|
||||
|
||||
(set! (-> *prototype-tie-work* upload-model-1 vif0)
|
||||
(new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
(set! (-> *prototype-tie-work* upload-model-3 vif0)
|
||||
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
(set! (-> *prototype-tie-work* upload-model-near-1 vif0)
|
||||
(new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
(set! (-> *prototype-tie-work* upload-model-near-4 vif0)
|
||||
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
(set! (-> *prototype-tie-work* upload-envmap-2 vif0)
|
||||
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscalf) :msk #x1)
|
||||
)
|
||||
|
||||
(set! (-> *prototype-tie-work* upload-envmap-4 vif1)
|
||||
(new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
(back-box-min vector4b :inline :offset-assert 12)
|
||||
(back-box-max vector4b :inline :offset-assert 16)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
@@ -55,24 +56,25 @@
|
||||
(texture-remap-table-len int32 :offset-assert 56)
|
||||
(texture-ids (pointer texture-id) :offset-assert 60)
|
||||
(texture-page-count int32 :offset-assert 64)
|
||||
;; 0 68
|
||||
(name symbol :offset 72)
|
||||
(unknown-basic basic :offset-assert 68) ;; seems to be 0 everywhere.
|
||||
(name symbol :offset-assert 72)
|
||||
(nickname symbol :offset-assert 76)
|
||||
(vis-info level-vis-info 8 :offset-assert 80)
|
||||
(actors drawable-inline-array-actor :offset-assert 112)
|
||||
(cameras (array entity-camera) :offset-assert 116)
|
||||
(nodes (inline-array bsp-node) :offset-assert 120)
|
||||
(level level :offset-assert 124)
|
||||
;; 0 (maybe current-leaf-idx?) 128
|
||||
(texture-flags texture-page-flag 10 :offset 130)
|
||||
;; 0 (maybe padding) 150
|
||||
(require-force-inside uint8 :offset 152)
|
||||
(ambients symbol :offset 156) ;; now just #t?
|
||||
(subdivide-close float :offset 160)
|
||||
(current-leaf-idx uint16 :offset-assert 128)
|
||||
(texture-flags texture-page-flag 10 :offset-assert 130)
|
||||
(cam-outside-bsp uint8 :offset 152)
|
||||
(cam-using-back uint8 :offset-assert 153)
|
||||
(cam-box-idx uint16 :offset-assert 154)
|
||||
(ambients symbol :offset-assert 156) ;; now just #t?
|
||||
(subdivide-close float :offset-assert 160)
|
||||
(subdivide-far float :offset-assert 164)
|
||||
(race-meshes (array entity-race-mesh) :offset-assert 168)
|
||||
(actor-birth-order (pointer uint32) :offset 172)
|
||||
(light-hash light-hash :offset 176)
|
||||
(actor-birth-order (pointer uint32) :offset-assert 172)
|
||||
(light-hash light-hash :offset-assert 176)
|
||||
(nav-meshes (array entity-nav-mesh) :offset-assert 180)
|
||||
(actor-groups (array actor-group) :offset-assert 184)
|
||||
(region-trees (array drawable-tree-region-prim) :offset-assert 188)
|
||||
@@ -82,16 +84,21 @@
|
||||
;; 204 is maybe that array's length
|
||||
;; 216 is a vector array
|
||||
;; (vec-array (pointer vector) :offset 216) ; TODO see - `update-visible` hits assertion
|
||||
(region-tree drawable-tree-region-prim :offset 252)
|
||||
(tfrag-masks texture-masks-array :offset-assert 256)
|
||||
(tfrag-mask-count uint32 :offset-assert 260)
|
||||
(shrub-masks texture-masks-array :offset-assert 264)
|
||||
(shrub-mask-count uint32 :offset-assert 268)
|
||||
(alpha-masks texture-masks-array :offset-assert 272)
|
||||
(alpha-mask-count uint32 :offset-assert 276)
|
||||
(water-masks texture-masks-array :offset-assert 280)
|
||||
(water-mask-count uint32 :offset-assert 284)
|
||||
|
||||
(region-tree drawable-tree-region-prim :offset 252)
|
||||
(bsp-scale vector :inline :offset-assert 288)
|
||||
(bsp-offset vector :inline :offset-assert 304)
|
||||
|
||||
; (actor-birth-order (pointer uint32) :offset-assert 172)
|
||||
; (split-box-indices (pointer uint16) :offset-assert 176)
|
||||
(unk-data uint32 18 :offset 180)
|
||||
(tfrag-texture-masks-array texture-masks-array)
|
||||
|
||||
(tmask0 texture-masks-array :offset 272)
|
||||
(tmask2 texture-masks-array :offset 280)
|
||||
(unk-data uint32 18 :offset 180)
|
||||
|
||||
(end uint8 :offset 399)
|
||||
)
|
||||
@@ -104,6 +111,7 @@
|
||||
(deactivate-entities (_type_) none 18)
|
||||
)
|
||||
)
|
||||
|
||||
;; unused
|
||||
(deftype game-level (basic)
|
||||
((master-bsp basic :offset-assert 4)
|
||||
|
||||
@@ -7,7 +7,543 @@
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
;; The "bsp" is the main level data structure: the bsp-header contains references to all static level data.
|
||||
;; The "bsp-tree" is a bsp used to associate camera positions with lists of visibible objects.
|
||||
|
||||
(defun-recursive mem-usage-bsp-tree none ((arg0 bsp-header) (arg1 bsp-node) (arg2 memory-usage-block) (arg3 int))
|
||||
"Compute the memory usage of the bsp-tree part of a bsp-header"
|
||||
(cond
|
||||
((zero? arg1)
|
||||
)
|
||||
(else
|
||||
(+! (-> arg2 data 60 count) 1)
|
||||
(let ((v1-3 20))
|
||||
(+! (-> arg2 data 60 used) v1-3)
|
||||
(+! (-> arg2 data 60 total) v1-3)
|
||||
)
|
||||
(if (zero? (-> arg1 front-box-min w))
|
||||
(mem-usage-bsp-tree arg0 (-> arg0 nodes (-> arg1 front)) arg2 arg3)
|
||||
)
|
||||
(when (zero? (-> arg1 back-box-min w))
|
||||
(if (> (-> arg1 back) 0)
|
||||
(mem-usage-bsp-tree arg0 (-> arg0 nodes (-> arg1 back)) arg2 arg3)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod mem-usage bsp-header ((obj bsp-header) (arg0 memory-usage-block) (arg1 int))
|
||||
"Compute the memory usage of everything in a bsp-header.
|
||||
This includes all the drawables."
|
||||
(set! (-> arg0 work-bsp) obj)
|
||||
(when (nonzero? (-> obj info))
|
||||
(set! (-> arg0 length) (max 85 (-> arg0 length)))
|
||||
(set! (-> arg0 data 84 name) "array")
|
||||
(+! (-> arg0 data 84 count) 1)
|
||||
(let ((v1-8 (asize-of (-> obj info))))
|
||||
(+! (-> arg0 data 84 used) v1-8)
|
||||
(+! (-> arg0 data 84 total) (logand -16 (+ v1-8 15)))
|
||||
)
|
||||
)
|
||||
(if (nonzero? (-> obj drawable-trees))
|
||||
(mem-usage (-> obj drawable-trees) arg0 arg1)
|
||||
)
|
||||
(if (nonzero? (-> obj collide-hash))
|
||||
(mem-usage (-> obj collide-hash) arg0 arg1)
|
||||
)
|
||||
(set! (-> arg0 length) (max 65 (-> arg0 length)))
|
||||
(set! (-> arg0 data 43 name) "entity")
|
||||
(set! (-> arg0 data 44 name) "camera")
|
||||
(set! (-> arg0 data 64 name) "pat")
|
||||
(set! (-> arg0 data 60 name) "bsp-node")
|
||||
(set! (-> arg0 length) (max 59 (-> arg0 length)))
|
||||
(set! (-> arg0 data 58 name) "bsp-main")
|
||||
(+! (-> arg0 data 58 count) 1)
|
||||
(let ((v1-31 400))
|
||||
(+! (-> arg0 data 58 used) v1-31)
|
||||
(+! (-> arg0 data 58 total) (logand -16 (+ v1-31 15)))
|
||||
)
|
||||
(set! (-> arg0 length) (max 62 (-> arg0 length)))
|
||||
(set! (-> arg0 data 61 name) "bsp-leaf-vis-self")
|
||||
(+! (-> arg0 data 61 count) 1)
|
||||
(let ((v1-40 (-> obj visible-list-length)))
|
||||
(+! (-> arg0 data 61 used) v1-40)
|
||||
(+! (-> arg0 data 61 total) (logand -16 (+ v1-40 15)))
|
||||
)
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-50 (* (-> obj texture-remap-table-len) 8)))
|
||||
(+! (-> arg0 data 59 used) v1-50)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-50 15)))
|
||||
)
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-60 (* (-> obj texture-page-count) 4)))
|
||||
(+! (-> arg0 data 59 used) v1-60)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-60 15)))
|
||||
)
|
||||
(when (nonzero? (-> obj unknown-basic))
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-72 (asize-of (-> obj unknown-basic))))
|
||||
(+! (-> arg0 data 59 used) v1-72)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-72 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> obj actor-birth-order))
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-85 (* (-> obj actors length) 4)))
|
||||
(+! (-> arg0 data 59 used) v1-85)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-85 15)))
|
||||
)
|
||||
)
|
||||
(+! (-> arg0 data 64 count) (-> obj pat-length))
|
||||
(let ((v1-92 (* (-> obj pat-length) 4)))
|
||||
(+! (-> arg0 data 64 used) v1-92)
|
||||
(+! (-> arg0 data 64 total) (logand -16 (+ v1-92 15)))
|
||||
)
|
||||
(when (nonzero? (-> obj region-trees))
|
||||
(let* ((s3-0 (-> obj region-trees length))
|
||||
(s2-0 0)
|
||||
(a0-39 (-> obj region-trees s2-0))
|
||||
)
|
||||
(while (< s2-0 s3-0)
|
||||
(mem-usage a0-39 arg0 (logior arg1 128))
|
||||
(+! s2-0 1)
|
||||
(set! a0-39 (-> obj region-trees s2-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s3-1 (-> obj cameras)))
|
||||
(when (nonzero? s3-1)
|
||||
(dotimes (s2-1 (-> s3-1 length))
|
||||
(mem-usage (-> s3-1 s2-1) arg0 (logior arg1 256))
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (nonzero? (-> obj nodes))
|
||||
(mem-usage-bsp-tree obj (-> obj nodes 0) arg0 arg1)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
(defmethod login bsp-header ((obj bsp-header))
|
||||
"Log in a bsp-header.
|
||||
Note that this version isn't typically used - instead level.gc does a special login that runs
|
||||
over multiple frames."
|
||||
(if (nonzero? (-> obj drawable-trees))
|
||||
(login (-> obj drawable-trees))
|
||||
)
|
||||
(set! (-> obj level tfrag-gs-test)
|
||||
(if (logtest? (-> obj texture-flags 0) (texture-page-flag alpha-enable))
|
||||
(new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest greater-equal))
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x26
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
(define *test-shrub* 0)
|
||||
|
||||
(defmethod draw bsp-header ((obj bsp-header) (arg0 bsp-header) (arg1 display-frame))
|
||||
"Draw a bsp-header. Note that this mostly just adds drawable trees to a list which is later
|
||||
used by the background system. So this is probably a bit of a leftover from when drawing was done
|
||||
by iterating through all drawable-trees recursively."
|
||||
(local-vars (a3-4 uint128) (a3-5 uint128))
|
||||
(let ((s4-0 (-> obj level)))
|
||||
(when (-> s4-0 render?)
|
||||
|
||||
;; setup for level drawing:
|
||||
(set! *draw-index* (-> s4-0 draw-index)) ;; the index of level being drawn
|
||||
(set! (-> *prototype-tie-work* mood) (-> s4-0 mood-context)) ;; the mood for TIE.
|
||||
|
||||
;; update tie/tfrag level of detail
|
||||
(if *artist-use-menu-subdiv*
|
||||
(update-subdivide-settings! *subdivide-settings* *math-camera* 7)
|
||||
(update-subdivide-settings! *subdivide-settings* *math-camera* (-> s4-0 index))
|
||||
)
|
||||
|
||||
;; upload visibility data to spr
|
||||
(let ((a2-3 (/ (+ (-> obj visible-list-length) 15) 16)))
|
||||
(__mem-move (-> (scratchpad-object terrain-context) work background vis-list) (-> s4-0 vis-bits) (the uint (* a2-3 16)))
|
||||
; (dma-send-to-spr-no-flush
|
||||
; (the-as uint (-> (the-as terrain-context #x70000000) work background vis-list))
|
||||
; (the-as uint (-> s4-0 vis-bits))
|
||||
; (the-as uint a2-3)
|
||||
; #f
|
||||
; )
|
||||
)
|
||||
|
||||
;; debug option to flip visibility bits
|
||||
(when *artist-flip-visible*
|
||||
(let ((v1-15 (/ (+ (-> obj visible-list-length) 15) 16))
|
||||
(a0-7 (-> (scratchpad-object terrain-context) work background vis-list))
|
||||
(a1-5 (-> obj all-visible-list))
|
||||
)
|
||||
(dotimes (a2-4 v1-15)
|
||||
(let ((a3-3 (-> (the-as (pointer uint128) (+ (the-as uint a0-7) (* a2-4 16))))))
|
||||
(.pnor a3-4 a3-3 0)
|
||||
)
|
||||
(let ((t0-2 (-> (the-as (pointer uint128) (&+ a1-5 (* a2-4 16))))))
|
||||
(.pand a3-5 a3-4 t0-2)
|
||||
)
|
||||
(set! (-> (the-as (pointer uint128) (+ (the-as uint a0-7) (* a2-4 16)))) a3-5)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; load vf registers with camera matrices/planes - to be used by renderers
|
||||
(let ((at-0 *math-camera*))
|
||||
(with-vf (vf16 vf17 vf18 vf19 vf20 vf21 vf22 vf23 vf24 vf25 vf26 vf27 vf28 vf29 vf30 vf31)
|
||||
:rw 'write
|
||||
(.lvf vf16 (&-> at-0 plane 0 quad))
|
||||
(.lvf vf17 (&-> at-0 plane 1 quad))
|
||||
(.lvf vf18 (&-> at-0 plane 2 quad))
|
||||
(.lvf vf19 (&-> at-0 plane 3 quad))
|
||||
(.lvf vf20 (&-> at-0 shrub-mat vector 0 quad))
|
||||
(.lvf vf21 (&-> at-0 shrub-mat vector 1 quad))
|
||||
(.lvf vf22 (&-> at-0 shrub-mat vector 2 quad))
|
||||
(.lvf vf23 (&-> at-0 shrub-mat trans quad))
|
||||
(.lvf vf24 (&-> at-0 camera-rot vector 0 quad))
|
||||
(.lvf vf25 (&-> at-0 camera-rot vector 1 quad))
|
||||
(.lvf vf26 (&-> at-0 camera-rot vector 2 quad))
|
||||
(.lvf vf27 (&-> at-0 camera-rot trans quad))
|
||||
(.lvf vf28 (&-> at-0 camera-temp vector 0 quad))
|
||||
(.lvf vf29 (&-> at-0 camera-temp vector 1 quad))
|
||||
(.lvf vf30 (&-> at-0 camera-temp vector 2 quad))
|
||||
(.lvf vf31 (&-> at-0 camera-temp trans quad))
|
||||
)
|
||||
)
|
||||
|
||||
;; execute the draw!
|
||||
(when (nonzero? (-> obj drawable-trees))
|
||||
(with-profiler 'bsp *profile-bsp-color*
|
||||
(let ((a1-8 (-> obj drawable-trees)))
|
||||
(draw a1-8 a1-8 arg1)
|
||||
)
|
||||
)
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
|
||||
)
|
||||
|
||||
(defmethod debug-draw bsp-header ((obj bsp-header) (arg0 drawable) (arg1 display-frame))
|
||||
"Set up and call debug-draw on a bsp-header and all its drawables.
|
||||
The actual use of debug-draw is up to the drawables, but this is a useful place to do random
|
||||
debug drawing."
|
||||
(rlet ((vf16 :class vf)
|
||||
(vf17 :class vf)
|
||||
(vf18 :class vf)
|
||||
(vf19 :class vf)
|
||||
(vf20 :class vf)
|
||||
(vf21 :class vf)
|
||||
(vf22 :class vf)
|
||||
(vf23 :class vf)
|
||||
(vf24 :class vf)
|
||||
(vf25 :class vf)
|
||||
(vf26 :class vf)
|
||||
(vf27 :class vf)
|
||||
(vf28 :class vf)
|
||||
(vf29 :class vf)
|
||||
(vf30 :class vf)
|
||||
(vf31 :class vf)
|
||||
)
|
||||
(let ((v1-0 (-> obj level)))
|
||||
(set! *draw-index* (-> v1-0 draw-index))
|
||||
(set! (-> *prototype-tie-work* mood) (-> v1-0 mood-context))
|
||||
(let ((a2-1 (/ (+ (-> obj visible-list-length) 15) 16)))
|
||||
(__mem-move (-> (scratchpad-object terrain-context) work background vis-list) (-> v1-0 vis-bits) (the uint (* a2-1 16)))
|
||||
; (dma-send-to-spr-no-flush
|
||||
; (the-as uint (+ #x38a0 #x70000000))
|
||||
; (the-as uint (-> v1-0 vis-bits))
|
||||
; (the-as uint a2-1)
|
||||
; #f
|
||||
; )
|
||||
)
|
||||
)
|
||||
(let ((at-0 *math-camera*))
|
||||
(with-vf (vf16 vf17 vf18 vf19 vf20 vf21 vf22 vf23 vf24 vf25 vf26 vf27 vf28 vf29 vf30 vf31)
|
||||
:rw 'write
|
||||
(.lvf vf16 (&-> at-0 plane 0 quad))
|
||||
(.lvf vf17 (&-> at-0 plane 1 quad))
|
||||
(.lvf vf18 (&-> at-0 plane 2 quad))
|
||||
(.lvf vf19 (&-> at-0 plane 3 quad))
|
||||
(.lvf vf20 (&-> at-0 shrub-mat vector 0 quad))
|
||||
(.lvf vf21 (&-> at-0 shrub-mat vector 1 quad))
|
||||
(.lvf vf22 (&-> at-0 shrub-mat vector 2 quad))
|
||||
(.lvf vf23 (&-> at-0 shrub-mat trans quad))
|
||||
(.lvf vf24 (&-> at-0 camera-rot vector 0 quad))
|
||||
(.lvf vf25 (&-> at-0 camera-rot vector 1 quad))
|
||||
(.lvf vf26 (&-> at-0 camera-rot vector 2 quad))
|
||||
(.lvf vf27 (&-> at-0 camera-rot trans quad))
|
||||
(.lvf vf28 (&-> at-0 camera-temp vector 0 quad))
|
||||
(.lvf vf29 (&-> at-0 camera-temp vector 1 quad))
|
||||
(.lvf vf30 (&-> at-0 camera-temp vector 2 quad))
|
||||
(.lvf vf31 (&-> at-0 camera-temp trans quad))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> obj drawable-trees))
|
||||
(let ((a1-4 (-> obj drawable-trees)))
|
||||
(debug-draw a1-4 a1-4 arg1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod collect-stats bsp-header ((obj bsp-header))
|
||||
"Set up and call collect-stats on a bsp-header.
|
||||
This will run (moderately) expensive checks to count triangles, visibility, etc."
|
||||
(rlet ((vf16 :class vf)
|
||||
(vf17 :class vf)
|
||||
(vf18 :class vf)
|
||||
(vf19 :class vf)
|
||||
(vf20 :class vf)
|
||||
(vf21 :class vf)
|
||||
(vf22 :class vf)
|
||||
(vf23 :class vf)
|
||||
(vf24 :class vf)
|
||||
(vf25 :class vf)
|
||||
(vf26 :class vf)
|
||||
(vf27 :class vf)
|
||||
(vf28 :class vf)
|
||||
(vf29 :class vf)
|
||||
(vf30 :class vf)
|
||||
(vf31 :class vf)
|
||||
)
|
||||
(let ((v1-0 (-> obj level))
|
||||
(a2-0 (/ (+ (-> obj visible-list-length) 15) 16))
|
||||
)
|
||||
(__mem-move (-> (scratchpad-object terrain-context) work background vis-list) (-> v1-0 vis-bits) (the uint (* a2-0 16)))
|
||||
; (dma-send-to-spr-no-flush
|
||||
; (the-as uint (+ #x38a0 #x70000000))
|
||||
; (the-as uint (-> v1-0 vis-bits))
|
||||
; (the-as uint a2-0)
|
||||
; #f
|
||||
; )
|
||||
)
|
||||
(let ((at-0 *math-camera*))
|
||||
(with-vf (vf16 vf17 vf18 vf19 vf20 vf21 vf22 vf23 vf24 vf25 vf26 vf27 vf28 vf29 vf30 vf31)
|
||||
:rw 'write
|
||||
(.lvf vf16 (&-> at-0 plane 0 quad))
|
||||
(.lvf vf17 (&-> at-0 plane 1 quad))
|
||||
(.lvf vf18 (&-> at-0 plane 2 quad))
|
||||
(.lvf vf19 (&-> at-0 plane 3 quad))
|
||||
(.lvf vf20 (&-> at-0 shrub-mat vector 0 quad))
|
||||
(.lvf vf21 (&-> at-0 shrub-mat vector 1 quad))
|
||||
(.lvf vf22 (&-> at-0 shrub-mat vector 2 quad))
|
||||
(.lvf vf23 (&-> at-0 shrub-mat trans quad))
|
||||
(.lvf vf24 (&-> at-0 camera-rot vector 0 quad))
|
||||
(.lvf vf25 (&-> at-0 camera-rot vector 1 quad))
|
||||
(.lvf vf26 (&-> at-0 camera-rot vector 2 quad))
|
||||
(.lvf vf27 (&-> at-0 camera-rot trans quad))
|
||||
(.lvf vf28 (&-> at-0 camera-temp vector 0 quad))
|
||||
(.lvf vf29 (&-> at-0 camera-temp vector 1 quad))
|
||||
(.lvf vf30 (&-> at-0 camera-temp vector 2 quad))
|
||||
(.lvf vf31 (&-> at-0 camera-temp trans quad))
|
||||
)
|
||||
)
|
||||
(if (nonzero? (-> obj drawable-trees))
|
||||
(collect-stats (-> obj drawable-trees))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defun bsp-camera-asm ((arg0 bsp-header) (arg1 vector))
|
||||
"Determine which leaf node of the bsp we are in, and store this in the bsp-header."
|
||||
(local-vars
|
||||
(a2-1 object)
|
||||
(cam-pos-i1 uint128)
|
||||
(cam-pos-32 uint128)
|
||||
(cam-pos-16 uint128)
|
||||
(cam-pos-8 uint128)
|
||||
(t0-5 uint)
|
||||
(b-flag uint)
|
||||
(f-flag int)
|
||||
(front-max-compare uint128)
|
||||
(back-max-compare uint128)
|
||||
(front-min-compare uint128)
|
||||
(back-min-compare uint128)
|
||||
)
|
||||
(rlet ((Q :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf3 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(nop!)
|
||||
;; unlike in jak 1, we use integers here, and each level has an offset/scale
|
||||
(.lvf vf3 (&-> arg0 bsp-scale quad))
|
||||
(let ((nodes (the-as object (-> arg0 nodes))))
|
||||
;; apply scaling and offset.
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
(.lvf vf2 (&-> arg0 bsp-offset quad))
|
||||
(.sub.vf vf1 vf1 vf2 :mask #b111)
|
||||
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b0)
|
||||
(.wait.vf)
|
||||
(.mul.vf vf1 vf1 Q :mask #b1)
|
||||
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b1)
|
||||
(.wait.vf)
|
||||
(.mul.vf vf1 vf1 Q :mask #b10)
|
||||
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b10)
|
||||
(.wait.vf)
|
||||
(.mul.vf vf1 vf1 Q :mask #b100)
|
||||
(let ((a1-1 #xffffff)
|
||||
(nidx (the-as uint 0))
|
||||
)
|
||||
(vftoi15.xyzw vf1 vf1) ;; convert scaled/offset to integer
|
||||
(.mov cam-pos-i1 vf1)
|
||||
;; pack to 8-byte integers
|
||||
(.pw.sra cam-pos-32 cam-pos-i1 15)
|
||||
(.ppach cam-pos-16 (the-as uint128 0) cam-pos-32)
|
||||
(.ppacb cam-pos-8 (the-as uint128 0) (the-as int cam-pos-16))
|
||||
(let ((cam-pos-8m (the-as uint128 (logand (the-as int cam-pos-8) a1-1))))
|
||||
;; loop to go down the tree top
|
||||
(label cfg-1)
|
||||
(let ((node (the-as bsp-node (&+ (the-as pointer nodes) (+ (* nidx 16) (* nidx 4))))))
|
||||
(nop!)
|
||||
;; do comparisons
|
||||
(let ((front-min (the-as uint128 (-> node front-box-min clr))))
|
||||
(.pcgtb front-min-compare front-min cam-pos-8m)
|
||||
(let ((front-max (the-as uint128 (-> node front-box-max clr))))
|
||||
(.pcgtb front-max-compare front-max cam-pos-8m)
|
||||
)
|
||||
(let ((back-min (the-as uint128 (-> node back-box-min clr))))
|
||||
(.pcgtb back-min-compare back-min cam-pos-8m)
|
||||
(let ((back-max (the-as uint128 (-> node back-box-max clr))))
|
||||
(.pcgtb back-max-compare back-max cam-pos-8m)
|
||||
)
|
||||
;; check comparisons
|
||||
(let* ((front-idx (-> node front))
|
||||
(not-f-min (lognot (the-as int front-min-compare)))
|
||||
(not-b-min (lognot (the-as int back-min-compare)))
|
||||
(t4-1 (logand not-f-min (the-as int front-max-compare)))
|
||||
(t5-1 (logand not-b-min (the-as int back-max-compare)))
|
||||
(f-in-box (logand t4-1 a1-1))
|
||||
(b-in-box (logand t5-1 a1-1))
|
||||
)
|
||||
;; (.srl (the-as uint f-flag) (the-as uint front-min) 24)
|
||||
(set! f-flag (logand #xffffffff (shr front-min 24)))
|
||||
(let ((back-idx (the-as bsp-node (-> node back))))
|
||||
(b! (= f-in-box a1-1) cfg-4 :delay
|
||||
;(.srl b-flag (the-as int back-min) 24)
|
||||
(set! b-flag (the uint (logand #xffffffff (shr back-min 24))))
|
||||
)
|
||||
(b! (= b-in-box a1-1) cfg-7 :delay (set! t0-5 (the-as uint 1)))
|
||||
(b! #t cfg-11 :delay (set! (-> arg0 cam-outside-bsp) t0-5)) ;; outside of both, outside of bsp!
|
||||
(label cfg-4)
|
||||
(b! (zero? f-flag) cfg-1 :likely-delay (set! nidx (the uint front-idx)))
|
||||
(let ((v1-1 nidx))
|
||||
(set! (-> arg0 cam-using-back) (the-as uint 0)) ;; for whatever reason, store the side...
|
||||
(b! #t cfg-10 :delay (set! a2-1 front-idx))
|
||||
(label cfg-7)
|
||||
(b! (zero? b-flag) cfg-1 :likely-delay (set! nidx (the uint back-idx)))
|
||||
(set! v1-1 nidx)
|
||||
(set! a2-1 back-idx)
|
||||
(set! (-> arg0 cam-using-back) (the-as uint 1))
|
||||
(label cfg-10)
|
||||
(set! (-> arg0 current-leaf-idx) (the-as uint a2-1)) ;; store both leaf and thing before it.
|
||||
(set! (-> arg0 cam-box-idx) (the-as uint v1-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 cam-outside-bsp) (the-as uint 0)) ;; not outside of bsp if loop finished.
|
||||
(label cfg-11)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod collect-regions bsp-header ((obj bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
|
||||
"Recursively find all regions containing the sphere, add to region-prim-list"
|
||||
(let ((s3-0 (-> obj region-trees)))
|
||||
(dotimes (s2-0 (-> s3-0 length))
|
||||
(collect-regions (-> s3-0 s2-0) arg0 arg1 arg2)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun print-collide-stats ()
|
||||
"Display collide stats on screen."
|
||||
(format *stdcon* "~0k~%count cycles instr icache dcache vu0/to/from~%")
|
||||
(print-to-stream (-> *perf-stats* data 3) "collide" *stdcon*)
|
||||
(print-to-stream (-> *perf-stats* data 4) "collide-list" *stdcon*)
|
||||
(print-to-stream (-> *perf-stats* data 5) "collide-fill" *stdcon*)
|
||||
(format *stdcon* "~0k---------------------------------------------------------------~%")
|
||||
(format *stdcon* "~0kcalls = ~d~%" (-> *collide-stats* calls))
|
||||
(format *stdcon* "~0kspheres = ~d~256hspheres/call = ~f~%"
|
||||
(-> *collide-stats* spheres)
|
||||
(/ (the float (-> *collide-stats* spheres)) (the float (-> *collide-stats* calls)))
|
||||
)
|
||||
(format *stdcon* "~0knodes = ~d~256hnodes/call = ~f~%"
|
||||
(-> *collide-stats* nodes)
|
||||
(/ (the float (-> *collide-stats* nodes)) (the float (-> *collide-stats* calls)))
|
||||
)
|
||||
(format *stdcon* "~0kfrags = ~d~256hfrags/call = ~f~%"
|
||||
(-> *collide-stats* frags)
|
||||
(/ (the float (-> *collide-stats* frags)) (the float (-> *collide-stats* calls)))
|
||||
)
|
||||
(format *stdcon* "~0ktris = ~d~256htris/frag = ~f~%"
|
||||
(-> *collide-stats* tris)
|
||||
(/ (the float (-> *collide-stats* tris)) (the float (-> *collide-stats* frags)))
|
||||
)
|
||||
(format *stdcon* "~0koutput = ~d~256houtput/call = ~f~%"
|
||||
(-> *collide-stats* output)
|
||||
(/ (the float (-> *collide-stats* output)) (the float (-> *collide-stats* calls)))
|
||||
)
|
||||
(format *stdcon* "~0k---------------------------------------------------------------~%")
|
||||
(let ((gp-0 (stopwatch-elapsed-ticks (the-as stopwatch (&-> *collide-stats* pad0 1))))
|
||||
(s4-0 (stopwatch-elapsed-ticks (the-as stopwatch (&-> *collide-stats* total-target 7))))
|
||||
(s5-0 (stopwatch-elapsed-ticks (the-as stopwatch (&-> *collide-stats* target-cache-fill 7))))
|
||||
)
|
||||
(format *stdcon* "~0ktotal-target ~D~%" gp-0)
|
||||
(format *stdcon* "~0ktarget-cache-fill ~D ~0,,2f%~%" s4-0 (/ (* 100.0 (the float s4-0)) (the float gp-0)))
|
||||
(format *stdcon* "~0ktarget-ray-poly ~D ~0,,2f%~%" s5-0 (/ (* 100.0 (the float s5-0)) (the float gp-0)))
|
||||
)
|
||||
(set! (-> *collide-stats* calls) (the-as uint 0))
|
||||
(set! (-> *collide-stats* spheres) (the-as uint 0))
|
||||
(set! (-> *collide-stats* nodes) (the-as uint 0))
|
||||
(set! (-> *collide-stats* frags) (the-as uint 0))
|
||||
(set! (-> *collide-stats* tris) (the-as uint 0))
|
||||
(set! (-> *collide-stats* output) (the-as uint 0))
|
||||
(stopwatch-init (the-as stopwatch (&-> *collide-stats* pad0 1)))
|
||||
(stopwatch-init (the-as stopwatch (&-> *collide-stats* total-target 7)))
|
||||
(stopwatch-init (the-as stopwatch (&-> *collide-stats* target-cache-fill 7)))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun level-remap-texture ((arg0 texture-id))
|
||||
"Remap a texture id."
|
||||
(let ((v1-1 (-> *level* log-in-level-bsp)))
|
||||
(when v1-1
|
||||
(let* ((a3-0 (-> v1-1 texture-remap-table-len))
|
||||
@@ -36,4 +572,155 @@
|
||||
)
|
||||
)
|
||||
(the-as texture-id arg0)
|
||||
)
|
||||
)
|
||||
|
||||
(defun build-masks ((arg0 bsp-header))
|
||||
"Allocate texture masks as needed for a level."
|
||||
(let ((v1-0 (-> arg0 drawable-trees))
|
||||
(s2-0 (-> arg0 tfrag-mask-count))
|
||||
(s3-0 (-> arg0 shrub-mask-count))
|
||||
(s4-0 (-> arg0 alpha-mask-count))
|
||||
(gp-0 (-> arg0 water-mask-count))
|
||||
)
|
||||
(when (zero? (+ s2-0 s3-0 s4-0 gp-0))
|
||||
(dotimes (a0-5 (-> v1-0 length))
|
||||
(let ((a1-2 (-> v1-0 trees a0-5)))
|
||||
(cond
|
||||
((= (-> a1-2 type) drawable-tree-tfrag)
|
||||
(let* ((a2-5 (-> (the-as drawable-tree-tfrag a1-2) arrays (+ (-> (the-as drawable-tree-tfrag a1-2) length) -1)))
|
||||
(a1-4 (-> a2-5 length))
|
||||
(a2-6 (-> (the-as drawable-inline-array-tfrag a2-5) data))
|
||||
)
|
||||
(dotimes (a3-1 a1-4)
|
||||
(set! (-> a2-6 0 texture-masks-index) s2-0)
|
||||
(+! s2-0 1)
|
||||
(set! a2-6 (the-as (inline-array tfragment) (-> a2-6 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-tfrag-trans)
|
||||
(let* ((a2-13
|
||||
(-> (the-as drawable-tree-tfrag-trans a1-2) arrays (+ (-> (the-as drawable-tree-tfrag-trans a1-2) length) -1))
|
||||
)
|
||||
(a1-7 (-> a2-13 length))
|
||||
(a2-14 (-> (the-as drawable-inline-array-tfrag a2-13) data))
|
||||
)
|
||||
(dotimes (a3-3 a1-7)
|
||||
(set! (-> a2-14 0 texture-masks-index) s4-0)
|
||||
(+! s4-0 1)
|
||||
(set! a2-14 (the-as (inline-array tfragment) (-> a2-14 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-tfrag-water)
|
||||
(let* ((a2-21
|
||||
(-> (the-as drawable-tree-tfrag-water a1-2) arrays (+ (-> (the-as drawable-tree-tfrag-water a1-2) length) -1))
|
||||
)
|
||||
(a1-10 (-> a2-21 length))
|
||||
(a2-22 (-> (the-as drawable-inline-array-tfrag a2-21) data))
|
||||
)
|
||||
(dotimes (a3-5 a1-10)
|
||||
(set! (-> a2-22 0 texture-masks-index) gp-0)
|
||||
(+! gp-0 1)
|
||||
(set! a2-22 (the-as (inline-array tfragment) (-> a2-22 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-instance-tie)
|
||||
(let* ((a1-13 (-> (the-as drawable-tree-instance-tie a1-2) prototypes prototype-array-tie))
|
||||
(a2-26 (-> a1-13 length))
|
||||
)
|
||||
(dotimes (a3-7 a2-26)
|
||||
(cond
|
||||
((logtest? (-> a1-13 array-data a3-7 flags) (prototype-flags tpage-water))
|
||||
(set! (-> a1-13 array-data a3-7 texture-masks-index) gp-0)
|
||||
(+! gp-0 1)
|
||||
)
|
||||
((logtest? (-> a1-13 array-data a3-7 flags) (prototype-flags tpage-alpha))
|
||||
(set! (-> a1-13 array-data a3-7 texture-masks-index) s4-0)
|
||||
(+! s4-0 1)
|
||||
)
|
||||
(else
|
||||
(set! (-> a1-13 array-data a3-7 texture-masks-index) s2-0)
|
||||
(+! s2-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-instance-shrub)
|
||||
(let* ((a2-30 (-> (the-as drawable-tree-instance-shrub a1-2) info prototype-inline-array-shrub))
|
||||
(a1-16 (-> a2-30 length))
|
||||
(a2-31 (-> a2-30 data))
|
||||
)
|
||||
(dotimes (a3-9 a1-16)
|
||||
(set! (-> a2-31 0 texture-masks-index) s3-0)
|
||||
(+! s3-0 1)
|
||||
(set! a2-31 (the-as (inline-array prototype-bucket-shrub) (-> a2-31 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s2-0)
|
||||
(set! (-> arg0 tfrag-masks) (new 'loading-level 'texture-masks-array (the-as int s2-0)))
|
||||
(set! (-> arg0 tfrag-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s2-0 4)))))
|
||||
(let ((v1-5 (-> arg0 tfrag-masks)))
|
||||
(dotimes (a0-8 (the-as int s2-0))
|
||||
(let ((a1-24 (-> v1-5 data a0-8)))
|
||||
(dotimes (a2-34 3)
|
||||
(set! (-> a1-24 data a2-34 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s3-0)
|
||||
(set! (-> arg0 shrub-masks) (new 'loading-level 'texture-masks-array (the-as int s3-0)))
|
||||
(set! (-> arg0 shrub-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s3-0 4)))))
|
||||
(let ((v1-10 (-> arg0 shrub-masks)))
|
||||
(dotimes (a0-11 (the-as int s3-0))
|
||||
(let ((a1-32 (-> v1-10 data a0-11)))
|
||||
(dotimes (a2-36 3)
|
||||
(set! (-> a1-32 data a2-36 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s4-0)
|
||||
(set! (-> arg0 alpha-masks) (new 'loading-level 'texture-masks-array (the-as int s4-0)))
|
||||
(set! (-> arg0 alpha-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s4-0 4)))))
|
||||
(let ((v1-15 (-> arg0 alpha-masks)))
|
||||
(dotimes (a0-14 (the-as int s4-0))
|
||||
(let ((a1-40 (-> v1-15 data a0-14)))
|
||||
(dotimes (a2-38 3)
|
||||
(set! (-> a1-40 data a2-38 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? gp-0)
|
||||
(set! (-> arg0 water-masks) (new 'loading-level 'texture-masks-array (the-as int gp-0)))
|
||||
(set! (-> arg0 water-mask-count) (the-as uint (malloc 'loading-level (the-as int (* gp-0 4)))))
|
||||
(let ((v1-20 (-> arg0 water-masks)))
|
||||
(dotimes (a0-17 (the-as int gp-0))
|
||||
(let ((a1-48 (-> v1-20 data a0-17)))
|
||||
(dotimes (a2-40 3)
|
||||
(set! (-> a1-48 data a2-40 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1058,7 +1058,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? build-masks) (build-masks s5-0)) ;; ADDED nonzero check.
|
||||
(build-masks s5-0)
|
||||
)
|
||||
(set! (-> *login-state* state) -1)
|
||||
(set! (-> *login-state* pos) (the-as uint 0))
|
||||
@@ -1172,7 +1172,7 @@
|
||||
(let ((current-array (-> lstate elt (-> lstate state))))
|
||||
(cond
|
||||
((= (-> current-array type) drawable-inline-array-tfrag)
|
||||
(set! *texture-masks-array* (-> lev bsp tfrag-texture-masks-array))
|
||||
(set! *texture-masks-array* (-> lev bsp tfrag-masks))
|
||||
(cond
|
||||
((< login-state-pos (-> (the-as drawable-inline-array-tfrag current-array) length))
|
||||
(dotimes (s2-2 200)
|
||||
@@ -1200,16 +1200,14 @@
|
||||
(set! proto (-> proto-array array-data (the-as uint login-state-pos)))
|
||||
(+! (-> protos prototype-max-qwc) 32)
|
||||
(cond
|
||||
((logtest? (-> proto flags) 4)
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp tmask0 data (-> proto texture-masks-index)))
|
||||
((logtest? (-> proto flags) (prototype-flags tpage-alpha))
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp alpha-masks data (-> proto texture-masks-index)))
|
||||
)
|
||||
((logtest? (-> proto flags) 128)
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp tmask2 data (-> proto texture-masks-index)))
|
||||
((logtest? (-> proto flags) (prototype-flags tpage-water))
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp water-masks data (-> proto texture-masks-index)))
|
||||
)
|
||||
(else
|
||||
(set! *texture-masks*
|
||||
(-> *level* level *level-index* bsp tfrag-texture-masks-array data (-> proto texture-masks-index))
|
||||
)
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp tfrag-masks data (-> proto texture-masks-index)))
|
||||
)
|
||||
)
|
||||
(when (and *debug-segment* (-> *screen-shot-work* highres-enable))
|
||||
@@ -1239,16 +1237,14 @@
|
||||
(dotimes (proto2-idx (-> proto-array length))
|
||||
(let ((proto2 (-> proto-array array-data proto2-idx)))
|
||||
(cond
|
||||
((logtest? (-> proto2 flags) 4)
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp tmask0 data (-> proto2 texture-masks-index)))
|
||||
((logtest? (-> proto2 flags) (prototype-flags tpage-alpha))
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp alpha-masks data (-> proto2 texture-masks-index)))
|
||||
)
|
||||
((logtest? (-> proto2 flags) 128)
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp tmask2 data (-> proto2 texture-masks-index)))
|
||||
((logtest? (-> proto2 flags) (prototype-flags tpage-water))
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp water-masks data (-> proto2 texture-masks-index)))
|
||||
)
|
||||
(else
|
||||
(set! *texture-masks*
|
||||
(-> *level* level *level-index* bsp tfrag-texture-masks-array data (-> proto2 texture-masks-index))
|
||||
)
|
||||
(set! *texture-masks* (-> *level* level *level-index* bsp tfrag-masks data (-> proto2 texture-masks-index)))
|
||||
)
|
||||
)
|
||||
(let ((envmap-shader (-> proto2 envmap-shader)))
|
||||
@@ -1751,7 +1747,7 @@
|
||||
#t
|
||||
)
|
||||
(else
|
||||
(zero? (-> obj bsp require-force-inside))
|
||||
(zero? (-> obj bsp cam-outside-bsp))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2761,7 +2757,7 @@
|
||||
(when (= (-> v1-96 status) 'active)
|
||||
(if (and (= (-> v1-96 status) 'active)
|
||||
(!= (-> v1-96 display?) 'special)
|
||||
(nonzero? (-> v1-96 bsp require-force-inside))
|
||||
(nonzero? (-> v1-96 bsp cam-outside-bsp))
|
||||
)
|
||||
(format *stdcon* "~3Loutside of bsp ~S~%~0L" (-> v1-96 name))
|
||||
)
|
||||
|
||||
@@ -5,13 +5,12 @@
|
||||
;; name in dgo: focus
|
||||
;; dgos: ENGINE, GAME
|
||||
|
||||
;; TODO: not done
|
||||
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype focus (structure)
|
||||
((handle handle :offset-assert 0)
|
||||
(collide-with collide-spec :offset-assert 8)
|
||||
((handle handle :offset-assert 0)
|
||||
(collide-with collide-spec :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #xc
|
||||
@@ -23,3 +22,40 @@
|
||||
(try-update-focus (_type_ process-focusable) symbol 12)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod reset-to-collide-spec focus ((obj focus) (arg0 collide-spec))
|
||||
(set! (-> obj collide-with) arg0)
|
||||
(set! (-> obj handle) (the-as handle #f))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod collide-check? focus ((obj focus) (arg0 process-focusable))
|
||||
(when (and arg0 (zero? (logand (-> arg0 focus-status) (focus-status disable dead))))
|
||||
(let* ((s5-0 (-> arg0 root))
|
||||
(v1-2 (if (type? s5-0 collide-shape)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(and v1-2 (logtest? (-> obj collide-with) (-> (the-as collide-shape v1-2) root-prim prim-core collide-as)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod try-update-focus focus ((obj focus) (arg0 process-focusable))
|
||||
(when (!= (handle->process (-> obj handle)) arg0)
|
||||
(set! (-> obj handle) (process->handle arg0))
|
||||
#t
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod clear-focused focus ((obj focus))
|
||||
(set! (-> obj handle) (the-as handle #f))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -570,6 +570,7 @@ class Compiler {
|
||||
Val* compile_asm_pcpyud(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_asm_pcpyld(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_asm_ppach(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_asm_ppacb(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_asm_psubw(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
Val* compile_asm_xorp(const goos::Object& form, const goos::Object& rest, Env* env);
|
||||
|
||||
|
||||
@@ -1600,6 +1600,9 @@ std::string IR_Int128Math3Asm::print() {
|
||||
case Kind::PAND:
|
||||
function = ".pand";
|
||||
break;
|
||||
case Kind::PACKUSWB:
|
||||
function = ".packuswb";
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
}
|
||||
@@ -1687,6 +1690,9 @@ void IR_Int128Math3Asm::do_codegen(emitter::ObjectGenerator* gen,
|
||||
case Kind::PAND:
|
||||
gen->add_instr(IGen::parallel_bitwise_and(dst, src2, src1), irec);
|
||||
break;
|
||||
case Kind::PACKUSWB:
|
||||
gen->add_instr(IGen::vpackuswb(dst, src1, src2), irec);
|
||||
break;
|
||||
default:
|
||||
ASSERT(false);
|
||||
}
|
||||
@@ -1770,6 +1776,14 @@ std::string IR_Int128Math2Asm::print() {
|
||||
use_imm = true;
|
||||
function = ".pw.sra";
|
||||
break;
|
||||
case Kind::PH_SLL:
|
||||
use_imm = true;
|
||||
function = ".ph.sll";
|
||||
break;
|
||||
case Kind::PH_SRL:
|
||||
use_imm = true;
|
||||
function = ".ph.srl";
|
||||
break;
|
||||
case Kind::VPSRLDQ:
|
||||
use_imm = true;
|
||||
function = ".VPSRLDQ";
|
||||
@@ -1829,6 +1843,19 @@ void IR_Int128Math2Asm::do_codegen(emitter::ObjectGenerator* gen,
|
||||
ASSERT(*m_imm <= 255);
|
||||
gen->add_instr(IGen::pw_srl(dst, src, *m_imm), irec);
|
||||
break;
|
||||
case Kind::PH_SLL:
|
||||
// you are technically allowed to put values > 32 in here.
|
||||
ASSERT(m_imm.has_value());
|
||||
ASSERT(*m_imm >= 0);
|
||||
ASSERT(*m_imm <= 255);
|
||||
gen->add_instr(IGen::ph_sll(dst, src, *m_imm), irec);
|
||||
break;
|
||||
case Kind::PH_SRL:
|
||||
ASSERT(m_imm.has_value());
|
||||
ASSERT(*m_imm >= 0);
|
||||
ASSERT(*m_imm <= 255);
|
||||
gen->add_instr(IGen::ph_srl(dst, src, *m_imm), irec);
|
||||
break;
|
||||
case Kind::PW_SRA:
|
||||
ASSERT(m_imm.has_value());
|
||||
ASSERT(*m_imm >= 0);
|
||||
|
||||
+3
-2
@@ -583,7 +583,8 @@ class IR_Int128Math3Asm : public IR_Asm {
|
||||
PCGTW,
|
||||
POR,
|
||||
PXOR,
|
||||
PAND
|
||||
PAND,
|
||||
PACKUSWB
|
||||
};
|
||||
IR_Int128Math3Asm(bool use_color,
|
||||
const RegVal* dst,
|
||||
@@ -605,7 +606,7 @@ class IR_Int128Math3Asm : public IR_Asm {
|
||||
|
||||
class IR_Int128Math2Asm : public IR_Asm {
|
||||
public:
|
||||
enum class Kind { PW_SLL, PW_SRL, PW_SRA, VPSRLDQ, VPSLLDQ, VPSHUFLW, VPSHUFHW };
|
||||
enum class Kind { PW_SLL, PW_SRL, PH_SLL, PH_SRL, PW_SRA, VPSRLDQ, VPSLLDQ, VPSHUFLW, VPSHUFHW };
|
||||
IR_Int128Math2Asm(bool use_color,
|
||||
const RegVal* dst,
|
||||
const RegVal* src,
|
||||
|
||||
@@ -769,6 +769,34 @@ Val* Compiler::compile_asm_ppach(const goos::Object& form, const goos::Object& r
|
||||
return get_none();
|
||||
}
|
||||
|
||||
Val* Compiler::compile_asm_ppacb(const goos::Object& form, const goos::Object& rest, Env* env) {
|
||||
auto args = get_va(form, rest);
|
||||
va_check(form, args, {{}, {}, {}}, {});
|
||||
|
||||
auto dest = compile_error_guard(args.unnamed.at(0), env)->to_reg(form, env);
|
||||
auto src1 = compile_error_guard(args.unnamed.at(1), env)->to_xmm128(form, env); // rs
|
||||
auto src2 = compile_error_guard(args.unnamed.at(2), env)->to_xmm128(form, env); // rt
|
||||
auto temp = env->make_ireg(TypeSpec("uint128"), RegClass::INT_128);
|
||||
|
||||
if (!dest->settable()) {
|
||||
throw_compiler_error(form, "Cannot set destination");
|
||||
}
|
||||
if (dest->ireg().reg_class != RegClass::VECTOR_FLOAT &&
|
||||
dest->ireg().reg_class != RegClass::INT_128) {
|
||||
throw_compiler_error(form, "Destination must be vector float or int128");
|
||||
}
|
||||
|
||||
env->emit_ir<IR_RegSet>(form, temp, src1);
|
||||
env->emit_ir<IR_RegSet>(form, dest, src2);
|
||||
env->emit_ir<IR_Int128Math2Asm>(form, true, temp, temp, IR_Int128Math2Asm::Kind::PH_SLL, 8);
|
||||
env->emit_ir<IR_Int128Math2Asm>(form, true, dest, dest, IR_Int128Math2Asm::Kind::PH_SLL, 8);
|
||||
env->emit_ir<IR_Int128Math2Asm>(form, true, temp, temp, IR_Int128Math2Asm::Kind::PH_SRL, 8);
|
||||
env->emit_ir<IR_Int128Math2Asm>(form, true, dest, dest, IR_Int128Math2Asm::Kind::PH_SRL, 8);
|
||||
// swapped on purpose, ps2 is backward (first arg goes low on x86, first arg goes high on ps2)
|
||||
env->emit_ir<IR_Int128Math3Asm>(form, true, dest, dest, temp, IR_Int128Math3Asm::Kind::PACKUSWB);
|
||||
return get_none();
|
||||
}
|
||||
|
||||
Val* Compiler::compile_asm_xorp(const goos::Object& form, const goos::Object& rest, Env* env) {
|
||||
auto args = get_va(form, rest);
|
||||
va_check(form, args, {{}, {}, {}}, {});
|
||||
|
||||
@@ -125,6 +125,7 @@ const std::unordered_map<
|
||||
{".pcpyud", &Compiler::compile_asm_pcpyud},
|
||||
{".pceqw", &Compiler::compile_asm_pceqw},
|
||||
{".ppach", &Compiler::compile_asm_ppach},
|
||||
{".ppacb", &Compiler::compile_asm_ppacb},
|
||||
{".psubw", &Compiler::compile_asm_psubw},
|
||||
|
||||
// BLOCK FORMS
|
||||
|
||||
@@ -2424,6 +2424,17 @@ class IGen {
|
||||
return instr;
|
||||
}
|
||||
|
||||
static Instruction ph_srl(Register dst, Register src, u8 imm) {
|
||||
ASSERT(dst.is_xmm());
|
||||
ASSERT(src.is_xmm());
|
||||
// VEX.128.66.0F.WIG 71 /2 ib VPSRLW
|
||||
Instruction instr(0x71);
|
||||
instr.set_vex_modrm_and_rex(2, src.hw_id(), VEX3::LeadingBytes::P_0F, dst.hw_id(), false,
|
||||
VexPrefix::P_66);
|
||||
instr.set(Imm(1, imm));
|
||||
return instr;
|
||||
}
|
||||
|
||||
static Instruction pw_sll(Register dst, Register src, u8 imm) {
|
||||
ASSERT(dst.is_xmm());
|
||||
ASSERT(src.is_xmm());
|
||||
@@ -2434,6 +2445,16 @@ class IGen {
|
||||
instr.set(Imm(1, imm));
|
||||
return instr;
|
||||
}
|
||||
static Instruction ph_sll(Register dst, Register src, u8 imm) {
|
||||
ASSERT(dst.is_xmm());
|
||||
ASSERT(src.is_xmm());
|
||||
// VEX.128.66.0F.WIG 71 /6 ib VPSLLW xmm1, xmm2, imm8
|
||||
Instruction instr(0x71);
|
||||
instr.set_vex_modrm_and_rex(6, src.hw_id(), VEX3::LeadingBytes::P_0F, dst.hw_id(), false,
|
||||
VexPrefix::P_66);
|
||||
instr.set(Imm(1, imm));
|
||||
return instr;
|
||||
}
|
||||
|
||||
static Instruction parallel_bitwise_or(Register dst, Register src0, Register src1) {
|
||||
ASSERT(dst.is_xmm());
|
||||
@@ -2714,5 +2735,18 @@ class IGen {
|
||||
instr.set(Imm(1, imm));
|
||||
return instr;
|
||||
}
|
||||
|
||||
static Instruction vpackuswb(Register dst, Register src0, Register src1) {
|
||||
ASSERT(dst.is_xmm());
|
||||
ASSERT(src0.is_xmm());
|
||||
ASSERT(src1.is_xmm());
|
||||
// VEX.128.66.0F.WIG 67 /r VPACKUSWB xmm1, xmm2, xmm3/m128
|
||||
// reg, vex, r/m
|
||||
|
||||
Instruction instr(0x67);
|
||||
instr.set_vex_modrm_and_rex(dst.hw_id(), src1.hw_id(), VEX3::LeadingBytes::P_0F, src0.hw_id(),
|
||||
false, VexPrefix::P_66);
|
||||
return instr;
|
||||
}
|
||||
};
|
||||
} // namespace emitter
|
||||
|
||||
+250
-274
@@ -89,8 +89,7 @@
|
||||
|
||||
;; definition for function update-visible
|
||||
;; INFO: Used lq/sq
|
||||
;; ERROR: failed type prop at 93: Could not figure out load: (set! a1 (l.hu (+ a1 124)))
|
||||
;; WARN: Return type mismatch none vs symbol.
|
||||
;; ERROR: failed type prop at 290: Could not figure out load: (set! v1 (l.w s3))
|
||||
(defun update-visible ((a0-0 math-camera))
|
||||
(local-vars
|
||||
(v0-0 none)
|
||||
@@ -98,16 +97,16 @@
|
||||
(v0-2 none)
|
||||
(v0-3 none)
|
||||
(v0-4 none)
|
||||
(v0-5 none)
|
||||
(v0-5 object)
|
||||
(v0-6 none)
|
||||
(v0-7 none)
|
||||
(v0-8 none)
|
||||
(v0-9 none)
|
||||
(v0-9 symbol)
|
||||
(v1-0 symbol)
|
||||
(v1-2 none)
|
||||
(v1-3 none)
|
||||
(v1-4 none)
|
||||
(v1-5 none)
|
||||
(v1-2 int)
|
||||
(v1-3 int)
|
||||
(v1-4 int)
|
||||
(v1-5 level)
|
||||
(v1-6 level-group)
|
||||
(v1-7 int)
|
||||
(v1-10 int)
|
||||
@@ -132,47 +131,47 @@
|
||||
(v1-31 int)
|
||||
(v1-32 symbol)
|
||||
(v1-33 symbol)
|
||||
(v1-34 none)
|
||||
(v1-37 none)
|
||||
(v1-34 symbol)
|
||||
(v1-37 type)
|
||||
(v1-38 none)
|
||||
(v1-40 none)
|
||||
(v1-44 none)
|
||||
(v1-45 none)
|
||||
(v1-46 none)
|
||||
(v1-48 none)
|
||||
(v1-50 none)
|
||||
(v1-40 int)
|
||||
(v1-44 symbol)
|
||||
(v1-45 symbol)
|
||||
(v1-46 level-group)
|
||||
(v1-48 bsp-header)
|
||||
(v1-50 bsp-header)
|
||||
(v1-52 level-group)
|
||||
(v1-53 int)
|
||||
(v1-56 none)
|
||||
(v1-57 none)
|
||||
(v1-58 none)
|
||||
(v1-60 none)
|
||||
(v1-61 none)
|
||||
(v1-62 none)
|
||||
(v1-63 none)
|
||||
(v1-64 none)
|
||||
(v1-65 none)
|
||||
(v1-66 none)
|
||||
(v1-68 none)
|
||||
(v1-69 none)
|
||||
(v1-70 none)
|
||||
(v1-71 none)
|
||||
(v1-72 none)
|
||||
(v1-73 none)
|
||||
(v1-74 none)
|
||||
(v1-75 none)
|
||||
(v1-76 none)
|
||||
(v1-77 none)
|
||||
(v1-78 none)
|
||||
(v1-79 none)
|
||||
(v1-56 symbol)
|
||||
(v1-57 symbol)
|
||||
(v1-58 symbol)
|
||||
(v1-60 int)
|
||||
(v1-61 int)
|
||||
(v1-62 int)
|
||||
(v1-63 int)
|
||||
(v1-64 int)
|
||||
(v1-65 int)
|
||||
(v1-66 symbol)
|
||||
(v1-68 symbol)
|
||||
(v1-69 symbol)
|
||||
(v1-70 symbol)
|
||||
(v1-71 symbol)
|
||||
(v1-72 int)
|
||||
(v1-73 int)
|
||||
(v1-74 bsp-header)
|
||||
(v1-75 bsp-header)
|
||||
(v1-76 bsp-header)
|
||||
(v1-77 uint)
|
||||
(v1-78 bsp-header)
|
||||
(v1-79 uint)
|
||||
(v1-81 none)
|
||||
(v1-82 none)
|
||||
(v1-83 none)
|
||||
(v1-84 none)
|
||||
(v1-86 none)
|
||||
(v1-87 none)
|
||||
(v1-88 none)
|
||||
(v1-89 none)
|
||||
(v1-82 symbol)
|
||||
(v1-83 symbol)
|
||||
(v1-84 symbol)
|
||||
(v1-86 bsp-header)
|
||||
(v1-87 bsp-header)
|
||||
(v1-88 bsp-header)
|
||||
(v1-89 uint)
|
||||
(v1-91 none)
|
||||
(v1-92 none)
|
||||
(v1-93 none)
|
||||
@@ -191,44 +190,44 @@
|
||||
(v1-109 none)
|
||||
(v1-111 none)
|
||||
(v1-112 none)
|
||||
(v1-115 none)
|
||||
(v1-116 none)
|
||||
(a0-1 none)
|
||||
(a0-2 none)
|
||||
(a0-4 none)
|
||||
(a0-5 none)
|
||||
(a0-6 none)
|
||||
(a0-7 none)
|
||||
(a0-9 none)
|
||||
(v1-115 level-group)
|
||||
(v1-116 int)
|
||||
(a0-1 level-group)
|
||||
(a0-2 symbol)
|
||||
(a0-4 bsp-header)
|
||||
(a0-5 (inline-array bsp-node))
|
||||
(a0-6 symbol)
|
||||
(a0-7 symbol)
|
||||
(a0-9 bsp-header)
|
||||
(a0-11 level-group)
|
||||
(a0-12 symbol)
|
||||
(a0-13 pointer)
|
||||
(a0-14 symbol)
|
||||
(a0-15 bsp-header)
|
||||
(a0-15 basic)
|
||||
(a0-17 int)
|
||||
(a0-18 int)
|
||||
(a0-19 int)
|
||||
(a0-20 uint)
|
||||
(a0-23 none)
|
||||
(a0-24 none)
|
||||
(a0-25 none)
|
||||
(a0-26 none)
|
||||
(a0-27 none)
|
||||
(a0-28 none)
|
||||
(a0-29 none)
|
||||
(a0-30 none)
|
||||
(a0-31 none)
|
||||
(a0-32 none)
|
||||
(a0-33 none)
|
||||
(a0-34 none)
|
||||
(a0-35 none)
|
||||
(a0-36 none)
|
||||
(a0-37 none)
|
||||
(a0-38 none)
|
||||
(a0-39 none)
|
||||
(a0-40 none)
|
||||
(a0-41 none)
|
||||
(a0-42 none)
|
||||
(a0-23 symbol)
|
||||
(a0-24 level)
|
||||
(a0-25 int)
|
||||
(a0-26 int)
|
||||
(a0-27 level-vis-info)
|
||||
(a0-28 symbol)
|
||||
(a0-29 symbol)
|
||||
(a0-30 pointer)
|
||||
(a0-31 pointer)
|
||||
(a0-32 cpad-list)
|
||||
(a0-33 cpad-info)
|
||||
(a0-34 pad-buttons)
|
||||
(a0-35 pad-buttons)
|
||||
(a0-36 level-group)
|
||||
(a0-37 symbol)
|
||||
(a0-38 int)
|
||||
(a0-39 int)
|
||||
(a0-40 string)
|
||||
(a0-41 int)
|
||||
(a0-42 int)
|
||||
(a0-43 none)
|
||||
(a0-45 none)
|
||||
(a0-47 none)
|
||||
@@ -267,20 +266,20 @@
|
||||
(a0-81 none)
|
||||
(a0-82 none)
|
||||
(a0-83 none)
|
||||
(a1-0 none)
|
||||
(a1-1 none)
|
||||
(a1-0 symbol)
|
||||
(a1-1 vector)
|
||||
(a1-2 (pointer uint16))
|
||||
(a1-3 vis-info-flag)
|
||||
(a1-4 bsp-header)
|
||||
(a1-5 none)
|
||||
(a1-9 none)
|
||||
(a1-10 none)
|
||||
(a1-11 none)
|
||||
(a1-12 none)
|
||||
(a1-13 none)
|
||||
(a1-14 none)
|
||||
(a1-15 none)
|
||||
(a1-16 none)
|
||||
(a1-5 uint)
|
||||
(a1-9 int)
|
||||
(a1-10 (pointer uint16))
|
||||
(a1-11 (pointer uint16))
|
||||
(a1-12 int)
|
||||
(a1-13 int)
|
||||
(a1-14 string)
|
||||
(a1-15 int)
|
||||
(a1-16 int)
|
||||
(a1-17 none)
|
||||
(a1-18 none)
|
||||
(a1-19 none)
|
||||
@@ -307,49 +306,46 @@
|
||||
(a1-40 none)
|
||||
(a1-41 none)
|
||||
(a2-0 int)
|
||||
(a2-1 none)
|
||||
(a2-2 none)
|
||||
(a2-4 none)
|
||||
(a2-5 none)
|
||||
(a2-1 uint)
|
||||
(a2-2 int)
|
||||
(a2-4 symbol)
|
||||
(a2-5 int)
|
||||
(a2-7 none)
|
||||
(a2-8 none)
|
||||
(a2-9 none)
|
||||
(a3-0 none)
|
||||
(a3-1 none)
|
||||
(a3-2 none)
|
||||
(a3-3 none)
|
||||
(a3-0 uint)
|
||||
(a3-1 int)
|
||||
(a3-2 int)
|
||||
(a3-3 int)
|
||||
(a3-4 none)
|
||||
(a3-5 none)
|
||||
(a3-6 none)
|
||||
(a3-7 none)
|
||||
(t0-0 none)
|
||||
(t0-2 none)
|
||||
(t0-0 int)
|
||||
(t0-2 uint)
|
||||
(t0-3 none)
|
||||
(t0-4 none)
|
||||
(t0-5 none)
|
||||
(t1-0 none)
|
||||
(t2-0 none)
|
||||
(t2-1 none)
|
||||
(t3-0 none)
|
||||
(t3-1 none)
|
||||
(s2-0 none)
|
||||
(s3-0 none)
|
||||
(t1-0 uint)
|
||||
(t2-0 string)
|
||||
(t3-0 string)
|
||||
(s2-0 int)
|
||||
(s3-0 uint)
|
||||
(s4-0 level-vis-info)
|
||||
(s4-1 none)
|
||||
(s4-1 uint)
|
||||
(s5-0 int)
|
||||
(s5-1 level)
|
||||
(s5-2 none)
|
||||
(t9-0 none)
|
||||
(s5-2 level)
|
||||
(t9-0 (function bsp-header vector none))
|
||||
(t9-1 (function pointer pointer int none))
|
||||
(t9-2 none)
|
||||
(t9-3 none)
|
||||
(t9-4 none)
|
||||
(t9-5 none)
|
||||
(t9-2 (function none))
|
||||
(t9-3 (function pointer pointer int none))
|
||||
(t9-4 (function pointer pointer int none))
|
||||
(t9-5 (function _varargs_ object))
|
||||
(t9-6 none)
|
||||
(t9-7 none)
|
||||
(t9-8 none)
|
||||
(gp-1 int)
|
||||
(gp-2 none)
|
||||
(gp-2 int)
|
||||
(sp-0 none)
|
||||
(f0-0 none)
|
||||
(f0-1 none)
|
||||
@@ -430,35 +426,29 @@
|
||||
(set! s5-0 0)
|
||||
(while (begin (set! v1-6 *level*) (set! v1-7 (-> v1-6 length)) (<.si s5-0 v1-7))
|
||||
(when (begin
|
||||
(set! v1-2 (the-as none 5232))
|
||||
(set! v1-3 (the-as none (*.si v1-2 s5-0)))
|
||||
(set! v1-4 (the-as none (+ v1-3 256)))
|
||||
(set! a0-1 (the-as none *level*))
|
||||
(set! v1-5 (the-as none (+ v1-4 a0-1)))
|
||||
(set! a0-2 (the-as none 'active))
|
||||
(set! a1-0 (the-as none (l.wu (+ v1-5 16))))
|
||||
(set! v1-2 5232)
|
||||
(set! v1-3 (*.si v1-2 s5-0))
|
||||
(set! v1-4 (+ v1-3 256))
|
||||
(set! a0-1 *level*)
|
||||
(set! v1-5 (+ v1-4 a0-1))
|
||||
(set! a0-2 'active)
|
||||
(set! a1-0 (-> v1-5 status))
|
||||
(= a1-0 a0-2)
|
||||
)
|
||||
(when (begin
|
||||
(and (begin
|
||||
(set! a0-4 (the-as none (l.wu (+ v1-5 92))))
|
||||
(set! a0-5 (the-as none (l.wu (+ a0-4 116))))
|
||||
(nonzero? a0-5)
|
||||
)
|
||||
(or (begin (set! a0-7 (the-as none *update-leaf-when-outside-bsp*)) a0-7)
|
||||
(set! a0-6 (the-as none (l.wu (+ v1-5 392))))
|
||||
)
|
||||
(and (begin (set! a0-4 (-> v1-5 bsp)) (set! a0-5 (-> a0-4 nodes)) (nonzero? a0-5))
|
||||
(or (begin (set! a0-7 *update-leaf-when-outside-bsp*) a0-7) (set! a0-6 (-> v1-5 inside-boxes)))
|
||||
)
|
||||
a0-6
|
||||
)
|
||||
(set! t9-0 (the-as none bsp-camera-asm))
|
||||
(set! a0-9 (the-as none (l.wu (+ v1-5 92))))
|
||||
(set! a1-1 (the-as none (+ a0-0 924)))
|
||||
(call!)
|
||||
(set! a0-10 (the-as none v0-0))
|
||||
(set! t9-0 bsp-camera-asm)
|
||||
(set! a0-9 (-> v1-5 bsp))
|
||||
(set! a1-1 (-> a0-0 trans))
|
||||
(call! a0-9 a1-1)
|
||||
(set! a0-10 v0-0)
|
||||
)
|
||||
)
|
||||
(set! s5-0 (the-as int (+ s5-0 1)))
|
||||
(set! s5-0 (+ s5-0 1))
|
||||
)
|
||||
(set! gp-1 0)
|
||||
(while (begin (set! v1-52 *level*) (set! v1-53 (-> v1-52 length)) (<.si gp-1 v1-53))
|
||||
@@ -484,7 +474,7 @@
|
||||
v1-18
|
||||
)
|
||||
(set! v1-19 (-> s5-1 all-visible?))
|
||||
(set! v1-19 (the-as symbol #t))
|
||||
(set! v1-19 #t)
|
||||
)
|
||||
(set! (-> s5-1 all-visible?) v1-19)
|
||||
(set! v1-20 (-> s5-1 force-all-visible?))
|
||||
@@ -538,191 +528,177 @@
|
||||
(cmove-#f-zero v1-32 a0-19 v1-33)
|
||||
(set! a0-20 (-> s4-0 length))
|
||||
(set! a1-4 (-> s4-0 from-bsp))
|
||||
(set! a1-5 (the-as none (l.hu (+ a1-4 124))))
|
||||
(set! a1-5 (-> a1-4 current-leaf-idx))
|
||||
(<.ui a0-20 a1-5)
|
||||
)
|
||||
(set! v1-32 (the-as symbol #f))
|
||||
(set! a0-22 (the-as none v1-32))
|
||||
(set! v1-32 #f)
|
||||
(set! a0-22 v1-32)
|
||||
)
|
||||
)
|
||||
v1-32
|
||||
)
|
||||
(when (begin
|
||||
(if (begin (set! v1-34 (the-as none 'loading)) (set! a0-23 (the-as none (l.wu (+ s5-1 2392)))) (!= a0-23 v1-34))
|
||||
(s.w! (+ s5-1 2392) #f)
|
||||
(if (begin (set! v1-34 'loading) (set! a0-23 (-> s5-1 all-visible?)) (!= a0-23 v1-34))
|
||||
(set! (-> s5-1 all-visible?) #f)
|
||||
)
|
||||
(set! a0-24 (the-as none s5-1))
|
||||
(set! v1-37 (the-as none (l.wu (+ a0-24 -4))))
|
||||
(set! t9-2 (the-as none (l.wu (+ v1-37 80))))
|
||||
(set! a1-6 (the-as none s4-0))
|
||||
(set! a2-1 (the-as none (l.wu (+ s4-0 36))))
|
||||
(set! a3-0 (the-as none (l.wu (+ s4-0 32))))
|
||||
(set! v0-2 (the-as none (call!)))
|
||||
(set! v1-38 (the-as none v0-2))
|
||||
(set! a0-24 s5-1)
|
||||
(set! v1-37 (-> a0-24 type))
|
||||
(set! t9-2 (method-of-type v1-37 level-method-16))
|
||||
(set! a1-6 s4-0)
|
||||
(set! a2-1 (-> s4-0 ramdisk))
|
||||
(set! a3-0 (-> s4-0 string-block))
|
||||
(set! v0-2 (call!))
|
||||
(set! v1-38 v0-2)
|
||||
v1-38
|
||||
)
|
||||
(set! v1-40 (the-as none 8))
|
||||
(set! v1-40 8)
|
||||
(while (nonzero? v1-40)
|
||||
(when (begin
|
||||
(set! v1-40 (the-as none (+ v1-40 -1)))
|
||||
(set! a0-25 (the-as none (sll v1-40 2)))
|
||||
(set! a0-26 (the-as none (+ a0-25 s5-1)))
|
||||
(set! a0-27 (the-as none (l.wu (+ a0-26 2404))))
|
||||
(set! v1-40 (+ v1-40 -1))
|
||||
(set! a0-25 (sll v1-40 2))
|
||||
(set! a0-26 (+ a0-25 s5-1))
|
||||
(set! a0-27 (dynamic-array-field-access a0-26 vis-info PLACEHOLDER))
|
||||
a0-27
|
||||
)
|
||||
(when (!= a0-27 s4-0)
|
||||
(set! a1-9 (the-as none -1))
|
||||
(s.w! (+ a0-27 44) a1-9)
|
||||
(set! a1-9 -1)
|
||||
(set! (-> a0-27 current-vis-string) (the-as uint a1-9))
|
||||
)
|
||||
)
|
||||
)
|
||||
(s.w! (+ s5-1 2392) #f)
|
||||
(set! (-> s5-1 all-visible?) #f)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(and (begin
|
||||
(set! v1-44 (the-as none (l.wu (+ s5-1 2392))))
|
||||
(set! a0-28 (the-as none 'loading))
|
||||
(set! a0-29 (the-as none (= v1-44 a0-28)))
|
||||
a0-29
|
||||
)
|
||||
(begin (set! v1-46 (the-as none *level*)) (set! v1-45 (the-as none (l.wu (+ v1-46 36)))))
|
||||
(and (begin (set! v1-44 (-> s5-1 all-visible?)) (set! a0-28 'loading) (set! a0-29 (= v1-44 a0-28)) a0-29)
|
||||
(begin (set! v1-46 *level*) (set! v1-45 (-> v1-46 play?)))
|
||||
)
|
||||
(cond
|
||||
(v1-45
|
||||
)
|
||||
(else
|
||||
(set! t9-3 (the-as none quad-copy!))
|
||||
(set! a0-30 (the-as none (l.wu (+ s5-1 2388))))
|
||||
(set! v1-48 (the-as none (l.wu (+ s5-1 92))))
|
||||
(set! a1-10 (the-as none (l.wu (+ v1-48 28))))
|
||||
(call!)
|
||||
(set! v1-49 (the-as none v0-3))
|
||||
(set! t9-3 quad-copy!)
|
||||
(set! a0-30 (-> s5-1 vis-bits))
|
||||
(set! v1-48 (-> s5-1 bsp))
|
||||
(set! a1-10 (-> v1-48 all-visible-list))
|
||||
(call! a0-30 a1-10 a2-0)
|
||||
(set! v1-49 v0-3)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(set! t9-4 (the-as none quad-copy!))
|
||||
(set! a0-31 (the-as none (-> s5-1 vis-bits)))
|
||||
(set! v1-50 (the-as none (-> s5-1 bsp)))
|
||||
(set! a1-11 (the-as none (l.wu (+ v1-50 28))))
|
||||
(call!)
|
||||
(set! v1-51 (the-as none v0-4))
|
||||
(set! t9-4 quad-copy!)
|
||||
(set! a0-31 (-> s5-1 vis-bits))
|
||||
(set! v1-50 (-> s5-1 bsp))
|
||||
(set! a1-11 (-> v1-50 all-visible-list))
|
||||
(call! a0-31 a1-11 a2-0)
|
||||
(set! v1-51 v0-4)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! gp-1 (the-as int (+ gp-1 1)))
|
||||
(set! gp-1 (+ gp-1 1))
|
||||
)
|
||||
)
|
||||
(when (begin
|
||||
(and (begin (set! v1-56 (the-as none *artist-fix-visible*)) v1-56)
|
||||
(begin
|
||||
(set! v1-58 (the-as none #t))
|
||||
(set! a0-32 (the-as none *cpad-list*))
|
||||
(set! a0-33 (the-as none (l.wu (+ a0-32 4))))
|
||||
(set! a0-34 (the-as none (l.wu (+ a0-33 56))))
|
||||
(set! a0-35 (the-as none (logand a0-34 512)))
|
||||
(cmove-#f-zero v1-57 a0-35 v1-58)
|
||||
)
|
||||
(and (begin (set! v1-56 *artist-fix-visible*) v1-56) (begin
|
||||
(set! v1-58 #t)
|
||||
(set! a0-32 *cpad-list*)
|
||||
(set! a0-33 (-> a0-32 cpads 0))
|
||||
(set! a0-34 (-> a0-33 button0-rel 0))
|
||||
(set! a0-35 (logand a0-34 512))
|
||||
(cmove-#f-zero v1-57 a0-35 v1-58)
|
||||
)
|
||||
)
|
||||
v1-57
|
||||
)
|
||||
(set! v1-60 (the-as none *fix-visible-level-mask*))
|
||||
(set! v1-61 (the-as none (+ v1-60 1)))
|
||||
(set! v1-62 (the-as none (logand v1-61 63)))
|
||||
(set! *fix-visible-level-mask* (the-as int v1-62))
|
||||
(set! v1-60 *fix-visible-level-mask*)
|
||||
(set! v1-61 (+ v1-60 1))
|
||||
(set! v1-62 (logand v1-61 63))
|
||||
(set! *fix-visible-level-mask* v1-62)
|
||||
)
|
||||
(set! gp-2 (the-as none 0))
|
||||
(while (begin (set! v1-115 (the-as none *level*)) (set! v1-116 (the-as none (l.w v1-115))) (<.si gp-2 v1-116))
|
||||
(set! gp-2 0)
|
||||
(while (begin (set! v1-115 *level*) (set! v1-116 (-> v1-115 length)) (<.si gp-2 v1-116))
|
||||
(when (begin
|
||||
(set! v1-63 (the-as none 5232))
|
||||
(set! v1-64 (the-as none (*.si v1-63 gp-2)))
|
||||
(set! v1-65 (the-as none (+ v1-64 256)))
|
||||
(set! a0-36 (the-as none *level*))
|
||||
(set! s5-2 (the-as none (+ v1-65 a0-36)))
|
||||
(set! v1-66 (the-as none 'active))
|
||||
(set! a0-37 (the-as none (l.wu (+ s5-2 16))))
|
||||
(set! v1-63 5232)
|
||||
(set! v1-64 (*.si v1-63 gp-2))
|
||||
(set! v1-65 (+ v1-64 256))
|
||||
(set! a0-36 *level*)
|
||||
(set! s5-2 (+ v1-65 a0-36))
|
||||
(set! v1-66 'active)
|
||||
(set! a0-37 (-> s5-2 status))
|
||||
(= a0-37 v1-66)
|
||||
)
|
||||
(when (begin
|
||||
(cond
|
||||
((begin
|
||||
(or (begin (set! v1-68 (the-as none *artist-fix-visible*)) v1-68) (set! v1-69 (the-as none *stats-bsp*)))
|
||||
v1-69
|
||||
)
|
||||
(set! v1-70 (the-as none #t))
|
||||
(set! a0-38 (the-as none *fix-visible-level-mask*))
|
||||
(set! a1-12 (the-as none 1))
|
||||
(set! a2-2 (the-as none (l.w (+ s5-2 12))))
|
||||
(set! a1-13 (the-as none (ash.si a1-12 a2-2)))
|
||||
(set! a0-39 (the-as none (logand a0-38 a1-13)))
|
||||
((begin (or (begin (set! v1-68 *artist-fix-visible*) v1-68) (set! v1-69 *stats-bsp*)) v1-69)
|
||||
(set! v1-70 #t)
|
||||
(set! a0-38 *fix-visible-level-mask*)
|
||||
(set! a1-12 1)
|
||||
(set! a2-2 (-> s5-2 index))
|
||||
(set! a1-13 (ash.si a1-12 a2-2))
|
||||
(set! a0-39 (logand a0-38 a1-13))
|
||||
(cmove-#f-nonzero v1-71 a0-39 v1-70)
|
||||
(s.w! (+ s5-2 400) v1-71)
|
||||
(set! t9-5 (the-as none format))
|
||||
(set! a0-40 (the-as none *stdcon*))
|
||||
(set! a1-14 (the-as none L105))
|
||||
(set! a2-4 (the-as none (l.wu s5-2)))
|
||||
(set! v1-72 (the-as none *fix-visible-level-mask*))
|
||||
(set! a3-1 (the-as none 1))
|
||||
(set! t0-0 (the-as none (l.w (+ s5-2 12))))
|
||||
(set! a3-2 (the-as none (ash.si a3-1 t0-0)))
|
||||
(if (begin (set! v1-73 (the-as none (logand v1-72 a3-2))) (zero? v1-73))
|
||||
(set! a3-3 (the-as none 88))
|
||||
(set! a3-4 (the-as none 32))
|
||||
(set! (-> s5-2 render?) v1-71)
|
||||
(set! t9-5 format)
|
||||
(set! a0-40 *stdcon*)
|
||||
(set! a1-14 L105)
|
||||
(set! a2-4 (-> s5-2 name))
|
||||
(set! v1-72 *fix-visible-level-mask*)
|
||||
(set! a3-1 1)
|
||||
(set! t0-0 (-> s5-2 index))
|
||||
(set! a3-2 (ash.si a3-1 t0-0))
|
||||
(if (begin (set! v1-73 (logand v1-72 a3-2)) (zero? v1-73))
|
||||
(set! a3-3 88)
|
||||
(set! a3-3 (the-as int 32))
|
||||
)
|
||||
(if (begin
|
||||
(set! v1-74 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! t0-2 (the-as none (l.hu (+ v1-74 124))))
|
||||
(set! v1-75 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! t1-0 (the-as none (l.hu (+ v1-75 150))))
|
||||
(set! v1-76 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! v1-77 (the-as none (l.bu (+ v1-76 149))))
|
||||
(set! v1-74 (-> s5-2 bsp))
|
||||
(set! t0-2 (-> v1-74 current-leaf-idx))
|
||||
(set! v1-75 (-> s5-2 bsp))
|
||||
(set! t1-0 (-> v1-75 cam-box-idx))
|
||||
(set! v1-76 (-> s5-2 bsp))
|
||||
(set! v1-77 (-> v1-76 cam-using-back))
|
||||
(zero? v1-77)
|
||||
)
|
||||
(set! t2-0 (the-as none L104))
|
||||
(set! t2-1 (the-as none L103))
|
||||
(set! t2-0 L104)
|
||||
(set! t2-0 (the-as string L103))
|
||||
)
|
||||
(if (begin
|
||||
(set! v1-78 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! v1-79 (the-as none (l.bu (+ v1-78 148))))
|
||||
(nonzero? v1-79)
|
||||
)
|
||||
(set! t3-0 (the-as none L102))
|
||||
(set! t3-1 (the-as none L101))
|
||||
(if (begin (set! v1-78 (-> s5-2 bsp)) (set! v1-79 (-> v1-78 cam-outside-bsp)) (nonzero? v1-79))
|
||||
(set! t3-0 L102)
|
||||
(set! t3-0 (the-as string L101))
|
||||
)
|
||||
(call!)
|
||||
(set! v1-80 (the-as none v0-5))
|
||||
(call! a0-40 a1-14 a2-4 a3-3 t0-2 t1-0 t2-0 t3-0)
|
||||
(set! v1-80 v0-5)
|
||||
)
|
||||
(else
|
||||
(set! v1-81 (the-as none #t))
|
||||
(s.w! (+ s5-2 400) v1-81)
|
||||
(set! (-> s5-2 render?) (the-as symbol v1-81))
|
||||
)
|
||||
)
|
||||
(and (begin (set! v1-82 (the-as none *artist-fix-visible*)) v1-82)
|
||||
(begin
|
||||
(set! v1-84 (the-as none #t))
|
||||
(set! a0-41 (the-as none *fix-visible-level-mask*))
|
||||
(set! a1-15 (the-as none 1))
|
||||
(set! a2-5 (the-as none (l.w (+ s5-2 12))))
|
||||
(set! a1-16 (the-as none (ash.si a1-15 a2-5)))
|
||||
(set! a0-42 (the-as none (logand a0-41 a1-16)))
|
||||
(cmove-#f-nonzero v1-83 a0-42 v1-84)
|
||||
)
|
||||
(and (begin (set! v1-82 *artist-fix-visible*) v1-82) (begin
|
||||
(set! v1-84 #t)
|
||||
(set! a0-41 *fix-visible-level-mask*)
|
||||
(set! a1-15 1)
|
||||
(set! a2-5 (-> s5-2 index))
|
||||
(set! a1-16 (ash.si a1-15 a2-5))
|
||||
(set! a0-42 (logand a0-41 a1-16))
|
||||
(cmove-#f-nonzero v1-83 a0-42 v1-84)
|
||||
)
|
||||
)
|
||||
v1-83
|
||||
)
|
||||
(when (begin
|
||||
(set! v1-86 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! s4-1 (the-as none (l.hu (+ v1-86 124))))
|
||||
(set! v1-87 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! s3-0 (the-as none (l.wu (+ v1-87 212))))
|
||||
(set! v1-88 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! v1-89 (the-as none (l.wu (+ v1-88 244))))
|
||||
(set! v1-86 (-> s5-2 bsp))
|
||||
(set! s4-1 (-> v1-86 current-leaf-idx))
|
||||
(set! v1-87 (-> s5-2 bsp))
|
||||
(set! s3-0 (-> v1-87 unk-data 9))
|
||||
(set! v1-88 (-> s5-2 bsp))
|
||||
(set! v1-89 (-> v1-88 unk-data 17))
|
||||
(nonzero? s3-0)
|
||||
)
|
||||
(set! s2-0 (the-as none 0))
|
||||
(set! s2-0 0)
|
||||
(while (begin (set! v1-99 (the-as none (l.w s3-0))) (<.si s2-0 v1-99))
|
||||
(when (begin
|
||||
(set! v1-91 (the-as none (sll s2-0 4)))
|
||||
@@ -742,7 +718,7 @@
|
||||
(set! v1-94 (the-as none (sll s2-0 4)))
|
||||
(set! v1-95 (the-as none (+ v1-94 12)))
|
||||
(set! a2-7 (the-as none (+ v1-95 s3-0)))
|
||||
(set! a3-5 (the-as none #x45800000))
|
||||
(set! a3-4 (the-as none #x45800000))
|
||||
(set! v1-96 (the-as none #x80ff))
|
||||
(set! t0-3 (the-as none (sll v1-96 16)))
|
||||
(call!)
|
||||
@@ -755,18 +731,18 @@
|
||||
(set! v1-97 (the-as none (sll s2-0 4)))
|
||||
(set! v1-98 (the-as none (+ v1-97 12)))
|
||||
(set! a2-8 (the-as none (+ v1-98 s3-0)))
|
||||
(set! a3-6 (the-as none #x45800000))
|
||||
(set! a3-5 (the-as none #x45800000))
|
||||
(set! t0-4 (the-as none (the-as uint #x800000ff)))
|
||||
(call!)
|
||||
(set! a0-48 (the-as none v0-7))
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! s2-0 (the-as none (+ s2-0 1)))
|
||||
(set! s2-0 (the-as int (+ s2-0 1)))
|
||||
)
|
||||
)
|
||||
(when (begin
|
||||
(set! v1-102 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! v1-102 (the-as none (-> s5-2 bsp)))
|
||||
(set! v1-103 (the-as none (l.wu (+ v1-102 116))))
|
||||
(nonzero? v1-103)
|
||||
)
|
||||
@@ -784,11 +760,11 @@
|
||||
(set! a0-52 (the-as none (+ a0-51 300)))
|
||||
(set! a0-53 (the-as none (l.q a0-52)))
|
||||
(s.q! a2-9 a0-53)
|
||||
(set! a3-7 (the-as none (+ sp-0 32)))
|
||||
(set! a3-6 (the-as none (+ sp-0 32)))
|
||||
(set! a0-54 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! a0-55 (the-as none (+ a0-54 300)))
|
||||
(set! a0-56 (the-as none (l.q a0-55)))
|
||||
(s.q! a3-7 a0-56)
|
||||
(s.q! a3-6 a0-56)
|
||||
(set! a0-57 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! a0-58 (the-as none (l.bu (+ a0-57 149))))
|
||||
(zero? a0-58)
|
||||
@@ -826,7 +802,7 @@
|
||||
(set! f1-11 (the-as none (i2f f1-10)))
|
||||
(set! f0-7 (the-as none (+.s f0-6 f1-11)))
|
||||
(s.f! (+ a2-9 8) f0-7)
|
||||
(set! f0-8 (the-as none (l.f a3-7)))
|
||||
(set! f0-8 (the-as none (l.f a3-6)))
|
||||
(set! a0-65 (the-as none (l.b (+ v1-107 8))))
|
||||
(set! a1-27 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! f1-12 (the-as none (l.f (+ a1-27 284))))
|
||||
@@ -836,8 +812,8 @@
|
||||
(set! f1-14 (the-as none (gpr->fpr a0-66)))
|
||||
(set! f1-15 (the-as none (i2f f1-14)))
|
||||
(set! f0-9 (the-as none (+.s f0-8 f1-15)))
|
||||
(s.f! a3-7 f0-9)
|
||||
(set! f0-10 (the-as none (l.f (+ a3-7 4))))
|
||||
(s.f! a3-6 f0-9)
|
||||
(set! f0-10 (the-as none (l.f (+ a3-6 4))))
|
||||
(set! a0-67 (the-as none (l.b (+ v1-107 9))))
|
||||
(set! a1-29 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! f1-16 (the-as none (l.f (+ a1-29 288))))
|
||||
@@ -847,8 +823,8 @@
|
||||
(set! f1-18 (the-as none (gpr->fpr a0-68)))
|
||||
(set! f1-19 (the-as none (i2f f1-18)))
|
||||
(set! f0-11 (the-as none (+.s f0-10 f1-19)))
|
||||
(s.f! (+ a3-7 4) f0-11)
|
||||
(set! f0-12 (the-as none (l.f (+ a3-7 8))))
|
||||
(s.f! (+ a3-6 4) f0-11)
|
||||
(set! f0-12 (the-as none (l.f (+ a3-6 8))))
|
||||
(set! v1-108 (the-as none (l.b (+ v1-107 10))))
|
||||
(set! a0-69 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! f1-20 (the-as none (l.f (+ a0-69 292))))
|
||||
@@ -858,7 +834,7 @@
|
||||
(set! f1-22 (the-as none (gpr->fpr v1-109)))
|
||||
(set! f1-23 (the-as none (i2f f1-22)))
|
||||
(set! f0-13 (the-as none (+.s f0-12 f1-23)))
|
||||
(s.f! (+ a3-7 8) f0-13)
|
||||
(s.f! (+ a3-6 8) f0-13)
|
||||
(set! v1-110 (the-as none (fpr->gpr f0-13)))
|
||||
)
|
||||
(else
|
||||
@@ -895,7 +871,7 @@
|
||||
(set! f1-35 (the-as none (i2f f1-34)))
|
||||
(set! f0-19 (the-as none (+.s f0-18 f1-35)))
|
||||
(s.f! (+ a2-9 8) f0-19)
|
||||
(set! f0-20 (the-as none (l.f a3-7)))
|
||||
(set! f0-20 (the-as none (l.f a3-6)))
|
||||
(set! a0-77 (the-as none (l.b (+ v1-107 16))))
|
||||
(set! a1-37 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! f1-36 (the-as none (l.f (+ a1-37 284))))
|
||||
@@ -905,8 +881,8 @@
|
||||
(set! f1-38 (the-as none (gpr->fpr a0-78)))
|
||||
(set! f1-39 (the-as none (i2f f1-38)))
|
||||
(set! f0-21 (the-as none (+.s f0-20 f1-39)))
|
||||
(s.f! a3-7 f0-21)
|
||||
(set! f0-22 (the-as none (l.f (+ a3-7 4))))
|
||||
(s.f! a3-6 f0-21)
|
||||
(set! f0-22 (the-as none (l.f (+ a3-6 4))))
|
||||
(set! a0-79 (the-as none (l.b (+ v1-107 17))))
|
||||
(set! a1-39 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! f1-40 (the-as none (l.f (+ a1-39 288))))
|
||||
@@ -916,8 +892,8 @@
|
||||
(set! f1-42 (the-as none (gpr->fpr a0-80)))
|
||||
(set! f1-43 (the-as none (i2f f1-42)))
|
||||
(set! f0-23 (the-as none (+.s f0-22 f1-43)))
|
||||
(s.f! (+ a3-7 4) f0-23)
|
||||
(set! f0-24 (the-as none (l.f (+ a3-7 8))))
|
||||
(s.f! (+ a3-6 4) f0-23)
|
||||
(set! f0-24 (the-as none (l.f (+ a3-6 8))))
|
||||
(set! v1-111 (the-as none (l.b (+ v1-107 18))))
|
||||
(set! a0-81 (the-as none (l.wu (+ s5-2 92))))
|
||||
(set! f1-44 (the-as none (l.f (+ a0-81 292))))
|
||||
@@ -927,7 +903,7 @@
|
||||
(set! f1-46 (the-as none (gpr->fpr v1-112)))
|
||||
(set! f1-47 (the-as none (i2f f1-46)))
|
||||
(set! f0-25 (the-as none (+.s f0-24 f1-47)))
|
||||
(s.f! (+ a3-7 8) f0-25)
|
||||
(s.f! (+ a3-6 8) f0-25)
|
||||
(set! v1-113 (the-as none (fpr->gpr f0-25)))
|
||||
)
|
||||
)
|
||||
@@ -940,9 +916,9 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! gp-2 (the-as none (+ gp-2 1)))
|
||||
(set! gp-2 (the-as int (+ gp-2 1)))
|
||||
)
|
||||
(set! v0-9 (the-as none #f))
|
||||
(set! v0-9 #f)
|
||||
(ret-value v0-9)
|
||||
)
|
||||
|
||||
|
||||
+4
-4
@@ -959,7 +959,7 @@
|
||||
)
|
||||
(let ((f2-1 (-> (the-as prototype-bucket-tie gp-0) dists w)))
|
||||
(when (= arg1 (debug-menu-msg press))
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) 8)
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) (prototype-flags vanish))
|
||||
(set! f1-2 (fmax (fmin (* 4096.0 arg2) f0-0) (+ 4096.0 f2-1)))
|
||||
(let ((f0-1 (fmax f0-0 (+ 4096.0 f1-2))))
|
||||
(set! (-> (the-as prototype-bucket-tie gp-0) tie-rvanish) (/ 128.0 (- f0-1 f1-2)))
|
||||
@@ -997,7 +997,7 @@
|
||||
(f1-2 (-> (the-as prototype-bucket-tie gp-0) dists w))
|
||||
)
|
||||
(when (= arg1 (debug-menu-msg press))
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) 8)
|
||||
(logior! (-> (the-as prototype-bucket-tie gp-0) flags) (prototype-flags vanish))
|
||||
(set! f0-0 (fmax (* 4096.0 arg2) (+ 4096.0 f2-1)))
|
||||
(let ((f1-4 (fmax (fmin f2-1 f0-0) (+ 4096.0 f1-2))))
|
||||
(set! (-> (the-as prototype-bucket-tie gp-0) tie-rvanish) (/ 128.0 (- f0-0 f1-4)))
|
||||
@@ -1112,9 +1112,9 @@
|
||||
(cond
|
||||
(v1-0
|
||||
(if (= arg1 (debug-menu-msg press))
|
||||
(logxor! (-> v1-0 flags) 1)
|
||||
(logxor! (-> v1-0 flags) (prototype-flags disable))
|
||||
)
|
||||
(zero? (logand (-> v1-0 flags) 1))
|
||||
(zero? (logand (-> v1-0 flags) (prototype-flags disable)))
|
||||
)
|
||||
(else
|
||||
#f
|
||||
|
||||
+116
-311
@@ -108,7 +108,7 @@
|
||||
(new (symbol type uint) _type_ 0)
|
||||
(frame-counter-delta (_type_ history-elt) time-frame 9)
|
||||
(update-entries! (_type_) history-elt 10)
|
||||
(history-iterator-method-11 (_type_ history-elt) float 11)
|
||||
(get-age (_type_ history-elt) float 11)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -295,9 +295,8 @@
|
||||
)
|
||||
|
||||
;; definition for method 11 of type history-iterator
|
||||
(defmethod history-iterator-method-11 history-iterator ((obj history-iterator) (arg0 history-elt))
|
||||
"TODO - Unsure of the purpose
|
||||
`min(1.0, ((history-elt.timestamp - 1) + frame-counter) / (max-age + 1)) - 1.0`"
|
||||
(defmethod get-age history-iterator ((obj history-iterator) (arg0 history-elt))
|
||||
"Get the age of a history element"
|
||||
(- 1.0 (fmin 1.0 (/ (the float (+ (- 1 (-> arg0 timestamp)) (-> *display* base-clock frame-counter)))
|
||||
(the float (+ (-> obj max-age) 1))
|
||||
)
|
||||
@@ -628,324 +627,130 @@
|
||||
|
||||
;; definition for function history-draw
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
;; ERROR: Expression building failed: In history-draw: Unmatched field: start bit 24, size 40, signed? true, type rgba
|
||||
;; WARN: new jak 2 until loop case, check carefully
|
||||
(defun history-draw ((arg0 history-iterator))
|
||||
(local-vars
|
||||
(v0-0 history-elt)
|
||||
(v0-3 symbol)
|
||||
(v0-4 symbol)
|
||||
(v0-5 symbol)
|
||||
(v0-6 symbol)
|
||||
(v0-7 symbol)
|
||||
(v0-8 symbol)
|
||||
(v0-9 symbol)
|
||||
(v0-10 symbol)
|
||||
(v0-11 symbol)
|
||||
(v0-12 int)
|
||||
(v1-0 type)
|
||||
(v1-8 int)
|
||||
(v1-9 int)
|
||||
(v1-11 int)
|
||||
(v1-13 int)
|
||||
(v1-15 int)
|
||||
(v1-17 int)
|
||||
(v1-18 int)
|
||||
(v1-19 int)
|
||||
(v1-20 int)
|
||||
(v1-21 int)
|
||||
(a0-1 history-iterator)
|
||||
(a0-7 history-channel)
|
||||
(a0-9 symbol)
|
||||
(a0-10 symbol)
|
||||
(a0-11 vector)
|
||||
(a0-12 vector)
|
||||
(a0-13 symbol)
|
||||
(a0-14 symbol)
|
||||
(a0-15 vector)
|
||||
(a0-16 symbol)
|
||||
(a0-18 symbol)
|
||||
(a0-20 symbol)
|
||||
(a0-22 number)
|
||||
(a0-23 int)
|
||||
(a0-24 int)
|
||||
(a0-25 int)
|
||||
(a0-26 pat-mode-info)
|
||||
(a0-27 rgba)
|
||||
(a0-28 rgba)
|
||||
(a0-29 symbol)
|
||||
(a0-31 float)
|
||||
(a0-33 vector)
|
||||
(a0-34 symbol)
|
||||
(a1-5 int)
|
||||
(a1-6 int)
|
||||
(a1-7 int)
|
||||
(a1-9 int)
|
||||
(a1-10 int)
|
||||
(a1-11 int)
|
||||
(a1-13 int)
|
||||
(a1-14 int)
|
||||
(a1-16 int)
|
||||
(a1-17 int)
|
||||
(a1-19 int)
|
||||
(a1-20 history-channel)
|
||||
(a1-21 symbol)
|
||||
(a1-23 (inline-array pat-mode-info))
|
||||
(a1-24 uint)
|
||||
(a1-25 int)
|
||||
(a1-26 int)
|
||||
(a1-28 int)
|
||||
(a1-29 float)
|
||||
(a1-30 float)
|
||||
(a1-31 int)
|
||||
(a2-1 vector)
|
||||
(a2-2 vector)
|
||||
(a2-3 vector)
|
||||
(a2-4 vector)
|
||||
(a2-5 vector)
|
||||
(a2-6 vector)
|
||||
(a2-7 vector)
|
||||
(a2-8 symbol)
|
||||
(a2-9 history-channel)
|
||||
(a2-10 vector)
|
||||
(a2-11 vector)
|
||||
(a3-0 vector)
|
||||
(a3-1 int)
|
||||
(a3-2 int)
|
||||
(a3-3 vector)
|
||||
(a3-4 int)
|
||||
(a3-5 int)
|
||||
(a3-6 vector)
|
||||
(a3-7 vector)
|
||||
(a3-8 vector)
|
||||
(a3-9 vector)
|
||||
(a3-10 vector)
|
||||
(t0-0 int)
|
||||
(t0-1 int)
|
||||
(t0-2 int)
|
||||
(t0-3 int)
|
||||
(t0-4 int)
|
||||
(t0-5 int)
|
||||
(t0-6 int)
|
||||
(t0-7 int)
|
||||
(t0-8 int)
|
||||
(t1-0 symbol)
|
||||
(t1-1 symbol)
|
||||
(t1-2 int)
|
||||
(t1-3 int)
|
||||
(t1-4 int)
|
||||
(t1-5 int)
|
||||
(t1-6 int)
|
||||
(t1-7 rgba)
|
||||
(t1-8 rgba)
|
||||
(t1-9 int)
|
||||
(t1-10 int)
|
||||
(t2-0 int)
|
||||
(t2-1 int)
|
||||
(s5-0 history-elt)
|
||||
(t9-0 (function history-iterator history-elt))
|
||||
(t9-3 (function symbol bucket-id vector vector rgba symbol rgba symbol))
|
||||
(t9-4 (function symbol bucket-id vector rgba symbol))
|
||||
(t9-5 (function symbol bucket-id vector vector rgba symbol rgba symbol))
|
||||
(t9-6 (function symbol bucket-id vector rgba symbol))
|
||||
(t9-7 (function symbol bucket-id vector vector meters rgba symbol))
|
||||
(t9-8 (function symbol bucket-id vector vector meters rgba symbol))
|
||||
(t9-9 (function symbol bucket-id vector vector meters rgba symbol))
|
||||
(t9-10 (function symbol bucket-id vector vector meters rgba symbol))
|
||||
(t9-11 (function symbol bucket-id vector vector meters rgba symbol))
|
||||
(f0-3 float)
|
||||
(f0-4 float)
|
||||
(f0-5 float)
|
||||
(f0-6 float)
|
||||
(f1-0 float)
|
||||
(f1-1 float)
|
||||
(sv-16 vector)
|
||||
(sv-20 vector)
|
||||
(sv-24 number)
|
||||
)
|
||||
(set! sv-16 #f)
|
||||
(set! sv-20 #f)
|
||||
(set! sv-24 0)
|
||||
(until (begin
|
||||
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
|
||||
(cond
|
||||
((= a0-7 (history-channel trans))
|
||||
(cond
|
||||
(sv-16
|
||||
(set! t9-3 add-debug-line)
|
||||
(set! a0-9 #t)
|
||||
(set! a1-5 318)
|
||||
(set! a2-1 sv-16)
|
||||
(set! a3-0 (-> s5-0 vector))
|
||||
(set! t0-0 #xffff00)
|
||||
(set! v1-9 (shl v1-8 24))
|
||||
(set! t0-1 (logior #xffff00 (shl v1-8 24)))
|
||||
(set! t1-0 #f)
|
||||
(set! t2-0 -1)
|
||||
(call! a0-9 a1-5 a2-1 a3-0 t0-1 t1-0 t2-0)
|
||||
(set! v1-10 v0-3)
|
||||
)
|
||||
(else
|
||||
(set! t9-4 add-debug-x)
|
||||
(set! a0-10 #t)
|
||||
(set! a1-6 318)
|
||||
(set! a2-2 (-> s5-0 vector))
|
||||
(set! a3-1 #xffff00)
|
||||
(set! v1-11 (sll v1-8 24))
|
||||
(set! a3-2 (logior a3-1 v1-11))
|
||||
(call! a0-10 a1-6 a2-2 a3-2)
|
||||
(set! v1-12 v0-4)
|
||||
)
|
||||
)
|
||||
(set! a0-11 (-> s5-0 vector))
|
||||
(set! sv-16 a0-11)
|
||||
)
|
||||
((begin (set! a1-7 4) (= a0-7 a1-7))
|
||||
(cond
|
||||
((begin (set! a0-12 sv-20) a0-12)
|
||||
(set! t9-5 add-debug-line)
|
||||
(set! a0-13 #t)
|
||||
(set! a1-9 318)
|
||||
(set! a2-3 sv-20)
|
||||
(set! a3-3 (-> s5-0 vector))
|
||||
(set! t0-2 #xffffff)
|
||||
(set! v1-13 (sll v1-8 24))
|
||||
(set! t0-3 (logior t0-2 v1-13))
|
||||
(set! t1-1 #f)
|
||||
(set! t2-1 -1)
|
||||
(call! a0-13 a1-9 a2-3 a3-3 t0-3 t1-1 t2-1)
|
||||
(set! v1-14 v0-5)
|
||||
(local-vars (sv-16 vector) (sv-20 vector) (sv-24 pat-surface))
|
||||
(set! sv-16 (the-as vector #f))
|
||||
(set! sv-20 (the-as vector #f))
|
||||
(set! sv-24 (new 'static 'pat-surface))
|
||||
(until #f
|
||||
(let ((s5-0 (update-entries! arg0)))
|
||||
(if (not s5-0)
|
||||
(goto cfg-34)
|
||||
)
|
||||
(when (logtest? (-> arg0 channel-mask) (ash 1 (-> s5-0 channel)))
|
||||
(let* ((f0-0 (get-age arg0 s5-0))
|
||||
(v1-8 (the int (lerp 4.0 128.0 f0-0)))
|
||||
)
|
||||
(case (-> s5-0 channel)
|
||||
(((history-channel trans))
|
||||
(if sv-16
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
sv-16
|
||||
(-> s5-0 vector)
|
||||
(the-as rgba (logior #xffff00 (shl v1-8 24)))
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
(else
|
||||
(set! t9-6 add-debug-x)
|
||||
(set! a0-14 #t)
|
||||
(set! a1-10 318)
|
||||
(set! a2-4 (-> s5-0 vector))
|
||||
(set! a3-4 #xffffff)
|
||||
(set! v1-15 (sll v1-8 24))
|
||||
(set! a3-5 (logior a3-4 v1-15))
|
||||
(call! a0-14 a1-10 a2-4 a3-5)
|
||||
(set! v1-16 v0-6)
|
||||
)
|
||||
)
|
||||
(set! a0-15 (-> s5-0 vector))
|
||||
(set! sv-20 a0-15)
|
||||
)
|
||||
((begin (set! a1-11 1) (= a0-7 a1-11))
|
||||
(set! t9-7 add-debug-vector)
|
||||
(set! a0-16 #t)
|
||||
(set! a1-13 318)
|
||||
(set! a2-5 (-> s5-0 origin))
|
||||
(set! a3-6 (-> s5-0 vector))
|
||||
(set! t0-4 #x3dcccccd)
|
||||
(set! v1-17 (sll v1-8 24))
|
||||
(set! t1-2 (logior v1-17 #xff00))
|
||||
(call! a0-16 a1-13 a2-5 a3-6 t0-4 t1-2)
|
||||
(set! a0-17 v0-7)
|
||||
)
|
||||
((begin (set! a1-14 2) (= a0-7 a1-14))
|
||||
(set! t9-8 add-debug-vector)
|
||||
(set! a0-18 #t)
|
||||
(set! a1-16 318)
|
||||
(set! a2-6 (-> s5-0 origin))
|
||||
(set! a3-7 (-> s5-0 vector))
|
||||
(set! t0-5 #x3dcccccd)
|
||||
(set! t1-3 #x408040)
|
||||
(set! v1-18 (sll v1-8 24))
|
||||
(set! t1-4 (logior t1-3 v1-18))
|
||||
(call! a0-18 a1-16 a2-6 a3-7 t0-5 t1-4)
|
||||
(set! a0-19 v0-8)
|
||||
)
|
||||
((begin (set! a1-17 3) (= a0-7 a1-17))
|
||||
(set! t9-9 add-debug-vector)
|
||||
(set! a0-20 #t)
|
||||
(set! a1-19 318)
|
||||
(set! a2-7 (-> s5-0 origin))
|
||||
(set! a3-8 (-> s5-0 vector))
|
||||
(set! t0-6 #x3dcccccd)
|
||||
(set! t1-5 #x404080)
|
||||
(set! v1-19 (sll v1-8 24))
|
||||
(set! t1-6 (logior t1-5 v1-19))
|
||||
(call! a0-20 a1-19 a2-7 a3-8 t0-6 t1-6)
|
||||
(set! a0-21 v0-9)
|
||||
)
|
||||
((begin
|
||||
(or (begin (set! a1-20 (+ a0-7 -5)) (set! a2-8 (zero? a1-20)) a2-8)
|
||||
(begin (set! a2-9 (+ a0-7 -6)) (set! a1-21 (zero? a2-9)))
|
||||
)
|
||||
a1-21
|
||||
)
|
||||
(set! a0-22 sv-24)
|
||||
(set! a0-23 (sll a0-22 54))
|
||||
(set! a0-24 (srl a0-23 61))
|
||||
(set! a0-25 (sll a0-24 4))
|
||||
(set! a1-23 *pat-mode-info*)
|
||||
(set! a0-26 (+ a0-25 a1-23))
|
||||
(set! a0-27 (-> a0-26 hilite-color))
|
||||
(set! a1-24 (the-as uint #xffffffff00ffffff))
|
||||
(set! a0-28 (logand a0-27 a1-24))
|
||||
(set! t1-7 a0-28)
|
||||
(set! t9-10 add-debug-vector)
|
||||
(set! a0-29 #t)
|
||||
(set! a1-25 318)
|
||||
(set! a2-10 (-> s5-0 origin))
|
||||
(set! a3-9 (-> s5-0 vector))
|
||||
(set! t0-7 #x45800000)
|
||||
(set! v1-20 (sll v1-8 24))
|
||||
(set! t1-8 (logior t1-7 v1-20))
|
||||
(call! a0-29 a1-25 a2-10 a3-9 t0-7 t1-8)
|
||||
(set! a0-30 v0-10)
|
||||
)
|
||||
((begin (set! a1-26 8) (= a0-7 a1-26))
|
||||
(set! a0-31 (-> s5-0 vector x))
|
||||
(set! sv-24 a0-31)
|
||||
)
|
||||
((begin (set! a1-28 10) (= a0-7 a1-28))
|
||||
(set! f0-3 (-> s5-0 vector x))
|
||||
(set! a3-10 (new 'stack-no-clear 'vector))
|
||||
(set! a0-33 a3-10)
|
||||
(set! f1-0 0.0)
|
||||
(set! (-> a0-33 x) f1-0)
|
||||
(set! a1-29 -8192.0)
|
||||
(set! f1-1 (gpr->fpr a1-29))
|
||||
(set! f0-4 (*.s f1-1 f0-3))
|
||||
(set! (-> a0-33 y) f0-4)
|
||||
(set! f0-5 0.0)
|
||||
(set! (-> a0-33 z) f0-5)
|
||||
(set! a1-30 1.0)
|
||||
(set! f0-6 (gpr->fpr a1-30))
|
||||
(set! (-> a0-33 w) f0-6)
|
||||
(set! t9-11 add-debug-vector)
|
||||
(set! a0-34 #t)
|
||||
(set! a1-31 318)
|
||||
(set! a2-11 (-> s5-0 origin))
|
||||
(set! t0-8 #x3f800000)
|
||||
(set! t1-9 #xffffff)
|
||||
(set! v1-21 (sll v1-8 24))
|
||||
(set! t1-10 (logior t1-9 v1-21))
|
||||
(call! a0-34 a1-31 a2-11 a3-10 t0-8 t1-10)
|
||||
(set! a0-35 v0-11)
|
||||
)
|
||||
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffff00 (shl v1-8 24))))
|
||||
)
|
||||
(set! sv-16 (-> s5-0 vector))
|
||||
)
|
||||
(((history-channel intersect))
|
||||
(if sv-20
|
||||
(add-debug-line
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
sv-20
|
||||
(-> s5-0 vector)
|
||||
(the-as rgba (logior #xffffff (shl v1-8 24)))
|
||||
#f
|
||||
(the-as rgba -1)
|
||||
)
|
||||
(add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 vector) (the-as rgba (logior #xffffff (shl v1-8 24))))
|
||||
)
|
||||
(set! sv-20 (-> s5-0 vector))
|
||||
)
|
||||
(((history-channel transv))
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 0.000024414063)
|
||||
(the-as rgba (logior (shl v1-8 24) #xff00))
|
||||
)
|
||||
)
|
||||
#f
|
||||
)
|
||||
(if (begin
|
||||
(set! a0-1 arg0)
|
||||
(set! v1-0 (-> a0-1 type))
|
||||
(set! t9-0 (method-of-type v1-0 update-entries!))
|
||||
(set! v0-0 (call! a0-1))
|
||||
(set! s5-0 v0-0)
|
||||
(not s5-0)
|
||||
(((history-channel transv-in))
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 0.000024414063)
|
||||
(the-as rgba (logior #x408040 (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
(((history-channel transv-out))
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 0.000024414063)
|
||||
(the-as rgba (logior #x404080 (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
(((history-channel local-normal) (history-channel surface-normal))
|
||||
(let ((t1-7
|
||||
(logand (the-as uint (-> *pat-mode-info* (-> sv-24 mode) hilite-color)) (the-as uint #xffffffff00ffffff))
|
||||
)
|
||||
)
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
(-> s5-0 vector)
|
||||
(meters 1.0)
|
||||
(the-as rgba (logior t1-7 (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
)
|
||||
(((history-channel pat))
|
||||
(set! sv-24 (the-as pat-surface (-> s5-0 vector x)))
|
||||
)
|
||||
(((history-channel friction))
|
||||
(let ((f0-3 (-> s5-0 vector x))
|
||||
(a3-10 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(set-vector! a3-10 0.0 (* -8192.0 f0-3) 0.0 1.0)
|
||||
(add-debug-vector
|
||||
#t
|
||||
(bucket-id debug-no-zbuf1)
|
||||
(-> s5-0 origin)
|
||||
a3-10
|
||||
(meters 0.00024414062)
|
||||
(the-as rgba (logior #xffffff (shl v1-8 24)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(begin (goto cfg-34))
|
||||
)
|
||||
)
|
||||
)
|
||||
#f
|
||||
(label cfg-34)
|
||||
(set! v0-12 0)
|
||||
(ret-none)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
+1
@@ -73,6 +73,7 @@
|
||||
(to-spr-waits uint32 :offset-assert 44)
|
||||
(from-spr-waits uint32 :offset-assert 48)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 14
|
||||
:size-assert #x34
|
||||
:flag-assert #xe00000034
|
||||
|
||||
+16
-16
@@ -3,22 +3,22 @@
|
||||
|
||||
;; definition of type prototype-bucket
|
||||
(deftype prototype-bucket (basic)
|
||||
((name string :offset-assert 4)
|
||||
(flags uint16 :offset-assert 8)
|
||||
(texture-masks-index uint16 :offset-assert 10)
|
||||
(in-level uint16 :offset-assert 12)
|
||||
(utextures uint16 :offset-assert 14)
|
||||
(geometry drawable 4 :offset-assert 16)
|
||||
(dists vector :inline :offset-assert 32)
|
||||
(rdists vector :inline :offset-assert 48)
|
||||
(near-plane meters :offset 32)
|
||||
(near-stiff meters :offset 36)
|
||||
(mid-plane meters :offset 40)
|
||||
(far-plane meters :offset 44)
|
||||
(rlength-near float :offset 48)
|
||||
(rlength-stiff float :offset 52)
|
||||
(rlength-mid float :offset 56)
|
||||
(stiffness float :offset 60)
|
||||
((name string :offset-assert 4)
|
||||
(flags prototype-flags :offset-assert 8)
|
||||
(texture-masks-index uint16 :offset-assert 10)
|
||||
(in-level uint16 :offset-assert 12)
|
||||
(utextures uint16 :offset-assert 14)
|
||||
(geometry drawable 4 :offset-assert 16)
|
||||
(dists vector :inline :offset-assert 32)
|
||||
(rdists vector :inline :offset-assert 48)
|
||||
(near-plane meters :offset 32)
|
||||
(near-stiff meters :offset 36)
|
||||
(mid-plane meters :offset 40)
|
||||
(far-plane meters :offset 44)
|
||||
(rlength-near float :offset 48)
|
||||
(rlength-stiff float :offset 52)
|
||||
(rlength-mid float :offset 56)
|
||||
(stiffness float :offset 60)
|
||||
)
|
||||
:method-count-assert 9
|
||||
:size-assert #x40
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *wind-work*, type wind-work
|
||||
(define *wind-work*
|
||||
(new 'static 'wind-work :wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0))
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *wind-work* to-ptrs 0) (the-as uint (+ 8192 #x70000000)))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *wind-work* to-ptrs 1) (the-as uint (+ 4096 #x70000000)))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *wind-work* to-ptrs 2) (the-as uint (+ #x70000000 0)))
|
||||
|
||||
|
||||
|
||||
|
||||
+1
-5
@@ -235,7 +235,7 @@
|
||||
(translucent-flag uint32 :offset-assert 520)
|
||||
(wait-from-spr uint32 :offset-assert 524)
|
||||
(wait-to-spr uint32 :offset-assert 528)
|
||||
(use-etie basic :offset-assert 532)
|
||||
(use-etie symbol :offset-assert 532)
|
||||
(buffer-start uint32 :offset-assert 536)
|
||||
(buffer-end uint32 :offset-assert 540)
|
||||
(tfrag-dists uint32 :offset-assert 544)
|
||||
@@ -686,7 +686,3 @@
|
||||
|
||||
;; failed to figure out what this is:
|
||||
0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for symbol *instance-tie-work*, type instance-tie-work
|
||||
(define *instance-tie-work* (new 'static 'instance-tie-work
|
||||
:wind-const (new 'static 'vector :x 0.5 :y 100.0 :z 0.0166 :w -1.0)
|
||||
:constant (new 'static 'vector :x 4096.0 :y 128.0)
|
||||
:far-morph (new 'static 'vector :x 1.0 :w 256.0)
|
||||
:upload-color-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x80c6 :num #x6 :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-color-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #xc0cc :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-color-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id next))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
)
|
||||
:upload-color-ret (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ret))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
)
|
||||
:generic-color-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x6 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x3)
|
||||
)
|
||||
:generic-color-1 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref)))
|
||||
:generic-color-end (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id end)))
|
||||
:envmap-color-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x8 :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x8000 :num #x8 :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:envmap-color-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #xc008 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:refl-fade-fac -0.000625
|
||||
:refl-fade-end 409600.0
|
||||
:use-etie #t
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *instance-tie-work* upload-color-2 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *instance-tie-work* upload-color-ret vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
|
||||
|
||||
;; definition for symbol *prototype-tie-work*, type prototype-tie-work
|
||||
(define *prototype-tie-work* (new 'static 'prototype-tie-work
|
||||
:upload-flushe (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd flushe) :msk #x1)
|
||||
)
|
||||
:upload-palette (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x1 :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4346 :num #x80 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-model-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16))
|
||||
)
|
||||
:upload-model-3 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call)))
|
||||
:upload-model-near-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-model-near-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-near-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x1e :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-model-near-3 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x32 :cmd (vif-cmd unpack-v4-16))
|
||||
)
|
||||
:upload-model-near-4 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call)))
|
||||
:envmap-palette (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x1 :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4302 :num #x80 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:envmap-shader (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x5 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :cmd (vif-cmd stmod))
|
||||
:vif1 (new 'static 'vif-tag :imm #x387 :num #x5 :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-envmap-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #xb8 :cmd (vif-cmd base))
|
||||
:vif1 (new 'static 'vif-tag :cmd (vif-cmd unpack-v4-32))
|
||||
)
|
||||
:upload-envmap-1 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd offset))
|
||||
:vif1 (new 'static 'vif-tag :imm #x4000 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-envmap-2 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x20 :cmd (vif-cmd unpack-v4-16))
|
||||
)
|
||||
:upload-envmap-3 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #x84 :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:upload-envmap-4 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id call)))
|
||||
:upload-envmap-scissor-4 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif1 (new 'static 'vif-tag :imm #xac :cmd (vif-cmd unpack-v4-8))
|
||||
)
|
||||
:generic-palette (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :qwc #x20 :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x1)
|
||||
)
|
||||
:generic-model-0 (new 'static 'dma-packet
|
||||
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
|
||||
:vif0 (new 'static 'vif-tag :imm #x2)
|
||||
)
|
||||
:generic-model-1 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref)))
|
||||
:generic-model-2 (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id ref)))
|
||||
:model-next (new 'static 'dma-packet :dma (new 'static 'dma-tag :id (dma-tag-id next)))
|
||||
:clamp #x8000ff00ff00ff
|
||||
)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *prototype-tie-work* upload-model-1 vif0)
|
||||
(new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *prototype-tie-work* upload-model-3 vif0)
|
||||
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *prototype-tie-work* upload-model-near-1 vif0)
|
||||
(new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *prototype-tie-work* upload-model-near-4 vif0)
|
||||
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *prototype-tie-work* upload-envmap-2 vif0)
|
||||
(new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscalf) :msk #x1)
|
||||
)
|
||||
|
||||
;; failed to figure out what this is:
|
||||
(set! (-> *prototype-tie-work* upload-envmap-4 vif1)
|
||||
(new 'static 'vif-tag :imm #xa :cmd (vif-cmd mscal) :msk #x1)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
+48
-36
@@ -10,6 +10,7 @@
|
||||
(back-box-min vector4b :inline :offset-assert 12)
|
||||
(back-box-max vector4b :inline :offset-assert 16)
|
||||
)
|
||||
:pack-me
|
||||
:method-count-assert 9
|
||||
:size-assert #x14
|
||||
:flag-assert #x900000014
|
||||
@@ -34,42 +35,53 @@
|
||||
|
||||
;; definition of type bsp-header
|
||||
(deftype bsp-header (drawable)
|
||||
((info file-info :offset 4)
|
||||
(all-visible-list (pointer uint16) :offset-assert 32)
|
||||
(visible-list-length int16 :offset-assert 36)
|
||||
(drawable-trees drawable-tree-array :offset-assert 40)
|
||||
(pat pointer :offset-assert 44)
|
||||
(pat-length int32 :offset-assert 48)
|
||||
(texture-remap-table (pointer uint64) :offset-assert 52)
|
||||
(texture-remap-table-len int32 :offset-assert 56)
|
||||
(texture-ids (pointer texture-id) :offset-assert 60)
|
||||
(texture-page-count int32 :offset-assert 64)
|
||||
(name symbol :offset 72)
|
||||
(nickname symbol :offset-assert 76)
|
||||
(vis-info level-vis-info 8 :offset-assert 80)
|
||||
(actors drawable-inline-array-actor :offset-assert 112)
|
||||
(cameras (array entity-camera) :offset-assert 116)
|
||||
(nodes (inline-array bsp-node) :offset-assert 120)
|
||||
(level level :offset-assert 124)
|
||||
(texture-flags texture-page-flag 10 :offset 130)
|
||||
(require-force-inside uint8 :offset 152)
|
||||
(ambients symbol :offset 156)
|
||||
(subdivide-close float :offset 160)
|
||||
(subdivide-far float :offset-assert 164)
|
||||
(race-meshes (array entity-race-mesh) :offset-assert 168)
|
||||
(actor-birth-order (pointer uint32) :offset 172)
|
||||
(light-hash light-hash :offset 176)
|
||||
(nav-meshes (array entity-nav-mesh) :offset-assert 180)
|
||||
(actor-groups (array actor-group) :offset-assert 184)
|
||||
(region-trees (array drawable-tree-region-prim) :offset-assert 188)
|
||||
(region-array region-array :offset-assert 192)
|
||||
(collide-hash collide-hash :offset-assert 196)
|
||||
(region-tree drawable-tree-region-prim :offset 252)
|
||||
(unk-data uint32 18 :offset 180)
|
||||
(tfrag-texture-masks-array texture-masks-array :offset-assert 256)
|
||||
(tmask0 texture-masks-array :offset 272)
|
||||
(tmask2 texture-masks-array :offset 280)
|
||||
(end uint8 :offset 399)
|
||||
((info file-info :offset 4)
|
||||
(all-visible-list (pointer uint16) :offset-assert 32)
|
||||
(visible-list-length int16 :offset-assert 36)
|
||||
(drawable-trees drawable-tree-array :offset-assert 40)
|
||||
(pat pointer :offset-assert 44)
|
||||
(pat-length int32 :offset-assert 48)
|
||||
(texture-remap-table (pointer uint64) :offset-assert 52)
|
||||
(texture-remap-table-len int32 :offset-assert 56)
|
||||
(texture-ids (pointer texture-id) :offset-assert 60)
|
||||
(texture-page-count int32 :offset-assert 64)
|
||||
(unknown-basic basic :offset-assert 68)
|
||||
(name symbol :offset-assert 72)
|
||||
(nickname symbol :offset-assert 76)
|
||||
(vis-info level-vis-info 8 :offset-assert 80)
|
||||
(actors drawable-inline-array-actor :offset-assert 112)
|
||||
(cameras (array entity-camera) :offset-assert 116)
|
||||
(nodes (inline-array bsp-node) :offset-assert 120)
|
||||
(level level :offset-assert 124)
|
||||
(current-leaf-idx uint16 :offset-assert 128)
|
||||
(texture-flags texture-page-flag 10 :offset-assert 130)
|
||||
(cam-outside-bsp uint8 :offset 152)
|
||||
(cam-using-back uint8 :offset-assert 153)
|
||||
(cam-box-idx uint16 :offset-assert 154)
|
||||
(ambients symbol :offset-assert 156)
|
||||
(subdivide-close float :offset-assert 160)
|
||||
(subdivide-far float :offset-assert 164)
|
||||
(race-meshes (array entity-race-mesh) :offset-assert 168)
|
||||
(actor-birth-order (pointer uint32) :offset-assert 172)
|
||||
(light-hash light-hash :offset-assert 176)
|
||||
(nav-meshes (array entity-nav-mesh) :offset-assert 180)
|
||||
(actor-groups (array actor-group) :offset-assert 184)
|
||||
(region-trees (array drawable-tree-region-prim) :offset-assert 188)
|
||||
(region-array region-array :offset-assert 192)
|
||||
(collide-hash collide-hash :offset-assert 196)
|
||||
(region-tree drawable-tree-region-prim :offset 252)
|
||||
(tfrag-masks texture-masks-array :offset-assert 256)
|
||||
(tfrag-mask-count uint32 :offset-assert 260)
|
||||
(shrub-masks texture-masks-array :offset-assert 264)
|
||||
(shrub-mask-count uint32 :offset-assert 268)
|
||||
(alpha-masks texture-masks-array :offset-assert 272)
|
||||
(alpha-mask-count uint32 :offset-assert 276)
|
||||
(water-masks texture-masks-array :offset-assert 280)
|
||||
(water-mask-count uint32 :offset-assert 284)
|
||||
(bsp-scale vector :inline :offset-assert 288)
|
||||
(bsp-offset vector :inline :offset-assert 304)
|
||||
(unk-data uint32 18 :offset 180)
|
||||
(end uint8 :offset 399)
|
||||
)
|
||||
:method-count-assert 19
|
||||
:size-assert #x190
|
||||
|
||||
+754
@@ -0,0 +1,754 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition for function mem-usage-bsp-tree
|
||||
;; WARN: Return type mismatch bsp-header vs none.
|
||||
(defun mem-usage-bsp-tree ((arg0 bsp-header) (arg1 bsp-node) (arg2 memory-usage-block) (arg3 int))
|
||||
(cond
|
||||
((zero? arg1)
|
||||
)
|
||||
(else
|
||||
(+! (-> arg2 data 60 count) 1)
|
||||
(let ((v1-3 20))
|
||||
(+! (-> arg2 data 60 used) v1-3)
|
||||
(+! (-> arg2 data 60 total) v1-3)
|
||||
)
|
||||
(if (zero? (-> arg1 front-box-min w))
|
||||
(mem-usage-bsp-tree arg0 (-> arg0 nodes (-> arg1 front)) arg2 arg3)
|
||||
)
|
||||
(when (zero? (-> arg1 back-box-min w))
|
||||
(if (> (-> arg1 back) 0)
|
||||
(mem-usage-bsp-tree arg0 (-> arg0 nodes (-> arg1 back)) arg2 arg3)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 8 of type bsp-header
|
||||
(defmethod mem-usage bsp-header ((obj bsp-header) (arg0 memory-usage-block) (arg1 int))
|
||||
(set! (-> arg0 work-bsp) obj)
|
||||
(when (nonzero? (-> obj info))
|
||||
(set! (-> arg0 length) (max 85 (-> arg0 length)))
|
||||
(set! (-> arg0 data 84 name) "array")
|
||||
(+! (-> arg0 data 84 count) 1)
|
||||
(let ((v1-8 (asize-of (-> obj info))))
|
||||
(+! (-> arg0 data 84 used) v1-8)
|
||||
(+! (-> arg0 data 84 total) (logand -16 (+ v1-8 15)))
|
||||
)
|
||||
)
|
||||
(if (nonzero? (-> obj drawable-trees))
|
||||
(mem-usage (-> obj drawable-trees) arg0 arg1)
|
||||
)
|
||||
(if (nonzero? (-> obj collide-hash))
|
||||
(mem-usage (-> obj collide-hash) arg0 arg1)
|
||||
)
|
||||
(set! (-> arg0 length) (max 65 (-> arg0 length)))
|
||||
(set! (-> arg0 data 43 name) "entity")
|
||||
(set! (-> arg0 data 44 name) "camera")
|
||||
(set! (-> arg0 data 64 name) "pat")
|
||||
(set! (-> arg0 data 60 name) "bsp-node")
|
||||
(set! (-> arg0 length) (max 59 (-> arg0 length)))
|
||||
(set! (-> arg0 data 58 name) "bsp-main")
|
||||
(+! (-> arg0 data 58 count) 1)
|
||||
(let ((v1-31 400))
|
||||
(+! (-> arg0 data 58 used) v1-31)
|
||||
(+! (-> arg0 data 58 total) (logand -16 (+ v1-31 15)))
|
||||
)
|
||||
(set! (-> arg0 length) (max 62 (-> arg0 length)))
|
||||
(set! (-> arg0 data 61 name) "bsp-leaf-vis-self")
|
||||
(+! (-> arg0 data 61 count) 1)
|
||||
(let ((v1-40 (-> obj visible-list-length)))
|
||||
(+! (-> arg0 data 61 used) v1-40)
|
||||
(+! (-> arg0 data 61 total) (logand -16 (+ v1-40 15)))
|
||||
)
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-50 (* (-> obj texture-remap-table-len) 8)))
|
||||
(+! (-> arg0 data 59 used) v1-50)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-50 15)))
|
||||
)
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-60 (* (-> obj texture-page-count) 4)))
|
||||
(+! (-> arg0 data 59 used) v1-60)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-60 15)))
|
||||
)
|
||||
(when (nonzero? (-> obj unknown-basic))
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-72 (asize-of (-> obj unknown-basic))))
|
||||
(+! (-> arg0 data 59 used) v1-72)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-72 15)))
|
||||
)
|
||||
)
|
||||
(when (nonzero? (-> obj actor-birth-order))
|
||||
(set! (-> arg0 length) (max 60 (-> arg0 length)))
|
||||
(set! (-> arg0 data 59 name) "bsp-misc")
|
||||
(+! (-> arg0 data 59 count) 1)
|
||||
(let ((v1-85 (* (-> obj actors length) 4)))
|
||||
(+! (-> arg0 data 59 used) v1-85)
|
||||
(+! (-> arg0 data 59 total) (logand -16 (+ v1-85 15)))
|
||||
)
|
||||
)
|
||||
(+! (-> arg0 data 64 count) (-> obj pat-length))
|
||||
(let ((v1-92 (* (-> obj pat-length) 4)))
|
||||
(+! (-> arg0 data 64 used) v1-92)
|
||||
(+! (-> arg0 data 64 total) (logand -16 (+ v1-92 15)))
|
||||
)
|
||||
(when (nonzero? (-> obj region-trees))
|
||||
(let* ((s3-0 (-> obj region-trees length))
|
||||
(s2-0 0)
|
||||
(a0-39 (-> obj region-trees s2-0))
|
||||
)
|
||||
(while (< s2-0 s3-0)
|
||||
(mem-usage a0-39 arg0 (logior arg1 128))
|
||||
(+! s2-0 1)
|
||||
(set! a0-39 (-> obj region-trees s2-0))
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((s3-1 (-> obj cameras)))
|
||||
(when (nonzero? s3-1)
|
||||
(dotimes (s2-1 (-> s3-1 length))
|
||||
(mem-usage (-> s3-1 s2-1) arg0 (logior arg1 256))
|
||||
)
|
||||
)
|
||||
)
|
||||
(if (nonzero? (-> obj nodes))
|
||||
(mem-usage-bsp-tree obj (-> obj nodes 0) arg0 arg1)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 9 of type bsp-header
|
||||
(defmethod login bsp-header ((obj bsp-header))
|
||||
(if (nonzero? (-> obj drawable-trees))
|
||||
(login (-> obj drawable-trees))
|
||||
)
|
||||
(set! (-> obj level tfrag-gs-test)
|
||||
(if (logtest? (-> obj texture-flags 0) (texture-page-flag alpha-enable))
|
||||
(new 'static 'gs-test :ate #x1 :atst (gs-atest always) :zte #x1 :ztst (gs-ztest greater-equal))
|
||||
(new 'static 'gs-test
|
||||
:ate #x1
|
||||
:atst (gs-atest greater-equal)
|
||||
:aref #x26
|
||||
:zte #x1
|
||||
:ztst (gs-ztest greater-equal)
|
||||
)
|
||||
)
|
||||
)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for symbol *test-shrub*, type int
|
||||
(define *test-shrub* 0)
|
||||
|
||||
;; definition for method 10 of type bsp-header
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod draw bsp-header ((obj bsp-header) (arg0 bsp-header) (arg1 display-frame))
|
||||
(local-vars (a3-4 uint128) (a3-5 uint128))
|
||||
(rlet ((vf16 :class vf)
|
||||
(vf17 :class vf)
|
||||
(vf18 :class vf)
|
||||
(vf19 :class vf)
|
||||
(vf20 :class vf)
|
||||
(vf21 :class vf)
|
||||
(vf22 :class vf)
|
||||
(vf23 :class vf)
|
||||
(vf24 :class vf)
|
||||
(vf25 :class vf)
|
||||
(vf26 :class vf)
|
||||
(vf27 :class vf)
|
||||
(vf28 :class vf)
|
||||
(vf29 :class vf)
|
||||
(vf30 :class vf)
|
||||
(vf31 :class vf)
|
||||
)
|
||||
(let ((s4-0 (-> obj level)))
|
||||
(when (-> s4-0 render?)
|
||||
(set! *draw-index* (-> s4-0 draw-index))
|
||||
(set! (-> *prototype-tie-work* mood) (-> s4-0 mood-context))
|
||||
(if *artist-use-menu-subdiv*
|
||||
(update-subdivide-settings! *subdivide-settings* *math-camera* 7)
|
||||
(update-subdivide-settings! *subdivide-settings* *math-camera* (-> s4-0 index))
|
||||
)
|
||||
(let ((a2-3 (/ (+ (-> obj visible-list-length) 15) 16)))
|
||||
(dma-send-to-spr-no-flush
|
||||
(the-as uint (-> (the-as terrain-context #x70000000) work background vis-list))
|
||||
(the-as uint (-> s4-0 vis-bits))
|
||||
(the-as uint a2-3)
|
||||
#f
|
||||
)
|
||||
)
|
||||
(when *artist-flip-visible*
|
||||
(let ((v1-15 (/ (+ (-> obj visible-list-length) 15) 16))
|
||||
(a0-7 (-> (the-as terrain-context #x70000000) work background vis-list))
|
||||
(a1-5 (-> obj all-visible-list))
|
||||
)
|
||||
(dotimes (a2-4 v1-15)
|
||||
(let ((a3-3 (-> (the-as (pointer uint128) (+ (the-as uint a0-7) (* a2-4 16))))))
|
||||
(.pnor a3-4 a3-3 0)
|
||||
)
|
||||
(let ((t0-2 (-> (the-as (pointer uint128) (&+ a1-5 (* a2-4 16))))))
|
||||
(.pand a3-5 a3-4 t0-2)
|
||||
)
|
||||
(set! (-> (the-as (pointer uint128) (+ (the-as uint a0-7) (* a2-4 16)))) a3-5)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((at-0 *math-camera*))
|
||||
(.lvf vf16 (&-> at-0 plane 0 quad))
|
||||
(.lvf vf17 (&-> at-0 plane 1 quad))
|
||||
(.lvf vf18 (&-> at-0 plane 2 quad))
|
||||
(.lvf vf19 (&-> at-0 plane 3 quad))
|
||||
(.lvf vf20 (&-> at-0 shrub-mat vector 0 quad))
|
||||
(.lvf vf21 (&-> at-0 shrub-mat vector 1 quad))
|
||||
(.lvf vf22 (&-> at-0 shrub-mat vector 2 quad))
|
||||
(.lvf vf23 (&-> at-0 shrub-mat trans quad))
|
||||
(.lvf vf24 (&-> at-0 camera-rot vector 0 quad))
|
||||
(.lvf vf25 (&-> at-0 camera-rot vector 1 quad))
|
||||
(.lvf vf26 (&-> at-0 camera-rot vector 2 quad))
|
||||
(.lvf vf27 (&-> at-0 camera-rot trans quad))
|
||||
(.lvf vf28 (&-> at-0 camera-temp vector 0 quad))
|
||||
(.lvf vf29 (&-> at-0 camera-temp vector 1 quad))
|
||||
(.lvf vf30 (&-> at-0 camera-temp vector 2 quad))
|
||||
(.lvf vf31 (&-> at-0 camera-temp trans quad))
|
||||
)
|
||||
(when (nonzero? (-> obj drawable-trees))
|
||||
(when *debug-segment*
|
||||
(let ((s4-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))
|
||||
(v1-27 'bsp)
|
||||
(s3-0 *profile-bsp-color*)
|
||||
)
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let ((s2-0 (-> s4-1 data (-> s4-1 count))))
|
||||
(let ((s1-0 (-> s4-1 base-time)))
|
||||
(set! (-> s2-0 name) v1-27)
|
||||
(set! (-> s2-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s1-0))))
|
||||
)
|
||||
(set! (-> s2-0 depth) (the-as uint (-> s4-1 depth)))
|
||||
(set! (-> s2-0 color) s3-0)
|
||||
(set! (-> s4-1 segment (-> s4-1 depth)) s2-0)
|
||||
)
|
||||
(+! (-> s4-1 count) 1)
|
||||
(+! (-> s4-1 depth) 1)
|
||||
(set! (-> s4-1 max-depth) (max (-> s4-1 max-depth) (-> s4-1 depth)))
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
(let ((a1-8 (-> obj drawable-trees)))
|
||||
(draw a1-8 a1-8 arg1)
|
||||
)
|
||||
(when *debug-segment*
|
||||
(let ((gp-1 (-> *display* frames (-> *display* on-screen) profile-array data 0)))
|
||||
(when (and *dproc* *debug-segment*)
|
||||
(let* ((v1-53 (+ (-> gp-1 depth) -1))
|
||||
(s5-1 (-> gp-1 segment v1-53))
|
||||
(s4-2 (-> gp-1 base-time))
|
||||
)
|
||||
(when (>= v1-53 0)
|
||||
(set! (-> s5-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s4-2))))
|
||||
(+! (-> gp-1 depth) -1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 14 of type bsp-header
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod debug-draw bsp-header ((obj bsp-header) (arg0 drawable) (arg1 display-frame))
|
||||
(rlet ((vf16 :class vf)
|
||||
(vf17 :class vf)
|
||||
(vf18 :class vf)
|
||||
(vf19 :class vf)
|
||||
(vf20 :class vf)
|
||||
(vf21 :class vf)
|
||||
(vf22 :class vf)
|
||||
(vf23 :class vf)
|
||||
(vf24 :class vf)
|
||||
(vf25 :class vf)
|
||||
(vf26 :class vf)
|
||||
(vf27 :class vf)
|
||||
(vf28 :class vf)
|
||||
(vf29 :class vf)
|
||||
(vf30 :class vf)
|
||||
(vf31 :class vf)
|
||||
)
|
||||
(let ((v1-0 (-> obj level)))
|
||||
(set! *draw-index* (-> v1-0 draw-index))
|
||||
(set! (-> *prototype-tie-work* mood) (-> v1-0 mood-context))
|
||||
(let ((a2-1 (/ (+ (-> obj visible-list-length) 15) 16)))
|
||||
(dma-send-to-spr-no-flush
|
||||
(the-as uint (+ #x38a0 #x70000000))
|
||||
(the-as uint (-> v1-0 vis-bits))
|
||||
(the-as uint a2-1)
|
||||
#f
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((at-0 *math-camera*))
|
||||
(.lvf vf16 (&-> at-0 plane 0 quad))
|
||||
(.lvf vf17 (&-> at-0 plane 1 quad))
|
||||
(.lvf vf18 (&-> at-0 plane 2 quad))
|
||||
(.lvf vf19 (&-> at-0 plane 3 quad))
|
||||
(.lvf vf20 (&-> at-0 shrub-mat vector 0 quad))
|
||||
(.lvf vf21 (&-> at-0 shrub-mat vector 1 quad))
|
||||
(.lvf vf22 (&-> at-0 shrub-mat vector 2 quad))
|
||||
(.lvf vf23 (&-> at-0 shrub-mat trans quad))
|
||||
(.lvf vf24 (&-> at-0 camera-rot vector 0 quad))
|
||||
(.lvf vf25 (&-> at-0 camera-rot vector 1 quad))
|
||||
(.lvf vf26 (&-> at-0 camera-rot vector 2 quad))
|
||||
(.lvf vf27 (&-> at-0 camera-rot trans quad))
|
||||
(.lvf vf28 (&-> at-0 camera-temp vector 0 quad))
|
||||
(.lvf vf29 (&-> at-0 camera-temp vector 1 quad))
|
||||
(.lvf vf30 (&-> at-0 camera-temp vector 2 quad))
|
||||
(.lvf vf31 (&-> at-0 camera-temp trans quad))
|
||||
)
|
||||
(when (nonzero? (-> obj drawable-trees))
|
||||
(let ((a1-4 (-> obj drawable-trees)))
|
||||
(debug-draw a1-4 a1-4 arg1)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 13 of type bsp-header
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-stats bsp-header ((obj bsp-header))
|
||||
(rlet ((vf16 :class vf)
|
||||
(vf17 :class vf)
|
||||
(vf18 :class vf)
|
||||
(vf19 :class vf)
|
||||
(vf20 :class vf)
|
||||
(vf21 :class vf)
|
||||
(vf22 :class vf)
|
||||
(vf23 :class vf)
|
||||
(vf24 :class vf)
|
||||
(vf25 :class vf)
|
||||
(vf26 :class vf)
|
||||
(vf27 :class vf)
|
||||
(vf28 :class vf)
|
||||
(vf29 :class vf)
|
||||
(vf30 :class vf)
|
||||
(vf31 :class vf)
|
||||
)
|
||||
(let ((v1-0 (-> obj level))
|
||||
(a2-0 (/ (+ (-> obj visible-list-length) 15) 16))
|
||||
)
|
||||
(dma-send-to-spr-no-flush
|
||||
(the-as uint (+ #x38a0 #x70000000))
|
||||
(the-as uint (-> v1-0 vis-bits))
|
||||
(the-as uint a2-0)
|
||||
#f
|
||||
)
|
||||
)
|
||||
(let ((at-0 *math-camera*))
|
||||
(.lvf vf16 (&-> at-0 plane 0 quad))
|
||||
(.lvf vf17 (&-> at-0 plane 1 quad))
|
||||
(.lvf vf18 (&-> at-0 plane 2 quad))
|
||||
(.lvf vf19 (&-> at-0 plane 3 quad))
|
||||
(.lvf vf20 (&-> at-0 shrub-mat vector 0 quad))
|
||||
(.lvf vf21 (&-> at-0 shrub-mat vector 1 quad))
|
||||
(.lvf vf22 (&-> at-0 shrub-mat vector 2 quad))
|
||||
(.lvf vf23 (&-> at-0 shrub-mat trans quad))
|
||||
(.lvf vf24 (&-> at-0 camera-rot vector 0 quad))
|
||||
(.lvf vf25 (&-> at-0 camera-rot vector 1 quad))
|
||||
(.lvf vf26 (&-> at-0 camera-rot vector 2 quad))
|
||||
(.lvf vf27 (&-> at-0 camera-rot trans quad))
|
||||
(.lvf vf28 (&-> at-0 camera-temp vector 0 quad))
|
||||
(.lvf vf29 (&-> at-0 camera-temp vector 1 quad))
|
||||
(.lvf vf30 (&-> at-0 camera-temp vector 2 quad))
|
||||
(.lvf vf31 (&-> at-0 camera-temp trans quad))
|
||||
)
|
||||
(if (nonzero? (-> obj drawable-trees))
|
||||
(collect-stats (-> obj drawable-trees))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for function bsp-camera-asm
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [srl t3, t3, 24]
|
||||
;; ERROR: Unsupported inline assembly instruction kind - [srl t2, t2, 24]
|
||||
(defun bsp-camera-asm ((arg0 bsp-header) (arg1 vector))
|
||||
(local-vars
|
||||
(a2-1 object)
|
||||
(cam-pos-i1 uint128)
|
||||
(cam-pos-32 uint128)
|
||||
(cam-pos-16 uint128)
|
||||
(cam-pos-8 uint128)
|
||||
(t0-5 uint)
|
||||
(b-flag uint)
|
||||
(f-flag int)
|
||||
(front-max-compare uint128)
|
||||
(back-max-compare uint128)
|
||||
(front-min-compare uint128)
|
||||
(back-min-compare uint128)
|
||||
)
|
||||
(rlet ((Q :class vf)
|
||||
(vf0 :class vf)
|
||||
(vf1 :class vf)
|
||||
(vf2 :class vf)
|
||||
(vf3 :class vf)
|
||||
)
|
||||
(init-vf0-vector)
|
||||
(nop!)
|
||||
(.lvf vf3 (&-> arg0 bsp-scale quad))
|
||||
(let ((nodes (the-as object (-> arg0 nodes))))
|
||||
(.lvf vf1 (&-> arg1 quad))
|
||||
(.lvf vf2 (&-> arg0 bsp-offset quad))
|
||||
(.sub.vf vf1 vf1 vf2 :mask #b111)
|
||||
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b0)
|
||||
(.wait.vf)
|
||||
(.mul.vf vf1 vf1 Q :mask #b1)
|
||||
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b1)
|
||||
(.wait.vf)
|
||||
(.mul.vf vf1 vf1 Q :mask #b10)
|
||||
(.div.vf Q vf0 vf3 :fsf #b11 :ftf #b10)
|
||||
(.wait.vf)
|
||||
(.mul.vf vf1 vf1 Q :mask #b100)
|
||||
(let ((a1-1 #xffffff)
|
||||
(nidx (the-as object 0))
|
||||
)
|
||||
(vftoi15.xyzw vf1 vf1)
|
||||
(.mov cam-pos-i1 vf1)
|
||||
(.pw.sra cam-pos-32 cam-pos-i1 15)
|
||||
(.ppach cam-pos-16 (the-as uint128 0) cam-pos-32)
|
||||
(.ppacb cam-pos-8 (the-as uint128 0) cam-pos-16)
|
||||
(let ((cam-pos-8m (the-as uint128 (logand (the-as int cam-pos-8) a1-1))))
|
||||
(label cfg-1)
|
||||
(let ((node (the-as bsp-node (&+ (the-as pointer nodes) (+ (* nidx 16) (* nidx 4))))))
|
||||
(nop!)
|
||||
(let ((front-min (the-as uint128 (-> node front-box-min clr))))
|
||||
(.pcgtb front-min-compare front-min cam-pos-8m)
|
||||
(let ((front-max (the-as uint128 (-> node front-box-max clr))))
|
||||
(.pcgtb front-max-compare front-max cam-pos-8m)
|
||||
)
|
||||
(let ((back-min (the-as uint128 (-> node back-box-min clr))))
|
||||
(.pcgtb back-min-compare back-min cam-pos-8m)
|
||||
(let ((back-max (the-as uint128 (-> node back-box-max clr))))
|
||||
(.pcgtb back-max-compare back-max cam-pos-8m)
|
||||
)
|
||||
(let* ((front-idx (-> node front))
|
||||
(not-f-min (lognot (the-as int front-min-compare)))
|
||||
(not-b-min (lognot (the-as int back-min-compare)))
|
||||
(t4-1 (logand not-f-min (the-as int front-max-compare)))
|
||||
(t5-1 (logand not-b-min (the-as int back-max-compare)))
|
||||
(f-in-box (logand t4-1 a1-1))
|
||||
(b-in-box (logand t5-1 a1-1))
|
||||
)
|
||||
(.srl (the-as uint f-flag) (the-as uint front-min) 24)
|
||||
(let ((back-idx (the-as bsp-node (-> node back))))
|
||||
(b! (= f-in-box a1-1) cfg-4 :delay (.srl b-flag (the-as int back-min) 24))
|
||||
(b! (= b-in-box a1-1) cfg-7 :delay (set! t0-5 (the-as uint 1)))
|
||||
(b! #t cfg-11 :delay (set! (-> arg0 cam-outside-bsp) t0-5))
|
||||
(label cfg-4)
|
||||
(b! (zero? f-flag) cfg-1 :likely-delay (set! nidx front-idx))
|
||||
(let ((v1-1 nidx))
|
||||
(set! (-> arg0 cam-using-back) (the-as uint 0))
|
||||
(b! #t cfg-10 :delay (set! a2-1 front-idx))
|
||||
(label cfg-7)
|
||||
(b! (zero? b-flag) cfg-1 :likely-delay (set! nidx back-idx))
|
||||
(set! v1-1 nidx)
|
||||
(set! a2-1 back-idx)
|
||||
(set! (-> arg0 cam-using-back) (the-as uint 1))
|
||||
(label cfg-10)
|
||||
(set! (-> arg0 current-leaf-idx) (the-as uint a2-1))
|
||||
(set! (-> arg0 cam-box-idx) (the-as uint v1-1))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 cam-outside-bsp) (the-as uint 0))
|
||||
(label cfg-11)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 16 of type bsp-header
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod collect-regions bsp-header ((obj bsp-header) (arg0 sphere) (arg1 int) (arg2 region-prim-list))
|
||||
(let ((s3-0 (-> obj region-trees)))
|
||||
(dotimes (s2-0 (-> s3-0 length))
|
||||
(collect-regions (-> s3-0 s2-0) arg0 arg1 arg2)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function print-collide-stats
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
;; WARN: Function may read a register that is not set: t0
|
||||
(defun print-collide-stats ()
|
||||
(local-vars (t0-0 none))
|
||||
(format *stdcon* "~0k~%count cycles instr icache dcache vu0/to/from~%")
|
||||
(print-to-stream (-> *perf-stats* data 3) "collide" *stdcon*)
|
||||
(print-to-stream (-> *perf-stats* data 4) "collide-list" *stdcon*)
|
||||
(print-to-stream (-> *perf-stats* data 5) "collide-fill" *stdcon*)
|
||||
(format *stdcon* "~0k---------------------------------------------------------------~%")
|
||||
(format *stdcon* "~0kcalls = ~d~%" (-> *collide-stats* calls))
|
||||
(format
|
||||
*stdcon*
|
||||
"~0kspheres = ~d~256hspheres/call = ~f~%"
|
||||
(-> *collide-stats* spheres)
|
||||
(/ (the float (-> *collide-stats* spheres)) (the float (-> *collide-stats* calls)))
|
||||
t0-0
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~0knodes = ~d~256hnodes/call = ~f~%"
|
||||
(-> *collide-stats* nodes)
|
||||
(/ (the float (-> *collide-stats* nodes)) (the float (-> *collide-stats* calls)))
|
||||
t0-0
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~0kfrags = ~d~256hfrags/call = ~f~%"
|
||||
(-> *collide-stats* frags)
|
||||
(/ (the float (-> *collide-stats* frags)) (the float (-> *collide-stats* calls)))
|
||||
t0-0
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~0ktris = ~d~256htris/frag = ~f~%"
|
||||
(-> *collide-stats* tris)
|
||||
(/ (the float (-> *collide-stats* tris)) (the float (-> *collide-stats* frags)))
|
||||
t0-0
|
||||
)
|
||||
(format
|
||||
*stdcon*
|
||||
"~0koutput = ~d~256houtput/call = ~f~%"
|
||||
(-> *collide-stats* output)
|
||||
(/ (the float (-> *collide-stats* output)) (the float (-> *collide-stats* calls)))
|
||||
t0-0
|
||||
)
|
||||
(format *stdcon* "~0k---------------------------------------------------------------~%")
|
||||
(let ((gp-0 (stopwatch-elapsed-ticks (the-as stopwatch (&-> *collide-stats* pad0 1))))
|
||||
(s4-0 (stopwatch-elapsed-ticks (the-as stopwatch (&-> *collide-stats* total-target 7))))
|
||||
(s5-0 (stopwatch-elapsed-ticks (the-as stopwatch (&-> *collide-stats* target-cache-fill 7))))
|
||||
)
|
||||
(format *stdcon* "~0ktotal-target ~D~%" gp-0)
|
||||
(format *stdcon* "~0ktarget-cache-fill ~D ~0,,2f%~%" s4-0 (/ (* 100.0 (the float s4-0)) (the float gp-0)))
|
||||
(format *stdcon* "~0ktarget-ray-poly ~D ~0,,2f%~%" s5-0 (/ (* 100.0 (the float s5-0)) (the float gp-0)))
|
||||
)
|
||||
(set! (-> *collide-stats* calls) (the-as uint 0))
|
||||
(set! (-> *collide-stats* spheres) (the-as uint 0))
|
||||
(set! (-> *collide-stats* nodes) (the-as uint 0))
|
||||
(set! (-> *collide-stats* frags) (the-as uint 0))
|
||||
(set! (-> *collide-stats* tris) (the-as uint 0))
|
||||
(set! (-> *collide-stats* output) (the-as uint 0))
|
||||
(stopwatch-init (the-as stopwatch (&-> *collide-stats* pad0 1)))
|
||||
(stopwatch-init (the-as stopwatch (&-> *collide-stats* total-target 7)))
|
||||
(stopwatch-init (the-as stopwatch (&-> *collide-stats* target-cache-fill 7)))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for function level-remap-texture
|
||||
;; WARN: Return type mismatch uint vs texture-id.
|
||||
(defun level-remap-texture ((arg0 texture-id))
|
||||
(let ((v1-1 (-> *level* log-in-level-bsp)))
|
||||
(when v1-1
|
||||
(let* ((a3-0 (-> v1-1 texture-remap-table-len))
|
||||
(v1-2 (the-as object (-> v1-1 texture-remap-table)))
|
||||
(t0-0 (the-as (pointer uint64) v1-2))
|
||||
(a1-1 (the-as uint #xfffffff8))
|
||||
(a2-1 (logand (new 'static 'texture-id :index #xfff :page #xfff) arg0))
|
||||
(a3-2 (the-as object (&+ t0-0 (* a3-0 8))))
|
||||
)
|
||||
(label cfg-2)
|
||||
(b! (= v1-2 a3-2) cfg-8 :delay (nop!))
|
||||
(let ((t0-3 (the-as object (logand (/ (+ (the-as int v1-2) (the-as int a3-2)) 2) a1-1))))
|
||||
(let ((t1-1 (- (-> (the-as (pointer uint32) t0-3) 0) a2-1)))
|
||||
(b! (zero? t1-1) cfg-7 :delay (nop!))
|
||||
(b! (< (the-as int t1-1) 0) cfg-6 :delay (nop!))
|
||||
)
|
||||
(b! #t cfg-2 :delay (set! a3-2 (the-as (pointer uint64) t0-3)))
|
||||
(label cfg-6)
|
||||
(b! #t cfg-2 :delay (set! v1-2 (+ (the-as int t0-3) 8)))
|
||||
(label cfg-7)
|
||||
(set! arg0 (the-as texture-id (logior (-> (the-as (pointer uint32) t0-3) 1) 20)))
|
||||
)
|
||||
)
|
||||
(label cfg-8)
|
||||
0
|
||||
)
|
||||
)
|
||||
(the-as texture-id arg0)
|
||||
)
|
||||
|
||||
;; definition for function build-masks
|
||||
;; INFO: Used lq/sq
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defun build-masks ((arg0 bsp-header))
|
||||
(let ((v1-0 (-> arg0 drawable-trees))
|
||||
(s2-0 (-> arg0 tfrag-mask-count))
|
||||
(s3-0 (-> arg0 shrub-mask-count))
|
||||
(s4-0 (-> arg0 alpha-mask-count))
|
||||
(gp-0 (-> arg0 water-mask-count))
|
||||
)
|
||||
(when (zero? (+ s2-0 s3-0 s4-0 gp-0))
|
||||
(dotimes (a0-5 (-> v1-0 length))
|
||||
(let ((a1-2 (-> v1-0 trees a0-5)))
|
||||
(cond
|
||||
((= (-> a1-2 type) drawable-tree-tfrag)
|
||||
(let* ((a2-5 (-> (the-as drawable-tree-tfrag a1-2) arrays (+ (-> (the-as drawable-tree-tfrag a1-2) length) -1)))
|
||||
(a1-4 (-> a2-5 length))
|
||||
(a2-6 (-> (the-as drawable-inline-array-tfrag a2-5) data))
|
||||
)
|
||||
(dotimes (a3-1 a1-4)
|
||||
(set! (-> a2-6 0 texture-masks-index) s2-0)
|
||||
(+! s2-0 1)
|
||||
(set! a2-6 (the-as (inline-array tfragment) (-> a2-6 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-tfrag-trans)
|
||||
(let* ((a2-13
|
||||
(-> (the-as drawable-tree-tfrag-trans a1-2) arrays (+ (-> (the-as drawable-tree-tfrag-trans a1-2) length) -1))
|
||||
)
|
||||
(a1-7 (-> a2-13 length))
|
||||
(a2-14 (-> (the-as drawable-inline-array-tfrag a2-13) data))
|
||||
)
|
||||
(dotimes (a3-3 a1-7)
|
||||
(set! (-> a2-14 0 texture-masks-index) s4-0)
|
||||
(+! s4-0 1)
|
||||
(set! a2-14 (the-as (inline-array tfragment) (-> a2-14 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-tfrag-water)
|
||||
(let* ((a2-21
|
||||
(-> (the-as drawable-tree-tfrag-water a1-2) arrays (+ (-> (the-as drawable-tree-tfrag-water a1-2) length) -1))
|
||||
)
|
||||
(a1-10 (-> a2-21 length))
|
||||
(a2-22 (-> (the-as drawable-inline-array-tfrag a2-21) data))
|
||||
)
|
||||
(dotimes (a3-5 a1-10)
|
||||
(set! (-> a2-22 0 texture-masks-index) gp-0)
|
||||
(+! gp-0 1)
|
||||
(set! a2-22 (the-as (inline-array tfragment) (-> a2-22 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-instance-tie)
|
||||
(let* ((a1-13 (-> (the-as drawable-tree-instance-tie a1-2) prototypes prototype-array-tie))
|
||||
(a2-26 (-> a1-13 length))
|
||||
)
|
||||
(dotimes (a3-7 a2-26)
|
||||
(cond
|
||||
((logtest? (-> a1-13 array-data a3-7 flags) (prototype-flags tpage-water))
|
||||
(set! (-> a1-13 array-data a3-7 texture-masks-index) gp-0)
|
||||
(+! gp-0 1)
|
||||
)
|
||||
((logtest? (-> a1-13 array-data a3-7 flags) (prototype-flags tpage-alpha))
|
||||
(set! (-> a1-13 array-data a3-7 texture-masks-index) s4-0)
|
||||
(+! s4-0 1)
|
||||
)
|
||||
(else
|
||||
(set! (-> a1-13 array-data a3-7 texture-masks-index) s2-0)
|
||||
(+! s2-0 1)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
((= (-> a1-2 type) drawable-tree-instance-shrub)
|
||||
(let* ((a2-30 (-> (the-as drawable-tree-instance-shrub a1-2) info prototype-inline-array-shrub))
|
||||
(a1-16 (-> a2-30 length))
|
||||
(a2-31 (-> a2-30 data))
|
||||
)
|
||||
(dotimes (a3-9 a1-16)
|
||||
(set! (-> a2-31 0 texture-masks-index) s3-0)
|
||||
(+! s3-0 1)
|
||||
(set! a2-31 (the-as (inline-array prototype-bucket-shrub) (-> a2-31 1)))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s2-0)
|
||||
(set! (-> arg0 tfrag-masks) (new 'loading-level 'texture-masks-array (the-as int s2-0)))
|
||||
(set! (-> arg0 tfrag-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s2-0 4)))))
|
||||
(let ((v1-5 (-> arg0 tfrag-masks)))
|
||||
(dotimes (a0-8 (the-as int s2-0))
|
||||
(let ((a1-24 (-> v1-5 data a0-8)))
|
||||
(dotimes (a2-34 3)
|
||||
(set! (-> a1-24 data a2-34 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s3-0)
|
||||
(set! (-> arg0 shrub-masks) (new 'loading-level 'texture-masks-array (the-as int s3-0)))
|
||||
(set! (-> arg0 shrub-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s3-0 4)))))
|
||||
(let ((v1-10 (-> arg0 shrub-masks)))
|
||||
(dotimes (a0-11 (the-as int s3-0))
|
||||
(let ((a1-32 (-> v1-10 data a0-11)))
|
||||
(dotimes (a2-36 3)
|
||||
(set! (-> a1-32 data a2-36 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? s4-0)
|
||||
(set! (-> arg0 alpha-masks) (new 'loading-level 'texture-masks-array (the-as int s4-0)))
|
||||
(set! (-> arg0 alpha-mask-count) (the-as uint (malloc 'loading-level (the-as int (* s4-0 4)))))
|
||||
(let ((v1-15 (-> arg0 alpha-masks)))
|
||||
(dotimes (a0-14 (the-as int s4-0))
|
||||
(let ((a1-40 (-> v1-15 data a0-14)))
|
||||
(dotimes (a2-38 3)
|
||||
(set! (-> a1-40 data a2-38 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(when (nonzero? gp-0)
|
||||
(set! (-> arg0 water-masks) (new 'loading-level 'texture-masks-array (the-as int gp-0)))
|
||||
(set! (-> arg0 water-mask-count) (the-as uint (malloc 'loading-level (the-as int (* gp-0 4)))))
|
||||
(let ((v1-20 (-> arg0 water-masks)))
|
||||
(dotimes (a0-17 (the-as int gp-0))
|
||||
(let ((a1-48 (-> v1-20 data a0-17)))
|
||||
(dotimes (a2-40 3)
|
||||
(set! (-> a1-48 data a2-40 mask quad) (the-as uint128 0))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
;;-*-Lisp-*-
|
||||
(in-package goal)
|
||||
|
||||
;; definition of type focus
|
||||
(deftype focus (structure)
|
||||
((handle handle :offset-assert 0)
|
||||
(collide-with collide-spec :offset-assert 8)
|
||||
)
|
||||
:method-count-assert 13
|
||||
:size-assert #xc
|
||||
:flag-assert #xd0000000c
|
||||
(:methods
|
||||
(clear-focused (_type_) none 9)
|
||||
(collide-check? (_type_ process-focusable) object 10)
|
||||
(reset-to-collide-spec (_type_ collide-spec) none 11)
|
||||
(try-update-focus (_type_ process-focusable) symbol 12)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 3 of type focus
|
||||
(defmethod inspect focus ((obj focus))
|
||||
(when (not obj)
|
||||
(set! obj obj)
|
||||
(goto cfg-4)
|
||||
)
|
||||
(format #t "[~8x] ~A~%" obj 'focus)
|
||||
(format #t "~1Thandle: ~D~%" (-> obj handle))
|
||||
(format #t "~1Tcollide-with: ~D~%" (-> obj collide-with))
|
||||
(label cfg-4)
|
||||
obj
|
||||
)
|
||||
|
||||
;; definition for method 11 of type focus
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod reset-to-collide-spec focus ((obj focus) (arg0 collide-spec))
|
||||
(set! (-> obj collide-with) arg0)
|
||||
(set! (-> obj handle) (the-as handle #f))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
;; definition for method 10 of type focus
|
||||
(defmethod collide-check? focus ((obj focus) (arg0 process-focusable))
|
||||
(when (and arg0 (zero? (logand (-> arg0 focus-status) (focus-status disable dead))))
|
||||
(let* ((s5-0 (-> arg0 root))
|
||||
(v1-2 (if (type? s5-0 collide-shape)
|
||||
s5-0
|
||||
)
|
||||
)
|
||||
)
|
||||
(and v1-2 (logtest? (-> obj collide-with) (-> (the-as collide-shape v1-2) root-prim prim-core collide-as)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 12 of type focus
|
||||
(defmethod try-update-focus focus ((obj focus) (arg0 process-focusable))
|
||||
(when (!= (handle->process (-> obj handle)) arg0)
|
||||
(set! (-> obj handle) (process->handle arg0))
|
||||
#t
|
||||
)
|
||||
)
|
||||
|
||||
;; definition for method 9 of type focus
|
||||
;; WARN: Return type mismatch int vs none.
|
||||
(defmethod clear-focused focus ((obj focus))
|
||||
(set! (-> obj handle) (the-as handle #f))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
(set! (-> v2 i) (+ i 16))
|
||||
)
|
||||
|
||||
(let ((v1-quad (-> (the (pointer uint128) v1)))
|
||||
(let ((v1-quad (-> (the (pointer uint128) v1))) ;;
|
||||
(v2-quad (-> (the (pointer uint128) v2)))
|
||||
(v3-quad (the uint128 0))
|
||||
)
|
||||
@@ -18,7 +18,7 @@
|
||||
;;(print128 v2-quad) (format #t "~%")
|
||||
;; expect #x07060504171615140302010013121110
|
||||
(print128 v3-quad) (format #t "~%")
|
||||
|
||||
|
||||
;; expect #x0f0e0d0c1f1e1d1c0b0a09081b1a1918
|
||||
(.pextuw v3-quad v1-quad v2-quad)
|
||||
(print128 v3-quad) (format #t "~%")
|
||||
@@ -28,25 +28,27 @@
|
||||
(print128 v3-quad) (format #t "~%")
|
||||
(.ppach v3-quad v1-quad v2-quad)
|
||||
(print128 v3-quad) (format #t "~%")
|
||||
(.ppacb v3-quad v1-quad v2-quad) ;; expect 0e0c0a08'06040210'1e1c1a18'16141210
|
||||
(print128 v3-quad) (format #t "~%")
|
||||
)
|
||||
|
||||
|
||||
(let ((s1 (new 'stack-no-clear 'array 'uint32 4))
|
||||
(s2 (new 'stack-no-clear 'array 'uint32 4)))
|
||||
(set! (-> s1 0) #xdeadbeef)
|
||||
(set! (-> s1 1) #x12312323)
|
||||
(set! (-> s1 2) #x11112222)
|
||||
(set! (-> s1 3) #x11112223)
|
||||
|
||||
|
||||
(set! (-> s2 0) #xdeadbeee) ;; different
|
||||
(set! (-> s2 1) #x12312323)
|
||||
(set! (-> s2 2) #x91112222) ;; different
|
||||
(set! (-> s2 3) #x11112223)
|
||||
|
||||
|
||||
(let ((s1q (-> (the (pointer uint128) s1)))
|
||||
(s2q (-> (the (pointer uint128) s2)))
|
||||
(s3q (the uint128 0))
|
||||
)
|
||||
|
||||
|
||||
(.pceqw s3q s1q s2q)
|
||||
(print128 s3q) (format #t "~%")
|
||||
)
|
||||
|
||||
@@ -652,6 +652,7 @@ TEST_F(WithGameTests, Pextlw) {
|
||||
"#x07060504030201001716151413121110\n"
|
||||
"#x1f1e1d1c1b1a19180f0e0d0c0b0a0908\n"
|
||||
"#x0d0c0908050401001d1c191815141110\n"
|
||||
"#x0e0c0a08060402001e1c1a1816141210\n"
|
||||
"#xffffffff00000000ffffffff00000000\n"
|
||||
"#x00090000000000fefffffffe000002ff\n"
|
||||
"0\n"});
|
||||
|
||||
@@ -128,6 +128,8 @@
|
||||
"(method 18 mysql-nav-graph)", // asm / dead-code
|
||||
"(method 10 mysql-nav-graph)",
|
||||
|
||||
"bsp-camera-asm",
|
||||
|
||||
"i-hopefully-will-never-exist-dont-add-anything-after-me-please"
|
||||
],
|
||||
|
||||
|
||||
@@ -702,3 +702,38 @@ TEST(EmitterAVX, VPAND) {
|
||||
EXPECT_EQ(tester.dump_to_hex_string(true),
|
||||
"C5E1DBDBC4C161DBDDC591DBDBC4C111DBDDC561DBEBC44161DBEDC511DBEBC44111DBED");
|
||||
}
|
||||
|
||||
TEST(EmitterAVX, VPACKUSWB) {
|
||||
CodeTester tester;
|
||||
tester.init_code_buffer(1024);
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 3, XMM0 + 3, XMM0 + 3));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 3, XMM0 + 3, XMM0 + 13));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 3, XMM0 + 13, XMM0 + 3));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 3, XMM0 + 13, XMM0 + 13));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 13, XMM0 + 3, XMM0 + 3));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 13, XMM0 + 3, XMM0 + 13));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 13, XMM0 + 13, XMM0 + 3));
|
||||
tester.emit(IGen::vpackuswb(XMM0 + 13, XMM0 + 13, XMM0 + 13));
|
||||
EXPECT_EQ(tester.dump_to_hex_string(true),
|
||||
"C5E167DBC4C16167DDC59167DBC4C11167DDC56167EBC4416167EDC51167EBC4411167ED");
|
||||
}
|
||||
|
||||
TEST(EmitterAVX, VPSRLW) {
|
||||
CodeTester tester;
|
||||
tester.init_code_buffer(1024);
|
||||
tester.emit(IGen::ph_srl(XMM0 + 3, XMM0 + 4, 3));
|
||||
tester.emit(IGen::ph_srl(XMM0 + 3, XMM0 + 14, 4));
|
||||
tester.emit(IGen::ph_srl(XMM0 + 13, XMM0 + 4, 5));
|
||||
tester.emit(IGen::ph_srl(XMM0 + 13, XMM0 + 14, 6));
|
||||
EXPECT_EQ(tester.dump_to_hex_string(true), "C5E171D403C4C16171D604C59171D405C4C11171D606");
|
||||
}
|
||||
|
||||
TEST(EmitterAVX, VPSLLW) {
|
||||
CodeTester tester;
|
||||
tester.init_code_buffer(1024);
|
||||
tester.emit(IGen::ph_sll(XMM0 + 3, XMM0 + 4, 3));
|
||||
tester.emit(IGen::ph_sll(XMM0 + 3, XMM0 + 14, 4));
|
||||
tester.emit(IGen::ph_sll(XMM0 + 13, XMM0 + 4, 5));
|
||||
tester.emit(IGen::ph_sll(XMM0 + 13, XMM0 + 14, 6));
|
||||
EXPECT_EQ(tester.dump_to_hex_string(true), "C5E171F403C4C16171F604C59171F405C4C11171F606");
|
||||
}
|
||||
Reference in New Issue
Block a user