Subversion Repositories Kolibri OS

Rev

Rev 6108 | Rev 8063 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6108 Rev 6523
Line 26... Line 26...
26
;output:
26
;output:
27
; eax = context.shared_state.lists[list]
27
; eax = context.shared_state.lists[list]
28
align 4
28
align 4
29
proc find_list uses ebx, context:dword, list:dword
29
proc find_list uses ebx, context:dword, list:dword
30
	mov eax,[context]
30
	mov eax,[context]
31
	mov eax,[eax+offs_cont_shared_state]
31
	mov eax,[eax+GLContext.shared_state]
32
	mov ebx,[list]
32
	mov ebx,[list]
33
	shl ebx,2
33
	shl ebx,2
34
	add eax,ebx
34
	add eax,ebx
35
	mov eax,[eax]
35
	mov eax,[eax]
36
	ret
36
	ret
Line 55... Line 55...
55
	.end_w:
55
	.end_w:
Line 56... Line 56...
56
 
56
 
57
	stdcall gl_free,edx
57
	stdcall gl_free,edx
58
	mov ecx,[list]
58
	mov ecx,[list]
59
	shl ecx,2
59
	shl ecx,2
60
	mov ebx,[ebx+offs_cont_shared_state] ;ebx = &context.shared_state.lists
60
	mov ebx,[ebx+GLContext.shared_state] ;ebx = &context.shared_state.lists
61
	add ebx,ecx
61
	add ebx,ecx
62
	mov dword[ebx],0 ;=NULL
62
	mov dword[ebx],0 ;=NULL
63
	ret
63
	ret
Line 73... Line 73...
73
	mov dword[eax],ecx ;l.first_op_buffer=ob
73
	mov dword[eax],ecx ;l.first_op_buffer=ob
Line 74... Line 74...
74
 
74
 
Line 75... Line 75...
75
	mov dword[ecx+offs_gpbu_ops],OP_EndList ;ob.ops[0].op=OP_EndList
75
	mov dword[ecx+offs_gpbu_ops],OP_EndList ;ob.ops[0].op=OP_EndList
76
 
76
 
77
	mov ebx,[context]
77
	mov ebx,[context]
78
	mov ebx,[ebx+offs_cont_shared_state]
78
	mov ebx,[ebx+GLContext.shared_state]
79
	mov ecx,[list]
79
	mov ecx,[list]
80
	shl ecx,2
80
	shl ecx,2
81
	add ebx,ecx
81
	add ebx,ecx
Line 120... Line 120...
120
	mov ecx,[p]
120
	mov ecx,[p]
121
	mov ecx,[ecx]
121
	mov ecx,[ecx]
122
	shl ecx,2
122
	shl ecx,2
123
	add ecx,ebx
123
	add ecx,ebx
124
	mov ecx,[ecx] ;ecx = кол-во параметров в компилируемой функции
124
	mov ecx,[ecx] ;ecx = кол-во параметров в компилируемой функции
125
	mov ebx,[edx+offs_cont_current_op_buffer_index]
125
	mov ebx,[edx+GLContext.current_op_buffer_index]
126
	mov eax,[edx+offs_cont_current_op_buffer]
126
	mov eax,[edx+GLContext.current_op_buffer]
Line 127... Line 127...
127
 
127
 
128
	; we should be able to add a NextBuffer opcode
128
	; we should be able to add a NextBuffer opcode
129
	mov esi,ebx
129
	mov esi,ebx
130
	add esi,ecx
130
	add esi,ecx
Line 139... Line 139...
139
		shl esi,2
139
		shl esi,2
140
		add esi,edi
140
		add esi,edi
141
		mov dword[esi+offs_gpbu_ops],OP_NextBuffer
141
		mov dword[esi+offs_gpbu_ops],OP_NextBuffer
142
		mov dword[esi+offs_gpbu_ops+4],eax
142
		mov dword[esi+offs_gpbu_ops+4],eax
Line 143... Line 143...
143
 
143
 
144
		mov dword[edx+offs_cont_current_op_buffer],eax
144
		mov dword[edx+GLContext.current_op_buffer],eax
145
		xor ebx,ebx
145
		xor ebx,ebx
Line 146... Line 146...
146
	@@:
146
	@@:
147
 
147
 
Line 151... Line 151...
151
		shl edi,2
151
		shl edi,2
152
		add edi,eax
152
		add edi,eax
153
		movsd
153
		movsd
154
		inc ebx
154
		inc ebx
155
	loop @b
155
	loop @b
156
	mov dword[edx+offs_cont_current_op_buffer_index],ebx
156
	mov dword[edx+GLContext.current_op_buffer_index],ebx
157
popad
157
popad
158
	ret
158
	ret
159
endp
159
endp
Line 160... Line 160...
160
 
160
 
Line 219... Line 219...
219
pop esi edi
219
pop esi edi
220
end if
220
end if
221
	call gl_get_context
221
	call gl_get_context
222
	mov ebx,[p]
222
	mov ebx,[p]
Line 223... Line 223...
223
 
223
 
224
	cmp dword[eax+offs_cont_exec_flag],0
224
	cmp dword[eax+GLContext.exec_flag],0
225
	je @f
225
	je @f
226
		push ebx
226
		push ebx
227
		push eax
227
		push eax
228
		mov ecx,dword[ebx] ;ecx = OP_...
228
		mov ecx,dword[ebx] ;ecx = OP_...
229
		shl ecx,2
229
		shl ecx,2
230
		lea ebx,[op_table_func]
230
		lea ebx,[op_table_func]
231
		add ecx,ebx
231
		add ecx,ebx
232
		call dword[ecx] ;op_table_func[op](c,p)
232
		call dword[ecx] ;op_table_func[op](c,p)
233
	@@:
233
	@@:
234
	call gl_get_context
234
	call gl_get_context
235
	cmp dword[eax+offs_cont_compile_flag],0
235
	cmp dword[eax+GLContext.compile_flag],0
236
	je @f
236
	je @f
237
		stdcall gl_compile_op,eax,[p]
237
		stdcall gl_compile_op,eax,[p]
238
	@@:
238
	@@:
239
	cmp dword[eax+offs_cont_print_flag],0
239
	cmp dword[eax+GLContext.print_flag],0
240
	je @f
240
	je @f
241
		;gl_print_op(stderr,p);
241
		;gl_print_op(stderr,p);
242
	@@:
242
	@@:
243
	ret
243
	ret
Line 310... Line 310...
310
		stdcall delete_list,ebx,[list]
310
		stdcall delete_list,ebx,[list]
311
	@@:
311
	@@:
312
	stdcall alloc_list,ebx,[list]
312
	stdcall alloc_list,ebx,[list]
Line 313... Line 313...
313
 
313
 
314
	mov eax,[eax] ;eax = GLList.first_op_buffer
314
	mov eax,[eax] ;eax = GLList.first_op_buffer
315
	mov [ebx+offs_cont_current_op_buffer],eax
315
	mov [ebx+GLContext.current_op_buffer],eax
Line 316... Line 316...
316
	mov dword[ebx+offs_cont_current_op_buffer_index],0
316
	mov dword[ebx+GLContext.current_op_buffer_index],0
317
 
317
 
318
	mov dword[ebx+offs_cont_compile_flag],1
318
	mov dword[ebx+GLContext.compile_flag],1
319
	xor eax,eax
319
	xor eax,eax
320
	cmp dword[mode],GL_COMPILE_AND_EXECUTE
320
	cmp dword[mode],GL_COMPILE_AND_EXECUTE
321
	jne @f
321
	jne @f
322
		inc eax ;eax = (mode == GL_COMPILE_AND_EXECUTE)
322
		inc eax ;eax = (mode == GL_COMPILE_AND_EXECUTE)
323
	@@:
323
	@@:
324
	mov [ebx+offs_cont_exec_flag],eax
324
	mov [ebx+GLContext.exec_flag],eax
Line 325... Line 325...
325
	ret
325
	ret
326
endp
326
endp
Line 338... Line 338...
338
	mov dword[p],OP_EndList
338
	mov dword[p],OP_EndList
339
	mov ebx,ebp
339
	mov ebx,ebp
340
	sub ebx,4 ;=sizeof(dd)
340
	sub ebx,4 ;=sizeof(dd)
341
	stdcall gl_compile_op,eax,ebx
341
	stdcall gl_compile_op,eax,ebx
Line 342... Line 342...
342
 
342
 
343
	mov dword[eax+offs_cont_compile_flag],0
343
	mov dword[eax+GLContext.compile_flag],0
344
	mov dword[eax+offs_cont_exec_flag],1
344
	mov dword[eax+GLContext.exec_flag],1
345
	ret
345
	ret
Line 346... Line 346...
346
endp
346
endp
347
 
347
 
Line 361... Line 361...
361
align 4
361
align 4
362
proc glGenLists uses ebx ecx edx edi esi, range:dword
362
proc glGenLists uses ebx ecx edx edi esi, range:dword
363
	call gl_get_context
363
	call gl_get_context
364
	mov edi,eax
364
	mov edi,eax
Line 365... Line 365...
365
 
365
 
366
	mov ebx,[eax+offs_cont_shared_state] ;ebx=context.shared_state.lists
366
	mov ebx,[eax+GLContext.shared_state] ;ebx=context.shared_state.lists
367
	xor edx,edx ;count=0
367
	xor edx,edx ;count=0
368
	mov ecx,MAX_DISPLAY_LISTS
368
	mov ecx,MAX_DISPLAY_LISTS
369
	xor esi,esi
369
	xor esi,esi
370
	.cycle_0: ;for(esi=0;esi
370
	.cycle_0: ;for(esi=0;esi