home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-31 | 23.0 KB | 1,414 lines |
-
- ; Storm C Compiler
- ; TEMP:Mesa_2_5/src/texobj.c
- mc68030
- mc68881
- XREF _gl_free_texture_image
- XREF _HashFindFreeKeyBlock
- XREF _HashRemove
- XREF _HashInsert
- XREF _HashLookup
- XREF _gl_error
- XREF _gl_problem
- XREF _free
- XREF _calloc
- XREF _std__in
- XREF _std__out
- XREF _std__err
- XREF _CC
-
- SECTION "_gl_alloc_texture_object:0",CODE
-
-
- ;struct gl_texture_object *
- XDEF _gl_alloc_texture_object
- _gl_alloc_texture_object
- L124 EQU -$C
- link a5,#L124
- movem.l d2/d3/a2,-(a7)
- movem.l $C(a5),d2/d3
- L118
- ; obj = (struct gl_texture_object *)
- pea $480.w
- pea 1.w
- jsr _calloc
- addq.w #$8,a7
- move.l d0,a2
- ; if (obj)
- cmp.w #0,a2
- beq L123
- L119
- ; obj->Name = name;
- move.l d2,4(a2)
- ; obj->Dimensions = dimensions;
- move.l d3,$8(a2)
- ; obj->WrapS = GL_REPEAT;
- move.l #$2901,$20(a2)
- ; obj->WrapT = GL_REPEAT;
- move.l #$2901,$24(a2)
- ; obj->MinFilter = GL_NEAREST_MIPMAP_LINEAR;
- move.l #$2702,$2C(a2)
- ; obj->MagFilter = GL_LINEAR;
- move.l #$2601,$30(a2)
- ; obj->MinMagThresh = 0.0F;
- clr.l $34(a2)
- ; obj->Palette[0] = 255;
- lea $64(a2),a0
- move.b #$FF,(a0)
- ; obj->Palette[1] = 255;
- lea $64(a2),a0
- addq.w #1,a0
- move.b #$FF,(a0)
- ; obj->Palette[2] = 255;
- lea $64(a2),a0
- addq.w #2,a0
- move.b #$FF,(a0)
- ; obj->Palette[3] = 255;
- lea $64(a2),a0
- addq.w #3,a0
- move.b #$FF,(a0)
- ; obj->PaletteSize = 1;
- move.l #1,$464(a2)
- ; obj->PaletteIntFormat = GL_RGBA;
- move.l #$1908,$468(a2)
- ; obj->PaletteFormat = GL_RGBA;
- move.l #$1908,$46C(a2)
- ; if (shared)
- tst.l $8(a5)
- beq.b L121
- L120
- ; obj->Next = shared->TexObjectList;
- move.l $8(a5),a1
- move.l $C(a1),a0
- move.l a0,$47C(a2)
- ; shared->TexObjectList = obj;
- move.l $8(a5),a0
- move.l a2,$C(a0)
- L121
- ; if (name > 0)
- tst.l d2
- beq.b L123
- L122
- ; HashInsert(shared->TexObjects, name, obj);
- move.l a2,-(a7)
- move.l d2,-(a7)
- move.l $8(a5),a1
- move.l $8(a1),a0
- move.l a0,-(a7)
- jsr _HashInsert
- add.w #$C,a7
- L123
- move.l a2,d0
- movem.l (a7)+,d2/d3/a2
- unlk a5
- rts
-
- SECTION "_gl_free_texture_object:0",CODE
-
- rts
-
- ;void gl_free_texture_object( struct gl_shared_state *shared,
- XDEF _gl_free_texture_object
- _gl_free_texture_object
- L142 EQU -$14
- link a5,#L142
- movem.l d2/a2/a3,-(a7)
- move.l $C(a5),a2
- L125
- ; if (shared)
- tst.l $8(a5)
- beq.b L134
- L126
- ; tprev = NULL;
- sub.l a1,a1
- ; tcurr = shared->TexObjectList;
- move.l $8(a5),a3
- move.l $C(a3),a0
- ; while (tcurr)
- bra.b L133
- L127
- ; if (tcurr==t)
- cmp.l a2,a0
- bne.b L132
- L128
- ; if (tprev)
- cmp.w #0,a1
- beq.b L130
- L129
- ; tprev->Next = t->Next;
- move.l $47C(a2),a0
- move.l a0,$47C(a1)
- bra.b L131
- L130
- ; shared->TexObjectList = t->Next;
- move.l $47C(a2),a0
- move.l $8(a5),a1
- move.l a0,$C(a1)
- L131
- ;
- bra.b L134
- L132
- ; tprev = tcurr;
- move.l a0,a1
- ; tcurr = tcurr->Next;
- move.l $47C(a0),a0
- L133
- cmp.w #0,a0
- bne.b L127
- L134
- ; if (t->Name)
- move.l 4(a2),d0
- beq.b L136
- L135
- ; HashRemove(shared->TexObjects, t->Name);
- move.l 4(a2),d0
- move.l d0,-(a7)
- move.l $8(a5),a1
- move.l $8(a1),a0
- move.l a0,-(a7)
- jsr _HashRemove
- addq.w #$8,a7
- L136
- ; for (i=0;
- moveq #0,d2
- bra.b L140
- L137
- ; if (t->Image[i])
- lea $38(a2),a0
- lea 0(a0,d2.l*4),a0
- move.l (a0),d0
- beq.b L139
- L138
- ; gl_free_texture_image( t->Image[i] );
- lea $38(a2),a0
- lea 0(a0,d2.l*4),a0
- move.l (a0),a0
- move.l a0,-(a7)
- jsr _gl_free_texture_image
- addq.w #4,a7
- L139
- addq.l #1,d2
- L140
- cmp.l #$B,d2
- blo.b L137
- L141
- ; free( t );
- move.l a2,-(a7)
- jsr _free
- addq.w #4,a7
- movem.l (a7)+,d2/a2/a3
- unlk a5
- rts
-
- SECTION "_gl_test_texture_object_completeness:0",CODE
-
-
- ;void gl_test_texture_object_completeness( struct gl_texture_object *
- XDEF _gl_test_texture_object_completeness
- _gl_test_texture_object_completeness
- movem.l d2-d4,-(a7)
- move.l $10(a7),a0
- L144
- ; t->Complete = GL_TRUE;
- move.b #1,$476(a0)
- ; if (!t->Image[0] || !t->Image[0]->Data)
- lea $38(a0),a1
- tst.l (a1)
- beq.b L146
- L145
- lea $38(a0),a1
- move.l (a1),a1
- move.l $34(a1),a1
- cmp.w #0,a1
- bne.b L147
- L146
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L147
- ; if (t->MinFilter!=GL_NEAREST && t->MinFilter!=GL_LINEAR)
- move.l $2C(a0),d0
- cmp.l #$2600,d0
- beq L220
- L148
- move.l $2C(a0),d0
- cmp.l #$2601,d0
- beq L220
- L149
- ; for (i=1;
- moveq #1,d0
- bra.b L158
- L150
- ; if (t->Image[i])
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),d1
- beq.b L157
- L151
- ; if (!t->Image[i]->Data)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $34(a1),a1
- cmp.w #0,a1
- bne.b L153
- L152
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L153
- ; if (t->Image[i]->Format != t->Image[0]->Format)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l (a1),d2
- lea $38(a0),a1
- move.l (a1),a1
- move.l (a1),d1
- cmp.l d1,d2
- beq.b L155
- L154
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L155
- ; if (t->Image[i]->Border != t->Image[0]->Border)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $8(a1),d2
- lea $38(a0),a1
- move.l (a1),a1
- move.l $8(a1),d1
- cmp.l d1,d2
- beq.b L157
- L156
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L157
- addq.l #1,d0
- L158
- cmp.l #$B,d0
- blt L150
- L159
- ; return;
- ; if (t->Dimensions==1)
- move.l $8(a0),d0
- cmp.l #1,d0
- bne L178
- L160
- ; GLuint width = t->Image[0]->Width2;
- lea $38(a0),a1
- move.l (a1),a1
- move.l $18(a1),d1
- ; for (i=1;
- moveq #1,d0
- bra L176
- L161
- ; if (width>1)
- cmp.l #1,d1
- bls.b L163
- L162
- ; width /= 2;
- moveq #1,d2
- lsr.l d2,d1
- L163
- ; if (!t->Image[i])
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- tst.l (a1)
- bne.b L165
- L164
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L165
- ; if (!t->Image[i]->Data)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $34(a1),a1
- cmp.w #0,a1
- bne.b L167
- L166
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L167
- ; if (t->Image[i]->Format != t->Image[0]->Format)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l (a1),d3
- lea $38(a0),a1
- move.l (a1),a1
- move.l (a1),d2
- cmp.l d2,d3
- beq.b L169
- L168
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L169
- ; if (t->Image[i]->Border != t->Image[0]->Border)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $8(a1),d3
- lea $38(a0),a1
- move.l (a1),a1
- move.l $8(a1),d2
- cmp.l d2,d3
- beq.b L171
- L170
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L171
- ; if (t->Image[i]->Width2 != width )
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $18(a1),d2
- cmp.l d1,d2
- beq.b L173
- L172
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L173
- ; if (width==1)
- cmp.l #1,d1
- bne.b L175
- L174
- movem.l (a7)+,d2-d4
- rts
- L175
- addq.l #1,d0
- L176
- cmp.l #$B,d0
- blt L161
- L177
- ; return;
- bra L220
- L178
- ; else if (t->Dimensions==2)
- move.l $8(a0),d0
- cmp.l #2,d0
- bne L196
- L179
- ; GLuint width = t->Image[0]->Width2;
- lea $38(a0),a1
- move.l (a1),a1
- move.l $18(a1),d2
- ; GLuint height = t->Image[0]->Height2;
- lea $38(a0),a1
- move.l (a1),a1
- move.l $1C(a1),d1
- ; for (i=1;
- moveq #1,d0
- bra L194
- L180
- ; if (width>1)
- cmp.l #1,d2
- bls.b L182
- L181
- ; width /= 2;
- moveq #1,d3
- lsr.l d3,d2
- L182
- ; if (height>1)
- cmp.l #1,d1
- bls.b L184
- L183
- ; height /= 2;
- moveq #1,d3
- lsr.l d3,d1
- L184
- ; if (!t->Image[i])
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- tst.l (a1)
- bne.b L186
- L185
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L186
- ; if (t->Image[i]->Width2 != width)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $18(a1),d3
- cmp.l d2,d3
- beq.b L188
- L187
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L188
- ; if (t->Image[i]->Height2 != height)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $1C(a1),d3
- cmp.l d1,d3
- beq.b L190
- L189
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L190
- ; if (width==1 && height==1)
- cmp.l #1,d2
- bne.b L193
- L191
- cmp.l #1,d1
- bne.b L193
- L192
- movem.l (a7)+,d2-d4
- rts
- L193
- addq.l #1,d0
- L194
- cmp.l #$B,d0
- blt L180
- L195
- ; return;
- bra L220
- L196
- ; else if (t->Dimensions==3)
- move.l $8(a0),d0
- cmp.l #3,d0
- bne L219
- L197
- ; GLuint width = t->Image[0]->Width2;
- lea $38(a0),a1
- move.l (a1),a1
- move.l $18(a1),d3
- ; GLuint height = t->Image[0]->Height2;
- lea $38(a0),a1
- move.l (a1),a1
- move.l $1C(a1),d2
- ; GLuint depth = t->Image[0]->Depth2;
- lea $38(a0),a1
- move.l (a1),a1
- move.l $20(a1),d1
- ; for (i=1;
- moveq #1,d0
- bra L217
- L198
- ; if (width>1)
- cmp.l #1,d3
- bls.b L200
- L199
- ; width /= 2;
- moveq #1,d4
- lsr.l d4,d3
- L200
- ; if (height>1)
- cmp.l #1,d2
- bls.b L202
- L201
- ; height /= 2;
- moveq #1,d4
- lsr.l d4,d2
- L202
- ; if (depth>1)
- cmp.l #1,d1
- bls.b L204
- L203
- ; depth /= 2;
- moveq #1,d4
- lsr.l d4,d1
- L204
- ; if (!t->Image[i])
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- tst.l (a1)
- bne.b L206
- L205
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L206
- ; if (t->Image[i]->Width2 != width)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $18(a1),d4
- cmp.l d3,d4
- beq.b L208
- L207
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L208
- ; if (t->Image[i]->Height2 != height)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $1C(a1),d4
- cmp.l d2,d4
- beq.b L210
- L209
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L210
- ; if (t->Image[i]->Depth2 != depth)
- lea $38(a0),a1
- lea 0(a1,d0.l*4),a1
- move.l (a1),a1
- move.l $20(a1),d4
- cmp.l d1,d4
- beq.b L212
- L211
- ; t->Complete = GL_FALSE;
- clr.b $476(a0)
- movem.l (a7)+,d2-d4
- rts
- L212
- ; if (width==1 && height==1 && depth==1)
- cmp.l #1,d3
- bne.b L216
- L213
- cmp.l #1,d2
- bne.b L216
- L214
- cmp.l #1,d1
- bne.b L216
- L215
- movem.l (a7)+,d2-d4
- rts
- L216
- addq.l #1,d0
- L217
- cmp.l #$B,d0
- blt L198
- L218
- ; return;
- bra.b L220
- L219
- ; gl_problem(NULL, "Bug in gl_test_texture_object_completeness\n");
- move.l #L143,-(a7)
- clr.l -(a7)
- jsr _gl_problem
- addq.w #$8,a7
- L220
- movem.l (a7)+,d2-d4
- rts
-
- L143
- dc.b 'Bug in gl_test_texture_object_completeness',$A,0
-
- SECTION "_gl_GenTextures:0",CODE
-
-
- ;void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName )
- XDEF _gl_GenTextures
- _gl_GenTextures
- movem.l d2-d4/a2,-(a7)
- movem.l $18(a7),d3/a2
- move.l $14(a7),a0
- L222
- ; if (INSIDE_BEGIN_END(ctx))
- move.l a0,a1
- add.l #$E08A,a1
- move.l (a1),d0
- cmp.l #$1A00,d0
- beq.b L224
- L223
- ; gl_error( ctx, GL_INVALID_OPERATION, "glGenTextures" );
- move.l #L221,-(a7)
- pea $502.w
- move.l a0,-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2-d4/a2
- rts
- L224
- ; if (n<0)
- tst.l d3
- bpl.b L226
- L225
- ; gl_error( ctx, GL_INVALID_VALUE, "glGenTextures" );
- move.l #L221,-(a7)
- pea $501.w
- move.l a0,-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2-d4/a2
- rts
- L226
- ; first = HashFindFreeKeyBlock(ctx->Shared->TexObjects, n);
- move.l d3,-(a7)
- move.l (a0),a0
- move.l $8(a0),a0
- move.l a0,-(a7)
- jsr _HashFindFreeKeyBlock
- addq.w #$8,a7
- ; for (i=0;
- moveq #0,d2
- bra.b L228
- L227
- ; texName[i] = first + i;
- move.l d0,d1
- add.l d2,d1
- lea 0(a2,d2.l*4),a0
- move.l d1,(a0)
- addq.l #1,d2
- L228
- cmp.l d3,d2
- blo.b L227
- L229
- movem.l (a7)+,d2-d4/a2
- rts
-
- L221
- dc.b 'glGenTextures',0
-
- SECTION "_gl_DeleteTextures:0",CODE
-
-
- ;void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *tex
- XDEF _gl_DeleteTextures
- _gl_DeleteTextures
- L249 EQU -$C
- link a5,#L249
- movem.l d2/d3/a2,-(a7)
- move.l $C(a5),d3
- move.l $8(a5),a2
- L231
- ; if (INSIDE_BEGIN_END(ctx))
- move.l a2,a0
- add.l #$E08A,a0
- move.l (a0),d0
- cmp.l #$1A00,d0
- beq.b L233
- L232
- ; gl_error( ctx, GL_INVALID_OPERATION, "glAreTexturesResid
- move.l #L230,-(a7)
- pea $502.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2/d3/a2
- unlk a5
- rts
- L233
- ; for (i=0;
- moveq #0,d2
- bra L247
- L234
- ; if (texName[i]>0)
- move.l $10(a5),a1
- lea 0(a1,d2.l*4),a0
- move.l (a0),d0
- beq L246
- L235
- ; t = (struct gl_texture_object *)
- move.l $10(a5),a1
- lea 0(a1,d2.l*4),a0
- move.l (a0),d0
- move.l d0,-(a7)
- move.l (a2),a0
- move.l $8(a0),a0
- move.l a0,-(a7)
- jsr _HashLookup
- addq.w #$8,a7
- move.l d0,-$8(a5)
- ; if (t)
- tst.l -$8(a5)
- beq L246
- L236
- ; if (ctx->Texture.Current1D==t)
- move.l a2,a0
- add.l #$D73C,a0
- lea (a0),a0
- move.l $AC(a0),a0
- cmp.l -$8(a5),a0
- bne.b L238
- L237
- ; ctx->Texture.Current1D = ctx->Shared->Default1D;
- move.l (a2),a0
- move.l $10(a0),a0
- move.l a2,a1
- add.l #$D7E8,a1
- move.l a0,(a1)
- ; t->RefCount--;
- move.l -$8(a5),a0
- move.l (a0),d0
- subq.l #1,d0
- move.l -$8(a5),a0
- move.l d0,(a0)
- bra.b L242
- L238
- ; else if (ctx->Texture.Current2D==t)
- move.l a2,a0
- add.l #$D73C,a0
- lea (a0),a0
- move.l $B0(a0),a0
- cmp.l -$8(a5),a0
- bne.b L240
- L239
- ; ctx->Texture.Current2D = ctx->Shared->Default2D;
- move.l (a2),a0
- move.l $14(a0),a0
- move.l a2,a1
- add.l #$D7EC,a1
- move.l a0,(a1)
- ; t->RefCount--;
- move.l -$8(a5),a0
- move.l (a0),d0
- subq.l #1,d0
- move.l -$8(a5),a0
- move.l d0,(a0)
- bra.b L242
- L240
- ; else if (ctx->Texture.Current3D==t)
- move.l a2,a0
- add.l #$D73C,a0
- lea (a0),a0
- move.l $B4(a0),a0
- cmp.l -$8(a5),a0
- bne.b L242
- L241
- ; ctx->Texture.Current3D = ctx->Shared->Default3D;
- move.l (a2),a0
- move.l $18(a0),a0
- move.l a2,a1
- add.l #$D7F0,a1
- move.l a0,(a1)
- ; t->RefCount--;
- move.l -$8(a5),a0
- move.l (a0),d0
- subq.l #1,d0
- move.l -$8(a5),a0
- move.l d0,(a0)
- L242
- ; if (ctx->Driver.DeleteTexture)
- lea $8A0(a2),a0
- move.l $C8(a0),a0
- cmp.w #0,a0
- beq.b L244
- L243
- ; (*ctx->Driver.DeleteTexture)( ctx, t );
- move.l -$8(a5),-(a7)
- move.l a2,-(a7)
- lea $8A0(a2),a0
- move.l $C8(a0),a0
- jsr (a0)
- addq.w #$8,a7
- L244
- ; if (t->RefCount==0)
- move.l -$8(a5),a0
- move.l (a0),d0
- bne.b L246
- L245
- ; gl_free_texture_object(ctx->Shared, t);
- move.l -$8(a5),-(a7)
- move.l (a2),a0
- move.l a0,-(a7)
- jsr _gl_free_texture_object
- addq.w #$8,a7
- L246
- addq.l #1,d2
- L247
- cmp.l d3,d2
- blo L234
- L248
- movem.l (a7)+,d2/d3/a2
- unlk a5
- rts
-
- L230
- dc.b 'glAreTexturesResident',0
-
- SECTION "_gl_BindTexture:0",CODE
-
-
- ;void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName )
- XDEF _gl_BindTexture
- _gl_BindTexture
- L290 EQU -$40
- link a5,#L290
- movem.l d2-d4/a2/a3,-(a7)
- move.l $10(a5),d3
- move.l $C(a5),d4
- move.l $8(a5),a2
- L254
- ; if (INSIDE_BEGIN_END(ctx))
- move.l a2,a0
- add.l #$E08A,a0
- move.l (a0),d0
- cmp.l #$1A00,d0
- beq.b L256
- L255
- ; gl_error( ctx, GL_INVALID_OPERATION, "glAreTexturesResid
- move.l #L250,-(a7)
- pea $502.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2-d4/a2/a3
- unlk a5
- rts
- L256
- ; switch (target)
- move.l d4,d0
- cmp.l #$DE1,d0
- beq.b L258
- bgt.b L291
- cmp.l #$DE0,d0
- beq.b L257
- bra.b L260
- L291
- cmp.l #$806F,d0
- beq.b L259
- bra.b L260
- ;
- L257
- ; oldTexObj = ctx->Texture.Current1D;
- move.l a2,a0
- add.l #$D73C,a0
- lea (a0),a0
- move.l $AC(a0),-4(a5)
- ; targetPointer = &ctx->Texture.Current1D;
- move.l #$D7E8,d0
- add.l a2,d0
- move.l d0,-$C(a5)
- ; targetDimensions = 1;
- moveq #1,d2
- ;
- bra.b L261
- L258
- ; oldTexObj = ctx->Texture.Current2D;
- move.l a2,a0
- add.l #$D73C,a0
- lea (a0),a0
- move.l $B0(a0),-4(a5)
- ; targetPointer = &ctx->Texture.Current2D;
- move.l #$D7EC,d0
- add.l a2,d0
- move.l d0,-$C(a5)
- ; targetDimensions = 2;
- moveq #2,d2
- ;
- bra.b L261
- L259
- ; oldTexObj = ctx->Texture.Current3D;
- move.l a2,a0
- add.l #$D73C,a0
- lea (a0),a0
- move.l $B4(a0),-4(a5)
- ; targetPointer = &ctx->Texture.Current3D;
- move.l #$D7F0,d0
- add.l a2,d0
- move.l d0,-$C(a5)
- ; targetDimensions = 3;
- moveq #3,d2
- ;
- bra.b L261
- L260
- ; gl_error( ctx, GL_INVALID_ENUM, "glBindTexture" );
- move.l #L251,-(a7)
- pea $500.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2-d4/a2/a3
- unlk a5
- rts
- L261
- ; return;
- ; if (texName==0)
- tst.l d3
- bne.b L268
- L262
- ; switch (target)
- move.l d4,d0
- cmp.l #$DE1,d0
- beq.b L264
- bgt.b L292
- cmp.l #$DE0,d0
- beq.b L263
- bra.b L266
- L292
- cmp.l #$806F,d0
- beq.b L265
- bra.b L266
- ;
- L263
- ; newTexObj = ctx->Shared->Default1D;
- move.l (a2),a0
- move.l $10(a0),a0
- ;
- bra.b L267
- L264
- ; newTexObj = ctx->Shared->Default2D;
- move.l (a2),a0
- move.l $14(a0),a0
- ;
- bra.b L267
- L265
- ; newTexObj = ctx->Shared->Default3D;
- move.l (a2),a0
- move.l $18(a0),a0
- ;
- bra.b L267
- L266
- ; gl_problem(ctx, "Bad target in gl_BindTexture");
- move.l #L252,-(a7)
- move.l a2,-(a7)
- jsr _gl_problem
- addq.w #$8,a7
- movem.l (a7)+,d2-d4/a2/a3
- unlk a5
- rts
- L267
- ; return;
- bra.b L273
- L268
- ; newTexObj = (struct gl_texture_object *)
- move.l d3,-(a7)
- move.l (a2),a0
- move.l $8(a0),a0
- move.l a0,-(a7)
- jsr _HashLookup
- addq.w #$8,a7
- move.l d0,a0
- ; if (newTexObj)
- cmp.w #0,a0
- beq.b L272
- L269
- ; if (newTexObj->Dimensions!=targetDimensions)
- move.l $8(a0),d0
- cmp.l d2,d0
- beq.b L271
- L270
- ; gl_error( ctx, GL_INVALID_OPERATION, "glBindTextureEXT" );
- move.l #L253,-(a7)
- pea $502.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2-d4/a2/a3
- unlk a5
- rts
- L271
- ; return;
- bra.b L273
- L272
- ; newTexObj = gl_alloc_texture_object(ctx->Shared, texName,
- move.l d2,-(a7)
- move.l d3,-(a7)
- move.l (a2),a0
- move.l a0,-(a7)
- jsr _gl_alloc_texture_object
- add.w #$C,a7
- move.l d0,a0
- L273
- ; *targetPointer = newTexObj;
- move.l -$C(a5),a1
- move.l a0,(a1)
- ; if (*targetPointer != oldTexObj && oldTexObj->Name>0)
- move.l -$C(a5),a3
- move.l (a3),a1
- cmp.l -4(a5),a1
- beq.b L276
- L274
- move.l -4(a5),a1
- move.l 4(a1),d0
- beq.b L276
- L275
- ; oldTexObj->RefCount--;
- move.l -4(a5),a1
- move.l (a1),d0
- subq.l #1,d0
- move.l -4(a5),a1
- move.l d0,(a1)
- L276
- ; if (newTexObj->Name>0)
- move.l 4(a0),d0
- beq.b L278
- L277
- ; newTexObj->RefCount++;
- move.l (a0),d0
- addq.l #1,d0
- move.l d0,(a0)
- L278
- ; if ( oldTexObj->WrapS != newTexObj->WrapS
- move.l -4(a5),a1
- move.l $20(a1),d1
- move.l $20(a0),d0
- cmp.l d0,d1
- bne.b L284
- L279
- move.l -4(a5),a1
- move.l $24(a1),d1
- move.l $24(a0),d0
- cmp.l d0,d1
- bne.b L284
- L280
- move.l -4(a5),a1
- move.l $28(a1),d1
- move.l $28(a0),d0
- cmp.l d0,d1
- bne.b L284
- L281
- move.l -4(a5),a1
- move.l $2C(a1),d1
- move.l $2C(a0),d0
- cmp.l d0,d1
- bne.b L284
- L282
- move.l -4(a5),a1
- move.l $30(a1),d1
- move.l $30(a0),d0
- cmp.l d0,d1
- bne.b L284
- L283
- move.b $476(a0),d0
- bne.b L285
- L284
- ; ctx->NewState |= NEW_RASTER_OPS;
- move.l a2,a1
- add.l #$E082,a1
- move.l (a1),d0
- or.l #2,d0
- move.l a2,a1
- add.l #$E082,a1
- move.l d0,(a1)
- L285
- ; if (oldTexObj==ctx->Texture.Current)
- move.l a2,a1
- add.l #$D73C,a1
- lea (a1),a1
- move.l $B8(a1),a1
- move.l -4(a5),a3
- cmp.l a1,a3
- bne.b L287
- L286
- ; ctx->Texture.Current = newTexObj;
- move.l a2,a1
- add.l #$D7F4,a1
- move.l a0,(a1)
- L287
- ; if (ctx->Driver.BindTexture)
- lea $8A0(a2),a1
- move.l $C4(a1),a1
- cmp.w #0,a1
- beq.b L289
- L288
- ; (*ctx->Driver.BindTexture)( ctx, target, newTexObj );
- move.l a0,-(a7)
- move.l d4,-(a7)
- move.l a2,-(a7)
- lea $8A0(a2),a0
- move.l $C4(a0),a0
- jsr (a0)
- add.w #$C,a7
- L289
- movem.l (a7)+,d2-d4/a2/a3
- unlk a5
- rts
-
- L252
- dc.b 'Bad target in gl_BindTexture',0
- L250
- dc.b 'glAreTexturesResident',0
- L251
- dc.b 'glBindTexture',0
- L253
- dc.b 'glBindTextureEXT',0
-
- SECTION "_gl_PrioritizeTextures:0",CODE
-
-
- ;void gl_PrioritizeTextures( GLcontext *ctx,
- XDEF _gl_PrioritizeTextures
- _gl_PrioritizeTextures
- L312 EQU -$10
- link a5,#L312
- movem.l d2/d3/a2,-(a7)
- move.l $C(a5),d3
- move.l $14(a5),a2
- L295
- ; if (INSIDE_BEGIN_END(ctx))
- move.l $8(a5),a0
- add.l #$E08A,a0
- move.l (a0),d0
- cmp.l #$1A00,d0
- beq.b L297
- L296
- ; gl_error( ctx, GL_INVALID_OPERATION, "glAreTexturesResid
- move.l #L293,-(a7)
- pea $502.w
- move.l $8(a5),-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2/d3/a2
- unlk a5
- rts
- L297
- ; if (n<0)
- tst.l d3
- bpl.b L299
- L298
- ; gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(
- move.l #L294,-(a7)
- pea $501.w
- move.l $8(a5),-(a7)
- jsr _gl_error
- add.w #$C,a7
- movem.l (a7)+,d2/d3/a2
- unlk a5
- rts
- L299
- ; for (i=0;
- moveq #0,d2
- bra L310
- L300
- ; if (texName[i]>0)
- move.l $10(a5),a1
- lea 0(a1,d2.l*4),a0
- move.l (a0),d0
- beq.b L309
- L301
- ; t = (struct gl_texture_object *)
- move.l $10(a5),a1
- lea 0(a1,d2.l*4),a0
- move.l (a0),d0
- move.l d0,-(a7)
- move.l $8(a5),a1
- move.l (a1),a0
- move.l $8(a0),a0
- move.l a0,-(a7)
- jsr _HashLookup
- addq.w #$8,a7
- move.l d0,a0
- ; if (t)
- cmp.w #0,a0
- beq.b L309
- L302
- ; t->Priority = CLAMP( priorities[i], 0.0F, 1.0F );
- lea 0(a2,d2.l*4),a1
- fmove.s (a1),fp0
- fcmp.s #$.00000000,fp0
- fboge.b L304
- L303
- fmove.s #$.00000000,fp0
- bra.b L308
- L304
- lea 0(a2,d2.l*4),a1
- fmove.s (a1),fp0
- fcmp.s #$.3F800000,fp0
- fbole.b L306
- L305
- fmove.s #$.3F800000,fp0
- bra.b L307
- L306
- lea 0(a2,d2.l*4),a1
- fmove.s (a1),fp0
- L307
- L308
- fmove.s fp0,$C(a0)
- L309
- addq.l #1,d2
- L310
- cmp.l d3,d2
- blo L300
- L311
- movem.l (a7)+,d2/d3/a2
- unlk a5
- rts
-
- L293
- dc.b 'glAreTexturesResident',0
- L294
- dc.b 'glAreTexturesResident(n)',0
-
- SECTION "_gl_AreTexturesResident:0",CODE
-
-
- ;GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n,
- XDEF _gl_AreTexturesResident
- _gl_AreTexturesResident
- L329 EQU -$A
- link a5,#L329
- movem.l d2-d4/a2,-(a7)
- move.l $C(a5),d3
- move.l $8(a5),a2
- L316
- ; GLboolean resident = GL_TRUE;
- moveq #1,d4
- ; if (INSIDE_BEGIN_END(ctx))
- move.l a2,a0
- add.l #$E08A,a0
- move.l (a0),d0
- cmp.l #$1A00,d0
- beq.b L318
- L317
- ; gl_error( ctx, GL_INVALID_OPERATION, "glAreTexturesResid
- move.l #L313,-(a7)
- pea $502.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- moveq #0,d0
- movem.l (a7)+,d2-d4/a2
- unlk a5
- rts
- L318
- ; if (n<0)
- tst.l d3
- bpl.b L320
- L319
- ; gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(
- move.l #L314,-(a7)
- pea $501.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- moveq #0,d0
- movem.l (a7)+,d2-d4/a2
- unlk a5
- rts
- L320
- ; for (i=0;
- moveq #0,d2
- bra L327
- L321
- ; if (texName[i]==0)
- move.l $10(a5),a1
- lea 0(a1,d2.l*4),a0
- move.l (a0),d0
- bne.b L323
- L322
- ; gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)
- move.l #L315,-(a7)
- pea $501.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- moveq #0,d0
- movem.l (a7)+,d2-d4/a2
- unlk a5
- rts
- L323
- ; t = (struct gl_texture_object *)
- move.l $10(a5),a1
- lea 0(a1,d2.l*4),a0
- move.l (a0),d0
- move.l d0,-(a7)
- move.l (a2),a0
- move.l $8(a0),a0
- move.l a0,-(a7)
- jsr _HashLookup
- addq.w #$8,a7
- move.l d0,a0
- ; if (t)
- cmp.w #0,a0
- beq.b L325
- L324
- ; residences[i] = GL_TRUE;
- move.l $14(a5),a1
- lea 0(a1,d2.l),a0
- move.b #1,(a0)
- bra.b L326
- L325
- ; gl_error( ctx, GL_INVALID_VALUE, "glAreTexturesResident(textures)
- move.l #L315,-(a7)
- pea $501.w
- move.l a2,-(a7)
- jsr _gl_error
- add.w #$C,a7
- moveq #0,d0
- movem.l (a7)+,d2-d4/a2
- unlk a5
- rts
- L326
- addq.l #1,d2
- L327
- cmp.l d3,d2
- blo L321
- L328
- ; return
- move.b d4,d0
- movem.l (a7)+,d2-d4/a2
- unlk a5
- rts
-
- L313
- dc.b 'glAreTexturesResident',0
- L314
- dc.b 'glAreTexturesResident(n)',0
- L315
- dc.b 'glAreTexturesResident(textures)',0
-
- SECTION "_gl_IsTexture:0",CODE
-
-
- ;GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture )
- XDEF _gl_IsTexture
- _gl_IsTexture
- move.l $8(a7),d0
- move.l 4(a7),a0
- L331
- ; if (INSIDE_BEGIN_END(ctx))
- move.l a0,a1
- add.l #$E08A,a1
- move.l (a1),d1
- cmp.l #$1A00,d1
- beq.b L333
- L332
- ; gl_error( ctx, GL_INVALID_OPERATION, "glIsTextures" );
- move.l #L330,-(a7)
- pea $502.w
- move.l a0,-(a7)
- jsr _gl_error
- add.w #$C,a7
- moveq #0,d0
- rts
- L333
- ; if (texture>0 && HashLookup(ctx->Shared->TexObjects, texture))
- tst.l d0
- beq.b L336
- L334
- move.l d0,-(a7)
- move.l (a0),a0
- move.l $8(a0),a0
- move.l a0,-(a7)
- jsr _HashLookup
- addq.w #$8,a7
- tst.l d0
- beq.b L336
- L335
- moveq #1,d0
- rts
- L336
- moveq #0,d0
- rts
-
- L330
- dc.b 'glIsTextures',0
-
- END
-