Move GSXB callback to C source
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401098
This commit is contained in:
parent
d078268df8
commit
ab3f230797
2 changed files with 27 additions and 47 deletions
|
@ -77,6 +77,10 @@ static void Mint_UnlockAudio(_THIS);
|
|||
static int Mint_CheckAudio(_THIS, SDL_AudioSpec *spec);
|
||||
static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec);
|
||||
|
||||
/* GSXB callbacks */
|
||||
static void Mint_GsxbInterrupt(void);
|
||||
static void Mint_GsxbNullInterrupt(void);
|
||||
|
||||
/*--- Audio driver bootstrap functions ---*/
|
||||
|
||||
static int Audio_Available(void)
|
||||
|
@ -180,7 +184,7 @@ static void Mint_CloseAudio(_THIS)
|
|||
Buffoper(0);
|
||||
|
||||
/* Uninstall interrupt */
|
||||
if (NSetinterrupt(2, SI_NONE, SDL_MintAudio_EmptyGsxbInterrupt)<0) {
|
||||
if (NSetinterrupt(2, SI_NONE, Mint_GsxbNullInterrupt)<0) {
|
||||
DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed in close\n"));
|
||||
}
|
||||
|
||||
|
@ -342,7 +346,7 @@ static void Mint_InitAudio(_THIS, SDL_AudioSpec *spec)
|
|||
}
|
||||
|
||||
/* Install interrupt */
|
||||
if (NSetinterrupt(2, SI_PLAY, SDL_MintAudio_GsxbInterrupt)<0) {
|
||||
if (NSetinterrupt(2, SI_PLAY, Mint_GsxbInterrupt)<0) {
|
||||
DEBUG_PRINT((DEBUG_NAME "NSetinterrupt() failed\n"));
|
||||
}
|
||||
|
||||
|
@ -390,3 +394,24 @@ static int Mint_OpenAudio(_THIS, SDL_AudioSpec *spec)
|
|||
|
||||
return(1); /* We don't use threaded audio */
|
||||
}
|
||||
|
||||
static void Mint_GsxbInterrupt(void)
|
||||
{
|
||||
Uint8 *newbuf;
|
||||
|
||||
if (SDL_MintAudio_mutex)
|
||||
return;
|
||||
|
||||
SDL_MintAudio_mutex=1;
|
||||
|
||||
SDL_MintAudio_numbuf ^= 1;
|
||||
SDL_MintAudio_Callback();
|
||||
newbuf = SDL_MintAudio_audiobuf[SDL_MintAudio_numbuf];
|
||||
Setbuffer(0, newbuf, newbuf + SDL_MintAudio_audiosize);
|
||||
|
||||
SDL_MintAudio_mutex=0;
|
||||
}
|
||||
|
||||
static void Mint_GsxbNullInterrupt(void)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
|
||||
.globl _SDL_MintAudio_Callback
|
||||
|
||||
.globl _SDL_MintAudio_GsxbInterrupt
|
||||
.globl _SDL_MintAudio_EmptyGsxbInterrupt
|
||||
.globl _SDL_MintAudio_XbiosInterrupt
|
||||
.globl _SDL_MintAudio_XbiosInterruptMeasureClock
|
||||
.globl _SDL_MintAudio_Dma8Interrupt
|
||||
|
@ -56,49 +54,6 @@
|
|||
#define savptr 0x4a2
|
||||
#define savamt 0x46
|
||||
|
||||
/*--- GSXB interrupt vector ---*/
|
||||
|
||||
.text
|
||||
_SDL_MintAudio_GsxbInterrupt:
|
||||
|
||||
/* Check if we are not already running */
|
||||
tstw _SDL_MintAudio_mutex
|
||||
bnes _SDL_MintAudio_EmptyGsxbInterrupt
|
||||
notw _SDL_MintAudio_mutex
|
||||
|
||||
/* Swap buffers */
|
||||
eorw #1,_SDL_MintAudio_numbuf
|
||||
|
||||
moveml d0-d7/a0-a6,sp@-
|
||||
|
||||
/* Callback */
|
||||
jsr _SDL_MintAudio_Callback
|
||||
|
||||
/* 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
|
||||
|
||||
moveml sp@+,d0-d7/a0-a6
|
||||
|
||||
clrw _SDL_MintAudio_mutex
|
||||
_SDL_MintAudio_EmptyGsxbInterrupt:
|
||||
rts
|
||||
|
||||
/*--- Xbios interrupt vector to measure Falcon external clock ---*/
|
||||
|
||||
_SDL_MintAudio_XbiosInterruptMeasureClock: /* 1 mS */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue