aboutsummaryrefslogtreecommitdiff
path: root/c/echo.h
diff options
context:
space:
mode:
authorJavier Degirolmo2012-06-28 10:11:45 -0300
committerJavier Degirolmo2012-06-28 10:11:45 -0300
commitfc04ca30169f7a89616bdbc16d111ce951200f62 (patch)
tree3dc3a61dadc59514e130e757a1292fe4e114405c /c/echo.h
parent1e2de1df171285e370903dcd415c50a25dab4b9b (diff)
Added C devkit :o and some instructions for which files you have to use depending whether you want the asm or C devkit
Diffstat (limited to 'c/echo.h')
-rw-r--r--c/echo.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/c/echo.h b/c/echo.h
new file mode 100644
index 0000000..526e24e
--- /dev/null
+++ b/c/echo.h
@@ -0,0 +1,42 @@
+#ifndef ECHO_H
+#define ECHO_H
+
+/*
+ * Macros used to define instrument lists
+ * Yeah, this thing is a mess
+ */
+#define ECHO_LIST_START(name) \
+ static const unsigned char name[] = {
+#define ECHO_LIST_ENTRY(addr) \
+ ((unsigned long)(addr) >> 8 & 0x7F) | 0x80, \
+ (unsigned long)(addr) & 0xFF, \
+ ((unsigned long)(addr) >> 15 & 0x7F) | \
+ ((unsigned long)(addr) >> 16 & 0x80)),
+#define ECHO_LIST_END \
+ 0x00 };
+
+/* Echo commands */
+enum {
+ ECHO_CMD_NONE, /* 0x00 - No command */
+ ECHO_CMD_LOADLIST, /* 0x01 - Load instrument list */
+ ECHO_CMD_PLAYSFX, /* 0x02 - Play a SFX */
+ ECHO_CMD_STOPSFX, /* 0x03 - Stop SFX playback */
+ ECHO_CMD_PLAYBGM, /* 0x04 - Play a BGM */
+ ECHO_CMD_STOPBGM /* 0x05 - Stop BGM playback */
+};
+
+/* Echo status flags */
+#define ECHO_STAT_BGM 0x0001 /* Background music is playing */
+#define ECHO_STAT_SFX 0x0002 /* Sound effect is playing */
+#define ECHO_STAT_BUSY 0x8000 /* Echo still didn't parse command */
+
+/* Function prototypes */
+void echo_play_bgm(const void *);
+void echo_stop_bgm(void);
+void echo_play_sfx(const void *);
+void echo_stop_sfx(void);
+unsigned short echo_get_status(void);
+void echo_send_command(unsigned char);
+void echo_send_command_ex(unsigned char, const void *);
+
+#endif