alEvtqNextEvent

This commit is contained in:
Mittenshugg
2020-08-05 23:54:36 -05:00
parent f2cb971f67
commit 2ff0a6aef1
2 changed files with 36 additions and 35 deletions
+36 -2
View File
@@ -4,14 +4,48 @@
#include "types.h"
#include "macros.h"
#include "audio_internal.h"
#include "libultra_internal.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9C90/alEvtqFlushType.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9C90/alEvtqPostEvent.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9C90/alEvtqNextEvent.s")
//GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9C90/alEvtqNextEvent.s")
ALMicroTime alEvtqNextEvent(ALEventQueue *evtq, ALEvent *evt)
{
ALEventListItem *item;
ALMicroTime delta;
OSIntMask mask;
mask = osSetIntMask(OS_IM_NONE);
item = (ALEventListItem *)evtq->allocList.next;
if (item)
{
alUnlink((ALLink *)item);
alCopy(&item->evt, evt, sizeof(*evt));
alLink((ALLink *)item, &evtq->freeList);
delta = item->delta;
}
else
{
/* sct 11/28/95 - If we get here, most like we overflowed the event queue */
/* with non-self-perpetuating events. Eg. if we filled the evtq with volume */
/* events, then when the seqp is told to play it will handle all the events */
/* at once completely emptying out the queue. At this point this problem */
/* must be treated as an out of resource error and the evtq should be increased. */
evt->type = -1;
delta = 0;
}
osSetIntMask(mask);
return delta;
}
//GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9C90/alEvtqNew.s")
void alEvtqNew(ALEventQueue *evtq, ALEventListItem *items, s32 itemCount)
{
s32 i;