From d22ed6d38704dca7e94f14c362b041ac593c3f64 Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Thu, 7 Aug 2014 11:48:01 +0000 Subject: [PATCH] sdk: update Makefiles && libsound git-svn-id: svn://kolibrios.org@5022 a494cfbc-eb01-0410-851d-a64ba20cac60 --- contrib/sdk/sources/Intel-2D/Makefile | 2 +- contrib/sdk/sources/Makefile | 9 +- contrib/sdk/sources/Mesa/Makefile | 2 +- contrib/sdk/sources/Mesa/include/GL/glu.h | 353 ++++++++++++++++++ .../sdk/sources/Mesa/include/GL/glu_mangle.h | 86 +++++ contrib/sdk/sources/Mesa/src/egl/Makefile | 2 +- contrib/sdk/sources/Mesa/src/glsl/Makefile | 2 +- contrib/sdk/sources/Mesa/src/mapi/Makefile | 2 +- contrib/sdk/sources/Mesa/src/mesa/Makefile | 2 +- contrib/sdk/sources/cairo/Makefile | 2 +- contrib/sdk/sources/eglut/Makefile | 2 +- contrib/sdk/sources/expat/Makefile | 2 +- contrib/sdk/sources/ffmpeg/config.mak | 2 +- contrib/sdk/sources/freetype/Makefile | 2 +- contrib/sdk/sources/gcc_eh/Makefile | 2 +- contrib/sdk/sources/libdrm/Makefile | 2 +- contrib/sdk/sources/libdrm/include/drm/drm.h | 5 +- .../sources/libdrm/include/drm/drm_fourcc.h | 5 + .../sdk/sources/libdrm/include/drm/drm_mode.h | 46 ++- .../sdk/sources/libdrm/include/drm/i915_drm.h | 113 +++++- contrib/sdk/sources/libpng/Makefile | 2 +- contrib/sdk/sources/libsupc++/Makefile | 2 +- contrib/sdk/sources/newlib/libc/Makefile | 2 +- contrib/sdk/sources/newlib/libc/pe/loader.c | 42 ++- contrib/sdk/sources/pixman/Makefile | 2 +- contrib/sdk/sources/render/Makefile | 2 +- contrib/sdk/sources/sound/Makefile | 21 ++ contrib/sdk/sources/sound/include/snd.inc | 42 +++ contrib/sdk/sources/sound/include/sound.h | 142 +++++++ contrib/sdk/sources/sound/src/init.asm | 118 ++++++ contrib/sdk/sources/sound/src/proc32.inc | 268 +++++++++++++ contrib/sdk/sources/sound/src/setbuf.asm | 62 +++ contrib/sdk/sources/sound/src/snd.inc | 41 ++ contrib/sdk/sources/sound/src/sndgetfmt.asm | 35 ++ contrib/sdk/sources/sound/src/sndgetmvol.asm | 74 ++++ contrib/sdk/sources/sound/src/sndgetpan.asm | 35 ++ contrib/sdk/sources/sound/src/sndgetpos.asm | 36 ++ contrib/sdk/sources/sound/src/sndgetsize.asm | 63 ++++ contrib/sdk/sources/sound/src/sndgetvol.asm | 44 +++ contrib/sdk/sources/sound/src/sndout.asm | 34 ++ contrib/sdk/sources/sound/src/sndreset.asm | 36 ++ contrib/sdk/sources/sound/src/sndsetfmt.asm | 35 ++ contrib/sdk/sources/sound/src/sndsetmvol.asm | 36 ++ contrib/sdk/sources/sound/src/sndsetpan.asm | 34 ++ contrib/sdk/sources/sound/src/sndsetpos.asm | 36 ++ contrib/sdk/sources/sound/src/sndsetvol.asm | 36 ++ contrib/sdk/sources/sound/src/sndtime.asm | 90 +++++ contrib/sdk/sources/sound/src/stopbuf.asm | 37 ++ contrib/sdk/sources/sound/src/wavhdr.asm | 170 +++++++++ contrib/sdk/sources/zlib/Makefile | 2 +- contrib/sdk/sources/zlib/zlib.def | 2 +- 51 files changed, 2178 insertions(+), 46 deletions(-) create mode 100644 contrib/sdk/sources/Mesa/include/GL/glu.h create mode 100644 contrib/sdk/sources/Mesa/include/GL/glu_mangle.h create mode 100644 contrib/sdk/sources/sound/Makefile create mode 100644 contrib/sdk/sources/sound/include/snd.inc create mode 100644 contrib/sdk/sources/sound/include/sound.h create mode 100644 contrib/sdk/sources/sound/src/init.asm create mode 100644 contrib/sdk/sources/sound/src/proc32.inc create mode 100644 contrib/sdk/sources/sound/src/setbuf.asm create mode 100644 contrib/sdk/sources/sound/src/snd.inc create mode 100644 contrib/sdk/sources/sound/src/sndgetfmt.asm create mode 100644 contrib/sdk/sources/sound/src/sndgetmvol.asm create mode 100644 contrib/sdk/sources/sound/src/sndgetpan.asm create mode 100644 contrib/sdk/sources/sound/src/sndgetpos.asm create mode 100644 contrib/sdk/sources/sound/src/sndgetsize.asm create mode 100644 contrib/sdk/sources/sound/src/sndgetvol.asm create mode 100644 contrib/sdk/sources/sound/src/sndout.asm create mode 100644 contrib/sdk/sources/sound/src/sndreset.asm create mode 100644 contrib/sdk/sources/sound/src/sndsetfmt.asm create mode 100644 contrib/sdk/sources/sound/src/sndsetmvol.asm create mode 100644 contrib/sdk/sources/sound/src/sndsetpan.asm create mode 100644 contrib/sdk/sources/sound/src/sndsetpos.asm create mode 100644 contrib/sdk/sources/sound/src/sndsetvol.asm create mode 100644 contrib/sdk/sources/sound/src/sndtime.asm create mode 100644 contrib/sdk/sources/sound/src/stopbuf.asm create mode 100644 contrib/sdk/sources/sound/src/wavhdr.asm diff --git a/contrib/sdk/sources/Intel-2D/Makefile b/contrib/sdk/sources/Intel-2D/Makefile index f3fb76d621..4bbc0bb6cb 100644 --- a/contrib/sdk/sources/Intel-2D/Makefile +++ b/contrib/sdk/sources/Intel-2D/Makefile @@ -5,7 +5,7 @@ AR = kos32-ar LD = kos32-ld STRIP = kos32-strip -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer LDFLAGS:= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 PXFLAGS:= --version-script pixlib.ver --out-implib $(LIBRARY).dll.a diff --git a/contrib/sdk/sources/Makefile b/contrib/sdk/sources/Makefile index fe162d266a..e0ad09c7e6 100644 --- a/contrib/sdk/sources/Makefile +++ b/contrib/sdk/sources/Makefile @@ -7,7 +7,7 @@ LIB_DIR:= $(abspath ../lib) all: newlib zlib libpng freetype pixman cairo \ libdrm pixlib ffmpeg libsupc++ gcc_eh expat \ - Mesa eglut + Mesa eglut sound newlib: $(DLL_DIR)/libc.dll $(LIB_DIR)/libc.dll.a $(LIB_DIR)/libapp.a $(LIB_DIR)/libdll.a @@ -118,4 +118,11 @@ eglut: $(DLL_DIR)/libeglut.dll $(LIB_DIR)/libeglut.dll.a $(LIB_DIR)/libeglut.a $(DLL_DIR)/libeglut.dll $(LIB_DIR)/libeglut.dll.a $(LIB_DIR)/libeglut.a : newlib Mesa $(MAKE) -C eglut + +##################################### + +sound: $(LIB_DIR)/libsound.a + +$(LIB_DIR)/libsound.a : + $(MAKE) -C sound \ No newline at end of file diff --git a/contrib/sdk/sources/Mesa/Makefile b/contrib/sdk/sources/Mesa/Makefile index 1da1c8ff79..174d9dc0de 100644 --- a/contrib/sdk/sources/Mesa/Makefile +++ b/contrib/sdk/sources/Mesa/Makefile @@ -9,7 +9,7 @@ export SDK_DIR:= $(abspath ../..) EGL = egl CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os -CFLAGS_OPT+= -fomit-frame-pointer -mno-ms-bitfields +CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields CFLAGS = -c $(CFLAGS_OPT) LDFLAGS = -nostdlib -shared -s --image-base 0 -T ../newlib/dll.lds -e _DllStartup diff --git a/contrib/sdk/sources/Mesa/include/GL/glu.h b/contrib/sdk/sources/Mesa/include/GL/glu.h new file mode 100644 index 0000000000..ba2228d8d8 --- /dev/null +++ b/contrib/sdk/sources/Mesa/include/GL/glu.h @@ -0,0 +1,353 @@ +/* + * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) + * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice including the dates of first publication and + * either this permission notice or a reference to + * http://oss.sgi.com/projects/FreeB/ + * shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF + * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Except as contained in this notice, the name of Silicon Graphics, Inc. + * shall not be used in advertising or otherwise to promote the sale, use or + * other dealings in this Software without prior written authorization from + * Silicon Graphics, Inc. + */ + +#ifndef __glu_h__ +#define __glu_h__ + +#if defined(USE_MGL_NAMESPACE) +#include "glu_mangle.h" +#endif + +#include + +#ifndef GLAPIENTRY +#if defined(_MSC_VER) || defined(__MINGW32__) +#define GLAPIENTRY __stdcall +#else +#define GLAPIENTRY +#endif +#endif + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GLAPIENTRY * +#endif + +#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(BUILD_GLU32) +# undef GLAPI +# define GLAPI __declspec(dllexport) +#elif (defined(_MSC_VER) || defined(__MINGW32__)) && defined(_DLL) +/* tag specifying we're building for DLL runtime support */ +# undef GLAPI +# define GLAPI __declspec(dllimport) +#elif !defined(GLAPI) +/* for use with static link lib build of Win32 edition only */ +# define GLAPI extern +#endif /* _STATIC_MESA support */ + +#ifdef __cplusplus +extern "C" { +#endif + +/*************************************************************/ + +/* Extensions */ +#define GLU_EXT_object_space_tess 1 +#define GLU_EXT_nurbs_tessellator 1 + +/* Boolean */ +#define GLU_FALSE 0 +#define GLU_TRUE 1 + +/* Version */ +#define GLU_VERSION_1_1 1 +#define GLU_VERSION_1_2 1 +#define GLU_VERSION_1_3 1 + +/* StringName */ +#define GLU_VERSION 100800 +#define GLU_EXTENSIONS 100801 + +/* ErrorCode */ +#define GLU_INVALID_ENUM 100900 +#define GLU_INVALID_VALUE 100901 +#define GLU_OUT_OF_MEMORY 100902 +#define GLU_INCOMPATIBLE_GL_VERSION 100903 +#define GLU_INVALID_OPERATION 100904 + +/* NurbsDisplay */ +/* GLU_FILL */ +#define GLU_OUTLINE_POLYGON 100240 +#define GLU_OUTLINE_PATCH 100241 + +/* NurbsCallback */ +#define GLU_NURBS_ERROR 100103 +#define GLU_ERROR 100103 +#define GLU_NURBS_BEGIN 100164 +#define GLU_NURBS_BEGIN_EXT 100164 +#define GLU_NURBS_VERTEX 100165 +#define GLU_NURBS_VERTEX_EXT 100165 +#define GLU_NURBS_NORMAL 100166 +#define GLU_NURBS_NORMAL_EXT 100166 +#define GLU_NURBS_COLOR 100167 +#define GLU_NURBS_COLOR_EXT 100167 +#define GLU_NURBS_TEXTURE_COORD 100168 +#define GLU_NURBS_TEX_COORD_EXT 100168 +#define GLU_NURBS_END 100169 +#define GLU_NURBS_END_EXT 100169 +#define GLU_NURBS_BEGIN_DATA 100170 +#define GLU_NURBS_BEGIN_DATA_EXT 100170 +#define GLU_NURBS_VERTEX_DATA 100171 +#define GLU_NURBS_VERTEX_DATA_EXT 100171 +#define GLU_NURBS_NORMAL_DATA 100172 +#define GLU_NURBS_NORMAL_DATA_EXT 100172 +#define GLU_NURBS_COLOR_DATA 100173 +#define GLU_NURBS_COLOR_DATA_EXT 100173 +#define GLU_NURBS_TEXTURE_COORD_DATA 100174 +#define GLU_NURBS_TEX_COORD_DATA_EXT 100174 +#define GLU_NURBS_END_DATA 100175 +#define GLU_NURBS_END_DATA_EXT 100175 + +/* NurbsError */ +#define GLU_NURBS_ERROR1 100251 +#define GLU_NURBS_ERROR2 100252 +#define GLU_NURBS_ERROR3 100253 +#define GLU_NURBS_ERROR4 100254 +#define GLU_NURBS_ERROR5 100255 +#define GLU_NURBS_ERROR6 100256 +#define GLU_NURBS_ERROR7 100257 +#define GLU_NURBS_ERROR8 100258 +#define GLU_NURBS_ERROR9 100259 +#define GLU_NURBS_ERROR10 100260 +#define GLU_NURBS_ERROR11 100261 +#define GLU_NURBS_ERROR12 100262 +#define GLU_NURBS_ERROR13 100263 +#define GLU_NURBS_ERROR14 100264 +#define GLU_NURBS_ERROR15 100265 +#define GLU_NURBS_ERROR16 100266 +#define GLU_NURBS_ERROR17 100267 +#define GLU_NURBS_ERROR18 100268 +#define GLU_NURBS_ERROR19 100269 +#define GLU_NURBS_ERROR20 100270 +#define GLU_NURBS_ERROR21 100271 +#define GLU_NURBS_ERROR22 100272 +#define GLU_NURBS_ERROR23 100273 +#define GLU_NURBS_ERROR24 100274 +#define GLU_NURBS_ERROR25 100275 +#define GLU_NURBS_ERROR26 100276 +#define GLU_NURBS_ERROR27 100277 +#define GLU_NURBS_ERROR28 100278 +#define GLU_NURBS_ERROR29 100279 +#define GLU_NURBS_ERROR30 100280 +#define GLU_NURBS_ERROR31 100281 +#define GLU_NURBS_ERROR32 100282 +#define GLU_NURBS_ERROR33 100283 +#define GLU_NURBS_ERROR34 100284 +#define GLU_NURBS_ERROR35 100285 +#define GLU_NURBS_ERROR36 100286 +#define GLU_NURBS_ERROR37 100287 + +/* NurbsProperty */ +#define GLU_AUTO_LOAD_MATRIX 100200 +#define GLU_CULLING 100201 +#define GLU_SAMPLING_TOLERANCE 100203 +#define GLU_DISPLAY_MODE 100204 +#define GLU_PARAMETRIC_TOLERANCE 100202 +#define GLU_SAMPLING_METHOD 100205 +#define GLU_U_STEP 100206 +#define GLU_V_STEP 100207 +#define GLU_NURBS_MODE 100160 +#define GLU_NURBS_MODE_EXT 100160 +#define GLU_NURBS_TESSELLATOR 100161 +#define GLU_NURBS_TESSELLATOR_EXT 100161 +#define GLU_NURBS_RENDERER 100162 +#define GLU_NURBS_RENDERER_EXT 100162 + +/* NurbsSampling */ +#define GLU_OBJECT_PARAMETRIC_ERROR 100208 +#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208 +#define GLU_OBJECT_PATH_LENGTH 100209 +#define GLU_OBJECT_PATH_LENGTH_EXT 100209 +#define GLU_PATH_LENGTH 100215 +#define GLU_PARAMETRIC_ERROR 100216 +#define GLU_DOMAIN_DISTANCE 100217 + +/* NurbsTrim */ +#define GLU_MAP1_TRIM_2 100210 +#define GLU_MAP1_TRIM_3 100211 + +/* QuadricDrawStyle */ +#define GLU_POINT 100010 +#define GLU_LINE 100011 +#define GLU_FILL 100012 +#define GLU_SILHOUETTE 100013 + +/* QuadricCallback */ +/* GLU_ERROR */ + +/* QuadricNormal */ +#define GLU_SMOOTH 100000 +#define GLU_FLAT 100001 +#define GLU_NONE 100002 + +/* QuadricOrientation */ +#define GLU_OUTSIDE 100020 +#define GLU_INSIDE 100021 + +/* TessCallback */ +#define GLU_TESS_BEGIN 100100 +#define GLU_BEGIN 100100 +#define GLU_TESS_VERTEX 100101 +#define GLU_VERTEX 100101 +#define GLU_TESS_END 100102 +#define GLU_END 100102 +#define GLU_TESS_ERROR 100103 +#define GLU_TESS_EDGE_FLAG 100104 +#define GLU_EDGE_FLAG 100104 +#define GLU_TESS_COMBINE 100105 +#define GLU_TESS_BEGIN_DATA 100106 +#define GLU_TESS_VERTEX_DATA 100107 +#define GLU_TESS_END_DATA 100108 +#define GLU_TESS_ERROR_DATA 100109 +#define GLU_TESS_EDGE_FLAG_DATA 100110 +#define GLU_TESS_COMBINE_DATA 100111 + +/* TessContour */ +#define GLU_CW 100120 +#define GLU_CCW 100121 +#define GLU_INTERIOR 100122 +#define GLU_EXTERIOR 100123 +#define GLU_UNKNOWN 100124 + +/* TessProperty */ +#define GLU_TESS_WINDING_RULE 100140 +#define GLU_TESS_BOUNDARY_ONLY 100141 +#define GLU_TESS_TOLERANCE 100142 + +/* TessError */ +#define GLU_TESS_ERROR1 100151 +#define GLU_TESS_ERROR2 100152 +#define GLU_TESS_ERROR3 100153 +#define GLU_TESS_ERROR4 100154 +#define GLU_TESS_ERROR5 100155 +#define GLU_TESS_ERROR6 100156 +#define GLU_TESS_ERROR7 100157 +#define GLU_TESS_ERROR8 100158 +#define GLU_TESS_MISSING_BEGIN_POLYGON 100151 +#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152 +#define GLU_TESS_MISSING_END_POLYGON 100153 +#define GLU_TESS_MISSING_END_CONTOUR 100154 +#define GLU_TESS_COORD_TOO_LARGE 100155 +#define GLU_TESS_NEED_COMBINE_CALLBACK 100156 + +/* TessWinding */ +#define GLU_TESS_WINDING_ODD 100130 +#define GLU_TESS_WINDING_NONZERO 100131 +#define GLU_TESS_WINDING_POSITIVE 100132 +#define GLU_TESS_WINDING_NEGATIVE 100133 +#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 + +/*************************************************************/ + + +#ifdef __cplusplus +class GLUnurbs; +class GLUquadric; +class GLUtesselator; +#else +typedef struct GLUnurbs GLUnurbs; +typedef struct GLUquadric GLUquadric; +typedef struct GLUtesselator GLUtesselator; +#endif + +typedef GLUnurbs GLUnurbsObj; +typedef GLUquadric GLUquadricObj; +typedef GLUtesselator GLUtesselatorObj; +typedef GLUtesselator GLUtriangulatorObj; + +#define GLU_TESS_MAX_COORD 1.0e150 + +/* Internal convenience typedefs */ +typedef void (GLAPIENTRYP _GLUfuncptr)(void); + +GLAPI void GLAPIENTRY gluBeginCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluBeginSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluBeginTrim (GLUnurbs* nurb); +GLAPI GLint GLAPIENTRY gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data); +GLAPI GLint GLAPIENTRY gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data); +GLAPI GLboolean GLAPIENTRY gluCheckExtension (const GLubyte *extName, const GLubyte *extString); +GLAPI void GLAPIENTRY gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluDeleteNurbsRenderer (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluDeleteQuadric (GLUquadric* quad); +GLAPI void GLAPIENTRY gluDeleteTess (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops); +GLAPI void GLAPIENTRY gluEndCurve (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluEndSurface (GLUnurbs* nurb); +GLAPI void GLAPIENTRY gluEndTrim (GLUnurbs* nurb); +GLAPI const GLubyte * GLAPIENTRY gluErrorString (GLenum error); +GLAPI void GLAPIENTRY gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data); +GLAPI const GLubyte * GLAPIENTRY gluGetString (GLenum name); +GLAPI void GLAPIENTRY gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data); +GLAPI void GLAPIENTRY gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view); +GLAPI void GLAPIENTRY gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ); +GLAPI GLUnurbs* GLAPIENTRY gluNewNurbsRenderer (void); +GLAPI GLUquadric* GLAPIENTRY gluNewQuadric (void); +GLAPI GLUtesselator* GLAPIENTRY gluNewTess (void); +GLAPI void GLAPIENTRY gluNextContour (GLUtesselator* tess, GLenum type); +GLAPI void GLAPIENTRY gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData); +GLAPI void GLAPIENTRY gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type); +GLAPI void GLAPIENTRY gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value); +GLAPI void GLAPIENTRY gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type); +GLAPI void GLAPIENTRY gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top); +GLAPI void GLAPIENTRY gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep); +GLAPI void GLAPIENTRY gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport); +GLAPI GLint GLAPIENTRY gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ); +GLAPI void GLAPIENTRY gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type); +GLAPI void GLAPIENTRY gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluQuadricDrawStyle (GLUquadric* quad, GLenum draw); +GLAPI void GLAPIENTRY gluQuadricNormals (GLUquadric* quad, GLenum normal); +GLAPI void GLAPIENTRY gluQuadricOrientation (GLUquadric* quad, GLenum orientation); +GLAPI void GLAPIENTRY gluQuadricTexture (GLUquadric* quad, GLboolean texture); +GLAPI GLint GLAPIENTRY gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut); +GLAPI void GLAPIENTRY gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks); +GLAPI void GLAPIENTRY gluTessBeginContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data); +GLAPI void GLAPIENTRY gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc); +GLAPI void GLAPIENTRY gluTessEndContour (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessEndPolygon (GLUtesselator* tess); +GLAPI void GLAPIENTRY gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ); +GLAPI void GLAPIENTRY gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data); +GLAPI void GLAPIENTRY gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data); +GLAPI GLint GLAPIENTRY gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ); +GLAPI GLint GLAPIENTRY gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW); + +#ifdef __cplusplus +} +#endif + +#endif /* __glu_h__ */ diff --git a/contrib/sdk/sources/Mesa/include/GL/glu_mangle.h b/contrib/sdk/sources/Mesa/include/GL/glu_mangle.h new file mode 100644 index 0000000000..9c25aa864c --- /dev/null +++ b/contrib/sdk/sources/Mesa/include/GL/glu_mangle.h @@ -0,0 +1,86 @@ +/* + * Mesa 3-D graphics library + * Version: 3.0 + * Copyright (C) 1995-1998 Brian Paul + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + + +#ifndef GLU_MANGLE_H +#define GLU_MANGLE_H + + +#define gluLookAt mgluLookAt +#define gluOrtho2D mgluOrtho2D +#define gluPerspective mgluPerspective +#define gluPickMatrix mgluPickMatrix +#define gluProject mgluProject +#define gluUnProject mgluUnProject +#define gluErrorString mgluErrorString +#define gluScaleImage mgluScaleImage +#define gluBuild1DMipmaps mgluBuild1DMipmaps +#define gluBuild2DMipmaps mgluBuild2DMipmaps +#define gluNewQuadric mgluNewQuadric +#define gluDeleteQuadric mgluDeleteQuadric +#define gluQuadricDrawStyle mgluQuadricDrawStyle +#define gluQuadricOrientation mgluQuadricOrientation +#define gluQuadricNormals mgluQuadricNormals +#define gluQuadricTexture mgluQuadricTexture +#define gluQuadricCallback mgluQuadricCallback +#define gluCylinder mgluCylinder +#define gluSphere mgluSphere +#define gluDisk mgluDisk +#define gluPartialDisk mgluPartialDisk +#define gluNewNurbsRenderer mgluNewNurbsRenderer +#define gluDeleteNurbsRenderer mgluDeleteNurbsRenderer +#define gluLoadSamplingMatrices mgluLoadSamplingMatrices +#define gluNurbsProperty mgluNurbsProperty +#define gluGetNurbsProperty mgluGetNurbsProperty +#define gluBeginCurve mgluBeginCurve +#define gluEndCurve mgluEndCurve +#define gluNurbsCurve mgluNurbsCurve +#define gluBeginSurface mgluBeginSurface +#define gluEndSurface mgluEndSurface +#define gluNurbsSurface mgluNurbsSurface +#define gluBeginTrim mgluBeginTrim +#define gluEndTrim mgluEndTrim +#define gluPwlCurve mgluPwlCurve +#define gluNurbsCallback mgluNurbsCallback +#define gluNewTess mgluNewTess +#define gluDeleteTess mgluDeleteTess +#define gluTessBeginPolygon mgluTessBeginPolygon +#define gluTessBeginContour mgluTessBeginContour +#define gluTessVertex mgluTessVertex +#define gluTessEndPolygon mgluTessEndPolygon +#define gluTessEndContour mgluTessEndContour +#define gluTessProperty mgluTessProperty +#define gluTessNormal mgluTessNormal +#define gluTessCallback mgluTessCallback +#define gluGetTessProperty mgluGetTessProperty +#define gluBeginPolygon mgluBeginPolygon +#define gluNextContour mgluNextContour +#define gluEndPolygon mgluEndPolygon +#define gluGetString mgluGetString +#define gluBuild1DMipmapLevels mgluBuild1DMipmapLevels +#define gluBuild2DMipmapLevels mgluBuild2DMipmapLevels +#define gluBuild3DMipmapLevels mgluBuild3DMipmapLevels +#define gluBuild3DMipmaps mgluBuild3DMipmaps +#define gluCheckExtension mgluCheckExtension +#define gluUnProject4 mgluUnProject4 +#define gluNurbsCallbackData mgluNurbsCallbackData +#define gluNurbsCallbackDataEXT mgluNurbsCallbackDataEXT + +#endif diff --git a/contrib/sdk/sources/Mesa/src/egl/Makefile b/contrib/sdk/sources/Mesa/src/egl/Makefile index 3b6ac23b52..0afc7b9214 100644 --- a/contrib/sdk/sources/Mesa/src/egl/Makefile +++ b/contrib/sdk/sources/Mesa/src/egl/Makefile @@ -3,7 +3,7 @@ SRC_DIR:=$(SDK_DIR)/sources MESA_SRC:= $(SRC_DIR)/Mesa/src CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os -CFLAGS_OPT+= -fomit-frame-pointer -mno-ms-bitfields +CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields CFLAGS = -c $(CFLAGS_OPT) LDFLAGS = -nostdlib -shared -s --image-base 0 -T $(SRC_DIR)/newlib/dll.lds --out-implib libegl.dll.a -e _DllStartup diff --git a/contrib/sdk/sources/Mesa/src/glsl/Makefile b/contrib/sdk/sources/Mesa/src/glsl/Makefile index 63f6cfed03..6a60468dfe 100644 --- a/contrib/sdk/sources/Mesa/src/glsl/Makefile +++ b/contrib/sdk/sources/Mesa/src/glsl/Makefile @@ -3,7 +3,7 @@ SRC_DIR:=$(SDK_DIR)/sources MESA_SRC:= $(SRC_DIR)/Mesa/src CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os -CFLAGS_OPT+= -fomit-frame-pointer -mno-ms-bitfields +CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields CFLAGS = -c $(CFLAGS_OPT) INC_MESA:= -I$(SRC_DIR)/newlib/libc/include -I$(SRC_DIR)/Mesa/include diff --git a/contrib/sdk/sources/Mesa/src/mapi/Makefile b/contrib/sdk/sources/Mesa/src/mapi/Makefile index 93a72529e5..d7e32fe108 100644 --- a/contrib/sdk/sources/Mesa/src/mapi/Makefile +++ b/contrib/sdk/sources/Mesa/src/mapi/Makefile @@ -3,7 +3,7 @@ SRC_DIR:=$(SDK_DIR)/sources MESA_SRC:= $(SRC_DIR)/Mesa/src CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os -CFLAGS_OPT+= -fomit-frame-pointer -mno-ms-bitfields +CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields CFLAGS = -c $(CFLAGS_OPT) LDFLAGS = -nostdlib -shared -s --image-base 0 -T $(SRC_DIR)/newlib/dll.lds --out-implib libGL.dll.a -e _DllStartup diff --git a/contrib/sdk/sources/Mesa/src/mesa/Makefile b/contrib/sdk/sources/Mesa/src/mesa/Makefile index aea2744f86..5c7d281b58 100644 --- a/contrib/sdk/sources/Mesa/src/mesa/Makefile +++ b/contrib/sdk/sources/Mesa/src/mesa/Makefile @@ -3,7 +3,7 @@ SRC_DIR:=$(SDK_DIR)/sources MESA_SRC:= $(SRC_DIR)/Mesa/src CFLAGS_OPT = -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER -Os -CFLAGS_OPT+= -fomit-frame-pointer -mno-ms-bitfields +CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields CFLAGS = -c $(CFLAGS_OPT) LDFLAGS = -nostdlib -shared -s --image-base 0 -T $(SRC_DIR)/newlib/dll.lds -e _DllStartup diff --git a/contrib/sdk/sources/cairo/Makefile b/contrib/sdk/sources/cairo/Makefile index 01524c0fce..dd028c5f83 100644 --- a/contrib/sdk/sources/cairo/Makefile +++ b/contrib/sdk/sources/cairo/Makefile @@ -5,7 +5,7 @@ AR = kos32-ar LD = kos32-ld STRIP = kos32-strip -CFLAGS = -c -O2 -ffast-math -Wall -Winline -Wno-attributes -fomit-frame-pointer +CFLAGS = -c -O2 -ffast-math -Wall -Winline -Wno-attributes -fno-ident -fomit-frame-pointer LDFLAGS = -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 --version-script cairo.ver --output-def $(LIBRARY).orig.def LDFLAGS+= --out-implib lib$(LIBRARY).dll.a diff --git a/contrib/sdk/sources/eglut/Makefile b/contrib/sdk/sources/eglut/Makefile index 33b88232b5..ae7e7e2450 100644 --- a/contrib/sdk/sources/eglut/Makefile +++ b/contrib/sdk/sources/eglut/Makefile @@ -6,7 +6,7 @@ CC = kos32-gcc AR = kos32-ar LD = kos32-ld -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer INCLUDES= -I. -I../newlib/libc/include -I../Mesa/include -I../Mesa/src/gbm/main -I../libdrm/include diff --git a/contrib/sdk/sources/expat/Makefile b/contrib/sdk/sources/expat/Makefile index d5ecdd998a..2614e4998f 100644 --- a/contrib/sdk/sources/expat/Makefile +++ b/contrib/sdk/sources/expat/Makefile @@ -4,7 +4,7 @@ CC = kos32-gcc AR = kos32-ar LD = kos32-ld -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer ARFLAGS = crs diff --git a/contrib/sdk/sources/ffmpeg/config.mak b/contrib/sdk/sources/ffmpeg/config.mak index b2ced04f65..096ef5ad29 100644 --- a/contrib/sdk/sources/ffmpeg/config.mak +++ b/contrib/sdk/sources/ffmpeg/config.mak @@ -34,7 +34,7 @@ STRIP=kos32-strip CP=cp -p LN_S=ln -s -f CPPFLAGS= -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=32 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -CFLAGS= -I../newlib/libc/include -I../zlib -U_Win32 -U_WIN32 -U__MINGW32__ -std=c99 -fomit-frame-pointer -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O2 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla +CFLAGS= -I../newlib/libc/include -I../zlib -U_Win32 -U_WIN32 -U__MINGW32__ -std=c99 -fno-ident -fomit-frame-pointer -Wdeclaration-after-statement -Wall -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wno-pointer-sign -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -O2 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla CXXFLAGS= -D__STDC_CONSTANT_MACROS ASFLAGS= -I../newlib/libc/include -U_Win32 -U_WIN32 -U__MINGW32__ AS_C=-c diff --git a/contrib/sdk/sources/freetype/Makefile b/contrib/sdk/sources/freetype/Makefile index fa61551dec..1781861d56 100644 --- a/contrib/sdk/sources/freetype/Makefile +++ b/contrib/sdk/sources/freetype/Makefile @@ -5,7 +5,7 @@ AR = kos32-ar LD = kos32-ld STRIP = kos32-strip -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -Wall -Winline -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -Wall -Winline -fno-ident -fomit-frame-pointer LDFLAGS = -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 LDFLAGS+= --out-implib lib$(LIBRARY).dll.a diff --git a/contrib/sdk/sources/gcc_eh/Makefile b/contrib/sdk/sources/gcc_eh/Makefile index bd1d89de03..71077e2438 100644 --- a/contrib/sdk/sources/gcc_eh/Makefile +++ b/contrib/sdk/sources/gcc_eh/Makefile @@ -7,7 +7,7 @@ LD = kos32-ld CPP= kos32-g++ STRIP = kos32-strip -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer ARFLAG = crs diff --git a/contrib/sdk/sources/libdrm/Makefile b/contrib/sdk/sources/libdrm/Makefile index f098073714..080219687c 100644 --- a/contrib/sdk/sources/libdrm/Makefile +++ b/contrib/sdk/sources/libdrm/Makefile @@ -5,7 +5,7 @@ AR = kos32-ar LD = kos32-ld STRIP = kos32-strip -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -march=i686 -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -march=i686 -O2 -fno-ident -fomit-frame-pointer LDFLAGS:= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --version-script libdrm.ver --image-base=0 LDFLAGS+= --out-implib $(LIBRARY).dll.a diff --git a/contrib/sdk/sources/libdrm/include/drm/drm.h b/contrib/sdk/sources/libdrm/include/drm/drm.h index 0d5b3510b6..7e714efbbe 100644 --- a/contrib/sdk/sources/libdrm/include/drm/drm.h +++ b/contrib/sdk/sources/libdrm/include/drm/drm.h @@ -427,7 +427,7 @@ struct drm_draw { * DRM_IOCTL_UPDATE_DRAW ioctl argument type. */ typedef enum { - DRM_DRAWABLE_CLIPRECTS + DRM_DRAWABLE_CLIPRECTS, } drm_drawable_info_type_t; struct drm_update_draw { @@ -459,12 +459,15 @@ struct drm_irq_busid { enum drm_vblank_seq_type { _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ + /* bits 1-6 are reserved for high crtcs */ + _DRM_VBLANK_HIGH_CRTC_MASK = 0x0000003e, _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ _DRM_VBLANK_SIGNAL = 0x40000000 /**< Send signal instead of blocking, unsupported */ }; +#define _DRM_VBLANK_HIGH_CRTC_SHIFT 1 #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ diff --git a/contrib/sdk/sources/libdrm/include/drm/drm_fourcc.h b/contrib/sdk/sources/libdrm/include/drm/drm_fourcc.h index 7296679d9f..d4a81a90c0 100644 --- a/contrib/sdk/sources/libdrm/include/drm/drm_fourcc.h +++ b/contrib/sdk/sources/libdrm/include/drm/drm_fourcc.h @@ -106,6 +106,11 @@ #define DRM_FORMAT_NV21 fourcc_code('N', 'V', '2', '1') /* 2x2 subsampled Cb:Cr plane */ #define DRM_FORMAT_NV16 fourcc_code('N', 'V', '1', '6') /* 2x1 subsampled Cr:Cb plane */ #define DRM_FORMAT_NV61 fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */ +#define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ +#define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ + +/* special NV12 tiled format */ +#define DRM_FORMAT_NV12MT fourcc_code('T', 'M', '1', '2') /* 2x2 subsampled Cr:Cb plane 64x32 macroblocks */ /* * 3 plane YCbCr diff --git a/contrib/sdk/sources/libdrm/include/drm/drm_mode.h b/contrib/sdk/sources/libdrm/include/drm/drm_mode.h index 6b07546f85..0d5c41d3c2 100644 --- a/contrib/sdk/sources/libdrm/include/drm/drm_mode.h +++ b/contrib/sdk/sources/libdrm/include/drm/drm_mode.h @@ -173,6 +173,9 @@ struct drm_mode_get_plane_res { #define DRM_MODE_ENCODER_TMDS 2 #define DRM_MODE_ENCODER_LVDS 3 #define DRM_MODE_ENCODER_TVDAC 4 +#define DRM_MODE_ENCODER_VIRTUAL 5 +#define DRM_MODE_ENCODER_DSI 6 +#define DRM_MODE_ENCODER_DPMST 7 struct drm_mode_get_encoder { __u32 encoder_id; @@ -210,6 +213,8 @@ struct drm_mode_get_encoder { #define DRM_MODE_CONNECTOR_HDMIB 12 #define DRM_MODE_CONNECTOR_TV 13 #define DRM_MODE_CONNECTOR_eDP 14 +#define DRM_MODE_CONNECTOR_VIRTUAL 15 +#define DRM_MODE_CONNECTOR_DSI 16 struct drm_mode_get_connector { @@ -230,6 +235,8 @@ struct drm_mode_get_connector { __u32 connection; __u32 mm_width, mm_height; /**< HxW in millimeters */ __u32 subpixel; + + __u32 pad; }; #define DRM_MODE_PROP_PENDING (1<<0) @@ -239,6 +246,21 @@ struct drm_mode_get_connector { #define DRM_MODE_PROP_BLOB (1<<4) #define DRM_MODE_PROP_BITMASK (1<<5) /* bitmask of enumerated types */ +/* non-extended types: legacy bitmask, one bit per type: */ +#define DRM_MODE_PROP_LEGACY_TYPE ( \ + DRM_MODE_PROP_RANGE | \ + DRM_MODE_PROP_ENUM | \ + DRM_MODE_PROP_BLOB | \ + DRM_MODE_PROP_BITMASK) + +/* extended-types: rather than continue to consume a bit per type, + * grab a chunk of the bits to use as integer type id. + */ +#define DRM_MODE_PROP_EXTENDED_TYPE 0x0000ffc0 +#define DRM_MODE_PROP_TYPE(n) ((n) << 6) +#define DRM_MODE_PROP_OBJECT DRM_MODE_PROP_TYPE(1) +#define DRM_MODE_PROP_SIGNED_RANGE DRM_MODE_PROP_TYPE(2) + struct drm_mode_property_enum { __u64 value; char name[DRM_PROP_NAME_LEN]; @@ -262,15 +284,6 @@ struct drm_mode_connector_set_property { __u32 connector_id; }; -#define DRM_MODE_OBJECT_CRTC 0xcccccccc -#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0 -#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0 -#define DRM_MODE_OBJECT_MODE 0xdededede -#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0 -#define DRM_MODE_OBJECT_FB 0xfbfbfbfb -#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb -#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee - struct drm_mode_obj_get_properties { __u64 props_ptr; __u64 prop_values_ptr; @@ -333,6 +346,8 @@ struct drm_mode_fb_cmd2 { #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 #define DRM_MODE_FB_DIRTY_FLAGS 0x03 +#define DRM_MODE_FB_DIRTY_MAX_CLIPS 256 + /* * Mark a region of a framebuffer as dirty. * @@ -373,20 +388,21 @@ struct drm_mode_mode_cmd { struct drm_mode_modeinfo mode; }; -#define DRM_MODE_CURSOR_BO (1<<0) -#define DRM_MODE_CURSOR_MOVE (1<<1) +#define DRM_MODE_CURSOR_BO 0x01 +#define DRM_MODE_CURSOR_MOVE 0x02 +#define DRM_MODE_CURSOR_FLAGS 0x03 /* - * depending on the value in flags diffrent members are used. + * depending on the value in flags different members are used. * * CURSOR_BO uses - * crtc + * crtc_id * width * height - * handle - if 0 turns the cursor of + * handle - if 0 turns the cursor off * * CURSOR_MOVE uses - * crtc + * crtc_id * x * y */ diff --git a/contrib/sdk/sources/libdrm/include/drm/i915_drm.h b/contrib/sdk/sources/libdrm/include/drm/i915_drm.h index e33d04b6a2..eca50c6470 100644 --- a/contrib/sdk/sources/libdrm/include/drm/i915_drm.h +++ b/contrib/sdk/sources/libdrm/include/drm/i915_drm.h @@ -33,6 +33,30 @@ * subject to backwards-compatibility constraints. */ +/** + * DOC: uevents generated by i915 on it's device node + * + * I915_L3_PARITY_UEVENT - Generated when the driver receives a parity mismatch + * event from the gpu l3 cache. Additional information supplied is ROW, + * BANK, SUBBANK, SLICE of the affected cacheline. Userspace should keep + * track of these events and if a specific cache-line seems to have a + * persistent error remap it with the l3 remapping tool supplied in + * intel-gpu-tools. The value supplied with the event is always 1. + * + * I915_ERROR_UEVENT - Generated upon error detection, currently only via + * hangcheck. The error detection event is a good indicator of when things + * began to go badly. The value supplied with the event is a 1 upon error + * detection, and a 0 upon reset completion, signifying no more error + * exists. NOTE: Disabling hangcheck or reset via module parameter will + * cause the related events to not be seen. + * + * I915_RESET_UEVENT - Event is generated just before an attempt to reset the + * the GPU. The value supplied with the event is always 1. NOTE: Disable + * reset via module parameter will cause this event to not be seen. + */ +#define I915_L3_PARITY_UEVENT "L3_PARITY_ERROR" +#define I915_ERROR_UEVENT "ERROR" +#define I915_RESET_UEVENT "RESET" /* Each region is a minimum of 16k, and there are at most 255 of them. */ @@ -195,8 +219,8 @@ typedef struct _drm_i915_sarea { #define DRM_I915_GEM_WAIT 0x2c #define DRM_I915_GEM_CONTEXT_CREATE 0x2d #define DRM_I915_GEM_CONTEXT_DESTROY 0x2e -#define DRM_I915_GEM_SET_CACHEING 0x2f -#define DRM_I915_GEM_GET_CACHEING 0x30 +#define DRM_I915_GEM_SET_CACHING 0x2f +#define DRM_I915_GEM_GET_CACHING 0x30 #define DRM_I915_REG_READ 0x31 #define DRM_I915_GET_RESET_STATS 0x32 @@ -305,7 +329,15 @@ typedef struct drm_i915_irq_wait { #define I915_PARAM_HAS_LLC 17 #define I915_PARAM_HAS_ALIASING_PPGTT 18 #define I915_PARAM_HAS_WAIT_TIMEOUT 19 +#define I915_PARAM_HAS_SEMAPHORES 20 +#define I915_PARAM_HAS_PRIME_VMAP_FLUSH 21 #define I915_PARAM_HAS_VEBOX 22 +#define I915_PARAM_HAS_SECURE_BATCHES 23 +#define I915_PARAM_HAS_PINNED_BATCHES 24 +#define I915_PARAM_HAS_EXEC_NO_RELOC 25 +#define I915_PARAM_HAS_EXEC_HANDLE_LUT 26 +#define I915_PARAM_HAS_WT 27 +#define I915_PARAM_CMD_PARSER_VERSION 28 typedef struct drm_i915_getparam { int param; @@ -626,7 +658,11 @@ struct drm_i915_gem_exec_object2 { __u64 offset; #define EXEC_OBJECT_NEEDS_FENCE (1<<0) +#define EXEC_OBJECT_NEEDS_GTT (1<<1) +#define EXEC_OBJECT_WRITE (1<<2) +#define __EXEC_OBJECT_UNKNOWN_FLAGS -(EXEC_OBJECT_WRITE<<1) __u64 flags; + __u64 rsvd1; __u64 rsvd2; }; @@ -672,6 +708,34 @@ struct drm_i915_gem_execbuffer2 { /** Resets the SO write offset registers for transform feedback on gen7. */ #define I915_EXEC_GEN7_SOL_RESET (1<<8) +/** Request a privileged ("secure") batch buffer. Note only available for + * DRM_ROOT_ONLY | DRM_MASTER processes. + */ +#define I915_EXEC_SECURE (1<<9) + +/** Inform the kernel that the batch is and will always be pinned. This + * negates the requirement for a workaround to be performed to avoid + * an incoherent CS (such as can be found on 830/845). If this flag is + * not passed, the kernel will endeavour to make sure the batch is + * coherent with the CS before execution. If this flag is passed, + * userspace assumes the responsibility for ensuring the same. + */ +#define I915_EXEC_IS_PINNED (1<<10) + +/** Provide a hint to the kernel that the command stream and auxiliary + * state buffers already holds the correct presumed addresses and so the + * relocation process may be skipped if no buffers need to be moved in + * preparation for the execbuffer. + */ +#define I915_EXEC_NO_RELOC (1<<11) + +/** Use the reloc.handle as an index into the exec object array rather + * than as the per-file handle. + */ +#define I915_EXEC_HANDLE_LUT (1<<12) + +#define __I915_EXEC_UNKNOWN_FLAGS -(I915_EXEC_HANDLE_LUT<<1) + #define I915_EXEC_CONTEXT_ID_MASK (0xffffffff) #define i915_execbuffer2_set_context_id(eb2, context) \ (eb2).rsvd1 = context & I915_EXEC_CONTEXT_ID_MASK @@ -708,21 +772,45 @@ struct drm_i915_gem_busy { __u32 busy; }; -#define I915_CACHEING_NONE 0 -#define I915_CACHEING_CACHED 1 +/** + * I915_CACHING_NONE + * + * GPU access is not coherent with cpu caches. Default for machines without an + * LLC. + */ +#define I915_CACHING_NONE 0 +/** + * I915_CACHING_CACHED + * + * GPU access is coherent with cpu caches and furthermore the data is cached in + * last-level caches shared between cpu cores and the gpu GT. Default on + * machines with HAS_LLC. + */ +#define I915_CACHING_CACHED 1 +/** + * I915_CACHING_DISPLAY + * + * Special GPU caching mode which is coherent with the scanout engines. + * Transparently falls back to I915_CACHING_NONE on platforms where no special + * cache mode (like write-through or gfdt flushing) is available. The kernel + * automatically sets this mode when using a buffer as a scanout target. + * Userspace can manually set this mode to avoid a costly stall and clflush in + * the hotpath of drawing the first frame. + */ +#define I915_CACHING_DISPLAY 2 -struct drm_i915_gem_cacheing { +struct drm_i915_gem_caching { /** - * Handle of the buffer to set/get the cacheing level of. */ + * Handle of the buffer to set/get the caching level of. */ __u32 handle; /** * Cacheing level to apply or return value * - * bits0-15 are for generic cacheing control (i.e. the above defined + * bits0-15 are for generic caching control (i.e. the above defined * values). bits16-31 are reserved for platform-specific variations * (e.g. l3$ caching on gen7). */ - __u32 cacheing; + __u32 caching; }; #define I915_TILING_NONE 0 @@ -962,6 +1050,15 @@ struct drm_i915_reset_stats { __u32 pad; }; +struct drm_i915_mask { + __u32 handle; + __u32 width; + __u32 height; + __u32 bo_size; + __u32 bo_pitch; + __u32 bo_map; +}; + struct drm_i915_fb_info { __u32 name; __u32 width; diff --git a/contrib/sdk/sources/libpng/Makefile b/contrib/sdk/sources/libpng/Makefile index 066a5bc3e2..c6502e694b 100644 --- a/contrib/sdk/sources/libpng/Makefile +++ b/contrib/sdk/sources/libpng/Makefile @@ -5,7 +5,7 @@ AR = kos32-ar LD = kos32-ld STRIP = kos32-strip -CFLAGS = -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -c -O2 -fomit-frame-pointer +CFLAGS = -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -c -O2 -fno-ident -fomit-frame-pointer LDFLAGS= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 LDFLAGS+= --out-implib $(LIBRARY).dll.a diff --git a/contrib/sdk/sources/libsupc++/Makefile b/contrib/sdk/sources/libsupc++/Makefile index 5f5b543423..4b89d8a86f 100644 --- a/contrib/sdk/sources/libsupc++/Makefile +++ b/contrib/sdk/sources/libsupc++/Makefile @@ -6,7 +6,7 @@ LD = kos32-ld CPP= kos32-g++ STRIP = kos32-strip -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer ARFLAGS= crs diff --git a/contrib/sdk/sources/newlib/libc/Makefile b/contrib/sdk/sources/newlib/libc/Makefile index 0a406d1063..12385ea576 100644 --- a/contrib/sdk/sources/newlib/libc/Makefile +++ b/contrib/sdk/sources/newlib/libc/Makefile @@ -3,7 +3,7 @@ CC = kos32-gcc AR = kos32-ar LD = kos32-ld -CFLAGS = -c -O2 -fomit-frame-pointer -DBUILD_DLL -DMISSING_SYSCALL_NAMES +CFLAGS = -c -O2 -fno-ident -fomit-frame-pointer -DBUILD_DLL -DMISSING_SYSCALL_NAMES LDFLAGS = -shared -s -T libcdll.lds --out-implib libc.dll.a --image-base 0 #LDFLAGS+= --output-def libc.orig.def ARFLAGS = crs diff --git a/contrib/sdk/sources/newlib/libc/pe/loader.c b/contrib/sdk/sources/newlib/libc/pe/loader.c index ade5ed2a70..8b713ff475 100644 --- a/contrib/sdk/sources/newlib/libc/pe/loader.c +++ b/contrib/sdk/sources/newlib/libc/pe/loader.c @@ -517,6 +517,16 @@ int link_image(void *img_base, PIMAGE_IMPORT_DESCRIPTOR imp) return 0; } +static void send_dbg_msg(void *msg) +{ + __asm__ __volatile__( + "int $0x40" + ::"a"(69), + "b"(10), + "S"(msg)); +}; + + int link_app() { struct app_hdr *header = NULL; @@ -524,8 +534,38 @@ int link_app() imp = (PIMAGE_IMPORT_DESCRIPTOR)header->__idata_start; - return link_image(NULL, imp); + if(link_image(NULL, imp)) + { +#ifdef DEBUG_INFO + struct + { + void *start; + uint32_t end; + char name[24]; + } dbg_msg; + + module_t *mod = &libc_dll; + + do + { + printf("%s %x - %x\n", + mod->img_name, mod->start, mod->end); + +// asm volatile("int3"); + + dbg_msg.start = mod->start; + dbg_msg.end = mod->end; + strcpy(dbg_msg.name, mod->img_name); + send_dbg_msg(&dbg_msg); + mod = (module_t*)mod->list.next; + }while(mod != &libc_dll); +#endif + + return 1; + }; + + return 0; } diff --git a/contrib/sdk/sources/pixman/Makefile b/contrib/sdk/sources/pixman/Makefile index a174d88152..78fb7d0163 100644 --- a/contrib/sdk/sources/pixman/Makefile +++ b/contrib/sdk/sources/pixman/Makefile @@ -5,7 +5,7 @@ AR = kos32-ar LD = kos32-ld STRIP = kos32-strip -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -Wall -Winline -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -Wall -Winline -fno-ident -fomit-frame-pointer LDFLAGS = -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 LDFLAGS+= --out-implib lib$(LIBRARY).dll.a diff --git a/contrib/sdk/sources/render/Makefile b/contrib/sdk/sources/render/Makefile index 9ac55c6580..1219efee7c 100644 --- a/contrib/sdk/sources/render/Makefile +++ b/contrib/sdk/sources/render/Makefile @@ -2,7 +2,7 @@ LIBRARY= librender CC=gcc -CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer +CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fno-ident -fomit-frame-pointer AR= ar diff --git a/contrib/sdk/sources/sound/Makefile b/contrib/sdk/sources/sound/Makefile new file mode 100644 index 0000000000..494c6d7002 --- /dev/null +++ b/contrib/sdk/sources/sound/Makefile @@ -0,0 +1,21 @@ + +AR = kos32-ar +FASM:= fasm.exe + +TARGET:= libsound + +dirs := ./src + +target_srcs:= $(foreach dir,$(dirs),$(wildcard $(dir)/*.asm)) + +target_objs:= $(subst .asm,.o,$(target_srcs)) + + +all: $(TARGET).a + +%.o: %.asm + $(FASM) $< $@ + +$(TARGET).a: $(target_objs) Makefile + $(AR) cvrs $@ $(target_objs) + mv -f $@ ../../lib diff --git a/contrib/sdk/sources/sound/include/snd.inc b/contrib/sdk/sources/sound/include/snd.inc new file mode 100644 index 0000000000..6e56a4e443 --- /dev/null +++ b/contrib/sdk/sources/sound/include/snd.inc @@ -0,0 +1,42 @@ + +struc CTRL_INFO +{ .pci_cmd dd ? + .irq dd ? + .glob_cntrl dd ? + .glob_sta dd ? + .codec_io_base dd ? + .ctrl_io_base dd ? + .codec_mem_base dd ? + .ctrl_mem_base dd ? + .codec_id dd ? +} +CTRL_INFO_SIZE equ 9*4 + +SRV_GETVERSION equ 0 +SND_CREATE_BUFF equ 1 +SND_DESTROY_BUFF equ 2 +SND_SETFORMAT equ 3 +SND_GETFORMAT equ 4 +SND_RESET equ 5 +SND_SETPOS equ 6 +SND_GETPOS equ 7 +SND_SETBUFF equ 8 +SND_OUT equ 9 +SND_PLAY equ 10 +SND_STOP equ 11 +SND_SETVOLUME equ 12 +SND_GETVOLUME equ 13 +SND_SETPAN equ 14 +SND_GETPAN equ 15 +SND_GETBUFFSIZE equ 16 +SND_GETFREESPACE equ 17 +SND_SETTIMEBASE equ 18 +SND_GETTIMESTAMP equ 19 + + +DEV_SET_BUFF equ 4 +DEV_NOTIFY equ 5 +DEV_SET_MASTERVOL equ 6 +DEV_GET_MASTERVOL equ 7 +DEV_GET_INFO equ 8 + diff --git a/contrib/sdk/sources/sound/include/sound.h b/contrib/sdk/sources/sound/include/sound.h new file mode 100644 index 0000000000..fbbeabd2e1 --- /dev/null +++ b/contrib/sdk/sources/sound/include/sound.h @@ -0,0 +1,142 @@ + +#ifndef _SOUND_H_ +#define _SOUND_H_ + +#ifdef __cplusplus +extern "C" +{ +#endif + +#define SOUND_VERSION 0x0101 +#define PCM_ALL 0 + +#define PCM_OUT 0x08000000 +#define PCM_RING 0x10000000 +#define PCM_STATIC 0x20000000 +#define PCM_FLOAT 0x40000000 +#define PCM_FILTER 0x80000000 + +#define PCM_2_16_48 1 +#define PCM_1_16_48 2 +#define PCM_2_16_44 3 +#define PCM_1_16_44 4 +#define PCM_2_16_32 5 +#define PCM_1_16_32 6 +#define PCM_2_16_24 7 +#define PCM_1_16_24 8 +#define PCM_2_16_22 9 +#define PCM_1_16_22 10 +#define PCM_2_16_16 11 +#define PCM_1_16_16 12 +#define PCM_2_16_12 13 +#define PCM_1_16_12 14 +#define PCM_2_16_11 15 +#define PCM_1_16_11 16 +#define PCM_2_16_8 17 +#define PCM_1_16_8 18 +#define PCM_2_8_48 19 +#define PCM_1_8_48 20 +#define PCM_2_8_44 21 +#define PCM_1_8_44 22 +#define PCM_2_8_32 23 +#define PCM_1_8_32 24 +#define PCM_2_8_24 25 +#define PCM_1_8_24 26 +#define PCM_2_8_22 27 +#define PCM_1_8_22 28 +#define PCM_2_8_16 29 +#define PCM_1_8_16 30 +#define PCM_2_8_12 31 +#define PCM_1_8_12 32 +#define PCM_2_8_11 33 +#define PCM_1_8_11 34 +#define PCM_2_8_8 35 +#define PCM_1_8_8 36 + +#define SRV_GETVERSION 0 +#define SND_CREATE_BUFF 1 +#define SND_DESTROY_BUFF 2 +#define SND_SETFORMAT 3 +#define SND_GETFORMAT 4 +#define SND_RESET 5 +#define SND_SETPOS 6 +#define SND_GETPOS 7 +#define SND_SETBUFF 8 +#define SND_OUT 9 +#define SND_PLAY 10 +#define SND_STOP 11 +#define SND_SETVOLUME 12 +#define SND_GETVOLUME 13 +#define SND_SETPAN 14 +#define SND_GETPAN 15 +#define SND_GETBUFFSIZE 16 +#define SND_GETFREESPACE 17 +#define SND_SETTIMEBASE 18 +#define SND_GETTIMESTAMP 19 + + +#define PLAY_SYNC 0x80000000 + +typedef unsigned int SNDBUF; + +int _stdcall InitSound(int *version); + +int _stdcall CreateBuffer(unsigned int format,int size,SNDBUF *buf); +int _stdcall DestroyBuffer(SNDBUF hBuff); + +int _stdcall SetFormat(SNDBUF hBuff, unsigned int format); +int _stdcall GetFormat(SNDBUF hBuff, unsigned int *format); + +int _stdcall ResetBuffer(SNDBUF hBuff, unsigned int flags); +int _stdcall SetBufferPos(SNDBUF hBuff, int offset); +int _stdcall GetBufferPos(SNDBUF hBuff, int *offset); +int _stdcall GetBufferSize(SNDBUF hBuff, int *size); +int _stdcall GetBufferFree(SNDBUF hBuff, int *free); + +int _stdcall SetBuffer(SNDBUF hBuff,void* buff, + int offs, int size); +int _stdcall WaveOut(SNDBUF hBuff,void *buff, int size); +int _stdcall PlayBuffer(SNDBUF hBuff,unsigned int flags); +int _stdcall StopBuffer(SNDBUF hBuff); + +int _stdcall SetVolume(SNDBUF hBuff, int left, int right); +int _stdcall GetVolume(SNDBUF hBuff, int *left, int *right); +int _stdcall SetPan(SNDBUF hBuff, int pan); +int _stdcall GetPan(SNDBUF hBuff, int *pan); + +int _stdcall GetMasterVol(int* vol); +int _stdcall SetMasterVol(int vol); + +int _stdcall SetTimeBase(SNDBUF hBuff, double base); +int _stdcall GetTimeStamp(SNDBUF hBuff, double *stamp); +int _stdcall GetDevTime(int *stamp); + + +typedef struct +{ + unsigned int riff_id; + unsigned int riff_size; + unsigned int riff_format; + + unsigned int fmt_id; + unsigned int fmt_size; + + unsigned short int wFormatTag; + unsigned short int nChannels; + unsigned int nSamplesPerSec; + unsigned int nAvgBytesPerSec; + unsigned short int nBlockAlign; + unsigned short int wBitsPerSample; + unsigned int data_id; + unsigned int data_size; +} WAVEHEADER; + + +unsigned int _stdcall test_wav(WAVEHEADER *hdr); + +#ifdef __cplusplus +extern "C" +} +#endif + +#endif //_SOUND_H_ diff --git a/contrib/sdk/sources/sound/src/init.asm b/contrib/sdk/sources/sound/src/init.asm new file mode 100644 index 0000000000..da50a2e505 --- /dev/null +++ b/contrib/sdk/sources/sound/src/init.asm @@ -0,0 +1,118 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _InitSound@4 +public _CreateBuffer@12 +public _DestroyBuffer@4 + +align 4 +_InitSound@4: ;p_ver:dword + + push ebx + push ecx + + mov eax, 68 + mov ebx, 16 + mov ecx, szInfinity + int 0x40 + mov [hSound], eax + test eax, eax + jz .fail + + mov eax, 68 + mov ebx, 16 + mov ecx, szSound + int 0x40 + mov [hrdwSound], eax + + lea eax, [esp+12] ;p_ver + xor ebx, ebx + + push 4 ;.out_size + push eax ;.output + push ebx ;.inp_size + push ebx ;.input + push SRV_GETVERSION ;.code + push [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp ;[handle] + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 4 +.fail: + or eax, -1 + pop ecx + pop ebx + ret 4 + + +align 4 +_CreateBuffer@12: ;format:dword,size:dword,p_str:dword + + push ebx + push ecx + lea eax, [esp+20] ;p_str + lea ebx, [esp+12] ;format + + push 4 ;.out_size + push eax ;.output + push 8 ;.inp_size + push ebx ;.input + push SND_CREATE_BUFF;.code + push [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 ;io_cintrol + pop ecx + pop ebx + ret 12 + +align 4 +_DestroyBuffer@4: ;str:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_DESTROY_BUFF;.code + push [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp ;[handle] + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 4 + + +section '.data' align 16 data readable writable + +public hSound +public hrdwSound + +hSound dd ? +hrdwSound dd ? + +szInfinity db 'INFINITY',0 +szSound db 'SOUND',0 + + diff --git a/contrib/sdk/sources/sound/src/proc32.inc b/contrib/sdk/sources/sound/src/proc32.inc new file mode 100644 index 0000000000..23c56b03c1 --- /dev/null +++ b/contrib/sdk/sources/sound/src/proc32.inc @@ -0,0 +1,268 @@ + +; Macroinstructions for defining and calling procedures + +macro stdcall proc,[arg] ; directly call STDCALL procedure + { common + if ~ arg eq + reverse + pushd arg + common + end if + call proc } + +macro invoke proc,[arg] ; indirectly call STDCALL procedure + { common + if ~ arg eq + reverse + pushd arg + common + end if + call [proc] } + +macro ccall proc,[arg] ; directly call CDECL procedure + { common + size@ccall = 0 + if ~ arg eq + reverse + pushd arg + size@ccall = size@ccall+4 + common + end if + call proc + if size@ccall + add esp,size@ccall + end if } + +macro cinvoke proc,[arg] ; indirectly call CDECL procedure + { common + size@ccall = 0 + if ~ arg eq + reverse + pushd arg + size@ccall = size@ccall+4 + common + end if + call [proc] + if size@ccall + add esp,size@ccall + end if } + +macro proc [args] ; define procedure + { common + match name params, args> + \{ define@proc name, \{ prologue name,flag,parmbytes,localbytes,reglist \} + macro locals + \{ virtual at ebp-localbytes+current + macro label . \\{ deflocal@proc .,:, \\} + struc db [val] \\{ \common deflocal@proc .,db,val \\} + struc dw [val] \\{ \common deflocal@proc .,dw,val \\} + struc dp [val] \\{ \common deflocal@proc .,dp,val \\} + struc dd [val] \\{ \common deflocal@proc .,dd,val \\} + struc dt [val] \\{ \common deflocal@proc .,dt,val \\} + struc dq [val] \\{ \common deflocal@proc .,dq,val \\} + struc rb cnt \\{ deflocal@proc .,rb cnt, \\} + struc rw cnt \\{ deflocal@proc .,rw cnt, \\} + struc rp cnt \\{ deflocal@proc .,rp cnt, \\} + struc rd cnt \\{ deflocal@proc .,rd cnt, \\} + struc rt cnt \\{ deflocal@proc .,rt cnt, \\} + struc rq cnt \\{ deflocal@proc .,rq cnt, \\} \} + macro endl + \{ purge label + restruc db,dw,dp,dd,dt,dq + restruc rb,rw,rp,rd,rt,rq + restruc byte,word,dword,pword,tword,qword + current = $-(ebp-localbytes) + end virtual \} + macro ret operand + \{ match any, operand \\{ retn operand \\} + match , operand \\{ match epilogue:reglist, epilogue@proc: + \\\{ epilogue name,flag,parmbytes,localbytes,reglist \\\} \\} \} + macro finish@proc \{ localbytes = (((current-1) shr 2)+1) shl 2 + end if \} } + +macro defargs@proc [arg] + { common + if ~ arg eq + forward + local ..arg,current@arg + match argname:type, arg + \{ current@arg equ argname + label ..arg type + argname equ ..arg + if dqword eq type + dd ?,?,?,? + else if tbyte eq type + dd ?,?,? + else if qword eq type | pword eq type + dd ?,? + else + dd ? + end if \} + match =current@arg,current@arg + \{ current@arg equ arg + arg equ ..arg + ..arg dd ? \} + common + args@proc equ current@arg + forward + restore current@arg + common + end if } + +macro deflocal@proc name,def,[val] + { common + match vars, all@vars \{ all@vars equ all@vars, \} + all@vars equ all@vars name + forward + local ..var,..tmp + ..var def val + match =?, val \{ ..tmp equ \} + match any =dup (=?), val \{ ..tmp equ \} + match tmp : value, ..tmp : val + \{ tmp: end virtual + initlocal@proc ..var,def value + virtual at tmp\} + common + match first rest, ..var, \{ name equ first \} } + +macro initlocal@proc name,def + { virtual at name + def + size@initlocal = $ - name + end virtual + position@initlocal = 0 + while size@initlocal > position@initlocal + virtual at name + def + if size@initlocal - position@initlocal < 2 + current@initlocal = 1 + load byte@initlocal byte from name+position@initlocal + else if size@initlocal - position@initlocal < 4 + current@initlocal = 2 + load word@initlocal word from name+position@initlocal + else + current@initlocal = 4 + load dword@initlocal dword from name+position@initlocal + end if + end virtual + if current@initlocal = 1 + mov byte [name+position@initlocal],byte@initlocal + else if current@initlocal = 2 + mov word [name+position@initlocal],word@initlocal + else + mov dword [name+position@initlocal],dword@initlocal + end if + position@initlocal = position@initlocal + current@initlocal + end while } + +macro endp + { purge ret,locals,endl + finish@proc + purge finish@proc + restore regs@proc + match all,args@proc \{ restore all \} + restore args@proc + match all,all@vars \{ restore all \} } + +macro local [var] + { common + locals + forward done@local equ + match varname[count]:vartype, var + \{ match =BYTE, vartype \\{ varname rb count + restore done@local \\} + match =WORD, vartype \\{ varname rw count + restore done@local \\} + match =DWORD, vartype \\{ varname rd count + restore done@local \\} + match =PWORD, vartype \\{ varname rp count + restore done@local \\} + match =QWORD, vartype \\{ varname rq count + restore done@local \\} + match =TBYTE, vartype \\{ varname rt count + restore done@local \\} + match =DQWORD, vartype \\{ label varname dqword + rq count+count + restore done@local \\} + match , done@local \\{ virtual + varname vartype + end virtual + rb count*sizeof.\#vartype + restore done@local \\} \} + match :varname:vartype, done@local:var + \{ match =BYTE, vartype \\{ varname db ? + restore done@local \\} + match =WORD, vartype \\{ varname dw ? + restore done@local \\} + match =DWORD, vartype \\{ varname dd ? + restore done@local \\} + match =PWORD, vartype \\{ varname dp ? + restore done@local \\} + match =QWORD, vartype \\{ varname dq ? + restore done@local \\} + match =TBYTE, vartype \\{ varname dt ? + restore done@local \\} + match =DQWORD, vartype \\{ label varname dqword + dq ?,? + restore done@local \\} + match , done@local \\{ varname vartype + restore done@local \\} \} + match ,done@local + \{ var + restore done@local \} + common + endl } diff --git a/contrib/sdk/sources/sound/src/setbuf.asm b/contrib/sdk/sources/sound/src/setbuf.asm new file mode 100644 index 0000000000..0b23778b92 --- /dev/null +++ b/contrib/sdk/sources/sound/src/setbuf.asm @@ -0,0 +1,62 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _SetBuffer@16 +public _PlayBuffer@8 + +align 4 +_SetBuffer@16: ;str:dword, src:dword, offs:dword, size:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 16 ;.inp_size + push ebx ;.input + push SND_SETBUFF ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 16 + +align 4 +_PlayBuffer@8: ;str:dword,flags:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 8 ;.inp_size + push ebx ;.input + push SND_PLAY ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + diff --git a/contrib/sdk/sources/sound/src/snd.inc b/contrib/sdk/sources/sound/src/snd.inc new file mode 100644 index 0000000000..a098d41877 --- /dev/null +++ b/contrib/sdk/sources/sound/src/snd.inc @@ -0,0 +1,41 @@ + +struc CTRL_INFO +{ .pci_cmd dd ? + .irq dd ? + .glob_cntrl dd ? + .glob_sta dd ? + .codec_io_base dd ? + .ctrl_io_base dd ? + .codec_mem_base dd ? + .ctrl_mem_base dd ? + .codec_id dd ? +} +CTRL_INFO_SIZE equ 9*4 + +SRV_GETVERSION equ 0 +SND_CREATE_BUFF equ 1 +SND_DESTROY_BUFF equ 2 +SND_SETFORMAT equ 3 +SND_GETFORMAT equ 4 +SND_RESET equ 5 +SND_SETPOS equ 6 +SND_GETPOS equ 7 +SND_SETBUFF equ 8 +SND_OUT equ 9 +SND_PLAY equ 10 +SND_STOP equ 11 +SND_SETVOLUME equ 12 +SND_GETVOLUME equ 13 +SND_SETPAN equ 14 +SND_GETPAN equ 15 +SND_GETBUFFSIZE equ 16 +SND_GETFREESPACE equ 17 +SND_SETTIMEBASE equ 18 +SND_GETTIMESTAMP equ 19 + +DEV_SET_BUFF equ 4 +DEV_NOTIFY equ 5 +DEV_SET_MASTERVOL equ 6 +DEV_GET_MASTERVOL equ 7 +DEV_GET_INFO equ 8 + diff --git a/contrib/sdk/sources/sound/src/sndgetfmt.asm b/contrib/sdk/sources/sound/src/sndgetfmt.asm new file mode 100644 index 0000000000..8854ea2af6 --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndgetfmt.asm @@ -0,0 +1,35 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _GetFormat@8 + +align 4 +_GetFormat@8: ;str:dword, p_fmt:dword + push ebx + push ecx + + lea eax, [esp+16] ;p_fmt + lea ebx, [esp+12] ;[stream] + + push 4 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETFORMAT ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + diff --git a/contrib/sdk/sources/sound/src/sndgetmvol.asm b/contrib/sdk/sources/sound/src/sndgetmvol.asm new file mode 100644 index 0000000000..0d8cf37af6 --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndgetmvol.asm @@ -0,0 +1,74 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _GetMasterVol@4 + +extrn hrdwSound + +align 4 +proc _GetMasterVol@4 stdcall, pvol:dword + locals + handle dd ? + io_code dd ? + input dd ? + inp_size dd ? + output dd ? + out_size dd ? + endl + + push ebx + push ecx + mov eax, [hrdwSound] + mov ecx, [pvol] + xor ebx, ebx + mov [handle], eax + mov [io_code], DEV_GET_MASTERVOL + mov [input], ebx + mov [inp_size], ebx + mov [output], ecx + mov [out_size], 4 + + mov eax, 68 + mov ebx, 17 + lea ecx, [handle] + int 0x40 + pop ecx + pop ebx + ret +endp + +if 0 +align 4 +proc _GetDevInfo@8 stdcall, hSrv:dword, p_info:dword + locals + handle dd ? + io_code dd ? + input dd ? + inp_size dd ? + output dd ? + out_size dd ? + endl + + push ebx + mov eax, [hSrv] + xor ebx, ebx + mov ecx, [p_info] + + mov [handle], eax + mov [io_code], DEV_GET_INFO + mov [input], ebx + mov [inp_size], ebx + mov [output], ecx + mov [out_size], CTRL_INFO_SIZE + + lea eax, [handle] + stdcall CallServiceEx, eax + pop ebx + ret +endp + +end if \ No newline at end of file diff --git a/contrib/sdk/sources/sound/src/sndgetpan.asm b/contrib/sdk/sources/sound/src/sndgetpan.asm new file mode 100644 index 0000000000..32b0e4d5ed --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndgetpan.asm @@ -0,0 +1,35 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _GetPan@8 + +extrn hSound + +align 4 +_GetPan@8: ;str:dword, p_pan:dword + push ebx + push ecx + + lea eax, [esp+16] + lea ebx, [esp+12] ;[stream] + + push 4 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETPAN ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + diff --git a/contrib/sdk/sources/sound/src/sndgetpos.asm b/contrib/sdk/sources/sound/src/sndgetpos.asm new file mode 100644 index 0000000000..15a96dcccc --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndgetpos.asm @@ -0,0 +1,36 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _GetBufferPos@8 + +align 4 +_GetBufferPos@8: ;str:dword, p_pos:dword + + push ebx + push ecx + + lea eax, [esp+16] + lea ebx, [esp+12] ;[stream] + + push 4 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETPOS ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + diff --git a/contrib/sdk/sources/sound/src/sndgetsize.asm b/contrib/sdk/sources/sound/src/sndgetsize.asm new file mode 100644 index 0000000000..0a598b7026 --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndgetsize.asm @@ -0,0 +1,63 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _GetBufferSize@8 +public _GetBufferFree@8 + +extrn hSound + +align 4 +_GetBufferSize@8: ;str:dword, p_size:dword + + push ebx + push ecx + + lea eax, [esp+16] + lea ebx, [esp+12] ;[stream] + + push 4 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETBUFFSIZE;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + +align 4 +_GetBufferFree@8: ;str:dword, p_free:dword + push ebx + push ecx + + lea ebx, [esp+12] ;[stream] + push 0 ;storage for free_space + mov eax, esp + + push 4 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETFREESPACE ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + mov ecx, [esp+20] ; p_free + pop dword [ecx] + pop ecx + pop ebx + ret 8 diff --git a/contrib/sdk/sources/sound/src/sndgetvol.asm b/contrib/sdk/sources/sound/src/sndgetvol.asm new file mode 100644 index 0000000000..dadcff1632 --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndgetvol.asm @@ -0,0 +1,44 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _GetVolume@12 + +extrn hSound + +align 4 +proc _GetVolume@12 stdcall, str:dword, pleft:dword,pright:dword + locals + handle dd ? + io_code dd ? + input dd ? + inp_size dd ? + output dd ? + out_size dd ? + endl + + push ebx + push ecx + mov eax, [hSound] + lea ebx, [str] + lea ecx, [pleft] + mov [handle], eax + mov [io_code], SND_GETVOLUME + mov [input], ebx + mov [inp_size], 4 + mov [output], ecx + mov [out_size], 8 + + mov eax, 68 + mov ebx, 17 + lea ecx, [handle] + int 0x40 + pop ecx + pop ebx + ret +endp + + diff --git a/contrib/sdk/sources/sound/src/sndout.asm b/contrib/sdk/sources/sound/src/sndout.asm new file mode 100644 index 0000000000..9f3f3216cb --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndout.asm @@ -0,0 +1,34 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _WaveOut@12 + +align 4 +_WaveOut@12: ;str:dword, src:dword, size:dword + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 12 ;.inp_size + push ebx ;.input + push SND_OUT ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 12 diff --git a/contrib/sdk/sources/sound/src/sndreset.asm b/contrib/sdk/sources/sound/src/sndreset.asm new file mode 100644 index 0000000000..03b127c0ce --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndreset.asm @@ -0,0 +1,36 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _ResetBuffer@8 + +align 4 +_ResetBuffer@8: ;str:dword, flags:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 12 ;.inp_size + push ebx ;.input + push SND_RESET ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + diff --git a/contrib/sdk/sources/sound/src/sndsetfmt.asm b/contrib/sdk/sources/sound/src/sndsetfmt.asm new file mode 100644 index 0000000000..7df233ba0a --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndsetfmt.asm @@ -0,0 +1,35 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _SetFormat@8 + +align 4 +_SetFormat@8: ;str:dword, fmt:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 8 ;.inp_size + push ebx ;.input + push SND_SETFORMAT ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 diff --git a/contrib/sdk/sources/sound/src/sndsetmvol.asm b/contrib/sdk/sources/sound/src/sndsetmvol.asm new file mode 100644 index 0000000000..f78dcc530e --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndsetmvol.asm @@ -0,0 +1,36 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _SetMasterVol@4 + +extrn hrdwSound + +align 4 +_SetMasterVol@4: ;vol:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push DEV_SET_MASTERVOL ;.code + push dword [hrdwSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 4 + diff --git a/contrib/sdk/sources/sound/src/sndsetpan.asm b/contrib/sdk/sources/sound/src/sndsetpan.asm new file mode 100644 index 0000000000..b7358bbf8b --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndsetpan.asm @@ -0,0 +1,34 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _SetPan@8 + +extrn hSound + +align 4 +_SetPan@8: ;str:dword, pan:dword + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 12 ;.inp_size + push ebx ;.input + push SND_SETPAN ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 diff --git a/contrib/sdk/sources/sound/src/sndsetpos.asm b/contrib/sdk/sources/sound/src/sndsetpos.asm new file mode 100644 index 0000000000..a93c3085a2 --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndsetpos.asm @@ -0,0 +1,36 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _SetBufferPos@8 + +align 4 +_SetBufferPos@8: ;str:dword, offs:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 8 ;.inp_size + push ebx ;.input + push SND_SETPOS ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + diff --git a/contrib/sdk/sources/sound/src/sndsetvol.asm b/contrib/sdk/sources/sound/src/sndsetvol.asm new file mode 100644 index 0000000000..8eb4a4191f --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndsetvol.asm @@ -0,0 +1,36 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _SetVolume@12 + +extrn hSound + +align 4 +_SetVolume@12: ;str:dword, lvol:dword,rvol:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 12 ;.inp_size + push ebx ;.input + push SND_SETVOLUME ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 12 + diff --git a/contrib/sdk/sources/sound/src/sndtime.asm b/contrib/sdk/sources/sound/src/sndtime.asm new file mode 100644 index 0000000000..94393c2402 --- /dev/null +++ b/contrib/sdk/sources/sound/src/sndtime.asm @@ -0,0 +1,90 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _SetTimeBase@12 +public _GetTimeStamp@8 +public _GetDevTime@4 + +extrn hSound +extrn hrdwSound + +align 4 +_SetTimeBase@12: ;stdcall str:dword, timebase:qword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 12 ;.inp_size + push ebx ;.input + push SND_SETTIMEBASE ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 12 + +align 4 +_GetTimeStamp@8: ; stdcall, str:dword, pstamp:dword + + push ebx + push ecx + + lea ebx, [esp+12] ;[stream] + mov eax, [esp+16] ;[pstamp] + + push 8 ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_GETTIMESTAMP ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 8 + +align 4 +_GetDevTime@4: ; pstamp:dword + + push ebx + push ecx + + xor ebx, ebx + mov eax, [esp+12] ;[pstamp] + + push 4 ;.out_size + push eax ;.output + push ebx ;.inp_size + push ebx ;.input + push 9 ;.code + push dword [hrdwSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 4 + + diff --git a/contrib/sdk/sources/sound/src/stopbuf.asm b/contrib/sdk/sources/sound/src/stopbuf.asm new file mode 100644 index 0000000000..063ff5f3b1 --- /dev/null +++ b/contrib/sdk/sources/sound/src/stopbuf.asm @@ -0,0 +1,37 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +extrn hSound + +public _StopBuffer@4 + +align 4 +_StopBuffer@4: ;str:dword + + push ebx + push ecx + + xor eax, eax + lea ebx, [esp+12] ;[stream] + + push eax ;.out_size + push eax ;.output + push 4 ;.inp_size + push ebx ;.input + push SND_STOP ;.code + push dword [hSound] ;.handle + + mov eax, 68 + mov ebx, 17 + mov ecx, esp + int 0x40 + add esp, 24 + pop ecx + pop ebx + ret 4 + + \ No newline at end of file diff --git a/contrib/sdk/sources/sound/src/wavhdr.asm b/contrib/sdk/sources/sound/src/wavhdr.asm new file mode 100644 index 0000000000..021030f8fd --- /dev/null +++ b/contrib/sdk/sources/sound/src/wavhdr.asm @@ -0,0 +1,170 @@ +format MS COFF + +include "snd.inc" +include "proc32.inc" + +section '.text' align 16 code readable executable + +public _test_wav@4 + +; convert WAVEHEADER into PCM_x_xx_xx constant + +align 4 +proc _test_wav@4 stdcall, hdr:dword + + mov eax, [hdr] + cmp dword [eax], 0x46464952 + jne .fail + + cmp dword [eax+8], 0x45564157 + jne .fail + + cmp word [eax+20], 1 + jne .fail + + mov ecx, dword [eax+24] + mov edx, 22050 + cmp ecx, edx + ja .high + je .l_22 + + cmp ecx, 8000 + je .l_8 + + cmp ecx, 11025 + je .l_11 + + cmp ecx, 12000 + je .l_12 + + cmp ecx, 16000 + je .l_16 +.fail: + xor eax, eax + ret +.high: + cmp ecx, 24000 + je .LN56 + cmp ecx, 32000 + je .LN65 + cmp ecx, 44100 + je .LN74 + cmp ecx, 48000 + jne .fail + + movzx ecx, word [eax+22] + dec ecx + je .LN79 + dec ecx + jne .LN74 + + mov edx, 19 + jmp .done +.LN79: + mov edx, 20 + jmp .done +.LN74: + movzx ecx, word [eax+22] + dec ecx + je .LN70 + dec ecx + jne .LN65 + + mov edx, 21 + jmp .done +.LN70: + mov edx, 22 + jmp .done +.LN65: + movzx ecx, word [eax+22] + dec ecx + je .LN61 + dec ecx + jne .LN56 + + mov edx, 23 + jmp .done +.LN61: + mov edx, 24 + jmp .done +.LN56: + movzx ecx, word [eax+22] + dec ecx + je .LN52 + dec ecx + je .LN50 +.l_22: + movzx ecx, word [eax+22] + dec ecx + je .LN43 + dec ecx + je .LN41 +.l_16: + movzx ecx, word [eax+22] + dec ecx + je .LN34 + dec ecx + je .LN32 +.l_12: + movzx ecx, word [eax+22] + dec ecx + je .LN25 + dec ecx + je .LN23 +.l_11: + movzx ecx, word [eax+22] + dec ecx + je .LN16 + dec ecx + je .LN14 +.l_8: + movzx ecx, word [eax+22] + dec ecx + je .LN7 + dec ecx + jne .fail + + mov edx, 35 + jmp .done +.LN7: + mov edx, 36 + jmp .done +.LN14: + mov edx, 33 + jmp .done +.LN16: + mov edx, 34 + jmp .done +.LN23: + mov edx, 31 + jmp .done +.LN25: + mov edx, 32 + jmp .done +.LN32: + mov edx, 29 + jmp .done +.LN34: + mov edx, 30 + jmp .done +.LN41: + mov edx, 27 + jmp .done +.LN43: + mov edx, 28 + jmp .done +.LN50: + mov edx, 25 + jmp .done +.LN52: + mov edx, 26 +.done: + xor ecx, ecx + cmp word [eax+34], 16 + setne cl + dec ecx + and ecx, -18 + add ecx, edx + mov eax, ecx + ret +endp diff --git a/contrib/sdk/sources/zlib/Makefile b/contrib/sdk/sources/zlib/Makefile index a4822157bd..3b4b4453d9 100644 --- a/contrib/sdk/sources/zlib/Makefile +++ b/contrib/sdk/sources/zlib/Makefile @@ -16,7 +16,7 @@ LD = kos32-ld AR = kos32-ar STRIP = kos32-strip -CFLAGS = $(LOC) -DHAVE_UNISTD_H -U_Win32 -U_WIN32 -U__MINGW32__ -O2 -Wall -fomit-frame-pointer +CFLAGS = $(LOC) -DHAVE_UNISTD_H -U_Win32 -U_WIN32 -U__MINGW32__ -O2 -Wall -fno-ident -fomit-frame-pointer AS = $(CC) ASFLAGS = $(LOC) -Wall diff --git a/contrib/sdk/sources/zlib/zlib.def b/contrib/sdk/sources/zlib/zlib.def index f0fb168e6b..4716f49bcb 100644 --- a/contrib/sdk/sources/zlib/zlib.def +++ b/contrib/sdk/sources/zlib/zlib.def @@ -1,4 +1,4 @@ -LIBRARY zlib.dll +LIBRARY libz.dll ; zlib data compression library EXPORTS