Decompile tfrag, tie, prim (#3429)

These still need to be ported to PC.
This commit is contained in:
water111 2024-03-17 13:32:05 -04:00 committed by GitHub
parent f7bfc8cab1
commit ea4820356c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
41 changed files with 10474 additions and 713 deletions

File diff suppressed because it is too large Load Diff

View File

@ -315,7 +315,8 @@
"(method 16 level)": [0, 1, 5, 13, 14, 15],
"upload-vis-bits": [2, 6, 3, 0],
"set-background-regs!": [4, 3],
"draw-drawable-tree-instance-shrub": [5, 7, 9, 11]
"draw-drawable-tree-instance-shrub": [5, 7, 9, 11],
"draw-drawable-tree-instance-tie": [21, 23, 31, 33]
},
// Sometimes the game might use format strings that are fetched dynamically,
@ -453,7 +454,8 @@
"generic-no-light-proc",
"(method 21 cloth-system)",
"debug-line-clip?",
"(method 9 font-work)"
"(method 9 font-work)",
"(method 9 prim-strip)"
],
"mips2c_jump_table_functions": {},

View File

@ -329,6 +329,30 @@
["L151", "(pointer bucket-id)", 12],
["L150", "(pointer bucket-id)", 12],
["L153", "(pointer bucket-id)", 12]
],
"tfrag-methods": [
["L89", "(inline-array tfrag-init-data)", 10],
["L90", "(pointer bucket-id)", 12],
["L91", "(pointer bucket-id)", 12],
["L92", "(pointer bucket-id)", 12],
["L93", "(pointer bucket-id)", 12],
["L95", "(pointer bucket-id)", 10],
["L96", "(pointer bucket-id)", 10]
],
"tie-methods": [
["L268", "(inline-array tie-init-data)", 10],
["L284", "(pointer bucket-id)", 10],
["L282", "(pointer bucket-id)", 10],
["L280", "(pointer bucket-id)", 10],
["L279", "(pointer bucket-id)", 10],
["L278", "(pointer bucket-id)", 10],
["L277", "(pointer bucket-id)", 10],
["L276", "(pointer bucket-id)", 10],
["L275", "(pointer bucket-id)", 10],
["L274", "(pointer bucket-id)", 10],
["L273", "(pointer bucket-id)", 10],
["L272", "(pointer bucket-id)", 10],
["L271", "(pointer bucket-id)", 10],
["L270", "(pointer bucket-id)", 10]
]
}

View File

@ -2603,7 +2603,120 @@
[115, "s3", "shrubbery"],
[161, "gp", "(inline-array prototype-bucket-shrub)"]
],
"draw-drawable-tree-instance-shrub": [[86, "a0", "drawable-group"]]
"draw-drawable-tree-instance-shrub": [[86, "a0", "drawable-group"]],
"(method 9 tfragment)": [
[27, "a3", "(pointer int32)"],
[32, "t0", "texture"]
],
"add-tfrag-mtx-0": [[[3, 17], "a0", "dma-packet"]],
"add-tfrag-mtx-1": [[[3, 17], "a0", "dma-packet"]],
"add-tfrag-data": [
[[3, 17], "a0", "dma-packet"],
[[24, 31], "v1", "dma-packet"]
],
"tfrag-init-buffer": [[[73, 81], "v1", "dma-packet"]],
"tfrag-end-buffer": [
[[21, 28], "a2", "dma-packet"],
[[31, 38], "a0", "(pointer vif-tag)"],
[[38, 42], "a0", "(pointer int32)"],
[[43, 49], "a0", "(pointer vif-tag)"]
],
"tfrag-vu1-init-buf": [
[[47, 55], "v1", "dma-packet"],
[[81, 86], "v1", "dma-packet"],
[89, "v1", "(pointer int32)"]
],
"draw-drawable-tree-tfrag-water": [
[18, "v1", "drawable-inline-array-node"],
[20, "a0", "drawable-inline-array-node"]
],
"draw-drawable-tree-tfrag-trans": [
[18, "v1", "drawable-inline-array-node"],
[20, "a0", "drawable-inline-array-node"]
],
"draw-drawable-tree-tfrag": [
[17, "v1", "drawable-inline-array-node"],
[19, "a0", "drawable-inline-array-node"]
],
"(method 9 tie-fragment)": [
[21, "a2", "(pointer int32)"],
[26, "a3", "(pointer int32)"],
[[1, 70], "s5", "adgif-shader"]
],
"tie-init-engine": [
[[37, 51], "a0", "dma-packet"],
[[63, 71], "a0", "dma-packet"],
[[73, 80], "a0", "dma-packet"],
[[81, 90], "v1", "vector"],
[[91, 98], "v1", "(pointer vif-tag)"]
],
"tie-end-buffer": [
[[47, 54], "a1", "dma-packet"],
[[58, 69], "a0", "(pointer vif-tag)"]
],
"tie-ints": [
[17, "v1", "(pointer uint32)"],
[21, "v1", "(pointer uint32)"]
],
"tie-floats": [[[3, 73], "gp", "(pointer uint32)"]],
"instance-tie-patch-buckets": [
[39, "a0", "(pointer uint64)"],
[137, "a0", "(pointer uint64)"],
[235, "a0", "(pointer uint64)"],
[333, "a0", "(pointer uint64)"],
[431, "a0", "(pointer uint64)"],
[530, "a0", "(pointer uint64)"],
[629, "a0", "(pointer uint64)"],
[728, "a0", "(pointer uint64)"],
[827, "a0", "(pointer uint64)"],
[926, "a0", "(pointer uint64)"],
[1025, "a0", "(pointer uint64)"],
[1124, "a0", "(pointer uint64)"],
[1223, "a0", "(pointer uint64)"]
],
"draw-drawable-tree-instance-tie": [
[[23, 37], "v1", "drawable-inline-array-node"],
[25, "a0", "drawable-inline-array-node"],
[120, "s2", "drawable-inline-array-instance-tie"],
[132, "v1", "int"],
[132, "a0", "int"]
],
"tie-init-buf": [
[[44, 51], "a0", "dma-packet"],
[[53, 60], "a0", "gs-gif-tag"],
[64, "a0", "(pointer gs-zbuf)"],
[66, "a0", "(pointer gs-reg64)"],
[[71, 79], "v1", "dma-packet"],
[[104, 110], "v1", "dma-packet"],
[112, "v1", "(pointer uint32)"]
],
"(method 13 drawable-tree-instance-tie)": [
[[51, 70], "t1", "tie-fragment"],
[[102, 120], "a3", "tie-fragment"],
[[160, 178], "t1", "tie-fragment"],
[[211, 229], "a3", "tie-fragment"],
[[266, 286], "t1", "tie-fragment"],
[[320, 340], "a1", "tie-fragment"],
[[381, 400], "t1", "tie-fragment"],
[[432, 450], "a3", "tie-fragment"],
[[487, 507], "t1", "tie-fragment"],
[[541, 561], "a1", "tie-fragment"],
[[598, 616], "t1", "tie-fragment"],
[[649, 667], "a3", "tie-fragment"],
[[703, 723], "t1", "tie-fragment"],
[[756, 776], "a1", "tie-fragment"]
],
"(method 9 prim-strip)": [
[224, "t2", "int"],
[224, "t0", "int"],
[226, "t1", "int"],
[226, "a3", "int"],
[[190, 231], "a1", "(inline-array prim-vertex)"]
],
"prim-engine-execute": [
[[15, 21], "v1", "connection"],
[[21, 25], "a0", "prim-strip"]
]
}

View File

@ -189,6 +189,7 @@ set(RUNTIME_SOURCE
mips2c/jak3_functions/font.cpp
mips2c/jak3_functions/generic_effect.cpp
mips2c/jak3_functions/lights.cpp
mips2c/jak3_functions/prim.cpp
mips2c/jak3_functions/sky.cpp
mips2c/mips2c_table.cpp
overlord/common/dma.cpp

View File

@ -13,7 +13,7 @@ struct Cache {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
// u32 call_addr = 0;
c->daddiu(sp, sp, -16); // daddiu sp, sp, -16
c->sd(fp, 8, sp); // sd fp, 8(sp)
c->mov64(fp, t9); // or fp, t9, r0
@ -171,7 +171,7 @@ struct Cache {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
// u32 call_addr = 0;
c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7)
c->lqc2(vf26, 812, v1); // lqc2 vf26, 812(v1)
c->lqc2(vf27, 812, v1); // lqc2 vf27, 812(v1)
@ -2350,7 +2350,7 @@ struct Cache {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
// u32 call_addr = 0;
c->lqc2(vf23, 12, a1); // lqc2 vf23, 12(a1)
c->lqc2(vf24, 12, a1); // lqc2 vf24, 12(a1)
c->lw(v1, 64, a1); // lw v1, 64(a1)

View File

@ -0,0 +1,479 @@
//--------------------------MIPS2C---------------------
// clang-format off
#include "game/mips2c/mips2c_private.h"
#include "game/kernel/jak3/kscheme.h"
using ::jak3::intern_from_c;
namespace Mips2C::jak3 {
namespace method_9_prim_strip {
struct Cache {
void* display; // *display*
void* prim_work; // *prim-work*
void* stdcon; // *stdcon*
void* adgif_shader_texture_simple; // adgif-shader<-texture-simple!
void* dma_bucket_insert_tag; // dma-bucket-insert-tag
void* format; // format
void* lookup_texture_by_id; // lookup-texture-by-id
void* paused; // paused?
} cache;
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
c->daddiu(sp, sp, -112); // daddiu sp, sp, -112
c->sd(ra, 0, sp); // sd ra, 0(sp)
c->sd(fp, 8, sp); // sd fp, 8(sp)
c->mov64(fp, t9); // or fp, t9, r0
c->sq(s1, 16, sp); // sq s1, 16(sp)
c->sq(s2, 32, sp); // sq s2, 32(sp)
c->sq(s3, 48, sp); // sq s3, 48(sp)
c->sq(s4, 64, sp); // sq s4, 64(sp)
c->sq(s5, 80, sp); // sq s5, 80(sp)
c->sq(gp, 96, sp); // sq gp, 96(sp)
c->mov64(gp, a0); // or gp, a0, r0
c->mov64(s1, a1); // or s1, a1, r0
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lw(v1, 0, v1); // lw v1, 0(v1)
c->dsll(v1, v1, 2); // dsll v1, v1, 2
c->load_symbol2(a0, cache.display); // lw a0, *display*(s7)
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->lwu(v1, 8, v1); // lwu v1, 8(v1)
c->lwu(v1, 36, v1); // lwu v1, 36(v1)
c->lhu(a0, 8, gp); // lhu a0, 8(gp)
c->daddiu(a0, a0, 79); // daddiu a0, a0, 79
c->addiu(a1, r0, 80); // addiu a1, r0, 80
// Unknown instr: divu a0, a1
// Unknown instr: mflo a0
c->gprs[a0].du64[0] = c->gprs[a0].du32[0] / c->gprs[a1].du32[0];
c->addiu(a1, r0, 144); // addiu a1, r0, 144
c->lhu(a2, 8, gp); // lhu a2, 8(gp)
c->multu3(a1, a1, a2); // multu3 a1, a1, a2
c->dsll(a0, a0, 7); // dsll a0, a0, 7
c->daddu(a0, a1, a0); // daddu a0, a1, a0
c->lwu(a1, 8, v1); // lwu a1, 8(v1)
c->lwu(v1, 4, v1); // lwu v1, 4(v1)
c->dsubu(v1, a1, v1); // dsubu v1, a1, v1
c->sltu(v1, a0, v1); // sltu v1, a0, v1
bc = c->sgpr64(v1) == 0; // beq v1, r0, L23
// nop // sll r0, r0, 0
if (bc) {goto block_28;} // branch non-likely
c->load_symbol2(t9, cache.lookup_texture_by_id); // lw t9, lookup-texture-by-id(s7)
c->lwu(a0, 12, gp); // lwu a0, 12(gp)
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(a1, v0); // or a1, v0, r0
c->load_symbol2(s3, cache.prim_work); // lw s3, *prim-work*(s7)
c->lwu(v1, 80, gp); // lwu v1, 80(gp)
c->dsll(v1, v1, 4); // dsll v1, v1, 4
c->daddiu(v1, v1, 236); // daddiu v1, v1, 236
c->daddu(s2, v1, s3); // daddu s2, v1, s3
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lw(v1, 0, v1); // lw v1, 0(v1)
c->dsll(v1, v1, 2); // dsll v1, v1, 2
c->load_symbol2(a0, cache.display); // lw a0, *display*(s7)
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->lwu(v1, 8, v1); // lwu v1, 8(v1)
c->lwu(s4, 36, v1); // lwu s4, 36(v1)
c->lwu(s5, 4, s4); // lwu s5, 4(s4)
c->lhu(v1, 8, gp); // lhu v1, 8(gp)
c->sw(v1, 224, s3); // sw v1, 224(s3)
c->daddiu(v1, gp, 92); // daddiu v1, gp, 92
c->sw(v1, 232, s3); // sw v1, 232(s3)
c->lwu(v1, 0, gp); // lwu v1, 0(gp)
c->andi(v1, v1, 1); // andi v1, v1, 1
bc = c->sgpr64(v1) == 0; // beq v1, r0, L8
// nop // sll r0, r0, 0
if (bc) {goto block_3;} // branch non-likely
c->addiu(v1, r0, 1); // addiu v1, r0, 1
//beq r0, r0, L9 // beq r0, r0, L9
// nop // sll r0, r0, 0
goto block_4; // branch always
block_3:
c->addiu(v1, r0, 0); // addiu v1, r0, 0
block_4:
c->lwu(a0, 0, gp); // lwu a0, 0(gp)
c->andi(a0, a0, 2); // andi a0, a0, 2
bc = c->sgpr64(a0) == 0; // beq a0, r0, L10
// nop // sll r0, r0, 0
if (bc) {goto block_6;} // branch non-likely
c->addiu(a0, r0, 1); // addiu a0, r0, 1
//beq r0, r0, L11 // beq r0, r0, L11
// nop // sll r0, r0, 0
goto block_7; // branch always
block_6:
c->addiu(a0, r0, 0); // addiu a0, r0, 0
block_7:
c->lwu(a2, 0, gp); // lwu a2, 0(gp)
c->andi(a2, a2, 4); // andi a2, a2, 4
bc = c->sgpr64(a2) == 0; // beq a2, r0, L12
// nop // sll r0, r0, 0
if (bc) {goto block_9;} // branch non-likely
c->addiu(a2, r0, 1); // addiu a2, r0, 1
//beq r0, r0, L13 // beq r0, r0, L13
// nop // sll r0, r0, 0
goto block_10; // branch always
block_9:
c->addiu(a2, r0, 0); // addiu a2, r0, 0
block_10:
c->lui(a3, 12288); // lui a3, 12288
c->ori(a3, a3, 16384); // ori a3, a3, 16384
c->dsll32(t0, a2, 31); // dsll32 t0, a2, 31
c->dsrl32(t0, t0, 26); // dsrl32 t0, t0, 26
c->ori(t0, t0, 13); // ori t0, t0, 13
c->dsll32(t1, a0, 31); // dsll32 t1, a0, 31
c->dsrl32(t1, t1, 27); // dsrl32 t1, t1, 27
c->or_(t0, t0, t1); // or t0, t0, t1
c->dsll32(t1, v1, 31); // dsll32 t1, v1, 31
c->dsrl32(t1, t1, 25); // dsrl32 t1, t1, 25
c->or_(t0, t0, t1); // or t0, t0, t1
c->dsll32(t0, t0, 21); // dsll32 t0, t0, 21
c->dsrl32(t0, t0, 6); // dsrl32 t0, t0, 6
c->or_(a3, a3, t0); // or a3, a3, t0
c->sw(a3, 80, s3); // sw a3, 80(s3)
c->lui(a3, 12288); // lui a3, 12288
c->ori(a3, a3, 16384); // ori a3, a3, 16384
c->dsll32(a2, a2, 31); // dsll32 a2, a2, 31
c->dsrl32(a2, a2, 26); // dsrl32 a2, a2, 26
c->ori(a2, a2, 12); // ori a2, a2, 12
c->dsll32(a0, a0, 31); // dsll32 a0, a0, 31
c->dsrl32(a0, a0, 27); // dsrl32 a0, a0, 27
c->or_(a0, a2, a0); // or a0, a2, a0
c->dsll32(v1, v1, 31); // dsll32 v1, v1, 31
c->dsrl32(v1, v1, 25); // dsrl32 v1, v1, 25
c->or_(v1, a0, v1); // or v1, a0, v1
c->dsll32(v1, v1, 21); // dsll32 v1, v1, 21
c->dsrl32(v1, v1, 6); // dsrl32 v1, v1, 6
c->or_(v1, a3, v1); // or v1, a3, v1
c->sw(v1, 84, s3); // sw v1, 84(s3)
bc = c->sgpr64(s7) == c->sgpr64(a1); // beq s7, a1, L19
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_20;} // branch non-likely
c->lwu(v1, 84, gp); // lwu v1, 84(gp)
c->lwu(a0, 88, gp); // lwu a0, 88(gp)
c->lwu(a0, 88, gp); // lwu a0, 88(gp)
c->daddiu(a0, a0, 12); // daddiu a0, a0, 12
c->addiu(a2, r0, 0); // addiu a2, r0, 0
//beq r0, r0, L15 // beq r0, r0, L15
// nop // sll r0, r0, 0
goto block_13; // branch always
block_12:
c->dsll(a3, a0, 4); // dsll a3, a0, 4
c->daddu(a3, v1, a3); // daddu a3, v1, a3
c->lq(a3, 4828, a3); // lq a3, 4828(a3)
c->dsll(t0, a2, 4); // dsll t0, a2, 4
c->daddu(t0, a1, t0); // daddu t0, a1, t0
c->lq(t0, 60, t0); // lq t0, 60(t0)
c->por(a3, a3, t0); // por a3, a3, t0
c->dsll(t0, a0, 4); // dsll t0, a0, 4
c->daddu(t0, v1, t0); // daddu t0, v1, t0
c->sq(a3, 4828, t0); // sq a3, 4828(t0)
c->daddiu(a2, a2, 1); // daddiu a2, a2, 1
block_13:
c->slti(a3, a2, 3); // slti a3, a2, 3
bc = c->sgpr64(a3) != 0; // bne a3, r0, L14
// nop // sll r0, r0, 0
if (bc) {goto block_12;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
c->mov64(v1, s7); // or v1, s7, r0
c->load_symbol2(t9, cache.adgif_shader_texture_simple);// lw t9, adgif-shader<-texture-simple!(s7)
c->daddiu(a0, s3, 128); // daddiu a0, s3, 128
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->ld(v1, 60, gp); // ld v1, 60(gp)
c->sd(v1, 176, s3); // sd v1, 176(s3)
c->addiu(v1, r0, 8); // addiu v1, r0, 8
c->sd(v1, 184, s3); // sd v1, 184(s3)
c->ld(v1, 68, gp); // ld v1, 68(gp)
c->sd(v1, 192, s3); // sd v1, 192(s3)
c->addiu(v1, r0, 66); // addiu v1, r0, 66
c->sb(v1, 200, s3); // sb v1, 200(s3)
c->lqc2(vf1, 0, s1); // lqc2 vf1, 0(s1)
c->lqc2(vf2, 16, s1); // lqc2 vf2, 16(s1)
c->lqc2(vf3, 32, s1); // lqc2 vf3, 32(s1)
c->lqc2(vf4, 48, s1); // lqc2 vf4, 48(s1)
c->lqc2(vf5, 128, s3); // lqc2 vf5, 128(s3)
c->lqc2(vf6, 144, s3); // lqc2 vf6, 144(s3)
c->lqc2(vf7, 160, s3); // lqc2 vf7, 160(s3)
c->lqc2(vf8, 176, s3); // lqc2 vf8, 176(s3)
c->lqc2(vf9, 192, s3); // lqc2 vf9, 192(s3)
c->lqc2(vf10, 80, s3); // lqc2 vf10, 80(s3)
c->lqc2(vf11, 28, gp); // lqc2 vf11, 28(gp)
c->lqc2(vf12, 44, gp); // lqc2 vf12, 44(gp)
//beq r0, r0, L18 // beq r0, r0, L18
// nop // sll r0, r0, 0
goto block_18; // branch always
block_15:
c->addiu(v1, r0, 80); // addiu v1, r0, 80
c->lw(a0, 224, s3); // lw a0, 224(s3)
c->slt(a1, v1, a0); // slt a1, v1, a0
c->movz(v1, a0, a1); // movz v1, a0, a1
c->sw(v1, 228, s3); // sw v1, 228(s3)
c->lbu(v1, 1, s2); // lbu v1, 1(s2)
c->andi(v1, v1, 1); // andi v1, v1, 1
c->dsll(v1, v1, 4); // dsll v1, v1, 4
c->daddiu(v1, v1, 48); // daddiu v1, v1, 48
c->daddu(a0, v1, s3); // daddu a0, v1, s3
c->lw(v1, 4, s4); // lw v1, 4(s4)
c->lq(a0, 0, a0); // lq a0, 0(a0)
c->daddiu(a1, v1, 16); // daddiu a1, v1, 16
c->lw(v1, 228, s3); // lw v1, 228(s3)
c->sq(a0, -16, a1); // sq a0, -16(a1)
c->sqc2(vf1, 0, a1); // sqc2 vf1, 0(a1)
c->sqc2(vf2, 16, a1); // sqc2 vf2, 16(a1)
c->sqc2(vf3, 32, a1); // sqc2 vf3, 32(a1)
c->sqc2(vf4, 48, a1); // sqc2 vf4, 48(a1)
c->sqc2(vf10, 64, a1); // sqc2 vf10, 64(a1)
c->sqc2(vf11, 80, a1); // sqc2 vf11, 80(a1)
c->sqc2(vf12, 96, a1); // sqc2 vf12, 96(a1)
c->sw(v1, 92, a1); // sw v1, 92(a1)
c->sqc2(vf5, 112, a1); // sqc2 vf5, 112(a1)
c->sqc2(vf6, 128, a1); // sqc2 vf6, 128(a1)
c->sqc2(vf7, 144, a1); // sqc2 vf7, 144(a1)
c->sqc2(vf8, 160, a1); // sqc2 vf8, 160(a1)
c->sqc2(vf9, 176, a1); // sqc2 vf9, 176(a1)
c->ori(a0, v1, 32768); // ori a0, v1, 32768
c->sw(a0, 140, a1); // sw a0, 140(a1)
c->daddiu(a0, a1, 192); // daddiu a0, a1, 192
c->sw(a0, 4, s4); // sw a0, 4(s4)
c->lbu(a0, 0, s2); // lbu a0, 0(s2)
c->addiu(a1, r0, 3); // addiu a1, r0, 3
// Unknown instr: divu a0, a1
// Unknown instr: mfhi a0
c->gprs[a0].du64[0] = c->gprs[a0].du32[0] % c->gprs[a1].du32[0];
c->dsll(a0, a0, 4); // dsll a0, a0, 4
c->daddu(a0, r0, a0); // daddu a0, r0, a0
c->daddu(a0, a0, s3); // daddu a0, a0, s3
c->addiu(a1, r0, 3); // addiu a1, r0, 3
c->mult3(a1, a1, v1); // mult3 a1, a1, v1
c->ld(a2, 0, a0); // ld a2, 0(a0)
c->lui(a3, -1); // lui a3, -1
c->and_(a2, a2, a3); // and a2, a2, a3
c->dsll32(a3, a1, 16); // dsll32 a3, a1, 16
c->dsrl32(a3, a3, 16); // dsrl32 a3, a3, 16
c->or_(a2, a2, a3); // or a2, a2, a3
c->sd(a2, 0, a0); // sd a2, 0(a0)
c->lwu(a2, 12, a0); // lwu a2, 12(a0)
c->lui(a3, -256); // lui a3, -256
c->ori(a3, a3, 65535); // ori a3, a3, 65535
c->and_(a2, a2, a3); // and a2, a2, a3
c->dsll32(a1, a1, 24); // dsll32 a1, a1, 24
c->dsrl32(a1, a1, 8); // dsrl32 a1, a1, 8
c->or_(a1, a2, a1); // or a1, a2, a1
c->sw(a1, 12, a0); // sw a1, 12(a0)
c->lw(a2, 4, s4); // lw a2, 4(s4)
c->lq(a3, 0, a0); // lq a3, 0(a0)
c->lq(a0, 208, s3); // lq a0, 208(s3)
c->lw(a1, 232, s3); // lw a1, 232(s3)
// nop // sll r0, r0, 0
c->sq(a3, 0, a2); // sq a3, 0(a2)
c->daddiu(a2, a2, 16); // daddiu a2, a2, 16
c->sw(a2, 4, s4); // sw a2, 4(s4)
// nop // sll r0, r0, 0
block_16:
// nop // sll r0, r0, 0
c->lw(t0, 12, a1); // lw t0, 12(a1)
// nop // sll r0, r0, 0
c->lw(a3, 44, a1); // lw a3, 44(a1)
c->pextlb(t0, r0, t0); // pextlb t0, r0, t0
c->lqc2(vf15, 0, a1); // lqc2 vf15, 0(a1)
c->pextlh(t0, r0, t0); // pextlh t0, r0, t0
c->lqc2(vf16, 32, a1); // lqc2 vf16, 32(a1)
c->pextlb(a3, r0, a3); // pextlb a3, r0, a3
c->lqc2(vf13, 16, a1); // lqc2 vf13, 16(a1)
c->pextlh(a3, r0, a3); // pextlh a3, r0, a3
c->lqc2(vf14, 48, a1); // lqc2 vf14, 48(a1)
c->vftoi12(DEST::xyzw, vf15, vf15); // vftoi12.xyzw vf15, vf15
c->sq(t0, 16, a2); // sq t0, 16(a2)
c->vftoi12(DEST::xyzw, vf16, vf16); // vftoi12.xyzw vf16, vf16
c->sq(a3, 64, a2); // sq a3, 64(a2)
// nop // sll r0, r0, 0
c->lw(t0, 8, a1); // lw t0, 8(a1)
// nop // sll r0, r0, 0
c->lw(a3, 40, a1); // lw a3, 40(a1)
c->daddiu(a1, a1, 64); // daddiu a1, a1, 64
c->mov128_gpr_vf(t2, vf15); // qmfc2.i t2, vf15
c->daddiu(v1, v1, -2); // daddiu v1, v1, -2
c->mov128_gpr_vf(t1, vf16); // qmfc2.i t1, vf16
c->pand(t2, t2, a0); // pand t2, t2, a0
c->sqc2(vf13, 32, a2); // sqc2 vf13, 32(a2)
c->pand(t1, t1, a0); // pand t1, t1, a0
c->sqc2(vf14, 80, a2); // sqc2 vf14, 80(a2)
c->or_(t0, t2, t0); // or t0, t2, t0
// nop // sll r0, r0, 0
c->or_(a3, t1, a3); // or a3, t1, a3
// nop // sll r0, r0, 0
c->sq(t0, 0, a2); // sq t0, 0(a2)
c->daddiu(a2, a2, 96); // daddiu a2, a2, 96
bc = ((s64)c->sgpr64(v1)) > 0; // bgtz v1, L17
c->sq(a3, -48, a2); // sq a3, -48(a2)
if (bc) {goto block_16;} // branch non-likely
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->addiu(a0, r0, 48); // addiu a0, r0, 48
c->lw(a1, 228, s3); // lw a1, 228(s3)
c->mult3(a0, a0, a1); // mult3 a0, a0, a1
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->sw(v1, 4, s4); // sw v1, 4(s4)
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->lq(a0, 96, s3); // lq a0, 96(s3)
c->sq(a0, 0, v1); // sq a0, 0(v1)
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->daddiu(v1, v1, 16); // daddiu v1, v1, 16
c->sw(v1, 4, s4); // sw v1, 4(s4)
c->lw(v1, 224, s3); // lw v1, 224(s3)
c->daddiu(v1, v1, -78); // daddiu v1, v1, -78
c->sw(v1, 224, s3); // sw v1, 224(s3)
c->lwu(v1, 232, s3); // lwu v1, 232(s3)
c->daddiu(v1, v1, 2496); // daddiu v1, v1, 2496
c->sw(v1, 232, s3); // sw v1, 232(s3)
c->lbu(v1, 0, s2); // lbu v1, 0(s2)
c->daddiu(v1, v1, 1); // daddiu v1, v1, 1
c->sb(v1, 0, s2); // sb v1, 0(s2)
c->lbu(v1, 1, s2); // lbu v1, 1(s2)
c->daddiu(v1, v1, 1); // daddiu v1, v1, 1
c->sb(v1, 1, s2); // sb v1, 1(s2)
block_18:
c->addiu(v1, r0, 2); // addiu v1, r0, 2
c->lw(a0, 224, s3); // lw a0, 224(s3)
c->slt(v1, v1, a0); // slt v1, v1, a0
bc = c->sgpr64(v1) != 0; // bne v1, r0, L16
// nop // sll r0, r0, 0
if (bc) {goto block_15;} // branch non-likely
c->mov64(v1, s7); // or v1, s7, r0
block_20:
c->load_symbol2(t9, cache.paused); // lw t9, paused?(s7)
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
bc = c->sgpr64(s7) != c->sgpr64(v0); // bne s7, v0, L21
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_25;} // branch non-likely
c->lwu(v1, 0, gp); // lwu v1, 0(gp)
c->andi(v1, v1, 8); // andi v1, v1, 8
bc = c->sgpr64(v1) == 0; // beq v1, r0, L21
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_25;} // branch non-likely
c->lwu(v1, 0, gp); // lwu v1, 0(gp)
c->andi(v1, v1, 16); // andi v1, v1, 16
bc = c->sgpr64(v1) != 0; // bne v1, r0, L20
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_24;} // branch non-likely
c->sh(r0, 8, gp); // sh r0, 8(gp)
c->gprs[v1].du64[0] = 0; // or v1, r0, r0
block_24:
c->addiu(v1, r0, -17); // addiu v1, r0, -17
c->lwu(a0, 0, gp); // lwu a0, 0(gp)
c->and_(v1, v1, a0); // and v1, v1, a0
c->sw(v1, 0, gp); // sw v1, 0(gp)
block_25:
c->lwu(a3, 4, s4); // lwu a3, 4(s4)
bc = c->sgpr64(s5) == c->sgpr64(a3); // beq s5, a3, L22
c->mov64(v1, s7); // or v1, s7, r0
if (bc) {goto block_27;} // branch non-likely
c->lwu(v1, 4, s4); // lwu v1, 4(s4)
c->lui(a0, 8192); // lui a0, 8192
c->sd(a0, 0, v1); // sd a0, 0(v1)
c->sw(r0, 8, v1); // sw r0, 8(v1)
c->sw(r0, 12, v1); // sw r0, 12(v1)
c->daddiu(v1, v1, 16); // daddiu v1, v1, 16
c->sw(v1, 4, s4); // sw v1, 4(s4)
c->load_symbol2(t9, cache.dma_bucket_insert_tag); // lw t9, dma-bucket-insert-tag(s7)
c->load_symbol2(v1, cache.display); // lw v1, *display*(s7)
c->lw(v1, 0, v1); // lw v1, 0(v1)
c->dsll(v1, v1, 2); // dsll v1, v1, 2
c->load_symbol2(a0, cache.display); // lw a0, *display*(s7)
c->daddu(v1, v1, a0); // daddu v1, v1, a0
c->lwu(v1, 8, v1); // lwu v1, 8(v1)
c->lwu(a0, 40, v1); // lwu a0, 40(v1)
c->lw(a1, 76, gp); // lw a1, 76(gp)
c->mov64(a2, s5); // or a2, s5, r0
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
block_27:
//beq r0, r0, L24 // beq r0, r0, L24
// nop // sll r0, r0, 0
goto block_29; // branch always
block_28:
c->load_symbol2(t9, cache.format); // lw t9, format(s7)
c->load_symbol2(a0, cache.stdcon); // lw a0, *stdcon*(s7)
// daddiu a1, fp, L29 // daddiu a1, fp, L29
ASSERT_NOT_REACHED(); // ran out of memory error print.
call_addr = c->gprs[t9].du32[0]; // function call:
c->sll(v0, ra, 0); // sll v0, ra, 0
c->jalr(call_addr); // jalr ra, t9
c->mov64(v1, v0); // or v1, v0, r0
block_29:
c->gprs[v0].du64[0] = 0; // or v0, r0, r0
c->ld(ra, 0, sp); // ld ra, 0(sp)
c->ld(fp, 8, sp); // ld fp, 8(sp)
c->lq(gp, 96, sp); // lq gp, 96(sp)
c->lq(s5, 80, sp); // lq s5, 80(sp)
c->lq(s4, 64, sp); // lq s4, 64(sp)
c->lq(s3, 48, sp); // lq s3, 48(sp)
c->lq(s2, 32, sp); // lq s2, 32(sp)
c->lq(s1, 16, sp); // lq s1, 16(sp)
//jr ra // jr ra
c->daddiu(sp, sp, 112); // daddiu sp, sp, 112
goto end_of_function; // return
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
// nop // sll r0, r0, 0
end_of_function:
return c->gprs[v0].du64[0];
}
void link() {
cache.display = intern_from_c(-1, 0, "*display*").c();
cache.prim_work = intern_from_c(-1, 0, "*prim-work*").c();
cache.stdcon = intern_from_c(-1, 0, "*stdcon*").c();
cache.adgif_shader_texture_simple = intern_from_c(-1, 0, "adgif-shader<-texture-simple!").c();
cache.dma_bucket_insert_tag = intern_from_c(-1, 0, "dma-bucket-insert-tag").c();
cache.format = intern_from_c(-1, 0, "format").c();
cache.lookup_texture_by_id = intern_from_c(-1, 0, "lookup-texture-by-id").c();
cache.paused = intern_from_c(-1, 0, "paused?").c();
gLinkedFunctionTable.reg("(method 9 prim-strip)", execute, 256);
}
} // namespace method_9_prim_strip
} // namespace Mips2C
// add method_9_prim_strip::link to the link callback table for the object file.
// FWD DEC:

View File

@ -280,6 +280,7 @@ namespace generic_no_light_proc { extern void link(); }
namespace method_9_font_work { extern void link(); }
namespace draw_string_asm { extern void link(); }
namespace get_string_length { extern void link(); }
namespace method_9_prim_strip { extern void link(); }
}
// clang-format on
@ -464,8 +465,8 @@ PerGameVersion<std::unordered_map<std::string, std::vector<void (*)()>>> gMips2C
jak3::generic_warp_dest::link, jak3::generic_warp_envmap_dest::link,
jak3::generic_no_light_proc::link}},
{"font",
{jak3::method_9_font_work::link, jak3::draw_string_asm::link,
jak3::get_string_length::link}}}};
{jak3::method_9_font_work::link, jak3::draw_string_asm::link, jak3::get_string_length::link}},
{"prim", {jak3::method_9_prim_strip::link}}}};
void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) {
const auto& it = m_executes.insert({name, {exec, Ptr<u8>()}});

View File

@ -8,13 +8,14 @@
(defenum prim-flags
:type uint32
:bitfield #t
(pf0 0) ;; set by default
(pf1 1) ;; set by default
(pf2 2)
(pf3 3)
(pf4 4)
(alpha-blend-enable 0) ;; set by default
(texture-enable 1) ;; set by default
(fog-enable 2)
(pf3 3) ;; auto-clear vertices?
(pf4 4) ;; has new verts to draw?
(no-texture-name 5) ;; only has the ID.
)
(define-extern process-drawable-art-error (state string process-drawable))
(define-extern *prim-engine* engine)
@ -35,7 +36,7 @@ some special effect code, then sent to the prim renderer to be drawn."
"Base class for prim-strip."
()
(:methods
(prim-base-method-9 () none)
(generate-dma! (_type_ matrix) none)
)
)
@ -63,7 +64,7 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
)
(:methods
(new (symbol type int texture-id string) _type_)
(prim-strip-method-10 (_type_ draw-control) none)
(setup-dma-and-tex (_type_ draw-control) none)
)
)
@ -76,7 +77,7 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
(go process-drawable-art-error "prim-strip")
)
(add-connection *prim-engine* pp #f pp s5-0 #f)
(set! (-> s5-0 flags) (prim-flags pf0 pf1))
(set! (-> s5-0 flags) (prim-flags alpha-blend-enable texture-enable))
(set! (-> s5-0 num-verts) (the-as uint num-vertices))
(set! (-> s5-0 allocated-num-verts) (the-as uint num-vertices))
(set! (-> s5-0 data0) (new 'static 'gs-test))
@ -147,10 +148,10 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
(mask vector4w :inline)
(in-verts int32)
(num-verts int32)
(vert-ptr prim-vertex)
(vert-ptr (inline-array prim-vertex))
(sinks prim-sink 68 :inline)
)
(:methods
(prim-work-method-9 () none)
(reset! (_type_) none)
)
)

View File

@ -5,5 +5,124 @@
;; name in dgo: prim
;; dgos: GAME
;; for now, I made the DMA generation mips2c
;; it's probably possible to rewrite in GOAL, or just totally redo.
;; we'll have to see how much is drawn with this.
;; somewhat annoyingly, it seems to resue generic buckets...
;; DECOMP BEGINS
(define *prim-work*
(new 'static 'prim-work
:vertex-tmpl (new 'static 'inline-array dma-packet 3
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v4-32))
)
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v4-32))
)
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v4-32))
)
)
:control-tmpl (new 'static 'inline-array dma-packet 2
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #xc :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x345 :num #xc :cmd (vif-cmd unpack-v4-32))
)
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #xc :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x363 :num #xc :cmd (vif-cmd unpack-v4-32))
)
)
:giftag (new 'static 'generic-gif-tag
:fan-prim (new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
:str-prim (new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
:regs (new 'static 'gif-tag-regs-32 :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
:num-strips #x1
)
:call-scissor (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscalf) :msk #x1)
)
:call-noclip (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1)
)
:mask (new 'static 'vector4w :x -2 :y -1 :z -1)
)
)
(defmethod reset! ((this prim-work))
"Reset all pending vertex/control data."
(dotimes (v1-0 68)
(let ((a1-2 (-> this sinks v1-0)))
(set! (-> a1-2 vertex-count) (the-as uint 0))
(set! (-> a1-2 control-count) (the-as uint 0))
)
0
)
0
(none)
)
(defmethod-mips2c "(method 9 prim-strip)" 9 prim-strip)
(defmethod setup-dma-and-tex ((this prim-strip) (arg0 draw-control))
"Set up the bucket, prim sink, and texture."
(let ((s5-0 (-> *level* level (-> arg0 level-index))))
(let ((s2-0 (-> s5-0 draw-index))
(s4-0 (-> arg0 default-texture-page))
)
(let ((s3-0 (vu1-bucket-map s2-0 (the-as int s4-0) (merc-mode mercneric2)))
(v1-3 (vu1-bucket-map s2-0 (the-as int s4-0) (merc-mode mm5)))
)
(set! (-> this bucket) s3-0)
(set! (-> this sink) (the-as uint v1-3))
)
(set! (-> this level) s5-0)
(set! (-> this texture-index) s4-0)
)
(when (not (logtest? (-> this flags) (prim-flags no-texture-name)))
(set! (-> this tex-id)
(lookup-level-texture-id-by-name (the-as string (-> this tex-name)) s5-0 (the-as int (-> this texture-index)))
)
(logior! (-> this flags) (prim-flags no-texture-name))
)
)
0
(none)
)
(defun prim-engine-execute ()
"Generate all prim DMA."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic))
(when (not (get-menu-mode *blit-displays-work*))
(let* ((gp-0 *prim-engine*)
(s5-0 (-> *math-camera* camera-temp))
(v1-9 (-> gp-0 alive-list next0))
(s4-0 (-> (the-as connection v1-9) next0))
)
(while (!= v1-9 (-> gp-0 alive-list-end))
(-> (the-as connection v1-9) param1)
(generate-dma! (the-as prim-strip (-> (the-as connection v1-9) param2)) s5-0)
(set! v1-9 s4-0)
(set! s4-0 (-> s4-0 next0))
)
)
)
)
0
(none)
)

View File

@ -5,6 +5,8 @@
;; name in dgo: draw-node
;; dgos: GAME
(define-extern draw-node-cull (function pointer pointer (inline-array draw-node) int none))
;; DECOMP BEGINS
(defmethod collect-regions ((this draw-node) (arg0 sphere) (arg1 int) (arg2 region-prim-list))

View File

@ -9,6 +9,7 @@
(define-extern sphere-in-view-frustum? (function sphere symbol))
(define-extern line-in-view-frustum? (function vector vector symbol))
(define-extern vis-cull (function int symbol))
;; DECOMP BEGINS

View File

@ -49,6 +49,7 @@
(dma-base uint32 :overlay-at (-> dma-chain 1))
(dma-level-1 uint32 :overlay-at (-> dma-chain 2))
(dma-qwc uint8 4 :offset 44)
(dma-qwc-word uint32 :overlay-at (-> dma-qwc 0))
(shader (inline-array adgif-shader) :offset 48)
(num-shaders uint8 :offset 52)
(num-base-colors uint8 :offset 53)

View File

@ -7,3 +7,785 @@
;; DECOMP BEGINS
;; WARN: Return type mismatch symbol vs none.
(defun edge-debug-lines ((arg0 (array vector-array)))
"Draw tfrag debug lines. These debug-lines are not stored in retail copies."
(when (nonzero? arg0)
(dotimes (s5-0 (-> arg0 length))
(when (logtest? *display-strip-lines* (ash 1 s5-0))
(let ((s4-0 (-> arg0 s5-0)))
(dotimes (s3-0 (/ (-> s4-0 length) 2))
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
(-> s4-0 data (* s3-0 2))
(-> s4-0 data (+ (* s3-0 2) 1))
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
#f
(the-as rgba -1)
)
)
)
)
)
)
(none)
)
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
"Top-level function to generate DMA for tfrag."
(local-vars (sv-16 int))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-8 (-> arg0 arrays s4-0))
(a0-4 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-8) data 0 id) 8))
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
(a1-3 (+ a1-1 #x3800 #x70000000))
(a0-8 (+ a0-6 #x3800 #x70000000))
)
(draw-node-cull
(the-as pointer a0-8)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-8 32))
(-> v1-8 length)
)
)
)
)
(let* ((v1-14 (-> arg0 arrays s5-0))
(s4-1 (&+ v1-14 32))
(s3-0 (-> v1-14 length))
)
(set! sv-16 (+ (/ (-> s4-1 id) 8) #x3800 #x70000000))
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf base)))
(with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 10
(bucket-id tfrag-l0-tfrag)
(bucket-id tfrag-l1-tfrag)
(bucket-id tfrag-l2-tfrag)
(bucket-id tfrag-l3-tfrag)
(bucket-id tfrag-l4-tfrag)
(bucket-id tfrag-l5-tfrag)
(bucket-id tfrag-l6-tfrag)
(bucket-id tfrag-l7-tfrag)
(bucket-id tfrag-l8-tfrag)
(bucket-id tfrag-l9-tfrag)
)
*draw-index*
)
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp tfrag-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 0) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
)
(with-dma-buffer-add-bucket ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 10
(bucket-id tfrag-scissor-l0-tfrag)
(bucket-id tfrag-scissor-l1-tfrag)
(bucket-id tfrag-scissor-l2-tfrag)
(bucket-id tfrag-scissor-l3-tfrag)
(bucket-id tfrag-scissor-l4-tfrag)
(bucket-id tfrag-scissor-l5-tfrag)
(bucket-id tfrag-scissor-l6-tfrag)
(bucket-id tfrag-scissor-l7-tfrag)
(bucket-id tfrag-scissor-l8-tfrag)
(bucket-id tfrag-scissor-l9-tfrag)
)
*draw-index*
)
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
)
(let ((a0-33 *dma-mem-usage*))
(when (nonzero? a0-33)
(set! (-> a0-33 length) (max 2 (-> a0-33 length)))
(set! (-> a0-33 data 1 name) "tfragment")
(+! (-> a0-33 data 1 count) 1)
(+! (-> a0-33 data 1 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-1))
)
(set! (-> a0-33 data 1 total) (-> a0-33 data 1 used))
)
)
)
)
)
)
(none)
)
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-trans ((arg0 drawable-tree-tfrag))
"Top-level function to generate DMA for tfrag."
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-7 (-> arg0 arrays s4-0))
(a0-6 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
(a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8))
(a1-3 (+ a1-1 #x3800 #x70000000))
(a0-10 (+ a0-8 #x3800 #x70000000))
)
(draw-node-cull
(the-as pointer a0-10)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-7 32))
(-> v1-7 length)
)
)
)
)
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x3800 #x70000000))
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-l0-alpha)
(bucket-id tfrag-l1-alpha)
(bucket-id tfrag-l2-alpha)
(bucket-id tfrag-l3-alpha)
(bucket-id tfrag-l4-alpha)
(bucket-id tfrag-l5-alpha)
(bucket-id tfrag-l6-alpha)
(bucket-id tfrag-l7-alpha)
(bucket-id tfrag-l8-alpha)
(bucket-id tfrag-l9-alpha)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp alpha-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 2) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
)
(with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-scissor-l0-alpha)
(bucket-id tfrag-scissor-l1-alpha)
(bucket-id tfrag-scissor-l2-alpha)
(bucket-id tfrag-scissor-l3-alpha)
(bucket-id tfrag-scissor-l4-alpha)
(bucket-id tfrag-scissor-l5-alpha)
(bucket-id tfrag-scissor-l6-alpha)
(bucket-id tfrag-scissor-l7-alpha)
(bucket-id tfrag-scissor-l8-alpha)
(bucket-id tfrag-scissor-l9-alpha)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 3) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
)
)
)
)
(none)
)
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-water ((arg0 drawable-tree-tfrag))
"Top-level function to generate DMA for tfrag."
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-7 (-> arg0 arrays s4-0))
(a0-6 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
(a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8))
(a1-3 (+ a1-1 #x3800 #x70000000))
(a0-10 (+ a0-8 #x3800 #x70000000))
)
(draw-node-cull
(the-as pointer a0-10)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-7 32))
(-> v1-7 length)
)
)
)
)
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x3800 #x70000000))
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-l0-water)
(bucket-id tfrag-l1-water)
(bucket-id tfrag-l2-water)
(bucket-id tfrag-l3-water)
(bucket-id tfrag-l4-water)
(bucket-id tfrag-l5-water)
(bucket-id tfrag-l6-water)
(bucket-id tfrag-l7-water)
(bucket-id tfrag-l8-water)
(bucket-id tfrag-l9-water)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp water-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 4) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
)
(with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-scissor-l0-water)
(bucket-id tfrag-scissor-l1-water)
(bucket-id tfrag-scissor-l2-water)
(bucket-id tfrag-scissor-l3-water)
(bucket-id tfrag-scissor-l4-water)
(bucket-id tfrag-scissor-l5-water)
(bucket-id tfrag-scissor-l6-water)
(bucket-id tfrag-scissor-l7-water)
(bucket-id tfrag-scissor-l8-water)
(bucket-id tfrag-scissor-l9-water)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 5) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
)
)
)
)
(none)
)
;; WARN: Return type mismatch pointer vs none.
(defun tfrag-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
"Do all tfrag buffer setup for a single bucket."
(let ((v1-0 *display*)
(a0-1 32)
)
(+! (-> v1-0 mem-reserve-size) a0-1)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((t1-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> t1-0 real-buffer-end) (the-as int (&+ (-> t1-0 base) a0-1)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s4-0 (-> s4-0 last))
(let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s3-0 base))
)
(tfrag-init-buffer s3-0 arg1 arg2 arg4)
(let ((v1-14 (the-as object (-> s3-0 base))))
(set! (-> (the-as dma-packet v1-14) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s4-0 next)))
(set! (-> (the-as dma-packet v1-14) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-14) vif1) (new 'static 'vif-tag))
(set! (-> s3-0 base) (the-as pointer (&+ (the-as dma-packet v1-14) 16)))
)
(set! (-> s4-0 next) (the-as uint s2-1))
)
)
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s5-1 (-> s5-1 last))
(let* ((s3-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s4-1 (-> s3-1 base))
)
(tfrag-end-buffer s3-1 (the-as int arg3))
(let ((v0-5 (-> s3-1 base)))
(let ((v1-28 (the-as object (-> s3-1 base))))
(set! (-> (the-as dma-packet v1-28) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-28) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-28) vif1) (new 'static 'vif-tag))
(set! (-> s3-1 base) (&+ (the-as pointer v1-28) 16))
)
(set! (-> (the-as (pointer int32) (-> s5-1 last)) 1) (the-as int s4-1))
(set! (-> s5-1 last) (the-as (pointer dma-tag) v0-5))
)
)
)
)
)
)
)
(none)
)
;; WARN: Return type mismatch pointer vs none.
;; ERROR: Failed store: (s.w! (+ v1-14 8) 0) at op 52
;; ERROR: Failed store: (s.w! (+ v1-14 12) 0) at op 53
;; ERROR: Failed store: (s.w! (+ v1-28 8) 0) at op 84
;; ERROR: Failed store: (s.w! (+ v1-28 12) 0) at op 85
;; ERROR: Failed store: (s.w! (+ v1-30 4) s4-1) at op 89
(defun tfrag-scissor-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
(none)
)
(deftype tfrag-init-data (structure)
((tfrag-bucket bucket-id)
(tfrag-scissor-bucket bucket-id)
(tfrag-trans-bucket bucket-id)
(tfrag-scissor-trans-bucket bucket-id)
(tfrag-water-bucket bucket-id)
(tfrag-water-scissor-bucket bucket-id)
)
)
(define *tfrag-init-table* (new 'static 'inline-array tfrag-init-data 10
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l0-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l0-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l0-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l0-alpha)
:tfrag-water-bucket (bucket-id tfrag-l0-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l0-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l1-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l1-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l1-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l1-alpha)
:tfrag-water-bucket (bucket-id tfrag-l1-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l1-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l2-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l2-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l2-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l2-alpha)
:tfrag-water-bucket (bucket-id tfrag-l2-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l2-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l3-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l3-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l3-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l3-alpha)
:tfrag-water-bucket (bucket-id tfrag-l3-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l3-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l4-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l4-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l4-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l4-alpha)
:tfrag-water-bucket (bucket-id tfrag-l4-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l4-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l5-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l5-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l5-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l5-alpha)
:tfrag-water-bucket (bucket-id tfrag-l5-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l5-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l6-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l6-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l6-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l6-alpha)
:tfrag-water-bucket (bucket-id tfrag-l6-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l6-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l7-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l7-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l7-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l7-alpha)
:tfrag-water-bucket (bucket-id tfrag-l7-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l7-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l8-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l8-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l8-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l8-alpha)
:tfrag-water-bucket (bucket-id tfrag-l8-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l8-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l9-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l9-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l9-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l9-alpha)
:tfrag-water-bucket (bucket-id tfrag-l9-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l9-water)
)
)
)
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-vu1-init-buffers ()
"Initialize all tfrag buckets."
(dotimes (gp-0 10)
(let ((s5-0 (-> *level* draw-level gp-0))
(s4-0 (-> *tfrag-init-table* gp-0))
)
(when s5-0
(set-subdivide-settings! s5-0)
(let ((s3-0 (-> s5-0 tfrag-gs-test)))
(tfrag-vu1-init-buf
(-> s4-0 tfrag-bucket)
s3-0
0
(-> s5-0 tfrag-last-calls 0)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-scissor-bucket)
s3-0
0
(-> s5-0 tfrag-last-calls 1)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
)
(tfrag-vu1-init-buf
(-> s4-0 tfrag-trans-bucket)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
1
(-> s5-0 tfrag-last-calls 2)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-scissor-trans-bucket)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
1
(-> s5-0 tfrag-last-calls 3)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-vu1-init-buf
(-> s4-0 tfrag-water-bucket)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
1
(-> s5-0 tfrag-last-calls 4)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-water-scissor-bucket)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
1
(-> s5-0 tfrag-last-calls 5)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
)
)
)
(none)
)
(defmethod draw ((this drawable-tree-tfrag))
"Draw the drawable, and typically its children.
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
(let ((v1-1 (-> *background-work* tfrag-tree-count))
(a1-3 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-trees v1-1) this)
(set! (-> *background-work* tfrag-levels v1-1) a1-3)
)
(+! (-> *background-work* tfrag-tree-count) 1)
0
(none)
)
(defmethod draw ((this drawable-tree-tfrag-trans))
"Draw the drawable, and typically its children.
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
(let ((v1-1 (-> *background-work* tfrag-trans-tree-count))
(a1-3 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-trans-trees v1-1) this)
(set! (-> *background-work* tfrag-trans-levels v1-1) a1-3)
)
(+! (-> *background-work* tfrag-trans-tree-count) 1)
0
(none)
)
(defmethod draw ((this drawable-tree-tfrag-water))
"Draw the drawable, and typically its children.
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
(let ((v1-1 (-> *background-work* tfrag-water-tree-count))
(a1-3 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-water-trees v1-1) this)
(set! (-> *background-work* tfrag-water-levels v1-1) a1-3)
)
(+! (-> *background-work* tfrag-water-tree-count) 1)
0
(none)
)
(defmethod collect-stats ((this tfragment))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(stats-tfrag-asm this)
0
(none)
)
(defmethod collect-stats ((this drawable-tree-tfrag))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor))
(let ((v1-15 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-15)
)
(dotimes (s5-0 (-> this length))
(collect-stats (-> this arrays s5-0))
)
)
0
(none)
)
(defmethod collect-stats ((this drawable-tree-tfrag-trans))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag-trans))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor-trans))
(let ((v1-12 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-12)
)
(dotimes (s5-0 (-> this length))
(collect-stats (-> this arrays s5-0))
)
)
0
(none)
)
(defmethod collect-stats ((this drawable-tree-tfrag-water))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag-water))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor-water))
(let ((v1-12 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-12)
)
(dotimes (s5-0 (-> this length))
(collect-stats (-> this arrays s5-0))
)
)
0
(none)
)
(defmethod collect-stats ((this drawable-inline-array-tfrag))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
(defmethod collect-stats ((this drawable-inline-array-tfrag-trans))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
(defmethod collect-stats ((this drawable-inline-array-tfrag-water))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
(defmethod debug-draw ((this drawable-tree-tfrag))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(dotimes (s5-0 (-> this length))
(debug-draw (-> this arrays s5-0))
)
)
0
(none)
)
(defmethod debug-draw ((this drawable-tree-tfrag-trans))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(debug-draw (-> this arrays s5-0))
)
)
0
(none)
)
(defmethod debug-draw ((this drawable-tree-tfrag-water))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(debug-draw (-> this arrays s5-0))
)
)
0
(none)
)
(defmethod debug-draw ((this drawable-inline-array-tfrag))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(debug-draw s4-0)
)
)
)
0
(none)
)
(defmethod debug-draw ((this tfragment))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(-> *display* frames (-> *display* on-screen) global-buf)
(edge-debug-lines (-> this debug-data debug-lines))
0
(none)
)

View File

@ -7,3 +7,72 @@
;; DECOMP BEGINS
(define tnear-vu1-block (new 'static 'vu-function :length #x38b :qlength #x1c6))
;; WARN: Return type mismatch symbol vs none.
(defun-debug tfrag-details ((arg0 tfragment))
(format 0 "id = ~d~%" (-> arg0 id))
(format 0 "common:~%")
(let ((s5-0 (-> arg0 dma-qwc 0))
(s4-0 (-> arg0 dma-common))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-0 s4-0)
(disasm-vif-tag (the-as (pointer vif-tag) s4-0) (the-as int (* s5-0 4)) (the-as symbol 0) #t)
)
(format 0 "base:~%")
(let ((s5-1 (-> arg0 dma-qwc 1))
(s4-1 (-> arg0 dma-base))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-1 s4-1)
(disasm-vif-tag (the-as (pointer vif-tag) s4-1) (the-as int (* s5-1 4)) (the-as symbol 0) #t)
)
(format 0 "level-0:~%")
(let ((s5-2 (-> arg0 dma-qwc 3))
(s4-2 (-> arg0 dma-qwc-word))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-2 s4-2)
(disasm-vif-tag (the-as (pointer vif-tag) s4-2) (the-as int (* s5-2 4)) (the-as symbol 0) #t)
)
(format 0 "level-1:~%")
(let ((s5-3 (-> arg0 dma-qwc 2))
(gp-1 (-> arg0 dma-level-1))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-3 gp-1)
(disasm-vif-tag (the-as (pointer vif-tag) gp-1) (the-as int (* s5-3 4)) (the-as symbol 0) #t)
)
(none)
)
;; WARN: Return type mismatch vector vs none.
(defun-debug clip-restore ()
(let ((a0-0 (new-stack-vector0))
(a1-0 (new 'stack-no-clear 'matrix))
)
(set! (-> a1-0 rvec quad) (the-as uint128 0))
(set! (-> a1-0 uvec quad) (the-as uint128 0))
(set! (-> a1-0 fvec quad) (the-as uint128 0))
(set! (-> a1-0 trans quad) (the-as uint128 0))
(set! (-> a0-0 x) 92648.22)
(set! (-> a0-0 y) 238025.03)
(set! (-> a0-0 z) 199836.31)
(set! (-> a0-0 w) 1.0)
(set! (-> a1-0 rvec x) -0.9283)
(set! (-> a1-0 rvec y) 0.0)
(set! (-> a1-0 rvec z) 0.3716)
(set! (-> a1-0 rvec w) 0.0)
(set! (-> a1-0 uvec x) -0.2257)
(set! (-> a1-0 uvec y) 0.7945)
(set! (-> a1-0 uvec z) -0.5637)
(set! (-> a1-0 uvec w) 0.0)
(set! (-> a1-0 fvec x) -0.2952)
(set! (-> a1-0 fvec y) -0.6072)
(set! (-> a1-0 fvec z) -0.7375)
(set! (-> a1-0 fvec w) 0.0)
(set! (-> a1-0 trans x) 0.0)
(set! (-> a1-0 trans y) 0.0)
(set! (-> a1-0 trans z) 0.0)
(set! (-> a1-0 trans w) 1.0)
(debug-set-camera-pos-rot! a0-0 a1-0)
)
(none)
)

View File

@ -7,3 +7,36 @@
;; DECOMP BEGINS
(define *tfrag-work* (new 'static 'tfrag-work
:base-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-0-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:common-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-1-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:color-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x102 :cmd (vif-cmd stcycl))
:vif1 (new 'static 'vif-tag :imm #xc000 :cmd (vif-cmd unpack-v4-8))
)
:max-fragment #xffff
)
)
(set! (-> *tfrag-work* color-ptr x) (+ 6144 #x70000000))
(set! (-> *tfrag-work* color-ptr y) (+ 6144 #x70000000))
(set! (-> *tfrag-work* color-ptr z) (+ 6144 #x70000000))
(set! (-> *tfrag-work* color-ptr w) (+ 6144 #x70000000))

View File

@ -5,5 +5,504 @@
;; name in dgo: tfrag
;; dgos: GAME
(define-extern draw-inline-array-tfrag (function pointer drawable-inline-array int dma-buffer none))
(define-extern draw-inline-array-tfrag-scissor (function pointer drawable-inline-array int dma-buffer none))
;; DECOMP BEGINS
(defmethod login ((this tfragment))
"Initialize the object after it is loaded."
(when (nonzero? *texture-masks-array*)
(dotimes (s5-0 (the-as int (-> this num-shaders)))
(let ((v1-3 (adgif-shader-login-no-remap (-> this shader s5-0)))
(a0-7 (-> *texture-masks-array* data (-> this texture-masks-index)))
)
(when v1-3
(dotimes (a1-3 3)
(dotimes (a2-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a1-3 16) (* a2-0 4)) (the-as int a0-7))))
(logior (-> (the-as (pointer int32) (+ (* a2-0 4) (the-as int a0-7) (* a1-3 16))) 0)
(-> (the-as texture (+ (* a2-0 4) (the-as int v1-3) (* a1-3 16))) masks data 0 mask x)
)
)
)
(set! (-> a0-7 data a1-3 dist) (fmax (-> a0-7 data a1-3 dist) (-> v1-3 masks data a1-3 dist)))
)
)
)
)
)
this
)
(defmethod mem-usage ((this tfragment) (usage memory-usage-block) (flags int))
(when (logtest? flags 2)
(+! (-> usage data 19 count) 1)
(let ((v1-6 (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors))))
(+! (-> usage data 19 used) v1-6)
(+! (-> usage data 19 total) (logand -4 (+ v1-6 3)))
)
(set! this this)
(goto cfg-16)
)
(let ((s4-0 1))
(set! (-> usage length) (max (-> usage length) (+ s4-0 8)))
(set! (-> usage data s4-0 name) "tfragment")
(+! (-> usage data s4-0 count) 1)
(let ((v1-20 (asize-of this)))
(+! (-> usage data s4-0 used) v1-20)
(+! (-> usage data s4-0 total) (logand -16 (+ v1-20 15)))
)
(set! (-> usage data (+ s4-0 1) name) "tfragment-base")
(+! (-> usage data (+ s4-0 1) count) 1)
(let ((v1-31 (* (-> this dma-qwc 0) 16)))
(+! (-> usage data (+ s4-0 1) used) v1-31)
(+! (-> usage data (+ s4-0 1) total) v1-31)
)
(set! (-> usage data (+ s4-0 2) name) "tfragment-common")
(+! (-> usage data (+ s4-0 2) count) 1)
(let ((v1-41 (* (- (-> this dma-qwc 1) (-> this dma-qwc 0)) 16)))
(+! (-> usage data (+ s4-0 2) used) v1-41)
(+! (-> usage data (+ s4-0 2) total) v1-41)
)
(set! (-> usage data (+ s4-0 3) name) "tfragment-level0")
(when (nonzero? (-> this num-level0-colors))
(+! (-> usage data (+ s4-0 3) count) 1)
(let ((v1-53 (* (- (-> this dma-qwc 2) (-> this dma-qwc 0)) 16)))
(+! (-> usage data (+ s4-0 3) used) v1-53)
(+! (-> usage data (+ s4-0 3) total) v1-53)
)
)
(set! (-> usage data (+ s4-0 4) name) "tfragment-level1")
(when (not (or (= (-> this dma-level-1) (-> this dma-common))
(= (-> this dma-level-1) (-> this dma-base))
(zero? (-> this num-level1-colors))
)
)
(+! (-> usage data (+ s4-0 4) count) 1)
(let ((v1-68 (* (- (-> this dma-qwc 3)
(- (/ (the-as int (- (-> this dma-level-1) (-> this dma-common))) 16) (-> this dma-qwc 0))
)
16
)
)
)
(+! (-> usage data (+ s4-0 4) used) v1-68)
(+! (-> usage data (+ s4-0 4) total) v1-68)
)
)
(set! (-> usage data (+ s4-0 5) name) "tfragment-color")
(+! (-> usage data (+ s4-0 5) count) 1)
(let ((v1-77
(if (logtest? flags 1)
0
(the-as int (* (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)) 2))
)
)
)
(+! (-> usage data (+ s4-0 5) used) v1-77)
(+! (-> usage data (+ s4-0 5) total) (logand -16 (+ v1-77 15)))
)
(set! (-> usage data (+ s4-0 6) name) "tfragment-debug")
)
(label cfg-16)
this
)
(defmethod login ((this drawable-inline-array-tfrag))
"Initialize the object after it is loaded."
(set! *texture-masks-array* (-> *level* level *level-index* bsp tfrag-masks))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
(defmethod login ((this drawable-inline-array-tfrag-trans))
"Initialize the object after it is loaded."
(set! *texture-masks-array* (-> *level* level *level-index* bsp alpha-masks))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
(defmethod login ((this drawable-inline-array-tfrag-water))
"Initialize the object after it is loaded."
(set! *texture-masks-array* (-> *level* level *level-index* bsp water-masks))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
(defmethod mem-usage ((this drawable-inline-array-tfrag) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
this
)
(defmethod mem-usage ((this drawable-tree-tfrag) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-6 (asize-of this)))
(+! (-> usage data 0 used) v1-6)
(+! (-> usage data 0 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> this time-of-day-pal))
(set! (-> usage length) (max 9 (-> usage length)))
(set! (-> usage data 8 name) "tfragment-pal")
(+! (-> usage data 8 count) 1)
(let ((v1-18 (asize-of (-> this time-of-day-pal))))
(+! (-> usage data 8 used) v1-18)
(+! (-> usage data 8 total) (logand -16 (+ v1-18 15)))
)
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this arrays s3-0) usage flags)
)
this
)
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of ((this drawable-inline-array-tfrag))
(the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> this length) -1) 64)))
)
(define *tfrag-display-stats* #f)
(define tfrag-vu1-block (new 'static 'vu-function :length #x74b :qlength #x3a6))
;; WARN: Return type mismatch tfrag-data vs none.
(defun tfrag-data-setup ((arg0 tfrag-data) (arg1 int) (arg2 int))
"Set up VU1 constants"
(let ((v1-0 *math-camera*))
(let ((a0-1 (-> arg0 data)))
(set! (-> a0-1 0) (the-as uint (-> v1-0 pfog0)))
(set! (-> a0-1 1) (the-as uint (-> v1-0 fog-min)))
(set! (-> a0-1 2) (the-as uint (-> v1-0 fog-max)))
(set! (-> a0-1 3) (the-as uint 3072.0))
)
(set-vector! (-> arg0 val) 0.5 1.0 2048.0 0.0)
(set-vector! (-> arg0 ambient) 1.0 1.0 1.0 1.0)
(let ((a0-4 arg2))
(cond
((zero? a0-4)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 1)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 2)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 3)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 fangif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad))
(set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad))
(set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad))
(set! (-> arg0 guard quad) (-> v1-0 guard quad))
)
(set-tfrag-dists! (-> arg0 dists))
(none)
)
;; WARN: Return type mismatch pointer vs none.
(defun add-tfrag-mtx-0 ((arg0 dma-buffer) (arg1 symbol))
"Add DMA for transferring matrix0 (same as matrix1)"
(let* ((a2-0 4)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(if arg1
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp-other)
)
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp)
)
)
(&+! (-> arg0 base) 64)
(none)
)
;; WARN: Return type mismatch pointer vs none.
(defun add-tfrag-mtx-1 ((arg0 dma-buffer) (arg1 symbol))
"Add DMA for transferring matrix1 (same as matrix0)"
(let* ((a2-0 4)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x14d :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(if arg1
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp-other)
)
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp)
)
)
(&+! (-> arg0 base) 64)
(none)
)
;; WARN: Return type mismatch dma-packet vs none.
(defun add-tfrag-data ((arg0 dma-buffer) (arg1 int) (arg2 int))
"Add DMA for tfrag constants."
(let* ((a3-0 14)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a3-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x290 :cmd (vif-cmd unpack-v4-32) :num a3-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(tfrag-data-setup (the-as tfrag-data (-> arg0 base)) arg1 arg2)
(&+! (-> arg0 base) 224)
(let ((v1-3 (the-as dma-packet (-> arg0 base))))
(set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> v1-3 vif0) (new 'static 'vif-tag))
(set! (-> v1-3 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
(set! (-> arg0 base) (the-as pointer (&+ v1-3 16)))
)
(none)
)
(define t-stat (new 'global 'tfrag-stats))
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-print-stats ((arg0 symbol))
"Print out accumulated tfrag stats."
(when (and *tfrag-display-stats* (!= *master-mode* 'menu))
(format arg0 "~%")
(format arg0 "tris: ~8d~%" (-> t-stat tris))
(format arg0 "verts: ~8d~%" (+ (-> t-stat base-verts) (-> t-stat level0-verts) (-> t-stat level1-verts)))
(format arg0 " base: ~8d~%" (-> t-stat base-verts))
(format arg0 " lev0: ~8d~%" (-> t-stat level0-verts))
(format arg0 " lev1: ~8d~%" (-> t-stat level1-verts))
(format arg0 "tfaces: ~8d~%" (-> t-stat tfaces))
(format arg0 "tfrags: ~8d~%" (-> t-stat tfrags))
(format arg0 "dtris: ~8d~%" (-> t-stat dtris))
(format arg0 "dps: ~8d~%" (-> t-stat drawpoints))
(format arg0 "strips: ~8d~%" (-> t-stat strips))
(format arg0 "shaders:~8d~%" (-> t-stat dma-tex))
(format arg0 "tri/str:~8f~%" (/ (the float (-> t-stat dtris)) (the float (-> t-stat strips))))
(format arg0 "dma-cnt:~8d (~8d)~%" (-> t-stat dma-cnt) (* (-> t-stat dma-cnt) 32))
(format arg0 "dma-dta:~8d (~8d)~%" (-> t-stat dma-dta) (/ (* 33 (-> t-stat dma-dta)) 10))
(let ((f0-4 (* 32.0 (the float (-> t-stat dma-cnt))))
(f1-5 (* 3.3 (the float (-> t-stat dma-dta))))
(f2-3 (* 30.0 (the float (-> t-stat tfrags))))
)
(+ f0-4 f1-5 f2-3)
)
)
(none)
)
(set! (-> t-stat from) 0)
(set! (-> t-stat to) 0)
(set! (-> t-stat cnt) 0)
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int) (arg3 symbol))
"Initialize DMA bucket for Tfrag rendering."
(let ((v1-0 *display*)
(a0-6 (+ (* (+ (/ (-> tfrag-vu1-block qlength) 127) 1) 16) 480))
)
(+! (-> v1-0 mem-reserve-size) a0-6)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a2-1 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a2-1 real-buffer-end) (the-as int (&+ (-> a2-1 base) a0-6)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-vu-function arg0 tfrag-vu1-block 1)
(dma-buffer-add-gs-set arg0 (test-1 arg1))
(add-tfrag-mtx-0 arg0 arg3)
(add-tfrag-mtx-1 arg0 arg3)
(add-tfrag-data arg0 arg2 (the-as int *subdivide-draw-mode*))
(let ((v1-5 (the-as dma-packet (-> arg0 base))))
(set! (-> v1-5 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> v1-5 vif0) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> v1-5 vif1) (new 'static 'vif-tag :imm #x148 :cmd (vif-cmd offset)))
(set! (-> arg0 base) (the-as pointer (&+ v1-5 16)))
)
)
)
)
(none)
)
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-end-buffer ((arg0 dma-buffer) (arg1 int))
"Finalize DMA bucket for tfrag rendering."
(let ((v1-0 *display*)
(a2-0 64)
)
(+! (-> v1-0 mem-reserve-size) a2-0)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((t0-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> t0-0 real-buffer-end) (the-as int (&+ (-> t0-0 base) a2-0)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(let* ((v1-2 arg0)
(a2-4 (the-as dma-packet (-> v1-2 base)))
)
(set! (-> a2-4 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> a2-4 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a2-4 vif1) (new 'static 'vif-tag))
(set! (-> v1-2 base) (the-as pointer (&+ a2-4 16)))
)
(let* ((v1-3 arg0)
(a0-1 (-> v1-3 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (the-as vif-tag arg1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer int32) a0-1) 4) 0)
(set! (-> (the-as (pointer int32) a0-1) 5) 0)
(set! (-> (the-as (pointer int32) a0-1) 6) 0)
(set! (-> (the-as (pointer int32) a0-1) 7) 0)
(set! (-> (the-as (pointer vif-tag) a0-1) 8) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) a0-1) 9) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) a0-1) 10) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as (pointer vif-tag) a0-1) 11) (new 'static 'vif-tag))
(set! (-> v1-3 base) (&+ a0-1 48))
)
)
)
)
(none)
)
;; ERROR: function was not converted to expressions. Cannot decompile.
;; WARN: Return type mismatch symbol vs none.
;; ERROR: Failed store: (s.w! (+ v1-5 8) a0-21) at op 77
;; ERROR: Failed store: (s.w! (+ v1-5 12) a0-22) at op 79
(defun tfrag-scissor-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int) (arg3 symbol))
(none)
)
;; WARN: Return type mismatch symbol vs none.
;; ERROR: Failed store: (s.w! (+ a2-4 8) a3-11) at op 25
;; ERROR: Failed store: (s.w! (+ a2-4 12) 0) at op 26
;; ERROR: Failed store: (s.w! (+ a0-1 4) a1-1) at op 33
;; ERROR: Failed store: (s.w! (+ a0-1 8) a1-2) at op 35
;; ERROR: Failed store: (s.w! (+ a0-1 12) a1-3) at op 37
;; ERROR: Failed store: (s.w! (+ a0-1 16) 0) at op 38
;; ERROR: Failed store: (s.w! (+ a0-1 20) 0) at op 39
;; ERROR: Failed store: (s.w! (+ a0-1 24) 0) at op 40
;; ERROR: Failed store: (s.w! (+ a0-1 28) 0) at op 41
;; ERROR: Failed store: (s.w! (+ a0-1 32) a1-4) at op 43
;; ERROR: Failed store: (s.w! (+ a0-1 36) a1-5) at op 45
;; ERROR: Failed store: (s.w! (+ a0-1 40) a1-6) at op 47
;; ERROR: Failed store: (s.w! (+ a0-1 44) 0) at op 48
(defun tfrag-scissor-end-buffer ((arg0 dma-buffer) (arg1 uint))
(none)
)
;; ERROR: function was not converted to expressions. Cannot decompile.
;; ERROR: function was not converted to expressions. Cannot decompile.
(defun stats-tfrag-asm ((frag tfragment))
(format 0 "no stats for you~%")
(none)
)

File diff suppressed because it is too large Load Diff

View File

@ -7,3 +7,7 @@
;; DECOMP BEGINS
(defun tie-scissor-make-perspective-matrix ((arg0 matrix) (arg1 matrix))
(column-scale-matrix! arg0 (-> *math-camera* hmge-scale) arg1)
(none)
)

View File

@ -9,3 +9,162 @@
;; 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)
)

View File

@ -7,3 +7,653 @@
;; DECOMP BEGINS
(defmethod login ((this tie-fragment))
"Initialize the object after it is loaded."
(let ((s5-0 (the-as adgif-shader (-> this gif-ref)))
(s4-0 (/ (-> this tex-count) (the-as uint 5)))
)
(dotimes (s3-0 (the-as int s4-0))
(let ((v1-1 (adgif-shader-login-no-remap s5-0)))
(when v1-1
(dotimes (a0-4 3)
(dotimes (a1-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a0-4 16) (* a1-0 4)) (the-as int *texture-masks*))))
(logior (-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int *texture-masks*) (* a0-4 16))) 0)
(-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int v1-1) (* a0-4 16))) 15)
)
)
)
(set! (-> *texture-masks* data a0-4 dist)
(fmax (-> *texture-masks* data a0-4 dist) (-> v1-1 masks data a0-4 dist))
)
)
)
)
(when (= (-> s5-0 reg-4) 66)
(set! (-> s5-0 reg-4) (the-as uint 127))
(set! (-> s5-0 alpha) (new 'static 'gs-alpha))
0
)
(&+! s5-0 80)
)
)
this
)
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of ((this drawable-inline-array-instance-tie))
(the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64)))
)
; (defmethod login ((this drawable-tree-instance-tie))
; "Initialize the object after it is loaded."
; this
; )
(defmethod login ((this drawable-tree-instance-tie))
"Initialize the object after it is loaded."
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
(defmethod login ((this prototype-tie))
"Initialize the object after it is loaded."
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
(defmethod mem-usage ((this drawable-tree-instance-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
(mem-usage (-> this prototypes prototype-array-tie) usage (logior flags 1))
this
)
(defmethod mem-usage ((this tie-fragment) (usage memory-usage-block) (flags int))
(when (logtest? flags 2)
(let ((v1-3 (* (-> this color-count) 4))
(a0-2 (cond
((logtest? flags 4)
20
)
((logtest? flags 8)
21
)
(else
22
)
)
)
)
(+! (-> usage data a0-2 count) 1)
(+! (-> usage data a0-2 used) v1-3)
(+! (-> usage data a0-2 total) (logand -4 (+ v1-3 3)))
)
(set! (-> usage length) (max 23 (-> usage length)))
(set! this this)
(goto cfg-13)
)
(set! (-> usage length) (max 18 (-> usage length)))
(set! (-> usage data 9 name) "tie-fragment")
(set! (-> usage data 10 name) "tie-gif")
(set! (-> usage data 11 name) "tie-points")
(set! (-> usage data 12 name) "tie-colors")
(set! (-> usage data 14 name) "tie-debug")
(set! (-> usage data 13 name) "tie-draw-points")
(set! (-> usage data 17 name) "tie-generic")
(+! (-> usage data 9 count) 1)
(let ((v1-21 (asize-of this)))
(+! (-> usage data 9 used) v1-21)
(+! (-> usage data 9 total) (logand -16 (+ v1-21 15)))
)
(let ((v1-26 (* (-> this gif-count) 16)))
(+! (-> usage data 10 count) (-> this tex-count))
(+! (-> usage data 10 used) v1-26)
(+! (-> usage data 10 total) (logand -16 (+ v1-26 15)))
)
(let ((v1-31 (* (-> this vertex-count) 16)))
(+! (-> usage data 11 count) (-> this vertex-count))
(+! (-> usage data 11 used) v1-31)
(+! (-> usage data 11 total) (logand -16 (+ v1-31 15)))
)
(let ((v1-36 (* (-> this dp-qwc) 16)))
(+! (-> usage data 13 count) (* (-> this dp-qwc) 16))
(+! (-> usage data 13 used) v1-36)
(+! (-> usage data 13 total) (logand -16 (+ v1-36 15)))
)
(let ((v1-41 (* (-> this generic-count) 16)))
(+! (-> usage data 17 count) 1)
(+! (-> usage data 17 used) v1-41)
(+! (-> usage data 17 total) (logand -16 (+ v1-41 15)))
)
(let ((s4-0 (-> this debug debug-lines)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(+! (-> usage data 14 count) (-> s4-0 s3-0 length))
(let ((v1-52 (asize-of (-> s4-0 s3-0))))
(+! (-> usage data 12 used) v1-52)
(+! (-> usage data 12 total) (logand -16 (+ v1-52 15)))
)
)
)
)
(label cfg-13)
this
)
(defmethod mem-usage ((this instance-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 19 (-> usage length)))
(set! (-> usage data 18 name) "instance-tie")
(+! (-> usage data 18 count) 1)
(let ((v1-6 (asize-of this)))
(+! (-> usage data 18 used) v1-6)
(+! (-> usage data 18 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> this color-indices))
(set! (-> usage length) (max 24 (-> usage length)))
(set! (-> usage data 23 name) "instance-tie-colors*")
(set! (-> usage data 19 name) "instance-tie-colors0")
(set! (-> usage data 20 name) "instance-tie-colors1")
(set! (-> usage data 21 name) "instance-tie-colors2")
(set! (-> usage data 22 name) "instance-tie-colors3")
(+! (-> usage data 23 count) 1)
(let ((s3-0 (-> this bucket-ptr)))
(+ (-> usage data 19 used) (-> usage data 20 used) (-> usage data 21 used) (-> usage data 22 used))
(dotimes (s2-0 4)
(let ((a0-10 (-> s3-0 tie-geom s2-0)))
(when (nonzero? a0-10)
(let ((t9-1 (method-of-object a0-10 mem-usage))
(a1-2 usage)
(v1-29 s2-0)
)
(t9-1 a0-10 a1-2 (logior (logior (cond
((= v1-29 1)
4
)
((= v1-29 2)
8
)
((= v1-29 3)
16
)
(else
0
)
)
2
)
flags
)
)
)
)
)
)
)
)
this
)
(defmethod mem-usage ((this drawable-inline-array-instance-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
this
)
(defmethod mem-usage ((this prototype-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
this
)
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of ((this prototype-tie))
(the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64)))
)
(deftype tie-consts (structure)
((data uint32 40)
(vector vector 10 :inline :overlay-at (-> data 0))
(quads uint128 10 :overlay-at (-> data 0))
(adgif gs-gif-tag :inline :overlay-at (-> data 0))
(strgif gs-gif-tag :inline :overlay-at (-> data 4))
(extra vector :inline :overlay-at (-> data 8))
(gifbufs vector :inline :overlay-at (-> data 12))
(clrbufs qword :inline :overlay-at (-> data 16))
(misc qword :inline :overlay-at (-> data 20))
(atestgif gs-gif-tag :inline :overlay-at (-> data 24))
(alpha gs-adcmd :inline :overlay-at (-> data 28))
(atest gs-adcmd 2 :inline :overlay-at (-> data 32))
(atest-tra gs-adcmd :inline :overlay-at (-> data 32))
(atest-def gs-adcmd :inline :overlay-at (-> data 36))
)
)
(define tie-vu1-block (new 'static 'vu-function :length #x3e7 :qlength #x1f4))
(defun tie-init-consts ((arg0 tie-consts) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
"Set up tie-consts for VU1"
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(case *subdivide-draw-mode*
(((subdivide-setting textured))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting outline))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting gouraud))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting hack))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(let ((f0-0 8388894.0)
(f1-0 8389078.0)
(f2-0 8389262.0)
)
(set! (-> arg0 gifbufs x) f2-0)
(set! (-> arg0 gifbufs y) f1-0)
(set! (-> arg0 gifbufs z) f2-0)
(set! (-> arg0 gifbufs w) f1-0)
(set! (-> arg0 extra x) (+ f0-0 f1-0 f2-0))
(set! (-> arg0 extra y) 0.0)
(set! (-> arg0 extra z) (+ f0-0 f1-0 f2-0))
)
(set! (-> arg0 clrbufs vector4w x) 198)
(set! (-> arg0 clrbufs vector4w y) 242)
(set! (-> arg0 clrbufs vector4w z) 198)
(set! (-> arg0 clrbufs vector4w w) 242)
(set! (-> arg0 atestgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1))
(set! (-> arg0 atestgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 alpha data) (the-as uint arg1))
(set! (-> arg0 alpha cmds) (gs-reg64 alpha-1))
(set! (-> arg0 atest-tra cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-tra data) (the-as uint arg2))
(set! (-> arg0 atest-def cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-def data) (the-as uint arg3))
(set! (-> arg0 misc vector4w x) 0)
(set! (-> arg0 misc vector4w y) -1)
(none)
)
(defun tie-init-engine ((arg0 dma-buffer) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
"Set up DMA to initialize TIE vu1."
(let ((v1-0 *display*)
(a0-6 (+ (* (+ (/ (-> tie-vu1-block qlength) 127) 1) 16) 240))
)
(+! (-> v1-0 mem-reserve-size) a0-6)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a2-1 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a2-1 real-buffer-end) (the-as int (&+ (-> a2-1 base) a0-6)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-vu-function arg0 tie-vu1-block 1)
(let ((s2-0 10))
(let* ((v1-2 arg0)
(a0-11 (the-as dma-packet (-> v1-2 base)))
)
(set! (-> a0-11 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc s2-0))
(set! (-> a0-11 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> a0-11 vif1) (new 'static 'vif-tag :imm #x3c6 :cmd (vif-cmd unpack-v4-32) :num s2-0))
(set! (-> v1-2 base) (the-as pointer (&+ a0-11 16)))
)
(tie-init-consts (the-as tie-consts (-> arg0 base)) arg1 arg2 arg3)
(&+! (-> arg0 base) (* s2-0 16))
)
(let* ((v1-5 arg0)
(a0-15 (the-as dma-packet (-> v1-5 base)))
)
(set! (-> a0-15 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-15 vif0) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> a0-15 vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> v1-5 base) (the-as pointer (&+ a0-15 16)))
)
(let* ((v1-6 arg0)
(a0-17 (the-as dma-packet (-> v1-6 base)))
)
(set! (-> a0-17 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-17 vif0) (new 'static 'vif-tag))
(set! (-> a0-17 vif1) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> v1-6 base) (the-as pointer (&+ a0-17 16)))
)
(let ((v1-7 (the-as object (-> arg0 base))))
(set! (-> (the-as vector v1-7) x) 8388608.0)
(set! (-> (the-as vector v1-7) y) 8388608.0)
(set! (-> (the-as vector v1-7) z) 8388608.0)
(set! (-> (the-as vector v1-7) w) 8388608.0)
(set! (-> (the-as (pointer vif-tag) v1-7) 4) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) v1-7) 5) (new 'static 'vif-tag :imm #x2c :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) v1-7) 6) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) v1-7) 7) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> arg0 base) (&+ (the-as pointer v1-7) 32))
)
)
)
)
0
(none)
)
(defun tie-end-buffer ((arg0 dma-buffer))
"Set up DMA to finish TIE."
(let ((v1-0 *display*)
(a1-0 96)
)
(+! (-> v1-0 mem-reserve-size) a1-0)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a3-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a3-0 real-buffer-end) (the-as int (&+ (-> a3-0 base) a1-0)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))))
(let* ((v1-5 arg0)
(a1-10 (the-as dma-packet (-> v1-5 base)))
)
(set! (-> a1-10 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a1-10 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a1-10 vif1) (new 'static 'vif-tag))
(set! (-> v1-5 base) (the-as pointer (&+ a1-10 16)))
)
(let* ((v1-6 arg0)
(a0-1 (-> v1-6 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 4) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) a0-1) 5) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) a0-1) 6) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) a0-1) 7) (new 'static 'vif-tag))
(set! (-> v1-6 base) (&+ a0-1 32))
)
)
)
)
0
(none)
)
(defun-debug tie-int-reg ((arg0 int))
"Get the name of TIE VU1 program integer register."
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"itemp"
)
((= v1-0 2)
"point-ptr"
)
((= v1-0 3)
"clr-ptr"
)
((= v1-0 4)
"target-bp1-ptr"
)
((= v1-0 5)
"skip-bp2"
)
((= v1-0 6)
"target-bp2-ptr"
)
((= v1-0 7)
"target-ip1-ptr"
)
((= v1-0 8)
"target-ip2-ptr"
)
((= v1-0 9)
"ind/ind0"
)
((= v1-0 10)
" ind1"
)
((= v1-0 11)
" ind2"
)
((= v1-0 12)
"dest-ptr"
)
((= v1-0 13)
"dest2-ptr"
)
((= v1-0 14)
"skip-ips"
)
((= v1-0 15)
"kick-addr"
)
)
)
)
(defun-debug tie-float-reg ((arg0 int))
"Get the name of TIE VU1 program float register."
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"t-mtx0"
)
((= v1-0 2)
"t-mtx1"
)
((= v1-0 3)
"t-mtx2"
)
((= v1-0 4)
"t-mtx3"
)
((= v1-0 5)
"vtx-0"
)
((= v1-0 6)
"vtx-1"
)
((= v1-0 7)
"vtx-2"
)
((= v1-0 8)
"vtx-3"
)
((= v1-0 9)
"pos-0/2"
)
((= v1-0 10)
"pos-1/3"
)
((= v1-0 11)
"clr-0"
)
((= v1-0 12)
"clr-1"
)
((= v1-0 13)
"clr-2"
)
((= v1-0 14)
"clr-3"
)
((= v1-0 15)
"tex-0"
)
((= v1-0 16)
"tex-1"
)
((= v1-0 17)
"tex-2"
)
((= v1-0 18)
"tex-3"
)
((= v1-0 19)
"res-0/2"
)
((= v1-0 20)
"res-1/3"
)
((= v1-0 21)
"gifbuf"
)
((= v1-0 22)
"clrbuf"
)
((= v1-0 23)
"extra"
)
((= v1-0 24)
"inds"
)
((= v1-0 25)
"--"
)
((= v1-0 26)
"--"
)
((= v1-0 27)
"morph"
)
((= v1-0 28)
"xyzofs"
)
((= v1-0 29)
"clr1"
)
((= v1-0 30)
"clr2"
)
((= v1-0 31)
"--"
)
)
)
)
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-ints ()
"Dump TIE integer regs for debug."
(local-vars (sv-16 uint))
(let ((gp-0 (+ #x3da0 #x1100c000)))
(dotimes (s5-0 16)
(if (< s5-0 10)
(format 0 " ")
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "vi~d: ~6d #x~4,'0X ~s~%")
(s1-0 s5-0)
(s0-0 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
)
(set! sv-16 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
(let ((t1-0 (tie-int-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
)
)
)
)
(none)
)
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-floats ()
"Dump TIE float regs for debug."
(local-vars (sv-16 uint) (sv-32 uint))
(let ((gp-0 (the-as (pointer uint32) (+ #x3da0 #x1100c000))))
(dotimes (s5-0 32)
(if (< s5-0 10)
(format 0 " ")
)
(format
0
"vf~d: #x~8,'0X #x~8,'0X #x~8,'0X #x~8,'0X "
s5-0
(-> gp-0 (* s5-0 4))
(-> gp-0 (+ (* s5-0 4) 1))
(-> gp-0 (+ (* s5-0 4) 2))
(-> gp-0 (+ (* s5-0 4) 3))
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "~F ~F ~F ~F ~s~%")
(s1-0 (-> gp-0 (* s5-0 4)))
(s0-0 (-> gp-0 (+ (* s5-0 4) 1)))
)
(set! sv-16 (-> gp-0 (+ (* s5-0 4) 2)))
(set! sv-32 (-> gp-0 (+ (* s5-0 4) 3)))
(let ((t2-1 (tie-float-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 sv-32 t2-1)
)
)
)
)
(none)
)

View File

@ -17,6 +17,7 @@
)
;; ---merc-mode
;; Note: merc mode 5 seems to be totally bogus - the buckets are somewhat random.
;; DECOMP BEGINS
@ -34,7 +35,7 @@
(bucket-id-16 gmerc-l0-pris)
(bucket-id-16 tex-l0-pris)
(bucket-id-16 gmerc2-l0-pris)
(bucket-id-16 bucket32)
(bucket-id-16 tie-vanish-l1-tfrag)
(bucket-id-16 merc-l0-shrub)
(bucket-id-16 emerc-l0-shrub)
(bucket-id-16 gmerc-l0-shrub)
@ -46,7 +47,7 @@
(bucket-id-16 gmerc-l0-alpha)
(bucket-id-16 tex-l0-alpha)
(bucket-id-16 gmerc2-l0-alpha)
(bucket-id-16 bucket20)
(bucket-id-16 tie-vanish-l0-tfrag)
(bucket-id-16 merc-l0-water)
(bucket-id-16 merc-l0-water)
(bucket-id-16 gmerc-l0-water)
@ -58,7 +59,7 @@
(bucket-id-16 gmerc-l0-pris)
(bucket-id-16 tex-l0-pris)
(bucket-id-16 gmerc2-l0-pris)
(bucket-id-16 bucket32)
(bucket-id-16 tie-vanish-l1-tfrag)
(bucket-id-16 merc-l0-pris2)
(bucket-id-16 emerc-l0-pris2)
(bucket-id-16 gmerc-l0-pris2)
@ -82,7 +83,7 @@
(bucket-id-16 gmerc-l1-shrub)
(bucket-id-16 tex-l1-shrub)
(bucket-id-16 gmerc2-l1-shrub)
(bucket-id-16 bucket11)
(bucket-id-16 tfrag-l0-tfrag)
(bucket-id-16 merc-l1-alpha)
(bucket-id-16 emerc-l1-alpha)
(bucket-id-16 gmerc-l1-alpha)
@ -106,7 +107,7 @@
(bucket-id-16 gmerc-l1-pris2)
(bucket-id-16 tex-l1-pris2)
(bucket-id-16 gmerc2-l1-pris2)
(bucket-id-16 bucket44)
(bucket-id-16 tie-vanish-l2-tfrag)
(bucket-id-16 merc-l2-tfrag)
(bucket-id-16 emerc-l2-tfrag)
(bucket-id-16 gmerc-l2-tfrag)
@ -124,7 +125,7 @@
(bucket-id-16 gmerc-l2-shrub)
(bucket-id-16 tex-l2-shrub)
(bucket-id-16 gmerc2-l2-shrub)
(bucket-id-16 bucket12)
(bucket-id-16 tie-l0-tfrag)
(bucket-id-16 merc-l2-alpha)
(bucket-id-16 emerc-l2-alpha)
(bucket-id-16 gmerc-l2-alpha)
@ -136,7 +137,7 @@
(bucket-id-16 gmerc-l2-water)
(bucket-id-16 tex-l2-water)
(bucket-id-16 gmerc2-l2-water)
(bucket-id-16 bucket56)
(bucket-id-16 tie-vanish-l3-tfrag)
(bucket-id-16 merc-l2-pris)
(bucket-id-16 emerc-l2-pris)
(bucket-id-16 gmerc-l2-pris)
@ -160,19 +161,19 @@
(bucket-id-16 gmerc-l3-pris)
(bucket-id-16 tex-l3-pris)
(bucket-id-16 gmerc2-l3-pris)
(bucket-id-16 bucket35)
(bucket-id-16 tfrag-l2-tfrag)
(bucket-id-16 merc-l3-shrub)
(bucket-id-16 emerc-l3-shrub)
(bucket-id-16 gmerc-l3-shrub)
(bucket-id-16 tex-l3-shrub)
(bucket-id-16 gmerc2-l3-shrub)
(bucket-id-16 bucket13)
(bucket-id-16 etie-l0-tfrag)
(bucket-id-16 merc-l3-alpha)
(bucket-id-16 emerc-l3-alpha)
(bucket-id-16 gmerc-l3-alpha)
(bucket-id-16 tex-l3-alpha)
(bucket-id-16 gmerc2-l3-alpha)
(bucket-id-16 bucket23)
(bucket-id-16 tfrag-l1-tfrag)
(bucket-id-16 merc-l3-water)
(bucket-id-16 merc-l3-water)
(bucket-id-16 gmerc-l3-water)
@ -184,7 +185,7 @@
(bucket-id-16 gmerc-l3-pris)
(bucket-id-16 tex-l3-pris)
(bucket-id-16 gmerc2-l3-pris)
(bucket-id-16 bucket35)
(bucket-id-16 tfrag-l2-tfrag)
(bucket-id-16 merc-l3-pris2)
(bucket-id-16 emerc-l3-pris2)
(bucket-id-16 gmerc-l3-pris2)
@ -202,19 +203,19 @@
(bucket-id-16 gmerc-l4-pris)
(bucket-id-16 tex-l4-pris)
(bucket-id-16 gmerc2-l4-pris)
(bucket-id-16 bucket36)
(bucket-id-16 tie-l2-tfrag)
(bucket-id-16 merc-l4-shrub)
(bucket-id-16 emerc-l4-shrub)
(bucket-id-16 gmerc-l4-shrub)
(bucket-id-16 tex-l4-shrub)
(bucket-id-16 gmerc2-l4-shrub)
(bucket-id-16 bucket14)
(bucket-id-16 tfrag-scissor-l0-tfrag)
(bucket-id-16 merc-l4-alpha)
(bucket-id-16 emerc-l4-alpha)
(bucket-id-16 gmerc-l4-alpha)
(bucket-id-16 tex-l4-alpha)
(bucket-id-16 gmerc2-l4-alpha)
(bucket-id-16 bucket24)
(bucket-id-16 tie-l1-tfrag)
(bucket-id-16 merc-l4-water)
(bucket-id-16 merc-l4-water)
(bucket-id-16 gmerc-l4-water)
@ -226,13 +227,13 @@
(bucket-id-16 gmerc-l4-pris)
(bucket-id-16 tex-l4-pris)
(bucket-id-16 gmerc2-l4-pris)
(bucket-id-16 bucket36)
(bucket-id-16 tie-l2-tfrag)
(bucket-id-16 merc-l4-pris2)
(bucket-id-16 emerc-l4-pris2)
(bucket-id-16 gmerc-l4-pris2)
(bucket-id-16 tex-l4-pris2)
(bucket-id-16 gmerc2-l4-pris2)
(bucket-id-16 bucket47)
(bucket-id-16 tfrag-l3-tfrag)
(bucket-id-16 merc-l5-tfrag)
(bucket-id-16 emerc-l5-tfrag)
(bucket-id-16 gmerc-l5-tfrag)
@ -244,37 +245,37 @@
(bucket-id-16 gmerc-l5-pris)
(bucket-id-16 tex-l5-pris)
(bucket-id-16 gmerc2-l5-pris)
(bucket-id-16 bucket37)
(bucket-id-16 etie-l2-tfrag)
(bucket-id-16 merc-l5-shrub)
(bucket-id-16 emerc-l5-shrub)
(bucket-id-16 gmerc-l5-shrub)
(bucket-id-16 tex-l5-shrub)
(bucket-id-16 gmerc2-l5-shrub)
(bucket-id-16 bucket15)
(bucket-id-16 tie-scissor-l0-tfrag)
(bucket-id-16 merc-l5-alpha)
(bucket-id-16 emerc-l5-alpha)
(bucket-id-16 gmerc-l5-alpha)
(bucket-id-16 tex-l5-alpha)
(bucket-id-16 gmerc2-l5-alpha)
(bucket-id-16 bucket25)
(bucket-id-16 etie-l1-tfrag)
(bucket-id-16 merc-l5-water)
(bucket-id-16 merc-l5-water)
(bucket-id-16 gmerc-l5-water)
(bucket-id-16 tex-l5-water)
(bucket-id-16 gmerc2-l5-water)
(bucket-id-16 bucket59)
(bucket-id-16 tfrag-l4-tfrag)
(bucket-id-16 merc-l5-pris)
(bucket-id-16 emerc-l5-pris)
(bucket-id-16 gmerc-l5-pris)
(bucket-id-16 tex-l5-pris)
(bucket-id-16 gmerc2-l5-pris)
(bucket-id-16 bucket37)
(bucket-id-16 etie-l2-tfrag)
(bucket-id-16 merc-l5-pris2)
(bucket-id-16 emerc-l5-pris2)
(bucket-id-16 gmerc-l5-pris2)
(bucket-id-16 tex-l5-pris2)
(bucket-id-16 gmerc2-l5-pris2)
(bucket-id-16 bucket48)
(bucket-id-16 tie-l3-tfrag)
(bucket-id-16 merc-l6-tfrag)
(bucket-id-16 emerc-l6-tfrag)
(bucket-id-16 gmerc-l6-tfrag)
@ -286,37 +287,37 @@
(bucket-id-16 gmerc-l6-pris)
(bucket-id-16 tex-l6-pris)
(bucket-id-16 gmerc2-l6-pris)
(bucket-id-16 bucket38)
(bucket-id-16 tfrag-scissor-l2-tfrag)
(bucket-id-16 merc-l6-shrub)
(bucket-id-16 emerc-l6-shrub)
(bucket-id-16 gmerc-l6-shrub)
(bucket-id-16 tex-l6-shrub)
(bucket-id-16 gmerc2-l6-shrub)
(bucket-id-16 bucket16)
(bucket-id-16 etie-scissor-l0-tfrag)
(bucket-id-16 merc-l6-alpha)
(bucket-id-16 emerc-l6-alpha)
(bucket-id-16 gmerc-l6-alpha)
(bucket-id-16 tex-l6-alpha)
(bucket-id-16 gmerc2-l6-alpha)
(bucket-id-16 bucket26)
(bucket-id-16 tfrag-scissor-l1-tfrag)
(bucket-id-16 merc-l6-water)
(bucket-id-16 merc-l6-water)
(bucket-id-16 gmerc-l6-water)
(bucket-id-16 tex-l6-water)
(bucket-id-16 gmerc2-l6-water)
(bucket-id-16 bucket60)
(bucket-id-16 tie-l4-tfrag)
(bucket-id-16 merc-l6-pris)
(bucket-id-16 emerc-l6-pris)
(bucket-id-16 gmerc-l6-pris)
(bucket-id-16 tex-l6-pris)
(bucket-id-16 gmerc2-l6-pris)
(bucket-id-16 bucket38)
(bucket-id-16 tfrag-scissor-l2-tfrag)
(bucket-id-16 merc-l6-pris2)
(bucket-id-16 emerc-l6-pris2)
(bucket-id-16 gmerc-l6-pris2)
(bucket-id-16 tex-l6-pris2)
(bucket-id-16 gmerc2-l6-pris2)
(bucket-id-16 bucket49)
(bucket-id-16 etie-l3-tfrag)
(bucket-id-16 merc-l7-tfrag)
(bucket-id-16 emerc-l7-tfrag)
(bucket-id-16 gmerc-l7-tfrag)
@ -328,7 +329,7 @@
(bucket-id-16 gmerc-l7-pris)
(bucket-id-16 tex-l7-pris)
(bucket-id-16 gmerc2-l7-pris)
(bucket-id-16 bucket39)
(bucket-id-16 tie-scissor-l2-tfrag)
(bucket-id-16 merc-l7-shrub)
(bucket-id-16 emerc-l7-shrub)
(bucket-id-16 gmerc-l7-shrub)
@ -340,25 +341,25 @@
(bucket-id-16 gmerc-l7-alpha)
(bucket-id-16 tex-l7-alpha)
(bucket-id-16 gmerc2-l7-alpha)
(bucket-id-16 bucket27)
(bucket-id-16 tie-scissor-l1-tfrag)
(bucket-id-16 merc-l7-water)
(bucket-id-16 merc-l7-water)
(bucket-id-16 gmerc-l7-water)
(bucket-id-16 tex-l7-water)
(bucket-id-16 gmerc2-l7-water)
(bucket-id-16 bucket61)
(bucket-id-16 etie-l4-tfrag)
(bucket-id-16 merc-l7-pris)
(bucket-id-16 emerc-l7-pris)
(bucket-id-16 gmerc-l7-pris)
(bucket-id-16 tex-l7-pris)
(bucket-id-16 gmerc2-l7-pris)
(bucket-id-16 bucket39)
(bucket-id-16 tie-scissor-l2-tfrag)
(bucket-id-16 merc-l7-pris2)
(bucket-id-16 emerc-l7-pris2)
(bucket-id-16 gmerc-l7-pris2)
(bucket-id-16 tex-l7-pris2)
(bucket-id-16 gmerc2-l7-pris2)
(bucket-id-16 bucket50)
(bucket-id-16 tfrag-scissor-l3-tfrag)
(bucket-id-16 merc-l8-tfrag)
(bucket-id-16 emerc-l8-tfrag)
(bucket-id-16 gmerc-l8-tfrag)
@ -370,7 +371,7 @@
(bucket-id-16 gmerc-l8-pris)
(bucket-id-16 tex-l8-pris)
(bucket-id-16 gmerc2-l8-pris)
(bucket-id-16 bucket40)
(bucket-id-16 etie-scissor-l2-tfrag)
(bucket-id-16 merc-l8-shrub)
(bucket-id-16 emerc-l8-shrub)
(bucket-id-16 gmerc-l8-shrub)
@ -382,25 +383,25 @@
(bucket-id-16 gmerc-l8-alpha)
(bucket-id-16 tex-l8-alpha)
(bucket-id-16 gmerc2-l8-alpha)
(bucket-id-16 bucket28)
(bucket-id-16 etie-scissor-l1-tfrag)
(bucket-id-16 merc-l8-water)
(bucket-id-16 merc-l8-water)
(bucket-id-16 gmerc-l8-water)
(bucket-id-16 tex-l8-water)
(bucket-id-16 gmerc2-l8-water)
(bucket-id-16 bucket62)
(bucket-id-16 tfrag-scissor-l4-tfrag)
(bucket-id-16 merc-l8-pris)
(bucket-id-16 emerc-l8-pris)
(bucket-id-16 gmerc-l8-pris)
(bucket-id-16 tex-l8-pris)
(bucket-id-16 gmerc2-l8-pris)
(bucket-id-16 bucket40)
(bucket-id-16 etie-scissor-l2-tfrag)
(bucket-id-16 merc-l8-pris2)
(bucket-id-16 emerc-l8-pris2)
(bucket-id-16 gmerc-l8-pris2)
(bucket-id-16 tex-l8-pris2)
(bucket-id-16 gmerc2-l8-pris2)
(bucket-id-16 bucket51)
(bucket-id-16 tie-scissor-l3-tfrag)
(bucket-id-16 merc-l9-tfrag)
(bucket-id-16 emerc-l9-tfrag)
(bucket-id-16 gmerc-l9-tfrag)
@ -430,7 +431,7 @@
(bucket-id-16 gmerc-l9-water)
(bucket-id-16 tex-l9-water)
(bucket-id-16 gmerc2-l9-water)
(bucket-id-16 bucket63)
(bucket-id-16 tie-scissor-l4-tfrag)
(bucket-id-16 merc-l9-pris)
(bucket-id-16 emerc-l9-pris)
(bucket-id-16 gmerc-l9-pris)
@ -442,7 +443,7 @@
(bucket-id-16 gmerc-l9-pris2)
(bucket-id-16 tex-l9-pris2)
(bucket-id-16 gmerc2-l9-pris2)
(bucket-id-16 bucket52)
(bucket-id-16 etie-scissor-l3-tfrag)
(bucket-id-16 merc-lcom-tfrag)
(bucket-id-16 emerc-lcom-tfrag)
(bucket-id-16 gmerc-lcom-tfrag)
@ -472,7 +473,7 @@
(bucket-id-16 gmerc-lcom-water)
(bucket-id-16 tex-lcom-water)
(bucket-id-16 gmerc2-lcom-water)
(bucket-id-16 bucket64)
(bucket-id-16 etie-scissor-l4-tfrag)
(bucket-id-16 merc-lcom-pris)
(bucket-id-16 emerc-lcom-pris)
(bucket-id-16 gmerc-lcom-pris)

View File

@ -119,12 +119,12 @@ At any point in time, there are 3 frames in progress:
rn5
rn6
rn7
rn8
rn9
rn10
rn11
rn12
rn13
tfrag
tie-scissor
tie
etie
etie-scissor
tie-vanish
generic
merc
emerc
@ -132,16 +132,16 @@ At any point in time, there are 3 frames in progress:
shrub-near
billboard
shrub-vanish
rn21
rn22
rn23
rn24
rn25
rn26
rn27
rn28
rn29
rn30
tfrag-trans
tie-scissor-trans
tie-trans
etie-trans
etie-scissor-trans
tfrag-water
tie-scissor-water
tie-water
etie-water
etie-scissor-water
rn31
rn32
rn33
@ -155,12 +155,12 @@ At any point in time, there are 3 frames in progress:
rn5
rn6
rn7
rn8
rn9
rn10
rn11
rn12
rn13
tfrag
tie-scissor
tie
etie
etie-scissor
tie-vanish
generic
merc
emerc
@ -168,16 +168,16 @@ At any point in time, there are 3 frames in progress:
shrub-near
billboard
shrub-vanish
rn21
rn22
rn23
rn24
rn25
rn26
rn27
rn28
rn29
rn30
tfrag-trans
tie-scissor-trans
tie-trans
etie-trans
etie-scissor-trans
tfrag-water
tie-scissor-water
tie-water
etie-water
etie-scissor-water
rn31
rn32
rn33

View File

@ -38,133 +38,133 @@
(bucket9 9) ;; hfrag
(tex-l0-tfrag 10) ;; texture
(bucket11 11) ;; tfrag
(bucket12 12) ;; tie
(bucket13 13) ;; tie
(bucket14 14) ;; tfrag
(bucket15 15) ;; tie
(bucket16 16) ;; tie
(tfrag-l0-tfrag 11) ;; tfrag
(tie-l0-tfrag 12) ;; tie
(etie-l0-tfrag 13) ;; tie
(tfrag-scissor-l0-tfrag 14) ;; tfrag
(tie-scissor-l0-tfrag 15) ;; tie
(etie-scissor-l0-tfrag 16) ;; tie
(merc-l0-tfrag 17) ;; merc
(emerc-l0-tfrag 18) ;; emerc
(gmerc-l0-tfrag 19) ;; generic
(bucket20 20) ;; tie
(tie-vanish-l0-tfrag 20) ;; tie
(gmerc2-l0-tfrag 21) ;; generic
(tex-l1-tfrag 22)
(bucket23 23)
(bucket24 24)
(bucket25 25)
(bucket26 26)
(bucket27 27)
(bucket28 28)
(tfrag-l1-tfrag 23)
(tie-l1-tfrag 24)
(etie-l1-tfrag 25)
(tfrag-scissor-l1-tfrag 26)
(tie-scissor-l1-tfrag 27)
(etie-scissor-l1-tfrag 28)
(merc-l1-tfrag 29)
(emerc-l1-tfrag 30)
(gmerc-l1-tfrag 31)
(bucket32 32)
(tie-vanish-l1-tfrag 32)
(gmerc2-l1-tfrag 33)
(tex-l2-tfrag 34)
(bucket35 35)
(bucket36 36)
(bucket37 37)
(bucket38 38)
(bucket39 39)
(bucket40 40)
(tfrag-l2-tfrag 35)
(tie-l2-tfrag 36)
(etie-l2-tfrag 37)
(tfrag-scissor-l2-tfrag 38)
(tie-scissor-l2-tfrag 39)
(etie-scissor-l2-tfrag 40)
(merc-l2-tfrag 41)
(emerc-l2-tfrag 42)
(gmerc-l2-tfrag 43)
(bucket44 44)
(tie-vanish-l2-tfrag 44)
(gmerc2-l2-tfrag 45)
(tex-l3-tfrag 46)
(bucket47 47)
(bucket48 48)
(bucket49 49)
(bucket50 50)
(bucket51 51)
(bucket52 52)
(tfrag-l3-tfrag 47)
(tie-l3-tfrag 48)
(etie-l3-tfrag 49)
(tfrag-scissor-l3-tfrag 50)
(tie-scissor-l3-tfrag 51)
(etie-scissor-l3-tfrag 52)
(merc-l3-tfrag 53)
(emerc-l3-tfrag 54)
(gmerc-l3-tfrag 55)
(bucket56 56)
(tie-vanish-l3-tfrag 56)
(gmerc2-l3-tfrag 57)
(tex-l4-tfrag 58)
(bucket59 59)
(bucket60 60)
(bucket61 61)
(bucket62 62)
(bucket63 63)
(bucket64 64)
(tfrag-l4-tfrag 59)
(tie-l4-tfrag 60)
(etie-l4-tfrag 61)
(tfrag-scissor-l4-tfrag 62)
(tie-scissor-l4-tfrag 63)
(etie-scissor-l4-tfrag 64)
(merc-l4-tfrag 65)
(emerc-l4-tfrag 66)
(gmerc-l4-tfrag 67)
(bucket68 68)
(tie-vanish-l4-tfrag 68)
(gmerc2-l4-tfrag 69)
(tex-l5-tfrag 70)
(bucket71 71)
(bucket72 72)
(bucket73 73)
(bucket74 74)
(bucket75 75)
(bucket76 76)
(tfrag-l5-tfrag 71)
(tie-l5-tfrag 72)
(etie-l5-tfrag 73)
(tfrag-scissor-l5-tfrag 74)
(tie-scissor-l5-tfrag 75)
(etie-scissor-l5-tfrag 76)
(merc-l5-tfrag 77)
(emerc-l5-tfrag 78)
(gmerc-l5-tfrag 79)
(bucket80 80)
(tie-vanish-l5-tfrag 80)
(gmerc2-l5-tfrag 81)
(tex-l6-tfrag 82)
(bucket83 83)
(bucket84 84)
(bucket85 85)
(bucket86 86)
(bucket87 87)
(bucket88 88)
(tfrag-l6-tfrag 83)
(tie-l6-tfrag 84)
(etie-l6-tfrag 85)
(tfrag-scissor-l6-tfrag 86)
(tie-scissor-l6-tfrag 87)
(etie-scissor-l6-tfrag 88)
(merc-l6-tfrag 89)
(emerc-l6-tfrag 90)
(gmerc-l6-tfrag 91)
(bucket92 92)
(tie-vanish-l6-tfrag 92)
(gmerc2-l6-tfrag 93)
(tex-l7-tfrag 94)
(bucket95 95)
(bucket96 96)
(bucket97 97)
(bucket98 98)
(bucket99 99)
(bucket100 100)
(tfrag-l7-tfrag 95)
(tie-l7-tfrag 96)
(etie-l7-tfrag 97)
(tfrag-scissor-l7-tfrag 98)
(tie-scissor-l7-tfrag 99)
(etie-scissor-l7-tfrag 100)
(merc-l7-tfrag 101)
(emerc-l7-tfrag 102)
(gmerc-l7-tfrag 103)
(bucket104 104)
(tie-vanish-l7-tfrag 104)
(gmerc2-l7-tfrag 105)
(tex-l8-tfrag 106)
(bucket107 107)
(bucket108 108)
(bucket109 109)
(bucket110 110)
(bucket111 111)
(bucket112 112)
(tfrag-l8-tfrag 107)
(tie-l8-tfrag 108)
(etie-l8-tfrag 109)
(tfrag-scissor-l8-tfrag 110)
(tie-scissor-l8-tfrag 111)
(etie-scissor-l8-tfrag 112)
(merc-l8-tfrag 113)
(emerc-l8-tfrag 114)
(gmerc-l8-tfrag 115)
(bucket116 116)
(tie-vanish-l8-tfrag 116)
(gmerc2-l8-tfrag 117)
(tex-l9-tfrag 118)
(bucket119 119)
(bucket120 120)
(bucket121 121)
(bucket122 122)
(bucket123 123)
(bucket124 124)
(tfrag-l9-tfrag 119)
(tie-l9-tfrag 120)
(etie-l9-tfrag 121)
(tfrag-scissor-l9-tfrag 122)
(tie-scissor-l9-tfrag 123)
(etie-scissor-l9-tfrag 124)
(merc-l9-tfrag 125)
(emerc-l9-tfrag 126)
(gmerc-l9-tfrag 127)
(bucket128 128)
(tie-vanish-l9-tfrag 128)
(gmerc2-l9-tfrag 129)
(tex-l0-shrub 130)
@ -278,123 +278,123 @@
(gmerc2-l9-shrub 229)
(tex-l0-alpha 230)
(bucket231 231)
(bucket232 232)
(bucket233 233)
(tfrag-l0-alpha 231)
(tie-l0-alpha 232)
(etie-l0-alpha 233)
(merc-l0-alpha 234)
(emerc-l0-alpha 235)
(gmerc-l0-alpha 236)
(bucket237 237)
(bucket238 238)
(bucket239 239)
(tfrag-scissor-l0-alpha 237)
(tie-scissor-l0-alpha 238)
(etie-scissor-l0-alpha 239)
(gmerc2-l0-alpha 240)
(tex-l1-alpha 241)
(bucket242 242)
(bucket243 243)
(bucket244 244)
(tfrag-l1-alpha 242)
(tie-l1-alpha 243)
(etie-l1-alpha 244)
(merc-l1-alpha 245)
(emerc-l1-alpha 246)
(gmerc-l1-alpha 247)
(bucket248 248)
(bucket249 249)
(bucket250 250)
(tfrag-scissor-l1-alpha 248)
(tie-scissor-l1-alpha 249)
(etie-scissor-l1-alpha 250)
(gmerc2-l1-alpha 251)
(tex-l2-alpha 252)
(bucket253 253)
(bucket254 254)
(bucket255 255)
(tfrag-l2-alpha 253)
(tie-l2-alpha 254)
(etie-l02alpha 255)
(merc-l2-alpha 256)
(emerc-l2-alpha 257)
(gmerc-l2-alpha 258)
(bucket259 259)
(bucket260 260)
(bucket261 261)
(tfrag-scissor-l2-alpha 259)
(tie-scissor-l2-alpha 260)
(etie-scissor-l2-alpha 261)
(gmerc2-l2-alpha 262)
(tex-l3-alpha 263)
(bucket264 264)
(bucket265 265)
(bucket266 266)
(tfrag-l3-alpha 264)
(tie-l3-alpha 265)
(etie-l3-alpha 266)
(merc-l3-alpha 267)
(emerc-l3-alpha 268)
(gmerc-l3-alpha 269)
(bucket270 270)
(bucket271 271)
(bucket272 272)
(tfrag-scissor-l3-alpha 270)
(tie-scissor-l3-alpha 271)
(etie-scissor-l3-alpha 272)
(gmerc2-l3-alpha 273)
(tex-l4-alpha 274)
(bucket275 275)
(bucket276 276)
(bucket277 277)
(tfrag-l4-alpha 275)
(tie-l4-alpha 276)
(etie-l4-alpha 277)
(merc-l4-alpha 278)
(emerc-l4-alpha 279)
(gmerc-l4-alpha 280)
(bucket281 281)
(bucket282 282)
(bucket283 283)
(tfrag-scissor-l4-alpha 281)
(tie-scissor-l4-alpha 282)
(etie-scissor-l4-alpha 283)
(gmerc2-l4-alpha 284)
(tex-l5-alpha 285)
(bucket286 286)
(bucket287 287)
(bucket288 288)
(tfrag-l5-alpha 286)
(tie-l5-alpha 287)
(etie-l5-alpha 288)
(merc-l5-alpha 289)
(emerc-l5-alpha 290)
(gmerc-l5-alpha 291)
(bucket292 292)
(bucket293 293)
(bucket294 294)
(tfrag-scissor-l5-alpha 292)
(tie-scissor-l5-alpha 293)
(etie-scissor-l5-alpha 294)
(gmerc2-l5-alpha 295)
(tex-l6-alpha 296)
(bucket297 297)
(bucket298 298)
(bucket299 299)
(tfrag-l6-alpha 297)
(tie-l6-alpha 298)
(etie-l6-alpha 299)
(merc-l6-alpha 300)
(emerc-l6-alpha 301)
(gmerc-l6-alpha 302)
(bucket303 303)
(bucket304 304)
(bucket305 305)
(tfrag-scissor-l6-alpha 303)
(tie-scissor-l6-alpha 304)
(etie-scissor-l6-alpha 305)
(gmerc2-l6-alpha 306)
(tex-l7-alpha 307)
(bucket308 308)
(bucket309 309)
(bucket310 310)
(tfrag-l7-alpha 308)
(tie-l7-alpha 309)
(etie-l7-alpha 310)
(merc-l7-alpha 311)
(emerc-l7-alpha 312)
(gmerc-l7-alpha 313)
(bucket314 314)
(bucket315 315)
(bucket316 316)
(tfrag-scissor-l7-alpha 314)
(tie-scissor-l7-alpha 315)
(etie-scissor-l7-alpha 316)
(gmerc2-l7-alpha 317)
(tex-l8-alpha 318)
(bucket319 319)
(bucket320 320)
(bucket321 321)
(tfrag-l8-alpha 319)
(tie-l8-alpha 320)
(etie-l8-alpha 321)
(merc-l8-alpha 322)
(emerc-l8-alpha 323)
(gmerc-l8-alpha 324)
(bucket325 325)
(bucket326 326)
(bucket327 327)
(tfrag-scissor-l8-alpha 325)
(tie-scissor-l8-alpha 326)
(etie-scissor-l8-alpha 327)
(gmerc2-l8-alpha 328)
(tex-l9-alpha 329)
(bucket330 330)
(bucket331 331)
(bucket332 332)
(tfrag-l9-alpha 330)
(tie-l9-alpha 331)
(etie-l9-alpha 332)
(merc-l9-alpha 333)
(emerc-l9-alpha 334)
(gmerc-l9-alpha 335)
(bucket336 336)
(bucket337 337)
(bucket338 338)
(tfrag-scissor-l9-alpha 336)
(tie-scissor-l9-alpha 337)
(etie-scissor-l9-alpha 338)
(gmerc2-l9-alpha 339)
(tex-lcom-tfrag 340)
@ -549,111 +549,111 @@
(tex-l0-water 463)
(merc-l0-water 464)
(gmerc-l0-water 465)
(bucket466 466)
(bucket467 467)
(bucket468 468)
(bucket469 469)
(bucket470 470)
(bucket471 471)
(tfrag-l0-water 466)
(tie-l0-water 467)
(etie-l0-water 468)
(tie-scissor-l0-water 469)
(tfrag-scissor-l0-water 470)
(etie-scissor-l0-water 471)
(gmerc2-l0-water 472)
(tex-l1-water 473)
(merc-l1-water 474)
(gmerc-l1-water 475)
(bucket476 476)
(bucket477 477)
(bucket478 478)
(bucket479 479)
(bucket480 480)
(bucket481 481)
(tfrag-l1-water 476)
(tie-l1-water 477)
(etie-l1-water 478)
(tie-scissor-l1-water 479)
(tfrag-scissor-l1-water 480)
(etie-scissor-l1-water 481)
(gmerc2-l1-water 482)
(tex-l2-water 483)
(merc-l2-water 484)
(gmerc-l2-water 485)
(bucket486 486)
(bucket487 487)
(bucket488 488)
(bucket489 489)
(bucket490 490)
(bucket491 491)
(tfrag-l2-water 486)
(tie-l2-water 487)
(etie-l2-water 488)
(tie-scissor-l2-water 489)
(tfrag-scissor-l2-water 490)
(etie-scissor-l2-water 491)
(gmerc2-l2-water 492)
(tex-l3-water 493)
(merc-l3-water 494)
(gmerc-l3-water 495)
(bucket496 496)
(bucket497 497)
(bucket498 498)
(bucket499 499)
(bucket500 500)
(bucket501 501)
(tfrag-l3-water 496)
(tie-l3-water 497)
(etie-l3-water 498)
(tie-scissor-l3-water 499)
(tfrag-scissor-l3-water 500)
(etie-scissor-l3-water 501)
(gmerc2-l3-water 502)
(tex-l4-water 503)
(merc-l4-water 504)
(gmerc-l4-water 505)
(bucket506 506)
(bucket507 507)
(bucket508 508)
(bucket509 509)
(bucket510 510)
(bucket511 511)
(tfrag-l4-water 506)
(tie-l4-water 507)
(etie-l4-water 508)
(tie-scissor-l4-water 509)
(tfrag-scissor-l4-water 510)
(etie-scissor-l4-water 511)
(gmerc2-l4-water 512)
(tex-l5-water 513)
(merc-l5-water 514)
(gmerc-l5-water 515)
(bucket516 516)
(bucket517 517)
(bucket518 518)
(bucket519 519)
(bucket520 520)
(bucket521 521)
(tfrag-l5-water 516)
(tie-l5-water 517)
(etie-l5-water 518)
(tie-scissor-l5-water 519)
(tfrag-scissor-l5-water 520)
(etie-scissor-l5-water 521)
(gmerc2-l5-water 522)
(tex-l6-water 523)
(merc-l6-water 524)
(gmerc-l6-water 525)
(bucket526 526)
(bucket527 527)
(bucket528 528)
(bucket529 529)
(bucket530 530)
(bucket531 531)
(tfrag-l6-water 526)
(tie-l6-water 527)
(etie-l6-water 528)
(tie-scissor-l6-water 529)
(tfrag-scissor-l6-water 530)
(etie-scissor-l6-water 531)
(gmerc2-l6-water 532)
(tex-l7-water 533)
(merc-l7-water 534)
(gmerc-l7-water 535)
(bucket536 536)
(bucket537 537)
(bucket538 538)
(bucket539 539)
(bucket540 540)
(bucket541 541)
(tfrag-l7-water 536)
(tie-l7-water 537)
(etie-l7-water 538)
(tie-scissor-l7-water 539)
(tfrag-scissor-l7-water 540)
(etie-scissor-l7-water 541)
(gmerc2-l7-water 542)
(tex-l8-water 543)
(merc-l8-water 544)
(gmerc-l8-water 545)
(bucket546 546)
(bucket547 547)
(bucket548 548)
(bucket549 549)
(bucket550 550)
(bucket551 551)
(tfrag-l8-water 546)
(tie-l8-water 547)
(etie-l8-water 548)
(tie-scissor-l8-water 549)
(tfrag-scissor-l8-water 550)
(etie-scissor-l8-water 551)
(gmerc2-l8-water 552)
(tex-l9-water 553)
(merc-l9-water 554)
(gmerc-l9-water 555)
(bucket556 556)
(bucket557 557)
(bucket558 558)
(bucket559 559)
(bucket560 560)
(bucket561 561)
(tfrag-l9-water 556)
(tie-l9-water 557)
(etie-l9-water 558)
(tie-scissor-l9-water 559)
(tfrag-scissor-l9-water 560)
(etie-scissor-l9-water 561)
(gmerc2-l9-water 562)
(tex-lcom-water 563)
@ -705,12 +705,12 @@
(rn5)
(rn6)
(rn7)
(rn8)
(rn9)
(rn10)
(rn11)
(rn12)
(rn13)
(tfrag)
(tie-scissor)
(tie)
(etie)
(etie-scissor)
(tie-vanish)
(generic) ;; right
(merc) ;; right
(emerc) ;; right
@ -718,16 +718,16 @@
(shrub-near)
(billboard)
(shrub-vanish)
(rn21)
(rn22)
(rn23)
(rn24)
(rn25)
(rn26)
(rn27)
(rn28)
(rn29)
(rn30)
(tfrag-trans)
(tie-scissor-trans)
(tie-trans)
(etie-trans)
(etie-scissor-trans)
(tfrag-water)
(tie-scissor-water)
(tie-water)
(etie-water)
(etie-scissor-water)
(rn31)
(rn32)
(rn33)

View File

@ -337,6 +337,7 @@
(loaded-texture-page-count int32)
(entity entity-links-array)
(closest-object meters 10)
(tie-min-dist float :offset 352)
(upload-size int32 20 :offset 388)
(inside-boxes? basic)
(display? symbol)
@ -380,7 +381,7 @@
(alpha-dists pointer)
(water-masks texture-masks-array)
(water-dists pointer)
(tfrag-last-calls int32 6)
(tfrag-last-calls uint32 6)
(texture-anim-array texture-anim-array 11)
(light-hash light-hash)
(draw-priority float)

View File

@ -32,7 +32,7 @@ some special effect code, then sent to the prim renderer to be drawn."
"Base class for prim-strip."
()
(:methods
(prim-base-method-9 () none)
(generate-dma! (_type_ matrix) none)
)
)
@ -71,7 +71,7 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
)
(:methods
(new (symbol type int texture-id string) _type_)
(prim-strip-method-10 (_type_ draw-control) none)
(setup-dma-and-tex (_type_ draw-control) none)
)
)
@ -112,7 +112,7 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
(go process-drawable-art-error "prim-strip")
)
(add-connection *prim-engine* pp #f pp s5-0 #f)
(set! (-> s5-0 flags) (prim-flags pf0 pf1))
(set! (-> s5-0 flags) (prim-flags alpha-blend-enable texture-enable))
(set! (-> s5-0 num-verts) (the-as uint num-vertices))
(set! (-> s5-0 allocated-num-verts) (the-as uint num-vertices))
(set! (-> s5-0 data0) (new 'static 'gs-test))
@ -198,11 +198,11 @@ These are owned by the thing submitting to prim, not the prim renderer itself."
(mask vector4w :inline)
(in-verts int32)
(num-verts int32)
(vert-ptr prim-vertex)
(vert-ptr (inline-array prim-vertex))
(sinks prim-sink 68 :inline)
)
(:methods
(prim-work-method-9 () none)
(reset! (_type_) none)
)
)

View File

@ -0,0 +1,130 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *prim-work*, type prim-work
(define *prim-work*
(new 'static 'prim-work
:vertex-tmpl (new 'static 'inline-array dma-packet 3
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x9 :cmd (vif-cmd unpack-v4-32))
)
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x120 :cmd (vif-cmd unpack-v4-32))
)
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x237 :cmd (vif-cmd unpack-v4-32))
)
)
:control-tmpl (new 'static 'inline-array dma-packet 2
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #xc :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x345 :num #xc :cmd (vif-cmd unpack-v4-32))
)
(new 'static 'dma-packet
:dma (new 'static 'dma-tag :qwc #xc :id (dma-tag-id cnt))
:vif1 (new 'static 'vif-tag :imm #x363 :num #xc :cmd (vif-cmd unpack-v4-32))
)
)
:giftag (new 'static 'generic-gif-tag
:fan-prim (new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
:str-prim (new 'static 'gif-tag-prim
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
:regs (new 'static 'gif-tag-regs-32 :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
:num-strips #x1
)
:call-scissor (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x6 :cmd (vif-cmd mscalf) :msk #x1)
)
:call-noclip (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1)
)
:mask (new 'static 'vector4w :x -2 :y -1 :z -1)
)
)
;; definition for method 9 of type prim-work
;; WARN: Return type mismatch int vs none.
(defmethod reset! ((this prim-work))
"Reset all pending vertex/control data."
(dotimes (v1-0 68)
(let ((a1-2 (-> this sinks v1-0)))
(set! (-> a1-2 vertex-count) (the-as uint 0))
(set! (-> a1-2 control-count) (the-as uint 0))
)
0
)
0
(none)
)
;; definition for method 9 of type prim-strip
;; INFO: function output is handled by mips2c
(defmethod-mips2c "(method 9 prim-strip)" 9 prim-strip)
;; definition for method 10 of type prim-strip
;; WARN: Return type mismatch int vs none.
(defmethod setup-dma-and-tex ((this prim-strip) (arg0 draw-control))
"Set up the bucket, prim sink, and texture."
(let ((s5-0 (-> *level* level (-> arg0 level-index))))
(let ((s2-0 (-> s5-0 draw-index))
(s4-0 (-> arg0 default-texture-page))
)
(let ((s3-0 (vu1-bucket-map s2-0 (the-as int s4-0) (merc-mode mercneric2)))
(v1-3 (vu1-bucket-map s2-0 (the-as int s4-0) (merc-mode mm5)))
)
(set! (-> this bucket) s3-0)
(set! (-> this sink) (the-as uint v1-3))
)
(set! (-> this level) s5-0)
(set! (-> this texture-index) s4-0)
)
(when (not (logtest? (-> this flags) (prim-flags no-texture-name)))
(set! (-> this tex-id)
(lookup-level-texture-id-by-name (the-as string (-> this tex-name)) s5-0 (the-as int (-> this texture-index)))
)
(logior! (-> this flags) (prim-flags no-texture-name))
)
)
0
(none)
)
;; definition for function prim-engine-execute
;; WARN: Return type mismatch int vs none.
(defun prim-engine-execute ()
"Generate all prim DMA."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask generic))
(when (not (get-menu-mode *blit-displays-work*))
(let* ((gp-0 *prim-engine*)
(s5-0 (-> *math-camera* camera-temp))
(v1-9 (-> gp-0 alive-list next0))
(s4-0 (-> (the-as connection v1-9) next0))
)
(while (!= v1-9 (-> gp-0 alive-list-end))
(-> (the-as connection v1-9) param1)
(generate-dma! (the-as prim-strip (-> (the-as connection v1-9) param2)) s5-0)
(set! v1-9 s4-0)
(set! s4-0 (-> s4-0 next0))
)
)
)
)
0
(none)
)

View File

@ -75,6 +75,7 @@
(dma-base uint32 :overlay-at (-> dma-chain 1))
(dma-level-1 uint32 :overlay-at (-> dma-chain 2))
(dma-qwc uint8 4 :offset 44)
(dma-qwc-word uint32 :overlay-at (-> dma-qwc 0))
(shader (inline-array adgif-shader) :offset 48)
(num-shaders uint8 :offset 52)
(num-base-colors uint8 :offset 53)
@ -451,7 +452,3 @@
;; failed to figure out what this is:
0

View File

@ -0,0 +1,898 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for function edge-debug-lines
;; WARN: Return type mismatch symbol vs none.
(defun edge-debug-lines ((arg0 (array vector-array)))
"Draw tfrag debug lines. These debug-lines are not stored in retail copies."
(when (nonzero? arg0)
(dotimes (s5-0 (-> arg0 length))
(when (logtest? *display-strip-lines* (ash 1 s5-0))
(let ((s4-0 (-> arg0 s5-0)))
(dotimes (s3-0 (/ (-> s4-0 length) 2))
(add-debug-line
#t
(bucket-id debug-no-zbuf1)
(-> s4-0 data (* s3-0 2))
(-> s4-0 data (+ (* s3-0 2) 1))
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
#f
(the-as rgba -1)
)
)
)
)
)
)
(none)
)
;; definition for function draw-drawable-tree-tfrag
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag ((arg0 drawable-tree-tfrag))
"Top-level function to generate DMA for tfrag."
(local-vars (sv-16 int))
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-8 (-> arg0 arrays s4-0))
(a0-4 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-8) data 0 id) 8))
(a0-6 (/ (-> (the-as drawable-inline-array-node a0-4) data 0 id) 8))
(a1-3 (+ a1-1 #x3800 #x70000000))
(a0-8 (+ a0-6 #x3800 #x70000000))
)
(draw-node-cull
(the-as pointer a0-8)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-8 32))
(-> v1-8 length)
)
)
)
)
(let* ((v1-14 (-> arg0 arrays s5-0))
(s4-1 (&+ v1-14 32))
(s3-0 (-> v1-14 length))
)
(set! sv-16 (+ (/ (-> s4-1 id) 8) #x3800 #x70000000))
(let ((s5-1 (-> *display* frames (-> *display* on-screen) global-buf base)))
(with-dma-buffer-add-bucket ((s1-0 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 10
(bucket-id tfrag-l0-tfrag)
(bucket-id tfrag-l1-tfrag)
(bucket-id tfrag-l2-tfrag)
(bucket-id tfrag-l3-tfrag)
(bucket-id tfrag-l4-tfrag)
(bucket-id tfrag-l5-tfrag)
(bucket-id tfrag-l6-tfrag)
(bucket-id tfrag-l7-tfrag)
(bucket-id tfrag-l8-tfrag)
(bucket-id tfrag-l9-tfrag)
)
*draw-index*
)
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp tfrag-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s4-1 s3-0 s1-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 0) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
)
(with-dma-buffer-add-bucket ((s1-1 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 10
(bucket-id tfrag-scissor-l0-tfrag)
(bucket-id tfrag-scissor-l1-tfrag)
(bucket-id tfrag-scissor-l2-tfrag)
(bucket-id tfrag-scissor-l3-tfrag)
(bucket-id tfrag-scissor-l4-tfrag)
(bucket-id tfrag-scissor-l5-tfrag)
(bucket-id tfrag-scissor-l6-tfrag)
(bucket-id tfrag-scissor-l7-tfrag)
(bucket-id tfrag-scissor-l8-tfrag)
(bucket-id tfrag-scissor-l9-tfrag)
)
*draw-index*
)
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s4-1 s3-0 s1-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 1) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
)
(let ((a0-33 *dma-mem-usage*))
(when (nonzero? a0-33)
(set! (-> a0-33 length) (max 2 (-> a0-33 length)))
(set! (-> a0-33 data 1 name) "tfragment")
(+! (-> a0-33 data 1 count) 1)
(+! (-> a0-33 data 1 used)
(&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint s5-1))
)
(set! (-> a0-33 data 1 total) (-> a0-33 data 1 used))
)
)
)
)
)
)
(none)
)
;; definition for function draw-drawable-tree-tfrag-trans
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-trans ((arg0 drawable-tree-tfrag))
"Top-level function to generate DMA for tfrag."
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-7 (-> arg0 arrays s4-0))
(a0-6 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
(a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8))
(a1-3 (+ a1-1 #x3800 #x70000000))
(a0-10 (+ a0-8 #x3800 #x70000000))
)
(draw-node-cull
(the-as pointer a0-10)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-7 32))
(-> v1-7 length)
)
)
)
)
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x3800 #x70000000))
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-l0-alpha)
(bucket-id tfrag-l1-alpha)
(bucket-id tfrag-l2-alpha)
(bucket-id tfrag-l3-alpha)
(bucket-id tfrag-l4-alpha)
(bucket-id tfrag-l5-alpha)
(bucket-id tfrag-l6-alpha)
(bucket-id tfrag-l7-alpha)
(bucket-id tfrag-l8-alpha)
(bucket-id tfrag-l9-alpha)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp alpha-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 2) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
)
(with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-scissor-l0-alpha)
(bucket-id tfrag-scissor-l1-alpha)
(bucket-id tfrag-scissor-l2-alpha)
(bucket-id tfrag-scissor-l3-alpha)
(bucket-id tfrag-scissor-l4-alpha)
(bucket-id tfrag-scissor-l5-alpha)
(bucket-id tfrag-scissor-l6-alpha)
(bucket-id tfrag-scissor-l7-alpha)
(bucket-id tfrag-scissor-l8-alpha)
(bucket-id tfrag-scissor-l9-alpha)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 3) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
)
)
)
)
(none)
)
;; definition for function draw-drawable-tree-tfrag-water
;; WARN: Return type mismatch drawable-tree-tfrag vs none.
(defun draw-drawable-tree-tfrag-water ((arg0 drawable-tree-tfrag))
"Top-level function to generate DMA for tfrag."
(local-vars (sv-16 int))
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(let ((s5-0 (+ (-> arg0 length) -1)))
(when (nonzero? s5-0)
(dotimes (s4-0 s5-0)
(let* ((v1-7 (-> arg0 arrays s4-0))
(a0-6 (-> arg0 arrays (+ s4-0 1)))
(a1-1 (/ (-> (the-as drawable-inline-array-node v1-7) data 0 id) 8))
(a0-8 (/ (-> (the-as drawable-inline-array-node a0-6) data 0 id) 8))
(a1-3 (+ a1-1 #x3800 #x70000000))
(a0-10 (+ a0-8 #x3800 #x70000000))
)
(draw-node-cull
(the-as pointer a0-10)
(the-as pointer a1-3)
(the-as (inline-array draw-node) (&+ v1-7 32))
(-> v1-7 length)
)
)
)
)
(let* ((v1-13 (-> arg0 arrays s5-0))
(s5-1 (&+ v1-13 32))
(s4-1 (-> v1-13 length))
)
(set! sv-16 (+ (/ (-> s5-1 id) 8) #x3800 #x70000000))
(with-dma-buffer-add-bucket ((s2-0 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-l0-water)
(bucket-id tfrag-l1-water)
(bucket-id tfrag-l2-water)
(bucket-id tfrag-l3-water)
(bucket-id tfrag-l4-water)
(bucket-id tfrag-l5-water)
(bucket-id tfrag-l6-water)
(bucket-id tfrag-l7-water)
(bucket-id tfrag-l8-water)
(bucket-id tfrag-l9-water)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* texture-dists) (the-as uint (-> *level* draw-level *draw-index* bsp water-closest)))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag (the-as pointer sv-16) s5-1 s4-1 s2-0)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 4) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 42)
(the-as uint 0)
(-> *tfrag-work* wait-to-spr)
(-> *tfrag-work* wait-from-spr)
)
)
(with-dma-buffer-add-bucket ((s2-1 (-> *display* frames (-> *display* on-screen) global-buf))
(-> (new 'static 'array bucket-id 12
(bucket-id tfrag-scissor-l0-water)
(bucket-id tfrag-scissor-l1-water)
(bucket-id tfrag-scissor-l2-water)
(bucket-id tfrag-scissor-l3-water)
(bucket-id tfrag-scissor-l4-water)
(bucket-id tfrag-scissor-l5-water)
(bucket-id tfrag-scissor-l6-water)
(bucket-id tfrag-scissor-l7-water)
(bucket-id tfrag-scissor-l8-water)
(bucket-id tfrag-scissor-l9-water)
(bucket-id bucket0)
(bucket-id bucket0)
)
*draw-index*
)
)
(set! (-> *tfrag-work* near-wait-to-spr) (the-as uint 0))
(set! (-> *tfrag-work* near-wait-from-spr) (the-as uint 0))
(set! (-> *tfrag-work* last-call) (the-as uint 0))
(draw-inline-array-tfrag-scissor (the-as pointer sv-16) s5-1 s4-1 s2-1)
(set! (-> *level* draw-level *draw-index* tfrag-last-calls 5) (-> *tfrag-work* last-call))
(update-wait-stats
(-> *perf-stats* data 43)
(the-as uint 0)
(-> *tfrag-work* near-wait-to-spr)
(-> *tfrag-work* near-wait-from-spr)
)
)
)
)
)
(none)
)
;; definition for function tfrag-vu1-init-buf
;; WARN: Return type mismatch pointer vs none.
(defun tfrag-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
"Do all tfrag buffer setup for a single bucket."
(let ((v1-0 *display*)
(a0-1 32)
)
(+! (-> v1-0 mem-reserve-size) a0-1)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((t1-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> t1-0 real-buffer-end) (the-as int (&+ (-> t1-0 base) a0-1)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s4-0 (-> s4-0 last))
(let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s3-0 base))
)
(tfrag-init-buffer s3-0 arg1 arg2 arg4)
(let ((v1-14 (the-as object (-> s3-0 base))))
(set! (-> (the-as dma-packet v1-14) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s4-0 next)))
(set! (-> (the-as dma-packet v1-14) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-14) vif1) (new 'static 'vif-tag))
(set! (-> s3-0 base) (the-as pointer (&+ (the-as dma-packet v1-14) 16)))
)
(set! (-> s4-0 next) (the-as uint s2-1))
)
)
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s5-1 (-> s5-1 last))
(let* ((s3-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s4-1 (-> s3-1 base))
)
(tfrag-end-buffer s3-1 (the-as int arg3))
(let ((v0-5 (-> s3-1 base)))
(let ((v1-28 (the-as object (-> s3-1 base))))
(set! (-> (the-as dma-packet v1-28) dma) (new 'static 'dma-tag :id (dma-tag-id next)))
(set! (-> (the-as dma-packet v1-28) vif0) (new 'static 'vif-tag))
(set! (-> (the-as dma-packet v1-28) vif1) (new 'static 'vif-tag))
(set! (-> s3-1 base) (&+ (the-as pointer v1-28) 16))
)
(set! (-> (the-as (pointer int32) (-> s5-1 last)) 1) (the-as int s4-1))
(set! (-> s5-1 last) (the-as (pointer dma-tag) v0-5))
)
)
)
)
)
)
)
(none)
)
;; definition for function tfrag-scissor-vu1-init-buf
;; WARN: Return type mismatch pointer vs none.
;; ERROR: Failed store: (s.w! (+ v1-14 8) 0) at op 52
;; ERROR: Failed store: (s.w! (+ v1-14 12) 0) at op 53
;; ERROR: Failed store: (s.w! (+ v1-28 8) 0) at op 84
;; ERROR: Failed store: (s.w! (+ v1-28 12) 0) at op 85
;; ERROR: Failed store: (s.w! (+ v1-30 4) s4-1) at op 89
(defun tfrag-scissor-vu1-init-buf ((arg0 bucket-id) (arg1 gs-test) (arg2 int) (arg3 uint) (arg4 symbol))
(let ((v1-0 *display*)
(a0-1 32)
)
(+! (-> v1-0 mem-reserve-size) a0-1)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((t1-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> t1-0 real-buffer-end) (the-as int (&+ (-> t1-0 base) a0-1)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((s4-0 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s4-0 (-> s4-0 last))
(let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf))
(s2-1 (-> s3-0 base))
)
(tfrag-scissor-init-buffer s3-0 arg1 arg2 arg4)
(let ((v1-14 (-> s3-0 base)))
(set! (-> (the-as (pointer uint64) v1-14)) (logior #x20000000 (shr (shl (-> s4-0 next) 33) 1)))
(s.w! (+ v1-14 8) 0)
(s.w! (+ v1-14 12) 0)
(set! (-> s3-0 base) (&+ v1-14 16))
)
(set! (-> s4-0 next) (the-as uint s2-1))
)
)
)
(let ((s5-1 (-> *display* frames (-> *display* on-screen) bucket-group arg0)))
(when (!= s5-1 (-> s5-1 last))
(let* ((s3-1 (-> *display* frames (-> *display* on-screen) global-buf))
(s4-1 (-> s3-1 base))
)
(tfrag-scissor-end-buffer s3-1 arg3)
(let ((v0-5 (-> s3-1 base)))
(let ((v1-28 (-> s3-1 base)))
(set! (-> (the-as (pointer int64) v1-28)) #x20000000)
(s.w! (+ v1-28 8) 0)
(s.w! (+ v1-28 12) 0)
(set! (-> s3-1 base) (&+ v1-28 16))
)
(let ((v1-30 (-> s5-1 last)))
(s.w! (+ v1-30 4) s4-1)
)
(set! (-> s5-1 last) (the-as (pointer dma-tag) v0-5))
)
)
)
)
)
)
)
(none)
)
;; definition of type tfrag-init-data
(deftype tfrag-init-data (structure)
((tfrag-bucket bucket-id)
(tfrag-scissor-bucket bucket-id)
(tfrag-trans-bucket bucket-id)
(tfrag-scissor-trans-bucket bucket-id)
(tfrag-water-bucket bucket-id)
(tfrag-water-scissor-bucket bucket-id)
)
)
;; definition for method 3 of type tfrag-init-data
(defmethod inspect ((this tfrag-init-data))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'tfrag-init-data)
(format #t "~1Ttfrag-bucket: ~D~%" (-> this tfrag-bucket))
(format #t "~1Ttfrag-scissor-bucket: ~D~%" (-> this tfrag-scissor-bucket))
(format #t "~1Ttfrag-trans-bucket: ~D~%" (-> this tfrag-trans-bucket))
(format #t "~1Ttfrag-scissor-trans-bucket: ~D~%" (-> this tfrag-scissor-trans-bucket))
(format #t "~1Ttfrag-water-bucket: ~D~%" (-> this tfrag-water-bucket))
(format #t "~1Ttfrag-water-scissor-bucket: ~D~%" (-> this tfrag-water-scissor-bucket))
(label cfg-4)
this
)
;; definition for symbol *tfrag-init-table*, type (inline-array tfrag-init-data)
(define *tfrag-init-table* (new 'static 'inline-array tfrag-init-data 10
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l0-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l0-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l0-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l0-alpha)
:tfrag-water-bucket (bucket-id tfrag-l0-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l0-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l1-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l1-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l1-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l1-alpha)
:tfrag-water-bucket (bucket-id tfrag-l1-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l1-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l2-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l2-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l2-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l2-alpha)
:tfrag-water-bucket (bucket-id tfrag-l2-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l2-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l3-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l3-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l3-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l3-alpha)
:tfrag-water-bucket (bucket-id tfrag-l3-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l3-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l4-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l4-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l4-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l4-alpha)
:tfrag-water-bucket (bucket-id tfrag-l4-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l4-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l5-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l5-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l5-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l5-alpha)
:tfrag-water-bucket (bucket-id tfrag-l5-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l5-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l6-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l6-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l6-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l6-alpha)
:tfrag-water-bucket (bucket-id tfrag-l6-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l6-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l7-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l7-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l7-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l7-alpha)
:tfrag-water-bucket (bucket-id tfrag-l7-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l7-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l8-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l8-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l8-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l8-alpha)
:tfrag-water-bucket (bucket-id tfrag-l8-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l8-water)
)
(new 'static 'tfrag-init-data
:tfrag-bucket (bucket-id tfrag-l9-tfrag)
:tfrag-scissor-bucket (bucket-id tfrag-scissor-l9-tfrag)
:tfrag-trans-bucket (bucket-id tfrag-l9-alpha)
:tfrag-scissor-trans-bucket (bucket-id tfrag-scissor-l9-alpha)
:tfrag-water-bucket (bucket-id tfrag-l9-water)
:tfrag-water-scissor-bucket (bucket-id tfrag-scissor-l9-water)
)
)
)
;; definition for function tfrag-vu1-init-buffers
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-vu1-init-buffers ()
"Initialize all tfrag buckets."
(dotimes (gp-0 10)
(let ((s5-0 (-> *level* draw-level gp-0))
(s4-0 (-> *tfrag-init-table* gp-0))
)
(when s5-0
(set-subdivide-settings! s5-0)
(let ((s3-0 (-> s5-0 tfrag-gs-test)))
(tfrag-vu1-init-buf
(-> s4-0 tfrag-bucket)
s3-0
0
(-> s5-0 tfrag-last-calls 0)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-scissor-bucket)
s3-0
0
(-> s5-0 tfrag-last-calls 1)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
)
(tfrag-vu1-init-buf
(-> s4-0 tfrag-trans-bucket)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
1
(-> s5-0 tfrag-last-calls 2)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-scissor-trans-bucket)
(new 'static 'gs-test
:ate #x1
:atst (gs-atest greater-equal)
:aref #x26
:afail #x1
:zte #x1
:ztst (gs-ztest greater-equal)
)
1
(-> s5-0 tfrag-last-calls 3)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-vu1-init-buf
(-> s4-0 tfrag-water-bucket)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
1
(-> s5-0 tfrag-last-calls 4)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
(tfrag-scissor-vu1-init-buf
(-> s4-0 tfrag-water-scissor-bucket)
(new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest greater-equal))
1
(-> s5-0 tfrag-last-calls 5)
(logtest? (-> s5-0 info level-flags) (level-flags use-camera-other))
)
)
)
)
(none)
)
;; definition for method 10 of type drawable-tree-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod draw ((this drawable-tree-tfrag))
"Draw the drawable, and typically its children.
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
(let ((v1-1 (-> *background-work* tfrag-tree-count))
(a1-3 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-trees v1-1) this)
(set! (-> *background-work* tfrag-levels v1-1) a1-3)
)
(+! (-> *background-work* tfrag-tree-count) 1)
0
(none)
)
;; definition for method 10 of type drawable-tree-tfrag-trans
;; WARN: Return type mismatch int vs none.
(defmethod draw ((this drawable-tree-tfrag-trans))
"Draw the drawable, and typically its children.
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
(let ((v1-1 (-> *background-work* tfrag-trans-tree-count))
(a1-3 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-trans-trees v1-1) this)
(set! (-> *background-work* tfrag-trans-levels v1-1) a1-3)
)
(+! (-> *background-work* tfrag-trans-tree-count) 1)
0
(none)
)
;; definition for method 10 of type drawable-tree-tfrag-water
;; WARN: Return type mismatch int vs none.
(defmethod draw ((this drawable-tree-tfrag-water))
"Draw the drawable, and typically its children.
This usually means adding stuff to a list to be drawn later, rather than expensive drawing here."
(let ((v1-1 (-> *background-work* tfrag-water-tree-count))
(a1-3 (-> *level* draw-level *draw-index*))
)
(set! (-> *background-work* tfrag-water-trees v1-1) this)
(set! (-> *background-work* tfrag-water-levels v1-1) a1-3)
)
(+! (-> *background-work* tfrag-water-tree-count) 1)
0
(none)
)
;; definition for method 13 of type tfragment
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this tfragment))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(stats-tfrag-asm this)
0
(none)
)
;; definition for method 13 of type drawable-tree-tfrag
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this drawable-tree-tfrag))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor))
(let ((v1-15 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-15)
)
(dotimes (s5-0 (-> this length))
(collect-stats (-> this arrays s5-0))
)
)
0
(none)
)
;; definition for method 13 of type drawable-tree-tfrag-trans
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this drawable-tree-tfrag-trans))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag-trans))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor-trans))
(let ((v1-12 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-12)
)
(dotimes (s5-0 (-> this length))
(collect-stats (-> this arrays s5-0))
)
)
0
(none)
)
;; definition for method 13 of type drawable-tree-tfrag-water
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this drawable-tree-tfrag-water))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(set! (-> *tfrag-work* vu1-enable-tfrag)
(the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* vu1-enable-tfrag-scissor)
(the-as int (logand (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user)))
)
(set! (-> *tfrag-work* tr-stat-tfrag) (-> *terrain-stats* tfrag-water))
(set! (-> *tfrag-work* tr-stat-tfrag-scissor) (-> *terrain-stats* tfrag-scissor-water))
(let ((v1-12 (-> *tfrag-work* frag-dists quad)))
(set! (-> *tfrag-work* frag-dists quad) v1-12)
)
(dotimes (s5-0 (-> this length))
(collect-stats (-> this arrays s5-0))
)
)
0
(none)
)
;; definition for method 13 of type drawable-inline-array-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this drawable-inline-array-tfrag))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
;; definition for method 13 of type drawable-inline-array-tfrag-trans
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this drawable-inline-array-tfrag-trans))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
;; definition for method 13 of type drawable-inline-array-tfrag-water
;; WARN: Return type mismatch int vs none.
(defmethod collect-stats ((this drawable-inline-array-tfrag-water))
"Collect triangle/perf statistics for rendering.
This is only called when viewing stats.
The vis-bits and culling registers are loaded during this time."
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(collect-stats s4-0)
)
)
)
)
0
(none)
)
;; definition for method 14 of type drawable-tree-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this drawable-tree-tfrag))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(when (logtest? (-> *display* vu1-enable-user) (vu1-renderer-mask tfrag))
(dotimes (s5-0 (-> this length))
(debug-draw (-> this arrays s5-0))
)
)
0
(none)
)
;; definition for method 14 of type drawable-tree-tfrag-trans
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this drawable-tree-tfrag-trans))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(when (logtest? (vu1-renderer-mask tfrag-trans) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(debug-draw (-> this arrays s5-0))
)
)
0
(none)
)
;; definition for method 14 of type drawable-tree-tfrag-water
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this drawable-tree-tfrag-water))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(when (logtest? (vu1-renderer-mask tfrag-water) (-> *display* vu1-enable-user))
(dotimes (s5-0 (-> this length))
(debug-draw (-> this arrays s5-0))
)
)
0
(none)
)
;; definition for method 14 of type drawable-inline-array-tfrag
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this drawable-inline-array-tfrag))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(dotimes (s5-0 (-> this length))
(let ((s4-0 (-> this data s5-0)))
(if (vis-cull (-> s4-0 id))
(debug-draw s4-0)
)
)
)
0
(none)
)
;; definition for method 14 of type tfragment
;; WARN: Return type mismatch int vs none.
(defmethod debug-draw ((this tfragment))
"Debug-draw a drawable and its children. Typically uses the debug-draw functions."
(-> *display* frames (-> *display* on-screen) global-buf)
(edge-debug-lines (-> this debug-data debug-lines))
0
(none)
)

View File

@ -0,0 +1,80 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol tnear-vu1-block, type vu-function
(define tnear-vu1-block (new 'static 'vu-function :length #x38b :qlength #x1c6))
;; definition (debug) for function tfrag-details
;; WARN: Return type mismatch symbol vs none.
(defun-debug tfrag-details ((arg0 tfragment))
(format 0 "id = ~d~%" (-> arg0 id))
(format 0 "common:~%")
(let ((s5-0 (-> arg0 dma-qwc 0))
(s4-0 (-> arg0 dma-common))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-0 s4-0)
(disasm-vif-tag (the-as (pointer vif-tag) s4-0) (the-as int (* s5-0 4)) (the-as symbol 0) #t)
)
(format 0 "base:~%")
(let ((s5-1 (-> arg0 dma-qwc 1))
(s4-1 (-> arg0 dma-base))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-1 s4-1)
(disasm-vif-tag (the-as (pointer vif-tag) s4-1) (the-as int (* s5-1 4)) (the-as symbol 0) #t)
)
(format 0 "level-0:~%")
(let ((s5-2 (-> arg0 dma-qwc 3))
(s4-2 (-> arg0 dma-qwc-word))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-2 s4-2)
(disasm-vif-tag (the-as (pointer vif-tag) s4-2) (the-as int (* s5-2 4)) (the-as symbol 0) #t)
)
(format 0 "level-1:~%")
(let ((s5-3 (-> arg0 dma-qwc 2))
(gp-1 (-> arg0 dma-level-1))
)
(format 0 "qwc = ~d, ref = ~x~%" s5-3 gp-1)
(disasm-vif-tag (the-as (pointer vif-tag) gp-1) (the-as int (* s5-3 4)) (the-as symbol 0) #t)
)
(none)
)
;; definition (debug) for function clip-restore
;; INFO: Used lq/sq
;; WARN: Return type mismatch vector vs none.
(defun-debug clip-restore ()
(let ((a0-0 (new-stack-vector0))
(a1-0 (new 'stack-no-clear 'matrix))
)
(set! (-> a1-0 rvec quad) (the-as uint128 0))
(set! (-> a1-0 uvec quad) (the-as uint128 0))
(set! (-> a1-0 fvec quad) (the-as uint128 0))
(set! (-> a1-0 trans quad) (the-as uint128 0))
(set! (-> a0-0 x) 92648.22)
(set! (-> a0-0 y) 238025.03)
(set! (-> a0-0 z) 199836.31)
(set! (-> a0-0 w) 1.0)
(set! (-> a1-0 rvec x) -0.9283)
(set! (-> a1-0 rvec y) 0.0)
(set! (-> a1-0 rvec z) 0.3716)
(set! (-> a1-0 rvec w) 0.0)
(set! (-> a1-0 uvec x) -0.2257)
(set! (-> a1-0 uvec y) 0.7945)
(set! (-> a1-0 uvec z) -0.5637)
(set! (-> a1-0 uvec w) 0.0)
(set! (-> a1-0 fvec x) -0.2952)
(set! (-> a1-0 fvec y) -0.6072)
(set! (-> a1-0 fvec z) -0.7375)
(set! (-> a1-0 fvec w) 0.0)
(set! (-> a1-0 trans x) 0.0)
(set! (-> a1-0 trans y) 0.0)
(set! (-> a1-0 trans z) 0.0)
(set! (-> a1-0 trans w) 1.0)
(debug-set-camera-pos-rot! a0-0 a1-0)
)
(none)
)

View File

@ -0,0 +1,45 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for symbol *tfrag-work*, type tfrag-work
(define *tfrag-work* (new 'static 'tfrag-work
:base-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-0-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:common-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:level-1-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id ref))
:vif0 (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl))
)
:color-tmpl (new 'static 'dma-packet
:dma (new 'static 'dma-tag :id (dma-tag-id cnt))
:vif0 (new 'static 'vif-tag :imm #x102 :cmd (vif-cmd stcycl))
:vif1 (new 'static 'vif-tag :imm #xc000 :cmd (vif-cmd unpack-v4-8))
)
:max-fragment #xffff
)
)
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr x) (+ 6144 #x70000000))
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr y) (+ 6144 #x70000000))
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr z) (+ 6144 #x70000000))
;; failed to figure out what this is:
(set! (-> *tfrag-work* color-ptr w) (+ 6144 #x70000000))

View File

@ -0,0 +1,618 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 9 of type tfragment
(defmethod login ((this tfragment))
"Initialize the object after it is loaded."
(when (nonzero? *texture-masks-array*)
(dotimes (s5-0 (the-as int (-> this num-shaders)))
(let ((v1-3 (adgif-shader-login-no-remap (-> this shader s5-0)))
(a0-7 (-> *texture-masks-array* data (-> this texture-masks-index)))
)
(when v1-3
(dotimes (a1-3 3)
(dotimes (a2-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a1-3 16) (* a2-0 4)) (the-as int a0-7))))
(logior (-> (the-as (pointer int32) (+ (* a2-0 4) (the-as int a0-7) (* a1-3 16))) 0)
(-> (the-as texture (+ (* a2-0 4) (the-as int v1-3) (* a1-3 16))) masks data 0 mask x)
)
)
)
(set! (-> a0-7 data a1-3 dist) (fmax (-> a0-7 data a1-3 dist) (-> v1-3 masks data a1-3 dist)))
)
)
)
)
)
this
)
;; definition for method 8 of type tfragment
(defmethod mem-usage ((this tfragment) (usage memory-usage-block) (flags int))
(when (logtest? flags 2)
(+! (-> usage data 19 count) 1)
(let ((v1-6 (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors))))
(+! (-> usage data 19 used) v1-6)
(+! (-> usage data 19 total) (logand -4 (+ v1-6 3)))
)
(set! this this)
(goto cfg-16)
)
(let ((s4-0 1))
(set! (-> usage length) (max (-> usage length) (+ s4-0 8)))
(set! (-> usage data s4-0 name) "tfragment")
(+! (-> usage data s4-0 count) 1)
(let ((v1-20 (asize-of this)))
(+! (-> usage data s4-0 used) v1-20)
(+! (-> usage data s4-0 total) (logand -16 (+ v1-20 15)))
)
(set! (-> usage data (+ s4-0 1) name) "tfragment-base")
(+! (-> usage data (+ s4-0 1) count) 1)
(let ((v1-31 (* (-> this dma-qwc 0) 16)))
(+! (-> usage data (+ s4-0 1) used) v1-31)
(+! (-> usage data (+ s4-0 1) total) v1-31)
)
(set! (-> usage data (+ s4-0 2) name) "tfragment-common")
(+! (-> usage data (+ s4-0 2) count) 1)
(let ((v1-41 (* (- (-> this dma-qwc 1) (-> this dma-qwc 0)) 16)))
(+! (-> usage data (+ s4-0 2) used) v1-41)
(+! (-> usage data (+ s4-0 2) total) v1-41)
)
(set! (-> usage data (+ s4-0 3) name) "tfragment-level0")
(when (nonzero? (-> this num-level0-colors))
(+! (-> usage data (+ s4-0 3) count) 1)
(let ((v1-53 (* (- (-> this dma-qwc 2) (-> this dma-qwc 0)) 16)))
(+! (-> usage data (+ s4-0 3) used) v1-53)
(+! (-> usage data (+ s4-0 3) total) v1-53)
)
)
(set! (-> usage data (+ s4-0 4) name) "tfragment-level1")
(when (not (or (= (-> this dma-level-1) (-> this dma-common))
(= (-> this dma-level-1) (-> this dma-base))
(zero? (-> this num-level1-colors))
)
)
(+! (-> usage data (+ s4-0 4) count) 1)
(let ((v1-68 (* (- (-> this dma-qwc 3)
(- (/ (the-as int (- (-> this dma-level-1) (-> this dma-common))) 16) (-> this dma-qwc 0))
)
16
)
)
)
(+! (-> usage data (+ s4-0 4) used) v1-68)
(+! (-> usage data (+ s4-0 4) total) v1-68)
)
)
(set! (-> usage data (+ s4-0 5) name) "tfragment-color")
(+! (-> usage data (+ s4-0 5) count) 1)
(let ((v1-77
(if (logtest? flags 1)
0
(the-as int (* (+ (-> this num-base-colors) (-> this num-level0-colors) (-> this num-level1-colors)) 2))
)
)
)
(+! (-> usage data (+ s4-0 5) used) v1-77)
(+! (-> usage data (+ s4-0 5) total) (logand -16 (+ v1-77 15)))
)
(set! (-> usage data (+ s4-0 6) name) "tfragment-debug")
)
(label cfg-16)
this
)
;; definition for method 3 of type drawable-inline-array-tfrag
(defmethod inspect ((this drawable-inline-array-tfrag))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tlength: ~D~%" (-> this length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data))
(dotimes (s5-0 (-> this length))
(format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0))
)
this
)
;; definition for method 9 of type drawable-inline-array-tfrag
(defmethod login ((this drawable-inline-array-tfrag))
"Initialize the object after it is loaded."
(set! *texture-masks-array* (-> *level* level *level-index* bsp tfrag-masks))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
;; definition for method 9 of type drawable-inline-array-tfrag-trans
(defmethod login ((this drawable-inline-array-tfrag-trans))
"Initialize the object after it is loaded."
(set! *texture-masks-array* (-> *level* level *level-index* bsp alpha-masks))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
;; definition for method 9 of type drawable-inline-array-tfrag-water
(defmethod login ((this drawable-inline-array-tfrag-water))
"Initialize the object after it is loaded."
(set! *texture-masks-array* (-> *level* level *level-index* bsp water-masks))
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
;; definition for method 8 of type drawable-inline-array-tfrag
(defmethod mem-usage ((this drawable-inline-array-tfrag) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
this
)
;; definition for method 8 of type drawable-tree-tfrag
(defmethod mem-usage ((this drawable-tree-tfrag) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-6 (asize-of this)))
(+! (-> usage data 0 used) v1-6)
(+! (-> usage data 0 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> this time-of-day-pal))
(set! (-> usage length) (max 9 (-> usage length)))
(set! (-> usage data 8 name) "tfragment-pal")
(+! (-> usage data 8 count) 1)
(let ((v1-18 (asize-of (-> this time-of-day-pal))))
(+! (-> usage data 8 used) v1-18)
(+! (-> usage data 8 total) (logand -16 (+ v1-18 15)))
)
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this arrays s3-0) usage flags)
)
this
)
;; definition for method 5 of type drawable-inline-array-tfrag
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of ((this drawable-inline-array-tfrag))
(the-as int (+ (-> drawable-inline-array-tfrag size) (* (+ (-> this length) -1) 64)))
)
;; definition for symbol *tfrag-display-stats*, type symbol
(define *tfrag-display-stats* #f)
;; definition for symbol tfrag-vu1-block, type vu-function
(define tfrag-vu1-block (new 'static 'vu-function :length #x74b :qlength #x3a6))
;; definition for function tfrag-data-setup
;; INFO: Used lq/sq
;; WARN: Return type mismatch tfrag-data vs none.
(defun tfrag-data-setup ((arg0 tfrag-data) (arg1 int) (arg2 int))
"Set up VU1 constants"
(let ((v1-0 *math-camera*))
(let ((a0-1 (-> arg0 data)))
(set! (-> a0-1 0) (the-as uint (-> v1-0 pfog0)))
(set! (-> a0-1 1) (the-as uint (-> v1-0 fog-min)))
(set! (-> a0-1 2) (the-as uint (-> v1-0 fog-max)))
(set! (-> a0-1 3) (the-as uint 3072.0))
)
(set-vector! (-> arg0 val) 0.5 1.0 2048.0 0.0)
(set-vector! (-> arg0 ambient) 1.0 1.0 1.0 1.0)
(let ((a0-4 arg2))
(cond
((zero? a0-4)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 1)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 2)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :fge #x1 :abe arg1)
)
)
)
((= a0-4 3)
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
(set! (-> arg0 fangif tag)
(new 'static 'gif-tag64
:pre #x1
:nreg #x3
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-fan) :iip #x1 :tme #x1 :fge #x1 :abe arg1)
)
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 fangif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 hvdf-offset quad) (-> v1-0 hvdf-off quad))
(set! (-> arg0 hmge-scale quad) (-> v1-0 hmge-scale quad))
(set! (-> arg0 invh-scale quad) (-> v1-0 inv-hmge-scale quad))
(set! (-> arg0 guard quad) (-> v1-0 guard quad))
)
(set-tfrag-dists! (-> arg0 dists))
(none)
)
;; definition for function add-tfrag-mtx-0
;; WARN: Return type mismatch pointer vs none.
(defun add-tfrag-mtx-0 ((arg0 dma-buffer) (arg1 symbol))
"Add DMA for transferring matrix0 (same as matrix1)"
(let* ((a2-0 4)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x5 :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(if arg1
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp-other)
)
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp)
)
)
(&+! (-> arg0 base) 64)
(none)
)
;; definition for function add-tfrag-mtx-1
;; WARN: Return type mismatch pointer vs none.
(defun add-tfrag-mtx-1 ((arg0 dma-buffer) (arg1 symbol))
"Add DMA for transferring matrix1 (same as matrix0)"
(let* ((a2-0 4)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a2-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x14d :cmd (vif-cmd unpack-v4-32) :num a2-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(if arg1
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp-other)
)
(column-scale-matrix!
(the-as matrix (-> arg0 base))
(new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0)
(-> *math-camera* camera-temp)
)
)
(&+! (-> arg0 base) 64)
(none)
)
;; definition for function add-tfrag-data
;; WARN: Return type mismatch dma-packet vs none.
(defun add-tfrag-data ((arg0 dma-buffer) (arg1 int) (arg2 int))
"Add DMA for tfrag constants."
(let* ((a3-0 14)
(v1-0 arg0)
(a0-1 (the-as dma-packet (-> v1-0 base)))
)
(set! (-> a0-1 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc a3-0))
(set! (-> a0-1 vif0) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> a0-1 vif1) (new 'static 'vif-tag :imm #x290 :cmd (vif-cmd unpack-v4-32) :num a3-0))
(set! (-> v1-0 base) (the-as pointer (&+ a0-1 16)))
)
(tfrag-data-setup (the-as tfrag-data (-> arg0 base)) arg1 arg2)
(&+! (-> arg0 base) 224)
(let ((v1-3 (the-as dma-packet (-> arg0 base))))
(set! (-> v1-3 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> v1-3 vif0) (new 'static 'vif-tag))
(set! (-> v1-3 vif1) (new 'static 'vif-tag :cmd (vif-cmd mscal) :msk #x1))
(set! (-> arg0 base) (the-as pointer (&+ v1-3 16)))
)
(none)
)
;; definition for symbol t-stat, type tfrag-stats
(define t-stat (new 'global 'tfrag-stats))
;; definition for function tfrag-print-stats
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-print-stats ((arg0 symbol))
"Print out accumulated tfrag stats."
(when (and *tfrag-display-stats* (!= *master-mode* 'menu))
(format arg0 "~%")
(format arg0 "tris: ~8d~%" (-> t-stat tris))
(format arg0 "verts: ~8d~%" (+ (-> t-stat base-verts) (-> t-stat level0-verts) (-> t-stat level1-verts)))
(format arg0 " base: ~8d~%" (-> t-stat base-verts))
(format arg0 " lev0: ~8d~%" (-> t-stat level0-verts))
(format arg0 " lev1: ~8d~%" (-> t-stat level1-verts))
(format arg0 "tfaces: ~8d~%" (-> t-stat tfaces))
(format arg0 "tfrags: ~8d~%" (-> t-stat tfrags))
(format arg0 "dtris: ~8d~%" (-> t-stat dtris))
(format arg0 "dps: ~8d~%" (-> t-stat drawpoints))
(format arg0 "strips: ~8d~%" (-> t-stat strips))
(format arg0 "shaders:~8d~%" (-> t-stat dma-tex))
(format arg0 "tri/str:~8f~%" (/ (the float (-> t-stat dtris)) (the float (-> t-stat strips))))
(format arg0 "dma-cnt:~8d (~8d)~%" (-> t-stat dma-cnt) (* (-> t-stat dma-cnt) 32))
(format arg0 "dma-dta:~8d (~8d)~%" (-> t-stat dma-dta) (/ (* 33 (-> t-stat dma-dta)) 10))
(let ((f0-4 (* 32.0 (the float (-> t-stat dma-cnt))))
(f1-5 (* 3.3 (the float (-> t-stat dma-dta))))
(f2-3 (* 30.0 (the float (-> t-stat tfrags))))
)
(+ f0-4 f1-5 f2-3)
)
)
(none)
)
;; failed to figure out what this is:
(set! (-> t-stat from) 0)
;; failed to figure out what this is:
(set! (-> t-stat to) 0)
;; failed to figure out what this is:
(set! (-> t-stat cnt) 0)
;; definition for function tfrag-init-buffer
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int) (arg3 symbol))
"Initialize DMA bucket for Tfrag rendering."
(let ((v1-0 *display*)
(a0-6 (+ (* (+ (/ (-> tfrag-vu1-block qlength) 127) 1) 16) 480))
)
(+! (-> v1-0 mem-reserve-size) a0-6)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a2-1 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a2-1 real-buffer-end) (the-as int (&+ (-> a2-1 base) a0-6)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-vu-function arg0 tfrag-vu1-block 1)
(dma-buffer-add-gs-set arg0 (test-1 arg1))
(add-tfrag-mtx-0 arg0 arg3)
(add-tfrag-mtx-1 arg0 arg3)
(add-tfrag-data arg0 arg2 (the-as int *subdivide-draw-mode*))
(let ((v1-5 (the-as dma-packet (-> arg0 base))))
(set! (-> v1-5 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> v1-5 vif0) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> v1-5 vif1) (new 'static 'vif-tag :imm #x148 :cmd (vif-cmd offset)))
(set! (-> arg0 base) (the-as pointer (&+ v1-5 16)))
)
)
)
)
(none)
)
;; definition for function tfrag-end-buffer
;; WARN: Return type mismatch symbol vs none.
(defun tfrag-end-buffer ((arg0 dma-buffer) (arg1 int))
"Finalize DMA bucket for tfrag rendering."
(let ((v1-0 *display*)
(a2-0 64)
)
(+! (-> v1-0 mem-reserve-size) a2-0)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((t0-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> t0-0 real-buffer-end) (the-as int (&+ (-> t0-0 base) a2-0)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(let* ((v1-2 arg0)
(a2-4 (the-as dma-packet (-> v1-2 base)))
)
(set! (-> a2-4 dma) (new 'static 'dma-tag :qwc #x3 :id (dma-tag-id cnt)))
(set! (-> a2-4 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a2-4 vif1) (new 'static 'vif-tag))
(set! (-> v1-2 base) (the-as pointer (&+ a2-4 16)))
)
(let* ((v1-3 arg0)
(a0-1 (-> v1-3 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (the-as vif-tag arg1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer int32) a0-1) 4) 0)
(set! (-> (the-as (pointer int32) a0-1) 5) 0)
(set! (-> (the-as (pointer int32) a0-1) 6) 0)
(set! (-> (the-as (pointer int32) a0-1) 7) 0)
(set! (-> (the-as (pointer vif-tag) a0-1) 8) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) a0-1) 9) (new 'static 'vif-tag :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) a0-1) 10) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> (the-as (pointer vif-tag) a0-1) 11) (new 'static 'vif-tag))
(set! (-> v1-3 base) (&+ a0-1 48))
)
)
)
)
(none)
)
;; definition for function draw-inline-array-tfrag
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function tfrag-scissor-init-buffer
;; WARN: Return type mismatch symbol vs none.
;; ERROR: Failed store: (s.w! (+ v1-5 8) a0-21) at op 77
;; ERROR: Failed store: (s.w! (+ v1-5 12) a0-22) at op 79
(defun tfrag-scissor-init-buffer ((arg0 dma-buffer) (arg1 gs-test) (arg2 int) (arg3 symbol))
(let ((v1-0 *display*)
(a0-6 (+ (* (+ (/ (-> tnear-vu1-block qlength) 127) 1) 16) 496))
)
(+! (-> v1-0 mem-reserve-size) a0-6)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a2-1 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a2-1 real-buffer-end) (the-as int (&+ (-> a2-1 base) a0-6)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-vu-function arg0 tnear-vu1-block 1)
(dma-buffer-add-gs-set arg0 (test-1 arg1))
(add-tfrag-mtx-0 arg0 arg3)
(add-tfrag-mtx-1 arg0 arg3)
(add-tfrag-data arg0 arg2 (the-as int *subdivide-scissor-draw-mode*))
(let ((v1-5 (-> arg0 base)))
(set! (-> (the-as (pointer int64) v1-5)) #x10000000)
(let ((a0-21 #x3000000))
(s.w! (+ v1-5 8) a0-21)
)
(let ((a0-22 #x2000148))
(s.w! (+ v1-5 12) a0-22)
)
(set! (-> arg0 base) (&+ v1-5 16))
)
)
)
)
(none)
)
;; definition for function tfrag-scissor-end-buffer
;; WARN: Return type mismatch symbol vs none.
;; ERROR: Failed store: (s.w! (+ a2-4 8) a3-11) at op 25
;; ERROR: Failed store: (s.w! (+ a2-4 12) 0) at op 26
;; ERROR: Failed store: (s.w! (+ a0-1 4) a1-1) at op 33
;; ERROR: Failed store: (s.w! (+ a0-1 8) a1-2) at op 35
;; ERROR: Failed store: (s.w! (+ a0-1 12) a1-3) at op 37
;; ERROR: Failed store: (s.w! (+ a0-1 16) 0) at op 38
;; ERROR: Failed store: (s.w! (+ a0-1 20) 0) at op 39
;; ERROR: Failed store: (s.w! (+ a0-1 24) 0) at op 40
;; ERROR: Failed store: (s.w! (+ a0-1 28) 0) at op 41
;; ERROR: Failed store: (s.w! (+ a0-1 32) a1-4) at op 43
;; ERROR: Failed store: (s.w! (+ a0-1 36) a1-5) at op 45
;; ERROR: Failed store: (s.w! (+ a0-1 40) a1-6) at op 47
;; ERROR: Failed store: (s.w! (+ a0-1 44) 0) at op 48
(defun tfrag-scissor-end-buffer ((arg0 dma-buffer) (arg1 uint))
(let ((v1-0 *display*)
(a2-0 64)
)
(+! (-> v1-0 mem-reserve-size) a2-0)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((t0-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> t0-0 real-buffer-end) (the-as int (&+ (-> t0-0 base) a2-0)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(let* ((v1-2 arg0)
(a2-4 (-> v1-2 base))
)
(set! (-> (the-as (pointer int64) a2-4)) #x10000003)
(let ((a3-11 #x20000000))
(s.w! (+ a2-4 8) a3-11)
)
(s.w! (+ a2-4 12) 0)
(set! (-> v1-2 base) (&+ a2-4 16))
)
(let* ((v1-3 arg0)
(a0-1 (-> v1-3 base))
)
(set! (-> (the-as (pointer uint32) a0-1)) arg1)
(let ((a1-1 #x13000000))
(s.w! (+ a0-1 4) a1-1)
)
(let ((a1-2 #x5000000))
(s.w! (+ a0-1 8) a1-2)
)
(let ((a1-3 #x30000000))
(s.w! (+ a0-1 12) a1-3)
)
(s.w! (+ a0-1 16) 0)
(s.w! (+ a0-1 20) 0)
(s.w! (+ a0-1 24) 0)
(s.w! (+ a0-1 28) 0)
(let ((a1-4 #x3000000))
(s.w! (+ a0-1 32) a1-4)
)
(let ((a1-5 #x2000000))
(s.w! (+ a0-1 36) a1-5)
)
(let ((a1-6 #x1000404))
(s.w! (+ a0-1 40) a1-6)
)
(s.w! (+ a0-1 44) 0)
(set! (-> v1-3 base) (&+ a0-1 48))
)
)
)
)
(none)
)
;; definition for function draw-inline-array-tfrag-scissor
;; ERROR: function was not converted to expressions. Cannot decompile.
;; definition for function stats-tfrag-asm
;; ERROR: function was not converted to expressions. Cannot decompile.

File diff suppressed because it is too large Load Diff

View File

@ -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)
)

View File

@ -0,0 +1,728 @@
;;-*-Lisp-*-
(in-package goal)
;; definition for method 9 of type tie-fragment
(defmethod login ((this tie-fragment))
"Initialize the object after it is loaded."
(let ((s5-0 (the-as adgif-shader (-> this gif-ref)))
(s4-0 (/ (-> this tex-count) (the-as uint 5)))
)
(dotimes (s3-0 (the-as int s4-0))
(let ((v1-1 (adgif-shader-login-no-remap s5-0)))
(when v1-1
(dotimes (a0-4 3)
(dotimes (a1-0 3)
(set! (-> (the-as (pointer int32) (+ (+ (* a0-4 16) (* a1-0 4)) (the-as int *texture-masks*))))
(logior (-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int *texture-masks*) (* a0-4 16))) 0)
(-> (the-as (pointer int32) (+ (* a1-0 4) (the-as int v1-1) (* a0-4 16))) 15)
)
)
)
(set! (-> *texture-masks* data a0-4 dist)
(fmax (-> *texture-masks* data a0-4 dist) (-> v1-1 masks data a0-4 dist))
)
)
)
)
(when (= (-> s5-0 reg-4) 66)
(set! (-> s5-0 reg-4) (the-as uint 127))
(set! (-> s5-0 alpha) (new 'static 'gs-alpha))
0
)
(&+! s5-0 80)
)
)
this
)
;; definition for method 3 of type drawable-inline-array-instance-tie
(defmethod inspect ((this drawable-inline-array-instance-tie))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tlength: ~D~%" (-> this length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data))
(dotimes (s5-0 (-> this length))
(format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0))
)
this
)
;; definition for method 5 of type drawable-inline-array-instance-tie
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of ((this drawable-inline-array-instance-tie))
(the-as int (+ (-> drawable-inline-array-instance-tie size) (* (+ (-> this length) -1) 64)))
)
;; definition for method 9 of type drawable-tree-instance-tie
;; INFO: this function exists in multiple non-identical object files
(defmethod login ((this drawable-tree-instance-tie))
"Initialize the object after it is loaded."
this
)
;; definition for method 9 of type drawable-tree-instance-tie
;; INFO: this function exists in multiple non-identical object files
(defmethod login ((this drawable-tree-instance-tie))
"Initialize the object after it is loaded."
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
;; definition for method 3 of type prototype-tie
(defmethod inspect ((this prototype-tie))
(format #t "[~8x] ~A~%" this (-> this type))
(format #t "~Tlength: ~D~%" (-> this length))
(format #t "~Tdata[~D]: @ #x~X~%" (-> this length) (-> this data))
(dotimes (s5-0 (-> this length))
(format #t "~T [~D] ~A~%" s5-0 (-> this data s5-0))
)
this
)
;; definition for method 9 of type prototype-tie
(defmethod login ((this prototype-tie))
"Initialize the object after it is loaded."
(dotimes (s5-0 (-> this length))
(login (-> this data s5-0))
)
this
)
;; definition for method 8 of type drawable-tree-instance-tie
(defmethod mem-usage ((this drawable-tree-instance-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
(mem-usage (-> this prototypes prototype-array-tie) usage (logior flags 1))
this
)
;; definition for method 8 of type tie-fragment
(defmethod mem-usage ((this tie-fragment) (usage memory-usage-block) (flags int))
(when (logtest? flags 2)
(let ((v1-3 (* (-> this color-count) 4))
(a0-2 (cond
((logtest? flags 4)
20
)
((logtest? flags 8)
21
)
(else
22
)
)
)
)
(+! (-> usage data a0-2 count) 1)
(+! (-> usage data a0-2 used) v1-3)
(+! (-> usage data a0-2 total) (logand -4 (+ v1-3 3)))
)
(set! (-> usage length) (max 23 (-> usage length)))
(set! this this)
(goto cfg-13)
)
(set! (-> usage length) (max 18 (-> usage length)))
(set! (-> usage data 9 name) "tie-fragment")
(set! (-> usage data 10 name) "tie-gif")
(set! (-> usage data 11 name) "tie-points")
(set! (-> usage data 12 name) "tie-colors")
(set! (-> usage data 14 name) "tie-debug")
(set! (-> usage data 13 name) "tie-draw-points")
(set! (-> usage data 17 name) "tie-generic")
(+! (-> usage data 9 count) 1)
(let ((v1-21 (asize-of this)))
(+! (-> usage data 9 used) v1-21)
(+! (-> usage data 9 total) (logand -16 (+ v1-21 15)))
)
(let ((v1-26 (* (-> this gif-count) 16)))
(+! (-> usage data 10 count) (-> this tex-count))
(+! (-> usage data 10 used) v1-26)
(+! (-> usage data 10 total) (logand -16 (+ v1-26 15)))
)
(let ((v1-31 (* (-> this vertex-count) 16)))
(+! (-> usage data 11 count) (-> this vertex-count))
(+! (-> usage data 11 used) v1-31)
(+! (-> usage data 11 total) (logand -16 (+ v1-31 15)))
)
(let ((v1-36 (* (-> this dp-qwc) 16)))
(+! (-> usage data 13 count) (* (-> this dp-qwc) 16))
(+! (-> usage data 13 used) v1-36)
(+! (-> usage data 13 total) (logand -16 (+ v1-36 15)))
)
(let ((v1-41 (* (-> this generic-count) 16)))
(+! (-> usage data 17 count) 1)
(+! (-> usage data 17 used) v1-41)
(+! (-> usage data 17 total) (logand -16 (+ v1-41 15)))
)
(let ((s4-0 (-> this debug debug-lines)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(+! (-> usage data 14 count) (-> s4-0 s3-0 length))
(let ((v1-52 (asize-of (-> s4-0 s3-0))))
(+! (-> usage data 12 used) v1-52)
(+! (-> usage data 12 total) (logand -16 (+ v1-52 15)))
)
)
)
)
(label cfg-13)
this
)
;; definition for method 8 of type instance-tie
(defmethod mem-usage ((this instance-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 19 (-> usage length)))
(set! (-> usage data 18 name) "instance-tie")
(+! (-> usage data 18 count) 1)
(let ((v1-6 (asize-of this)))
(+! (-> usage data 18 used) v1-6)
(+! (-> usage data 18 total) (logand -16 (+ v1-6 15)))
)
(when (nonzero? (-> this color-indices))
(set! (-> usage length) (max 24 (-> usage length)))
(set! (-> usage data 23 name) "instance-tie-colors*")
(set! (-> usage data 19 name) "instance-tie-colors0")
(set! (-> usage data 20 name) "instance-tie-colors1")
(set! (-> usage data 21 name) "instance-tie-colors2")
(set! (-> usage data 22 name) "instance-tie-colors3")
(+! (-> usage data 23 count) 1)
(let ((s3-0 (-> this bucket-ptr)))
(+ (-> usage data 19 used) (-> usage data 20 used) (-> usage data 21 used) (-> usage data 22 used))
(dotimes (s2-0 4)
(let ((a0-10 (-> s3-0 tie-geom s2-0)))
(when (nonzero? a0-10)
(let ((t9-1 (method-of-object a0-10 mem-usage))
(a1-2 usage)
(v1-29 s2-0)
)
(t9-1 a0-10 a1-2 (logior (logior (cond
((= v1-29 1)
4
)
((= v1-29 2)
8
)
((= v1-29 3)
16
)
(else
0
)
)
2
)
flags
)
)
)
)
)
)
)
)
this
)
;; definition for method 8 of type drawable-inline-array-instance-tie
(defmethod mem-usage ((this drawable-inline-array-instance-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
this
)
;; definition for method 8 of type prototype-tie
(defmethod mem-usage ((this prototype-tie) (usage memory-usage-block) (flags int))
(set! (-> usage length) (max 1 (-> usage length)))
(set! (-> usage data 0 name) "drawable-group")
(+! (-> usage data 0 count) 1)
(let ((v1-5 32))
(+! (-> usage data 0 used) v1-5)
(+! (-> usage data 0 total) (logand -16 (+ v1-5 15)))
)
(dotimes (s3-0 (-> this length))
(mem-usage (-> this data s3-0) usage flags)
)
this
)
;; definition for method 5 of type prototype-tie
;; WARN: Return type mismatch uint vs int.
(defmethod asize-of ((this prototype-tie))
(the-as int (+ (-> prototype-tie size) (* (+ (-> this length) -1) 64)))
)
;; definition of type tie-consts
(deftype tie-consts (structure)
((data uint32 40)
(vector vector 10 :inline :overlay-at (-> data 0))
(quads uint128 10 :overlay-at (-> data 0))
(adgif gs-gif-tag :inline :overlay-at (-> data 0))
(strgif gs-gif-tag :inline :overlay-at (-> data 4))
(extra vector :inline :overlay-at (-> data 8))
(gifbufs vector :inline :overlay-at (-> data 12))
(clrbufs qword :inline :overlay-at (-> data 16))
(misc qword :inline :overlay-at (-> data 20))
(atestgif gs-gif-tag :inline :overlay-at (-> data 24))
(alpha gs-adcmd :inline :overlay-at (-> data 28))
(atest gs-adcmd 2 :inline :overlay-at (-> data 32))
(atest-tra gs-adcmd :inline :overlay-at (-> data 32))
(atest-def gs-adcmd :inline :overlay-at (-> data 36))
)
)
;; definition for method 3 of type tie-consts
(defmethod inspect ((this tie-consts))
(when (not this)
(set! this this)
(goto cfg-4)
)
(format #t "[~8x] ~A~%" this 'tie-consts)
(format #t "~1Tdata[40] @ #x~X~%" (-> this data))
(format #t "~1Tvector[10] @ #x~X~%" (-> this data))
(format #t "~1Tquads[10] @ #x~X~%" (-> this data))
(format #t "~1Tadgif: #<qword @ #x~X>~%" (-> this data))
(format #t "~1Tstrgif: #<qword @ #x~X>~%" (-> this strgif))
(format #t "~1Textra: #<qword @ #x~X>~%" (-> this extra))
(format #t "~1Tgifbufs: #<qword @ #x~X>~%" (-> this gifbufs))
(format #t "~1Tclrbufs: #<qword @ #x~X>~%" (-> this clrbufs))
(format #t "~1Tmisc: #<qword @ #x~X>~%" (-> this misc))
(format #t "~1Tatestgif: #<qword @ #x~X>~%" (-> this atestgif))
(format #t "~1Talpha: #<qword @ #x~X>~%" (-> this alpha))
(format #t "~1Tatest[2] @ #x~X~%" (-> this atest-tra))
(format #t "~1Tatest-tra: #<gs-adcmd @ #x~X>~%" (-> this atest-tra))
(format #t "~1Tatest-def: #<gs-adcmd @ #x~X>~%" (-> this atest-def))
(label cfg-4)
this
)
;; definition for symbol tie-vu1-block, type vu-function
(define tie-vu1-block (new 'static 'vu-function :length #x3e7 :qlength #x1f4))
;; definition for function tie-init-consts
;; WARN: Return type mismatch int vs none.
(defun tie-init-consts ((arg0 tie-consts) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
"Set up tie-consts for VU1"
(set! (-> arg0 adgif tag) (new 'static 'gif-tag64 :nloop #x5 :nreg #x1))
(set! (-> arg0 adgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(case *subdivide-draw-mode*
(((subdivide-setting textured))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting outline))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting gouraud))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type tri-strip) :iip #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
(((subdivide-setting hack))
(set! (-> arg0 strgif tag)
(new 'static 'gif-tag64
:pre #x1
:prim (new 'static 'gs-prim :prim (gs-prim-type line-strip) :iip #x1 :tme #x1 :fge #x1 :abe #x1)
:nreg #x3
)
)
)
)
(set! (-> arg0 strgif regs)
(new 'static 'gif-tag-regs :regs0 (gif-reg-id st) :regs1 (gif-reg-id rgbaq) :regs2 (gif-reg-id xyzf2))
)
(let ((f0-0 8388894.0)
(f1-0 8389078.0)
(f2-0 8389262.0)
)
(set! (-> arg0 gifbufs x) f2-0)
(set! (-> arg0 gifbufs y) f1-0)
(set! (-> arg0 gifbufs z) f2-0)
(set! (-> arg0 gifbufs w) f1-0)
(set! (-> arg0 extra x) (+ f0-0 f1-0 f2-0))
(set! (-> arg0 extra y) 0.0)
(set! (-> arg0 extra z) (+ f0-0 f1-0 f2-0))
)
(set! (-> arg0 clrbufs vector4w x) 198)
(set! (-> arg0 clrbufs vector4w y) 242)
(set! (-> arg0 clrbufs vector4w z) 198)
(set! (-> arg0 clrbufs vector4w w) 242)
(set! (-> arg0 atestgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1))
(set! (-> arg0 atestgif regs) (new 'static 'gif-tag-regs :regs0 (gif-reg-id a+d)))
(set! (-> arg0 alpha data) (the-as uint arg1))
(set! (-> arg0 alpha cmds) (gs-reg64 alpha-1))
(set! (-> arg0 atest-tra cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-tra data) (the-as uint arg2))
(set! (-> arg0 atest-def cmds) (gs-reg64 test-1))
(set! (-> arg0 atest-def data) (the-as uint arg3))
(set! (-> arg0 misc vector4w x) 0)
(set! (-> arg0 misc vector4w y) -1)
(none)
)
;; definition for function tie-init-engine
;; WARN: Return type mismatch int vs none.
(defun tie-init-engine ((arg0 dma-buffer) (arg1 gs-alpha) (arg2 gs-test) (arg3 gs-test))
"Set up DMA to initialize TIE vu1."
(let ((v1-0 *display*)
(a0-6 (+ (* (+ (/ (-> tie-vu1-block qlength) 127) 1) 16) 240))
)
(+! (-> v1-0 mem-reserve-size) a0-6)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a2-1 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a2-1 real-buffer-end) (the-as int (&+ (-> a2-1 base) a0-6)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-vu-function arg0 tie-vu1-block 1)
(let ((s2-0 10))
(let* ((v1-2 arg0)
(a0-11 (the-as dma-packet (-> v1-2 base)))
)
(set! (-> a0-11 dma) (new 'static 'dma-tag :id (dma-tag-id cnt) :qwc s2-0))
(set! (-> a0-11 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> a0-11 vif1) (new 'static 'vif-tag :imm #x3c6 :cmd (vif-cmd unpack-v4-32) :num s2-0))
(set! (-> v1-2 base) (the-as pointer (&+ a0-11 16)))
)
(tie-init-consts (the-as tie-consts (-> arg0 base)) arg1 arg2 arg3)
(&+! (-> arg0 base) (* s2-0 16))
)
(let* ((v1-5 arg0)
(a0-15 (the-as dma-packet (-> v1-5 base)))
)
(set! (-> a0-15 dma) (new 'static 'dma-tag :id (dma-tag-id cnt)))
(set! (-> a0-15 vif0) (new 'static 'vif-tag :imm #x8 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> a0-15 vif1) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> v1-5 base) (the-as pointer (&+ a0-15 16)))
)
(let* ((v1-6 arg0)
(a0-17 (the-as dma-packet (-> v1-6 base)))
)
(set! (-> a0-17 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a0-17 vif0) (new 'static 'vif-tag))
(set! (-> a0-17 vif1) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> v1-6 base) (the-as pointer (&+ a0-17 16)))
)
(let ((v1-7 (the-as object (-> arg0 base))))
(set! (-> (the-as vector v1-7) x) 8388608.0)
(set! (-> (the-as vector v1-7) y) 8388608.0)
(set! (-> (the-as vector v1-7) z) 8388608.0)
(set! (-> (the-as vector v1-7) w) 8388608.0)
(set! (-> (the-as (pointer vif-tag) v1-7) 4) (new 'static 'vif-tag :cmd (vif-cmd base)))
(set! (-> (the-as (pointer vif-tag) v1-7) 5) (new 'static 'vif-tag :imm #x2c :cmd (vif-cmd offset)))
(set! (-> (the-as (pointer vif-tag) v1-7) 6) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) v1-7) 7) (new 'static 'vif-tag :imm #x404 :cmd (vif-cmd stcycl)))
(set! (-> arg0 base) (&+ (the-as pointer v1-7) 32))
)
)
)
)
0
(none)
)
;; definition for function tie-end-buffer
;; WARN: Return type mismatch int vs none.
(defun tie-end-buffer ((arg0 dma-buffer))
"Set up DMA to finish TIE."
(let ((v1-0 *display*)
(a1-0 96)
)
(+! (-> v1-0 mem-reserve-size) a1-0)
(when (not (-> v1-0 dma-buffer-overflow))
(let ((a3-0 (-> v1-0 frames (-> v1-0 on-screen) global-buf)))
(if (< (-> a3-0 real-buffer-end) (the-as int (&+ (-> a3-0 base) a1-0)))
(set! (-> v1-0 dma-buffer-overflow) #t)
)
)
(when (not (-> v1-0 dma-buffer-overflow))
(dma-buffer-add-gs-set arg0 (test-1 (new 'static 'gs-test :zte #x1 :ztst (gs-ztest greater-equal))))
(let* ((v1-5 arg0)
(a1-10 (the-as dma-packet (-> v1-5 base)))
)
(set! (-> a1-10 dma) (new 'static 'dma-tag :qwc #x2 :id (dma-tag-id cnt)))
(set! (-> a1-10 vif0) (new 'static 'vif-tag :cmd (vif-cmd stmask)))
(set! (-> a1-10 vif1) (new 'static 'vif-tag))
(set! (-> v1-5 base) (the-as pointer (&+ a1-10 16)))
)
(let* ((v1-6 arg0)
(a0-1 (-> v1-6 base))
)
(set! (-> (the-as (pointer vif-tag) a0-1) 0) (new 'static 'vif-tag :imm #x4 :cmd (vif-cmd mscalf) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 1) (new 'static 'vif-tag :cmd (vif-cmd stmod)))
(set! (-> (the-as (pointer vif-tag) a0-1) 2) (new 'static 'vif-tag :cmd (vif-cmd flusha) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 3) (new 'static 'vif-tag :cmd (vif-cmd strow) :msk #x1))
(set! (-> (the-as (pointer vif-tag) a0-1) 4) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) a0-1) 5) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) a0-1) 6) (new 'static 'vif-tag))
(set! (-> (the-as (pointer vif-tag) a0-1) 7) (new 'static 'vif-tag))
(set! (-> v1-6 base) (&+ a0-1 32))
)
)
)
)
0
(none)
)
;; definition (debug) for function tie-int-reg
(defun-debug tie-int-reg ((arg0 int))
"Get the name of TIE VU1 program integer register."
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"itemp"
)
((= v1-0 2)
"point-ptr"
)
((= v1-0 3)
"clr-ptr"
)
((= v1-0 4)
"target-bp1-ptr"
)
((= v1-0 5)
"skip-bp2"
)
((= v1-0 6)
"target-bp2-ptr"
)
((= v1-0 7)
"target-ip1-ptr"
)
((= v1-0 8)
"target-ip2-ptr"
)
((= v1-0 9)
"ind/ind0"
)
((= v1-0 10)
" ind1"
)
((= v1-0 11)
" ind2"
)
((= v1-0 12)
"dest-ptr"
)
((= v1-0 13)
"dest2-ptr"
)
((= v1-0 14)
"skip-ips"
)
((= v1-0 15)
"kick-addr"
)
)
)
)
;; definition (debug) for function tie-float-reg
(defun-debug tie-float-reg ((arg0 int))
"Get the name of TIE VU1 program float register."
(let ((v1-0 arg0))
(cond
((zero? v1-0)
"zero"
)
((= v1-0 1)
"t-mtx0"
)
((= v1-0 2)
"t-mtx1"
)
((= v1-0 3)
"t-mtx2"
)
((= v1-0 4)
"t-mtx3"
)
((= v1-0 5)
"vtx-0"
)
((= v1-0 6)
"vtx-1"
)
((= v1-0 7)
"vtx-2"
)
((= v1-0 8)
"vtx-3"
)
((= v1-0 9)
"pos-0/2"
)
((= v1-0 10)
"pos-1/3"
)
((= v1-0 11)
"clr-0"
)
((= v1-0 12)
"clr-1"
)
((= v1-0 13)
"clr-2"
)
((= v1-0 14)
"clr-3"
)
((= v1-0 15)
"tex-0"
)
((= v1-0 16)
"tex-1"
)
((= v1-0 17)
"tex-2"
)
((= v1-0 18)
"tex-3"
)
((= v1-0 19)
"res-0/2"
)
((= v1-0 20)
"res-1/3"
)
((= v1-0 21)
"gifbuf"
)
((= v1-0 22)
"clrbuf"
)
((= v1-0 23)
"extra"
)
((= v1-0 24)
"inds"
)
((= v1-0 25)
"--"
)
((= v1-0 26)
"--"
)
((= v1-0 27)
"morph"
)
((= v1-0 28)
"xyzofs"
)
((= v1-0 29)
"clr1"
)
((= v1-0 30)
"clr2"
)
((= v1-0 31)
"--"
)
)
)
)
;; definition (debug) for function tie-ints
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-ints ()
"Dump TIE integer regs for debug."
(local-vars (sv-16 uint))
(let ((gp-0 (+ #x3da0 #x1100c000)))
(dotimes (s5-0 16)
(if (< s5-0 10)
(format 0 " ")
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "vi~d: ~6d #x~4,'0X ~s~%")
(s1-0 s5-0)
(s0-0 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
)
(set! sv-16 (-> (the-as (pointer uint32) (+ gp-0 (* (* s5-0 4) 4))) 0))
(let ((t1-0 (tie-int-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 t1-0)
)
)
)
)
(none)
)
;; definition (debug) for function tie-floats
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defun-debug tie-floats ()
"Dump TIE float regs for debug."
(local-vars (sv-16 uint) (sv-32 uint))
(let ((gp-0 (the-as (pointer uint32) (+ #x3da0 #x1100c000))))
(dotimes (s5-0 32)
(if (< s5-0 10)
(format 0 " ")
)
(format
0
"vf~d: #x~8,'0X #x~8,'0X #x~8,'0X #x~8,'0X "
s5-0
(-> gp-0 (* s5-0 4))
(-> gp-0 (+ (* s5-0 4) 1))
(-> gp-0 (+ (* s5-0 4) 2))
(-> gp-0 (+ (* s5-0 4) 3))
)
(let ((s4-0 format)
(s3-0 0)
(s2-0 "~F ~F ~F ~F ~s~%")
(s1-0 (-> gp-0 (* s5-0 4)))
(s0-0 (-> gp-0 (+ (* s5-0 4) 1)))
)
(set! sv-16 (-> gp-0 (+ (* s5-0 4) 2)))
(set! sv-32 (-> gp-0 (+ (* s5-0 4) 3)))
(let ((t2-1 (tie-float-reg s5-0)))
(s4-0 s3-0 s2-0 s1-0 s0-0 sv-16 sv-32 t2-1)
)
)
)
)
(none)
)

View File

@ -17,7 +17,7 @@
(bucket-id-16 gmerc-l0-pris)
(bucket-id-16 tex-l0-pris)
(bucket-id-16 gmerc2-l0-pris)
(bucket-id-16 bucket32)
(bucket-id-16 tie-vanish-l1-tfrag)
(bucket-id-16 merc-l0-shrub)
(bucket-id-16 emerc-l0-shrub)
(bucket-id-16 gmerc-l0-shrub)
@ -29,7 +29,7 @@
(bucket-id-16 gmerc-l0-alpha)
(bucket-id-16 tex-l0-alpha)
(bucket-id-16 gmerc2-l0-alpha)
(bucket-id-16 bucket20)
(bucket-id-16 tie-vanish-l0-tfrag)
(bucket-id-16 merc-l0-water)
(bucket-id-16 merc-l0-water)
(bucket-id-16 gmerc-l0-water)
@ -41,7 +41,7 @@
(bucket-id-16 gmerc-l0-pris)
(bucket-id-16 tex-l0-pris)
(bucket-id-16 gmerc2-l0-pris)
(bucket-id-16 bucket32)
(bucket-id-16 tie-vanish-l1-tfrag)
(bucket-id-16 merc-l0-pris2)
(bucket-id-16 emerc-l0-pris2)
(bucket-id-16 gmerc-l0-pris2)
@ -65,7 +65,7 @@
(bucket-id-16 gmerc-l1-shrub)
(bucket-id-16 tex-l1-shrub)
(bucket-id-16 gmerc2-l1-shrub)
(bucket-id-16 bucket11)
(bucket-id-16 tfrag-l0-tfrag)
(bucket-id-16 merc-l1-alpha)
(bucket-id-16 emerc-l1-alpha)
(bucket-id-16 gmerc-l1-alpha)
@ -89,7 +89,7 @@
(bucket-id-16 gmerc-l1-pris2)
(bucket-id-16 tex-l1-pris2)
(bucket-id-16 gmerc2-l1-pris2)
(bucket-id-16 bucket44)
(bucket-id-16 tie-vanish-l2-tfrag)
(bucket-id-16 merc-l2-tfrag)
(bucket-id-16 emerc-l2-tfrag)
(bucket-id-16 gmerc-l2-tfrag)
@ -107,7 +107,7 @@
(bucket-id-16 gmerc-l2-shrub)
(bucket-id-16 tex-l2-shrub)
(bucket-id-16 gmerc2-l2-shrub)
(bucket-id-16 bucket12)
(bucket-id-16 tie-l0-tfrag)
(bucket-id-16 merc-l2-alpha)
(bucket-id-16 emerc-l2-alpha)
(bucket-id-16 gmerc-l2-alpha)
@ -119,7 +119,7 @@
(bucket-id-16 gmerc-l2-water)
(bucket-id-16 tex-l2-water)
(bucket-id-16 gmerc2-l2-water)
(bucket-id-16 bucket56)
(bucket-id-16 tie-vanish-l3-tfrag)
(bucket-id-16 merc-l2-pris)
(bucket-id-16 emerc-l2-pris)
(bucket-id-16 gmerc-l2-pris)
@ -143,19 +143,19 @@
(bucket-id-16 gmerc-l3-pris)
(bucket-id-16 tex-l3-pris)
(bucket-id-16 gmerc2-l3-pris)
(bucket-id-16 bucket35)
(bucket-id-16 tfrag-l2-tfrag)
(bucket-id-16 merc-l3-shrub)
(bucket-id-16 emerc-l3-shrub)
(bucket-id-16 gmerc-l3-shrub)
(bucket-id-16 tex-l3-shrub)
(bucket-id-16 gmerc2-l3-shrub)
(bucket-id-16 bucket13)
(bucket-id-16 etie-l0-tfrag)
(bucket-id-16 merc-l3-alpha)
(bucket-id-16 emerc-l3-alpha)
(bucket-id-16 gmerc-l3-alpha)
(bucket-id-16 tex-l3-alpha)
(bucket-id-16 gmerc2-l3-alpha)
(bucket-id-16 bucket23)
(bucket-id-16 tfrag-l1-tfrag)
(bucket-id-16 merc-l3-water)
(bucket-id-16 merc-l3-water)
(bucket-id-16 gmerc-l3-water)
@ -167,7 +167,7 @@
(bucket-id-16 gmerc-l3-pris)
(bucket-id-16 tex-l3-pris)
(bucket-id-16 gmerc2-l3-pris)
(bucket-id-16 bucket35)
(bucket-id-16 tfrag-l2-tfrag)
(bucket-id-16 merc-l3-pris2)
(bucket-id-16 emerc-l3-pris2)
(bucket-id-16 gmerc-l3-pris2)
@ -185,19 +185,19 @@
(bucket-id-16 gmerc-l4-pris)
(bucket-id-16 tex-l4-pris)
(bucket-id-16 gmerc2-l4-pris)
(bucket-id-16 bucket36)
(bucket-id-16 tie-l2-tfrag)
(bucket-id-16 merc-l4-shrub)
(bucket-id-16 emerc-l4-shrub)
(bucket-id-16 gmerc-l4-shrub)
(bucket-id-16 tex-l4-shrub)
(bucket-id-16 gmerc2-l4-shrub)
(bucket-id-16 bucket14)
(bucket-id-16 tfrag-scissor-l0-tfrag)
(bucket-id-16 merc-l4-alpha)
(bucket-id-16 emerc-l4-alpha)
(bucket-id-16 gmerc-l4-alpha)
(bucket-id-16 tex-l4-alpha)
(bucket-id-16 gmerc2-l4-alpha)
(bucket-id-16 bucket24)
(bucket-id-16 tie-l1-tfrag)
(bucket-id-16 merc-l4-water)
(bucket-id-16 merc-l4-water)
(bucket-id-16 gmerc-l4-water)
@ -209,13 +209,13 @@
(bucket-id-16 gmerc-l4-pris)
(bucket-id-16 tex-l4-pris)
(bucket-id-16 gmerc2-l4-pris)
(bucket-id-16 bucket36)
(bucket-id-16 tie-l2-tfrag)
(bucket-id-16 merc-l4-pris2)
(bucket-id-16 emerc-l4-pris2)
(bucket-id-16 gmerc-l4-pris2)
(bucket-id-16 tex-l4-pris2)
(bucket-id-16 gmerc2-l4-pris2)
(bucket-id-16 bucket47)
(bucket-id-16 tfrag-l3-tfrag)
(bucket-id-16 merc-l5-tfrag)
(bucket-id-16 emerc-l5-tfrag)
(bucket-id-16 gmerc-l5-tfrag)
@ -227,37 +227,37 @@
(bucket-id-16 gmerc-l5-pris)
(bucket-id-16 tex-l5-pris)
(bucket-id-16 gmerc2-l5-pris)
(bucket-id-16 bucket37)
(bucket-id-16 etie-l2-tfrag)
(bucket-id-16 merc-l5-shrub)
(bucket-id-16 emerc-l5-shrub)
(bucket-id-16 gmerc-l5-shrub)
(bucket-id-16 tex-l5-shrub)
(bucket-id-16 gmerc2-l5-shrub)
(bucket-id-16 bucket15)
(bucket-id-16 tie-scissor-l0-tfrag)
(bucket-id-16 merc-l5-alpha)
(bucket-id-16 emerc-l5-alpha)
(bucket-id-16 gmerc-l5-alpha)
(bucket-id-16 tex-l5-alpha)
(bucket-id-16 gmerc2-l5-alpha)
(bucket-id-16 bucket25)
(bucket-id-16 etie-l1-tfrag)
(bucket-id-16 merc-l5-water)
(bucket-id-16 merc-l5-water)
(bucket-id-16 gmerc-l5-water)
(bucket-id-16 tex-l5-water)
(bucket-id-16 gmerc2-l5-water)
(bucket-id-16 bucket59)
(bucket-id-16 tfrag-l4-tfrag)
(bucket-id-16 merc-l5-pris)
(bucket-id-16 emerc-l5-pris)
(bucket-id-16 gmerc-l5-pris)
(bucket-id-16 tex-l5-pris)
(bucket-id-16 gmerc2-l5-pris)
(bucket-id-16 bucket37)
(bucket-id-16 etie-l2-tfrag)
(bucket-id-16 merc-l5-pris2)
(bucket-id-16 emerc-l5-pris2)
(bucket-id-16 gmerc-l5-pris2)
(bucket-id-16 tex-l5-pris2)
(bucket-id-16 gmerc2-l5-pris2)
(bucket-id-16 bucket48)
(bucket-id-16 tie-l3-tfrag)
(bucket-id-16 merc-l6-tfrag)
(bucket-id-16 emerc-l6-tfrag)
(bucket-id-16 gmerc-l6-tfrag)
@ -269,37 +269,37 @@
(bucket-id-16 gmerc-l6-pris)
(bucket-id-16 tex-l6-pris)
(bucket-id-16 gmerc2-l6-pris)
(bucket-id-16 bucket38)
(bucket-id-16 tfrag-scissor-l2-tfrag)
(bucket-id-16 merc-l6-shrub)
(bucket-id-16 emerc-l6-shrub)
(bucket-id-16 gmerc-l6-shrub)
(bucket-id-16 tex-l6-shrub)
(bucket-id-16 gmerc2-l6-shrub)
(bucket-id-16 bucket16)
(bucket-id-16 etie-scissor-l0-tfrag)
(bucket-id-16 merc-l6-alpha)
(bucket-id-16 emerc-l6-alpha)
(bucket-id-16 gmerc-l6-alpha)
(bucket-id-16 tex-l6-alpha)
(bucket-id-16 gmerc2-l6-alpha)
(bucket-id-16 bucket26)
(bucket-id-16 tfrag-scissor-l1-tfrag)
(bucket-id-16 merc-l6-water)
(bucket-id-16 merc-l6-water)
(bucket-id-16 gmerc-l6-water)
(bucket-id-16 tex-l6-water)
(bucket-id-16 gmerc2-l6-water)
(bucket-id-16 bucket60)
(bucket-id-16 tie-l4-tfrag)
(bucket-id-16 merc-l6-pris)
(bucket-id-16 emerc-l6-pris)
(bucket-id-16 gmerc-l6-pris)
(bucket-id-16 tex-l6-pris)
(bucket-id-16 gmerc2-l6-pris)
(bucket-id-16 bucket38)
(bucket-id-16 tfrag-scissor-l2-tfrag)
(bucket-id-16 merc-l6-pris2)
(bucket-id-16 emerc-l6-pris2)
(bucket-id-16 gmerc-l6-pris2)
(bucket-id-16 tex-l6-pris2)
(bucket-id-16 gmerc2-l6-pris2)
(bucket-id-16 bucket49)
(bucket-id-16 etie-l3-tfrag)
(bucket-id-16 merc-l7-tfrag)
(bucket-id-16 emerc-l7-tfrag)
(bucket-id-16 gmerc-l7-tfrag)
@ -311,7 +311,7 @@
(bucket-id-16 gmerc-l7-pris)
(bucket-id-16 tex-l7-pris)
(bucket-id-16 gmerc2-l7-pris)
(bucket-id-16 bucket39)
(bucket-id-16 tie-scissor-l2-tfrag)
(bucket-id-16 merc-l7-shrub)
(bucket-id-16 emerc-l7-shrub)
(bucket-id-16 gmerc-l7-shrub)
@ -323,25 +323,25 @@
(bucket-id-16 gmerc-l7-alpha)
(bucket-id-16 tex-l7-alpha)
(bucket-id-16 gmerc2-l7-alpha)
(bucket-id-16 bucket27)
(bucket-id-16 tie-scissor-l1-tfrag)
(bucket-id-16 merc-l7-water)
(bucket-id-16 merc-l7-water)
(bucket-id-16 gmerc-l7-water)
(bucket-id-16 tex-l7-water)
(bucket-id-16 gmerc2-l7-water)
(bucket-id-16 bucket61)
(bucket-id-16 etie-l4-tfrag)
(bucket-id-16 merc-l7-pris)
(bucket-id-16 emerc-l7-pris)
(bucket-id-16 gmerc-l7-pris)
(bucket-id-16 tex-l7-pris)
(bucket-id-16 gmerc2-l7-pris)
(bucket-id-16 bucket39)
(bucket-id-16 tie-scissor-l2-tfrag)
(bucket-id-16 merc-l7-pris2)
(bucket-id-16 emerc-l7-pris2)
(bucket-id-16 gmerc-l7-pris2)
(bucket-id-16 tex-l7-pris2)
(bucket-id-16 gmerc2-l7-pris2)
(bucket-id-16 bucket50)
(bucket-id-16 tfrag-scissor-l3-tfrag)
(bucket-id-16 merc-l8-tfrag)
(bucket-id-16 emerc-l8-tfrag)
(bucket-id-16 gmerc-l8-tfrag)
@ -353,7 +353,7 @@
(bucket-id-16 gmerc-l8-pris)
(bucket-id-16 tex-l8-pris)
(bucket-id-16 gmerc2-l8-pris)
(bucket-id-16 bucket40)
(bucket-id-16 etie-scissor-l2-tfrag)
(bucket-id-16 merc-l8-shrub)
(bucket-id-16 emerc-l8-shrub)
(bucket-id-16 gmerc-l8-shrub)
@ -365,25 +365,25 @@
(bucket-id-16 gmerc-l8-alpha)
(bucket-id-16 tex-l8-alpha)
(bucket-id-16 gmerc2-l8-alpha)
(bucket-id-16 bucket28)
(bucket-id-16 etie-scissor-l1-tfrag)
(bucket-id-16 merc-l8-water)
(bucket-id-16 merc-l8-water)
(bucket-id-16 gmerc-l8-water)
(bucket-id-16 tex-l8-water)
(bucket-id-16 gmerc2-l8-water)
(bucket-id-16 bucket62)
(bucket-id-16 tfrag-scissor-l4-tfrag)
(bucket-id-16 merc-l8-pris)
(bucket-id-16 emerc-l8-pris)
(bucket-id-16 gmerc-l8-pris)
(bucket-id-16 tex-l8-pris)
(bucket-id-16 gmerc2-l8-pris)
(bucket-id-16 bucket40)
(bucket-id-16 etie-scissor-l2-tfrag)
(bucket-id-16 merc-l8-pris2)
(bucket-id-16 emerc-l8-pris2)
(bucket-id-16 gmerc-l8-pris2)
(bucket-id-16 tex-l8-pris2)
(bucket-id-16 gmerc2-l8-pris2)
(bucket-id-16 bucket51)
(bucket-id-16 tie-scissor-l3-tfrag)
(bucket-id-16 merc-l9-tfrag)
(bucket-id-16 emerc-l9-tfrag)
(bucket-id-16 gmerc-l9-tfrag)
@ -413,7 +413,7 @@
(bucket-id-16 gmerc-l9-water)
(bucket-id-16 tex-l9-water)
(bucket-id-16 gmerc2-l9-water)
(bucket-id-16 bucket63)
(bucket-id-16 tie-scissor-l4-tfrag)
(bucket-id-16 merc-l9-pris)
(bucket-id-16 emerc-l9-pris)
(bucket-id-16 gmerc-l9-pris)
@ -425,7 +425,7 @@
(bucket-id-16 gmerc-l9-pris2)
(bucket-id-16 tex-l9-pris2)
(bucket-id-16 gmerc2-l9-pris2)
(bucket-id-16 bucket52)
(bucket-id-16 etie-scissor-l3-tfrag)
(bucket-id-16 merc-lcom-tfrag)
(bucket-id-16 emerc-lcom-tfrag)
(bucket-id-16 gmerc-lcom-tfrag)
@ -455,7 +455,7 @@
(bucket-id-16 gmerc-lcom-water)
(bucket-id-16 tex-lcom-water)
(bucket-id-16 gmerc2-lcom-water)
(bucket-id-16 bucket64)
(bucket-id-16 etie-scissor-l4-tfrag)
(bucket-id-16 merc-lcom-pris)
(bucket-id-16 emerc-lcom-pris)
(bucket-id-16 gmerc-lcom-pris)
@ -1526,7 +1526,3 @@
;; failed to figure out what this is:
(kmemclose)

View File

@ -162,12 +162,12 @@
rn5
rn6
rn7
rn8
rn9
rn10
rn11
rn12
rn13
tfrag
tie-scissor
tie
etie
etie-scissor
tie-vanish
generic
merc
emerc
@ -175,16 +175,16 @@
shrub-near
billboard
shrub-vanish
rn21
rn22
rn23
rn24
rn25
rn26
rn27
rn28
rn29
rn30
tfrag-trans
tie-scissor-trans
tie-trans
etie-trans
etie-scissor-trans
tfrag-water
tie-scissor-water
tie-water
etie-water
etie-scissor-water
rn31
rn32
rn33
@ -198,12 +198,12 @@
rn5
rn6
rn7
rn8
rn9
rn10
rn11
rn12
rn13
tfrag
tie-scissor
tie
etie
etie-scissor
tie-vanish
generic
merc
emerc
@ -211,16 +211,16 @@
shrub-near
billboard
shrub-vanish
rn21
rn22
rn23
rn24
rn25
rn26
rn27
rn28
rn29
rn30
tfrag-trans
tie-scissor-trans
tie-trans
etie-trans
etie-scissor-trans
tfrag-water
tie-scissor-water
tie-water
etie-water
etie-scissor-water
rn31
rn32
rn33

View File

@ -375,6 +375,7 @@
(loaded-texture-page-count int32)
(entity entity-links-array)
(closest-object meters 10)
(tie-min-dist float :offset 352)
(upload-size int32 20 :offset 388)
(inside-boxes? basic)
(display? symbol)
@ -418,7 +419,7 @@
(alpha-dists pointer)
(water-masks texture-masks-array)
(water-dists pointer)
(tfrag-last-calls int32 6)
(tfrag-last-calls uint32 6)
(texture-anim-array texture-anim-array 11)
(light-hash light-hash)
(draw-priority float)

View File

@ -10,7 +10,8 @@
"joint",
"subdivide",
"shadow-cpu-h",
"foreground"
"foreground",
"tie-methods"
],
"skip_compile_functions": [
@ -109,7 +110,12 @@
// shrubbery
"init-dma-test",
"draw-prototype-inline-array-shrub",
"draw-inline-array-instance-shrub"
"draw-inline-array-instance-shrub",
// tfrag
"tfrag-scissor-end-buffer",
"tfrag-scissor-init-buffer",
"tfrag-scissor-vu1-init-buf",
"(method 9 drawable-tree-instance-tie)"
],
"skip_compile_states": {}