Files
TeslaRel410/sda4/DPL3/VRENDER/TEXTURE.S
T
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

686 lines
14 KiB
ArmAsm

.file "texture.c"
// PGC Rel 2.0a -opt 2
.text
.align 8
_newCell:
.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)
st.l r4, -8(fp)
st.l r5, -4(fp)
st.l r16, 48(fp)
mov r17, r4
// lineno: 0
// lineno: 42
adds 20, r0, r16
call _malloc
nop
mov r16, r5
bte 0x0000, r16, .B577
ld.l 48(fp), r28
st.l r4, 8(r16)
st.l r28, 4(r16)
st.l r4, 16(r16)
st.l r0, 0(r16)
// lineno: 50
.B577: //.B0000
mov r5, r16
.DB.B577577:
// lineno: 0
// lineno: 51
ld.l -8(fp), r4
ld.l -4(fp), r5
adds .a1+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.align 8
_cell_hwareSize:
// lineno: 0
// lineno: 62
xor 0x0040, r16, r0
bnc .B582
bri r1
mov r0, r16
// lineno: 63
.B582: //.B0001
xor 0x0080, r16, r0
.DB.B582582:
bnc .B584
bri r1
adds 1, r0, r16
// lineno: 64
.B584: //.B0002
xor 0x0100, r16, r0
.DB.B584584:
bnc .B586
br .B697
adds 2, r0, r16
// lineno: 66
.B586: //.B0003
bri r1
adds 1, r0, r16
// lineno: 0
.B697: //.R0001
// lineno: 67
bri r1
nop
.globl _texInit
.align 8
_texInit:
.a3 = 0
.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 r6, -8(fp)
// lineno: 0
orh h%.BSS, r0, r31
or l%.BSS, r31, r6
// lineno: 75
orh h%_texturesInited, r0, r31
or l%_texturesInited, r31, r28
ld.l 0(r28), r29
btne 0x0000, r29, .B700
adds 1, r0, r30
orh ha%_texturesInited, r0, r31
st.l r30, l%_texturesInited(r31)
mov r0, r4
mov r0, r4
st.l r0, 0(r6)
// lineno: 83
.B708: //.M0000
adds 64, r0, r16
.DB.B708708:
call _newCell
mov r0, r17
ld.l r0(r6), r28
st.l r16, 0(r6)
st.l r28, 0(r16)
mov r16, r5
adds 1, r4, r4
adds -64, r4, r0
bc.t .DB.B708708
adds 64, r0, r16
// lineno: 0
mov r5, r28
ld.l r0(r6), r5
mov r0, r4
orh ha%.BSS+4, r0, r31
st.l r28, l%.BSS+4(r31)
bte 0x0000, r5, .B598
mov r0, r4
// lineno: 91
.B709: //.M0001
mov r5, r28
.DB.B709709:
ld.l r0(r5), r5
st.l r4, 8(r28)
st.l r4, 16(r28)
adds 1, r4, r4
xor 0x0000, r5, r0
bnc.t .DB.B709709
mov r5, r28
// lineno: 0
// lineno: 93
.B598: //.B0008
// lineno: 0
.B700: //.R0002
// lineno: 94
ld.l -16(fp), r4
ld.l -12(fp), r5
ld.l -8(fp), r6
adds .a3+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _allocateHSPtexture
.align 8
_allocateHSPtexture:
.a4 = 80
.f4 = 80
addu -(.a4+.f4), sp, sp
st.l fp,(.f4-16)(sp)
addu (.f4-16), sp, fp
st.l r1, 4(fp)
st.l r4, -48(fp)
st.l r5, -44(fp)
st.l r6, -40(fp)
st.l r7, -36(fp)
st.l r8, -32(fp)
st.l r9, -28(fp)
st.l r10, -24(fp)
st.l r11, -20(fp)
st.l r12, -16(fp)
st.l r13, -12(fp)
st.l r14, -8(fp)
st.l r15, -4(fp)
mov r16, r12
// lineno: 0
orh h%.BSS+4, r0, r31
or l%.BSS+4, r31, r15
// lineno: 106
bte r17, r16, .B608
br .B712
mov r0, r16
// lineno: 108
.B608: //.B0009
xor 0x0100, r16, r0
.DB.B608608:
bc .B610
xor 0x0080, r16, r0
bc .B610
xor 0x0040, r16, r0
bc .B610
br .B712
mov r0, r16
// lineno: 111
.B610: //.B0011
ld.l r0(r15), r9
.DB.B610610:
mov r0, r10
xor 0x0100, r12, r0
bnc .B615
br .B617
adds 16, r0, r7
// lineno: 114
.B615: //.B0013
xor 0x0080, r12, r0
.DB.B615615:
bnc .B618
br .B620
adds 4, r0, r7
// lineno: 115
.B618: //.B0015
xor 0x0040, r12, r0
.DB.B618618:
bnc .B621
adds 1, r0, r7
// lineno: 0
.B621: //.B0017
// lineno: 0
.B620: //.B0016
// lineno: 117
.B617: //.B0014
btne 0x0001, r7, .B622
bte 0x0000, r9, .B624
mov r12, r16
call _cell_hwareSize
mov r9, r13
ld.l r0(r13), r28
st.l r0, 0(r13)
st.l r28, 0(r15)
st.l r16, 12(r13)
br .B712
mov r13, r16
// lineno: 146
.B624: //.B0019
br .B712
mov r0, r16
// lineno: 156
.B622: //.B0018
bte 0x0000, r9, .B632
// lineno: 157
.B728: //.M0003
ld.l 8(r9), r28
.DB.B728728:
ld.l r0(r9), r8
adds 1, r28, r4
adds 1, r0, r6
mov r6, r5
mov r6, r5
mov r9, r11
// lineno: 170
.B727: //.M0002
btne 0x0000, r8, .B642
// lineno: 0
// lineno: 0
br .B712
mov r0, r16
// lineno: 178
.B642: //.B0026
ld.l 8(r8), r28
.DB.B642642:
btne r4, r28, .B644
adds 1, r5, r5
adds 1, r4, r4
btne r7, r5, .B646
// lineno: 0
// lineno: 0
ld.l r0(r8), r14
st.l r0, 0(r8)
mov r11, r8
btne 0x0000, r10, .B649
br .B650
st.l r14, 0(r15)
// lineno: 198
.B649: //.B0029
st.l r14, 0(r10)
.DB.B649649:
// lineno: 200
.B650: //.B0030
call _cell_hwareSize
mov r12, r16
st.l r16, 12(r8)
br .B712
mov r11, r16
// lineno: 213
.B646: //.B0028
br .B651
ld.l r0(r8), r8
// lineno: 217
.B644: //.B0027
orh h%.S00652, r0, r31
.DB.B644644:
call _printf
or l%.S00652, r31, r16
mov r0, r6
// lineno: 221
.B651: //.B0031
btne 0x0000, r6, .B727
// lineno: 0
mov r9, r28
ld.l r0(r9), r9
mov r28, r10
xor 0x0000, r9, r0
bnc.t .DB.B728728
ld.l 8(r9), r28
// lineno: 0
// lineno: 224
.B632: //.B0023
mov r0, r16
.DB.B632632:
// lineno: 0
.B712: //.R0003
// lineno: 228
ld.l -48(fp), r4
ld.l -44(fp), r5
ld.l -40(fp), r6
ld.l -36(fp), r7
ld.l -32(fp), r8
ld.l -28(fp), r9
ld.l -24(fp), r10
ld.l -20(fp), r11
ld.l -16(fp), r12
ld.l -12(fp), r13
ld.l -8(fp), r14
ld.l -4(fp), r15
adds .a4+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.align 8
_paletfix:
// lineno: 0
// lineno: 233
adds 0, r16, r0
bnc .B657
mov r0, r16
// lineno: 234
.B657: //.B0032
subs 255, r16, r0
.DB.B657657:
bnc .B659
adds 255, r0, r29
mov r29, r16
// lineno: 236
.B659: //.B0033
shra 4, r16, r16
.DB.B659659:
// lineno: 0
// lineno: 237
bri r1
nop
.globl _codeWordFromRamp
.align 8
_codeWordFromRamp:
.a6 = 80
.f6 = 48
addu -(.a6+.f6), sp, sp
st.l fp,(.f6-16)(sp)
addu (.f6-16), sp, fp
st.l r1, 4(fp)
st.l r16, 48(fp)
st.l r17, 52(fp)
// lineno: 0
// lineno: 244
adds 0, r17, r0
bc .B672
adds -4, r17, r0
bc .B671
// lineno: 246
.B672: //.B0035
br .B734
nop
// lineno: 248
.B671: //.B0034
ld.l 48(fp), r28
.DB.B671671:
fld.l r0(r28), f16
orh ha%.C00670, r0, r31
fld.l l%.C00670(r31), f17
fmul.ss f16, f17, f18
ftrunc.sd f18, f20
call _paletfix
fxfr f20, r16
ld.l 48(fp), r28
mov r16, r29
fld.l 4(r28), f16
orh ha%.C00670, r0, r31
fld.l l%.C00670(r31), f17
st.l r29, -4(fp)
fmul.ss f16, f17, f18
ftrunc.sd f18, f20
call _paletfix
fxfr f20, r16
ld.l 48(fp), r28
mov r16, r29
fld.l 8(r28), f16
orh ha%.C00670, r0, r31
fld.l l%.C00670(r31), f17
st.l r29, -8(fp)
fmul.ss f16, f17, f18
ftrunc.sd f18, f20
call _paletfix
fxfr f20, r16
ld.l 48(fp), r28
mov r16, r29
fld.l 12(r28), f16
orh ha%.C00670, r0, r31
fld.l l%.C00670(r31), f17
st.l r29, -12(fp)
fmul.ss f16, f17, f18
ftrunc.sd f18, f20
call _paletfix
fxfr f20, r16
ld.l 48(fp), r28
mov r16, r29
fld.l 16(r28), f16
orh ha%.C00670, r0, r31
fld.l l%.C00670(r31), f17
st.l r29, -16(fp)
fmul.ss f16, f17, f18
ftrunc.sd f18, f20
call _paletfix
fxfr f20, r16
ld.l 48(fp), r28
mov r16, r29
fld.l 20(r28), f16
orh ha%.C00670, r0, r31
fld.l l%.C00670(r31), f17
st.l r29, -20(fp)
fmul.ss f16, f17, f18
ftrunc.sd f18, f20
call _paletfix
fxfr f20, r16
ld.l -16(fp), r28
ld.l -4(fp), r30
shl 4, r28, r29
or r30, r29, r18
ld.l -8(fp), r19
ld.l -20(fp), r22
shl 8, r19, r20
or r18, r20, r21
shl 12, r22, r23
or r21, r23, r24
ld.l -12(fp), r25
shl 20, r16, r28
shl 16, r25, r26
or r24, r26, r27
or r27, r28, r29
shl 3, r29, r30
ld.l 52(fp), r19
ld.l 48(fp), r18
or r30, r19, r20
st.l r20, 24(r18)
st.l r16, -24(fp)
// lineno: 0
.B734: //.R0005
// lineno: 259
adds .a6+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.globl _setRampEntry
.align 8
_setRampEntry:
.a7 = 80
.f7 = 32
addu -(.a7+.f7), sp, sp
st.l fp,(.f7-16)(sp)
addu (.f7-16), sp, fp
st.l r1, 4(fp)
// lineno: 0
// lineno: 266
adds 0, r17, r0
bc .B686
adds -4, r17, r0
bc .B685
// lineno: 266
.B686: //.B0037
br .B747
nop
// lineno: 268
.B685: //.B0036
fst.l f8, r0(r16)
.DB.B685685:
fst.l f9, 4(r16)
fst.l f10, 8(r16)
fst.l f11, 12(r16)
fst.l f12, 16(r16)
call _codeWordFromRamp
fst.l f13, 20(r16)
// lineno: 0
.B747: //.R0006
// lineno: 283
adds .a7+16, fp, r31
ld.l 4(fp), r1
ld.l 0(fp), fp
bri r1
mov r31, sp
.data
.align 8
.C00670: // (0)
.long 0x437fe666 // 2.55899994E+02
.data
.align 1
.S00652: //
// "no contiguous, restarting search\n"
.byte 0x6e,0x6f,0x20,0x63,0x6f,0x6e,0x74,0x69,0x67,0x75,0x6f
.byte 0x75,0x73,0x2c,0x20,0x72,0x65,0x73,0x74,0x61,0x72,0x74
.byte 0x69,0x6e,0x67,0x20,0x73,0x65,0x61,0x72,0x63,0x68,0x0a
.byte 0x00
.data
.align 4
_texturesInited: //texturesInited
.long 0
.lcomm .BSS,16
//freeCell +0
//list_head +4
.extern _printf
.extern _malloc