diff options
Diffstat (limited to 'arm9/source/types/circbuf.h')
-rw-r--r-- | arm9/source/types/circbuf.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arm9/source/types/circbuf.h b/arm9/source/types/circbuf.h index 305f8bf..15b3b63 100644 --- a/arm9/source/types/circbuf.h +++ b/arm9/source/types/circbuf.h @@ -1,16 +1,18 @@ -#include <nds.h> - #ifndef CIRCBUF_H_ #define CIRCBUF_H_ + #include "../bang.h" + + + // A 256-byte circular buffer. 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 + u8 front; // start of buffer, read from here up to back + u8 back; // end of buffer, write past here up to front } CircBuf; - u8 cb_read_byte(CircBuf *buf); - void cb_write_byte(CircBuf *buf, u8 byte); - void cb_clear(CircBuf *buf); - + // Methods. + u8 circbuf_read(CircBuf *buf); + void circbuf_write(CircBuf *buf, u8 byte); + void circbuf_clear(CircBuf *buf); #endif |