summaryrefslogtreecommitdiff
path: root/opl/opl.h
diff options
context:
space:
mode:
authorSimon Howard2009-05-30 23:24:11 +0000
committerSimon Howard2009-05-30 23:24:11 +0000
commit98ee23f4268dbb1395aa0b2cbfad9f53d1092b33 (patch)
tree1d454e6a78ddccdb629aabad3f647c9242a628b0 /opl/opl.h
parent6e4f6ab9626d81e4106d3ccc974a76d832fdff13 (diff)
downloadchocolate-doom-98ee23f4268dbb1395aa0b2cbfad9f53d1092b33.tar.gz
chocolate-doom-98ee23f4268dbb1395aa0b2cbfad9f53d1092b33.tar.bz2
chocolate-doom-98ee23f4268dbb1395aa0b2cbfad9f53d1092b33.zip
Add initial callback/timer API.
Subversion-branch: /branches/opl-branch Subversion-revision: 1538
Diffstat (limited to 'opl/opl.h')
-rw-r--r--opl/opl.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/opl/opl.h b/opl/opl.h
index 352e6696..515950b1 100644
--- a/opl/opl.h
+++ b/opl/opl.h
@@ -27,6 +27,8 @@
#ifndef OPL_OPL_H
#define OPL_OPL_H
+typedef void (*opl_callback_t)(void *data);
+
typedef enum
{
OPL_REGISTER_PORT = 0,
@@ -72,5 +74,19 @@ void OPL_WritePort(opl_port_t port, unsigned int value);
unsigned int OPL_ReadPort(opl_port_t port);
+// Set a timer callback. After the specified number of milliseconds
+// have elapsed, the callback will be invoked.
+
+void OPL_SetCallback(unsigned int ms, opl_callback_t callback, void *data);
+
+// Begin critical section, during which, OPL callbacks will not be
+// invoked.
+
+void OPL_Lock(void);
+
+// End critical section.
+
+void OPL_Unlock(void);
+
#endif