summaryrefslogtreecommitdiff
path: root/arm9/source/types/readbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/source/types/readbuf.c')
-rw-r--r--arm9/source/types/readbuf.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arm9/source/types/readbuf.c b/arm9/source/types/readbuf.c
new file mode 100644
index 0000000..eaee27a
--- /dev/null
+++ b/arm9/source/types/readbuf.c
@@ -0,0 +1,12 @@
+#include <nds.h>
+#include "readbuf.h"
+
+u8 rb_read(ReadBuf *buf) {
+ u8 output = buf->mem[buf->p];
+ if (output) buf->p++;
+ return output;
+}
+
+void rb_reset(ReadBuf *buf) {
+ buf->p = 0;
+}