From 9a54fc6aedb41d018da84a91f7bd8e3155f4ba3d Mon Sep 17 00:00:00 2001 From: IgorA Date: Mon, 14 Dec 2020 16:48:32 +0000 Subject: [PATCH] tinygl: add some double functions, add bcc32 example libimg: small optimize git-svn-id: svn://kolibrios.org@8408 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/bcc32/examples/tinygl_1/Makefile | 19 + programs/bcc32/examples/tinygl_1/tinygl_1.cpp | 92 ++ .../bcc32/examples/tinygl_1/tinygl_1_cpp.bat | 15 + programs/bcc32/include/l_tinygl.h | 804 ++++++++++++++++++ .../develop/libraries/TinyGL/asm_fork/api.asm | 87 ++ .../TinyGL/asm_fork/examples/gears.asm | 21 +- .../TinyGL/asm_fork/examples/test0.asm | 18 +- .../TinyGL/asm_fork/examples/test1.asm | 18 +- .../TinyGL/asm_fork/examples/test2.asm | 18 +- .../TinyGL/asm_fork/examples/test3.asm | 18 +- .../TinyGL/asm_fork/examples/test_array0.asm | 72 +- .../TinyGL/asm_fork/examples/test_array1.asm | 45 +- .../TinyGL/asm_fork/examples/test_glu0.asm | 23 +- .../TinyGL/asm_fork/examples/test_glu1.asm | 29 +- .../TinyGL/asm_fork/examples/test_glu2.asm | 29 +- .../TinyGL/asm_fork/examples/textures0.asm | 29 +- .../TinyGL/asm_fork/examples/textures1.asm | 29 +- .../TinyGL/asm_fork/examples/textures2.asm | 29 +- .../TinyGL/asm_fork/info_fun_float.inc | 244 ++++-- .../libraries/TinyGL/asm_fork/tinygl.asm | 6 - .../libs-dev/libimg/png/libpng/png.asm | 106 ++- programs/media/log_el/trunk/le_libs.inc | 2 +- programs/media/log_el/trunk/log_el.asm | 115 ++- programs/other/ha/HACONFIG.ASM | 38 +- 24 files changed, 1438 insertions(+), 468 deletions(-) create mode 100644 programs/bcc32/examples/tinygl_1/Makefile create mode 100644 programs/bcc32/examples/tinygl_1/tinygl_1.cpp create mode 100644 programs/bcc32/examples/tinygl_1/tinygl_1_cpp.bat create mode 100644 programs/bcc32/include/l_tinygl.h diff --git a/programs/bcc32/examples/tinygl_1/Makefile b/programs/bcc32/examples/tinygl_1/Makefile new file mode 100644 index 0000000000..8eecc4b303 --- /dev/null +++ b/programs/bcc32/examples/tinygl_1/Makefile @@ -0,0 +1,19 @@ +# Path to /programs +SVN_PROGR:=../../.. + +# Path to /programs/bcc32 +SVN_BCC32:=$(SVN_PROGR)/bcc32 + +# Path to t2fasm +T2FASM:=$(SVN_BCC32)/t2fasm + +# Path to include +INCLUDE:=$(SVN_BCC32)/include + +# Path to Bin folder +KOS32_BCC:=/home/autobuild/borlandcpp/bin + +# Filename without .cpp +FILENAME:=tinygl_1 + +include $(SVN_BCC32)/Makefile_app diff --git a/programs/bcc32/examples/tinygl_1/tinygl_1.cpp b/programs/bcc32/examples/tinygl_1/tinygl_1.cpp new file mode 100644 index 0000000000..9abf666a69 --- /dev/null +++ b/programs/bcc32/examples/tinygl_1/tinygl_1.cpp @@ -0,0 +1,92 @@ +#include +#include +#include +#include + +using namespace Kolibri; + +const char header[] = "Test tinygl library, [<-] and [->] - rotate"; +char library_path[2048]; + +namespace Kolibri{ + char CurrentDirectoryPath[2048]; +} + +TinyGLContext ctx1; +float angle_z = 0.0, delt_size = 3.0; + +void draw_3d() +{ + glClear(GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT); //очистим буфер цвета и глубины + + glPushMatrix(); + glRotatef(angle_z,0.0,0.0,1.0); + + glColor3f(1.0, 0.0, 0.0); + glBegin(GL_TRIANGLES); + glColor3f(0.0, 0.0, 1.0); + glVertex3f(0.0, 0.5, 0.1); + glVertex3f(0.475, 0.823, 0.1); + glVertex3f(0.433, 0.25, 0.1); + + glColor3f(0.0, 1.0, 0.0); + glVertex3f(0.5, 0.0, 0.1); + glVertex3f(0.823,-0.475, 0.1); + glVertex3f(0.25, -0.433, 0.1); + + glColor3f(1.0, 0.0, 0.0); + glVertex3f(0.0, -0.5, 0.1); + glVertex3f(-0.475,-0.823,0.1); + glVertex3f(-0.433,-0.25, 0.1); + + glVertex3f(-0.5, 0.0, 0.1); + glColor3f(1.0, 1.0, 0.0); + glVertex3f(-0.823, 0.475, 0.1); + glColor3f(1.0, 1.0, 1.0); + glVertex3f(-0.25, 0.433, 0.1); + glEnd(); + + glPopMatrix(); +} + +bool KolibriOnStart(TStartData &kos_start, TThreadData /*th*/) +{ + kos_start.Left = 10; + kos_start.Top = 40; + kos_start.Width = 330; + kos_start.Height = 275; + kos_start.WinData.WindowColor = 0xd0d0d0; + kos_start.WinData.WindowType = 0x33; // 0x34 - fixed, 0x33 - not fixed + kos_start.WinData.Title = header; + if(LoadLibrary("tinygl.obj", library_path, "/sys/lib/tinygl.obj", &import_tinygl)) + { + kosglMakeCurrent(0,0,kos_start.Width,kos_start.Height,&ctx1); + glEnable(GL_DEPTH_TEST); + glClearColor(0.2,0.0,0.2,0.0); + draw_3d(); + return true; + } + else return false; +} + +void KolibriOnPaint(void) +{ + kosglSwapBuffers(); +} + +void KolibriOnKeyPress(TThreadData /*th*/) +{ + long key = GetKey(); + switch(key){ + case 176: //Left + angle_z+=delt_size; + draw_3d(); + kosglSwapBuffers(); + break; + case 179: //Right + angle_z-=delt_size; + draw_3d(); + kosglSwapBuffers(); + //break; + }; +} diff --git a/programs/bcc32/examples/tinygl_1/tinygl_1_cpp.bat b/programs/bcc32/examples/tinygl_1/tinygl_1_cpp.bat new file mode 100644 index 0000000000..1679612a2d --- /dev/null +++ b/programs/bcc32/examples/tinygl_1/tinygl_1_cpp.bat @@ -0,0 +1,15 @@ +Set NAME=tinygl_1 +Set BCC_DIR=..\..\..\bcc32 +kos32-bcc -S -v- -R- -6 -a4 -O2 -Og -Oi -Ov -OS -k- -D__KOLIBRI__ -I..\..\..\bcc32\include %NAME%.cpp + +echo STACKSIZE equ 8192> kos_make.inc +echo include "%BCC_DIR%\include\kos_start.inc">> kos_make.inc +echo include "%BCC_DIR%\include\kos_func.inc">> kos_make.inc +echo include "%BCC_DIR%\include\kos_heap.inc">> kos_make.inc + +echo include "kos_make.inc" > f_%NAME%.asm +t2fasm < %NAME%.asm >> f_%NAME%.asm +fasm f_%NAME%.asm %NAME%.kex +if exist %NAME%.kex kpack %NAME%.kex +if exist %NAME%.kex del kos_make.inc +pause diff --git a/programs/bcc32/include/l_tinygl.h b/programs/bcc32/include/l_tinygl.h new file mode 100644 index 0000000000..8c37e86736 --- /dev/null +++ b/programs/bcc32/include/l_tinygl.h @@ -0,0 +1,804 @@ +#ifndef __L_TINYGL_H_INCLUDED_ +#define __L_TINYGL_H_INCLUDED_ +// +// tinygl.obj +// + +enum { + /* Boolean values */ + GL_FALSE = 0, + GL_TRUE = 1, + + /* Data types */ + GL_BYTE = 0x1400, + GL_UNSIGNED_BYTE = 0x1401, + GL_SHORT = 0x1402, + GL_UNSIGNED_SHORT = 0x1403, + GL_INT = 0x1404, + GL_UNSIGNED_INT = 0x1405, + GL_FLOAT = 0x1406, + GL_DOUBLE = 0x140A, + GL_2_BYTES = 0x1407, + GL_3_BYTES = 0x1408, + GL_4_BYTES = 0x1409, + + /* Primitives */ + GL_LINES = 0x0001, + GL_POINTS = 0x0000, + GL_LINE_STRIP = 0x0003, + GL_LINE_LOOP = 0x0002, + GL_TRIANGLES = 0x0004, + GL_TRIANGLE_STRIP = 0x0005, + GL_TRIANGLE_FAN = 0x0006, + GL_QUADS = 0x0007, + GL_QUAD_STRIP = 0x0008, + GL_POLYGON = 0x0009, + GL_EDGE_FLAG = 0x0B43, + + /* Vertex Arrays */ + GL_VERTEX_ARRAY = 0x8074, + GL_NORMAL_ARRAY = 0x8075, + GL_COLOR_ARRAY = 0x8076, + GL_INDEX_ARRAY = 0x8077, + GL_TEXTURE_COORD_ARRAY = 0x8078, + GL_EDGE_FLAG_ARRAY = 0x8079, + GL_VERTEX_ARRAY_SIZE = 0x807A, + GL_VERTEX_ARRAY_TYPE = 0x807B, + GL_VERTEX_ARRAY_STRIDE = 0x807C, + GL_VERTEX_ARRAY_COUNT = 0x807D, + GL_NORMAL_ARRAY_TYPE = 0x807E, + GL_NORMAL_ARRAY_STRIDE = 0x807F, + GL_NORMAL_ARRAY_COUNT = 0x8080, + GL_COLOR_ARRAY_SIZE = 0x8081, + GL_COLOR_ARRAY_TYPE = 0x8082, + GL_COLOR_ARRAY_STRIDE = 0x8083, + GL_COLOR_ARRAY_COUNT = 0x8084, + GL_INDEX_ARRAY_TYPE = 0x8085, + GL_INDEX_ARRAY_STRIDE = 0x8086, + GL_INDEX_ARRAY_COUNT = 0x8087, + GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088, + GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089, + GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A, + GL_TEXTURE_COORD_ARRAY_COUNT = 0x808B, + GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C, + GL_EDGE_FLAG_ARRAY_COUNT = 0x808D, + GL_VERTEX_ARRAY_POINTER = 0x808E, + GL_NORMAL_ARRAY_POINTER = 0x808F, + GL_COLOR_ARRAY_POINTER = 0x8090, + GL_INDEX_ARRAY_POINTER = 0x8091, + GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092, + GL_EDGE_FLAG_ARRAY_POINTER = 0x8093, + GL_V2F = 0x2A20, + GL_V3F = 0x2A21, + GL_C4UB_V2F = 0x2A22, + GL_C4UB_V3F = 0x2A23, + GL_C3F_V3F = 0x2A24, + GL_N3F_V3F = 0x2A25, + GL_C4F_N3F_V3F = 0x2A26, + GL_T2F_V3F = 0x2A27, + GL_T4F_V4F = 0x2A28, + GL_T2F_C4UB_V3F = 0x2A29, + GL_T2F_C3F_V3F = 0x2A2A, + GL_T2F_N3F_V3F = 0x2A2B, + GL_T2F_C4F_N3F_V3F = 0x2A2C, + GL_T4F_C4F_N3F_V4F = 0x2A2D, + + /* Matrix Mode */ + GL_MATRIX_MODE = 0x0BA0, + GL_MODELVIEW = 0x1700, + GL_PROJECTION = 0x1701, + GL_TEXTURE = 0x1702, + + /* Points */ + GL_POINT_SMOOTH = 0x0B10, + GL_POINT_SIZE = 0x0B11, + GL_POINT_SIZE_GRANULARITY = 0x0B13, + GL_POINT_SIZE_RANGE = 0x0B12, + + /* Lines */ + GL_LINE_SMOOTH = 0x0B20, + GL_LINE_STIPPLE = 0x0B24, + GL_LINE_STIPPLE_PATTERN = 0x0B25, + GL_LINE_STIPPLE_REPEAT = 0x0B26, + GL_LINE_WIDTH = 0x0B21, + GL_LINE_WIDTH_GRANULARITY = 0x0B23, + GL_LINE_WIDTH_RANGE = 0x0B22, + + /* Polygons */ + GL_POINT = 0x1B00, + GL_LINE = 0x1B01, + GL_FILL = 0x1B02, + GL_CCW = 0x0901, + GL_CW = 0x0900, + GL_FRONT = 0x0404, + GL_BACK = 0x0405, + GL_CULL_FACE = 0x0B44, + GL_CULL_FACE_MODE = 0x0B45, + GL_POLYGON_SMOOTH = 0x0B41, + GL_POLYGON_STIPPLE = 0x0B42, + GL_FRONT_FACE = 0x0B46, + GL_POLYGON_MODE = 0x0B40, + GL_POLYGON_OFFSET_FACTOR = 0x3038, + GL_POLYGON_OFFSET_UNITS = 0x2A00, + GL_POLYGON_OFFSET_POINT = 0x2A01, + GL_POLYGON_OFFSET_LINE = 0x2A02, + GL_POLYGON_OFFSET_FILL = 0x8037, + + /* Display Lists */ + GL_COMPILE = 0x1300, + GL_COMPILE_AND_EXECUTE = 0x1301, + GL_LIST_BASE = 0x0B32, + GL_LIST_INDEX = 0x0B33, + GL_LIST_MODE = 0x0B30, + + /* Depth buffer */ + GL_NEVER = 0x0200, + GL_LESS = 0x0201, + GL_GEQUAL = 0x0206, + GL_LEQUAL = 0x0203, + GL_GREATER = 0x0204, + GL_NOTEQUAL = 0x0205, + GL_EQUAL = 0x0202, + GL_ALWAYS = 0x0207, + GL_DEPTH_TEST = 0x0B71, + GL_DEPTH_BITS = 0x0D56, + GL_DEPTH_CLEAR_VALUE = 0x0B73, + GL_DEPTH_FUNC = 0x0B74, + GL_DEPTH_RANGE = 0x0B70, + GL_DEPTH_WRITEMASK = 0x0B72, + GL_DEPTH_COMPONENT = 0x1902, + + /* Lighting */ + GL_LIGHTING = 0x0B50, + GL_LIGHT0 = 0x4000, + GL_LIGHT1 = 0x4001, + GL_LIGHT2 = 0x4002, + GL_LIGHT3 = 0x4003, + GL_LIGHT4 = 0x4004, + GL_LIGHT5 = 0x4005, + GL_LIGHT6 = 0x4006, + GL_LIGHT7 = 0x4007, + GL_SPOT_EXPONENT = 0x1205, + GL_SPOT_CUTOFF = 0x1206, + GL_CONSTANT_ATTENUATION = 0x1207, + GL_LINEAR_ATTENUATION = 0x1208, + GL_QUADRATIC_ATTENUATION = 0x1209, + GL_AMBIENT = 0x1200, + GL_DIFFUSE = 0x1201, + GL_SPECULAR = 0x1202, + GL_SHININESS = 0x1601, + GL_EMISSION = 0x1600, + GL_POSITION = 0x1203, + GL_SPOT_DIRECTION = 0x1204, + GL_AMBIENT_AND_DIFFUSE = 0x1602, + GL_COLOR_INDEXES = 0x1603, + GL_LIGHT_MODEL_TWO_SIDE = 0x0B52, + GL_LIGHT_MODEL_LOCAL_VIEWER = 0x0B51, + GL_LIGHT_MODEL_AMBIENT = 0x0B53, + GL_FRONT_AND_BACK = 0x0408, + GL_SHADE_MODEL = 0x0B54, + GL_FLAT = 0x1D00, + GL_SMOOTH = 0x1D01, + GL_COLOR_MATERIAL = 0x0B57, + GL_COLOR_MATERIAL_FACE = 0x0B55, + GL_COLOR_MATERIAL_PARAMETER = 0x0B56, + GL_NORMALIZE = 0x0BA1, + + /* User clipping planes */ + GL_CLIP_PLANE0 = 0x3000, + GL_CLIP_PLANE1 = 0x3001, + GL_CLIP_PLANE2 = 0x3002, + GL_CLIP_PLANE3 = 0x3003, + GL_CLIP_PLANE4 = 0x3004, + GL_CLIP_PLANE5 = 0x3005, + + /* Accumulation buffer */ + GL_ACCUM_RED_BITS = 0x0D58, + GL_ACCUM_GREEN_BITS = 0x0D59, + GL_ACCUM_BLUE_BITS = 0x0D5A, + GL_ACCUM_ALPHA_BITS = 0x0D5B, + GL_ACCUM_CLEAR_VALUE = 0x0B80, + GL_ACCUM = 0x0100, + GL_ADD = 0x0104, + GL_LOAD = 0x0101, + GL_MULT = 0x0103, + GL_RETURN = 0x0102, + + /* Alpha testing */ + GL_ALPHA_TEST = 0x0BC0, + GL_ALPHA_TEST_REF = 0x0BC2, + GL_ALPHA_TEST_FUNC = 0x0BC1, + + /* Blending */ + GL_BLEND = 0x0BE2, + GL_BLEND_SRC = 0x0BE1, + GL_BLEND_DST = 0x0BE0, + GL_ZERO = 0, + GL_ONE = 1, + GL_SRC_COLOR = 0x0300, + GL_ONE_MINUS_SRC_COLOR = 0x0301, + GL_DST_COLOR = 0x0306, + GL_ONE_MINUS_DST_COLOR = 0x0307, + GL_SRC_ALPHA = 0x0302, + GL_ONE_MINUS_SRC_ALPHA = 0x0303, + GL_DST_ALPHA = 0x0304, + GL_ONE_MINUS_DST_ALPHA = 0x0305, + GL_SRC_ALPHA_SATURATE = 0x0308, + GL_CONSTANT_COLOR = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + GL_CONSTANT_ALPHA = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004, + + /* Render Mode */ + GL_FEEDBACK = 0x1C01, + GL_RENDER = 0x1C00, + GL_SELECT = 0x1C02, + + /* Feedback */ + GL_2D = 0x0600, + GL_3D = 0x0601, + GL_3D_COLOR = 0x0602, + GL_3D_COLOR_TEXTURE = 0x0603, + GL_4D_COLOR_TEXTURE = 0x0604, + GL_POINT_TOKEN = 0x0701, + GL_LINE_TOKEN = 0x0702, + GL_LINE_RESET_TOKEN = 0x0707, + GL_POLYGON_TOKEN = 0x0703, + GL_BITMAP_TOKEN = 0x0704, + GL_DRAW_PIXEL_TOKEN = 0x0705, + GL_COPY_PIXEL_TOKEN = 0x0706, + GL_PASS_THROUGH_TOKEN = 0x0700, + + /* Fog */ + GL_FOG = 0x0B60, + GL_FOG_MODE = 0x0B65, + GL_FOG_DENSITY = 0x0B62, + GL_FOG_COLOR = 0x0B66, + GL_FOG_INDEX = 0x0B61, + GL_FOG_START = 0x0B63, + GL_FOG_END = 0x0B64, + GL_LINEAR = 0x2601, + GL_EXP = 0x0800, + GL_EXP2 = 0x0801, + + /* Logic Ops */ + GL_LOGIC_OP = 0x0BF1, + GL_LOGIC_OP_MODE = 0x0BF0, + GL_CLEAR = 0x1500, + GL_SET = 0x150F, + GL_COPY = 0x1503, + GL_COPY_INVERTED = 0x150C, + GL_NOOP = 0x1505, + GL_INVERT = 0x150A, + GL_AND = 0x1501, + GL_NAND = 0x150E, + GL_OR = 0x1507, + GL_NOR = 0x1508, + GL_XOR = 0x1506, + GL_EQUIV = 0x1509, + GL_AND_REVERSE = 0x1502, + GL_AND_INVERTED = 0x1504, + GL_OR_REVERSE = 0x150B, + GL_OR_INVERTED = 0x150D, + + /* Stencil */ + GL_STENCIL_TEST = 0x0B90, + GL_STENCIL_WRITEMASK = 0x0B98, + GL_STENCIL_BITS = 0x0D57, + GL_STENCIL_FUNC = 0x0B92, + GL_STENCIL_VALUE_MASK = 0x0B93, + GL_STENCIL_REF = 0x0B97, + GL_STENCIL_FAIL = 0x0B94, + GL_STENCIL_PASS_DEPTH_PASS = 0x0B96, + GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95, + GL_STENCIL_CLEAR_VALUE = 0x0B91, + GL_STENCIL_INDEX = 0x1901, + GL_KEEP = 0x1E00, + GL_REPLACE = 0x1E01, + GL_INCR = 0x1E02, + GL_DECR = 0x1E03, + + /* Buffers, Pixel Drawing/Reading */ + GL_NONE = 0, + GL_LEFT = 0x0406, + GL_RIGHT = 0x0407, + /*GL_FRONT = 0x0404, */ + /*GL_BACK = 0x0405, */ + /*GL_FRONT_AND_BACK = 0x0408, */ + GL_FRONT_LEFT = 0x0400, + GL_FRONT_RIGHT = 0x0401, + GL_BACK_LEFT = 0x0402, + GL_BACK_RIGHT = 0x0403, + GL_AUX0 = 0x0409, + GL_AUX1 = 0x040A, + GL_AUX2 = 0x040B, + GL_AUX3 = 0x040C, + GL_COLOR_INDEX = 0x1900, + GL_RED = 0x1903, + GL_GREEN = 0x1904, + GL_BLUE = 0x1905, + GL_ALPHA = 0x1906, + GL_LUMINANCE = 0x1909, + GL_LUMINANCE_ALPHA = 0x190A, + GL_ALPHA_BITS = 0x0D55, + GL_RED_BITS = 0x0D52, + GL_GREEN_BITS = 0x0D53, + GL_BLUE_BITS = 0x0D54, + GL_INDEX_BITS = 0x0D51, + GL_SUBPIXEL_BITS = 0x0D50, + GL_AUX_BUFFERS = 0x0C00, + GL_READ_BUFFER = 0x0C02, + GL_DRAW_BUFFER = 0x0C01, + GL_DOUBLEBUFFER = 0x0C32, + GL_STEREO = 0x0C33, + GL_BITMAP = 0x1A00, + GL_COLOR = 0x1800, + GL_DEPTH = 0x1801, + GL_STENCIL = 0x1802, + GL_DITHER = 0x0BD0, + GL_RGB = 0x1907, + GL_RGBA = 0x1908, + + /* Implementation limits */ + GL_MAX_LIST_NESTING = 0x0B31, + GL_MAX_ATTRIB_STACK_DEPTH = 0x0D35, + GL_MAX_MODELVIEW_STACK_DEPTH = 0x0D36, + GL_MAX_NAME_STACK_DEPTH = 0x0D37, + GL_MAX_PROJECTION_STACK_DEPTH = 0x0D38, + GL_MAX_TEXTURE_STACK_DEPTH = 0x0D39, + GL_MAX_EVAL_ORDER = 0x0D30, + GL_MAX_LIGHTS = 0x0D31, + GL_MAX_CLIP_PLANES = 0x0D32, + GL_MAX_TEXTURE_SIZE = 0x0D33, + GL_MAX_PIXEL_MAP_TABLE = 0x0D34, + GL_MAX_VIEWPORT_DIMS = 0x0D3A, + GL_MAX_CLIENT_ATTRIB_STACK_DEPTH= 0x0D3B, + + /* Gets */ + GL_ATTRIB_STACK_DEPTH = 0x0BB0, + GL_COLOR_CLEAR_VALUE = 0x0C22, + GL_COLOR_WRITEMASK = 0x0C23, + GL_CURRENT_INDEX = 0x0B01, + GL_CURRENT_COLOR = 0x0B00, + GL_CURRENT_NORMAL = 0x0B02, + GL_CURRENT_RASTER_COLOR = 0x0B04, + GL_CURRENT_RASTER_DISTANCE = 0x0B09, + GL_CURRENT_RASTER_INDEX = 0x0B05, + GL_CURRENT_RASTER_POSITION = 0x0B07, + GL_CURRENT_RASTER_TEXTURE_COORDS = 0x0B06, + GL_CURRENT_RASTER_POSITION_VALID = 0x0B08, + GL_CURRENT_TEXTURE_COORDS = 0x0B03, + GL_INDEX_CLEAR_VALUE = 0x0C20, + GL_INDEX_MODE = 0x0C30, + GL_INDEX_WRITEMASK = 0x0C21, + GL_MODELVIEW_MATRIX = 0x0BA6, + GL_MODELVIEW_STACK_DEPTH = 0x0BA3, + GL_NAME_STACK_DEPTH = 0x0D70, + GL_PROJECTION_MATRIX = 0x0BA7, + GL_PROJECTION_STACK_DEPTH = 0x0BA4, + GL_RENDER_MODE = 0x0C40, + GL_RGBA_MODE = 0x0C31, + GL_TEXTURE_MATRIX = 0x0BA8, + GL_TEXTURE_STACK_DEPTH = 0x0BA5, + GL_VIEWPORT = 0x0BA2, + + + /* Evaluators */ + GL_AUTO_NORMAL = 0x0D80, + GL_MAP1_COLOR_4 = 0x0D90, + GL_MAP1_GRID_DOMAIN = 0x0DD0, + GL_MAP1_GRID_SEGMENTS = 0x0DD1, + GL_MAP1_INDEX = 0x0D91, + GL_MAP1_NORMAL = 0x0D92, + GL_MAP1_TEXTURE_COORD_1 = 0x0D93, + GL_MAP1_TEXTURE_COORD_2 = 0x0D94, + GL_MAP1_TEXTURE_COORD_3 = 0x0D95, + GL_MAP1_TEXTURE_COORD_4 = 0x0D96, + GL_MAP1_VERTEX_3 = 0x0D97, + GL_MAP1_VERTEX_4 = 0x0D98, + GL_MAP2_COLOR_4 = 0x0DB0, + GL_MAP2_GRID_DOMAIN = 0x0DD2, + GL_MAP2_GRID_SEGMENTS = 0x0DD3, + GL_MAP2_INDEX = 0x0DB1, + GL_MAP2_NORMAL = 0x0DB2, + GL_MAP2_TEXTURE_COORD_1 = 0x0DB3, + GL_MAP2_TEXTURE_COORD_2 = 0x0DB4, + GL_MAP2_TEXTURE_COORD_3 = 0x0DB5, + GL_MAP2_TEXTURE_COORD_4 = 0x0DB6, + GL_MAP2_VERTEX_3 = 0x0DB7, + GL_MAP2_VERTEX_4 = 0x0DB8, + GL_COEFF = 0x0A00, + GL_DOMAIN = 0x0A02, + GL_ORDER = 0x0A01, + + /* Hints */ + GL_FOG_HINT = 0x0C54, + GL_LINE_SMOOTH_HINT = 0x0C52, + GL_PERSPECTIVE_CORRECTION_HINT = 0x0C50, + GL_POINT_SMOOTH_HINT = 0x0C51, + GL_POLYGON_SMOOTH_HINT = 0x0C53, + GL_DONT_CARE = 0x1100, + GL_FASTEST = 0x1101, + GL_NICEST = 0x1102, + + /* Scissor box */ + GL_SCISSOR_TEST = 0x0C11, + GL_SCISSOR_BOX = 0x0C10, + + /* Pixel Mode / Transfer */ + GL_MAP_COLOR = 0x0D10, + GL_MAP_STENCIL = 0x0D11, + GL_INDEX_SHIFT = 0x0D12, + GL_INDEX_OFFSET = 0x0D13, + GL_RED_SCALE = 0x0D14, + GL_RED_BIAS = 0x0D15, + GL_GREEN_SCALE = 0x0D18, + GL_GREEN_BIAS = 0x0D19, + GL_BLUE_SCALE = 0x0D1A, + GL_BLUE_BIAS = 0x0D1B, + GL_ALPHA_SCALE = 0x0D1C, + GL_ALPHA_BIAS = 0x0D1D, + GL_DEPTH_SCALE = 0x0D1E, + GL_DEPTH_BIAS = 0x0D1F, + GL_PIXEL_MAP_S_TO_S_SIZE = 0x0CB1, + GL_PIXEL_MAP_I_TO_I_SIZE = 0x0CB0, + GL_PIXEL_MAP_I_TO_R_SIZE = 0x0CB2, + GL_PIXEL_MAP_I_TO_G_SIZE = 0x0CB3, + GL_PIXEL_MAP_I_TO_B_SIZE = 0x0CB4, + GL_PIXEL_MAP_I_TO_A_SIZE = 0x0CB5, + GL_PIXEL_MAP_R_TO_R_SIZE = 0x0CB6, + GL_PIXEL_MAP_G_TO_G_SIZE = 0x0CB7, + GL_PIXEL_MAP_B_TO_B_SIZE = 0x0CB8, + GL_PIXEL_MAP_A_TO_A_SIZE = 0x0CB9, + GL_PIXEL_MAP_S_TO_S = 0x0C71, + GL_PIXEL_MAP_I_TO_I = 0x0C70, + GL_PIXEL_MAP_I_TO_R = 0x0C72, + GL_PIXEL_MAP_I_TO_G = 0x0C73, + GL_PIXEL_MAP_I_TO_B = 0x0C74, + GL_PIXEL_MAP_I_TO_A = 0x0C75, + GL_PIXEL_MAP_R_TO_R = 0x0C76, + GL_PIXEL_MAP_G_TO_G = 0x0C77, + GL_PIXEL_MAP_B_TO_B = 0x0C78, + GL_PIXEL_MAP_A_TO_A = 0x0C79, + GL_PACK_ALIGNMENT = 0x0D05, + GL_PACK_LSB_FIRST = 0x0D01, + GL_PACK_ROW_LENGTH = 0x0D02, + GL_PACK_SKIP_PIXELS = 0x0D04, + GL_PACK_SKIP_ROWS = 0x0D03, + GL_PACK_SWAP_BYTES = 0x0D00, + GL_UNPACK_ALIGNMENT = 0x0CF5, + GL_UNPACK_LSB_FIRST = 0x0CF1, + GL_UNPACK_ROW_LENGTH = 0x0CF2, + GL_UNPACK_SKIP_PIXELS = 0x0CF4, + GL_UNPACK_SKIP_ROWS = 0x0CF3, + GL_UNPACK_SWAP_BYTES = 0x0CF0, + GL_ZOOM_X = 0x0D16, + GL_ZOOM_Y = 0x0D17, + + /* Texture mapping */ + GL_TEXTURE_ENV = 0x2300, + GL_TEXTURE_ENV_MODE = 0x2200, + GL_TEXTURE_1D = 0x0DE0, + GL_TEXTURE_2D = 0x0DE1, + GL_TEXTURE_WRAP_S = 0x2802, + GL_TEXTURE_WRAP_T = 0x2803, + GL_TEXTURE_MAG_FILTER = 0x2800, + GL_TEXTURE_MIN_FILTER = 0x2801, + GL_TEXTURE_ENV_COLOR = 0x2201, + GL_TEXTURE_GEN_S = 0x0C60, + GL_TEXTURE_GEN_T = 0x0C61, + GL_TEXTURE_GEN_MODE = 0x2500, + GL_TEXTURE_BORDER_COLOR = 0x1004, + GL_TEXTURE_WIDTH = 0x1000, + GL_TEXTURE_HEIGHT = 0x1001, + GL_TEXTURE_BORDER = 0x1005, + GL_TEXTURE_COMPONENTS = 0x1003, + GL_NEAREST_MIPMAP_NEAREST = 0x2700, + GL_NEAREST_MIPMAP_LINEAR = 0x2702, + GL_LINEAR_MIPMAP_NEAREST = 0x2701, + GL_LINEAR_MIPMAP_LINEAR = 0x2703, + GL_OBJECT_LINEAR = 0x2401, + GL_OBJECT_PLANE = 0x2501, + GL_EYE_LINEAR = 0x2400, + GL_EYE_PLANE = 0x2502, + GL_SPHERE_MAP = 0x2402, + GL_DECAL = 0x2101, + GL_MODULATE = 0x2100, + GL_NEAREST = 0x2600, + GL_REPEAT = 0x2901, + GL_CLAMP = 0x2900, + GL_S = 0x2000, + GL_T = 0x2001, + GL_R = 0x2002, + GL_Q = 0x2003, + GL_TEXTURE_GEN_R = 0x0C62, + GL_TEXTURE_GEN_Q = 0x0C63, + + GL_PROXY_TEXTURE_1D = 0x8063, + GL_PROXY_TEXTURE_2D = 0x8064, + GL_TEXTURE_PRIORITY = 0x8066, + GL_TEXTURE_RESIDENT = 0x8067, + GL_TEXTURE_1D_BINDING = 0x8068, + GL_TEXTURE_2D_BINDING = 0x8069, + + /* Internal texture formats */ + GL_ALPHA4 = 0x803B, + GL_ALPHA8 = 0x803C, + GL_ALPHA12 = 0x803D, + GL_ALPHA16 = 0x803E, + GL_LUMINANCE4 = 0x803F, + GL_LUMINANCE8 = 0x8040, + GL_LUMINANCE12 = 0x8041, + GL_LUMINANCE16 = 0x8042, + GL_LUMINANCE4_ALPHA4 = 0x8043, + GL_LUMINANCE6_ALPHA2 = 0x8044, + GL_LUMINANCE8_ALPHA8 = 0x8045, + GL_LUMINANCE12_ALPHA4 = 0x8046, + GL_LUMINANCE12_ALPHA12 = 0x8047, + GL_LUMINANCE16_ALPHA16 = 0x8048, + GL_INTENSITY = 0x8049, + GL_INTENSITY4 = 0x804A, + GL_INTENSITY8 = 0x804B, + GL_INTENSITY12 = 0x804C, + GL_INTENSITY16 = 0x804D, + GL_R3_G3_B2 = 0x2A10, + GL_RGB4 = 0x804F, + GL_RGB5 = 0x8050, + GL_RGB8 = 0x8051, + GL_RGB10 = 0x8052, + GL_RGB12 = 0x8053, + GL_RGB16 = 0x8054, + GL_RGBA2 = 0x8055, + GL_RGBA4 = 0x8056, + GL_RGB5_A1 = 0x8057, + GL_RGBA8 = 0x8058, + GL_RGB10_A2 = 0x8059, + GL_RGBA12 = 0x805A, + GL_RGBA16 = 0x805B, + + /* Utility */ + GL_VENDOR = 0x1F00, + GL_RENDERER = 0x1F01, + GL_VERSION = 0x1F02, + GL_EXTENSIONS = 0x1F03, + + /* Errors */ + GL_INVALID_VALUE = 0x0501, + GL_INVALID_ENUM = 0x0500, + GL_INVALID_OPERATION = 0x0502, + GL_STACK_OVERFLOW = 0x0503, + GL_STACK_UNDERFLOW = 0x0504, + GL_OUT_OF_MEMORY = 0x0505, + + /* + * 1.0 Extensions + */ + /* GL_EXT_blend_minmax and GL_EXT_blend_color */ + GL_CONSTANT_COLOR_EXT = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002, + GL_CONSTANT_ALPHA_EXT = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004, + GL_BLEND_EQUATION_EXT = 0x8009, + GL_MIN_EXT = 0x8007, + GL_MAX_EXT = 0x8008, + GL_FUNC_ADD_EXT = 0x8006, + GL_FUNC_SUBTRACT_EXT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B, + GL_BLEND_COLOR_EXT = 0x8005, + + /* GL_EXT_polygon_offset */ + GL_POLYGON_OFFSET_EXT = 0x8037, + GL_POLYGON_OFFSET_FACTOR_EXT = 0x8038, + GL_POLYGON_OFFSET_BIAS_EXT = 0x8039, + + /* GL_EXT_vertex_array */ + GL_VERTEX_ARRAY_EXT = 0x8074, + GL_NORMAL_ARRAY_EXT = 0x8075, + GL_COLOR_ARRAY_EXT = 0x8076, + GL_INDEX_ARRAY_EXT = 0x8077, + GL_TEXTURE_COORD_ARRAY_EXT = 0x8078, + GL_EDGE_FLAG_ARRAY_EXT = 0x8079, + GL_VERTEX_ARRAY_SIZE_EXT = 0x807A, + GL_VERTEX_ARRAY_TYPE_EXT = 0x807B, + GL_VERTEX_ARRAY_STRIDE_EXT = 0x807C, + GL_VERTEX_ARRAY_COUNT_EXT = 0x807D, + GL_NORMAL_ARRAY_TYPE_EXT = 0x807E, + GL_NORMAL_ARRAY_STRIDE_EXT = 0x807F, + GL_NORMAL_ARRAY_COUNT_EXT = 0x8080, + GL_COLOR_ARRAY_SIZE_EXT = 0x8081, + GL_COLOR_ARRAY_TYPE_EXT = 0x8082, + GL_COLOR_ARRAY_STRIDE_EXT = 0x8083, + GL_COLOR_ARRAY_COUNT_EXT = 0x8084, + GL_INDEX_ARRAY_TYPE_EXT = 0x8085, + GL_INDEX_ARRAY_STRIDE_EXT = 0x8086, + GL_INDEX_ARRAY_COUNT_EXT = 0x8087, + GL_TEXTURE_COORD_ARRAY_SIZE_EXT = 0x8088, + GL_TEXTURE_COORD_ARRAY_TYPE_EXT = 0x8089, + GL_TEXTURE_COORD_ARRAY_STRIDE_EXT= 0x808A, + GL_TEXTURE_COORD_ARRAY_COUNT_EXT= 0x808B, + GL_EDGE_FLAG_ARRAY_STRIDE_EXT = 0x808C, + GL_EDGE_FLAG_ARRAY_COUNT_EXT = 0x808D, + GL_VERTEX_ARRAY_POINTER_EXT = 0x808E, + GL_NORMAL_ARRAY_POINTER_EXT = 0x808F, + GL_COLOR_ARRAY_POINTER_EXT = 0x8090, + GL_INDEX_ARRAY_POINTER_EXT = 0x8091, + GL_TEXTURE_COORD_ARRAY_POINTER_EXT= 0x8092, + GL_EDGE_FLAG_ARRAY_POINTER_EXT = 0x8093 + +}; + +enum { + GL_CURRENT_BIT = 0x00000001, + GL_POINT_BIT = 0x00000002, + GL_LINE_BIT = 0x00000004, + GL_POLYGON_BIT = 0x00000008, + GL_POLYGON_STIPPLE_BIT = 0x00000010, + GL_PIXEL_MODE_BIT = 0x00000020, + GL_LIGHTING_BIT = 0x00000040, + GL_FOG_BIT = 0x00000080, + GL_DEPTH_BUFFER_BIT = 0x00000100, + GL_ACCUM_BUFFER_BIT = 0x00000200, + GL_STENCIL_BUFFER_BIT = 0x00000400, + GL_VIEWPORT_BIT = 0x00000800, + GL_TRANSFORM_BIT = 0x00001000, + GL_ENABLE_BIT = 0x00002000, + GL_COLOR_BUFFER_BIT = 0x00004000, + GL_HINT_BIT = 0x00008000, + GL_EVAL_BIT = 0x00010000, + GL_LIST_BIT = 0x00020000, + GL_TEXTURE_BIT = 0x00040000, + GL_SCISSOR_BIT = 0x00080000, + GL_ALL_ATTRIB_BITS = 0x000fffff +}; + +struct ZBuffer +{ + long int xsize, ysize; + int linesize; //line size, in bytes + int mode; + + unsigned short int* zbuf; + unsigned char* pbuf; //PIXEL + int frame_buffer_allocated; + + int nb_colors; + unsigned char* dctable; + int* ctable; + unsigned char* current_texture; //PIXEL + unsigned int s_log2; + unsigned int s_bound; + unsigned int t_bound; +}; + +struct TinyGLContext +{ + ZBuffer* gl_context; + long int xsize, ysize; + long int dx, dy, x, y; +}; + +// +// tinygl - import table +// +#define import_tinygl glEnable +void (__stdcall* glEnable)(int code) = (void (__stdcall*)(int))&"glEnable"; +void (__stdcall* glDisable)(int code) = (void (__stdcall*)(int))&"glDisable"; +void (__stdcall* glShadeModel)(int mode) = (void (__stdcall*)(int))&"glShadeModel"; +void (__stdcall* glCullFace)(int mode) = (void (__stdcall*)(int))&"glCullFace"; +void (__stdcall* glPolygonMode)(int face, int mode) = (void (__stdcall*)(int, int))&"glPolygonMode"; +void (__stdcall* glBegin)(int type) = (void (__stdcall*)(int))&"glBegin"; +void (__stdcall* glEnd)() = (void (__stdcall*)())&"glEnd"; +void (__stdcall* glVertex2f)(float x, float y) = (void (__stdcall*)(float, float))&"glVertex2f"; +void (__stdcall* glVertex2d)(double x, double y) = (void (__stdcall*)(double, double))&"glVertex2d"; +void (__stdcall* glVertex2fv)(float* v) = (void (__stdcall*)(float*))&"glVertex2fv"; +void (__stdcall* glVertex2dv)(double* v) = (void (__stdcall*)(double*))&"glVertex2dv"; +void (__stdcall* glVertex3f)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glVertex3f"; +void (__stdcall* glVertex3d)(double x, double y, double z) = (void (__stdcall*)(double, double, double))&"glVertex3d"; +void (__stdcall* glVertex3fv)(float* v) = (void (__stdcall*)(float*))&"glVertex3fv"; +void (__stdcall* glVertex3dv)(double* v) = (void (__stdcall*)(double*))&"glVertex3dv"; +void (__stdcall* glVertex4f)(float x, float y, float z, float w) = (void (__stdcall*)(float, float, float, float))&"glVertex4f"; +void (__stdcall* glVertex4d)(double x, double y, double z, double w) = (void (__stdcall*)(double, double, double, double))&"glVertex4d"; +void (__stdcall* glVertex4fv)(float* v) = (void (__stdcall*)(float*))&"glVertex4fv"; +void (__stdcall* glVertex4dv)(double* v) = (void (__stdcall*)(double*))&"glVertex4dv"; +void (__stdcall* glColor3f)(float r, float g, float b) = (void (__stdcall*)(float, float, float))&"glColor3f"; +//void (__stdcall* glColor3d)(...) = (void (__stdcall*)(...))&"glColor3d"; +//void (__stdcall* glColor3fv)(...) = (void (__stdcall*)(...))&"glColor3fv"; +//void (__stdcall* glColor3dv)(...) = (void (__stdcall*)(...))&"glColor3dv"; +void (__stdcall* glColor3ub)(unsigned char r, unsigned char g, unsigned char b) = (void (__stdcall*)(unsigned char, unsigned char, unsigned char))&"glColor3ub"; +//void (__stdcall* glColor4f)(...) = (void (__stdcall*)(...))&"glColor4f"; +//void (__stdcall* glColor4d)(...) = (void (__stdcall*)(...))&"glColor4d"; +//void (__stdcall* glColor4fv)(...) = (void (__stdcall*)(...))&"glColor4fv"; +//void (__stdcall* glColor4dv)(...) = (void (__stdcall*)(...))&"glColor4dv"; +void (__stdcall* glNormal3f)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glNormal3f"; +//void (__stdcall* glNormal3d)(...) = (void (__stdcall*)(...))&"glNormal3d"; +//void (__stdcall* glNormal3fv)(...) = (void (__stdcall*)(...))&"glNormal3fv"; +//void (__stdcall* glNormal3dv)(...) = (void (__stdcall*)(...))&"glNormal3dv"; +//void (__stdcall* glTexCoord1f)(...) = (void (__stdcall*)(...))&"glTexCoord1f"; +//void (__stdcall* glTexCoord1d)(...) = (void (__stdcall*)(...))&"glTexCoord1d"; +//void (__stdcall* glTexCoord1fv)(...) = (void (__stdcall*)(...))&"glTexCoord1fv"; +//void (__stdcall* glTexCoord1dv)(...) = (void (__stdcall*)(...))&"glTexCoord1dv"; +void (__stdcall* glTexCoord2f)(float s, float t) = (void (__stdcall*)(float, float))&"glTexCoord2f"; +//void (__stdcall* glTexCoord2d)(...) = (void (__stdcall*)(...))&"glTexCoord2d"; +void (__stdcall* glTexCoord2fv)(float* v) = (void (__stdcall*)(float*))&"glTexCoord2fv"; +//void (__stdcall* glTexCoord2dv)(...) = (void (__stdcall*)(...))&"glTexCoord2dv"; +//void (__stdcall* glTexCoord3f)(...) = (void (__stdcall*)(...))&"glTexCoord3f"; +//void (__stdcall* glTexCoord3d)(...) = (void (__stdcall*)(...))&"glTexCoord3d"; +//void (__stdcall* glTexCoord3fv)(...) = (void (__stdcall*)(...))&"glTexCoord3fv"; +//void (__stdcall* glTexCoord3dv)(...) = (void (__stdcall*)(...))&"glTexCoord3dv"; +void (__stdcall* glTexCoord4f)(float s, float t, float r, float q) = (void (__stdcall*)(float, float, float, float))&"glTexCoord4f"; +//void (__stdcall* glTexCoord4d)(...) = (void (__stdcall*)(...))&"glTexCoord4d"; +//void (__stdcall* glTexCoord4fv)(...) = (void (__stdcall*)(...))&"glTexCoord4fv"; +//void (__stdcall* glTexCoord4dv)(...) = (void (__stdcall*)(...))&"glTexCoord4dv"; +void (__stdcall* glEdgeFlag)(int flag) = (void (__stdcall*)(int))&"glEdgeFlag"; +void (__stdcall* glMatrixMode)(int mode) = (void (__stdcall*)(int))&"glMatrixMode"; +void (__stdcall* glLoadMatrixf)(const float* m) = (void (__stdcall*)(const float*))&"glLoadMatrixf"; +void (__stdcall* glLoadIdentity)() = (void (__stdcall*)())&"glLoadIdentity"; +//void (__stdcall* glMultMatrixf)(...) = (void (__stdcall*)(...))&"glMultMatrixf"; +void (__stdcall* glPushMatrix)() = (void (__stdcall*)())&"glPushMatrix"; +void (__stdcall* glPopMatrix)() = (void (__stdcall*)())&"glPopMatrix"; +void (__stdcall* glRotatef)(float angle, float x, float y, float z) = (void (__stdcall*)(float, float, float, float))&"glRotatef"; +void (__stdcall* glTranslatef)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glTranslatef"; +void (__stdcall* glScalef)(float x, float y, float z) = (void (__stdcall*)(float, float, float))&"glScalef"; +void (__stdcall* glViewport)(int x, int y, int width, int height) = (void (__stdcall*)(int, int, int, int))&"glViewport"; +void (__stdcall* glFrustum)(double l, double r, double b, double t, double n, double f) = (void (__stdcall*)(double, double, double, double, double, double))&"glFrustum"; +void (__stdcall* glGenLists)(int range) = (void (__stdcall*)(int))&"glGenLists"; +//void (__stdcall* glIsList)(...) = (void (__stdcall*)(...))&"glIsList"; +void (__stdcall* glNewList)(unsigned int list, int mode) = (void (__stdcall*)(unsigned int, int))&"glNewList"; +void (__stdcall* glEndList)() = (void (__stdcall*)())&"glEndList"; +void (__stdcall* glCallList)(unsigned int list) = (void (__stdcall*)(unsigned int))&"glCallList"; +void (__stdcall* glClear)(int mask) = (void (__stdcall*)(int))&"glClear"; +void (__stdcall* glClearColor)(float r, float g, float b, float a) = (void (__stdcall*)(float, float, float, float))&"glClearColor"; +//void (__stdcall* glClearDepth)(...) = (void (__stdcall*)(...))&"glClearDepth"; +void (__stdcall* glRenderMode)(int mode) = (void (__stdcall*)(int))&"glRenderMode"; +//void (__stdcall* glSelectBuffer)(...) = (void (__stdcall*)(...))&"glSelectBuffer"; +//void (__stdcall* glInitNames)(...) = (void (__stdcall*)(...))&"glInitNames"; +//void (__stdcall* glPushName)(...) = (void (__stdcall*)(...))&"glPushName"; +//void (__stdcall* glPopName)(...) = (void (__stdcall*)(...))&"glPopName"; +//void (__stdcall* glLoadName)(...) = (void (__stdcall*)(...))&"glLoadName"; +void (__stdcall* glGenTextures)(int n, unsigned int* textures) = (void (__stdcall*)(int, unsigned int *))&"glGenTextures"; +//void (__stdcall* glDeleteTextures)(...) = (void (__stdcall*)(...))&"glDeleteTextures"; +void (__stdcall* glBindTexture)(int target, int texture) = (void (__stdcall*)(int, int))&"glBindTexture"; +void (__stdcall* glTexImage2D)(int target, int level, int components, int width, int height, int border, int format, int type, void *pixels) = (void (__stdcall*)(int, int, int, int, int, int, int, int, void*))&"glTexImage2D"; +void (__stdcall* glTexEnvi)(int target, int pname, int param) = (void (__stdcall*)(int, int, int))&"glTexEnvi"; +void (__stdcall* glTexParameteri)(int target, int pname, int param) = (void (__stdcall*)(int, int, int))&"glTexParameteri"; +//void (__stdcall* glPixelStorei)(...) = (void (__stdcall*)(...))&"glPixelStorei"; +void (__stdcall* glMaterialfv)(int mode, int type, float* v) = (void (__stdcall*)(int, int, float*))&"glMaterialfv"; +void (__stdcall* glMaterialf)(int mode, int type, float v) = (void (__stdcall*)(int, int, float))&"glMaterialf"; +void (__stdcall* glColorMaterial)(int mode, int type) = (void (__stdcall*)(int, int))&"glColorMaterial"; +void (__stdcall* glLightfv)(int light, int type, float* v) = (void (__stdcall*)(int, int, float*))&"glLightfv"; +//void (__stdcall* glLightf)(...) = (void (__stdcall*)(...))&"glLightf"; +//void (__stdcall* glLightModeli)(...) = (void (__stdcall*)(...))&"glLightModeli"; +void (__stdcall* glLightModelfv)(int pname, float* param) = (void (__stdcall*)(int, float*))&"glLightModelfv"; +//void (__stdcall* glFlush)(...) = (void (__stdcall*)(...))&"glFlush"; +//void (__stdcall* glHint)(...) = (void (__stdcall*)(...))&"glHint"; +//void (__stdcall* glGetIntegerv)(...) = (void (__stdcall*)(...))&"glGetIntegerv"; +//void (__stdcall* glGetFloatv)(...) = (void (__stdcall*)(...))&"glGetFloatv"; +//void (__stdcall* glFrontFace)(...) = (void (__stdcall*)(...))&"glFrontFace"; +//void (__stdcall* glEnableClientState)(...) = (void (__stdcall*)(...))&"glEnableClientState"; +//void (__stdcall* glDisableClientState)(...) = (void (__stdcall*)(...))&"glDisableClientState"; +//void (__stdcall* glArrayElement)(...) = (void (__stdcall*)(...))&"glArrayElement"; +//void (__stdcall* glDrawArrays)(...) = (void (__stdcall*)(...))&"glDrawArrays"; +//void (__stdcall* glDrawElements)(...) = (void (__stdcall*)(...))&"glDrawElements"; +//void (__stdcall* glVertexPointer)(...) = (void (__stdcall*)(...))&"glVertexPointer"; +//void (__stdcall* glColorPointer)(...) = (void (__stdcall*)(...))&"glColorPointer"; +//void (__stdcall* glNormalPointer)(...) = (void (__stdcall*)(...))&"glNormalPointer"; +//void (__stdcall* glTexCoordPointer)(...) = (void (__stdcall*)(...))&"glTexCoordPointer"; +//void (__stdcall* glPolygonOffset)(...) = (void (__stdcall*)(...))&"glPolygonOffset"; +//void (__stdcall* glOrtho)(...) = (void (__stdcall*)(...))&"glOrtho"; +//void (__stdcall* glDebug)(...) = (void (__stdcall*)(...))&"glDebug"; +//void (__stdcall* glInit)(...) = (void (__stdcall*)(...))&"glInit"; +//void (__stdcall* glClose)(...) = (void (__stdcall*)(...))&"glClose"; +//void (__stdcall* gluPerspective)(...) = (void (__stdcall*)(...))&"gluPerspective"; +//void (__stdcall* gluNewQuadric)(...) = (void (__stdcall*)(...))&"gluNewQuadric"; +//void (__stdcall* gluDeleteQuadric)(...) = (void (__stdcall*)(...))&"gluDeleteQuadric"; +//void (__stdcall* gluQuadricDrawStyle)(...) = (void (__stdcall*)(...))&"gluQuadricDrawStyle"; +//void (__stdcall* gluQuadricOrientation)(...) = (void (__stdcall*)(...))&"gluQuadricOrientation"; +//void (__stdcall* gluQuadricTexture)(...) = (void (__stdcall*)(...))&"gluQuadricTexture"; +//void (__stdcall* gluCylinder)(...) = (void (__stdcall*)(...))&"gluCylinder"; +//void (__stdcall* gluSphere)(...) = (void (__stdcall*)(...))&"gluSphere"; +void (__stdcall* kosglMakeCurrent)(long l, long t, long w, long h, TinyGLContext*) = (void (__stdcall*)(long, long, long, long, TinyGLContext*))&"kosglMakeCurrent"; +void (__stdcall* kosglSwapBuffers)() = (void (__stdcall*)())&"kosglSwapBuffers"; +asm{ + dd 0, 0 +} +#endif \ No newline at end of file diff --git a/programs/develop/libraries/TinyGL/asm_fork/api.asm b/programs/develop/libraries/TinyGL/asm_fork/api.asm index 036d25a02c..ca80842f27 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/api.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/api.asm @@ -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 diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm index d983b2614f..84cb0b4fd8 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/gears.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test0.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test0.asm index a8bcfe702a..3d6b5106dd 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test0.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test0.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test1.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test1.asm index 959eb1c433..05582727fd 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test1.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test1.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test2.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test2.asm index a5ca76d075..60beca0418 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test2.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test2.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test3.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test3.asm index 342813ae55..f905c8dce0 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test3.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test3.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_array0.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_array0.asm index 1262a6f666..c355573504 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_array0.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_array0.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_array1.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_array1.asm index 7896c86cb0..50df34d6da 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_array1.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_array1.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu0.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu0.asm index 6706154f9e..1ed52e9a49 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu0.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu0.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm index 5657abf139..6e4f95bda6 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu1.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm index a5eb9a1ccc..1acdf96397 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/test_glu2.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm index fef6d77bdf..95c76f7313 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/textures0.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm index 035b88f7de..c928d11db6 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm b/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm index a9ef6c512d..678fc8c94f 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/examples/textures2.asm @@ -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: diff --git a/programs/develop/libraries/TinyGL/asm_fork/info_fun_float.inc b/programs/develop/libraries/TinyGL/asm_fork/info_fun_float.inc index b0e6d64816..1da1d44100 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/info_fun_float.inc +++ b/programs/develop/libraries/TinyGL/asm_fork/info_fun_float.inc @@ -5,7 +5,7 @@ ; ⢮ ᫠ ᫥ ⮩ (1-17) NumberSymbolsAD DW 5 ; ⠭ (10 ⥯ 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: ; ᫮ 饩 ⮩ 筮 Data_Double DQ ? ; ᫮ BCD-ଠ @@ -39,9 +40,10 @@ Data_BCD DT ? Data_Flag DB ? ; १ (᫨ 0 - ⥫쭮 ᫮) Data_Sign DB ? +; १ - 0 ..e+.. 1 ..e-.. +Data_Sign_Exp DB ? - -db 0 ;㪠⥫ ᤢ +align 4 ; ப ࠭ ᫠ ASCII Data_String DB 32 DUP (?) @@ -59,10 +61,11 @@ Data_String DB 32 DUP (?) ;* 室 ࠬ: * ;* Data_String - ப-१. * ;******************************************************* +align 4 DoubleFloat_to_String: pushad ; 뢠 ப Data_String - lea EDI, [Data_String] + mov EDI, Data_String ; ᫮ NumberSymbolsAD ; ࠧ冷 @@ -74,9 +77,7 @@ DoubleFloat_to_String: je .NoShifts ; ᫥ ⮩ jl .Error ;訡 dec BX - shl BX, 3 ;㬭 8 - lea eax,[MConst] - add EBX, eax + lea ebx,[MConst+8*ebx] fmul qword [EBX] ;㬭 ⠭ .NoShifts: ; ᫮ BCD @@ -130,8 +131,8 @@ DoubleFloat_to_String: stosb ; 騥 㫨 ᫥ - lea EDI, [Data_String] - lea ESI, [Data_String] + mov EDI, Data_String + mov ESI, Data_String ; ய ᫠, ᫨ cmp byte [ESI],'-' jne .N2 @@ -151,10 +152,11 @@ DoubleFloat_to_String: ; 訡 - jmp .Error ; ஢ ᫠ 砫 ப +align 4 .N4: rep movsb jmp .End - ; 訡 +align 4 .Error: mov AL,'E' stosb @@ -166,12 +168,14 @@ DoubleFloat_to_String: stosb jmp .End ; ९ ࠧ來 ⪨ +align 4 .Overflow: mov AL,'#' stosb xor AL,AL stosb ; 楤 +align 4 .End: popad ret @@ -184,6 +188,7 @@ DoubleFloat_to_String: ;* 室 ࠬ: * ;* Data_Double - ᫮ 筮 . * ;**************************************************** +align 4 String_to_DoubleFloat: pushad cld @@ -193,110 +198,200 @@ String_to_DoubleFloat: mov word [Data_BCD+8],0 ; 頥 mov [Data_Sign],0 - ; ᨬ SI 㪠⥫ ப - lea ESI, [Data_String] + ; ᨬ esi 㪠⥫ ப + mov esi, Data_String ; ய᪠ ஡ । ᫮ mov ecx,64 ; 横 .ShiftIgnore: lodsb - cmp AL,' ' - jne .ShiftIgnoreEnd - loop .ShiftIgnore - jmp .Error + cmp al,' ' + jne .ShiftIgnoreEnd + loop .ShiftIgnore + jmp .Error +align 4 .ShiftIgnoreEnd: ; ஢塞 ᫠ - cmp AL,'-' + cmp al,'-' jne .Positive mov [Data_Sign],80h lodsb .Positive: mov [Data_Flag],0 ;ਧ 窨 - mov DX,0 ; 窨 + xor edx,edx ; 窨 mov ecx,18 ;. ᫮ ࠧ冷 +align 4 .ASCIItoBCDConversion: - cmp AL,'.' ;窠? + cmp al,'.' ;窠? jne .NotDot cmp [Data_Flag],0 ;窠 砫? - jne .Error + jne .Error ;᫨ 窠 㦥 뫠 mov [Data_Flag],1 lodsb - cmp AL,0 ; ப? - jne .NotDot + or al,al ; ப? + jnz .NotDot jmp .ASCIItoBCDConversionEnd +align 4 .NotDot: ; 1 祭 樨 窨, ; ᫨ 砫 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 ;᫨ ᫮ ଠ ..e.. + or al,al + jnz .Error + jmp .ASCIItoBCDConversionEnd + @@: ; ᫠ ࠬ - cmp AL,'0' + cmp al,'0' jb .Error - cmp AL,'9' + cmp al,'9' ja .Error ; 襬 । ࠤ BCD - and AL,0Fh - or byte [Data_BCD],AL + and al,15 ;ᨬ 0-9 ॢ ᫮ + or byte [Data_BCD],al ; ஢ઠ ப - cmp byte [ESI],0 + cmp byte [esi],0 je .ASCIItoBCDConversionEnd ; BCD 4 ࠧ鸞 ; (ᤢ 訥 2 ) - 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 ; (ᤢ । 4 ) - mov EAX, dword [Data_BCD] - shld dword [Data_BCD+4],EAX,4 + mov eax,dword [Data_BCD] + shld dword [Data_BCD+4],eax,4 ; (ᤢ 訥 4 ) shl dword [Data_BCD],4 ; 㦠 ᫥騩 ᨬ AL lodsb - loop .ASCIItoBCDConversion + loop .ASCIItoBCDConversion ;᫨ . ⠢ dec ecx, jnz ... ; ᫨ 19- ᨬ 0 窠, ; 訡 ९ - cmp AL,'.' + cmp al,'.' jne .NotDot2 - inc ecx + inc ecx ;ய 窨 祭 讣 ᫠ lodsb .NotDot2: - cmp AL,0 - jne .Error ;९ ࠧ來 ⪨ + or al,al ;९ ࠧ來 ⪨? + jz .ASCIItoBCDConversionEnd +align 4 +.Error: ;  訡 㫨 १ + fldz ; ⥪ ᮯ + fstp [Data_Double] + jmp .End ; BCD .ASCIItoBCDConversionEnd: ; 訩 - mov AL,[Data_Sign] - mov byte [Data_BCD+9],AL + mov al,[Data_Sign] + mov byte [Data_BCD+9],al ; ॣ ᮯ fninit ; 㧨 ᮯ ᫮ BCD-ଠ fbld [Data_BCD] - ; ᫨ ⥫ - mov EBX,18+1 - sub BX,CX - sub BX,DX - cmp EBX,0 - je .NoDiv - dec EBX - shl EBX,3 ;㬭 8 - lea eax,[MConst] - add EBX,eax - fdiv qword [EBX] ;ࠧ ⠭ -.NoDiv:; 㧨 ᫮ 筮 ଠ - fstp [Data_Double] - jmp .End - -.Error:;  訡 㫨 १ - fldz ; ⥪ ᮯ - fstp [Data_Double] + ; ᫨ ⥫ ⥫ + lea ebx,[ecx+edx-18] + cmp ebx,0 + jle .NoMul ;᫨ ᫮ e-.. + dec ebx + jz .NoDiv ;᫨ ᫮ e+0 + dec ebx + lea ebx,[MConst+8*ebx] + cmp ebx,MConst.end + jl @f + ffree st0 + fincstp + jmp .Error ;᫨ 祭 讥 ᫮ e+** + @@: + fmul qword [ebx] ;㬭 ⠭ ( ᥫ ⠢ e+..) + jmp .NoDiv +.NoMul: + neg ebx + lea ebx,[MConst+8*ebx] + cmp ebx,MConst.end + jl @f + ffree st0 + fincstp + jmp .Error ;᫨ 祭 쪮 ᫮ e-** + @@: + fdiv qword [ebx] ;ࠧ ⠭ +.NoDiv: ;㧨 ᫮ 筮 ଠ + 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 ;ᨬ 0-9 ॢ ᫮ + add ebx,eax + lodsb + jmp .cycle0 + .cycle0end: + + cmp ebx,328 ;308 - . ࠧ ⥯ double + 20 - ᫮ ࠧ冷 BCD + ja .Error + cmp [Data_Sign_Exp],0 + je @f + neg ebx + @@: + cmp [Data_Flag],0 ;窠 砫? + 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 \ No newline at end of file diff --git a/programs/develop/libraries/TinyGL/asm_fork/tinygl.asm b/programs/develop/libraries/TinyGL/asm_fork/tinygl.asm index 07ae221385..23828cb7ad 100644 --- a/programs/develop/libraries/TinyGL/asm_fork/tinygl.asm +++ b/programs/develop/libraries/TinyGL/asm_fork/tinygl.asm @@ -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 ) diff --git a/programs/develop/libraries/libs-dev/libimg/png/libpng/png.asm b/programs/develop/libraries/libs-dev/libimg/png/libpng/png.asm index b933727d08..9976c29bf4 100644 --- a/programs/develop/libraries/libs-dev/libimg/png/libpng/png.asm +++ b/programs/develop/libraries/libs-dev/libimg/png/libpng/png.asm @@ -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] diff --git a/programs/media/log_el/trunk/le_libs.inc b/programs/media/log_el/trunk/le_libs.inc index b9f35ee43b..cfd5de7972 100644 --- a/programs/media/log_el/trunk/le_libs.inc +++ b/programs/media/log_el/trunk/le_libs.inc @@ -1 +1 @@ -;include 'load_lib.mac' ;include 'mem.inc' ;include '../../../dll.inc' ;@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load head_f_i: head_f_l db '⥬ 訡',0 system_dir_0 db '/sys/lib/' lib_name_0 db 'proc_lib.obj',0 err_message_found_lib_0 db ' ⥪ ',39,'proc_lib.obj',39,0 err_message_import_0 db '訡 ⥪ ',39,'proc_lib.obj',39,0 system_dir_1 db '/sys/lib/' lib_name_1 db 'libimg.obj',0 err_message_found_lib_1 db ' ⥪ ',39,'libimg.obj',39,0 err_message_import_1 db '訡 ⥪ ',39,'libimg.obj',39,0 system_dir_2 db '/sys/lib/' lib_name_2 db 'box_lib.obj',0 err_message_found_lib_2 db ' ⥪ ',39,'box_lib.obj',39,0 err_message_import_2 db '訡 ⥪ ',39,'box_lib.obj',39,0 system_dir_3 db '/sys/lib/' lib_name_3 db 'libini.obj',0 err_message_found_lib_3 db ' ⥪ ',39,'libini.obj',39,0 err_message_import_3 db '訡 ⥪ ',39,'libini.obj',39,0 system_dir_7 db '/sys/lib/' lib_name_7 db 'buf2d.obj',0 err_msg_found_lib_7 db ' ⥪ ',39,'buf2d.obj',39,0 err_msg_import_7 db '訡 ⥪ ',39,'buf2d',39,0 l_libs_start: lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\ err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\ err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i lib2 l_libs lib_name_2, sys_path, file_name, system_dir_2,\ err_message_found_lib_2, head_f_l, import_box_lib, err_message_import_2, head_f_i lib3 l_libs lib_name_3, sys_path, file_name, system_dir_3,\ err_message_found_lib_3, head_f_l, import_libini, err_message_import_3, head_f_i lib_7 l_libs lib_name_7, sys_path, library_path, system_dir_7,\ err_msg_found_lib_7,head_f_l,import_buf2d,err_msg_import_7,head_f_i l_libs_end: align 4 proclib_import: ;ᠭ ᯮ㥬 㭪権 OpenDialog_Init dd aOpenDialog_Init OpenDialog_Start dd aOpenDialog_Start dd 0,0 aOpenDialog_Init db 'OpenDialog_init',0 aOpenDialog_Start db 'OpenDialog_start',0 align 4 import_libimg: dd alib_init1 img_is_img dd aimg_is_img img_info dd aimg_info img_from_file dd aimg_from_file img_to_file dd aimg_to_file img_from_rgb dd aimg_from_rgb img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode img_encode dd aimg_encode img_create dd aimg_create img_destroy dd aimg_destroy img_destroy_layer dd aimg_destroy_layer img_count dd aimg_count img_lock_bits dd aimg_lock_bits img_unlock_bits dd aimg_unlock_bits img_flip dd aimg_flip img_flip_layer dd aimg_flip_layer img_rotate dd aimg_rotate img_rotate_layer dd aimg_rotate_layer img_draw dd aimg_draw dd 0,0 alib_init1 db 'lib_init',0 aimg_is_img db 'img_is_img',0 ;। , ⥪ ᤥ ࠦ aimg_info db 'img_info',0 aimg_from_file db 'img_from_file',0 aimg_to_file db 'img_to_file',0 aimg_from_rgb db 'img_from_rgb',0 aimg_to_rgb db 'img_to_rgb',0 ;८ࠧ ࠦ RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;⮬᪨ । ଠ ᪨ aimg_encode db 'img_encode',0 aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 aimg_destroy_layer db 'img_destroy_layer',0 aimg_count db 'img_count',0 aimg_lock_bits db 'img_lock_bits',0 aimg_unlock_bits db 'img_unlock_bits',0 aimg_flip db 'img_flip',0 aimg_flip_layer db 'img_flip_layer',0 aimg_rotate db 'img_rotate',0 aimg_rotate_layer db 'img_rotate_layer',0 aimg_draw db 'img_draw',0 align 4 import_box_lib: dd alib_init2 ;㭪 ᪠ ᮬ 1 ࠧ 祭 ⥪, ⮬ ணࠬ ⪠ 㦭 edit_box_draw dd aEdit_box_draw edit_box_key dd aEdit_box_key edit_box_mouse dd aEdit_box_mouse ; version_ed dd aVersion_ed scrollbar_ver_draw dd aScrollbar_ver_draw ; scrollbar_ver_mouse dd aScrollbar_ver_mouse scrollbar_hor_draw dd aScrollbar_hor_draw ; scrollbar_hor_mouse dd aScrollbar_hor_mouse ; version_scrollbar dd aVersion_scrollbar tl_data_init dd sz_tl_data_init tl_data_clear dd sz_tl_data_clear tl_info_clear dd sz_tl_info_clear tl_key dd sz_tl_key tl_mouse dd sz_tl_mouse tl_draw dd sz_tl_draw tl_info_undo dd sz_tl_info_undo tl_info_redo dd sz_tl_info_redo tl_node_add dd sz_tl_node_add tl_node_set_data dd sz_tl_node_set_data tl_node_get_data dd sz_tl_node_get_data tl_node_delete dd sz_tl_node_delete tl_cur_beg dd sz_tl_cur_beg tl_cur_next dd sz_tl_cur_next tl_cur_perv dd sz_tl_cur_perv tl_node_close_open dd sz_tl_node_close_open tl_node_lev_inc dd sz_tl_node_lev_inc tl_node_lev_dec dd sz_tl_node_lev_dec tl_node_move_up dd sz_tl_node_move_up tl_node_move_down dd sz_tl_node_move_down tl_save_mem dd sz_tl_save_mem tl_load_mem dd sz_tl_load_mem tl_get_mem_size dd sz_tl_get_mem_size tl_node_poi_get_info dd sz_tl_node_poi_get_info tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info tl_node_poi_get_data dd sz_tl_node_poi_get_data dd 0,0 alib_init2 db 'lib_init',0 aEdit_box_draw db 'edit_box',0 aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 ; aVersion_ed db 'version_ed',0 aScrollbar_ver_draw db 'scrollbar_v_draw',0 ; aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 aScrollbar_hor_draw db 'scrollbar_h_draw',0 ; aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 ; aVersion_scrollbar db 'version_scrollbar',0 sz_tl_data_init db 'tl_data_init',0 sz_tl_data_clear db 'tl_data_clear',0 sz_tl_info_clear db 'tl_info_clear',0 sz_tl_key db 'tl_key',0 sz_tl_mouse db 'tl_mouse',0 sz_tl_draw db 'tl_draw',0 sz_tl_info_undo db 'tl_info_undo',0 sz_tl_info_redo db 'tl_info_redo',0 sz_tl_node_add db 'tl_node_add',0 sz_tl_node_set_data db 'tl_node_set_data',0 sz_tl_node_get_data db 'tl_node_get_data',0 sz_tl_node_delete db 'tl_node_delete',0 sz_tl_cur_beg db 'tl_cur_beg',0 sz_tl_cur_next db 'tl_cur_next',0 sz_tl_cur_perv db 'tl_cur_perv',0 sz_tl_node_close_open db 'tl_node_close_open',0 sz_tl_node_lev_inc db 'tl_node_lev_inc',0 sz_tl_node_lev_dec db 'tl_node_lev_dec',0 sz_tl_node_move_up db 'tl_node_move_up',0 sz_tl_node_move_down db 'tl_node_move_down',0 sz_tl_save_mem db 'tl_save_mem',0 sz_tl_load_mem db 'tl_load_mem',0 sz_tl_get_mem_size db 'tl_get_mem_size',0 sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0 sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0 sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0 align 4 import_libini: dd alib_init0 ini_get_str dd aini_get_str ini_get_int dd aini_get_int ini_get_color dd aini_get_color dd 0,0 alib_init0 db 'lib_init',0 aini_get_str db 'ini_get_str',0 aini_get_int db 'ini_get_int',0 aini_get_color db 'ini_get_color',0 align 4 import_buf2d: init dd sz_init buf2d_create dd sz_buf2d_create buf2d_create_f_img dd sz_buf2d_create_f_img buf2d_clear dd sz_buf2d_clear buf2d_draw dd sz_buf2d_draw buf2d_delete dd sz_buf2d_delete buf2d_line dd sz_buf2d_line buf2d_rect_by_size dd sz_buf2d_rect_by_size buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size buf2d_circle dd sz_buf2d_circle buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2 buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2 buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8 buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32 buf2d_bit_blt dd sz_buf2d_bit_blt buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha buf2d_curve_bezier dd sz_buf2d_curve_bezier buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix buf2d_draw_text dd sz_buf2d_draw_text buf2d_crop_color dd sz_buf2d_crop_color buf2d_offset_h dd sz_buf2d_offset_h buf2d_flood_fill dd sz_buf2d_flood_fill buf2d_set_pixel dd sz_buf2d_set_pixel dd 0,0 sz_init db 'lib_init',0 sz_buf2d_create db 'buf2d_create',0 sz_buf2d_create_f_img db 'buf2d_create_f_img',0 sz_buf2d_clear db 'buf2d_clear',0 sz_buf2d_draw db 'buf2d_draw',0 sz_buf2d_delete db 'buf2d_delete',0 sz_buf2d_line db 'buf2d_line',0 sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0 sz_buf2d_circle db 'buf2d_circle',0 sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0 sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0 sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0 sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0 sz_buf2d_bit_blt db 'buf2d_bit_blt',0 sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0 sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0 sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0 sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0 sz_buf2d_draw_text db 'buf2d_draw_text',0 sz_buf2d_crop_color db 'buf2d_crop_color',0 sz_buf2d_offset_h db 'buf2d_offset_h',0 sz_buf2d_flood_fill db 'buf2d_flood_fill',0 sz_buf2d_set_pixel db 'buf2d_set_pixel',0 + system_dir_0 db '/sys/lib/' lib_name_0 db 'proc_lib.obj',0 system_dir_1 db '/sys/lib/' lib_name_1 db 'libimg.obj',0 system_dir_2 db '/sys/lib/' lib_name_2 db 'box_lib.obj',0 system_dir_3 db '/sys/lib/' lib_name_3 db 'libini.obj',0 system_dir_4 db '/sys/lib/' lib_name_4 db 'buf2d.obj',0 l_libs_start: lib0 l_libs lib_name_0, file_name, system_dir_0, import_proclib lib1 l_libs lib_name_1, file_name, system_dir_1, import_libimg lib2 l_libs lib_name_2, file_name, system_dir_2, import_box_lib lib3 l_libs lib_name_3, file_name, system_dir_3, import_libini lib4 l_libs lib_name_4, file_name, system_dir_4, import_buf2d l_libs_end: align 4 import_proclib: OpenDialog_Init dd aOpenDialog_Init OpenDialog_Start dd aOpenDialog_Start dd 0,0 aOpenDialog_Init db 'OpenDialog_init',0 aOpenDialog_Start db 'OpenDialog_start',0 align 4 import_libimg: dd alib_init1 img_is_img dd aimg_is_img img_info dd aimg_info img_from_file dd aimg_from_file img_to_file dd aimg_to_file img_from_rgb dd aimg_from_rgb img_to_rgb dd aimg_to_rgb img_to_rgb2 dd aimg_to_rgb2 img_decode dd aimg_decode img_encode dd aimg_encode img_create dd aimg_create img_destroy dd aimg_destroy img_destroy_layer dd aimg_destroy_layer img_count dd aimg_count img_lock_bits dd aimg_lock_bits img_unlock_bits dd aimg_unlock_bits img_flip dd aimg_flip img_flip_layer dd aimg_flip_layer img_rotate dd aimg_rotate img_rotate_layer dd aimg_rotate_layer img_draw dd aimg_draw dd 0,0 alib_init1 db 'lib_init',0 aimg_is_img db 'img_is_img',0 ;। , ⥪ ᤥ ࠦ aimg_info db 'img_info',0 aimg_from_file db 'img_from_file',0 aimg_to_file db 'img_to_file',0 aimg_from_rgb db 'img_from_rgb',0 aimg_to_rgb db 'img_to_rgb',0 ;८ࠧ ࠦ RGB aimg_to_rgb2 db 'img_to_rgb2',0 aimg_decode db 'img_decode',0 ;⮬᪨ । ଠ ᪨ aimg_encode db 'img_encode',0 aimg_create db 'img_create',0 aimg_destroy db 'img_destroy',0 aimg_destroy_layer db 'img_destroy_layer',0 aimg_count db 'img_count',0 aimg_lock_bits db 'img_lock_bits',0 aimg_unlock_bits db 'img_unlock_bits',0 aimg_flip db 'img_flip',0 aimg_flip_layer db 'img_flip_layer',0 aimg_rotate db 'img_rotate',0 aimg_rotate_layer db 'img_rotate_layer',0 aimg_draw db 'img_draw',0 align 4 import_box_lib: dd alib_init2 ;㭪 ᪠ ᮬ 1 ࠧ 祭 ⥪, ⮬ ணࠬ ⪠ 㦭 edit_box_draw dd aEdit_box_draw edit_box_key dd aEdit_box_key edit_box_mouse dd aEdit_box_mouse ; version_ed dd aVersion_ed scrollbar_ver_draw dd aScrollbar_ver_draw ; scrollbar_ver_mouse dd aScrollbar_ver_mouse scrollbar_hor_draw dd aScrollbar_hor_draw ; scrollbar_hor_mouse dd aScrollbar_hor_mouse ; version_scrollbar dd aVersion_scrollbar tl_data_init dd sz_tl_data_init tl_data_clear dd sz_tl_data_clear tl_info_clear dd sz_tl_info_clear tl_key dd sz_tl_key tl_mouse dd sz_tl_mouse tl_draw dd sz_tl_draw tl_info_undo dd sz_tl_info_undo tl_info_redo dd sz_tl_info_redo tl_node_add dd sz_tl_node_add tl_node_set_data dd sz_tl_node_set_data tl_node_get_data dd sz_tl_node_get_data tl_node_delete dd sz_tl_node_delete tl_cur_beg dd sz_tl_cur_beg tl_cur_next dd sz_tl_cur_next tl_cur_perv dd sz_tl_cur_perv tl_node_close_open dd sz_tl_node_close_open tl_node_lev_inc dd sz_tl_node_lev_inc tl_node_lev_dec dd sz_tl_node_lev_dec tl_node_move_up dd sz_tl_node_move_up tl_node_move_down dd sz_tl_node_move_down tl_save_mem dd sz_tl_save_mem tl_load_mem dd sz_tl_load_mem tl_get_mem_size dd sz_tl_get_mem_size tl_node_poi_get_info dd sz_tl_node_poi_get_info tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info tl_node_poi_get_data dd sz_tl_node_poi_get_data dd 0,0 alib_init2 db 'lib_init',0 aEdit_box_draw db 'edit_box',0 aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 ; aVersion_ed db 'version_ed',0 aScrollbar_ver_draw db 'scrollbar_v_draw',0 ; aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 aScrollbar_hor_draw db 'scrollbar_h_draw',0 ; aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 ; aVersion_scrollbar db 'version_scrollbar',0 sz_tl_data_init db 'tl_data_init',0 sz_tl_data_clear db 'tl_data_clear',0 sz_tl_info_clear db 'tl_info_clear',0 sz_tl_key db 'tl_key',0 sz_tl_mouse db 'tl_mouse',0 sz_tl_draw db 'tl_draw',0 sz_tl_info_undo db 'tl_info_undo',0 sz_tl_info_redo db 'tl_info_redo',0 sz_tl_node_add db 'tl_node_add',0 sz_tl_node_set_data db 'tl_node_set_data',0 sz_tl_node_get_data db 'tl_node_get_data',0 sz_tl_node_delete db 'tl_node_delete',0 sz_tl_cur_beg db 'tl_cur_beg',0 sz_tl_cur_next db 'tl_cur_next',0 sz_tl_cur_perv db 'tl_cur_perv',0 sz_tl_node_close_open db 'tl_node_close_open',0 sz_tl_node_lev_inc db 'tl_node_lev_inc',0 sz_tl_node_lev_dec db 'tl_node_lev_dec',0 sz_tl_node_move_up db 'tl_node_move_up',0 sz_tl_node_move_down db 'tl_node_move_down',0 sz_tl_save_mem db 'tl_save_mem',0 sz_tl_load_mem db 'tl_load_mem',0 sz_tl_get_mem_size db 'tl_get_mem_size',0 sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0 sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0 sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0 align 4 import_libini: dd alib_init0 ini_get_str dd aini_get_str ini_get_int dd aini_get_int ini_get_color dd aini_get_color dd 0,0 alib_init0 db 'lib_init',0 aini_get_str db 'ini_get_str',0 aini_get_int db 'ini_get_int',0 aini_get_color db 'ini_get_color',0 align 4 import_buf2d: init dd sz_init buf2d_create dd sz_buf2d_create buf2d_create_f_img dd sz_buf2d_create_f_img buf2d_clear dd sz_buf2d_clear buf2d_draw dd sz_buf2d_draw buf2d_delete dd sz_buf2d_delete buf2d_line dd sz_buf2d_line buf2d_rect_by_size dd sz_buf2d_rect_by_size buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size buf2d_circle dd sz_buf2d_circle buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2 buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2 buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8 buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32 buf2d_bit_blt dd sz_buf2d_bit_blt buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha buf2d_curve_bezier dd sz_buf2d_curve_bezier buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix buf2d_draw_text dd sz_buf2d_draw_text buf2d_crop_color dd sz_buf2d_crop_color buf2d_offset_h dd sz_buf2d_offset_h buf2d_flood_fill dd sz_buf2d_flood_fill buf2d_set_pixel dd sz_buf2d_set_pixel dd 0,0 sz_init db 'lib_init',0 sz_buf2d_create db 'buf2d_create',0 sz_buf2d_create_f_img db 'buf2d_create_f_img',0 sz_buf2d_clear db 'buf2d_clear',0 sz_buf2d_draw db 'buf2d_draw',0 sz_buf2d_delete db 'buf2d_delete',0 sz_buf2d_line db 'buf2d_line',0 sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0 sz_buf2d_circle db 'buf2d_circle',0 sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0 sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0 sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0 sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0 sz_buf2d_bit_blt db 'buf2d_bit_blt',0 sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0 sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0 sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0 sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0 sz_buf2d_draw_text db 'buf2d_draw_text',0 sz_buf2d_crop_color db 'buf2d_crop_color',0 sz_buf2d_offset_h db 'buf2d_offset_h',0 sz_buf2d_flood_fill db 'buf2d_flood_fill',0 sz_buf2d_set_pixel db 'buf2d_set_pixel',0 diff --git a/programs/media/log_el/trunk/log_el.asm b/programs/media/log_el/trunk/log_el.asm index 3dab7d7ce8..0ae7e01417 100644 --- a/programs/media/log_el/trunk/log_el.asm +++ b/programs/media/log_el/trunk/log_el.asm @@ -1,5 +1,5 @@ use32 - org 0x0 + org 0 db 'MENUET01' ;. ᯮ塞 䠩 ᥣ 8 dd 1,start,i_end,mem,stacktop,0,sys_path @@ -42,11 +42,12 @@ include '../../../macros.inc' include '../../../proc32.inc' include '../../../KOSfuncs.inc' include '../../../load_img.inc' +include '../../../load_lib.mac' include '../../../develop/libraries/box_lib/trunk/box_lib.mac' include 'le_pole.inc' include 'le_signal.inc' -@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load +@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load caption db '᪨ 13.02.16',0 ; panel_0_coord_top equ 5 ; न 0- 鸞 㬥⮢ @@ -171,12 +172,6 @@ mcs dd 1, 0, 0, 1,\ 0,-1, 1, 0 IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3 -image_data_toolbar dd 0 - -icon_tl_sys dd 0 ;㪠⥫ ࠭ ⥬ -icon_toolbar dd 0 ;㪠⥫ ࠭ ꥪ⮢ - -image_data_gray dd 0 ; ६묨 묨 ࠦﬨ ଠ 24-bit, ᮧ cursors_count equ 4 @@ -196,7 +191,7 @@ align 4 start: load_libraries l_libs_start,l_libs_end ;஢ઠ ᪮쪮 㤠筮 㧨 ⥪ - mov ebp,lib_7 + mov ebp,lib4 cmp dword [ebp+ll_struc_size-4],0 jz @f mcall SF_TERMINATE_PROCESS @@ -205,7 +200,7 @@ start: mcall SF_SET_EVENTS_MASK,0x27 ;*** 뢠 ஥ *.ini 䠩 - copy_path ini_name,sys_path,file_name,0x0 + copy_path ini_name,sys_path,file_name,0 stdcall dword[ini_get_color],file_name,ini_sec_color,key_color_bkgnd,ini_def_c_bkgnd mov dword[buf_0.color],eax @@ -642,7 +637,7 @@ pushad mcall SF_CREATE_WINDOW, (20 shl 16)+580,(20 shl 16)+415 ; *** ᮧ *** - mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_0_coord_top shl 16)+20, 3,, [sc.work_button] + mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_0_coord_top shl 16)+20, 3, [sc.work_button] add ebx,25 shl 16 mov edx,4 @@ -758,27 +753,26 @@ pushad stdcall pole_draw_pok, pole ; *** ᮧ ⠭ ᨣ set_0 set_1 *** - mov esi,[sc.work_button] - mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_1_coord_top shl 16)+20, 20 + mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_1_coord_top shl 16)+20, 20, [sc.work_button] add ebx,25 shl 16 - mov edx,21 + inc edx int 0x40 add ebx,30 shl 16 - mov edx,22 + inc edx int 0x40 add ebx,25 shl 16 - mov edx,23 + inc edx int 0x40 add ebx,25 shl 16 - mov edx,24 + inc edx int 0x40 add ebx,25 shl 16 - mov edx,25 + inc edx int 0x40 mov ecx,[sc.work_text] @@ -808,8 +802,7 @@ pushad int 0x40 ; *** ᮧ ᮢ ஢ *** - mov esi,[sc.work_button] - mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_2_coord_top shl 16)+20, 30 + mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (panel_2_coord_top shl 16)+20, 30, [sc.work_button] add ebx,30 shl 16 mov edx,31 @@ -1042,11 +1035,6 @@ shem_colors: dd color_s0, color_s1, color_s2, color_s3 color_captions dd 0x808080 -align 4 -open_file_lif: - rb 2*4096 ; 䠩 -.end: - align 4 but_open_file: pushad @@ -1080,8 +1068,8 @@ but_open_file: mov esi,txt_size call str_analiz_r - cmp edi,0 - je @f + or edi,edi + jz @f stdcall str_len,esi add edi,eax stdcall conv_str_to_int,edi @@ -1104,8 +1092,8 @@ but_open_file: mov esi,txt_elements call str_analiz_r - cmp edi,0 - je .end_elems + or edi,edi + jz .end_elems stdcall str_len,esi add edi,eax stdcall conv_str_to_int,edi @@ -1416,8 +1404,8 @@ pushad inc edx push edx stdcall pole_cell_find, edi - cmp eax,0 - je @f + or eax,eax + jz @f or dword[napr],1 @@: @@ -1427,8 +1415,8 @@ pushad mov edx,[ebx+offs_cell_x] push edx stdcall pole_cell_find, edi - cmp eax,0 - je @f + or eax,eax + jz @f or dword[napr],2 @@: @@ -1438,8 +1426,8 @@ pushad dec edx push edx stdcall pole_cell_find, edi - cmp eax,0 - je @f + or eax,eax + jz @f or dword[napr],4 @@: @@ -1449,8 +1437,8 @@ pushad mov edx,[ebx+offs_cell_x] push edx stdcall pole_cell_find, edi - cmp eax,0 - je @f + or eax,eax + jz @f or dword[napr],8 @@: @@ -1970,15 +1958,13 @@ proc move_rotate_n90 uses ecx edi, d_x:dword, d_y:dword, angle:dword endp align 4 -proc mem_copy, destination:dword, source:dword, len:dword - push ecx esi edi - cld - mov esi, dword[source] - mov edi, dword[destination] - mov ecx, dword[len] - rep movsb - pop edi esi ecx - ret +proc mem_copy uses ecx esi edi, destination:dword, source:dword, len:dword + cld + mov edi,[destination] + mov esi,[source] + mov ecx,[len] + rep movsb + ret endp ;description: @@ -2290,8 +2276,8 @@ proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword, hot_p:dword add ecx,[buf_curs.data] mcall SF_MOUSE_GET,SSF_LOAD_CURSOR - cmp eax,0 - je @f + or eax,eax + jz @f mov [cursor_pointer],eax mcall SF_MOUSE_GET,SSF_SET_CURSOR,[cursor_pointer] @@: @@ -2339,15 +2325,6 @@ db 0 include 'le_libs.inc' -mouse_dd dd 0x0 -sc system_colors -last_time dd 0 - - - -align 16 -procinfo process_information - align 4 buf_0: dd 0 ; .l: dw 170 ;+4 left @@ -2360,8 +2337,7 @@ buf_0: dd 0 ; align 4 buf_font: ; ⮬ dd 0 ;㪠⥫ ࠦ - dw 25 ;+4 left - dw 25 ;+6 top + dw 25,25 ;+4 left,top dd 96 ;+8 w dd 144 ;+12 h dd 0 ;+16 color @@ -2370,8 +2346,7 @@ buf_font: ; align 4 buf_curs: ; ࠬ .data: dd 0 ;㪠⥫ ࠦ - dw 0 ;+4 left - dw 0 ;+6 top + dw 0,0 ;+4 left,top dd 32 ;+8 w dd 32*cursors_count ;+12 h dd 0 ;+16 color @@ -2380,8 +2355,7 @@ buf_curs: ; align 4 buf_curs_8: ; ࠬ .data: dd 0 ;㪠⥫ ࠦ - dw 0 ;+4 left - dw 0 ;+6 top + dw 0,0 ;+4 left,top dd 32 ;+8 w dd 32*cursors_count ;+12 h dd 0 ;+16 color @@ -2618,13 +2592,22 @@ align 4 align 16 i_end: + image_data_toolbar dd 0 + icon_tl_sys dd 0 ;㪠⥫ ࠭ ⥬ + icon_toolbar dd 0 ;㪠⥫ ࠭ ꥪ⮢ + image_data_gray dd 0 ; ६묨 묨 ࠦﬨ ଠ 24-bit, ᮧ + mouse_dd dd 0 + last_time dd 0 + sc system_colors + procinfo process_information run_file_70 FileInfoBlock + open_file_lif: + rb 2*4096 ; 䠩 + .end: rb 1024 stacktop: sys_path rb 1024 - file_name: - rb 1024 ;4096 - library_path rb 1024 + file_name rb 2048 ;4096 plugin_path rb 4096 openfile_path rb 4096 filename_area rb 256 diff --git a/programs/other/ha/HACONFIG.ASM b/programs/other/ha/HACONFIG.ASM index 00600f0296..036f2be1e1 100644 --- a/programs/other/ha/HACONFIG.ASM +++ b/programs/other/ha/HACONFIG.ASM @@ -44,8 +44,9 @@ include 'lang.inc' ; include '../../macros.inc' include '../../proc32.inc' include '../../dll.inc' +include '../../KOSfuncs.inc' include '../../develop/libraries/box_lib/trunk/box_lib.mac' ; checkBox editBox -include '../../develop/libraries/box_lib/load_lib.mac' ; +include '../../load_lib.mac' ; @use_library KMENUITEM_NORMAL equ 0 @@ -1431,13 +1432,6 @@ valueModeMenu1 db ' valueModeMenu2 db '० 祩 ',0 valueModeMenu3 db '० ⨢樨',0 -head_f_i: - head_f_l db '⥬ 訡',0 - err_message_found_lib0 db ' ⥪ ',39,'proc_lib.obj',39,0 - err_message_import0 db '訡 ⥪ ',39,'proc_lib.obj',39,0 - err_message_found_lib1 db ' ⥪ ',39,'kmenu.obj',39,0 - err_message_import1 db '訡 ⥪ ',39,'kmenu',39,0 - hkCaption: db ':',0 ;hkHint: db ' ',0 radiusCaption: db ':',0 @@ -1468,13 +1462,6 @@ valueModeMenu1 db 'classic mode ',0 valueModeMenu2 db 'hot key mode ',0 valueModeMenu3 db 'activation key gesture mode ',0 -head_f_i: - head_f_l db 'System error',0 - err_message_found_lib0 db 'Could not find library ',39,'proc_lib.obj',39,0 - err_message_import0 db 'Error importing library ',39,'proc_lib.obj',39,0 - err_message_found_lib1 db 'Could not find library ',39,'kmenu.obj',39,0 - err_message_import1 db 'Error importing library ',39,'kmenu',39,0 - hkCaption: db 'Key:',0 ;hkHint: db 'press any key',0 radiusCaption: db 'Radius:',0 @@ -1717,24 +1704,17 @@ coordModeMenu: .y dw 200 -align 4 -proclib_import: ; - OpenDialog_Init dd aOpenDialog_Init - OpenDialog_Start dd aOpenDialog_Start -dd 0,0 - aOpenDialog_Init db 'OpenDialog_init',0 - aOpenDialog_Start db 'OpenDialog_start',0 - system_dir0 db '/sys/lib/' lib0_name db 'proc_lib.obj',0 +system_dir1 db '/sys/lib/' lib1_name db 'kmenu.obj',0 symbolDownArrow db 25,0 ;library structures l_libs_start: - lib0 l_libs lib0_name, sys_path, file_name, system_dir0, err_message_found_lib0, head_f_l, proclib_import,err_message_import0, head_f_i - lib1 l_libs lib1_name, sys_path, file_name, system_dir0, err_message_found_lib1, head_f_l, import_libkmenu,err_message_import1,head_f_i + lib0 l_libs lib0_name, file_name, system_dir0, import_proclib + lib1 l_libs lib1_name, file_name, system_dir1, import_libkmenu load_lib_end: @@ -1748,6 +1728,14 @@ editRU edit_box 230-buttonW,290,85, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0x1000000 editRD edit_box 230-buttonW,290,120, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0x10000000, edMaxSize, dataBuffer.4, mouse_dd, 0, edMax, edMax editRadius edit_box 40,(buttonHotKeyX + buttonHotKeyWidth + 20),buttonModeY, 0xffffff, 0x6a9480, 0, 0xAABBCC, 0x10000000, 4, radiusBuffer.data, mouse_dd, ed_figure_only, edMax, edMax +align 4 +import_proclib: + OpenDialog_Init dd aOpenDialog_Init + OpenDialog_Start dd aOpenDialog_Start +dd 0,0 + aOpenDialog_Init db 'OpenDialog_init',0 + aOpenDialog_Start db 'OpenDialog_start',0 + align 4 import_libkmenu: kmenu_init dd akmenu_init