Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for sound event handling

+ some little stuf needed by SDL ;)
  • Loading branch information...
commit f4a31c118e36b911a746f1b13d8098b83ddf6aab 1 parent b28ec67
@cebash cebash authored
View
4 psl1ght/include/audio/audio.h
@@ -1,6 +1,7 @@
#pragma once
#include <psl1ght/types.h>
+#include <sys/thread.h>
EXTERN_BEGIN
@@ -40,5 +41,8 @@ int audioPortStop(u32 portNum);
int audioGetPortConfig(u32 portNum, AudioPortConfig *portConfig);
int audioPortClose(u32 portNum);
int audioQuit(void);
+int audioCreateNotifyEventQueue(sys_event_queue_t * queue_id, u64 * queue_key);
+int audioSetNotifyEventQueue( u64 queue_key);
+int audioRemoveNotifyEventQueue( u64 queue_key);
EXTERN_END
View
6 psl1ght/include/psl1ght/lv2/thread.h
@@ -29,3 +29,9 @@ LV2_SYSCALL lv2SemaphoreDestroy(sys_semaphore_t semaid) { return Lv2Syscall1(91,
LV2_SYSCALL lv2SemaphoreWait(sys_semaphore_t semaid, u64 timeout_usec) { return Lv2Syscall2(92, semaid, timeout_usec); }
LV2_SYSCALL lv2SemaphoreTrywait(sys_semaphore_t semaid) { return Lv2Syscall1(93, semaid); }
LV2_SYSCALL lv2SemaphorePost(sys_semaphore_t semaid, s32 count) { return Lv2Syscall2(94, semaid, count); }
+LV2_SYSCALL lv2SemaphoreGetValue(sys_semaphore_t semaid, s32 *count) { return Lv2Syscall2(114, semaid, (u64)count); }
+
+LV2_SYSCALL lv2QEventDestroy(sys_event_queue_t eveid, s32 mode) { return Lv2Syscall2(129, eveid, mode); }
+LV2_SYSCALL lv2QEventRcv(sys_event_queue_t eveid, sys_event_t * sysev, s32 timeout_usec) { return Lv2Syscall3(130, eveid, (u64)sysev, timeout_usec); }
+LV2_SYSCALL lv2QEventDrain(sys_event_queue_t eveid) { return Lv2Syscall1(133, eveid); }
+
View
9 psl1ght/include/sys/thread.h
@@ -106,4 +106,13 @@ s32 sys_lwmutex_lock(sys_lwmutex_t *lwmutex, u64 timeout_usec);
s32 sys_lwmutex_trylock(sys_lwmutex_t *lwmutex);
s32 sys_lwmutex_unlock(sys_lwmutex_t *lwmutex);
+typedef u64 sys_event_queue_t;
+typedef struct sys_event_t {
+ u64 source, data_1, data_2, data_3;
+} sys_event_t;
+
+s32 sys_event_queue_destroy(sys_event_queue_t eveid, s32 mode);
+s32 sys_event_queue_receive(sys_event_queue_t eveid, sys_event_t * event, u64 timeout_usec);
+s32 sys_event_queue_drain(sys_event_queue_t eveid);
+
EXTERN_END
View
20 psl1ght/libc-glue-ppu/source/thread.c
@@ -132,3 +132,23 @@ s32 sys_semaphore_post(sys_semaphore_t semaid, s32 count)
{
return lv2SemaphorePost(semaid, count);
}
+
+s32 sys_semaphore_get_value(sys_semaphore_t semaid, s32 * count)
+{
+ return lv2SemaphoreGetValue(semaid, count);
+}
+
+s32 sys_event_queue_destroy(sys_event_queue_t eveid, s32 mode)
+{
+ return lv2QEventDestroy(eveid, mode);
+}
+s32 sys_event_queue_receive(sys_event_queue_t eveid, sys_event_t * event, u64 timeout_usec)
+{
+ return lv2QEventRcv(eveid, event, timeout_usec);
+}
+
+s32 sys_event_queue_drain(sys_event_queue_t eveid)
+{
+ return lv2QEventDrain(eveid);
+}
+
View
2  psl1ght/sprx/libaudio/exports.h
@@ -6,7 +6,7 @@ EXPORT(audioPortStart, 0x89be28f2);
EXPORT(audioQuit, 0xca5ac370);
EXPORT(audioPortOpen, 0xcd7bc431);
EXPORT(audioSetPortLevel, 0x56dfe179);
-EXPORT(audioCreateNotifyEventQueue, 0x2073b7f6);
+EXPORT(audioCreateNotifyEventQueue, 0x4e13af04);
EXPORT(audioMiscSetAccessoryVolume, 0x31211f6b);
EXPORT(audioSetNotifyEventQueue, 0x377e0cd9);
EXPORT(audioGetPortTimestamp, 0x4109d08c);
Please sign in to comment.
Something went wrong with that request. Please try again.