src/stdlib/SDL_stdlib.c
author Ryan C. Gordon <icculus@icculus.org>
Mon, 09 Dec 2013 15:17:20 -0500
changeset 8056 abd9434c5d3e
parent 8033 8181c3a4a055
child 8093 b43765095a6f
permissions -rw-r--r--
Hook up SDL_acos and SDL_asin properly.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
     2
  Simple DirectMedia Layer
6885
700f1b25f77f Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6355
diff changeset
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
     7
  arising from the use of this software.
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    11
  freely, subject to the following restrictions:
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5455
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
1402
d910939febfa Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents: 1354
diff changeset
    21
#include "SDL_config.h"
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
/* This file contains portable stdlib functions for SDL */
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
1354
22f39393668a Fixed build problem with SDL_string.c
Sam Lantinga <slouken@libsdl.org>
parents: 1346
diff changeset
    25
#include "SDL_stdinc.h"
7351
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    26
#include "../libm/math_libm.h"
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
7351
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    28
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    29
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    30
SDL_atan(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    31
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    32
#ifdef HAVE_ATAN
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    33
    return atan(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    34
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    35
    return SDL_uclibc_atan(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    36
#endif /* HAVE_ATAN */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    37
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    38
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    39
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    40
SDL_atan2(double x, double y)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    41
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    42
#if defined(HAVE_ATAN2)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    43
    return atan2(x, y);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    44
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    45
    return SDL_uclibc_atan2(x, y);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    46
#endif /* HAVE_ATAN2 */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    47
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    48
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    49
double
8056
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    50
SDL_acos(double val)
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    51
{
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    52
#if defined(HAVE_ACOS)
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    53
    return acos(val);
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    54
#else
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    55
    double result;
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    56
    if (val == -1.0) {
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    57
        result = M_PI;
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    58
    } else {
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    59
        result = SDL_atan(SDL_sqrt(1.0 - val * val) / val);
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    60
        if (result < 0.0)
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    61
        {
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    62
            result += M_PI;
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    63
        }
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    64
    }
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    65
    return result;
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    66
#endif
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    67
}
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    68
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    69
double
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    70
SDL_asin(double val)
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    71
{
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    72
#if defined(HAVE_ASIN)
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    73
    return asin(val);
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    74
#else
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    75
    double result;
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    76
    if (val == -1.0) {
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    77
        result = -(M_PI / 2.0);
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    78
    } else {
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    79
        result = (M_PI / 2.0) - SDL_acos(val);
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    80
    }
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    81
    return result;
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    82
#endif
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    83
}
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    84
abd9434c5d3e Hook up SDL_acos and SDL_asin properly.
Ryan C. Gordon <icculus@icculus.org>
parents: 8033
diff changeset
    85
double
7351
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    86
SDL_ceil(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    87
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    88
#ifdef HAVE_CEIL
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    89
    return ceil(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    90
#else
8033
8181c3a4a055 Fixed bug 2274 - SDL_ceil is incorrectly implemented when HAVE_LIBC is not defined
Sam Lantinga <slouken@libsdl.org>
parents: 7357
diff changeset
    91
    double integer = SDL_floor(x);
8181c3a4a055 Fixed bug 2274 - SDL_ceil is incorrectly implemented when HAVE_LIBC is not defined
Sam Lantinga <slouken@libsdl.org>
parents: 7357
diff changeset
    92
    double fraction = x - integer;
8181c3a4a055 Fixed bug 2274 - SDL_ceil is incorrectly implemented when HAVE_LIBC is not defined
Sam Lantinga <slouken@libsdl.org>
parents: 7357
diff changeset
    93
    if (fraction > 0.0) {
8181c3a4a055 Fixed bug 2274 - SDL_ceil is incorrectly implemented when HAVE_LIBC is not defined
Sam Lantinga <slouken@libsdl.org>
parents: 7357
diff changeset
    94
        integer += 1.0;
8181c3a4a055 Fixed bug 2274 - SDL_ceil is incorrectly implemented when HAVE_LIBC is not defined
Sam Lantinga <slouken@libsdl.org>
parents: 7357
diff changeset
    95
    }
8181c3a4a055 Fixed bug 2274 - SDL_ceil is incorrectly implemented when HAVE_LIBC is not defined
Sam Lantinga <slouken@libsdl.org>
parents: 7357
diff changeset
    96
    return integer;
7351
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    97
#endif /* HAVE_CEIL */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    98
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
    99
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   100
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   101
SDL_copysign(double x, double y)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   102
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   103
#if defined(HAVE_COPYSIGN)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   104
    return copysign(x, y);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   105
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   106
    return SDL_uclibc_copysign(x, y);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   107
#endif /* HAVE_COPYSIGN */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   108
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   109
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   110
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   111
SDL_cos(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   112
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   113
#if defined(HAVE_COS)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   114
    return cos(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   115
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   116
    return SDL_uclibc_cos(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   117
#endif /* HAVE_COS */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   118
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   119
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   120
float
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   121
SDL_cosf(float x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   122
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   123
#ifdef HAVE_COSF
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   124
    return cosf(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   125
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   126
    return (float)SDL_cos((double)x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   127
#endif
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   128
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   129
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   130
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   131
SDL_fabs(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   132
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   133
#if defined(HAVE_FABS)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   134
    return fabs(x); 
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   135
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   136
    return SDL_uclibc_fabs(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   137
#endif /* HAVE_FABS */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   138
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   139
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   140
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   141
SDL_floor(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   142
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   143
#if defined(HAVE_FLOOR)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   144
    return floor(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   145
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   146
    return SDL_uclibc_floor(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   147
#endif /* HAVE_FLOOR */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   148
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   149
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   150
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   151
SDL_log(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   152
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   153
#if defined(HAVE_LOG)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   154
    return log(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   155
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   156
    return SDL_uclibc_log(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   157
#endif /* HAVE_LOG */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   158
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   159
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   160
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   161
SDL_pow(double x, double y)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   162
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   163
#if defined(HAVE_POW)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   164
    return pow(x, y);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   165
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   166
    return SDL_uclibc_pow(x, y);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   167
#endif /* HAVE_POW */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   168
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   169
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   170
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   171
SDL_scalbn(double x, int n)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   172
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   173
#if defined(HAVE_SCALBN)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   174
    return scalbn(x, n);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   175
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   176
    return SDL_uclibc_scalbn(x, n);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   177
#endif /* HAVE_SCALBN */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   178
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   179
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   180
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   181
SDL_sin(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   182
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   183
#if defined(HAVE_SIN)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   184
    return sin(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   185
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   186
    return SDL_uclibc_sin(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   187
#endif /* HAVE_SIN */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   188
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   189
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   190
float 
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   191
SDL_sinf(float x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   192
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   193
#ifdef HAVE_SINF
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   194
    return sinf(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   195
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   196
    return (float)SDL_sin((double)x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   197
#endif /* HAVE_SINF */
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   198
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   199
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   200
double
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   201
SDL_sqrt(double x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   202
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   203
#if defined(HAVE_SQRT)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   204
    return sqrt(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   205
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   206
    return SDL_uclibc_sqrt(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   207
#endif
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   208
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   209
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   210
int SDL_abs(int x)
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   211
{
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   212
#ifdef HAVE_ABS
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   213
    return abs(x);
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   214
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   215
    return ((x) < 0 ? -(x) : (x));
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   216
#endif
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   217
}
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   218
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   219
#ifdef HAVE_CTYPE_H
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   220
int SDL_isdigit(int x) { return isdigit(x); }
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   221
int SDL_isspace(int x) { return isspace(x); }
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   222
int SDL_toupper(int x) { return toupper(x); }
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   223
int SDL_tolower(int x) { return tolower(x); }
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   224
#else
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   225
int SDL_isdigit(int x) { return ((x) >= '0') && ((x) <= '9'); }
7357
9bd0b241c941 Fixed SDL's implementation of isspace() to check form feed and vertical tab.
Philipp Wiesemann <philipp.wiesemann@arcor.de>
parents: 7351
diff changeset
   226
int SDL_isspace(int x) { return ((x) == ' ') || ((x) == '\t') || ((x) == '\r') || ((x) == '\n') || ((x) == '\f') || ((x) == '\v'); }
7351
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   227
int SDL_toupper(int x) { return ((x) >= 'a') && ((x) <= 'z') ? ('A'+((x)-'a')) : (x); }
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   228
int SDL_tolower(int x) { return ((x) >= 'A') && ((x) <= 'Z') ? ('a'+((x)-'A')) : (x); }
668a3dc28361 Removed the inline functions from SDL_stdinc.h
Sam Lantinga <slouken@libsdl.org>
parents: 7180
diff changeset
   229
#endif
7003
eeaf77005c30 Improvements to stdlib.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   230
eeaf77005c30 Improvements to stdlib.
Ryan C. Gordon <icculus@icculus.org>
parents: 6885
diff changeset
   231
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   232
#ifndef HAVE_LIBC
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   233
/* These are some C runtime intrinsics that need to be defined */
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   234
3255
f8a4214ce90a Fixed compiling on 64-bit Windows
Sam Lantinga <slouken@libsdl.org>
parents: 3253
diff changeset
   235
#if defined(_MSC_VER)
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   236
1433
bb6839704ed6 SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   237
#ifndef __FLTUSED__
bb6839704ed6 SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   238
#define __FLTUSED__
3255
f8a4214ce90a Fixed compiling on 64-bit Windows
Sam Lantinga <slouken@libsdl.org>
parents: 3253
diff changeset
   239
__declspec(selectany) int _fltused = 1;
1433
bb6839704ed6 SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   240
#endif
3255
f8a4214ce90a Fixed compiling on 64-bit Windows
Sam Lantinga <slouken@libsdl.org>
parents: 3253
diff changeset
   241
6355
3ef4d0e923cb Fixed bug 1540: SDL 2.0 won't link on Visual Studio 2012 RC for x64
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   242
/* The optimizer on Visual Studio 2010/2012 generates memcpy() calls */
3ef4d0e923cb Fixed bug 1540: SDL 2.0 won't link on Visual Studio 2012 RC for x64
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   243
#if _MSC_VER >= 1600 && defined(_WIN64) && !defined(_DEBUG)
5455
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   244
#include <intrin.h>
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   245
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   246
#pragma function(memcpy)
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   247
void * memcpy ( void * destination, const void * source, size_t num )
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   248
{
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   249
    const Uint8 *src = (const Uint8 *)source;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   250
    Uint8 *dst = (Uint8 *)destination;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   251
    size_t i;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   252
    
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   253
    /* All WIN64 architectures have SSE, right? */
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   254
    if (!((uintptr_t) src & 15) && !((uintptr_t) dst & 15)) {
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   255
        __m128 values[4];
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   256
        for (i = num / 64; i--;) {
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   257
            _mm_prefetch(src, _MM_HINT_NTA);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   258
            values[0] = *(__m128 *) (src + 0);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   259
            values[1] = *(__m128 *) (src + 16);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   260
            values[2] = *(__m128 *) (src + 32);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   261
            values[3] = *(__m128 *) (src + 48);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   262
            _mm_stream_ps((float *) (dst + 0), values[0]);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   263
            _mm_stream_ps((float *) (dst + 16), values[1]);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   264
            _mm_stream_ps((float *) (dst + 32), values[2]);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   265
            _mm_stream_ps((float *) (dst + 48), values[3]);
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   266
            src += 64;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   267
            dst += 64;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   268
        }
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   269
        num &= 63;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   270
    }
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   271
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   272
    while (num--) {
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   273
        *dst++ = *src++;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   274
    }
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   275
    return destination;
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   276
}
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   277
#endif /* _MSC_VER == 1600 && defined(_WIN64) && !defined(_DEBUG) */
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   278
5086
c2539ff054c8 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 4868
diff changeset
   279
#ifdef _M_IX86
1433
bb6839704ed6 SDL_windows.h is no longer necessary
Sam Lantinga <slouken@libsdl.org>
parents: 1402
diff changeset
   280
4868
d6adaafcfb10 Fixed compiling with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   281
void
d6adaafcfb10 Fixed compiling with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   282
__declspec(naked)
d6adaafcfb10 Fixed compiling with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   283
_chkstk()
d6adaafcfb10 Fixed compiling with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   284
{
d6adaafcfb10 Fixed compiling with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   285
}
d6adaafcfb10 Fixed compiling with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
   286
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   287
/* Float to long */
3253
5d7ef5970073 Fixed issues building 64-bit Windows binary
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   288
void
5d7ef5970073 Fixed issues building 64-bit Windows binary
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   289
__declspec(naked)
5d7ef5970073 Fixed issues building 64-bit Windows binary
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   290
_ftol()
1345
7f32b9bede06 Fixes for Visual C++ 6.0
Sam Lantinga <slouken@libsdl.org>
parents: 1331
diff changeset
   291
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   292
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   293
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   294
        push        ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   295
        mov         ebp,esp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   296
        sub         esp,20h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   297
        and         esp,0FFFFFFF0h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   298
        fld         st(0)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   299
        fst         dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   300
        fistp       qword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   301
        fild        qword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   302
        mov         edx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   303
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   304
        test        eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   305
        je          integer_QnaN_or_zero
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   306
arg_is_not_integer_QnaN:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   307
        fsubp       st(1),st
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   308
        test        edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   309
        jns         positive
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   310
        fstp        dword ptr [esp]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   311
        mov         ecx,dword ptr [esp]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   312
        xor         ecx,80000000h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   313
        add         ecx,7FFFFFFFh
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   314
        adc         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   315
        mov         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   316
        adc         edx,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   317
        jmp         localexit
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   318
positive:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   319
        fstp        dword ptr [esp]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   320
        mov         ecx,dword ptr [esp]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   321
        add         ecx,7FFFFFFFh
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   322
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   323
        mov         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   324
        sbb         edx,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   325
        jmp         localexit
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   326
integer_QnaN_or_zero:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   327
        mov         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   328
        test        edx,7FFFFFFFh
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   329
        jne         arg_is_not_integer_QnaN
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   330
        fstp        dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   331
        fstp        dword ptr [esp+18h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   332
localexit:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   333
        leave
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   334
        ret
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   335
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   336
    /* *INDENT-ON* */
1345
7f32b9bede06 Fixes for Visual C++ 6.0
Sam Lantinga <slouken@libsdl.org>
parents: 1331
diff changeset
   337
}
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   338
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   339
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   340
_ftol2_sse()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   341
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   342
    _ftol();
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   343
}
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   344
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   345
/* 64-bit math operators for 32-bit systems */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   346
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   347
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   348
_allmul()
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   349
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   350
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   351
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   352
        push        ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   353
        mov         ebp,esp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   354
        push        edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   355
        push        esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   356
        push        ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   357
        sub         esp,0Ch
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   358
        mov         eax,dword ptr [ebp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   359
        mov         edi,dword ptr [ebp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   360
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   361
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   362
        sar         esi,1Fh
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   363
        mov         eax,dword ptr [ebp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   364
        mul         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   365
        imul        edi,esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   366
        mov         ecx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   367
        mov         dword ptr [ebp-18h],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   368
        mov         edx,dword ptr [ebp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   369
        add         ecx,edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   370
        imul        ebx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   371
        mov         eax,dword ptr [ebp-18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   372
        lea         ebx,[ebx+ecx]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   373
        mov         dword ptr [ebp-14h],ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   374
        mov         edx,dword ptr [ebp-14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   375
        add         esp,0Ch
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   376
        pop         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   377
        pop         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   378
        pop         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   379
        pop         ebp
7180
3733e68edbc3 Fixed bug 1846 - _allmul implementation in SDL_stdlib.c doesn't clean up the stack
Sam Lantinga <slouken@libsdl.org>
parents: 7003
diff changeset
   380
        ret         10h
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   381
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   382
    /* *INDENT-ON* */
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   383
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   384
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   385
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   386
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   387
_alldiv()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   388
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   389
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   390
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   391
        push        edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   392
        push        esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   393
        push        ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   394
        xor         edi,edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   395
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   396
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   397
        jge         L1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   398
        inc         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   399
        mov         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   400
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   401
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   402
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   403
        mov         dword ptr [esp+14h],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   404
        mov         dword ptr [esp+10h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   405
L1:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   406
        mov         eax,dword ptr [esp+1Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   407
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   408
        jge         L2
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   409
        inc         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   410
        mov         edx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   411
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   412
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   413
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   414
        mov         dword ptr [esp+1Ch],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   415
        mov         dword ptr [esp+18h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   416
L2:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   417
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   418
        jne         L3
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   419
        mov         ecx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   420
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   421
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   422
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   423
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   424
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   425
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   426
        mov         edx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   427
        jmp         L4
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   428
L3:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   429
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   430
        mov         ecx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   431
        mov         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   432
        mov         eax,dword ptr [esp+10h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   433
L5:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   434
        shr         ebx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   435
        rcr         ecx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   436
        shr         edx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   437
        rcr         eax,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   438
        or          ebx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   439
        jne         L5
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   440
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   441
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   442
        mul         dword ptr [esp+1Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   443
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   444
        mov         eax,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   445
        mul         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   446
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   447
        jb          L6
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   448
        cmp         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   449
        ja          L6
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   450
        jb          L7
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   451
        cmp         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   452
        jbe         L7
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   453
L6:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   454
        dec         esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   455
L7:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   456
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   457
        mov         eax,esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   458
L4:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   459
        dec         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   460
        jne         L8
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   461
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   462
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   463
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   464
L8:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   465
        pop         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   466
        pop         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   467
        pop         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   468
        ret         10h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   469
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   470
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   471
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   472
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   473
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   474
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   475
_aulldiv()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   476
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   477
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   478
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   479
        push        ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   480
        push        esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   481
        mov         eax,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   482
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   483
        jne         L1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   484
        mov         ecx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   485
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   486
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   487
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   488
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   489
        mov         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   490
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   491
        mov         edx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   492
        jmp         L2
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   493
L1:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   494
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   495
        mov         ebx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   496
        mov         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   497
        mov         eax,dword ptr [esp+0Ch]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   498
L3:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   499
        shr         ecx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   500
        rcr         ebx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   501
        shr         edx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   502
        rcr         eax,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   503
        or          ecx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   504
        jne         L3
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   505
        div         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   506
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   507
        mul         dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   508
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   509
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   510
        mul         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   511
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   512
        jb          L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   513
        cmp         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   514
        ja          L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   515
        jb          L5
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   516
        cmp         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   517
        jbe         L5
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   518
L4:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   519
        dec         esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   520
L5:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   521
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   522
        mov         eax,esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   523
L2:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   524
        pop         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   525
        pop         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   526
        ret         10h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   527
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   528
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   529
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   530
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   531
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   532
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   533
_allrem()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   534
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   535
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   536
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   537
        push        ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   538
        push        edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   539
        xor         edi,edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   540
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   541
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   542
        jge         L1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   543
        inc         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   544
        mov         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   545
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   546
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   547
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   548
        mov         dword ptr [esp+10h],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   549
        mov         dword ptr [esp+0Ch],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   550
L1:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   551
        mov         eax,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   552
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   553
        jge         L2
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   554
        mov         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   555
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   556
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   557
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   558
        mov         dword ptr [esp+18h],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   559
        mov         dword ptr [esp+14h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   560
L2:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   561
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   562
        jne         L3
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   563
        mov         ecx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   564
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   565
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   566
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   567
        mov         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   568
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   569
        mov         eax,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   570
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   571
        dec         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   572
        jns         L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   573
        jmp         L8
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   574
L3:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   575
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   576
        mov         ecx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   577
        mov         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   578
        mov         eax,dword ptr [esp+0Ch]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   579
L5:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   580
        shr         ebx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   581
        rcr         ecx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   582
        shr         edx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   583
        rcr         eax,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   584
        or          ebx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   585
        jne         L5
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   586
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   587
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   588
        mul         dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   589
        xchg        eax,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   590
        mul         dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   591
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   592
        jb          L6
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   593
        cmp         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   594
        ja          L6
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   595
        jb          L7
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   596
        cmp         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   597
        jbe         L7
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   598
L6:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   599
        sub         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   600
        sbb         edx,dword ptr [esp+18h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   601
L7:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   602
        sub         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   603
        sbb         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   604
        dec         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   605
        jns         L8
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   606
L4:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   607
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   608
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   609
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   610
L8:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   611
        pop         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   612
        pop         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   613
        ret         10h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   614
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   615
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   616
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   617
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   618
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   619
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   620
_aullrem()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   621
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   622
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   623
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   624
        push        ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   625
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   626
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   627
        jne         L1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   628
        mov         ecx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   629
        mov         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   630
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   631
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   632
        mov         eax,dword ptr [esp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   633
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   634
        mov         eax,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   635
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   636
        jmp         L2
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   637
L1:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   638
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   639
        mov         ebx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   640
        mov         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   641
        mov         eax,dword ptr [esp+8]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   642
L3:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   643
        shr         ecx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   644
        rcr         ebx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   645
        shr         edx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   646
        rcr         eax,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   647
        or          ecx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   648
        jne         L3
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   649
        div         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   650
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   651
        mul         dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   652
        xchg        eax,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   653
        mul         dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   654
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   655
        jb          L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   656
        cmp         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   657
        ja          L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   658
        jb          L5
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   659
        cmp         eax,dword ptr [esp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   660
        jbe         L5
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   661
L4:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   662
        sub         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   663
        sbb         edx,dword ptr [esp+14h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   664
L5:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   665
        sub         eax,dword ptr [esp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   666
        sbb         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   667
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   668
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   669
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   670
L2:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   671
        pop         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   672
        ret         10h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   673
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   674
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   675
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   676
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   677
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   678
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   679
_alldvrm()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   680
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   681
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   682
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   683
        push        edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   684
        push        esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   685
        push        ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   686
        xor         edi,edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   687
        xor         ebp,ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   688
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   689
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   690
        jge         L1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   691
        inc         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   692
        inc         ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   693
        mov         edx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   694
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   695
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   696
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   697
        mov         dword ptr [esp+14h],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   698
        mov         dword ptr [esp+10h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   699
L1:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   700
        mov         eax,dword ptr [esp+1Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   701
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   702
        jge         L2
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   703
        inc         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   704
        mov         edx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   705
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   706
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   707
        sbb         eax,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   708
        mov         dword ptr [esp+1Ch],eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   709
        mov         dword ptr [esp+18h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   710
L2:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   711
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   712
        jne         L3
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   713
        mov         ecx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   714
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   715
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   716
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   717
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   718
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   719
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   720
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   721
        mov         eax,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   722
        mul         dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   723
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   724
        mov         eax,esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   725
        mul         dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   726
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   727
        jmp         L4
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   728
L3:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   729
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   730
        mov         ecx,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   731
        mov         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   732
        mov         eax,dword ptr [esp+10h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   733
L5:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   734
        shr         ebx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   735
        rcr         ecx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   736
        shr         edx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   737
        rcr         eax,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   738
        or          ebx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   739
        jne         L5
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   740
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   741
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   742
        mul         dword ptr [esp+1Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   743
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   744
        mov         eax,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   745
        mul         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   746
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   747
        jb          L6
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   748
        cmp         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   749
        ja          L6
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   750
        jb          L7
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   751
        cmp         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   752
        jbe         L7
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   753
L6:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   754
        dec         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   755
        sub         eax,dword ptr [esp+18h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   756
        sbb         edx,dword ptr [esp+1Ch]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   757
L7:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   758
        xor         ebx,ebx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   759
L4:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   760
        sub         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   761
        sbb         edx,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   762
        dec         ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   763
        jns         L9
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   764
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   765
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   766
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   767
L9:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   768
        mov         ecx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   769
        mov         edx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   770
        mov         ebx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   771
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   772
        mov         eax,esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   773
        dec         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   774
        jne         L8
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   775
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   776
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   777
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   778
L8:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   779
        pop         ebp
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   780
        pop         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   781
        pop         edi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   782
        ret         10h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   783
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   784
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   785
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   786
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   787
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   788
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   789
_aulldvrm()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   790
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   791
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   792
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   793
        push        esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   794
        mov         eax,dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   795
        or          eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   796
        jne         L1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   797
        mov         ecx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   798
        mov         eax,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   799
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   800
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   801
        mov         ebx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   802
        mov         eax,dword ptr [esp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   803
        div         ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   804
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   805
        mov         eax,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   806
        mul         dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   807
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   808
        mov         eax,esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   809
        mul         dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   810
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   811
        jmp         L2
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   812
L1:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   813
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   814
        mov         ebx,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   815
        mov         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   816
        mov         eax,dword ptr [esp+8]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   817
L3:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   818
        shr         ecx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   819
        rcr         ebx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   820
        shr         edx,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   821
        rcr         eax,1
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   822
        or          ecx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   823
        jne         L3
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   824
        div         ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   825
        mov         esi,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   826
        mul         dword ptr [esp+14h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   827
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   828
        mov         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   829
        mul         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   830
        add         edx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   831
        jb          L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   832
        cmp         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   833
        ja          L4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   834
        jb          L5
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   835
        cmp         eax,dword ptr [esp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   836
        jbe         L5
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   837
L4:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   838
        dec         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   839
        sub         eax,dword ptr [esp+10h]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   840
        sbb         edx,dword ptr [esp+14h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   841
L5:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   842
        xor         ebx,ebx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   843
L2:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   844
        sub         eax,dword ptr [esp+8]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   845
        sbb         edx,dword ptr [esp+0Ch]
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   846
        neg         edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   847
        neg         eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   848
        sbb         edx,0
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   849
        mov         ecx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   850
        mov         edx,ebx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   851
        mov         ebx,ecx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   852
        mov         ecx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   853
        mov         eax,esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   854
        pop         esi
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   855
        ret         10h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   856
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   857
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   858
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   859
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   860
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   861
__declspec(naked)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   862
_allshl()
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   863
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   864
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   865
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   866
        cmp         cl,40h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   867
        jae         RETZERO
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   868
        cmp         cl,20h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   869
        jae         MORE32
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   870
        shld        edx,eax,cl
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   871
        shl         eax,cl
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   872
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   873
MORE32:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   874
        mov         edx,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   875
        xor         eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   876
        and         cl,1Fh
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   877
        shl         edx,cl
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   878
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   879
RETZERO:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   880
        xor         eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   881
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   882
        ret
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   883
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   884
    /* *INDENT-ON* */
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   885
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   886
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   887
void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   888
__declspec(naked)
2760
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   889
_allshr()
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   890
{
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   891
    /* *INDENT-OFF* */
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   892
    __asm {
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   893
        cmp         cl,40h
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   894
        jae         RETZERO
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   895
        cmp         cl,20h
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   896
        jae         MORE32
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   897
        shrd        eax,edx,cl
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   898
        sar         edx,cl
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   899
        ret
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   900
MORE32:
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   901
        mov         eax,edx
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   902
        xor         edx,edx
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   903
        and         cl,1Fh
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   904
        sar         eax,cl
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   905
        ret
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   906
RETZERO:
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   907
        xor         eax,eax
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   908
        xor         edx,edx
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   909
        ret
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   910
    }
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   911
    /* *INDENT-ON* */
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   912
}
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   913
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   914
void
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   915
__declspec(naked)
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   916
_aullshr()
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   917
{
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   918
    /* *INDENT-OFF* */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   919
    __asm {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   920
        cmp         cl,40h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   921
        jae         RETZERO
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   922
        cmp         cl,20h
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   923
        jae         MORE32
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   924
        shrd        eax,edx,cl
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   925
        shr         edx,cl
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   926
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   927
MORE32:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   928
        mov         eax,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   929
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   930
        and         cl,1Fh
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   931
        shr         eax,cl
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   932
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   933
RETZERO:
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   934
        xor         eax,eax
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   935
        xor         edx,edx
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   936
        ret
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   937
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   938
    /* *INDENT-ON* */
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   939
}
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   940
5455
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   941
#endif /* _M_IX86 */
3255
f8a4214ce90a Fixed compiling on 64-bit Windows
Sam Lantinga <slouken@libsdl.org>
parents: 3253
diff changeset
   942
1330
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   943
#endif /* MSC_VER */
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   944
1331
1cbaeee565b1 A few fixes to get this building on Linux again
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   945
#endif /* !HAVE_LIBC */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   946
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   947
/* vi: set ts=4 sw=4 expandtab: */