src/video/ataricommon/SDL_atarimxalloc.c
author Sam Lantinga
Sun, 17 Feb 2002 19:54:28 +0000
changeset 281 c5010ab8ba35
child 297 f6ffac90895c
permissions -rw-r--r--
Added initial support for Atari (thanks Patrice!)
slouken@281
     1
/*
slouken@281
     2
    SDL - Simple DirectMedia Layer
slouken@281
     3
    Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
slouken@281
     4
slouken@281
     5
    This library is free software; you can redistribute it and/or
slouken@281
     6
    modify it under the terms of the GNU Library General Public
slouken@281
     7
    License as published by the Free Software Foundation; either
slouken@281
     8
    version 2 of the License, or (at your option) any later version.
slouken@281
     9
slouken@281
    10
    This library is distributed in the hope that it will be useful,
slouken@281
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@281
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@281
    13
    Library General Public License for more details.
slouken@281
    14
slouken@281
    15
    You should have received a copy of the GNU Library General Public
slouken@281
    16
    License along with this library; if not, write to the Free
slouken@281
    17
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
slouken@281
    18
slouken@281
    19
    Sam Lantinga
slouken@281
    20
    slouken@libsdl.org
slouken@281
    21
*/
slouken@281
    22
slouken@281
    23
#ifdef SAVE_RCSID
slouken@281
    24
static char rcsid =
slouken@281
    25
 "@(#) $Id$";
slouken@281
    26
#endif
slouken@281
    27
slouken@281
    28
/*
slouken@281
    29
 *	Memory allocation
slouken@281
    30
 *
slouken@281
    31
 *	Patrice Mandin
slouken@281
    32
 */
slouken@281
    33
slouken@281
    34
#include <mint/osbind.h>
slouken@281
    35
slouken@281
    36
#include "SDL_types.h"
slouken@281
    37
slouken@281
    38
/*--- Variables ---*/
slouken@281
    39
slouken@281
    40
static int atari_mxalloc_avail=-1;
slouken@281
    41
slouken@281
    42
/*--- Functions ---*/
slouken@281
    43
slouken@281
    44
void *Atari_SysMalloc(Uint32 size, Uint16 alloc_type)
slouken@281
    45
{
slouken@281
    46
	/* Test if Mxalloc() available */
slouken@281
    47
	if (atari_mxalloc_avail<0) {
slouken@281
    48
		atari_mxalloc_avail = ((Sversion()&0xFF)>=0x01) | (Sversion()>=0x1900);
slouken@281
    49
	}
slouken@281
    50
slouken@281
    51
	if (atari_mxalloc_avail) {
slouken@281
    52
		return (void *) Mxalloc(size, alloc_type);
slouken@281
    53
	} else { \
slouken@281
    54
		return (void *) Malloc(size);
slouken@281
    55
	}
slouken@281
    56
}