Subversion Repositories Kolibri OS

Rev

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

Rev 5213 Rev 5218
Line 30... Line 30...
30
if TGL_FEATURE_RENDER_BITS eq 15
30
if TGL_FEATURE_RENDER_BITS eq 15
Line 31... Line 31...
31
 
31
 
32
;#define RGB_TO_PIXEL(r,g,b) \
32
;#define RGB_TO_PIXEL(r,g,b) \
33
;  ((((r) >> 1) & 0x7c00) | (((g) >> 6) & 0x03e0) | ((b) >> 11))
33
;  ((((r) >> 1) & 0x7c00) | (((g) >> 6) & 0x03e0) | ((b) >> 11))
34
;typedef unsigned short PIXEL;
34
;typedef unsigned short PIXEL;
35
;/* bytes per pixel */
35
; bytes per pixel
36
;PSZB equ 2
36
;PSZB equ 2
37
;/* bits per pixel = (1 << PSZH) */
37
; bits per pixel = (1 << PSZH)
Line 38... Line 38...
38
;PSZSH equ 4
38
;PSZSH equ 4
Line 39... Line 39...
39
 
39
 
40
else if TGL_FEATURE_RENDER_BITS eq 16
40
else if TGL_FEATURE_RENDER_BITS eq 16
41
 
41
 
42
;/* 16 bit mode */
42
; 16 bit mode
43
;#define RGB_TO_PIXEL(r,g,b) \
43
;#define RGB_TO_PIXEL(r,g,b) \
44
;  (((r) & 0xF800) | (((g) >> 5) & 0x07E0) | ((b) >> 11))
44
;  (((r) & 0xF800) | (((g) >> 5) & 0x07E0) | ((b) >> 11))
Line 140... Line 140...
140
;
140
;
Line 141... Line 141...
141
 
141
 
Line 142... Line 142...
142
; modify these functions so that they suit your needs
142
; modify these functions so that they suit your needs
143
 
143
 
144
align 4
144
align 4
145
proc gl_free uses ebx ecx, mptr:dword
145
proc gl_free uses eax ebx ecx, mptr:dword
146
	mov ecx,[mptr]
146
	mov ecx,[mptr]
147
	or ecx,ecx
-
 
148
	jz @f
147
	or ecx,ecx
-
 
148
	jz @f
149
    @@:
149
		mcall 68, 13
150
	mcall 68, 13
150
	@@:
Line 151... Line 151...
151
	ret
151
	ret
152
endp
152
endp
Line 163... Line 163...
163
; выделение очищеной памяти
163
; выделение очищеной памяти
164
align 4
164
align 4
165
proc gl_zalloc uses ebx ecx edi, size:dword
165
proc gl_zalloc uses ebx ecx edi, size:dword
166
	mov ecx,[size]
166
	mov ecx,[size]
167
	stdcall gl_malloc,ecx
167
	stdcall gl_malloc,ecx
168
	cmp eax,0
168
	or eax,eax
169
	je @f
169
	jz @f
170
		mov ebx,eax
170
		mov ebx,eax
171
		mov edi,eax
171
		mov edi,eax
172
		xor eax,eax
172
		xor eax,eax
173
		shr ecx,2
173
		shr ecx,2
174
		rep stosd ;очистка памяти (пишем везде 0)
174
		rep stosd ;очистка памяти (пишем везде 0)