tinygl: add some double functions, add bcc32 example

libimg: small optimize

git-svn-id: svn://kolibrios.org@8408 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA
2020-12-14 16:48:32 +00:00
parent eac740c648
commit 9a54fc6aed
24 changed files with 1438 additions and 468 deletions

View File

@@ -10,12 +10,40 @@ glVertex4f: ;x, y, z, w
pop eax
ret 20 ;=sizeof(dd)*5
align 4
proc glVertex4d, x:qword, y:qword, z:qword, w:qword
add esp,-16
fld qword[w]
fstp dword[esp+12]
fld qword[z]
fstp dword[esp+8]
fld qword[y]
fstp dword[esp+4]
fld qword[x]
fstp dword[esp]
call glVertex4f
ret
endp
align 4
proc glVertex2f, x:dword, y:dword
stdcall glVertex4f,[x],[y],0.0,1.0
ret
endp
align 4
proc glVertex2d, x:qword, y:qword
push 1.0
push 0.0
add esp,-8
fld qword[y]
fstp dword[esp+4]
fld qword[x]
fstp dword[esp]
call glVertex4f
ret
endp
align 4
proc glVertex2fv uses eax, v:dword
mov eax,[v]
@@ -23,12 +51,40 @@ proc glVertex2fv uses eax, v:dword
ret
endp
align 4
proc glVertex2dv uses eax, v:dword
mov eax,[v]
push 1.0
push 0.0
add esp,-8
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glVertex4f
ret
endp
align 4
proc glVertex3f, x:dword, y:dword, z:dword
stdcall glVertex4f,[x],[y],[z],1.0
ret
endp
align 4
proc glVertex3d, x:qword, y:qword, z:qword
push 1.0
add esp,-12
fld qword[z]
fstp dword[esp+8]
fld qword[y]
fstp dword[esp+4]
fld qword[x]
fstp dword[esp]
call glVertex4f
ret
endp
align 4
proc glVertex3fv uses eax, v:dword
mov eax,[v]
@@ -36,6 +92,21 @@ proc glVertex3fv uses eax, v:dword
ret
endp
align 4
proc glVertex3dv uses eax, v:dword
mov eax,[v]
push 1.0
add esp,-12
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glVertex4f
ret
endp
align 4
proc glVertex4fv uses eax, v:dword
mov eax,[v]
@@ -43,6 +114,22 @@ proc glVertex4fv uses eax, v:dword
ret
endp
align 4
proc glVertex4dv uses eax, v:dword
mov eax,[v]
add esp,-16
fld qword[eax+24]
fstp dword[esp+12]
fld qword[eax+16]
fstp dword[esp+8]
fld qword[eax+8]
fstp dword[esp+4]
fld qword[eax]
fstp dword[esp]
call glVertex4f
ret
endp
; glNormal
align 4

View File

@@ -6,7 +6,7 @@ use32
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
include 'fps.inc'
@@ -18,8 +18,7 @@ macro matr_cell c_funct,c_param,funct,param, dia
dia dword[esp-4*(c_param*(c_funct-funct)+(1+c_param-param))]
}
;Так как некоторые извращенческие функции OpenGL воспринимают только параметры
;типа double (8 байт) то придется пихать их в стек макросом glpush
;Макрос для параметров типа double (8 байт)
macro glpush GLDoubleVar {
push dword[GLDoubleVar+4]
push dword[GLDoubleVar]
@@ -27,8 +26,7 @@ macro glpush GLDoubleVar {
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -903,7 +901,7 @@ endp
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -920,11 +918,6 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
head_f_i:
head_f_l db '"System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
;--------------------------------------------------
align 16
@@ -932,10 +925,8 @@ i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
procinfo process_information
cur_dir_path rb 4096
library_path rb 4096
rb 4096
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -6,7 +6,7 @@ use32
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@@ -14,8 +14,7 @@ include '../opengl_const.inc'
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_lib_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -154,21 +153,14 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
head_f_i:
head_f_l db '"System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
;--------------------------------------------------
align 16
i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
ctx1 rb 28 ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 1024
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -6,7 +6,7 @@ use32
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@@ -14,8 +14,7 @@ include '../opengl_const.inc'
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_lib_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -154,21 +153,14 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
head_f_i:
head_f_l db '"System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
;--------------------------------------------------
align 16
i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
ctx1 rb 28 ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 1024
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -6,7 +6,7 @@ use32
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@@ -14,8 +14,7 @@ include '../opengl_const.inc'
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_lib_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -163,21 +162,14 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
head_f_i:
head_f_l db '"System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
;--------------------------------------------------
align 16
i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
ctx1 rb 28 ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 1024
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -6,7 +6,7 @@ use32
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@@ -14,8 +14,7 @@ include '../opengl_const.inc'
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_lib_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -155,21 +154,14 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
head_f_i:
head_f_l db '"System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
;--------------------------------------------------
align 16
i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
ctx1 rb 28 ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 1024
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -1,28 +1,24 @@
use32
org 0x0
org 0
db 'MENUET01'
dd 0x1
dd start
dd i_end
dd mem,stacktop
dd 0,cur_dir_path
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../../programs/proc32.inc'
include '../../../../../../programs/macros.inc'
include '../../../../../../programs/develop/libraries/box_lib/load_lib.mac'
include '../../../../../../programs/dll.inc'
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@use_library
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_tinygl
cmp eax,-1
jz button.exit
mcall 40,0x27
mcall SF_SET_EVENTS_MASK,0x27
stdcall [kosglMakeCurrent], 10,10,400,350,ctx1
stdcall [glEnable], GL_DEPTH_TEST
@@ -37,7 +33,7 @@ red_win:
align 4
still:
mcall 10
mcall SF_WAIT_EVENT
cmp al,1
jz red_win
cmp al,2
@@ -49,19 +45,18 @@ still:
align 4
draw_window:
pushad
mcall 12,1
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx,0x33ffffff ;0x73ffffff
mcall 0,(50 shl 16)+430,(30 shl 16)+400,,,caption
stdcall [kosglSwapBuffers]
mcall SF_CREATE_WINDOW,(50 shl 16)+430,(30 shl 16)+400,0x33ffffff,,caption
call [kosglSwapBuffers]
mcall 12,2
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
align 4
key:
mcall 2
mcall SF_GET_KEY
cmp ah,27 ;Esc
je button.exit
@@ -72,7 +67,7 @@ key:
fadd dword[delt_sc]
fstp dword[scale]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,45 ;-
jne @f
@@ -80,7 +75,7 @@ key:
fsub dword[delt_sc]
fstp dword[scale]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,178 ;Up
jne @f
@@ -88,7 +83,7 @@ key:
fadd dword[delt_size]
fstp dword[angle_y]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,177 ;Down
jne @f
@@ -96,7 +91,7 @@ key:
fsub dword[delt_size]
fstp dword[angle_y]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,176 ;Left
jne @f
@@ -104,7 +99,7 @@ key:
fadd dword[delt_size]
fstp dword[angle_z]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,179 ;Right
jne @f
@@ -112,30 +107,27 @@ key:
fsub dword[delt_size]
fstp dword[angle_z]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
jmp still
align 4
button:
mcall 17
mcall SF_GET_BUTTON
cmp ah,1
jne still
.exit:
mcall -1
mcall SF_TERMINATE_PROCESS
align 4
caption db 'Test opengl 1.1 arrays, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
align 4
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
align 4
draw_3d:
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
stdcall [glPushMatrix]
call [glPushMatrix]
;масштаб и повороты
stdcall [glTranslatef], 0.0,0.0,0.5
@@ -152,7 +144,7 @@ stdcall [glPushMatrix]
stdcall [glDisableClientState], GL_COLOR_ARRAY ;отключаем режим рисования цветов
stdcall [glDisableClientState], GL_VERTEX_ARRAY ;отключаем режим рисования вершин
stdcall [glPopMatrix]
call [glPopMatrix]
ret
align 4
@@ -168,7 +160,7 @@ Colors dd 0.0, 0.5, 1.0, 1.0, 0.0, 0.5, 1.0, 1.0, 1.0, 0.5, 1.0, 0.0 ;4 цвет
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -185,17 +177,13 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
err_message_found_lib db 'Sorry I cannot load library tinygl.obj',0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library tinygl.obj',0
;--------------------------------------------------
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 4096
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -1,12 +1,12 @@
use32
org 0x0
org 0
db 'MENUET01'
dd 1,start,i_end,mem,stacktop,0,cur_dir_path
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@@ -14,8 +14,7 @@ include '../opengl_const.inc'
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -62,9 +61,8 @@ draw_window:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx,0x33ffffff
mcall SF_CREATE_WINDOW,(50 shl 16)+430,(30 shl 16)+400,,,caption
stdcall [kosglSwapBuffers]
mcall SF_CREATE_WINDOW,(50 shl 16)+430,(30 shl 16)+400,0x33ffffff,,caption
call [kosglSwapBuffers]
mcall SF_REDRAW,SSF_END_DRAW
popad
@@ -83,7 +81,7 @@ key:
fadd dword[delt_sc]
fstp dword[scale]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,45 ;-
jne @f
@@ -91,7 +89,7 @@ key:
fsub dword[delt_sc]
fstp dword[scale]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,178 ;Up
jne @f
@@ -99,7 +97,7 @@ key:
fadd dword[delt_size]
fstp dword[angle_y]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,177 ;Down
jne @f
@@ -107,7 +105,7 @@ key:
fsub dword[delt_size]
fstp dword[angle_y]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,176 ;Left
jne @f
@@ -115,7 +113,7 @@ key:
fadd dword[delt_size]
fstp dword[angle_x]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
cmp ah,179 ;Right
jne @f
@@ -123,7 +121,7 @@ key:
fsub dword[delt_size]
fstp dword[angle_x]
call draw_3d
stdcall [kosglSwapBuffers]
call [kosglSwapBuffers]
@@:
jmp still
@@ -139,14 +137,11 @@ button:
align 4
caption db 'Test opengl 1.1 arrays, [Esc] - exit, [<-],[->],[Up],[Down] - rotate',0
align 4
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
align 4
draw_3d:
stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;очистим буфер цвета и глубины
stdcall [glPushMatrix]
call [glPushMatrix]
;масштаб и повороты
stdcall [glTranslatef], 0.0,0.0,0.5
@@ -155,7 +150,7 @@ stdcall [glPushMatrix]
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
;рисование через тндексный массив
;рисование через индексный массив
mov eax,house_3ds ;начало внедренного файла 3ds
add eax,0xeb ;смещение по которому идут координаты вершин (получено с использованием программы info_3ds)
stdcall [glVertexPointer], 3, GL_FLOAT, 0, eax ;задаем массив для вершин, 3 - число координат для одной вершины
@@ -163,7 +158,7 @@ stdcall [glPushMatrix]
stdcall [glDrawElements], GL_TRIANGLES, 0x1a6*3, GL_UNSIGNED_SHORT, Indices ;mode, count, type, *indices
stdcall [glDisableClientState], GL_VERTEX_ARRAY ;отключаем режим рисования вершин
stdcall [glPopMatrix]
call [glPopMatrix]
ret
align 4
@@ -199,17 +194,13 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,0
head_f_i:
head_f_l db 'System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,0
;--------------------------------------------------
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 4096
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -6,7 +6,7 @@ use32
include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../develop/libraries/box_lib/load_lib.mac'
include '../../../../../load_lib.mac'
include '../../../../../dll.inc'
include '../opengl_const.inc'
@@ -14,8 +14,7 @@ include '../opengl_const.inc'
align 4
start:
load_library name_tgl, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, import_lib_tinygl, err_message_import, head_f_i
load_library name_tgl, library_path, system_path, import_tinygl
cmp eax,SF_TERMINATE_PROCESS
jz button.exit
@@ -23,7 +22,7 @@ start:
stdcall [kosglMakeCurrent], 10,10,300,225,ctx1
stdcall [glEnable], GL_DEPTH_TEST
stdcall [gluNewQuadric]
call [gluNewQuadric]
mov [qObj],eax
stdcall [glClearColor], 0.5,0.5,0.5,0.0
@@ -170,7 +169,7 @@ delt_size dd 3.0
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -187,21 +186,13 @@ include '../export.inc'
;--------------------------------------------------
system_path db '/sys/lib/'
name_tgl db 'tinygl.obj',0
head_f_i:
head_f_l db '"System error',0
err_message_import db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_message_found_lib db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
;--------------------------------------------------
align 16
i_end:
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
ctx1 rb 28 ;sizeof.TinyGLContext = 28
cur_dir_path rb 4096
library_path rb 4096
rb 2048
stacktop:
cur_dir_path:
rb 4096
library_path:
rb 4096
mem:

View File

@@ -7,14 +7,13 @@ include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_img.inc'
include '../../../../../load_lib.mac'
include '../opengl_const.inc'
include '../zbuffer.inc'
include '../../../../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
align 4
image_data_toolbar dd 0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
;Макрос для параметров типа double (8 байт)
@@ -366,7 +365,7 @@ lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового ос
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -490,14 +489,6 @@ system_dir_1 db '/sys/lib/'
lib_name_1 db 'buf2d.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'libimg.obj',0
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
head_f_i:
head_f_l db '"System error',0
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
;--------------------------------------------------
txt_scale:
@@ -535,23 +526,21 @@ buf_1:
align 4
l_libs_start:
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
l_libs_end:
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
image_data_toolbar dd 0
qObj dd 0
run_file_70 FileInfoBlock
sc system_colors
align 16
cur_dir_path rb 4096
file_name rb 4096
rb 4096
stacktop:
cur_dir_path rb 4096
file_name rb 4096
mem:

View File

@@ -7,14 +7,13 @@ include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_img.inc'
include '../../../../../load_lib.mac'
include '../opengl_const.inc'
include '../zbuffer.inc'
include '../../../../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
align 4
image_data_toolbar dd 0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
;Макрос для параметров типа double (8 байт)
@@ -357,7 +356,7 @@ lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового ос
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -481,14 +480,6 @@ system_dir_1 db '/sys/lib/'
lib_name_1 db 'buf2d.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'libimg.obj',0
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
head_f_i:
head_f_l db '"System error',0
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
;--------------------------------------------------
txt_scale:
@@ -526,23 +517,21 @@ buf_1:
align 4
l_libs_start:
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
l_libs_end:
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
image_data_toolbar dd 0
qObj dd 0
run_file_70 FileInfoBlock
sc system_colors
align 16
cur_dir_path rb 4096
file_name rb 4096
rb 4096
stacktop:
cur_dir_path rb 4096
file_name rb 4096
mem:

View File

@@ -7,11 +7,12 @@ include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_img.inc'
include '../../../../../load_lib.mac'
include '../opengl_const.inc'
include '../zbuffer.inc'
include '../../../../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
;Макрос для параметров типа double (8 байт)
macro glpush GLDoubleVar {
@@ -19,8 +20,6 @@ macro glpush GLDoubleVar {
push dword[GLDoubleVar]
}
align 4
image_data_toolbar dd 0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
align 4
@@ -407,7 +406,7 @@ lmodel_ambient dd 0.2, 0.2, 0.2, 1.0 ; Параметры фонового ос
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -531,14 +530,6 @@ system_dir_1 db '/sys/lib/'
lib_name_1 db 'buf2d.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'libimg.obj',0
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
head_f_i:
head_f_l db '"System error',0
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
;--------------------------------------------------
txt_scale:
@@ -576,17 +567,15 @@ buf_1:
align 4
l_libs_start:
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
l_libs_end:
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
image_data_toolbar dd 0
dr_figure dd 0
qObj dd 0
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
@@ -596,8 +585,8 @@ i_end:
run_file_70 FileInfoBlock
sc system_colors
align 16
cur_dir_path rb 4096
file_name rb 4096
rb 4096
stacktop:
cur_dir_path rb 4096
file_name rb 4096
mem:

View File

@@ -7,11 +7,12 @@ include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_img.inc'
include '../../../../../load_lib.mac'
include '../opengl_const.inc'
include '../zbuffer.inc'
include '../../../../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
;Макрос для параметров типа double (8 байт)
macro glpush GLDoubleVar {
@@ -19,8 +20,6 @@ macro glpush GLDoubleVar {
push dword[GLDoubleVar]
}
align 4
image_data_toolbar dd 0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
align 4
@@ -337,7 +336,7 @@ delt_size dd 3.0
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -461,14 +460,6 @@ system_dir_1 db '/sys/lib/'
lib_name_1 db 'buf2d.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'libimg.obj',0
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
head_f_i:
head_f_l db '"System error',0
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
;--------------------------------------------------
txt_scale:
@@ -512,17 +503,15 @@ buf_1:
align 4
l_libs_start:
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
l_libs_end:
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
image_data_toolbar dd 0
dr_figure dd 0
qObj dd 0
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
@@ -532,8 +521,8 @@ i_end:
run_file_70 FileInfoBlock
sc system_colors
align 16
cur_dir_path rb 4096
file_name rb 4096
rb 4096
stacktop:
cur_dir_path rb 4096
file_name rb 4096
mem:

View File

@@ -7,11 +7,12 @@ include '../../../../../proc32.inc'
include '../../../../../macros.inc'
include '../../../../../KOSfuncs.inc'
include '../../../../../load_img.inc'
include '../../../../../load_lib.mac'
include '../opengl_const.inc'
include '../zbuffer.inc'
include '../../../../../develop/info3ds/info_fun_float.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
;Макрос для параметров типа double (8 байт)
macro glpush GLDoubleVar {
@@ -19,8 +20,6 @@ macro glpush GLDoubleVar {
push dword[GLDoubleVar]
}
align 4
image_data_toolbar dd 0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
align 4
@@ -294,7 +293,7 @@ delt_size dd 3.0
;--------------------------------------------------
align 4
import_lib_tinygl:
import_tinygl:
macro E_LIB n
{
@@ -418,14 +417,6 @@ system_dir_1 db '/sys/lib/'
lib_name_1 db 'buf2d.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'libimg.obj',0
err_msg_found_lib_0 db 'Sorry I cannot load library ',39,'tinygl.obj',39,'" -tE',0
err_msg_found_lib_1 db 'Sorry I cannot load library ',39,'buf2d.obj',39,'" -tE',0
err_msg_found_lib_2 db 'Sorry I cannot load library ',39,'libimg.obj',39,'" -tE',0
head_f_i:
head_f_l db '"System error',0
err_msg_import_0 db 'Error on load import library ',39,'tinygl.obj',39,'" -tE',0
err_msg_import_1 db 'Error on load import library ',39,'buf2d.obj',39,'" -tE',0
err_msg_import_2 db 'Error on load import library ',39,'libimg.obj',39,'" -tE',0
;--------------------------------------------------
txt_scale:
@@ -469,17 +460,15 @@ buf_1:
align 4
l_libs_start:
lib_0 l_libs lib_name_0, cur_dir_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, import_lib_tinygl,err_msg_import_0,head_f_i
lib_1 l_libs lib_name_1, cur_dir_path, file_name, system_dir_1,\
err_msg_found_lib_1, head_f_l, import_buf2d, err_msg_import_1,head_f_i
lib_2 l_libs lib_name_2, cur_dir_path, file_name, system_dir_2,\
err_msg_found_lib_2, head_f_l, import_libimg, err_msg_import_2, head_f_i
lib_0 l_libs lib_name_0, file_name, system_dir_0, import_tinygl
lib_1 l_libs lib_name_1, file_name, system_dir_1, import_buf2d
lib_2 l_libs lib_name_2, file_name, system_dir_2, import_libimg
l_libs_end:
align 4
i_end:
ctx1 rb 28 ;sizeof.TinyGLContext = 28
image_data_toolbar dd 0
qObj dd 0
TexObj dd 0 ;массив указателей на текстуры (в данном случае 1 шт.)
texture dd 0 ;указатель на память с текстурой
@@ -488,8 +477,8 @@ i_end:
run_file_70 FileInfoBlock
sc system_colors
align 16
cur_dir_path rb 4096
file_name rb 4096
rb 4096
stacktop:
cur_dir_path rb 4096
file_name rb 4096
mem:

View File

@@ -5,7 +5,7 @@
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> (1-17)
NumberSymbolsAD DW 5
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (10 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> N)
MConst DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
MConst: DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
DQ 1.0E6,1.0E7,1.0E8,1.0E9,1.0E10
DQ 1.0E11,1.0E12,1.0E13,1.0E14,1.0E15
DQ 1.0E16,1.0E17,1.0E18,1.0E19,1.0E20
@@ -31,6 +31,7 @@ MConst DQ 1.0E1,1.0E2,1.0E3,1.0E4,1.0E5
DQ 1.0E116,1.0E117,1.0E118,1.0E119,1.0E120
DQ 1.0E121,1.0E122,1.0E123,1.0E124,1.0E125
DQ 1.0E126,1.0E127,1.0E128
.end:
; <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Data_Double DQ ?
; <EFBFBD><EFBFBD> <EFBFBD> BCD-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
@@ -39,9 +40,10 @@ Data_BCD DT ?
Data_Flag DB ?
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD> <EFBFBD><EFBFBD> 0 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥫쭮<EFBFBD> <EFBFBD><EFBFBD>)
Data_Sign DB ?
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - 0 <EFBFBD><EFBFBD><EFBFBD> ..e+.. <EFBFBD> 1 <EFBFBD><EFBFBD><EFBFBD> ..e-..
Data_Sign_Exp DB ?
db 0 ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ASCII
Data_String DB 32 DUP (?)
@@ -59,10 +61,11 @@ Data_String DB 32 DUP (?)
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
;* Data_String - <EFBFBD><EFBFBD><EFBFBD>-<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
;*******************************************************
align 4
DoubleFloat_to_String:
pushad
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> Data_String
lea EDI, [Data_String]
mov EDI, Data_String
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> NumberSymbolsAD
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
@@ -74,9 +77,7 @@ DoubleFloat_to_String:
je .NoShifts ;<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jl .Error ;<EFBFBD><EFBFBD><EFBFBD>
dec BX
shl BX, 3 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 8
lea eax,[MConst]
add EBX, eax
lea ebx,[MConst+8*ebx]
fmul qword [EBX] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.NoShifts:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD
@@ -130,8 +131,8 @@ DoubleFloat_to_String:
stosb
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>
lea EDI, [Data_String]
lea ESI, [Data_String]
mov EDI, Data_String
mov ESI, Data_String
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>, <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cmp byte [ESI],'-'
jne .N2
@@ -151,10 +152,11 @@ DoubleFloat_to_String:
; <EFBFBD><EFBFBD><EFBFBD> - <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jmp .Error
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
align 4
.N4: rep movsb
jmp .End
; <EFBFBD><EFBFBD><EFBFBD>
align 4
.Error:
mov AL,'E'
stosb
@@ -166,12 +168,14 @@ DoubleFloat_to_String:
stosb
jmp .End
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
align 4
.Overflow:
mov AL,'#'
stosb
xor AL,AL
stosb
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
align 4
.End:
popad
ret
@@ -184,6 +188,7 @@ DoubleFloat_to_String:
;* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: *
;* Data_Double - <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. *
;****************************************************
align 4
String_to_DoubleFloat:
pushad
cld
@@ -193,110 +198,200 @@ String_to_DoubleFloat:
mov word [Data_BCD+8],0
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov [Data_Sign],0
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> SI <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
lea ESI, [Data_String]
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> esi <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
mov esi, Data_String
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
mov ecx,64 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.ShiftIgnore:
lodsb
cmp AL,' '
jne .ShiftIgnoreEnd
loop .ShiftIgnore
jmp .Error
cmp al,' '
jne .ShiftIgnoreEnd
loop .ShiftIgnore
jmp .Error
align 4
.ShiftIgnoreEnd:
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
cmp AL,'-'
cmp al,'-'
jne .Positive
mov [Data_Sign],80h
lodsb
.Positive:
mov [Data_Flag],0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
mov DX,0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
xor edx,edx ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
mov ecx,18 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
align 4
.ASCIItoBCDConversion:
cmp AL,'.' ;<EFBFBD><EFBFBD>?
cmp al,'.' ;<EFBFBD><EFBFBD>?
jne .NotDot
cmp [Data_Flag],0 ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
jne .Error
jne .Error ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>
mov [Data_Flag],1
lodsb
cmp AL,0 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>?
jne .NotDot
or al,al ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>?
jnz .NotDot
jmp .ASCIItoBCDConversionEnd
align 4
.NotDot:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>,
; <EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cmp [Data_Flag],0
jnz .Figures
inc DX
inc edx
.Figures:
cmp al,'e'
je .exp_form
cmp al,'E'
jne @f
.exp_form:
call string_ExpForm ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ..e..
or al,al
jnz .Error
jmp .ASCIItoBCDConversionEnd
@@:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cmp AL,'0'
cmp al,'0'
jb .Error
cmp AL,'9'
cmp al,'9'
ja .Error
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD
and AL,0Fh
or byte [Data_BCD],AL
and al,15 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0-9 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>
or byte [Data_BCD],al
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
cmp byte [ESI],0
cmp byte [esi],0
je .ASCIItoBCDConversionEnd
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD <EFBFBD><EFBFBD> 4 <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
; (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
mov AX,word [Data_BCD+6]
shld word [Data_BCD+8],AX,4
mov ax,word [Data_BCD+6]
shld word [Data_BCD+8],ax,4
; (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
mov EAX, dword [Data_BCD]
shld dword [Data_BCD+4],EAX,4
mov eax,dword [Data_BCD]
shld dword [Data_BCD+4],eax,4
; (<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> 4 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
shl dword [Data_BCD],4
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD> AL
lodsb
loop .ASCIItoBCDConversion
loop .ASCIItoBCDConversion ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> dec ecx, jnz ...
; <EFBFBD> 19-<EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 0 <EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>,
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cmp AL,'.'
cmp al,'.'
jne .NotDot2
inc ecx
inc ecx ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
lodsb
.NotDot2:
cmp AL,0
jne .Error ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
or al,al ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>?
jz .ASCIItoBCDConversionEnd
align 4
.Error: ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fldz ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fstp [Data_Double]
jmp .End
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> BCD <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.ASCIItoBCDConversionEnd:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov AL,[Data_Sign]
mov byte [Data_BCD+9],AL
mov al,[Data_Sign]
mov byte [Data_BCD+9],al
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fninit
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> BCD-<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fbld [Data_BCD]
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov EBX,18+1
sub BX,CX
sub BX,DX
cmp EBX,0
je .NoDiv
dec EBX
shl EBX,3 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> 8
lea eax,[MConst]
add EBX,eax
fdiv qword [EBX] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.NoDiv:; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fstp [Data_Double]
jmp .End
.Error:; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fldz ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fstp [Data_Double]
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
lea ebx,[ecx+edx-18]
cmp ebx,0
jle .NoMul ;<EFBFBD> <EFBFBD><EFBFBD> e-..
dec ebx
jz .NoDiv ;<EFBFBD> <EFBFBD><EFBFBD> e+0
dec ebx
lea ebx,[MConst+8*ebx]
cmp ebx,MConst.end
jl @f
ffree st0
fincstp
jmp .Error ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> e+**
@@:
fmul qword [ebx] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> e+..)
jmp .NoDiv
.NoMul:
neg ebx
lea ebx,[MConst+8*ebx]
cmp ebx,MConst.end
jl @f
ffree st0
fincstp
jmp .Error ;<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> e-**
@@:
fdiv qword [ebx] ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.NoDiv: ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
fstp [Data_Double]
.End:
popad
ret
;output:
; eax - 1 if error
; edx += size
align 4
proc str_cat, str1:dword, str2:dword
push eax ecx edi esi
proc string_ExpForm uses ebx
mov [Data_Sign_Exp],0
xor eax,eax
lodsb
cmp al,'+'
jne @f
lodsb
@@:
cmp al,'-'
jne @f
inc [Data_Sign_Exp]
lodsb
@@:
xor ebx,ebx
.cycle0:
cmp al,0
je .cycle0end
cmp al,9
je .cycle0end
cmp al,10
je .cycle0end
cmp al,13
je .cycle0end
cmp al,' '
je .cycle0end
cmp al,'0'
jb .Error
cmp al,'9'
ja .Error
imul ebx,10
and eax,15 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0-9 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD>
add ebx,eax
lodsb
jmp .cycle0
.cycle0end:
cmp ebx,328 ;308 - <EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> double + 20 - <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD> BCD
ja .Error
cmp [Data_Sign_Exp],0
je @f
neg ebx
@@:
cmp [Data_Flag],0 ;<EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>?
jne @f
dec edx
@@:
add edx,ebx
xor eax,eax
jmp @f
.Error:
xor eax,eax
inc eax
@@:
ret
endp
align 4
proc str_cat uses eax ecx edi esi, str1:dword, str2:dword
mov esi,dword[str2]
stdcall str_len,esi
mov ecx,eax
@@ -306,7 +401,6 @@ proc str_cat, str1:dword, str2:dword
add edi,eax
cld
repne movsb
pop esi edi ecx eax
ret
endp
@@ -323,4 +417,34 @@ proc str_len, str1:dword
@@:
sub eax,[str1]
ret
endp
align 4
proc String_crop_0 uses eax ebx ecx edi
mov edi,Data_String
mov al,'.'
mov ecx,32
repne scasb
mov ebx,edi
mov edi,Data_String
xor al,al
mov ecx,32
repne scasb
cmp ebx,edi
jg .end_f
dec edi
.cycle0:
dec edi
cmp edi,Data_String
jle .end_f
cmp byte[edi],'0'
jne .cycle0end
mov byte[edi],0
jmp .cycle0
.cycle0end:
cmp byte[edi],'.'
jne .end_f
mov byte[edi],0
.end_f:
ret
endp

View File

@@ -105,12 +105,6 @@ align 4
end if
; ***
glVertex2d: ;(double ,double)
glVertex2dv: ;(double *)
glVertex3d: ;(double ,double ,double)
glVertex3dv: ;(double *)
glVertex4d: ;(double ,double ,double, double )
glVertex4dv: ;(double *)
glColor3d: ;(double ,double ,double)
glColor3dv: ;(double *)
glColor4d: ;(double ,double ,double, double )

View File

@@ -48,8 +48,8 @@ proc png_set_sig_bytes uses eax edi, png_ptr:dword, num_bytes:dword
png_debug 1, 'in png_set_sig_bytes'
mov edi,[png_ptr]
cmp edi,0
je .end_f ;if (..==0) return
or edi,edi
jz .end_f ;if (..==0) return
mov eax,[num_bytes]
cmp eax,0
@@ -101,13 +101,10 @@ endp
align 4
proc png_zalloc uses edx ecx, png_ptr:dword, items:dword, size:dword
cmp dword[png_ptr],0
jne @f
xor eax,eax
jmp .end_f ;if (..==0) return 0
@@:
xor eax,eax
cmp dword[png_ptr],eax
je .end_f ;if (..==0) return 0
not eax
xor edx,edx
mov ecx,[size]
@@ -161,8 +158,8 @@ locals
endl
mov edi,[png_ptr]
PNG_CHUNK_ANCILLARY [edi+png_struct.chunk_name]
cmp eax,0 ;if (..!=0)
je @f
or eax,eax ;if (..!=0)
jz @f
mov eax,[edi+png_struct.flags]
and eax,PNG_FLAG_CRC_ANCILLARY_MASK
cmp eax,PNG_FLAG_CRC_ANCILLARY_USE or PNG_FLAG_CRC_ANCILLARY_NOWARN
@@ -340,12 +337,12 @@ end if
; Call the general version checker (shared with read and write code):
stdcall png_user_version_check, ebx, [user_png_ver]
cmp eax,0
je .end0 ;if (..!=0)
or eax,eax
jz .end0 ;if (..!=0)
stdcall png_malloc_warn, ebx, sizeof.png_struct
;eax = png_ptr
cmp eax,0
je .end0 ;if (..!=0)
or eax,eax
jz .end0 ;if (..!=0)
; png_ptr->zstream holds a back-pointer to the png_struct, so
; this can only be done now:
@@ -379,34 +376,27 @@ endp
; Allocate the memory for an info_struct for the application.
;png_infop (png_structrp png_ptr)
align 4
proc png_create_info_struct uses ebx ecx edi, png_ptr:dword
proc png_create_info_struct uses ecx edi, png_ptr:dword
png_debug 1, 'in png_create_info_struct'
;ebx - info_ptr dd ? ;png_inforp
mov edi,[png_ptr]
cmp edi,0
jne @f ;if (..==0) return 0
xor eax,eax
jmp .end_f
@@:
mov eax,[png_ptr]
or eax,eax
jz .end_f ;if (..==0) return 0
; Use the internal API that does not (or at least should not) error out, so
; that this call always returns ok. The application typically sets up the
; error handling *after* creating the info_struct because this is the way it
; has always been done in 'example.asm'.
stdcall png_malloc_base, edi, sizeof.png_info_def
mov ebx,eax
cmp eax,0
je @f
stdcall png_malloc_base, eax, sizeof.png_info_def
or eax,eax
jz .end_f
push eax
mov edi,eax
xor eax,eax
mov ecx,sizeof.png_info_def
rep stosb ;memset(...
@@:
mov eax,ebx
pop eax
.end_f:
ret
endp
@@ -428,8 +418,8 @@ proc png_destroy_info_struct uses eax ebx ecx edi, png_ptr:dword, info_ptr_ptr:d
je .end_f ;if (..==0) return
mov edi,[info_ptr_ptr]
cmp edi,0 ;if (..!=0)
je .end_f
or edi,edi ;if (..!=0)
jz .end_f
; Do this first in case of an error below; if the app implements its own
; memory management this can lead to png_free calling png_error, which
; will abort this routine and return control to the app error handler.
@@ -490,11 +480,11 @@ proc png_data_freer uses edi esi, png_ptr:dword, info_ptr:dword, freer:dword, ma
png_debug 1, 'in png_data_freer'
mov edi,[png_ptr]
cmp edi,0
je .end_f
or edi,edi
jz .end_f
mov esi,[info_ptr]
cmp esi,0
je .end_f ;if (..==0 || ..==0) return
or esi,esi
jz .end_f ;if (..==0 || ..==0) return
; if (freer == PNG_DESTROY_WILL_FREE_DATA)
; info_ptr->free_me |= mask;
@@ -514,11 +504,11 @@ proc png_free_data uses eax edi esi, png_ptr:dword, info_ptr:dword, mask:dword,
png_debug 1, 'in png_free_data'
mov edi,[png_ptr]
cmp edi,0
je .end_f
or edi,edi
jz .end_f
mov esi,[info_ptr]
cmp esi,0
je .end_f ;if (..==0 || ..==0) return
or esi,esi
jz .end_f ;if (..==0 || ..==0) return
if PNG_TEXT_SUPPORTED eq 1
; Free text item num or (if num == -1) all text items
@@ -722,8 +712,8 @@ endp
align 4
proc png_get_io_ptr, png_ptr:dword
mov eax,[png_ptr]
cmp eax,0
je @f ;if (..==0) return 0
or eax,eax
jz @f ;if (..==0) return 0
mov eax,[eax+png_struct.io_ptr]
@@:
ret
@@ -742,8 +732,8 @@ proc png_init_io uses eax edi, png_ptr:dword, fp:dword
png_debug 1, 'in png_init_io'
mov edi,[png_ptr]
cmp edi,0
je @f ;if (..==0) return
or edi,edi
jz @f ;if (..==0) return
mov eax,[fp]
mov [edi+png_struct.io_ptr],eax
@@:
@@ -967,8 +957,8 @@ proc png_handle_as_unknown uses ecx edi esi, png_ptr:dword, chunk_name:dword
; bytep p, p_end;
mov edi,[png_ptr]
cmp edi,0
je .end0
or edi,edi
jz .end0
cmp dword[chunk_name],0
je .end0
cmp dword[edi+png_struct.num_chunk_list],0
@@ -1020,8 +1010,8 @@ endp
align 4
proc png_reset_zstream, png_ptr:dword
mov eax,[png_ptr]
cmp eax,0
jne @f ;if (..==0)
or eax,eax
jnz @f ;if (..==0)
mov eax,Z_STREAM_ERROR
jmp .end_f
@@:
@@ -1289,8 +1279,8 @@ endp
align 4
proc png_colorspace_sync uses ecx edi esi, png_ptr:dword, info_ptr:dword
mov edi,[info_ptr]
cmp edi,0
je @f ;if (..==0) ;reduce code size; check here not in the caller
or edi,edi
jz @f ;if (..==0) ;reduce code size; check here not in the caller
mov ecx,sizeof.png_colorspace
mov esi,[png_ptr]
add esi,png_struct.colorspace
@@ -1935,8 +1925,8 @@ locals
message rb 196 ;char[] ;see below for calculation
endl
mov eax,[colorspace]
cmp eax,0
je @f ;if (..!=0)
or eax,eax
jz @f ;if (..!=0)
or word[eax+png_colorspace.flags], PNG_COLORSPACE_INVALID
@@:
@@ -2857,8 +2847,8 @@ else
@@:
end if
cmp ebx,0
je @f
or ebx,ebx
jz @f
png_error edi, 'Invalid IHDR data'
@@:
ret
@@ -4432,8 +4422,8 @@ endp
align 4
proc png_set_option uses ecx, png_ptr:dword, option:dword, onoff:dword
mov eax,[png_ptr]
cmp eax,0
je @f
or eax,eax
jz @f
mov ecx,[option]
cmp ecx,0
jl @f
@@ -4695,8 +4685,8 @@ proc png_image_free uses eax ebx, image:dword
; png_safe_execute will call this API after the return.
mov ebx,[image]
cmp ebx,0
je @f
or ebx,ebx
jz @f
cmp dword[ebx+png_image.opaque],0
je @f
mov eax,[ebx+png_image.opaque]