Files
CydandClaude Fable 5 db7745fcd0 sda4: commit the Glaze developer hard-drive dump
Un-ignored: the dev drive is the ground truth the restoration and
emulator work constantly reference (DPL3/LIBDPL + VRENDER i860 renderer
source, BT/RP live+dev game trees, VGL_LABS pod boot, scene/audio
content). Kept in-repo for the pod-owner community.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 19:41:15 -05:00

625 lines
13 KiB
ArmAsm

.file "material.c"
// PGC Rel 2.0a -opt 2
.text
.globl _add_material
.align 8
_add_material:
.a1 = 80
.f1 = 32
addu -(.a1+.f1), sp, sp
st.l fp,(.f1-16)(sp)
addu (.f1-16), sp, fp
st.l r1, 4(fp)
// lineno: 64
orh h%_material_head, r0, r31
or l%_material_head, r31, r17
orh h%_material_tail, r0, r31
call _addPAZitem
or l%_material_tail, r31, r18
orh ha%_scene_resolved, r0, r31
st.l r0, l%_scene_resolved(r31)
// lineno: 66
adds .a1+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _create_material
.align 8
_create_material:
.a2 = 0
.f2 = 32
addu -(.a2+.f2), sp, sp
st.l fp,(.f2-16)(sp)
addu (.f2-16), sp, fp
st.l r1, 4(fp)
st.l r4, -8(fp)
// lineno: 0
// lineno: 71
adds 120, r0, r16
call _malloc
nop
mov r16, r4
btne 0x0000, r16, .B503
br .B603
mov r0, r16
// lineno: 77
.B503: //.B0000
st.l r0, 116(r4)
.DB.B503503:
st.b r0, 84(r4)
st.l r0, 48(r4)
st.l r0, 36(r4)
orh ha%.C00036, r0, r31
fld.l l%.C00036(r31), f16
fst.l f0, 8(r4)
fst.l f0, 12(r4)
fst.l f16, 4(r4)
fst.l f0, 16(r4)
fst.l f0, 20(r4)
fst.l f16, 24(r4)
st.l r0, 28(r4)
st.l r0, 32(r4)
addu 84, r4, r16
orh h%.S00505, r0, r31
call _strcpy
or l%.S00505, r31, r17
addu 52, r4, r16
orh h%.S00507, r0, r31
call _strcpy
or l%.S00507, r31, r17
mov r4, r16
// lineno: 0
.B603: //.R0000
// lineno: 94
ld.l -8(fp), r4
adds .a2+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _delete_material
.align 8
_delete_material:
.a3 = 80
.f3 = 48
addu -(.a3+.f3), sp, sp
st.l fp,(.f3-16)(sp)
addu (.f3-16), sp, fp
st.l r1, 4(fp)
st.l r4, -16(fp)
st.l r5, -12(fp)
st.l r16, 48(fp)
// lineno: 0
orh h%_material_head, r0, r31
or l%_material_head, r31, r4
orh h%_material_tail, r0, r31
or l%_material_tail, r31, r5
// lineno: 102
mov r4, r17
call _findPAZitem
mov r5, r18
mov r16, r28
st.l r16, -4(fp)
bte 0x0000, r16, .B514
mov r28, r16
mov r4, r17
call _removePAZitem
mov r5, r18
ld.l 48(fp), r28
btne r16, r28, .B517
call _free
mov r28, r16
// lineno: 105
.B517: //.B0002
orh ha%_scene_resolved, r0, r31
.DB.B517517:
br .B518
st.l r0, l%_scene_resolved(r31)
// lineno: 109
.B514: //.B0001
ld.l 48(fp), r16
.DB.B514514:
call _free
nop
// lineno: 0
.B518: //.B0003
// lineno: 111
ld.l -16(fp), r4
ld.l -12(fp), r5
adds .a3+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _add_texture
.align 8
_add_texture:
.a4 = 80
.f4 = 32
addu -(.a4+.f4), sp, sp
st.l fp,(.f4-16)(sp)
addu (.f4-16), sp, fp
st.l r1, 4(fp)
// lineno: 125
orh h%_texture_head, r0, r31
or l%_texture_head, r31, r17
orh h%_texture_tail, r0, r31
call _addPAZitem
or l%_texture_tail, r31, r18
orh ha%_scene_resolved, r0, r31
st.l r0, l%_scene_resolved(r31)
// lineno: 127
adds .a4+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _trace_materials
.align 8
_trace_materials:
.a5 = 0
.f5 = 48
addu -(.a5+.f5), sp, sp
st.l fp,(.f5-16)(sp)
addu (.f5-16), sp, fp
st.l r1, 4(fp)
st.l r4, -16(fp)
st.l r5, -12(fp)
st.l r6, -8(fp)
// lineno: 0
// lineno: 143
orh h%.S00528, r0, r31
call _printf
or l%.S00528, r31, r16
orh ha%_material_head, r0, r31
ld.l l%_material_head(r31), r4
bte 0x0000, r4, .B531
// lineno: 146
.B638: //.M0000
ld.l 8(r4), r28
.DB.B638638:
addu 84, r28, r17
orh h%.S00533, r0, r31
call _printf
or l%.S00533, r31, r16
ld.l r0(r4), r4
xor 0x0000, r4, r0
bnc.t .DB.B638638
ld.l 8(r4), r28
// lineno: 0
// lineno: 148
.B531: //.B0005
orh h%.S00535, r0, r31
.DB.B531531:
call _printf
or l%.S00535, r31, r16
orh ha%_texture_head, r0, r31
ld.l l%_texture_head(r31), r4
bte 0x0000, r4, .B538
// lineno: 157
.B639: //.M0001
ld.l 8(r4), r6
.DB.B639639:
addu 16, r6, r17
orh h%.S00540, r0, r31
call _printf
or l%.S00540, r31, r16
ld.l r0(r4), r4
xor 0x0000, r4, r0
bnc.t .DB.B639639
ld.l 8(r4), r6
// lineno: 0
// lineno: 0
.B538: //.B0007
// lineno: 162
ld.l -16(fp), r4
ld.l -12(fp), r5
ld.l -8(fp), r6
adds .a5+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _resolve_scene
.align 8
_resolve_scene:
.a6 = 80
.f6 = 112
addu -(.a6+.f6), sp, sp
st.l fp,(.f6-16)(sp)
addu (.f6-16), sp, fp
st.l r1, 4(fp)
st.l r4, -80(fp)
st.l r5, -76(fp)
st.l r6, -72(fp)
st.l r7, -68(fp)
st.l r8, -64(fp)
st.l r9, -60(fp)
st.l r10, -56(fp)
st.l r11, -52(fp)
st.l r12, -48(fp)
st.l r13, -44(fp)
st.l r14, -40(fp)
st.l r15, -36(fp)
// lineno: 0
orh h%_material_head, r0, r31
or l%_material_head, r31, r14
adds 1, r0, r5
// lineno: 174
orh ha%_scene_resolved, r0, r31
ld.l l%_scene_resolved(r31), r28
btne 0x0000, r28, .B544
ld.l r0(r14), r13
bte 0x0000, r13, .B549
ld.l -4(fp), r4
ld.l -8(fp), r6
ld.l -12(fp), r7
ld.l -16(fp), r10
orh h%_texture_head, r0, r31
or l%_texture_head, r31, r11
// lineno: 182
.B667: //.M0004
ld.l 8(r13), r10
.DB.B667667:
ld.l r0(r11), r6
st.l r0, 28(r10)
addu 28, r10, r8
addu 52, r10, r9
mov r0, r4
mov r0, r4
// lineno: 189
.B662: //.M0002
btne 0x0000, r6, .B557
mov r5, r4
br .B559
st.l r0, 0(r8)
// lineno: 197
.B557: //.B0013
ld.l 8(r6), r7
.DB.B557557:
mov r9, r16
call _strcmp
addu 16, r7, r17
btne 0x0000, r16, .B562
mov r5, r4
br .B564
st.l r7, 0(r8)
// lineno: 204
.B562: //.B0015
ld.l r0(r6), r6
.DB.B562562:
// lineno: 0
.B564: //.B0016
// lineno: 206
.B559: //.B0014
bte 0x0000, r4, .B662
// lineno: 0
ld.l r0(r13), r13
xor 0x0000, r13, r0
bnc.t .DB.B667667
ld.l 8(r13), r10
// lineno: 0
st.l r4, -4(fp)
st.l r6, -8(fp)
st.l r7, -12(fp)
st.l r10, -16(fp)
// lineno: 209
.B549: //.B0010
orh ha%_sceneGeometry, r0, r31
.DB.B549549:
ld.l l%_sceneGeometry(r31), r28
st.l r28, -20(fp)
bte 0x0000, r28, .B566
ld.l -24(fp), r10
ld.l -28(fp), r11
ld.l -32(fp), r9
// lineno: 215
.B670: //.M0007
ld.l -20(fp), r28
.DB.B670670:
ld.l 4(r28), r15
bte 0x0000, r15, .B571
// lineno: 216
.B669: //.M0006
ld.l 8(r15), r9
.DB.B669669:
bte 0x0000, r9, .B574
// lineno: 217
.B668: //.M0005
st.l r0, 212(r9)
.DB.B668668:
st.l r0, 216(r9)
mov r0, r10
ld.l r0(r14), r13
mov r0, r10
mov r0, r11
mov r0, r11
addu 212, r9, r4
addu 216, r9, r6
addu 180, r9, r7
addu 148, r9, r8
// lineno: 225
.B665: //.M0003
bte 0x0000, r10, .B580
btne 0x0000, r11, .B666
// lineno: 227
.B580: //.B0025
ld.l 8(r13), r12
.DB.B580580:
addu 84, r12, r16
call _strcmp
mov r8, r17
btne 0x0000, r16, .B583
mov r5, r10
st.l r12, 0(r4)
// lineno: 240
.B583: //.B0026
addu 84, r12, r16
.DB.B583583:
call _strcmp
mov r7, r17
btne 0x0000, r16, .B585
mov r5, r11
st.l r12, 0(r6)
// lineno: 247
.B585: //.B0027
ld.l r0(r13), r13
.DB.B585585:
btne 0x0000, r13, .B587
btne 0x0000, r10, .B589
st.l r0, 0(r4)
// lineno: 251
.B589: //.B0029
btne 0x0000, r11, .B590
st.l r0, 0(r6)
// lineno: 253
.B590: //.B0030
mov r5, r10
.DB.B590590:
mov r5, r11
// lineno: 256
.B587: //.B0028
br .B665
nop
// lineno: 0
.B666: //.N0000
ld.l r0(r9), r9
.DB.B666666:
xor 0x0000, r9, r0
bnc.t .DB.B668668
st.l r0, 212(r9)
// lineno: 0
// lineno: 258
.B574: //.B0022
ld.l r0(r15), r15
.DB.B574574:
xor 0x0000, r15, r0
bnc.t .DB.B669669
ld.l 8(r15), r9
// lineno: 0
// lineno: 259
.B571: //.B0020
ld.l -20(fp), r28
.DB.B571571:
ld.l r0(r28), r29
st.l r29, -20(fp)
xor 0x0000, r29, r0
bnc.t .DB.B670670
ld.l -20(fp), r28
// lineno: 0
st.l r10, -24(fp)
st.l r11, -28(fp)
st.l r9, -32(fp)
// lineno: 0
.B566: //.B0018
// lineno: 262
.B544: //.B0008
orh ha%_scene_resolved, r0, r31
.DB.B544544:
st.l r5, l%_scene_resolved(r31)
// lineno: 0
// lineno: 263
ld.l -80(fp), r4
ld.l -76(fp), r5
ld.l -72(fp), r6
ld.l -68(fp), r7
ld.l -64(fp), r8
ld.l -60(fp), r9
ld.l -56(fp), r10
ld.l -52(fp), r11
ld.l -48(fp), r12
ld.l -44(fp), r13
ld.l -40(fp), r14
ld.l -36(fp), r15
adds .a6+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.data
.align 8
.C00036: // (0)
.long 0x3f800000 // 1.00000000E+00
.data
.align 1
.S00505: //
// "DEFAULT"
.byte 0x44,0x45,0x46,0x41,0x55,0x4c,0x54,0x00
.S00507: //
// "DEFAULT"
.byte 0x44,0x45,0x46,0x41,0x55,0x4c,0x54,0x00
.S00528: //
// "trace materials\n"
.byte 0x74,0x72,0x61,0x63,0x65,0x20,0x6d,0x61,0x74,0x65,0x72
.byte 0x69,0x61,0x6c,0x73,0x0a,0x00
.S00533: //
// "material name %s\n"
.byte 0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x6e,0x61
.byte 0x6d,0x65,0x20,0x25,0x73,0x0a,0x00
.S00535: //
// "trace textures\n"
.byte 0x74,0x72,0x61,0x63,0x65,0x20,0x74,0x65,0x78,0x74,0x75
.byte 0x72,0x65,0x73,0x0a,0x00
.S00540: //
// "texture %s\n"
.byte 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x20,0x25,0x73,0x0a
.byte 0x00
.data
.align 4
_material_head: //material_head
.long 0
_material_tail: //material_tail
.long 0
_texture_head: //texture_head
.long 0
_texture_tail: //texture_tail
.long 0
.globl _scene_resolved
_scene_resolved: //scene_resolved
.long 0
.extern _strcmp
.extern _printf
.extern _free
.extern _removePAZitem
.extern _findPAZitem
.extern _strcpy
.extern _malloc
.extern _addPAZitem