src/stdlib/SDL_stdlib.c
author Sam Lantinga <slouken@libsdl.org>
Sat, 22 Feb 2014 10:40:12 -0800
changeset 8231 ad3edb1923f2
parent 8149 681eb46b8ac4
child 8583 fb2933ca805f
permissions -rw-r--r--
Thou shalt not use more than 4k local variables in this code.
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
8149
681eb46b8ac4 Fixed bug 2374 - Update copyright for 2014...
Sam Lantinga <slouken@libsdl.org>
parents: 8093
diff changeset
     3
  Copyright (C) 1997-2014 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
*/
8093
b43765095a6f Make internal SDL sources include SDL_internal.h instead of SDL_config.h
Ryan C. Gordon <icculus@icculus.org>
parents: 8056
diff changeset
    21
#include "../SDL_internal.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
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   281
/* Float to long */
3253
5d7ef5970073 Fixed issues building 64-bit Windows binary
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   282
void
5d7ef5970073 Fixed issues building 64-bit Windows binary
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   283
__declspec(naked)
5d7ef5970073 Fixed issues building 64-bit Windows binary
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
   284
_ftol()
1345
7f32b9bede06 Fixes for Visual C++ 6.0
Sam Lantinga <slouken@libsdl.org>
parents: 1331
diff changeset
   285
{
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
   286
    /* *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
   287
    __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
   288
        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
   289
        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
   290
        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
   291
        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
   292
        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
   293
        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
   294
        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
   295
        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
   296
        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
   297
        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
   298
        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
   299
        je          integer_QnaN_or_zero
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   300
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
   301
        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
   302
        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
   303
        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
   304
        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
   305
        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
   306
        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
   307
        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
   308
        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
   309
        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
   310
        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
   311
        jmp         localexit
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   312
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
   313
        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
   314
        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
   315
        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
   316
        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
   317
        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
   318
        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
   319
        jmp         localexit
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   320
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
   321
        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
   322
        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
   323
        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
   324
        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
   325
        fstp        dword ptr [esp+18h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   326
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
   327
        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
   328
        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
   329
    }
c121d94672cb SDL 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
    /* *INDENT-ON* */
1345
7f32b9bede06 Fixes for Visual C++ 6.0
Sam Lantinga <slouken@libsdl.org>
parents: 1331
diff changeset
   331
}
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
   332
c121d94672cb SDL 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
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
   334
_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
   335
{
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
   336
    _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
   337
}
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   338
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   339
/* 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
   340
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
   341
__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
   342
_allmul()
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   343
{
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
   344
    /* *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
   345
    __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
   346
        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
   347
        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
   348
        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
   349
        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
   350
        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
   351
        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
   352
        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
   353
        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
   354
        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
   355
        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
   356
        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
   357
        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
   358
        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
   359
        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
   360
        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
   361
        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
   362
        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
   363
        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
   364
        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
   365
        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
   366
        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
   367
        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
   368
        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
   369
        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
   370
        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
   371
        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
   372
        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
   373
        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
   374
        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
   375
    }
c121d94672cb SDL 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
    /* *INDENT-ON* */
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   377
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   378
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
   379
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
   380
__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
   381
_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
   382
{
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
   383
    /* *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
   384
    __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
   385
        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
   386
        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
   387
        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
   388
        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
   389
        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
   390
        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
   391
        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
   392
        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
   393
        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
   394
        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
   395
        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
   396
        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
   397
        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
   398
        mov         dword ptr [esp+10h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   399
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
   400
        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
   401
        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
   402
        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
   403
        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
   404
        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
   405
        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
   406
        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
   407
        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
   408
        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
   409
        mov         dword ptr [esp+18h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   410
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
   411
        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
   412
        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
   413
        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
   414
        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
   415
        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
   416
        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
   417
        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
   418
        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
   419
        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
   420
        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
   421
        jmp         L4
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   422
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
   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         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
   425
        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
   426
        mov         eax,dword ptr [esp+10h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   427
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
   428
        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
   429
        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
   430
        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
   431
        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
   432
        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
   433
        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
   434
        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
   435
        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
   436
        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
   437
        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
   438
        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
   439
        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
   440
        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
   441
        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
   442
        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
   443
        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
   444
        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
   445
        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
   446
        jbe         L7
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   447
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
   448
        dec         esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   449
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
   450
        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
   451
        mov         eax,esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   452
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
   453
        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
   454
        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
   455
        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
   456
        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
   457
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   458
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
   459
        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
   460
        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
   461
        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
   462
        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
   463
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   464
    /* *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
   465
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   466
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
   467
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
   468
__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
   469
_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
   470
{
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
   471
    /* *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
   472
    __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
   473
        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
   474
        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
   475
        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
   476
        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
   477
        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
   478
        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
   479
        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
   480
        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
   481
        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
   482
        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
   483
        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
   484
        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
   485
        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
   486
        jmp         L2
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   487
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
   488
        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
   489
        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
   490
        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
   491
        mov         eax,dword ptr [esp+0Ch]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   492
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
   493
        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
   494
        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
   495
        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
   496
        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
   497
        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
   498
        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
   499
        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
   500
        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
   501
        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
   502
        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
   503
        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
   504
        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
   505
        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
   506
        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
   507
        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
   508
        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
   509
        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
   510
        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
   511
        jbe         L5
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   512
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
   513
        dec         esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   514
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
   515
        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
   516
        mov         eax,esi
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   517
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
   518
        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
   519
        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
   520
        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
   521
    }
c121d94672cb SDL 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
    /* *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
   523
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   524
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
   525
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
   526
__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
   527
_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
   528
{
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
   529
    /* *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
   530
    __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
   531
        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
   532
        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
   533
        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
   534
        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
   535
        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
   536
        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
   537
        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
   538
        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
   539
        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
   540
        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
   541
        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
   542
        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
   543
        mov         dword ptr [esp+0Ch],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   544
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
   545
        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
   546
        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
   547
        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
   548
        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
   549
        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
   550
        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
   551
        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
   552
        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
   553
        mov         dword ptr [esp+14h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   554
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
   555
        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
   556
        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
   557
        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
   558
        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
   559
        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
   560
        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
   561
        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
   562
        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
   563
        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
   564
        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
   565
        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
   566
        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
   567
        jmp         L8
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   568
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
   569
        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
   570
        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
   571
        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
   572
        mov         eax,dword ptr [esp+0Ch]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   573
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
   574
        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
   575
        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
   576
        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
   577
        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
   578
        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
   579
        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
   580
        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
   581
        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
   582
        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
   583
        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
   584
        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
   585
        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
   586
        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
   587
        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
   588
        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
   589
        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
   590
        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
   591
        jbe         L7
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   592
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
   593
        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
   594
        sbb         edx,dword ptr [esp+18h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   595
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
   596
        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
   597
        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
   598
        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
   599
        jns         L8
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   600
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
   601
        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
   602
        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
   603
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   604
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
   605
        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
   606
        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
   607
        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
   608
    }
c121d94672cb SDL 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
    /* *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
   610
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   611
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
   612
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
   613
__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
   614
_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
   615
{
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
   616
    /* *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
   617
    __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
   618
        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
   619
        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
   620
        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
   621
        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
   622
        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
   623
        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
   624
        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
   625
        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
   626
        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
   627
        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
   628
        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
   629
        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
   630
        jmp         L2
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   631
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
   632
        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
   633
        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
   634
        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
   635
        mov         eax,dword ptr [esp+8]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   636
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
   637
        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
   638
        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
   639
        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
   640
        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
   641
        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
   642
        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
   643
        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
   644
        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
   645
        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
   646
        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
   647
        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
   648
        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
   649
        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
   650
        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
   651
        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
   652
        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
   653
        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
   654
        jbe         L5
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   655
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
   656
        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
   657
        sbb         edx,dword ptr [esp+14h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   658
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
   659
        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
   660
        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
   661
        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
   662
        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
   663
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   664
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
   665
        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
   666
        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
   667
    }
c121d94672cb SDL 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
    /* *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
   669
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   670
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
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
   672
__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
   673
_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
   674
{
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
   675
    /* *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
   676
    __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
   677
        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
   678
        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
   679
        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
   680
        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
   681
        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
   682
        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
   683
        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
   684
        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
   685
        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
   686
        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
   687
        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
   688
        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
   689
        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
   690
        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
   691
        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
   692
        mov         dword ptr [esp+10h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   693
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
   694
        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
   695
        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
   696
        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
   697
        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
   698
        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
   699
        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
   700
        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
   701
        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
   702
        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
   703
        mov         dword ptr [esp+18h],edx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   704
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
   705
        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
   706
        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
   707
        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
   708
        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
   709
        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
   710
        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
   711
        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
   712
        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
   713
        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
   714
        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
   715
        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
   716
        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
   717
        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
   718
        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
   719
        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
   720
        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
   721
        jmp         L4
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   722
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
   723
        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
   724
        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
   725
        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
   726
        mov         eax,dword ptr [esp+10h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   727
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
   728
        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
   729
        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
   730
        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
   731
        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
   732
        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
   733
        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
   734
        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
   735
        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
   736
        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
   737
        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
   738
        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
   739
        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
   740
        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
   741
        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
   742
        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
   743
        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
   744
        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
   745
        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
   746
        jbe         L7
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   747
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
   748
        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
   749
        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
   750
        sbb         edx,dword ptr [esp+1Ch]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   751
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
   752
        xor         ebx,ebx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   753
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
   754
        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
   755
        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
   756
        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
   757
        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
   758
        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
   759
        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
   760
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   761
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
   762
        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
   763
        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
   764
        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
   765
        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
   766
        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
   767
        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
   768
        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
   769
        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
   770
        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
   771
        sbb         edx,0
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   772
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
   773
        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
   774
        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
   775
        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
   776
        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
   777
    }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   778
    /* *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
   779
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   780
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
   781
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
   782
__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
   783
_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
   784
{
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
   785
    /* *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
   786
    __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
   787
        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
   788
        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
   789
        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
   790
        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
   791
        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
   792
        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
   793
        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
   794
        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
   795
        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
   796
        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
   797
        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
   798
        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
   799
        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
   800
        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
   801
        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
   802
        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
   803
        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
   804
        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
   805
        jmp         L2
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   806
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
   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         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
   809
        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
   810
        mov         eax,dword ptr [esp+8]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   811
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
   812
        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
   813
        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
   814
        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
   815
        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
   816
        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
   817
        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
   818
        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
   819
        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
   820
        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
   821
        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
   822
        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
   823
        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
   824
        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
   825
        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
   826
        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
   827
        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
   828
        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
   829
        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
   830
        jbe         L5
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   831
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
   832
        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
   833
        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
   834
        sbb         edx,dword ptr [esp+14h]
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   835
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
   836
        xor         ebx,ebx
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   837
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
   838
        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
   839
        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
   840
        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
   841
        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
   842
        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
   843
        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
   844
        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
   845
        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
   846
        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
   847
        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
   848
        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
   849
        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
   850
    }
c121d94672cb SDL 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
    /* *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
   852
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   853
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
   854
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
   855
__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
   856
_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
   857
{
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
   858
    /* *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
   859
    __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
   860
        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
   861
        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
   862
        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
   863
        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
   864
        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
   865
        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
   866
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   867
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
   868
        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
   869
        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
   870
        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
   871
        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
   872
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   873
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
   874
        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
   875
        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
   876
        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
   877
    }
c121d94672cb SDL 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
    /* *INDENT-ON* */
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   879
}
2735
204be4fc2726 Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
   880
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
   881
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
   882
__declspec(naked)
2760
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   883
_allshr()
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   884
{
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   885
    /* *INDENT-OFF* */
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   886
    __asm {
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   887
        cmp         cl,40h
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   888
        jae         RETZERO
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   889
        cmp         cl,20h
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   890
        jae         MORE32
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   891
        shrd        eax,edx,cl
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   892
        sar         edx,cl
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   893
        ret
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   894
MORE32:
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   895
        mov         eax,edx
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   896
        xor         edx,edx
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   897
        and         cl,1Fh
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   898
        sar         eax,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
RETZERO:
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   901
        xor         eax,eax
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
        ret
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   904
    }
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   905
    /* *INDENT-ON* */
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   906
}
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   907
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   908
void
02aa80d7905f Updated Visual C++ build
Sam Lantinga <slouken@libsdl.org>
parents: 2735
diff changeset
   909
__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
   910
_aullshr()
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   911
{
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
   912
    /* *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
   913
    __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
   914
        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
   915
        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
   916
        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
   917
        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
   918
        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
   919
        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
   920
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   921
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
   922
        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
   923
        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
   924
        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
   925
        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
   926
        ret
1346
1b5fbaf1d2c6 Default to build SDL without MSVCRT
Sam Lantinga <slouken@libsdl.org>
parents: 1345
diff changeset
   927
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
   928
        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
   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
        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
   931
    }
c121d94672cb SDL 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
    /* *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
   933
}
450721ad5436 It's now possible to build SDL without any C runtime at all on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   934
5455
5fbf5fc81aa8 Fixed linking x64 with Visual Studio 2010.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   935
#endif /* _M_IX86 */
3255
f8a4214ce90a Fixed compiling on 64-bit Windows
Sam Lantinga <slouken@libsdl.org>
parents: 3253
diff changeset
   936
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
   937
#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
   938
1331
1cbaeee565b1 A few fixes to get this building on Linux again
Sam Lantinga <slouken@libsdl.org>
parents: 1330
diff changeset
   939
#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
   940
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents: 1433
diff changeset
   941
/* vi: set ts=4 sw=4 expandtab: */