summaryrefslogtreecommitdiff
path: root/arm9/source/types/circbuf.h
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/source/types/circbuf.h')
-rw-r--r--arm9/source/types/circbuf.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/arm9/source/types/circbuf.h b/arm9/source/types/circbuf.h
new file mode 100644
index 0000000..305f8bf
--- /dev/null
+++ b/arm9/source/types/circbuf.h
@@ -0,0 +1,16 @@
+#include <nds.h>
+
+#ifndef CIRCBUF_H_
+ #define CIRCBUF_H_
+
+ typedef struct {
+ u8 mem[256];
+ u8 front; // start of buffer, read from here until back
+ u8 back; // end of buffer, write past here until front
+ } CircBuf;
+
+ u8 cb_read_byte(CircBuf *buf);
+ void cb_write_byte(CircBuf *buf, u8 byte);
+ void cb_clear(CircBuf *buf);
+
+#endif