Commit 4b968e37 authored by Sam Lantinga's avatar Sam Lantinga

Removed outdated Atari support

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403828
parent 23bd7aa6
...@@ -46,8 +46,6 @@ Thanks to everyone who made this possible, including: ...@@ -46,8 +46,6 @@ Thanks to everyone who made this possible, including:
* David Carré, for the Pandora port * David Carré, for the Pandora port
* Patrice Mandin, for the Atari port
* Couriersud for the DirectFB driver * Couriersud for the DirectFB driver
* Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation * Jon Atkins for SDL_image, SDL_mixer and SDL_net documentation
......
...@@ -14,8 +14,8 @@ and 2D framebuffer across multiple platforms. ...@@ -14,8 +14,8 @@ and 2D framebuffer across multiple platforms.
The current version supports Linux, Windows, Windows CE, BeOS, MacOS, The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
The code contains support for Atari, AIX, OSF/Tru64, RISC OS, and The code contains support for AIX, OSF/Tru64, RISC OS, and SymbianOS,
SymbianOS, but these are not officially supported. but these are not officially supported.
SDL is written in C, but works with C++ natively, and has bindings to SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
......
==============================================================================
Using the Simple DirectMedia Layer on Atari
==============================================================================
If you want to build SDL from sources to create SDL programs on Atari:
see sections I - II.
If you want to create SDL programs on Atari using SDL binary build,
download it from my web site (URL at end of this file).
If you want to configure a program using SDL on Atari,
see sections IV - VI.
==============================================================================
I. Building the Simple DirectMedia Layer libraries:
(This step isn't necessary if you have the SDL binary distribution)
Do the classic configure, with --disable-shared --enable-static and:
Tos version (should run everywhere):
--disable-threads
Tos does not support threads.
MiNT version (maybe Magic, only for multitasking OS):
--disable-pthreads --enable-pth
Mint and Magic may supports threads, so audio can be used with current
devices, like Sun audio, or disk-writing support. Like Tos, interrupt
audio without threads is more suited for Atari machines.
Then you can make ; make install it.
==============================================================================
II. Building the Simple DirectMedia Layer test programs:
Do the classic configure, then make.
Run them !
==============================================================================
III. Enjoy! :)
If you have a project you'd like me to know about, or want to ask questions,
go ahead and join the SDL developer's mailing list by sending e-mail to:
sdl-request@libsdl.org
and put "subscribe" into the subject of the message. Or alternatively you
can use the web interface:
http://www.libsdl.org/mailman/listinfo/sdl
==============================================================================
IV. What is supported:
Keyboard (GEMDOS, BIOS, GEM, Ikbd)
Mouse (XBIOS, GEM, Ikbd, /dev/mouse (non working atm, disabled))
Video (XBIOS (Fullscreen), GEM (Windowed and Fullscreen))
Timer (VBL vector, GNU pth library)
Joysticks and joypads (Ikbd, Hardware)
Audio (Hardware, XBIOS, GSXB, MCSN, STFA, /dev/audio if threads enabled)
Threads (Multitasking OS only via GNU pth library)
Shared object loader (using LDG library from http://ldg.atari.org/)
Audio CD (MetaDOS)
OpenGL (using Mesa offscreen rendering driver)
- Dependent driver combinations:
Video Kbd Mouse Timer Joysticks
xbios ikbd ikbd vbl(2) ikbd
xbios gemdos xbios vbl(2) xbios
xbios bios xbios vbl(2) xbios
gem gem gem(1) vbl(2) xbios
Audio O/S Misc
dma8 All Uses MFP Timer A interrupt
xbios TOS Uses MFP Timer A interrupt
xbios MiNT Uses MFP Timer A interrupt
xbios Magic Disabled
stfa All Uses MFP interrupt
mcsn TOS Uses MFP Timer A interrupt
mcsn MiNT Uses MiNT thread
mcsn Magic Disabled
gsxb All Uses GSXB callback
Joypad driver always uses hardware access.
OpenGL driver always uses OSMesa.
(1) GEM does not report relative mouse motion, so xbios mouse driver is used
to report this type event.
A preliminary driver for /dev/mouse device driver is present, but is disabled
till it can be used with other applications simultaneously.
(2) If you build SDL with threads using the GNU pth library, timers are
supported via the pth library.
==============================================================================
V. Environment variables:
SDL_VIDEODRIVER:
Set to 'xbios' to force xbios video driver
Set to 'gem' to force gem video driver
SDL_VIDEO_GL_DRIVER:
Set to filename to load as OpenGL library, if you use SDL_GL_LoadLibrary()
SDL_AUDIODRIVER:
Set to 'mint_gsxb' to force Atari GSXB audio driver
Set to 'mint_mcsn' to force Atari MCSN audio driver
Set to 'mint_stfa' to force Atari STFA audio driver
Set to 'mint_xbios' to force Atari Xbios audio driver
Set to 'mint_dma8' to force Atari 8 bits DMA audio driver
Set to 'audio' to force Sun /dev/audio audio driver
Set to 'disk' to force disk-writing audio driver
SDL_ATARI_EVENTSDRIVER
Set to 'ikbd' to force IKBD 6301 keyboard driver
Set to 'gemdos' to force gemdos keyboard driver
Set to 'bios' to force bios keyboard driver
SDL_JOYSTICK_ATARI:
Use any of these strings in the environment variable to enable or
disable a joystick:
'ikbd-joy1-[on|off]' for IKBD joystick on port 1 (hardware access)
'xbios-joy1-[on|off]' for IKBD joystick on port 1 (xbios access)
'porta-pad-[on|off]' for joypad and/or teamtap on port A
'porta-joy0-[on|off]' for joystick 0 on port A
'porta-joy1-[on|off]' for joystick 1 on port A
'porta-lp-[on|off]' for lightpen on port A
'porta-anpad-[on|off]' for analog paddle on port A
'portb-pad-[on|off]' for joypad and/or teamtap on port B
'portb-joy0-[on|off]' for joystick 0 on port B
'portb-joy1-[on|off]' for joystick 1 on port B
'portb-anpad-[on|off]' for analog paddle on port B
Default configuration is:
'ikbd-joy1-on' (if IKBD events driver enabled)
'xbios-joy1-on' (if gemdos/bios/gem events driver enabled)
'porta-pad-on portb-pad-on' (if available on the machine)
port[a|b]-[pad|joy?|lp|anpad]-* strings are mutually exclusives.
On such a port, you can only use a joypad OR 1 or 2 joysticks OR
a lightpen OR an analog paddle. You must disable joypad before
setting another controller.
The second joystick port on IKBD is used by the mouse, so not usable.
Another problem with the IKBD: mouse buttons and joystick fire buttons
are wired together at the hardware level, it means:
port 0 port 0 port 1
mouse left button = joystick fire 0 = joystick fire 1
mouse right button = joystick fire 1 = joystick fire 0
Descriptions of joysticks/joypads:
- Joypads: 1 hat, 17 buttons (Atari Jaguar console-like).
- Joysticks: 1 hat, 1 button.
- Lightpen, analog paddles: 2 axis, 2 buttons. The 2 buttons are those
affected to 1 button joysticks on the same port.
==============================================================================
VI. More informations about drivers:
OpenGL:
The default is to use the Mesa offscreen driver (osmesa.ldg). If you want
to use an older OpenGL implementation, like mesa_gl.ldg or tiny_gl.ldg,
your program must use SDL_GL_LoadLibrary() to do so, and retrieve the
needed function pointers with SDL_LoadFunction(). In all cases, the OpenGL
context is taken care of by SDL itself, you just have to use gl* functions.
However, there is one OpenGL call that has a different prototype in the old
implementations: glOrtho(). In the old implementations, it has 6 float as
parameters, in the standard one, it has 6 double parameters. If you want
to compile testdyngl, or any other SDL program that loads its OpenGL
library, you must change the glOrtho() prototype used in this program. In
osmesa.ldg, you can retrieve a glOrtho() with double parameters, by
searching for the function "glOrtho6d".
Xbios video:
Video chip is detected using the _VDO cookie.
Screen enhancers are not supported, but could be if you know how to
use them.
ST, STE, Mega ST, Mega STE:
320x200x4 bits, shades of grey, available only for the purpose
of testing SDL.
TT:
320x480x8 and 320x240x8 (software double-lined mode).
Falcon:
All modes supported by the current monitor (RVB or VGA).
BlowUp and Centscreen extended modes, ScreenBlaster 3 current mode.
Clones and any machine with monochrome monitor:
Not supported.
Gem video:
Automatically used if xbios not available.
All machines:
Only the current resolution, if 8 bits or higher depth.
IKBD keyboard, mouse and joystick driver:
Available if _MCH cookie is ST, Mega ST, STE, Mega STE, TT or Falcon.
Hades has an IKBD, but xbios is not available for video, so IKBD
driver is disabled.
Gemdos and bios keyboard driver:
Available on all machines.
Mouse and joystick xbios driver:
Available on all machines (I think).
Joypad driver:
Available if _MCH cookie is STE or Falcon.
PTH timer driver:
Available with multitasking OS.
VBL timer driver:
Available on all machines (I think).
Audio drivers:
Cookies _SND, MCSN, STFA and GSXB used to detect supported audio
capabilities.
STE, Mega STE, TT:
8 bits DMA (hardware access)
STFA, MCSN or GSXB driver if installed
Falcon:
8 bits DMA (hardware access)
Xbios functions
STFA, MCSN or GSXB driver if installed
Other machines:
STFA, MCSN or GSXB driver if installed
STFA driver:
http://removers.free.fr/softs/stfa.html
GSXB driver:
http://assemsoft.atari.org/gsxb/
MacSound driver:
http://jf.omnis.ch/software/tos/
MagicSound driver (MCSN,GSXB compatible):
http://perso.wanadoo.fr/didierm/
X-Sound driver (GSXB compatible):
http://www.uni-ulm.de/~s_thuth/atari/xsound_e.html
--
Patrice Mandin <pmandin@caramail.com>
http://pmandin.atari.org/
...@@ -897,25 +897,6 @@ AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default= ...@@ -897,25 +897,6 @@ AC_HELP_STRING([--enable-dummyaudio], [support the dummy audio driver [[default=
fi fi
} }
dnl Set up the Atari Audio driver
CheckAtariAudio()
{
AC_ARG_ENABLE(mintaudio,
AC_HELP_STRING([--enable-mintaudio], [support Atari audio driver [[default=yes]]]),
, enable_mintaudio=yes)
if test x$enable_audio = xyes -a x$enable_mintaudio = xyes; then
mintaudio=no
AC_CHECK_HEADER(mint/falcon.h, have_mint_falcon_hdr=yes)
if test x$have_mint_falcon_hdr = xyes; then
mintaudio=yes
AC_DEFINE(SDL_AUDIO_DRIVER_MINT)
SOURCES="$SOURCES $srcdir/src/audio/mint/*.c"
SOURCES="$SOURCES $srcdir/src/audio/mint/*.S"
have_audio=yes
fi
fi
}
dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually). dnl See if GCC's -fvisibility=hidden is supported (gcc4 and later, usually).
dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility dnl Details of this flag are here: http://gcc.gnu.org/wiki/Visibility
CheckVisibilityHidden() CheckVisibilityHidden()
...@@ -1529,48 +1510,6 @@ AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=no]]]) ...@@ -1529,48 +1510,6 @@ AC_HELP_STRING([--enable-video-svga], [use SVGAlib video driver [[default=no]]])
fi fi
} }
dnl Set up the Atari Bios keyboard driver
CheckAtariBiosEvent()
{
SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.c"
SOURCES="$SOURCES $srcdir/src/video/ataricommon/*.S"
}
dnl Set up the Atari Xbios driver
CheckAtariXbiosVideo()
{
AC_ARG_ENABLE(video-xbios,
AC_HELP_STRING([--enable-video-xbios], [use Atari Xbios video driver [[default=yes]]]),
, enable_video_xbios=yes)
video_xbios=no
if test x$enable_video = xyes -a x$enable_video_xbios = xyes; then
video_xbios=yes
AC_DEFINE(SDL_VIDEO_DRIVER_XBIOS)
SOURCES="$SOURCES $srcdir/src/video/xbios/*.c"
have_video=yes
fi
}
dnl Set up the Atari Gem driver
CheckAtariGemVideo()
{
AC_ARG_ENABLE(video-gem,
AC_HELP_STRING([--enable-video-gem], [use Atari Gem video driver [[default=yes]]]),
, enable_video_gem=yes)
if test x$enable_video = xyes -a x$enable_video_gem = xyes; then
video_gem=no
AC_CHECK_HEADER(gem.h, have_gem_hdr=yes)
AC_CHECK_LIB(gem, appl_init, have_gem_lib=yes)
if test x$have_gem_hdr = xyes -a x$have_gem_lib = xyes; then
video_gem=yes
AC_DEFINE(SDL_VIDEO_DRIVER_GEM)
SOURCES="$SOURCES $srcdir/src/video/gem/*.c"
SDL_LIBS="$SDL_LIBS -lgem"
have_video=yes
fi
fi
}
dnl rcg04172001 Set up the Null video driver. dnl rcg04172001 Set up the Null video driver.
CheckDummyVideo() CheckDummyVideo()
{ {
...@@ -1708,43 +1647,6 @@ CheckMacGL() ...@@ -1708,43 +1647,6 @@ CheckMacGL()
fi fi
} }
dnl Check for Mesa offscreen rendering
CheckAtariOSMesa()
{
if test "x$enable_video" = "xyes" -a "x$enable_video_opengl" = "xyes"; then
AC_CHECK_HEADER(GL/osmesa.h, have_osmesa_hdr=yes)
AC_CHECK_LIB(OSMesa, OSMesaCreateContext, have_osmesa_lib=yes, have_osmesa_lib=no, -lm)
# Static linking to -lOSMesa
AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
if test "x$OSMESA_CONFIG" = "xno" -o "x$enable_atari_ldg" = "xno"; then
# -lOSMesa is really the static library
if test "x$have_osmesa_hdr" = "xyes" -a "x$have_osmesa_lib" = "xyes"; then
OSMESA_LIBS="-lOSMesa"
fi
else
# -lOSMesa is a loader for OSMesa.ldg
OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
OSMESA_LIBS=`$OSMESA_CONFIG --libs`
fi
AC_DEFINE(SDL_VIDEO_OPENGL)
AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA)
AC_DEFINE(SDL_VIDEO_RENDER_OGL)
SDL_CFLAGS="$SDL_CFLAGS $OSMESA_CFLAGS"
SDL_LIBS="$SDL_LIBS $OSMESA_LIBS"
AC_ARG_ENABLE(osmesa-shared,
AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support [[default=yes]]]),
, enable_osmesa_shared=yes)
if test "x$enable_osmesa_shared" = "xyes" -a "x$enable_atari_ldg" = "xyes"; then
# Dynamic linking
if test "x$have_osmesa_hdr" = "xyes"; then
AC_DEFINE(SDL_VIDEO_OPENGL_OSMESA_DYNAMIC)
fi
fi
fi
}
dnl See if we can use the new unified event interface in Linux 2.4 dnl See if we can use the new unified event interface in Linux 2.4
CheckInputEvents() CheckInputEvents()
{ {
...@@ -2086,24 +1988,6 @@ AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[de ...@@ -2086,24 +1988,6 @@ AC_HELP_STRING([--enable-sdl-dlopen], [use dlopen for shared object loading [[de
fi fi
} }
dnl Set up the Atari LDG (shared object loader)
CheckAtariLdg()
{
AC_ARG_ENABLE(atari-ldg,
AC_HELP_STRING([--enable-atari-ldg], [use Atari LDG for shared object loading [[default=yes]]]),
, enable_atari_ldg=yes)
if test x$video_gem = xyes -a x$enable_atari_ldg = xyes; then
AC_CHECK_HEADER(ldg.h, have_ldg_hdr=yes)
AC_CHECK_LIB(ldg, ldg_open, have_ldg_lib=yes, have_ldg_lib=no, -lgem)
if test x$have_ldg_hdr = xyes -a x$have_ldg_lib = xyes; then
AC_DEFINE(SDL_LOADSO_LDG)
SOURCES="$SOURCES $srcdir/src/loadso/mint/*.c"
SDL_LIBS="$SDL_LIBS -lldg -lgem"
have_loadso=yes
fi
fi
}
dnl Check for the usbhid(3) library on *BSD dnl Check for the usbhid(3) library on *BSD
CheckUSBHID() CheckUSBHID()
{ {
...@@ -2795,45 +2679,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau ...@@ -2795,45 +2679,6 @@ AC_HELP_STRING([--enable-render-d3d], [enable the Direct3D render driver [[defau
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit" EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-framework,CoreAudio -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit"
fi fi
;; ;;
*-*-mint*)
ARCH=mint
CheckDummyVideo
CheckDiskAudio
CheckDummyAudio
CheckAtariBiosEvent
CheckAtariXbiosVideo
CheckAtariGemVideo
CheckAtariAudio
CheckAtariLdg
CheckAtariOSMesa
CheckPTH
# Set up files for the audio library
if test x$enable_threads = xyes -a x$enable_pth = xyes; then
if test x$enable_audio = xyes; then
AC_DEFINE(SDL_AUDIO_DRIVER_SUNAUDIO)
SOURCES="$SOURCES $srcdir/src/audio/sun/*.c"
have_audio=yes
fi
fi
# Set up files for the joystick library
if test x$enable_joystick = xyes; then
AC_DEFINE(SDL_JOYSTICK_MINT)
SOURCES="$SOURCES $srcdir/src/joystick/mint/*.c"
have_joystick=yes
fi
# Set up files for the timer library
if test x$enable_timers = xyes; then
if test x$enable_threads = xyes -a x$enable_pth = xyes; then
AC_DEFINE(SDL_TIMER_UNIX)
SOURCES="$SOURCES $srcdir/src/timer/unix/*.c"
else
AC_DEFINE(SDL_TIMER_MINT)
SOURCES="$SOURCES $srcdir/src/timer/mint/*.c"
SOURCES="$SOURCES $srcdir/src/timer/mint/*.S"
fi
have_timers=yes
fi
;;
*-riscos) *-riscos)
ARCH=riscos ARCH=riscos
CheckOSS CheckOSS
......
...@@ -38,8 +38,8 @@ and 2D framebuffer across multiple platforms. ...@@ -38,8 +38,8 @@ and 2D framebuffer across multiple platforms.
The current version supports Linux, Windows, Windows CE, BeOS, MacOS, The current version supports Linux, Windows, Windows CE, BeOS, MacOS,
Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX. Mac OS X, FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, IRIX, and QNX.
The code contains support for Atari, AIX, OSF/Tru64, RISC OS, and The code contains support for AIX, OSF/Tru64, RISC OS, and SymbianOS,
SymbianOS, but these are not officially supported. but these are not officially supported.
SDL is written in C, but works with C++ natively, and has bindings to SDL is written in C, but works with C++ natively, and has bindings to
several other languages, including Ada, C#, Eiffel, Erlang, Euphoria, several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
......
...@@ -187,7 +187,6 @@ ...@@ -187,7 +187,6 @@
#undef SDL_AUDIO_DRIVER_DSOUND #undef SDL_AUDIO_DRIVER_DSOUND
#undef SDL_AUDIO_DRIVER_ESD #undef SDL_AUDIO_DRIVER_ESD
#undef SDL_AUDIO_DRIVER_ESD_DYNAMIC #undef SDL_AUDIO_DRIVER_ESD_DYNAMIC
#undef SDL_AUDIO_DRIVER_MINT
#undef SDL_AUDIO_DRIVER_MMEAUDIO #undef SDL_AUDIO_DRIVER_MMEAUDIO
#undef SDL_AUDIO_DRIVER_NAS #undef SDL_AUDIO_DRIVER_NAS
#undef SDL_AUDIO_DRIVER_NAS_DYNAMIC #undef SDL_AUDIO_DRIVER_NAS_DYNAMIC
...@@ -209,7 +208,6 @@ ...@@ -209,7 +208,6 @@
#undef SDL_JOYSTICK_DUMMY #undef SDL_JOYSTICK_DUMMY
#undef SDL_JOYSTICK_IOKIT #undef SDL_JOYSTICK_IOKIT
#undef SDL_JOYSTICK_LINUX #undef SDL_JOYSTICK_LINUX
#undef SDL_JOYSTICK_MINT
#undef SDL_JOYSTICK_NDS #undef SDL_JOYSTICK_NDS
#undef SDL_JOYSTICK_RISCOS #undef SDL_JOYSTICK_RISCOS
#undef SDL_JOYSTICK_WINMM #undef SDL_JOYSTICK_WINMM
...@@ -241,7 +239,6 @@ ...@@ -241,7 +239,6 @@
/* Enable various timer systems */ /* Enable various timer systems */
#undef SDL_TIMER_BEOS #undef SDL_TIMER_BEOS
#undef SDL_TIMER_DUMMY #undef SDL_TIMER_DUMMY
#undef SDL_TIMER_MINT
#undef SDL_TIMER_NDS #undef SDL_TIMER_NDS
#undef SDL_TIMER_RISCOS #undef SDL_TIMER_RISCOS
#undef SDL_TIMER_UNIX #undef SDL_TIMER_UNIX
...@@ -255,7 +252,6 @@ ...@@ -255,7 +252,6 @@
#undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC
#undef SDL_VIDEO_DRIVER_DUMMY #undef SDL_VIDEO_DRIVER_DUMMY
#undef SDL_VIDEO_DRIVER_FBCON #undef SDL_VIDEO_DRIVER_FBCON
#undef SDL_VIDEO_DRIVER_GEM
#undef SDL_VIDEO_DRIVER_NDS #undef SDL_VIDEO_DRIVER_NDS
#undef SDL_VIDEO_DRIVER_PHOTON #undef SDL_VIDEO_DRIVER_PHOTON
#undef SDL_VIDEO_DRIVER_QNXGF #undef SDL_VIDEO_DRIVER_QNXGF
...@@ -277,7 +273,6 @@ ...@@ -277,7 +273,6 @@
#undef SDL_VIDEO_DRIVER_X11_XINPUT #undef SDL_VIDEO_DRIVER_X11_XINPUT
#undef SDL_VIDEO_DRIVER_X11_SCRNSAVER #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER
#undef SDL_VIDEO_DRIVER_X11_XV #undef SDL_VIDEO_DRIVER_X11_XV
#undef SDL_VIDEO_DRIVER_XBIOS
#undef SDL_VIDEO_RENDER_D3D #undef SDL_VIDEO_RENDER_D3D
#undef SDL_VIDEO_RENDER_GDI #undef SDL_VIDEO_RENDER_GDI
......
...@@ -62,11 +62,6 @@ extern AudioBootStrap BEOSAUDIO_bootstrap; ...@@ -62,11 +62,6 @@ extern AudioBootStrap BEOSAUDIO_bootstrap;
extern AudioBootStrap COREAUDIO_bootstrap; extern AudioBootStrap COREAUDIO_bootstrap;
extern AudioBootStrap COREAUDIOIPHONE_bootstrap; extern AudioBootStrap COREAUDIOIPHONE_bootstrap;
extern AudioBootStrap SNDMGR_bootstrap; extern AudioBootStrap SNDMGR_bootstrap;
extern AudioBootStrap MINTAUDIO_GSXB_bootstrap;
extern AudioBootStrap MINTAUDIO_MCSN_bootstrap;
extern AudioBootStrap MINTAUDIO_STFA_bootstrap;
extern AudioBootStrap MINTAUDIO_XBIOS_bootstrap;
extern AudioBootStrap MINTAUDIO_DMA8_bootstrap;
extern AudioBootStrap DISKAUD_bootstrap; extern AudioBootStrap DISKAUD_bootstrap;
extern AudioBootStrap DUMMYAUD_bootstrap; extern AudioBootStrap DUMMYAUD_bootstrap;
extern AudioBootStrap DCAUD_bootstrap; extern AudioBootStrap DCAUD_bootstrap;
...@@ -127,13 +122,6 @@ static const AudioBootStrap *const bootstrap[] = { ...@@ -127,13 +122,6 @@ static const AudioBootStrap *const bootstrap[] = {
#if SDL_AUDIO_DRIVER_COREAUDIOIPHONE #if SDL_AUDIO_DRIVER_COREAUDIOIPHONE
&COREAUDIOIPHONE_bootstrap, &COREAUDIOIPHONE_bootstrap,
#endif #endif
#if SDL_AUDIO_DRIVER_MINT
&MINTAUDIO_GSXB_bootstrap,
&MINTAUDIO_MCSN_bootstrap,
&MINTAUDIO_STFA_bootstrap,
&MINTAUDIO_XBIOS_bootstrap,
&MINTAUDIO_DMA8_bootstrap,
#endif
#if SDL_AUDIO_DRIVER_DISK #if SDL_AUDIO_DRIVER_DISK
&DISKAUD_bootstrap, &DISKAUD_bootstrap,
#endif #endif
......
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
Audio interrupt variables and callback function
Patrice Mandin
*/
#include <unistd.h>
#include <mint/osbind.h>
#include <mint/falcon.h>
#include <mint/mintbind.h>
#include <mint/cookie.h>
#include "SDL_audio.h"
#include "SDL_mintaudio.h"
#include "SDL_mintaudio_stfa.h"
/* The audio device */
SDL_AudioDevice *SDL_MintAudio_device;
Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
volatile unsigned short SDL_MintAudio_mutex;
volatile unsigned long SDL_MintAudio_clocktics;
cookie_stfa_t *SDL_MintAudio_stfa;
/* MiNT thread variables */
SDL_bool SDL_MintAudio_mint_present;
SDL_bool SDL_MintAudio_quit_thread;
SDL_bool SDL_MintAudio_thread_finished;
long SDL_MintAudio_thread_pid;
/* The callback function, called by each driver whenever needed */
void
SDL_MintAudio_Callback(void)
{
Uint8 *buffer;
SDL_AudioDevice *audio = SDL_MintAudio_device;
buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
SDL_memset(buffer, audio->spec.silence, audio->spec.size);
if (audio->paused)
return;
if (audio->convert.needed) {
int silence;
if (audio->convert.src_format == AUDIO_U8) {
silence = 0x80;
} else {
silence = 0;
}
SDL_memset(audio->convert.buf, silence, audio->convert.len);
audio->spec.callback(audio->spec.userdata,
(Uint8 *) audio->convert.buf,
audio->convert.len);
SDL_ConvertAudio(&audio->convert);
SDL_memcpy(buffer, audio->convert.buf, audio->convert.len_cvt);
} else {
audio->spec.callback(audio->spec.userdata, buffer, audio->spec.size);
}
}
/* Add a new frequency/clock/predivisor to the current list */
void
SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
Uint32 prediv, int gpio_bits)
{
int i, p;
if (MINTAUDIO_freqcount == MINTAUDIO_maxfreqs) {
return;
}
/* Search where to insert the frequency (highest first) */
for (p = 0; p < MINTAUDIO_freqcount; p++) {
if (frequency > MINTAUDIO_frequencies[p].frequency) {
break;
}
}
/* Put all following ones farer */
if (MINTAUDIO_freqcount > 0) {
for (i = MINTAUDIO_freqcount; i > p; i--) {
SDL_memcpy(&MINTAUDIO_frequencies[i],
&MINTAUDIO_frequencies[i - 1],
sizeof(mint_frequency_t));
}
}
/* And insert new one */
MINTAUDIO_frequencies[p].frequency = frequency;
MINTAUDIO_frequencies[p].masterclock = clock;
MINTAUDIO_frequencies[p].predivisor = prediv;
MINTAUDIO_frequencies[p].gpio_bits = gpio_bits;
MINTAUDIO_freqcount++;
}
/* Search for the nearest frequency */
int
SDL_MintAudio_SearchFrequency(_THIS, int desired_freq)
{
int i;
/* Only 1 freq ? */
if (MINTAUDIO_freqcount == 1) {
return 0;
}
/* Check the array */
for (i = 0; i < MINTAUDIO_freqcount; i++) {
if (desired_freq >= ((MINTAUDIO_frequencies[i].frequency +
MINTAUDIO_frequencies[i + 1].frequency) >> 1)) {
return i;
}
}
/* Not in the array, give the latest */
return MINTAUDIO_freqcount - 1;
}
/* Check if FPU is present */
void
SDL_MintAudio_CheckFpu(void)
{
unsigned long cookie_fpu;
SDL_MintAudio_hasfpu = 0;
if (Getcookie(C__FPU, &cookie_fpu) != C_FOUND) {
return;
}
switch ((cookie_fpu >> 16) & 0xfffe) {
case 2:
case 4:
case 6:
case 8:
case 16:
SDL_MintAudio_hasfpu = 1;
break;
}
}
/* The thread function, used under MiNT with xbios */
int
SDL_MintAudio_Thread(long param)
{
SndBufPtr pointers;
SDL_bool buffers_filled[2] = { SDL_FALSE, SDL_FALSE };
SDL_MintAudio_thread_finished = SDL_FALSE;
while (!SDL_MintAudio_quit_thread) {
if (Buffptr(&pointers) != 0)
continue;
if (((unsigned long) pointers.play >=
(unsigned long) SDL_MintAudio_audiobuf[0])
&& ((unsigned long) pointers.play <=
(unsigned long) SDL_MintAudio_audiobuf[1])) {
/* DMA is reading buffer #0, setup buffer #1 if not already done */
if (!buffers_filled[1]) {
SDL_MintAudio_numbuf = 1;
SDL_MintAudio_Callback();
Setbuffer(0, SDL_MintAudio_audiobuf[1],
SDL_MintAudio_audiobuf[1] +
SDL_MintAudio_audiosize);
buffers_filled[1] = SDL_TRUE;
buffers_filled[0] = SDL_FALSE;
}
} else {
/* DMA is reading buffer #1, setup buffer #0 if not already done */
if (!buffers_filled[0]) {
SDL_MintAudio_numbuf = 0;
SDL_MintAudio_Callback();
Setbuffer(0, SDL_MintAudio_audiobuf[0],
SDL_MintAudio_audiobuf[0] +
SDL_MintAudio_audiosize);
buffers_filled[0] = SDL_TRUE;
buffers_filled[1] = SDL_FALSE;
}
}
usleep(100);
}
SDL_MintAudio_thread_finished = SDL_TRUE;
return 0;
}
void
SDL_MintAudio_WaitThread(void)
{
if (!SDL_MintAudio_mint_present)
return;
if (SDL_MintAudio_thread_finished)
return;
SDL_MintAudio_quit_thread = SDL_TRUE;
while (!SDL_MintAudio_thread_finished) {
Syield();
}
}
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
MiNT audio driver
Patrice Mandin
*/
#ifndef _SDL_mintaudio_h
#define _SDL_mintaudio_h
#include "../SDL_sysaudio.h"
#include "SDL_mintaudio_stfa.h"
/* Hidden "this" pointer for the audio functions */
#define _THIS SDL_AudioDevice *this
/* 16 predivisors with 3 clocks max. */
#define MINTAUDIO_maxfreqs (16*3)
typedef struct
{
Uint32 frequency;
Uint32 masterclock;
Uint32 predivisor;
int gpio_bits; /* in case of external clock */
} mint_frequency_t;
struct SDL_PrivateAudioData
{
mint_frequency_t frequencies[MINTAUDIO_maxfreqs];
int freq_count; /* Number of frequencies in the array */
int numfreq; /* Number of selected frequency */
};
/* Old variable names */
#define MINTAUDIO_frequencies (this->hidden->frequencies)
#define MINTAUDIO_freqcount (this->hidden->freq_count)
#define MINTAUDIO_numfreq (this->hidden->numfreq)
/* _MCH cookie (values>>16) */
enum
{
MCH_ST = 0,
MCH_STE,
MCH_TT,
MCH_F30,
MCH_CLONE,
MCH_ARANYM
};
/* Master clocks for replay frequencies */
#define MASTERCLOCK_STE 8010666 /* Not sure of this one */
#define MASTERCLOCK_TT 16107953 /* Not sure of this one */
#define MASTERCLOCK_FALCON1 25175000
#define MASTERCLOCK_FALCON2 32000000 /* Only usable for DSP56K */
#define MASTERCLOCK_FALCONEXT -1 /* Clock on DSP56K port, unknown */
#define MASTERCLOCK_44K 22579200 /* Standard clock for 44.1 Khz */
#define MASTERCLOCK_48K 24576000 /* Standard clock for 48 Khz */
/* Master clock predivisors */
#define MASTERPREDIV_STE 160
#define MASTERPREDIV_TT 320
#define MASTERPREDIV_FALCON 256
#define MASTERPREDIV_MILAN 256
/* MFP 68901 interrupt sources */
enum
{
MFP_PARALLEL = 0,
MFP_DCD,
MFP_CTS,
MFP_BITBLT,
MFP_TIMERD,
MFP_BAUDRATE = MFP_TIMERD,
MFP_TIMERC,
MFP_200HZ = MFP_TIMERC,
MFP_ACIA,
MFP_DISK,
MFP_TIMERB,
MFP_HBLANK = MFP_TIMERB,
MFP_TERR,
MFP_TBE,
MFP_RERR,
MFP_RBF,
MFP_TIMERA,
MFP_DMASOUND = MFP_TIMERA,
MFP_RING,
MFP_MONODETECT
};
/* Xbtimer() timers */
enum
{
XB_TIMERA = 0,
XB_TIMERB,
XB_TIMERC,
XB_TIMERD
};
/* Variables */
extern SDL_AudioDevice *SDL_MintAudio_device;
extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */
extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */
extern volatile unsigned short SDL_MintAudio_numbuf; /* Buffer to play */
extern volatile unsigned short SDL_MintAudio_mutex;
extern cookie_stfa_t *SDL_MintAudio_stfa;
extern volatile unsigned long SDL_MintAudio_clocktics;
extern unsigned short SDL_MintAudio_hasfpu; /* To preserve fpu registers if needed */
/* MiNT thread variables */
extern SDL_bool SDL_MintAudio_mint_present;
extern SDL_bool SDL_MintAudio_quit_thread;
extern SDL_bool SDL_MintAudio_thread_finished;
extern long SDL_MintAudio_thread_pid;
/* Functions */
void SDL_MintAudio_Callback(void);
void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock,
Uint32 prediv, int gpio_bits);
int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq);
void SDL_MintAudio_CheckFpu(void);
/* MiNT thread functions */
int SDL_MintAudio_Thread(long param);
void SDL_MintAudio_WaitThread(void);
/* ASM interrupt functions */
void SDL_MintAudio_GsxbInterrupt(void);
void SDL_MintAudio_EmptyGsxbInterrupt(void);
void SDL_MintAudio_XbiosInterruptMeasureClock(void);
void SDL_MintAudio_XbiosInterrupt(void);
void SDL_MintAudio_Dma8Interrupt(void);
void SDL_MintAudio_StfaInterrupt(void);
#endif /* _SDL_mintaudio_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
MiNT audio driver
using DMA 8bits (hardware access)
Patrice Mandin
*/
/* Mint includes */
#include <mint/osbind.h>
#include <mint/falcon.h>
#include <mint/cookie.h>
#include "SDL_audio.h"
#include "../SDL_audio_c.h"
#include "../SDL_sysaudio.h"
#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
#include "SDL_mintaudio.h"
#include "SDL_mintaudio_dma8.h"
/*--- Defines ---*/
#define MINT_AUDIO_DRIVER_NAME "mint_dma8"
/* Debug print info */
#define DEBUG_NAME "audio:dma8: "
#if 0
#define DEBUG_PRINT(what) \
{ \
printf what; \
}
#else
#define DEBUG_PRINT(what)
#endif
/*--- Static variables ---*/
static unsigned long cookie_snd, cookie_mch;
static void
MINTDMA8_LockDevice(_THIS)
{
void *oldpile;
/* Stop replay */
oldpile = (void *) Super(0);
DMAAUDIO_IO.control = 0;
Super(oldpile);
}
static void
MINTDMA8_UnlockDevice(_THIS)
{
void *oldpile;
/* Restart replay */
oldpile = (void *) Super(0);
DMAAUDIO_IO.control = 3;
Super(oldpile);
}
static void
MINTDMA8_CloseDevice(_THIS)
{
if (this->hidden != NULL) {
/* Stop replay */
void *oldpile = (void *) Super(0);
DMAAUDIO_IO.control = 0;
Super(oldpile);
DEBUG_PRINT((DEBUG_NAME "closeaudio: replay stopped\n"));
/* Disable interrupt */
Jdisint(MFP_DMASOUND);
DEBUG_PRINT((DEBUG_NAME "closeaudio: interrupt disabled\n"));
/* Wait if currently playing sound */
while (SDL_MintAudio_mutex != 0) {
}
DEBUG_PRINT((DEBUG_NAME "closeaudio: no more interrupt running\n"));
/* Clear buffers */
if (SDL_MintAudio_audiobuf[0]) {
Mfree(SDL_MintAudio_audiobuf[0]);
SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
}
DEBUG_PRINT((DEBUG_NAME "closeaudio: buffers freed\n"));
SDL_free(this->hidden);
this->hidden = NULL;
}
}
static int
MINTDMA8_CheckAudio(_THIS)
{
int i, masterprediv, sfreq;
unsigned long masterclock;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(this->spec.format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(this->spec.format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(this->spec.format)));
DEBUG_PRINT(("big endian=%d, ",
SDL_AUDIO_ISBIGENDIAN(this->spec.format)));
DEBUG_PRINT(("channels=%d, ", this->spec.channels));
DEBUG_PRINT(("freq=%d\n", this->spec.freq));
if (this->spec.channels > 2) {
this->spec.channels = 2; /* no more than stereo! */
}
/* Check formats available */
this->spec.format = AUDIO_S8;
/* Calculate and select the closest frequency */
sfreq = 0;
masterclock = MASTERCLOCK_STE;
masterprediv = MASTERPREDIV_STE;
switch (cookie_mch >> 16) {
/*
case MCH_STE:
masterclock=MASTERCLOCK_STE;
masterprediv=MASTERPREDIV_STE;
break;
*/
case MCH_TT:
masterclock = MASTERCLOCK_TT;
masterprediv = MASTERPREDIV_TT;
break;
case MCH_F30:
case MCH_ARANYM:
masterclock = MASTERCLOCK_FALCON1;
masterprediv = MASTERPREDIV_FALCON;
sfreq = 1;
break;
}
MINTAUDIO_freqcount = 0;
for (i = sfreq; i < 4; i++) {
SDL_MintAudio_AddFrequency(this,
masterclock / (masterprediv * (1 << i)),
masterclock, i - sfreq, -1);
}
#if 1
for (i = 0; i < MINTAUDIO_freqcount; i++) {
DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
i, MINTAUDIO_frequencies[i].frequency,
MINTAUDIO_frequencies[i].masterclock,
MINTAUDIO_frequencies[i].predivisor));
}
#endif
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, this->spec.freq);
this->spec.freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(this->spec.format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(this->spec.format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(this->spec.format)));
DEBUG_PRINT(("big endian=%d, ",
SDL_AUDIO_ISBIGENDIAN(this->spec.format)));
DEBUG_PRINT(("channels=%d, ", this->spec.channels));
DEBUG_PRINT(("freq=%d\n", this->spec.freq));
return 0;
}
static void
MINTDMA8_InitAudio(_THIS)
{
void *oldpile;
unsigned long buffer;
unsigned char mode;
/* Set replay tracks */
if (cookie_snd & SND_16BIT) {
Settracks(0, 0);
Setmontracks(0);
}
oldpile = (void *) Super(0);
/* Stop currently playing sound */
DMAAUDIO_IO.control = 0;
/* Set buffer */
buffer = (unsigned long) SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
DMAAUDIO_IO.start_high = (buffer >> 16) & 255;
DMAAUDIO_IO.start_mid = (buffer >> 8) & 255;
DMAAUDIO_IO.start_low = buffer & 255;
buffer += SDL_MintAudio_audiosize;
DMAAUDIO_IO.end_high = (buffer >> 16) & 255;
DMAAUDIO_IO.end_mid = (buffer >> 8) & 255;
DMAAUDIO_IO.end_low = buffer & 255;
mode = 3 - MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
if (this->spec.channels == 1) {
mode |= 1 << 7;
}
DMAAUDIO_IO.sound_ctrl = mode;
/* Set interrupt */
Jdisint(MFP_DMASOUND);
Xbtimer(XB_TIMERA, 8, 1, SDL_MintAudio_Dma8Interrupt);
Jenabint(MFP_DMASOUND);
if (cookie_snd & SND_16BIT) {
if (Setinterrupt(SI_TIMERA, SI_PLAY) < 0) {
DEBUG_PRINT((DEBUG_NAME "Setinterrupt() failed\n"));
}
}
/* Go */
DMAAUDIO_IO.control = 3; /* playback + repeat */
Super(oldpile);
}
static int
MINTDMA8_OpenDevice(_THIS, const char *devname, int iscapture)
{
SDL_MintAudio_device = this;
/* Check audio capabilities */
if (MINTDMA8_CheckAudio(this) == -1) {
return 0;
}
/* Initialize all variables that we clean on shutdown */
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc((sizeof *this->hidden));
if (this->hidden == NULL) {
SDL_OutOfMemory();
return 0;
}
SDL_memset(this->hidden, 0, (sizeof *this->hidden));
SDL_CalculateAudioSpec(&this->spec);
/* Allocate memory for audio buffers in DMA-able RAM */
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", this->spec.size));
SDL_MintAudio_audiobuf[0] =
Atari_SysMalloc(this->spec.size * 2, MX_STRAM);
if (SDL_MintAudio_audiobuf[0] == NULL) {
SDL_free(this->hidden);
this->hidden = NULL;
SDL_OutOfMemory();
return 0;
}
SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + this->spec.size;
SDL_MintAudio_numbuf = 0;
SDL_memset(SDL_MintAudio_audiobuf[0], this->spec.silence,
this->spec.size * 2);
SDL_MintAudio_audiosize = this->spec.size;
SDL_MintAudio_mutex = 0;
DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n",
SDL_MintAudio_audiobuf[0]));
DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n",
SDL_MintAudio_audiobuf[1]));
SDL_MintAudio_CheckFpu();
/* Setup audio hardware */
MINTDMA8_InitAudio(this);
return 1; /* good to go. */
}
static int
MINTDMA8_Init(SDL_AudioDriverImpl * impl)
{
/* Cookie _MCH present ? if not, assume ST machine */
if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
cookie_mch = MCH_ST;
}
/* Cookie _SND present ? if not, assume ST machine */
if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
cookie_snd = SND_PSG;
}
/* Check if we have 8 bits audio */
if ((cookie_snd & SND_8BIT) == 0) {
SDL_SetError(DEBUG_NAME "no 8 bits sound");
return 0;
}
/* Check if audio is lockable */
if (cookie_snd & SND_16BIT) {
if (Locksnd() != 1) {
SDL_SetError(DEBUG_NAME "audio locked by other application");
return 0;
}
Unlocksnd();
}
DEBUG_PRINT((DEBUG_NAME "8 bits audio available!\n"));
/* Set the function pointers */
impl->OpenDevice = MINTDMA8_OpenDevice;
impl->CloseDevice = MINTDMA8_CloseDevice;
impl->LockDevice = MINTDMA8_LockDevice;
impl->UnlockDevice = MINTDMA8_UnlockDevice;
impl->OnlyHasDefaultOutputDevice = 1;
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */
}
AudioBootStrap MINTAUDIO_DMA8_bootstrap = {
MINT_AUDIO_DRIVER_NAME, "MiNT DMA 8 bits audio driver", MINTDMA8_Init, 0
};
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
DMA 8bits and Falcon Codec audio definitions
Patrice Mandin, Didier Mquignon
*/
#ifndef _SDL_mintaudio_dma8_h
#define _SDL_mintaudio_dma8_h
#define DMAAUDIO_IO_BASE (0xffff8900)
struct DMAAUDIO_IO_S
{
unsigned char int_ctrl;
unsigned char control;
unsigned char dummy1;
unsigned char start_high;
unsigned char dummy2;
unsigned char start_mid;
unsigned char dummy3;
unsigned char start_low;
unsigned char dummy4;
unsigned char cur_high;
unsigned char dummy5;
unsigned char cur_mid;
unsigned char dummy6;
unsigned char cur_low;
unsigned char dummy7;
unsigned char end_high;
unsigned char dummy8;
unsigned char end_mid;
unsigned char dummy9;
unsigned char end_low;
unsigned char dummy10[12];
unsigned char track_ctrl; /* CODEC only */
unsigned char sound_ctrl;
unsigned short sound_data;
unsigned short sound_mask;
unsigned char dummy11[10];
unsigned short dev_ctrl;
unsigned short dest_ctrl;
unsigned short sync_div;
unsigned char track_rec;
unsigned char adderin_input;
unsigned char channel_input;
unsigned char channel_amplification;
unsigned char channel_reduction;
unsigned char dummy12[6];
unsigned char data_direction;
unsigned char dummy13;
unsigned char dev_data;
};
#define DMAAUDIO_IO ((*(volatile struct DMAAUDIO_IO_S *)DMAAUDIO_IO_BASE))
#endif /* _SDL_mintaudio_dma8_h */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
* GSXB audio definitions
*
* Patrice Mandin
*/
#ifndef _SDL_mintaudio_gsxb_h
#define _SDL_mintaudio_gsxb_h
#include <mint/falcon.h> /* for trap_14_xxx macros */
/* GSXB Cookie */
#define C_GSXB 0x47535842L
/* Bit 5 in cookie _SND */
#define SND_GSXB (1<<5)
/* NSoundcmd modes */
#define SETRATE 7 /* Set sample rate */
#define SET8BITFORMAT 8 /* 8 bits format */
#define SET16BITFORMAT 9 /* 16 bits format */
#define SET24BITFORMAT 10 /* 24 bits format */
#define SET32BITFORMAT 11 /* 32 bits format */
#define LTATTEN_MASTER 12 /* Attenuation */
#define RTATTEN_MASTER 13
#define LTATTEN_MICIN 14
#define RTATTEN_MICIN 15
#define LTATTEN_FMGEN 16
#define RTATTEN_FMGEN 17
#define LTATTEN_LINEIN 18
#define RTATTEN_LINEIN 19
#define LTATTEN_CDIN 20
#define RTATTEN_CDIN 21
#define LTATTEN_VIDIN 22
#define RTATTEN_VIDIN 23
#define LTATTEN_AUXIN 24
#define RTATTEN_AUXIN 25
/* Setmode modes */
#define MONO16 3
#define STEREO24 4
#define STEREO32 5
#define MONO24 6
#define MONO32 7
/* Sndstatus modes */
#define SND_QUERYFORMATS 2
#define SND_QUERYMIXERS 3
#define SND_QUERYSOURCES 4
#define SND_QUERYDUPLEX 5
#define SND_QUERY8BIT 8
#define SND_QUERY16BIT 9
#define SND_QUERY24BIT 10
#define SND_QUERY32BIT 11
#define SND_FORMAT8 (1<<0)
#define SND_FORMAT16 (1<<1)
#define SND_FORMAT24 (1<<2)
#define SND_FORMAT32 (1<<3)
#define SND_FORMATSIGNED (1<<0)
#define SND_FORMATUNSIGNED (1<<1)
#define SND_FORMATBIGENDIAN (1<<2)
#define SND_FORMATLITTLEENDIAN (1<<3)
/* Devconnect prescalers */
#define CLK_44K 1
#define CLK_22K 3
#define CLK_11K 7
/* Extra xbios functions */
#define NSoundcmd(mode,data,data2) \
(long)trap_14_wwl((short)130,(short)(mode),(short)(data),(long)(data2))
#define NSetinterrupt(src_inter,cause,inth_addr) \
(long)trap_14_wwwl((short)135,(short)(src_inter),(short)(cause), \
(long)(inth_addr))
#endif /* _SDL_mintaudio_gsxb_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
/*
Audio interrupts
Patrice Mandin, Didier Mquignon
*/
.text
.globl _SDL_MintAudio_Callback
.globl _SDL_MintAudio_XbiosInterrupt
.globl _SDL_MintAudio_XbiosInterruptMeasureClock
.globl _SDL_MintAudio_Dma8Interrupt
.globl _SDL_MintAudio_StfaInterrupt
.globl _SDL_MintAudio_mutex
.globl _SDL_MintAudio_audiobuf
.globl _SDL_MintAudio_numbuf
.globl _SDL_MintAudio_audiosize
.globl _SDL_MintAudio_clocktics
.globl _SDL_MintAudio_hasfpu
.globl _SDL_MintAudio_stfa
/*
How it works:
- Audio is playing buffer #0 (resp. #1)
- We must calculate a sample in buffer #1 (resp. #0)
so we first call the callback to do it
- Then we swap the buffers
*/
#define savptr 0x4a2
#define savamt 0x46
/*--- Xbios interrupt vector to measure Falcon external clock ---*/
_SDL_MintAudio_XbiosInterruptMeasureClock: /* 1 mS */
btst #0,0xFFFF8901:w /* state DMA sound */
beqs SDL_MintAudio_EndIntMeasure
addql #1,_SDL_MintAudio_clocktics
SDL_MintAudio_EndIntMeasure:
bclr #5,0xFFFFFA0F:w /* Clear service bit */
rte
/*--- Xbios interrupt vector ---*/
_SDL_MintAudio_XbiosInterrupt:
/* Reenable interrupts, so other interrupts can work */
movew #0x2300,sr
/* Clear service bit, so other MFP interrupts can work */
bclr #5,0xfffffa0f:w
/* Check if we are not already running */
tstw _SDL_MintAudio_mutex
bne SDL_MintAudio_XbiosEnd
notw _SDL_MintAudio_mutex
/* Swap buffers */
eorw #1,_SDL_MintAudio_numbuf
moveml d0-d7/a0-a6,sp@-
/* Save FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_MintAudio_Xbios_nofpu1
.chip 68060
fsave sp@-
fmoveml fpcr/fpsr/fpiar,sp@-
fmovemx fp0-fp7,sp@-
.chip 68000
SDL_MintAudio_Xbios_nofpu1:
/* Callback */
jsr _SDL_MintAudio_Callback
/* Restore FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_MintAudio_Xbios_nofpu2
.chip 68060
fmovemx sp@+,fp0-fp7
fmoveml sp@+,fpcr/fpsr/fpiar
frestore sp@+
.chip 68000
SDL_MintAudio_Xbios_nofpu2:
/* Reserve space for registers */
subl #savamt,savptr
/* Set new buffer */
moveq #0,d0
movel _SDL_MintAudio_audiosize,d1
movew _SDL_MintAudio_numbuf,d0
lsll #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:l),a1
lea a1@(d1:l),a2
movel a2,sp@-
movel a1,sp@-
clrw sp@-
movew #131,sp@-
trap #14
lea sp@(12),sp
/* Restore registers space */
addl #savamt,savptr
moveml sp@+,d0-d7/a0-a6
clrw _SDL_MintAudio_mutex
SDL_MintAudio_XbiosEnd:
rte
/*--- DMA 8 bits interrupt vector ---*/
_SDL_MintAudio_Dma8Interrupt:
/* Reenable interrupts, so other interrupts can work */
movew #0x2300,sr
/* Clear service bit, so other MFP interrupts can work */
bclr #5,0xfffffa0f:w
/* Check if we are not already running */
tstw _SDL_MintAudio_mutex
bne SDL_MintAudio_Dma8End
notw _SDL_MintAudio_mutex
/* Swap buffers */
eorw #1,_SDL_MintAudio_numbuf
moveml d0-d1/a0-a1,sp@-
/* Save FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_MintAudio_Dma8_nofpu1
.chip 68060
fsave sp@-
fmoveml fpcr/fpsr/fpiar,sp@-
fmovemx fp0-fp7,sp@-
.chip 68000
SDL_MintAudio_Dma8_nofpu1:
/* Callback */
jsr _SDL_MintAudio_Callback
/* Restore FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_MintAudio_Dma8_nofpu2
.chip 68060
fmovemx sp@+,fp0-fp7
fmoveml sp@+,fpcr/fpsr/fpiar
frestore sp@+
.chip 68000
SDL_MintAudio_Dma8_nofpu2:
/* Set new buffer */
moveq #0,d0
movew _SDL_MintAudio_numbuf,d0
lslw #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:w),d1
/* Modify DMA addresses */
lea 0xffff8900:w,a0
moveb d1,a0@(0x07) /* Start address */
rorl #8,d1
moveb d1,a0@(0x05)
rorl #8,d1
moveb d1,a0@(0x03)
swap d1
addl _SDL_MintAudio_audiosize,d1
moveb d1,a0@(0x13) /* End address */
rorl #8,d1
moveb d1,a0@(0x11)
rorl #8,d1
moveb d1,a0@(0x0f)
moveml sp@+,d0-d1/a0-a1
clrw _SDL_MintAudio_mutex
SDL_MintAudio_Dma8End:
rte
/*--- STFA interrupt vector ---*/
STFA_SOUND_START = 6
STFA_SOUND_END = STFA_SOUND_START+8
_SDL_MintAudio_StfaInterrupt:
/* Reenable interrupts, so other interrupts can work */
movew #0x2300,sr
/* Check if we are not already running */
tstw _SDL_MintAudio_mutex
bnes SDL_MintAudio_StfaEnd
notw _SDL_MintAudio_mutex
/* Swap buffers */
eorw #1,_SDL_MintAudio_numbuf
moveml d0-d7/a0-a6,sp@-
/* Save FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_MintAudio_Stfa_nofpu1
.chip 68060
fsave sp@-
fmoveml fpcr/fpsr/fpiar,sp@-
fmovemx fp0-fp7,sp@-
.chip 68000
SDL_MintAudio_Stfa_nofpu1:
/* Callback */
jsr _SDL_MintAudio_Callback
/* Restore FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_MintAudio_Stfa_nofpu2
.chip 68060
fmovemx sp@+,fp0-fp7
fmoveml sp@+,fpcr/fpsr/fpiar
frestore sp@+
.chip 68000
SDL_MintAudio_Stfa_nofpu2:
/* Set new buffer */
moveq #0,d0
movel _SDL_MintAudio_stfa,a1
movew _SDL_MintAudio_numbuf,d0
lslw #2,d0
lea _SDL_MintAudio_audiobuf,a0
movel a0@(d0:w),d1
/* Modify STFA replay buffers */
movel d1,a1@(STFA_SOUND_START)
addl _SDL_MintAudio_audiosize,d1
movel d1,a1@(STFA_SOUND_END)
moveml sp@+,d0-d7/a0-a6
clrw _SDL_MintAudio_mutex
SDL_MintAudio_StfaEnd:
rte
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
MCSN control structure
Patrice Mandin
*/
#ifndef _SDL_mintaudio_mcsh_h
#define _SDL_mintaudio_mcsh_h
typedef struct
{
unsigned short version; /* Version */
unsigned short size; /* Size of structure */
unsigned short play; /* Replay capability */
unsigned short record; /* Record capability */
unsigned short dsp; /* DSP56K present */
unsigned short pint; /* Interrupt at end of replay */
unsigned short rint; /* Interrupt at end of record */
unsigned long res1; /* Frequency of external clock */
unsigned long res2;
unsigned long res3;
unsigned long res4;
} cookie_mcsn_t __attribute__ ((packed));
enum
{
MCSN_ST = 0,
MCSN_TT,
MCSN_STE = MCSN_TT,
MCSN_FALCON,
MCSN_MAC = MCSN_FALCON
};
#define SETSMPFREQ 7 /* Set sample frequency */
#endif /* _SDL_mintaudio_mcsh_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
MiNT audio driver
using XBIOS functions (STFA driver)
Patrice Mandin
*/
/* Mint includes */
#include <mint/osbind.h>
#include <mint/falcon.h>
#include <mint/cookie.h>
#include "SDL_audio.h"
#include "../SDL_audio_c.h"
#include "../SDL_sysaudio.h"
#include "../../video/ataricommon/SDL_atarimxalloc_c.h"
#include "SDL_mintaudio.h"
#include "SDL_mintaudio_stfa.h"
/*--- Defines ---*/
#define MINT_AUDIO_DRIVER_NAME "mint_stfa"
/* Debug print info */
#define DEBUG_NAME "audio:stfa: "
#if 0
#define DEBUG_PRINT(what) \
{ \
printf what; \
}
#else
#define DEBUG_PRINT(what)
#endif
/*--- Static variables ---*/
static unsigned long cookie_snd = 0;
static unsigned long cookie_mch = 0;
static cookie_stfa_t *cookie_stfa = NULL;
static const int freqs[16] = {
4995, 6269, 7493, 8192,
9830, 10971, 12538, 14985,
16384, 19819, 21943, 24576,
30720, 32336, 43885, 49152
};
static void
MINTSTFA_LockDevice(_THIS)
{
/* Stop replay */
void *oldpile = (void *) Super(0);
cookie_stfa->sound_enable = STFA_PLAY_DISABLE;
Super(oldpile);
}
static void
MINTSTFA_UnlockDevice(_THIS)
{
/* Restart replay */
void *oldpile = (void *) Super(0);
cookie_stfa->sound_enable = STFA_PLAY_ENABLE | STFA_PLAY_REPEAT;
Super(oldpile);
}
static void
MINTSTFA_CloseDevice(_THIS)
{
if (this->hidden != NULL) {
/* Stop replay */
void *oldpile = (void *) Super(0);
cookie_stfa->sound_enable = STFA_PLAY_DISABLE;
Super(oldpile);
/* Wait if currently playing sound */
while (SDL_MintAudio_mutex != 0) {
}
/* Clear buffers */
if (SDL_MintAudio_audiobuf[0]) {
Mfree(SDL_MintAudio_audiobuf[0]);
SDL_MintAudio_audiobuf[0] = SDL_MintAudio_audiobuf[1] = NULL;
}
SDL_free(this->hidden);
this->hidden = NULL;
}
}
static int
MINTSTFA_CheckAudio(_THIS)
{
int i;
DEBUG_PRINT((DEBUG_NAME "asked: %d bits, ",
SDL_AUDIO_BITSIZE(this->spec.format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(this->spec.format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(this->spec.format)));
DEBUG_PRINT(("big endian=%d, ",
SDL_AUDIO_ISBIGENDIAN(this->spec.format)));
DEBUG_PRINT(("channels=%d, ", this->spec.channels));
DEBUG_PRINT(("freq=%d\n", this->spec.freq));
if (SDL_AUDIO_BITSIZE(this->spec.format) > 16) {
this->spec.format = AUDIO_S16SYS; /* clamp out int32/float32 ... */
}
if (this->spec.channels > 2) {
this->spec.channels = 2; /* no more than stereo! */
}
/* Check formats available */
MINTAUDIO_freqcount = 0;
for (i = 0; i < 16; i++) {
SDL_MintAudio_AddFrequency(this, freqs[i], 0, i, -1);
}
#if 1
for (i = 0; i < MINTAUDIO_freqcount; i++) {
DEBUG_PRINT((DEBUG_NAME "freq %d: %lu Hz, clock %lu, prediv %d\n",
i, MINTAUDIO_frequencies[i].frequency,
MINTAUDIO_frequencies[i].masterclock,
MINTAUDIO_frequencies[i].predivisor));
}
#endif
MINTAUDIO_numfreq = SDL_MintAudio_SearchFrequency(this, this->spec.freq);
this->spec.freq = MINTAUDIO_frequencies[MINTAUDIO_numfreq].frequency;
DEBUG_PRINT((DEBUG_NAME "obtained: %d bits, ",
SDL_AUDIO_BITSIZE(this->spec.format)));
DEBUG_PRINT(("float=%d, ", SDL_AUDIO_ISFLOAT(this->spec.format)));
DEBUG_PRINT(("signed=%d, ", SDL_AUDIO_ISSIGNED(this->spec.format)));
DEBUG_PRINT(("big endian=%d, ",
SDL_AUDIO_ISBIGENDIAN(this->spec.format)));
DEBUG_PRINT(("channels=%d, ", this->spec.channels));
DEBUG_PRINT(("freq=%d\n", this->spec.freq));
return 0;
}
static void
MINTSTFA_InitAudio(_THIS)
{
void *buffer = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
void *oldpile = (void *) Super(0);
/* Stop replay */
cookie_stfa->sound_enable = STFA_PLAY_DISABLE;
/* Select replay format */
cookie_stfa->sound_control =
MINTAUDIO_frequencies[MINTAUDIO_numfreq].predivisor;
if (SDL_AUDIO_BITSIZE(this->spec.format) == 8) {
cookie_stfa->sound_control |= STFA_FORMAT_8BIT;
} else {
cookie_stfa->sound_control |= STFA_FORMAT_16BIT;
}
if (this->spec.channels == 2) {
cookie_stfa->sound_control |= STFA_FORMAT_STEREO;
} else {
cookie_stfa->sound_control |= STFA_FORMAT_MONO;
}
if (SDL_AUDIO_ISSIGNED(this->spec.format) != 0) {
cookie_stfa->sound_control |= STFA_FORMAT_SIGNED;
} else {
cookie_stfa->sound_control |= STFA_FORMAT_UNSIGNED;
}
if (SDL_AUDIO_ISBIGENDIAN(this->spec.format) != 0) {
cookie_stfa->sound_control |= STFA_FORMAT_BIGENDIAN;
} else {
cookie_stfa->sound_control |= STFA_FORMAT_LITENDIAN;
}
/* Set buffer */
cookie_stfa->sound_start = (unsigned long) buffer;
cookie_stfa->sound_end = (unsigned long) (buffer + this->spec.size);
/* Set interrupt */
cookie_stfa->stfa_it = SDL_MintAudio_StfaInterrupt;
/* Restart replay */
cookie_stfa->sound_enable = STFA_PLAY_ENABLE | STFA_PLAY_REPEAT;
Super(oldpile);
DEBUG_PRINT((DEBUG_NAME "hardware initialized\n"));
}
static int
MINTSTFA_OpenDevice(_THIS, const char *devname, int iscapture)
{
SDL_MintAudio_device = this;
/* Check audio capabilities */
if (MINTSTFA_CheckAudio(this) == -1) {
return 0;
}
/* Initialize all variables that we clean on shutdown */
this->hidden = (struct SDL_PrivateAudioData *)
SDL_malloc((sizeof *this->hidden));
if (this->hidden == NULL) {
SDL_OutOfMemory();
return 0;
}
SDL_memset(this->hidden, 0, (sizeof *this->hidden));
SDL_CalculateAudioSpec(&this->spec);
/* Allocate memory for audio buffers in DMA-able RAM */
DEBUG_PRINT((DEBUG_NAME "buffer size=%d\n", this->spec.size));
SDL_MintAudio_audiobuf[0] =
Atari_SysMalloc(this->spec.size * 2, MX_STRAM);
if (SDL_MintAudio_audiobuf[0] == NULL) {
SDL_OutOfMemory();
SDL_free(this->hidden);
this->hidden = NULL;
return 0;
}
SDL_MintAudio_audiobuf[1] = SDL_MintAudio_audiobuf[0] + this->spec.size;
SDL_MintAudio_numbuf = 0;
SDL_memset(SDL_MintAudio_audiobuf[0], this->spec.silence,
this->spec.size * 2);
SDL_MintAudio_audiosize = this->spec.size;
SDL_MintAudio_mutex = 0;
DEBUG_PRINT((DEBUG_NAME "buffer 0 at 0x%08x\n",
SDL_MintAudio_audiobuf[0]));
DEBUG_PRINT((DEBUG_NAME "buffer 1 at 0x%08x\n",
SDL_MintAudio_audiobuf[1]));
SDL_MintAudio_CheckFpu();
/* Setup audio hardware */
MINTSTFA_InitAudio(this);
return 1; /* good to go. */
}
static int
MINTSTFA_Init(SDL_AudioDriverImpl * impl)
{
/* Cookie _MCH present ? if not, assume ST machine */
if (Getcookie(C__MCH, &cookie_mch) == C_NOTFOUND) {
cookie_mch = MCH_ST;
}
/* Cookie _SND present ? if not, assume ST machine */
if (Getcookie(C__SND, &cookie_snd) == C_NOTFOUND) {
cookie_snd = SND_PSG;
}
/* Cookie STFA present ? */
if (Getcookie(C_STFA, (long *) &cookie_stfa) != C_FOUND) {
SDL_SetError(DEBUG_NAME "no STFA audio");
return (0);
}
SDL_MintAudio_stfa = cookie_stfa;
DEBUG_PRINT((DEBUG_NAME "STFA audio available!\n"));
/* Set the function pointers */
impl->OpenDevice = MINTSTFA_OpenDevice;
impl->CloseDevice = MINTSTFA_CloseDevice;
impl->LockDevice = MINTSTFA_LockDevice;
impl->UnlockDevice = MINTSTFA_UnlockDevice;
impl->OnlyHasDefaultOutputDevice = 1;
impl->ProvidesOwnCallbackThread = 1;
impl->SkipMixerLock = 1;
return 2; /* 2 == definitely has an audio device. */
}
AudioBootStrap MINTAUDIO_STFA_bootstrap = {
MINT_AUDIO_DRIVER_NAME, "MiNT STFA audio driver", MINTSTFA_Init, 0
};
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
STFA control structure
Patrice Mandin
*/
#ifndef _SDL_mintaudio_stfa_h
#define _SDL_mintaudio_stfa_h
/*--- Defines ---*/
#define C_STFA 0x53544641L /* Sound treiber fr atari (seb/The removers) */
#define STFA_PLAY_ENABLE (1<<0)
#define STFA_PLAY_DISABLE (0<<0)
#define STFA_PLAY_REPEAT (1<<1)
#define STFA_PLAY_SINGLE (0<<1)
#define STFA_FORMAT_SIGNED (1<<15)
#define STFA_FORMAT_UNSIGNED (0<<15)
#define STFA_FORMAT_STEREO (1<<14)
#define STFA_FORMAT_MONO (0<<14)
#define STFA_FORMAT_16BIT (1<<13)
#define STFA_FORMAT_8BIT (0<<13)
#define STFA_FORMAT_LITENDIAN (1<<9)
#define STFA_FORMAT_BIGENDIAN (0<<9)
#define STFA_FORMAT_FREQ_MASK 0x0f
enum
{
STFA_FORMAT_F4995 = 0,
STFA_FORMAT_F6269,
STFA_FORMAT_F7493,
STFA_FORMAT_F8192,
STFA_FORMAT_F9830,
STFA_FORMAT_F10971,
STFA_FORMAT_F12538,
STFA_FORMAT_F14985,
STFA_FORMAT_F16384,
STFA_FORMAT_F19819,
STFA_FORMAT_F21943,
STFA_FORMAT_F24576,
STFA_FORMAT_F30720,
STFA_FORMAT_F32336,
STFA_FORMAT_F43885,
STFA_FORMAT_F49152
};
/*--- Types ---*/
typedef struct
{
unsigned short sound_enable;
unsigned short sound_control;
unsigned short sound_output;
unsigned long sound_start;
unsigned long sound_current;
unsigned long sound_end;
unsigned short version;
void *old_vbl;
void *old_timera;
unsigned long old_mfp_status;
void *new_vbl;
void *drivers_list;
void *play_stop;
unsigned short frequency;
void *set_frequency;
unsigned short frequency_threshold;
unsigned short *custom_freq_table;
unsigned short stfa_on_off;
void *new_drivers_list;
unsigned long old_bit_2_of_cookie_snd;
void (*stfa_it) (void);
} cookie_stfa_t __attribute__ ((packed));
#endif /* _SDL_mintaudio_stfa_h */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_LOADSO_LDG
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* System dependent library loading routines */
#include <stdio.h>
#include <gem.h>
#include <ldg.h>
#include "SDL_loadso.h"
void *
SDL_LoadObject(const char *sofile)
{
const char *loaderror = "Unknown error";
void *handle = (void *) ldg_open((char *) sofile, ldg_global);
if (handle == NULL) {
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
}
return (handle);
}
void *
SDL_LoadFunction(void *handle, const char *name)
{
const char *loaderror = "Unknown error";
void *symbol = (void *) ldg_find((char *) name, (LDG *) handle);
if (symbol == NULL) {
SDL_SetError("Failed loading %s: %s", name, loaderror);
}
return (symbol);
}
void
SDL_UnloadObject(void *handle)
{
if (handle != NULL) {
ldg_close((LDG *) handle, ldg_global);
}
}
#endif /* SDL_LOADSO_LDG */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifdef SDL_TIMER_MINT
/*
* TOS/MiNT timer driver
* based on vbl vector
*
* Patrice Mandin
*/
#include <stdio.h>
#include <sys/time.h>
#include <signal.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <mint/cookie.h>
#include <mint/sysvars.h>
#include <mint/osbind.h>
#include <mint/mintbind.h>
#include "SDL_timer.h"
#include "../SDL_timer_c.h"
#include "SDL_thread.h"
#include "SDL_vbltimer_s.h"
/* from audio/mint */
void SDL_MintAudio_CheckFpu(void);
/* The first ticks value of the application */
static Uint32 start;
static SDL_bool read_hz200_from_vbl = SDL_FALSE;
static int mint_present; /* can we use Syield() ? */
void
SDL_StartTicks(void)
{
void *oldpile;
unsigned long dummy;
/* Set first ticks value */
oldpile = (void *) Super(0);
start = *((volatile long *) _hz_200);
Super(oldpile);
start *= 5; /* One _hz_200 tic is 5ms */
mint_present = (Getcookie(C_MiNT, &dummy) == C_FOUND);
}
Uint32
SDL_GetTicks(void)
{
Uint32 now = start;
if (read_hz200_from_vbl) {
now = SDL_Atari_hz200;
} else {
void *old_stack = (void *) Super(0);
now = *((volatile long *) _hz_200);
Super(old_stack);
}
return ((now * 5) - start);
}
void
SDL_Delay(Uint32 ms)
{
Uint32 now;
now = SDL_GetTicks();
while ((SDL_GetTicks() - now) < ms) {
if (mint_present) {
Syield();
}
}
}
/* Data to handle a single periodic alarm */
static SDL_bool timer_installed = SDL_FALSE;
/* This is only called if the event thread is not running */
int
SDL_SYS_TimerInit(void)
{
void *old_stack;
SDL_MintAudio_CheckFpu();
/* Install RunTimer in vbl vector */
old_stack = (void *) Super(0);
timer_installed = !SDL_AtariVblInstall(SDL_ThreadedTimerCheck);
Super(old_stack);
if (!timer_installed) {
return (-1);
}
read_hz200_from_vbl = SDL_TRUE;
return (SDL_SetTimerThreaded(0));
}
void
SDL_SYS_TimerQuit(void)
{
if (timer_installed) {
/* Uninstall RunTimer vbl vector */
void *old_stack = (void *) Super(0);
SDL_AtariVblUninstall(SDL_ThreadedTimerCheck);
Super(old_stack);
timer_installed = SDL_FALSE;
}
read_hz200_from_vbl = SDL_FALSE;
}
int
SDL_SYS_StartTimer(void)
{
SDL_SetError("Internal logic error: MiNT uses vbl timer");
return (-1);
}
void
SDL_SYS_StopTimer(void)
{
return;
}
#endif /* SDL_TIMER_MINT */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
/*
* VBL queue routine
*
* Patrice Mandin
*/
#define _vbl_queue 0x456
#define _hz_200 0x4ba
.text
.globl _SDL_AtariVblInstall
.globl _SDL_AtariVblUninstall
.globl _SDL_MintAudio_hasfpu
/*--- Vector installer ---*/
_SDL_AtariVblInstall:
movel sp@(4),my_vector
lea _my_vbl,a0
clrw vbl_mutex
movel _hz_200.w, _SDL_Atari_hz200
/* Stop interrupts */
movew #0x2700,sr
/* Read vbl_queue pointer */
movel _vbl_queue.w,a1
/* Search a free place */
moveq #7,d0
bcl_search_place:
movel (a1),d1
beqs place_found
addql #4,a1
dbra d0,bcl_search_place
/* Not found */
moveq #1,d0
bras exit_vbl_queue
/* Then install ourselves */
place_found:
movel a0,(a1)
moveq #0,d0
exit_vbl_queue:
/* Restart interrupts */
movew #0x2300,sr
rts
/*--- Vector uninstaller ---*/
_SDL_AtariVblUninstall:
movel sp@(4),d0
cmpl my_vector,d0
bnes badvector
movel #_my_vbl,d0
/* Stop interrupts */
movew #0x2700,sr
/* Read vbl_queue pointer */
movel _vbl_queue.w,a1
/* Search where we are */
moveq #7,d1
bcl2_search_place:
cmpl (a1),d0
bnes next_place
clrl (a1)
moveq #0,d1
next_place:
addql #4,a1
dbra d1,bcl2_search_place
/* Restart interrupts */
movew #0x2300,sr
badvector:
rts
/*--- Our vbl ---*/
_my_vbl:
/* Update _hz_200 */
movel _hz_200.w, _SDL_Atari_hz200
/* Verify if this is not already running */
tstw vbl_mutex
bnes vbl_end
notw vbl_mutex
moveml d0-d7/a0-a6,sp@-
/* Save FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_AtariVbl_nofpu1
.chip 68060
fsave sp@-
fmoveml fpcr/fpsr/fpiar,sp@-
fmovemx fp0-fp7,sp@-
.chip 68000
SDL_AtariVbl_nofpu1:
movel my_vector,a0
jsr a0@
/* Restore FPU if needed */
tstw _SDL_MintAudio_hasfpu
beqs SDL_AtariVbl_Xbios_nofpu2
.chip 68060
fmovemx sp@+,fp0-fp7
fmoveml sp@+,fpcr/fpsr/fpiar
frestore sp@+
.chip 68000
SDL_AtariVbl_Xbios_nofpu2:
moveml sp@+,d0-d7/a0-a6
clrw vbl_mutex
vbl_end:
rts
.data
.even
.comm _SDL_Atari_hz200,4*1
.even
.comm vbl_mutex,2*1
.even
.comm my_vector,4*1
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
* TOS/MiNT timer driver
* based on vbl vector
*
* Patrice Mandin
*/
extern volatile long SDL_Atari_hz200;
/* Functions prototypes */
extern int SDL_AtariVblInstall(void *newvector);
extern void SDL_AtariVblUninstall(void *newvector);
/* vi: set ts=4 sw=4 expandtab: */
...@@ -234,8 +234,6 @@ GL_LoadFunctions(GL_RenderData * data) ...@@ -234,8 +234,6 @@ GL_LoadFunctions(GL_RenderData * data)
{ {
#if defined(__QNXNTO__) && (_NTO_VERSION < 630) #if defined(__QNXNTO__) && (_NTO_VERSION < 630)
#define __SDL_NOGETPROCADDR__ #define __SDL_NOGETPROCADDR__
#elif defined(__MINT__)
#define __SDL_NOGETPROCADDR__
#endif #endif
#ifdef __SDL_NOGETPROCADDR__ #ifdef __SDL_NOGETPROCADDR__
#define SDL_PROC(ret,func,params) data->func=func; #define SDL_PROC(ret,func,params) data->func=func;
......
...@@ -379,12 +379,6 @@ extern VideoBootStrap qnxgf_bootstrap; ...@@ -379,12 +379,6 @@ extern VideoBootStrap qnxgf_bootstrap;
#if SDL_VIDEO_DRIVER_EPOC #if SDL_VIDEO_DRIVER_EPOC
extern VideoBootStrap EPOC_bootstrap; extern VideoBootStrap EPOC_bootstrap;
#endif #endif
#if SDL_VIDEO_DRIVER_XBIOS
extern VideoBootStrap XBIOS_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_GEM
extern VideoBootStrap GEM_bootstrap;
#endif
#if SDL_VIDEO_DRIVER_RISCOS #if SDL_VIDEO_DRIVER_RISCOS
extern VideoBootStrap RISCOS_bootstrap; extern VideoBootStrap RISCOS_bootstrap;
#endif #endif
......
...@@ -88,12 +88,6 @@ static VideoBootStrap *bootstrap[] = { ...@@ -88,12 +88,6 @@ static VideoBootStrap *bootstrap[] = {
#if SDL_VIDEO_DRIVER_EPOC #if SDL_VIDEO_DRIVER_EPOC
&EPOC_bootstrap, &EPOC_bootstrap,
#endif #endif
#if SDL_VIDEO_DRIVER_XBIOS
&XBIOS_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_GEM
&GEM_bootstrap,
#endif
#if SDL_VIDEO_DRIVER_RISCOS #if SDL_VIDEO_DRIVER_RISCOS
&RISCOS_bootstrap, &RISCOS_bootstrap,
#endif #endif
......
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _ATARI_C2P_h
#define _ATARI_C2P_h
#include "SDL_stdinc.h"
/*--- Functions pointers ---*/
/* Convert a chunky screen to bitplane screen */
extern void (*SDL_Atari_C2pConvert) (Uint8 * src, /* Source screen (one byte=one pixel) */
Uint8 * dest, /* Destination (4/8 bits planes) */
Uint32 width, /* Dimensions of screen to convert */
Uint32 height, Uint32 dblligne, /* Double the lines when converting ? */
Uint32 srcpitch, /* Length of one source line in bytes */
Uint32 dstpitch /* Length of one destination line in bytes */
);
/*--- 8 bits functions ---*/
/* Convert a chunky screen to bitplane screen */
void SDL_Atari_C2pConvert8(Uint8 * src, /* Source screen (one byte=one pixel) */
Uint8 * dest, /* Destination (8 bits planes) */
Uint32 width, /* Dimensions of screen to convert */
Uint32 height, Uint32 dblligne, /* Double the lines when converting ? */
Uint32 srcpitch, /* Length of one source line in bytes */
Uint32 dstpitch /* Length of one destination line in bytes */
);
/*--- 4 bits functions ---*/
/* Convert a chunky screen to bitplane screen */
void SDL_Atari_C2pConvert4(Uint8 * src, /* Source screen (one byte=one pixel) */
Uint8 * dest, /* Destination (4 bits planes) */
Uint32 width, /* Dimensions of screen to convert */
Uint32 height, Uint32 dblligne, /* Double the lines when converting ? */
Uint32 srcpitch, /* Length of one source line in bytes */
Uint32 dstpitch /* Length of one destination line in bytes */
);
/* Conversion palette */
void SDL_Atari_C2pConvert4_pal(Uint16 * lightpalette);
#endif /* _ATARI_C2P_h */
/* vi: set ts=4 sw=4 expandtab: */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/*
MiNT /dev/mouse driver
Patrice Mandin
*/
#include <fcntl.h>
#include <unistd.h>
#include "../../events/SDL_events_c.h"
#include "SDL_ataridevmouse_c.h"
/* Defines */
#define DEVICE_NAME "/dev/mouse"
/* Local variables */
static int handle = -1;
static int mouseb, prev_mouseb;
/* Functions */
int
SDL_AtariDevMouse_Open(void)
{
int r;
const char *mousedev;
/*
TODO: Fix the MiNT device driver, that locks mouse for other
applications, so this is disabled till fixed
*/
return 0;
/* First, try SDL_MOUSEDEV device */
mousedev = SDL_getenv("SDL_MOUSEDEV");
if (!mousedev) {
handle = open(mousedev, 0);
}
/* Failed, try default device */
if (handle < 0) {
handle = open(DEVICE_NAME, 0);
}
if (handle < 0) {
handle = -1;
return 0;
}
/* Set non blocking mode */
r = fcntl(handle, F_GETFL, 0);
if (r < 0) {
close(handle);
handle = -1;
return 0;
}
r |= O_NDELAY;
r = fcntl(handle, F_SETFL, r);
if (r < 0) {
close(handle);
handle = -1;
return 0;
}
prev_mouseb = 7;
return 1;
}
void
SDL_AtariDevMouse_Close(void)
{
if (handle > 0) {
close(handle);
handle = -1;
}
}
static int
atari_GetButton(int button)
{
switch (button) {
case 0:
return SDL_BUTTON_RIGHT;
case 1:
return SDL_BUTTON_MIDDLE;
default:
break;
}
return SDL_BUTTON_LEFT;
}
void
SDL_AtariDevMouse_PostMouseEvents(_THIS, SDL_bool buttonEvents)
{
unsigned char buffer[3];
int mousex, mousey;
if (handle < 0) {
return;
}
mousex = mousey = 0;
while (read(handle, buffer, sizeof(buffer)) == sizeof(buffer)) {
mouseb = buffer[0] & 7;
mousex += (char) buffer[1];
mousey += (char) buffer[2];
/* Mouse button events */
if (buttonEvents && (mouseb != prev_mouseb)) {
int i;
for (i = 0; i < 3; i++) {
int curbutton, prevbutton;
curbutton = mouseb & (1 << i);
prevbutton = prev_mouseb & (1 << i);
if (curbutton && !prevbutton) {
SDL_PrivateMouseButton(SDL_RELEASED,
atari_GetButton(i), 0, 0);
}
if (!curbutton && prevbutton) {
SDL_PrivateMouseButton(SDL_PRESSED,
atari_GetButton(i), 0, 0);
}
}
prev_mouseb = mouseb;
}
}
/* Mouse motion event */
if (mousex || mousey) {
SDL_PrivateMouseMotion(0, 1, mousex, -mousey);
}
}
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2009 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
#ifndef _SDL_gemevents_h
#define _SDL_gemevents_h
extern void GEM_PumpEvents(_THIS);
#endif /* _SDL_gemevents_h */
/* vi: set ts=4 sw=4 expandtab: */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment